apipie-bindings 0.3.0 → 0.4.0

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
  SHA256:
3
- metadata.gz: 89d947a65424dc154dcc7fe08ffe8c7d18f5286643d9e1c4616070f7f814e8ef
4
- data.tar.gz: 18d9c689d6d3f4a5a2b25020f3cc80337ebaa7b674fd6fba5e3d2df1b8dabf36
3
+ metadata.gz: 5c27168a737308891f84a0437f14b21247d4054651f698f888ef3a5e80dced00
4
+ data.tar.gz: 6d68349f382e9282d5674db0e175280d05952ea35004a6dc525d896b93ae46c6
5
5
  SHA512:
6
- metadata.gz: a7e133869cf290c0b38fbabf434b2208734c4e539a19adaae994cd947642052be747a9123e50ba58d8dec0a93dbceed144235a0895fc72381dae1e2f1fc8a94d
7
- data.tar.gz: 481a7f9fa959a0ca1670b76496f709c1126d7342c31acca8c764ad0f04f4b6a42b72018ff9c6bd7c4fcbc29c734a3596621c23a68b986b159410386c8ccb0d76
6
+ metadata.gz: eeb6522be945abe8c90588ac382751e4cf0ece7b898ae233def0a73d9d621264ee5bb4494e5da4921a75cde2af8fe078be3aa4875441e54390417b9948ff75b5
7
+ data.tar.gz: 1ac904b2c5e2ea670246619fe8d1e5b3450cc7567f716692506311e0ce5a0130191862e71e9ef253fcb87437a88fa9213ab3e93b57a902f7d0f6c056c2c18f04
@@ -1,5 +1,8 @@
1
1
  Release notes
2
2
  =============
3
+ ### 0.4.0 (2020-05-29)
4
+ * support Ruby 2.7 ([PR #79](https://github.com/Apipie/apipie-bindings/pull/79))
5
+
3
6
  ### 0.3.0 (2019-10-25)
4
7
  * Add token based auth mechanism ([PR #77](https://github.com/Apipie/apipie-bindings/pull/77))
5
8
  * Throw malformed examples ([PR #78](https://github.com/Apipie/apipie-bindings/pull/78))
@@ -135,7 +135,7 @@ module ApipieBindings
135
135
  end
136
136
 
137
137
  def apidoc
138
- @apidoc = @apidoc || load_apidoc || retrieve_apidoc
138
+ @apidoc ||= load_apidoc || retrieve_apidoc
139
139
  @apidoc
140
140
  end
141
141
 
@@ -280,7 +280,7 @@ module ApipieBindings
280
280
  end
281
281
 
282
282
  def retrieve_apidoc
283
- FileUtils.mkdir_p(@apidoc_cache_dir) unless File.exists?(@apidoc_cache_dir)
283
+ FileUtils.mkdir_p(@apidoc_cache_dir) unless File.exist?(@apidoc_cache_dir)
284
284
  if language
285
285
  response = retrieve_apidoc_call("/apidoc/v#{@api_version}.#{language}.json", :safe => true)
286
286
  language_family = language.split('_').first
@@ -16,7 +16,7 @@ module ApipieBindings
16
16
  end
17
17
 
18
18
  unless RestClient.before_execution_procs.include? RestClient::AUTHENTICATOR_EXTENSION
19
- RestClient.add_before_execution_proc &RestClient::AUTHENTICATOR_EXTENSION
19
+ RestClient.add_before_execution_proc(&RestClient::AUTHENTICATOR_EXTENSION)
20
20
  end
21
21
  end
22
22
  end
@@ -17,10 +17,10 @@ module ApipieBindings
17
17
  def path(params=nil)
18
18
  return @path if params.nil?
19
19
 
20
- path = params_in_path.inject(@path) do |p, param_name|
20
+ params_in_path.inject(@path) do |p, param_name|
21
21
  param_value = (params[param_name.to_sym] or params[param_name.to_s]) or
22
22
  raise ArgumentError, "missing param '#{param_name}' in parameters"
23
- p.sub(":#{param_name}", URI.escape(param_value.to_s))
23
+ p.sub(":#{param_name}", CGI.escape(param_value.to_s))
24
24
  end
25
25
  end
26
26
 
@@ -1,5 +1,5 @@
1
1
  module ApipieBindings
2
2
  def self.version
3
- @version ||= Gem::Version.new '0.3.0'
3
+ @version ||= Gem::Version.new '0.4.0'
4
4
  end
5
5
  end
@@ -60,7 +60,7 @@ describe ApipieBindings::Action do
60
60
  e = proc do
61
61
  resource.action(:create).validate!({ :user => { :vip => true } })
62
62
  end.must_raise(ApipieBindings::MissingArgumentsError)
63
- e.message.must_match /: user\[name\]$/
63
+ e.message.must_match(/: user\[name\]$/)
64
64
  end
65
65
 
66
66
  it "should raise on missing nested required params (hash)" do
@@ -74,7 +74,7 @@ describe ApipieBindings::Action do
74
74
  }
75
75
  })
76
76
  end.must_raise(ApipieBindings::MissingArgumentsError)
77
- e.message.must_match /: user\[address\]\[city\]$/
77
+ e.message.must_match(/: user\[address\]\[city\]$/)
78
78
  end
79
79
 
80
80
  it "should raise on missing nested required params (array)" do
@@ -88,7 +88,7 @@ describe ApipieBindings::Action do
88
88
  }
89
89
  })
