clearance 0.9.0.rc2 → 0.9.0.rc3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of clearance might be problematic. Click here for more details.

Files changed (96) hide show
  1. data/Rakefile +55 -1
  2. data/VERSION +1 -0
  3. data/clearance.gemspec +208 -0
  4. data/cucumber.yml +4 -0
  5. data/lib/rails/generators/clearance_generator.rb +5 -1
  6. data/spec/rails_root/Gemfile +40 -0
  7. data/spec/rails_root/README +244 -0
  8. data/spec/rails_root/Rakefile +10 -0
  9. data/spec/rails_root/app/controllers/accounts_controller.rb +10 -0
  10. data/spec/rails_root/app/controllers/application_controller.rb +6 -0
  11. data/spec/rails_root/app/helpers/application_helper.rb +2 -0
  12. data/spec/rails_root/app/models/user.rb +3 -0
  13. data/spec/rails_root/app/views/accounts/edit.html.erb +0 -0
  14. data/spec/rails_root/app/views/layouts/application.html.erb +24 -0
  15. data/spec/rails_root/config.ru +4 -0
  16. data/spec/rails_root/config/application.rb +46 -0
  17. data/spec/rails_root/config/boot.rb +6 -0
  18. data/spec/rails_root/config/cucumber.yml +8 -0
  19. data/spec/rails_root/config/database.yml +25 -0
  20. data/spec/rails_root/config/environment.rb +7 -0
  21. data/spec/rails_root/config/environments/development.rb +19 -0
  22. data/spec/rails_root/config/environments/production.rb +42 -0
  23. data/spec/rails_root/config/environments/test.rb +32 -0
  24. data/spec/rails_root/config/initializers/backtrace_silencers.rb +7 -0
  25. data/spec/rails_root/config/initializers/clearance.rb +3 -0
  26. data/spec/rails_root/config/initializers/inflections.rb +10 -0
  27. data/spec/rails_root/config/initializers/mime_types.rb +5 -0
  28. data/spec/rails_root/config/initializers/secret_token.rb +7 -0
  29. data/spec/rails_root/config/initializers/session_store.rb +8 -0
  30. data/spec/rails_root/config/locales/en.yml +5 -0
  31. data/spec/rails_root/config/routes.rb +61 -0
  32. data/spec/rails_root/db/schema.rb +28 -0
  33. data/spec/rails_root/doc/README_FOR_APP +2 -0
  34. data/spec/rails_root/features/password_reset.feature +33 -0
  35. data/spec/rails_root/features/sign_in.feature +35 -0
  36. data/spec/rails_root/features/sign_out.feature +15 -0
  37. data/spec/rails_root/features/sign_up.feature +45 -0
  38. data/spec/rails_root/features/step_definitions/clearance_steps.rb +130 -0
  39. data/spec/rails_root/features/step_definitions/web_steps.rb +219 -0
  40. data/spec/rails_root/features/support/env.rb +57 -0
  41. data/spec/rails_root/features/support/paths.rb +45 -0
  42. data/spec/rails_root/lib/tasks/cucumber.rake +53 -0
  43. data/spec/rails_root/public/404.html +26 -0
  44. data/spec/rails_root/public/422.html +26 -0
  45. data/spec/rails_root/public/500.html +26 -0
  46. data/spec/rails_root/public/favicon.ico +0 -0
  47. data/spec/rails_root/public/images/rails.png +0 -0
  48. data/spec/rails_root/public/javascripts/application.js +2 -0
  49. data/spec/rails_root/public/javascripts/controls.js +965 -0
  50. data/spec/rails_root/public/javascripts/dragdrop.js +974 -0
  51. data/spec/rails_root/public/javascripts/effects.js +1123 -0
  52. data/spec/rails_root/public/javascripts/prototype.js +4874 -0
  53. data/spec/rails_root/public/javascripts/rails.js +118 -0
  54. data/spec/rails_root/public/robots.txt +5 -0
  55. data/spec/rails_root/script/cucumber +10 -0
  56. data/spec/rails_root/script/rails +9 -0
  57. data/spec/rails_root/spec/factories/clearance.rb +13 -0
  58. data/spec/rails_root/vendor/plugins/dynamic_form/MIT-LICENSE +20 -0
  59. data/spec/rails_root/vendor/plugins/dynamic_form/README +13 -0
  60. data/spec/rails_root/vendor/plugins/dynamic_form/Rakefile +10 -0
  61. data/spec/rails_root/vendor/plugins/dynamic_form/init.rb +5 -0
  62. data/spec/rails_root/vendor/plugins/dynamic_form/lib/action_view/helpers/dynamic_form.rb +300 -0
  63. data/spec/rails_root/vendor/plugins/dynamic_form/lib/action_view/locale/en.yml +8 -0
  64. data/spec/rails_root/vendor/plugins/dynamic_form/test/dynamic_form_i18n_test.rb +42 -0
  65. data/spec/rails_root/vendor/plugins/dynamic_form/test/dynamic_form_test.rb +370 -0
  66. data/spec/rails_root/vendor/plugins/dynamic_form/test/test_helper.rb +9 -0
  67. data/test/rails_root/Gemfile +40 -0
  68. data/test/rails_root/README +244 -0
  69. data/test/rails_root/Rakefile +10 -0
  70. data/test/rails_root/app/views/accounts/edit.html.erb +0 -0
  71. data/test/rails_root/app/views/layouts/application.html.erb +24 -0
  72. data/test/rails_root/config.ru +4 -0
  73. data/test/rails_root/config/cucumber.yml +8 -0
  74. data/test/rails_root/config/database.yml +25 -0
  75. data/test/rails_root/config/locales/en.yml +5 -0
  76. data/test/rails_root/doc/README_FOR_APP +2 -0
  77. data/test/rails_root/lib/tasks/cucumber.rake +53 -0
  78. data/test/rails_root/public/404.html +26 -0
  79. data/test/rails_root/public/422.html +26 -0
  80. data/test/rails_root/public/500.html +26 -0
  81. data/test/rails_root/public/favicon.ico +0 -0
  82. data/test/rails_root/public/images/rails.png +0 -0
  83. data/test/rails_root/public/javascripts/application.js +2 -0
  84. data/test/rails_root/public/javascripts/controls.js +965 -0
  85. data/test/rails_root/public/javascripts/dragdrop.js +974 -0
  86. data/test/rails_root/public/javascripts/effects.js +1123 -0
  87. data/test/rails_root/public/javascripts/prototype.js +4874 -0
  88. data/test/rails_root/public/javascripts/rails.js +118 -0
  89. data/test/rails_root/public/robots.txt +5 -0
  90. data/test/rails_root/script/cucumber +10 -0
  91. data/test/rails_root/script/rails +9 -0
  92. data/test/rails_root/vendor/plugins/dynamic_form/MIT-LICENSE +20 -0
  93. data/test/rails_root/vendor/plugins/dynamic_form/README +13 -0
  94. data/test/rails_root/vendor/plugins/dynamic_form/Rakefile +10 -0
  95. data/test/rails_root/vendor/plugins/dynamic_form/lib/action_view/locale/en.yml +8 -0
  96. metadata +111 -47
