frameio-api 0.1.0 → 0.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0901a5840882914621de78e0c9e36bbff287aca801994e5b88201b96ecf31683'
4
- data.tar.gz: 5223091ad97b2e6b46220e98d3b476e4b71351840b6b29de00dd5795306f474b
3
+ metadata.gz: 32d754e356ca37fe32054ba4597cb99794a05ac2a2d0aa6ec74b06b1e3faac01
4
+ data.tar.gz: 4d6c7fc619576154f9f369bb0e932f95837ee32eda5f8e4cdbc8232363792622
5
5
  SHA512:
6
- metadata.gz: 6f4eca7dc8eb1cd7c2b8ddab1093412e37d7c8fbcee759513b00feac7367e45c957d215d4116e921438bf98ce30193b25b9db0b3fa2dda848ff6d5278249c836
7
- data.tar.gz: 631a196ecd6d488ebf56f085b414783c07fda7bc4b6c44751897b2f85903e0a06d34868b90f225ae1ec56df574ee2468e8b08a01f85e17d786f454ba612852bb
6
+ metadata.gz: 7e432ec0ae00b4c47b8ef7f6b054ebd6ea6d988265c786dd15ed04b4c1f5198ddfd41e88073b7501e7d9e3be2d2bcca441dfabe207cd71d9e4fb5b0f1189964b
7
+ data.tar.gz: 5cf95c1f21fceebd6c588f458edea5a0434ec220923ba808aef1b3f981668f322695b59f7bbe3bb05ce3b6fbfe972e6c9f0ed5bbe65628999a5526460784e053
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # FrameIo
1
+ # Frameio-API
2
2
  Very basic (and wip) Frame.io API wrapper
3
3
  Only OAuth2 authentification available at the moment.
4
4
 
@@ -8,7 +8,7 @@ Only OAuth2 authentification available at the moment.
8
8
  Add this line to your application's Gemfile:
9
9
 
10
10
  ```ruby
11
- gem "frame_io"
11
+ gem "frameio-api"
12
12
  ```
13
13
 
14
14
  And then execute:
@@ -18,7 +18,7 @@ $ bundle
18
18
 
19
19
  Or install it yourself as:
20
20
  ```bash
21
- $ gem install frame_io
21
+ $ gem install frameio-api
22
22
  ```
23
23
 
24
24
 
@@ -61,7 +61,7 @@ end
61
61
  That's all! You now have access to a frame.io client:
62
62
 
63
63
  ```ruby
64
- current_user.frame_io #=> FrameIo::Client
64
+ current_user.frame_io #=> FrameioApi::Client
65
65
 
66
66
  current_user.frame_io.accounts #=> All accounts for user frame.io account
67
67
  ```
@@ -1,4 +1,4 @@
1
- module FrameIo
1
+ module FrameioApi
2
2
  class Account < OpenStruct
3
3
  def self.all(client:)
4
4
  client.get_resource('accounts', object_class: self)
@@ -0,0 +1,8 @@
1
+ ActiveRecord::Base.extend(Module.new do
2
+ def act_as_frameio_user(opts = {})
3
+ FrameioApi.access_token = opts[:access_token]
4
+ FrameioApi.refresh_token = opts[:refresh_token]
5
+ FrameioApi.expires_at = opts[:expires_at]
6
+ include FrameioApi
7
+ end
8
+ end)
@@ -1,4 +1,4 @@
1
- module FrameIo
1
+ module FrameioApi
2
2
  class Asset < OpenStruct
3
3
  def self.children(asset:, client:)
4
4
  client.get_resource("assets/#{asset.id}/children", object_class: self)
@@ -1,4 +1,4 @@
1
- module FrameIo
1
+ module FrameioApi
2
2
  class Client
3
3
  attr_reader :user, :api_key
4
4
 
@@ -26,9 +26,9 @@ module FrameIo
26
26
  OAuth2::AccessToken.from_hash(
27
27
  oauth.client,
28
28
  {
29
- access_token: user.send(FrameIo.access_token),
30
- refresh_token: user.send(FrameIo.refresh_token),
31
- expires_at: user.send(FrameIo.expires_at)
29
+ access_token: user.send(FrameioApi.access_token),
30
+ refresh_token: user.send(FrameioApi.refresh_token),
31
+ expires_at: user.send(FrameioApi.expires_at)
32
32
  }
33
33
  )
34
34
  end
@@ -1,4 +1,4 @@
1
- module FrameIo
1
+ module FrameioApi
2
2
  class Collaborator < OpenStruct
3
3
  def self.all(project:, client:)
4
4
  client.get_resource("projects/#{project.id}/collaborators", object_class: self)
@@ -1,4 +1,4 @@
1
- module FrameIo
1
+ module FrameioApi
2
2
  class CustomAction < OpenStruct
