jmpod 0.1.1 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b21621ee5d1c8aac0e168dedc6fa43e2da8af465ca3a135ecb180c5c894d024a
4
- data.tar.gz: fc792eda400dfd075dd7737d28d7b4ce9572f453310a3ee5dc0345a839f45c61
3
+ metadata.gz: 2af0852f050b2a632032d245b33586aad40b9732649266ff63f2585143cef452
4
+ data.tar.gz: 5569dfd88899fb8e41f7197500d452b8cb4fe283879be88b74d9fde1cbceb86f
5
5
  SHA512:
6
- metadata.gz: e8d05a3452a94b98736879e7cbe0d3251e24a60353048d6555d26be8f30a6dc11658f17bf3ceb3d8a50e3ea50d2b432b60cfc2bdf924560c25f9256e62a39a3e
7
- data.tar.gz: 92ba059ccfc48c048ed8ef46082f09f21c716f4681b47bb0166b988dcd1f23a0271ecae3604656741dda6de046649694fd80ac4880823ed46462326f00afb6b5
6
+ metadata.gz: 58665a6990d0e229e941019b0df7088258f6389a5eb1970c4744f59e8b9969ae57cc8c685092a108ec55146ea29871b798572bbc0c298daa7e00f01f1d92fa25
7
+ data.tar.gz: 3431e264b60b0a406c52bd006ca2daa386917109b42a5adacd42c70fa394a23c1a900f99d5bb5c2860804cc0743dc0ee32f6547daa71374cf7851eb25ae7135d
data/Gemfile CHANGED
@@ -1,6 +1,5 @@
1
- source "https://rubygems.org"
1
+ # gem 国内源
2
+ source "https://ruby-china.org"
2
3
 
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
-
5
- # Specify your gem's dependencies in jmpod.gemspec
4
+ # 依赖项 --> 引用spec文件里的依赖
6
5
  gemspec
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jmpod (0.1.0)
4
+ jmpod (0.1.1)
5
5
  claide (>= 1.0.2, < 2.0)
6
6
  cocoapods (>= 1.8.4)
7
7
  colored2 (~> 3.1)
data/jmpod.gemspec CHANGED
@@ -29,13 +29,21 @@ Gem::Specification.new do |spec|
29
29
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
30
30
  end
31
31
  spec.bindir = "bin"
32
+ # 可执行文件
32
33
  spec.executables = %w{ jmpod }
33
34
  spec.require_paths = %w{ lib }
34
35
 
36
+ # 生产依赖
37
+ # spec.add_dependency
38
+
39
+ # 开发依赖
35
40
  spec.add_development_dependency "bundler", "~> 1.17"
36
41
  spec.add_development_dependency "rake", "~> 10.0"
42
+
43
+ # 运行时依赖
37
44
  spec.add_runtime_dependency "claide", ">= 1.0.2", "< 2.0"
38
45
  spec.add_runtime_dependency "molinillo", "~> 0.6.6"
39
46
  spec.add_runtime_dependency "colored2", "~> 3.1"
40
47
  spec.add_runtime_dependency "cocoapods", ">= 1.8.4"
48
+
41
49
  end
@@ -3,11 +3,9 @@ module Jmpod
3
3
  class Create < Command
4
4
  class Oc < Create
5
5
 
6
-
7
-
8
6
  self.summary = '创建一个oc库'
9
7
  self.description = <<-DESC
10
- 创建一个oc pod 库.
8
+ 创建一个oc pod 库, 包含unit、ci、fastlane,podrepopush 等文件.
11
9
  DESC
12
10
 
13
11
  self.arguments = [
@@ -16,6 +14,7 @@ module Jmpod
16
14
 
17
15
  def initialize(argv)
18
16
  @name = argv.shift_argument
17
+ @constant = Constant.new(self)
19
18
  super
20
19
  @additional_args = argv.remainder!
21
20
  end
@@ -29,9 +28,8 @@ module Jmpod
29
28
  end
30
29
 
31
30
  def run
32
- puts "od lib create #{@name} --template-url=http://34.80.176.10:8080/iOS-third/pod-template"
33
- system "pod lib create #{@name} --template-url=http://34.80.176.10:8080/iOS-third/pod-template"
34
- # puts "create a new oc pod done!"
31
+ system "pod lib create #{@name} objc --template-url=#{@constant.GitURL}pod-template.git"
32
+ puts "一个新的oc pod创建成!".green
35
33
  end
36
34
  end
37
35
  end
@@ -0,0 +1,36 @@
1
+ module Jmpod
2
+ class Command
3
+ class Create < Command
4
+ class Swift < Create
5
+
6
+ self.summary = '创建一个Swift库'
7
+ self.description = <<-DESC
8
+ 创建一个swift pod 库
9
+ DESC
10
+
11
+ self.arguments = [
12
+ CLAide::Argument.new('NAME', true),
13
+ ]
14
+
15
+ def initialize(argv)
16
+ @name = argv.shift_argument
17
+ super
18
+ @additional_args = argv.remainder!
19
+ end
20
+
21
+ def validate!
22
+ super
23
+ help! 'A name for the Pod is required.' unless @name
24
+ help! 'The Pod name cannot contain spaces.' if @name =~ /\s/
25
+ help! 'The Pod name cannot contain plusses.' if @name =~ /\+/
26
+ help! "The Pod name cannot begin with a '.'" if @name[0, 1] == '.'
27
+ end
28
+
29
+ def run
30
+ system "pod lib create #{@name} swift --template-url=http://34.80.176.10:8080/iOS-third/pod-template"
31
+ puts "一个新的swift pod创建成功!".green
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,40 @@
1
+ module Jmpod
2
+ class Command
3
+ class Create < Command
4
+ class Third < Create
5
+
6
+ self.summary = 'fork一个第三方库'
7
+ self.description = <<-DESC
8
+ fork一个第三个库到私有仓库
9
+ DESC
10
+
11
+ self.arguments = [
12
+ CLAide::Argument.new('URL', true),
13
+ ]
14
+
15
+ def initialize(argv)
16
+ @url = argv.shift_argument
17
+ super
18
+ @additional_args = argv.remainder!
19
+ end
20
+
21
+ def validate!
22
+ super
23
+ help! 'A url for the Pod is required.' unless @url
24
+ help! 'The Pod url cannot contain spaces.' if @url =~ /\s/
25
+ help! 'The Pod url cannot contain plusses.' if @url =~ /\+/
26
+ help! "The Pod url cannot begin with a '.'" if @url[0, 1] == '.'
27
+ end
28
+
29
+ def run
30
+ # fork 第三方仓库流程
31
+ puts "run"
32
+ `git clone #{@url}`
33
+ puts Dir.pwd
34
+ # `git remote set-url origin http://34.80.176.10:8080/ios/.git`
35
+ puts "fork 第三方库成功!".green
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -8,7 +8,7 @@ module Jmpod
8
8
  self.abstract_command = true
9
9
  self.summary = '创建pod库'
10
10
  self.description = <<-DESC
11
- 在当前文件夹下创建pod库,并且上传到gitlab上
11
+ 在当前文件夹下创建pod库,关联并上传到私有仓库!
12
12
  DESC
13
13
  end
14
14
  end
@@ -0,0 +1,36 @@
1
+ module Jmpod
2
+ class Command
3
+ class Init < Command
4
+ class Ci < Create
5
+
6
+ self.summary = '创建ci'
7
+ self.description = <<-DESC
8
+ 创建gitlab ci.
9
+ DESC
10
+
11
+ self.arguments = [
12
+ CLAide::Argument.new('NAME', true),
13
+ ]
14
+
15
+ def initialize(argv)
16
+ @name = argv.shift_argument
17
+ @constant = Constant.new(self)
18
+ super
19
+ @additional_args = argv.remainder!
20
+ end
21
+
22
+ def validate!
23
+ super
24
+ help! 'A name for the Pod is required.' unless @name
25
+ help! 'The Pod name cannot contain spaces.' if @name =~ /\s/
26
+ help! 'The Pod name cannot contain plusses.' if @name =~ /\+/
27
+ help! "The Pod name cannot begin with a '.'" if @name[0, 1] == '.'
28
+ end
29
+
30
+ def run
31
+ puts "new ci".green
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,36 @@
1
+ module Jmpod
2
+ class Command
3
+ class Init < Command
4
+ class Unit < Create
5
+
6
+ self.summary = '创建unit'
7
+ self.description = <<-DESC
8
+ 集成单元测试.
9
+ DESC
10
+
11
+ self.arguments = [
12
+ CLAide::Argument.new('NAME', true),
13
+ ]
14
+
15
+ def initialize(argv)
16
+ @name = argv.shift_argument
17
+ @constant = Constant.new(self)
18
+ super
19
+ @additional_args = argv.remainder!
20
+ end
21
+
22
+ def validate!
23
+ super
24
+ help! 'A name for the Pod is required.' unless @name
25
+ help! 'The Pod name cannot contain spaces.' if @name =~ /\s/
26
+ help! 'The Pod name cannot contain plusses.' if @name =~ /\+/
27
+ help! "The Pod name cannot begin with a '.'" if @name[0, 1] == '.'
28
+ end
29
+
30
+ def run
31
+ puts "new unit".green
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,14 @@
1
+ require 'jmpod/command/init/ci'
2
+ require 'jmpod/command/init/unit'
3
+
4
+ module Jmpod
5
+ class Command
6
+ class Create < Command
7
+ self.abstract_command = true
8
+ self.summary = '初始化'
9
+ self.description = <<-DESC
10
+ 初始化ci,单测等
11
+ DESC
12
+ end
13
+ end
14
+ end
data/lib/jmpod/command.rb CHANGED
@@ -15,11 +15,12 @@ module Jmpod
15
15
 
16
16
  class Command < CLAide::Command
17
17
  require 'jmpod/command/create'
18
+ require 'jmpod/command/init'
18
19
 
19
20
  self.abstract_command = true
20
21
  self.command = 'jmpod'
21
22
  self.version = VERSION
22
- self.description = 'Jmpod, test gem pod'
23
+ self.description = 'jmpod, a tool to manager pod'
23
24
  self.plugin_prefixes = %w(claide jmpod)
24
25
 
25
26
  def self.options
@@ -29,8 +30,6 @@ module Jmpod
29
30
  end
30
31
 
31
32
  def self.run(argv)
32
- help! 'You cannot run CocoaPods as root.' if Process.uid == 0 && !Gem.win_platform?
33
-
34
33
  super(argv)
35
34
  end
36
35
 
@@ -0,0 +1,12 @@
1
+ module Jmpod
2
+ class Constant
3
+ attr_reader :configurator
4
+
5
+ def initialize(config)
6
+ @configurator = config
7
+ end
8
+
9
+ def GitURL
10
+ "http://34.80.176.10:8080/iOS-third/"
11
+ end
12
+ end
data/lib/jmpod/version.rb CHANGED
@@ -2,5 +2,5 @@ module Jmpod
2
2
  # freeze 冻结对象,将对象变成一个常量
3
3
  # unless 右边的代码块成立,才会运行左边的代码块
4
4
  # defined? 是用来判断本地变量是否存在,也可用来判断是否存在方法
5
- VERSION = "0.1.1".freeze unless defined? Jmpod::VERSION
5
+ VERSION = "0.1.2".freeze unless defined? Jmpod::VERSION
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jmpod
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - jieming
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-22 00:00:00.000000000 Z
11
+ date: 2020-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -123,6 +123,10 @@ files:
123
123
  - lib/jmpod/command/create/oc.rb
124
124
  - lib/jmpod/command/create/swift.rb
125
125
  - lib/jmpod/command/create/third.rb
126
+ - lib/jmpod/command/init.rb
127
+ - lib/jmpod/command/init/ci.rb
128
+ - lib/jmpod/command/init/unit.rb
129
+ - lib/jmpod/constant.rb
126
130
  - lib/jmpod/version.rb
127
131
  homepage: http://34.80.176.10:8080/iOS-third/jmpod
128
132
  licenses: []