query_diet 0.5.3 → 0.5.4

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 (70) hide show
  1. checksums.yaml +7 -0
  2. data/lib/query_diet/active_record_ext.rb +2 -1
  3. data/lib/query_diet/rack/reset_logger.rb +2 -2
  4. data/lib/query_diet/version.rb +1 -1
  5. metadata +21 -170
  6. data/.gitignore +0 -4
  7. data/Rakefile +0 -44
  8. data/query_diet.gemspec +0 -22
  9. data/spec/rails-2.3/Gemfile +0 -9
  10. data/spec/rails-2.3/Gemfile.lock +0 -60
  11. data/spec/rails-2.3/Rakefile +0 -11
  12. data/spec/rails-2.3/app_root/config/boot.rb +0 -114
  13. data/spec/rails-2.3/app_root/config/database.yml +0 -4
  14. data/spec/rails-2.3/app_root/config/environment.rb +0 -14
  15. data/spec/rails-2.3/app_root/config/environments/test.rb +0 -0
  16. data/spec/rails-2.3/app_root/config/routes.rb +0 -4
  17. data/spec/rails-2.3/app_root/log/.gitignore +0 -1
  18. data/spec/rails-2.3/spec.opts +0 -5
  19. data/spec/rails-2.3/spec_helper.rb +0 -27
  20. data/spec/rails-3.0/.rspec +0 -2
  21. data/spec/rails-3.0/Gemfile +0 -9
  22. data/spec/rails-3.0/Gemfile.lock +0 -116
  23. data/spec/rails-3.0/Rakefile +0 -10
  24. data/spec/rails-3.0/app_root/.gitignore +0 -4
  25. data/spec/rails-3.0/app_root/config/application.rb +0 -32
  26. data/spec/rails-3.0/app_root/config/boot.rb +0 -13
  27. data/spec/rails-3.0/app_root/config/database.yml +0 -4
  28. data/spec/rails-3.0/app_root/config/environment.rb +0 -5
  29. data/spec/rails-3.0/app_root/config/environments/test.rb +0 -35
  30. data/spec/rails-3.0/app_root/config/initializers/backtrace_silencers.rb +0 -7
  31. data/spec/rails-3.0/app_root/config/initializers/inflections.rb +0 -10
  32. data/spec/rails-3.0/app_root/config/initializers/mime_types.rb +0 -5
  33. data/spec/rails-3.0/app_root/config/initializers/secret_token.rb +0 -7
  34. data/spec/rails-3.0/app_root/config/initializers/session_store.rb +0 -8
  35. data/spec/rails-3.0/app_root/config/routes.rb +0 -58
  36. data/spec/rails-3.0/app_root/lib/tasks/.gitkeep +0 -0
  37. data/spec/rails-3.0/app_root/log/.gitkeep +0 -0
  38. data/spec/rails-3.0/app_root/script/rails +0 -6
  39. data/spec/rails-3.0/rcov.opts +0 -2
  40. data/spec/rails-3.0/spec_helper.rb +0 -31
  41. data/spec/rails-3.2/.rspec +0 -2
  42. data/spec/rails-3.2/Gemfile +0 -10
  43. data/spec/rails-3.2/Gemfile.lock +0 -127
  44. data/spec/rails-3.2/Rakefile +0 -10
  45. data/spec/rails-3.2/app_root/.gitignore +0 -4
  46. data/spec/rails-3.2/app_root/config/application.rb +0 -32
  47. data/spec/rails-3.2/app_root/config/boot.rb +0 -13
  48. data/spec/rails-3.2/app_root/config/database.yml +0 -4
  49. data/spec/rails-3.2/app_root/config/environment.rb +0 -5
  50. data/spec/rails-3.2/app_root/config/environments/test.rb +0 -35
  51. data/spec/rails-3.2/app_root/config/initializers/backtrace_silencers.rb +0 -7
  52. data/spec/rails-3.2/app_root/config/initializers/inflections.rb +0 -10
  53. data/spec/rails-3.2/app_root/config/initializers/mime_types.rb +0 -5
  54. data/spec/rails-3.2/app_root/config/initializers/secret_token.rb +0 -7
  55. data/spec/rails-3.2/app_root/config/initializers/session_store.rb +0 -8
  56. data/spec/rails-3.2/app_root/config/routes.rb +0 -58
  57. data/spec/rails-3.2/app_root/log/.gitignore +0 -1
  58. data/spec/rails-3.2/rcov.opts +0 -2
  59. data/spec/rails-3.2/spec_helper.rb +0 -31
  60. data/spec/shared/app_root/app/controllers/application_controller.rb +0 -2
  61. data/spec/shared/app_root/app/controllers/query_diet_controller.rb +0 -13
  62. data/spec/shared/app_root/app/models/movie.rb +0 -3
  63. data/spec/shared/app_root/app/views/layouts/screen.html.erb +0 -7
  64. data/spec/shared/app_root/app/views/query_diet/no_query.html.erb +0 -3
  65. data/spec/shared/app_root/app/views/query_diet/two_queries.html.erb +0 -3
  66. data/spec/shared/app_root/db/.gitignore +0 -1
  67. data/spec/shared/app_root/db/migrate/001_create_movies.rb +0 -14
  68. data/spec/shared/query_diet/helpers/widget_spec.rb +0 -32
  69. data/spec/shared/query_diet/integration/widget_spec.rb +0 -23
  70. data/spec/shared/query_diet/logger_spec.rb +0 -91
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2deea9908e9dcc378261cc0a31d816dd7f6cfc8e
4
+ data.tar.gz: 1038eca5e56ac5a839f130c2b0b421be4e6dd2a4
5
+ SHA512:
6
+ metadata.gz: c806425decd164abaafc2fb9e20eefdaa64508cf4ec986e7b5622825c5029a77b363e6d63681cbb52c743d070099e1728bf7360241d4fbbed22914143885dfb5
7
+ data.tar.gz: 02ff75bbe20739846ed15e52f84b3be6dc0c1916b8d74dad53175dbdc1fce945356e7698cab45321bc925eabeb3281ed942a3e1df2c5d68fc93f5dec07fc1dd0
@@ -6,6 +6,7 @@ ActiveRecord::ConnectionAdapters::AbstractAdapter.class_eval do
6
6
  end
