interpol 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -0
- data/lib/interpol/sinatra/request_params_parser.rb +8 -1
- data/lib/interpol/stub_app.rb +5 -4
- data/lib/interpol/version.rb +1 -1
- metadata +3 -3
data/Rakefile
CHANGED
@@ -142,11 +142,18 @@ module Interpol
|
|
142
142
|
end
|
143
143
|
|
144
144
|
def with_parsed_params
|
145
|
-
@
|
145
|
+
unless @_skip_param_parsing
|
146
|
+
@_parsed_params = request_params_parser.validate_and_parse_params(self)
|
147
|
+
end
|
148
|
+
|
146
149
|
yield
|
147
150
|
ensure
|
148
151
|
@_parsed_params = nil
|
149
152
|
end
|
153
|
+
|
154
|
+
def skip_param_parsing!
|
155
|
+
@_skip_param_parsing = true
|
156
|
+
end
|
150
157
|
end
|
151
158
|
end
|
152
159
|
end
|
data/lib/interpol/stub_app.rb
CHANGED
@@ -23,10 +23,11 @@ module Interpol
|
|
23
23
|
@config = config
|
24
24
|
|
25
25
|
@app = ::Sinatra.new do
|
26
|
-
set
|
27
|
-
not_found
|
28
|
-
before
|
29
|
-
|
26
|
+
set :stub_app_builder, builder
|
27
|
+
not_found { JSON.dump(:error => "The requested resource could not be found") }
|
28
|
+
before { content_type "application/json;charset=utf-8" }
|
29
|
+
before('/__ping') { skip_param_parsing! if respond_to?(:skip_param_parsing!) }
|
30
|
+
get('/__ping') { JSON.dump(:message => "Interpol stub app running.") }
|
30
31
|
|
31
32
|
def self.name
|
32
33
|
"Interpol::StubApp (anonymous)"
|
data/lib/interpol/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: interpol
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -223,7 +223,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
223
223
|
version: '0'
|
224
224
|
segments:
|
225
225
|
- 0
|
226
|
-
hash:
|
226
|
+
hash: 4001494580876368258
|
227
227
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
228
228
|
none: false
|
229
229
|
requirements:
|
@@ -232,7 +232,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
232
232
|
version: '0'
|
233
233
|
segments:
|
234
234
|
- 0
|
235
|
-
hash:
|
235
|
+
hash: 4001494580876368258
|
236
236
|
requirements: []
|
237
237
|
rubyforge_project:
|
238
238
|
rubygems_version: 1.8.24
|