dm-rest-adapter 1.1.0 → 1.2.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -5,7 +5,7 @@ source 'http://rubygems.org'
5
5
  SOURCE = ENV.fetch('SOURCE', :git).to_sym
6
6
  REPO_POSTFIX = SOURCE == :path ? '' : '.git'
7
7
  DATAMAPPER = SOURCE == :path ? Pathname(__FILE__).dirname.parent : 'http://github.com/datamapper'
8
- DM_VERSION = '~> 1.1.0'
8
+ DM_VERSION = '~> 1.2.0.rc1'
9
9
 
10
10
  gem 'dm-serializer', DM_VERSION, SOURCE => "#{DATAMAPPER}/dm-serializer#{REPO_POSTFIX}"
11
11
 
@@ -13,18 +13,18 @@ group :development do
13
13
 
14
14
  gem 'dm-validations', DM_VERSION, SOURCE => "#{DATAMAPPER}/dm-validations#{REPO_POSTFIX}"
15
15
  gem 'fakeweb', '~> 1.3'
16
- gem 'jeweler', '~> 1.5.2'
17
- gem 'rake', '~> 0.8.7'
18
- gem 'rspec', '~> 1.3.1'
16
+ gem 'jeweler', '~> 1.6.4'
17
+ gem 'rake', '~> 0.9.2'
18
+ gem 'rspec', '~> 1.3.2'
19
19
 
20
20
  end
21
21
 
22
22
  platforms :mri_18 do
23
23
  group :quality do
24
24
 
25
- gem 'rcov', '~> 0.9.9'
26
- gem 'yard', '~> 0.6'
27
- gem 'yardstick', '~> 0.2'
25
+ gem 'rcov', '~> 0.9.10'
26
+ gem 'yard', '~> 0.7.2'
27
+ gem 'yardstick', '~> 0.4'
28
28
 
29
29
  end
30
30
  end
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
 
4
4
  begin
5
- gem 'jeweler', '~> 1.5.2'
5
+ gem 'jeweler', '~> 1.6.4'
6
6
  require 'jeweler'
7
7
 
8
8
  Jeweler::Tasks.new do |gem|
@@ -12,7 +12,6 @@ begin
12
12
  gem.email = 'scott.burton [a] joyent [d] com'
13
13
  gem.homepage = 'http://github.com/datamapper/%s' % gem.name
14
14
  gem.authors = [ 'Scott Burton @ Joyent Inc' ]
15
- gem.has_rdoc = 'yard'
16
15
 
17
16
  gem.rubyforge_project = 'datamapper'
18
17
  end
@@ -21,5 +20,5 @@ begin
21
20
 
22
21
  FileList['tasks/**/*.rake'].each { |task| import task }
23
22
  rescue LoadError
24
- puts 'Jeweler (or a dependency) not available. Install it with: gem install jeweler -v 1.5.2'
23
+ puts 'Jeweler (or a dependency) not available. Install it with: gem install jeweler -v 1.6.4'
25
24
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.2.0.rc1
@@ -4,14 +4,14 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{dm-rest-adapter}
8
- s.version = "1.1.0"
7
+ s.name = "dm-rest-adapter"
8
+ s.version = "1.2.0.rc1"
9
9
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
10
+ s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Scott Burton @ Joyent Inc"]
12
- s.date = %q{2011-03-16}
13
- s.description = %q{REST Adapter for DataMapper}
14
- s.email = %q{scott.burton [a] joyent [d] com}
12
+ s.date = "2011-09-09"
13
+ s.description = "REST Adapter for DataMapper"
14
+ s.email = "scott.burton [a] joyent [d] com"
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE",
17
17
  "README.rdoc"
@@ -40,44 +40,37 @@ Gem::Specification.new do |s|
40
40
  "tasks/yard.rake",
41
41
  "tasks/yardstick.rake"
42
42
  ]
43
- s.homepage = %q{http://github.com/datamapper/dm-rest-adapter}
43
+ s.homepage = "http://github.com/datamapper/dm-rest-adapter"
44
44
  s.require_paths = ["lib"]
45
- s.rubyforge_project = %q{datamapper}
46
- s.rubygems_version = %q{1.6.2}
47
- s.summary = %q{REST Adapter for DataMapper}
48
- s.test_files = [
49
- "spec/fixtures/book.rb",
50
- "spec/fixtures/difficult_book.rb",
51
- "spec/semipublic/connection_spec.rb",
52
- "spec/semipublic/rest_adapter_spec.rb",
53
- "spec/spec_helper.rb"
54
- ]
45
+ s.rubyforge_project = "datamapper"
46
+ s.rubygems_version = "1.8.10"
47
+ s.summary = "REST Adapter for DataMapper"
55
48
 
56
49
  if s.respond_to? :specification_version then
57
50
  s.specification_version = 3
58
51
 
59
52
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
60
- s.add_runtime_dependency(%q<dm-serializer>, ["~> 1.1.0"])
61
- s.add_development_dependency(%q<dm-validations>, ["~> 1.1.0"])
53
+ s.add_runtime_dependency(%q<dm-serializer>, ["~> 1.2.0.rc1"])
54
+ s.add_development_dependency(%q<dm-validations>, ["~> 1.2.0.rc1"])
62
55
  s.add_development_dependency(%q<fakeweb>, ["~> 1.3"])
63
- s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
64
- s.add_development_dependency(%q<rake>, ["~> 0.8.7"])
65
- s.add_development_dependency(%q<rspec>, ["~> 1.3.1"])
56
+ s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
57
+ s.add_development_dependency(%q<rake>, ["~> 0.9.2"])
58
+ s.add_development_dependency(%q<rspec>, ["~> 1.3.2"])
66
59
  else
67
- s.add_dependency(%q<dm-serializer>, ["~> 1.1.0"])
68
- s.add_dependency(%q<dm-validations>, ["~> 1.1.0"])
60
+ s.add_dependency(%q<dm-serializer>, ["~> 1.2.0.rc1"])
61
+ s.add_dependency(%q<dm-validations>, ["~> 1.2.0.rc1"])
69
62
  s.add_dependency(%q<fakeweb>, ["~> 1.3"])
70
- s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
71
- s.add_dependency(%q<rake>, ["~> 0.8.7"])
72
- s.add_dependency(%q<rspec>, ["~> 1.3.1"])
63
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
64
+ s.add_dependency(%q<rake>, ["~> 0.9.2"])
65
+ s.add_dependency(%q<rspec>, ["~> 1.3.2"])
73
66
  end
74
67
  else
75
- s.add_dependency(%q<dm-serializer>, ["~> 1.1.0"])
76
- s.add_dependency(%q<dm-validations>, ["~> 1.1.0"])
68
+ s.add_dependency(%q<dm-serializer>, ["~> 1.2.0.rc1"])
69
+ s.add_dependency(%q<dm-validations>, ["~> 1.2.0.rc1"])
77
70
  s.add_dependency(%q<fakeweb>, ["~> 1.3"])
78
- s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
79
- s.add_dependency(%q<rake>, ["~> 0.8.7"])
80
- s.add_dependency(%q<rspec>, ["~> 1.3.1"])
71
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
72
+ s.add_dependency(%q<rake>, ["~> 0.9.2"])
73
+ s.add_dependency(%q<rspec>, ["~> 1.3.2"])
81
74
  end
82
75
  end
83
76
 
@@ -83,7 +83,7 @@ module DataMapperRest
83
83
  :path => @options[:path],
84
84
  :query_values => query,
85
85
  :fragment => @options[:fragment]
86
- ).freeze
86
+ )
87
87
  end
88
88
  end
89
89
 
@@ -129,16 +129,14 @@ module DataMapperRest
129
129
  raise "No root element matching #{element_name} in xml"
130
130
  end
131
131
 
132
- pairs = model.properties(name).map { |p| [ p.field, p ] }
133
- field_to_property = DataMapper::Ext::Array.to_hash(pairs)
132
+ field_to_property = Hash[ model.properties(name).map { |p| [ p.field, p ] } ]
134
133
  record_from_rexml(entity_element, field_to_property)
135
134
  end
136
135
 
137
136
  def parse_resources(xml, model)
138
137
  doc = REXML::Document::new(xml)
139
138
 
140
- pairs = model.properties(name).map { |p| [ p.field, p ] }
141
- field_to_property = DataMapper::Ext::Array.to_hash(pairs)
139
+ field_to_property = Hash[ model.properties(name).map { |p| [ p.field, p ] } ]
142
140
  element_name = element_name(model)
143
141
 
144
142
  doc.elements.collect("/#{resource_name(model)}/#{element_name}") do |entity_element|
@@ -1,5 +1,4 @@
1
1
  require 'net/http'
2
- require 'dm-core/support/inflector'
3
2
 
4
3
  module DataMapperRest
5
4
  # Somewhat stolen from ActiveResource
@@ -15,3 +15,9 @@ DataMapper.setup(:default, 'rest://admin:secret@localhost:4000/?format=xml')
15
15
  Pathname.glob((ROOT + 'spec/fixtures/**/*.rb').to_s).each { |file| require file }
16
16
 
17
17
  FakeWeb.allow_net_connect = false
18
+
19
+ Spec::Runner.configure do |config|
20
+ config.before :suite do
21
+ DataMapper.finalize
22
+ end
23
+ end
metadata CHANGED
@@ -1,8 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dm-rest-adapter
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 1.1.0
4
+ hash: 15424023
5
+ prerelease: 6
6
+ segments:
7
+ - 1
8
+ - 2
9
+ - 0
10
+ - rc
11
+ - 1
12
+ version: 1.2.0.rc1
6
13
  platform: ruby
7
14
  authors:
8
15
  - Scott Burton @ Joyent Inc
@@ -10,75 +17,107 @@ autorequire:
10
17
  bindir: bin
11
18
  cert_chain: []
12
19
 
13
- date: 2011-03-16 00:00:00 -07:00
14
- default_executable:
20
+ date: 2011-09-09 00:00:00 Z
15
21
  dependencies:
16
22
  - !ruby/object:Gem::Dependency
17
- name: dm-serializer
18
- requirement: &id001 !ruby/object:Gem::Requirement
23
+ type: :runtime
24
+ version_requirements: &id001 !ruby/object:Gem::Requirement
19
25
  none: false
20
26
  requirements:
21
27
  - - ~>
22
28
  - !ruby/object:Gem::Version
23
- version: 1.1.0
24
- type: :runtime
29
+ hash: 15424023
30
+ segments:
31
+ - 1
32
+ - 2
33
+ - 0
34
+ - rc
35
+ - 1
36
+ version: 1.2.0.rc1
25
37
  prerelease: false
26
- version_requirements: *id001
38
+ requirement: *id001
39
+ name: dm-serializer
27
40
  - !ruby/object:Gem::Dependency
28
- name: dm-validations
29
- requirement: &id002 !ruby/object:Gem::Requirement
41
+ type: :development
42
+ version_requirements: &id002 !ruby/object:Gem::Requirement
30
43
  none: false
31
44
  requirements:
32
45
  - - ~>
33
46
  - !ruby/object:Gem::Version
34
- version: 1.1.0
35
- type: :development
47
+ hash: 15424023
48
+ segments:
49
+ - 1
50
+ - 2
51
+ - 0
52
+ - rc
53
+ - 1
54
+ version: 1.2.0.rc1
36
55
  prerelease: false
37
- version_requirements: *id002
56
+ requirement: *id002
57
+ name: dm-validations
38
58
  - !ruby/object:Gem::Dependency
39
- name: fakeweb
40
- requirement: &id003 !ruby/object:Gem::Requirement
59
+ type: :development
60
+ version_requirements: &id003 !ruby/object:Gem::Requirement
41
61
  none: false
42
62
  requirements:
43
63
  - - ~>
44
64
  - !ruby/object:Gem::Version