3
3
  def self.all(team:, client:)
4
4
  client.get_resource("teams/#{team.id}/actions", object_class: self)
@@ -1,4 +1,4 @@
1
- module FrameIo
1
+ module FrameioApi
2
2
  class Project < OpenStruct
3
3
  def self.all(team:, client:)
4
4
  client.get_resource("teams/#{team.id}/projects", object_class: self)
@@ -1,4 +1,4 @@
1
- module FrameIo
1
+ module FrameioApi
2
2
  class Railtie < ::Rails::Railtie
3
3
  end
4
4
  end
@@ -1,4 +1,4 @@
1
- module FrameIo
1
+ module FrameioApi
2
2
  class Team < OpenStruct
3
3
  def self.all(account:, client:)
4
4
  client.get_resource("accounts/#{account.id}/teams?include=user_role", object_class: self)
@@ -1,4 +1,4 @@
1
- module FrameIo
1
+ module FrameioApi
2
2
  class User < OpenStruct
3
3
  def self.current(client:)
4
4
  client.get_resource('me', object_class: self)
@@ -0,0 +1,3 @@
1
+ module FrameioApi
2
+ VERSION = "0.3.0"
3
+ end
@@ -1,17 +1,17 @@
1
- require "frame_io/version"
2
- require "frame_io/railtie"
3
- require 'frame_io/account'
4
- require 'frame_io/active_record_extension'
5
- require 'frame_io/asset'
6
- require 'frame_io/client'
7
- require 'frame_io/collaborator'
8
- require 'frame_io/custom_action'
9
- require 'frame_io/project'
10
- require 'frame_io/team'
11
- require 'frame_io/user'
1
+ require "frameio_api/version"
2
+ require "frameio_api/railtie"
3
+ require 'frameio_api/account'
4
+ require 'frameio_api/active_record_extension'
5
+ require 'frameio_api/asset'
6
+ require 'frameio_api/client'
7
+ require 'frameio_api/collaborator'
8
+ require 'frameio_api/custom_action'
9
+ require 'frameio_api/project'
10
+ require 'frameio_api/team'
11
+ require 'frameio_api/user'
12
12
  require 'omniauth-frameio'
13
13
 
14
- module FrameIo
14
+ module FrameioApi
15
15
  TokenError = Class.new(StandardError)
16
16
 
17
17
  class << self
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frameio-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Holl
@@ -49,25 +49,25 @@ files:
49
49
  - MIT-LICENSE
50
50
  - README.md
51
51
  - Rakefile
52
- - lib/frame_io.rb
53
- - lib/frame_io/account.rb
54
- - lib/frame_io/active_record_extension.rb
55
- - lib/frame_io/asset.rb
56
- - lib/frame_io/client.rb
57
- - lib/frame_io/collaborator.rb
58
- - lib/frame_io/custom_action.rb
59
- - lib/frame_io/project.rb
60
- - lib/frame_io/railtie.rb
61
- - lib/frame_io/team.rb
62
- - lib/frame_io/user.rb
63
- - lib/frame_io/version.rb
64
- - lib/tasks/frame_io_tasks.rake
65
- homepage: https://github.com/boxprod/frame_io
52
+ - lib/frameio_api.rb
53
+ - lib/frameio_api/account.rb
54
+ - lib/frameio_api/active_record_extension.rb
55
+ - lib/frameio_api/asset.rb
56
+ - lib/frameio_api/client.rb
57
+ - lib/frameio_api/collaborator.rb
58
+ - lib/frameio_api/custom_action.rb
59
+ - lib/frameio_api/project.rb
60
+ - lib/frameio_api/railtie.rb
61
+ - lib/frameio_api/team.rb
62
+ - lib/frameio_api/user.rb
63
+ - lib/frameio_api/version.rb
64
+ - lib/tasks/frameio_api_tasks.rake
65
+ homepage: https://github.com/boxprod/frameio-api
66
66
  licenses:
67
67
  - MIT
68
68
  metadata:
69
- homepage_uri: https://github.com/boxprod/frame_io
70
- source_code_uri: https://github.com/boxprod/frame_io
69
+ homepage_uri: https://github.com/boxprod/frameio-api
70
+ source_code_uri: https://github.com/boxprod/frameio-api
71
71
  post_install_message:
72
72
  rdoc_options: []
73
73
  require_paths:
@@ -1,8 +0,0 @@
1
- ActiveRecord::Base.extend(Module.new do
2
- def act_as_frameio_user(opts = {})
3
- FrameIo.access_token = opts[:access_token]
4
- FrameIo.refresh_token = opts[:refresh_token]
5
- FrameIo.expires_at = opts[:expires_at]
6
- include FrameIo
7
- end
8
- end)
@@ -1,3 +0,0 @@
1
- module FrameIo
2
- VERSION = "0.1.0"
3
- end