yk_command 0.5.7 → 0.5.8
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/.idea/sonarlint/issuestore/0/d/0d7a5f844cb7a763c4b02c8788a45a497537e9d4 +0 -0
- data/.idea/sonarlint/issuestore/1/9/19beed89439e4bbf29ca633ebffb0979a334a05d +0 -0
- data/.idea/sonarlint/issuestore/2/2/2264693887a1513e6c4ed16a6231e00d3045ec4e +0 -0
- data/.idea/sonarlint/issuestore/2/4/2461a61a84d866812e64ff95d40bd7836fb136ea +0 -0
- data/.idea/sonarlint/issuestore/2/e/2e113f2d3dc9bee6a98073d85966fbd9773c044f +0 -0
- data/.idea/sonarlint/issuestore/3/4/3423fb39097dbf652818678b749434eb36867bdf +0 -0
- data/.idea/sonarlint/issuestore/4/4/44b7fa1ba50397e71d88bd69389f1ec917165cfb +0 -0
- data/.idea/sonarlint/issuestore/4/6/460ee6442cf29ef54774da00475d1b5a4bd35a75 +0 -0
- data/.idea/sonarlint/issuestore/5/1/512554f10221132e2995f116a1bc380edc569ec4 +0 -0
- data/.idea/sonarlint/issuestore/6/e/6e1b71034e8e2f84d8f8236b269fef92a4a51797 +0 -0
- data/.idea/sonarlint/issuestore/7/1/71fc201a1096db97453882ad1da5120a71f77bb5 +0 -0
- data/.idea/sonarlint/issuestore/7/e/7ed8a0c3d2507e911337de44fdef07f89e35091a +0 -0
- data/.idea/sonarlint/issuestore/9/5/95a45210972238034e9fed522811176fe20117d3 +0 -0
- data/.idea/sonarlint/issuestore/9/7/97c2c9c7adeb7fa2e6ffbf07cba2418868ac9739 +0 -0
- data/.idea/sonarlint/issuestore/9/a/9ac8606ab5816ca6769cd53216a107d7d06ca971 +0 -0
- data/.idea/sonarlint/issuestore/a/6/a67e5ecfa13044750ab8599881f66237821a8b38 +0 -0
- data/.idea/sonarlint/issuestore/a/7/a7f1546c0b6a93fd23b7fc1506b2eb0d13e011c2 +0 -0
- data/.idea/sonarlint/issuestore/a/d/ad7bffefc6248a8f673a10e668a82bdbbe38a3e3 +0 -0
- data/.idea/sonarlint/issuestore/b/a/ba47c112fc95dd748a99abb0290610022df254a7 +0 -0
- data/.idea/sonarlint/issuestore/b/e/be2bfbadd6efe69882507c3a03b1b96c46f3dcbe +0 -0
- data/.idea/sonarlint/issuestore/c/f/cf949c4c054253d95250aa9644f2b805b2aa0d2a +0 -0
- data/.idea/sonarlint/issuestore/d/5/d594a688a538c9bebe38deb974bd46055c65a93c +0 -0
- data/.idea/sonarlint/issuestore/d/e/de3150c01c3a946a6168173c4116741379fe3579 +0 -0
- data/.idea/sonarlint/issuestore/e/5/e5580d669a0c327c5b0897ba7dd8465a3d4db45a +0 -0
- data/.idea/sonarlint/issuestore/e/e/ee825dc90668e04039ee525c5858c5736562c9f5 +0 -0
- data/.idea/sonarlint/issuestore/f/6/f6e109e4c314cef09022792f4b88dd267a682d28 +3 -0
- data/.idea/sonarlint/issuestore/index.pb +53 -0
- data/.idea/yk_command.iml +5 -5
- data/Gemfile.lock +1 -1
- data/lib/yk_command/analyze/analyze.rb +1 -1
- data/lib/yk_command/analyze/request.rb +12 -7
- data/lib/yk_command/commands.rb +31 -1
- data/lib/yk_command/component_manage/component_manage_platform.rb +73 -4
- data/lib/yk_command/gitlab/yk_gitlab.rb +23 -2
- data/lib/yk_command/module/module_handler.rb +1 -4
- data/lib/yk_command/module/yk_module.rb +57 -63
- data/lib/yk_command/project/YKProjectTemplate/NAME.podspec +142 -18
- data/lib/yk_command/project/setup/ConfigureSwift.rb +2 -0
- data/lib/yk_command/project/setup/TemplateConfigurator.rb +8 -4
- data/lib/yk_command/project/simple_project_template/.gitignore +37 -0
- data/lib/yk_command/project/simple_project_template/CODE_OF_CONDUCT.md +40 -0
- data/lib/yk_command/project/simple_project_template/LICENSE +21 -0
- data/lib/yk_command/project/simple_project_template/NAME-osx.podspec +43 -0
- data/lib/yk_command/project/simple_project_template/NAME.podspec +140 -0
- data/lib/yk_command/project/simple_project_template/POD_LICENSE +19 -0
- data/lib/yk_command/project/simple_project_template/POD_README.md +29 -0
- data/lib/yk_command/project/simple_project_template/Pod/Assets/.gitkeep +0 -0
- data/lib/yk_command/project/simple_project_template/Pod/Classes/.gitkeep +0 -0
- data/lib/yk_command/project/simple_project_template/README.md +22 -0
- data/lib/yk_command/project/simple_project_template/configure +13 -0
- data/lib/yk_command/project/simple_project_template/templates/ios/Example/PROJECT/Base.lproj/LaunchScreen.storyboard +31 -0
- data/lib/yk_command/project/simple_project_template/templates/ios/Example/PROJECT/Base.lproj/Main.storyboard +79 -0
- data/lib/yk_command/project/simple_project_template/templates/ios/Example/PROJECT/CPDAppDelegate.h +15 -0
- data/lib/yk_command/project/simple_project_template/templates/ios/Example/PROJECT/CPDAppDelegate.m +46 -0
- data/lib/yk_command/project/simple_project_template/templates/ios/Example/PROJECT/CPDViewController.h +13 -0
- data/lib/yk_command/project/simple_project_template/templates/ios/Example/PROJECT/CPDViewController.m +37 -0
- data/lib/yk_command/project/simple_project_template/templates/ios/Example/PROJECT/Images.xcassets/AppIcon.appiconset/Contents.json +98 -0
- data/lib/yk_command/project/simple_project_template/templates/ios/Example/PROJECT/PROJECT-Info.plist +49 -0
- data/lib/yk_command/project/simple_project_template/templates/ios/Example/PROJECT/PROJECT-Prefix.pch +16 -0
- data/lib/yk_command/project/simple_project_template/templates/ios/Example/PROJECT/en.lproj/InfoPlist.strings +2 -0
- data/lib/yk_command/project/simple_project_template/templates/ios/Example/PROJECT/main.m +17 -0
- data/lib/yk_command/project/simple_project_template/templates/ios/Example/PROJECT.xcodeproj/project.pbxproj +500 -0
- data/lib/yk_command/project/simple_project_template/templates/ios/Example/PROJECT.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/lib/yk_command/project/simple_project_template/templates/ios/Example/PROJECT.xcodeproj/xcshareddata/xcschemes/PROJECT.xcscheme +101 -0
- data/lib/yk_command/project/simple_project_template/templates/ios/Example/Podfile +19 -0
- data/lib/yk_command/project/simple_project_template/templates/ios/Example/Tests/Tests-Info.plist +22 -0
- data/lib/yk_command/project/simple_project_template/templates/ios/Example/Tests/Tests-Prefix.pch +7 -0
- data/lib/yk_command/project/simple_project_template/templates/ios/Example/Tests/Tests.m +9 -0
- data/lib/yk_command/project/simple_project_template/templates/ios/Example/Tests/en.lproj/InfoPlist.strings +2 -0
- data/lib/yk_command/project/simple_project_template/templates/macos-swift/Example/PROJECT/AppDelegate.swift +26 -0
- data/lib/yk_command/project/simple_project_template/templates/macos-swift/Example/PROJECT/Assets.xcassets/AppIcon.appiconset/Contents.json +58 -0
- data/lib/yk_command/project/simple_project_template/templates/macos-swift/Example/PROJECT/Base.lproj/Main.storyboard +717 -0
- data/lib/yk_command/project/simple_project_template/templates/macos-swift/Example/PROJECT/Info.plist +30 -0
- data/lib/yk_command/project/simple_project_template/templates/macos-swift/Example/PROJECT/PROJECT.entitlements +10 -0
- data/lib/yk_command/project/simple_project_template/templates/macos-swift/Example/PROJECT/ViewController.swift +27 -0
- data/lib/yk_command/project/simple_project_template/templates/macos-swift/Example/PROJECT.xcodeproj/project.pbxproj +444 -0
- data/lib/yk_command/project/simple_project_template/templates/macos-swift/Example/PROJECT.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/lib/yk_command/project/simple_project_template/templates/macos-swift/Example/PROJECT.xcodeproj/xcshareddata/xcschemes/PROJECT.xcscheme +103 -0
- data/lib/yk_command/project/simple_project_template/templates/macos-swift/Example/Podfile +11 -0
- data/lib/yk_command/project/simple_project_template/templates/macos-swift/Example/Tests/Info.plist +22 -0
- data/lib/yk_command/project/simple_project_template/templates/macos-swift/Example/Tests/Tests.swift +1 -0
- data/lib/yk_command/project/simple_project_template/templates/swift/Example/PROJECT/AppDelegate.swift +46 -0
- data/lib/yk_command/project/simple_project_template/templates/swift/Example/PROJECT/Base.lproj/LaunchScreen.xib +46 -0
- data/lib/yk_command/project/simple_project_template/templates/swift/Example/PROJECT/Base.lproj/Main.storyboard +86 -0
- data/lib/yk_command/project/simple_project_template/templates/swift/Example/PROJECT/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- data/lib/yk_command/project/simple_project_template/templates/swift/Example/PROJECT/Info.plist +39 -0
- data/lib/yk_command/project/simple_project_template/templates/swift/Example/PROJECT/ViewController.swift +30 -0
- data/lib/yk_command/project/simple_project_template/templates/swift/Example/PROJECT.xcodeproj/project.pbxproj +468 -0
- data/lib/yk_command/project/simple_project_template/templates/swift/Example/PROJECT.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/lib/yk_command/project/simple_project_template/templates/swift/Example/PROJECT.xcodeproj/xcshareddata/xcschemes/PROJECT.xcscheme +117 -0
- data/lib/yk_command/project/simple_project_template/templates/swift/Example/Podfile +20 -0
- data/lib/yk_command/project/simple_project_template/templates/swift/Example/Tests/Info.plist +24 -0
- data/lib/yk_command/project/simple_project_template/templates/swift/Example/Tests/Tests.swift +1 -0
- data/lib/yk_command/project/yk_project.rb +14 -9
- data/lib/yk_command/version.rb +1 -1
- metadata +82 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5bed07804903e12366b92b0c98fea8a499abfc55aadbf0f14cb3464c09817f7e
|
|
4
|
+
data.tar.gz: 97807920ca7352478bfa8115e28622d0d7d71a810ff1fd61d6a43b1090120a70
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 340f24db3d9bd760e94750753e5d8582b7142779c26aa9e8b8f8de18e8293ec956040cc30d71c096638d7fd3fb9d86282064bcabce7f810dd374101f4724dee2
|
|
7
|
+
data.tar.gz: d6d16ade847a43b2d7476ba746040cc015c088e950f30ce85e39da3fbc9133b593212ba03df52fc33d8fed974442a33ac1f5e8689f8909a65169ec1bbf3557a3
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
|
|
2
|
+
8
|
|
3
|
+
Rakefile,4/4/44b7fa1ba50397e71d88bd69389f1ec917165cfb
|
|
4
|
+
[
|
|
5
|
+
+lib/yk_command/project/setup/MessageBank.rb,e/e/ee825dc90668e04039ee525c5858c5736562c9f5
|
|
6
|
+
^
|
|
7
|
+
.lib/yk_command/project/setup/ConfigureSwift.rb,a/7/a7f1546c0b6a93fd23b7fc1506b2eb0d13e011c2
|
|
8
|
+
\
|
|
9
|
+
,lib/yk_command/project/setup/ConfigureiOS.rb,c/f/cf949c4c054253d95250aa9644f2b805b2aa0d2a
|
|
10
|
+
b
|
|
11
|
+
2lib/yk_command/project/setup/ProjectManipulator.rb,f/6/f6e109e4c314cef09022792f4b88dd267a682d28
|
|
12
|
+
v
|
|
13
|
+
Flib/yk_command/project/YKProjectTemplate/templates/ios/Example/Podfile,a/d/ad7bffefc6248a8f673a10e668a82bdbbe38a3e3
|
|
14
|
+
x
|
|
15
|
+
Hlib/yk_command/project/YKProjectTemplate/templates/swift/Example/Podfile,7/e/7ed8a0c3d2507e911337de44fdef07f89e35091a
|
|
16
|
+
~
|
|
17
|
+
Nlib/yk_command/project/YKProjectTemplate/templates/macos-swift/Example/Podfile,2/2/2264693887a1513e6c4ed16a6231e00d3045ec4e
|
|
18
|
+
d
|
|
19
|
+
4lib/yk_command/module/template/objc/PrefixHeader.pch,1/9/19beed89439e4bbf29ca633ebffb0979a334a05d
|
|
20
|
+
b
|
|
21
|
+
2lib/yk_command/module/template/objc/RouterDefine.h,a/6/a67e5ecfa13044750ab8599881f66237821a8b38
|
|
22
|
+
a
|
|
23
|
+
1lib/yk_command/module/template/objc/ToolsHeader.h,9/a/9ac8606ab5816ca6769cd53216a107d7d06ca971
|
|
24
|
+
b
|
|
25
|
+
2lib/yk_command/module/template/objc/VendorHeader.h,b/e/be2bfbadd6efe69882507c3a03b1b96c46f3dcbe
|
|
26
|
+
d
|
|
27
|
+
4lib/yk_command/module/template/objc/RouterRegister.h,4/6/460ee6442cf29ef54774da00475d1b5a4bd35a75
|
|
28
|
+
e
|
|
29
|
+
5lib/yk_command/module/template/objc/ServiceProtocol.h,b/a/ba47c112fc95dd748a99abb0290610022df254a7
|
|
30
|
+
e
|
|
31
|
+
5lib/yk_command/module/template/objc/ServiceRegister.h,3/4/3423fb39097dbf652818678b749434eb36867bdf
|
|
32
|
+
e
|
|
33
|
+
5lib/yk_command/module/template/objc/ServiceRegister.m,0/d/0d7a5f844cb7a763c4b02c8788a45a497537e9d4
|
|
34
|
+
�
|
|
35
|
+
Zlib/yk_command/project/YKProjectTemplate/templates/ios/Example/PROJECT/CPDViewController.m,e/5/e5580d669a0c327c5b0897ba7dd8465a3d4db45a
|
|
36
|
+
�
|
|
37
|
+
]lib/yk_command/project/YKProjectTemplate/templates/swift/Example/PROJECT/ViewController.swift,7/1/71fc201a1096db97453882ad1da5120a71f77bb5
|
|
38
|
+
�
|
|
39
|
+
Wlib/yk_command/project/YKProjectTemplate/templates/ios/Example/PROJECT/CPDAppDelegate.m,2/e/2e113f2d3dc9bee6a98073d85966fbd9773c044f
|
|
40
|
+
d
|
|
41
|
+
4lib/yk_command/module/template/objc/CategoryHeader.h,6/e/6e1b71034e8e2f84d8f8236b269fef92a4a51797
|
|
42
|
+
d
|
|
43
|
+
4lib/yk_command/module/template/objc/RouterRegister.m,d/5/d594a688a538c9bebe38deb974bd46055c65a93c
|
|
44
|
+
g
|
|
45
|
+
7lib/yk_command/module/template/swift/RouterDefine.swift,5/1/512554f10221132e2995f116a1bc380edc569ec4
|
|
46
|
+
7
|
|
47
|
+
Gemfile,d/e/de3150c01c3a946a6168173c4116741379fe3579
|
|
48
|
+
i
|
|
49
|
+
9lib/yk_command/project/YKProjectTemplate/NAME-osx.podspec,9/7/97c2c9c7adeb7fa2e6ffbf07cba2418868ac9739
|
|
50
|
+
e
|
|
51
|
+
5lib/yk_command/project/YKProjectTemplate/NAME.podspec,9/5/95a45210972238034e9fed522811176fe20117d3
|
|
52
|
+
b
|
|
53
|
+
2lib/yk_command/project/YKProjectTemplate/README.md,2/4/2461a61a84d866812e64ff95d40bd7836fb136ea
|
data/.idea/yk_command.iml
CHANGED
|
@@ -80,21 +80,21 @@
|
|
|
80
80
|
<option name="myRootTask">
|
|
81
81
|
<RakeTaskImpl id="rake">
|
|
82
82
|
<subtasks>
|
|
83
|
-
<RakeTaskImpl description="Build yk_command-0.5.
|
|
83
|
+
<RakeTaskImpl description="Build yk_command-0.5.7.gem into the pkg directory" fullCommand="build" id="build" />
|
|
84
84
|
<RakeTaskImpl id="build">
|
|
85
85
|
<subtasks>
|
|
86
|
-
<RakeTaskImpl description="Generate SHA512 checksum if yk_command-0.5.
|
|
86
|
+
<RakeTaskImpl description="Generate SHA512 checksum if yk_command-0.5.7.gem into the checksums directory" fullCommand="build:checksum" id="checksum" />
|
|
87
87
|
</subtasks>
|
|
88
88
|
</RakeTaskImpl>
|
|
89
89
|
<RakeTaskImpl description="Remove any temporary products" fullCommand="clean" id="clean" />
|
|
90
90
|
<RakeTaskImpl description="Remove any generated files" fullCommand="clobber" id="clobber" />
|
|
91
|
-
<RakeTaskImpl description="Build and install yk_command-0.5.
|
|
91
|
+
<RakeTaskImpl description="Build and install yk_command-0.5.7.gem into system gems" fullCommand="install" id="install" />
|
|
92
92
|
<RakeTaskImpl id="install">
|
|
93
93
|
<subtasks>
|
|
94
|
-
<RakeTaskImpl description="Build and install yk_command-0.5.
|
|
94
|
+
<RakeTaskImpl description="Build and install yk_command-0.5.7.gem into system gems without network access" fullCommand="install:local" id="local" />
|
|
95
95
|
</subtasks>
|
|
96
96
|
</RakeTaskImpl>
|
|
97
|
-
<RakeTaskImpl description="Create tag v0.5.
|
|
97
|
+
<RakeTaskImpl description="Create tag v0.5.7 and build and push yk_command-0.5.7.gem to rubygems.org" fullCommand="release[remote]" id="release[remote]" />
|
|
98
98
|
<RakeTaskImpl description="" fullCommand="default" id="default" />
|
|
99
99
|
<RakeTaskImpl description="" fullCommand="release" id="release" />
|
|
100
100
|
<RakeTaskImpl id="release">
|
data/Gemfile.lock
CHANGED
|
@@ -2,30 +2,35 @@ require 'httparty'
|
|
|
2
2
|
module YkCommand
|
|
3
3
|
class Request
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
include HTTParty
|
|
6
6
|
|
|
7
7
|
headers 'Content-Type' => 'application/json'
|
|
8
8
|
|
|
9
9
|
def initialize(config)
|
|
10
10
|
@config = config
|
|
11
|
-
self.class.base_uri @config[:
|
|
11
|
+
self.class.base_uri @config[:local]
|
|
12
|
+
puts "🍉 #{self.class.base_uri}"
|
|
12
13
|
end
|
|
13
14
|
|
|
14
|
-
def upload_app_dependency(project_id,data)
|
|
15
|
+
def upload_app_dependency(project_id, data)
|
|
15
16
|
|
|
16
|
-
self.class.post('/dependency/addDependency', query: { "projectId" => project_id },body: data)
|
|
17
|
+
self.class.post('/dependency/addDependency', query: { "projectId" => project_id }, body: data)
|
|
17
18
|
end
|
|
18
19
|
|
|
19
20
|
def get_project_info(app_project_name)
|
|
20
|
-
self.class.get('/project/projectByName', query: { "name" => app_project_name }
|
|
21
|
+
self.class.get('/project/projectByName', query: { "name" => app_project_name })
|
|
21
22
|
end
|
|
22
23
|
|
|
23
24
|
def upload_app(app_list_data)
|
|
24
|
-
self.class.post('/project/updateAllAppProjects',body: {'data' => app_list_data}.to_json)
|
|
25
|
+
self.class.post('/project/updateAllAppProjects', body: { 'data' => app_list_data }.to_json)
|
|
25
26
|
end
|
|
26
27
|
|
|
27
28
|
def upload_component(data)
|
|
28
|
-
self.class.post('/project/updateAllComponents',body: {'data' => data}.to_json)
|
|
29
|
+
self.class.post('/project/updateAllComponents', body: { 'data' => data }.to_json)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def upload_third_lib_project(data)
|
|
33
|
+
self.class.post('/project/updateAllComponents', body: { 'data' => data }.to_json)
|
|
29
34
|
end
|
|
30
35
|
|
|
31
36
|
end
|
data/lib/yk_command/commands.rb
CHANGED
|
@@ -23,7 +23,14 @@ module YkCommand
|
|
|
23
23
|
method_option :create, aliases: '-c'
|
|
24
24
|
|
|
25
25
|
def create(path = nil)
|
|
26
|
-
YkModule.new(self .args,self .options ).create(path)
|
|
26
|
+
YkModule.new(self .args,self .options ).create(path,false )
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
desc 'create_simple_project <Path>', '在某个路径下交互式生成一个简单的demo项目'
|
|
30
|
+
method_option :create, aliases: '-c'
|
|
31
|
+
|
|
32
|
+
def create_simple_project(path = nil)
|
|
33
|
+
YkModule.new(self .args,self .options ).create(path,true )
|
|
27
34
|
end
|
|
28
35
|
|
|
29
36
|
desc 'dependency <Podfile.lock Path>', '解析Podfile.lock'
|
|
@@ -51,6 +58,29 @@ module YkCommand
|
|
|
51
58
|
|
|
52
59
|
end
|
|
53
60
|
|
|
61
|
+
desc 'platform_create_component ', '创建新的公共组件'
|
|
62
|
+
method_option :platform_create_component, aliases: '-pcc'
|
|
63
|
+
|
|
64
|
+
def platform_create_component(path = nil,name,desc)
|
|
65
|
+
p = ComponentManagePlatform.new
|
|
66
|
+
p.create_new_component(name,desc)
|
|
67
|
+
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
desc 'platform_delete_component ', '删除YKComponents下的组件'
|
|
71
|
+
method_option :platform_delete_component, aliases: '-pcc'
|
|
72
|
+
|
|
73
|
+
def platform_delete_component(name)
|
|
74
|
+
p = ComponentManagePlatform.new
|
|
75
|
+
p.delete_component(name)
|
|
76
|
+
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
54
84
|
|
|
55
85
|
end
|
|
56
86
|
end
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
1
|
require 'yk_command/gitlab/yk_gitlab'
|
|
4
2
|
require 'yk_command/analyze/request'
|
|
5
3
|
require 'yk_command/config/yk_config'
|
|
@@ -14,24 +12,95 @@ module YkCommand
|
|
|
14
12
|
def initialize
|
|
15
13
|
path = __dir__
|
|
16
14
|
config = YkConfig.new path
|
|
17
|
-
@gitlab_srvice =YkGitlab.new(config.read_config GITLAB_CONFIG_FILE)
|
|
15
|
+
@gitlab_srvice = YkGitlab.new(config.read_config GITLAB_CONFIG_FILE)
|
|
18
16
|
@api_service = Request.new(config.read_config SERVER_ENV_CONFIG_FILE)
|
|
19
17
|
end
|
|
20
18
|
|
|
21
19
|
def update_app_data
|
|
22
20
|
data = @gitlab_srvice.get_all_app
|
|
23
21
|
list = data.parsed_response['shared_projects']
|
|
24
|
-
|
|
22
|
+
list.each do |project |
|
|
23
|
+
committers = [];
|
|
24
|
+
commits = @gitlab_srvice.get_project_commits(project["id"],0 ,50 )
|
|
25
|
+
commits.each do |commit|
|
|
26
|
+
committers.push(commit["committer_name"])
|
|
27
|
+
end
|
|
28
|
+
project["committers"] = committers.uniq
|
|
29
|
+
end
|
|
25
30
|
r = @api_service.upload_app(list)
|
|
26
31
|
pp r
|
|
27
32
|
end
|
|
28
33
|
|
|
29
34
|
def update_component_data
|
|
30
35
|
data = @gitlab_srvice.get_all_components
|
|
36
|
+
|
|
31
37
|
list = data.parsed_response['projects']
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
list.each do |project |
|
|
42
|
+
committers = [];
|
|
43
|
+
commits = @gitlab_srvice.get_project_commits(project["id"],0 ,50 )
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
commits.each do |commit|
|
|
47
|
+
committers.push(commit["committer_name"])
|
|
48
|
+
end
|
|
49
|
+
project["committers"] = committers.uniq
|
|
50
|
+
end
|
|
51
|
+
|
|
32
52
|
r = @api_service.upload_component(list)
|
|
33
53
|
pp r
|
|
34
54
|
end
|
|
55
|
+
|
|
56
|
+
def update_third_lib_data
|
|
57
|
+
data = @gitlab_srvice.get_third_party_lib_projects
|
|
58
|
+
list = data.parsed_response['projects']
|
|
59
|
+
r = @api_service.upload_third_lib_project(list)
|
|
60
|
+
pp r
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def create_new_component(name, desc)
|
|
64
|
+
r = @gitlab_srvice.create_project(name, desc)
|
|
65
|
+
if r.response.code == "201"
|
|
66
|
+
pp "创建成功"
|
|
67
|
+
url = r.parsed_response["http_url_to_repo"]
|
|
68
|
+
pp "repo url :#{url}"
|
|
69
|
+
else
|
|
70
|
+
pp "创建失败"
|
|
71
|
+
pp r.parsed_response['message']
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def find_project(name)
|
|
77
|
+
r = @gitlab_srvice.search_project(name)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
def delete_component(name)
|
|
81
|
+
|
|
82
|
+
res = find_project(name)
|
|
83
|
+
id = 0
|
|
84
|
+
res.each do |project_hash|
|
|
85
|
+
if project_hash["namespace"]["id"] == 514 && project_hash["name"] == name
|
|
86
|
+
id = project_hash['id']
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
if id == 0
|
|
91
|
+
pp '未找到相关的工程'
|
|
92
|
+
end
|
|
93
|
+
r = @gitlab_srvice.delete_project(id) unless id == 0
|
|
94
|
+
|
|
95
|
+
if r != nil
|
|
96
|
+
if r.code == 200
|
|
97
|
+
pp "#{name} 成功删除"
|
|
98
|
+
else
|
|
99
|
+
pp "#{name} 删除失败,"
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
|
|
35
104
|
end
|
|
36
105
|
|
|
37
106
|
end
|
|
@@ -26,15 +26,36 @@ module YkCommand
|
|
|
26
26
|
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
def get_third_party_lib_projects
|
|
30
|
+
get_group_projects 873,100,0
|
|
31
|
+
end
|
|
30
32
|
|
|
31
33
|
def get_group_projects(group_id,per_page,page)
|
|
32
34
|
self.class.get("/groups/#{group_id}", query: { "private_token" => @token,"per_page"=> per_page,"page"=> page })
|
|
33
35
|
end
|
|
34
36
|
|
|
35
|
-
|
|
37
|
+
def create_project(name,description)
|
|
38
|
+
self.class.post("/projects", query: { "private_token" => @token },body:{"name" => name,"namespace_id" => 514,"description" => description}.to_json)
|
|
39
|
+
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def get_project_commits(project_id,page,per_page)
|
|
36
43
|
|
|
44
|
+
self.class.get("/projects/#{project_id}/repository/commits", query: { "private_token" => @token,"per_page"=> per_page,"page"=> page })
|
|
37
45
|
|
|
46
|
+
end
|
|
38
47
|
|
|
48
|
+
def search_project(name)
|
|
49
|
+
self.class.get("/projects", query: { "private_token" => @token,"search":name} )
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def delete_project(id)
|
|
53
|
+
self.class.delete("/projects/#{id}", query: { "private_token" => @token })
|
|
54
|
+
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
end
|
|
39
60
|
|
|
40
61
|
end
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
require 'colored'
|
|
3
2
|
require 'fileutils'
|
|
4
3
|
require 'psych'
|
|
@@ -37,14 +36,12 @@ module YkCommand
|
|
|
37
36
|
if File.exist?(@final_path.to_s)
|
|
38
37
|
say "#{@final_path} 已存在:", :red
|
|
39
38
|
else
|
|
40
|
-
construct_project path
|
|
41
|
-
|
|
39
|
+
construct_project path, false
|
|
42
40
|
|
|
43
41
|
end
|
|
44
42
|
end
|
|
45
43
|
|
|
46
|
-
|
|
47
|
-
def read_user_input(desc,ask_prom,now_value,limit)
|
|
44
|
+
def read_user_input(desc, ask_prom, now_value, limit)
|
|
48
45
|
item = ''
|
|
49
46
|
say "#{desc}:", :green
|
|
50
47
|
|
|
@@ -53,19 +50,18 @@ module YkCommand
|
|
|
53
50
|
if input != ''
|
|
54
51
|
item = input
|
|
55
52
|
else
|
|
56
|
-
if now_value!=nil && now_value != ''
|
|
53
|
+
if now_value != nil && now_value != ''
|
|
57
54
|
item = now_value
|
|
58
55
|
else
|
|
59
|
-
say "请正确填写#{desc}"
|
|
60
|
-
item = read_user_input(desc,ask_prom,now_value,limit)
|
|
56
|
+
say "请正确填写#{desc}", :red
|
|
57
|
+
item = read_user_input(desc, ask_prom, now_value, limit)
|
|
61
58
|
end
|
|
62
59
|
|
|
63
60
|
end
|
|
64
61
|
item
|
|
65
62
|
end
|
|
66
63
|
|
|
67
|
-
|
|
68
|
-
def create(path = nil)
|
|
64
|
+
def create(path = nil, simple)
|
|
69
65
|
|
|
70
66
|
path = Dir.pwd if path.nil?
|
|
71
67
|
|
|
@@ -73,16 +69,16 @@ module YkCommand
|
|
|
73
69
|
|
|
74
70
|
config = File.exist?(config_file_path) ? YAML.load_file(config_file_path) : {}
|
|
75
71
|
|
|
76
|
-
project = read_user_input('模块名',"Project name",config[:project],nil
|
|
72
|
+
project = read_user_input('模块名', "Project name", config[:project], nil)
|
|
77
73
|
config[:project] = project
|
|
78
74
|
|
|
79
|
-
language = read_user_input('语言',"Project language",config[:language], ['objc', 'swift', '']
|
|
75
|
+
language = read_user_input('语言', "Project language", config[:language], ['objc', 'swift', ''])
|
|
80
76
|
config[:language] = language
|
|
81
77
|
|
|
82
|
-
class_prefix = read_user_input('类名前缀',"Class prefix",config[:class_prefix],nil
|
|
78
|
+
class_prefix = read_user_input('类名前缀', "Class prefix", config[:class_prefix], nil)
|
|
83
79
|
config[:class_prefix] = class_prefix
|
|
84
80
|
|
|
85
|
-
author = read_user_input('文件作者',"Author",config[:author],nil)
|
|
81
|
+
author = read_user_input('文件作者', "Author", config[:author], nil)
|
|
86
82
|
config[:author] = author
|
|
87
83
|
|
|
88
84
|
# Dir.chdir(path)
|
|
@@ -98,33 +94,36 @@ module YkCommand
|
|
|
98
94
|
@date = Time.now.strftime('%d/%m/%y')
|
|
99
95
|
@lang = config[:language]
|
|
100
96
|
|
|
97
|
+
construct_project path, simple
|
|
101
98
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
end
|
|
99
|
+
end
|
|
105
100
|
|
|
106
|
-
def construct_project(path)
|
|
101
|
+
def construct_project(path, is_simple)
|
|
107
102
|
final_path = "#{path}/#{@name}"
|
|
108
103
|
|
|
109
104
|
if File.exist?(final_path.to_s)
|
|
110
105
|
say "#{final_path} 已存在:", :red
|
|
111
106
|
else
|
|
112
107
|
|
|
113
|
-
YkProject.new.prepare_project(@name
|
|
108
|
+
YkProject.new(is_simple).prepare_project(@name, @lang, @class_prefix, @author, path)
|
|
114
109
|
config = {}
|
|
115
|
-
config[:final_path]
|
|
116
|
-
config[:name]
|
|
117
|
-
config[:project]
|
|
118
|
-
config[:prefixed_module]
|
|
119
|
-
config[:author]
|
|
120
|
-
config[:date]
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
110
|
+
config[:final_path] = final_path
|
|
111
|
+
config[:name] = @name
|
|
112
|
+
config[:project] = @project
|
|
113
|
+
config[:prefixed_module] = @prefixed_module
|
|
114
|
+
config[:author] = @author
|
|
115
|
+
config[:date] = @date
|
|
116
|
+
|
|
117
|
+
if !is_simple== true
|
|
118
|
+
file_handler = ModuleHandler.new([], [], config)
|
|
119
|
+
file_handler.yk_module_folders
|
|
120
|
+
file_handler.yk_template_files
|
|
121
|
+
end
|
|
122
|
+
Dir.chdir("#{final_path}/Example") do
|
|
123
|
+
system 'pod install'
|
|
124
|
+
system "open './#{@name}.xcworkspace'"
|
|
125
|
+
end
|
|
126
|
+
end
|
|
128
127
|
|
|
129
128
|
#
|
|
130
129
|
#
|
|
@@ -137,29 +136,25 @@ module YkCommand
|
|
|
137
136
|
#
|
|
138
137
|
# else
|
|
139
138
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
# config[:language] = language.empty? ? config[:language] || 'objc' : language
|
|
160
|
-
# config[:class_prefix] = class_prefix.empty? ? config[:class_prefix] || '' : class_prefix
|
|
161
|
-
# config[:author] = author.empty? ? config[:author] || '' : author
|
|
162
|
-
|
|
139
|
+
# say '模块名:', :green
|
|
140
|
+
# input_name = ask("Project name [#{config[:project]}] ?")
|
|
141
|
+
# if input_name != ''
|
|
142
|
+
# config[:project] = input_name if input_name != config[:project]
|
|
143
|
+
# else
|
|
144
|
+
# say '请正确填写模块名',:red
|
|
145
|
+
# end
|
|
146
|
+
#
|
|
147
|
+
# say '语言:', :green
|
|
148
|
+
# language = ask("Project language [#{config[:language]}] ?", limited_to: ['objc', 'swift', ''])
|
|
149
|
+
# say '类名前缀:', :green
|
|
150
|
+
# class_prefix = ask("Class prefix [#{config[:class_prefix]}] ?")
|
|
151
|
+
# say '文件作者:', :green
|
|
152
|
+
# author = ask("Author [#{config[:author]}] ?")
|
|
153
|
+
#
|
|
154
|
+
# config[:project] = project.empty? ? config[:project] || '' : project
|
|
155
|
+
# config[:language] = language.empty? ? config[:language] || 'objc' : language
|
|
156
|
+
# config[:class_prefix] = class_prefix.empty? ? config[:class_prefix] || '' : class_prefix
|
|
157
|
+
# config[:author] = author.empty? ? config[:author] || '' : author
|
|
163
158
|
|
|
164
159
|
# end
|
|
165
160
|
|
|
@@ -204,17 +199,16 @@ module YkCommand
|
|
|
204
199
|
|
|
205
200
|
# def prepare_folder
|
|
206
201
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
202
|
+
# host_a = 'yeah'
|
|
203
|
+
# host_b = 'ka'
|
|
204
|
+
# template_repo_url = "http://gitlab.#{host_a}#{host_b}.com/App/iOS/YKComponents/YKProjectTemplate.git"
|
|
205
|
+
# system("git clone #{template_repo_url} #{@final_path}")
|
|
211
206
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
207
|
+
# FileUtils.remove_dir(@final_path, true)
|
|
208
|
+
# FileUtils.cp_r('/Users/imacn24/Documents/dev/YKProjectTemplate', @final_path)
|
|
209
|
+
# FileUtils.remove_dir("#{@final_path}/.git", true)
|
|
215
210
|
# end
|
|
216
211
|
|
|
217
|
-
|
|
218
212
|
end
|
|
219
213
|
end
|
|
220
214
|
end
|