ratchetio 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. data/.gitignore +1 -0
  2. data/CHANGELOG.md +6 -0
  3. data/README.md +2 -0
  4. data/Rakefile +7 -1
  5. data/lib/generators/ratchetio/ratchetio_generator.rb +1 -1
  6. data/lib/ratchetio/configuration.rb +9 -10
  7. data/lib/ratchetio/rails/controller_methods.rb +3 -3
  8. data/lib/ratchetio/rails/middleware/exception_catcher.rb +2 -4
  9. data/lib/ratchetio/version.rb +1 -1
  10. data/lib/ratchetio.rb +87 -60
  11. data/ratchetio.gemspec +16 -1
  12. data/spec/controllers/home_controller_spec.rb +41 -0
  13. data/spec/dummyapp/.gitignore +74 -0
  14. data/spec/dummyapp/Gemfile +19 -0
  15. data/spec/dummyapp/README +19 -0
  16. data/spec/dummyapp/README.textile +80 -0
  17. data/spec/dummyapp/Rakefile +7 -0
  18. data/spec/dummyapp/app/assets/javascripts/application.js +15 -0
  19. data/spec/dummyapp/app/assets/javascripts/home.js.coffee +3 -0
  20. data/spec/dummyapp/app/assets/stylesheets/application.css.scss +37 -0
  21. data/spec/dummyapp/app/assets/stylesheets/home.css.scss +3 -0
  22. data/spec/dummyapp/app/controllers/application_controller.rb +3 -0
  23. data/spec/dummyapp/app/controllers/home_controller.rb +21 -0
  24. data/spec/dummyapp/app/controllers/users_controller.rb +12 -0
  25. data/spec/dummyapp/app/helpers/application_helper.rb +2 -0
  26. data/spec/dummyapp/app/helpers/home_helper.rb +2 -0
  27. data/spec/dummyapp/app/mailers/.gitkeep +0 -0
  28. data/spec/dummyapp/app/models/.gitkeep +0 -0
  29. data/spec/dummyapp/app/models/user.rb +11 -0
  30. data/spec/dummyapp/app/views/devise/registrations/edit.html.erb +27 -0
  31. data/spec/dummyapp/app/views/devise/registrations/new.html.erb +20 -0
  32. data/spec/dummyapp/app/views/devise/shared/_links.html.erb +25 -0
  33. data/spec/dummyapp/app/views/home/cause_exception.html.erb +1 -0
  34. data/spec/dummyapp/app/views/home/index.html.erb +4 -0
  35. data/spec/dummyapp/app/views/home/report_exception.html.erb +1 -0
  36. data/spec/dummyapp/app/views/layouts/_messages.html.erb +5 -0
  37. data/spec/dummyapp/app/views/layouts/_navigation.html.erb +21 -0
  38. data/spec/dummyapp/app/views/layouts/application.html.erb +25 -0
  39. data/spec/dummyapp/app/views/users/index.html.erb +8 -0
  40. data/spec/dummyapp/app/views/users/show.html.erb +3 -0
  41. data/spec/dummyapp/config/application.rb +76 -0
  42. data/spec/dummyapp/config/boot.rb +6 -0
  43. data/spec/dummyapp/config/cucumber.yml +8 -0
  44. data/spec/dummyapp/config/environment.rb +5 -0
  45. data/spec/dummyapp/config/environments/development.rb +54 -0
  46. data/spec/dummyapp/config/environments/production.rb +87 -0
  47. data/spec/dummyapp/config/environments/test.rb +41 -0
  48. data/spec/dummyapp/config/initializers/backtrace_silencers.rb +7 -0
  49. data/spec/dummyapp/config/initializers/devise.rb +233 -0
  50. data/spec/dummyapp/config/initializers/generators.rb +2 -0
  51. data/spec/dummyapp/config/initializers/inflections.rb +15 -0
  52. data/spec/dummyapp/config/initializers/mime_types.rb +5 -0
  53. data/spec/dummyapp/config/initializers/ratchetio.rb +20 -0
  54. data/spec/dummyapp/config/initializers/secret_token.rb +7 -0
  55. data/spec/dummyapp/config/initializers/session_store.rb +8 -0
  56. data/spec/dummyapp/config/initializers/wrap_parameters.rb +14 -0
  57. data/spec/dummyapp/config/locales/devise.en.yml +58 -0
  58. data/spec/dummyapp/config/locales/en.yml +5 -0
  59. data/spec/dummyapp/config/routes.rb +11 -0
  60. data/spec/dummyapp/config.ru +4 -0
  61. data/spec/dummyapp/db/migrate/20121121184652_devise_create_users.rb +46 -0
  62. data/spec/dummyapp/db/migrate/20121121184654_add_name_to_users.rb +5 -0
  63. data/spec/dummyapp/db/schema.rb +35 -0
  64. data/spec/dummyapp/db/seeds.rb +12 -0
  65. data/spec/dummyapp/lib/assets/.gitkeep +0 -0
  66. data/spec/dummyapp/lib/tasks/.gitkeep +0 -0
  67. data/spec/dummyapp/lib/tasks/cucumber.rake +65 -0
  68. data/spec/dummyapp/public/404.html +26 -0
  69. data/spec/dummyapp/public/422.html +26 -0
  70. data/spec/dummyapp/public/500.html +25 -0
  71. data/spec/dummyapp/public/favicon.ico +0 -0
  72. data/spec/dummyapp/public/humans.txt +20 -0
  73. data/spec/dummyapp/public/robots.txt +5 -0
  74. data/spec/dummyapp/script/cucumber +10 -0
  75. data/spec/dummyapp/script/rails +6 -0
  76. data/spec/dummyapp/vendor/assets/javascripts/.gitkeep +0 -0
  77. data/spec/dummyapp/vendor/assets/stylesheets/.gitkeep +0 -0
  78. data/spec/dummyapp/vendor/plugins/.gitkeep +0 -0
  79. data/spec/ratchetio_spec.rb +233 -1
  80. data/spec/spec_helper.rb +36 -0
  81. data/spec/support/devise.rb +3 -0
  82. metadata +350 -3
@@ -0,0 +1,233 @@
1
+ require 'devise'
2
+ # Use this hook to configure devise mailer, warden hooks and so forth.
3
+ # Many of these configuration options can be set straight in your model.
4
+ Devise.setup do |config|
5
+ # ==> Mailer Configuration
6
+ # Configure the e-mail address which will be shown in Devise::Mailer,
7
+ # note that it will be overwritten if you use your own mailer class with default "from" parameter.
8
+ config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com"
9
+
10
+ # Configure the class responsible to send e-mails.
11
+ # config.mailer = "Devise::Mailer"
12
+
13
+ # ==> ORM configuration
14
+ # Load and configure the ORM. Supports :active_record (default) and
15
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
16
+ # available as additional gems.
17
+ require 'devise/orm/active_record'
18
+
19
+ # ==> Configuration for any authentication mechanism
20
+ # Configure which keys are used when authenticating a user. The default is
21
+ # just :email. You can configure it to use [:username, :subdomain], so for
22
+ # authenticating a user, both parameters are required. Remember that those
23
+ # parameters are used only when authenticating and not when retrieving from
24
+ # session. If you need permissions, you should implement that in a before filter.
25
+ # You can also supply a hash where the value is a boolean determining whether
26
+ # or not authentication should be aborted when the value is not present.
27
+ # config.authentication_keys = [ :email ]
28
+
29
+ # Configure parameters from the request object used for authentication. Each entry
30
+ # given should be a request method and it will automatically be passed to the
31
+ # find_for_authentication method and considered in your model lookup. For instance,
32
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
33
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
34
+ # config.request_keys = []
35
+
36
+ # Configure which authentication keys should be case-insensitive.
37
+ # These keys will be downcased upon creating or modifying a user and when used
38
+ # to authenticate or find a user. Default is :email.
39
+ config.case_insensitive_keys = [ :email ]
40
+
41
+ # Configure which authentication keys should have whitespace stripped.
42
+ # These keys will have whitespace before and after removed upon creating or
43
+ # modifying a user and when used to authenticate or find a user. Default is :email.
44
+ config.strip_whitespace_keys = [ :email ]
45
+
46
+ # Tell if authentication through request.params is enabled. True by default.
47
+ # It can be set to an array that will enable params authentication only for the
48
+ # given strategies, for example, `config.params_authenticatable = [:database]` will
49
+ # enable it only for database (email + password) authentication.
50
+ # config.params_authenticatable = true
51
+
52
+ # Tell if authentication through HTTP Basic Auth is enabled. False by default.
53
+ # It can be set to an array that will enable http authentication only for the
54
+ # given strategies, for example, `config.http_authenticatable = [:token]` will
55
+ # enable it only for token authentication.
56
+ # config.http_authenticatable = false
57
+
58
+ # If http headers should be returned for AJAX requests. True by default.
59
+ # config.http_authenticatable_on_xhr = true
60
+
61
+ # The realm used in Http Basic Authentication. "Application" by default.
62
+ # config.http_authentication_realm = "Application"
63
+
64
+ # It will change confirmation, password recovery and other workflows
65
+ # to behave the same regardless if the e-mail provided was right or wrong.
66
+ # Does not affect registerable.
67
+ # config.paranoid = true
68
+
69
+ # By default Devise will store the user in session. You can skip storage for
70
+ # :http_auth and :token_auth by adding those symbols to the array below.
71
+ # Notice that if you are skipping storage for all authentication paths, you
72
+ # may want to disable generating routes to Devise's sessions controller by
73
+ # passing :skip => :sessions to `devise_for` in your config/routes.rb
74
+ config.skip_session_storage = [:http_auth]
75
+
76
+ # ==> Configuration for :database_authenticatable
77
+ # For bcrypt, this is the cost for hashing the password and defaults to 10. If
78
+ # using other encryptors, it sets how many times you want the password re-encrypted.
79
+ #
80
+ # Limiting the stretches to just one in testing will increase the performance of
81
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
82
+ # a value less than 10 in other environments.
83
+ config.stretches = Rails.env.test? ? 1 : 10
84
+
85
+ # Setup a pepper to generate the encrypted password.
86
+ # config.pepper = "59ac5dfd254187301c43390ebd59150ab9e28a26bfe528ac69fcecd7ae176495d2193ff797d41228f3f95dceb439ea5e972ae8e017109f7c8dd9a262787d95ff"
87
+
88
+ # ==> Configuration for :confirmable
89
+ # A period that the user is allowed to access the website even without
90
+ # confirming his account. For instance, if set to 2.days, the user will be
91
+ # able to access the website for two days without confirming his account,
92
+ # access will be blocked just in the third day. Default is 0.days, meaning
93
+ # the user cannot access the website without confirming his account.
94
+ # config.allow_unconfirmed_access_for = 2.days
95
+
96
+ # If true, requires any email changes to be confirmed (exactly the same way as
97
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
98
+ # db field (see migrations). Until confirmed new email is stored in
99
+ # unconfirmed email column, and copied to email column on successful confirmation.
100
+ config.reconfirmable = true
101
+
102
+ # Defines which key will be used when confirming an account
103
+ # config.confirmation_keys = [ :email ]
104
+
105
+ # ==> Configuration for :rememberable
106
+ # The time the user will be remembered without asking for credentials again.
107
+ # config.remember_for = 2.weeks
108
+
109
+ # If true, extends the user's remember period when remembered via cookie.
110
+ # config.extend_remember_period = false
111
+
112
+ # Options to be passed to the created cookie. For instance, you can set
113
+ # :secure => true in order to force SSL only cookies.
114
+ # config.rememberable_options = {}
115
+
116
+ # ==> Configuration for :validatable
117
+ # Range for password length. Default is 6..128.
118
+ # config.password_length = 6..128
119
+
120
+ # Email regex used to validate email formats. It simply asserts that
121
+ # an one (and only one) @ exists in the given string. This is mainly
122
+ # to give user feedback and not to assert the e-mail validity.
123
+ # config.email_regexp = /\A[^@]+@[^@]+\z/
124
+
125
+ # ==> Configuration for :timeoutable
126
+ # The time you want to timeout the user session without activity. After this
127
+ # time the user will be asked for credentials again. Default is 30 minutes.
128
+ # config.timeout_in = 30.minutes
129
+
130
+ # If true, expires auth token on session timeout.
131
+ # config.expire_auth_token_on_timeout = false
132
+
133
+ # ==> Configuration for :lockable
134
+ # Defines which strategy will be used to lock an account.
135
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
136
+ # :none = No lock strategy. You should handle locking by yourself.
137
+ # config.lock_strategy = :failed_attempts
138
+
139
+ # Defines which key will be used when locking and unlocking an account
140
+ # config.unlock_keys = [ :email ]
141
+
142
+ # Defines which strategy will be used to unlock an account.
143
+ # :email = Sends an unlock link to the user email
144
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
145
+ # :both = Enables both strategies
146
+ # :none = No unlock strategy. You should handle unlocking by yourself.
147
+ # config.unlock_strategy = :both
148
+
149
+ # Number of authentication tries before locking an account if lock_strategy
150
+ # is failed attempts.
151
+ # config.maximum_attempts = 20
152
+
153
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
154
+ # config.unlock_in = 1.hour
155
+
156
+ # ==> Configuration for :recoverable
157
+ #
158
+ # Defines which key will be used when recovering the password for an account
159
+ # config.reset_password_keys = [ :email ]
160
+
161
+ # Time interval you can reset your password with a reset password key.
162
+ # Don't put a too small interval or your users won't have the time to
163
+ # change their passwords.
164
+ config.reset_password_within = 6.hours
165
+
166
+ # ==> Configuration for :encryptable
167
+ # Allow you to use another encryption algorithm besides bcrypt (default). You can use
168
+ # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
169
+ # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
170
+ # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
171
+ # REST_AUTH_SITE_KEY to pepper)
172
+ # config.encryptor = :sha512
173
+
174
+ # ==> Configuration for :token_authenticatable
175
+ # Defines name of the authentication token params key
176
+ # config.token_authentication_key = :auth_token
177
+
178
+ # ==> Scopes configuration
179
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
180
+ # "users/sessions/new". It's turned off by default because it's slower if you
181
+ # are using only default views.
182
+ # config.scoped_views = false
183
+
184
+ # Configure the default scope given to Warden. By default it's the first
185
+ # devise role declared in your routes (usually :user).
186
+ # config.default_scope = :user
187
+
188
+ # Set this configuration to false if you want /users/sign_out to sign out
189
+ # only the current scope. By default, Devise signs out all scopes.
190
+ # config.sign_out_all_scopes = true
191
+
192
+ # ==> Navigation configuration
193
+ # Lists the formats that should be treated as navigational. Formats like
194
+ # :html, should redirect to the sign in page when the user does not have
195
+ # access, but formats like :xml or :json, should return 401.
196
+ #
197
+ # If you have any extra navigational formats, like :iphone or :mobile, you
198
+ # should add them to the navigational formats lists.
199
+ #
200
+ # The "*/*" below is required to match Internet Explorer requests.
201
+ # config.navigational_formats = ["*/*", :html]
202
+
203
+ # The default HTTP method used to sign out a resource. Default is :delete.
204
+ config.sign_out_via = Rails.env.test? ? :get : :delete
205
+
206
+ # ==> OmniAuth
207
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
208
+ # up on your models and hooks.
209
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
210
+
211
+ # ==> Warden configuration
212
+ # If you want to use other strategies, that are not supported by Devise, or
213
+ # change the failure app, you can configure them inside the config.warden block.
214
+ #
215
+ # config.warden do |manager|
216
+ # manager.intercept_401 = false
217
+ # manager.default_strategies(:scope => :user).unshift :some_external_strategy
218
+ # end
219
+
220
+ # ==> Mountable engine configurations
221
+ # When using Devise inside an engine, let's call it `MyEngine`, and this engine
222
+ # is mountable, there are some extra configurations to be taken into account.
223
+ # The following options are available, assuming the engine is mounted as:
224
+ #
225
+ # mount MyEngine, at: "/my_engine"
226
+ #
227
+ # The router that invoked `devise_for`, in the example above, would be:
228
+ # config.router_name = :my_engine
229
+ #
230
+ # When using omniauth, Devise cannot automatically set Omniauth path,
231
+ # so you need to do it manually. For the users scope, it would be:
232
+ # config.omniauth_path_prefix = "/my_engine/users/auth"
233
+ end
@@ -0,0 +1,2 @@
1
+ Rails.application.config.generators do |g|
2
+ end
@@ -0,0 +1,15 @@
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
11
+ #
12
+ # These inflection rules are supported but not enabled by default:
13
+ # ActiveSupport::Inflector.inflections do |inflect|
14
+ # inflect.acronym 'RESTful'
15
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,20 @@
1
+ require 'ratchetio/rails'
2
+ Ratchetio.configure do |config|
3
+ config.access_token = 'aaaabbbbccccddddeeeeffff00001111'
4
+
5
+ # By default, Ratchetio will try to call the `current_user` controller method
6
+ # to fetch the logged-in user object, and then call that object's `id`,
7
+ # `username`, and `email` methods to fetch those properties. To customize:
8
+ # config.person_method = "my_current_user"
9
+ # config.person_id_method = "my_id"
10
+ # config.person_username_method = "my_username"
11
+ # config.person_email_method = "my_email"
12
+
13
+ # Add exception class names to the exception_level_filters hash to
14
+ # change the level that exception is reported at. Note that if an exception
15
+ # has already been reported and logged the level will need to be changed
16
+ # via the ratchet.io interface.
17
+ # Valid levels: 'critical', 'error', 'warning', 'info', 'debug', 'ignore'
18
+ # 'ignore' will cause the exception to not be reported at all.
19
+ # config.exception_level_filters.merge!('MyCriticalException' => 'critical')
20
+ 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
+ Dummyapp::Application.config.secret_token = '7f640048c34529459638a28f0d6684ec7d96f2340600a832da8b7c87d9b614a81cb8417f743fbc031b3dc9e95f7022bf43f3909e7d672990b684b150c1b8d2b6'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Dummyapp::Application.config.session_store :cookie_store, key: '_dummyapp_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 "rails generate session_migration")
8
+ # Dummyapp::Application.config.session_store :active_record_store
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json]
9
+ end
10
+
11
+ # Disable root element in JSON by default.
12
+ ActiveSupport.on_load(:active_record) do
13
+ self.include_root_in_json = false
14
+ end
@@ -0,0 +1,58 @@
1
+ # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2
+
3
+ en:
4
+ errors:
5
+ messages:
6
+ expired: "has expired, please request a new one"
7
+ not_found: "not found"
8
+ already_confirmed: "was already confirmed, please try signing in"
9
+ not_locked: "was not locked"
10
+ not_saved:
11
+ one: "1 error prohibited this %{resource} from being saved:"
12
+ other: "%{count} errors prohibited this %{resource} from being saved:"
13
+
14
+ devise:
15
+ failure:
16
+ already_authenticated: 'You are already signed in.'
17
+ unauthenticated: 'You need to sign in or sign up before continuing.'
18
+ unconfirmed: 'You have to confirm your account before continuing.'
19
+ locked: 'Your account is locked.'
20
+ invalid: 'Invalid email or password.'
21
+ invalid_token: 'Invalid authentication token.'
22
+ timeout: 'Your session expired, please sign in again to continue.'
23
+ inactive: 'Your account was not activated yet.'
24
+ sessions:
25
+ signed_in: 'Signed in successfully.'
26
+ signed_out: 'Signed out successfully.'
27
+ passwords:
28
+ send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.'
29
+ updated: 'Your password was changed successfully. You are now signed in.'
30
+ updated_not_active: 'Your password was changed successfully.'
31
+ send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
32
+ no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
33
+ confirmations:
34
+ send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
35
+ send_paranoid_instructions: 'If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes.'
36
+ confirmed: 'Your account was successfully confirmed. You are now signed in.'
37
+ registrations:
38
+ signed_up: 'Welcome! You have signed up successfully.'
39
+ signed_up_but_unconfirmed: 'A message with a confirmation link has been sent to your email address. Please open the link to activate your account.'
40
+ signed_up_but_inactive: 'You have signed up successfully. However, we could not sign you in because your account is not yet activated.'
41
+ signed_up_but_locked: 'You have signed up successfully. However, we could not sign you in because your account is locked.'
42
+ updated: 'You updated your account successfully.'
43
+ update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address."
44
+ destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
45
+ unlocks:
46
+ send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.'
47
+ unlocked: 'Your account has been unlocked successfully. Please sign in to continue.'
48
+ send_paranoid_instructions: 'If your account exists, you will receive an email with instructions about how to unlock it in a few minutes.'
49
+ omniauth_callbacks:
50
+ success: 'Successfully authenticated from %{kind} account.'
51
+ failure: 'Could not authenticate you from %{kind} because "%{reason}".'
52
+ mailer:
53
+ confirmation_instructions:
54
+ subject: 'Confirmation instructions'
55
+ reset_password_instructions:
56
+ subject: 'Reset password instructions'
57
+ unlock_instructions:
58
+ subject: 'Unlock Instructions'
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,11 @@
1
+ Dummyapp::Application.routes.draw do
2
+ authenticated :user do
3
+ root :to => 'home#index'
4
+ end
5
+ root :to => "home#index"
6
+ devise_for :users
7
+ resources :users
8
+
9
+ match "/cause_exception" => "home#cause_exception"
10
+ match "/report_exception" => "home#report_exception"
11
+ end
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Dummyapp::Application
@@ -0,0 +1,46 @@
1
+ class DeviseCreateUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table(:users) do |t|
4
+ ## Database authenticatable
5
+ t.string :email, :null => false, :default => ""
6
+ t.string :encrypted_password, :null => false, :default => ""
7
+
8
+ ## Recoverable
9
+ t.string :reset_password_token
10
+ t.datetime :reset_password_sent_at
11
+
12
+ ## Rememberable
13
+ t.datetime :remember_created_at
14
+
15
+ ## Trackable
16
+ t.integer :sign_in_count, :default => 0
17
+ t.datetime :current_sign_in_at
18
+ t.datetime :last_sign_in_at
19
+ t.string :current_sign_in_ip
20
+ t.string :last_sign_in_ip
21
+
22
+ ## Confirmable
23
+ # t.string :confirmation_token
24
+ # t.datetime :confirmed_at
25
+ # t.datetime :confirmation_sent_at
26
+ # t.string :unconfirmed_email # Only if using reconfirmable
27
+
28
+ ## Lockable
29
+ # t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
30
+ # t.string :unlock_token # Only if unlock strategy is :email or :both
31
+ # t.datetime :locked_at
32
+
33
+ ## Token authenticatable
34
+ # t.string :authentication_token
35
+
36
+
37
+ t.timestamps
38
+ end
39
+
40
+ add_index :users, :email, :unique => true
41
+ add_index :users, :reset_password_token, :unique => true
42
+ # add_index :users, :confirmation_token, :unique => true
43
+ # add_index :users, :unlock_token, :unique => true
44
+ # add_index :users, :authentication_token, :unique => true
45
+ end
46
+ end
@@ -0,0 +1,5 @@
1
+ class AddNameToUsers < ActiveRecord::Migration
2
+ def change
3
+ add_column :users, :name, :string
4
+ end
5
+ end
@@ -0,0 +1,35 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended to check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(:version => 20121121184654) do
15
+
16
+ create_table "users", :force => true do |t|
17
+ t.string "email", :default => "", :null => false
18
+ t.string "encrypted_password", :default => "", :null => false
19
+ t.string "reset_password_token"
20
+ t.datetime "reset_password_sent_at"
21
+ t.datetime "remember_created_at"
22
+ t.integer "sign_in_count", :default => 0
23
+ t.datetime "current_sign_in_at"
24
+ t.datetime "last_sign_in_at"
25
+ t.string "current_sign_in_ip"
26
+ t.string "last_sign_in_ip"
27
+ t.datetime "created_at", :null => false
28
+ t.datetime "updated_at", :null => false
29
+ t.string "name"
30
+ end
31
+
32
+ add_index "users", ["email"], :name => "index_users_on_email", :unique => true
33
+ add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
34
+
35
+ end
@@ -0,0 +1,12 @@
1
+ # This file should contain all the record creation needed to seed the database with its default values.
2
+ # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3
+ #
4
+ # Examples:
5
+ #
6
+ # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
7
+ # Mayor.create(name: 'Emanuel', city: cities.first)
8
+ puts 'SETTING UP DEFAULT USER LOGIN'
9
+ user = User.create! :name => 'First User', :email => 'user@example.com', :password => 'please', :password_confirmation => 'please'
10
+ puts 'New user created: ' << user.name
11
+ user2 = User.create! :name => 'Second User', :email => 'user2@example.com', :password => 'please', :password_confirmation => 'please'
12
+ puts 'New user created: ' << user2.name
File without changes
File without changes
@@ -0,0 +1,65 @@
1
+ # IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
2
+ # It is recommended to regenerate this file in the future when you upgrade to a
3
+ # newer version of cucumber-rails. Consider adding your own code to a new file
4
+ # instead of editing this one. Cucumber will automatically load all features/**/*.rb
5
+ # files.
6
+
7
+
8
+ unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks
9
+
10
+ vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
11
+ $LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil?
12
+
13
+ begin
14
+ require 'cucumber/rake/task'
15
+
16
+ namespace :cucumber do
17
+ Cucumber::Rake::Task.new({:ok => 'db:test:prepare'}, 'Run features that should pass') do |t|
18
+ t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
19
+ t.fork = true # You may get faster startup if you set this to false
20
+ t.profile = 'default'
21
+ end
22
+
23
+ Cucumber::Rake::Task.new({:wip => 'db:test:prepare'}, 'Run features that are being worked on') do |t|
24
+ t.binary = vendored_cucumber_bin
25
+ t.fork = true # You may get faster startup if you set this to false
26
+ t.profile = 'wip'
27
+ end
28
+
29
+ Cucumber::Rake::Task.new({:rerun => 'db:test:prepare'}, 'Record failing features and run only them if any exist') do |t|
30
+ t.binary = vendored_cucumber_bin
31
+ t.fork = true # You may get faster startup if you set this to false
32
+ t.profile = 'rerun'
33
+ end
34
+
35
+ desc 'Run all features'
36
+ task :all => [:ok, :wip]
37
+
38
+ task :statsetup do
39
+ require 'rails/code_statistics'
40
+ ::STATS_DIRECTORIES << %w(Cucumber\ features features) if File.exist?('features')
41
+ ::CodeStatistics::TEST_TYPES << "Cucumber features" if File.exist?('features')
42
+ end
43
+ end
44
+ desc 'Alias for cucumber:ok'
45
+ task :cucumber => 'cucumber:ok'
46
+
47
+ task :default => :cucumber
48
+
49
+ task :features => :cucumber do
50
+ STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"
51
+ end
52
+
53
+ # In case we don't have ActiveRecord, append a no-op task that we can depend upon.
54
+ task 'db:test:prepare' do
55
+ end
56
+
57
+ task :stats => 'cucumber:statsetup'
58
+ rescue LoadError
59
+ desc 'cucumber rake task not available (cucumber not installed)'
60
+ task :cucumber do
61
+ abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
62
+ end
63
+ end
64
+
65
+ end
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,25 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ </div>
24
+ </body>
25
+ </html>
File without changes