xbean 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e3f55e0b9c2fd907614763e32c90924fb730aed1
4
- data.tar.gz: 966dfd0cd414ebc98525a24d1c6e8888a7dc5b51
3
+ metadata.gz: 601af7c03126498f429be8e3de4bc32025ee30a6
4
+ data.tar.gz: 5de7439d33427b1f3989c5f0216ac9966fe798c2
5
5
  SHA512:
6
- metadata.gz: 4e42bcbae115e46a887ac5210424ad35b5a3db1eb2619d5025f8cd0884c732461ec42c8eb5ffe0cdf4877d57dbc50eaf28cf3fd65c809260ef2868ebd0c23e56
7
- data.tar.gz: 665ade647a7f99445bb0c1dd5900750ffd8ac89fad127d1938e6493c148d0d3573a1aeadc7219f77741cddd40a4dfbe8502a7d02bdfe1329fcc0feec77436e71
6
+ metadata.gz: 151c90c8adc881dc0d96bf35851991c80984bcf01fab8d98d2740931bdf61c80de9b605552cd5dbbe2b3601afdc3939d0d1439105feb859ac7cab160a2a1fae6
7
+ data.tar.gz: 1ecb0fcc87ffd5ff3b309b565cc5737d60185f2a68165fb2e5a9096a7f8b3df07530f6062f61384e6483e0e95e8caa1a9843af6f961fcfc8fa2911a0861da798
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
+ [![Gem Version](https://badge.fury.io/rb/xbean.png)](https://badge.fury.io/rb/xbean)
2
+
1
3
  # What is xbean
2
- xbean 是一个 iOS 自动打包工具。
4
+ xbean 是一个小巧的 iOS 自动打包工具。从安装到使用只需要花费您一分钟。
3
5
 
4
6
  ## Installation
5
7
 
data/bin/xbean CHANGED
@@ -1,19 +1,16 @@
1
1
  #!/usr/bin/env ruby -W
2
- # encoding: utf-8
3
2
 
4
3
  require 'xbean'
5
4
 
6
- if ARGV.length > 0
7
- action = ARGV.first
8
- Bean::Runner.new.exec(action)
9
- else
10
- puts <<-"..."
5
+ return Bean::Runner.new.exec(ARGV.first) if ARGV.length > 0
6
+
7
+ puts <<-"..."
11
8
  Usage:
12
9
  $ xbean COMMAND
13
10
 
14
11
  Commands:
15
12
 
16
- + init Generate a Beanfile for the curren directory
13
+ + init Generate a Beanfile for the curren directory
17
14
  + <bean> The custom bean action in your Beanfile
18
15
 
19
16
  Example:
@@ -21,5 +18,4 @@ Example:
21
18
  xbean dev
22
19
  Run the `dev` bean you defined in your Beanfile.
23
20
 
24
- ...
25
- end
21
+ ...
data/lib/bean/action.rb CHANGED
@@ -1,54 +1,28 @@
1
1
  #!/usr/bin/env ruby -W
2
2
 
3
3
  module Action
4
-
5
4
  class BeanAction
6
5
  def initialize(bean_file)
7
6
  @bean_file = bean_file
8
- @configs = {}
9
7
  define_bean_action
10
8
  end
11
9
 
12
- # Run the action with action name.
13
-
14
- # def run(name)
15
- # puts "action name: #{name}"
16
- # return puts "The action `#{name}` does not exist" unless config = @configs[name.to_sym]
17
- # puts "archive info:"
18
- # XcodeBuilder::Archiver.new(config)
19
- # end
20
-
21
-
22
10
  private
23
11
 
24
12
  def define_bean_action
25
13
  configs = {}
26
14
  Kernel.send :define_method, :bean do |name, &block|
27
- # yield add_config(Workspace::Config.new(name)) if block
28
15
  config = Workspace::Config.new(name)
29
16
  block.call(config)
30
- configs[config.name.to_sym] = config
17
+ configs[name.to_sym] = config
31
18
  end
32
19
 
33
20
  load @bean_file
34
21
 
35
22
  BeanAction.send :define_method, :run do |name|
36
- # puts "action name: #{name}"
37
23
  return puts "The action `#{name}` does not exist" unless config = configs[name.to_sym]
38
- # puts "archive info:"
39
24
  XcodeBuilder::Archiver.archive(config)
40
25
  end
41
-
42
- end
43
-
44
- def add_config(config)
45
- @configs[config.name.to_sym] = archiver
46
26
  end
47
27
  end
48
-
49
-
50
- end
51
-
52
- # module Kernel
53
- # def bean(name, )
54
- # end
28
+ end
data/lib/bean/project.rb CHANGED
@@ -15,7 +15,6 @@ module Workspace
15
15
 
16
16
  def clear
17
17
  `rm -rf #{TMP_DIR}` if Dir.exist?(TMP_DIR)
18
- # Dir.delete(TMP_DIR) if Dir.exist?(TMP_DIR)
19
18
  end
20
19
 
21
20
  end
data/lib/bean/runner.rb CHANGED
@@ -2,22 +2,26 @@
2
2
 
3
3
  require_relative 'colored'
4
4
 
5
- # include Action
6
-
7
5
  module Bean
8
6
  class Runner
7
+
9
8
  def exec(name)
10
9
  return init if name.to_s == 'init'
10
+ run_bean(name)
11
+ end
12
+
13
+ private
14
+
15
+ # exec then bean your defined in your own Beanfile.
16
+ def run_bean(name)
11
17
  bean_file = Workspace::BEAN_FILE
12
18
  return puts "Beanfile does not exist.".red unless Workspace.bean?
13
19
  Action::BeanAction.new(bean_file).run(name)
14
20
  end
15
21
 
16
- private
17
-
18
22
  def init
19
23
  beanfile = Workspace::BEAN_FILE
20
- return puts "Beanfile already exist." if File.exist?(beanfile)
24
+ return puts "Beanfile already exist.".red if File.exist?(beanfile)
21
25
 
22
26
  File.open(beanfile, 'w') do |f|
23
27
  f.write <<-"..."
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby -W
2
+
3
+ module Bean
4
+ VERSION = "0.0.7"
5
+ end
@@ -87,8 +87,6 @@ module XcodeTool
87
87
  def command(name, key, value, type)
88
88
  return unless %w(Add Set).include?(name)
89
89
  type = name == 'Add' ? " #{type}" : ''
90
- # cmd = "/usr/libexec/PlistBuddy -c '#{name} :#{key}#{type} #{value}' #{@plist_file}"
91
- # puts cmd.red
92
90
  system "/usr/libexec/PlistBuddy -c '#{name} :#{key}#{type} #{value}' #{@plist_file}"
93
91
  end
94
92
 
data/lib/test.rb CHANGED
@@ -31,6 +31,6 @@ require_relative 'xbean'
31
31
  # config.team_id = 'DHF3334HH'
32
32
  # puts config
33
33
 
34
- # Bean::Runner.new.exec('dev')
35
- Bean::Runner.new.exec('init')
34
+ Bean::Runner.new.exec('dev')
35
+ # Bean::Runner.new.exec('init')
36
36
 
data/xbean.gemspec CHANGED
@@ -1,6 +1,8 @@
1
+ require_relative 'lib/bean/version'
2
+
1
3
  Gem::Specification.new do |s|
2
4
  s.name = 'xbean'
3
- s.version = '0.0.6'
5
+ s.version = Bean::VERSION
4
6
  s.date = '2018-07-16'
5
7
  s.summary = "Archiver for iOS."
6
8
  s.description = "A tool to Arcive iOS App."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xbean
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - jewelz
@@ -27,11 +27,11 @@ files:
27
27
  - lib/bean/project.rb
28
28
  - lib/bean/runner.rb
29
29
  - lib/bean/table.rb
30
+ - lib/bean/version.rb
30
31
  - lib/bean/xcode_tool.rb
31
32
  - lib/bean/xcodebuild.rb
32
33
  - lib/test.rb
33
34
  - lib/xbean.rb
34
- - xbean-0.0.1.gem
35
35
  - xbean.gemspec
36
36
  homepage: https://github.com/hujewelz/bean.git
37
37
  licenses: