sinatra-cometio 0.5.9 → 0.6.0

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: 9d493ba15d44c94753f78b0c236125f775fb6b61
4
- data.tar.gz: b5944b12327e36182514f61491077f80777ec8de
3
+ metadata.gz: a4c765b3c03f7d0d9f4119ee6eaeca36412039e1
4
+ data.tar.gz: c796d5fbfba6045eb227f2c1c5e57aadc79b28d5
5
5
  SHA512:
6
- metadata.gz: 9691dfab15f2e4211c0159585f026bd6cabb2ebb8316bccc519381245d7b8529f50c8d3ac9fc39c41eea3fe44a3fa80654e46f29038a029cd253cd3fcd178b3c
7
- data.tar.gz: 1c63eb1aab0634faef1ec4c1e1235596b13c219714ef16ef4ac34a3df7c6e249914a75e71ed377a40f8bdb2c638fc8c0f10de71c19a882600a79120a537d888c
6
+ metadata.gz: 1497b9122f45e9ce82e494c321411249d76102403ea46ce4ef7c1ddb068121f4e757a4a5ef470072e4e7a205b234a8c0996a2120b68f8971b6588c2aa4bb8365
7
+ data.tar.gz: 0e3d08e27a8d18fcbe380e8bad85d88105b3ee39c3540a7f41a321a6e1888c167766f2af9cfaca23545d4d4da4a909b70cd0e41896bc47b0fdb9b40b4aaa0816
@@ -1,3 +1,7 @@
1
+ === 0.6.0 2013-10-05
2
+
3
+ * set MIT License
4
+
1
5
  === 0.5.9 2013-08-06
2
6
 
3
7
  * store REMOTE_ADDR into CometIO.sessions
data/README.md CHANGED
@@ -158,8 +158,13 @@ Test
158
158
 
159
159
  % gem install bundler
160
160
  % bundle install
161
- % export PORT=5000
162
- % export PID_FILE=/tmp/sinatra-cometio-test.pid
161
+
162
+ start server
163
+
164
+ % rake test_server
165
+
166
+ run test
167
+
163
168
  % rake test
164
169
 
165
170
 
data/Rakefile CHANGED
@@ -6,3 +6,9 @@ Rake::TestTask.new do |t|
6
6
  end
7
7
 
8
8
  task :default => :test
9
+
10
+ desc "Start test server"
11
+ task :test_server do
12
+ require File.expand_path 'test/app', File.dirname(__FILE__)
13
+ App.start
14
+ end
@@ -1,5 +1,5 @@
1
1
  module Sinatra
2
2
  module CometIO
3
- VERSION = '0.5.9'
3
+ VERSION = '0.6.0'
4
4
  end
5
5
  end
@@ -10,6 +10,7 @@ Gem::Specification.new do |gem|
10
10
  gem.description = %q{Comet component for Sinatra RocketIO}
11
11
  gem.summary = gem.description
12
12
  gem.homepage = "https://github.com/shokai/sinatra-cometio"
13
+ gem.license = "MIT"
13
14
 
14
15
  gem.files = `git ls-files`.split($/).reject{|i| i=="Gemfile.lock" }
15
16
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
@@ -8,50 +8,23 @@ class App
8
8
  ENV['PORT'] || 5000
9
9
  end
10
10
 
11
- def self.cometio_url
12
- "http://localhost:#{port}/cometio/io"
11
+ def self.url
12
+ "http://localhost:#{port}"
13
13
  end
14
14
 
15
- def self.pid_file
16
- ENV['PID_FILE'] || "/tmp/sinatra-cometio-testapp.pid"
15
+ def self.cometio_url
16
+ "http://localhost:#{port}/cometio/io"
17
17
  end
18
18
 
19
19
  def self.app_dir
20
20
  File.expand_path 'app', File.dirname(__FILE__)
21
21
  end
22
22
 
23
- def self.pid
24
- return unless @running
25
- File.open(pid_file) do |f|
26
- pid = f.gets.strip.to_i
27
- return pid if pid > 0
28
- end
29
- return
30
- end
31
-
32
23
  def self.start
33
- return if @running
34
- File.delete pid_file if File.exists? pid_file
35
- Thread.new do
36
- IO::popen "cd #{app_dir} && PID_FILE=#{pid_file} rackup config.ru -p #{port} > /dev/null 2>&1"
37
- end
24
+ return if running
38
25
  @running = true
39
- 100.times do
40
- if File.exists? pid_file
41
- sleep 0.1
42
- return true
43
- end
44
- sleep 1
45
- end
46
- @running = false
47
- return false
48
- end
49
-
50
- def self.stop
51
- return unless @running
52
- system "kill #{pid}"
53
- File.delete pid_file if File.exists? pid_file
54
- @running = false
26
+ cmd = "cd #{app_dir} && bundle exec rackup config.ru -p #{port}"
27
+ system cmd
55
28
  end
56
29
 
57
30
  end
@@ -1,8 +1,3 @@
1
- pid_file = ENV['PID_FILE'] || "/tmp/sinatra-cometio-test-pid"
2
- File.open(pid_file, "w+") do |f|
3
- f.write Process.pid.to_s
4
- end
5
-
6
1
  class TestApp < Sinatra::Base
7
2
  register Sinatra::CometIO
8
3
 
@@ -2,14 +2,6 @@ require File.expand_path 'test_helper', File.dirname(__FILE__)
2
2
 
3
3
  class TestCometio < MiniTest::Test
4
4
 
5
- def setup
6
- App.start
7
- end
8
-
9
- def teardown
10
- App.stop
11
- end
12
-
13
5
  def test_simple
14
6
  client = Sinatra::CometIO::Client.new(App.cometio_url).connect
15
7
  post_data = {:time => Time.now.to_s, :msg => 'hello!!'}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-cometio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.9
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sho Hashimoto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-06 00:00:00.000000000 Z
11
+ date: 2013-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -217,7 +217,8 @@ files:
217
217
  - test/test_cometio.rb
218
218
  - test/test_helper.rb
219
219
  homepage: https://github.com/shokai/sinatra-cometio
220
- licenses: []
220
+ licenses:
221
+ - MIT
221
222
  metadata: {}
222
223
  post_install_message:
223
224
  rdoc_options: []
@@ -235,7 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
235
236
  version: '0'
236
237
  requirements: []
237
238
  rubyforge_project:
238
- rubygems_version: 2.0.5
239
+ rubygems_version: 2.1.5
239
240
  signing_key:
240
241
  specification_version: 4
241
242
  summary: Comet component for Sinatra RocketIO