api_client_base 0.2.0 → 0.2.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 40aec0e5f2dddf675b4e5a7df5e30518d1e28b7f
4
- data.tar.gz: 9c225931a08517e543e8818ceef6ce8cc5828e50
3
+ metadata.gz: c1810c99b2a7120ac20568a58ebe02ecba7ce3f2
4
+ data.tar.gz: 40a4c41bee6aed4bc80bda8430dab9178af1ae94
5
5
  SHA512:
6
- metadata.gz: 7755b15e5885babce88d5116a9f64dacafc8231a92a2c67b0fc22390b3f1128e6ef365f487a26568f502486430428ea52bde05aa5cdace1a58951a36d1f7e121
7
- data.tar.gz: ae7ab45a1807d225c906df4235e017c4fcf0ac0b74ab363fe207e6622887418c44ae09466b115e7f5cfbb1b4a3486432fd67668d47e6ed6849fd955bdb4707c4
6
+ metadata.gz: dff3a2dcabb87193c5a4303b4b5dbf6383ac69c19f9b421cd707f1c4cbaf816a2092f398fc58d8c5d20b576c163cfe495eb73f26d74083049c18d5577090f899
7
+ data.tar.gz: be3502b1c3f94a7ea70a550cb0c2aec8256b9f2455ca2fff75d8b76b5a1b7e45d404d47b38db2af41264b10876df31308a49435b6db86d78b09012bda5dc160a
@@ -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 |args={}|
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 = 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
@@ -1,3 +1,3 @@
1
1
  module APIClientBase
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  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.0
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: 2016-12-22 00:00:00.000000000 Z
11
+ date: 2017-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport