parent
c976772b9e
commit
e8d7480a63
|
|
@ -9,6 +9,9 @@ Features
|
||||||
Compatibility change:
|
Compatibility change:
|
||||||
* Stripping leading and trailing whitespace of xlsx and csv values by default might change how your data gets parsed.
|
* Stripping leading and trailing whitespace of xlsx and csv values by default might change how your data gets parsed.
|
||||||
|
|
||||||
|
Bugs fixes:
|
||||||
|
* The `range` option everywhere doesn't fail on `[]` (#107)
|
||||||
|
|
||||||
## v0.7.0 / 2015-09-11
|
## v0.7.0 / 2015-09-11
|
||||||
|
|
||||||
Features
|
Features
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ module Squib
|
||||||
input = 0..(deck_size - 1) if input == :all
|
input = 0..(deck_size - 1) if input == :all
|
||||||
input = (input.to_i)..(input.to_i) if input.respond_to? :to_i
|
input = (input.to_i)..(input.to_i) if input.respond_to? :to_i
|
||||||
raise ArgumentError.new("#{input} must be Enumerable (i.e. respond_to :each).") unless input.respond_to? :each
|
raise ArgumentError.new("#{input} must be Enumerable (i.e. respond_to :each).") unless input.respond_to? :each
|
||||||
raise ArgumentError.new("#{input} is outside of deck range of 0..#{deck_size-1}") if input.max > (deck_size - 1)
|
raise ArgumentError.new("#{input} is outside of deck range of 0..#{deck_size-1}") if (!input.max.nil?) && (input.max > (deck_size - 1))
|
||||||
input
|
input
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,4 +33,9 @@ describe Squib::Args::CardRange do
|
||||||
expect(range.to_a).to eq([0])
|
expect(range.to_a).to eq([0])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'allows [] as an empty range' do
|
||||||
|
range = Squib::Args::CardRange.new([], deck_size: 5)
|
||||||
|
expect(range.to_a).to eq([])
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
Loading…
Reference in New Issue