jive-tile 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/jive-tile.gemspec +2 -2
- data/lib/generators/jive/tile/active_record_generator.rb +1 -1
- data/lib/generators/jive/tile/next_migration_version.rb +1 -1
- data/lib/generators/jive/tile/tile_generator.rb +1 -1
- data/lib/jive/tile.rb +7 -3
- data/lib/jive/tile/add_on/class_methods.rb +5 -7
- data/lib/jive/tile/class_methods.rb +13 -0
- data/lib/jive/tile/compatibility.rb +1 -1
- data/lib/jive/tile/{model.rb → instance_methods.rb} +6 -9
- data/lib/jive/tile/version.rb +4 -2
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8209f623b40e109f3874a53e58a503442e2685d
|
4
|
+
data.tar.gz: 435667c040a6b8d447a7da9a790ce79cc8071e2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4151cc1c0fbfac04cd24faaf782b3a1d851b053ac37a7a466791f6d51fbb3c1d776ed5193a98805fda0f5b424f5b5062c803b0721a648fae40df2de4ceac4c3
|
7
|
+
data.tar.gz: 07c994110178561a815eba80fe4d6e8ab66fb57e30496d5231db8bb1782beb0d2807026739828efbe5794ad91cca2b351efc11f9e9dbe68efc954f5122e4214e
|
data/README.md
CHANGED
data/jive-tile.gemspec
CHANGED
@@ -21,8 +21,8 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_dependency "activerecord", [">= 3.0", "< 5.0"]
|
22
22
|
|
23
23
|
# Tiles require association with an AddOn
|
24
|
-
spec.add_dependency "jive-add_on"
|
25
|
-
spec.add_dependency "jive-oauth_token"
|
24
|
+
spec.add_dependency "jive-add_on", ">= 0.0.2"
|
25
|
+
spec.add_dependency "jive-oauth_token", ">= 0.0.3"
|
26
26
|
|
27
27
|
if RUBY_PLATFORM == 'java'
|
28
28
|
spec.add_development_dependency "jdbc-sqlite3", "> 0"
|
@@ -5,7 +5,7 @@ require "rails/generators/active_record"
|
|
5
5
|
|
6
6
|
# Extend the HasDynamicColumnsGenerator so that it creates an AR migration
|
7
7
|
module Jive
|
8
|
-
|
8
|
+
class Tile < ActiveRecord::Base
|
9
9
|
class ActiveRecordGenerator < ::Jive::Tile::Generator
|
10
10
|
include Rails::Generators::Migration
|
11
11
|
extend NextMigrationVersion
|
data/lib/jive/tile.rb
CHANGED
@@ -8,12 +8,16 @@ require "jive/tile/add_on/class_methods"
|
|
8
8
|
|
9
9
|
require "jive/tile/version"
|
10
10
|
require "jive/tile/compatibility"
|
11
|
-
require "jive/tile/
|
11
|
+
require "jive/tile/class_methods"
|
12
|
+
require "jive/tile/instance_methods"
|
12
13
|
|
13
14
|
module Jive
|
14
|
-
|
15
|
+
class Tile < ActiveRecord::Base
|
15
16
|
end
|
16
17
|
end
|
17
18
|
|
19
|
+
Jive::Tile.send :include, Jive::Tile::InstanceMethods
|
20
|
+
Jive::Tile.send :extend, Jive::Tile::ClassMethods
|
21
|
+
|
18
22
|
# We want add-ons to know they can now associate with Tiles
|
19
|
-
Jive::AddOn
|
23
|
+
Jive::AddOn.send :include, Jive::Tile::AddOn::ClassMethods
|
@@ -1,12 +1,10 @@
|
|
1
1
|
module Jive
|
2
|
-
|
2
|
+
class Tile < ActiveRecord::Base
|
3
3
|
module AddOn
|
4
|
-
module
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
has_many :tiles, :class_name => "Jive::Tile::Model", :foreign_key => :jive_add_on_id
|
9
|
-
end
|
4
|
+
module ClassMethods
|
5
|
+
def self.included(base)
|
6
|
+
base.class_eval do
|
7
|
+
has_many :tiles, :class_name => "Jive::Tile", :foreign_key => :jive_add_on_id
|
10
8
|
end
|
11
9
|
end
|
12
10
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Jive
|
2
|
+
class Tile < ActiveRecord::Base
|
3
|
+
module ClassMethods
|
4
|
+
def self.extended(base)
|
5
|
+
base.belongs_to :add_on, :class_name => "Jive::AddOn", :foreign_key => :jive_add_on_id
|
6
|
+
base.validates :jive_add_on_id, :presence => true
|
7
|
+
base.has_one :oauth_token, :class_name => "Jive::OauthToken", :as => :owner
|
8
|
+
base.serialize :config, Hash
|
9
|
+
base.after_create :fetch_oauth_token
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -1,12 +1,9 @@
|
|
1
1
|
module Jive
|
2
|
-
|
3
|
-
|
4
|
-
self.
|
5
|
-
|
6
|
-
|
7
|
-
serialize :config, Hash
|
8
|
-
|
9
|
-
after_create :fetch_oauth_token
|
2
|
+
class Tile < ActiveRecord::Base
|
3
|
+
module InstanceMethods
|
4
|
+
def self.included(base)
|
5
|
+
base.table_name = "jive_tiles"
|
6
|
+
end
|
10
7
|
|
11
8
|
private
|
12
9
|
def fetch_oauth_token
|
@@ -37,7 +34,7 @@ module Jive
|
|
37
34
|
json_body = JSON.parse(response.body)
|
38
35
|
|
39
36
|
# Create
|
40
|
-
Jive::OauthToken
|
37
|
+
Jive::OauthToken.create(
|
41
38
|
:owner => self,
|
42
39
|
:scope => json_body["scope"],
|
43
40
|
:token_type => json_body["token_type"],
|
data/lib/jive/tile/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Butch Marshall
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -36,28 +36,28 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version:
|
39
|
+
version: 0.0.2
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
46
|
+
version: 0.0.2
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: jive-oauth_token
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
53
|
+
version: 0.0.3
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version:
|
60
|
+
version: 0.0.3
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: sqlite3
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -180,8 +180,9 @@ files:
|
|
180
180
|
- lib/generators/jive/tile/tile_generator.rb
|
181
181
|
- lib/jive/tile.rb
|
182
182
|
- lib/jive/tile/add_on/class_methods.rb
|
183
|
+
- lib/jive/tile/class_methods.rb
|
183
184
|
- lib/jive/tile/compatibility.rb
|
184
|
-
- lib/jive/tile/
|
185
|
+
- lib/jive/tile/instance_methods.rb
|
185
186
|
- lib/jive/tile/version.rb
|
186
187
|
homepage: https://github.com/butchmarshall/ruby-jive-tile
|
187
188
|
licenses:
|