oauth2_provider_engine 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +40 -0
- data/app/assets/javascripts/oauth2_provider/application.js +52 -0
- data/app/assets/javascripts/oauth2_provider/highcharts.js +162 -0
- data/app/assets/javascripts/oauth2_provider/jquery.tagsinput.js +218 -0
- data/app/assets/stylesheets/oauth2_provider/gh-buttons.css +388 -0
- data/app/assets/stylesheets/oauth2_provider/gh-icons.png +0 -0
- data/app/assets/stylesheets/oauth2_provider/jquery.tagsinput.css +6 -0
- data/app/assets/stylesheets/oauth2_provider/reset.css +2 -0
- data/app/assets/stylesheets/oauth2_provider/template.css +52 -0
- data/app/controllers/oauth2_provider/accesses_controller.rb +39 -0
- data/app/controllers/oauth2_provider/application_controller.rb +17 -0
- data/app/controllers/oauth2_provider/authorize_controller.rb +141 -0
- data/app/controllers/oauth2_provider/clients_controller.rb +85 -0
- data/app/controllers/oauth2_provider/scopes_controller.rb +63 -0
- data/app/controllers/oauth2_provider/token_controller.rb +187 -0
- data/app/helpers/clients_helper.rb +5 -0
- data/app/helpers/oauth2_provider/application_helper.rb +4 -0
- data/app/models/oauth2_provider/client.rb +129 -0
- data/app/models/oauth2_provider/document.rb +15 -0
- data/app/models/oauth2_provider/oauth_access.rb +80 -0
- data/app/models/oauth2_provider/oauth_authorization.rb +70 -0
- data/app/models/oauth2_provider/oauth_daily_request.rb +54 -0
- data/app/models/oauth2_provider/oauth_refresh_token.rb +20 -0
- data/app/models/oauth2_provider/oauth_token.rb +78 -0
- data/app/models/oauth2_provider/scope.rb +39 -0
- data/app/views/layouts/oauth2_provider/application.html.erb +62 -0
- data/app/views/oauth2_provider/accesses/index.html.erb +25 -0
- data/app/views/oauth2_provider/accesses/show.html.erb +35 -0
- data/app/views/oauth2_provider/clients/_form.html.erb +50 -0
- data/app/views/oauth2_provider/clients/edit.html.erb +9 -0
- data/app/views/oauth2_provider/clients/index.html.erb +43 -0
- data/app/views/oauth2_provider/clients/new.html.erb +8 -0
- data/app/views/oauth2_provider/clients/show.html.erb +49 -0
- data/app/views/oauth2_provider/scopes/_form.html.erb +35 -0
- data/app/views/oauth2_provider/scopes/edit.html.erb +8 -0
- data/app/views/oauth2_provider/scopes/index.html.erb +27 -0
- data/app/views/oauth2_provider/scopes/new.html.erb +7 -0
- data/app/views/oauth2_provider/scopes/show.html.erb +19 -0
- data/app/views/shared/authorize.html.erb +34 -0
- data/app/views/shared/token.json.erb +8 -0
- data/config/locales/en.yml +31 -0
- data/config/oauth.yml +4 -0
- data/config/routes.rb +25 -0
- data/lib/oauth2_provider.rb +38 -0
- data/lib/oauth2_provider/controller_mixin.rb +53 -0
- data/lib/oauth2_provider/engine.rb +4 -0
- data/lib/oauth2_provider_engine.rb +1 -0
- data/lib/oauth2_provider_engine/version.rb +3 -0
- data/test/dummy/CHANGELOG.rdoc +67 -0
- data/test/dummy/Gemfile +53 -0
- data/test/dummy/Gemfile.lock +254 -0
- data/test/dummy/README.rdoc +522 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/VERSION +1 -0
- data/test/dummy/app/assets/stylesheets/reset.css +2 -0
- data/test/dummy/app/assets/stylesheets/template.css +52 -0
- data/test/dummy/app/controllers/application_controller.rb +52 -0
- data/test/dummy/app/controllers/pastas_controller.rb +23 -0
- data/test/dummy/app/controllers/pizzas_controller.rb +23 -0
- data/test/dummy/app/controllers/sessions_controller.rb +26 -0
- data/test/dummy/app/controllers/users_controller.rb +59 -0
- data/test/dummy/app/models/user.rb +50 -0
- data/test/dummy/app/views/layouts/application.html.erb +65 -0
- data/test/dummy/app/views/sessions/new.html.erb +25 -0
- data/test/dummy/app/views/shared/403.json.erb +4 -0
- data/test/dummy/app/views/shared/404.json.erb +6 -0
- data/test/dummy/app/views/shared/422.json.erb +5 -0
- data/test/dummy/app/views/shared/500.json.erb +4 -0
- data/test/dummy/app/views/shared/html/404.html.erb +0 -0
- data/test/dummy/app/views/shared/html/422.html.erb +0 -0
- data/test/dummy/app/views/users/_form.html.erb +27 -0
- data/test/dummy/app/views/users/edit.html.erb +8 -0
- data/test/dummy/app/views/users/index.html.erb +20 -0
- data/test/dummy/app/views/users/new.html.erb +46 -0
- data/test/dummy/app/views/users/show.html.erb +15 -0
- data/test/dummy/app/views/users/show.json.erb +6 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +57 -0
- data/test/dummy/config/boot.rb +13 -0
- data/test/dummy/config/cucumber.yml +8 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +32 -0
- data/test/dummy/config/environments/production.rb +58 -0
- data/test/dummy/config/environments/test.rb +35 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +10 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/test.rb +3 -0
- data/test/dummy/config/locales/en.yml +1 -0
- data/test/dummy/config/mongoid.yml +20 -0
- data/test/dummy/config/routes.rb +22 -0
- data/test/dummy/db/seeds.rb +7 -0
- data/test/dummy/doc/README_FOR_APP +2 -0
- data/test/dummy/lib/tasks/cucumber.rake +53 -0
- data/test/dummy/lib/tasks/watchr.rake +5 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +4 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/public/robots.txt +5 -0
- data/test/dummy/script/cucumber +10 -0
- data/test/dummy/script/rails +6 -0
- data/test/dummy/spec/acceptance/acceptance_helper.rb +5 -0
- data/test/dummy/spec/acceptance/accesses_controller_spec.rb +77 -0
- data/test/dummy/spec/acceptance/clients_controller_spec.rb +218 -0
- data/test/dummy/spec/acceptance/oauth_authorize_controller_spec.rb +241 -0
- data/test/dummy/spec/acceptance/oauth_token_controller_spec.rb +196 -0
- data/test/dummy/spec/acceptance/resource_controller_spec.rb +143 -0
- data/test/dummy/spec/acceptance/scopes_controller_spec.rb +227 -0
- data/test/dummy/spec/acceptance/support/helpers.rb +81 -0
- data/test/dummy/spec/acceptance/support/paths.rb +9 -0
- data/test/dummy/spec/acceptance/support/view_helpers.rb +52 -0
- data/test/dummy/spec/acceptance/users_controller_spec.rb +198 -0
- data/test/dummy/spec/extras/scope_spec.rb +105 -0
- data/test/dummy/spec/factories/oauth.rb +106 -0
- data/test/dummy/spec/models/oauth/client_spec.rb +123 -0
- data/test/dummy/spec/models/oauth/oauth_access_spec.rb +48 -0
- data/test/dummy/spec/models/oauth/oauth_authorization_spec.rb +50 -0
- data/test/dummy/spec/models/oauth/oauth_daily_request_spec.rb +14 -0
- data/test/dummy/spec/models/oauth/oauth_refresh_token_spec.rb +11 -0
- data/test/dummy/spec/models/oauth/oauth_token_spec.rb +55 -0
- data/test/dummy/spec/models/scope_spec.rb +17 -0
- data/test/dummy/spec/spec_helper.rb +39 -0
- data/test/dummy/spec/support/settings_helper.rb +28 -0
- data/test/dummy/test/initializers/capybara_headers_hack.rb +23 -0
- data/test/oauth2_provider_test.rb +7 -0
- data/test/test_helper.rb +15 -0
- metadata +387 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<h2>Show Users</h2>
|
|
2
|
+
|
|
3
|
+
<table>
|
|
4
|
+
<tr>
|
|
5
|
+
<th>Email</th>
|
|
6
|
+
<th>Name</th>
|
|
7
|
+
<th></th>
|
|
8
|
+
<th></th>
|
|
9
|
+
<th></th>
|
|
10
|
+
</tr>
|
|
11
|
+
|
|
12
|
+
<% @users.each do |user| %>
|
|
13
|
+
<tr>
|
|
14
|
+
<td><%= user.email %></td>
|
|
15
|
+
<td><%= user.name %></td>
|
|
16
|
+
<td><%= link_to 'Show', user, class: "button" %></td>
|
|
17
|
+
<td><%= link_to 'Edit', edit_user_path(user), class: "button" %></td>
|
|
18
|
+
</tr>
|
|
19
|
+
<% end %>
|
|
20
|
+
</table>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
<head></head>
|
|
3
|
+
<body>
|
|
4
|
+
|
|
5
|
+
<h2>Sign Up</h2>
|
|
6
|
+
<% if admin_does_not_exist %>
|
|
7
|
+
<p class="admin_notice">
|
|
8
|
+
<b>No administrator was found. Probably this is the first time
|
|
9
|
+
you access the Rest OAuth 2.0 Server Dashboard. Fill the form
|
|
10
|
+
and create the first admin user</b>.
|
|
11
|
+
</p>
|
|
12
|
+
<% end %>
|
|
13
|
+
|
|
14
|
+
<%= form_for @user do |f| %>
|
|
15
|
+
|
|
16
|
+
<% if @user.errors.any? %>
|
|
17
|
+
<div id="error_explanation">
|
|
18
|
+
<div><%= pluralize(@user.errors.count, "error") %> prohibited this resource from being saved</div>
|
|
19
|
+
<ul>
|
|
20
|
+
<% @user.errors.full_messages.each do |msg| %>
|
|
21
|
+
<li><%= msg %></li>
|
|
22
|
+
<% end %>
|
|
23
|
+
</ul>
|
|
24
|
+
</div>
|
|
25
|
+
<% end %>
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
<div class="field">
|
|
29
|
+
<%= f.label :email %><br />
|
|
30
|
+
<%= f.text_field :email %>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<div class="field">
|
|
34
|
+
<%= f.label :password %><br />
|
|
35
|
+
<%= f.password_field :password %>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<div class="actions">
|
|
39
|
+
<%= f.submit nil, {class: "button"} %>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<% end %>
|
|
43
|
+
|
|
44
|
+
</body>
|
|
45
|
+
</html>
|
|
46
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<h2>Show User</h2>
|
|
2
|
+
|
|
3
|
+
<div class="field_show">
|
|
4
|
+
<b>Email:</b>
|
|
5
|
+
<%= @user.email %>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<div class="field_show">
|
|
9
|
+
<b>Name:</b>
|
|
10
|
+
<%= @user.name %>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<div class="button-group footer_buttons">
|
|
14
|
+
<%= link_to 'Edit', edit_user_path(@user), class: "button" %>
|
|
15
|
+
</div>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
|
2
|
+
|
|
3
|
+
# require "active_record/railtie"
|
|
4
|
+
require "action_controller/railtie"
|
|
5
|
+
require "action_mailer/railtie"
|
|
6
|
+
require "active_resource/railtie"
|
|
7
|
+
require "rails/test_unit/railtie"
|
|
8
|
+
|
|
9
|
+
if defined?(Bundler)
|
|
10
|
+
# If you precompile assets before deploying to production, use this line
|
|
11
|
+
Bundler.require(*Rails.groups(:assets => %w(development test)))
|
|
12
|
+
# If you want your assets lazily compiled in production, use this line
|
|
13
|
+
# Bundler.require(:default, :assets, Rails.env)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
module Lelylan
|
|
17
|
+
class Application < Rails::Application
|
|
18
|
+
# Settings in config/environments/* take precedence over those specified here.
|
|
19
|
+
# Application configuration should go into files in config/initializers
|
|
20
|
+
# -- all .rb files in that directory are automatically loaded.
|
|
21
|
+
|
|
22
|
+
# Custom directories with classes and modules you want to be autoloadable.
|
|
23
|
+
config.autoload_paths += %W[
|
|
24
|
+
#{config.root}/lib
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
# Only load the plugins named here, in the order given (default is alphabetical).
|
|
28
|
+
# :all can be used as a placeholder for all plugins not explicitly named.
|
|
29
|
+
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
|
30
|
+
|
|
31
|
+
# Activate observers that should always be running.
|
|
32
|
+
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
|
33
|
+
|
|
34
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
|
35
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
|
36
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
|
37
|
+
|
|
38
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
|
39
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
|
40
|
+
# config.i18n.default_locale = :de
|
|
41
|
+
|
|
42
|
+
# JavaScript files you want as :defaults (application.js is always included).
|
|
43
|
+
# config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
|
|
44
|
+
|
|
45
|
+
# Configure the default encoding used in templates for Ruby 1.9.
|
|
46
|
+
config.encoding = "utf-8"
|
|
47
|
+
|
|
48
|
+
# Configure sensitive parameters which will be filtered from the log file.
|
|
49
|
+
config.filter_parameters += [:password]
|
|
50
|
+
|
|
51
|
+
# Disable authenticity token
|
|
52
|
+
config.action_controller.allow_forgery_protection = false
|
|
53
|
+
|
|
54
|
+
config.assets.enabled = true
|
|
55
|
+
config.assets.version = '1.1'
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'rubygems'
|
|
2
|
+
|
|
3
|
+
# Set up gems listed in the Gemfile.
|
|
4
|
+
gemfile = File.expand_path('../../Gemfile', __FILE__)
|
|
5
|
+
begin
|
|
6
|
+
ENV['BUNDLE_GEMFILE'] = gemfile
|
|
7
|
+
require 'bundler'
|
|
8
|
+
Bundler.setup
|
|
9
|
+
rescue Bundler::GemNotFound => e
|
|
10
|
+
STDERR.puts e.message
|
|
11
|
+
STDERR.puts "Try running `bundle install`."
|
|
12
|
+
exit!
|
|
13
|
+
end if File.exist?(gemfile)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<%
|
|
2
|
+
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
|
|
3
|
+
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
|
|
4
|
+
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip"
|
|
5
|
+
%>
|
|
6
|
+
default: <%= std_opts %> features
|
|
7
|
+
wip: --tags @wip:3 --wip features
|
|
8
|
+
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
Lelylan::Application.configure do
|
|
2
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
|
3
|
+
|
|
4
|
+
# In the development environment your application's code is reloaded on
|
|
5
|
+
# every request. This slows down response time but is perfect for development
|
|
6
|
+
# since you don't have to restart the webserver when you make code changes.
|
|
7
|
+
config.cache_classes = false
|
|
8
|
+
|
|
9
|
+
# Log error messages when you accidentally call methods on nil.
|
|
10
|
+
config.whiny_nils = true
|
|
11
|
+
|
|
12
|
+
# Show full error reports and disable caching
|
|
13
|
+
config.consider_all_requests_local = true
|
|
14
|
+
config.action_controller.perform_caching = false
|
|
15
|
+
|
|
16
|
+
# Don't care if the mailer can't send
|
|
17
|
+
#config.action_mailer.raise_delivery_errors = false
|
|
18
|
+
|
|
19
|
+
# Print deprecation notices to the Rails logger
|
|
20
|
+
config.active_support.deprecation = :log
|
|
21
|
+
|
|
22
|
+
# Only use best-standards-support built into browsers
|
|
23
|
+
config.action_dispatch.best_standards_support = :builtin
|
|
24
|
+
|
|
25
|
+
#Do not compress assets
|
|
26
|
+
config.assets.compress = false
|
|
27
|
+
|
|
28
|
+
# Expands the lines which load the assets
|
|
29
|
+
config.assets.debug = true
|
|
30
|
+
|
|
31
|
+
end
|
|
32
|
+
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
require 'rack/ssl'
|
|
2
|
+
|
|
3
|
+
Lelylan::Application.configure do
|
|
4
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
|
5
|
+
|
|
6
|
+
# The production environment is meant for finished, "live" apps.
|
|
7
|
+
# Code is not reloaded between requests
|
|
8
|
+
config.cache_classes = true
|
|
9
|
+
|
|
10
|
+
# Full error reports are disabled and caching is turned on
|
|
11
|
+
config.consider_all_requests_local = false
|
|
12
|
+
config.action_controller.perform_caching = true
|
|
13
|
+
|
|
14
|
+
# Specifies the header that your server uses for sending files
|
|
15
|
+
config.action_dispatch.x_sendfile_header = "X-Sendfile"
|
|
16
|
+
|
|
17
|
+
# For nginx:
|
|
18
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
|
|
19
|
+
|
|
20
|
+
# If you have no front-end server that supports something like X-Sendfile,
|
|
21
|
+
# just comment this out and Rails will serve the files
|
|
22
|
+
|
|
23
|
+
# See everything in the log (default is :info)
|
|
24
|
+
# config.log_level = :debug
|
|
25
|
+
|
|
26
|
+
# Use a different logger for distributed setups
|
|
27
|
+
# config.logger = SyslogLogger.new
|
|
28
|
+
|
|
29
|
+
# Use a different cache store in production
|
|
30
|
+
# config.cache_store = :mem_cache_store
|
|
31
|
+
|
|
32
|
+
# Disable Rails's static asset server
|
|
33
|
+
# In production, Apache or nginx will already do this
|
|
34
|
+
config.serve_static_assets = false
|
|
35
|
+
|
|
36
|
+
# Enable serving of images, stylesheets, and javascripts from an asset server
|
|
37
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
|
38
|
+
|
|
39
|
+
# Disable delivery errors, bad email addresses will be ignored
|
|
40
|
+
# config.action_mailer.raise_delivery_errors = false
|
|
41
|
+
|
|
42
|
+
# Enable threaded mode
|
|
43
|
+
# config.threadsafe!
|
|
44
|
+
|
|
45
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
|
46
|
+
# the I18n.default_locale when a translation can not be found)
|
|
47
|
+
config.i18n.fallbacks = true
|
|
48
|
+
|
|
49
|
+
# Send deprecation notices to registered listeners
|
|
50
|
+
config.active_support.deprecation = :notify
|
|
51
|
+
|
|
52
|
+
# Force HTTPS
|
|
53
|
+
# http://collectiveidea.com/blog/archives/2010/11/29/ssl-with-rails/
|
|
54
|
+
config.middleware.use Rack::SSL
|
|
55
|
+
|
|
56
|
+
# Force secure cookies
|
|
57
|
+
config.middleware.insert_before ActionDispatch::Cookies, Rack::SSL
|
|
58
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
Lelylan::Application.configure do
|
|
2
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
|
3
|
+
|
|
4
|
+
# The test environment is used exclusively to run your application's
|
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
|
6
|
+
# your test database is "scratch space" for the test suite and is wiped
|
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
|
8
|
+
config.cache_classes = true
|
|
9
|
+
|
|
10
|
+
# Log error messages when you accidentally call methods on nil.
|
|
11
|
+
config.whiny_nils = true
|
|
12
|
+
|
|
13
|
+
# Show full error reports and disable caching
|
|
14
|
+
config.consider_all_requests_local = true
|
|
15
|
+
config.action_controller.perform_caching = false
|
|
16
|
+
|
|
17
|
+
# Raise exceptions instead of rendering exception templates
|
|
18
|
+
config.action_dispatch.show_exceptions = false
|
|
19
|
+
|
|
20
|
+
# Disable request forgery protection in test environment
|
|
21
|
+
config.action_controller.allow_forgery_protection = false
|
|
22
|
+
|
|
23
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
|
24
|
+
# The :test delivery method accumulates sent emails in the
|
|
25
|
+
# ActionMailer::Base.deliveries array.
|
|
26
|
+
#config.action_mailer.delivery_method = :test
|
|
27
|
+
|
|
28
|
+
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
|
29
|
+
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
|
30
|
+
# like if you have constraints or database-specific column types
|
|
31
|
+
# config.active_record.schema_format = :sql
|
|
32
|
+
|
|
33
|
+
# Print deprecation notices to the stderr
|
|
34
|
+
config.active_support.deprecation = :stderr
|
|
35
|
+
end
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
|
2
|
+
|
|
3
|
+
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
|
4
|
+
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
|
5
|
+
|
|
6
|
+
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
|
|
7
|
+
# Rails.backtrace_cleaner.remove_silencers!
|
|
@@ -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
|
+
Lelylan::Application.config.secret_token = '587decfc3592f92e448446c6986552ca3218de1ee97bc34e3cd445536c35029fd711c1a7ddc40931c56ed03fa533ee8e59e0a21e0373d1c017478ef7b79bb13e'
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
|
2
|
+
|
|
3
|
+
Lelylan::Application.config.session_store :cookie_store, :key => '_lelylan_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
|
+
# Lelylan::Application.config.session_store :active_record_store
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
en:
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
development:
|
|
2
|
+
host: localhost
|
|
3
|
+
database: lelylan_development
|
|
4
|
+
|
|
5
|
+
test:
|
|
6
|
+
host: localhost
|
|
7
|
+
database: lelylan_test
|
|
8
|
+
|
|
9
|
+
# set these environment variables on your prod server
|
|
10
|
+
production:
|
|
11
|
+
host: <%= ENV['MONGOID_HOST'] %>
|
|
12
|
+
port: <%= ENV['MONGOID_PORT'] %>
|
|
13
|
+
username: <%= ENV['MONGOID_USERNAME'] %>
|
|
14
|
+
password: <%= ENV['MONGOID_PASSWORD'] %>
|
|
15
|
+
database: <%= ENV['MONGOID_DATABASE'] %>
|
|
16
|
+
# slaves:
|
|
17
|
+
# - host: slave1.local
|
|
18
|
+
# port: 27018
|
|
19
|
+
# - host: slave2.local
|
|
20
|
+
# port: 27019
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Lelylan::Application.routes.draw do
|
|
2
|
+
mount Oauth2Provider::Engine, at: 'oauth'
|
|
3
|
+
|
|
4
|
+
get "domains/example/app/callback" => "sessions#new" if Rails.env == 'test'
|
|
5
|
+
|
|
6
|
+
get "log_out" => "sessions#destroy", as: "log_out"
|
|
7
|
+
get "log_in" => "sessions#new", as: "log_in"
|
|
8
|
+
|
|
9
|
+
get "sign_up" => "users#new", as: "sign_up"
|
|
10
|
+
get "users/show" => "users#show"
|
|
11
|
+
get "users/edit" => "users#edit"
|
|
12
|
+
|
|
13
|
+
resources :users
|
|
14
|
+
resources :sessions
|
|
15
|
+
|
|
16
|
+
root :to => "sessions#new"
|
|
17
|
+
|
|
18
|
+
# sample resources
|
|
19
|
+
resources :pizzas, defaults: { format: "json" }
|
|
20
|
+
resources :pastas, defaults: { format: "json" }
|
|
21
|
+
|
|
22
|
+
end
|
|
@@ -0,0 +1,7 @@
|
|
|
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 => 'Daley', :city => cities.first)
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
end
|
|
38
|
+
desc 'Alias for cucumber:ok'
|
|
39
|
+
task :cucumber => 'cucumber:ok'
|
|
40
|
+
|
|
41
|
+
task :default => :cucumber
|
|
42
|
+
|
|
43
|
+
task :features => :cucumber do
|
|
44
|
+
STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"
|
|
45
|
+
end
|
|
46
|
+
rescue LoadError
|
|
47
|
+
desc 'cucumber rake task not available (cucumber not installed)'
|
|
48
|
+
task :cucumber do
|
|
49
|
+
abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
end
|