api_client_base 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/api_client_base/client/class_methods.rb +2 -2
- data/lib/api_client_base/request.rb +1 -1
- data/lib/api_client_base/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1810c99b2a7120ac20568a58ebe02ecba7ce3f2
|
4
|
+
data.tar.gz: 40a4c41bee6aed4bc80bda8430dab9178af1ae94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dff3a2dcabb87193c5a4303b4b5dbf6383ac69c19f9b421cd707f1c4cbaf816a2092f398fc58d8c5d20b576c163cfe495eb73f26d74083049c18d5577090f899
|
7
|
+
data.tar.gz: be3502b1c3f94a7ea70a550cb0c2aec8256b9f2455ca2fff75d8b76b5a1b7e45d404d47b38db2af41264b10876df31308a49435b6db86d78b09012bda5dc160a
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
6
6
|
|
7
|
+
## [0.2.1] - 2017-02-13
|
8
|
+
### Fixed
|
9
|
+
- bug with customizing the args of an `api_action` (it didn't work at all!)
|
10
|
+
- when building path, escape the values
|
11
|
+
|
7
12
|
## [0.2.0]
|
8
13
|
### Added
|
9
14
|
- Convenience module for gem's base module
|
@@ -3,7 +3,7 @@ module APIClientBase
|
|
3
3
|
module ClassMethods
|
4
4
|
|
5
5
|
def api_action(action_name, opts={})
|
6
|
-
define_method action_name do
|
6
|
+
define_method action_name do |*args|
|
7
7
|
namespace = self.class.name.deconstantize.constantize
|
8
8
|
|
9
9
|
request_class_name = [action_name.to_s.camelize, "Request"].join
|
@@ -16,7 +16,7 @@ module APIClientBase
|
|
16
16
|
request_args = opts[:args].each_with_object({}).
|
17
17
|
with_index { |(arg, hash), i| hash[arg] = args[i] }
|
18
18
|
else
|
19
|
-
request_args =
|
19
|
+
request_args = {}
|
20
20
|
end
|
21
21
|
|
22
22
|
default_request_opts_method =
|
@@ -67,7 +67,7 @@ module APIClientBase
|
|
67
67
|
def default_api_client_base_path
|
68
68
|
path.scan(/:\w+/).reduce(path) do |new_path, var|
|
69
69
|
attribute_name = var.gsub(":", "")
|
70
|
-
value = self.send(attribute_name)
|
70
|
+
value = CGI::escape(self.send(attribute_name).to_s)
|
71
71
|
new_path.gsub(var, value.to_s)
|
72
72
|
end
|
73
73
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: api_client_base
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ramon Tayag
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|