yk_command 0.1.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.idea/vcs.xml +3 -0
- data/.idea/yk_command.iml +41 -5
- data/Gemfile.lock +87 -1
- data/bin/yk_command +8 -0
- data/lib/yk_command/commands.rb +159 -1
- data/lib/yk_command/template/objc/RouterRegister.h +16 -0
- data/lib/yk_command/template/objc/RouterRegister.m +13 -0
- data/lib/yk_command/template/objc/ServiceRegister.h +16 -0
- data/lib/yk_command/template/objc/ServiceRegister.m +13 -0
- data/lib/yk_command/version.rb +1 -1
- data/yk_command.gemspec +3 -1
- metadata +49 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd092ee6d2dff5ae8fd6ebd28051abe07523e6e6972b0ad5f23c7852d36d5a13
|
4
|
+
data.tar.gz: 4606370a6257ddc2cf5082618cfa525291a8be619d96d888ce190743ee6eb0cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 997b9707ed9ef9eeabf2c5d78a60166e90892bf8b40de5b63803dc60bc98a632cd48d367e956286e8d5b25647df2af3b81cf28c68b96f860138dd37965a1c5fa
|
7
|
+
data.tar.gz: 61cc345a8a6f0fc9638e29781af31685f199d86b68652ff1d21cc0ab356fc3f1f2950c66e33abe08209a2c99292a783a77572b20163ae887fb828469930dde76
|
data/.idea/vcs.xml
CHANGED
@@ -2,5 +2,8 @@
|
|
2
2
|
<project version="4">
|
3
3
|
<component name="VcsDirectoryMappings">
|
4
4
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
5
|
+
<mapping directory="$PROJECT_DIR$/CXFApp" vcs="Git" />
|
6
|
+
<mapping directory="$PROJECT_DIR$/CXFAppHome" vcs="Git" />
|
7
|
+
<mapping directory="$PROJECT_DIR$/SUHome3" vcs="Git" />
|
5
8
|
</component>
|
6
9
|
</project>
|
data/.idea/yk_command.iml
CHANGED
@@ -11,37 +11,73 @@
|
|
11
11
|
</content>
|
12
12
|
<orderEntry type="inheritedJdk" />
|
13
13
|
<orderEntry type="sourceFolder" forTests="false" />
|
14
|
+
<orderEntry type="library" scope="PROVIDED" name="CFPropertyList (v3.0.5, RVM: ruby-2.7.2) [gem]" level="application" />
|
15
|
+
<orderEntry type="library" scope="PROVIDED" name="activesupport (v5.2.7, RVM: ruby-2.7.2) [gem]" level="application" />
|
16
|
+
<orderEntry type="library" scope="PROVIDED" name="addressable (v2.8.0, RVM: ruby-2.7.2) [gem]" level="application" />
|
17
|
+
<orderEntry type="library" scope="PROVIDED" name="algoliasearch (v1.27.5, RVM: ruby-2.7.2) [gem]" level="application" />
|
18
|
+
<orderEntry type="library" scope="PROVIDED" name="atomos (v0.1.3, RVM: ruby-2.7.2) [gem]" level="application" />
|
14
19
|
<orderEntry type="library" scope="PROVIDED" name="bundler (v2.2.33, RVM: ruby-2.7.2) [gem]" level="application" />
|
20
|
+
<orderEntry type="library" scope="PROVIDED" name="claide (v1.1.0, RVM: ruby-2.7.2) [gem]" level="application" />
|
21
|
+
<orderEntry type="library" scope="PROVIDED" name="cocoapods (v1.11.3, RVM: ruby-2.7.2) [gem]" level="application" />
|
22
|
+
<orderEntry type="library" scope="PROVIDED" name="cocoapods-core (v1.11.3, RVM: ruby-2.7.2) [gem]" level="application" />
|
23
|
+
<orderEntry type="library" scope="PROVIDED" name="cocoapods-deintegrate (v1.0.5, RVM: ruby-2.7.2) [gem]" level="application" />
|
24
|
+
<orderEntry type="library" scope="PROVIDED" name="cocoapods-downloader (v1.6.1, RVM: ruby-2.7.2) [gem]" level="application" />
|
25
|
+
<orderEntry type="library" scope="PROVIDED" name="cocoapods-plugins (v1.0.0, RVM: ruby-2.7.2) [gem]" level="application" />
|
26
|
+
<orderEntry type="library" scope="PROVIDED" name="cocoapods-search (v1.0.1, RVM: ruby-2.7.2) [gem]" level="application" />
|
27
|
+
<orderEntry type="library" scope="PROVIDED" name="cocoapods-trunk (v1.6.0, RVM: ruby-2.7.2) [gem]" level="application" />
|
28
|
+
<orderEntry type="library" scope="PROVIDED" name="cocoapods-try (v1.2.0, RVM: ruby-2.7.2) [gem]" level="application" />
|
15
29
|
<orderEntry type="library" scope="PROVIDED" name="colored (v1.2, RVM: ruby-2.7.2) [gem]" level="application" />
|
16
30
|
<orderEntry type="library" scope="PROVIDED" name="colored2 (v3.1.2, RVM: ruby-2.7.2) [gem]" level="application" />
|
31
|
+
<orderEntry type="library" scope="PROVIDED" name="concurrent-ruby (v1.1.10, RVM: ruby-2.7.2) [gem]" level="application" />
|
17
32
|
<orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.5.0, RVM: ruby-2.7.2) [gem]" level="application" />
|
33
|
+
<orderEntry type="library" scope="PROVIDED" name="escape (v0.0.4, RVM: ruby-2.7.2) [gem]" level="application" />
|
34
|
+
<orderEntry type="library" scope="PROVIDED" name="ethon (v0.15.0, RVM: ruby-2.7.2) [gem]" level="application" />
|
35
|
+
<orderEntry type="library" scope="PROVIDED" name="ffi (v1.15.5, RVM: ruby-2.7.2) [gem]" level="application" />
|
36
|
+
<orderEntry type="library" scope="PROVIDED" name="fourflusher (v2.3.1, RVM: ruby-2.7.2) [gem]" level="application" />
|
37
|
+
<orderEntry type="library" scope="PROVIDED" name="fuzzy_match (v2.0.4, RVM: ruby-2.7.2) [gem]" level="application" />
|
38
|
+
<orderEntry type="library" scope="PROVIDED" name="gh_inspector (v1.1.3, RVM: ruby-2.7.2) [gem]" level="application" />
|
39
|
+
<orderEntry type="library" scope="PROVIDED" name="httpclient (v2.8.3, RVM: ruby-2.7.2) [gem]" level="application" />
|
40
|
+
<orderEntry type="library" scope="PROVIDED" name="i18n (v1.10.0, RVM: ruby-2.7.2) [gem]" level="application" />
|
41
|
+
<orderEntry type="library" scope="PROVIDED" name="json (v2.6.1, RVM: ruby-2.7.2) [gem]" level="application" />
|
42
|
+
<orderEntry type="library" scope="PROVIDED" name="minitest (v5.15.0, RVM: ruby-2.7.2) [gem]" level="application" />
|
43
|
+
<orderEntry type="library" scope="PROVIDED" name="molinillo (v0.8.0, RVM: ruby-2.7.2) [gem]" level="application" />
|
44
|
+
<orderEntry type="library" scope="PROVIDED" name="nanaimo (v0.3.0, RVM: ruby-2.7.2) [gem]" level="application" />
|
45
|
+
<orderEntry type="library" scope="PROVIDED" name="nap (v1.1.0, RVM: ruby-2.7.2) [gem]" level="application" />
|
46
|
+
<orderEntry type="library" scope="PROVIDED" name="netrc (v0.11.0, RVM: ruby-2.7.2) [gem]" level="application" />
|
47
|
+
<orderEntry type="library" scope="PROVIDED" name="public_suffix (v4.0.6, RVM: ruby-2.7.2) [gem]" level="application" />
|
18
48
|
<orderEntry type="library" scope="PROVIDED" name="rake (v13.0.6, RVM: ruby-2.7.2) [gem]" level="application" />
|
49
|
+
<orderEntry type="library" scope="PROVIDED" name="rexml (v3.2.5, RVM: ruby-2.7.2) [gem]" level="application" />
|
19
50
|
<orderEntry type="library" scope="PROVIDED" name="rspec (v3.11.0, RVM: ruby-2.7.2) [gem]" level="application" />
|
20
51
|
<orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.11.0, RVM: ruby-2.7.2) [gem]" level="application" />
|
21
52
|
<orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.11.0, RVM: ruby-2.7.2) [gem]" level="application" />
|
22
53
|
<orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.11.0, RVM: ruby-2.7.2) [gem]" level="application" />
|
23
54
|
<orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.11.0, RVM: ruby-2.7.2) [gem]" level="application" />
|
55
|
+
<orderEntry type="library" scope="PROVIDED" name="ruby-macho (v2.5.1, RVM: ruby-2.7.2) [gem]" level="application" />
|
24
56
|
<orderEntry type="library" scope="PROVIDED" name="thor (v1.2.1, RVM: ruby-2.7.2) [gem]" level="application" />
|
57
|
+
<orderEntry type="library" scope="PROVIDED" name="thread_safe (v0.3.6, RVM: ruby-2.7.2) [gem]" level="application" />
|
58
|
+
<orderEntry type="library" scope="PROVIDED" name="typhoeus (v1.4.0, RVM: ruby-2.7.2) [gem]" level="application" />
|
59
|
+
<orderEntry type="library" scope="PROVIDED" name="tzinfo (v1.2.9, RVM: ruby-2.7.2) [gem]" level="application" />
|
60
|
+
<orderEntry type="library" scope="PROVIDED" name="xcodeproj (v1.21.0, RVM: ruby-2.7.2) [gem]" level="application" />
|
25
61
|
</component>
|
26
62
|
<component name="RakeTasksCache">
|
27
63
|
<option name="myRootTask">
|
28
64
|
<RakeTaskImpl id="rake">
|
29
65
|
<subtasks>
|
30
|
-
<RakeTaskImpl description="Build yk_command-0.1.
|
66
|
+
<RakeTaskImpl description="Build yk_command-0.1.1.gem into the pkg directory" fullCommand="build" id="build" />
|
31
67
|
<RakeTaskImpl id="build">
|
32
68
|
<subtasks>
|
33
|
-
<RakeTaskImpl description="Generate SHA512 checksum if yk_command-0.1.
|
69
|
+
<RakeTaskImpl description="Generate SHA512 checksum if yk_command-0.1.1.gem into the checksums directory" fullCommand="build:checksum" id="checksum" />
|
34
70
|
</subtasks>
|
35
71
|
</RakeTaskImpl>
|
36
72
|
<RakeTaskImpl description="Remove any temporary products" fullCommand="clean" id="clean" />
|
37
73
|
<RakeTaskImpl description="Remove any generated files" fullCommand="clobber" id="clobber" />
|
38
|
-
<RakeTaskImpl description="Build and install yk_command-0.1.
|
74
|
+
<RakeTaskImpl description="Build and install yk_command-0.1.1.gem into system gems" fullCommand="install" id="install" />
|
39
75
|
<RakeTaskImpl id="install">
|
40
76
|
<subtasks>
|
41
|
-
<RakeTaskImpl description="Build and install yk_command-0.1.
|
77
|
+
<RakeTaskImpl description="Build and install yk_command-0.1.1.gem into system gems without network access" fullCommand="install:local" id="local" />
|
42
78
|
</subtasks>
|
43
79
|
</RakeTaskImpl>
|
44
|
-
<RakeTaskImpl description="Create tag v0.1.
|
80
|
+
<RakeTaskImpl description="Create tag v0.1.1 and build and push yk_command-0.1.1.gem to rubygems.org" fullCommand="release[remote]" id="release[remote]" />
|
45
81
|
<RakeTaskImpl description="" fullCommand="default" id="default" />
|
46
82
|
<RakeTaskImpl description="" fullCommand="release" id="release" />
|
47
83
|
<RakeTaskImpl id="release">
|
data/Gemfile.lock
CHANGED
@@ -1,15 +1,85 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
yk_command (0.1
|
4
|
+
yk_command (0.2.1)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
+
CFPropertyList (3.0.5)
|
10
|
+
rexml
|
11
|
+
activesupport (5.2.7)
|
12
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
13
|
+
i18n (>= 0.7, < 2)
|
14
|
+
minitest (~> 5.1)
|
15
|
+
tzinfo (~> 1.1)
|
16
|
+
addressable (2.8.0)
|
17
|
+
public_suffix (>= 2.0.2, < 5.0)
|
18
|
+
algoliasearch (1.27.5)
|
19
|
+
httpclient (~> 2.8, >= 2.8.3)
|
20
|
+
json (>= 1.5.1)
|
21
|
+
atomos (0.1.3)
|
22
|
+
claide (1.1.0)
|
23
|
+
cocoapods (1.11.3)
|
24
|
+
addressable (~> 2.8)
|
25
|
+
claide (>= 1.0.2, < 2.0)
|
26
|
+
cocoapods-core (= 1.11.3)
|
27
|
+
cocoapods-deintegrate (>= 1.0.3, < 2.0)
|
28
|
+
cocoapods-downloader (>= 1.4.0, < 2.0)
|
29
|
+
cocoapods-plugins (>= 1.0.0, < 2.0)
|
30
|
+
cocoapods-search (>= 1.0.0, < 2.0)
|
31
|
+
cocoapods-trunk (>= 1.4.0, < 2.0)
|
32
|
+
cocoapods-try (>= 1.1.0, < 2.0)
|
33
|
+
colored2 (~> 3.1)
|
34
|
+
escape (~> 0.0.4)
|
35
|
+
fourflusher (>= 2.3.0, < 3.0)
|
36
|
+
gh_inspector (~> 1.0)
|
37
|
+
molinillo (~> 0.8.0)
|
38
|
+
nap (~> 1.0)
|
39
|
+
ruby-macho (>= 1.0, < 3.0)
|
40
|
+
xcodeproj (>= 1.21.0, < 2.0)
|
41
|
+
cocoapods-core (1.11.3)
|
42
|
+
activesupport (>= 5.0, < 7)
|
43
|
+
addressable (~> 2.8)
|
44
|
+
algoliasearch (~> 1.0)
|
45
|
+
concurrent-ruby (~> 1.1)
|
46
|
+
fuzzy_match (~> 2.0.4)
|
47
|
+
nap (~> 1.0)
|
48
|
+
netrc (~> 0.11)
|
49
|
+
public_suffix (~> 4.0)
|
50
|
+
typhoeus (~> 1.0)
|
51
|
+
cocoapods-deintegrate (1.0.5)
|
52
|
+
cocoapods-downloader (1.6.1)
|
53
|
+
cocoapods-plugins (1.0.0)
|
54
|
+
nap
|
55
|
+
cocoapods-search (1.0.1)
|
56
|
+
cocoapods-trunk (1.6.0)
|
57
|
+
nap (>= 0.8, < 2.0)
|
58
|
+
netrc (~> 0.11)
|
59
|
+
cocoapods-try (1.2.0)
|
9
60
|
colored (1.2)
|
10
61
|
colored2 (3.1.2)
|
62
|
+
concurrent-ruby (1.1.10)
|
11
63
|
diff-lcs (1.5.0)
|
64
|
+
escape (0.0.4)
|
65
|
+
ethon (0.15.0)
|
66
|
+
ffi (>= 1.15.0)
|
67
|
+
ffi (1.15.5)
|
68
|
+
fourflusher (2.3.1)
|
69
|
+
fuzzy_match (2.0.4)
|
70
|
+
gh_inspector (1.1.3)
|
71
|
+
httpclient (2.8.3)
|
72
|
+
i18n (1.10.0)
|
73
|
+
concurrent-ruby (~> 1.0)
|
74
|
+
json (2.6.1)
|
75
|
+
minitest (5.15.0)
|
76
|
+
molinillo (0.8.0)
|
77
|
+
nanaimo (0.3.0)
|
78
|
+
nap (1.1.0)
|
79
|
+
netrc (0.11.0)
|
80
|
+
public_suffix (4.0.6)
|
12
81
|
rake (13.0.6)
|
82
|
+
rexml (3.2.5)
|
13
83
|
rspec (3.11.0)
|
14
84
|
rspec-core (~> 3.11.0)
|
15
85
|
rspec-expectations (~> 3.11.0)
|
@@ -23,18 +93,34 @@ GEM
|
|
23
93
|
diff-lcs (>= 1.2.0, < 2.0)
|
24
94
|
rspec-support (~> 3.11.0)
|
25
95
|
rspec-support (3.11.0)
|
96
|
+
ruby-macho (2.5.1)
|
26
97
|
thor (1.2.1)
|
98
|
+
thread_safe (0.3.6)
|
99
|
+
typhoeus (1.4.0)
|
100
|
+
ethon (>= 0.9.0)
|
101
|
+
tzinfo (1.2.9)
|
102
|
+
thread_safe (~> 0.1)
|
103
|
+
xcodeproj (1.21.0)
|
104
|
+
CFPropertyList (>= 2.3.3, < 4.0)
|
105
|
+
atomos (~> 0.1.3)
|
106
|
+
claide (>= 1.0.2, < 2.0)
|
107
|
+
colored2 (~> 3.1)
|
108
|
+
nanaimo (~> 0.3.0)
|
109
|
+
rexml (~> 3.2.4)
|
27
110
|
|
28
111
|
PLATFORMS
|
29
112
|
x86_64-darwin-21
|
30
113
|
|
31
114
|
DEPENDENCIES
|
32
115
|
bundler (~> 2.2.5)
|
116
|
+
cocoapods
|
117
|
+
cocoapods-core
|
33
118
|
colored
|
34
119
|
colored2
|
35
120
|
rake (~> 13.0)
|
36
121
|
rspec (~> 3.2)
|
37
122
|
thor
|
123
|
+
xcodeproj
|
38
124
|
yk_command!
|
39
125
|
|
40
126
|
BUNDLED WITH
|
data/bin/yk_command
ADDED
data/lib/yk_command/commands.rb
CHANGED
@@ -1,14 +1,172 @@
|
|
1
1
|
require 'colored2'
|
2
2
|
require 'thor'
|
3
|
+
require 'fileutils'
|
4
|
+
require 'psych'
|
5
|
+
require 'yaml'
|
3
6
|
|
4
7
|
module YkCommand
|
5
8
|
class CLI < Thor
|
6
9
|
include Thor::Actions
|
7
|
-
|
10
|
+
|
11
|
+
desc 'hello', 'hello a world'
|
8
12
|
method_option :name, aliases: '-n'
|
9
13
|
def hello_world(name)
|
10
14
|
say "hello world #{name}", :yellow
|
11
15
|
end
|
12
16
|
|
17
|
+
CONFIG_FILE = '.YKModuleFilesConfig.yml'
|
18
|
+
|
19
|
+
desc 'read_config', '读取配置'
|
20
|
+
def read_config(path)
|
21
|
+
config_file_path = "#{path}/#{CONFIG_FILE}"
|
22
|
+
config = File.exists?(config_file_path) ? YAML.load_file(config_file_path) : {}
|
23
|
+
|
24
|
+
project = @name
|
25
|
+
say "语言:",:green
|
26
|
+
language = ask("Project language [#{config[:language]}] ?", :limited_to => ["objc", "swift", ""])
|
27
|
+
say "类名前缀:",:green
|
28
|
+
class_prefix = ask("Class prefix [#{config[:class_prefix]}] ?")
|
29
|
+
say "文件作者:",:green
|
30
|
+
author = ask("Author [#{config[:author]}] ?")
|
31
|
+
|
32
|
+
config[:project] = project.empty? ? config[:project] || '' : project
|
33
|
+
config[:language] = language.empty? ? config[:language] || 'objc' : language
|
34
|
+
config[:class_prefix] = class_prefix.empty? ? config[:class_prefix] || '' : class_prefix
|
35
|
+
config[:author] = author.empty? ? config[:author] || '' : author
|
36
|
+
|
37
|
+
File.open(config_file_path, 'w') do |f|
|
38
|
+
f.write config.to_yaml
|
39
|
+
# f.write YAML.to_yaml(config)
|
40
|
+
end
|
41
|
+
|
42
|
+
@module = @name
|
43
|
+
@class_prefix = config[:class_prefix]
|
44
|
+
@prefixed_module = config[:class_prefix] + @module
|
45
|
+
@project = config[:project]
|
46
|
+
@author = config[:author]
|
47
|
+
@date = Time.now.strftime('%d/%m/%y')
|
48
|
+
@lang = config[:language]
|
49
|
+
@prefixed_module = "YK#{@name}"
|
50
|
+
|
51
|
+
end
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
desc 'create', '开始配置'
|
56
|
+
method_option :create, aliases: '-c'
|
57
|
+
def create(path=nil)
|
58
|
+
|
59
|
+
if path == nil
|
60
|
+
path = Dir.pwd
|
61
|
+
end
|
62
|
+
|
63
|
+
say "模块名:",:green
|
64
|
+
|
65
|
+
config_file_path = "#{path}/#{CONFIG_FILE}"
|
66
|
+
|
67
|
+
config = File.exists?(config_file_path) ? YAML.load_file(config_file_path) : {}
|
68
|
+
|
69
|
+
input_name = ask("Project name [#{config[:project]}] ?")
|
70
|
+
if input_name != ""
|
71
|
+
@name = input_name
|
72
|
+
if input_name != config[:project]
|
73
|
+
config[:project] = input_name
|
74
|
+
end
|
75
|
+
else
|
76
|
+
@name = config[:project]
|
77
|
+
end
|
78
|
+
|
79
|
+
File.open(config_file_path, 'w') do |f|
|
80
|
+
f.write config.to_yaml
|
81
|
+
end
|
82
|
+
|
83
|
+
@final_path = "#{path}/#{@name}"
|
84
|
+
|
85
|
+
if File.exist?("#{@final_path}")
|
86
|
+
say "#{@final_path} 已存在:",:red
|
87
|
+
else
|
88
|
+
prepare_folder
|
89
|
+
read_config(path)
|
90
|
+
|
91
|
+
if File.exist?("#{@final_path}/configure")
|
92
|
+
system("#{@final_path}/configure", @name, @lang ,@class_prefix , *@additional_args)
|
93
|
+
else
|
94
|
+
say "Template does not have a configure file", :red
|
95
|
+
end
|
96
|
+
|
97
|
+
yk_module_folders
|
98
|
+
yk_template_files
|
99
|
+
|
100
|
+
end
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
end
|
105
|
+
|
106
|
+
def prepare_folder
|
107
|
+
host_a = "yeah"
|
108
|
+
host_b = "ka"
|
109
|
+
template_repo_url = "http://gitlab.#{host_a}#{host_b}.com/App/iOS/YKComponents/YKProjectTemplate.git"
|
110
|
+
system("git clone #{template_repo_url} #{@final_path}")
|
111
|
+
|
112
|
+
# FileUtils.remove_dir(@final_path, true)
|
113
|
+
# FileUtils.cp_r('/Users/imacn24/Documents/dev/YKProjectTemplate', @final_path)
|
114
|
+
# FileUtils.remove_dir("#{@final_path}/.git", true)
|
115
|
+
|
116
|
+
|
117
|
+
end
|
118
|
+
|
119
|
+
def yk_module_folders
|
120
|
+
|
121
|
+
class_folder_path = "#{@final_path}/#{@name}/Classes"
|
122
|
+
|
123
|
+
first_level_folders = ["Public","Private"]
|
124
|
+
public_level_folders = ["Register"]
|
125
|
+
private_level_folders = ["Category","Vendor","Tools"]
|
126
|
+
|
127
|
+
|
128
|
+
first_level_folders.each do |folder|
|
129
|
+
path = "#{class_folder_path}/#{folder}"
|
130
|
+
empty_directory path
|
131
|
+
end
|
132
|
+
|
133
|
+
public_level_folders.each do |folder|
|
134
|
+
path = "#{class_folder_path}/Public/#{folder}"
|
135
|
+
empty_directory path
|
136
|
+
end
|
137
|
+
|
138
|
+
private_level_folders.each do |folder|
|
139
|
+
path = "#{class_folder_path}/Private/#{folder}"
|
140
|
+
empty_directory path
|
141
|
+
system "touch \"#{path}/EmptyFile.m\""
|
142
|
+
end
|
143
|
+
|
144
|
+
end
|
145
|
+
|
146
|
+
CLI.source_root(File.dirname(__FILE__))
|
147
|
+
|
148
|
+
def yk_template_files
|
149
|
+
register_path = "#{@final_path}/#{@name}/Classes/Public/Register"
|
150
|
+
registger = {
|
151
|
+
'RouterRegister.h' => 'RouterRegister',
|
152
|
+
'RouterRegister.m' => 'RouterRegister',
|
153
|
+
'ServiceRegister.h' => 'ServiceRegister',
|
154
|
+
'ServiceRegister.m' => 'ServiceRegister',
|
155
|
+
}
|
156
|
+
|
157
|
+
|
158
|
+
registger.each do |file_name, folder|
|
159
|
+
final_file = "#{register_path}/#{@prefixed_module}#{file_name}"
|
160
|
+
template "#{__dir__}/template/objc/#{file_name}",final_file
|
161
|
+
end
|
162
|
+
|
163
|
+
Dir.chdir("#{@final_path}/Example") do
|
164
|
+
system "pod install --silent"
|
165
|
+
system "open './#{@name}.xcworkspace'"
|
166
|
+
|
167
|
+
end
|
168
|
+
|
169
|
+
end
|
170
|
+
|
13
171
|
end
|
14
172
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
//
|
2
|
+
// <%= @prefixed_module %>RouterRegister.h
|
3
|
+
// <%= @project %>
|
4
|
+
//
|
5
|
+
// Created by <%= @author %> on <%= @date %>.
|
6
|
+
//
|
7
|
+
//
|
8
|
+
|
9
|
+
#import <Foundation/Foundation.h>
|
10
|
+
|
11
|
+
/**
|
12
|
+
Router Register for the <%= @module %> module.
|
13
|
+
*/
|
14
|
+
@interface <%= @prefixed_module %>RouterRegister : NSObject
|
15
|
+
|
16
|
+
@end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
//
|
2
|
+
// <%= @prefixed_module %>RouterRegister.m
|
3
|
+
// <%= @project %>
|
4
|
+
//
|
5
|
+
// Created by <%= @author %> on <%= @date %>.
|
6
|
+
//
|
7
|
+
//
|
8
|
+
|
9
|
+
#import "<%= @prefixed_module %>RouterRegister.h"
|
10
|
+
|
11
|
+
@implementation <%= @prefixed_module %>RouterRegister
|
12
|
+
|
13
|
+
@end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
//
|
2
|
+
// <%= @prefixed_module %>ServiceRegister.h
|
3
|
+
// <%= @project %>
|
4
|
+
//
|
5
|
+
// Created by <%= @author %> on <%= @date %>.
|
6
|
+
//
|
7
|
+
//
|
8
|
+
|
9
|
+
#import <Foundation/Foundation.h>
|
10
|
+
|
11
|
+
/**
|
12
|
+
Router Register for the <%= @module %> module.
|
13
|
+
*/
|
14
|
+
@interface <%= @prefixed_module %>ServiceRegister : NSObject
|
15
|
+
|
16
|
+
@end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
//
|
2
|
+
// <%= @prefixed_module %>ServiceRegister.m
|
3
|
+
// <%= @project %>
|
4
|
+
//
|
5
|
+
// Created by <%= @author %> on <%= @date %>.
|
6
|
+
//
|
7
|
+
//
|
8
|
+
|
9
|
+
#import "<%= @prefixed_module %>ServiceRegister.h"
|
10
|
+
|
11
|
+
@implementation <%= @prefixed_module %>ServiceRegister
|
12
|
+
|
13
|
+
@end
|
data/lib/yk_command/version.rb
CHANGED
data/yk_command.gemspec
CHANGED
@@ -37,7 +37,9 @@ Gem::Specification.new do |spec|
|
|
37
37
|
spec.add_development_dependency "colored"
|
38
38
|
spec.add_development_dependency "colored2"
|
39
39
|
spec.add_development_dependency "rspec", "~> 3.2"
|
40
|
-
|
40
|
+
spec.add_development_dependency "xcodeproj"
|
41
|
+
spec.add_development_dependency "cocoapods"
|
42
|
+
spec.add_development_dependency "cocoapods-core"
|
41
43
|
|
42
44
|
|
43
45
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yk_command
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Major Tom
|
@@ -80,12 +80,55 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '3.2'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: xcodeproj
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: cocoapods
|
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
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: cocoapods-core
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
83
125
|
description: a longer description or delete this line.
|
84
126
|
email:
|
85
127
|
- v2top1@163.com
|
86
128
|
executables:
|
87
129
|
- console
|
88
130
|
- setup
|
131
|
+
- yk_command
|
89
132
|
extensions: []
|
90
133
|
extra_rdoc_files: []
|
91
134
|
files:
|
@@ -100,8 +143,13 @@ files:
|
|
100
143
|
- Rakefile
|
101
144
|
- bin/console
|
102
145
|
- bin/setup
|
146
|
+
- bin/yk_command
|
103
147
|
- lib/yk_command.rb
|
104
148
|
- lib/yk_command/commands.rb
|
149
|
+
- lib/yk_command/template/objc/RouterRegister.h
|
150
|
+
- lib/yk_command/template/objc/RouterRegister.m
|
151
|
+
- lib/yk_command/template/objc/ServiceRegister.h
|
152
|
+
- lib/yk_command/template/objc/ServiceRegister.m
|
105
153
|
- lib/yk_command/version.rb
|
106
154
|
- sig/yk_command.rbs
|
107
155
|
- yk_command.gemspec
|