jpmobile 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. data/.gitignore +6 -0
  2. data/{test/rails/rails_root/vendor/plugins/jpmobile/MIT-LICENSE → MIT-LICENSE} +0 -0
  3. data/README.rdoc +16 -6
  4. data/Rakefile +14 -0
  5. data/VERSION.yml +4 -0
  6. data/init.rb +3 -0
  7. data/install.rb +1 -0
  8. data/jpmobile.gemspec +299 -0
  9. data/lib/jpmobile.rb +0 -2
  10. data/lib/jpmobile/emoticon.rb +16 -2
  11. data/lib/jpmobile/emoticon/z_combine.rb +17 -4
  12. data/lib/jpmobile/filter.rb +2 -3
  13. data/lib/jpmobile/mobile/abstract_mobile.rb +6 -0
  14. data/lib/jpmobile/mobile/docomo.rb +24 -1
  15. data/lib/jpmobile/mobile/z_ip_addresses_au.rb +3 -2
  16. data/lib/jpmobile/mobile/z_ip_addresses_docomo.rb +4 -1
  17. data/lib/jpmobile/request_with_mobile.rb +4 -1
  18. data/{test/rails/rails_root/vendor/plugins/jpmobile/spec → spec}/spec.opts +0 -0
  19. data/spec/spec_helper.rb +36 -0
  20. data/spec/unit/detect_by_email_spec.rb +31 -0
  21. data/{test/rails/rails_root/vendor/plugins/jpmobile/spec → spec}/unit/detect_by_ua_spec.rb +11 -13
  22. data/spec/unit/is_carrier_spec.rb +93 -0
  23. data/spec/unit/spec_helper.rb +5 -0
  24. data/spec/unit/util_spec.rb +30 -0
  25. data/spec/unit/valid_ip_spec.rb +60 -0
  26. data/{test/rails/rails_root/vendor/plugins/jpmobile/tasks → tasks}/jpmobile_tasks.rake +3 -3
  27. data/test/legacy/autoload_test.rb +2 -1
  28. data/test/legacy/docomo_test.rb +39 -0
  29. data/test/legacy/emoticon_functional_test.rb +21 -19
  30. data/test/legacy/emoticon_test.rb +12 -12
  31. data/test/legacy/filter_test.rb +10 -8
  32. data/test/legacy/helper.rb +32 -3
  33. data/test/legacy/softbank_test.rb +2 -0
  34. data/test/rails/.gitignore +1 -0
  35. data/test/rails/overrides/app/controllers/filter_controller.rb +10 -0
  36. data/test/rails/overrides/spec/controllers/docomo_guid_spec.rb +2 -0
  37. data/test/rails/overrides/spec/controllers/docomo_spec.rb +2 -0
  38. data/test/rails/overrides/spec/controllers/emobile_spec.rb +2 -0
  39. data/test/rails/overrides/spec/controllers/filter_spec.rb +8 -7
  40. data/test/rails/overrides/spec/controllers/pc_spec.rb +2 -0
  41. data/test/rails/overrides/spec/controllers/softbank_emulator_spec.rb +2 -0
  42. data/test/rails/overrides/spec/controllers/template_path_spec.rb +2 -0
  43. data/test/rails/overrides/spec/controllers/trans_sid_spec.rb +1 -0
  44. data/test/rails/overrides/spec/helpers/helpers_spec.rb +2 -0
  45. data/test/rails/overrides/spec/spec_helper.rb +15 -0
  46. data/test/rails/rails_root/app/controllers/filter_controller.rb +0 -23
  47. data/test/rails/rails_root/app/controllers/mobile_spec_controller.rb +1 -1
  48. data/test/rails/rails_root/app/controllers/template_path_controller.rb +3 -0
  49. data/test/rails/rails_root/app/helpers/application_helper.rb +0 -1
  50. data/test/rails/rails_root/config/boot.rb +13 -110
  51. data/test/rails/rails_root/config/environment.rb +4 -41
  52. data/test/rails/rails_root/config/environments/development.rb +22 -13
  53. data/test/rails/rails_root/config/environments/production.rb +41 -20
  54. data/test/rails/rails_root/config/environments/test.rb +35 -28
  55. data/test/rails/rails_root/config/initializers/backtrace_silencers.rb +2 -2
  56. data/test/rails/rails_root/config/initializers/inflections.rb +1 -1
  57. data/test/rails/rails_root/config/initializers/session_store.rb +2 -15
  58. data/test/rails/rails_root/config/routes.rb +6 -42
  59. data/test/rails/rails_root/db/schema.rb +24 -7
  60. data/test/rails/rails_root/db/seeds.rb +2 -2
  61. data/test/rails/rails_root/spec/helpers/helpers_spec.rb +4 -2
  62. data/test/rails/rails_root/spec/spec_helper.rb +19 -35
  63. data/test/rails/rails_root/test/performance/browsing_test.rb +2 -2
  64. data/test/rails/rails_root/test/test_helper.rb +2 -27
  65. data/test/rails/rails_root/vendor/plugins/jpmobile/init.rb +1 -1
  66. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile.rb +39 -25
  67. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/docomo_guid.rb +2 -1
  68. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/email.rb +3 -4
  69. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/emoticon.rb +24 -8
  70. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/emoticon/conversion_table.rb +10 -9
  71. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/emoticon/z_combine.rb +17 -4
  72. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/filter.rb +43 -136
  73. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/helpers.rb +5 -18
  74. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/hook_action_controller.rb +24 -16
  75. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/hook_action_view.rb +42 -85
  76. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/abstract_mobile.rb +25 -2
  77. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/au.rb +28 -3
  78. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/display.rb +29 -26
  79. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/docomo.rb +60 -11
  80. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/softbank.rb +16 -41
  81. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/willcom.rb +1 -10
  82. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/z_ip_addresses_au.rb +3 -2
  83. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/z_ip_addresses_docomo.rb +4 -1
  84. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/position.rb +4 -3
  85. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/request_with_mobile.rb +14 -13
  86. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/trans_sid.rb +52 -35
  87. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/util.rb +68 -0
  88. data/test/rails/rails_root/vendor/plugins/jpmobile/spec/spec_helper.rb +3 -2
  89. data/test/rails/rails_root/vendor/plugins/jpmobile/spec/unit/detect_by_email_spec.rb +21 -27
  90. data/test/rails/rails_root/vendor/plugins/jpmobile/spec/unit/is_carrier_spec.rb +56 -84
  91. data/test/rails/rails_root/vendor/plugins/jpmobile/spec/unit/spec_helper.rb +1 -2
  92. data/test/rails/rails_root/vendor/plugins/jpmobile/spec/unit/util_spec.rb +8 -2
  93. data/test/rails/rails_root/vendor/plugins/jpmobile/spec/unit/valid_ip_spec.rb +43 -52
  94. data/test/rails/rails_root/vendor/plugins/jpmobile/tools/disabled_update_display_info_docomo.rb +0 -0
  95. data/test/rails/rails_root/vendor/plugins/jpmobile/tools/update_ip_addresses_au.rb +0 -0
  96. data/tools/emoji/genregexp.rb +47 -0
  97. metadata +348 -253
  98. data/test/rails/rails_root/README +0 -243
  99. data/test/rails/rails_root/Rakefile +0 -10
  100. data/test/rails/rails_root/app/controllers/docomo_guid_controller.rb +0 -13
  101. data/test/rails/rails_root/app/controllers/trans_sid_controller.rb +0 -28
  102. data/test/rails/rails_root/app/views/filter/index.html.erb +0 -0
  103. data/test/rails/rails_root/app/views/hankaku_filter/index.html.erb +0 -0
  104. data/test/rails/rails_root/app/views/template_path/_partial.html.erb +0 -1
  105. data/test/rails/rails_root/app/views/template_path/_partial_mobile.html.erb +0 -1
  106. data/test/rails/rails_root/app/views/template_path/_partial_mobile_docomo.html.erb +0 -1
  107. data/test/rails/rails_root/app/views/template_path/index.html.erb +0 -1
  108. data/test/rails/rails_root/app/views/template_path/index_mobile.html.erb +0 -1
  109. data/test/rails/rails_root/app/views/template_path/index_mobile_docomo.html.erb +0 -1
  110. data/test/rails/rails_root/app/views/template_path/partial.html.erb +0 -2
  111. data/test/rails/rails_root/config/database.yml +0 -22
  112. data/test/rails/rails_root/config/initializers/new_rails_defaults.rb +0 -21
  113. data/test/rails/rails_root/config/locales/en.yml +0 -5
  114. data/test/rails/rails_root/db/development.sqlite3 +0 -0
  115. data/test/rails/rails_root/db/test.sqlite3 +0 -0
  116. data/test/rails/rails_root/doc/README_FOR_APP +0 -2
  117. data/test/rails/rails_root/lib/tasks/rspec.rake +0 -165
  118. data/test/rails/rails_root/log/development.log +0 -38
  119. data/test/rails/rails_root/log/production.log +0 -0
  120. data/test/rails/rails_root/log/server.log +0 -0
  121. data/test/rails/rails_root/log/test.log +0 -451
  122. data/test/rails/rails_root/public/404.html +0 -30
  123. data/test/rails/rails_root/public/422.html +0 -30
  124. data/test/rails/rails_root/public/500.html +0 -30
  125. data/test/rails/rails_root/public/favicon.ico +0 -0
  126. data/test/rails/rails_root/public/images/rails.png +0 -0
  127. data/test/rails/rails_root/public/index.html +0 -275
  128. data/test/rails/rails_root/public/javascripts/application.js +0 -2
  129. data/test/rails/rails_root/public/javascripts/controls.js +0 -963
  130. data/test/rails/rails_root/public/javascripts/dragdrop.js +0 -973
  131. data/test/rails/rails_root/public/javascripts/effects.js +0 -1128
  132. data/test/rails/rails_root/public/javascripts/prototype.js +0 -4320
  133. data/test/rails/rails_root/public/robots.txt +0 -5
  134. data/test/rails/rails_root/script/about +0 -4
  135. data/test/rails/rails_root/script/console +0 -3
  136. data/test/rails/rails_root/script/dbconsole +0 -3
  137. data/test/rails/rails_root/script/destroy +0 -3
  138. data/test/rails/rails_root/script/generate +0 -3
  139. data/test/rails/rails_root/script/performance/benchmarker +0 -3
  140. data/test/rails/rails_root/script/performance/profiler +0 -3
  141. data/test/rails/rails_root/script/plugin +0 -3
  142. data/test/rails/rails_root/script/runner +0 -3
  143. data/test/rails/rails_root/script/server +0 -3
  144. data/test/rails/rails_root/spec/controllers/docomo_guid_spec.rb +0 -77
  145. data/test/rails/rails_root/spec/controllers/docomo_spec.rb +0 -28
  146. data/test/rails/rails_root/spec/controllers/emobile_spec.rb +0 -35
  147. data/test/rails/rails_root/spec/controllers/filter_spec.rb +0 -157
  148. data/test/rails/rails_root/spec/controllers/pc_spec.rb +0 -11
  149. data/test/rails/rails_root/spec/controllers/softbank_emulator_spec.rb +0 -40
  150. data/test/rails/rails_root/spec/controllers/template_path_spec.rb +0 -115
  151. data/test/rails/rails_root/spec/controllers/trans_sid_spec.rb +0 -99
  152. data/test/rails/rails_root/spec/rcov.opts +0 -2
  153. data/test/rails/rails_root/spec/rspec.rake +0 -165
  154. data/test/rails/rails_root/spec/spec.opts +0 -4
  155. data/test/rails/rails_root/vendor/plugins/jpmobile/CHANGELOG +0 -7
  156. data/test/rails/rails_root/vendor/plugins/jpmobile/README.rdoc +0 -239
  157. data/test/rails/rails_root/vendor/plugins/jpmobile/Rakefile +0 -116
  158. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/hook_request.rb +0 -5
  159. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/rack/auth.rb +0 -55
  160. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/rack/combined_logger.rb +0 -54
  161. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/rack/request.rb +0 -7
  162. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/rack/trans_sid.rb +0 -14
  163. data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/version.rb +0 -9
