wrest 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +5 -8
- data/Rakefile +2 -2
- data/VERSION.yml +1 -1
- data/lib/wrest/{mappers/simple_resource.rb → components.rb} +7 -6
- data/lib/wrest/{mappers → components}/attributes_container.rb +1 -1
- data/lib/wrest/{mappers/resource.rb → resource.rb} +5 -4
- data/lib/wrest/{mappers/resource → resource}/base.rb +2 -2
- data/lib/wrest/{mappers/resource → resource}/collection.rb +1 -1
- data/lib/wrest/version.rb +1 -1
- data/spec/wrest/{mappers → components}/attributes_container_spec.rb +1 -1
- data/spec/wrest/core_ext/string_spec.rb +7 -0
- data/spec/wrest/{mappers/resource → resource}/base_spec.rb +3 -3
- metadata +13 -14
- data/lib/wrest/mappers.rb +0 -21
- data/spec/wrest/mappers/simple_resource_spec.rb +0 -7
data/README.rdoc
CHANGED
@@ -10,14 +10,7 @@ The source is available at git://github.com/kaiwren/wrest.git
|
|
10
10
|
|
11
11
|
To install as a Rails plugin, do <tt>script/plugin install git://github.com/kaiwren/wrest.git</tt>
|
12
12
|
|
13
|
-
To install the Wrest gem,
|
14
|
-
|
15
|
-
gem sources -a http://gems.github.com
|
16
|
-
|
17
|
-
Then to install Wrest and its dependencies:
|
18
|
-
|
19
|
-
sudo gem install kaiwren-wrest
|
20
|
-
|
13
|
+
To install the Wrest gem, do <tt>sudo gem install wrest</tt>
|
21
14
|
|
22
15
|
== Wrest Core
|
23
16
|
|
@@ -72,6 +65,10 @@ The Wrest logger can be set and accessed through Wrest.logger and is configured
|
|
72
65
|
|
73
66
|
Standard options are available and can be listed using <tt>rake -T</tt>. Use rake:rcov for coverage and rake:rdoc to generate documentation.
|
74
67
|
|
68
|
+
== Documentation
|
69
|
+
|
70
|
+
Wrest RDocs can be found at http://wrest.rubyforge.org/
|
71
|
+
|
75
72
|
== Wrest::Resource
|
76
73
|
|
77
74
|
Wrest::Resource is an alternative to ActiveResource which targets Rails REST services; it is currently under development.
|
data/Rakefile
CHANGED
@@ -26,7 +26,7 @@ end
|
|
26
26
|
|
27
27
|
desc 'Generate documentation for Wrest'
|
28
28
|
Rake::RDocTask.new(:rdoc) do |rdoc|
|
29
|
-
rdoc.rdoc_dir = '
|
29
|
+
rdoc.rdoc_dir = 'rdoc'
|
30
30
|
rdoc.title = 'WRest'
|
31
31
|
rdoc.options << '--line-numbers' << '--inline-source'
|
32
32
|
rdoc.rdoc_files.include('README.rdoc')
|
@@ -83,7 +83,7 @@ begin
|
|
83
83
|
)
|
84
84
|
|
85
85
|
host = "#{config['username']}@rubyforge.org"
|
86
|
-
remote_dir = "/var/www/gforge-projects/
|
86
|
+
remote_dir = "/var/www/gforge-projects/wrest/"
|
87
87
|
local_dir = 'rdoc'
|
88
88
|
|
89
89
|
Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
|
data/VERSION.yml
CHANGED
@@ -7,11 +7,12 @@
|
|
7
7
|
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
8
8
|
# See the License for the specific language governing permissions and limitations under the License.
|
9
9
|
|
10
|
-
module Wrest
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
end
|
10
|
+
module Wrest #:nodoc:
|
11
|
+
# A component is a building block that can
|
12
|
+
# be used while building an object oriented wrapper
|
13
|
+
# around a REST service
|
14
|
+
module Components
|
16
15
|
end
|
17
16
|
end
|
17
|
+
|
18
|
+
require "#{WREST_ROOT}/wrest/components/attributes_container"
|
@@ -7,7 +7,7 @@
|
|
7
7
|
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
8
8
|
# See the License for the specific language governing permissions and limitations under the License.
|
9
9
|
|
10
|
-
module Wrest::
|
10
|
+
module Wrest::Components #:nodoc:
|
11
11
|
|
12
12
|
# Adds behaviour allowing a class to
|
13
13
|
# contain attributes and providing support
|
@@ -8,10 +8,11 @@
|
|
8
8
|
# See the License for the specific language governing permissions and limitations under the License.
|
9
9
|
|
10
10
|
module Wrest
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
# Wrest::Resource is a re-implementation
|
12
|
+
# of ActiveResource using Wrest::Components
|
13
|
+
# and with some of the rough edges removed
|
14
|
+
module Resource
|
14
15
|
end
|
15
16
|
end
|
16
17
|
|
17
|
-
require "#{WREST_ROOT}/wrest/
|
18
|
+
require "#{WREST_ROOT}/wrest/resource/base"
|
@@ -7,11 +7,11 @@
|
|
7
7
|
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
8
8
|
# See the License for the specific language governing permissions and limitations under the License.
|
9
9
|
|
10
|
-
module Wrest::
|
10
|
+
module Wrest::Resource #:nodoc:
|
11
11
|
# Resource::Base is the equivalent of ActiveResource::Base.
|
12
12
|
# It is a REST client targetted at Rails REST apps.
|
13
13
|
class Base
|
14
|
-
include Wrest::
|
14
|
+
include Wrest::Components::AttributesContainer
|
15
15
|
|
16
16
|
has_attributes :id
|
17
17
|
attr_reader :attributes
|
data/lib/wrest/version.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
require File.dirname(__FILE__) + '
|
1
|
+
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
2
|
|
3
|
-
class Glassware < Wrest::
|
3
|
+
class Glassware < Wrest::Resource::Base
|
4
4
|
set_host "http://localhost:3000"
|
5
5
|
end
|
6
6
|
|
@@ -8,7 +8,7 @@ class BottledUniverse < Glassware
|
|
8
8
|
set_host "http://localhost:3001"
|
9
9
|
end
|
10
10
|
|
11
|
-
module Wrest
|
11
|
+
module Wrest
|
12
12
|
describe Resource::Base do
|
13
13
|
it "should not affect other classes when setting up its macros" do
|
14
14
|
Class.should_not respond_to(:host=)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wrest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sidu Ponnappa
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-04-
|
12
|
+
date: 2009-04-20 00:00:00 +05:30
|
13
13
|
default_executable: wrest
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -56,16 +56,15 @@ files:
|
|
56
56
|
- VERSION.yml
|
57
57
|
- bin/wrest
|
58
58
|
- lib/wrest.rb
|
59
|
+
- lib/wrest/components.rb
|
60
|
+
- lib/wrest/components/attributes_container.rb
|
59
61
|
- lib/wrest/core_ext/string.rb
|
60
62
|
- lib/wrest/core_ext/string/conversions.rb
|
61
63
|
- lib/wrest/exceptions.rb
|
62
64
|
- lib/wrest/exceptions/unsupported_content_type_exception.rb
|
63
|
-
- lib/wrest/
|
64
|
-
- lib/wrest/
|
65
|
-
- lib/wrest/
|
66
|
-
- lib/wrest/mappers/resource/base.rb
|
67
|
-
- lib/wrest/mappers/resource/collection.rb
|
68
|
-
- lib/wrest/mappers/simple_resource.rb
|
65
|
+
- lib/wrest/resource.rb
|
66
|
+
- lib/wrest/resource/base.rb
|
67
|
+
- lib/wrest/resource/collection.rb
|
69
68
|
- lib/wrest/response.rb
|
70
69
|
- lib/wrest/translators.rb
|
71
70
|
- lib/wrest/translators/content_types.rb
|
@@ -79,9 +78,9 @@ files:
|
|
79
78
|
- spec/rcov.opts
|
80
79
|
- spec/spec.opts
|
81
80
|
- spec/spec_helper.rb
|
82
|
-
- spec/wrest/
|
83
|
-
- spec/wrest/
|
84
|
-
- spec/wrest/
|
81
|
+
- spec/wrest/components/attributes_container_spec.rb
|
82
|
+
- spec/wrest/core_ext/string_spec.rb
|
83
|
+
- spec/wrest/resource/base_spec.rb
|
85
84
|
- spec/wrest/response_spec.rb
|
86
85
|
- spec/wrest/translators/typed_hash_spec.rb
|
87
86
|
- spec/wrest/translators/xml_spec.rb
|
@@ -119,9 +118,9 @@ summary: REST client library for Ruby.
|
|
119
118
|
test_files:
|
120
119
|
- spec/custom_matchers/custom_matchers.rb
|
121
120
|
- spec/spec_helper.rb
|
122
|
-
- spec/wrest/
|
123
|
-
- spec/wrest/
|
124
|
-
- spec/wrest/
|
121
|
+
- spec/wrest/components/attributes_container_spec.rb
|
122
|
+
- spec/wrest/core_ext/string_spec.rb
|
123
|
+
- spec/wrest/resource/base_spec.rb
|
125
124
|
- spec/wrest/response_spec.rb
|
126
125
|
- spec/wrest/translators/typed_hash_spec.rb
|
127
126
|
- spec/wrest/translators/xml_spec.rb
|
data/lib/wrest/mappers.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
# Copyright 2009 Sidu Ponnappa
|
2
|
-
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
6
|
-
# Unless required by applicable law or agreed to in writing, software distributed under the License
|
7
|
-
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
8
|
-
# See the License for the specific language governing permissions and limitations under the License.
|
9
|
-
|
10
|
-
module Wrest #:nodoc:
|
11
|
-
# A Mapper is anything that constructs an object
|
12
|
-
# or object graph from a hash map. This hash map
|
13
|
-
# is typically obtained by using a Translator to
|
14
|
-
# deserialise a Response.
|
15
|
-
module Mappers
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
require "#{WREST_ROOT}/wrest/mappers/attributes_container"
|
20
|
-
require "#{WREST_ROOT}/wrest/mappers/simple_resource"
|
21
|
-
require "#{WREST_ROOT}/wrest/mappers/resource"
|