65
+ hash: 9
66
+ segments:
67
+ - 1
68
+ - 3
45
69
  version: "1.3"
46
- type: :development
47
70
  prerelease: false
48
- version_requirements: *id003
71
+ requirement: *id003
72
+ name: fakeweb
49
73
  - !ruby/object:Gem::Dependency
50
- name: jeweler
51
- requirement: &id004 !ruby/object:Gem::Requirement
74
+ type: :development
75
+ version_requirements: &id004 !ruby/object:Gem::Requirement
52
76
  none: false
53
77
  requirements:
54
78
  - - ~>
55
79
  - !ruby/object:Gem::Version
56
- version: 1.5.2
57
- type: :development
80
+ hash: 7
81
+ segments:
82
+ - 1
83
+ - 6
84
+ - 4
85
+ version: 1.6.4
58
86
  prerelease: false
59
- version_requirements: *id004
87
+ requirement: *id004
88
+ name: jeweler
60
89
  - !ruby/object:Gem::Dependency
61
- name: rake
62
- requirement: &id005 !ruby/object:Gem::Requirement
90
+ type: :development
91
+ version_requirements: &id005 !ruby/object:Gem::Requirement
63
92
  none: false
64
93
  requirements:
65
94
  - - ~>
66
95
  - !ruby/object:Gem::Version
67
- version: 0.8.7
68
- type: :development
96
+ hash: 63
97
+ segments:
98
+ - 0
99
+ - 9
100
+ - 2
101
+ version: 0.9.2
69
102
  prerelease: false
70
- version_requirements: *id005
103
+ requirement: *id005
104
+ name: rake
71
105
  - !ruby/object:Gem::Dependency
72
- name: rspec
73
- requirement: &id006 !ruby/object:Gem::Requirement
106
+ type: :development
107
+ version_requirements: &id006 !ruby/object:Gem::Requirement
74
108
  none: false
75
109
  requirements:
76
110
  - - ~>
77
111
  - !ruby/object:Gem::Version
78
- version: 1.3.1
79
- type: :development
112
+ hash: 31
113
+ segments:
114
+ - 1
115
+ - 3
116
+ - 2
117
+ version: 1.3.2
80
118
  prerelease: false
81
- version_requirements: *id006
119
+ requirement: *id006
120
+ name: rspec
82
121
  description: REST Adapter for DataMapper
83
122
  email: scott.burton [a] joyent [d] com
84
123
  executables: []
@@ -111,7 +150,6 @@ files:
111
150
  - tasks/spec.rake
112
151
  - tasks/yard.rake
113
152
  - tasks/yardstick.rake
114
- has_rdoc: true
115
153
  homepage: http://github.com/datamapper/dm-rest-adapter
116
154
  licenses: []
117
155
 
@@ -125,23 +163,27 @@ required_ruby_version: !ruby/object:Gem::Requirement
125
163
  requirements:
126
164
  - - ">="
127
165
  - !ruby/object:Gem::Version
166
+ hash: 3
167
+ segments:
168
+ - 0
128
169
  version: "0"
129
170
  required_rubygems_version: !ruby/object:Gem::Requirement
130
171
  none: false
131
172
  requirements:
132
- - - ">="
173
+ - - ">"
133
174
  - !ruby/object:Gem::Version
134
- version: "0"
175
+ hash: 25
176
+ segments:
177
+ - 1
178
+ - 3
179
+ - 1
180
+ version: 1.3.1
135
181
  requirements: []
136
182
 
137
183
  rubyforge_project: datamapper
138
- rubygems_version: 1.6.2
184
+ rubygems_version: 1.8.10
139
185
  signing_key:
140
186
  specification_version: 3
141
187
  summary: REST Adapter for DataMapper
142
- test_files:
143
- - spec/fixtures/book.rb
144
- - spec/fixtures/difficult_book.rb
145
- - spec/semipublic/connection_spec.rb
146
- - spec/semipublic/rest_adapter_spec.rb
147
- - spec/spec_helper.rb
188
+ test_files: []
189
+