elecnix-omnisocial 0.1.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.
Files changed (28) hide show
  1. data/README.md +35 -0
  2. data/app/controllers/omnisocial/auth_controller.rb +39 -0
  3. data/app/helpers/omnisocial/auth_helper.rb +32 -0
  4. data/app/models/omnisocial/facebook_account.rb +27 -0
  5. data/app/models/omnisocial/linked_in_account.rb +15 -0
  6. data/app/models/omnisocial/login_account.rb +29 -0
  7. data/app/models/omnisocial/twitter_account.rb +15 -0
  8. data/app/models/omnisocial/user.rb +36 -0
  9. data/app/views/omnisocial/auth/new.html.erb +23 -0
  10. data/config/routes.rb +6 -0
  11. data/lib/extensions/action_controller/base.rb +62 -0
  12. data/lib/generators/omnisocial/omnisocial_generator.rb +52 -0
  13. data/lib/generators/omnisocial/templates/README +6 -0
  14. data/lib/generators/omnisocial/templates/assets/images/facebook.png +0 -0
  15. data/lib/generators/omnisocial/templates/assets/images/linkedin.png +0 -0
  16. data/lib/generators/omnisocial/templates/assets/images/signin_facebook.png +0 -0
  17. data/lib/generators/omnisocial/templates/assets/images/signin_linkedin.jpg +0 -0
  18. data/lib/generators/omnisocial/templates/assets/images/signin_twitter.png +0 -0
  19. data/lib/generators/omnisocial/templates/assets/images/twitter.gif +0 -0
  20. data/lib/generators/omnisocial/templates/assets/stylesheets/omnisocial.css +80 -0
  21. data/lib/generators/omnisocial/templates/migration.rb +33 -0
  22. data/lib/generators/omnisocial/templates/omnisocial.rb +19 -0
  23. data/lib/generators/omnisocial/templates/user.rb +3 -0
  24. data/lib/omnisocial.rb +28 -0
  25. data/lib/omnisocial/engine.rb +39 -0
  26. data/lib/omnisocial/service_config.rb +13 -0
  27. data/lib/omnisocial/version.rb +3 -0
  28. metadata +133 -0
@@ -0,0 +1,35 @@
1
+ # OmniSocial
2
+
3
+ A Rails 3 engine for Twitter, Facebook and LinkedIn logins using [OmniAuth](http://github.com/intridea/omniauth)
4
+
5
+ ## Installation
6
+
7
+ To use OmniSocial in a Rails 3 application:
8
+
9
+ 1. Require it in the Gemfile: `gem 'omnisocial'`
10
+
11
+ 2. Install it by running `bundle`.
12
+
13
+ 3. Run `rails g omnisocial` to copy an initializer, database migration and some CSS and image assets into your base application directory.
14
+
15
+ 4. Edit `config/initializers/omnisocial.rb` and include your application's Twitter and Facebook OAuth configuration.
16
+
17
+ 5. Run `rake db:migrate` to create the user and login_account tables.
18
+
19
+ 6. Test that the logins work by accessing `/login` inside your application.
20
+
21
+ Some more detailed installation instructions are in the [project announcement article](http://icelab.com.au/articles/welcome-to-the-omnisocial/).
22
+
23
+ ## Contributors
24
+
25
+ * [Klaus Hartl](http://github.com/carhartl)
26
+ * [Stephen Aument](http://github.com/stephenaument)
27
+
28
+ ## Copyright & License
29
+
30
+ OmniSocial is Copyright (c) 2010 [Tim Riley](http://openmonkey.com/) and [Icelab](http://icelab.com.au/), and is released under MIT License.
31
+
32
+ The "Sign in with Twitter/Facebook" buttons are from [Komodo Media](http://www.komodomedia.com/blog/2009/05/sign-in-with-twitter-and-facebook-buttons/), distributeed under the [Creative Commons Attribution-Share Alike 3.0 Unported License](http://creativecommons.org/licenses/by-sa/3.0/).
33
+
34
+ The twitter bird image is courtesy of [Pasquale D’Silva](http://wefunction.com/2008/07/freebie-twitter-icons-illustration/).
35
+
@@ -0,0 +1,39 @@
1
+ module Omnisocial
2
+ class AuthController < ApplicationController
3
+
4
+ unloadable
5
+
6
+ def new
7
+ if current_user?
8
+ flash[:notice] = 'You are already signed in. Please sign out if you want to sign in as a different user.'
9
+ redirect_to(root_path)
10
+ end
11
+ end
12
+
13
+ def callback
14
+ account = case request.env['rack.auth']['provider']
15
+ when 'twitter' then
16
+ Omnisocial::TwitterAccount.find_or_create_from_auth_hash(request.env['rack.auth'])
17
+ when 'facebook' then
18
+ Omnisocial::FacebookAccount.find_or_create_from_auth_hash(request.env['rack.auth'])
19
+ when 'linked_in' then
20
+ Omnisocial::LinkedInAccount.find_or_create_from_auth_hash(request.env['rack.auth'])
21
+ end
22
+
23
+ self.current_user = account.find_or_create_user
24
+
25
+ flash[:notice] = 'You have logged in successfully.'
26
+ redirect_back_or_default(root_path)
27
+ end
28
+
29
+ def failure
30
+ flash[:error] = "We had trouble signing you in. Did you make sure to grant access? Please select a service below and try again."
31
+ render :action => 'new'
32
+ end
33
+
34
+ def destroy
35
+ logout!
36
+ redirect_to(root_path)
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,32 @@
1
+ module Omnisocial
2
+ module AuthHelper
3
+ def auth_request_path(options = {})
4
+ "/auth/#{options[:service]}"
5
+ end
6
+
7
+ def big_twitter_login_button
8
+ content_tag(:a, content_tag(:span, 'Sign in with Twitter'), :class => 'omnisocial-button twitter', :href => auth_request_path(:service => 'twitter'))
9
+ end
10
+
11
+ def big_facebook_login_button
12
+ content_tag(:a, content_tag(:span, 'Sign in with Facebook'), :class => 'omnisocial-button facebook', :href => auth_request_path(:service => 'facebook'))
13
+ end
14
+
15
+ def twitter_login_button
16
+ content_tag(:a, image_tag('/images/omnisocial/signin_twitter.png', :alt => 'Sign in with Twitter'), :href => auth_request_path(:service => 'twitter'))
17
+ end
18
+
19
+ def facebook_login_button
20
+ content_tag(:a, image_tag('/images/omnisocial/signin_facebook.png', :alt => 'Sign in with Facebook'), :href => auth_request_path(:service => 'facebook'))
21
+ end
22
+
23
+ def linkedin_login_button
24
+ content_tag(:a, content_tag(:img, :src => '/images/omnisocial/signin_linked_in.png', :alt => 'Sign in with LinkeIn'), :href => auth_request_path(:service => 'linked_in'))
25
+ end
26
+
27
+ def big_linkedin_login_button
28
+ content_tag(:a, content_tag(:span, 'Sign in with LinkedIn'), :class => 'omnisocial-button linkedin', :href => auth_request_path(:service => 'linked_in'))
29
+ end
30
+
31
+ end
32
+ end
@@ -0,0 +1,27 @@
1
+ module Omnisocial
2
+ class FacebookAccount < LoginAccount
3
+ def assign_account_info(auth_hash)
4
+ self.remote_account_id = auth_hash['uid']
5
+ self.login = auth_hash['user_info']['nickname']
6
+ self.name = auth_hash['user_info']['name']
7
+ self.first_name = auth_hash['user_info']['first_name'] if self.respond_to? :first_name
8
+ self.last_name = auth_hash['user_info']['last_name'] if self.respond_to? :last_name
9
+ self.email = auth_hash['extra']['user_hash']['email'] if self.respond_to? :email
10
+ self.gender = auth_hash['extra']['user_hash']['gender'] if self.respond_to? :gender
11
+ self.timezone = auth_hash['extra']['user_hash']['timezone'] if self.respond_to? :timezone
12
+ self.access_token = auth_hash['credentials']['token']
13
+ end
14
+
15
+ def account_url
16
+ "http://facebook.com/#{self.login}"
17
+ end
18
+
19
+ def picture_url
20
+ if self.login.include?('profile.php')
21
+ "https://graph.facebook.com/#{self.login.gsub(/[^\d]/, '')}/picture?type=square"
22
+ else
23
+ "https://graph.facebook.com/#{self.login}/picture?type=square"
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,15 @@
1
+ module Omnisocial
2
+ class LinkedInAccount < LoginAccount
3
+ def assign_account_info(auth_hash)
4
+ self.remote_account_id = auth_hash['uid']
5
+ self.picture_url = auth_hash['user_info']['image']
6
+ self.name = auth_hash['user_info']['first_name']
7
+ self.access_token = auth_hash['credentials']['token']
8
+ end
9
+
10
+ def account_url
11
+ "http://www.linkedin.com/profile/view?id=#{self.remote_account_id}"
12
+ end
13
+ end
14
+ end
15
+
@@ -0,0 +1,29 @@
1
+ module Omnisocial
2
+ class LoginAccount < ActiveRecord::Base
3
+ belongs_to :user
4
+
5
+ def self.find_or_create_from_auth_hash(auth_hash)
6
+ if (account = find_by_remote_account_id(auth_hash['uid']))
7
+ account.assign_account_info(auth_hash)
8
+ account.save
9
+ account
10
+ else
11
+ create_from_auth_hash(auth_hash)
12
+ end
13
+ end
14
+
15
+ def self.create_from_auth_hash(auth_hash)
16
+ create do |account|
17
+ account.assign_account_info(auth_hash)
18
+ end
19
+ end
20
+
21
+ def find_or_create_user
22
+ return self.user if self.user
23
+
24
+ ::User.create do |user|
25
+ user.login_account = self
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,15 @@
1
+ module Omnisocial
2
+ class TwitterAccount < LoginAccount
3
+ def assign_account_info(auth_hash)
4
+ self.remote_account_id = auth_hash['uid']
5
+ self.login = auth_hash['user_info']['nickname']
6
+ self.picture_url = auth_hash['user_info']['image']
7
+ self.name = auth_hash['user_info']['name']
8
+ self.access_token = auth_hash['credentials']['token']
9
+ end
10
+
11
+ def account_url
12
+ "http://twitter.com/#{self.login}"
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,36 @@
1
+ module Omnisocial
2
+ class User < ActiveRecord::Base
3
+ self.abstract_class = true
4
+
5
+ has_one :login_account, :class_name => 'Omnisocial::LoginAccount', :dependent => :destroy
6
+ delegate :login, :name, :picture_url, :account_url, :access_token, :to => :login_account
7
+
8
+ def to_param
9
+ if !self.login.include?('profile.php?')
10
+ "#{self.id}-#{self.login.gsub('.', '-')}"
11
+ else
12
+ self.id.to_s
13
+ end
14
+ end
15
+
16
+ def from_twitter?
17
+ login_account.kind_of? TwitterAccount
18
+ end
19
+
20
+ def from_facebook?
21
+ login_account.kind_of? FacebookAccount
22
+ end
23
+
24
+ def from_linked_in?
25
+ login_account.kind_of? LinkedInAccount
26
+ end
27
+
28
+ def remember
29
+ update_attributes(:remember_token => ::BCrypt::Password.create("#{Time.now}-#{self.login_account.type}-#{self.login}")) unless new_record?
30
+ end
31
+
32
+ def forget
33
+ update_attributes(:remember_token => nil) unless new_record?
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,23 @@
1
+ <div id="omnisocial-login">
2
+ <% if flash[:error] -%>
3
+ <div class="error">
4
+ <p>
5
+ <%= flash[:error] %>
6
+ </p>
7
+ </div>
8
+ <% end -%>
9
+ <div class="information">
10
+ <h1>Sign in (or up)</h1>
11
+ <p class="large">
12
+ You can use either your Twitter or Facebook account to sign in or sign up.
13
+ </p>
14
+ <p>
15
+ Select your preferred method and you'll be sent off to authorise us to use your account.
16
+ </p>
17
+ <p>
18
+ It&#8217;ll only take a second and your information will be perfectly safe. We don't get access to your password and <em>we won't post or tweet anything from your account</em> without your explicit permission.
19
+ </p>
20
+ </div>
21
+ <%= big_twitter_login_button %>
22
+ <%= big_facebook_login_button %>
23
+ </div>
@@ -0,0 +1,6 @@
1
+ Rails.application.routes.draw do
2
+ match '/login' => 'omnisocial/auth#new', :as => :login
3
+ match '/auth/:service/callback' => 'omnisocial/auth#callback'
4
+ match '/auth/failure' => 'omnisocial/auth#failure'
5
+ match '/logout' => 'omnisocial/auth#destroy', :as => :logout
6
+ end
@@ -0,0 +1,62 @@
1
+ class ActionController::Base
2
+ def self.require_user(options = {})
3
+ raise Exception, "require_user cannot be called on ActionController::Base. Only it's subclasses" if self == ActionController::Base
4
+ prepend_before_filter :require_user, options
5
+ end
6
+
7
+ helper_method :current_user, :current_user?
8
+
9
+ protected
10
+
11
+ # Filters
12
+
13
+ def require_user
14
+ current_user.present? || deny_access
15
+ end
16
+
17
+ # Utils
18
+
19
+ def store_location
20
+ session[:return_to] = request.fullpath
21
+ end
22
+
23
+ def deny_access
24
+ store_location
25
+ redirect_to login_path
26
+ end
27
+
28
+ def redirect_back_or_default(default)
29
+ redirect_to(session[:return_to] || default)
30
+ session[:return_to] = nil
31
+ end
32
+
33
+ def current_user
34
+ @current_user ||= if session[:user_id]
35
+ User.find(session[:user_id])
36
+ elsif cookies[:remember_token]
37
+ User.find_by_remember_token(cookies[:remember_token])
38
+ else
39
+ false
40
+ end
41
+ end
42
+
43
+ def current_user?
44
+ !!current_user
45
+ end
46
+
47
+ def current_user=(user)
48
+ user.tap do |user|
49
+ user.remember
50
+ session[:user_id] = user.id
51
+ cookies[:remember_token] = user.remember_token
52
+ end
53
+ end
54
+
55
+ def logout!
56
+ session[:user_id] = nil
57
+ @current_user = nil
58
+ cookies.delete(:remember_token)
59
+ session[:return_to] = nil
60
+ end
61
+
62
+ end
@@ -0,0 +1,52 @@
1
+ require 'rails/generators'
2
+ require 'rails/generators/migration'
3
+
4
+ module Omnisocial
5
+ module Generators
6
+ class OmnisocialGenerator < Rails::Generators::Base
7
+ include Rails::Generators::Migration
8
+
9
+ desc 'Creates an omnisocial initializer and migration, and copies image and CSS assets.'
10
+
11
+ def self.source_root
12
+ File.join(File.dirname(__FILE__), 'templates')
13
+ end
14
+
15
+ # Implement the required interface for Rails::Generators::Migration:
16
+ # http://github.com/rails/rails/blob/master/activerecord/lib/generators/active_record.rb
17
+ def self.next_migration_number(dirname)
18
+ if ActiveRecord::Base.timestamped_migrations
19
+ Time.now.utc.strftime("%Y%m%d%H%M%S")
20
+ else
21
+ "%.3d" % (current_migration_number(dirname) + 1)
22
+ end
23
+ end
24
+
25
+ def create_migration_file
26
+ migration_template 'migration.rb', 'db/migrate/create_omnisocial_tables.rb'
27
+ end
28
+
29
+ def copy_initializer
30
+ template 'omnisocial.rb', 'config/initializers/omnisocial.rb'
31
+ end
32
+
33
+ def copy_user_model
34
+ template 'user.rb', 'app/models/user.rb'
35
+ end
36
+
37
+ def copy_assets
38
+ copy_file 'assets/stylesheets/omnisocial.css', 'public/stylesheets/omnisocial.css'
39
+ copy_file 'assets/images/twitter.gif', 'public/images/omnisocial/twitter.gif'
40
+ copy_file 'assets/images/facebook.png', 'public/images/omnisocial/facebook.png'
41
+ copy_file 'assets/images/signin_twitter.png', 'public/images/omnisocial/signin_twitter.png'
42
+ copy_file 'assets/images/signin_facebook.png', 'public/images/omnisocial/signin_facebook.png'
43
+ copy_file 'assets/images/linkedin.png', 'public/images/omnisocial/linkeding.png'
44
+ copy_file 'assets/images/signin_linkedin.jpg', 'public/images/omnisocial/signin_linkedin.jpg'
45
+ end
46
+
47
+ def show_readme
48
+ readme 'README' if behavior == :invoke
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,6 @@
1
+
2
+ ===============================================================================
3
+
4
+ Welcome to the OmniSocial.
5
+
6
+ ===============================================================================
@@ -0,0 +1,80 @@
1
+ #omnisocial-login {
2
+ overflow: hidden;
3
+ }
4
+
5
+ #omnisocial-login .information {
6
+ float: left;
7
+ margin-right: 40px;
8
+ width: 450px;
9
+ }
10
+
11
+ a.omnisocial-button {
12
+ text-decoration: none;
13
+ }
14
+ a.omnisocial-button span {
15
+ -webkit-border-radius: 3px;
16
+ -moz-border-radius: 3px;
17
+ border-width: 1px;
18
+ border-style: solid;
19
+ font-weight: bold;
20
+ font-family: "proxima-nova-condensed-1", "proxima-nova-condensed-2", Helvetica, Arial, Verdana, sans-serif;
21
+ font-size: 16px;
22
+ cursor: pointer;
23
+ display: inline-block;
24
+ line-height: 1;
25
+ margin-top: 1px;
26
+ padding: 8px 10px 9px;
27
+ position: relative;
28
+ text-decoration: none;
29
+ text-shadow: rgba(0, 0, 0, 0.4) 0 -1px 0px;
30
+ background: #3583cf;
31
+ background: -webkit-gradient(linear, left top, left bottom, from(#629ed9), to(#3583cf));
32
+ border-color: #bbe2f8;
33
+ color: white;
34
+ float: none;
35
+ font-size: 18px;
36
+ position: absolute;
37
+ }
38
+ a:hover.omnisocial-button span {
39
+ text-shadow: rgba(0, 0, 0, 0.4) 0 -1px 0px;
40
+ background: #6ca520;
41
+ background: -webkit-gradient(linear, left top, left bottom, from(#90bb58), to(#6ca520));
42
+ border-color: #dcf1bf;
43
+ -o-box-shadow: rgba(0, 0, 0, 0.5) 0 0 5px 0;
44
+ -webkit-box-shadow: rgba(0, 0, 0, 0.5) 0 0 5px 0;
45
+ -moz-box-shadow: rgba(0, 0, 0, 0.5) 0 0 5px 0;
46
+ box-shadow: rgba(0, 0, 0, 0.5) 0 0 5px 0;
47
+ }
48
+
49
+ a.omnisocial-button.twitter {
50
+ background: url(/images/omnisocial/twitter.gif) center center no-repeat;
51
+ float: left;
52
+ height: 255px;
53
+ width: 200px;
54
+ }
55
+ a.omnisocial-button.twitter span {
56
+ margin: 240px 0 0 25px;
57
+ }
58
+
59
+ a.omnisocial-button.facebook {
60
+ background: url(/images/omnisocial/facebook.png) center center no-repeat;
61
+ float: left;
62
+ margin-left: 40px;
63
+ height: 255px;
64
+ width: 200px;
65
+ }
66
+ a.omnisocial-button.linkedin {
67
+ background: url(/images/omnisocial/linkedin.png) center center no-repeat;
68
+ float: left;
69
+ margin-left: 40px;
70
+ height: 255px;
71
+ width: 200px;
72
+ }
73
+
74
+ a.omnisocial-button.linkedin span {
75
+ margin: 240px 0 0 11px;
76
+ }
77
+
78
+ a.omnisocial-button.facebook span {
79
+ margin: 240px 0 0 11px;
80
+ }
@@ -0,0 +1,33 @@
1
+ class CreateOmnisocialTables < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :users do |t|
4
+ t.string :remember_token
5
+ # Any additional fields here
6
+
7
+ t.timestamps
8
+ end
9
+
10
+ create_table :login_accounts do |t|
11
+ t.string :type
12
+ t.integer :user_id
13
+ t.string :remote_account_id
14
+ t.string :name
15
+ t.string :login
16
+ t.string :picture_url
17
+ t.string :access_token
18
+ # Any additional fields here
19
+
20
+ t.timestamps
21
+ end
22
+
23
+ add_index :login_accounts, :user_id
24
+ add_index :login_accounts, :type
25
+ end
26
+
27
+ def self.down
28
+ remove_index :login_accounts, :type
29
+ remove_index :login_accounts, :user_id
30
+ drop_table :login_accounts
31
+ drop_table :users
32
+ end
33
+ end
@@ -0,0 +1,19 @@
1
+ Omnisocial.setup do |config|
2
+
3
+ # ==> Twitter
4
+ # config.twitter 'APP_KEY', 'APP_SECRET'
5
+
6
+ # ==> Facebook
7
+ # config.facebook 'APP_KEY', 'APP_SECRET', :scope => 'publish_stream'
8
+
9
+ if Rails.env.production?
10
+
11
+ # Configs for production mode go here
12
+
13
+ elsif Rails.env.development?
14
+
15
+ # Configs for development mode go here
16
+
17
+ end
18
+
19
+ end
@@ -0,0 +1,3 @@
1
+ class User < Omnisocial::User
2
+ # Make any customisations here
3
+ end
@@ -0,0 +1,28 @@
1
+ module Omnisocial
2
+ require 'omnisocial/service_config'
3
+
4
+ # Twitter & Facebook app configs
5
+ mattr_accessor :service_configs
6
+ @@service_configs = {}
7
+
8
+ def self.setup
9
+ yield self
10
+ end
11
+
12
+ # config.twitter APP_KEY, APP_SECRET, :scope => ['foo', 'bar']
13
+ def self.twitter(app_key, app_secret, options = {})
14
+ @@service_configs[:twitter] = Omnisocial::ServiceConfig.new(app_key, app_secret, options)
15
+ end
16
+
17
+ def self.facebook(app_key, app_secret, options = {})
18
+ @@service_configs[:facebook] = Omnisocial::ServiceConfig.new(app_key, app_secret, options)
19
+ end
20
+
21
+ def self.linked_in(app_key, app_secret, options ={})
22
+ @@service_configs[:linked_in] = Omnisocial::ServiceConfig.new(app_key, app_secret, options)
23
+ end
24
+
25
+ require 'omnisocial/engine' if defined?(Rails) && Rails::VERSION::MAJOR == 3
26
+ end
27
+
28
+ require 'extensions/action_controller/base'
@@ -0,0 +1,39 @@
1
+ require 'omnisocial'
2
+
3
+ require 'rails'
4
+ require 'action_controller'
5
+
6
+ require 'omniauth/core'
7
+ require 'omniauth/oauth'
8
+ require 'bcrypt'
9
+
10
+ module Omnisocial
11
+ class Engine < Rails::Engine
12
+
13
+ config.to_prepare do
14
+ ApplicationController.helper(Omnisocial::AuthHelper)
15
+ end
16
+
17
+ initializer 'omnisocial.load_middleware', :after=> :load_config_initializers do
18
+ if Omnisocial.service_configs[:twitter]
19
+ config.app_middleware.use ::OmniAuth::Strategies::Twitter,
20
+ Omnisocial.service_configs[:twitter].app_key,
21
+ Omnisocial.service_configs[:twitter].app_secret
22
+ end
23
+
24
+ if Omnisocial.service_configs[:facebook]
25
+ config.app_middleware.use ::OmniAuth::Strategies::Facebook,
26
+ Omnisocial.service_configs[:facebook].app_key,
27
+ Omnisocial.service_configs[:facebook].app_secret,
28
+ Omnisocial.service_configs[:facebook].options
29
+ end
30
+
31
+ if Omnisocial.service_configs[:linked_in]
32
+ config.app_middleware.use ::OmniAuth::Strategies::LinkedIn,
33
+ Omnisocial.service_configs[:linked_in].app_key,
34
+ Omnisocial.service_configs[:linked_in].app_secret
35
+ end
36
+ end
37
+
38
+ end
39
+ end
@@ -0,0 +1,13 @@
1
+ require 'ostruct'
2
+
3
+ module Omnisocial
4
+ class ServiceConfig < OpenStruct
5
+ def initialize(app_key, app_secret, options)
6
+ super(
7
+ :app_key => app_key,
8
+ :app_secret => app_secret,
9
+ :options => options
10
+ )
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,3 @@
1
+ module Omnisocial
2
+ VERSION = '0.1.5'
3
+ end
metadata ADDED
@@ -0,0 +1,133 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: elecnix-omnisocial
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 5
9
+ version: 0.1.5
10
+ platform: ruby
11
+ authors:
12
+ - Tim Riley
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2011-02-08 00:00:00 -05:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: oa-core
22
+ requirement: &id001 !ruby/object:Gem::Requirement
23
+ none: false
24
+ requirements:
25
+ - - ~>
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ - 1
30
+ - 2
31
+ version: 0.1.2
32
+ type: :runtime
33
+ prerelease: false
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: oa-oauth
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - ~>
41
+ - !ruby/object:Gem::Version
42
+ segments:
43
+ - 0
44
+ - 1
45
+ - 2
46
+ version: 0.1.2
47
+ type: :runtime
48
+ prerelease: false
49
+ version_requirements: *id002
50
+ - !ruby/object:Gem::Dependency
51
+ name: bcrypt-ruby
52
+ requirement: &id003 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ~>
56
+ - !ruby/object:Gem::Version
57
+ segments:
58
+ - 2
59
+ - 1
60
+ version: "2.1"
61
+ type: :runtime
62
+ prerelease: false
63
+ version_requirements: *id003
64
+ description: Twitter and Facebook logins for your Rails application.
65
+ email: tim@openmonkey.com
66
+ executables: []
67
+
68
+ extensions: []
69
+
70
+ extra_rdoc_files: []
71
+
72
+ files:
73
+ - README.md
74
+ - lib/omnisocial.rb
75
+ - lib/generators/omnisocial/omnisocial_generator.rb
76
+ - lib/generators/omnisocial/templates/omnisocial.rb
77
+ - lib/generators/omnisocial/templates/user.rb
78
+ - lib/generators/omnisocial/templates/migration.rb
79
+ - lib/generators/omnisocial/templates/assets/images/linkedin.png
80
+ - lib/generators/omnisocial/templates/assets/images/facebook.png
81
+ - lib/generators/omnisocial/templates/assets/images/twitter.gif
82
+ - lib/generators/omnisocial/templates/assets/images/signin_facebook.png
83
+ - lib/generators/omnisocial/templates/assets/images/signin_linkedin.jpg
84
+ - lib/generators/omnisocial/templates/assets/images/signin_twitter.png
85
+ - lib/generators/omnisocial/templates/assets/stylesheets/omnisocial.css
86
+ - lib/generators/omnisocial/templates/README
87
+ - lib/omnisocial/engine.rb
88
+ - lib/omnisocial/service_config.rb
89
+ - lib/omnisocial/version.rb
90
+ - lib/extensions/action_controller/base.rb
91
+ - app/models/omnisocial/facebook_account.rb
92
+ - app/models/omnisocial/user.rb
93
+ - app/models/omnisocial/twitter_account.rb
94
+ - app/models/omnisocial/login_account.rb
95
+ - app/models/omnisocial/linked_in_account.rb
96
+ - app/controllers/omnisocial/auth_controller.rb
97
+ - app/helpers/omnisocial/auth_helper.rb
98
+ - app/views/omnisocial/auth/new.html.erb
99
+ - config/routes.rb
100
+ has_rdoc: true
101
+ homepage: http://github.com/icelab/omnisocial
102
+ licenses: []
103
+
104
+ post_install_message:
105
+ rdoc_options: []
106
+
107
+ require_paths:
108
+ - lib
109
+ required_ruby_version: !ruby/object:Gem::Requirement
110
+ none: false
111
+ requirements:
112
+ - - ">="
113
+ - !ruby/object:Gem::Version
114
+ segments:
115
+ - 0
116
+ version: "0"
117
+ required_rubygems_version: !ruby/object:Gem::Requirement
118
+ none: false
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ segments:
123
+ - 0
124
+ version: "0"
125
+ requirements: []
126
+
127
+ rubyforge_project:
128
+ rubygems_version: 1.3.7
129
+ signing_key:
130
+ specification_version: 3
131
+ summary: Twitter and Facebook logins for your Rails application.
132
+ test_files: []
133
+