smartcar 1.0.7 → 1.0.8
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/Gemfile.lock +4 -2
- data/README.md +17 -13
- data/lib/smartcar/vehicle.rb +1 -1
- data/lib/smartcar/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3f5f753c2493733b16502aa5d2cbd3957ed073a1caf9dbcd032241febbe75b7
|
4
|
+
data.tar.gz: 2f639abde820c99a2ea91a80518dd95ffba94dbfc1915dd5ddb53578189fdb5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2abac7e475acd840ba72e98367857abed3ea53c1df739179cbaf1a9c6751542bdfc3871cd8f1fc908a428fa603839f68ec0a82c13f0bf9f985f462ee3bf32fa5
|
7
|
+
data.tar.gz: e7352fd756b8c969eb50450e6fa7024e4196e86511b9630afe1db0ba46cdf8d6ca71d342402b2e891bfcfe0ec6d88ba70a1f17dcf7ac3481ea169d12106ad5cc
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
smartcar (1.0.
|
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
|
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 >
|
113
|
-
|
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 =
|
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
|
-
|
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
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
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
|
-
|
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 `
|
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
|
data/lib/smartcar/vehicle.rb
CHANGED
@@ -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 [
|
87
|
+
# @return [Permissions] object
|
88
88
|
def permissions(options: {})
|
89
89
|
get_attribute(Permissions)
|
90
90
|
end
|
data/lib/smartcar/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2020-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|