omniauth_china 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +12 -0
- data/Gemfile.lock +188 -0
- data/Rakefile +13 -1
- data/lib/omniauth_china/oauth_china.rb +1 -1
- data/lib/omniauth_china/version.rb +1 -1
- data/spec/omniauth_china/strategies/douban_spec.rb +40 -0
- data/spec/omniauth_china/strategies/t163_spec.rb +5 -0
- data/spec/omniauth_china/strategies/tsina_spec.rb +5 -0
- data/spec/omniauth_china/strategies/tsohu_spec.rb +5 -0
- data/spec/spec_helper.rb +33 -0
- data/spec/support/shared_examples.rb +29 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/config/application.rb +45 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +22 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +26 -0
- data/test/dummy/config/environments/production.rb +49 -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/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +58 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +0 -0
- data/test/dummy/log/production.log +0 -0
- data/test/dummy/log/server.log +0 -0
- data/test/dummy/log/test.log +27 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +26 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/public/javascripts/application.js +2 -0
- data/test/dummy/public/javascripts/controls.js +965 -0
- data/test/dummy/public/javascripts/dragdrop.js +974 -0
- data/test/dummy/public/javascripts/effects.js +1123 -0
- data/test/dummy/public/javascripts/prototype.js +6001 -0
- data/test/dummy/public/javascripts/rails.js +175 -0
- data/test/dummy/public/stylesheets/.gitkeep +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/integration/navigation_test.rb +7 -0
- data/test/omniauth_china/strategies/douban_test.rb +40 -0
- data/test/omniauth_china_test.rb +7 -0
- data/test/support/integration_case.rb +5 -0
- data/test/test_helper.rb +54 -0
- metadata +98 -4
data/Gemfile
CHANGED
@@ -1,4 +1,16 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
2
|
|
3
|
+
gem "rails", "3.0.3"
|
4
|
+
gem "capybara", ">= 0.4.0"
|
5
|
+
gem "sqlite3"
|
6
|
+
|
7
|
+
gem 'rack'
|
8
|
+
gem 'rake'
|
9
|
+
gem 'mg', '~> 0.0.8'
|
10
|
+
gem 'rspec', '~> 2.0.0'
|
11
|
+
gem 'webmock', '~> 1.3.4'
|
12
|
+
gem 'rack-test', '~> 0.5.4'
|
13
|
+
gem 'json', '~> 1.4.3' # multi_json implementation
|
14
|
+
|
3
15
|
# Specify your gem's dependencies in omniauth_china.gemspec
|
4
16
|
gemspec
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,188 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
omniauth_china (0.0.2)
|
5
|
+
omniauth
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: http://rubygems.org/
|
9
|
+
specs:
|
10
|
+
abstract (1.0.0)
|
11
|
+
actionmailer (3.0.3)
|
12
|
+
actionpack (= 3.0.3)
|
13
|
+
mail (~> 2.2.9)
|
14
|
+
actionpack (3.0.3)
|
15
|
+
activemodel (= 3.0.3)
|
16
|
+
activesupport (= 3.0.3)
|
17
|
+
builder (~> 2.1.2)
|
18
|
+
erubis (~> 2.6.6)
|
19
|
+
i18n (~> 0.4)
|
20
|
+
rack (~> 1.2.1)
|
21
|
+
rack-mount (~> 0.6.13)
|
22
|
+
rack-test (~> 0.5.6)
|
23
|
+
tzinfo (~> 0.3.23)
|
24
|
+
activemodel (3.0.3)
|
25
|
+
activesupport (= 3.0.3)
|
26
|
+
builder (~> 2.1.2)
|
27
|
+
i18n (~> 0.4)
|
28
|
+
activerecord (3.0.3)
|
29
|
+
activemodel (= 3.0.3)
|
30
|
+
activesupport (= 3.0.3)
|
31
|
+
arel (~> 2.0.2)
|
32
|
+
tzinfo (~> 0.3.23)
|
33
|
+
activeresource (3.0.3)
|
34
|
+
activemodel (= 3.0.3)
|
35
|
+
activesupport (= 3.0.3)
|
36
|
+
activesupport (3.0.3)
|
37
|
+
addressable (2.2.4)
|
38
|
+
arel (2.0.9)
|
39
|
+
builder (2.1.2)
|
40
|
+
capybara (0.4.1.2)
|
41
|
+
celerity (>= 0.7.9)
|
42
|
+
culerity (>= 0.2.4)
|
43
|
+
mime-types (>= 1.16)
|
44
|
+
nokogiri (>= 1.3.3)
|
45
|
+
rack (>= 1.0.0)
|
46
|
+
rack-test (>= 0.5.4)
|
47
|
+
selenium-webdriver (>= 0.0.27)
|
48
|
+
xpath (~> 0.1.3)
|
49
|
+
celerity (0.8.8)
|
50
|
+
childprocess (0.1.8)
|
51
|
+
ffi (~> 1.0.6)
|
52
|
+
crack (0.1.8)
|
53
|
+
culerity (0.2.15)
|
54
|
+
diff-lcs (1.1.2)
|
55
|
+
erubis (2.6.6)
|
56
|
+
abstract (>= 1.0.0)
|
57
|
+
faraday (0.5.7)
|
58
|
+
addressable (~> 2.2.4)
|
59
|
+
multipart-post (~> 1.1.0)
|
60
|
+
rack (>= 1.1.0, < 2)
|
61
|
+
ffi (1.0.7)
|
62
|
+
rake (>= 0.8.7)
|
63
|
+
i18n (0.5.0)
|
64
|
+
json (1.4.6)
|
65
|
+
json_pure (1.5.1)
|
66
|
+
mail (2.2.15)
|
67
|
+
activesupport (>= 2.3.6)
|
68
|
+
i18n (>= 0.4.0)
|
69
|
+
mime-types (~> 1.16)
|
70
|
+
treetop (~> 1.4.8)
|
71
|
+
mg (0.0.8)
|
72
|
+
rake
|
73
|
+
mime-types (1.16)
|
74
|
+
multi_json (0.0.5)
|
75
|
+
multipart-post (1.1.0)
|
76
|
+
net-ldap (0.1.1)
|
77
|
+
nokogiri (1.4.4)
|
78
|
+
oa-basic (0.2.0)
|
79
|
+
multi_json (~> 0.0.2)
|
80
|
+
nokogiri (~> 1.4.2)
|
81
|
+
oa-core (= 0.2.0)
|
82
|
+
rest-client (~> 1.6.0)
|
83
|
+
oa-core (0.2.0)
|
84
|
+
rack (~> 1.1)
|
85
|
+
oa-enterprise (0.2.0)
|
86
|
+
net-ldap (~> 0.1.1)
|
87
|
+
nokogiri (~> 1.4.2)
|
88
|
+
oa-core (= 0.2.0)
|
89
|
+
pyu-ruby-sasl (~> 0.0.3.1)
|
90
|
+
rubyntlm (~> 0.1.1)
|
91
|
+
oa-more (0.2.0)
|
92
|
+
multi_json (~> 0.0.2)
|
93
|
+
oa-core (= 0.2.0)
|
94
|
+
rest-client (~> 1.6.0)
|
95
|
+
oa-oauth (0.2.0)
|
96
|
+
multi_json (~> 0.0.2)
|
97
|
+
nokogiri (~> 1.4.2)
|
98
|
+
oa-core (= 0.2.0)
|
99
|
+
oauth (~> 0.4.0)
|
100
|
+
oauth2 (~> 0.1.1)
|
101
|
+
oa-openid (0.2.0)
|
102
|
+
oa-core (= 0.2.0)
|
103
|
+
rack-openid (~> 1.2.0)
|
104
|
+
ruby-openid-apps-discovery
|
105
|
+
oauth (0.4.4)
|
106
|
+
oauth2 (0.1.1)
|
107
|
+
faraday (~> 0.5.0)
|
108
|
+
multi_json (~> 0.0.4)
|
109
|
+
omniauth (0.2.0)
|
110
|
+
oa-basic (= 0.2.0)
|
111
|
+
oa-core (= 0.2.0)
|
112
|
+
oa-enterprise (= 0.2.0)
|
113
|
+
oa-more (= 0.2.0)
|
114
|
+
oa-oauth (= 0.2.0)
|
115
|
+
oa-openid (= 0.2.0)
|
116
|
+
polyglot (0.3.1)
|
117
|
+
pyu-ruby-sasl (0.0.3.2)
|
118
|
+
rack (1.2.2)
|
119
|
+
rack-mount (0.6.14)
|
120
|
+
rack (>= 1.0.0)
|
121
|
+
rack-openid (1.2.0)
|
122
|
+
rack (>= 1.1.0)
|
123
|
+
ruby-openid (>= 2.1.8)
|
124
|
+
rack-test (0.5.7)
|
125
|
+
rack (>= 1.0)
|
126
|
+
rails (3.0.3)
|
127
|
+
actionmailer (= 3.0.3)
|
128
|
+
actionpack (= 3.0.3)
|
129
|
+
activerecord (= 3.0.3)
|
130
|
+
activeresource (= 3.0.3)
|
131
|
+
activesupport (= 3.0.3)
|
132
|
+
bundler (~> 1.0)
|
133
|
+
railties (= 3.0.3)
|
134
|
+
railties (3.0.3)
|
135
|
+
actionpack (= 3.0.3)
|
136
|
+
activesupport (= 3.0.3)
|
137
|
+
rake (>= 0.8.7)
|
138
|
+
thor (~> 0.14.4)
|
139
|
+
rake (0.8.7)
|
140
|
+
rest-client (1.6.1)
|
141
|
+
mime-types (>= 1.16)
|
142
|
+
rspec (2.0.1)
|
143
|
+
rspec-core (~> 2.0.1)
|
144
|
+
rspec-expectations (~> 2.0.1)
|
145
|
+
rspec-mocks (~> 2.0.1)
|
146
|
+
rspec-core (2.0.1)
|
147
|
+
rspec-expectations (2.0.1)
|
148
|
+
diff-lcs (>= 1.1.2)
|
149
|
+
rspec-mocks (2.0.1)
|
150
|
+
rspec-core (~> 2.0.1)
|
151
|
+
rspec-expectations (~> 2.0.1)
|
152
|
+
ruby-openid (2.1.8)
|
153
|
+
ruby-openid-apps-discovery (1.2.0)
|
154
|
+
ruby-openid (>= 2.1.7)
|
155
|
+
rubyntlm (0.1.1)
|
156
|
+
rubyzip (0.9.4)
|
157
|
+
selenium-webdriver (0.1.4)
|
158
|
+
childprocess (>= 0.1.7)
|
159
|
+
ffi (>= 1.0.7)
|
160
|
+
json_pure
|
161
|
+
rubyzip
|
162
|
+
sqlite3 (1.3.3)
|
163
|
+
thor (0.14.6)
|
164
|
+
treetop (1.4.9)
|
165
|
+
polyglot (>= 0.3.1)
|
166
|
+
tzinfo (0.3.25)
|
167
|
+
webmock (1.3.5)
|
168
|
+
addressable (>= 2.1.1)
|
169
|
+
crack (>= 0.1.7)
|
170
|
+
xpath (0.1.3)
|
171
|
+
nokogiri (~> 1.3)
|
172
|
+
|
173
|
+
PLATFORMS
|
174
|
+
ruby
|
175
|
+
|
176
|
+
DEPENDENCIES
|
177
|
+
capybara (>= 0.4.0)
|
178
|
+
json (~> 1.4.3)
|
179
|
+
mg (~> 0.0.8)
|
180
|
+
omniauth
|
181
|
+
omniauth_china!
|
182
|
+
rack
|
183
|
+
rack-test (~> 0.5.4)
|
184
|
+
rails (= 3.0.3)
|
185
|
+
rake
|
186
|
+
rspec (~> 2.0.0)
|
187
|
+
sqlite3
|
188
|
+
webmock (~> 1.3.4)
|
data/Rakefile
CHANGED
@@ -1,2 +1,14 @@
|
|
1
|
+
require 'rubygems'
|
1
2
|
require 'bundler'
|
2
|
-
Bundler
|
3
|
+
Bundler.setup
|
4
|
+
require 'rake'
|
5
|
+
|
6
|
+
require 'mg'
|
7
|
+
MG.new('omniauth_china.gemspec')
|
8
|
+
|
9
|
+
require 'rspec/core/rake_task'
|
10
|
+
RSpec::Core::RakeTask.new(:spec) do |s|
|
11
|
+
s.rspec_opts = "--format=#{ENV['RSPEC_FORMAT'] || 'nested'} --colour"
|
12
|
+
end
|
13
|
+
|
14
|
+
task :default => :spec
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
|
+
|
3
|
+
describe OmniAuth::Strategies::Douban do
|
4
|
+
|
5
|
+
def app
|
6
|
+
Rack::Builder.new {
|
7
|
+
use OmniAuth::Test::PhonySession
|
8
|
+
use OmniAuth::Builder do
|
9
|
+
provider :douban, 'abc', 'def'
|
10
|
+
end
|
11
|
+
run lambda { |env| [200, {'Content-Type' => 'text/plain'}, [env.key?('omniauth.auth').to_s]] }
|
12
|
+
}.to_app
|
13
|
+
end
|
14
|
+
|
15
|
+
def session
|
16
|
+
last_request.env['rack.session']
|
17
|
+
end
|
18
|
+
|
19
|
+
before do
|
20
|
+
stub_request(:post, 'http://www.douban.com/service/auth/request_token').
|
21
|
+
to_return(:body => "oauth_token=yourtoken&oauth_token_secret=yoursecret&oauth_callback_confirmed=false")
|
22
|
+
end
|
23
|
+
|
24
|
+
describe '/auth/{name}' do
|
25
|
+
before do
|
26
|
+
get '/auth/douban'
|
27
|
+
end
|
28
|
+
it 'should redirect to authorize_url' do
|
29
|
+
last_response.should be_redirect
|
30
|
+
oauth_callback = CGI.escape('http://example.org/auth/douban/callback')
|
31
|
+
last_response.headers['Location'].should == "http://www.douban.com/service/auth/authorize?oauth_callback=#{oauth_callback}&oauth_token=yourtoken"
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'should set appropriate session variables' do
|
35
|
+
session[:oauth].should == {:douban => {:callback_confirmed => false, :request_token => 'yourtoken', :request_secret => 'yoursecret'}}
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
it_should_behave_like 'an oauth strategy'
|
40
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
Bundler.setup
|
4
|
+
require 'rspec'
|
5
|
+
require 'rspec/autorun'
|
6
|
+
require 'webmock/rspec'
|
7
|
+
require 'rack/test'
|
8
|
+
require 'omniauth/core'
|
9
|
+
require 'omniauth/test'
|
10
|
+
require 'omniauth/oauth'
|
11
|
+
require 'omniauth_china/oauth_china'
|
12
|
+
|
13
|
+
Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f}
|
14
|
+
|
15
|
+
RSpec.configure do |config|
|
16
|
+
config.include WebMock
|
17
|
+
config.include Rack::Test::Methods
|
18
|
+
config.extend OmniAuth::Test::StrategyMacros, :type => :strategy
|
19
|
+
end
|
20
|
+
|
21
|
+
def strategy_class
|
22
|
+
meta = self.class.metadata
|
23
|
+
while meta.key?(:example_group)
|
24
|
+
meta = meta[:example_group]
|
25
|
+
end
|
26
|
+
meta[:describes]
|
27
|
+
end
|
28
|
+
|
29
|
+
def app
|
30
|
+
lambda{|env| [200, {}, ['Hello']]}
|
31
|
+
end
|
32
|
+
|
33
|
+
WebMock.disable_net_connect!
|
@@ -0,0 +1,29 @@
|
|
1
|
+
shared_examples_for "an oauth strategy" do
|
2
|
+
it 'should be initializable with only three arguments' do
|
3
|
+
lambda{ strategy_class.new(lambda{|env| [200, {}, ['Hello World']]}, 'key', 'secret') }.should_not raise_error
|
4
|
+
end
|
5
|
+
|
6
|
+
it 'should be initializable with a block' do
|
7
|
+
lambda{ strategy_class.new(lambda{|env| [200, {}, ['Hello World']]}){|s| s.consumer_key = 'abc'} }.should_not raise_error
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'should handle the setting of client options' do
|
11
|
+
s = strategy_class.new(lambda{|env| [200, {}, ['Hello World']]}, 'key', 'secret', :client_options => {:abc => 'def'})
|
12
|
+
s.consumer.options[:abc].should == 'def'
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
shared_examples_for "an oauth2 strategy" do
|
17
|
+
it 'should be initializable with only three arguments' do
|
18
|
+
lambda{ strategy_class.new(lambda{|env| [200, {}, ['Hello World']]}, 'key', 'secret') }.should_not raise_error
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'should be initializable with a block' do
|
22
|
+
lambda{ strategy_class.new(lambda{|env| [200, {}, ['Hello World']]}){|s| s.client_id = 'abc'} }.should_not raise_error
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'should handle the setting of client options' do
|
26
|
+
s = strategy_class.new(lambda{|env| [200, {}, ['Hello World']]}, 'key', 'secret', :client_options => {:abc => 'def'})
|
27
|
+
s.client.options[:abc].should == 'def'
|
28
|
+
end
|
29
|
+
end
|
data/test/dummy/Rakefile
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
2
|
+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
3
|
+
|
4
|
+
require File.expand_path('../config/application', __FILE__)
|
5
|
+
require 'rake'
|
6
|
+
|
7
|
+
Dummy::Application.load_tasks
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
require "active_model/railtie"
|
4
|
+
require "active_record/railtie"
|
5
|
+
require "action_controller/railtie"
|
6
|
+
require "action_view/railtie"
|
7
|
+
require "action_mailer/railtie"
|
8
|
+
|
9
|
+
Bundler.require
|
10
|
+
require "omniauth_china"
|
11
|
+
|
12
|
+
module Dummy
|
13
|
+
class Application < Rails::Application
|
14
|
+
# Settings in config/environments/* take precedence over those specified here.
|
15
|
+
# Application configuration should go into files in config/initializers
|
16
|
+
# -- all .rb files in that directory are automatically loaded.
|
17
|
+
|
18
|
+
# Custom directories with classes and modules you want to be autoloadable.
|
19
|
+
# config.autoload_paths += %W(#{config.root}/extras)
|
20
|
+
|
21
|
+
# Only load the plugins named here, in the order given (default is alphabetical).
|
22
|
+
# :all can be used as a placeholder for all plugins not explicitly named.
|
23
|
+
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
24
|
+
|
25
|
+
# Activate observers that should always be running.
|
26
|
+
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
27
|
+
|
28
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
29
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
30
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
31
|
+
|
32
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
33
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
34
|
+
# config.i18n.default_locale = :de
|
35
|
+
|
36
|
+
# JavaScript files you want as :defaults (application.js is always included).
|
37
|
+
# config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
|
38
|
+
|
39
|
+
# Configure the default encoding used in templates for Ruby 1.9.
|
40
|
+
config.encoding = "utf-8"
|
41
|
+
|
42
|
+
# Configure sensitive parameters which will be filtered from the log file.
|
43
|
+
config.filter_parameters += [:password]
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# SQLite version 3.x
|
2
|
+
# gem install sqlite3-ruby (not necessary on OS X Leopard)
|
3
|
+
development:
|
4
|
+
adapter: sqlite3
|
5
|
+
database: db/development.sqlite3
|
6
|
+
pool: 5
|
7
|
+
timeout: 5000
|
8
|
+
|
9
|
+
# Warning: The database defined as "test" will be erased and
|
10
|
+
# re-generated from your development database when you run "rake".
|
11
|
+
# Do not set this db to the same as development or production.
|
12
|
+
test:
|
13
|
+
adapter: sqlite3
|
14
|
+
database: db/test.sqlite3
|
15
|
+
pool: 5
|
16
|
+
timeout: 5000
|
17
|
+
|
18
|
+
production:
|
19
|
+
adapter: sqlite3
|
20
|
+
database: db/production.sqlite3
|
21
|
+
pool: 5
|
22
|
+
timeout: 5000
|
@@ -0,0 +1,26 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.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_view.debug_rjs = true
|
15
|
+
config.action_controller.perform_caching = false
|
16
|
+
|
17
|
+
# Don't care if the mailer can't send
|
18
|
+
config.action_mailer.raise_delivery_errors = false
|
19
|
+
|
20
|
+
# Print deprecation notices to the Rails logger
|
21
|
+
config.active_support.deprecation = :log
|
22
|
+
|
23
|
+
# Only use best-standards-support built into browsers
|
24
|
+
config.action_dispatch.best_standards_support = :builtin
|
25
|
+
end
|
26
|
+
|
@@ -0,0 +1,49 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# The production environment is meant for finished, "live" apps.
|
5
|
+
# Code is not reloaded between requests
|
6
|
+
config.cache_classes = true
|
7
|
+
|
8
|
+
# Full error reports are disabled and caching is turned on
|
9
|
+
config.consider_all_requests_local = false
|
10
|
+
config.action_controller.perform_caching = true
|
11
|
+
|
12
|
+
# Specifies the header that your server uses for sending files
|
13
|
+
config.action_dispatch.x_sendfile_header = "X-Sendfile"
|
14
|
+
|
15
|
+
# For nginx:
|
16
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
|
17
|
+
|
18
|
+
# If you have no front-end server that supports something like X-Sendfile,
|
19
|
+
# just comment this out and Rails will serve the files
|
20
|
+
|
21
|
+
# See everything in the log (default is :info)
|
22
|
+
# config.log_level = :debug
|
23
|
+
|
24
|
+
# Use a different logger for distributed setups
|
25
|
+
# config.logger = SyslogLogger.new
|
26
|
+
|
27
|
+
# Use a different cache store in production
|
28
|
+
# config.cache_store = :mem_cache_store
|
29
|
+
|
30
|
+
# Disable Rails's static asset server
|
31
|
+
# In production, Apache or nginx will already do this
|
32
|
+
config.serve_static_assets = false
|
33
|
+
|
34
|
+
# Enable serving of images, stylesheets, and javascripts from an asset server
|
35
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
36
|
+
|
37
|
+
# Disable delivery errors, bad email addresses will be ignored
|
38
|
+
# config.action_mailer.raise_delivery_errors = false
|
39
|
+
|
40
|
+
# Enable threaded mode
|
41
|
+
# config.threadsafe!
|
42
|
+
|
43
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
44
|
+
# the I18n.default_locale when a translation can not be found)
|
45
|
+
config.i18n.fallbacks = true
|
46
|
+
|
47
|
+
# Send deprecation notices to registered listeners
|
48
|
+
config.active_support.deprecation = :notify
|
49
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.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
|
+
Dummy::Application.config.secret_token = '6d8630a042b67aa62b6a559b7886f30ea38c7a849dd478c00858826590b3d84dafd05d8f4395c7188911d3752d8fa5c9dd438fc657e7cb24c20d04d92390fdc2'
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
Dummy::Application.config.session_store :cookie_store, :key => '_dummy_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
|
+
# Dummy::Application.config.session_store :active_record_store
|