database_stalker 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.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/lib/database_stalker/version.rb +1 -1
  3. data/lib/database_stalker.rb +15 -1
  4. data/rails_test/.gitignore +14 -0
  5. data/rails_test/.rspec +1 -0
  6. data/rails_test/Gemfile +50 -0
  7. data/rails_test/Gemfile.lock +187 -0
  8. data/rails_test/README.rdoc +28 -0
  9. data/rails_test/Rakefile +6 -0
  10. data/rails_test/app/assets/images/.keep +0 -0
  11. data/rails_test/app/assets/javascripts/application.js +16 -0
  12. data/rails_test/app/assets/stylesheets/application.css +15 -0
  13. data/rails_test/app/controllers/application_controller.rb +5 -0
  14. data/rails_test/app/controllers/concerns/.keep +0 -0
  15. data/rails_test/app/helpers/application_helper.rb +2 -0
  16. data/rails_test/app/mailers/.keep +0 -0
  17. data/rails_test/app/models/.keep +0 -0
  18. data/rails_test/app/models/concerns/.keep +0 -0
  19. data/rails_test/app/models/sample1.rb +2 -0
  20. data/rails_test/app/models/sample2.rb +2 -0
  21. data/rails_test/app/models/sample3.rb +2 -0
  22. data/rails_test/app/views/layouts/application.html.erb +14 -0
  23. data/rails_test/bin/bundle +3 -0
  24. data/rails_test/bin/rails +9 -0
  25. data/rails_test/bin/rake +9 -0
  26. data/rails_test/bin/rspec +8 -0
  27. data/rails_test/bin/setup +29 -0
  28. data/rails_test/bin/spring +17 -0
  29. data/rails_test/config/application.rb +35 -0
  30. data/rails_test/config/boot.rb +3 -0
  31. data/rails_test/config/database.yml +53 -0
  32. data/rails_test/config/environment.rb +5 -0
  33. data/rails_test/config/environments/development.rb +41 -0
  34. data/rails_test/config/environments/production.rb +79 -0
  35. data/rails_test/config/environments/test.rb +42 -0
  36. data/rails_test/config/initializers/assets.rb +11 -0
  37. data/rails_test/config/initializers/backtrace_silencers.rb +7 -0
  38. data/rails_test/config/initializers/cookies_serializer.rb +3 -0
  39. data/rails_test/config/initializers/filter_parameter_logging.rb +4 -0
  40. data/rails_test/config/initializers/inflections.rb +16 -0
  41. data/rails_test/config/initializers/mime_types.rb +4 -0
  42. data/rails_test/config/initializers/session_store.rb +3 -0
  43. data/rails_test/config/initializers/to_time_preserves_timezone.rb +10 -0
  44. data/rails_test/config/initializers/wrap_parameters.rb +14 -0
  45. data/rails_test/config/locales/en.yml +23 -0
  46. data/rails_test/config/routes.rb +56 -0
  47. data/rails_test/config/secrets.yml +22 -0
  48. data/rails_test/config.ru +4 -0
  49. data/rails_test/db/migrate/20171110000051_create_sample1s.rb +8 -0
  50. data/rails_test/db/migrate/20171110000055_create_sample2s.rb +8 -0
  51. data/rails_test/db/migrate/20171110000058_create_sample3s.rb +8 -0
  52. data/rails_test/db/schema.rb +31 -0
  53. data/rails_test/db/seeds.rb +7 -0
  54. data/rails_test/lib/assets/.keep +0 -0
  55. data/rails_test/lib/tasks/.keep +0 -0
  56. data/rails_test/log/.keep +0 -0
  57. data/rails_test/public/404.html +67 -0
  58. data/rails_test/public/422.html +67 -0
  59. data/rails_test/public/500.html +66 -0
  60. data/rails_test/public/favicon.ico +0 -0
  61. data/rails_test/public/robots.txt +5 -0
  62. data/rails_test/spec/database_stalker_usage_spec.rb +11 -0
  63. data/rails_test/spec/spec_helper.rb +42 -0
  64. metadata +62 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 296195149ecce6fa3627e127e8d042a61548d58b
4
- data.tar.gz: 1fed48ac3dde38829f05f16f69154c291377a11e
3
+ metadata.gz: 17057c858434c678b5bce9f6a0645f0ecc2ac02e
4
+ data.tar.gz: 1fbd37277e38e96aba343154281f48c96cfb1706
5
5
  SHA512:
6
- metadata.gz: cd3de7b17eeb61aa081c45520693a37e725f9aa75dd415eea7f33fa454af8bf787c7b48230237f1a706da4438b0419e9cf5bad8538494e4255fa6eea7beb9884
7
- data.tar.gz: b6e5c875213f3940304b75a6a53c3244188b659cfdec08005df68c3b9dc83af8e52be00bb4e84ac7aa91bf755df3729f413080247f5fca9bc48c16a931b81bc5
6
+ metadata.gz: 6fd2553c35173b03ff83aa35ec5247b069d801527a2771720dba769cca7ffa45641dc2db7c353cc4a1b1757f237db215fc9687b42e39e8f3ca19a068ec5bac91
7
+ data.tar.gz: fa7bae7622552804509119c7a1781d4b8ce08faba22e1b14e05725f6e9f9398e7ac5ab57b3084fd19566a19e695b00f5cb956e3c6a533bb6dba09c1a9112a2e0
@@ -1,3 +1,3 @@
1
1
  module DatabaseStalker
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -3,9 +3,12 @@ require "database_stalker/parser"
3
3
 
4
4
  module DatabaseStalker
5
5
 
6
+ DEFAULT_LOG_FILE = 'log/test.log'
7
+ DEFAULT_TABLE_LOG_FILE = 'log/table_names.log'
8
+
6
9
  class << self
7
10
 
8
- def start(log_file, table_log_file)
11
+ def start(log_file: DEFAULT_LOG_FILE, table_log_file: DEFAULT_TABLE_LOG_FILE)
9
12
  clean_up_file(log_file) if File.exist?(log_file)
10
13
  Process.fork do
11
14
  watch_test_process
@@ -13,6 +16,17 @@ module DatabaseStalker
13
16
  end
14
17
  end
15
18
 
19
+ def read_table_names(table_log_file: DEFAULT_TABLE_LOG_FILE)
20
+ return [] if not File.exist?(table_log_file)
21
+ result = []
22
+ File.open(table_log_file, 'r') do |f|
23
+ f.each_line do |line|
24
+ result << line.strip
25
+ end
26
+ end
27
+ result
28
+ end
29
+
16
30
  def clean_up_file(file)
17
31
  File.open(file,'w'){ |f| f = nil }
18
32
  end
@@ -0,0 +1,14 @@
1
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile '~/.gitignore_global'
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ # Ignore all logfiles and tempfiles.
11
+ /log/*
12
+ !/log/.keep
13
+ /tmp
14
+ /vendor
data/rails_test/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
@@ -0,0 +1,50 @@
1
+ source 'https://rubygems.org'
2
+
3
+
4
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
5
+ gem 'rails', '4.2.10'
6
+ gem 'rake', '< 11.0'
7
+ # Use mysql as the database for Active Record
8
+ gem 'mysql2', '>= 0.3.13', '< 0.5'
9
+ # Use SCSS for stylesheets
10
+ gem 'sass-rails', '~> 5.0'
11
+ # Use Uglifier as compressor for JavaScript assets
12
+ gem 'uglifier', '>= 1.3.0'
13
+ # Use CoffeeScript for .coffee assets and views
14
+ gem 'coffee-rails', '~> 4.1.0'
15
+ # See https://github.com/rails/execjs#readme for more supported runtimes
16
+ # gem 'therubyracer', platforms: :ruby
17
+
18
+ # Use jquery as the JavaScript library
19
+ gem 'jquery-rails'
20
+ # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
21
+ gem 'turbolinks'
22
+ # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
23
+ gem 'jbuilder', '~> 2.0'
24
+ # bundle exec rake doc:rails generates the API under doc/api.
25
+ gem 'sdoc', '~> 0.4.0', group: :doc
26
+
27
+ # Use ActiveModel has_secure_password
28
+ # gem 'bcrypt', '~> 3.1.7'
29
+
30
+ # Use Unicorn as the app server
31
+ # gem 'unicorn'
32
+
33
+ # Use Capistrano for deployment
34
+ # gem 'capistrano-rails', group: :development
35
+
36
+ group :development, :test do
37
+ # Call 'byebug' anywhere in the code to stop execution and get a debugger console
38
+ gem 'rspec-rails', '~> 2.14.0'
39
+ gem 'spring-commands-rspec'
40
+ gem 'byebug'
41
+ end
42
+
43
+ group :development do
44
+ # Access an IRB console on exception pages or by using <%= console %> in views
45
+ gem 'web-console', '~> 2.0'
46
+
47
+ # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
48
+ gem 'spring'
49
+ end
50
+
@@ -0,0 +1,187 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ actionmailer (4.2.10)
5
+ actionpack (= 4.2.10)
6
+ actionview (= 4.2.10)
7
+ activejob (= 4.2.10)
8
+ mail (~> 2.5, >= 2.5.4)
9
+ rails-dom-testing (~> 1.0, >= 1.0.5)
10
+ actionpack (4.2.10)
11
+ actionview (= 4.2.10)
12
+ activesupport (= 4.2.10)
13
+ rack (~> 1.6)
14
+ rack-test (~> 0.6.2)
15
+ rails-dom-testing (~> 1.0, >= 1.0.5)
16
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
17
+ actionview (4.2.10)
18
+ activesupport (= 4.2.10)
19
+ builder (~> 3.1)
20
+ erubis (~> 2.7.0)
21
+ rails-dom-testing (~> 1.0, >= 1.0.5)
22
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
23
+ activejob (4.2.10)
24
+ activesupport (= 4.2.10)
25
+ globalid (>= 0.3.0)
26
+ activemodel (4.2.10)
27
+ activesupport (= 4.2.10)
28
+ builder (~> 3.1)
29
+ activerecord (4.2.10)
30
+ activemodel (= 4.2.10)
31
+ activesupport (= 4.2.10)
32
+ arel (~> 6.0)
33
+ activesupport (4.2.10)
34
+ i18n (~> 0.7)
35
+ minitest (~> 5.1)
36
+ thread_safe (~> 0.3, >= 0.3.4)
37
+ tzinfo (~> 1.1)
38
+ arel (6.0.4)
39
+ binding_of_caller (0.7.3)
40
+ debug_inspector (>= 0.0.1)
41
+ builder (3.2.3)
42
+ byebug (9.0.6)
43
+ coffee-rails (4.1.1)
44
+ coffee-script (>= 2.2.0)
45
+ railties (>= 4.0.0, < 5.1.x)
46
+ coffee-script (2.4.1)
47
+ coffee-script-source
48
+ execjs
49
+ coffee-script-source (1.12.2)
50
+ concurrent-ruby (1.0.5)
51
+ crass (1.0.2)
52
+ debug_inspector (0.0.3)
53
+ diff-lcs (1.3)
54
+ erubis (2.7.0)
55
+ execjs (2.7.0)
56
+ ffi (1.9.18)
57
+ globalid (0.4.1)
58
+ activesupport (>= 4.2.0)
59
+ i18n (0.9.1)
60
+ concurrent-ruby (~> 1.0)
61
+ jbuilder (2.7.0)
62
+ activesupport (>= 4.2.0)
63
+ multi_json (>= 1.2)
64
+ jquery-rails (4.3.1)
65
+ rails-dom-testing (>= 1, < 3)
66
+ railties (>= 4.2.0)
67
+ thor (>= 0.14, < 2.0)
68
+ json (1.8.6)
69
+ loofah (2.1.1)
70
+ crass (~> 1.0.2)
71
+ nokogiri (>= 1.5.9)
72
+ mail (2.7.0)
73
+ mini_mime (>= 0.1.1)
74
+ mini_mime (1.0.0)
75
+ mini_portile2 (2.3.0)
76
+ minitest (5.10.3)
77
+ multi_json (1.12.2)
78
+ mysql2 (0.4.9)
79
+ nokogiri (1.8.1)
80
+ mini_portile2 (~> 2.3.0)
81
+ rack (1.6.8)
82
+ rack-test (0.6.3)
83
+ rack (>= 1.0)
84
+ rails (4.2.10)
85
+ actionmailer (= 4.2.10)
86
+ actionpack (= 4.2.10)
87
+ actionview (= 4.2.10)
88
+ activejob (= 4.2.10)
89
+ activemodel (= 4.2.10)
90
+ activerecord (= 4.2.10)
91
+ activesupport (= 4.2.10)
92
+ bundler (>= 1.3.0, < 2.0)
93
+ railties (= 4.2.10)
94
+ sprockets-rails
95
+ rails-deprecated_sanitizer (1.0.3)
96
+ activesupport (>= 4.2.0.alpha)
97
+ rails-dom-testing (1.0.8)
98
+ activesupport (>= 4.2.0.beta, < 5.0)
99
+ nokogiri (~> 1.6)
100
+ rails-deprecated_sanitizer (>= 1.0.1)
101
+ rails-html-sanitizer (1.0.3)
102
+ loofah (~> 2.0)
103
+ railties (4.2.10)
104
+ actionpack (= 4.2.10)
105
+ activesupport (= 4.2.10)
106
+ rake (>= 0.8.7)
107
+ thor (>= 0.18.1, < 2.0)
108
+ rake (10.5.0)
109
+ rb-fsevent (0.10.2)
110
+ rb-inotify (0.9.10)
111
+ ffi (>= 0.5.0, < 2)
112
+ rdoc (4.3.0)
113
+ rspec-core (2.14.8)
114
+ rspec-expectations (2.14.5)
115
+ diff-lcs (>= 1.1.3, < 2.0)
116
+ rspec-mocks (2.14.6)
117
+ rspec-rails (2.14.2)
118
+ actionpack (>= 3.0)
119
+ activemodel (>= 3.0)
120
+ activesupport (>= 3.0)
121
+ railties (>= 3.0)
122
+ rspec-core (~> 2.14.0)
123
+ rspec-expectations (~> 2.14.0)
124
+ rspec-mocks (~> 2.14.0)
125
+ sass (3.5.3)
126
+ sass-listen (~> 4.0.0)
127
+ sass-listen (4.0.0)
128
+ rb-fsevent (~> 0.9, >= 0.9.4)
129
+ rb-inotify (~> 0.9, >= 0.9.7)
130
+ sass-rails (5.0.6)
131
+ railties (>= 4.0.0, < 6)
132
+ sass (~> 3.1)
133
+ sprockets (>= 2.8, < 4.0)
134
+ sprockets-rails (>= 2.0, < 4.0)
135
+ tilt (>= 1.1, < 3)
136
+ sdoc (0.4.2)
137
+ json (~> 1.7, >= 1.7.7)
138
+ rdoc (~> 4.0)
139
+ spring (2.0.2)
140
+ activesupport (>= 4.2)
141
+ spring-commands-rspec (1.0.4)
142
+ spring (>= 0.9.1)
143
+ sprockets (3.7.1)
144
+ concurrent-ruby (~> 1.0)
145
+ rack (> 1, < 3)
146
+ sprockets-rails (3.2.1)
147
+ actionpack (>= 4.0)
148
+ activesupport (>= 4.0)
149
+ sprockets (>= 3.0.0)
150
+ thor (0.20.0)
151
+ thread_safe (0.3.6)
152
+ tilt (2.0.8)
153
+ turbolinks (5.0.1)
154
+ turbolinks-source (~> 5)
155
+ turbolinks-source (5.0.3)
156
+ tzinfo (1.2.4)
157
+ thread_safe (~> 0.1)
158
+ uglifier (3.2.0)
159
+ execjs (>= 0.3.0, < 3)
160
+ web-console (2.3.0)
161
+ activemodel (>= 4.0)
162
+ binding_of_caller (>= 0.7.2)
163
+ railties (>= 4.0)
164
+ sprockets-rails (>= 2.0, < 4.0)
165
+
166
+ PLATFORMS
167
+ ruby
168
+
169
+ DEPENDENCIES
170
+ byebug
171
+ coffee-rails (~> 4.1.0)
172
+ jbuilder (~> 2.0)
173
+ jquery-rails
174
+ mysql2 (>= 0.3.13, < 0.5)
175
+ rails (= 4.2.10)
176
+ rake (< 11.0)
177
+ rspec-rails (~> 2.14.0)
178
+ sass-rails (~> 5.0)
179
+ sdoc (~> 0.4.0)
180
+ spring
181
+ spring-commands-rspec
182
+ turbolinks
183
+ uglifier (>= 1.3.0)
184
+ web-console (~> 2.0)
185
+
186
+ BUNDLED WITH
187
+ 1.15.4
@@ -0,0 +1,28 @@
1
+ == README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
25
+
26
+
27
+ Please feel free to use a different markup language if you do not plan to run
28
+ <tt>rake doc:app</tt>.
@@ -0,0 +1,6 @@
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
+
6
+ Rails.application.load_tasks
File without changes
@@ -0,0 +1,16 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require turbolinks
16
+ //= require_tree .
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,5 @@
1
+ class ApplicationController < ActionController::Base
2
+ # Prevent CSRF attacks by raising an exception.
3
+ # For APIs, you may want to use :null_session instead.
4
+ protect_from_forgery with: :exception
5
+ end
File without changes
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
File without changes
File without changes
File without changes
@@ -0,0 +1,2 @@
1
+ class Sample1 < ActiveRecord::Base
2
+ end
@@ -0,0 +1,2 @@
1
+ class Sample2 < ActiveRecord::Base
2
+ end
@@ -0,0 +1,2 @@
1
+ class Sample3 < ActiveRecord::Base
2
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>RailsTest</title>
5
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
6
+ <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path('../spring', __FILE__)
4
+ rescue LoadError => e
5
+ raise unless e.message.include?('spring')
6
+ end
7
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
8
+ require_relative '../config/boot'
9
+ require 'rails/commands'
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path('../spring', __FILE__)
4
+ rescue LoadError => e
5
+ raise unless e.message.include?('spring')
6
+ end
7
+ require_relative '../config/boot'
8
+ require 'rake'
9
+ Rake.application.run
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path('../spring', __FILE__)
4
+ rescue LoadError => e
5
+ raise unless e.message.include?('spring')
6
+ end
7
+ require 'bundler/setup'
8
+ load Gem.bin_path('rspec-core', 'rspec')
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ # path to your application root.
5
+ APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
6
+
7
+ Dir.chdir APP_ROOT do
8
+ # This script is a starting point to setup your application.
9
+ # Add necessary setup steps to this file:
10
+
11
+ puts "== Installing dependencies =="
12
+ system "gem install bundler --conservative"
13
+ system "bundle check || bundle install"
14
+
15
+ # puts "\n== Copying sample files =="
16
+ # unless File.exist?("config/database.yml")
17
+ # system "cp config/database.yml.sample config/database.yml"
18
+ # end
19
+
20
+ puts "\n== Preparing database =="
21
+ system "bin/rake db:setup"
22
+
23
+ puts "\n== Removing old logs and tempfiles =="
24
+ system "rm -f log/*"
25
+ system "rm -rf tmp/cache"
26
+
27
+ puts "\n== Restarting application server =="
28
+ system "touch tmp/restart.txt"
29
+ end
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # This file loads spring without using Bundler, in order to be fast.
4
+ # It gets overwritten when you run the `spring binstub` command.
5
+
6
+ unless defined?(Spring)
7
+ require 'rubygems'
8
+ require 'bundler'
9
+
10
+ lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read)
11
+ spring = lockfile.specs.detect { |spec| spec.name == "spring" }
12
+ if spring
13
+ Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
14
+ gem 'spring', spring.version
15
+ require 'spring/binstub'
16
+ end
17
+ end
@@ -0,0 +1,35 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require "rails"
4
+ # Pick the frameworks you want:
5
+ require "active_model/railtie"
6
+ require "active_job/railtie"
7
+ require "active_record/railtie"
8
+ require "action_controller/railtie"
9
+ require "action_mailer/railtie"
10
+ require "action_view/railtie"
11
+ require "sprockets/railtie"
12
+ # require "rails/test_unit/railtie"
13
+
14
+ # Require the gems listed in Gemfile, including any gems
15
+ # you've limited to :test, :development, or :production.
16
+ Bundler.require(*Rails.groups)
17
+
18
+ module RailsTest
19
+ class Application < Rails::Application
20
+ # Settings in config/environments/* take precedence over those specified here.
21
+ # Application configuration should go into files in config/initializers
22
+ # -- all .rb files in that directory are automatically loaded.
23
+
24
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
25
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
26
+ # config.time_zone = 'Central Time (US & Canada)'
27
+
28
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
29
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
30
+ # config.i18n.default_locale = :de
31
+
32
+ # Do not swallow errors in after_commit/after_rollback callbacks.
33
+ config.active_record.raise_in_transactional_callbacks = true
34
+ end
35
+ end
@@ -0,0 +1,3 @@
1
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
2
+
3
+ require 'bundler/setup' # Set up gems listed in the Gemfile.
@@ -0,0 +1,53 @@
1
+ # MySQL. Versions 5.0+ are recommended.
2
+ #
3
+ # Install the MYSQL driver
4
+ # gem install mysql2
5
+ #
6
+ # Ensure the MySQL gem is defined in your Gemfile
7
+ # gem 'mysql2'
8
+ #
9
+ # And be sure to use new-style password hashing:
10
+ # http://dev.mysql.com/doc/refman/5.0/en/old-client.html
11
+ #
12
+ default: &default
13
+ adapter: mysql2
14
+ encoding: utf8
15
+ pool: 5
16
+ username: root
17
+ password:
18
+
19
+ development:
20
+ <<: *default
21
+ database: rails_test_development
22
+
23
+ # Warning: The database defined as "test" will be erased and
24
+ # re-generated from your development database when you run "rake".
25
+ # Do not set this db to the same as development or production.
26
+ test:
27
+ <<: *default
28
+ database: rails_test_test
29
+
30
+ # As with config/secrets.yml, you never want to store sensitive information,
31
+ # like your database password, in your source code. If your source code is
32
+ # ever seen by anyone, they now have access to your database.
33
+ #
34
+ # Instead, provide the password as a unix environment variable when you boot
35
+ # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
36
+ # for a full rundown on how to provide these environment variables in a
37
+ # production deployment.
38
+ #
39
+ # On Heroku and other platform providers, you may have a full connection URL
40
+ # available as an environment variable. For example:
41
+ #
42
+ # DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase"
43
+ #
44
+ # You can use this database configuration with:
45
+ #
46
+ # production:
47
+ # url: <%= ENV['DATABASE_URL'] %>
48
+ #
49
+ production:
50
+ <<: *default
51
+ database: rails_test_production
52
+ username: rails_test
53
+ password: <%= ENV['RAILS_TEST_DATABASE_PASSWORD'] %>
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!
@@ -0,0 +1,41 @@
1
+ Rails.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
+ # Do not eager load code on boot.
10
+ config.eager_load = false
11
+
12
+ # Show full error reports and disable caching.
13
+ config.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send.
17
+ config.action_mailer.raise_delivery_errors = false
18
+
19
+ # Print deprecation notices to the Rails logger.
20
+ config.active_support.deprecation = :log
21
+
22
+ # Raise an error on page load if there are pending migrations.
23
+ config.active_record.migration_error = :page_load
24
+
25
+ # Debug mode disables concatenation and preprocessing of assets.
26
+ # This option may cause significant delays in view rendering with a large
27
+ # number of complex assets.
28
+ config.assets.debug = true
29
+
30
+ # Asset digests allow you to set far-future HTTP expiration dates on all assets,
31
+ # yet still be able to expire them through the digest params.
32
+ config.assets.digest = true
33
+
34
+ # Adds additional error checking when serving assets at runtime.
35
+ # Checks for improperly declared sprockets dependencies.
36
+ # Raises helpful error messages.
37
+ config.assets.raise_runtime_errors = true
38
+
39
+ # Raises error for missing translations
40
+ # config.action_view.raise_on_missing_translations = true
41
+ end