sinatra-respond_to 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog.rdoc +5 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +39 -0
- data/{README.rdoc → README.md} +37 -33
- data/Rakefile +11 -36
- data/lib/sinatra/respond_to.rb +29 -42
- data/lib/sinatra/respond_to/version.rb +2 -2
- data/sinatra-respond_to.gemspec +27 -0
- data/spec/app/test_app.rb +1 -0
- data/spec/extension_spec.rb +8 -3
- data/spec/spec_helper.rb +4 -3
- metadata +127 -80
- data/Manifest.txt +0 -17
data/Changelog.rdoc
CHANGED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
sinatra-respond_to (0.5.0)
|
5
|
+
sinatra (~> 1.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: http://rubygems.org/
|
9
|
+
specs:
|
10
|
+
builder (2.1.2)
|
11
|
+
diff-lcs (1.1.2)
|
12
|
+
haml (3.0.17)
|
13
|
+
rack (1.2.1)
|
14
|
+
rack-test (0.5.4)
|
15
|
+
rack (>= 1.0)
|
16
|
+
rcov (0.9.8)
|
17
|
+
rspec (2.0.0.beta.19)
|
18
|
+
rspec-core (= 2.0.0.beta.19)
|
19
|
+
rspec-expectations (= 2.0.0.beta.19)
|
20
|
+
rspec-mocks (= 2.0.0.beta.19)
|
21
|
+
rspec-core (2.0.0.beta.19)
|
22
|
+
rspec-expectations (2.0.0.beta.19)
|
23
|
+
diff-lcs (>= 1.1.2)
|
24
|
+
rspec-mocks (2.0.0.beta.19)
|
25
|
+
sinatra (1.0)
|
26
|
+
rack (>= 1.0)
|
27
|
+
|
28
|
+
PLATFORMS
|
29
|
+
ruby
|
30
|
+
|
31
|
+
DEPENDENCIES
|
32
|
+
builder (>= 2.0)
|
33
|
+
bundler (~> 1.0.0.rc.5)
|
34
|
+
haml (>= 2.0)
|
35
|
+
rack-test (~> 0.5.4)
|
36
|
+
rcov (~> 0.9.8)
|
37
|
+
rspec (~> 2.0.0.beta.19)
|
38
|
+
sinatra (~> 1.0)
|
39
|
+
sinatra-respond_to!
|
data/{README.rdoc → README.md}
RENAMED
@@ -1,23 +1,25 @@
|
|
1
|
-
|
1
|
+
# sinatra-respond\_to
|
2
2
|
|
3
|
-
* http://www.github.com/cehoffman/sinatra-
|
3
|
+
* http://www.github.com/cehoffman/sinatra-respond\_to
|
4
4
|
|
5
|
-
|
5
|
+
## DESCRIPTION:
|
6
6
|
|
7
|
-
A
|
7
|
+
A respond\_to style Rails block for baked-in web service support in Sinatra
|
8
8
|
|
9
|
-
|
9
|
+
## FEATURES/PROBLEMS:
|
10
10
|
|
11
11
|
* Handles setting charset for appropriate types
|
12
12
|
* Handles setting the content type depending on what is being served
|
13
13
|
* Automatically can adjust XMLHttpRequests to return Javascript
|
14
14
|
|
15
|
-
|
15
|
+
## SYNOPSIS:
|
16
|
+
|
17
|
+
Allows urls of the form **/posts**, **/posts.rss**, and **/posts?format=atom** to route to the same Sinatra block and format specific respond\_to block.
|
16
18
|
|
17
19
|
require 'sinatra'
|
18
20
|
require 'sinatra/respond_to'
|
19
21
|
|
20
|
-
register Sinatra::RespondTo
|
22
|
+
Sinatra::Application.register Sinatra::RespondTo
|
21
23
|
|
22
24
|
get '/posts' do
|
23
25
|
@posts = Post.recent
|
@@ -50,7 +52,7 @@ A respond_to style Rails block for baked-in web service support in Sinatra
|
|
50
52
|
end
|
51
53
|
end
|
52
54
|
|
53
|
-
To change the character set of the response, there is a
|
55
|
+
To change the character set of the response, there is a `charset` helper. For example
|
54
56
|
|
55
57
|
get '/iso-8859-1' do
|
56
58
|
charset 'iso-8859-1'
|
@@ -64,33 +66,31 @@ To change the character set of the response, there is a <tt>charset</tt> helper.
|
|
64
66
|
end
|
65
67
|
end
|
66
68
|
|
67
|
-
|
69
|
+
## CONFIGURATION:
|
68
70
|
|
69
|
-
There a few options available for configuring the default behavior of
|
70
|
-
<tt>set</tt> utility.
|
71
|
+
There a few options available for configuring the default behavior of respond\_to using Sinatra's `set` utility.
|
71
72
|
|
72
|
-
*
|
73
|
-
|
74
|
-
|
75
|
-
*
|
76
|
-
|
77
|
-
|
78
|
-
*
|
79
|
-
|
80
|
-
|
81
|
-
|
73
|
+
* **default\_charset - utf-8**
|
74
|
+
Assumes all text documents are encoded using this character set.
|
75
|
+
This can be overridden within the respond_to block for the appropriate format
|
76
|
+
* **default\_content - :html**
|
77
|
+
When a user vists a url without an extension, for example /post this will be
|
78
|
+
the assumed content to serve first. Expects a symbol as used in setting content_type.
|
79
|
+
* **assume\_xhr\_is\_js - true**
|
80
|
+
To avoid headaches with accept headers, and appending .js to urls, this will
|
81
|
+
cause the default format for all XmlHttpRequests to be classified as wanting Javascript
|
82
|
+
in the response.
|
82
83
|
|
83
|
-
|
84
|
+
## REQUIREMENTS:
|
84
85
|
|
85
|
-
* sinatra
|
86
|
+
* sinatra 1.x
|
86
87
|
|
87
|
-
|
88
|
+
## INSTALL:
|
88
89
|
|
89
|
-
|
90
|
+
$ gem install sinatra-respond_to
|
90
91
|
|
91
|
-
|
92
|
-
Due to the way respond\_to works, all incoming requests have the extension striped from the request.path\_info.
|
93
|
-
This causes routes like the following to fail.
|
92
|
+
## CAVEATS:
|
93
|
+
Due to the way respond\_to works, all incoming requests have the extension striped from the request.path\_info. This causes routes like the following to fail.
|
94
94
|
|
95
95
|
get '/style.css' do
|
96
96
|
content_type :css, :charset => 'utf-8'
|
@@ -109,16 +109,20 @@ If you want to ensure the route only gets called for css requests try this. Thi
|
|
109
109
|
sass :style
|
110
110
|
end
|
111
111
|
|
112
|
-
|
112
|
+
## DEVELOPERS:
|
113
113
|
|
114
114
|
After checking out the source, run:
|
115
115
|
|
116
|
-
|
116
|
+
$ bundle install
|
117
|
+
$ rake spec:spec
|
118
|
+
|
119
|
+
This task will install any missing dependencies, run the tests/specs, and generate the RDoc.
|
120
|
+
|
121
|
+
## Contributors
|
117
122
|
|
118
|
-
|
119
|
-
and generate the RDoc.
|
123
|
+
* [Ryan Schenk](http://github.com/rschenk/)
|
120
124
|
|
121
|
-
|
125
|
+
## LICENSE:
|
122
126
|
|
123
127
|
(The MIT License)
|
124
128
|
|
data/Rakefile
CHANGED
@@ -1,41 +1,16 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
require 'hoe'
|
5
|
-
require File.expand_path(File.join('.', 'lib', 'sinatra', 'respond_to', 'version'))
|
6
|
-
|
7
|
-
Hoe.plugin :gemcutter
|
8
|
-
Hoe.plugin :clean
|
9
|
-
Hoe.plugin :git
|
10
|
-
|
11
|
-
Hoe.spec 'sinatra-respond_to' do
|
12
|
-
developer('Chris Hoffman', 'cehoffman@gmail.com')
|
13
|
-
extra_deps << ['sinatra', '>= 0.9.4']
|
14
|
-
extra_dev_deps << ['rspec', '>= 1.3.0']
|
15
|
-
extra_dev_deps << ['rcov', '>= 0.9.7.1']
|
16
|
-
extra_dev_deps << ['rack-test', '>= 0.5.3']
|
17
|
-
extra_dev_deps << ['haml', ">= 2.0"]
|
18
|
-
extra_dev_deps << ['builder', '>= 2.0']
|
19
|
-
self.readme_file = 'README.rdoc'
|
20
|
-
self.history_file = 'Changelog.rdoc'
|
21
|
-
self.test_globs = 'spec/*_spec.rb'
|
22
|
-
self.version = ::Sinatra::RespondTo::Version
|
23
|
-
end
|
1
|
+
require 'bundler'
|
2
|
+
Bundler::GemHelper.install_tasks
|
24
3
|
|
25
4
|
begin
|
26
|
-
require '
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
t.rcov_opts << '--sort' << 'coverage' << '--sort-reverse'
|
35
|
-
t.rcov_opts << '--comments' << '--exclude' << 'pkg,gems'
|
5
|
+
require 'rspec/core/rake_task'
|
6
|
+
namespace :spec do
|
7
|
+
desc 'Run specs'
|
8
|
+
RSpec::Core::RakeTask.new do |t|
|
9
|
+
t.rcov = true
|
10
|
+
t.rcov_opts = ['--sort coverage --text-summary --sort-reverse']
|
11
|
+
t.rcov_opts << "--comments --exclude spec,pkg,#{ENV['GEM_HOME']}"
|
12
|
+
end
|
36
13
|
end
|
37
14
|
rescue LoadError
|
38
|
-
puts
|
15
|
+
puts 'RSpec not available, try a bundle install'
|
39
16
|
end
|
40
|
-
|
41
|
-
# vim: syntax=ruby
|
data/lib/sinatra/respond_to.rb
CHANGED
@@ -44,10 +44,13 @@ module Sinatra
|
|
44
44
|
next if self.class.development? && request.path_info =~ %r{/__sinatra__/.*?.png}
|
45
45
|
|
46
46
|
unless options.static? && options.public? && (request.get? || request.head?) && static_file?(request.path_info)
|
47
|
-
request.
|
48
|
-
|
49
|
-
|
47
|
+
if request.params.has_key? 'format'
|
48
|
+
format params['format']
|
49
|
+
else
|
50
|
+
request.path_info.sub! %r{\.([^\./]+)$}, ''
|
50
51
|
|
52
|
+
format request.xhr? && options.assume_xhr_is_js? ? :js : $1 || options.default_content
|
53
|
+
end
|
51
54
|
charset options.default_charset if Sinatra::RespondTo::TEXT_MIME_TYPES.include? format
|
52
55
|
end
|
53
56
|
end
|
@@ -93,7 +96,7 @@ module Sinatra
|
|
93
96
|
layout = case engine
|
94
97
|
when 'haml' then "!!!\n%html\n %body= yield"
|
95
98
|
when 'erb' then "<html>\n <body>\n <%= yield %>\n </body>\n</html>"
|
96
|
-
when 'builder' then
|
99
|
+
when 'builder' then "xml << yield"
|
97
100
|
end
|
98
101
|
|
99
102
|
layout = "<small>app.#{format}.#{engine}</small>\n<pre>#{escape_html(layout)}</pre>"
|
@@ -129,31 +132,20 @@ module Sinatra
|
|
129
132
|
end
|
130
133
|
|
131
134
|
app.class_eval do
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
alias_method :render_without_format, :render
|
147
|
-
alias_method :render, :render_with_format
|
148
|
-
|
149
|
-
if ::Sinatra::VERSION =~ /^0\.9/
|
150
|
-
def lookup_layout_with_format(*args)
|
151
|
-
args[1] = "#{args[1]}.#{format}".to_sym if args[1].is_a?(::Symbol)
|
152
|
-
lookup_layout_without_format *args
|
153
|
-
end
|
154
|
-
alias_method :lookup_layout_without_format, :lookup_layout
|
155
|
-
alias_method :lookup_layout, :lookup_layout_with_format
|
156
|
-
end
|
135
|
+
# Changes in 1.0 Sinatra reuse render for layout so we store the
|
136
|
+
# original value to tell us if this is an automatic attempt to do a
|
137
|
+
# layout call. If it is, it might fail with Errno::ENOENT and we want
|
138
|
+
# to pass that back to sinatra since it isn't a MissingTemplate error
|
139
|
+
alias :render_without_format :render
|
140
|
+
def render(*args, &block)
|
141
|
+
assumed_layout = args[1] == :layout
|
142
|
+
args[1] = "#{args[1]}.#{format}".to_sym if args[1].is_a?(::Symbol)
|
143
|
+
render_without_format *args, &block
|
144
|
+
rescue Errno::ENOENT => e
|
145
|
+
raise MissingTemplate, "#{args[1]}.#{args[0]}" unless assumed_layout
|
146
|
+
raise e
|
147
|
+
end
|
148
|
+
private :render
|
157
149
|
end
|
158
150
|
end
|
159
151
|
|
@@ -163,30 +155,25 @@ module Sinatra
|
|
163
155
|
# doesn't have to do a reverse lookup on the header
|
164
156
|
def self.included(klass)
|
165
157
|
klass.class_eval do
|
166
|
-
|
158
|
+
alias :content_type_without_save :content_type
|
159
|
+
def content_type(*args)
|
167
160
|
content_type_without_save *args
|
168
|
-
@
|
161
|
+
@_format = args.first.to_sym
|
169
162
|
response['Content-Type']
|
170
163
|
end
|
171
|
-
|
172
|
-
alias_method :content_type, :content_type_with_save
|
173
|
-
end if ::Sinatra::VERSION =~ /^1.0/
|
174
|
-
end
|
175
|
-
|
176
|
-
def self.mime_type(sym)
|
177
|
-
::Sinatra::Base.respond_to?(:media_type) && ::Sinatra::Base.media_type(sym) || ::Sinatra::Base.mime_type(sym)
|
164
|
+
end
|
178
165
|
end
|
179
166
|
|
180
167
|
def format(val=nil)
|
181
168
|
unless val.nil?
|
182
|
-
mime_type = ::Sinatra::
|
169
|
+
mime_type = ::Sinatra::Base.mime_type(val)
|
183
170
|
fail "Unknown media type #{val}\nTry registering the extension with a mime type" if mime_type.nil?
|
184
171
|
|
185
|
-
@
|
172
|
+
@_format = val.to_sym
|
186
173
|
response['Content-Type'].sub!(/^[^;]+/, mime_type)
|
187
174
|
end
|
188
175
|
|
189
|
-
@
|
176
|
+
@_format
|
190
177
|
end
|
191
178
|
|
192
179
|
# This is mostly just a helper so request.path_info isn't changed when
|
@@ -213,7 +200,7 @@ module Sinatra
|
|
213
200
|
def respond_to(&block)
|
214
201
|
wants = {}
|
215
202
|
def wants.method_missing(type, *args, &handler)
|
216
|
-
::Sinatra::Base.send(:fail, "Unknown media type for respond_to: #{type}\nTry registering the extension with a mime type") if ::Sinatra::
|
203
|
+
::Sinatra::Base.send(:fail, "Unknown media type for respond_to: #{type}\nTry registering the extension with a mime type") if ::Sinatra::Base.mime_type(type).nil?
|
217
204
|
self[type] = handler
|
218
205
|
end
|
219
206
|
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/sinatra/respond_to/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = 'sinatra-respond_to'
|
6
|
+
s.version = Sinatra::RespondTo::Version
|
7
|
+
s.platform = Gem::Platform::RUBY
|
8
|
+
s.authors = ['Chris Hoffman']
|
9
|
+
s.email = ['cehoffman@gmail.com']
|
10
|
+
s.homepage = 'http://github.com/cehoffman/sinatra-respond_to'
|
11
|
+
s.summary = 'A respond_to style Rails block for baked-in web service support in Sinatra'
|
12
|
+
|
13
|
+
s.required_rubygems_version = '>= 1.3.6'
|
14
|
+
|
15
|
+
s.add_runtime_dependency 'sinatra', '~> 1.0'
|
16
|
+
|
17
|
+
s.add_development_dependency 'bundler', '~> 1.0.0.rc.5'
|
18
|
+
s.add_development_dependency 'rspec', '~> 2.0.0.beta.19'
|
19
|
+
s.add_development_dependency 'rack-test', '~> 0.5.4'
|
20
|
+
s.add_development_dependency 'rcov', '~> 0.9.8'
|
21
|
+
s.add_development_dependency 'builder', '>= 2.0'
|
22
|
+
s.add_development_dependency 'haml', '>= 2.0'
|
23
|
+
|
24
|
+
s.test_files = Dir['spec/**/*']
|
25
|
+
s.files = `git ls-files`.split("\n") - ['.gitignore', '.rspec']
|
26
|
+
s.require_path = 'lib'
|
27
|
+
end
|
data/spec/app/test_app.rb
CHANGED
data/spec/extension_spec.rb
CHANGED
@@ -2,7 +2,7 @@ require File.join(File.dirname(__FILE__), 'spec_helper')
|
|
2
2
|
|
3
3
|
describe Sinatra::RespondTo do
|
4
4
|
def mime_type(sym)
|
5
|
-
::Sinatra::Base.
|
5
|
+
::Sinatra::Base.mime_type(sym)
|
6
6
|
end
|
7
7
|
|
8
8
|
describe "options" do
|
@@ -41,6 +41,11 @@ describe Sinatra::RespondTo do
|
|
41
41
|
end
|
42
42
|
|
43
43
|
describe "extension routing" do
|
44
|
+
it "should use a format parameter before sniffing out the extension" do
|
45
|
+
get "/resource?format=xml"
|
46
|
+
last_response.body.should =~ %r{\s*<root>Some XML</root>\s*}
|
47
|
+
end
|
48
|
+
|
44
49
|
it "breaks routes expecting an extension" do
|
45
50
|
# In test_app.rb the route is defined as get '/style.css' instead of get '/style'
|
46
51
|
get "/style.css"
|
@@ -338,7 +343,7 @@ describe Sinatra::RespondTo do
|
|
338
343
|
content_type :xhtml
|
339
344
|
|
340
345
|
format.should == :xhtml
|
341
|
-
end
|
346
|
+
end
|
342
347
|
end
|
343
348
|
|
344
349
|
describe "static_file?" do
|
@@ -398,4 +403,4 @@ describe Sinatra::RespondTo do
|
|
398
403
|
end
|
399
404
|
end
|
400
405
|
end
|
401
|
-
end
|
406
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
#$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
|
-
require '
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'rspec'
|
5
6
|
require 'rack/test'
|
6
7
|
|
7
8
|
require File.join(File.dirname(__FILE__), '..', 'lib', 'sinatra', 'respond_to')
|
8
9
|
require File.join(File.dirname(__FILE__), 'app', 'test_app')
|
9
10
|
require File.join(File.dirname(__FILE__), 'app', 'production_error_app')
|
10
11
|
|
11
|
-
|
12
|
+
RSpec.configure do |config|
|
12
13
|
def app
|
13
14
|
@app ||= ::Rack::Builder.new do
|
14
15
|
run ::TestApp
|
@@ -16,4 +17,4 @@ Spec::Runner.configure do |config|
|
|
16
17
|
end
|
17
18
|
|
18
19
|
config.include ::Rack::Test::Methods
|
19
|
-
end
|
20
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-respond_to
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 11
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 5
|
9
|
+
- 0
|
10
|
+
version: 0.5.0
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Chris Hoffman
|
@@ -9,154 +15,195 @@ autorequire:
|
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date: 2010-
|
18
|
+
date: 2010-08-22 00:00:00 -05:00
|
13
19
|
default_executable:
|
14
20
|
dependencies:
|
15
21
|
- !ruby/object:Gem::Dependency
|
16
22
|
name: sinatra
|
17
|
-
|
18
|
-
|
19
|
-
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
20
26
|
requirements:
|
21
|
-
- -
|
27
|
+
- - ~>
|
22
28
|
- !ruby/object:Gem::Version
|
23
|
-
|
24
|
-
|
29
|
+
hash: 15
|
30
|
+
segments:
|
31
|
+
- 1
|
32
|
+
- 0
|
33
|
+
version: "1.0"
|
34
|
+
type: :runtime
|
35
|
+
version_requirements: *id001
|
25
36
|
- !ruby/object:Gem::Dependency
|
26
|
-
name:
|
27
|
-
|
28
|
-
|
29
|
-
|
37
|
+
name: bundler
|
38
|
+
prerelease: false
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
30
41
|
requirements:
|
31
|
-
- -
|
42
|
+
- - ~>
|
32
43
|
- !ruby/object:Gem::Version
|
33
|
-
|
34
|
-
|
35
|
-
-
|
36
|
-
|
44
|
+
hash: 15424063
|
45
|
+
segments:
|
46
|
+
- 1
|
47
|
+
- 0
|
48
|
+
- 0
|
49
|
+
- rc
|
50
|
+
- 5
|
51
|
+
version: 1.0.0.rc.5
|
37
52
|
type: :development
|
38
|
-
|
39
|
-
version_requirements: !ruby/object:Gem::Requirement
|
40
|
-
requirements:
|
41
|
-
- - ">="
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: 0.3.0
|
44
|
-
version:
|
53
|
+
version_requirements: *id002
|
45
54
|
- !ruby/object:Gem::Dependency
|
46
55
|
name: rspec
|
47
|
-
|
48
|
-
|
49
|
-
|
56
|
+
prerelease: false
|
57
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
50
59
|
requirements:
|
51
|
-
- -
|
60
|
+
- - ~>
|
52
61
|
- !ruby/object:Gem::Version
|
53
|
-
|
54
|
-
|
55
|
-
-
|
56
|
-
|
62
|
+
hash: 62196421
|
63
|
+
segments:
|
64
|
+
- 2
|
65
|
+
- 0
|
66
|
+
- 0
|
67
|
+
- beta
|
68
|
+
- 19
|
69
|
+
version: 2.0.0.beta.19
|
57
70
|
type: :development
|
58
|
-
|
59
|
-
version_requirements: !ruby/object:Gem::Requirement
|
60
|
-
requirements:
|
61
|
-
- - ">="
|
62
|
-
- !ruby/object:Gem::Version
|
63
|
-
version: 0.9.7.1
|
64
|
-
version:
|
71
|
+
version_requirements: *id003
|
65
72
|
- !ruby/object:Gem::Dependency
|
66
73
|
name: rack-test
|
67
|
-
|
68
|
-
|
69
|
-
|
74
|
+
prerelease: false
|
75
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
76
|
+
none: false
|
70
77
|
requirements:
|
71
|
-
- -
|
78
|
+
- - ~>
|
72
79
|
- !ruby/object:Gem::Version
|
73
|
-
|
74
|
-
|
75
|
-
-
|
76
|
-
|
80
|
+
hash: 3
|
81
|
+
segments:
|
82
|
+
- 0
|
83
|
+
- 5
|
84
|
+
- 4
|
85
|
+
version: 0.5.4
|
77
86
|
type: :development
|
78
|
-
|
79
|
-
|
87
|
+
version_requirements: *id004
|
88
|
+
- !ruby/object:Gem::Dependency
|
89
|
+
name: rcov
|
90
|
+
prerelease: false
|
91
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
92
|
+
none: false
|
80
93
|
requirements:
|
81
|
-
- -
|
94
|
+
- - ~>
|
82
95
|
- !ruby/object:Gem::Version
|
83
|
-
|
84
|
-
|
96
|
+
hash: 43
|
97
|
+
segments:
|
98
|
+
- 0
|
99
|
+
- 9
|
100
|
+
- 8
|
101
|
+
version: 0.9.8
|
102
|
+
type: :development
|
103
|
+
version_requirements: *id005
|
85
104
|
- !ruby/object:Gem::Dependency
|
86
105
|
name: builder
|
87
|
-
|
88
|
-
|
89
|
-
|
106
|
+
prerelease: false
|
107
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
108
|
+
none: false
|
90
109
|
requirements:
|
91
110
|
- - ">="
|
92
111
|
- !ruby/object:Gem::Version
|
112
|
+
hash: 3
|
113
|
+
segments:
|
114
|
+
- 2
|
115
|
+
- 0
|
93
116
|
version: "2.0"
|
94
|
-
version:
|
95
|
-
- !ruby/object:Gem::Dependency
|
96
|
-
name: hoe
|
97
117
|
type: :development
|
98
|
-
|
99
|
-
|
118
|
+
version_requirements: *id006
|
119
|
+
- !ruby/object:Gem::Dependency
|
120
|
+
name: haml
|
121
|
+
prerelease: false
|
122
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
123
|
+
none: false
|
100
124
|
requirements:
|
101
125
|
- - ">="
|
102
126
|
- !ruby/object:Gem::Version
|
103
|
-
|
104
|
-
|
105
|
-
|
127
|
+
hash: 3
|
128
|
+
segments:
|
129
|
+
- 2
|
130
|
+
- 0
|
131
|
+
version: "2.0"
|
132
|
+
type: :development
|
133
|
+
version_requirements: *id007
|
134
|
+
description:
|
106
135
|
email:
|
107
136
|
- cehoffman@gmail.com
|
108
137
|
executables: []
|
109
138
|
|
110
139
|
extensions: []
|
111
140
|
|
112
|
-
extra_rdoc_files:
|
113
|
-
|
141
|
+
extra_rdoc_files: []
|
142
|
+
|
114
143
|
files:
|
115
144
|
- Changelog.rdoc
|
116
|
-
-
|
117
|
-
-
|
145
|
+
- Gemfile
|
146
|
+
- Gemfile.lock
|
147
|
+
- README.md
|
118
148
|
- Rakefile
|
119
149
|
- lib/sinatra/respond_to.rb
|
120
150
|
- lib/sinatra/respond_to/version.rb
|
121
|
-
-
|
122
|
-
- spec/extension_spec.rb
|
151
|
+
- sinatra-respond_to.gemspec
|
123
152
|
- spec/app/production_error_app.rb
|
153
|
+
- spec/app/public/static folder/.keep
|
154
|
+
- spec/app/public/static.txt
|
124
155
|
- spec/app/test_app.rb
|
125
156
|
- spec/app/unreachable_static.txt
|
126
|
-
- spec/app/public/static.txt
|
127
|
-
- spec/app/public/static folder/.keep
|
128
157
|
- spec/app/views/layout.html.haml
|
129
158
|
- spec/app/views/resource.html.haml
|
130
159
|
- spec/app/views/resource.js.erb
|
131
160
|
- spec/app/views/resource.xml.builder
|
161
|
+
- spec/extension_spec.rb
|
162
|
+
- spec/spec_helper.rb
|
132
163
|
has_rdoc: true
|
133
|
-
homepage: http://
|
164
|
+
homepage: http://github.com/cehoffman/sinatra-respond_to
|
134
165
|
licenses: []
|
135
166
|
|
136
167
|
post_install_message:
|
137
|
-
rdoc_options:
|
138
|
-
|
139
|
-
- README.rdoc
|
168
|
+
rdoc_options: []
|
169
|
+
|
140
170
|
require_paths:
|
141
171
|
- lib
|
142
172
|
required_ruby_version: !ruby/object:Gem::Requirement
|
173
|
+
none: false
|
143
174
|
requirements:
|
144
175
|
- - ">="
|
145
176
|
- !ruby/object:Gem::Version
|
177
|
+
hash: 3
|
178
|
+
segments:
|
179
|
+
- 0
|
146
180
|
version: "0"
|
147
|
-
version:
|
148
181
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
182
|
+
none: false
|
149
183
|
requirements:
|
150
184
|
- - ">="
|
151
185
|
- !ruby/object:Gem::Version
|
152
|
-
|
153
|
-
|
186
|
+
hash: 23
|
187
|
+
segments:
|
188
|
+
- 1
|
189
|
+
- 3
|
190
|
+
- 6
|
191
|
+
version: 1.3.6
|
154
192
|
requirements: []
|
155
193
|
|
156
|
-
rubyforge_project:
|
157
|
-
rubygems_version: 1.3.
|
194
|
+
rubyforge_project:
|
195
|
+
rubygems_version: 1.3.7
|
158
196
|
signing_key:
|
159
197
|
specification_version: 3
|
160
198
|
summary: A respond_to style Rails block for baked-in web service support in Sinatra
|
161
199
|
test_files:
|
200
|
+
- spec/app/production_error_app.rb
|
201
|
+
- spec/app/public/static.txt
|
202
|
+
- spec/app/test_app.rb
|
203
|
+
- spec/app/unreachable_static.txt
|
204
|
+
- spec/app/views/layout.html.haml
|
205
|
+
- spec/app/views/resource.html.haml
|
206
|
+
- spec/app/views/resource.js.erb
|
207
|
+
- spec/app/views/resource.xml.builder
|
162
208
|
- spec/extension_spec.rb
|
209
|
+
- spec/spec_helper.rb
|
data/Manifest.txt
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
Changelog.rdoc
|
2
|
-
Manifest.txt
|
3
|
-
README.rdoc
|
4
|
-
Rakefile
|
5
|
-
lib/sinatra/respond_to.rb
|
6
|
-
lib/sinatra/respond_to/version.rb
|
7
|
-
spec/spec_helper.rb
|
8
|
-
spec/extension_spec.rb
|
9
|
-
spec/app/production_error_app.rb
|
10
|
-
spec/app/test_app.rb
|
11
|
-
spec/app/unreachable_static.txt
|
12
|
-
spec/app/public/static.txt
|
13
|
-
spec/app/public/static folder/.keep
|
14
|
-
spec/app/views/layout.html.haml
|
15
|
-
spec/app/views/resource.html.haml
|
16
|
-
spec/app/views/resource.js.erb
|
17
|
-
spec/app/views/resource.xml.builder
|