domp 0.0.4 → 0.0.5
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 +4 -4
- data/README.md +5 -1
- data/domp.gemspec +11 -10
- data/lib/domp/version.rb +1 -1
- data/lib/generators/domp/domp_generator.rb +2 -2
- data/lib/generators/domp/templates/model_authentication.rb +3 -1
- data/lib/generators/domp/templates/omniauth_callbacks_controller.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e0cc4c0b72f28d1c2077b228266add9aef14fc1
|
4
|
+
data.tar.gz: d7df9bc7823e0536036182fe4b41ee5304177311
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cfe4bf21b99ac110ecf565aede34d11d5157651a66dec5a0a56b34c87504740383d58c2f1d600a574f02516593da2f8b42f38069bee343405e328ce280ea03b
|
7
|
+
data.tar.gz: d554b797d8a39e0bdc8beefcf4a0596512e4dfcfd58d897b06be054cd417fa9e82c20ff7dd718a477925fe8577bbc6f576ffb75ef368c313c573f5da9780754d
|
data/README.md
CHANGED
@@ -49,7 +49,7 @@ Here's what the `User` model will look like:
|
|
49
49
|
|
50
50
|
```ruby
|
51
51
|
class User < ActiveRecord::Base
|
52
|
-
has_many :authentications, class_name: 'UserAuthentication'
|
52
|
+
has_many :authentications, class_name: 'UserAuthentication', dependent: :destroy
|
53
53
|
|
54
54
|
devise :omniauthable, :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable
|
55
55
|
|
@@ -86,6 +86,10 @@ gem "omniauth"
|
|
86
86
|
gem "omniauth-facebook"
|
87
87
|
gem "omniauth-twitter"
|
88
88
|
```
|
89
|
+
|
90
|
+
## License
|
91
|
+
This gem is released under the MIT License.
|
92
|
+
|
89
93
|
## Contributing
|
90
94
|
|
91
95
|
1. Fork it
|
data/domp.gemspec
CHANGED
@@ -4,16 +4,17 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'domp/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |gem|
|
7
|
-
gem.name
|
8
|
-
gem.version
|
9
|
-
gem.
|
10
|
-
gem.
|
11
|
-
gem.
|
12
|
-
gem.
|
13
|
-
gem.
|
7
|
+
gem.name = "domp"
|
8
|
+
gem.version = Domp::VERSION
|
9
|
+
gem.license = 'MIT'
|
10
|
+
gem.authors = ["Alexander Zaytsev"]
|
11
|
+
gem.email = ["alexander@say26.com"]
|
12
|
+
gem.description = %q{Devise Omniauth Multiple Providers}
|
13
|
+
gem.summary = %q{Generator to bootstrap usage of multiple providers with Devise and Omniauth}
|
14
|
+
gem.homepage = "https://github.com/AlexanderZaytsev/domp"
|
14
15
|
|
15
|
-
gem.files
|
16
|
-
gem.executables
|
17
|
-
gem.test_files
|
16
|
+
gem.files = `git ls-files`.split($/)
|
17
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
18
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
19
|
gem.require_paths = ["lib"]
|
19
20
|
end
|
data/lib/domp/version.rb
CHANGED
@@ -23,7 +23,7 @@ class DompGenerator < Rails::Generators::NamedBase
|
|
23
23
|
providers.each do |provider|
|
24
24
|
id = ask("#{provider.capitalize} application ID:")
|
25
25
|
secret = ask("#{provider.capitalize} application secret:")
|
26
|
-
omniauth_config << "\n config.omniauth :#{provider}, '#{id}', '#{secret}'\n"
|
26
|
+
omniauth_config << "\n config.omniauth :#{provider.underscore}, '#{id}', '#{secret}'\n"
|
27
27
|
end
|
28
28
|
|
29
29
|
inject_into_file 'config/initializers/devise.rb', after: "# config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'" do
|
@@ -33,7 +33,7 @@ class DompGenerator < Rails::Generators::NamedBase
|
|
33
33
|
|
34
34
|
def update_model_class
|
35
35
|
inject_into_class "app/models/#{file_name}.rb", class_name do
|
36
|
-
" has_many :authentications, class_name: '#{class_name}Authentication'\n"
|
36
|
+
" has_many :authentications, class_name: '#{class_name}Authentication', dependent: :destroy\n"
|
37
37
|
end
|
38
38
|
|
39
39
|
inject_into_class "app/models/#{file_name}.rb", class_name do
|
@@ -10,12 +10,14 @@ class <%= class_name %>Authentication < ActiveRecord::Base
|
|
10
10
|
|
11
11
|
<% end -%>
|
12
12
|
def self.create_from_omniauth(params, <%= class_name.downcase %>, provider)
|
13
|
+
token_expires_at = params['credentials']['expires_at'] ? Time.at(params['credentials']['expires_at']).to_datetime : nil
|
14
|
+
|
13
15
|
create(
|
14
16
|
<%= class_name.downcase %>: <%= class_name.downcase %>,
|
15
17
|
authentication_provider: provider,
|
16
18
|
uid: params['uid'],
|
17
19
|
token: params['credentials']['token'],
|
18
|
-
token_expires_at:
|
20
|
+
token_expires_at: token_expires_at,
|
19
21
|
params: params,
|
20
22
|
)
|
21
23
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: domp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Zaytsev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Devise Omniauth Multiple Providers
|
14
14
|
email:
|
@@ -33,7 +33,8 @@ files:
|
|
33
33
|
- lib/generators/domp/templates/model_authentications_migration.rb
|
34
34
|
- lib/generators/domp/templates/omniauth_callbacks_controller.rb
|
35
35
|
homepage: https://github.com/AlexanderZaytsev/domp
|
36
|
-
licenses:
|
36
|
+
licenses:
|
37
|
+
- MIT
|
37
38
|
metadata: {}
|
38
39
|
post_install_message:
|
39
40
|
rdoc_options: []
|