centaman 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/centaman.rb +1 -1
- data/lib/centaman/version.rb +1 -1
- data/lib/centaman/wrapper.rb +8 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4bf3e4c569f27b72696e95c7b5777f82b49598f
|
4
|
+
data.tar.gz: 7bce54d011cd6aa3367a05449556dce6de4c9dc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69993197b61360d3dbffc891413480b02c523c0928f31cf56e998d2738cb4f60d537fc4f1d51a45cc0cd12e06bba501615164c5d22023f55c76650a59e00cf2e
|
7
|
+
data.tar.gz: 3859b49ecbebf8e4d91fe347b16cf4f578e677edaf5cea3e6f171a87620af3a3c7995eed3d089fdbb5d2adda57389446b5a38fd129efd6b5db5265edadfa5587
|
data/README.md
CHANGED
@@ -28,9 +28,9 @@ TODO: Write usage instructions here
|
|
28
28
|
|
29
29
|
This gem assumes the following environment variables are defined by the application
|
30
30
|
|
31
|
-
-
|
32
|
-
-
|
33
|
-
-
|
31
|
+
- CENTAMAN_API_URL (Centaman API endpoint, ex: https://taxi.centaman.net/CentamanAPI)
|
32
|
+
- CENTAMAN_API_USERNAME (Centaman API username)
|
33
|
+
- CENTAMAN_API_PASSWORD (Centaman API password)
|
34
34
|
- FIXIE_URL (Optional. Used with FIXIE proxy to route outbound requests through a set of static IP addresses)
|
35
35
|
|
36
36
|
## Development
|
data/lib/centaman.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'httparty'
|
1
2
|
require 'centaman/version'
|
2
3
|
require 'centaman/wrapper'
|
3
4
|
require 'centaman/service'
|
@@ -24,7 +25,6 @@ require 'centaman/object/extra'
|
|
24
25
|
require 'centaman/object/gift_ticket'
|
25
26
|
require 'centaman/object/purchased_ticket'
|
26
27
|
require 'centaman/object/ticket_type'
|
27
|
-
require 'httparty'
|
28
28
|
|
29
29
|
module Centaman
|
30
30
|
end
|
data/lib/centaman/version.rb
CHANGED
data/lib/centaman/wrapper.rb
CHANGED
@@ -8,21 +8,22 @@ module Centaman
|
|
8
8
|
http_proxy FIXIE.host, FIXIE.port, FIXIE.user, FIXIE.password
|
9
9
|
end
|
10
10
|
|
11
|
-
attr_reader :api_username, :api_password
|
11
|
+
attr_reader :api_username, :api_password, :api_token
|
12
12
|
|
13
13
|
def initialize(args = {})
|
14
|
-
@api_username = ENV['
|
15
|
-
@api_password = ENV['
|
16
|
-
|
14
|
+
@api_username = ENV['CENTAMAN_API_USERNAME']
|
15
|
+
@api_password = ENV['CENTAMAN_API_PASSWORD']
|
16
|
+
@api_token = ENV.fetch('CENTAMAN_API_TOKEN', generate_token)
|
17
|
+
self.class.base_uri ENV['CENTAMAN_API_URL']
|
17
18
|
after_init(args)
|
18
19
|
end
|
19
20
|
|
20
21
|
def headers
|
21
|
-
{ 'authorization' => "Basic #{
|
22
|
+
{ 'authorization' => "Basic #{api_token}", 'Content-Type' => 'application/json' }
|
22
23
|
end
|
23
24
|
|
24
|
-
def
|
25
|
-
|
25
|
+
def generate_token
|
26
|
+
Base64.encode64("#{api_username}:#{api_password}")
|
26
27
|
end
|
27
28
|
|
28
29
|
def options
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: centaman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- francirp
|
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
133
|
version: '0'
|
134
134
|
requirements: []
|
135
135
|
rubyforge_project:
|
136
|
-
rubygems_version: 2.5.
|
136
|
+
rubygems_version: 2.5.2
|
137
137
|
signing_key:
|
138
138
|
specification_version: 4
|
139
139
|
summary: Wrapper for the Centaman Ticketing API
|