luna-binary-uploader 0.1.24 → 0.1.25

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: 116426b3ff192fe626ed285d524284bf5fad7a33c82ce59b3d43c4ce7204c62a
4
- data.tar.gz: c07ff3d27936481b281771b1a4aa82dacef88a87384b78f04eb11cb6c8eeeb58
3
+ metadata.gz: 69f6dde43552f8b6f3c016abed8c0efe2df08f975afebd16d5d15786059564b7
4
+ data.tar.gz: 449f282e177e6d6125dde7672ad3cdf1b34e114cefc32b0f6e3f9bc417629558
5
5
  SHA512:
6
- metadata.gz: 541c3bcbe9802971456300bff08f6818c0055234f3302132d3d61c2dfb50f40ec227e5b0e74a38b7f4a2b284189239985a995616f402aeb4d3dffb5787306369
7
- data.tar.gz: 4de07acdddd8808404e866c54a7517de3c3761155f7dbbe9392fba2ec2698372c650bd5d29bcf51f1d56502d1e1ed22400f72e0d4e24a2c838ff2c9d6df3c65c
6
+ metadata.gz: 9b28579c5ffa2121188c4f96b9dd6a660cf4a4948ce5b500556d82e5650a39e1c8c7a14b1da7d5b6086a438780ab61d11271fd43d7d45474495f8af1929544a2
7
+ data.tar.gz: 6bfba261965ef5bc34e54746fc1c45e34e4d86aee2c83eccbf7d49701148d29519671d84f1656ed860e2d695ed639dd559f111b33abf51e831e1fb87c34131a2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- luna-binary-uploader (0.1.21)
4
+ luna-binary-uploader (0.1.25)
5
5
  cocoapods
6
6
  cocoapods-generate (~> 2.0.1)
7
7
  cocoapods-imy-bin (= 0.3.1.3)
@@ -11,9 +11,9 @@ PATH
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- CFPropertyList (3.0.4)
14
+ CFPropertyList (3.0.5)
15
15
  rexml
16
- activesupport (6.1.4.1)
16
+ activesupport (6.1.4.4)
17
17
  concurrent-ruby (~> 1.0, >= 1.0.2)
18
18
  i18n (>= 1.6, < 2)
19
19
  minitest (>= 5.1)
@@ -123,13 +123,13 @@ GEM
123
123
  gh_inspector (1.1.3)
124
124
  gli (2.19.0)
125
125
  httpclient (2.8.3)
126
- i18n (1.8.10)
126
+ i18n (1.8.11)
127
127
  concurrent-ruby (~> 1.0)
128
- json (2.6.0)
128
+ json (2.6.1)
129
129
  mime-types (3.3.1)
130
130
  mime-types-data (~> 3.2015)
131
131
  mime-types-data (3.2021.0901)
132
- minitest (5.14.4)
132
+ minitest (5.15.0)
133
133
  molinillo (0.8.0)
134
134
  multi_test (0.1.2)
135
135
  nanaimo (0.3.0)
@@ -159,7 +159,7 @@ GEM
159
159
  colored2 (~> 3.1)
160
160
  nanaimo (~> 0.3.0)
161
161
  rexml (~> 3.2.4)
162
- zeitwerk (2.5.0)
162
+ zeitwerk (2.5.1)
163
163
 
164
164
  PLATFORMS
165
165
  ruby
data/bin/lbu CHANGED
@@ -21,59 +21,28 @@ class App
21
21
  subcommand_option_handling :normal
22
22
  arguments :strict
23
23
 
24
- desc 'Describe some switch here'
25
- switch [:s,:switch]
26
-
27
- desc 'Describe some flag here'
28
- default_value 'the default'
29
- arg_name 'The name of the argument'
30
- flag [:f,:flagname]
31
-
32
- desc 'Describe list here'
33
- arg_name 'Describe arguments to list here'
34
- command :list do |c|
35
- c.desc 'Describe a switch to list'
36
- c.switch :s
37
-
38
- c.desc 'Describe a flag to list'
39
- c.default_value 'default'
40
- c.flag :f
41
- c.action do |global_options,options,args|
42
-
43
- # Your command logic here
44
-
45
- # If you have any errors, just raise them
46
- # raise "that command made no sense"
47
-
48
- puts "list command ran"
49
- end
50
- end
51
-
52
24
  desc '初始化二进制配置repo代码'