@@ -1,26 +1,3 @@
1
- class FilterControllerBase < ApplicationController
2
- def abracadabra_utf8
3
- render :text => "アブラカダブラ"
4
- end
5
- def abracadabra_xhtml_utf8
6
- response.content_type = "application/xhtml+xml"
7
- render :text => "アブラカダブラ"
8
- end
9
- def index
10
- @q = params[:q]
11
- end
12
- def empty
13
- render :text => ""
14
- end
15
- def rawdata
16
- send_data "アブラカダブラ", :type => 'application/octet-stream'
17
- end
18
- end
19
-
20
1
  class FilterController < FilterControllerBase
21
2
  mobile_filter
22
3
  end
23
-
24
- class HankakuFilterController < FilterControllerBase
25
- mobile_filter :hankaku => true
26
- end
@@ -1,5 +1,5 @@
1
1
  class MobileSpecController < ApplicationController
2
- def hello
2
+ def index
3
3
  render :text=>"Hello, world."
4
4
  end
5
5
  end
@@ -2,5 +2,8 @@ class TemplatePathController < ApplicationController
2
2
  def index
3
3
  @q = params[:q]
4
4
  end
5
+
6
+ def show
7
+ end
5
8
  end
6
9
 
@@ -1,3 +1,2 @@
1
- # Methods added to this helper will be available to all templates in the application.
2
1
  module ApplicationHelper
