async_sinatra 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Binary file
@@ -0,0 +1,5 @@
1
+ === 0.4.0 / <%= Time.new.strftime("%Y-%m-%d") %>
2
+
3
+ * 1 major enhancement
4
+
5
+ * Moved to Hoe!
@@ -0,0 +1,9 @@
1
+ CHANGELOG.rdoc
2
+ Manifest.txt
3
+ README.rdoc
4
+ Rakefile
5
+ examples/basic.ru
6
+ lib/async_sinatra.rb
7
+ lib/sinatra/async.rb
8
+ lib/sinatra/async/test.rb
9
+ test/test_async.rb
@@ -1,8 +1,7 @@
1
1
  = async_sinatra
2
- by James Tucker
3
- http://ra66i.org
4
- http://github.com/raggi/async_sinatra
5
- http://libraggi.rubyforge.org/async_sinatra
2
+
3
+ http://github.com/raggi/async_sinatra
4
+ http://libraggi.rubyforge.org/async_sinatra
6
5
 
7
6
  == DESCRIPTION:
8
7
 
data/Rakefile CHANGED
@@ -1,97 +1,23 @@
1
1
  #!/usr/bin/env rake
2
- require 'rake/clean'
3
2
 
4
- task :default => :test
3
+ require 'hoe'
4
+ Hoe.plugin :doofus, :git, :minitest, :gemspec2, :rubyforge
5
5
 
6
- def spec(file = Dir['*.gemspec'].first)
7
- @spec ||=
8
- begin
9
- require 'rubygems/specification'
10
- Thread.abort_on_exception = true
11
- data = File.read(file)
12
- spec = nil
13
- Thread.new { spec = eval("$SAFE = 3\n#{data}") }.join
14
- spec.instance_variable_set(:@filename, file)
15
- def spec.filename; @filename; end
16
- spec
17
- end
18
- end
19
-
20
- def manifest; @manifest ||= `git ls-files`.split("\n").reject{|s|s=~/\.gemspec$|\.gitignore$/}; end
21
-
22
- require 'rubygems/package_task'
23
- def gem_task; @gem_task ||= Gem::PackageTask.new(spec); end
24
- gem_task.define
25
- Rake::Task[:clobber].enhance [:clobber_package]
26
-
27
- require 'rake/testtask'
28
- Rake::TestTask.new do |t|
29
- t.test_files = spec.test_files
30
- t.ruby_opts = ['-rubygems']
31
- t.warning = true
32
- end unless spec.test_files.empty?
6
+ Hoe.spec 'async_sinatra' do
7
+ developer 'raggi', 'raggi@rubyforge.org'
33
8
 