53
25
  arg_name 'url地址'
54
26
  command :init do |c|
55
27
  c.action do |global_options,options,args|
56
- if args[0]
57
- Luna::Binary::Init.new(args[0])
58
- else
59
- raise "添加url地址"
60
- end
28
+ help_now!('url is required') if args.empty?
29
+ Luna::Binary::Init.new(args[0])
61
30
  end
62
31
  end
63
32
 
64
33
 
65
34
  desc '对pod install封装,一键开关二进制'
66
- arg_name '只接参数n, 表示不用二进制 '
35
+ arg_name ''
67
36
  command :install do |c|
37
+ c.desc '是否需要二进制, 不需要的话 -n or --no'
38
+ c.switch [:n,:no]
68
39
  c.action do |global_options,options,args|
69
- if args[0] && args[0] != "n"
70
- raise "只接参数n, 表示不用二进制"
71
- elsif args[0] && args[0] == "n"
40
+ if options[:no]
72
41
  is_open = "false"
73
42
  else
74
43
  is_open = "true"
75
44
  end
76
- Luna::Binary::Install.new(is_open)
45
+ Luna::Binary::Install.new(is_open)
77
46
  end
78
47
  end
79
48
 
@@ -120,11 +89,10 @@ class App
120
89
  arg_name '1.模块名 2.版本号'
121
90
  command :del do |c|
122
91
  c.action do |global_options,options,args|
123
- if args[0] && args[1]
124
- Luna::Binary::Delete.new(args[0],args[1]).delete
125
- else
126
- raise "缺少参数:1.模块名 2.版本号"
127
- end
92
+ help_now!('args is required') if args.empty?
93
+ help_now!('模块名是需要的') if args[0] == nil
94
+ help_now!('版本号是需要的') if args[1] == nil
95
+ Luna::Binary::Delete.new(args[0],args[1]).delete
128
96
  end
129
97
  end
130
98
 
@@ -146,28 +114,31 @@ class App
146
114
  desc '仅仅更新服务的framwork,podfile带有标志位的:dev_env_use_binary的模块framework,通常解决xcode升级导致framework swift 版本问题'
147
115
  arg_name '参数:1.二进制路径(可以不传默认为当前目录下的/temp-luna-uploader/merged)'
148
116
  command :refresh do |c|
117
+ c.desc '是否需要build, 不需要的话 -n or --no'
118
+ c.switch [:n,:no]
149
119
  c.action do |global_options,options,args|
120
+ if options[:no]
150
121
  obj = Luna::Binary::Refresh.new()
151
122
  if args[0] != nil
152
- obj.binary_path = args[0]
123
+ obj.binary_path = args[0]
153
124
  else
154
125
  obj.binary_path = Luna::Binary::Common.instance.binary_path_merged
155
126
  end
156
127
  obj.run
157
- end
158
- end
159
-
160
- desc '检查并上传带有标记:dev_env_use_binary的模块,上传repo和framework'
161
- arg_name '参数:1.二进制路径(可以不传默认为当前目录下的/temp-luna-uploader/merged)'
162
- command :update do |c|
163
- c.action do |global_options,options,args|
164
- obj = Luna::Binary::Update.new()
165
- if args[0] != nil
166
- obj.binary_path = args[0]
167
- else
128
+ else
129
+ help_now!('args is required') if args.empty?
130
+ help_now!('workspace is required') if args[0] == nil
131
+ help_now!('scheme is required') if args[1] == nil
132
+ build = Luna::Binary::Build.new()
133
+ build.workspace=args[0]
134
+ build.scheme=args[1]
135
+ if build.run
136
+ obj = Luna::Binary::Refresh.new()
168
137
  obj.binary_path = Luna::Binary::Common.instance.binary_path_merged
138
+ obj.run
169
139
  end
170
- obj.run
140
+ end
141
+
171
142
  end
172
143
  end
173
144
 
@@ -175,14 +146,13 @@ class App
175
146
  arg_name '1.xcworkspace 名称 eg:MyWorkSpace.xcworkspace 2.scheme eg: MyProject'
176
147
  command :build do |c|
177
148
  c.action do |global_options,options,args|