7
7
  end
8
8
 
9
- alias_method_chain :log, :query_diet
9
+ alias_method :log_without_query_diet, :log
10
+ alias_method :log, :log_with_query_diet
10
11
 
11
12
  end
@@ -18,9 +18,9 @@ end
18
18
  if defined?(Rails::Railtie)
19
19
  class QueryDiet::Railtie < Rails::Railtie
20
20
  initializer 'query_diet.insert_middleware' do |app|
21
- app.config.middleware.use 'QueryDiet::Rack::ResetLogger'
21
+ app.config.middleware.use QueryDiet::Rack::ResetLogger
22
22
  end
23
23
  end
24
24
  else
25
- ActionController::Dispatcher.middleware.use('QueryDiet::Rack::ResetLogger')
25
+ ActionController::Dispatcher.middleware.use(QueryDiet::Rack::ResetLogger)
26
26
  end
@@ -1,3 +1,3 @@
1
1
  module QueryDiet
2
- VERSION = '0.5.3'
2
+ VERSION = '0.5.4'
3
3
  end
metadata CHANGED
@@ -1,201 +1,52 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: query_diet
3
- version: !ruby/object:Gem::Version
4
- hash: 13
5
- prerelease:
6
- segments:
7
- - 0
8
- - 5
9
- - 3
10
- version: 0.5.3
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.4
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Henning Koch
14
8
  - Tobias Kraze
15
9
  autorequire:
16
10
  bindir: bin
17
11
  cert_chain: []
18
-
19
- date: 2014-10-20 00:00:00 +02:00
20
- default_executable:
12
+ date: 2016-02-05 00:00:00.000000000 Z
21
13
  dependencies: []
22
-
23
14
  description: Rails database query counter that stays out of your way
24
15
  email: github@makandra.de
25
16
  executables: []
26
-
27
17
  extensions: []
28
-
29
18
  extra_rdoc_files: []
30
-
31
- files:
32
- - .gitignore
19
+ files:
33
20
  - MIT-LICENSE
34
21
  - README.rdoc
35
- - Rakefile
36
22
  - lib/query_diet.rb
37
23
  - lib/query_diet/active_record_ext.rb
38
24
  - lib/query_diet/logger.rb
39
25
  - lib/query_diet/rack/reset_logger.rb
40
26
  - lib/query_diet/version.rb
