orthrus 0.0.3 → 0.0.4
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/.travis.yml +12 -0
- data/Gemfile +1 -0
- data/README.markdown +5 -1
- data/lib/orthrus/remote_method.rb +1 -1
- data/lib/orthrus/version.rb +1 -1
- data/test/test_remote_method.rb +8 -0
- metadata +5 -4
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/README.markdown
CHANGED
@@ -13,7 +13,11 @@ Orthrus is a small extension inspired by the original remote method API from Pau
|
|
13
13
|
which is deprecated in the current Typhoeus release.
|
14
14
|
|
15
15
|
It can be used to encapsulate remote method calls in a clean way and provide an
|
16
|
-
easy interface to work with.
|
16
|
+
easy interface to work with. All of its functionality is covered by tests as well.
|
17
|
+
|
18
|
+
![orthrus build status][1]
|
19
|
+
|
20
|
+
[1]:http://travis-ci.org/xijo/orthrus.png
|
17
21
|
|
18
22
|
## Installation
|
19
23
|
|
@@ -38,7 +38,7 @@ module Orthrus
|
|
38
38
|
# path = "/planet/:identifier"
|
39
39
|
# interpolated_path({:identifier => "mars"}) #=> "/planet/mars"
|
40
40
|
def interpolated_path(args = {})
|
41
|
-
interpolated_path = @path
|
41
|
+
interpolated_path = @path || ""
|
42
42
|
args.each do |key, value|
|
43
43
|
if interpolated_path.include?(":#{key}")
|
44
44
|
interpolated_path.sub!(":#{key}", value.to_s)
|
data/lib/orthrus/version.rb
CHANGED
data/test/test_remote_method.rb
CHANGED
@@ -35,6 +35,14 @@ class TestDefineRemoteMethod < Test::Unit::TestCase
|
|
35
35
|
)
|
36
36
|
assert_equal @mars_response.body, remote_method.run(:identifier => :mars).body
|
37
37
|
end
|
38
|
+
|
39
|
+
def test_remote_method_with_empty_path
|
40
|
+
remote_method = Orthrus::RemoteMethod.new(
|
41
|
+
:base_uri => "http://astronomical.test/planets/mars",
|
42
|
+
:method => :get
|
43
|
+
)
|
44
|
+
assert_equal @mars_response.body, remote_method.run(:identifier => :mars).body
|
45
|
+
end
|
38
46
|
|
39
47
|
def test_remote_method_with_success_handler
|
40
48
|
remote_method = Orthrus::RemoteMethod.new(
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: orthrus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Johannes Opper
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-07-15 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -74,6 +74,7 @@ extra_rdoc_files: []
|
|
74
74
|
|
75
75
|
files:
|
76
76
|
- .gitignore
|
77
|
+
- .travis.yml
|
77
78
|
- CHANGELOG.markdown
|
78
79
|
- Gemfile
|
79
80
|
- LICENSE
|