178
- if args[0] && args[1]
179
- obj = Luna::Binary::Build.new()
180
- obj.workspace=args[0]
181
- obj.scheme=args[1]
182
- obj.run
183
- else
184
- raise "缺少参数:1.xcworkspace 名称 eg:MyWorkSpace.xcworkspace 2.scheme eg: MyProject"
185
- end
149
+ help_now!('args is required') if args.empty?
150
+ help_now!('workspace is required') if args[0] == nil
151
+ help_now!('scheme is required') if args[1] == nil
152
+ obj = Luna::Binary::Build.new()
153
+ obj.workspace=args[0]
154
+ obj.scheme=args[1]
155
+ obj.run
186
156
  end
187
157
  end
188
158
 
@@ -190,12 +160,11 @@ class App
190
160
  arg_name '1.armPath 2.x86path'
191
161
  command :merge do |c|
192
162
  c.action do |global_options,options,args|
193
- if args[0] && args[1]
194
- obj = Luna::Binary::Build.new()
195
- obj.mergeFrameWorks(args[0], args[1])
196
- else
197
- raise "缺少参数:1.armPath 2.x86path"
198
- end
163
+ help_now!('args is required') if args.empty?
164
+ help_now!('armPath is required') if args[0] == nil
165
+ help_now!('x86path is required') if args[1] == nil
166
+ obj = Luna::Binary::Build.new()
167
+ obj.mergeFrameWorks(args[0], args[1])
199
168
  end
200
169
  end
201
170
 
@@ -203,6 +172,9 @@ class App
203
172
  arg_name '1.跑工程几次 2.workspace 3.scheme 4.normal正常模式下 binary二进制模式下,不传的话都跑'
204
173
  command :benchmark do |c|
205
174
  c.action do |global_options,options,args|
175
+ help_now!('args is required') if args.empty?
176
+ help_now!('workspace is required') if args[0] == nil
177
+ help_now!('scheme is required') if args[1] == nil
206
178
  obj = Luna::Binary::BenchMark.new(Integer(args[0]), args[1], args[2])
207
179
  if args[3] == "normal"
208
180
  obj.run_no_binary
@@ -215,6 +187,32 @@ class App
215
187
  end
216
188
  end
217
189
 
190
+ desc '二进制build完自动将podfile标记的需要二进制的,进行打包上传'
191
+ arg_name 'workspace 名称 eg:MyWorkSpace.xcworkspace 2.scheme eg: MyProject'
192
+ command :publish do |c|
193
+ c.desc '是否需要build, 不需要的话 -n or --no'
194
+ c.switch [:n,:no]
195
+ c.action do |global_options,options,args|
196
+ help_now!('args is required') if args.empty?
197
+ if options[:no]
198
+ update = Luna::Binary::Update.new()
199
+ update.binary_path = Luna::Binary::Common.instance.binary_path_merged
200
+ update.run
201
+ else
202
+ help_now!('workspace is required') if args[0] == nil
203
+ help_now!('scheme is required') if args[1] == nil
204
+ build = Luna::Binary::Build.new()
205
+ build.workspace=args[0]
206
+ build.scheme=args[1]
207
+ if build.run
208
+ update = Luna::Binary::Update.new()
209
+ update.binary_path = Luna::Binary::Common.instance.binary_path_merged
210
+ update.run
211
+ end
212
+ end
213
+ end
214
+ end
215
+
218
216
  pre do |global,command,options,args|
219
217
  # Pre logic here
220
218
  # Return true to proceed; false to abort and not call the
@@ -16,7 +16,7 @@ module Luna
16
16
  end
17
17
 
18
18
  def run
19
- createFrameworks
19
+ return createFrameworks
20
20
  end
21
21
 
22
22
  def command(c)
@@ -35,6 +35,7 @@ module Luna
35
35
  isNext = command("xcodebuild -workspace #{workspace} -scheme #{scheme} -configuration Debug -derivedDataPath '#{tempLunaUploaderPath}/build/x86/temp' -destination 'platform=iOS Simulator,name=iPhone 11'") if isNext == true
36
36
  isNext = command("cp -r #{tempLunaUploaderPath}/build/x86/temp/Build/Products/Debug-iphonesimulator #{binary_path_x86}") if isNext == true
37
37
  mergeFrameWorks(binary_path_arm, binary_path_x86) if isNext == true