34
- require 'rdoc/task'
35
- rdtask = RDoc::Task.new do |rd|
36
- rd.title = spec.name
37
- rd.main = spec.extra_rdoc_files.first
38
- lib_rexp = spec.require_paths.map { |p| Regexp.escape p }.join('|')
39
- rd.rdoc_files.include(*manifest.grep(/^(?:#{lib_rexp})/))
40
- rd.rdoc_files.include(*spec.extra_rdoc_files)
41
- end
42
-
43
- Rake::Task[:clobber].enhance [:clobber_rdoc]
9
+ extra_deps << %w[rack >=1.2.1]
10
+ extra_deps << %w[sinatra >=1.0]
44
11
 
45
- require 'yaml'
46
- require 'rake/contrib/sshpublisher'
47
- desc "Publish rdoc to rubyforge"
48
- task :publish => rdtask.name do
49
- rf_cfg = File.expand_path '~/.rubyforge/user-config.yml'
50
- host = "#{YAML.load_file(rf_cfg)['username']}@rubyforge.org"
51
- remote_dir = "/var/www/gforge-projects/#{spec.rubyforge_project}/#{spec.name}/"
52
- Rake::SshDirPublisher.new(host, remote_dir, rdtask.rdoc_dir).upload
53
- end
12
+ extra_dev_deps << %w(hoe-doofus >=1.0)
13
+ extra_dev_deps << %w(hoe-seattlerb >=1.2)
14
+ extra_dev_deps << %w(hoe-git >=1.3)
15
+ extra_dev_deps << %w(hoe-gemspec2 >=1.0)
16
+ extra_dev_deps << %w(rdoc)
17
+ extra_dev_deps << %w(eventmachine >=0.12.11)
54
18
 
55
- desc 'Generate and open documentation'
56
- task :docs => :rdoc do
57
- path = rdtask.send :rdoc_target
58
- case RUBY_PLATFORM
59
- when /darwin/ ; sh "open #{path}"
60
- when /mswin|mingw/ ; sh "start #{path}"
61
- else
62
- sh "firefox #{path}"
63
- end
19
+ self.extra_rdoc_files = FileList["**/*.rdoc"]
20
+ self.history_file = "CHANGELOG.rdoc"
21
+ self.readme_file = "README.rdoc"
22
+ self.rubyforge_name = 'libraggi'
64
23
  end
65
-
66
- desc "Regenerate gemspec"
67
- task :gemspec => spec.filename
68
-
69
- task spec.filename do
70
- spec.files = manifest
71
- spec.test_files = manifest.grep(%r{test/test_.*\.rb})
72
- open(spec.filename, 'w') { |w| w.write spec.to_ruby }
73
- end
74
-
75
- desc "Bump version from #{spec.version} to #{spec.version.to_s.succ}"
76
- task :bump do
77
- spec.version = spec.version.to_s.succ
78
- spec.date = Time.now
79
- end
80
-
81
- desc "Tag version #{spec.version}"
82
- task :tag do
83
- tagged = Dir.new('.git/refs/tags').entries.include? spec.version.to_s
84
- if tagged
85
- warn "Tag #{spec.version} already exists"
86
- else
87
- # TODO release message in tag message
88
- sh "git tag #{spec.version}"
89
- end
90
- end
91
-
92
- desc "Release #{gem_task.gem_spec.file_name}"
93
- task :release => [:tag, :gem, :publish] do |t|
94
- sh "rubyforge add_release #{spec.rubyforge_project} #{spec.name} #{spec.version} #{gem_task.package_dir}/#{gem_task.gem_spec.file_name}"
95
- sh "gem push #{gem_task.package_dir}/#{gem_task.gem_spec.file_name}"
96
- sh "git push --all --tags"
97
- end
@@ -0,0 +1,6 @@
1
+ require 'sinatra/async'
2
+ # This is just a stub module for documentation and versioning. Please see
3
+ # Sinatra::Async.
4
+ module AsyncSinatra
5
+ VERSION = '0.4.0'
6
+ end
@@ -93,6 +93,12 @@ class TestSinatraAsync < Test::Unit::TestCase
93
93
  def app
94
94
  TestApp.new
95
95
  end
96
+
97
+ def assert_redirect(path)
98
+ r = last_request.env
99
+ uri = r['rack.url_scheme'] + '://' + r['SERVER_NAME'] + path
100
+ assert_equal uri, last_response.location
101
+ end
96
102
 
97
103
  def test_basic_async_get
98
104
  get '/hello'
@@ -171,14 +177,14 @@ class TestSinatraAsync < Test::Unit::TestCase
171
177
  aget '/redirect'
172
178
  assert last_response.redirect?
173
179
  assert_equal 302, last_response.status
174
- assert_equal '/', last_response.location
180
+ assert_redirect '/'
175
181
  end
176
182
 
177
183
  def test_aredirect
178
184
  aget '/aredirect'
179
185
  assert last_response.redirect?
180
186
  assert_equal 302, last_response.status
181
- assert_equal '/', last_response.location
187
+ assert_redirect '/'
182
188
  end
183
189
 
184
190
  def test_emredirect
@@ -186,6 +192,6 @@ class TestSinatraAsync < Test::Unit::TestCase
186
192
  em_async_continue
187
193
  assert last_response.redirect?
188
194
  assert_equal 302, last_response.status
189
- assert_equal '/', last_response.location
195
+ assert_redirect '/'
190
196
  end
191
197
  end
metadata CHANGED
@@ -1,27 +1,64 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async_sinatra
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
5
- prerelease: false
4
+ hash: 15
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
- - 3
8
+ - 4
9
9
  - 0
10
- version: 0.3.0
10
+ version: 0.4.0
11
11
  platform: ruby
12
12
  authors:
13
- - James Tucker
13
+ - raggi
14
14
  autorequire:
15
15
  bindir: bin
16
- cert_chain: []
16
+ cert_chain:
17
+ - |
18
+ -----BEGIN CERTIFICATE-----
19
+ MIIDNDCCAhygAwIBAgIBADANBgkqhkiG9w0BAQUFADBAMQ4wDAYDVQQDDAVyYWdn
20
+ aTEZMBcGCgmSJomT8ixkARkWCXJ1Ynlmb3JnZTETMBEGCgmSJomT8ixkARkWA29y
21
+ ZzAeFw0xMDEyMjIyMDIyMzlaFw0xMTEyMjIyMDIyMzlaMEAxDjAMBgNVBAMMBXJh
22
+ Z2dpMRkwFwYKCZImiZPyLGQBGRYJcnVieWZvcmdlMRMwEQYKCZImiZPyLGQBGRYD
23
+ b3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvgeVrJxLGm2PgcrM
24
+ DoB5mgQVC8PMYzpzJ64+75DQ1BgHa6wIeAuRphLY9qQh+sTTvKbUHtdgkWGghRVf
25
+ GaRVmtFlDHRt6RHWBmxXhXmcywT6c1xeni+eC7p56/zSkZ2RFHaZ4BXC4+8lO56j
26
+ sAh7c+YTcY1xd7teRX6g98aIep4MLxQlbEY+DcdDvtCIAswUYNVY+Nw08goIEw5Q
27
+ Sjm4fjrFPBT0T6RsmkcI4ea78h993nrWPdIndgVniwBc/SxGuBUGrfm637yCXNwL
28
+ FUzVd0qsJcIeMhXS8ZTii04oWKcK+G2B7KZ8/+olu7TwJu5mom9ORRMlflrTxJxi
29
+ rd4TBQIDAQABozkwNzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQU
30
+ 2QvD5zSSmpVqxaJSYrFbamIWCn0wDQYJKoZIhvcNAQEFBQADggEBAHwCkRkMjr/h
31
+ oYjGvs3BdEDuEYvzpKgWr6xv0hjsklBZ096dOjm0tLNSdplpn5MALUw3Cqtgp1KK
32
+ EKEZgEi9fbhhyzhkQyoociuqLQQ0daZuigh2CESrznX1b8AawCLyB2bJ9blNylPi
33
+ GWGaAjsqPBtAP6LoQib2aS0YuK7kVWxUTlupQ2D3Af5ag6NY8pS/etpS4IMVQU5l
34
+ v9ctVo17bHsWM3sjLW3Lj6xzYheYo0r9YAMOLXz7c92JwDQahDN95W4rUTj68rAQ
35
+ dHaj98YtwM8tjKyJsxZSeZEn+4wEtwTHuqU7v/HaK7OX+eIb090ZsV5ii5YpD/Fh
36
+ WjgTOJft4S4=
37
+ -----END CERTIFICATE-----
17
38
 
18
- date: 2010-09-07 00:00:00 -03:00
39
+ date: 2011-01-02 00:00:00 -05:00
19
40
  default_executable:
20
41
  dependencies:
21
42
  - !ruby/object:Gem::Dependency
22
- name: sinatra
43
+ name: rack
23
44
  prerelease: false
24
45
  requirement: &id001 !ruby/object:Gem::Requirement
46
+ none: false
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ hash: 29
51
+ segments:
52
+ - 1
53
+ - 2
54
+ - 1
55
+ version: 1.2.1
56
+ type: :runtime
57
+ version_requirements: *id001
58
+ - !ruby/object:Gem::Dependency
59
+ name: sinatra
60
+ prerelease: false
61
+ requirement: &id002 !ruby/object:Gem::Requirement
25
62
  none: false
26
63
  requirements:
27
64
  - - ">="
@@ -32,27 +69,117 @@ dependencies:
32
69
  - 0
33
70
  version: "1.0"
34
71
  type: :runtime
35
- version_requirements: *id001
72
+ version_requirements: *id002
36
73
  - !ruby/object:Gem::Dependency
37
- name: rdoc
74
+ name: minitest
38
75
  prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
76
+ requirement: &id003 !ruby/object:Gem::Requirement
40
77
  none: false
41
78
  requirements:
42
79
  - - ">="
43
80
  - !ruby/object:Gem::Version
44
- hash: 29
81
+ hash: 15
82
+ segments:
83
+ - 1
84
+ - 6
85
+ - 0
86
+ version: 1.6.0
87
+ type: :development
88
+ version_requirements: *id003
89
+ - !ruby/object:Gem::Dependency
90
+ name: rubyforge
91
+ prerelease: false
92
+ requirement: &id004 !ruby/object:Gem::Requirement
93
+ none: false
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ hash: 7
45
98
  segments:
46
99
  - 2
100
+ - 0
47
101
  - 4
102
+ version: 2.0.4
103
+ type: :development
104
+ version_requirements: *id004
105
+ - !ruby/object:Gem::Dependency
106
+ name: hoe-doofus
107
+ prerelease: false
108
+ requirement: &id005 !ruby/object:Gem::Requirement
109
+ none: false
110
+ requirements:
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ hash: 15
114
+ segments:
48
115
  - 1
49
- version: 2.4.1
116
+ - 0
117
+ version: "1.0"
50
118
  type: :development
51
- version_requirements: *id002
119
+ version_requirements: *id005
52
120
  - !ruby/object:Gem::Dependency
53
- name: rake
121
+ name: hoe-seattlerb
54
122
  prerelease: false
55
- requirement: &id003 !ruby/object:Gem::Requirement
123
+ requirement: &id006 !ruby/object:Gem::Requirement
124
+ none: false
125
+ requirements:
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ hash: 11
129
+ segments:
130
+ - 1
131
+ - 2
132
+ version: "1.2"
133
+ type: :development
134
+ version_requirements: *id006
135
+ - !ruby/object:Gem::Dependency
136
+ name: hoe-git
137
+ prerelease: false
138
+ requirement: &id007 !ruby/object:Gem::Requirement
139
+ none: false
140
+ requirements:
141
+ - - ">="
142
+ - !ruby/object:Gem::Version
143
+ hash: 9
144
+ segments:
145
+ - 1
146
+ - 3
147
+ version: "1.3"
148
+ type: :development
149
+ version_requirements: *id007
150
+ - !ruby/object:Gem::Dependency
151
+ name: hoe-gemspec2
152
+ prerelease: false
153
+ requirement: &id008 !ruby/object:Gem::Requirement
154
+ none: false
155
+ requirements:
156
+ - - ">="
157
+ - !ruby/object:Gem::Version
158
+ hash: 15
159
+ segments:
160
+ - 1
161
+ - 0
162
+ version: "1.0"
163
+ type: :development
164
+ version_requirements: *id008
165
+ - !ruby/object:Gem::Dependency
166
+ name: rdoc
167
+ prerelease: false
168
+ requirement: &id009 !ruby/object:Gem::Requirement
169
+ none: false
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ hash: 3
174
+ segments:
175
+ - 0
176
+ version: "0"
177
+ type: :development
178
+ version_requirements: *id009
179
+ - !ruby/object:Gem::Dependency
180
+ name: eventmachine
181
+ prerelease: false
182
+ requirement: &id010 !ruby/object:Gem::Requirement
56
183
  none: false
57
184
  requirements:
58
185
  - - ">="
@@ -60,36 +187,65 @@ dependencies:
60
187
  hash: 57
61
188
  segments:
62
189
  - 0
190
+ - 12
191
+ - 11
192
+ version: 0.12.11
193
+ type: :development
194
+ version_requirements: *id010
195
+ - !ruby/object:Gem::Dependency
196
+ name: hoe
197
+ prerelease: false
198
+ requirement: &id011 !ruby/object:Gem::Requirement
199
+ none: false
200
+ requirements:
201
+ - - ">="
202
+ - !ruby/object:Gem::Version
203
+ hash: 47
204
+ segments:
205
+ - 2
63
206
  - 8
64
- - 3
65
- version: 0.8.3
207
+ - 0
208
+ version: 2.8.0
66
209
  type: :development
67
- version_requirements: *id003
68
- description: Asynchronous response API for Sinatra
69
- email: raggi@rubyforge.org
210
+ version_requirements: *id011
211
+ description: |-
212
+ A Sinatra plugin to provide convenience whilst performing asynchronous
213
+ responses inside of the Sinatra framework running under async webservers.
214
+
215
+ To properly utilise this package, some knowledge of EventMachine and/or
216
+ asynchronous patterns is recommended.
217
+
218
+ Currently, supporting servers include:
219
+
220
+ * Thin
221
+ * Rainbows
222
+ * Zbatery
223
+ email:
224
+ - raggi@rubyforge.org
70
225
  executables: []
71
226
 
72
227
  extensions: []
73
228
 
74
229
  extra_rdoc_files:
230
+ - Manifest.txt
231
+ - CHANGELOG.rdoc
75
232
  - README.rdoc
76
233
  files:
234
+ - CHANGELOG.rdoc
235
+ - Manifest.txt
77
236
  - README.rdoc
78
237
  - Rakefile
79
238
  - examples/basic.ru
239
+ - lib/async_sinatra.rb
80
240
  - lib/sinatra/async.rb
81
241
  - lib/sinatra/async/test.rb
82
242
  - test/test_async.rb
83
243
  has_rdoc: true
84
- homepage: http://libraggi.rubyforge.org/async_sinatra
244
+ homepage: http://github.com/raggi/async_sinatra
85
245
  licenses: []
86
246
 
87
247
  post_install_message:
88
248
  rdoc_options:
89
- - --line-numbers
90
- - --inline-source
91
- - --title
92
- - Async Sinatra
93
249
  - --main
94
250
  - README.rdoc
95
251
  require_paths:
@@ -115,9 +271,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
271
  requirements: []
116
272
 
117
273
  rubyforge_project: libraggi
118
- rubygems_version: 1.3.7
274
+ rubygems_version: 1.4.1
119
275
  signing_key:
120
- specification_version: 2
121
- summary: Asynchronous response API for Sinatra
276
+ specification_version: 3
277
+ summary: A Sinatra plugin to provide convenience whilst performing asynchronous responses inside of the Sinatra framework running under async webservers
122
278
  test_files:
123
279
  - test/test_async.rb
Binary file