kaiwren-wrest 0.0.4 → 0.0.5

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.
@@ -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, you'll need to add GitHub to you gem sources if you haven't already done so:
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 = 'doc'
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')
@@ -48,13 +48,13 @@ begin
48
48
  require 'jeweler'
49
49
  Jeweler::Tasks.new do |gemspec|
50
50
  gemspec.name = "wrest"
51
- gemspec.version = "0.0.3"
52
51
  gemspec.summary = "REST client library for Ruby."
53
52
  gemspec.description = "Wrest is a REST client library which allows you to quickly build object oriented wrappers around any web service. It has two main components - Wrest Core and Wrest::Resource."
54
53
  gemspec.authors = ["Sidu Ponnappa"]
55
54
  gemspec.email = "ckponnappa@gmail.com"
56
55
  gemspec.homepage = "http://github.com/kaiwren/wrest"
57
56
  gemspec.has_rdoc = true
57
+ gemspec.rubyforge_project = 'wrest'
58
58
  gemspec.platform = Gem::Platform::RUBY
59
59
  gemspec.executables = ['wrest']
60
60
  gemspec.require_path = "lib"
@@ -68,6 +68,33 @@ rescue LoadError
68
68
  puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
69
69
  end
70
70
 
71
+ begin
72
+ require 'rake/contrib/sshpublisher'
73
+ namespace :rubyforge do
74
+
75
+ desc "Release gem and RDoc documentation to RubyForge"
76
+ task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]
77
+
78
+ namespace :release do
79
+ desc "Publish RDoc to RubyForge."
80
+ task :docs => [:rdoc] do
81
+ config = YAML.load(
82
+ File.read(File.expand_path('~/.rubyforge/user-config.yml'))
83
+ )
84
+
85
+ host = "#{config['username']}@rubyforge.org"
86
+ remote_dir = "/var/www/gforge-projects/wrest/"
87
+ local_dir = 'rdoc'
88
+
89
+ Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
90
+ end
91
+ end
92
+ end
93
+ rescue LoadError
94
+ puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
95
+ end
96
+
97
+
71
98
  namespace (:benchmark) do
72
99
  desc "Create classes to be used in Wrest::Resource vs. ActiveResource"
73
100
  task :setup_test_classes do
@@ -1,4 +1,4 @@
1
1
  ---
2
- :patch: 4
2
+ :patch: 5
3
3
  :minor: 0
4
4
  :major: 0
@@ -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
- module Mappers
12
- class SimpleResource
13
- include Wrest::Mappers::AttributesContainer
14
- attr_reader :attributes
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::Mappers #:nodoc:
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
- module Mappers
12
- module Resource
13
- end
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/mappers/resource/base"
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::Mappers::Resource #:nodoc:
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::Mappers::AttributesContainer
14
+ include Wrest::Components::AttributesContainer
15
15
 
16
16
  has_attributes :id
17
17
  attr_reader :attributes
@@ -8,5 +8,5 @@
8
8
  # See the License for the specific language governing permissions and limitations under the License.
9
9
 
10
10
  # Understands how to contain a collection of Wrest::Resources
11
- class Wrest::Mappers::Resource::Collection
11
+ class Wrest::Resource::Collection
12
12
  end
@@ -12,7 +12,7 @@ module Wrest
12
12
  unless defined? MAJOR
13
13
  MAJOR = 0
14
14
  MINOR = 0
15
- TINY = 4
15
+ TINY = 5
16
16
 
17
17
  STRING = [MAJOR, MINOR, TINY].join('.')
18
18
 
@@ -9,7 +9,7 @@
9
9
 
10
10
  require File.dirname(__FILE__) + '/../../spec_helper'
11
11
 
12
- module Wrest::Mappers
12
+ module Wrest::Components
13
13
  describe AttributesContainer do
14
14
  class HumanBeing
15
15
  include AttributesContainer
@@ -0,0 +1,7 @@
1
+ require File.dirname(__FILE__) + '/../../spec_helper'
2
+
3
+ describe String, 'extensions' do
4
+ it "should know how to convert a string to a Wrest::Uri" do
5
+ 'http://localhost:3000'.to_uri.should == Wrest::Uri.new('http://localhost:3000')
6
+ end
7
+ end
@@ -1,6 +1,6 @@
1
- require File.dirname(__FILE__) + '/../../../spec_helper'
1
+ require File.dirname(__FILE__) + '/../../spec_helper'
2
2
 
3
- class Glassware < Wrest::Mappers::Resource::Base
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::Mappers
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: kaiwren-wrest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
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-18 00:00:00 -07:00
12
+ date: 2009-04-20 00:00:00 -07:00
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/mappers.rb
64
- - lib/wrest/mappers/attributes_container.rb
65
- - lib/wrest/mappers/resource.rb
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/mappers/attributes_container_spec.rb
83
- - spec/wrest/mappers/resource/base_spec.rb
84
- - spec/wrest/mappers/simple_resource_spec.rb
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
@@ -109,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
108
  version:
110
109
  requirements: []
111
110
 
112
- rubyforge_project:
111
+ rubyforge_project: wrest
113
112
  rubygems_version: 1.2.0
114
113
  signing_key:
115
114
  specification_version: 3
@@ -117,9 +116,9 @@ summary: REST client library for Ruby.
117
116
  test_files:
118
117
  - spec/custom_matchers/custom_matchers.rb
119
118
  - spec/spec_helper.rb
120
- - spec/wrest/mappers/attributes_container_spec.rb
121
- - spec/wrest/mappers/resource/base_spec.rb
122
- - spec/wrest/mappers/simple_resource_spec.rb
119
+ - spec/wrest/components/attributes_container_spec.rb
120
+ - spec/wrest/core_ext/string_spec.rb
121
+ - spec/wrest/resource/base_spec.rb
123
122
  - spec/wrest/response_spec.rb
124
123
  - spec/wrest/translators/typed_hash_spec.rb
125
124
  - spec/wrest/translators/xml_spec.rb
@@ -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"
@@ -1,7 +0,0 @@
1
- require File.dirname(__FILE__) + '/../../spec_helper'
2
-
3
- module Wrest::Mappers
4
- describe SimpleResource do
5
- it "should do something"
6
- end
7
- end