38
+ return isNext
38
39
  end
39
40
 
40
41
  def mergeFrameWorks(binary_path_arm, binary_path_x86)
@@ -0,0 +1,100 @@
1
+ # This file was generated by the `rspec --init` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # The generated `.rspec` file contains `--require spec_helper` which will cause
4
+ # this file to always be loaded, without a need to explicitly require it in any
5
+ # files.
6
+ #
7
+ # Given that it is always loaded, you are encouraged to keep this file as
8
+ # light-weight as possible. Requiring heavyweight dependencies from this file
9
+ # will add to the boot time of your test suite on EVERY test run, even for an
10
+ # individual file that may not need all of that loaded. Instead, consider making
11
+ # a separate helper file that requires the additional dependencies and performs
12
+ # the additional setup, and require it from the spec files that actually need
13
+ # it.
14
+ #
15
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
16
+ RSpec.configure do |config|
17
+ # rspec-expectations config goes here. You can use an alternate
18
+ # assertion/expectation library such as wrong or the stdlib/minitest
19
+ # assertions if you prefer.
20
+ config.expect_with :rspec do |expectations|
21
+ # This option will default to `true` in RSpec 4. It makes the `description`
22
+ # and `failure_message` of custom matchers include text for helper methods
23
+ # defined using `chain`, e.g.:
24
+ # be_bigger_than(2).and_smaller_than(4).description
25
+ # # => "be bigger than 2 and smaller than 4"
26
+ # ...rather than:
27
+ # # => "be bigger than 2"
28
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
29
+ end
30
+
31
+ # rspec-mocks config goes here. You can use an alternate test double
32
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
33
+ config.mock_with :rspec do |mocks|
34
+ # Prevents you from mocking or stubbing a method that does not exist on
35
+ # a real object. This is generally recommended, and will default to
36
+ # `true` in RSpec 4.
37
+ mocks.verify_partial_doubles = true
38
+ end
39
+
40
+ # This option will default to `:apply_to_host_groups` in RSpec 4 (and will
41
+ # have no way to turn it off -- the option exists only for backwards
42
+ # compatibility in RSpec 3). It causes shared context metadata to be
43
+ # inherited by the metadata hash of host groups and examples, rather than
44
+ # triggering implicit auto-inclusion in groups with matching metadata.
45
+ config.shared_context_metadata_behavior = :apply_to_host_groups
46
+
47
+ # The settings below are suggested to provide a good initial experience
48
+ # with RSpec, but feel free to customize to your heart's content.
49
+ =begin
50
+ # This allows you to limit a spec run to individual examples or groups
51
+ # you care about by tagging them with `:focus` metadata. When nothing
52
+ # is tagged with `:focus`, all examples get run. RSpec also provides
53
+ # aliases for `it`, `describe`, and `context` that include `:focus`
54
+ # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
55
+ config.filter_run_when_matching :focus
56
+
57
+ # Allows RSpec to persist some state between runs in order to support
58
+ # the `--only-failures` and `--next-failure` CLI options. We recommend
59
+ # you configure your source control system to ignore this file.
60
+ config.example_status_persistence_file_path = "spec/examples.txt"
61
+
62
+ # Limits the available syntax to the non-monkey patched syntax that is
63
+ # recommended. For more details, see:
64
+ # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
65
+ # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
66
+ # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
67
+ config.disable_monkey_patching!
68
+
69
+ # This setting enables warnings. It's recommended, but in some cases may
70
+ # be too noisy due to issues in dependencies.
71
+ config.warnings = true
72
+
73
+ # Many RSpec users commonly either run the entire suite or an individual
74
+ # file, and it's useful to allow more verbose output when running an
75
+ # individual spec file.
76
+ if config.files_to_run.one?
77
+ # Use the documentation formatter for detailed output,
78
+ # unless a formatter has already been configured
79
+ # (e.g. via a command-line flag).
80
+ config.default_formatter = "doc"
81
+ end
82
+
83
+ # Print the 10 slowest examples and example groups at the
84
+ # end of the spec run, to help surface which specs are running
85
+ # particularly slow.
86
+ config.profile_examples = 10
87
+
88
+ # Run specs in random order to surface order dependencies. If you find an
89
+ # order dependency and want to debug it, you can fix the order by providing
90
+ # the seed, which is printed after each run.
91
+ # --seed 1234
92
+ config.order = :random
93
+
94
+ # Seed global randomization in this process using the `--seed` CLI option.
95
+ # Setting this allows you to use `--seed` to deterministically reproduce
96
+ # test failures related to randomization by passing the same `--seed` value
97
+ # as the one that triggered the failure.
98
+ Kernel.srand config.seed
99
+ =end
100
+ end
@@ -0,0 +1,81 @@
1
+ current_dir = File.dirname(__FILE__)
2
+
3
+ require 'bundler/setup'
4
+ Bundler.require
5
+ require "#{current_dir}/spec_helper.rb"
6
+ require "#{current_dir}/../common/common.rb"
7
+
8
+ RSpec.describe Commmon do
9
+ describe 'exception' do
10
+ it do
11
+ expect { Common.instance.repoPath }.to raise_error(NoMethodError)
12
+ end
13
+ end
14
+
15
+ describe 'exist' do
16
+ it do
17
+ expect { Common.instance.repoPath.length.empty? }.to be false
18
+ end
19
+ end
20
+
21
+ describe 'exist lockfile' do
22
+ it do
23
+ expect { Common.instance.lockfile.empty? }.to be false
24
+ end
25
+ end
26
+
27
+
28
+ end
29
+
30
+
31
+ RSpec.describe Uploader do
32
+ describe 'exception' do
33
+ it do
34
+ expect { Common.instance.repoPath }.to raise_error(NoMethodError)
35
+ end
36
+ end
37
+
38
+ describe 'exist' do
39
+ it do
40
+ expect { Common.instance.repoPath.length != 0 }.to be true
41
+ end
42
+ end
43
+ end
44
+
45
+ RSpec.describe 'Assertion' do
46
+ describe 'expect equality' do
47
+ it do
48
+ foo = 1
49
+ expect(foo).to eq(1)
50
+ end
51
+
52
+ it do
53
+ foo = [1, 2, 3]
54
+ expect(foo).not_to equal([1, 2, 3])
55
+ end
56
+ end
57
+
58
+ describe 'expect Truthiness' do
59
+ it { expect(1 + 1 == 2).to be true }
60
+ end
61
+
62
+ describe 'match array' do
63
+ it do
64
+ arr = [1, 2, 3]
65
+ expect(arr).to match_array([1, 2, 3])
66
+ end
67
+ end
68
+
69
+ describe 'exception' do
70
+ it do
71
+ expect { nil.split(',') }.to raise_error(NoMethodError)
72
+ end
73
+ end
74
+
75
+ describe 'state change' do
76
+ it do
77
+ arr = [1]
78
+ expect { arr += [2, 3] }.to change { arr.size }.by(2)
79
+ end
80
+ end
81
+ end
@@ -1,7 +1,7 @@
1
1
  module Luna
