aihs_devise_invitable 0.4.rc
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +27 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +117 -0
- data/LICENSE +20 -0
- data/README.rdoc +187 -0
- data/Rakefile +57 -0
- data/app/controllers/devise/invitations_controller.rb +47 -0
- data/app/views/devise/invitations/edit.html.erb +14 -0
- data/app/views/devise/invitations/new.html.erb +12 -0
- data/app/views/devise/mailer/invitation.html.erb +8 -0
- data/app/views/devise/mailer/invitation_instructions.html.erb +8 -0
- data/config/locales/en.yml +9 -0
- data/devise_invitable.gemspec +143 -0
- data/lib/devise_invitable.rb +16 -0
- data/lib/devise_invitable/controllers/helpers.rb +7 -0
- data/lib/devise_invitable/controllers/url_helpers.rb +24 -0
- data/lib/devise_invitable/mailer.rb +14 -0
- data/lib/devise_invitable/model.rb +130 -0
- data/lib/devise_invitable/rails.rb +13 -0
- data/lib/devise_invitable/routes.rb +13 -0
- data/lib/devise_invitable/schema.rb +33 -0
- data/lib/devise_invitable/version.rb +3 -0
- data/lib/generators/active_record/devise_invitable_generator.rb +13 -0
- data/lib/generators/active_record/templates/migration.rb +20 -0
- data/lib/generators/devise_invitable/devise_invitable_generator.rb +16 -0
- data/lib/generators/devise_invitable/install_generator.rb +35 -0
- data/lib/generators/devise_invitable/views_generator.rb +10 -0
- data/test/generators_test.rb +45 -0
- data/test/integration/invitation_test.rb +107 -0
- data/test/integration_tests_helper.rb +58 -0
- data/test/mailers/invitation_mail_test.rb +63 -0
- data/test/model_tests_helper.rb +41 -0
- data/test/models/invitable_test.rb +213 -0
- data/test/models_test.rb +32 -0
- data/test/rails_app/app/controllers/admins_controller.rb +6 -0
- data/test/rails_app/app/controllers/application_controller.rb +3 -0
- data/test/rails_app/app/controllers/home_controller.rb +4 -0
- data/test/rails_app/app/controllers/users_controller.rb +12 -0
- data/test/rails_app/app/helpers/application_helper.rb +2 -0
- data/test/rails_app/app/models/octopussy.rb +11 -0
- data/test/rails_app/app/models/user.rb +4 -0
- data/test/rails_app/app/views/home/index.html.erb +0 -0
- data/test/rails_app/app/views/layouts/application.html.erb +16 -0
- data/test/rails_app/app/views/users/invitations/new.html.erb +15 -0
- data/test/rails_app/config.ru +4 -0
- data/test/rails_app/config/application.rb +46 -0
- data/test/rails_app/config/boot.rb +14 -0
- data/test/rails_app/config/database.yml +22 -0
- data/test/rails_app/config/environment.rb +5 -0
- data/test/rails_app/config/environments/development.rb +26 -0
- data/test/rails_app/config/environments/production.rb +49 -0
- data/test/rails_app/config/environments/test.rb +35 -0
- data/test/rails_app/config/initializers/backtrace_silencers.rb +7 -0
- data/test/rails_app/config/initializers/devise.rb +174 -0
- data/test/rails_app/config/initializers/inflections.rb +10 -0
- data/test/rails_app/config/initializers/mime_types.rb +5 -0
- data/test/rails_app/config/initializers/secret_token.rb +7 -0
- data/test/rails_app/config/initializers/session_store.rb +8 -0
- data/test/rails_app/config/locales/en.yml +5 -0
- data/test/rails_app/config/routes.rb +4 -0
- data/test/rails_app/script/rails +6 -0
- data/test/routes_test.rb +20 -0
- data/test/test_helper.rb +31 -0
- metadata +222 -0
@@ -0,0 +1,10 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Add new inflection rules using the following format
|
4
|
+
# (all these examples are active by default):
|
5
|
+
# ActiveSupport::Inflector.inflections do |inflect|
|
6
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
7
|
+
# inflect.singular /^(ox)en/i, '\1'
|
8
|
+
# inflect.irregular 'person', 'people'
|
9
|
+
# inflect.uncountable %w( fish sheep )
|
10
|
+
# end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
# Make sure the secret is at least 30 characters and all random,
|
6
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
+
RailsApp::Application.config.secret_token = 'e997edf9d7eba5cf89a76a046fa53f5d66261d22cfcf29e3f538c75ad2d175b106bd5d099f44f6ce34ad3b3162d71cfaa37d2d4f4b38645288331427b4c2a607'
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
RailsApp::Application.config.session_store :cookie_store, :key => '_test_app_session'
|
4
|
+
|
5
|
+
# Use the database for sessions instead of the cookie-based default,
|
6
|
+
# which shouldn't be used to store highly confidential information
|
7
|
+
# (create the session table with "rake db:sessions:create")
|
8
|
+
# RailsApp::Application.config.session_store :active_record_store
|
@@ -0,0 +1,6 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
+
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
6
|
+
require 'rails/commands'
|
data/test/routes_test.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'test/test_helper'
|
2
|
+
|
3
|
+
class RoutesTest < ActionController::TestCase
|
4
|
+
|
5
|
+
test 'map new user invitation' do
|
6
|
+
assert_recognizes({:controller => 'devise/invitations', :action => 'new'}, {:path => 'users/invitation/new', :method => :get})
|
7
|
+
end
|
8
|
+
|
9
|
+
test 'map create user invitation' do
|
10
|
+
assert_recognizes({:controller => 'devise/invitations', :action => 'create'}, {:path => 'users/invitation', :method => :post})
|
11
|
+
end
|
12
|
+
|
13
|
+
test 'map accept user invitation' do
|
14
|
+
assert_recognizes({:controller => 'devise/invitations', :action => 'edit'}, 'users/invitation/accept')
|
15
|
+
end
|
16
|
+
|
17
|
+
test 'map update user invitation' do
|
18
|
+
assert_recognizes({:controller => 'devise/invitations', :action => 'update'}, {:path => 'users/invitation', :method => :put})
|
19
|
+
end
|
20
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
ENV["RAILS_ENV"] = "test"
|
2
|
+
DEVISE_ORM = (ENV["DEVISE_ORM"] || :active_record).to_sym
|
3
|
+
require 'rails_app/config/environment'
|
4
|
+
|
5
|
+
require 'rails/test_help'
|
6
|
+
require 'capybara/rails'
|
7
|
+
|
8
|
+
ActionMailer::Base.delivery_method = :test
|
9
|
+
ActionMailer::Base.perform_deliveries = true
|
10
|
+
ActionMailer::Base.default_url_options[:host] = 'test.com'
|
11
|
+
|
12
|
+
ActiveRecord::Migration.verbose = false
|
13
|
+
ActiveRecord::Base.logger = Logger.new(nil)
|
14
|
+
|
15
|
+
ActiveRecord::Schema.define(:version => 1) do
|
16
|
+
create_table :users do |t|
|
17
|
+
t.database_authenticatable :null => true
|
18
|
+
t.string :username
|
19
|
+
t.confirmable
|
20
|
+
t.invitable
|
21
|
+
t.encryptable
|
22
|
+
|
23
|
+
t.timestamps
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
ActiveSupport::Deprecation.silenced = true
|
28
|
+
|
29
|
+
class ActionDispatch::IntegrationTest
|
30
|
+
include Capybara
|
31
|
+
end
|
metadata
ADDED
@@ -0,0 +1,222 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: aihs_devise_invitable
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 7712090
|
5
|
+
prerelease: true
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 4
|
9
|
+
- rc
|
10
|
+
version: 0.4.rc
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Sergio Cambra
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-11-11 00:00:00 -07:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: mocha
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 43
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
- 9
|
33
|
+
- 8
|
34
|
+
version: 0.9.8
|
35
|
+
type: :development
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: capybara
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 1
|
46
|
+
segments:
|
47
|
+
- 0
|
48
|
+
- 3
|
49
|
+
- 9
|
50
|
+
version: 0.3.9
|
51
|
+
type: :development
|
52
|
+
version_requirements: *id002
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: rails
|
55
|
+
prerelease: false
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
hash: 7
|
62
|
+
segments:
|
63
|
+
- 3
|
64
|
+
- 0
|
65
|
+
- 0
|
66
|
+
version: 3.0.0
|
67
|
+
type: :development
|
68
|
+
version_requirements: *id003
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: sqlite3-ruby
|
71
|
+
prerelease: false
|
72
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
hash: 3
|
78
|
+
segments:
|
79
|
+
- 0
|
80
|
+
version: "0"
|
81
|
+
type: :development
|
82
|
+
version_requirements: *id004
|
83
|
+
description: It adds support for send invitations by email (it requires to be authenticated) and accept the invitation setting the password
|
84
|
+
email: sergio@entrecables.com
|
85
|
+
executables: []
|
86
|
+
|
87
|
+
extensions: []
|
88
|
+
|
89
|
+
extra_rdoc_files:
|
90
|
+
- LICENSE
|
91
|
+
- README.rdoc
|
92
|
+
files:
|
93
|
+
- .document
|
94
|
+
- .gitignore
|
95
|
+
- Gemfile
|
96
|
+
- Gemfile.lock
|
97
|
+
- LICENSE
|
98
|
+
- README.rdoc
|
99
|
+
- Rakefile
|
100
|
+
- app/controllers/devise/invitations_controller.rb
|
101
|
+
- app/views/devise/invitations/edit.html.erb
|
102
|
+
- app/views/devise/invitations/new.html.erb
|
103
|
+
- app/views/devise/mailer/invitation.html.erb
|
104
|
+
- app/views/devise/mailer/invitation_instructions.html.erb
|
105
|
+
- config/locales/en.yml
|
106
|
+
- devise_invitable.gemspec
|
107
|
+
- lib/devise_invitable.rb
|
108
|
+
- lib/devise_invitable/controllers/helpers.rb
|
109
|
+
- lib/devise_invitable/controllers/url_helpers.rb
|
110
|
+
- lib/devise_invitable/mailer.rb
|
111
|
+
- lib/devise_invitable/model.rb
|
112
|
+
- lib/devise_invitable/rails.rb
|
113
|
+
- lib/devise_invitable/routes.rb
|
114
|
+
- lib/devise_invitable/schema.rb
|
115
|
+
- lib/devise_invitable/version.rb
|
116
|
+
- lib/generators/active_record/devise_invitable_generator.rb
|
117
|
+
- lib/generators/active_record/templates/migration.rb
|
118
|
+
- lib/generators/devise_invitable/devise_invitable_generator.rb
|
119
|
+
- lib/generators/devise_invitable/install_generator.rb
|
120
|
+
- lib/generators/devise_invitable/views_generator.rb
|
121
|
+
- test/generators_test.rb
|
122
|
+
- test/integration/invitation_test.rb
|
123
|
+
- test/integration_tests_helper.rb
|
124
|
+
- test/mailers/invitation_mail_test.rb
|
125
|
+
- test/model_tests_helper.rb
|
126
|
+
- test/models/invitable_test.rb
|
127
|
+
- test/models_test.rb
|
128
|
+
- test/rails_app/app/controllers/admins_controller.rb
|
129
|
+
- test/rails_app/app/controllers/application_controller.rb
|
130
|
+
- test/rails_app/app/controllers/home_controller.rb
|
131
|
+
- test/rails_app/app/controllers/users_controller.rb
|
132
|
+
- test/rails_app/app/helpers/application_helper.rb
|
133
|
+
- test/rails_app/app/models/octopussy.rb
|
134
|
+
- test/rails_app/app/models/user.rb
|
135
|
+
- test/rails_app/app/views/home/index.html.erb
|
136
|
+
- test/rails_app/app/views/layouts/application.html.erb
|
137
|
+
- test/rails_app/app/views/users/invitations/new.html.erb
|
138
|
+
- test/rails_app/config.ru
|
139
|
+
- test/rails_app/config/application.rb
|
140
|
+
- test/rails_app/config/boot.rb
|
141
|
+
- test/rails_app/config/database.yml
|
142
|
+
- test/rails_app/config/environment.rb
|
143
|
+
- test/rails_app/config/environments/development.rb
|
144
|
+
- test/rails_app/config/environments/production.rb
|
145
|
+
- test/rails_app/config/environments/test.rb
|
146
|
+
- test/rails_app/config/initializers/backtrace_silencers.rb
|
147
|
+
- test/rails_app/config/initializers/devise.rb
|
148
|
+
- test/rails_app/config/initializers/inflections.rb
|
149
|
+
- test/rails_app/config/initializers/mime_types.rb
|
150
|
+
- test/rails_app/config/initializers/secret_token.rb
|
151
|
+
- test/rails_app/config/initializers/session_store.rb
|
152
|
+
- test/rails_app/config/locales/en.yml
|
153
|
+
- test/rails_app/config/routes.rb
|
154
|
+
- test/rails_app/script/rails
|
155
|
+
- test/routes_test.rb
|
156
|
+
- test/test_helper.rb
|
157
|
+
has_rdoc: true
|
158
|
+
homepage: http://github.com/scambra/devise_invitable
|
159
|
+
licenses: []
|
160
|
+
|
161
|
+
post_install_message:
|
162
|
+
rdoc_options:
|
163
|
+
- --charset=UTF-8
|
164
|
+
require_paths:
|
165
|
+
- lib
|
166
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
167
|
+
none: false
|
168
|
+
requirements:
|
169
|
+
- - ">="
|
170
|
+
- !ruby/object:Gem::Version
|
171
|
+
hash: 3
|
172
|
+
segments:
|
173
|
+
- 0
|
174
|
+
version: "0"
|
175
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
176
|
+
none: false
|
177
|
+
requirements:
|
178
|
+
- - ">"
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
hash: 25
|
181
|
+
segments:
|
182
|
+
- 1
|
183
|
+
- 3
|
184
|
+
- 1
|
185
|
+
version: 1.3.1
|
186
|
+
requirements: []
|
187
|
+
|
188
|
+
rubyforge_project:
|
189
|
+
rubygems_version: 1.3.7
|
190
|
+
signing_key:
|
191
|
+
specification_version: 3
|
192
|
+
summary: An invitation strategy for devise
|
193
|
+
test_files:
|
194
|
+
- test/generators_test.rb
|
195
|
+
- test/integration/invitation_test.rb
|
196
|
+
- test/integration_tests_helper.rb
|
197
|
+
- test/mailers/invitation_mail_test.rb
|
198
|
+
- test/model_tests_helper.rb
|
199
|
+
- test/models/invitable_test.rb
|
200
|
+
- test/models_test.rb
|
201
|
+
- test/rails_app/app/controllers/admins_controller.rb
|
202
|
+
- test/rails_app/app/controllers/application_controller.rb
|
203
|
+
- test/rails_app/app/controllers/home_controller.rb
|
204
|
+
- test/rails_app/app/controllers/users_controller.rb
|
205
|
+
- test/rails_app/app/helpers/application_helper.rb
|
206
|
+
- test/rails_app/app/models/octopussy.rb
|
207
|
+
- test/rails_app/app/models/user.rb
|
208
|
+
- test/rails_app/config/application.rb
|
209
|
+
- test/rails_app/config/boot.rb
|
210
|
+
- test/rails_app/config/environment.rb
|
211
|
+
- test/rails_app/config/environments/development.rb
|
212
|
+
- test/rails_app/config/environments/production.rb
|
213
|
+
- test/rails_app/config/environments/test.rb
|
214
|
+
- test/rails_app/config/initializers/backtrace_silencers.rb
|
215
|
+
- test/rails_app/config/initializers/devise.rb
|
216
|
+
- test/rails_app/config/initializers/inflections.rb
|
217
|
+
- test/rails_app/config/initializers/mime_types.rb
|
218
|
+
- test/rails_app/config/initializers/secret_token.rb
|
219
|
+
- test/rails_app/config/initializers/session_store.rb
|
220
|
+
- test/rails_app/config/routes.rb
|
221
|
+
- test/routes_test.rb
|
222
|
+
- test/test_helper.rb
|