vsvipergen 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -0
  3. data/Gemfile.lock +9 -3
  4. data/bin/console +24 -21
  5. data/exe/vsvipergen +27 -22
  6. data/lib/templates/VS<$$>Contracts.h +4 -4
  7. data/lib/templates/VS<$$>Contracts.java +1 -1
  8. data/lib/templates/VS<$$>Contracts.swift +3 -3
  9. data/lib/templates/architecturalDecisionRecordFile/VS<$$>_adr.md +32 -0
  10. data/lib/templates/interactor/VS<$$>Interactor.h +3 -3
  11. data/lib/templates/interactor/VS<$$>Interactor.java +1 -1
  12. data/lib/templates/interactor/VS<$$>Interactor.m +3 -3
  13. data/lib/templates/interactor/VS<$$>Interactor.swift +5 -5
  14. data/lib/templates/model/VS<$$>VO.h +4 -4
  15. data/lib/templates/model/VS<$$>VO.java +2 -2
  16. data/lib/templates/model/VS<$$>VO.m +6 -6
  17. data/lib/templates/model/VS<$$>VO.swift +4 -4
  18. data/lib/templates/presenter/VS<$$>Presenter.h +2 -2
  19. data/lib/templates/presenter/VS<$$>Presenter.java +1 -1
  20. data/lib/templates/presenter/VS<$$>Presenter.m +4 -4
  21. data/lib/templates/presenter/VS<$$>Presenter.swift +3 -3
  22. data/lib/templates/router/VS<$$>Router.h +3 -3
  23. data/lib/templates/router/VS<$$>Router.java +1 -1
  24. data/lib/templates/router/VS<$$>Router.m +3 -3
  25. data/lib/templates/router/VS<$$>Router.swift +3 -3
  26. data/lib/templates/view/VS<$$>Page.java +1 -1
  27. data/lib/templates/view/VS<$$>ViewController.h +3 -3
  28. data/lib/templates/view/VS<$$>ViewController.m +2 -2
  29. data/lib/templates/view/VS<$$>ViewController.swift +2 -2
  30. data/lib/vsvipergen.rb +35 -23
  31. data/lib/vsvipergen/version.rb +1 -1
  32. data/lib/vsvipergen_adr.rb +29 -0
  33. data/lib/vsvipergen_contracts.rb +6 -7
  34. data/lib/vsvipergen_interactor.rb +8 -8
  35. data/lib/vsvipergen_model.rb +16 -12
  36. data/lib/vsvipergen_presenter.rb +8 -8
  37. data/lib/vsvipergen_router.rb +8 -8
  38. data/lib/vsvipergen_view.rb +8 -8
  39. data/vsvipergen.gemspec +3 -2
  40. metadata +21 -5
@@ -4,10 +4,8 @@ require 'vsvipergen'
4
4
  module Vsvipergen
5
5
  # concrete class for VS<$filePrefix$>VO.h, VS<$filePrefix$>VO.m
6
6
  class ViperObjcModelFileGenerator < Generator
7
- attr_accessor :modelPrefix
8
- def init(filePrefix, now, year, modelPrefix)
9
- super(filePrefix, now, year)
10
- @modelPrefix = modelPrefix
7
+ def init(prefix, now, year, projectName, orgName)
8
+ super(prefix, now, year, projectName, orgName)
11
9
  end
12
10
 
13
11
  def makeFiles
@@ -23,13 +21,15 @@ module Vsvipergen
23
21
  subPath = currPath + "/entity"
24
22
  Dir.mkdir(subPath) unless File.exist?(subPath)
25
23
 
26
- newHeaderFilePath = subPath + "/VS#{modelPrefix.strip}VO.h"
24
+ newHeaderFilePath = subPath + "/VS#{prefix.strip}VO.h"
27
25
  generatedFilePaths.push(newHeaderFilePath)
28
26
 
29
27
  templateHeaderFilePath = File.expand_path '../lib/templates/model/VS<$$>VO.h', File.dirname(__FILE__)
