routific 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/routific.rb +5 -2
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc6c661a65a9129693f2fd1f1c5fe07d50089e2b
4
- data.tar.gz: 5ecbf5537ec5bfac22d72aa3bcd7eaddc40165ba
3
+ metadata.gz: 340ed36c4db7569fd0679c3e58431486ecfaeaf9
4
+ data.tar.gz: f4b9bc9f9b6b9dd71a7a4224e6d375838e1df543
5
5
  SHA512:
6
- metadata.gz: db5d7e8a3108ced87eb681b37ce2c5c3348d776a53fbb5159256b898851e0cbb73b21faaf7c4a5e0cfc4464bfa194a2d36b4b91b47b9ceebfcd7244072a3da4a
7
- data.tar.gz: d27dec456acf25f6dbd351966c28e9819bb0948dad9c2f7e2d96538794428fb7cac02ba5bf38e75d3e1880f92e8399823c25a3290beac7b2bbe7294d0c097d64
6
+ metadata.gz: 3e7e5acc2e1c239251fc6cf0dae6898a1b47a2b3870500f1df6d068ed61a73bc1e252a92f5ed896b35862e115def1638750d15baaf89e162c7ce74741f09f4e6
7
+ data.tar.gz: ddde157979fa350588935653e8ae63e2197fe685e5352f65c4c6e76cedfbf0b3fb4b79d7de5519daa1bfe28377b30b474382e47236fc800161c90256e83f9ef6
@@ -70,11 +70,14 @@ class Routific
70
70
  raise ArgumentError, "access token must be set"
71
71
  end
72
72
 
73
- # Sends HTTP request to Routific API server
73
+ # Prefix the token with "bearer " if missing during assignment
74
+ prefixed_token = (/bearer /.match(token).nil?) ? "bearer #{token}" : token
75
+
74
76
  begin
77
+ # Sends HTTP request to Routific API server
75
78
  response = RestClient.post('https://routific.com/api/vrp',
76
79
  data.to_json,
77
- 'Authorization' => "bearer #{token}",
80
+ 'Authorization' => prefixed_token,
78
81
  content_type: :json,
79
82
  accept: :json
80
83
  )
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: routific
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc Kuo
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-01-21 00:00:00.000000000 Z
12
+ date: 2015-01-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  version: '0'
145
145
  requirements: []
146
146
  rubyforge_project:
147
- rubygems_version: 2.2.2
147
+ rubygems_version: 2.4.5
148
148
  signing_key:
149
149
  specification_version: 4
150
150
  summary: routific API