wd_sinatra 0.3.0 → 0.3.1
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.
- data/CHANGELOG.md +5 -0
- data/README.md +4 -0
- data/lib/wd_sinatra/sinatra_ext.rb +7 -3
- data/lib/wd_sinatra/version.rb +1 -1
- data/templates/Gemfile +3 -5
- data/templates/config/{airbrake.yml → airbrake.yml.sample} +0 -0
- data/templates/config/environments/production.rb +1 -0
- data/wd-sinatra.gemspec +1 -1
- metadata +9 -7
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -174,6 +174,7 @@ The request dispatcher offers a fews hooks which you can see demonstrated in
|
|
174
174
|
* `params_postprocessor_hook(params)`
|
175
175
|
* `params_exception_handler(exception)`
|
176
176
|
* `pre_dispatch_hook`
|
177
|
+
* `post_dispatch_hook(response)`
|
177
178
|
|
178
179
|
The two first hooks are used to process the params and when implemented
|
179
180
|
are expected to return the params that will be used in the request.
|
@@ -186,6 +187,9 @@ The `pre_dispatch_hook` is called just before the request is dispatched
|
|
186
187
|
to the service implementation. This is where you might want to implement
|
187
188
|
an authentication verification system for instance.
|
188
189
|
|
190
|
+
The `post_dispatch_hook` is called, as you might have guessed it, after
|
191
|
+
the response is dispatched but before it gets sent back to the client.
|
192
|
+
|
189
193
|
These hooks have access to the entire request context, including the
|
190
194
|
`service` being called. You can use the service `extra` option to set
|
191
195
|
some custom settings that can then be used in this pre dispatch hook.
|
@@ -78,10 +78,14 @@ class WeaselDiesel
|
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
81
|
-
# Define WeaselDiesel::RequestHandler#authorization_check in your app if
|
82
|
-
# you want to use an auth check.
|
83
81
|
pre_dispatch_hook if self.respond_to?(:pre_dispatch_hook)
|
84
|
-
|
82
|
+
if self.respond_to?(:post_dispatch_hook)
|
83
|
+
body = service_dispatch
|
84
|
+
post_dispatch_hook
|
85
|
+
body
|
86
|
+
else
|
87
|
+
service_dispatch
|
88
|
+
end
|
85
89
|
end
|
86
90
|
|
87
91
|
# Forwarding some methods to the underlying app object
|
data/lib/wd_sinatra/version.rb
CHANGED
data/templates/Gemfile
CHANGED
@@ -7,12 +7,10 @@ gem "weasel_diesel"
|
|
7
7
|
gem "wd_sinatra"
|
8
8
|
# gem 'wd_newrelic_rpm', :require => 'newrelic_rpm'
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
gem 'json'
|
13
|
-
end
|
10
|
+
gem 'backports', '2.3.0', :platform => 'ruby_18'
|
11
|
+
gem 'json', :platform => 'ruby_18'
|
14
12
|
|
15
|
-
|
13
|
+
group :development, :test do
|
16
14
|
gem "rack-test", "0.6.1"
|
17
15
|
# gem "foreman"
|
18
16
|
# gem "puma"
|
File without changes
|
data/wd-sinatra.gemspec
CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |gem|
|
|
6
6
|
gem.email = ["mattaimonetti@gmail.com"]
|
7
7
|
gem.description = %q{Weasel-Diesel Sinatra app gem, allowing you to generate/update sinatra apps using the Weasel Diesel DSL}
|
8
8
|
gem.summary = %q{Weasel-Diesel Sinatra app gem, allowing you to generate/update sinatra apps using the Weasel Diesel DSL}
|
9
|
-
gem.homepage = "https://github.com/mattetti/
|
9
|
+
gem.homepage = "https://github.com/mattetti/wd-sinatra"
|
10
10
|
|
11
11
|
gem.files = `git ls-files`.split($\)
|
12
12
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wd_sinatra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 1
|
10
|
+
version: 0.3.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Matt Aimonetti
|
@@ -15,7 +15,8 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-06-
|
18
|
+
date: 2012-06-28 00:00:00 -07:00
|
19
|
+
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: weasel_diesel
|
@@ -75,7 +76,7 @@ files:
|
|
75
76
|
- templates/api/hello_world.rb
|
76
77
|
- templates/bin/console
|
77
78
|
- templates/config.ru
|
78
|
-
- templates/config/airbrake.yml
|
79
|
+
- templates/config/airbrake.yml.sample
|
79
80
|
- templates/config/environments/default.rb
|
80
81
|
- templates/config/environments/production.rb
|
81
82
|
- templates/config/environments/test.rb
|
@@ -145,7 +146,8 @@ files:
|
|
145
146
|
- templates/test/integration/hello_world_test.rb
|
146
147
|
- templates/test/test_helpers.rb
|
147
148
|
- wd-sinatra.gemspec
|
148
|
-
|
149
|
+
has_rdoc: true
|
150
|
+
homepage: https://github.com/mattetti/wd-sinatra
|
149
151
|
licenses: []
|
150
152
|
|
151
153
|
post_install_message:
|
@@ -174,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
176
|
requirements: []
|
175
177
|
|
176
178
|
rubyforge_project:
|
177
|
-
rubygems_version: 1.
|
179
|
+
rubygems_version: 1.5.3
|
178
180
|
signing_key:
|
179
181
|
specification_version: 3
|
180
182
|
summary: Weasel-Diesel Sinatra app gem, allowing you to generate/update sinatra apps using the Weasel Diesel DSL
|