90
90
  end.must_raise(ApipieBindings::MissingArgumentsError)
91
- e.message.must_match /: user\[contacts\]\[0\]\[contact\]$/
91
+ e.message.must_match(/: user\[contacts\]\[0\]\[contact\]$/)
92
92
  end
93
93
 
94
94
  it "should raise on invalid param format" do
@@ -103,8 +103,8 @@ describe ApipieBindings::Action do
103
103
  }
104
104
  })
105
105
  end.must_raise(ApipieBindings::InvalidArgumentTypesError)
106
- e.message.must_match /user\[contacts\]\[0\] - Hash was expected/
107
- e.message.must_match /user\[contacts\]\[1\] - Hash was expected/
106
+ e.message.must_match(/user\[contacts\]\[0\] - Hash was expected/)
107
+ e.message.must_match(/user\[contacts\]\[1\] - Hash was expected/)
108
108
  end
109
109
 
110
110
  it "should accept minimal correct params" do
@@ -131,7 +131,7 @@ describe ApipieBindings::Action do
131
131
  end
132
132
 
133
133
  it "should have name visible in puts" do
134
- out, err = capture_io { puts resource.action(:index) }
134
+ out, _err = capture_io { puts resource.action(:index) }
135
135
  out.must_equal "<Action users:index>\n"
136
136
  end
137
137
 
@@ -76,7 +76,7 @@ describe ApipieBindings::API do
76
76
  request_args = RestClient.version >= '1.8.0' ? args.last.args : args.last
77
77
  request_args[:method] == :post && request_args[:params] == {:file => s} && request_args[:headers] == headers
78
78
  end
79
- result = api.http_call(:post, '/api/path', {:file => s}, headers, {:response => :raw})
79
+ api.http_call(:post, '/api/path', {:file => s}, headers, {:response => :raw})
80
80
  end
81
81
 
82
82
  it "should process nil response safely" do
@@ -46,7 +46,7 @@ describe ApipieBindings::Param do
46
46
  end
47
47
 
48
48
  it "should have full name, type and required visible in puts" do
49
- out, err = capture_io { puts param }
49
+ out, _err = capture_io { puts param }
50
50
  out.must_equal "<Param *architecture (Hash)>\n"
51
51
  end
52
52
 
@@ -34,7 +34,7 @@ describe ApipieBindings::Resource do
34
34
  end
35
35
 
36
36
  it "should have name visible in puts" do
37
- out, err = capture_io { puts resource }
37
+ out, _err = capture_io { puts resource }
38
38
  out.must_equal "<Resource :users>\n"
39
39
  end
40
40
 
@@ -24,7 +24,7 @@ describe ApipieBindings::Route do
24
24
  end
25
25
 
26
26
  it "should have path visible in puts" do
27
- out, err = capture_io { puts route }
27
+ out, _err = capture_io { puts route }
28
28
  out.must_equal "<Route /api/architectures/:id>\n"
29
29
  end
30
30
 
@@ -12,6 +12,6 @@ SimpleCov.root Pathname.new(File.dirname(__FILE__) + "../../../")
12
12
  require 'minitest/autorun'
13
13
  require 'minitest/spec'
14
14
  require "minitest-spec-context"
15
- require "mocha/setup"
15
+ require "mocha/minitest"
16
16
 
17
17
  require 'apipie_bindings'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apipie-bindings
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Bačovský
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-25 00:00:00.000000000 Z
11
+ date: 2020-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -62,16 +62,16 @@ dependencies:
62
62
  name: rake
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - "~>"
65
+ - - ">="
66
66
  - !ruby/object:Gem::Version
67
- version: 10.1.0
67
+ version: 12.3.3
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - "~>"
72
+ - - ">="
73
73
  - !ruby/object:Gem::Version
74
- version: 10.1.0
74
+ version: 12.3.3
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: thor
77
77
  requirement: !ruby/object:Gem::Requirement
@@ -257,7 +257,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
257
257
  version: '0'
258
258
  requirements: []
259
259
  rubyforge_project:
260
- rubygems_version: 2.7.10
260
+ rubygems_version: 2.7.6.2
261
261
  signing_key:
262
262
  specification_version: 4
263
263
  summary: The Ruby bindings for Apipie documented APIs