molt 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitattributes +2 -0
- data/Gemfile.lock +1 -9
- data/README.md +32 -32
- data/bin/console +2 -2
- data/lib/molt/cli/create_module.rb +8 -3
- data/lib/molt/cli/main.rb +2 -3
- data/lib/molt/cli/setup.rb +1 -0
- data/lib/molt/{configuration.rb → helpers/configuration.rb} +2 -0
- data/lib/molt/{template.rb → helpers/exporter.rb} +1 -1
- data/lib/molt/version.rb +1 -1
- data/lib/molt.rb +2 -5
- data/molt.gemspec +1 -3
- metadata +5 -32
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e3011f13b0f469c8c0de16c3b98bf9a24272ef6a
|
|
4
|
+
data.tar.gz: d9e02d59aa79110500b99e100e1f87476dfbfedb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2740f351b7542e0cf7702f160d8d4e9df107abe18d142ba7dfa0dfd70cde8990105716ed1565b9570693af017acfb69a8e7af8646d04c4895259436849b555a9
|
|
7
|
+
data.tar.gz: 1c10d71fb96e863fd587d09ce85c4d5b4cc11d3fee0d8555ed88d00c69a0a652ddee28dec26bb71271071e547de10690e77ef13404653032df4aa0afc069aa1f
|
data/.gitattributes
ADDED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
molt (0.2.
|
|
4
|
+
molt (0.2.1)
|
|
5
5
|
commander
|
|
6
6
|
liquid (~> 4.0.0)
|
|
7
7
|
terminal-table
|
|
@@ -10,17 +10,11 @@ PATH
|
|
|
10
10
|
GEM
|
|
11
11
|
remote: https://rubygems.org/
|
|
12
12
|
specs:
|
|
13
|
-
awesome_print (1.8.0)
|
|
14
|
-
coderay (1.1.2)
|
|
15
13
|
commander (4.4.4)
|
|
16
14
|
highline (~> 1.7.2)
|
|
17
15
|
diff-lcs (1.3)
|
|
18
16
|
highline (1.7.10)
|
|
19
17
|
liquid (4.0.0)
|
|
20
|
-
method_source (0.9.0)
|
|
21
|
-
pry (0.11.3)
|
|
22
|
-
coderay (~> 1.1.0)
|
|
23
|
-
method_source (~> 0.9.0)
|
|
24
18
|
rake (12.3.0)
|
|
25
19
|
rspec (3.7.0)
|
|
26
20
|
rspec-core (~> 3.7.0)
|
|
@@ -44,10 +38,8 @@ PLATFORMS
|
|
|
44
38
|
ruby
|
|
45
39
|
|
|
46
40
|
DEPENDENCIES
|
|
47
|
-
awesome_print
|
|
48
41
|
bundler (~> 1.16)
|
|
49
42
|
molt!
|
|
50
|
-
pry
|
|
51
43
|
rake
|
|
52
44
|
rspec (~> 3.4)
|
|
53
45
|
|
data/README.md
CHANGED
|
@@ -158,24 +158,24 @@ To list available template sets and the template files they contain:
|
|
|
158
158
|
|
|
159
159
|
## Creating (generating) a module <a name="creation"></a>
|
|
160
160
|
|
|
161
|
-
$ molt create_module Friends
|
|
162
|
-
|
|
163
|
-
| Developer
|
|
164
|
-
| Email
|
|
165
|
-
| Company
|
|
166
|
-
| Project
|
|
167
|
-
|
|
|
168
|
-
| Template Set
|
|
169
|
-
|
|
|
170
|
-
| Source
|
|
171
|
-
|
|
|
172
|
-
|
|
|
173
|
-
|
|
|
174
|
-
|
|
|
175
|
-
|
|
|
176
|
-
|
|
|
177
|
-
|
|
|
178
|
-
|
|
161
|
+
$ molt create_module Friends VIPER_TableView
|
|
162
|
+
+-------------------------------------------------------------+-------------------------------------------------------+
|
|
163
|
+
| Developer | Tom Hagen |
|
|
164
|
+
| Email | tom@omerta.org |
|
|
165
|
+
| Company | Genco Olive Oil Imports |
|
|
166
|
+
| Project | CapoRegime |
|
|
167
|
+
| | |
|
|
168
|
+
| Template Set | VIPER_TableView |
|
|
169
|
+
| | |
|
|
170
|
+
| Source | Destination |
|
|
171
|
+
| VIPER_TableView/Protocols.swift.liquid | ./Friends/FriendsProtocols.swift |
|
|
172
|
+
| VIPER_TableView/Presenter.swift.liquid | ./Friends/FriendsPresenter.swift |
|
|
173
|
+
| VIPER_TableView/DataManagers/RemoteDataManager.swift.liquid | ./Friends/DataManagers/FriendsRemoteDataManager.swift |
|
|
174
|
+
| VIPER_TableView/DataManagers/LocalDataManager.swift.liquid | ./Friends/DataManagers/FriendsLocalDataManager.swift |
|
|
175
|
+
| VIPER_TableView/View.swift.liquid | ./Friends/FriendsView.swift |
|
|
176
|
+
| VIPER_TableView/Wireframe.swift.liquid | ./Friends/FriendsWireframe.swift |
|
|
177
|
+
| VIPER_TableView/Interactor.swift.liquid | ./Friends/FriendsInteractor.swift |
|
|
178
|
+
+-------------------------------------------------------------+-------------------------------------------------------+
|
|
179
179
|
|
|
180
180
|
That was just a dry-run. If this looks good to you, don't forget to add --do-it
|
|
181
181
|
|
|
@@ -199,23 +199,23 @@ Note that generating a new module will never touch your Xcode project, but it's
|
|
|
199
199
|
|
|
200
200
|
## Exporting template sets as Xcode templates <a name="xcode"></a>
|
|
201
201
|
|
|
202
|
-
$ molt xcode
|
|
203
|
-
|
|
204
|
-
| Template Set
|
|
205
|
-
|
|
|
206
|
-
| Source
|
|
207
|
-
|
|
|
208
|
-
|
|
|
209
|
-
|
|
|
210
|
-
|
|
|
211
|
-
|
|
|
212
|
-
|
|
|
213
|
-
|
|
|
214
|
-
|
|
202
|
+
$ molt xcode VIPER_TableView
|
|
203
|
+
+-------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+
|
|
204
|
+
| Template Set | VIPER_TableView |
|
|
205
|
+
| | |
|
|
206
|
+
| Source | Destination |
|
|
207
|
+
| VIPER_TableView/Protocols.swift.liquid | ~/Library/Developer/Xcode/Templates/File Templates/Molt/VIPER TableView.xctemplate/___FILEBASENAME___Protocols.swift |
|
|
208
|
+
| VIPER_TableView/Presenter.swift.liquid | ~/Library/Developer/Xcode/Templates/File Templates/Molt/VIPER TableView.xctemplate/___FILEBASENAME___Presenter.swift |
|
|
209
|
+
| VIPER_TableView/DataManagers/RemoteDataManager.swift.liquid | ~/Library/Developer/Xcode/Templates/File Templates/Molt/VIPER TableView.xctemplate/___FILEBASENAME___RemoteDataManager.swift |
|
|
210
|
+
| VIPER_TableView/DataManagers/LocalDataManager.swift.liquid | ~/Library/Developer/Xcode/Templates/File Templates/Molt/VIPER TableView.xctemplate/___FILEBASENAME___LocalDataManager.swift |
|
|
211
|
+
| VIPER_TableView/View.swift.liquid | ~/Library/Developer/Xcode/Templates/File Templates/Molt/VIPER TableView.xctemplate/___FILEBASENAME___View.swift |
|
|
212
|
+
| VIPER_TableView/Wireframe.swift.liquid | ~/Library/Developer/Xcode/Templates/File Templates/Molt/VIPER TableView.xctemplate/___FILEBASENAME___Wireframe.swift |
|
|
213
|
+
| VIPER_TableView/Interactor.swift.liquid | ~/Library/Developer/Xcode/Templates/File Templates/Molt/VIPER TableView.xctemplate/___FILEBASENAME___Interactor.swift |
|
|
214
|
+
+-------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+
|
|
215
215
|
|
|
216
216
|
This command basically exports a template set and makes it available as an Xcode template, which makes your often-used template instantly available from within Xcode itself. When you do create a new file from within Xcode, you will be prompted for the module name and the model. Other meta details normally available in `create_module` won't be necessary during the export.
|
|
217
217
|
|
|
218
|
-
## Notes about the bundled `
|
|
218
|
+
## Notes about the bundled `VIPER_TableView` template set <a name="notes"></a>
|
|
219
219
|
|
|
220
220
|
1. The `RemoteDataManager` makes use of `Alamofire` and `ObjectMapper`
|
|
221
221
|
2. The `LocalDataManager` makes use of `Core Data`
|
data/bin/console
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
require "liquid"
|
|
2
|
+
require "molt/helpers/configuration"
|
|
3
|
+
require "molt/helpers/exporter"
|
|
4
|
+
|
|
1
5
|
module Molt::CLI
|
|
2
6
|
class Generator
|
|
3
7
|
|
|
@@ -23,6 +27,7 @@ module Molt::CLI
|
|
|
23
27
|
|
|
24
28
|
Dir["#{sets}/#{template_set}/**/*swift.liquid"].each do |template_file|
|
|
25
29
|
template_base_folder = File.dirname(template_file).gsub(/#{sets}\/#{template_set}/, "")
|
|
30
|
+
|
|
26
31
|
destination_folder = "#{options.output_folder}/#{module_name}#{template_base_folder}" if !xcode
|
|
27
32
|
destination_folder = File.expand_path("~/Library/Developer/Xcode/Templates/File Templates/Molt/#{template_set.gsub(/_/, " ")}.xctemplate") if xcode
|
|
28
33
|
|
|
@@ -33,8 +38,8 @@ module Molt::CLI
|
|
|
33
38
|
|
|
34
39
|
if options.do_it
|
|
35
40
|
FileUtils.mkdir_p destination_folder
|
|
36
|
-
FileUtils.cp Dir.glob("#{Molt::ROOT}/sample_configs/Template*"), destination_folder
|
|
37
|
-
Molt::
|
|
41
|
+
FileUtils.cp Dir.glob("#{Molt::ROOT}/sample_configs/Template*"), destination_folder if xcode
|
|
42
|
+
Molt::Exporter.liquify(template: template_file, output_file: output_file, config: config)
|
|
38
43
|
end
|
|
39
44
|
end
|
|
40
45
|
|
|
@@ -50,7 +55,7 @@ module Molt::CLI
|
|
|
50
55
|
|
|
51
56
|
if options.do_it
|
|
52
57
|
FileUtils.mkdir_p destination_folder
|
|
53
|
-
Molt::
|
|
58
|
+
Molt::Exporter.liquify(template: template_file, output_file: output_file, config: config)
|
|
54
59
|
end
|
|
55
60
|
end
|
|
56
61
|
end
|
data/lib/molt/cli/main.rb
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
require "commander"
|
|
2
2
|
require "fileutils"
|
|
3
|
-
require "liquid"
|
|
4
3
|
require "terminal-table"
|
|
5
|
-
require "
|
|
4
|
+
require "generamba/string-colorize.rb"
|
|
6
5
|
|
|
7
6
|
require "molt/cli/setup"
|
|
8
7
|
require "molt/cli/template_sets"
|
|
@@ -78,7 +77,7 @@ module Molt::CLI
|
|
|
78
77
|
Molt::CLI::Generator.create_module("", args[0], options, true)
|
|
79
78
|
end
|
|
80
79
|
end
|
|
81
|
-
alias_command :'
|
|
80
|
+
alias_command :'x', :xcode
|
|
82
81
|
end
|
|
83
82
|
end
|
|
84
83
|
end
|
data/lib/molt/cli/setup.rb
CHANGED
data/lib/molt/version.rb
CHANGED
data/lib/molt.rb
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
require "molt/version"
|
|
2
|
-
require "molt/
|
|
3
|
-
require "molt/template"
|
|
4
|
-
require "molt/cli/main"
|
|
5
|
-
require "generamba/string-colorize"
|
|
1
|
+
require "molt/version.rb"
|
|
2
|
+
require "molt/cli/main.rb"
|
|
6
3
|
|
|
7
4
|
module Molt
|
|
8
5
|
ROOT = File.expand_path(File.join(File.dirname(__FILE__), ".."))
|
data/molt.gemspec
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
lib = File.expand_path("../lib", __FILE__)
|
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
3
|
require "molt/version"
|
|
@@ -15,6 +14,7 @@ Gem::Specification.new do |spec|
|
|
|
15
14
|
|
|
16
15
|
spec.required_ruby_version = ">= 2.2"
|
|
17
16
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|sample_output)/}) }
|
|
17
|
+
|
|
18
18
|
spec.bindir = "bin"
|
|
19
19
|
spec.executables = ["molt"]
|
|
20
20
|
spec.require_paths = ["lib"]
|
|
@@ -24,9 +24,7 @@ Gem::Specification.new do |spec|
|
|
|
24
24
|
spec.add_runtime_dependency 'terminal-table'
|
|
25
25
|
spec.add_runtime_dependency "thor", "~> 0.20"
|
|
26
26
|
|
|
27
|
-
spec.add_development_dependency "awesome_print"
|
|
28
27
|
spec.add_development_dependency "bundler", "~> 1.16"
|
|
29
|
-
spec.add_development_dependency "pry"
|
|
30
28
|
spec.add_development_dependency "rake"
|
|
31
29
|
spec.add_development_dependency "rspec", "~> 3.4"
|
|
32
30
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: molt
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Marco Cabazal
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-02-
|
|
11
|
+
date: 2018-02-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: commander
|
|
@@ -66,20 +66,6 @@ dependencies:
|
|
|
66
66
|
- - "~>"
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: '0.20'
|
|
69
|
-
- !ruby/object:Gem::Dependency
|
|
70
|
-
name: awesome_print
|
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
|
72
|
-
requirements:
|
|
73
|
-
- - ">="
|
|
74
|
-
- !ruby/object:Gem::Version
|
|
75
|
-
version: '0'
|
|
76
|
-
type: :development
|
|
77
|
-
prerelease: false
|
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
-
requirements:
|
|
80
|
-
- - ">="
|
|
81
|
-
- !ruby/object:Gem::Version
|
|
82
|
-
version: '0'
|
|
83
69
|
- !ruby/object:Gem::Dependency
|
|
84
70
|
name: bundler
|
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -94,20 +80,6 @@ dependencies:
|
|
|
94
80
|
- - "~>"
|
|
95
81
|
- !ruby/object:Gem::Version
|
|
96
82
|
version: '1.16'
|
|
97
|
-
- !ruby/object:Gem::Dependency
|
|
98
|
-
name: pry
|
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
|
100
|
-
requirements:
|
|
101
|
-
- - ">="
|
|
102
|
-
- !ruby/object:Gem::Version
|
|
103
|
-
version: '0'
|
|
104
|
-
type: :development
|
|
105
|
-
prerelease: false
|
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
-
requirements:
|
|
108
|
-
- - ">="
|
|
109
|
-
- !ruby/object:Gem::Version
|
|
110
|
-
version: '0'
|
|
111
83
|
- !ruby/object:Gem::Dependency
|
|
112
84
|
name: rake
|
|
113
85
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -145,6 +117,7 @@ extensions: []
|
|
|
145
117
|
extra_rdoc_files: []
|
|
146
118
|
files:
|
|
147
119
|
- ".circleci/config.yml"
|
|
120
|
+
- ".gitattributes"
|
|
148
121
|
- ".gitignore"
|
|
149
122
|
- ".rspec"
|
|
150
123
|
- ".travis.yml"
|
|
@@ -186,8 +159,8 @@ files:
|
|
|
186
159
|
- lib/molt/cli/main.rb
|
|
187
160
|
- lib/molt/cli/setup.rb
|
|
188
161
|
- lib/molt/cli/template_sets.rb
|
|
189
|
-
- lib/molt/configuration.rb
|
|
190
|
-
- lib/molt/
|
|
162
|
+
- lib/molt/helpers/configuration.rb
|
|
163
|
+
- lib/molt/helpers/exporter.rb
|
|
191
164
|
- lib/molt/version.rb
|
|
192
165
|
- molt.gemspec
|
|
193
166
|
- sample_configs/TemplateIcon.png
|