msgpack-rpc-over-http 0.0.6 → 0.0.7

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: 80269e378fceb3949f0dd58386269372c3537e03
4
- data.tar.gz: db999c392058e551f00da76f0d43efd028e40c9b
3
+ metadata.gz: bf7259fc341e5613f1027189046a366c7887a413
4
+ data.tar.gz: 956800032f4ba62e68b23fbf25ee0003e4222edf
5
5
  SHA512:
6
- metadata.gz: 81f3325c554d2174318b1ebdcd0d92837d9403f84d5e79ecddef73c293df93ade9737d568df1f1b477f2ed3bcbb92c0492f3920928ae9af00aa40a6bb4ef7c5c
7
- data.tar.gz: 4a8255282c7ca2ff3110c8083bad573eb9d585968d46a5faf794e76adb25ecf9e049de8a9b83e1ab5b98b3706b328c981cb0c9bfe5ddb6d3e08ddd26c556ed1f
6
+ metadata.gz: 50dbd6f294001ca14407864c9be8a7521fa7ffd298e77d8e4d656d0b4f1aea85a689ccb494b7c8f943f5356f7c2d61a78c542e377ce7cebcfd64c1e26ab854df
7
+ data.tar.gz: 59f5d353a8a986836fd46b434af31fd6438fc012fc8e5c91be8d05f99a3f1625449b4a3fe6a452b47108c445331fb69572b040324eef51c24f8f9798572f94ac
data/Gemfile CHANGED
@@ -3,7 +3,14 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in msgpack-rpc-over-http.gemspec
4
4
  gemspec
5
5
 
6
- group :test do
7
- gem 'test-unit', '~> 2.5.2'
8
- gem 'thin'
9
- end
6
+ platforms :ruby do
7
+ group :test do
8
+ gem 'thin'
9
+ end
10
+ end
11
+
12
+ platforms :jruby do
13
+ group :test do
14
+ gem 'mizuno'
15
+ end
16
+ end
@@ -1,5 +1,5 @@
1
1
  module MessagePack
2
2
  module RPCOverHTTP
3
- VERSION = "0.0.6"
3
+ VERSION = "0.0.7"
4
4
  end
5
5
  end
@@ -16,9 +16,10 @@ Gem::Specification.new do |gem|
16
16
  gem.version = MessagePack::RPCOverHTTP::VERSION
17
17
 
18
18
  gem.add_runtime_dependency "rack"
19
- gem.add_runtime_dependency "msgpack", "~> 0.5.5"
20
- gem.add_runtime_dependency "celluloid", "~> 0.12.3"
19
+ gem.add_runtime_dependency "msgpack", "~> 0.5.11"
20
+ gem.add_runtime_dependency "celluloid", "~> 0.16.0"
21
21
  gem.add_runtime_dependency "httpclient"
22
22
 
23
- gem.add_development_dependency "thin"
23
+ gem.add_development_dependency "rake"
24
+ gem.add_development_dependency "test-unit", "~> 3.0"
24
25
  end
@@ -31,6 +31,13 @@ class MockHandler
31
31
  end
32
32
  end
33
33
 
34
+ def jruby?
35
+ if /java/ =~ RUBY_PLATFORM
36
+ return true
37
+ end
38
+ false
39
+ end
40
+
34
41
  def sleep_until_http_server_is_started(host, port)
35
42
  timeout(30) do
36
43
  while stopped_test_app_server?(host, port)
@@ -1,4 +1,7 @@
1
1
  #\ -s thin
2
+
3
+ ### NOTE: this file is not used with jruby. FIX test/test_client.rb #setup if this file is fixed.
4
+
2
5
  $LOAD_PATH.unshift(File.expand_path("./../lib", File.dirname(__FILE__)))
3
6
  $LOAD_PATH.unshift(File.dirname(__FILE__))
4
7
 
@@ -1,3 +1,5 @@
1
+ require 'rack'
2
+
1
3
  module MessagePack::RPCOverHTTP
