xbean 0.0.6 → 0.0.7
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/README.md +3 -1
- data/bin/xbean +5 -9
- data/lib/bean/action.rb +2 -28
- data/lib/bean/project.rb +0 -1
- data/lib/bean/runner.rb +9 -5
- data/lib/bean/version.rb +5 -0
- data/lib/bean/xcode_tool.rb +0 -2
- data/lib/test.rb +2 -2
- data/xbean.gemspec +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 601af7c03126498f429be8e3de4bc32025ee30a6
|
4
|
+
data.tar.gz: 5de7439d33427b1f3989c5f0216ac9966fe798c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 151c90c8adc881dc0d96bf35851991c80984bcf01fab8d98d2740931bdf61c80de9b605552cd5dbbe2b3601afdc3939d0d1439105feb859ac7cab160a2a1fae6
|
7
|
+
data.tar.gz: 1ecb0fcc87ffd5ff3b309b565cc5737d60185f2a68165fb2e5a9096a7f8b3df07530f6062f61384e6483e0e95e8caa1a9843af6f961fcfc8fa2911a0861da798
|
data/README.md
CHANGED
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
|
-
|
8
|
-
|
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
|
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[
|
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
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 <<-"..."
|
data/lib/bean/version.rb
ADDED
data/lib/bean/xcode_tool.rb
CHANGED
@@ -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
data/xbean.gemspec
CHANGED
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.
|
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:
|