bytedance 0.1.14 → 0.1.15

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
  SHA1:
3
- metadata.gz: 7a51594accc3d611d4d770dd1ffe99bbc54c31fe
4
- data.tar.gz: fe8249120644cc8e5f0b928b8087515000faa8b7
3
+ metadata.gz: b0c5f08b6d0ebebad734c325f305387bdaffcdd9
4
+ data.tar.gz: 359a42a979b99172a1cc2435ab76dd0c376c71c4
5
5
  SHA512:
6
- metadata.gz: 585a94a8ff0d41e2a2091d9d80a905bf587eb1064546fe2d73d0d249d6732d5849c5fe3151ebee134c37e4a349b2953748af86c9911f155b10e5ef2467032e78
7
- data.tar.gz: 63573a8a5644982f0f7fc15007775ccfd0db47db44800dcf52fe29ae0025f961f533e670c9fd4f57ba49e4912ea790a9f46d9eb82b07a41f9f8752584d8c5bf6
6
+ metadata.gz: 271d81fdda87cee1f3147805b27b62480bb41c16e290ef271ca3568aa88c05901bde7a316fc845935d84dc53eccfa35c08e4c82fca900e3a82fbbfbce0915cfe
7
+ data.tar.gz: 7820c9e6b5bfc40c24b0df9a786e45e635c3b37222159172f25137f4ed7a989bc0fb1591f9e0bb2a7d089e08c2ed77d7cd1a2511c4e561db098163b2aed71547
data/bin/bytedance CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # require "../Documents/code/bytedance/lib/bytedance"
4
- require "bytedance1"
4
+ require "bytedance"
5
5
 
6
6
  # Bytedance::BytedanceMain.new(ARGV).run
7
7
 
data/lib/bytedance.rb CHANGED
@@ -1,47 +1,117 @@
1
- require_relative "bytedance/version"
2
- require 'xcodeproj'
1
+ # encoding: utf-8
2
+
3
+ require 'claide'
4
+ require 'colored'
3
5
  require 'cocoapods'
4
- require 'json'
5
-
6
- module Bytedance
7
- class BytedanceMain < CLAide::Command
8
-
9
- def initialize(argv)
10
- @argv = argv
11
- @params = CLAide::ARGV.new(argv)
12
- end
13
-
14
- def self.options
15
- [
16
- ['--help', 'Show nothing'],
17
- ['--help', 'Show nothing'],
18
- ].concat(super)
19
- end
20
-
21
- def run
22
- if @params.flag?('platform') == nil
23
- addParam('--platform')
24
- end
25
-
26
- if @params.flag?('components') == nil
27
- addParam('--components')
28
- end
29
-
30
- if @params.option('prefix') == nil
31
- puts "输入prfix:"
32
- result = STDIN.gets.chomp
33
- if result == nil
34
- result = "TT"
35
- end
36
- addParam('--prefix=' + result)
37
- end
38
- addParam('--template-url=git@code.byted.org:jialei.jay/pod-template.git')
39
- finalParams = CLAide::ARGV.new(@argv)
40
- Pod::Command::Lib::Create.new(finalParams).run
41
- end
42
-
43
- def addParam(param)
44
- @argv.insert(1,param)
45
- end
46
- end
6
+
7
+ class BytedanceManager < CLAide::Command
8
+ self.abstract_command = true
9
+
10
+ self.description = <<-DESC
11
+
12
+ DESC
13
+
14
+ self.command = 'bytedance'
15
+
16
+ def self.options
17
+ [
18
+
19
+ ].concat(super)
20
+ end
21
+
22
+ def run
23
+
24
+ end
25
+
26
+ class Lib < BytedanceManager
27
+
28
+ self.abstract_command = true
29
+ self.summary = ''
30
+
31
+ self.description = <<-DESC
32
+
33
+ DESC
34
+
35
+ def run
36
+ super
37
+
38
+ end
39
+
40
+ class Create < Lib
41
+ self.summary = ''
42
+
43
+ def self.options
44
+ [['--platform', '是否引入平台基础库,默认引入,不引入使用--no-platform'],
45
+ ['--components=[none|optional|all]', 'none 不引入任何组件,optional 选择自己想要的(default), all 引入全部组件,于平台一致'],
46
+ ['--prefix', '可选,默认 prefix = TT']].concat(super)
47
+ end
48
+
49
+ def initialize(params)
50
+ formatParam(params)
51
+ super
52
+ end
53
+
54
+ def validate!
55
+ super
56
+ if @components && !%w(none optional all).include?(@components)
57
+ help! "`#{@components}' is not a valid components."
58
+ end
59
+ end
60
+
61
+ def run
62
+ super
63
+ finalParams = CLAide::ARGV.new(@arguments)
64
+ Pod::Command::Lib::Create.new(finalParams).run
65
+ end
66
+
67
+ def formatParam(params)
68
+ @arguments = params.arguments
69
+ @arguments.insert(0,params.shift_argument)
70
+ if params.flag?('platform') == nil
71
+ addParam('--platform')
72
+ end
73
+ @components = params.option('components')
74
+ if @components == nil
75
+ addParam('--components=optional')
76
+ end
77
+
78
+ if params.option('prefix') == nil
79
+ puts "输入prfix:"
80
+ result = STDIN.gets.chomp
81
+ if result == nil
82
+ result = "TT"
83
+ end
84
+ addParam('--prefix=' + result)
85
+ end
86
+ addParam('--template-url=git@code.byted.org:jialei.jay/pod-template.git')
87
+ end
88
+
89
+ def addParam(param)
90
+ @arguments.insert(1,param)
91
+ end
92
+
93
+ end
94
+
95
+ class Publish < Lib
96
+ self.summary = ''
97
+
98
+ def self.options
99
+ [['--iced', 'the ice-tea version']].concat(super)
100
+ end
101
+
102
+ def initialize(argv)
103
+ @flavor = argv.shift_argument
104
+ @iced = argv.flag?('iced')
105
+ super
106
+ end
107
+
108
+ def run
109
+ super
110
+
111
+ end
112
+ end
113
+
114
+ end
115
+
47
116
  end
117
+
@@ -1,3 +1,3 @@
1
1
  module Bytedance
2
- VERSION = "0.1.14"
2
+ VERSION = "0.1.15"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bytedance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.14
4
+ version: 0.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - jialei
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-03 00:00:00.000000000 Z
11
+ date: 2018-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler