jive-tile 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/jive-tile.gemspec +1 -0
- data/lib/jive/tile/model.rb +5 -3
- data/lib/jive/tile/version.rb +1 -1
- data/lib/jive/tile.rb +1 -2
- metadata +15 -2
- data/lib/jive/tile/oauth_token.rb +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1cdb4849328f76b637ca7f261d0fe0ad5e8f1457
|
4
|
+
data.tar.gz: 4c9fbc5ba1a645146d7ddf89c5291c40c064fd92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88e062d55550b42255f2e7b92d5bce2627ca37107dcf96bca1ac7319d2b92d756825644996c11de3943018329d43da184c9320c9004911f2c06aff921807215b
|
7
|
+
data.tar.gz: 0d9fb1d69da46e5026b043c11dc04d7f7922ab0e3811463c5baf1415ae96485ee278a34b7fe90500cc30c3ef8953bb457633cf8ca441203ba7451a91ae762adf
|
data/Gemfile
CHANGED
data/jive-tile.gemspec
CHANGED
data/lib/jive/tile/model.rb
CHANGED
@@ -3,7 +3,7 @@ module Jive
|
|
3
3
|
class Model < ActiveRecord::Base
|
4
4
|
self.table_name = :jive_tiles
|
5
5
|
belongs_to :add_on, :class_name => "Jive::AddOn::Model", :foreign_key => :jive_add_on_id
|
6
|
-
|
6
|
+
has_one :oauth_token, :class_name => "Jive::OauthToken::Model", :as => :owner
|
7
7
|
serialize :config, Hash
|
8
8
|
|
9
9
|
after_create :fetch_oauth_token
|
@@ -14,6 +14,8 @@ module Jive
|
|
14
14
|
require "net/http"
|
15
15
|
require "openssl"
|
16
16
|
|
17
|
+
return if self.add_on.nil?
|
18
|
+
|
17
19
|
uri = URI.parse("#{self.add_on.jive_url}/oauth2/token")
|
18
20
|
http = Net::HTTP.new(uri.host, uri.port)
|
19
21
|
http.use_ssl = true
|
@@ -35,8 +37,8 @@ module Jive
|
|
35
37
|
json_body = JSON.parse(response.body)
|
36
38
|
|
37
39
|
# Create
|
38
|
-
Jive::
|
39
|
-
:
|
40
|
+
Jive::OauthToken::Model.create(
|
41
|
+
:owner => self,
|
40
42
|
:scope => json_body["scope"],
|
41
43
|
:token_type => json_body["token_type"],
|
42
44
|
:expires_in => json_body["expires_in"],
|
data/lib/jive/tile/version.rb
CHANGED
data/lib/jive/tile.rb
CHANGED
@@ -2,14 +2,13 @@ require "active_support"
|
|
2
2
|
require "active_support/dependencies"
|
3
3
|
require "active_record"
|
4
4
|
|
5
|
+
require "jive/oauth_token"
|
5
6
|
require "jive/add_on"
|
6
7
|
require "jive/tile/add_on/class_methods"
|
7
8
|
|
8
9
|
require "jive/tile/version"
|
9
10
|
require "jive/tile/compatibility"
|
10
11
|
require "jive/tile/model"
|
11
|
-
require "jive/tile/oauth_token"
|
12
|
-
|
13
12
|
|
14
13
|
module Jive
|
15
14
|
module Tile
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jive-tile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Butch Marshall
|
@@ -44,6 +44,20 @@ dependencies:
|
|
44
44
|
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '0'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: jive-oauth_token
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
47
61
|
- !ruby/object:Gem::Dependency
|
48
62
|
name: sqlite3
|
49
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -168,7 +182,6 @@ files:
|
|
168
182
|
- lib/jive/tile/add_on/class_methods.rb
|
169
183
|
- lib/jive/tile/compatibility.rb
|
170
184
|
- lib/jive/tile/model.rb
|
171
|
-
- lib/jive/tile/oauth_token.rb
|
172
185
|
- lib/jive/tile/version.rb
|
173
186
|
homepage: https://github.com/butchmarshall/ruby-jive-tile
|
174
187
|
licenses:
|