safie 0.1.0 → 0.2.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
  SHA256:
3
- metadata.gz: 76986f81ae83e04ed006e9df4d27c6d29c41bf368e11906338aa90d4a31854a9
4
- data.tar.gz: 3a29d0eb9d29e06e624e6d7870f9e2f66f637ff43df9fcf9854cd1e819ac07a0
3
+ metadata.gz: 7b7444d439aa66efb03c9fdc3b2cf6dd03f96951429f9038822edd7a59f3acb3
4
+ data.tar.gz: 5fcd0abfe944c2a7341f556bb1ff8d3b78f54013af919639ee4fd1e41bc6a859
5
5
  SHA512:
6
- metadata.gz: 1cb5418f73a157d9da09905fdccd235c067ec97ee0d32be68df5ee4eb0975204f8ae1a5aaa7b6c687a2c3976f87fe5037a19f730aee57fe015a493f13b7c373b
7
- data.tar.gz: e088cd677feb04ed1478d9cf31861b582ecb2b93bb4cd5e631d98336fb2c44b627b1091ef7d2f04a107c0e4d1b44e92568fd3e1f6b42eedfd8acd26fc7855b4d
6
+ metadata.gz: 69457a9a32d138f6945ccc301c083c988831031088b638b1ae21b3b6cd6eba99dbc5e562e718f3fb8d9530a21fc00c054faa6c89390d88ec73c21ac64834d944
7
+ data.tar.gz: 1aeab6ecc8e24934e099a6f569e302fa3523837419a673371a5caa71e8760b5c939886def5987152a2dbd4f5dd65a33b00b3e4e9def93e94844c3780a1a4d2f9
@@ -2,6 +2,8 @@
2
2
  sudo: false
3
3
  language: ruby
4
4
  cache: bundler
5
+ before_install: gem install bundler
5
6
  rvm:
7
+ - 2.4.9
8
+ - 2.5.7
6
9
  - 2.6.5
7
- before_install: gem install bundler -v 2.0.2
data/README.md CHANGED
@@ -22,7 +22,27 @@ Or install it yourself as:
22
22
 
23
23
  ## Usage
24
24
 
25
- TODO: Write usage instructions here
25
+ ```ruby
26
+ require 'safie'
27
+
28
+ client = Safie::Client.new(
29
+ identifier: 'client_id',
30
+ secret: 'client_secret',
31
+ redirect_uri: 'https://client.example.com/callback'
32
+ )
33
+
34
+ authorization_uri = client.authorization_uri(
35
+ state: SecureRandom.hex(8)
36
+ )
37
+ puts authorization_uri
38
+ `open "#{authorization_uri}"`
39
+
40
+ print 'code: ' and STDOUT.flush
41
+ code = gets.chop
42
+ client.authorization_code = code
43
+ access_token = client.access_token!
44
+ access_token.token_info!
45
+ ```
26
46
 
27
47
  ## Development
28
48
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.2.0
@@ -4,6 +4,7 @@ module Safie
4
4
 
5
5
  def initialize(access_token, attributes = {})
6
6
  super attributes.merge(access_token: access_token)
7
+ @token_type = :bearer
7
8
  end
8
9
 
9
10
  def token_info!(params = {})
@@ -1,15 +1,6 @@
1
1
  module Safie
2
2
  class Exception < StandardError; end
3
3
 
4
- class ValidationFailed < Exception
5
- attr_reader :object
6
-
7
- def initialize(object)
8
- super object.errors.full_messages.to_sentence
9
- @object = object
10
- end
11
- end
12
-
13
4
  class HttpError < Exception
14
5
  attr_accessor :status, :response
15
6
  def initialize(status, message = nil, response = nil)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: safie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - nov