service_api 0.0.1 → 0.0.2

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: ba6978a7be8e0338599cebac7b88b19dd2c75820
4
- data.tar.gz: 756d2a3a25c34a92f7cb5f89ac227472030413c4
3
+ metadata.gz: 3011d5900d368b5667436e94dea95a0e5d185ab8
4
+ data.tar.gz: b5f2d3a2731f8b87233467105227aa52db36705e
5
5
  SHA512:
6
- metadata.gz: 61642864e157207a38556f4f1178dc19bfb6928fb27e3167c07b56918e649cfc64b7804cc0ee7ea6ad27fdaa3c113e229cca03affbd0f651e5e4b56731a12575
7
- data.tar.gz: cf12d4612c7b6f2b19c045ba0c4e89ba0d719fd0d92b123c91e80a5c46a85a4abb74eac4880f2fb61aeefe51de00f80c930979f585b92b6e69726d2e82a034d2
6
+ metadata.gz: 04e57921b787ac37766f34cb9c06e2cfb8731e265deaa5bbf6c31d31b264f26bb44e46e6c6032bb4b8e42f727f71350040ebcc4c0047c13a3cae3c41b48f0e8d
7
+ data.tar.gz: a4240168d0795b24c5cd40be56fdbb54ca4947307bd426d549fe3d9bb53156fcc5af1c609013c36bc359233f9f76637ab765b442ef7c9da37adffa05b557d722
@@ -2,8 +2,8 @@ module ServiceApi
2
2
  class UriTokens
3
3
  attr_reader :uri_template
4
4
 
5
- def initialize(uri_template)
6
- @uri_template = URITemplate.new(uri_template)
5
+ def initialize(*args)
6
+ @uri_template = URITemplate.new(*args)
7
7
  end
8
8
 
9
9
  def token_values
@@ -1,3 +1,3 @@
1
1
  module ServiceApi
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
@@ -0,0 +1,27 @@
1
+ require 'spec_helper'
2
+
3
+ describe ServiceApi::UriTokens do
4
+ describe 'default' do
5
+ let(:template) { ServiceApi::UriTokens.new('http://{host}/{segments}/{file}.{extensions}') }
6
+
7
+ it 'should use RFC6570 class' do
8
+ template.uri_template.class.should == URITemplate::RFC6570
9
+ end
10
+
11
+ it 'should return token values' do
12
+ template.token_values.sort.should == ['host', 'segments', 'file', 'extensions'].sort
13
+ end
14
+ end
15
+
16
+ describe 'colon' do
17
+ let(:template) { ServiceApi::UriTokens.new(:colon, 'http://:host/:segments/:file.:extensions') }
18
+
19
+ it 'should use Colon class' do
20
+ template.uri_template.class.should == URITemplate::Colon
21
+ end
22
+
23
+ it 'should return token values' do
24
+ template.token_values.sort.should == ['host', 'segments', 'file', 'extensions'].sort
25
+ end
26
+ end
27
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: service_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Krzysztof Wawer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-20 00:00:00.000000000 Z
11
+ date: 2014-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -125,8 +125,8 @@ files:
125
125
  - lib/service_api/uri_tokens.rb
126
126
  - lib/service_api/version.rb
127
127
  - service_api.gemspec
128
- - spec/integrations/base_faraday_spec.rb
129
- - spec/integrations/uri_tokens_spec.rb
128
+ - spec/functionals/base_faraday_spec.rb
129
+ - spec/functionals/uri_tokens_spec.rb
130
130
  - spec/spec_helper.rb
131
131
  homepage: http://github.com/wafcio/service_api
132
132
  licenses:
@@ -153,6 +153,6 @@ signing_key:
153
153
  specification_version: 4
154
154
  summary: Set of useful modules, classes for api gems
155
155
  test_files:
156
- - spec/integrations/base_faraday_spec.rb
157
- - spec/integrations/uri_tokens_spec.rb
156
+ - spec/functionals/base_faraday_spec.rb
157
+ - spec/functionals/uri_tokens_spec.rb
158
158
  - spec/spec_helper.rb
@@ -1,9 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe ServiceApi::UriTokens do
4
- let(:template) { ServiceApi::UriTokens.new('http://{host}/{segments}/{file}.{extensions}') }
5
-
6
- it 'should return token values' do
7
- template.token_values.sort.should == ['extensions', 'file', 'host', 'segments']
8
- end
9
- end