30
28
 
31
29
  templateHeaderFileContents = ViperFileReader.new.readFile(templateHeaderFilePath)
32
- templateHeaderFileContents.gsub! "<$modelPrefix$>", modelPrefix.strip
30
+ templateHeaderFileContents.gsub! "<$projectName$>", projectName.strip
31
+ templateHeaderFileContents.gsub! "<$orgName$>", orgName.strip
32
+ templateHeaderFileContents.gsub! "<$prefix$>", prefix.strip
33
33
  templateHeaderFileContents.gsub! "<$now$>", now.strip
34
34
  templateHeaderFileContents.gsub! "<$year$>", year.strip
35
35
  templateHeaderFileContents.gsub! "<$properties$>", "".strip
@@ -41,13 +41,15 @@ module Vsvipergen
41
41
  subPath = currPath + "/entity"
42
42
  Dir.mkdir(subPath) unless File.exist?(subPath)
43
43
 
44
- newImplementFilePath = subPath + "/VS#{modelPrefix.strip}VO.m"
44
+ newImplementFilePath = subPath + "/VS#{prefix.strip}VO.m"
45
45
  generatedFilePaths.push(newImplementFilePath)
46
46
 
47
47
  templateImplementFilePath = File.expand_path '../lib/templates/model/VS<$$>VO.m', File.dirname(__FILE__)
48
48
 
49
49
  templateImplementFileContents = ViperFileReader.new.readFile(templateImplementFilePath)
50
- templateImplementFileContents.gsub! "<$modelPrefix$>", modelPrefix.strip
50
+ templateImplementFileContents.gsub! "<$projectName$>", projectName.strip
51
+ templateImplementFileContents.gsub! "<$orgName$>", orgName.strip
52
+ templateImplementFileContents.gsub! "<$prefix$>", prefix.strip
51
53
  templateImplementFileContents.gsub! "<$now$>", now.strip
52
54
  templateImplementFileContents.gsub! "<$year$>", year.strip
53
55
  templateImplementFileContents.gsub! "<$properties$>", "".strip
@@ -67,13 +69,15 @@ module Vsvipergen
67
69
  subPath = currPath + "/entity"
68
70
  Dir.mkdir(subPath) unless File.exist?(subPath)
69
71
 
70
- newSwiftFilePath = subPath + "/VS#{modelPrefix.strip}VO.swift"
72
+ newSwiftFilePath = subPath + "/VS#{prefix.strip}VO.swift"
71
73
  generatedFilePaths.push(newSwiftFilePath)
72
74
 
73
75
  templateSwiftFilePath = File.expand_path '../lib/templates/model/VS<$$>VO.swift', File.dirname(__FILE__)
74
76
 
75
77
  templateSwiftFileContents = ViperFileReader.new.readFile(templateSwiftFilePath)
76
- templateSwiftFileContents.gsub! "<$modelPrefix$>", modelPrefix.strip
78
+ templateSwiftFileContents.gsub! "<$projectName$>", projectName.strip
79
+ templateSwiftFileContents.gsub! "<$orgName$>", orgName.strip
80
+ templateSwiftFileContents.gsub! "<$prefix$>", prefix.strip
77
81
  templateSwiftFileContents.gsub! "<$now$>", now.strip
78
82
  templateSwiftFileContents.gsub! "<$year$>", year.strip
79
83
  templateSwiftFileContents.gsub! "<$properties$>", "<#property#>".strip
@@ -90,13 +94,13 @@ module Vsvipergen
90
94
  end
91
95
 
92
96
  def makeJavaFile
93
- newJavaFilePath = currPath + "/VS#{modelPrefix.strip}VO.java"
97
+ newJavaFilePath = currPath + "/VS#{prefix.strip}VO.java"
94
98
  generatedFilePaths.push(newJavaFilePath)
95
99
 
96
100
  templateJavaFilePath = File.expand_path '../lib/templates/model/VS<$$>VO.java', File.dirname(__FILE__)
97
101
 
98
102
  templateJavaFileContents = ViperFileReader.new.readFile(templateJavaFilePath)
99
- templateJavaFileContents.gsub! "<$modelPrefix$>", modelPrefix.strip
103
+ templateJavaFileContents.gsub! "<$prefix$>", prefix.strip
100
104
  templateJavaFileContents.gsub! "<$now$>", now.strip
101
105
  templateJavaFileContents.gsub! "<$year$>", year.strip
102
106
  templateJavaFileContents.gsub! "<$properties$>", "".strip
@@ -4,10 +4,8 @@ require 'vsvipergen'
4
4
  module Vsvipergen
5
5
  # concrete class for VS<$filePrefix$>Presenter.h, VS<$filePrefix$>Presenter.m
6
6
  class ViperObjcPresenterFileGenerator < Generator
7
- attr_accessor :modelPrefix
8
- def init(filePrefix, now, year, modelPrefix)
9
- super(filePrefix, now, year)
10
- @modelPrefix = modelPrefix
7
+ def init(prefix, now, year, projectName, orgName)
8
+ super(prefix, now, year, projectName, orgName)
11
9
  end
12
10
 
13
11
  def makeFiles
@@ -29,7 +27,8 @@ module Vsvipergen
29
27
  templateHeaderFilePath = File.expand_path '../lib/templates/Presenter/VS<$$>Presenter.h', File.dirname(__FILE__)
30
28
 
31
29
  templateHeaderFileContents = ViperFileReader.new.readFile(templateHeaderFilePath)
32
- templateHeaderFileContents.gsub! "<$modelPrefix$>", modelPrefix.strip
30
+ templateHeaderFileContents.gsub! "<$projectName$>", projectName.strip
31
+ templateHeaderFileContents.gsub! "<$orgName$>", orgName.strip
33
32
  templateHeaderFileContents.gsub! "<$now$>", now.strip
34
33
  templateHeaderFileContents.gsub! "<$year$>", year.strip
35
34
  templateHeaderFileContents.gsub! "<$prefix$>", prefix.strip
@@ -47,7 +46,8 @@ module Vsvipergen
47
46
  templateImplementFilePath = File.expand_path '../lib/templates/Presenter/VS<$$>Presenter.m', File.dirname(__FILE__)
48
47
 
49
48
  templateImplementFileContents = ViperFileReader.new.readFile(templateImplementFilePath)
50
- templateImplementFileContents.gsub! "<$modelPrefix$>", modelPrefix.strip
49
+ templateImplementFileContents.gsub! "<$projectName$>", projectName.strip
50
+ templateImplementFileContents.gsub! "<$orgName$>", orgName.strip
51
51
  templateImplementFileContents.gsub! "<$now$>", now.strip
52
52
  templateImplementFileContents.gsub! "<$year$>", year.strip
53
53
  templateImplementFileContents.gsub! "<$prefix$>", prefix.strip
@@ -73,7 +73,8 @@ module Vsvipergen
73
73
  templateSwiftFilePath = File.expand_path '../lib/templates/presenter/VS<$$>Presenter.swift', File.dirname(__FILE__)
74
74
 
75
75
  templateSwiftFileContents = ViperFileReader.new.readFile(templateSwiftFilePath)
76
- templateSwiftFileContents.gsub! "<$modelPrefix$>", modelPrefix.strip
76
+ templateSwiftFileContents.gsub! "<$projectName$>", projectName.strip
77
+ templateSwiftFileContents.gsub! "<$orgName$>", orgName.strip
77
78
  templateSwiftFileContents.gsub! "<$now$>", now.strip
78
79
  templateSwiftFileContents.gsub! "<$year$>", year.strip
79
80
  templateSwiftFileContents.gsub! "<$prefix$>", prefix.strip
@@ -96,7 +97,6 @@ module Vsvipergen
96
97
  templateJavaFilePath = File.expand_path '../lib/templates/presenter/VS<$$>Presenter.java', File.dirname(__FILE__)
97
98
 
98
99
  templateJavaFileContents = ViperFileReader.new.readFile(templateJavaFilePath)
99
- templateJavaFileContents.gsub! "<$modelPrefix$>", modelPrefix.strip
100
100
  templateJavaFileContents.gsub! "<$now$>", now.strip
101
101
  templateJavaFileContents.gsub! "<$year$>", year.strip
102
102
  templateJavaFileContents.gsub! "<$prefix$>", prefix.strip
@@ -4,10 +4,8 @@ require 'vsvipergen'
4
4
  module Vsvipergen
5
5
  # concrete class for VS<$filePrefix$>ViewController.h, VS<$filePrefix$>ViewController.m
6
6
  class ViperObjcRouterFileGenerator < Generator
7
- attr_accessor :modelPrefix
8
- def init(filePrefix, now, year, modelPrefix)
9
- super(filePrefix, now, year)
10
- @modelPrefix = modelPrefix
7
+ def init(prefix, now, year, projectName, orgName)
8
+ super(prefix, now, year, projectName, orgName)
11
9
  end
12
10
 
13
11
  def makeFiles
@@ -29,7 +27,8 @@ module Vsvipergen
29
27
  templateHeaderFilePath = File.expand_path '../lib/templates/router/VS<$$>Router.h', File.dirname(__FILE__)
30
28
 
31
29
  templateHeaderFileContents = ViperFileReader.new.readFile(templateHeaderFilePath)
32
- templateHeaderFileContents.gsub! "<$modelPrefix$>", modelPrefix.strip
30
+ templateHeaderFileContents.gsub! "<$projectName$>", projectName.strip
31
+ templateHeaderFileContents.gsub! "<$orgName$>", orgName.strip
33
32
  templateHeaderFileContents.gsub! "<$now$>", now.strip
34
33
  templateHeaderFileContents.gsub! "<$year$>", year.strip
35
34
  templateHeaderFileContents.gsub! "<$prefix$>", prefix.strip
@@ -47,7 +46,8 @@ module Vsvipergen
47
46
  templateImplementFilePath = File.expand_path '../lib/templates/router/VS<$$>Router.m', File.dirname(__FILE__)
48
47
 
49
48
  templateImplementFileContents = ViperFileReader.new.readFile(templateImplementFilePath)
50
- templateImplementFileContents.gsub! "<$modelPrefix$>", modelPrefix.strip
49
+ templateImplementFileContents.gsub! "<$projectName$>", projectName.strip
50
+ templateImplementFileContents.gsub! "<$orgName$>", orgName.strip
51
51
  templateImplementFileContents.gsub! "<$now$>", now.strip
52
52
  templateImplementFileContents.gsub! "<$year$>", year.strip
53
53
  templateImplementFileContents.gsub! "<$prefix$>", prefix.strip
@@ -73,7 +73,8 @@ module Vsvipergen
73
73
  templateSwiftFilePath = File.expand_path '../lib/templates/router/VS<$$>Router.swift', File.dirname(__FILE__)
74
74
 
75
75
  templateSwiftFileContents = ViperFileReader.new.readFile(templateSwiftFilePath)
76
- templateSwiftFileContents.gsub! "<$modelPrefix$>", modelPrefix.strip
76
+ templateSwiftFileContents.gsub! "<$projectName$>", projectName.strip
77
+ templateSwiftFileContents.gsub! "<$orgName$>", orgName.strip
77
78
  templateSwiftFileContents.gsub! "<$now$>", now.strip
78
79
  templateSwiftFileContents.gsub! "<$year$>", year.strip
79
80
  templateSwiftFileContents.gsub! "<$prefix$>", prefix.strip
@@ -96,7 +97,6 @@ module Vsvipergen
96
97
  templateJavaFilePath = File.expand_path '../lib/templates/router/VS<$$>Router.java', File.dirname(__FILE__)
