sinatra-param 1.0.0 → 1.0.1

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: 18a23f0baef3417d12254ac4083df075ffe7b05c
4
- data.tar.gz: 854af92a66e992f5c1b86dc14600f4715b6dc338
3
+ metadata.gz: dc4d0d398469bb52ab79a0948e317d1d125bff3d
4
+ data.tar.gz: a10c62771b154aa046b3c89a2b1b7dc728cbf26b
5
5
  SHA512:
6
- metadata.gz: 25576e0184a0adabe22e38f05c7b2a717506b1692e8c90e604f8af2a09214a1609bdf1b12cae630843a72f02d0660f75022cc7449763cd4dc972d011f9b8f536
7
- data.tar.gz: abbcb391d35a4cde22b8d5a1acc97bd8a312d494edeb27b399618e7b997f5edfa5ef0f264b332a75ac767b4dbb62d969682f6bd8d545a077960c1a231952f223
6
+ metadata.gz: 4e767c9fb0b92416432c59d53dd81b68ef9ad30250bdba869eaafc5b2415ac2d3319ad73d04b0a969b63bbbf16f8ab489be0b611540d3a38c6729e298975f639
7
+ data.tar.gz: 40bcc930eb0df82c3f154f32467fa56985174a6603db678f5f7fe634dab8f1fd352ce36d50b5360a7cc4a3c4ed0e7f16312493e8cbabcffaa7b91944613032d2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sinatra-param (1.0.0)
4
+ sinatra-param (1.0.1)
5
5
  sinatra (~> 1.3)
6
6
 
7
7
  GEM
@@ -10,8 +10,10 @@ GEM
10
10
  diff-lcs (1.2.4)
11
11
  multi_json (1.7.2)
12
12
  rack (1.5.2)
13
- rack-protection (1.5.0)
13
+ rack-protection (1.5.1)
14
14
  rack
15
+ rack-test (0.6.2)
16
+ rack (>= 1.0)
15
17
  rake (10.1.0)
16
18
  rspec (2.14.1)
17
19
  rspec-core (~> 2.14.0)
@@ -25,7 +27,7 @@ GEM
25
27
  multi_json (~> 1.0)
26
28
  simplecov-html (~> 0.7.1)
27
29
  simplecov-html (0.7.1)
28
- sinatra (1.4.3)
30
+ sinatra (1.4.4)
29
31
  rack (~> 1.4)
30
32
  rack-protection (~> 1.4)
31
33
  tilt (~> 1.3, >= 1.3.4)
@@ -35,6 +37,7 @@ PLATFORMS
35
37
  ruby
36
38
 
37
39
  DEPENDENCIES
40
+ rack-test
38
41
  rake
39
42
  rspec
40
43
  simplecov
@@ -1,5 +1,5 @@
1
1
  module Sinatra
2
2
  module Param
3
- VERSION = '1.0.0'
3
+ VERSION = '1.0.1'
4
4
  end
5
5
  end
data/lib/sinatra/param.rb CHANGED
@@ -5,6 +5,8 @@ require 'date'
5
5
 
6
6
  module Sinatra
7
7
  module Param
8
+ Boolean = :boolean
9
+
8
10
  class InvalidParameterError < StandardError; end
9
11
 
10
12
  def param(name, type, options = {})
@@ -52,7 +54,7 @@ module Sinatra
52
54
  return DateTime.parse(param) if type == DateTime
53
55
  return Array(param.split(options[:delimiter] || ",")) if type == Array
54
56
  return Hash[param.split(options[:delimiter] || ",").map{|c| c.split(options[:separator] || ":")}] if type == Hash
55
- return (/(false|f|no|n|0)$/i === param.to_s ? false : (/(true|t|yes|y|1)$/i === param.to_s ? true : nil)) if type == TrueClass || type == FalseClass || type == :boolean
57
+ return (/(false|f|no|n|0)$/i === param.to_s ? false : (/(true|t|yes|y|1)$/i === param.to_s ? true : nil)) if type == TrueClass || type == FalseClass || type == Boolean
56
58
  return nil
57
59
  end
58
60
 
Binary file
@@ -15,6 +15,7 @@ Gem::Specification.new do |s|
15
15
 
16
16
  s.add_development_dependency "rake"
17
17
  s.add_development_dependency "rspec"
18
+ s.add_development_dependency "rack-test"
18
19
  s.add_development_dependency "simplecov"
19
20
 
20
21
  s.files = Dir["./**/*"].reject { |file| file =~ /\.\/(bin|log|pkg|script|spec|test|vendor)/ }
data/spec/dummy/app.rb CHANGED
@@ -52,7 +52,7 @@ class App < Sinatra::Base
52
52
  end
53
53
 
54
54
  get '/coerce/boolean' do
55
- param :arg, :boolean
55
+ param :arg, Boolean
56
56
  params.to_json
57
57
  end
58
58
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-param
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mattt Thompson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-21 00:00:00.000000000 Z
11
+ date: 2013-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rack-test
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: simplecov
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -126,6 +140,7 @@ files:
126
140
  - ./LICENSE
127
141
  - ./Rakefile
128
142
  - ./README.md
143
+ - ./sinatra-param-1.0.0.gem
129
144
  - ./sinatra-param.gemspec
130
145
  - spec/dummy/app.rb
131
146
  - spec/parameter_sets_spec.rb