acfs 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 81eada64bf268a7ee4bdec316baf65e2f8ca0ac8cd80120474dfede36d4b4f51
4
- data.tar.gz: b5a0d11f1eb60c8bfb16ccd66a8d7ee8f09fcaeea8976f47540239725a08d08b
3
+ metadata.gz: '099f37ed68e218d04f91c2f9f636e7b177b84feb8b8e0be4c4403da004937760'
4
+ data.tar.gz: bfbf0d3dc7f77eb38f16043051350a468baab870b3b002c35bc9f96df492eb07
5
5
  SHA512:
6
- metadata.gz: 2cb0a9482b37b1a57bfad86f4213040d27babbf2cd6d4496a93b3260e50435ff1c575d57ba4a0d48b22ada2a3fbda44289283da1032fe3ecdc6010fe39f7646e
7
- data.tar.gz: b21823474d56cdda6ca816f21d3f76674aa00a4d2636ec0dedc15deecd17469ef55716688306a654952bee4438b5ce338cc2471b4db644852daaa09e0b2bbc4c
6
+ metadata.gz: 29c45b69c95afd11cb58af0e02a383a2c1adcfeefb2521a917e1b7f6606a694c66fa0e2d56796e59127d453f4a1f95ab36c6a2e9a384657992b6a821c946c357
7
+ data.tar.gz: cba2e6df7a7988d2d06fc8ca303aa63875736c6d0fc6c0013ecbb36038b559bcfc085058c086468389905947aba375d6add11f3e8010ab2cff1b70628edd8770
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+
4
+
5
+ ## Unreleased
6
+ ---
7
+
8
+ ### New
9
+
10
+ ### Changes
11
+
12
+ ### Fixes
13
+
14
+ ### Breaks
15
+
16
+
17
+ ## 1.3.1 - (2019-07-02)
18
+ ---
19
+
20
+ ### Fixes
21
+ * Improve URL argument encoding when building resource requests
22
+
3
23
  ## 1.3.0
4
24
 
5
25
  * Change default error messages to a more compact representation to ease integration with error reporting services.
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
 
29
29
  spec.add_runtime_dependency 'rack'
30
30
 
31
- spec.add_development_dependency 'bundler', '~> 1.3'
31
+ spec.add_development_dependency 'bundler'
32
32
 
33
33
  if ENV['TRAVIS_BUILD_NUMBER'] && !ENV['TRAVIS_TAG']
34
34
  # Append travis build number for auto-releases
@@ -33,7 +33,7 @@ module Acfs
33
33
 
34
34
  def str
35
35
  uri = raw.dup
36
- uri.path = URI.escape '/' + struct.map {|s| lookup_arg(s, args) }.join('/')
36
+ uri.path = '/' + struct.map {|s| lookup_arg(s, args) }.join('/')
37
37
  uri.to_s
38
38
  end
39
39
 
@@ -58,7 +58,7 @@ module Acfs
58
58
 
59
59
  def lookup_replacement(sym, args)
60
60
  value = get_replacement(sym, args).to_s
61
- return value unless value.empty?
61
+ return ::URI.encode_www_form_component(value) unless value.empty?
62
62
 
63
63
  raise ArgumentError.new "Cannot replace path argument `#{sym}' with empty string."
64
64
  end
@@ -2,7 +2,7 @@ module Acfs
2
2
  module VERSION
3
3
  MAJOR = 1
4
4
  MINOR = 3
5
- PATCH = 0
5
+ PATCH = 1
6
6
  STAGE = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, STAGE].reject(&:nil?).join('.')
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+
3
+ describe ::Acfs::Location do
4
+ let(:location) { described_class.new(uri, args) }
5
+ let(:uri) { 'http://localhost/users/:id' }
6
+ let(:args) { {id: 4} }
7
+
8
+ describe '#str' do
9
+ subject(:str) { location.str }
10
+
11
+ it 'replaces variables with values' do
12
+ expect(str).to eq 'http://localhost/users/4'
13
+ end
14
+
15
+ context 'with special characters' do
16
+ let(:args) { {id: '4 [@(\/!^$'} }
17
+
18
+ it 'escapes special characters' do
19
+ expect(str).to eq 'http://localhost/users/4+%5B%40%28%5C%2F%21%5E%24'
20
+ end
21
+ end
22
+ end
23
+ end
@@ -398,7 +398,7 @@ describe Acfs::Resource::QueryMethods do
398
398
  expect(block).not_to receive(:call)
399
399
 
400
400
  model.find_by! age: 24, &block
401
- expect { Acfs.run }.to raise_error
401
+ expect { Acfs.run }.to raise_error Acfs::ResourceNotFound
402
402
  end
403
403
  end
404
404
  end
@@ -1,11 +1,14 @@
1
1
  require 'rspec'
2
2
  require 'webmock/rspec'
3
3
 
4
- if ENV['CI'] || (defined?(:RUBY_ENGINE) && RUBY_ENGINE != 'rbx')
5
- require 'coveralls'
6
- Coveralls.wear! do
7
- add_filter 'spec'
8
- end
4
+ require 'simplecov'
5
+ SimpleCov.start do
6
+ add_filter 'spec'
7
+ end
8
+
9
+ if ENV['CI']
10
+ require 'codecov'
11
+ SimpleCov.formatter = SimpleCov::Formatter::Codecov
9
12
  end
10
13
 
11
14
  require 'bundler'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acfs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Graichen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-27 00:00:00.000000000 Z
11
+ date: 2019-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -98,16 +98,16 @@ dependencies:
98
98
  name: bundler
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: '1.3'
103
+ version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: '1.3'
110
+ version: '0'
111
111
  description: API Client For Services
112
112
  email:
113
113
  - jg@altimos.de
@@ -174,6 +174,7 @@ files:
174
174
  - spec/acfs/collection_spec.rb
175
175
  - spec/acfs/configuration_spec.rb
176
176
  - spec/acfs/global_spec.rb
177
+ - spec/acfs/location_spec.rb
177
178
  - spec/acfs/middleware/json_spec.rb
178
179
  - spec/acfs/middleware/msgpack_spec.rb
179
180
  - spec/acfs/operation_spec.rb
@@ -237,6 +238,7 @@ test_files:
237
238
  - spec/acfs/collection_spec.rb
238
239
  - spec/acfs/configuration_spec.rb
239
240
  - spec/acfs/global_spec.rb
241
+ - spec/acfs/location_spec.rb
240
242
  - spec/acfs/middleware/json_spec.rb
241
243
  - spec/acfs/middleware/msgpack_spec.rb
242
244
  - spec/acfs/operation_spec.rb