data/Rakefile CHANGED
@@ -5,6 +5,7 @@ ENV['BUNDLE_GEMFILE'] = File.dirname(__FILE__) + '/test/rails_root/Gemfile'
5
5
  require 'rake'
6
6
  require 'rake/testtask'
7
7
  require 'cucumber/rake/task'
8
+ require 'spec/rake/spectask'
8
9
 
9
10
  namespace :test do
10
11
  Rake::TestTask.new(:basic => ["generator:cleanup",
@@ -41,6 +42,57 @@ namespace :test do
41
42
  end
42
43
  end
43
44
 
45
+ namespace :spec do
46
+ Spec::Rake::SpecTask.new(:basic => %w(spec:generator:cleanup spec:generator:clearance)) do |task|
47
+ task.spec_files = FileList['spec/*/*_spec.rb']
48
+ end
49
+
50
+ Spec::Rake::SpecTask.new(:views => %w(spec:generator:cleanup spec:generator:clearance spec:generator:clearance_views)) do |task|
51
+ task.spec_files = FileList['spec/*/*_spec.rb']
52
+ end
53
+
54
+ Cucumber::Rake::Task.new(:features => %w(spec:generator:cleanup spec:generator:clearance spec:generator:clearance_features)) do |task|
55
+ task.cucumber_opts = '--format progress'
56
+ task.profile = 'features_with_rspec'
57
+ end
58
+
59
+ Cucumber::Rake::Task.new(:features_for_views => %w(spec:generator:cleanup spec:generator:clearance spec:generator:clearance_features spec:generator:clearance_views)) do |task|
60
+ task.cucumber_opts = '--format progress'
61
+ task.profile = 'features_for_views_with_rspec'
62
+ end
63
+
64
+ namespace :generator do
65
+ task :cleanup do
66
+ FileList["spec/rails_root/db/**/*"].each do |each|
67
+ FileUtils.rm_rf(each)
68
+ end
69
+
70
+ FileUtils.rm_rf("spec/rails_root/vendor/plugins/clearance")
71
+ FileUtils.rm_rf("spec/rails_root/app/views/passwords")
72
+ FileUtils.rm_rf("spec/rails_root/app/views/sessions")
73
+ FileUtils.rm_rf("spec/rails_root/app/views/users")
74
+ FileUtils.mkdir_p("spec/rails_root/vendor/plugins")
75
+ clearance_root = File.expand_path(File.dirname(__FILE__))
76
+ system("ln -s #{clearance_root} spec/rails_root/vendor/plugins/clearance")
77
+ FileList["spec/rails_root/features/*.feature"].each do |each|
78
+ FileUtils.rm_rf(each)
79
+ end
80
+ end
81
+
82
+ task :clearance do
83
+ system "cd spec/rails_root && bundle install && ./script/rails generate clearance && rake db:migrate db:test:prepare"
84
+ end
85
+
86
+ task :clearance_features do
87
+ system "cd spec/rails_root && ./script/rails generate clearance_features"
88
+ end
89
+
90
+ task :clearance_views do
91
+ system "cd spec/rails_root && ./script/rails generate clearance_views"
92
+ end
93
+ end
94
+ end
95
+
44
96
  namespace :generator do
45
97
  desc "Cleans up the test app before running the generator"
46
98
  task :cleanup do
@@ -78,4 +130,6 @@ end
78
130
 
79
131
  desc "Run the test suite"
80
132
  task :default => ['test:basic', 'test:features',
81
- 'test:views', 'test:features_for_views']
133
+ 'test:views', 'test:features_for_views',
134
+ 'spec:basic', 'spec:features',
135
+ 'spec:views', 'spec:features_for_views']
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.9.0.rc3
data/clearance.gemspec ADDED
@@ -0,0 +1,208 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = %q{clearance}
3
+ s.version = IO.read(File.join(File.dirname(__FILE__), 'VERSION'))
4
+
5
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
6
+ s.authors = ["Dan Croak", "Mike Burns", "Jason Morrison", "Joe Ferris", "Eugene Bolshakov", "Nick Quaranto", "Josh Nichols", "Mike Breen", "Marcel G\303\266rner", "Bence Nagy", "Ben Mabey", "Eloy Duran", "Tim Pope", "Mihai Anca", "Mark Cornick", "Shay Arnett", "Jon Yurek", "Chad Pytel"]
7
+ s.date = %q{2010-06-29}
8
+ s.summary = %q{Rails authentication with email & password.}
9
+ s.description = %q{Rails authentication with email & password.}
10
+ s.email = %q{support@thoughtbot.com}
11
+ s.extra_rdoc_files = [
12
+ "LICENSE",
13
+ "README.md"
14
+ ]
15
+ s.files = [
16
+ "CHANGELOG.md",
17
+ "LICENSE",
18
+ "README.md",
19
+ "Rakefile",
20
+ "VERSION",
21
+ "app/controllers/clearance/confirmations_controller.rb",
22
+ "app/controllers/clearance/passwords_controller.rb",
23
+ "app/controllers/clearance/sessions_controller.rb",
24
+ "app/controllers/clearance/users_controller.rb",
25
+ "app/models/clearance_mailer.rb",
26
+ "app/views/clearance_mailer/change_password.html.erb",
27
+ "app/views/clearance_mailer/confirmation.html.erb",
28
+ "app/views/passwords/edit.html.erb",
29
+ "app/views/passwords/new.html.erb",
30
+ "app/views/sessions/new.html.erb",
31
+ "app/views/users/_form.html.erb",
32
+ "app/views/users/new.html.erb",
33
+ "clearance.gemspec",
34
+ "config/routes.rb",
35
+ "cucumber.yml",
36
+ "lib/clearance.rb",
37
+ "lib/clearance/authentication.rb",
38
+ "lib/clearance/configuration.rb",
39
+ "lib/clearance/engine.rb",
40
+ "lib/clearance/extensions/errors.rb",
41
+ "lib/clearance/extensions/rescue.rb",
42
+ "lib/clearance/user.rb",
43
+ "lib/rails/generators/clearance_features_generator.rb",
44
+ "lib/rails/generators/clearance_features_templates/features/password_reset.feature",
45
+ "lib/rails/generators/clearance_features_templates/features/sign_in.feature",
46
+ "lib/rails/generators/clearance_features_templates/features/sign_out.feature",
47
+ "lib/rails/generators/clearance_features_templates/features/sign_up.feature",
48
+ "lib/rails/generators/clearance_features_templates/features/step_definitions/clearance_steps.rb",
49
+ "lib/rails/generators/clearance_generator.rb",
50
+ "lib/rails/generators/clearance_templates/README",
51
+ "lib/rails/generators/clearance_templates/clearance.rb",
52
+ "lib/rails/generators/clearance_templates/factories.rb",
53
+ "lib/rails/generators/clearance_templates/migrations/create_users.rb",
54
+ "lib/rails/generators/clearance_templates/migrations/update_users.rb",
55
+ "lib/rails/generators/clearance_templates/user.rb",
56
+ "lib/rails/generators/clearance_views_generator.rb",
57
+ "lib/rails/generators/clearance_views_templates/formtastic/erb/passwords/edit.html.erb",
58
+ "lib/rails/generators/clearance_views_templates/formtastic/erb/passwords/new.html.erb",
59
+ "lib/rails/generators/clearance_views_templates/formtastic/erb/sessions/new.html.erb",
60
+ "lib/rails/generators/clearance_views_templates/formtastic/erb/users/_inputs.html.erb",
61
+ "lib/rails/generators/clearance_views_templates/formtastic/erb/users/new.html.erb",
62
+ "rails/init.rb",
63
+ "shoulda_macros/clearance.rb"
64
+ ]
65
+
66
+ s.homepage = %q{http://github.com/thoughtbot/clearance}
67
+ s.rdoc_options = ["--charset=UTF-8"]
68
+ s.require_paths = ["lib"]
69
+ s.rubygems_version = %q{1.3.7}
70
+ s.test_files = [
71
+ "spec/rails_root/Gemfile",
72
+ "spec/rails_root/README",
73
+ "spec/rails_root/Rakefile",
74
+ "spec/rails_root/app/controllers/accounts_controller.rb",
75
+ "spec/rails_root/app/controllers/application_controller.rb",
76
+ "spec/rails_root/app/helpers/application_helper.rb",
77
+ "spec/rails_root/app/models/user.rb",
78
+ "spec/rails_root/app/views/accounts/edit.html.erb",
79
+ "spec/rails_root/app/views/layouts/application.html.erb",
80
+ "spec/rails_root/config.ru",
81
+ "spec/rails_root/config/application.rb",
82
+ "spec/rails_root/config/boot.rb",
83
+ "spec/rails_root/config/cucumber.yml",
84
+ "spec/rails_root/config/database.yml",
85
+ "spec/rails_root/config/environment.rb",
86
+ "spec/rails_root/config/environments/development.rb",
87
+ "spec/rails_root/config/environments/production.rb",
88
+ "spec/rails_root/config/environments/test.rb",
89
+ "spec/rails_root/config/initializers/backtrace_silencers.rb",
90
+ "spec/rails_root/config/initializers/clearance.rb",
91
+ "spec/rails_root/config/initializers/inflections.rb",
92
+ "spec/rails_root/config/initializers/mime_types.rb",
93
+ "spec/rails_root/config/initializers/secret_token.rb",
94
+ "spec/rails_root/config/initializers/session_store.rb",
95
+ "spec/rails_root/config/locales/en.yml",
96
+ "spec/rails_root/config/routes.rb",
97
+ "spec/rails_root/db/schema.rb",
98
+ "spec/rails_root/doc/README_FOR_APP",
99
+ "spec/rails_root/features/password_reset.feature",
100
+ "spec/rails_root/features/sign_in.feature",
101
+ "spec/rails_root/features/sign_out.feature",
102
+ "spec/rails_root/features/sign_up.feature",
103
+ "spec/rails_root/features/step_definitions/clearance_steps.rb",
104
+ "spec/rails_root/features/step_definitions/web_steps.rb",
105
+ "spec/rails_root/features/support/env.rb",
106
+ "spec/rails_root/features/support/paths.rb",
107
+ "spec/rails_root/lib/tasks/cucumber.rake",
108
+ "spec/rails_root/public/404.html",
109
+ "spec/rails_root/public/422.html",
110
+ "spec/rails_root/public/500.html",
111
+ "spec/rails_root/public/favicon.ico",
112
+ "spec/rails_root/public/images/rails.png",
113
+ "spec/rails_root/public/javascripts/application.js",
114
+ "spec/rails_root/public/javascripts/controls.js",
115
+ "spec/rails_root/public/javascripts/dragdrop.js",
116
+ "spec/rails_root/public/javascripts/effects.js",
117
+ "spec/rails_root/public/javascripts/prototype.js",
118
+ "spec/rails_root/public/javascripts/rails.js",
119
+ "spec/rails_root/public/robots.txt",
120
+ "spec/rails_root/script/cucumber",
121
+ "spec/rails_root/script/rails",
122
+ "spec/rails_root/spec/factories/clearance.rb",
123
+ "spec/rails_root/vendor/plugins/clearance",
124
+ "spec/rails_root/vendor/plugins/dynamic_form/MIT-LICENSE",
125
+ "spec/rails_root/vendor/plugins/dynamic_form/README",
126
+ "spec/rails_root/vendor/plugins/dynamic_form/Rakefile",
127
+ "spec/rails_root/vendor/plugins/dynamic_form/init.rb",
128
+ "spec/rails_root/vendor/plugins/dynamic_form/lib/action_view/helpers/dynamic_form.rb",
129
+ "spec/rails_root/vendor/plugins/dynamic_form/lib/action_view/locale/en.yml",
130
+ "spec/rails_root/vendor/plugins/dynamic_form/test/dynamic_form_i18n_test.rb",
131
+ "spec/rails_root/vendor/plugins/dynamic_form/test/dynamic_form_test.rb",
132
+ "spec/rails_root/vendor/plugins/dynamic_form/test/test_helper.rb",
133
+ "test/controllers/confirmations_controller_test.rb",
134
+ "test/controllers/passwords_controller_test.rb",
135
+ "test/controllers/sessions_controller_test.rb",
136
+ "test/controllers/users_controller_test.rb",
137
+ "test/models/clearance_mailer_test.rb",
138
+ "test/models/user_test.rb",
139
+ "test/rails_root/Gemfile",
140
+ "test/rails_root/README",
141
+ "test/rails_root/Rakefile",
142
+ "test/rails_root/app/controllers/accounts_controller.rb",
143
+ "test/rails_root/app/controllers/application_controller.rb",
144
+ "test/rails_root/app/helpers/application_helper.rb",
145
+ "test/rails_root/app/models/user.rb",
146
+ "test/rails_root/app/views/accounts/edit.html.erb",
147
+ "test/rails_root/app/views/layouts/application.html.erb",
148
+ "test/rails_root/config.ru",
149
+ "test/rails_root/config/application.rb",
150
+ "test/rails_root/config/boot.rb",
151
+ "test/rails_root/config/cucumber.yml",
152
+ "test/rails_root/config/database.yml",
153
+ "test/rails_root/config/environment.rb",
154
+ "test/rails_root/config/environments/development.rb",
155
+ "test/rails_root/config/environments/production.rb",
156
+ "test/rails_root/config/environments/test.rb",
157
+ "test/rails_root/config/initializers/backtrace_silencers.rb",
158
+ "test/rails_root/config/initializers/clearance.rb",
159
+ "test/rails_root/config/initializers/inflections.rb",
160
+ "test/rails_root/config/initializers/mime_types.rb",
161
+ "test/rails_root/config/initializers/secret_token.rb",
162
+ "test/rails_root/config/initializers/session_store.rb",
163
+ "test/rails_root/config/locales/en.yml",
164
+ "test/rails_root/config/routes.rb",
165
+ "test/rails_root/doc/README_FOR_APP",
166
+ "test/rails_root/features/step_definitions/web_steps.rb",
167
+ "test/rails_root/features/support/env.rb",
168
+ "test/rails_root/features/support/paths.rb",
169
+ "test/rails_root/lib/tasks/cucumber.rake",
170
+ "test/rails_root/public/404.html",
171
+ "test/rails_root/public/422.html",
172
+ "test/rails_root/public/500.html",
173
+ "test/rails_root/public/favicon.ico",
174
+ "test/rails_root/public/images/rails.png",
175
+ "test/rails_root/public/javascripts/application.js",
176
+ "test/rails_root/public/javascripts/controls.js",
177
+ "test/rails_root/public/javascripts/dragdrop.js",
178
+ "test/rails_root/public/javascripts/effects.js",
179
+ "test/rails_root/public/javascripts/prototype.js",
180
+ "test/rails_root/public/javascripts/rails.js",
181
+ "test/rails_root/public/robots.txt",
182
+ "test/rails_root/script/cucumber",
183
+ "test/rails_root/script/rails",
184
+ "test/rails_root/test/factories/clearance.rb",
185
+ "test/rails_root/test/functional/accounts_controller_test.rb",
186
+ "test/rails_root/test/performance/browsing_test.rb",
187
+ "test/rails_root/test/test_helper.rb",
188
+ "test/rails_root/vendor/plugins/dynamic_form/MIT-LICENSE",
189
+ "test/rails_root/vendor/plugins/dynamic_form/README",
190
+ "test/rails_root/vendor/plugins/dynamic_form/Rakefile",
191
+ "test/rails_root/vendor/plugins/dynamic_form/init.rb",
192
+ "test/rails_root/vendor/plugins/dynamic_form/lib/action_view/helpers/dynamic_form.rb",
193
+ "test/rails_root/vendor/plugins/dynamic_form/lib/action_view/locale/en.yml",
194
+ "test/rails_root/vendor/plugins/dynamic_form/test/dynamic_form_i18n_test.rb",
195
+ "test/rails_root/vendor/plugins/dynamic_form/test/dynamic_form_test.rb",
196
+ "test/rails_root/vendor/plugins/dynamic_form/test/test_helper.rb",
197
+ "test/test_helper.rb"
198
+ ]
199
+
200
+ s.add_dependency('rails', '~>3.0.0.beta4')
201
+ s.add_development_dependency('rspec', [">= 1.3.0"])
202
+
203
+ if s.respond_to? :specification_version then
204
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
205
+ s.specification_version = 3
206
+ end
207
+ end
208
+
data/cucumber.yml ADDED
@@ -0,0 +1,4 @@
1
+ features: test/rails_root/features
2
+ features_with_rspec: spec/rails_root/features
3
+ features_for_views: test/rails_root/features
4
+ features_for_views_with_rspec: spec/rails_root/features
@@ -25,7 +25,11 @@ class ClearanceGenerator < ActiveRecord::Generators::Base
25
25
  template "user.rb", user_model
26
26
  end
27
27
 
28
- template "factories.rb", "test/factories/clearance.rb"
28
+ if File.exists?("spec")
29
+ template "factories.rb", "spec/factories/clearance.rb"
30
+ else
31
+ template "factories.rb", "test/factories/clearance.rb"
32
+ end
29
33
 
30
34
  migration_template "migrations/#{migration_source_name}.rb",
31
35
  "db/migrate/clearance_#{migration_target_name}"
@@ -0,0 +1,40 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'rails', '3.0.0.beta4'
4
+
5
+ # Bundle edge Rails instead:
6
+ # gem 'rails', :git => 'git://github.com/rails/rails.git'
7
+
8
+ gem 'sqlite3-ruby', :require => 'sqlite3'
9
+
10
+ gem 'mocha'
11
+
12
+ gem 'formtastic', "1.0.0.beta", :git => "git://github.com/justinfrench/formtastic.git", :branch => "rails3"
13
+
14
+ gem 'shoulda', '>= 2.11', :git => "git://github.com/thoughtbot/shoulda.git"
15
+ gem 'factory_girl_rails'
16
+ gem 'nokogiri', '1.4.1'
17
+
18
+ gem 'capybara'
19
+ gem 'database_cleaner'
20
+ gem 'cucumber-rails', '0.3.2'
21
+ gem 'cucumber', '0.8.0'
22
+ gem 'launchy'
23
+
24
+ # Use unicorn as the web server
25
+ # gem 'unicorn'
26
+
27
+ # Deploy with Capistrano
28
+ # gem 'capistrano'
29
+
30
+ # Bundle the extra gems:
31
+ # gem 'bj'
32
+ # gem 'nokogiri', '1.4.1'
33
+ # gem 'sqlite3-ruby', :require => 'sqlite3'
34
+ # gem 'aws-s3', :require => 'aws/s3'
35
+
36
+ # Bundle gems for certain environments:
37
+ # gem 'rspec', :group => :test
38
+ # group :test do
39
+ # gem 'webrat'
40
+ # end
@@ -0,0 +1,244 @@
1
+ == Welcome to Rails
2
+
3
+ Rails is a web-application framework that includes everything needed to create
4
+ database-backed web applications according to the Model-View-Control pattern.
5
+
6
+ This pattern splits the view (also called the presentation) into "dumb" templates
7
+ that are primarily responsible for inserting pre-built data in between HTML tags.
8
+ The model contains the "smart" domain objects (such as Account, Product, Person,
9
+ Post) that holds all the business logic and knows how to persist themselves to
10
+ a database. The controller handles the incoming requests (such as Save New Account,
11
+ Update Product, Show Post) by manipulating the model and directing data to the view.
12
+
13
+ In Rails, the model is handled by what's called an object-relational mapping
14
+ layer entitled Active Record. This layer allows you to present the data from
15
+ database rows as objects and embellish these data objects with business logic
16
+ methods. You can read more about Active Record in
17
+ link:files/vendor/rails/activerecord/README.html.
18
+
19
+ The controller and view are handled by the Action Pack, which handles both
20
+ layers by its two parts: Action View and Action Controller. These two layers
21
+ are bundled in a single package due to their heavy interdependence. This is
22
+ unlike the relationship between the Active Record and Action Pack that is much
23
+ more separate. Each of these packages can be used independently outside of
24
+ Rails. You can read more about Action Pack in
25
+ link:files/vendor/rails/actionpack/README.html.
26
+
27
+
28
+ == Getting Started
29
+
30
+ 1. At the command prompt, start a new Rails application using the <tt>rails</tt> command
31
+ and your application name. Ex: rails myapp
32
+ 2. Change directory into myapp and start the web server: <tt>rails server</tt> (run with --help for options)
33
+ 3. Go to http://localhost:3000/ and get "Welcome aboard: You're riding the Rails!"
34
+ 4. Follow the guidelines to start developing your application
35
+
36
+
37
+ == Web Servers
38
+
39
+ By default, Rails will try to use Mongrel if it's installed when started with <tt>rails server</tt>, otherwise
40
+ Rails will use WEBrick, the webserver that ships with Ruby. But you can also use Rails
41
+ with a variety of other web servers.
42
+
43
+ Mongrel is a Ruby-based webserver with a C component (which requires compilation) that is
44
+ suitable for development and deployment of Rails applications. If you have Ruby Gems installed,
45
+ getting up and running with mongrel is as easy as: <tt>gem install mongrel</tt>.
46
+ More info at: http://mongrel.rubyforge.org
47
+
48
+ Say other Ruby web servers like Thin and Ebb or regular web servers like Apache or LiteSpeed or
49
+ Lighttpd or IIS. The Ruby web servers are run through Rack and the latter can either be setup to use
50
+ FCGI or proxy to a pack of Mongrels/Thin/Ebb servers.
51
+
52
+ == Apache .htaccess example for FCGI/CGI
53
+
54
+ # General Apache options
55
+ AddHandler fastcgi-script .fcgi
56
+ AddHandler cgi-script .cgi
57
+ Options +FollowSymLinks +ExecCGI
58
+
59
+ # If you don't want Rails to look in certain directories,
60
+ # use the following rewrite rules so that Apache won't rewrite certain requests
61
+ #
62
+ # Example:
63
+ # RewriteCond %{REQUEST_URI} ^/notrails.*
64
+ # RewriteRule .* - [L]
65
+
66
+ # Redirect all requests not available on the filesystem to Rails
67
+ # By default the cgi dispatcher is used which is very slow
68
+ #
69
+ # For better performance replace the dispatcher with the fastcgi one
70
+ #
71
+ # Example:
72
+ # RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
73
+ RewriteEngine On
74
+
75
+ # If your Rails application is accessed via an Alias directive,
76
+ # then you MUST also set the RewriteBase in this htaccess file.
77
+ #
78
+ # Example:
79
+ # Alias /myrailsapp /path/to/myrailsapp/public
80
+ # RewriteBase /myrailsapp
81
+
82
+ RewriteRule ^$ index.html [QSA]
83
+ RewriteRule ^([^.]+)$ $1.html [QSA]
84
+ RewriteCond %{REQUEST_FILENAME} !-f
85
+ RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
86
+
87
+ # In case Rails experiences terminal errors
88
+ # Instead of displaying this message you can supply a file here which will be rendered instead
89
+ #
90
+ # Example:
91
+ # ErrorDocument 500 /500.html
92
+
93
+ ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
94
+
95
+
96
+ == Debugging Rails
97
+
98
+ Sometimes your application goes wrong. Fortunately there are a lot of tools that
99
+ will help you debug it and get it back on the rails.
100
+
101
+ First area to check is the application log files. Have "tail -f" commands running
102
+ on the server.log and development.log. Rails will automatically display debugging
103
+ and runtime information to these files. Debugging info will also be shown in the
104
+ browser on requests from 127.0.0.1.
105
+
106
+ You can also log your own messages directly into the log file from your code using
107
+ the Ruby logger class from inside your controllers. Example:
108
+
109
+ class WeblogController < ActionController::Base
110
+ def destroy
111
+ @weblog = Weblog.find(params[:id])
112
+ @weblog.destroy
113
+ logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
114
+ end
115
+ end
116
+
117
+ The result will be a message in your log file along the lines of:
118
+
119
+ Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1
120
+
121
+ More information on how to use the logger is at http://www.ruby-doc.org/core/
122
+
123
+ Also, Ruby documentation can be found at http://www.ruby-lang.org/ including:
124
+
125
+ * The Learning Ruby (Pickaxe) Book: http://www.ruby-doc.org/docs/ProgrammingRuby/
126
+ * Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
127
+
128
+ These two online (and free) books will bring you up to speed on the Ruby language
129
+ and also on programming in general.
130
+
131
+
132
+ == Debugger
133
+
134
+ Debugger support is available through the debugger command when you start your Mongrel or
135
+ Webrick server with --debugger. This means that you can break out of execution at any point
136
+ in the code, investigate and change the model, AND then resume execution!
137
+ You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install ruby-debug'
138
+ Example:
139
+
140
+ class WeblogController < ActionController::Base
141
+ def index
142
+ @posts = Post.find(:all)
143
+ debugger
144
+ end
145
+ end
146
+
147
+ So the controller will accept the action, run the first line, then present you
148
+ with a IRB prompt in the server window. Here you can do things like:
149
+
150
+ >> @posts.inspect
151
+ => "[#<Post:0x14a6be8 @attributes={\"title\"=>nil, \"body\"=>nil, \"id\"=>\"1\"}>,
152
+ #<Post:0x14a6620 @attributes={\"title\"=>\"Rails you know!\", \"body\"=>\"Only ten..\", \"id\"=>\"2\"}>]"
153
+ >> @posts.first.title = "hello from a debugger"
154
+ => "hello from a debugger"
155
+
156
+ ...and even better is that you can examine how your runtime objects actually work:
157
+
158
+ >> f = @posts.first
159
+ => #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
160
+ >> f.
161
+ Display all 152 possibilities? (y or n)
162
+
163
+ Finally, when you're ready to resume execution, you enter "cont"
164
+
165
+
166
+ == Console
167
+
168
+ You can interact with the domain model by starting the console through <tt>rails console</tt>.
169
+ Here you'll have all parts of the application configured, just like it is when the
170
+ application is running. You can inspect domain models, change values, and save to the
171
+ database. Starting the script without arguments will launch it in the development environment.
172
+ Passing an argument will specify a different environment, like <tt>rails console production</tt>.
173
+
174
+ To reload your controllers and models after launching the console run <tt>reload!</tt>
175
+
176
+ == dbconsole
177
+
178
+ You can go to the command line of your database directly through <tt>rails dbconsole</tt>.
179
+ You would be connected to the database with the credentials defined in database.yml.
180
+ Starting the script without arguments will connect you to the development database. Passing an
181
+ argument will connect you to a different database, like <tt>rails dbconsole production</tt>.
182
+ Currently works for mysql, postgresql and sqlite.
183
+
184
+ == Description of Contents
185
+
186
+ app
187
+ Holds all the code that's specific to this particular application.
188
+
189
+ app/controllers
190
+ Holds controllers that should be named like weblogs_controller.rb for
191
+ automated URL mapping. All controllers should descend from ApplicationController
192
+ which itself descends from ActionController::Base.
193
+
194
+ app/models
195
+ Holds models that should be named like post.rb.
196
+ Most models will descend from ActiveRecord::Base.
197
+
198
+ app/views
199
+ Holds the template files for the view that should be named like
200
+ weblogs/index.html.erb for the WeblogsController#index action. All views use eRuby
201
+ syntax.
202
+
203
+ app/views/layouts
204
+ Holds the template files for layouts to be used with views. This models the common
205
+ header/footer method of wrapping views. In your views, define a layout using the
206
+ <tt>layout :default</tt> and create a file named default.html.erb. Inside default.html.erb,
207
+ call <% yield %> to render the view using this layout.
208
+
209
+ app/helpers
210
+ Holds view helpers that should be named like weblogs_helper.rb. These are generated
211
+ for you automatically when using rails generate for controllers. Helpers can be used to
212
+ wrap functionality for your views into methods.
213
+
214
+ config
215
+ Configuration files for the Rails environment, the routing map, the database, and other dependencies.
216
+
217
+ db
218
+ Contains the database schema in schema.rb. db/migrate contains all
219
+ the sequence of Migrations for your schema.
220
+
221
+ doc
222
+ This directory is where your application documentation will be stored when generated
223
+ using <tt>rake doc:app</tt>
224
+
225
+ lib
226
+ Application specific libraries. Basically, any kind of custom code that doesn't
227
+ belong under controllers, models, or helpers. This directory is in the load path.
228
+
229
+ public
230
+ The directory available for the web server. Contains subdirectories for images, stylesheets,
231
+ and javascripts. Also contains the dispatchers and the default HTML files. This should be
232
+ set as the DOCUMENT_ROOT of your web server.
233
+
234
+ script
235
+ Helper scripts for automation and generation.
236
+
237
+ test
238
+ Unit and functional tests along with fixtures. When using the rails generate command, template
239
+ test files will be generated for you and placed in this directory.
240
+
241
+ vendor
242
+ External libraries that the application depends on. Also includes the plugins subdirectory.
243
+ If the app has frozen rails, those gems also go here, under vendor/rails/.
244
+ This directory is in the load path.