aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource
diff options
context:
space:
mode:
Diffstat (limited to 'activeresource')
-rwxr-xr-xactiveresource/Rakefile4
-rw-r--r--activeresource/activeresource.gemspec3
-rw-r--r--activeresource/lib/active_resource/base.rb20
-rw-r--r--activeresource/lib/active_resource/http_mock.rb2
-rw-r--r--activeresource/lib/active_resource/version.rb2
-rw-r--r--activeresource/test/abstract_unit.rb6
6 files changed, 21 insertions, 16 deletions
diff --git a/activeresource/Rakefile b/activeresource/Rakefile
index 42e450da66..b1c18ff189 100755
--- a/activeresource/Rakefile
+++ b/activeresource/Rakefile
@@ -1,7 +1,7 @@
#!/usr/bin/env rake
require 'rake/testtask'
require 'rake/packagetask'
-require 'rake/gempackagetask'
+require 'rubygems/package_task'
desc "Default Task"
task :default => [ :test ]
@@ -26,7 +26,7 @@ end
spec = eval(File.read('activeresource.gemspec'))
-Rake::GemPackageTask.new(spec) do |p|
+Gem::PackageTask.new(spec) do |p|
p.gem_spec = spec
end
diff --git a/activeresource/activeresource.gemspec b/activeresource/activeresource.gemspec
index c2fd707e9b..a8772ecf8c 100644
--- a/activeresource/activeresource.gemspec
+++ b/activeresource/activeresource.gemspec
@@ -12,9 +12,8 @@ Gem::Specification.new do |s|
s.author = 'David Heinemeier Hansson'
s.email = 'david@loudthinking.com'
s.homepage = 'http://www.rubyonrails.org'
- s.rubyforge_project = 'activeresource'
- s.files = Dir['CHANGELOG', 'README.rdoc', 'examples/**/*', 'lib/**/*']
+ s.files = Dir['CHANGELOG', 'MIT-LICENSE', 'README.rdoc', 'examples/**/*', 'lib/**/*']
s.require_path = 'lib'
s.extra_rdoc_files = %w( README.rdoc )
diff --git a/activeresource/lib/active_resource/base.rb b/activeresource/lib/active_resource/base.rb
index 65d285249b..0c272fa093 100644
--- a/activeresource/lib/active_resource/base.rb
+++ b/activeresource/lib/active_resource/base.rb
@@ -3,7 +3,6 @@ require 'active_support/core_ext/class/attribute_accessors'
require 'active_support/core_ext/class/attribute'
require 'active_support/core_ext/hash/indifferent_access'
require 'active_support/core_ext/kernel/reporting'
-require 'active_support/core_ext/module/attr_accessor_with_default'
require 'active_support/core_ext/module/delegation'
require 'active_support/core_ext/module/aliasing'
require 'active_support/core_ext/object/blank'
@@ -565,10 +564,23 @@ module ActiveResource
@headers ||= {}
end
- attr_accessor_with_default(:element_name) { model_name.element } #:nodoc:
- attr_accessor_with_default(:collection_name) { ActiveSupport::Inflector.pluralize(element_name) } #:nodoc:
+ attr_writer :element_name
- attr_accessor_with_default(:primary_key, 'id') #:nodoc:
+ def element_name
+ @element_name ||= model_name.element
+ end
+
+ attr_writer :collection_name
+
+ def collection_name
+ @collection_name ||= ActiveSupport::Inflector.pluralize(element_name)
+ end
+
+ attr_writer :primary_key
+
+ def primary_key
+ @primary_key ||= 'id'
+ end
# Gets the \prefix for a resource's nested URL (e.g., <tt>prefix/collectionname/1.json</tt>)
# This method is regenerated at runtime based on what the \prefix is set to.
diff --git a/activeresource/lib/active_resource/http_mock.rb b/activeresource/lib/active_resource/http_mock.rb
index e90580be4f..6167c1420e 100644
--- a/activeresource/lib/active_resource/http_mock.rb
+++ b/activeresource/lib/active_resource/http_mock.rb
@@ -55,7 +55,7 @@ module ActiveResource
@responses = responses
end
- for method in [ :post, :put, :get, :delete, :head ]
+ [ :post, :put, :get, :delete, :head ].each do |method|
# def post(path, request_headers = {}, body = nil, status = 200, response_headers = {})
# @responses[Request.new(:post, path, nil, request_headers)] = Response.new(body || "", status, response_headers)
# end
diff --git a/activeresource/lib/active_resource/version.rb b/activeresource/lib/active_resource/version.rb
index f26e2312b9..440b504344 100644
--- a/activeresource/lib/active_resource/version.rb
+++ b/activeresource/lib/active_resource/version.rb
@@ -3,7 +3,7 @@ module ActiveResource
MAJOR = 3
MINOR = 1
TINY = 0
- PRE = "beta1"
+ PRE = "rc1"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
end
diff --git a/activeresource/test/abstract_unit.rb b/activeresource/test/abstract_unit.rb
index 948dd94a1d..9c1e9a526d 100644
--- a/activeresource/test/abstract_unit.rb
+++ b/activeresource/test/abstract_unit.rb
@@ -3,7 +3,6 @@ require File.expand_path('../../../load_paths', __FILE__)
lib = File.expand_path("#{File.dirname(__FILE__)}/../lib")
$:.unshift(lib) unless $:.include?('lib') || $:.include?(lib)
-require 'rubygems'
require 'test/unit'
require 'active_resource'
require 'active_support'
@@ -14,11 +13,6 @@ require 'setter_trap'
require 'logger'
ActiveResource::Base.logger = Logger.new("#{File.dirname(__FILE__)}/debug.log")
-begin
- require 'ruby-debug'
-rescue LoadError
-end
-
def setup_response
matz_hash = { 'person' => { :id => 1, :name => 'Matz' } }