share_checker 0.1.1 → 0.1.2
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/Gemfile +4 -6
- data/lib/share_checker/provider.rb +23 -0
- data/lib/share_checker/providers/facebook.rb +2 -4
- data/lib/share_checker/providers/tweetracker.rb +2 -13
- data/lib/share_checker/providers/twitter.rb +2 -2
- data/lib/share_checker/providers/vkontakte.rb +2 -4
- data/lib/share_checker/version.rb +1 -1
- data/lib/share_checker.rb +3 -1
- data/spec/spec_helper.rb +4 -19
- metadata +22 -110
- data/spec/dummy/Rakefile +0 -7
- data/spec/dummy/app/controllers/application_controller.rb +0 -3
- data/spec/dummy/app/helpers/application_helper.rb +0 -2
- data/spec/dummy/app/views/layouts/application.html.erb +0 -14
- data/spec/dummy/config/application.rb +0 -45
- data/spec/dummy/config/boot.rb +0 -10
- data/spec/dummy/config/database.yml +0 -22
- data/spec/dummy/config/environment.rb +0 -5
- data/spec/dummy/config/environments/development.rb +0 -26
- data/spec/dummy/config/environments/production.rb +0 -49
- data/spec/dummy/config/environments/test.rb +0 -35
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy/config/initializers/inflections.rb +0 -10
- data/spec/dummy/config/initializers/mime_types.rb +0 -5
- data/spec/dummy/config/initializers/secret_token.rb +0 -7
- data/spec/dummy/config/initializers/session_store.rb +0 -8
- data/spec/dummy/config/locales/en.yml +0 -5
- data/spec/dummy/config/routes.rb +0 -58
- data/spec/dummy/config.ru +0 -4
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +0 -0
- data/spec/dummy/log/production.log +0 -0
- data/spec/dummy/log/server.log +0 -0
- data/spec/dummy/log/test.log +0 -95
- data/spec/dummy/public/404.html +0 -26
- data/spec/dummy/public/422.html +0 -26
- data/spec/dummy/public/500.html +0 -26
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/javascripts/application.js +0 -2
- data/spec/dummy/public/javascripts/controls.js +0 -965
- data/spec/dummy/public/javascripts/dragdrop.js +0 -974
- data/spec/dummy/public/javascripts/effects.js +0 -1123
- data/spec/dummy/public/javascripts/prototype.js +0 -6001
- data/spec/dummy/public/javascripts/rails.js +0 -191
- data/spec/dummy/script/rails +0 -6
- data/spec/integration/navigation_spec.rb +0 -9
data/Gemfile
CHANGED
@@ -1,14 +1,12 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
2
|
|
3
|
-
gem "
|
4
|
-
gem "
|
5
|
-
gem "sqlite3"
|
6
|
-
|
7
|
-
gem "nokogiri"
|
3
|
+
gem "activesupport"
|
4
|
+
gem "i18n"
|
8
5
|
gem "crack"
|
9
6
|
gem "curb"
|
10
7
|
|
11
|
-
gem "rspec-rails", "~> 2.6.1"
|
8
|
+
#gem "rspec-rails", "~> 2.6.1"
|
9
|
+
gem "rspec", "~> 2.6.0", :require => "spec"
|
12
10
|
|
13
11
|
# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
|
14
12
|
# gem 'ruby-debug'
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'curb'
|
2
|
+
require 'crack'
|
2
3
|
|
3
4
|
module ShareChecker
|
4
5
|
class Provider
|
@@ -25,6 +26,28 @@ module ShareChecker
|
|
25
26
|
raise NotImplementedError, "Must be overwritten in subclasses"
|
26
27
|
end
|
27
28
|
|
29
|
+
def parse_xml(body)
|
30
|
+
begin
|
31
|
+
content = Crack::XML.parse(body)
|
32
|
+
rescue Exception => e
|
33
|
+
puts "#{@name} error parse xml: #{body}, #{e.message}, #{@link}"
|
34
|
+
content = nil
|
35
|
+
end
|
36
|
+
|
37
|
+
return content
|
38
|
+
end
|
39
|
+
|
40
|
+
def parse_json(body)
|
41
|
+
begin
|
42
|
+
content = Crack::JSON.parse(body)
|
43
|
+
rescue Exception => e
|
44
|
+
puts "#{@name} error parse xml: #{body}, #{e.message}, #{@link}"
|
45
|
+
content = nil
|
46
|
+
end
|
47
|
+
|
48
|
+
return content
|
49
|
+
end
|
50
|
+
|
28
51
|
def method_missing(method_name, *args, &block)
|
29
52
|
if @options.key?(method_name.to_sym)
|
30
53
|
@options[method_name.to_sym]
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'nokogiri'
|
2
|
-
|
3
1
|
module ShareChecker
|
4
2
|
module Providers
|
5
3
|
class Facebook < Provider
|
@@ -20,8 +18,8 @@ module ShareChecker
|
|
20
18
|
# </links_getStats_response>
|
21
19
|
#
|
22
20
|
def parse(response)
|
23
|
-
doc =
|
24
|
-
doc.
|
21
|
+
doc = parse_xml(response)
|
22
|
+
doc.nil? ? 0 : doc["links_getStats_response"]["link_stat"]["like_count"].to_i
|
25
23
|
end
|
26
24
|
|
27
25
|
def url
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'crack/json'
|
2
|
-
|
3
1
|
module ShareChecker
|
4
2
|
module Providers
|
5
3
|
class Tweetracker < Provider
|
@@ -14,17 +12,8 @@ module ShareChecker
|
|
14
12
|
# }
|
15
13
|
#
|
16
14
|
def parse(response)
|
17
|
-
|
18
|
-
|
19
|
-
begin
|
20
|
-
obj = Crack::JSON.parse(response)
|
21
|
-
count = (obj["users"] ? obj["users"].to_i : 0)
|
22
|
-
rescue Exception => e
|
23
|
-
puts "Error parse json: #{response}, #{e.message}"
|
24
|
-
count = 0
|
25
|
-
end
|
26
|
-
|
27
|
-
return count
|
15
|
+
doc = parse_json(response)
|
16
|
+
doc.nil? ? 0 : doc["users"].to_i
|
28
17
|
end
|
29
18
|
|
30
19
|
def url
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'crack/json'
|
2
|
-
|
3
1
|
module ShareChecker
|
4
2
|
module Providers
|
5
3
|
class Vkontakte < Provider
|
@@ -9,8 +7,8 @@ module ShareChecker
|
|
9
7
|
# {"response":{"count":1054,"users":[136685987,30523343,144263601,9428152,67880464,9770301,5702433,...]}}
|
10
8
|
#
|
11
9
|
def parse(response)
|
12
|
-
|
13
|
-
|
10
|
+
doc = parse_json(response)
|
11
|
+
doc.nil? ? 0 : doc["response"]["count"].to_i
|
14
12
|
end
|
15
13
|
|
16
14
|
def url
|
data/lib/share_checker.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1,23 +1,8 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require "rubygems"
|
2
|
+
require "bundler/setup"
|
3
3
|
|
4
|
-
|
5
|
-
require "
|
6
|
-
require "rspec/rails"
|
7
|
-
|
8
|
-
ActionMailer::Base.delivery_method = :test
|
9
|
-
ActionMailer::Base.perform_deliveries = true
|
10
|
-
ActionMailer::Base.default_url_options[:host] = "test.com"
|
11
|
-
|
12
|
-
Rails.backtrace_cleaner.remove_silencers!
|
13
|
-
|
14
|
-
# Configure capybara for integration testing
|
15
|
-
require "capybara/rails"
|
16
|
-
Capybara.default_driver = :rack_test
|
17
|
-
Capybara.default_selector = :css
|
18
|
-
|
19
|
-
# Run any available migration
|
20
|
-
ActiveRecord::Migrator.migrate File.expand_path("../dummy/db/migrate/", __FILE__)
|
4
|
+
$:.push File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
|
5
|
+
require "share_checker"
|
21
6
|
|
22
7
|
# Load support files
|
23
8
|
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: share_checker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 2
|
10
|
+
version: 0.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Igor Galeta
|
@@ -16,8 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-10-
|
20
|
-
default_executable:
|
19
|
+
date: 2011-10-08 00:00:00 Z
|
21
20
|
dependencies:
|
22
21
|
- !ruby/object:Gem::Dependency
|
23
22
|
name: activesupport
|
@@ -34,7 +33,7 @@ dependencies:
|
|
34
33
|
type: :runtime
|
35
34
|
version_requirements: *id001
|
36
35
|
- !ruby/object:Gem::Dependency
|
37
|
-
name:
|
36
|
+
name: crack
|
38
37
|
prerelease: false
|
39
38
|
requirement: &id002 !ruby/object:Gem::Requirement
|
40
39
|
none: false
|
@@ -48,7 +47,7 @@ dependencies:
|
|
48
47
|
type: :runtime
|
49
48
|
version_requirements: *id002
|
50
49
|
- !ruby/object:Gem::Dependency
|
51
|
-
name:
|
50
|
+
name: curb
|
52
51
|
prerelease: false
|
53
52
|
requirement: &id003 !ruby/object:Gem::Requirement
|
54
53
|
none: false
|
@@ -61,20 +60,6 @@ dependencies:
|
|
61
60
|
version: "0"
|
62
61
|
type: :runtime
|
63
62
|
version_requirements: *id003
|
64
|
-
- !ruby/object:Gem::Dependency
|
65
|
-
name: curb
|
66
|
-
prerelease: false
|
67
|
-
requirement: &id004 !ruby/object:Gem::Requirement
|
68
|
-
none: false
|
69
|
-
requirements:
|
70
|
-
- - ">="
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
hash: 3
|
73
|
-
segments:
|
74
|
-
- 0
|
75
|
-
version: "0"
|
76
|
-
type: :runtime
|
77
|
-
version_requirements: *id004
|
78
63
|
description: Insert ShareChecker description.
|
79
64
|
email: galeta.igor@gmail.com
|
80
65
|
executables: []
|
@@ -84,63 +69,26 @@ extensions: []
|
|
84
69
|
extra_rdoc_files:
|
85
70
|
- README.rdoc
|
86
71
|
files:
|
87
|
-
- lib/share_checker
|
88
|
-
- lib/share_checker/
|
89
|
-
- lib/share_checker/providers/facebook.rb
|
72
|
+
- lib/share_checker.rb
|
73
|
+
- lib/share_checker/config.rb
|
90
74
|
- lib/share_checker/providers/odnoklassniki.rb
|
75
|
+
- lib/share_checker/providers/tweetracker.rb
|
91
76
|
- lib/share_checker/providers/vkontakte.rb
|
92
|
-
- lib/share_checker/
|
77
|
+
- lib/share_checker/providers/facebook.rb
|
78
|
+
- lib/share_checker/providers/twitter.rb
|
93
79
|
- lib/share_checker/version.rb
|
94
80
|
- lib/share_checker/provider.rb
|
95
|
-
- lib/share_checker.rb
|
96
81
|
- MIT-LICENSE
|
97
82
|
- Rakefile
|
98
83
|
- Gemfile
|
99
84
|
- README.rdoc
|
100
|
-
- spec/
|
101
|
-
- spec/dummy/public/500.html
|
102
|
-
- spec/dummy/public/404.html
|
103
|
-
- spec/dummy/public/favicon.ico
|
104
|
-
- spec/dummy/public/javascripts/application.js
|
105
|
-
- spec/dummy/public/javascripts/dragdrop.js
|
106
|
-
- spec/dummy/public/javascripts/effects.js
|
107
|
-
- spec/dummy/public/javascripts/prototype.js
|
108
|
-
- spec/dummy/public/javascripts/controls.js
|
109
|
-
- spec/dummy/public/javascripts/rails.js
|
110
|
-
- spec/dummy/public/422.html
|
111
|
-
- spec/dummy/app/views/layouts/application.html.erb
|
112
|
-
- spec/dummy/app/helpers/application_helper.rb
|
113
|
-
- spec/dummy/app/controllers/application_controller.rb
|
114
|
-
- spec/dummy/log/production.log
|
115
|
-
- spec/dummy/log/server.log
|
116
|
-
- spec/dummy/log/test.log
|
117
|
-
- spec/dummy/log/development.log
|
118
|
-
- spec/dummy/Rakefile
|
119
|
-
- spec/dummy/script/rails
|
120
|
-
- spec/dummy/config/routes.rb
|
121
|
-
- spec/dummy/config/environments/production.rb
|
122
|
-
- spec/dummy/config/environments/test.rb
|
123
|
-
- spec/dummy/config/environments/development.rb
|
124
|
-
- spec/dummy/config/boot.rb
|
125
|
-
- spec/dummy/config/application.rb
|
126
|
-
- spec/dummy/config/database.yml
|
127
|
-
- spec/dummy/config/initializers/session_store.rb
|
128
|
-
- spec/dummy/config/initializers/inflections.rb
|
129
|
-
- spec/dummy/config/initializers/mime_types.rb
|
130
|
-
- spec/dummy/config/initializers/backtrace_silencers.rb
|
131
|
-
- spec/dummy/config/initializers/secret_token.rb
|
132
|
-
- spec/dummy/config/environment.rb
|
133
|
-
- spec/dummy/config/locales/en.yml
|
134
|
-
- spec/dummy/db/test.sqlite3
|
135
|
-
- spec/dummy/config.ru
|
136
|
-
- spec/providers/twitter_spec.rb
|
137
|
-
- spec/providers/facebook_spec.rb
|
138
|
-
- spec/providers/odnoklassniki_spec.rb
|
139
|
-
- spec/providers/tweetracker_spec.rb
|
85
|
+
- spec/spec_helper.rb
|
140
86
|
- spec/providers/vkontakte_spec.rb
|
87
|
+
- spec/providers/tweetracker_spec.rb
|
88
|
+
- spec/providers/odnoklassniki_spec.rb
|
89
|
+
- spec/providers/facebook_spec.rb
|
90
|
+
- spec/providers/twitter_spec.rb
|
141
91
|
- spec/share_checker_spec.rb
|
142
|
-
- spec/spec_helper.rb
|
143
|
-
has_rdoc: true
|
144
92
|
homepage: https://github.com/galetahub/share_checker
|
145
93
|
licenses: []
|
146
94
|
|
@@ -170,51 +118,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
170
118
|
requirements: []
|
171
119
|
|
172
120
|
rubyforge_project:
|
173
|
-
rubygems_version: 1.
|
121
|
+
rubygems_version: 1.8.10
|
174
122
|
signing_key:
|
175
123
|
specification_version: 3
|
176
124
|
summary: Insert ShareChecker summary.
|
177
125
|
test_files:
|
178
|
-
- spec/
|
179
|
-
- spec/dummy/public/500.html
|
180
|
-
- spec/dummy/public/404.html
|
181
|
-
- spec/dummy/public/favicon.ico
|
182
|
-
- spec/dummy/public/javascripts/application.js
|
183
|
-
- spec/dummy/public/javascripts/dragdrop.js
|
184
|
-
- spec/dummy/public/javascripts/effects.js
|
185
|
-
- spec/dummy/public/javascripts/prototype.js
|
186
|
-
- spec/dummy/public/javascripts/controls.js
|
187
|
-
- spec/dummy/public/javascripts/rails.js
|
188
|
-
- spec/dummy/public/422.html
|
189
|
-
- spec/dummy/app/views/layouts/application.html.erb
|
190
|
-
- spec/dummy/app/helpers/application_helper.rb
|
191
|
-
- spec/dummy/app/controllers/application_controller.rb
|
192
|
-
- spec/dummy/log/production.log
|
193
|
-
- spec/dummy/log/server.log
|
194
|
-
- spec/dummy/log/test.log
|
195
|
-
- spec/dummy/log/development.log
|
196
|
-
- spec/dummy/Rakefile
|
197
|
-
- spec/dummy/script/rails
|
198
|
-
- spec/dummy/config/routes.rb
|
199
|
-
- spec/dummy/config/environments/production.rb
|
200
|
-
- spec/dummy/config/environments/test.rb
|
201
|
-
- spec/dummy/config/environments/development.rb
|
202
|
-
- spec/dummy/config/boot.rb
|
203
|
-
- spec/dummy/config/application.rb
|
204
|
-
- spec/dummy/config/database.yml
|
205
|
-
- spec/dummy/config/initializers/session_store.rb
|
206
|
-
- spec/dummy/config/initializers/inflections.rb
|
207
|
-
- spec/dummy/config/initializers/mime_types.rb
|
208
|
-
- spec/dummy/config/initializers/backtrace_silencers.rb
|
209
|
-
- spec/dummy/config/initializers/secret_token.rb
|
210
|
-
- spec/dummy/config/environment.rb
|
211
|
-
- spec/dummy/config/locales/en.yml
|
212
|
-
- spec/dummy/db/test.sqlite3
|
213
|
-
- spec/dummy/config.ru
|
214
|
-
- spec/providers/twitter_spec.rb
|
215
|
-
- spec/providers/facebook_spec.rb
|
216
|
-
- spec/providers/odnoklassniki_spec.rb
|
217
|
-
- spec/providers/tweetracker_spec.rb
|
126
|
+
- spec/spec_helper.rb
|
218
127
|
- spec/providers/vkontakte_spec.rb
|
128
|
+
- spec/providers/tweetracker_spec.rb
|
129
|
+
- spec/providers/odnoklassniki_spec.rb
|
130
|
+
- spec/providers/facebook_spec.rb
|
131
|
+
- spec/providers/twitter_spec.rb
|
219
132
|
- spec/share_checker_spec.rb
|
220
|
-
- spec/spec_helper.rb
|
data/spec/dummy/Rakefile
DELETED
@@ -1,7 +0,0 @@
|
|
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
|
@@ -1,45 +0,0 @@
|
|
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 "share_checker"
|
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
|
data/spec/dummy/config/boot.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
# SQLite version 3.x
|
2
|
-
# gem install sqlite3
|
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
|
@@ -1,26 +0,0 @@
|
|
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
|
-
|
@@ -1,49 +0,0 @@
|
|
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
|
@@ -1,35 +0,0 @@
|
|
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
|
@@ -1,7 +0,0 @@
|
|
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!
|
@@ -1,10 +0,0 @@
|
|
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
|
@@ -1,7 +0,0 @@
|
|
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 = '074938f674f9042280fec72204a7edcd21dad25a1248ba81fe9126c7731dde694dc9a629ff56accd2e670bf10886f74a01f62c564904874bd9ff79ab0cc2efc3'
|
@@ -1,8 +0,0 @@
|
|
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
|