acfs 1.3.0 → 1.3.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 +4 -4
- data/CHANGELOG.md +20 -0
- data/acfs.gemspec +1 -1
- data/lib/acfs/location.rb +2 -2
- data/lib/acfs/version.rb +1 -1
- data/spec/acfs/location_spec.rb +23 -0
- data/spec/acfs/resource/query_methods_spec.rb +1 -1
- data/spec/spec_helper.rb +8 -5
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '099f37ed68e218d04f91c2f9f636e7b177b84feb8b8e0be4c4403da004937760'
|
4
|
+
data.tar.gz: bfbf0d3dc7f77eb38f16043051350a468baab870b3b002c35bc9f96df492eb07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29c45b69c95afd11cb58af0e02a383a2c1adcfeefb2521a917e1b7f6606a694c66fa0e2d56796e59127d453f4a1f95ab36c6a2e9a384657992b6a821c946c357
|
7
|
+
data.tar.gz: cba2e6df7a7988d2d06fc8ca303aa63875736c6d0fc6c0013ecbb36038b559bcfc085058c086468389905947aba375d6add11f3e8010ab2cff1b70628edd8770
|
data/CHANGELOG.md
CHANGED
@@ -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.
|
data/acfs.gemspec
CHANGED
@@ -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'
|
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
|
data/lib/acfs/location.rb
CHANGED
@@ -33,7 +33,7 @@ module Acfs
|
|
33
33
|
|
34
34
|
def str
|
35
35
|
uri = raw.dup
|
36
|
-
uri.path =
|
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
|
data/lib/acfs/version.rb
CHANGED
@@ -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
|
data/spec/spec_helper.rb
CHANGED
@@ -1,11 +1,14 @@
|
|
1
1
|
require 'rspec'
|
2
2
|
require 'webmock/rspec'
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
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.
|
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-
|
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: '
|
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: '
|
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
|