97
98
 
98
99
  templateJavaFileContents = ViperFileReader.new.readFile(templateJavaFilePath)
99
- templateJavaFileContents.gsub! "<$modelPrefix$>", modelPrefix.strip
100
100
  templateJavaFileContents.gsub! "<$now$>", now.strip
101
101
  templateJavaFileContents.gsub! "<$year$>", year.strip
102
102
  templateJavaFileContents.gsub! "<$prefix$>", prefix.strip
@@ -4,10 +4,8 @@ require 'vsvipergen'
4
4
  module Vsvipergen
5
5
  # concrete class for VS<$filePrefix$>ViewController.h, VS<$filePrefix$>ViewController.m
6
6
  class ViperObjcViewControllerFileGenerator < Generator
7
- attr_accessor :modelPrefix
8
- def init(filePrefix, now, year, modelPrefix)
9
- super(filePrefix, now, year)
10
- @modelPrefix = modelPrefix
7
+ def init(prefix, now, year, projectName, orgName)
8
+ super(prefix, now, year, projectName, orgName)
11
9
  end
12
10
 
13
11
  def makeFiles
@@ -29,7 +27,8 @@ module Vsvipergen
29
27
  templateHeaderFilePath = File.expand_path '../lib/templates/view/VS<$$>ViewController.h', File.dirname(__FILE__)
30
28
 
31
29
  templateHeaderFileContents = ViperFileReader.new.readFile(templateHeaderFilePath)
32
- templateHeaderFileContents.gsub! "<$modelPrefix$>", modelPrefix.strip
30
+ templateHeaderFileContents.gsub! "<$projectName$>", projectName.strip
31
+ templateHeaderFileContents.gsub! "<$orgName$>", orgName.strip
33
32
  templateHeaderFileContents.gsub! "<$now$>", now.strip
34
33
  templateHeaderFileContents.gsub! "<$year$>", year.strip
35
34
  templateHeaderFileContents.gsub! "<$prefix$>", prefix.strip
@@ -47,7 +46,8 @@ module Vsvipergen
47
46
  templateImplementFilePath = File.expand_path '../lib/templates/view/VS<$$>ViewController.m', File.dirname(__FILE__)
48
47
 
49
48
  templateImplementFileContents = ViperFileReader.new.readFile(templateImplementFilePath)
50
- templateImplementFileContents.gsub! "<$modelPrefix$>", modelPrefix.strip
49
+ templateImplementFileContents.gsub! "<$projectName$>", projectName.strip
50
+ templateImplementFileContents.gsub! "<$orgName$>", orgName.strip
51
51
  templateImplementFileContents.gsub! "<$now$>", now.strip
52
52
  templateImplementFileContents.gsub! "<$year$>", year.strip
53
53
  templateImplementFileContents.gsub! "<$prefix$>", prefix.strip
@@ -73,7 +73,8 @@ module Vsvipergen
73
73
  templateSwiftFilePath = File.expand_path '../lib/templates/view/VS<$$>ViewController.swift', File.dirname(__FILE__)
74
74
 
75
75
  templateSwiftFileContents = ViperFileReader.new.readFile(templateSwiftFilePath)
76
- templateSwiftFileContents.gsub! "<$modelPrefix$>", modelPrefix.strip
76
+ templateSwiftFileContents.gsub! "<$projectName$>", projectName.strip
77
+ templateSwiftFileContents.gsub! "<$orgName$>", orgName.strip
77
78
  templateSwiftFileContents.gsub! "<$now$>", now.strip
78
79
  templateSwiftFileContents.gsub! "<$year$>", year.strip
79
80
  templateSwiftFileContents.gsub! "<$prefix$>", prefix.strip
@@ -96,7 +97,6 @@ module Vsvipergen
96
97
  templateJavaFilePath = File.expand_path '../lib/templates/view/VS<$$>Page.java', File.dirname(__FILE__)
97
98
 
98
99
  templateJavaFileContents = ViperFileReader.new.readFile(templateJavaFilePath)
99
- templateJavaFileContents.gsub! "<$modelPrefix$>", modelPrefix.strip
100
100
  templateJavaFileContents.gsub! "<$now$>", now.strip
101
101
  templateJavaFileContents.gsub! "<$year$>", year.strip
102
102
  templateJavaFileContents.gsub! "<$prefix$>", prefix.strip
data/vsvipergen.gemspec CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
7
7
  spec.name = "vsvipergen"
8
8
  spec.version = Vsvipergen::VERSION
9
9
  spec.authors = ["vendys-choohyoung"]
10
- spec.email = ["lch@vendys.co.kr"]
10
+ spec.email = ["leechoohyoung@gmail.com"]
11
11
 
12
12
  spec.summary = "cli tool to generating objective-c, swift or java code for viper structure"
13
13
  spec.description = "generating VS<$prefix$>Protocol.h, VS<$prefix$>ViewController.h, VS<$prefix$>ViewController.m, VS<$prefix$>Presenter.h, VS<$prefix$>Presenter.m, VS<$prefix$>Interactor.h, VS<$prefix$>Interactor.m, VS<$prefix$>Router.h, VS<$prefix$>Router.m"
@@ -33,9 +33,10 @@ Gem::Specification.new do |spec|
33
33
  spec.require_paths = ["lib"]
34
34
 
35
35
  spec.add_development_dependency "bundler", "~> 1.16"
36
- spec.add_development_dependency "rake", "~> 10.0"
36
+ spec.add_development_dependency "rake", "~> 13.0"
37
37
  spec.add_development_dependency 'xcodeproj', '~> 1.7.0'
38
38
  spec.add_development_dependency 'colorize', '~> 0.8.1'
39
+ spec.add_development_dependency 'pry', '~> 0.13.1'
39
40
 
40
41
  # spec.add_development_dependency "rpec", "~> 3.0"
41
42
  spec.add_runtime_dependency 'xcodeproj', '~> 1.7.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vsvipergen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - vendys-choohyoung
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-14 00:00:00.000000000 Z
11
+ date: 2021-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '13.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '13.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: xcodeproj
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.8.1
69
+ - !ruby/object:Gem::Dependency
70
+ name: pry
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.13.1
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.13.1
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: xcodeproj
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -98,7 +112,7 @@ description: generating VS<$prefix$>Protocol.h, VS<$prefix$>ViewController.h, VS
98
112
  VS<$prefix$>Presenter.h, VS<$prefix$>Presenter.m, VS<$prefix$>Interactor.h, VS<$prefix$>Interactor.m,
99
113
  VS<$prefix$>Router.h, VS<$prefix$>Router.m
100
114
  email:
101
- - lch@vendys.co.kr
115
+ - leechoohyoung@gmail.com
102
116
  executables:
103
117
  - vsvipergen
104
118
  extensions: []
@@ -117,6 +131,7 @@ files:
117
131
  - lib/templates/VS<$$>Contracts.h
118
132
  - lib/templates/VS<$$>Contracts.java
119
133
  - lib/templates/VS<$$>Contracts.swift
134
+ - lib/templates/architecturalDecisionRecordFile/VS<$$>_adr.md
120
135
  - lib/templates/interactor/VS<$$>Interactor.h
121
136
  - lib/templates/interactor/VS<$$>Interactor.java
122
137
  - lib/templates/interactor/VS<$$>Interactor.m
@@ -139,6 +154,7 @@ files:
139
154
  - lib/templates/view/VS<$$>ViewController.swift
140
155
  - lib/vsvipergen.rb
141
156
  - lib/vsvipergen/version.rb
157
+ - lib/vsvipergen_adr.rb
142
158
  - lib/vsvipergen_contracts.rb
143
159
  - lib/vsvipergen_interactor.rb
144
160
  - lib/vsvipergen_model.rb