2
2
  module Binary
3
3
  module Uploader
4
- VERSION = "0.1.24"
4
+ VERSION = "0.1.25"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: luna-binary-uploader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.24
4
+ version: 0.1.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - 车德超
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-27 00:00:00.000000000 Z
11
+ date: 2021-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -148,6 +148,8 @@ files:
148
148
  - lib/luna/binary/init.rb
149
149
  - lib/luna/binary/install.rb
150
150
  - lib/luna/binary/refresh.rb
151
+ - lib/luna/binary/spec/spec_helper.rb
152
+ - lib/luna/binary/spec/test_spec.rb
151
153
  - lib/luna/binary/update.rb
152
154
  - lib/luna/binary/uploader.rb
153
155
  - lib/luna/binary/uploader/version.rb
@@ -156,7 +158,7 @@ homepage: https://github.com/YoudaoMobile/luna-binary-uploader
156
158
  licenses:
157
159
  - MIT
158
160
  metadata: {}
159
- post_install_message:
161
+ post_install_message:
160
162
  rdoc_options: []
161
163
  require_paths:
162
164
  - lib
@@ -171,8 +173,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
171
173
  - !ruby/object:Gem::Version
172
174
  version: '0'
173
175
  requirements: []
174
- rubygems_version: 3.0.3
175
- signing_key:
176
+ rubygems_version: 3.1.4
177
+ signing_key:
176
178
  specification_version: 4
177
179
  summary: 词典上传二进制控件
178
180
  test_files: []