jive-oauth_token 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 483f3aa24f4d9b482c7eb4b693bc0c49906f8ad7
4
+ data.tar.gz: 92e97fa4f3ed0e89423ca1fc28eab7c4bc26237e
5
+ SHA512:
6
+ metadata.gz: 339fde0f699235c46c70cc061c41a19ecb6389e5e15ff47bb42ec7bd5ce50596f9780b90845c181fdd50d750d8534d3ea05093937dcd6029cae92ef5a5043b99
7
+ data.tar.gz: 5c46b34943c47210d651606756934ce7c073e7104ac4efc6aff1d4a9f4a20702723635a33ad1e7e53fde29b768606072eb8c67fb0b2ac0caf706c2fcce8f3d1d
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.0
4
+ before_install: gem install bundler -v 1.11.2
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in jive-oauth_token.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # Jive::OauthToken
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/jive/oauth_token`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'jive-oauth_token'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install jive-oauth_token
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/jive-oauth_token.
36
+
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "jive/oauth_token"
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
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,36 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'jive/oauth_token/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "jive-oauth_token"
8
+ spec.version = Jive::OauthToken::VERSION
9
+ spec.authors = ["Butch Marshall"]
10
+ spec.email = ["butch.a.marshall@gmail.com"]
11
+ spec.summary = "Jive OAuth Token functionality implemented using ActiveRecord."
12
+ spec.description = "Implements the functionality required for dealing with and storing Jive OAuth Tokens using ActiveRecord as a storage backend."
13
+ spec.homepage = "https://github.com/butchmarshall/ruby-jive-oauth_token"
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
+ if RUBY_PLATFORM == 'java'
24
+ spec.add_development_dependency "jdbc-sqlite3", "> 0"
25
+ spec.add_development_dependency "activerecord-jdbcsqlite3-adapter", "> 0"
26
+ else
27
+ spec.add_development_dependency "sqlite3", "> 0"
28
+ end
29
+
30
+ spec.add_development_dependency "database_cleaner"
31
+ spec.add_development_dependency "factory_girl", "> 4.0"
32
+ spec.add_development_dependency "bundler", "~> 1.11"
33
+ spec.add_development_dependency "rake", "~> 10.0"
34
+ spec.add_development_dependency "rspec", "~> 3.0"
35
+ spec.add_development_dependency "webmock"
36
+ end
@@ -0,0 +1,24 @@
1
+ require "generators/jive/oauth_token/oauth_token_generator"
2
+ require "generators/jive/oauth_token/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 OauthToken
9
+ class ActiveRecordGenerator < ::Jive::OauthToken::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_oauth_tokens_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 OauthToken
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,11 @@
1
+ require 'rails/generators/base'
2
+ require 'jive/oauth_token/compatibility'
3
+
4
+ module Jive
5
+ module OauthToken
6
+ class Generator < Rails::Generators::Base
7
+ source_paths << File.join(File.dirname(__FILE__), 'templates')
8
+ end
9
+ end
10
+ end
11
+
@@ -0,0 +1,21 @@
1
+ class AddJiveOauthTokens010Migration < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :jive_oauth_tokens do |t|
4
+ t.string :owner_id
5
+ t.integer :owner_type
6
+
7
+ t.string :scope
8
+ t.string :token_type
9
+ t.integer :expires_in
10
+ t.timestamp :expires_at
11
+ t.string :refresh_token
12
+ t.string :access_token
13
+
14
+ t.timestamps null: false
15
+ end
16
+ end
17
+
18
+ def self.down
19
+ drop_table :jive_oauth_tokens
20
+ end
21
+ end
@@ -0,0 +1,29 @@
1
+ require 'jive/oauth_token/version'
2
+
3
+ module Jive
4
+ module OauthToken
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
@@ -0,0 +1,8 @@
1
+ module Jive
2
+ module OauthToken
3
+ class Model < ActiveRecord::Base
4
+ self.table_name = :jive_oauth_tokens
5
+ belongs_to :owner, :polymorphic => true
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,5 @@
1
+ module Jive
2
+ module OauthToken
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,14 @@
1
+ require "active_support"
2
+ require "active_support/dependencies"
3
+ require "active_record"
4
+
5
+ require "jive/oauth_token/version"
6
+ require "jive/oauth_token/compatibility"
7
+ require "jive/oauth_token/model"
8
+
9
+
10
+ module Jive
11
+ module OauthToken
12
+ # Your code goes here...
13
+ end
14
+ end
metadata ADDED
@@ -0,0 +1,180 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jive-oauth_token
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-02-01 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: sqlite3
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">"
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ type: :development
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: database_cleaner
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: factory_girl
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">"
66
+ - !ruby/object:Gem::Version
67
+ version: '4.0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">"
73
+ - !ruby/object:Gem::Version
74
+ version: '4.0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: bundler
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '1.11'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '1.11'
89
+ - !ruby/object:Gem::Dependency
90
+ name: rake
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '10.0'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '10.0'
103
+ - !ruby/object:Gem::Dependency
104
+ name: rspec
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: '3.0'
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "~>"
115
+ - !ruby/object:Gem::Version
116
+ version: '3.0'
117
+ - !ruby/object:Gem::Dependency
118
+ name: webmock
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
+ description: Implements the functionality required for dealing with and storing Jive
132
+ OAuth Tokens using ActiveRecord as a storage backend.
133
+ email:
134
+ - butch.a.marshall@gmail.com
135
+ executables: []
136
+ extensions: []
137
+ extra_rdoc_files: []
138
+ files:
139
+ - ".gitignore"
140
+ - ".rspec"
141
+ - ".travis.yml"
142
+ - Gemfile
143
+ - README.md
144
+ - Rakefile
145
+ - bin/console
146
+ - bin/setup
147
+ - jive-oauth_token.gemspec
148
+ - lib/generators/jive/oauth_token/active_record_generator.rb
149
+ - lib/generators/jive/oauth_token/next_migration_version.rb
150
+ - lib/generators/jive/oauth_token/oauth_token_generator.rb
151
+ - lib/generators/jive/oauth_token/templates/migration_0.1.0.rb
152
+ - lib/jive/oauth_token.rb
153
+ - lib/jive/oauth_token/compatibility.rb
154
+ - lib/jive/oauth_token/model.rb
155
+ - lib/jive/oauth_token/version.rb
156
+ homepage: https://github.com/butchmarshall/ruby-jive-oauth_token
157
+ licenses:
158
+ - MIT
159
+ metadata: {}
160
+ post_install_message:
161
+ rdoc_options: []
162
+ require_paths:
163
+ - lib
164
+ required_ruby_version: !ruby/object:Gem::Requirement
165
+ requirements:
166
+ - - ">="
167
+ - !ruby/object:Gem::Version
168
+ version: '0'
169
+ required_rubygems_version: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ requirements: []
175
+ rubyforge_project:
176
+ rubygems_version: 2.4.6
177
+ signing_key:
178
+ specification_version: 4
179
+ summary: Jive OAuth Token functionality implemented using ActiveRecord.
180
+ test_files: []