moses 0.1.3 → 0.1.4
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.
- data/VERSION +1 -1
- data/lib/moses.rb +12 -4
- data/moses.gemspec +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.4
|
data/lib/moses.rb
CHANGED
@@ -71,8 +71,11 @@ module Moses
|
|
71
71
|
@args.each_with_index do |arg, index|
|
72
72
|
if flag?(arg)
|
73
73
|
next_index = index + 1
|
74
|
-
|
75
|
-
|
74
|
+
if variable_option? index
|
75
|
+
create_variable_option(arg, next_index)
|
76
|
+
else
|
77
|
+
create_boolean_option(arg)
|
78
|
+
end
|
76
79
|
end
|
77
80
|
end
|
78
81
|
@args.delete_if { |a| flag?(a) }
|
@@ -100,9 +103,14 @@ module Moses
|
|
100
103
|
default_commands.include?(@command) || self.class.method_defined?(:commands) && [*commands].include?(@command) && self.class.method_defined?(@command)
|
101
104
|
end
|
102
105
|
|
103
|
-
def create_variable_option(flag,
|
106
|
+
def create_variable_option(flag, next_index)
|
104
107
|
key = flag.gsub(/^--/, '').to_sym
|
105
|
-
@
|
108
|
+
if not_flag? @args[next_index]
|
109
|
+
value = @args[next_index]
|
110
|
+
@args.delete_at next_index
|
111
|
+
end
|
112
|
+
|
113
|
+
@options[key] = value || true
|
106
114
|
end
|
107
115
|
|
108
116
|
def create_boolean_option(flag)
|
data/moses.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: moses
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -127,7 +127,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
127
127
|
version: '0'
|
128
128
|
segments:
|
129
129
|
- 0
|
130
|
-
hash: -
|
130
|
+
hash: -1441504447573939489
|
131
131
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
132
|
none: false
|
133
133
|
requirements:
|