3
2
  end
@@ -1,110 +1,13 @@
1
- # Don't change this file!
2
- # Configure your app in config/environment.rb and config/environments/*.rb
3
-
4
- RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
5
-
6
- module Rails
7
- class << self
8
- def boot!
9
- unless booted?
10
- preinitialize
11
- pick_boot.run
12
- end
13
- end
14
-
15
- def booted?
16
- defined? Rails::Initializer
17
- end
18
-
19
- def pick_boot
20
- (vendor_rails? ? VendorBoot : GemBoot).new
21
- end
22
-
23
- def vendor_rails?
24
- File.exist?("#{RAILS_ROOT}/vendor/rails")
25
- end
26
-
27
- def preinitialize
28
- load(preinitializer_path) if File.exist?(preinitializer_path)
29
- end
30
-
31
- def preinitializer_path
32
- "#{RAILS_ROOT}/config/preinitializer.rb"
33
- end
34
- end
35
-
36
- class Boot
37
- def run
38
- load_initializer
39
- Rails::Initializer.run(:set_load_path)
40
- end
41
- end
42
-
43
- class VendorBoot < Boot
44
- def load_initializer
45
- require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
46
- Rails::Initializer.run(:install_gem_spec_stubs)
47
- Rails::GemDependency.add_frozen_gem_path
48
- end
49
- end
50
-
51
- class GemBoot < Boot
52
- def load_initializer
53
- self.class.load_rubygems
54
- load_rails_gem
55
- require 'initializer'
56
- end
57
-
58
- def load_rails_gem
59
- if version = self.class.gem_version
60
- gem 'rails', version
61
- else
62
- gem 'rails'
63
- end
64
- rescue Gem::LoadError => load_error
65
- $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
66
- exit 1
67
- end
68
-
69
- class << self
70
- def rubygems_version
71
- Gem::RubyGemsVersion rescue nil
72
- end
73
-
74
- def gem_version
75
- if defined? RAILS_GEM_VERSION
76
- RAILS_GEM_VERSION
77
- elsif ENV.include?('RAILS_GEM_VERSION')
78
- ENV['RAILS_GEM_VERSION']
79
- else
80
- parse_gem_version(read_environment_rb)
81
- end
82
- end
83
-
84
- def load_rubygems
85
- min_version = '1.3.2'
86
- require 'rubygems'
87
- unless rubygems_version >= min_version
88
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
89
- exit 1
90
- end
91
-
92
- rescue LoadError
93
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
94
- exit 1
95
- end
96
-
97
- def parse_gem_version(text)
98
- $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
99
- end
100
-
101
- private
102
- def read_environment_rb
103
- File.read("#{RAILS_ROOT}/config/environment.rb")
104
- end
105
- end
106
- end
107
- end
108
-
109
- # All that for this:
110
- Rails.boot!
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)
@@ -1,42 +1,5 @@
1
- # Be sure to restart your server when you modify this file
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
2
3
 
