jive-tile 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +6 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +46 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/jive-tile.gemspec +40 -0
- data/lib/generators/jive/tile/active_record_generator.rb +24 -0
- data/lib/generators/jive/tile/next_migration_version.rb +16 -0
- data/lib/generators/jive/tile/templates/migration_0.1.0.rb +33 -0
- data/lib/generators/jive/tile/tile_generator.rb +11 -0
- data/lib/jive/tile/add_on/class_methods.rb +15 -0
- data/lib/jive/tile/compatibility.rb +29 -0
- data/lib/jive/tile/model.rb +8 -0
- data/lib/jive/tile/oauth_token.rb +8 -0
- data/lib/jive/tile/version.rb +5 -0
- data/lib/jive/tile.rb +20 -0
- metadata +197 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a8c1ae0eea146652f75fdb34cec013a426c0bf66
|
4
|
+
data.tar.gz: a705b3c544be25aec9ab421fc9744c6d53e5393f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9d2dff0342b17e0ecf802d6e17373068e9732b0f6e27ef7e801320389e713831cdbd4a07d0ab6e6d1d4cc0a40d1651de7b51cfd6f8d65ee5ecebc0c8ab91da58
|
7
|
+
data.tar.gz: 366f29cb267611c89621fe6f7d12c17e4485595792b226bc590649a23e2faf1622272276d8929bf775bba4d90344ae179895ef097eba3576e46f2a5bcd848e77
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Butch Marshall
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/jive-tile.svg)](http://badge.fury.io/rb/jive-tile)
|
2
|
+
[![Build Status](https://travis-ci.org/butchmarshall/ruby-jive-tile.svg?branch=master)](https://travis-ci.org/butchmarshall/ruby-jive-tile)
|
3
|
+
|
4
|
+
# Jive::Tile
|
5
|
+
|
6
|
+
An implemention of Jives Tiles using ActiveRecord.
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
Add this line to your application's Gemfile:
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
gem 'jive-tile'
|
14
|
+
```
|
15
|
+
|
16
|
+
And then execute:
|
17
|
+
|
18
|
+
$ bundle
|
19
|
+
|
20
|
+
Or install it yourself as:
|
21
|
+
|
22
|
+
$ gem install jive-tile
|
23
|
+
|
24
|
+
then run
|
25
|
+
|
26
|
+
```ruby
|
27
|
+
rails generate jive:tile:active_record
|
28
|
+
```
|
29
|
+
|
30
|
+
## Usage
|
31
|
+
|
32
|
+
To the ActiveRecord model:
|
33
|
+
|
34
|
+
```ruby
|
35
|
+
Jive::Tile::Model.new(...)
|
36
|
+
```
|
37
|
+
|
38
|
+
## Contributing
|
39
|
+
|
40
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/butchmarshall/ruby-jive-tile.
|
41
|
+
|
42
|
+
|
43
|
+
## License
|
44
|
+
|
45
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
46
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "jive/tile"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
data/jive-tile.gemspec
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'jive/tile/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "jive-tile"
|
8
|
+
spec.version = Jive::Tile::VERSION
|
9
|
+
spec.authors = ["Butch Marshall"]
|
10
|
+
spec.email = ["butch.a.marshall@gmail.com"]
|
11
|
+
spec.summary = "Jive Tile functionality implemented using ActiveRecord."
|
12
|
+
spec.description = "Implements the functionality required for dealing with and storing Jive Tiles using ActiveRecord as a storage backend."
|
13
|
+
spec.homepage = "https://github.com/butchmarshall/ruby-jive-tile"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
|
+
spec.bindir = "exe"
|
18
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_dependency "activerecord", [">= 3.0", "< 5.0"]
|
22
|
+
|
23
|
+
# Tiles require association with an AddOn
|
24
|
+
spec.add_dependency "jive-add_on"
|
25
|
+
|
26
|
+
if RUBY_PLATFORM == 'java'
|
27
|
+
spec.add_development_dependency "jdbc-sqlite3", "> 0"
|
28
|
+
spec.add_development_dependency "activerecord-jdbcsqlite3-adapter", "> 0"
|
29
|
+
else
|
30
|
+
spec.add_development_dependency "sqlite3", "> 0"
|
31
|
+
end
|
32
|
+
|
33
|
+
spec.add_development_dependency "database_cleaner"
|
34
|
+
spec.add_development_dependency "factory_girl", "> 4.0"
|
35
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
36
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
37
|
+
|
38
|
+
spec.add_development_dependency "rspec"
|
39
|
+
spec.add_development_dependency "webmock"
|
40
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require "generators/jive/tile/tile_generator"
|
2
|
+
require "generators/jive/tile/next_migration_version"
|
3
|
+
require "rails/generators/migration"
|
4
|
+
require "rails/generators/active_record"
|
5
|
+
|
6
|
+
# Extend the HasDynamicColumnsGenerator so that it creates an AR migration
|
7
|
+
module Jive
|
8
|
+
module Tile
|
9
|
+
class ActiveRecordGenerator < ::Jive::Tile::Generator
|
10
|
+
include Rails::Generators::Migration
|
11
|
+
extend NextMigrationVersion
|
12
|
+
|
13
|
+
source_paths << File.join(File.dirname(__FILE__), "templates")
|
14
|
+
|
15
|
+
def create_migration_file
|
16
|
+
migration_template "migration_0.1.0.rb", "db/migrate/add_jive_tiles_0_1_0_migration.rb"
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.next_migration_number(dirname)
|
20
|
+
::ActiveRecord::Generators::Base.next_migration_number dirname
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Jive
|
2
|
+
module Tile
|
3
|
+
module NextMigrationVersion
|
4
|
+
# while methods have moved around this has been the implementation
|
5
|
+
# since ActiveRecord 3.0
|
6
|
+
def next_migration_number(dirname)
|
7
|
+
next_migration_number = current_migration_number(dirname) + 1
|
8
|
+
if ActiveRecord::Base.timestamped_migrations
|
9
|
+
[Time.now.utc.strftime("%Y%m%d%H%M%S"), format("%.14d", next_migration_number)].max
|
10
|
+
else
|
11
|
+
format("%.3d", next_migration_number)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
class AddJiveTiles010Migration < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :jive_tiles do |t|
|
4
|
+
t.integer :jive_add_on_id
|
5
|
+
t.string :guid
|
6
|
+
t.string :remote_id
|
7
|
+
t.text :config
|
8
|
+
t.string :name
|
9
|
+
t.string :jive_url
|
10
|
+
t.string :tenant_id
|
11
|
+
t.string :push_url
|
12
|
+
t.string :code
|
13
|
+
t.integer :jive_tiles_oauth_token_id
|
14
|
+
|
15
|
+
t.timestamps null: false
|
16
|
+
end
|
17
|
+
|
18
|
+
create_table :jive_tiles_oauth_tokens do |t|
|
19
|
+
t.string :scope
|
20
|
+
t.string :token_type
|
21
|
+
t.string :expires_in
|
22
|
+
t.string :refresh_token
|
23
|
+
t.string :access_token
|
24
|
+
|
25
|
+
t.timestamps null: false
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.down
|
30
|
+
drop_table :jive_tiles
|
31
|
+
drop_table :jive_tiles_oauth_tokens
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'jive/tile/version'
|
2
|
+
|
3
|
+
module Jive
|
4
|
+
module Tile
|
5
|
+
module Compatibility
|
6
|
+
if ActiveSupport::VERSION::MAJOR >= 4
|
7
|
+
require 'active_support/proxy_object'
|
8
|
+
|
9
|
+
def self.executable_prefix
|
10
|
+
'bin'
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.proxy_object_class
|
14
|
+
ActiveSupport::ProxyObject
|
15
|
+
end
|
16
|
+
else
|
17
|
+
require 'active_support/basic_object'
|
18
|
+
|
19
|
+
def self.executable_prefix
|
20
|
+
'script'
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.proxy_object_class
|
24
|
+
ActiveSupport::BasicObject
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/jive/tile.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require "active_support"
|
2
|
+
require "active_support/dependencies"
|
3
|
+
require "active_record"
|
4
|
+
|
5
|
+
require "jive/add_on"
|
6
|
+
require "jive/tile/add_on/class_methods"
|
7
|
+
|
8
|
+
require "jive/tile/version"
|
9
|
+
require "jive/tile/compatibility"
|
10
|
+
require "jive/tile/model"
|
11
|
+
require "jive/tile/oauth_token"
|
12
|
+
|
13
|
+
|
14
|
+
module Jive
|
15
|
+
module Tile
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
# We want add-ons to know they can now associate with Tiles
|
20
|
+
Jive::AddOn::Model.send :include, Jive::Tile::AddOn::Model::ClassMethods
|
metadata
ADDED
@@ -0,0 +1,197 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jive-tile
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Butch Marshall
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-01-02 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activerecord
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.0'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '5.0'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3.0'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '5.0'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: jive-add_on
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: sqlite3
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: database_cleaner
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: factory_girl
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '4.0'
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '4.0'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: bundler
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '1.7'
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '1.7'
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: rake
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '10.0'
|
110
|
+
type: :development
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - "~>"
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '10.0'
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: rspec
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - ">="
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0'
|
124
|
+
type: :development
|
125
|
+
prerelease: false
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - ">="
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '0'
|
131
|
+
- !ruby/object:Gem::Dependency
|
132
|
+
name: webmock
|
133
|
+
requirement: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - ">="
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '0'
|
138
|
+
type: :development
|
139
|
+
prerelease: false
|
140
|
+
version_requirements: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '0'
|
145
|
+
description: Implements the functionality required for dealing with and storing Jive
|
146
|
+
Tiles using ActiveRecord as a storage backend.
|
147
|
+
email:
|
148
|
+
- butch.a.marshall@gmail.com
|
149
|
+
executables: []
|
150
|
+
extensions: []
|
151
|
+
extra_rdoc_files: []
|
152
|
+
files:
|
153
|
+
- ".gitignore"
|
154
|
+
- ".rspec"
|
155
|
+
- ".travis.yml"
|
156
|
+
- Gemfile
|
157
|
+
- LICENSE.txt
|
158
|
+
- README.md
|
159
|
+
- Rakefile
|
160
|
+
- bin/console
|
161
|
+
- bin/setup
|
162
|
+
- jive-tile.gemspec
|
163
|
+
- lib/generators/jive/tile/active_record_generator.rb
|
164
|
+
- lib/generators/jive/tile/next_migration_version.rb
|
165
|
+
- lib/generators/jive/tile/templates/migration_0.1.0.rb
|
166
|
+
- lib/generators/jive/tile/tile_generator.rb
|
167
|
+
- lib/jive/tile.rb
|
168
|
+
- lib/jive/tile/add_on/class_methods.rb
|
169
|
+
- lib/jive/tile/compatibility.rb
|
170
|
+
- lib/jive/tile/model.rb
|
171
|
+
- lib/jive/tile/oauth_token.rb
|
172
|
+
- lib/jive/tile/version.rb
|
173
|
+
homepage: https://github.com/butchmarshall/ruby-jive-tile
|
174
|
+
licenses:
|
175
|
+
- MIT
|
176
|
+
metadata: {}
|
177
|
+
post_install_message:
|
178
|
+
rdoc_options: []
|
179
|
+
require_paths:
|
180
|
+
- lib
|
181
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
182
|
+
requirements:
|
183
|
+
- - ">="
|
184
|
+
- !ruby/object:Gem::Version
|
185
|
+
version: '0'
|
186
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
187
|
+
requirements:
|
188
|
+
- - ">="
|
189
|
+
- !ruby/object:Gem::Version
|
190
|
+
version: '0'
|
191
|
+
requirements: []
|
192
|
+
rubyforge_project:
|
193
|
+
rubygems_version: 2.4.8
|
194
|
+
signing_key:
|
195
|
+
specification_version: 4
|
196
|
+
summary: Jive Tile functionality implemented using ActiveRecord.
|
197
|
+
test_files: []
|