restfulie 1.0.0.beta4 → 1.0.0.beta5
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -5
- data/README.textile +8 -18
- data/Rakefile +7 -0
- data/lib/restfulie/client/feature/history_request.rb +4 -6
- data/lib/restfulie/client/feature/throw_error.rb +4 -0
- metadata +91 -12
- data/Gemfile.lock +0 -102
data/Gemfile
CHANGED
data/README.textile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
h1. Web site
|
2
2
|
|
3
|
-
"http://restfulie.caelumobjects.com
|
3
|
+
"Restfulie's site":http://restfulie.caelumobjects.com has a lot of information on Restfulie itself
|
4
4
|
|
5
5
|
h1. Quit pretending
|
6
6
|
|
@@ -12,16 +12,16 @@ One liners for your pleasure. First, how to let restfulie know which media types
|
|
12
12
|
|
13
13
|
<pre>
|
14
14
|
class ItemsController < ...
|
15
|
-
|
15
|
+
respond_to :atom, :html, :xml, :commerce, :opensearch
|
16
16
|
end
|
17
17
|
</pre>
|
18
18
|
|
19
19
|
Now let's handle them all:
|
20
20
|
|
21
21
|
<pre>
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
def index
|
23
|
+
respond_with @orders = Order.all
|
24
|
+
end
|
25
25
|
</pre>
|
26
26
|
|
27
27
|
And what is the *first* difference between simple web services with Rails and a REST architecture? Let's add hypermedia to the game:
|
@@ -66,16 +66,6 @@ bundle install
|
|
66
66
|
rake test:spec test:integration
|
67
67
|
</pre>
|
68
68
|
|
69
|
-
<script type="text/javascript">
|
70
|
-
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
71
|
-
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
|
72
|
-
</script>
|
73
|
-
<script type="text/javascript">
|
74
|
-
try {
|
75
|
-
var pageTracker = _gat._getTracker("UA-11770776-1");
|
76
|
-
pageTracker._trackPageview();
|
77
|
-
} catch(err) {}</script>
|
78
|
-
|
79
69
|
h2. Contributions
|
80
70
|
|
81
71
|
Restfulie was created and is maintained by "Caelum":http://caelumobjects.com, and has received enormous contributions from all those developers:
|
@@ -95,9 +85,9 @@ Everton Ribeiro, abril
|
|
95
85
|
Paulo Ahagon, abril
|
96
86
|
Elomar França
|
97
87
|
Thomas Stefano
|
98
|
-
"David Paniz":
|
99
|
-
"Caike Souza":
|
88
|
+
"David Paniz":http://www.caelum.com.br
|
89
|
+
"Caike Souza":http://www.caikesouza.com/blog
|
100
90
|
|
101
91
|
h2. Rails 2
|
102
92
|
|
103
|
-
If you want to use Restfulie with Rails2, please use any release up to 0.9.2 and its minor releases.
|
93
|
+
If you want to use Restfulie with Rails2, please use any release up to 0.9.2 and its minor releases.
|
data/Rakefile
CHANGED
@@ -22,8 +22,15 @@ spec = Gem::Specification.new do |s|
|
|
22
22
|
s.summary = SUMMARY
|
23
23
|
s.require_paths = ['lib']
|
24
24
|
s.files = FileList['lib/**/*.rb', '[A-Z]*', 'lib/**/*.rng'].to_a
|
25
|
+
|
25
26
|
s.add_dependency("nokogiri", [">= 1.4.2"])
|
26
27
|
s.add_dependency("json_pure", [">= 1.2.4"])
|
28
|
+
s.add_dependency("rack-conneg")
|
29
|
+
s.add_dependency("sqlite3-ruby")
|
30
|
+
s.add_dependency('tokamak', ">= 1.0.0.beta4")
|
31
|
+
s.add_dependency('medie', ">= 1.0.0.beta4")
|
32
|
+
s.add_dependency('respondie', "~> 0.9.0")
|
33
|
+
|
27
34
|
|
28
35
|
s.author = AUTHOR
|
29
36
|
s.email = EMAIL
|
@@ -1,13 +1,11 @@
|
|
1
1
|
# ==== RequestHistory
|
2
|
-
# Uses
|
2
|
+
# Uses RequestHistory to remind previous requests
|
3
3
|
#
|
4
4
|
# ==== Example:
|
5
5
|
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
# @executor.request_history!(0) #doing first request
|
10
|
-
#
|
6
|
+
# result = Restfulie.at(uri).get
|
7
|
+
# result = result.headers.links.payment.get
|
8
|
+
# result.request_history(1) # doing first request
|
11
9
|
class Restfulie::Client::Feature::HistoryRequest
|
12
10
|
|
13
11
|
def execute(flow, request, env)
|
@@ -1,3 +1,7 @@
|
|
1
|
+
# Adds support to throwing an error when 300+ response codes are returned
|
2
|
+
#
|
3
|
+
# To use it, load it in your dsl:
|
4
|
+
# Restfulie.at("http://localhost:3000/product/2").throw_error.get
|
1
5
|
class Restfulie::Client::Feature::ThrowError
|
2
6
|
def execute(flow, request, env)
|
3
7
|
result = flow.continue(request, env)
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: restfulie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 62196361
|
5
5
|
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
9
|
- 0
|
10
10
|
- beta
|
11
|
-
-
|
12
|
-
version: 1.0.0.
|
11
|
+
- 5
|
12
|
+
version: 1.0.0.beta5
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Guilherme Silveira, Caue Guerra, Luis Cipriani, Everton Ribeiro, George Guimaraes, Paulo Ahagon, and many more!
|
@@ -21,8 +21,75 @@ date: 2011-01-06 00:00:00 -02:00
|
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
24
|
+
name: rack-conneg
|
25
|
+
prerelease: false
|
26
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
27
|
+
none: false
|
28
|
+
requirements:
|
29
|
+
- - ">="
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
hash: 3
|
32
|
+
segments:
|
33
|
+
- 0
|
34
|
+
version: "0"
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: tokamak
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 62196363
|
46
|
+
segments:
|
47
|
+
- 1
|
48
|
+
- 0
|
49
|
+
- 0
|
50
|
+
- beta
|
51
|
+
- 4
|
52
|
+
version: 1.0.0.beta4
|
53
|
+
type: :runtime
|
54
|
+
version_requirements: *id002
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: medie
|
57
|
+
prerelease: false
|
58
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
hash: 62196363
|
64
|
+
segments:
|
65
|
+
- 1
|
66
|
+
- 0
|
67
|
+
- 0
|
68
|
+
- beta
|
69
|
+
- 4
|
70
|
+
version: 1.0.0.beta4
|
24
71
|
type: :runtime
|
25
|
-
version_requirements:
|
72
|
+
version_requirements: *id003
|
73
|
+
- !ruby/object:Gem::Dependency
|
74
|
+
name: respondie
|
75
|
+
prerelease: false
|
76
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
77
|
+
none: false
|
78
|
+
requirements:
|
79
|
+
- - ~>
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
hash: 59
|
82
|
+
segments:
|
83
|
+
- 0
|
84
|
+
- 9
|
85
|
+
- 0
|
86
|
+
version: 0.9.0
|
87
|
+
type: :runtime
|
88
|
+
version_requirements: *id004
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: nokogiri
|
91
|
+
prerelease: false
|
92
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
26
93
|
none: false
|
27
94
|
requirements:
|
28
95
|
- - ">="
|
@@ -33,12 +100,12 @@ dependencies:
|
|
33
100
|
- 4
|
34
101
|
- 2
|
35
102
|
version: 1.4.2
|
36
|
-
requirement: *id001
|
37
|
-
prerelease: false
|
38
|
-
name: nokogiri
|
39
|
-
- !ruby/object:Gem::Dependency
|
40
103
|
type: :runtime
|
41
|
-
version_requirements:
|
104
|
+
version_requirements: *id005
|
105
|
+
- !ruby/object:Gem::Dependency
|
106
|
+
name: json_pure
|
107
|
+
prerelease: false
|
108
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
42
109
|
none: false
|
43
110
|
requirements:
|
44
111
|
- - ">="
|
@@ -49,9 +116,22 @@ dependencies:
|
|
49
116
|
- 2
|
50
117
|
- 4
|
51
118
|
version: 1.2.4
|
52
|
-
|
119
|
+
type: :runtime
|
120
|
+
version_requirements: *id006
|
121
|
+
- !ruby/object:Gem::Dependency
|
122
|
+
name: sqlite3-ruby
|
53
123
|
prerelease: false
|
54
|
-
|
124
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
125
|
+
none: false
|
126
|
+
requirements:
|
127
|
+
- - ">="
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
hash: 3
|
130
|
+
segments:
|
131
|
+
- 0
|
132
|
+
version: "0"
|
133
|
+
type: :development
|
134
|
+
version_requirements: *id007
|
55
135
|
description:
|
56
136
|
email: guilherme.silveira@caelum.com.br
|
57
137
|
executables: []
|
@@ -129,7 +209,6 @@ files:
|
|
129
209
|
- lib/restfulie/version.rb
|
130
210
|
- lib/restfulie.rb
|
131
211
|
- Gemfile
|
132
|
-
- Gemfile.lock
|
133
212
|
- LICENSE
|
134
213
|
- Rakefile
|
135
214
|
- README.textile
|
data/Gemfile.lock
DELETED
@@ -1,102 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: http://rubygems.org/
|
3
|
-
specs:
|
4
|
-
abstract (1.0.0)
|
5
|
-
actionpack (3.0.3)
|
6
|
-
activemodel (= 3.0.3)
|
7
|
-
activesupport (= 3.0.3)
|
8
|
-
builder (~> 2.1.2)
|
9
|
-
erubis (~> 2.6.6)
|
10
|
-
i18n (~> 0.4)
|
11
|
-
rack (~> 1.2.1)
|
12
|
-
rack-mount (~> 0.6.13)
|
13
|
-
rack-test (~> 0.5.6)
|
14
|
-
tzinfo (~> 0.3.23)
|
15
|
-
activemodel (3.0.3)
|
16
|
-
activesupport (= 3.0.3)
|
17
|
-
builder (~> 2.1.2)
|
18
|
-
i18n (~> 0.4)
|
19
|
-
activesupport (3.0.3)
|
20
|
-
builder (2.1.2)
|
21
|
-
columnize (0.3.2)
|
22
|
-
diff-lcs (1.1.2)
|
23
|
-
erubis (2.6.6)
|
24
|
-
abstract (>= 1.0.0)
|
25
|
-
fakeweb (1.3.0)
|
26
|
-
hoe (2.8.0)
|
27
|
-
rake (>= 0.8.7)
|
28
|
-
i18n (0.5.0)
|
29
|
-
json_pure (1.4.6)
|
30
|
-
linecache (0.43)
|
31
|
-
medie (1.0.0.beta4)
|
32
|
-
actionpack (>= 3.0.0)
|
33
|
-
activesupport
|
34
|
-
json_pure
|
35
|
-
methodize
|
36
|
-
methodize (0.1)
|
37
|
-
nokogiri (1.4.4)
|
38
|
-
rack (1.2.1)
|
39
|
-
rack-conneg (0.1.4)
|
40
|
-
rack (>= 1.0)
|
41
|
-
rack-mount (0.6.13)
|
42
|
-
rack (>= 1.0.0)
|
43
|
-
rack-test (0.5.7)
|
44
|
-
rack (>= 1.0)
|
45
|
-
railties (3.0.3)
|
46
|
-
actionpack (= 3.0.3)
|
47
|
-
activesupport (= 3.0.3)
|
48
|
-
rake (>= 0.8.7)
|
49
|
-
thor (~> 0.14.4)
|
50
|
-
rake (0.8.7)
|
51
|
-
rcov (0.9.9)
|
52
|
-
respondie (0.9.0)
|
53
|
-
rspec (2.3.0)
|
54
|
-
rspec-core (~> 2.3.0)
|
55
|
-
rspec-expectations (~> 2.3.0)
|
56
|
-
rspec-mocks (~> 2.3.0)
|
57
|
-
rspec-core (2.3.1)
|
58
|
-
rspec-expectations (2.3.0)
|
59
|
-
diff-lcs (~> 1.1.2)
|
60
|
-
rspec-mocks (2.3.0)
|
61
|
-
rspec-rails (2.3.1)
|
62
|
-
actionpack (~> 3.0)
|
63
|
-
activesupport (~> 3.0)
|
64
|
-
railties (~> 3.0)
|
65
|
-
rspec (~> 2.3.0)
|
66
|
-
ruby-debug (0.10.4)
|
67
|
-
columnize (>= 0.1)
|
68
|
-
ruby-debug-base (~> 0.10.4.0)
|
69
|
-
ruby-debug-base (0.10.4)
|
70
|
-
linecache (>= 0.3)
|
71
|
-
sinatra (1.1.2)
|
72
|
-
rack (~> 1.1)
|
73
|
-
tilt (~> 1.2)
|
74
|
-
sqlite3-ruby (1.3.2)
|
75
|
-
state_machine (0.9.4)
|
76
|
-
test-unit (1.2.3)
|
77
|
-
hoe (>= 1.5.1)
|
78
|
-
thor (0.14.6)
|
79
|
-
tilt (1.2.1)
|
80
|
-
tokamak (1.1.1)
|
81
|
-
json_pure
|
82
|
-
nokogiri
|
83
|
-
tzinfo (0.3.23)
|
84
|
-
yard (0.6.4)
|
85
|
-
|
86
|
-
PLATFORMS
|
87
|
-
ruby
|
88
|
-
|
89
|
-
DEPENDENCIES
|
90
|
-
fakeweb
|
91
|
-
medie (>= 1.0.0.beta4)
|
92
|
-
rack-conneg
|
93
|
-
rcov
|
94
|
-
respondie (~> 0.9.0)
|
95
|
-
rspec-rails (>= 2.3.0)
|
96
|
-
ruby-debug
|
97
|
-
sinatra
|
98
|
-
sqlite3-ruby
|
99
|
-
state_machine
|
100
|
-
test-unit (= 1.2.3)
|
101
|
-
tokamak (>= 1.0.0.beta4)
|
102
|
-
yard
|