3
- # Specifies gem version of Rails to use when vendor/rails is not present
4
- RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
5
-
6
- # Bootstrap the Rails environment, frameworks, and default configuration
7
- require File.join(File.dirname(__FILE__), 'boot')
8
-
9
- Rails::Initializer.run do |config|
10
- # Settings in config/environments/* take precedence over those specified here.
11
- # Application configuration should go into files in config/initializers
12
- # -- all .rb files in that directory are automatically loaded.
13
-
14
- # Add additional load paths for your own custom dirs
15
- # config.load_paths += %W( #{RAILS_ROOT}/extras )
16
-
17
- # Specify gems that this application depends on and have them installed with rake gems:install
18
- # config.gem "bj"
19
- # config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
20
- # config.gem "sqlite3-ruby", :lib => "sqlite3"
21
- # config.gem "aws-s3", :lib => "aws/s3"
22
-
23
- # Only load the plugins named here, in the order given (default is alphabetical).
24
- # :all can be used as a placeholder for all plugins not explicitly named
25
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
26
-
27
- # Skip frameworks you're not going to use. To use Rails without a database,
28
- # you must remove the Active Record framework.
29
- # config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
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.
36
- config.time_zone = 'UTC'
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}')]
40
- # config.i18n.default_locale = :de
41
- end
42
- ActionController::Base.session = {:key => "_session_id", :cookie_only => false}
4
+ # Initialize the rails application
5
+ RailsRoot::Application.initialize!
@@ -1,17 +1,26 @@
1
- # Settings specified here will take precedence over those in config/environment.rb
1
+ RailsRoot::Application.configure do
2
+ # Settings specified here will take precedence over those in config/environment.rb
2
3
 