41
27
  - lib/query_diet/widget.rb
42
- - query_diet.gemspec
43
- - spec/rails-2.3/Gemfile
44
- - spec/rails-2.3/Gemfile.lock
45
- - spec/rails-2.3/Rakefile
46
- - spec/rails-2.3/app_root/config/boot.rb
47
- - spec/rails-2.3/app_root/config/database.yml
48
- - spec/rails-2.3/app_root/config/environment.rb
49
- - spec/rails-2.3/app_root/config/environments/test.rb
50
- - spec/rails-2.3/app_root/config/routes.rb
51
- - spec/rails-2.3/app_root/log/.gitignore
52
- - spec/rails-2.3/spec.opts
53
- - spec/rails-2.3/spec_helper.rb
54
- - spec/rails-3.0/.rspec
55
- - spec/rails-3.0/Gemfile
56
- - spec/rails-3.0/Gemfile.lock
57
- - spec/rails-3.0/Rakefile
58
- - spec/rails-3.0/app_root/.gitignore
59
- - spec/rails-3.0/app_root/config/application.rb
60
- - spec/rails-3.0/app_root/config/boot.rb
61
- - spec/rails-3.0/app_root/config/database.yml
62
- - spec/rails-3.0/app_root/config/environment.rb
63
- - spec/rails-3.0/app_root/config/environments/test.rb
64
- - spec/rails-3.0/app_root/config/initializers/backtrace_silencers.rb
65
- - spec/rails-3.0/app_root/config/initializers/inflections.rb
66
- - spec/rails-3.0/app_root/config/initializers/mime_types.rb
67
- - spec/rails-3.0/app_root/config/initializers/secret_token.rb
68
- - spec/rails-3.0/app_root/config/initializers/session_store.rb
69
- - spec/rails-3.0/app_root/config/routes.rb
70
- - spec/rails-3.0/app_root/lib/tasks/.gitkeep
71
- - spec/rails-3.0/app_root/log/.gitkeep
72
- - spec/rails-3.0/app_root/script/rails
73
- - spec/rails-3.0/rcov.opts
74
- - spec/rails-3.0/spec_helper.rb
75
- - spec/rails-3.2/.rspec
76
- - spec/rails-3.2/Gemfile
77
- - spec/rails-3.2/Gemfile.lock
78
- - spec/rails-3.2/Rakefile
79
- - spec/rails-3.2/app_root/.gitignore
80
- - spec/rails-3.2/app_root/config/application.rb
81
- - spec/rails-3.2/app_root/config/boot.rb
82
- - spec/rails-3.2/app_root/config/database.yml
83
- - spec/rails-3.2/app_root/config/environment.rb
84
- - spec/rails-3.2/app_root/config/environments/test.rb
85
- - spec/rails-3.2/app_root/config/initializers/backtrace_silencers.rb
86
- - spec/rails-3.2/app_root/config/initializers/inflections.rb
87
- - spec/rails-3.2/app_root/config/initializers/mime_types.rb
88
- - spec/rails-3.2/app_root/config/initializers/secret_token.rb
89
- - spec/rails-3.2/app_root/config/initializers/session_store.rb
90
- - spec/rails-3.2/app_root/config/routes.rb
91
- - spec/rails-3.2/app_root/log/.gitignore
92
- - spec/rails-3.2/rcov.opts
93
- - spec/rails-3.2/spec_helper.rb
94
- - spec/shared/app_root/app/controllers/application_controller.rb
95
- - spec/shared/app_root/app/controllers/query_diet_controller.rb
96
- - spec/shared/app_root/app/models/movie.rb
97
- - spec/shared/app_root/app/views/layouts/screen.html.erb
98
- - spec/shared/app_root/app/views/query_diet/no_query.html.erb
99
- - spec/shared/app_root/app/views/query_diet/two_queries.html.erb
100
- - spec/shared/app_root/db/.gitignore
101
- - spec/shared/app_root/db/migrate/001_create_movies.rb
102
- - spec/shared/query_diet/helpers/widget_spec.rb
103
- - spec/shared/query_diet/integration/widget_spec.rb
104
- - spec/shared/query_diet/logger_spec.rb
105
- has_rdoc: true
106
28
  homepage: https://github.com/makandra/query_diet
107
- licenses:
29
+ licenses:
108
30
  - MIT
