rcoli 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/rcoli/model.rb +19 -0
- data/lib/rcoli/version.rb +1 -1
- data/lib/rcoli.rb +1 -0
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/lib/rcoli/model.rb
CHANGED
@@ -135,6 +135,14 @@ module RCoLi
|
|
135
135
|
setter :description
|
136
136
|
setter :syntax
|
137
137
|
|
138
|
+
def solitaire
|
139
|
+
@solitaire = true
|
140
|
+
end
|
141
|
+
|
142
|
+
def solitaire?
|
143
|
+
return true == @solitaire
|
144
|
+
end
|
145
|
+
|
138
146
|
def initialize(name)
|
139
147
|
@name = name
|
140
148
|
end
|
@@ -168,12 +176,23 @@ module RCoLi
|
|
168
176
|
parse_args(args, result)
|
169
177
|
if result.command
|
170
178
|
action = result.command.get_action
|
179
|
+
raise "Invalid configuration. Missing action block." unless action
|
180
|
+
context.instance_exec(result.global_options, result.options, result.arguments, &@pre_action) if (@pre_action and !result.command.solitaire?)
|
171
181
|
context.instance_exec(result.global_options, result.options, result.arguments, &action)
|
182
|
+
context.instance_exec(result.global_options, result.options, result.arguments, &@post_action) if (@post_action and !result.command.solitaire?)
|
172
183
|
else
|
173
184
|
say "Display UI"
|
174
185
|
end
|
175
186
|
end
|
176
187
|
|
188
|
+
def pre(&block)
|
189
|
+
@pre_action = block
|
190
|
+
end
|
191
|
+
|
192
|
+
def post(&block)
|
193
|
+
@post_action = block
|
194
|
+
end
|
195
|
+
|
177
196
|
end
|
178
197
|
|
179
198
|
|
data/lib/rcoli/version.rb
CHANGED
data/lib/rcoli.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rcoli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -77,7 +77,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
77
77
|
version: '0'
|
78
78
|
segments:
|
79
79
|
- 0
|
80
|
-
hash:
|
80
|
+
hash: 4363719608537841093
|
81
81
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
82
|
none: false
|
83
83
|
requirements:
|
@@ -86,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
86
86
|
version: '0'
|
87
87
|
segments:
|
88
88
|
- 0
|
89
|
-
hash:
|
89
|
+
hash: 4363719608537841093
|
90
90
|
requirements: []
|
91
91
|
rubyforge_project:
|
92
92
|
rubygems_version: 1.8.24
|