2
4
  class TestClient < Test::Unit::TestCase
3
5
  def self.unused_port
@@ -13,13 +15,32 @@ module MessagePack::RPCOverHTTP
13
15
  def setup
14
16
  @client = Client.new("http://0.0.0.0:#{@@server_port}/")
15
17
  if @@is_stopped_test_app_server
16
- pid = fork {
17
- Rack::Server.start(config: "test/mock_server.ru", Port: @@server_port)
18
- exit 0
19
- }
20
- at_exit do
21
- Process.kill(:INT, pid)
22
- Process.waitpid(pid)
18
+ if /java/ =~ RUBY_PLATFORM
19
+ mizuno = nil
20
+ thread = Thread.new do
21
+ Thread.current.abort_on_exception = true
22
+ require 'mizuno/server'
23
+ app = Rack::Builder.new {
24
+ # MockHandler is in helper.rb
25
+ run MessagePack::RPCOverHTTP::Server.app(MockHandler.new)
26
+ }
27
+ mizuno = Mizuno::Server.new
28
+ mizuno.run(app, embedded: true, threads: 1, port: @@server_port, host: '0.0.0.0')
29
+ end
30
+ at_exit do
31
+ mizuno.stop
32
+ thread.kill
33
+ thread.join
34
+ end
35
+ else
36
+ pid = fork {
37
+ Rack::Server.start(config: "test/mock_server.ru", Port: @@server_port)
38
+ exit 0
39
+ }
40
+ at_exit do
41
+ Process.kill(:INT, pid)
42
+ Process.waitpid(pid)
43
+ end
23
44
  end
24
45
  sleep_until_http_server_is_started("0.0.0.0", @@server_port)
25
46
  @@is_stopped_test_app_server = false
@@ -37,6 +58,8 @@ module MessagePack::RPCOverHTTP
37
58
  end
38
59
 
39
60
  def test_call_async
61
+ pend "msgpack-rpc-over-http does not support Client#async for jruby" if jruby?
62
+
40
63
  future = @client.call_async(:test, "a", "b")
41
64
  assert_equal ["a", "b"], future.value
42
65
  assert_raise(MessagePack::RPCOverHTTP::RuntimeError) do
@@ -62,6 +85,7 @@ module MessagePack::RPCOverHTTP
62
85
  end
63
86
 
64
87
  def test_stream
88
+ pend "msgpack-rpc-over-http does not support Client#stream for jruby" if jruby?
65
89
  expect = ["a", "b"]
66
90
  @client.stream(:stream_normal, "a", "b") do |res|
67
91
  assert_equal expect.shift, res
@@ -78,6 +102,7 @@ module MessagePack::RPCOverHTTP
78
102
  end
79
103
 
80
104
  def test_stream_async
105
+ pend "msgpack-rpc-over-http does not support Client#stream_async for jruby" if jruby?
81
106
  expect = ["a", "b"]
82
107
  future = @client.stream_async(:stream_normal, "a", "b") do |res|
83
108
  assert_equal expect.shift, res
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: msgpack-rpc-over-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Narihiro Nakamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-07 00:00:00.000000000 Z
11
+ date: 2015-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -30,28 +30,28 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.5.5
33
+ version: 0.5.11
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.5.5
40
+ version: 0.5.11
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: celluloid
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.12.3
47
+ version: 0.16.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.12.3
54
+ version: 0.16.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: httpclient
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: thin
70
+ name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: test-unit
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.0'
83
97
  description: This library provides MessagePack-RPC via HTTP
84
98
  email:
85
99
  - authornari@gmail.com
@@ -125,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
139
  version: '0'
126
140
  requirements: []
127
141
  rubyforge_project:
128
- rubygems_version: 2.2.0
142
+ rubygems_version: 2.4.5
129
143
  signing_key:
130
144
  specification_version: 4
131
145
  summary: This library provides MessagePack-RPC via HTTP