109
- post_install_message: Remember to put <%= query_diet_widget if Rails.env.development? %> into your app layout.
31
+ metadata: {}
32
+ post_install_message:
110
33
  rdoc_options: []
111
-
112
- require_paths:
34
+ require_paths:
113
35
  - lib
114
- required_ruby_version: !ruby/object:Gem::Requirement
115
- none: false
116
- requirements:
36
+ required_ruby_version: !ruby/object:Gem::Requirement
37
+ requirements:
117
38
  - - ">="
118
- - !ruby/object:Gem::Version
119
- hash: 3
120
- segments:
121
- - 0
122
- version: "0"
123
- required_rubygems_version: !ruby/object:Gem::Requirement
124
- none: false
125
- requirements:
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ required_rubygems_version: !ruby/object:Gem::Requirement
42
+ requirements:
126
43
  - - ">="
127
- - !ruby/object:Gem::Version
128
- hash: 3
129
- segments:
130
- - 0
131
- version: "0"
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
132
46
  requirements: []
133
-
134
47
  rubyforge_project:
135
- rubygems_version: 1.3.9.5
48
+ rubygems_version: 2.4.8
136
49
  signing_key:
137
- specification_version: 3
50
+ specification_version: 4
138
51
  summary: Rails database query counter that stays out of your way
