restify 0.2.0.1.b46 → 0.2.0.1.b47
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MmQ2MjU4ODNjZDRhYjlmMjc4MGQ3NWQ4ZDljZGY5YmQzZWExYjZmNg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OTFlOGM5ZjYwY2FhNDcyNzAxNzI1ODU0OWQwZjI0NjE2MWRlYWFmMA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NTkyMzM3ZTdkYWUxYmIyNDY4ZTNkMTVjMDVhODNlNjkyMjExNTMwNjBmZjQ3
|
10
|
+
ZDYxOTQwZDJjNWQxNjIxMTZmNzAyN2MzNjMzNzZhNmJlY2U2ZDk0ZDQ3N2Vm
|
11
|
+
ZGVmM2E2NmYyZGU3YzI4ODliNjMxY2I3ZGI3NGM2NTk3YWIyMjk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NTMxODgwOTkyZDhlOWYzODRiYmJmNjVhMTA2MTFkM2M0MDU5ZmFiODhkYjJj
|
14
|
+
YmYyOTBhM2IyN2E1MmE0Nzk1ZjBhZWRkZmZmOWU5OWI0MmFiMDVjMjE5Mjlj
|
15
|
+
YWYxNGEzNTIwMzMyOGZmNGIzZTVjZGVhMjVmYjRiMWMyNDQ1NWU=
|
data/lib/restify/relation.rb
CHANGED
@@ -34,7 +34,10 @@ module Restify
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def expand(params)
|
37
|
-
|
37
|
+
variables = extract! params
|
38
|
+
uri = @template.expand variables
|
39
|
+
uri.query_values = params if params.any?
|
40
|
+
uri
|
38
41
|
end
|
39
42
|
|
40
43
|
private
|
@@ -43,7 +46,7 @@ module Restify
|
|
43
46
|
@context.request method, expand(params), data
|
44
47
|
end
|
45
48
|
|
46
|
-
def
|
49
|
+
def extract!(params)
|
47
50
|
@template.variables.each_with_object({}) do |var, hash|
|
48
51
|
if (value = params.delete(var) { params.delete(var.to_sym) { nil } })
|
49
52
|
value = value.to_param if value.respond_to?(:to_param)
|
@@ -35,5 +35,11 @@ describe Restify::Relation do
|
|
35
35
|
|
36
36
|
it { expect(subject.to_s).to eq 'http://test.host/resource/42' }
|
37
37
|
end
|
38
|
+
|
39
|
+
context 'with additional parameters' do
|
40
|
+
let(:params) { {id: '5', abc: 'cde'} }
|
41
|
+
|
42
|
+
it { expect(subject.to_s).to eq 'http://test.host/resource/5?abc=cde' }
|
43
|
+
end
|
38
44
|
end
|
39
45
|
end
|
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib"]
|
10
10
|
s.authors = ["Michael Bleigh", "Jerry Cheung"]
|
11
|
-
s.date = "2014-12-
|
11
|
+
s.date = "2014-12-19"
|
12
12
|
s.description = "Hashie is a collection of classes and mixins that make hashes more powerful."
|
13
13
|
s.email = ["michael@intridea.com", "jollyjerry@gmail.com"]
|
14
14
|
s.files = [".yardopts", "CHANGELOG.md", "CONTRIBUTING.md", "LICENSE", "README.md", "Rakefile", "UPGRADING.md", "hashie.gemspec", "lib/hashie.rb", "lib/hashie/clash.rb", "lib/hashie/dash.rb", "lib/hashie/extensions/coercion.rb", "lib/hashie/extensions/dash/indifferent_access.rb", "lib/hashie/extensions/deep_fetch.rb", "lib/hashie/extensions/deep_find.rb", "lib/hashie/extensions/deep_merge.rb", "lib/hashie/extensions/ignore_undeclared.rb", "lib/hashie/extensions/indifferent_access.rb", "lib/hashie/extensions/key_conversion.rb", "lib/hashie/extensions/mash/safe_assignment.rb", "lib/hashie/extensions/merge_initializer.rb", "lib/hashie/extensions/method_access.rb", "lib/hashie/extensions/parsers/yaml_erb_parser.rb", "lib/hashie/extensions/pretty_inspect.rb", "lib/hashie/extensions/stringify_keys.rb", "lib/hashie/extensions/symbolize_keys.rb", "lib/hashie/hash.rb", "lib/hashie/mash.rb", "lib/hashie/rash.rb", "lib/hashie/trash.rb", "lib/hashie/version.rb", "spec/hashie/clash_spec.rb", "spec/hashie/dash_spec.rb", "spec/hashie/extensions/autoload_spec.rb", "spec/hashie/extensions/coercion_spec.rb", "spec/hashie/extensions/dash/indifferent_access_spec.rb", "spec/hashie/extensions/deep_fetch_spec.rb", "spec/hashie/extensions/deep_find_spec.rb", "spec/hashie/extensions/deep_merge_spec.rb", "spec/hashie/extensions/ignore_undeclared_spec.rb", "spec/hashie/extensions/indifferent_access_spec.rb", "spec/hashie/extensions/indifferent_access_with_rails_hwia_spec.rb", "spec/hashie/extensions/key_conversion_spec.rb", "spec/hashie/extensions/mash/safe_assignment_spec.rb", "spec/hashie/extensions/merge_initializer_spec.rb", "spec/hashie/extensions/method_access_spec.rb", "spec/hashie/extensions/stringify_keys_spec.rb", "spec/hashie/extensions/symbolize_keys_spec.rb", "spec/hashie/hash_spec.rb", "spec/hashie/mash_spec.rb", "spec/hashie/parsers/yaml_erb_parser_spec.rb", "spec/hashie/rash_spec.rb", "spec/hashie/trash_spec.rb", "spec/hashie/version_spec.rb", "spec/spec_helper.rb", "spec/support/module_context.rb"]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: restify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.0.1.
|
4
|
+
version: 0.2.0.1.b47
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Graichen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: obligation
|