ares-focus-extensions 0.0.2 → 0.0.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.
- data/lib/ares/add_api_key.rb +7 -0
- data/lib/ares/remove_format_extension.rb +7 -0
- metadata +3 -3
data/lib/ares/add_api_key.rb
CHANGED
|
@@ -5,13 +5,19 @@ module ActiveResource
|
|
|
5
5
|
def element_path_with_auth(*args)
|
|
6
6
|
element_path_without_auth(*args).concat("?Ft-Api-Key=#{self.api_key}")
|
|
7
7
|
end
|
|
8
|
+
|
|
8
9
|
def new_element_path_with_auth(*args)
|
|
9
10
|
new_element_path_without_auth(*args).concat("?Ft-Api-Key=#{self.api_key}")
|
|
10
11
|
end
|
|
12
|
+
|
|
11
13
|
def collection_path_with_auth(*args)
|
|
12
14
|
collection_path_without_auth(*args).concat("?Ft-Api-Key=#{self.api_key}")
|
|
13
15
|
end
|
|
14
16
|
|
|
17
|
+
def custom_method_collection_url_with_auth(*args)
|
|
18
|
+
custom_method_collection_url_without_auth(*args).concat("?Ft-Api-Key=#{self.api_key}")
|
|
19
|
+
end
|
|
20
|
+
|
|
15
21
|
def api_key
|
|
16
22
|
# Not using superclass_delegating_reader. See +site+ for explanation
|
|
17
23
|
if defined?(@api_key)
|
|
@@ -33,6 +39,7 @@ module ActiveResource
|
|
|
33
39
|
alias_method_chain :element_path, :auth
|
|
34
40
|
alias_method_chain :new_element_path, :auth
|
|
35
41
|
alias_method_chain :collection_path, :auth
|
|
42
|
+
alias_method_chain :custom_method_collection_url, :auth
|
|
36
43
|
#attr_accessor :api_key
|
|
37
44
|
end
|
|
38
45
|
end
|
|
@@ -5,12 +5,18 @@ module ActiveResource
|
|
|
5
5
|
def element_path_with_extension(*args)
|
|
6
6
|
element_path_without_extension(*args).gsub(/.json|.xml/,'')
|
|
7
7
|
end
|
|
8
|
+
|
|
8
9
|
def new_element_path_with_extension(*args)
|
|
9
10
|
new_element_path_without_extension(*args).gsub(/.json|.xml/,'')
|
|
10
11
|
end
|
|
12
|
+
|
|
11
13
|
def collection_path_with_extension(*args)
|
|
12
14
|
collection_path_without_extension(*args).gsub(/.json|.xml/,'')
|
|
13
15
|
end
|
|
16
|
+
|
|
17
|
+
def custom_method_collection_url_with_extension(*args)
|
|
18
|
+
custom_method_collection_url_without_extension(*args).gsub(/.json|.xml/,'')
|
|
19
|
+
end
|
|
14
20
|
end
|
|
15
21
|
|
|
16
22
|
def self.included(base)
|
|
@@ -20,6 +26,7 @@ module ActiveResource
|
|
|
20
26
|
alias_method_chain :element_path, :extension
|
|
21
27
|
alias_method_chain :new_element_path, :extension
|
|
22
28
|
alias_method_chain :collection_path, :extension
|
|
29
|
+
alias_method_chain :custom_method_collection_url, :extension
|
|
23
30
|
end
|
|
24
31
|
end
|
|
25
32
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ares-focus-extensions
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.3
|
|
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: 2012-12-
|
|
12
|
+
date: 2012-12-26 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: activeresource
|
|
@@ -28,7 +28,7 @@ dependencies:
|
|
|
28
28
|
- !ruby/object:Gem::Version
|
|
29
29
|
version: '3.0'
|
|
30
30
|
description: Add-ons including API Key, remove format extensions (.json, .xml) for
|
|
31
|
-
requests, and configuration file (sites.yml) for each
|
|
31
|
+
requests, and configuration file (sites.yml) for each environment's default settings.
|
|
32
32
|
email: spencerfdavis@gmail.com
|
|
33
33
|
executables: []
|
|
34
34
|
extensions: []
|