tiqets 0.2.0 → 0.3.0

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
  SHA1:
3
- metadata.gz: 58a9128f0eeb3fe9c16aa58845a7e4b718cbd323
4
- data.tar.gz: d4a69be377f0f1466f6b18820ba2d47c74d3f23e
3
+ metadata.gz: 243efec33ef0f3bfac4ab3e62b1945f4428a42e6
4
+ data.tar.gz: a553e2ed7e3c2ef1bc1803710723814a056e4e97
5
5
  SHA512:
6
- metadata.gz: 5ca4a3bac7a153c4564ecf7caac312aa03d8592903bb11dd187bceeec7592adeac112df59dcd81b20fab685a5486563a2c234eb0aac1d22db719af317e784465
7
- data.tar.gz: 598997ab957416a90145790dc88a5944c45e83a382819a6d04a3ddd7bff2e7e0969fd6d4b9750e37e161532a38afb64ddae78751b5d7a514a7482131b09e0ca2
6
+ metadata.gz: 12a3ba5f9b3da267a7a01fa4f571ce2844197de4c97285e5b6d274c8e91d3fd17e1ea7a2564df99426175ded750ba210e24ed2254db8f06b37d924f2fe4cb4ea
7
+ data.tar.gz: ffd2b0b615f6448a09c11abd4027ddbb4c1c1aa2d99f024f8248d49ebf7abdde2f03348118809c54b16617cb5718460e3b35b536425d8366bf6ab27e0a4b3de2
@@ -7,4 +7,11 @@ rvm:
7
7
  - 2.3.4
8
8
  - 2.4.1
9
9
 
10
+ addons:
11
+ code_climate:
12
+ repo_token: aa95c18c4a614c7aad6306f78f9d205bf04481ca82e91138cd9f4c1b573bf4bd
13
+
10
14
  before_install: gem install bundler -v 1.15.3
15
+
16
+ after_success:
17
+ - bundle exec codeclimate-test-reporter
@@ -0,0 +1,6 @@
1
+ # Changelog
2
+
3
+ ## 0.3.0
4
+ - Add changelog
5
+ - Setup test coverage
6
+ - Support query params
data/README.md CHANGED
@@ -4,7 +4,8 @@ A simple (unofficial) Ruby wrapper for the [Tiqets](https://www.tiqets.com) [API
4
4
 
5
5
  [![Travis CI status](https://img.shields.io/travis/richardvenneman/tiqets.svg?style=flat-square)](https://travis-ci.org/richardvenneman/tiqets)
6
6
  [![RubyGem](https://img.shields.io/gem/v/tiqets.svg?style=flat-square)](https://rubygems.org/gems/tiqets)
7
-
7
+ [![Code Climate](https://img.shields.io/codeclimate/github/richardvenneman/tiqets.svg?style=flat-square)](https://codeclimate.com/github/richardvenneman/tiqets)
8
+ [![Code Climate](https://img.shields.io/codeclimate/coverage/github/richardvenneman/tiqets.svg?style=flat-square)](https://codeclimate.com/github/richardvenneman/tiqets/coverage)
8
9
 
9
10
  Full 100% API coverage is not a direct goal as we're primarily developing this for our needs at [CitySpotters](https://www.cityspotters.com). Pull requests are definitely welcome.
10
11
 
@@ -40,12 +41,17 @@ Alternatively you can set the `TIQETS_API_KEY` environment variable and use the
40
41
 
41
42
  ### Products
42
43
 
43
- #### Get a single product
44
+ #### client#find_product(product_id, params)
45
+
44
46
  Finds a product by Product ID. Returns an object with the properties [described in the API documentation](https://api.tiqets.com/v2/docs/#the-product-object).
45
47
 
48
+ Requires the `lang` and `currency` params [as specified in the API documentation](https://api.tiqets.com/v2/docs/#get-a-single-product).
49
+
46
50
  ```ruby
47
- @client.find_product(973698)
51
+ product = @client.find_product(973698)
48
52
  # => #<Tiqets::Resources::Product::Product:0x007fe9c8438a00>
53
+
54
+ product.title #=> "Louvre Museum: Skip the line"
49
55
  ```
50
56
 
51
57
  ## Contributing
@@ -17,8 +17,8 @@ module Tiqets
17
17
  @connection ||= HTTP.auth("Authorization: Token #{@api_key}")
18
18
  end
19
19
 
20
- def get(url, response_key)
21
- response = connection.get(@root + url)
20
+ def get(url, params, response_key)
21
+ response = connection.get(@root + url, params: params)
22
22
 
23
23
  handle_response(response, response_key)
24
24
  end
@@ -1,6 +1,6 @@
1
1
  module Tiqets
2
2
  class Error < Exception
3
- attr_reader :code, :error
3
+ attr_reader :code, :message
4
4
 
5
5
  def initialize(code, error)
6
6
  @code = code
@@ -10,9 +10,7 @@ module Tiqets
10
10
  end
11
11
 
12
12
  def message
13
- message = "Tiqets API Error: #{@error}"
14
- message += " (code: #{@code})" unless @code.nil?
15
- message
13
+ "Tiqets API error: #{@error}"
16
14
  end
17
15
  end
18
16
  end
@@ -1,10 +1,8 @@
1
1
  module Tiqets
2
2
  module Resources
3
3
  module Product
4
- SLUG = 'products'.freeze
5
-
6
- def find_product(id)
7
- response = get("products/#{id}", 'product')
4
+ def find_product(id, params = {})
5
+ response = get("products/#{id}", params, 'product')
8
6
  Product.new(response)
9
7
  end
10
8
 
@@ -1,3 +1,3 @@
1
1
  module Tiqets
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.3.0'.freeze
3
3
  end
@@ -27,4 +27,6 @@ Gem::Specification.new do |spec|
27
27
  spec.add_development_dependency 'guard-minitest', '~> 2'
28
28
  spec.add_development_dependency 'rake', '~> 10.0'
29
29
  spec.add_development_dependency 'webmock', '~> 3.0'
30
+ spec.add_development_dependency 'simplecov', '~> 0.15'
31
+ spec.add_development_dependency 'codeclimate-test-reporter', '~> 1.0.0'
30
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tiqets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Venneman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-17 00:00:00.000000000 Z
11
+ date: 2017-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http
@@ -94,6 +94,34 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '3.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: simplecov
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '0.15'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '0.15'
111
+ - !ruby/object:Gem::Dependency
112
+ name: codeclimate-test-reporter
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 1.0.0
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 1.0.0
97
125
  description: Ruby Tiqets API wrapper.
98
126
  email:
99
127
  - richardvenneman@me.com
@@ -104,6 +132,7 @@ files:
104
132
  - ".gitignore"
105
133
  - ".ruby-version"
106
134
  - ".travis.yml"
135
+ - CHANGELOG.md
107
136
  - Gemfile
108
137
  - Guardfile
109
138
  - LICENSE.txt