3
- # In the development environment your application's code is reloaded on
4
- # every request. This slows down response time but is perfect for development
5
- # since you don't have to restart the webserver when you make code changes.
6
- config.cache_classes = false
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
7
8
 
8
- # Log error messages when you accidentally call methods on nil.
9
- config.whiny_nils = true
9
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
10
11
 
11
- # Show full error reports and disable caching
12
- config.action_controller.consider_all_requests_local = true
13
- config.action_view.debug_rjs = true
14
- config.action_controller.perform_caching = false
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
15
26
 
16
- # Don't care if the mailer can't send
17
- config.action_mailer.raise_delivery_errors = false
@@ -1,28 +1,49 @@
1
- # Settings specified here will take precedence over those in config/environment.rb
1
+ RailsRoot::Application.configure do
2
+ # Settings specified here will take precedence over those in config/environment.rb
2
3
 
3
- # The production environment is meant for finished, "live" apps.
4
- # Code is not reloaded between requests
5
- config.cache_classes = true
4
+ # The production environment is meant for finished, "live" apps.
5
+ # Code is not reloaded between requests
6
+ config.cache_classes = true
6
7
 
7
- # Full error reports are disabled and caching is turned on
8
- config.action_controller.consider_all_requests_local = false
9
- config.action_controller.perform_caching = true
10
- config.action_view.cache_template_loading = true
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
11
 
12
- # See everything in the log (default is :info)
13
- # config.log_level = :debug
12
+ # Specifies the header that your server uses for sending files
13
+ config.action_dispatch.x_sendfile_header = "X-Sendfile"
14
14
 
15
- # Use a different logger for distributed setups
16
- # config.logger = SyslogLogger.new
15
+ # For nginx:
16
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
17
17
 
18
- # Use a different cache store in production
19
- # config.cache_store = :mem_cache_store
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
20
 
21
- # Enable serving of images, stylesheets, and javascripts from an asset server
22
- # config.action_controller.asset_host = "http://assets.example.com"
21
+ # See everything in the log (default is :info)
22
+ # config.log_level = :debug
23
23
 
24
- # Disable delivery errors, bad email addresses will be ignored
25
- # config.action_mailer.raise_delivery_errors = false
24
+ # Use a different logger for distributed setups
25
+ # config.logger = SyslogLogger.new
26
26
 
27
- # Enable threaded mode
28
- # config.threadsafe!
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,28 +1,35 @@
1
- # Settings specified here will take precedence over those in config/environment.rb
2
-
3
- # The test environment is used exclusively to run your application's
4
- # test suite. You never need to work with it otherwise. Remember that
5
- # your test database is "scratch space" for the test suite and is wiped
6
- # and recreated between test runs. Don't rely on the data there!
7
- config.cache_classes = true
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.action_controller.consider_all_requests_local = true
14
- config.action_controller.perform_caching = false
15
- config.action_view.cache_template_loading = true
16
-
17
- # Disable request forgery protection in test environment
18
- config.action_controller.allow_forgery_protection = false
19
-
20
- # Tell Action Mailer not to deliver emails to the real world.
21
- # The :test delivery method accumulates sent emails in the
22
- # ActionMailer::Base.deliveries array.
23
- config.action_mailer.delivery_method = :test
24
-
25
- # Use SQL instead of Active Record's schema dumper when creating the test database.
26
- # This is necessary if your schema can't be completely dumped by the schema dumper,
27
- # like if you have constraints or database-specific column types
28
- # config.active_record.schema_format = :sql
1
+ RailsRoot::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
@@ -3,5 +3,5 @@
3
3
  # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
4
  # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
5
 
6
- # You can also remove all the silencers if you're trying do debug a problem that might steem from framework code.
7
- # Rails.backtrace_cleaner.remove_silencers!
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,6 +1,6 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
- # Add new inflection rules using the following format
3
+ # Add new inflection rules using the following format
4
4
  # (all these examples are active by default):
5
5
  # ActiveSupport::Inflector.inflections do |inflect|
6
6
  # inflect.plural /^(ox)$/i, '\1en'
@@ -1,15 +1,2 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Your secret key for verifying cookie session data integrity.
4
- # If you change this key, all old sessions 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
- ActionController::Base.session = {
8
- :key => '_rails_root_session',
9
- :secret => 'cfca52d47d3bb2378a7e6f9652b5a6174927f35398cefbd04b610a71adb29f86820e37e9b208e5637638d13bc738f766c4a35ba22b680de5f34b5b47a6756317'
10
- }
11
-
12
- # Use the database for sessions instead of the cookie-based default,
13
- # which shouldn't be used to store highly confidential information
14
- # (create the session table with "rake db:sessions:create")
15
- # ActionController::Base.session_store = :active_record_store
1
+ Rails.application.config.session_store :active_record_store, :key => '_session_id'
2
+ Rails.application.config.session_options = {:cookie_only => false}
@@ -1,43 +1,7 @@
1
- ActionController::Routing::Routes.draw do |map|
2
- # The priority is based upon order of creation: first created -> highest priority.
3
-
4
- # Sample of regular route:
5
- # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
6
- # Keep in mind you can assign values other than :controller and :action
7
-
8
- # Sample of named route:
9
- # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
10
- # This route can be invoked with purchase_url(:id => product.id)
11
-
12
- # Sample resource route (maps HTTP verbs to controller actions automatically):
13
- # map.resources :products
14
-
15
- # Sample resource route with options:
16
- # map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }
17
-
18
- # Sample resource route with sub-resources:
19
- # map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
20
-
21
- # Sample resource route with more complex sub-resources
22
- # map.resources :products do |products|
23
- # products.resources :comments
24
- # products.resources :sales, :collection => { :recent => :get }
25
- # end
26
-
27
- # Sample resource route within a namespace:
28
- # map.namespace :admin do |admin|
29
- # # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
30
- # admin.resources :products
31
- # end
32
-
33
- # You can have the root of your site routed with map.root -- just remember to delete public/index.html.
34
- # map.root :controller => "welcome"
35
-
36
- # See how all your routes lay out with "rake routes"
37
-
38
- # Install the default routes as the lowest priority.
39
- # Note: These default routes make all actions in every controller accessible via GET requests. You should
40
- # consider removing or commenting them out if you're using named routes and resources.
41
- map.connect ':controller/:action/:id'
42
- map.connect ':controller/:action/:id.:format'
1
+ RailsRoot::Application.routes.draw do |map|
2
+ resources :users
3
+ namespace :admin do
4
+ resources :users
5
+ end
6
+ match ':controller(/:action(/:id(.:format)))'
43
7
  end