smartcar 1.0.7 → 1.0.8

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: 20f8c410ca2e09b81f481f66f8790b9040688dec92973825d7a7ba72cec14a7d
4
- data.tar.gz: 5c748df1b3c987a00df29e1f7f65ae8c89c76ad7473acfc8135c27ddad94fe15
3
+ metadata.gz: a3f5f753c2493733b16502aa5d2cbd3957ed073a1caf9dbcd032241febbe75b7
4
+ data.tar.gz: 2f639abde820c99a2ea91a80518dd95ffba94dbfc1915dd5ddb53578189fdb5e
5
5
  SHA512:
6
- metadata.gz: 4bdbd39d8887437f76f53ccea2cdc8f6ae618d5a13558713c44b74ca21ab01fbe960b8d8b66104ace8df1a4c3de2d8a2308e3fe6ec000c9a80b721abda0fca09
7
- data.tar.gz: 71f27cea632e1578e878f9bb6c7caa921890236515facc7435f6b17aa2faa1c198c8e7bfd4064fd90ec37ee2533d31aae362b1f0c13ce867b43380d3add3fcbc
6
+ metadata.gz: 2abac7e475acd840ba72e98367857abed3ea53c1df739179cbaf1a9c6751542bdfc3871cd8f1fc908a428fa603839f68ec0a82c13f0bf9f985f462ee3bf32fa5
7
+ data.tar.gz: e7352fd756b8c969eb50450e6fa7024e4196e86511b9630afe1db0ba46cdf8d6ca71d342402b2e891bfcfe0ec6d88ba70a1f17dcf7ac3481ea169d12106ad5cc
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- smartcar (1.0.7)
4
+ smartcar (1.0.8)
5
5
  oauth2 (~> 1.4)
6
6
 
7
7
  GEM
@@ -10,8 +10,9 @@ GEM
10
10
  byebug (11.1.3)
11
11
  childprocess (3.0.0)
12
12
  diff-lcs (1.3)
13
- faraday (1.0.1)
13
+ faraday (1.1.0)
14
14
  multipart-post (>= 1.2, < 3)
15
+ ruby2_keywords
15
16
  jwt (2.2.2)
16
17
  multi_json (1.15.0)
17
18
  multi_xml (0.6.0)
@@ -38,6 +39,7 @@ GEM
38
39
  diff-lcs (>= 1.2.0, < 2.0)
39
40
  rspec-support (~> 3.9.0)
40
41
  rspec-support (3.9.3)
42
+ ruby2_keywords (0.0.2)
41
43
  rubyzip (2.3.0)
42
44
  selenium-webdriver (3.142.7)
43
45
  childprocess (>= 0.5, < 4.0)
data/README.md CHANGED
@@ -109,12 +109,13 @@ Example Usage for oAuth -
109
109
  # To get the redirect URL :
110
110
  2.5.5 :002 > options = {test_mode: true,scope: ["read_battery","read_charge","read_fuel","read_location","control_security","read_odometer","read_tires","read_vin","read_vehicle_info"],flags: ["country:DE"]}
111
111
  2.5.5 :003 > require 'smartcar'
112
- 2.5.5 :004 > url = Smartcar::Oauth.authorization_url(options)
113
- => "https://connect.smartcar.com/oauth/authorize?approval_prompt=auto&client_id=2715c6b2-eba8-4fda-85b1-8d849733a344&mode=test&redirect_uri=http%3A%2F%2Flocalhost%3A8000%2Fcallback&response_type=code&scope=read_battery+read_charge+read_fuel+read_location+control_security+read_odometer+read_tires+read_vin+read_vehicle_info&flags=country%3ADE"
112
+ 2.5.5 :004 > client = Smartcar::Oauth.new(options)
113
+ 2.5.5 :005 > url = client.authorization_url
114
+ => "https://connect.smartcar.com/oauth/authorize?approval_prompt=auto&client_id=<client id>&mode=test&redirect_uri=http%3A%2F%2Flocalhost%3A8000%2Fcallback&response_type=code&scope=read_battery+read_charge+read_fuel+read_location+control_security+read_odometer+read_tires+read_vin+read_vehicle_info&flags=country%3ADE"
114
115
  # Redirect user to the above URL.
115
116
  # After authentication user control reaches the callback URL with code.
116
117
  # Use the code from the parameters and request a token
117
- 2.5.5 :006 > token_hash = Smartcar::Oauth.get_token(code)
118
+ 2.5.5 :006 > token_hash = client.get_token(code)
118
119
  => {"token_type"=>"Bearer", :access_token=>"56801a5e-6a0b-4d05-a43e-52a4d5e6648f", :refresh_token=>"4f46e7e4-28c5-47b3-ba8d-7dcef73d05dd", :expires_at=>1577875279}
119
120
  # This access_token can be used to call the Smartcar APIs as given above.
120
121
  # Store this hash and if it expired refresh the token OR use the code again to
@@ -136,19 +137,22 @@ Tests can be run using either default rake command OR specific rspec command.
136
137
  bundle exec rake spec
137
138
  ```
138
139
 
139
- Releasing to rubygems right now cannot be automated because of MFA ([source](https://github.com/rubygems/rubygems/issues/3092)). For now the process is to run the gem build and push commands locally and manually enter in the Rubygems MFA code (available on 1password). Steps for that would be :
140
+ **NOTE : Do not forget to update the version number in version.rb.**
141
+
142
+ ## Release
143
+
144
+ Deployments to Rubgygems is automated through Travis. After merging to master, create a tag on the latest commit on master and push it. That would trigger a CI job which will build, test and deploy to Rubygems. As a convention we use the version number of the gem for the release tag.
140
145
 
141
146
  ```
142
147
  # After merging to master, checkout to master and pull code locally, then run the following
143
- gem build
144
- Successfully built RubyGem
145
- Name: smartcar
146
- Version: <version>
147
- File: smartcar-<version>.gem
148
- # now push the gem built by the build command. This would ask for the MFA code
149
- gem push smartcar-<version>.gem
148
+ git tag v1.2.3
149
+ # now push the tags
150
+ git push origin --tags
151
+ Total 0 (delta 0), reused 0 (delta 0)
152
+ To github.com:smartcar/ruby-sdk.git
153
+ * [new tag] v1.2.3 -> v1.2.3
150
154
  ```
151
- In general it is a good advice to create a tag for every release. If not for the above mentioned MFA bug, creating a tag for a commit on master and pushing the tag would trigger travis to deploy to rubygems automatically.
155
+
152
156
 
153
157
  ## Contributing
154
158
 
@@ -156,7 +160,7 @@ To contribute, please:
156
160
 
157
161
  1. Open an issue for the feature (or bug) you would like to resolve.
158
162
  2. Resolve the issue and add tests in your feature branch.
159
- 3. Open a PR from your feature branch into `develop` that tags the issue.
163
+ 3. Open a PR from your feature branch into `master` that tags the issue.
160
164
 
161
165
  [gem-image]: https://badge.fury.io/rb/smartcar
162
166
  [gem-url]: https://badge.fury.io/rb/smartcar.svg
@@ -84,7 +84,7 @@ module Smartcar
84
84
  # EX : Smartcar::Vehicle.new(token: token, id: id).permissions
85
85
  # @param options [Hash] - Optional filter parameters (check documentation)
86
86
  #
87
- # @return [Array] of permissions (Strings)
87
+ # @return [Permissions] object
88
88
  def permissions(options: {})
89
89
  get_attribute(Permissions)
90
90
  end
@@ -1,4 +1,4 @@
1
1
  module Smartcar
2
2
  # Gem current version number
3
- VERSION = "1.0.7"
3
+ VERSION = "1.0.8"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartcar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ashwin Subramanian
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-06 00:00:00.000000000 Z
11
+ date: 2020-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler