Skip to content

Commit

Permalink
Rename rxTypes
Browse files Browse the repository at this point in the history
Version update
  • Loading branch information
unicov committed Sep 3, 2021
1 parent d22366f commit eba87ad
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import PackageDescription

let dependencies: [Package.Dependency] = [
.package(url: "https://github.com/apple/swift-tools-support-core.git", .exact("0.1.5")),
.package(url: "https://github.com/apple/swift-tools-support-core.git", .exact("0.2.3")),
.package(url: "https://github.com/apple/swift-argument-parser", .exact("0.4.3")),
.package(name: "SwiftSyntax", url: "https://github.com/apple/swift-syntax.git", .exact("0.50400.0")),
]
Expand Down
8 changes: 4 additions & 4 deletions Sources/MockoloFramework/Models/VariableModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ final class VariableModel: Model {
var filePath: String = ""
var isStatic = false
var shouldOverride = false
var overrideTypes: [String: String]?
var rxTypes: [String: String]?
var customModifiers: [String: Modifier]?
var modelDescription: String? = nil
var combineType: CombineType?
Expand Down Expand Up @@ -41,7 +41,7 @@ final class VariableModel: Model {
isStatic: Bool,
canBeInitParam: Bool,
offset: Int64,
overrideTypes: [String: String]?,
rxTypes: [String: String]?,
customModifiers: [String: Modifier]?,
modelDescription: String?,
combineType: CombineType?,
Expand All @@ -53,7 +53,7 @@ final class VariableModel: Model {
self.shouldOverride = encloserType == .classType
self.canBeInitParam = canBeInitParam
self.processed = processed
self.overrideTypes = overrideTypes
self.rxTypes = rxTypes
self.customModifiers = customModifiers
self.accessLevel = acl ?? ""
self.attributes = nil
Expand Down Expand Up @@ -91,7 +91,7 @@ final class VariableModel: Model {
if let rxVar = applyRxVariableTemplate(name: identifier,
type: type,
encloser: encloser,
overrideTypes: overrideTypes,
rxTypes: rxTypes,
shouldOverride: shouldOverride,
useMockObservable: useMockObservable,
allowSetCallCount: allowSetCallCount,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ extension VariableDeclSyntax {
isStatic: isStatic,
canBeInitParam: potentialInitParam,
offset: v.offset,
overrideTypes: metadata?.varTypes,
rxTypes: metadata?.varTypes,
customModifiers: metadata?.modifiers,
modelDescription: self.description,
combineType: metadata?.combineTypes?[name] ?? metadata?.combineTypes?["all"],
Expand Down
6 changes: 3 additions & 3 deletions Sources/MockoloFramework/Templates/VariableTemplate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ extension VariableModel {
func applyRxVariableTemplate(name: String,
type: Type,
encloser: String,
overrideTypes: [String: String]?,
rxTypes: [String: String]?,
shouldOverride: Bool,
useMockObservable: Bool,
allowSetCallCount: Bool,
Expand All @@ -180,8 +180,8 @@ extension VariableModel {
let staticSpace = isStatic ? "\(String.static) " : ""
let privateSetSpace = allowSetCallCount ? "" : "\(String.privateSet) "

if let overrideTypes = overrideTypes, !overrideTypes.isEmpty {
let (subjectType, _, subjectVal) = type.parseRxVar(overrides: overrideTypes, overrideKey: name, isInitParam: true)
if let rxTypes = rxTypes, !rxTypes.isEmpty {
let (subjectType, _, subjectVal) = type.parseRxVar(overrides: rxTypes, overrideKey: name, isInitParam: true)
if let underlyingSubjectType = subjectType {

let underlyingSubjectName = "\(name)\(String.subjectSuffix)"
Expand Down
6 changes: 3 additions & 3 deletions Sources/MockoloFramework/Utils/TypeParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,10 @@ public final class Type {

var subjectKind = ""
var underlyingSubjectType = ""
if let overrideTypes = overrides {
if let val = overrideTypes[overrideKey], val.hasSuffix(String.subjectSuffix) {
if let rxTypes = overrides {
if let val = rxTypes[overrideKey], val.hasSuffix(String.subjectSuffix) {
subjectKind = val
} else if let val = overrideTypes["all"], val.hasSuffix(String.subjectSuffix) {
} else if let val = rxTypes["all"], val.hasSuffix(String.subjectSuffix) {
subjectKind = val
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/MockoloFramework/Version.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ public struct Version {
public let value: String

/// The current Mockolo version.
public static let current = Version(value: "1.4.1")
public static let current = Version(value: "1.5.0")
}

0 comments on commit eba87ad

Please sign in to comment.