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.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/moses.rb +12 -4
  3. data/moses.gemspec +1 -1
  4. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
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
- create_variable_option(arg, @args[next_index]) if variable_option? index
75
- create_boolean_option(arg) unless variable_option? index
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, value = nil)
106
+ def create_variable_option(flag, next_index)
104
107
  key = flag.gsub(/^--/, '').to_sym
105
- @options[key] = value ? value : true
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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "moses"
8
- s.version = "0.1.3"
8
+ s.version = "0.1.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Dayton Nolan"]
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.3
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: -1783026924940414943
130
+ hash: -1441504447573939489
131
131
  required_rubygems_version: !ruby/object:Gem::Requirement
132
132
  none: false
133
133
  requirements: