torba-rails 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/.travis.yml +4 -0
  4. data/.yardopts +3 -0
  5. data/CHANGELOG.md +1 -0
  6. data/CONTRIBUTING.md +48 -0
  7. data/Gemfile +6 -0
  8. data/LICENSE.txt +22 -0
  9. data/README.md +81 -0
  10. data/Rakefile +26 -0
  11. data/lib/torba/rails.rb +29 -0
  12. data/lib/torba-rails.rb +1 -0
  13. data/test/3.2/Gemfile +12 -0
  14. data/test/3.2/Gemfile.lock +116 -0
  15. data/test/3.2/Rakefile +7 -0
  16. data/test/3.2/Torbafile +8 -0
  17. data/test/3.2/app/assets/javascripts/application.js +2 -0
  18. data/test/3.2/app/assets/stylesheets/application.scss +6 -0
  19. data/test/3.2/app/controllers/application_controller.rb +3 -0
  20. data/test/3.2/app/helpers/application_helper.rb +2 -0
  21. data/test/3.2/app/views/layouts/application.html.erb +14 -0
  22. data/test/3.2/bin/rails +6 -0
  23. data/test/3.2/config/application.rb +62 -0
  24. data/test/3.2/config/boot.rb +6 -0
  25. data/test/3.2/config/environment.rb +5 -0
  26. data/test/3.2/config/environments/development.rb +27 -0
  27. data/test/3.2/config/environments/production.rb +64 -0
  28. data/test/3.2/config/environments/test.rb +29 -0
  29. data/test/3.2/config/initializers/backtrace_silencers.rb +7 -0
  30. data/test/3.2/config/initializers/secret_token.rb +7 -0
  31. data/test/3.2/config/initializers/wrap_parameters.rb +10 -0
  32. data/test/3.2/config/locales/en.yml +5 -0
  33. data/test/3.2/config/routes.rb +58 -0
  34. data/test/3.2/config.ru +4 -0
  35. data/test/3.2/script/rails +6 -0
  36. data/test/4.2/Gemfile +6 -0
  37. data/test/4.2/Gemfile.lock +128 -0
  38. data/test/4.2/Rakefile +6 -0
  39. data/test/4.2/Torbafile +8 -0
  40. data/test/4.2/app/assets/javascripts/application.js +2 -0
  41. data/test/4.2/app/assets/stylesheets/application.scss +6 -0
  42. data/test/4.2/app/controllers/application_controller.rb +5 -0
  43. data/test/4.2/app/helpers/application_helper.rb +2 -0
  44. data/test/4.2/app/views/layouts/application.html.erb +13 -0
  45. data/test/4.2/bin/rails +4 -0
  46. data/test/4.2/config/application.rb +25 -0
  47. data/test/4.2/config/boot.rb +3 -0
  48. data/test/4.2/config/environment.rb +5 -0
  49. data/test/4.2/config/environments/development.rb +35 -0
  50. data/test/4.2/config/environments/production.rb +76 -0
  51. data/test/4.2/config/environments/test.rb +37 -0
  52. data/test/4.2/config/initializers/assets.rb +11 -0
  53. data/test/4.2/config/initializers/cookies_serializer.rb +3 -0
  54. data/test/4.2/config/initializers/filter_parameter_logging.rb +4 -0
  55. data/test/4.2/config/initializers/session_store.rb +3 -0
  56. data/test/4.2/config/initializers/wrap_parameters.rb +9 -0
  57. data/test/4.2/config/locales/en.yml +23 -0
  58. data/test/4.2/config/routes.rb +56 -0
  59. data/test/4.2/config/secrets.yml +22 -0
  60. data/test/4.2/config.ru +4 -0
  61. data/test/5.0/Gemfile +6 -0
  62. data/test/5.0/Gemfile.lock +138 -0
  63. data/test/5.0/Rakefile +6 -0
  64. data/test/5.0/Torbafile +8 -0
  65. data/test/5.0/app/assets/javascripts/application.js +2 -0
  66. data/test/5.0/app/assets/stylesheets/application.scss +6 -0
  67. data/test/5.0/app/controllers/application_controller.rb +5 -0
  68. data/test/5.0/app/helpers/application_helper.rb +2 -0
  69. data/test/5.0/app/views/layouts/application.html.erb +13 -0
  70. data/test/5.0/bin/rails +4 -0
  71. data/test/5.0/config/application.rb +17 -0
  72. data/test/5.0/config/boot.rb +3 -0
  73. data/test/5.0/config/cable.yml +10 -0
  74. data/test/5.0/config/environment.rb +5 -0
  75. data/test/5.0/config/environments/development.rb +52 -0
  76. data/test/5.0/config/environments/production.rb +79 -0
  77. data/test/5.0/config/environments/test.rb +36 -0
  78. data/test/5.0/config/initializers/assets.rb +11 -0
  79. data/test/5.0/config/initializers/cookies_serializer.rb +5 -0
  80. data/test/5.0/config/initializers/filter_parameter_logging.rb +4 -0
  81. data/test/5.0/config/initializers/per_form_csrf_tokens.rb +4 -0
  82. data/test/5.0/config/initializers/request_forgery_protection.rb +4 -0
  83. data/test/5.0/config/initializers/session_store.rb +3 -0
  84. data/test/5.0/config/initializers/wrap_parameters.rb +14 -0
  85. data/test/5.0/config/locales/en.yml +23 -0
  86. data/test/5.0/config/puma.rb +47 -0
  87. data/test/5.0/config/routes.rb +6 -0
  88. data/test/5.0/config/secrets.yml +22 -0
  89. data/test/5.0/config.ru +4 -0
  90. data/test/5.0/db/seeds.rb +7 -0
  91. data/test/Torbafile +8 -0
  92. data/test/acceptance_test.rb +68 -0
  93. data/test/application.js +2 -0
  94. data/test/application.scss +6 -0
  95. data/test/compiled_assets/3.2/application-32cc93d3c658f24842cdb4028d7f6a6a.js +1 -0
  96. data/test/compiled_assets/3.2/application-406b208e73b83fe37135274c5157c8e3.css +1 -0
  97. data/test/compiled_assets/3.2/trumbowyg/icons-0b2826fbd974348c269c2b8017a14314.png +0 -0
  98. data/test/compiled_assets/3.2/trumbowyg/icons-2x-cc69d8bc62651602e75c2f7097cf5187.png +0 -0
  99. data/test/compiled_assets/4.2+/application-7cdb22c682ee9bf44774492034be6952becd2c75184c101017152af1476b12a8.css +1 -0
  100. data/test/compiled_assets/4.2+/application-c7e50f0b91ececdd620e1c86789b65677d9bbe0f35ab4717a9a522e6c89a56f9.js +1 -0
  101. data/test/compiled_assets/4.2+/trumbowyg/icons-2x-39fe92cd396082eb94f0c92103537209ba97ffa3079377bbe55fea857abe5341.png +0 -0
  102. data/test/compiled_assets/4.2+/trumbowyg/icons-efc940454e4e764063875def5c909a2f9c8b2c4d2a41c6a98dc41fb111868f1f.png +0 -0
  103. data/test/test_helper.rb +35 -0
  104. data/torba-rails.gemspec +23 -0
  105. metadata +323 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 01b6c3577cb9d061eb867c3163227e5be3fae9c5
4
+ data.tar.gz: bf9f1c67a94004096714ebd28941b094996b57c2
5
+ SHA512:
6
+ metadata.gz: 0bf77c82ea973080c6504224348ddc7d673204158a18856acc18349db95ea71a7ddbbd7271e3ff274981ff8b32b400f9ee3e91f5a8cf6947dda501d0a0098b40
7
+ data.tar.gz: b5c494929426b215f47599f41d2b47dc6cf9ccf200f37ddf6583524e1fedd03d9b5d144cb77c5b9c736dd5fe4dbd2049972c86809815b319aa6ec79256df2d0e
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ tmp/
10
+ log/
11
+ public/
12
+ *.bundle
13
+ *.so
14
+ *.o
15
+ *.a
16
+ *.sqlite3
17
+ mkmf.log
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.2
4
+ bundler_args: --without doc debug
data/.yardopts ADDED
@@ -0,0 +1,3 @@
1
+ --no-private
2
+ -
3
+ CHANGELOG.md
data/CHANGELOG.md ADDED
@@ -0,0 +1 @@
1
+ ## Unreleased
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,48 @@
1
+ # Contributing
2
+
3
+ ## Adding a feature
4
+
5
+ 1. Open an issue and explain what you're planning to do. It is better to discuss new idea first,
6
+ rather when diving into code.
7
+ 2. Add some tests.
8
+ 3. Write the code.
9
+ 4. Make sure all tests pass.
10
+ 5. Commit with detailed explanation what you've done in a message.
11
+ 6. Open pull request.
12
+
13
+ ## Breaking/removing a feature
14
+
15
+ 1. Add deprecation warning and fallback to old behaivour if possible.
16
+ 2. Explain how to migrate to the new code in CHANGELOG.
17
+ 3. Update/remove tests.
18
+ 4. Update the code.
19
+ 5. Make sure all tests pass.
20
+ 6. Commit with detailed explanation what you've done in a message.
21
+ 7. Open pull request.
22
+
23
+ ## Fixing a bug
24
+
25
+ 1. Add failing test.
26
+ 2. Fix the bug.
27
+ 3. Make sure all tests pass.
28
+ 4. Commit with detailed explanation what you've done in a message.
29
+ 5. Open pull request.
30
+
31
+ ## Fixing a typo
32
+
33
+ 1. Commit with a message that include "[ci skip]" remark.
34
+ 2. Open pull request.
35
+
36
+ ## Running the tests
37
+
38
+ ```
39
+ bundle exec rake bundle
40
+ bundle exec rake test_all
41
+ ```
42
+
43
+ ## Working with documentation
44
+
45
+ ```
46
+ yard server -dr
47
+ open http://localhost:8808
48
+ ```
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ gem "pry", :group => :debug
6
+ gem "yard", "~> 0.8", :group => :doc
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2016 Andrii Malyshko
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,81 @@
1
+ # torba-rails
2
+
3
+ [![Build Status](https://img.shields.io/travis/torba-rb/torba-rails.svg)](https://travis-ci.org/torba-rb/torba-rails)
4
+ [![Gem version](https://img.shields.io/gem/v/torba-rails.svg)](https://rubygems.org/gems/torba-rails)
5
+
6
+ This gem provides integration for Ruby on Rails projects with the [Torba][torba-github] gem.
7
+
8
+ ## Status
9
+
10
+ Production ready.
11
+
12
+ ## Documentation
13
+
14
+ [Released version](http://rubydoc.info/gems/torba-rails/1.0.0)
15
+
16
+ ## Installation
17
+
18
+ Add this line to your application's Gemfile and run `bundle`:
19
+
20
+ ```ruby
21
+ gem 'torba-rails'
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ The gem doesn't need extra configuration except the usual [Torba setup][torba-usage].
27
+
28
+ Non JS/CSS assets are automatically added to precompile list, no need to manually populate
29
+ `config.assets.precompile`.
30
+
31
+ Be careful to **import only assets that you really need**. Everything that is non JS or CSS asset is
32
+ going to be precompiled by Sprockets and accessible publicly. See [Rails ticket][rails-ticket-vendoring]
33
+ that explains this problem (and why Rails >= 4 precompiles only application.js/css in vendor by
34
+ default), except that Torba does have a way to specify exact list of files to import.
35
+
36
+ ## Example
37
+
38
+ See fully configured [Rails application][rails-example].
39
+
40
+ ## Deployment
41
+
42
+ torba-rails automatically hooks into the existing `assets:precompile`
43
+ Rake task to ensure that `torba pack` is executed. This means that Rails
44
+ deployments will "just work", although there are some optimizations you can make
45
+ as explained below.
46
+
47
+ ### Heroku
48
+
49
+ You will need to specify some config vars to ensure Torba's files are placed in
50
+ locations suitable for the Heroku platform.
51
+
52
+ `TORBA_HOME_PATH` should be within your app so that Torba's assets are included
53
+ in the slug.
54
+
55
+ `TORBA_CACHE_PATH` should make use of the `tmp/cache/assets` directory. This is
56
+ where the Ruby buildpack expects cached files to be stored related to the
57
+ `assets:precompile` step. This way Torba doesn't have to download packages fresh
58
+ every time.
59
+
60
+ ```bash
61
+ heroku config:set TORBA_HOME_PATH=vendor/torba TORBA_CACHE_PATH=tmp/cache/assets/torba
62
+ ```
63
+
64
+ Now your Heroku app is good to go.
65
+
66
+ ### Capistrano
67
+
68
+ Specify the `TORBA_HOME_PATH` env variable pointing to a persistent directory
69
+ writable by your deploy user and shared across releases. Capistrano's `shared`
70
+ directory is good for this.
71
+
72
+ For Capistrano 3, you can set this up in `config/deploy.rb`:
73
+
74
+ ```
75
+ set :default_env, { torba_home_path: shared_path.join('vendor/torba') }
76
+ ```
77
+
78
+ [torba-github]: https://github.com/torba-rb/torba
79
+ [torba-usage]: https://github.com/torba-rb/torba#usage
80
+ [rails-ticket-vendoring]: https://github.com/rails/rails/pull/7968
81
+ [rails-example]: https://github.com/torba-rb/rails-example
data/Rakefile ADDED
@@ -0,0 +1,26 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ rails_versions = %w[3.2 4.2 5.0]
4
+
5
+ task :bundle do
6
+ rails_versions.each do |version|
7
+ Bundler.with_clean_env do
8
+ sh "BUNDLE_GEMFILE=test/#{version}/Gemfile bundle install"
9
+ end
10
+ end
11
+ end
12
+
13
+ task :test do
14
+ $LOAD_PATH.unshift("test")
15
+ Dir.glob("./test/**/*_test.rb").each { |file| require file}
16
+ end
17
+
18
+ task :test_all do
19
+ rails_versions.each do |version|
20
+ Bundler.with_clean_env do
21
+ sh "RAILS_VERSION=#{version} bundle exec rake test"
22
+ end
23
+ end
24
+ end
25
+
26
+ task :default => [:bundle, :test_all]
@@ -0,0 +1,29 @@
1
+ module Torba
2
+ class Engine < Rails::Engine
3
+ def self.setup(config = Rails.application.config)
4
+ config.assets.paths.concat(Torba.load_path)
5
+ config.assets.precompile.concat(Torba.non_js_css_logical_paths)
6
+ end
7
+
8
+ def self.serve_static_files?(config = Rails.application.config)
9
+ (config.respond_to?(:public_file_server) && config.public_file_server.enabled) ||
10
+ (config.respond_to?(:serve_static_files) && config.serve_static_files) || # Rails 4
11
+ (config.respond_to?(:serve_static_assets) && config.serve_static_assets) || # Rails 3
12
+ ENV["RAILS_GROUPS"] == "assets" # Rails 3
13
+ end
14
+
15
+ initializer "torba.assets" do
16
+ if Engine.serve_static_files?
17
+ require "torba/verify"
18
+ Engine.setup
19
+ end
20
+ end
21
+
22
+ rake_tasks do
23
+ require "torba/rake_task"
24
+ Torba::RakeTask.new("torba:pack", :before => "assets:precompile") do
25
+ Engine.setup
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1 @@
1
+ require "torba/rails"
data/test/3.2/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rails', '3.2.22.2'
4
+ gem 'torba-rails', path: '../..'
5
+
6
+ # Gems used only for assets and not required
7
+ # in production environments by default.
8
+ group :assets do
9
+ gem 'sass-rails', '~> 3.2.3'
10
+ gem 'coffee-rails', '~> 3.2.1'
11
+ gem 'uglifier', '>= 1.0.3'
12
+ end
@@ -0,0 +1,116 @@
1
+ PATH
2
+ remote: ../..
3
+ specs:
4
+ torba-rails (1.0.0)
5
+ railties (>= 3.2)
6
+ torba (~> 1.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionmailer (3.2.22.2)
12
+ actionpack (= 3.2.22.2)
13
+ mail (~> 2.5.4)
14
+ actionpack (3.2.22.2)
15
+ activemodel (= 3.2.22.2)
16
+ activesupport (= 3.2.22.2)
17
+ builder (~> 3.0.0)
18
+ erubis (~> 2.7.0)
19
+ journey (~> 1.0.4)
20
+ rack (~> 1.4.5)
21
+ rack-cache (~> 1.2)
22
+ rack-test (~> 0.6.1)
23
+ sprockets (~> 2.2.1)
24
+ activemodel (3.2.22.2)
25
+ activesupport (= 3.2.22.2)
26
+ builder (~> 3.0.0)
27
+ activerecord (3.2.22.2)
28
+ activemodel (= 3.2.22.2)
29
+ activesupport (= 3.2.22.2)
30
+ arel (~> 3.0.2)
31
+ tzinfo (~> 0.3.29)
32
+ activeresource (3.2.22.2)
33
+ activemodel (= 3.2.22.2)
34
+ activesupport (= 3.2.22.2)
35
+ activesupport (3.2.22.2)
36
+ i18n (~> 0.6, >= 0.6.4)
37
+ multi_json (~> 1.0)
38
+ arel (3.0.3)
39
+ builder (3.0.4)
40
+ coffee-rails (3.2.2)
41
+ coffee-script (>= 2.2.0)
42
+ railties (~> 3.2.0)
43
+ coffee-script (2.4.1)
44
+ coffee-script-source
45
+ execjs
46
+ coffee-script-source (1.10.0)
47
+ erubis (2.7.0)
48
+ execjs (2.6.0)
49
+ hike (1.2.3)
50
+ i18n (0.7.0)
51
+ journey (1.0.4)
52
+ json (1.8.3)
53
+ mail (2.5.4)
54
+ mime-types (~> 1.16)
55
+ treetop (~> 1.4.8)
56
+ mime-types (1.25.1)
57
+ multi_json (1.11.2)
58
+ polyglot (0.3.5)
59
+ rack (1.4.7)
60
+ rack-cache (1.6.1)
61
+ rack (>= 0.4)
62
+ rack-ssl (1.3.4)
63
+ rack
64
+ rack-test (0.6.3)
65
+ rack (>= 1.0)
66
+ rails (3.2.22.2)
67
+ actionmailer (= 3.2.22.2)
68
+ actionpack (= 3.2.22.2)
69
+ activerecord (= 3.2.22.2)
70
+ activeresource (= 3.2.22.2)
71
+ activesupport (= 3.2.22.2)
72
+ bundler (~> 1.0)
73
+ railties (= 3.2.22.2)
74
+ railties (3.2.22.2)
75
+ actionpack (= 3.2.22.2)
76
+ activesupport (= 3.2.22.2)
77
+ rack-ssl (~> 1.3.2)
78
+ rake (>= 0.8.7)
79
+ rdoc (~> 3.4)
80
+ thor (>= 0.14.6, < 2.0)
81
+ rake (11.1.2)
82
+ rdoc (3.12.2)
83
+ json (~> 1.4)
84
+ sass (3.4.22)
85
+ sass-rails (3.2.6)
86
+ railties (~> 3.2.0)
87
+ sass (>= 3.1.10)
88
+ tilt (~> 1.3)
89
+ sprockets (2.2.3)
90
+ hike (~> 1.2)
91
+ multi_json (~> 1.0)
92
+ rack (~> 1.0)
93
+ tilt (~> 1.1, != 1.3.0)
94
+ thor (0.19.1)
95
+ tilt (1.4.1)
96
+ torba (1.0.0)
97
+ thor (~> 0.19.1)
98
+ treetop (1.4.15)
99
+ polyglot
100
+ polyglot (>= 0.3.1)
101
+ tzinfo (0.3.48)
102
+ uglifier (3.0.0)
103
+ execjs (>= 0.3.0, < 3)
104
+
105
+ PLATFORMS
106
+ ruby
107
+
108
+ DEPENDENCIES
109
+ coffee-rails (~> 3.2.1)
110
+ rails (= 3.2.22.2)
111
+ sass-rails (~> 3.2.3)
112
+ torba-rails!
113
+ uglifier (>= 1.0.3)
114
+
115
+ BUNDLED WITH
116
+ 1.10.6
data/test/3.2/Rakefile ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env rake
2
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
3
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
+
5
+ require File.expand_path('../config/application', __FILE__)
6
+
7
+ TorbaTest::Application.load_tasks
@@ -0,0 +1,8 @@
1
+ gh_release "trumbowyg",
2
+ source: "torba-rb/Trumbowyg",
3
+ tag: "1.1.6",
4
+ import: %w[
5
+ dist/trumbowyg.js
6
+ dist/ui/trumbowyg.css
7
+ dist/ui/images/
8
+ ]
@@ -0,0 +1,2 @@
1
+ //= require trumbowyg/trumbowyg
2
+ //= require_tree .
@@ -0,0 +1,6 @@
1
+ /*
2
+ *= require_self
3
+ *= require_tree .
4
+ */
5
+
6
+ @import "trumbowyg/trumbowyg";
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery
3
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>TorbaTest</title>
5
+ <%= stylesheet_link_tag "application", :media => "all" %>
6
+ <%= javascript_include_tag "application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -0,0 +1,62 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require "sprockets/railtie"
4
+
5
+ if defined?(Bundler)
6
+ # If you precompile assets before deploying to production, use this line
7
+ Bundler.require(*Rails.groups(:assets => %w(development test)))
8
+ # If you want your assets lazily compiled in production, use this line
9
+ # Bundler.require(:default, :assets, Rails.env)
10
+ end
11
+
12
+ module TorbaTest
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
+ # Configure the default encoding used in templates for Ruby 1.9.
37
+ config.encoding = "utf-8"
38
+
39
+ # Configure sensitive parameters which will be filtered from the log file.
40
+ config.filter_parameters += [:password]
41
+
42
+ # Enable escaping HTML in JSON.
43
+ config.active_support.escape_html_entities_in_json = true
44
+
45
+ # Use SQL instead of Active Record's schema dumper when creating the database.
46
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
47
+ # like if you have constraints or database-specific column types
48
+ # config.active_record.schema_format = :sql
49
+
50
+ # Enforce whitelist mode for mass assignment.
51
+ # This will create an empty whitelist of attributes available for mass-assignment for all models
52
+ # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
53
+ # parameters by using an attr_accessible or attr_protected declaration.
54
+ # config.active_record.whitelist_attributes = true
55
+
56
+ # Enable the asset pipeline
57
+ config.assets.enabled = true
58
+
59
+ # Version of your assets, change this if you want to expire all your assets
60
+ config.assets.version = '1.0'
61
+ end
62
+ end
@@ -0,0 +1,6 @@
1
+ require 'rubygems'
2
+
3
+ # Set up gems listed in the Gemfile.
4
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
5
+
6
+ require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ TorbaTest::Application.initialize!
@@ -0,0 +1,27 @@
1
+ TorbaTest::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 web server 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
+ # Print deprecation notices to the Rails logger
17
+ config.active_support.deprecation = :log
18
+
19
+ # Only use best-standards-support built into browsers
20
+ config.action_dispatch.best_standards_support = :builtin
21
+
22
+ # Do not compress assets
23
+ config.assets.compress = false
24
+
25
+ # Expands the lines which load the assets
26
+ config.assets.debug = true
27
+ end
@@ -0,0 +1,64 @@
1
+ TorbaTest::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # Code is not reloaded between requests
5
+ config.cache_classes = true
6
+
7
+ # Full error reports are disabled and caching is turned on
8
+ config.consider_all_requests_local = false
9
+ config.action_controller.perform_caching = true
10
+
11
+ # Disable Rails's static asset server (Apache or nginx will already do this)
12
+ config.serve_static_assets = false
13
+
14
+ # Compress JavaScripts and CSS
15
+ config.assets.compress = true
16
+
17
+ # Don't fallback to assets pipeline if a precompiled asset is missed
18
+ config.assets.compile = false
19
+
20
+ # Generate digests for assets URLs
21
+ config.assets.digest = true
22
+
23
+ # Defaults to nil and saved in location specified by config.assets.prefix
24
+ # config.assets.manifest = YOUR_PATH
25
+
26
+ # Specifies the header that your server uses for sending files
27
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29
+
30
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
+ # config.force_ssl = true
32
+
33
+ # See everything in the log (default is :info)
34
+ # config.log_level = :debug
35
+
36
+ # Prepend all log lines with the following tags
37
+ # config.log_tags = [ :subdomain, :uuid ]
38
+
39
+ # Use a different logger for distributed setups
40
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
41
+
42
+ # Use a different cache store in production
43
+ # config.cache_store = :mem_cache_store
44
+
45
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
46
+ # config.action_controller.asset_host = "http://assets.example.com"
47
+
48
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
49
+ # config.assets.precompile += %w( search.js )
50
+
51
+ # Disable delivery errors, bad email addresses will be ignored
52
+ # config.action_mailer.raise_delivery_errors = false
53
+
54
+ # Enable threaded mode
55
+ # config.threadsafe!
56
+
57
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
58
+ # the I18n.default_locale when a translation can not be found)
59
+ config.i18n.fallbacks = true
60
+
61
+ # Send deprecation notices to registered listeners
62
+ config.active_support.deprecation = :notify
63
+
64
+ end
@@ -0,0 +1,29 @@
1
+ TorbaTest::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
+ # Configure static asset server for tests with Cache-Control for performance
11
+ config.serve_static_assets = true
12
+ config.static_cache_control = "public, max-age=3600"
13
+
14
+ # Log error messages when you accidentally call methods on nil
15
+ config.whiny_nils = true
16
+
17
+ # Show full error reports and disable caching
18
+ config.consider_all_requests_local = true
19
+ config.action_controller.perform_caching = false
20
+
21
+ # Raise exceptions instead of rendering exception templates
22
+ config.action_dispatch.show_exceptions = false
23
+
24
+ # Disable request forgery protection in test environment
25
+ config.action_controller.allow_forgery_protection = false
26
+
27
+ # Print deprecation notices to the stderr
28
+ config.active_support.deprecation = :stderr
29
+ 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,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
+ TorbaTest::Application.config.secret_token = '081df2b6ad1b66b91a78cdf109d88371f8876e6b6fbcf795af7e51a32be3fd666d95a599138c4a516e3695afc9f8906aad96548bcf3d7a7c7fd929feb02297da'