moonmaster9000-dupe 0.3.2 → 0.3.3

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.
@@ -32,14 +32,16 @@ class Dupe
32
32
  private
33
33
  def find_all(records)
34
34
  ActiveResource::HttpMock.respond_to do |mock|
35
- mock.get "/#{@resource_name.to_s.pluralize}.xml", {}, format_for_service_response(records)
35
+ puts "mocking response to #{prefix}#{@resource_name.to_s.pluralize}.xml"
36
+ mock.get "#{prefix}#{@resource_name.to_s.pluralize}.xml", {}, format_for_service_response(records)
36
37
  end
37
38
  end
38
39
 
39
40
  def find_one(record, identifiers)
40
41
  ActiveResource::HttpMock.respond_to do |mock|
41
42
  identifiers.each do |identifier|
42
- mock.get "/#{@resource_name.to_s.pluralize}/#{record[identifier]}.xml", {}, format_for_service_response(record)
43
+ puts "mocking response to #{prefix}#{@resource_name.to_s.pluralize}/#{record[identifier]}.xml"
44
+ mock.get "#{prefix}#{@resource_name.to_s.pluralize}/#{record[identifier]}.xml", {}, format_for_service_response(record)
43
45
  end
44
46
  end
45
47
  end
@@ -48,5 +50,9 @@ class Dupe
48
50
  root = (records.is_a? Array) ? @resource_name.to_s.pluralize : @resource_name.to_s
49
51
  @format == :json ? records.to_json({:root => root}): records.to_xml({:root => root})
50
52
  end
53
+
54
+ def prefix
55
+ @resource_name.to_s.camelize.constantize.prefix.gsub(/\/+/, '/') rescue "/"
56
+ end
51
57
  end
52
58
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moonmaster9000-dupe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Parker
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-17 00:00:00 -07:00
12
+ date: 2009-09-23 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency