just_open_id 0.0.0 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ pkg/*
2
+ *.gem
3
+ .bundle
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in just-open-id.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,70 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ just_open_id (0.0.1)
5
+ omniauth
6
+
7
+ GEM
8
+ remote: http://rubygems.org/
9
+ specs:
10
+ addressable (2.2.2)
11
+ faraday (0.5.3)
12
+ addressable (~> 2.2.2)
13
+ multipart-post (~> 1.0.1)
14
+ rack (>= 1.1.0, < 2)
15
+ mime-types (1.16)
16
+ multi_json (0.0.5)
17
+ multipart-post (1.0.1)
18
+ net-ldap (0.1.1)
19
+ nokogiri (1.4.4)
20
+ oa-basic (0.1.6)
21
+ multi_json (~> 0.0.2)
22
+ nokogiri (~> 1.4.2)
23
+ oa-core (= 0.1.6)
24
+ rest-client (~> 1.6.0)
25
+ oa-core (0.1.6)
26
+ rack (~> 1.1)
27
+ oa-enterprise (0.1.6)
28
+ net-ldap (~> 0.1.1)
29
+ nokogiri (~> 1.4.2)
30
+ oa-core (= 0.1.6)
31
+ pyu-ruby-sasl (~> 0.0.3.1)
32
+ rubyntlm (~> 0.1.1)
33
+ oa-oauth (0.1.6)
34
+ multi_json (~> 0.0.2)
35
+ nokogiri (~> 1.4.2)
36
+ oa-core (= 0.1.6)
37
+ oauth (~> 0.4.0)
38
+ oauth2 (~> 0.1.0)
39
+ oa-openid (0.1.6)
40
+ oa-core (= 0.1.6)
41
+ rack-openid (~> 1.2.0)
42
+ ruby-openid-apps-discovery
43
+ oauth (0.4.4)
44
+ oauth2 (0.1.0)
45
+ faraday (~> 0.5.0)
46
+ multi_json (~> 0.0.4)
47
+ omniauth (0.1.6)
48
+ oa-basic (= 0.1.6)
49
+ oa-core (= 0.1.6)
50
+ oa-enterprise (= 0.1.6)
51
+ oa-oauth (= 0.1.6)
52
+ oa-openid (= 0.1.6)
53
+ pyu-ruby-sasl (0.0.3.2)
54
+ rack (1.2.1)
55
+ rack-openid (1.2.0)
56
+ rack (>= 1.1.0)
57
+ ruby-openid (>= 2.1.8)
58
+ rest-client (1.6.1)
59
+ mime-types (>= 1.16)
60
+ ruby-openid (2.1.8)
61
+ ruby-openid-apps-discovery (1.2.0)
62
+ ruby-openid (>= 2.1.7)
63
+ rubyntlm (0.1.1)
64
+
65
+ PLATFORMS
66
+ ruby
67
+
68
+ DEPENDENCIES
69
+ just_open_id!
70
+ omniauth
data/README ADDED
@@ -0,0 +1,16 @@
1
+ just_open_id is a Rails 3 engine for just OpenID logins using OmniAuth that connects to a User model.
2
+
3
+ The goal of this gem is to make it possible to manage accounts across multiple small apps.
4
+
5
+ I also want to use a User model and current_user helper method in the most traditional way in each app.
6
+
7
+ 1. Run your migrations for your namespaced User model.
8
+ 2. Ensure you have a root path.
9
+ 3. Add something like this to a template.
10
+
11
+ <% if current_user %>
12
+ Welcome <%= current_user.name %>!
13
+ <%= link_to "Sign Out", signout_path %>
14
+ <% else %>
15
+ <%= link_to "Sign in with Twitter", "/auth/twitter" %>
16
+ <% end %>'
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,23 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "just_open_id/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "just_open_id"
7
+ s.version = JustOpenId::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Jody Alkema"]
10
+ s.email = ["jody@alkema.ca"]
11
+ s.homepage = "http://github.com/alkema/just_open_id"
12
+ s.summary = "A Rails 3 engine for just OpenID logins using OmniAuth that connects to a User model."
13
+ s.description = "A Rails 3 engine for just OpenID logins using OmniAuth that connects to a User model."
14
+
15
+ s.rubyforge_project = "just_open_id"
16
+ s.add_dependency "omniauth"
17
+ # s.add_development_dependency "rspec"
18
+
19
+ s.files = `git ls-files`.split("\n")
20
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
21
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
22
+ s.require_paths = ["app", "config", "lib"]
23
+ end
@@ -0,0 +1,3 @@
1
+ module JustOpenId
2
+ VERSION = "0.0.2"
3
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: just_open_id
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 0
10
- version: 0.0.0
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jody Alkema
@@ -19,38 +19,9 @@ date: 2011-01-09 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
- prerelease: false
23
- type: :runtime
24
- name: rails
25
- version_requirements: &id001 !ruby/object:Gem::Requirement
26
- none: false
27
- requirements:
28
- - - ">="
29
- - !ruby/object:Gem::Version
30
- hash: 3
31
- segments:
32
- - 0
33
- version: "0"
34
- requirement: *id001
35
- - !ruby/object:Gem::Dependency
36
- prerelease: false
37
- type: :runtime
38
22
  name: omniauth
39
- version_requirements: &id002 !ruby/object:Gem::Requirement
40
- none: false
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- hash: 3
45
- segments:
46
- - 0
47
- version: "0"
48
- requirement: *id002
49
- - !ruby/object:Gem::Dependency
50
23
  prerelease: false
51
- type: :runtime
52
- name: openid
53
- version_requirements: &id003 !ruby/object:Gem::Requirement
24
+ requirement: &id001 !ruby/object:Gem::Requirement
54
25
  none: false
55
26
  requirements:
56
27
  - - ">="
@@ -59,50 +30,46 @@ dependencies:
59
30
  segments:
60
31
  - 0
61
32
  version: "0"
62
- requirement: *id003
63
- - !ruby/object:Gem::Dependency
64
- prerelease: false
65
33
  type: :runtime
66
- name: omniauth
67
- version_requirements: &id004 !ruby/object:Gem::Requirement
68
- none: false
69
- requirements:
70
- - - ">="
71
- - !ruby/object:Gem::Version
72
- hash: 3
73
- segments:
74
- - 0
75
- version: "0"
76
- requirement: *id004
77
- description:
78
- email: jody@alkema.ca
34
+ version_requirements: *id001
35
+ description: A Rails 3 engine for just OpenID logins using OmniAuth that connects to a User model.
36
+ email:
37
+ - jody@alkema.ca
79
38
  executables: []
80
39
 
81
40
  extensions: []
82
41
 
83
- extra_rdoc_files:
84
- - README.rdoc
42
+ extra_rdoc_files: []
43
+
85
44
  files:
45
+ - .gitignore
46
+ - Gemfile
47
+ - Gemfile.lock
48
+ - README
49
+ - Rakefile
86
50
  - app/controllers/just_open_id/sessions_controller.rb
87
51
  - app/models/just_open_id/user.rb
88
52
  - config/initializers/omniauth.rb
89
53
  - config/routes.rb
54
+ - just_open_id.gemspec
90
55
  - lib/engine.rb
91
56
  - lib/extensions/action_controller/base.rb
92
57
  - lib/just_open_id.rb
58
+ - lib/just_open_id/version.rb
93
59
  - lib/rails/generators/just_open_id/just_open_id_generator.rb
94
60
  - lib/rails/generators/just_open_id/templates/initializer.rb
95
61
  - lib/rails/generators/just_open_id/templates/migration.rb
96
62
  - lib/rails/generators/just_open_id/templates/schema.rb
97
- - README.rdoc
98
63
  has_rdoc: true
99
- homepage:
64
+ homepage: http://github.com/alkema/just_open_id
100
65
  licenses: []
101
66
 
102
67
  post_install_message:
103
68
  rdoc_options: []
104
69
 
105
70
  require_paths:
71
+ - app
72
+ - config
106
73
  - lib
107
74
  required_ruby_version: !ruby/object:Gem::Requirement
108
75
  none: false
@@ -124,10 +91,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
91
  version: "0"
125
92
  requirements: []
126
93
 
127
- rubyforge_project:
94
+ rubyforge_project: just_open_id
128
95
  rubygems_version: 1.3.7
129
96
  signing_key:
130
97
  specification_version: 3
131
- summary: A Rails 3 engine just OpenID logins using OmniAuth
98
+ summary: A Rails 3 engine for just OpenID logins using OmniAuth that connects to a User model.
132
99
  test_files: []
133
100
 
data/README.rdoc DELETED
@@ -1,56 +0,0 @@
1
- == Overview
2
-
3
- One of the things I was most looking forward to in rails 3 was the plugin / engine architecture. Recently, I sat down to figure out how to create my first engine and package it up as a gem and it took me awhile of time just to get the structure of the engine setup. It's missing a lot of the "rails" you get in a normal rails app.
4
-
5
- In it's simplest form engines are quite easy, however for a full-featured engine (such as creating a forum) there are a lot of extras that you're going to want. These are the things I spent time figuring out that I've packaged up into an easy starting point:
6
-
7
- * Namespacing models & controllers so they don't collide with those in the main app
8
- * Creating a global layout within your engine that gets nested within your application layout
9
- * Generating migrations from your engine
10
- * Creating an "acts_as_[plugin]" declaration for use inside your main app's models
11
- * Easy plugin configuration file editable from main app directory
12
- * Rake tasks within engine
13
- * Writing tests for models complete with fixtures
14
- * Serving static assets within engine
15
- * Packaging and distributing as a gem
16
- * Code is here - I've created an engine stub that has all the things setup for you already. I want to see a lot more rails 3 engines get created, I hope this helps! I'd love to hear feedback from you if you try it out.
17
-
18
- Here’s how you get ready to create your first gem by using this starting point:
19
-
20
- * git clone http://github.com/krschacht/rails_3_engine_demo.git
21
- * cd rails_3_engine_demo
22
- * [edit test/database.yml]
23
- * rake test (this will initialize your test database and run the basic test suite)
24
-
25
- Now, create a plain rails app and set it up to use your engine. FYI: even though the engine's directory is 'rails_3_engine_demo', internally the engine is named 'just_open_id'
26
-
27
- * cd .. [ this is to take you outside the 'rails_3_engine_demo' directory that was created above' ]
28
- * rails new demo_app_to_use_gem -d mysql
29
- * cd demo_app_to_use_gem
30
- * [edit config/database.yml]
31
- * [edit Gemfile, add line: ] gem ‘just_open_id’, :path => "../rails_3_engine_demo"
32
- * rails generate just_open_id
33
- * [examine config/initializers/just_open_id.rb to see basic config parameters]
34
- * rake db:create
35
- * rake db:migrate (one of the migrations that you'll see run came from the engine)
36
-
37
- You have now setup a empty rails app that utilizes your engine. To test out the functionality, startup the demo app’s webserver:
38
-
39
- * rails server
40
- * Then visit: http://localhost:3000/just_open_id (this is a controller included within the engine)
41
- * Watch the server logs as you're viewing this page and you'll see some output which is coming from an application before_filter which is executing from inside the engine (in lib/application_controller.rb)
42
- * rake just_open_id:report (this is a a rake task that is included inside the engine)
43
-
44
- Lastly, let's package up your engine as a real gem. You’ll need Jeweler installed for this:
45
-
46
- * cd rails_3_engine_demo
47
- * sudo gem install jeweler
48
- * rake gemspec
49
- * rake build
50
- * rake install (you have now installed your engine as a gem locally)
51
- * [ At this point if you wanted your demo app to use your installed gem, edit the Gemfile in your demo app and remove the 'path' option from your gem line. It should look like this: ] gem ‘just_open_id’
52
- * rake gemcutter:release (this pushes your gem up to Gemcutter, a public gem repository)
53
-
54
- Now you’re ready to start customizing this engine for your own purposes. Do a global find in your engine directory and replace every instance of "just_open_id" and "JustOpenId" with your engine name (be sure to preserve capitalization). Likewise, rename every directory and file that’s named "just_open_id" with your engine name. I should really automate this but I haven’t figured out how to create a rake task that I can run from within the engine directory itself.
55
-
56
- P.S. Special thanks to Chrispy for helping figure out the application_controller includes!