despecable 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0a4a7ccf6f71926d7b730060c7a75bf7631115e6
4
- data.tar.gz: 674547978b66be016c57dba26ffa03ef048c5e25
3
+ metadata.gz: 98cd98797bdd7901e3577dc059fa92556d456c11
4
+ data.tar.gz: 3f23e8c9cb02084a5ac39161bbe2756f52512dc9
5
5
  SHA512:
6
- metadata.gz: 75ea855b04f42288d85ab46861979c0ee3031db1a88541a39419bac29abbe6c5689a7a0b0e272125efa3521c976e4f7808d858da5e1de199a86dcf5603495a92
7
- data.tar.gz: 15899dbf346f56ad6668562cbe69c31b249acc0a2716bc682d8c137701632d8acdddde240776984c74db5d2286de473c1ad05436e37048df65b328be43dbccfc
6
+ metadata.gz: bfe5b70765a7c8d6612df4d7746db2c49e887a5aae5d02ac879665d656646ac016abae7d12380c2e87ce773b5e063857838a4fe02ab6a874534fb55007b1312b
7
+ data.tar.gz: 1f0e453dc92b6df6830e0feb43c749d552475f57a997675a451e1209bf601e400720131cc017350e29611a33d612705bd269740062378d4c412ef3817fc1d3d9
@@ -10,6 +10,6 @@ class Despecable::DespecableError < StandardError
10
10
  end
11
11
 
12
12
  def introduction(name)
13
- "Invalid value for paramter #{name}."
13
+ "Invalid value for parameter #{name}."
14
14
  end
15
15
  end
@@ -1,5 +1,5 @@
1
1
  class Despecable::IncorrectParameterError < Despecable::DespecableError
2
2
  def introduction(name)
3
- "Incorrect value for paramter '#{name}'."
3
+ "Incorrect value for parameter '#{name}'."
4
4
  end
5
5
  end
@@ -35,7 +35,7 @@ module Despecable
35
35
  raise Despecable::InvalidParameterError, "Required type: integer"
36
36
  end
37
37
 
38
- def float
38
+ def float(value)
39
39
  Float(value)
40
40
  rescue ArgumentError
41
41
  raise unless /^invalid value for Float/ =~ $!.message
@@ -46,7 +46,11 @@ module Despecable
46
46
  @specd.append(name)
47
47
  if !params.key?(name) && options[:default]
48
48
  params[name] = options[:default]
49
+ elsif options[:array]
50
+ values = @spectacles.arrayify(params[name])
51
+ params[name] = values.map{|val| @spectacles.read(val, type, options)}
49
52
  elsif options[:arrayable] && @spectacles.arrayable?(params[name])
53
+ # TODO: deprecate arrayable in favor of array
50
54
  values = @spectacles.arrayify(params[name])
51
55
  params[name] = values.map{|val| @spectacles.read(val, type, options)}
52
56
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: despecable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Schwartz