homeflow_api 0.17.14 → 0.17.15
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.
- data/VERSION +1 -1
- data/homeflow_api.gemspec +2 -2
- data/lib/homeflow/api/request.rb +10 -5
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.17.
|
1
|
+
0.17.15
|
data/homeflow_api.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "homeflow_api"
|
8
|
-
s.version = "0.17.
|
8
|
+
s.version = "0.17.15"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Daniel Cooper"]
|
12
|
-
s.date = "2013-
|
12
|
+
s.date = "2013-08-06"
|
13
13
|
s.description = "A gem for dealing the homeflow api"
|
14
14
|
s.email = "daniel@homeflow.co.uk"
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/homeflow/api/request.rb
CHANGED
@@ -22,11 +22,7 @@ module Homeflow
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def perform_request
|
25
|
-
|
26
|
-
url = "#{Homeflow::API.config.source}/#{request_specification.resource_class.resource_uri}"
|
27
|
-
else
|
28
|
-
url = "#{Homeflow::API.config.source}/#{request_specification.resource_uri}"
|
29
|
-
end
|
25
|
+
url = normalised_base_url
|
30
26
|
query_params = @request_specification.to_params.merge(constant_params)
|
31
27
|
post_params = (@request_specification.respond_to?(:post_params) ? @request_specification.post_params : {})
|
32
28
|
if Homeflow::API.config.show_debug && Homeflow::API.configuration.logger
|
@@ -52,6 +48,15 @@ module Homeflow
|
|
52
48
|
end
|
53
49
|
end
|
54
50
|
|
51
|
+
def normalised_base_url
|
52
|
+
source = Homeflow::API.config.source.gsub(/.\/$/,'')
|
53
|
+
if request_specification.is_a? Query
|
54
|
+
return "#{source}/#{request_specification.resource_class.resource_uri}"
|
55
|
+
else
|
56
|
+
return "#{source}/#{request_specification.resource_uri}"
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
55
60
|
def body_of_request(request)
|
56
61
|
if request.respond_to? :body
|
57
62
|
request.body
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: homeflow_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.17.
|
4
|
+
version: 0.17.15
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-08-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: hashie
|
@@ -178,7 +178,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
178
178
|
version: '0'
|
179
179
|
segments:
|
180
180
|
- 0
|
181
|
-
hash:
|
181
|
+
hash: -1047818709259987954
|
182
182
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
183
183
|
none: false
|
184
184
|
requirements:
|