139
- test_files:
140
- - spec/rails-2.3/Gemfile
141
- - spec/rails-2.3/Gemfile.lock
142
- - spec/rails-2.3/Rakefile
143
- - spec/rails-2.3/app_root/config/boot.rb
144
- - spec/rails-2.3/app_root/config/database.yml
145
- - spec/rails-2.3/app_root/config/environment.rb
146
- - spec/rails-2.3/app_root/config/environments/test.rb
147
- - spec/rails-2.3/app_root/config/routes.rb
148
- - spec/rails-2.3/app_root/log/.gitignore
149
- - spec/rails-2.3/spec.opts
150
- - spec/rails-2.3/spec_helper.rb
151
- - spec/rails-3.0/.rspec
152
- - spec/rails-3.0/Gemfile
153
- - spec/rails-3.0/Gemfile.lock
154
- - spec/rails-3.0/Rakefile
155
- - spec/rails-3.0/app_root/.gitignore
156
- - spec/rails-3.0/app_root/config/application.rb
157
- - spec/rails-3.0/app_root/config/boot.rb
158
- - spec/rails-3.0/app_root/config/database.yml
159
- - spec/rails-3.0/app_root/config/environment.rb
160
- - spec/rails-3.0/app_root/config/environments/test.rb
161
- - spec/rails-3.0/app_root/config/initializers/backtrace_silencers.rb
162
- - spec/rails-3.0/app_root/config/initializers/inflections.rb
163
- - spec/rails-3.0/app_root/config/initializers/mime_types.rb
164
- - spec/rails-3.0/app_root/config/initializers/secret_token.rb
165
- - spec/rails-3.0/app_root/config/initializers/session_store.rb
166
- - spec/rails-3.0/app_root/config/routes.rb
167
- - spec/rails-3.0/app_root/lib/tasks/.gitkeep
168
- - spec/rails-3.0/app_root/log/.gitkeep
169
- - spec/rails-3.0/app_root/script/rails
170
- - spec/rails-3.0/rcov.opts
171
- - spec/rails-3.0/spec_helper.rb
172
- - spec/rails-3.2/.rspec
173
- - spec/rails-3.2/Gemfile
174
- - spec/rails-3.2/Gemfile.lock
175
- - spec/rails-3.2/Rakefile
176
- - spec/rails-3.2/app_root/.gitignore
177
- - spec/rails-3.2/app_root/config/application.rb
178
- - spec/rails-3.2/app_root/config/boot.rb
179
- - spec/rails-3.2/app_root/config/database.yml
180
- - spec/rails-3.2/app_root/config/environment.rb
181
- - spec/rails-3.2/app_root/config/environments/test.rb
182
- - spec/rails-3.2/app_root/config/initializers/backtrace_silencers.rb
183
- - spec/rails-3.2/app_root/config/initializers/inflections.rb
184
- - spec/rails-3.2/app_root/config/initializers/mime_types.rb
185
- - spec/rails-3.2/app_root/config/initializers/secret_token.rb
186
- - spec/rails-3.2/app_root/config/initializers/session_store.rb
187
- - spec/rails-3.2/app_root/config/routes.rb
188
- - spec/rails-3.2/app_root/log/.gitignore
189
- - spec/rails-3.2/rcov.opts
190
- - spec/rails-3.2/spec_helper.rb
191
- - spec/shared/app_root/app/controllers/application_controller.rb
192
- - spec/shared/app_root/app/controllers/query_diet_controller.rb
193
- - spec/shared/app_root/app/models/movie.rb
194
- - spec/shared/app_root/app/views/layouts/screen.html.erb
195
- - spec/shared/app_root/app/views/query_diet/no_query.html.erb
196
- - spec/shared/app_root/app/views/query_diet/two_queries.html.erb
197
- - spec/shared/app_root/db/.gitignore
198
- - spec/shared/app_root/db/migrate/001_create_movies.rb
199
- - spec/shared/query_diet/helpers/widget_spec.rb
200
- - spec/shared/query_diet/integration/widget_spec.rb
201
- - spec/shared/query_diet/logger_spec.rb
52
+ test_files: []
data/.gitignore DELETED
@@ -1,4 +0,0 @@
1
- doc
2
- pkg
3
- *.gem
4
- .idea
data/Rakefile DELETED
@@ -1,44 +0,0 @@
1
- require 'rake'
2
- require 'bundler/gem_tasks'
3
-
4
- desc 'Default: Run all specs.'
5
- task :default => 'all:spec'
6
-
7
- namespace :all do
8
-
9
- desc "Run specs on all spec apps"
10
- task :spec do
11
- for_each_directory_of('spec/**/Rakefile') do |directory|
12
- env = "SPEC=../../#{ENV['SPEC']} " if ENV['SPEC']
13
- system("cd #{directory} && #{env} bundle exec rake spec")
14
- end
15
- end
16
-
17
- namespace :bundle do
18
-
19
- desc "Bundle all spec apps"
20
- task :install do
21
- for_each_directory_of('spec/**/Gemfile') do |directory|
22
- system("cd #{directory} && bundle install")
23
- end
24
- end
25
-
26
- desc "Update a gem given by the GEM environment variable"
27
- task :update do
28
- gem = ENV['GEM'] or raise "Name the gem you wish to update by setting a environment variable GEM"
29
- for_each_directory_of('spec/**/Gemfile') do |directory|
30
- system("cd #{directory} && bundle update #{gem}")
31
- end
32
- end
33
-
34
- end
35
-
36
- end
37
-
38
- def for_each_directory_of(path, &block)
39
- Dir[path].sort.each do |rakefile|
40
- directory = File.dirname(rakefile)
41
- puts '', "\033[44m#{directory}\033[0m", ''
42
- block.call(directory)
43
- end
44
- end
data/query_diet.gemspec DELETED
@@ -1,22 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- $: << File.expand_path('../lib', __FILE__)
3
- require 'query_diet/version'
4
-
5
- Gem::Specification.new do |gem|
6
- gem.authors = ["Henning Koch", "Tobias Kraze"]
7
- gem.email = "github@makandra.de"
8
- gem.description = "Rails database query counter that stays out of your way"
9
- gem.summary = gem.description
10
- gem.homepage = "https://github.com/makandra/query_diet"
11
- gem.license = 'MIT'
12
-
13
- gem.files = `git ls-files`.split($\)
14
- gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
15
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
16
- gem.name = "query_diet"
17
- gem.require_paths = ["lib"]
18
- gem.version = QueryDiet::VERSION
19
-
20
- gem.post_install_message = "Remember to put <%= query_diet_widget if Rails.env.development? %> into your app layout."
21
- end
22
-
@@ -1,9 +0,0 @@
1
- source :rubygems
2
-
3
- gem 'rails', '~> 2.3'
4
- gem 'rspec', '~> 1.3'
5
- gem 'rspec-rails', '~> 1.3'
6
- gem 'sqlite3'
7
- gem 'query_diet', :path => '../..'
8
- gem 'ruby-debug'
9
- gem 'webrat'
@@ -1,60 +0,0 @@
1
- PATH
2
- remote: ../..
3
- specs:
4
- query_diet (0.5.3)
5
-
6
- GEM
7
- remote: http://rubygems.org/
8
- specs:
9
- actionmailer (2.3.14)
10
- actionpack (= 2.3.14)
11
- actionpack (2.3.14)
12
- activesupport (= 2.3.14)
13
- rack (~> 1.1.0)
14
- activerecord (2.3.14)
15
- activesupport (= 2.3.14)
16
- activeresource (2.3.14)
17
- activesupport (= 2.3.14)
18
- activesupport (2.3.14)
19
- columnize (0.3.6)
20
- linecache (0.46)
21
- rbx-require-relative (> 0.0.4)
22
- nokogiri (1.5.5)
23
- rack (1.1.3)
24
- rack-test (0.6.2)
25
- rack (>= 1.0)
26
- rails (2.3.14)
27
- actionmailer (= 2.3.14)
28
- actionpack (= 2.3.14)
29
- activerecord (= 2.3.14)
30
- activeresource (= 2.3.14)
31
- activesupport (= 2.3.14)
32
- rake (>= 0.8.3)
33
- rake (0.9.2.2)
34
- rbx-require-relative (0.0.9)
35
- rspec (1.3.2)
36
- rspec-rails (1.3.4)
37
- rack (>= 1.0.0)
38
- rspec (~> 1.3.1)
39
- ruby-debug (0.10.4)
40
- columnize (>= 0.1)
41
- ruby-debug-base (~> 0.10.4.0)
42
- ruby-debug-base (0.10.4)
43
- linecache (>= 0.3)
44
- sqlite3 (1.3.6)
45
- webrat (0.7.3)
46
- nokogiri (>= 1.2.0)
47
- rack (>= 1.0)
48
- rack-test (>= 0.5.3)
49
-
50
- PLATFORMS
51
- ruby
52
-
53
- DEPENDENCIES
54
- query_diet!
55
- rails (~> 2.3)
56
- rspec (~> 1.3)
57
- rspec-rails (~> 1.3)
58
- ruby-debug
59
- sqlite3
60
- webrat
@@ -1,11 +0,0 @@
1
- require 'rake'
2
- require 'spec/rake/spectask'
3
-
4
- desc 'Default: Run all specs for a specific rails version.'
5
- task :default => :spec
6
-
7
- desc "Run all specs for a specific rails version"
8
- Spec::Rake::SpecTask.new() do |t|
9
- t.spec_opts = ['--options', "\"spec.opts\""]
10
- t.spec_files = defined?(SPEC) ? SPEC : FileList['**/*_spec.rb', '../shared/**/*_spec.rb']
11
- end
@@ -1,114 +0,0 @@
1
- # Allow customization of the rails framework path
2
- RAILS_FRAMEWORK_ROOT = (ENV['RAILS_FRAMEWORK_ROOT'] || "#{File.dirname(__FILE__)}/../../../../../../vendor/rails") unless defined?(RAILS_FRAMEWORK_ROOT)
3
-
4
- # Don't change this file!
5
- # Configure your app in config/environment.rb and config/environments/*.rb
6
-
7
- RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
8
-
9
- module Rails
10
- class << self
11
- def boot!
12
- unless booted?
13
- preinitialize
14
- pick_boot.run
15
- end
16
- end
17
-
18
- def booted?
19
- defined? Rails::Initializer
20
- end
21
-
22
- def pick_boot
23
- (vendor_rails? ? VendorBoot : GemBoot).new
24
- end
25
-
26
- def vendor_rails?
27
- File.exist?(RAILS_FRAMEWORK_ROOT)
28
- end
29
-
30
- def preinitialize
31
- load(preinitializer_path) if File.exist?(preinitializer_path)
32
- end
33
-
34
- def preinitializer_path
35
- "#{RAILS_ROOT}/config/preinitializer.rb"
36
- end
37
- end
38
-
39
- class Boot
40
- def run
41
- load_initializer
42
- Rails::Initializer.run(:set_load_path)
43
- end
44
- end
45
-
46
- class VendorBoot < Boot
47
- def load_initializer
48
- require "#{RAILS_FRAMEWORK_ROOT}/railties/lib/initializer"
49
- Rails::Initializer.run(:install_gem_spec_stubs)
50
- end
51
- end
52
-
53
- class GemBoot < Boot
54
- def load_initializer
55
- self.class.load_rubygems
56
- load_rails_gem
57
- require 'initializer'
58
- end
59
-
60
- def load_rails_gem
61
- if version = self.class.gem_version
62
- gem 'rails', version
63
- else
64
- gem 'rails'
65
- end
66
- rescue Gem::LoadError => load_error
67
- $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.)
68
- exit 1
69
- end
70
-
71
- class << self
72
- def rubygems_version
73
- Gem::RubyGemsVersion rescue nil
74
- end
75
-
76
- def gem_version
77
- if defined? RAILS_GEM_VERSION
78
- RAILS_GEM_VERSION
79
- elsif ENV.include?('RAILS_GEM_VERSION')
80
- ENV['RAILS_GEM_VERSION']
81
- else
82
- parse_gem_version(read_environment_rb)
83
- end
84
- end
85
-
86
- def load_rubygems
87
- require 'rubygems'
88
- min_version = '1.1.1'
89
- unless rubygems_version >= min_version
90
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
91
- exit 1
92
- end
93
-
94
- rescue LoadError
95
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
96
- exit 1
97
- end
98
-
99
- def parse_gem_version(text)
100
- $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
101
- end
102
-
103
- private
104
- def read_environment_rb
105
- environment_rb = "#{RAILS_ROOT}/config/environment.rb"
106
- environment_rb = "#{HELPER_RAILS_ROOT}/config/environment.rb" unless File.exists?(environment_rb)
107
- File.read(environment_rb)
108
- end
109
- end
110
- end
111
- end
112
-
113
- # All that for this:
114
- Rails.boot!
@@ -1,4 +0,0 @@
1
- test:
2
- adapter: sqlite3
3
- database: db/query_diet_test.db
4
- verbosity: quiet
@@ -1,14 +0,0 @@
1
- require File.join(File.dirname(__FILE__), 'boot')
2
-
3
- Rails::Initializer.run do |config|
4
- config.cache_classes = false
5
- config.whiny_nils = true
6
- config.action_controller.session = { :key => "_myapp_session", :secret => "gwirofjweroijger8924rt2zfwehfuiwehb1378rifowenfoqwphf23" }
7
- config.plugin_locators.unshift(
8
- Class.new(Rails::Plugin::Locator) do
9
- def plugins
10
- [Rails::Plugin.new(File.expand_path('.'))]
11
- end
12
- end
13
- ) unless defined?(PluginTestHelper::PluginLocator)
14
- end
File without changes
@@ -1,4 +0,0 @@
1
- ActionController::Routing::Routes.draw do |map|
2
- map.connect ':controller/:action/:id'
3
- map.connect ':controller/:action/:id.:format'
4
- end
@@ -1 +0,0 @@
1
- *.log
@@ -1,5 +0,0 @@
1
- --colour
2
- --format progress
3
- --loadby mtime
4
- --reverse
5
- --debugger
@@ -1,27 +0,0 @@
1
- $LOAD_PATH << File.expand_path('../../lib', __FILE__)
2
-
3
- ENV['RAILS_ENV'] ||= 'test'
4
-
5
- # Load the Rails environment and testing framework
6
- require File.expand_path('../app_root/config/environment', __FILE__)
7
- require 'query_diet'
8
-
9
- MissingSourceFile::REGEXPS << [/^cannot load such file -- (.+)$/i, 1] # Ruby 1.9 vs Rails 2.3 fix
10
-
11
- require 'spec/rails'
12
- require 'webrat/integrations/rspec-rails'
13
-
14
- # Undo changes to RAILS_ENV
15
- silence_warnings {RAILS_ENV = ENV['RAILS_ENV']}
16
-
17
- FileUtils.rm(Dir.glob("#{Rails.root}/db/*.db"), :force => true)
18
-
19
- # Run the migrations
20
- ActiveRecord::Migration.verbose = false
21
- ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate")
22
-
23
- Spec::Runner.configure do |config|
24
- config.use_transactional_fixtures = true
25
- config.use_instantiated_fixtures = false
26
- config.include(Webrat::Matchers, :type => [:integration])
27
- end
@@ -1,2 +0,0 @@
1
- --colour
2
- --format progress
@@ -1,9 +0,0 @@
1
- source 'http://rubygems.org'
2
-
3
- gem 'sqlite3'
4
- gem 'rails', '=3.0.17'
5
- gem 'rspec'
6
- gem 'rspec-rails'
7
- gem 'ruby-debug'
8
- gem 'query_diet', :path => '../..'
9
- gem 'webrat'