query_reviewer 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.
@@ -12,9 +12,9 @@ module QueryReviewer
12
12
  CONFIGURATION.merge!(default_config["all"] || {})
13
13
  CONFIGURATION.merge!(default_config[Rails.env || "test"] || {})
14
14
 
15
- app_config_file = File.join(Rails.root.to_s, "config", "query_reviewer.yml")
15
+ app_config_file = Rails.root + "config/query_reviewer.yml"
16
16
 
17
- if File.exist?(app_config_file)
17
+ if app_config_file.exist?
18
18
  app_config = YAML.load(ERB.new(IO.read(app_config_file)).result)
19
19
  CONFIGURATION.merge!(app_config["all"] || {})
20
20
  CONFIGURATION.merge!(app_config[Rails.env || "test"] || {})
@@ -29,6 +29,15 @@ module QueryReviewer
29
29
  rescue
30
30
  CONFIGURATION["uv"] ||= false
31
31
  end
32
+
33
+ require "query_reviewer/query_warning"
34
+ require "query_reviewer/array_extensions"
35
+ require "query_reviewer/sql_query"
36
+ require "query_reviewer/mysql_analyzer"
37
+ require "query_reviewer/sql_sub_query"
38
+ require "query_reviewer/mysql_adapter_extensions"
39
+ require "query_reviewer/controller_extensions"
40
+ require "query_reviewer/sql_query_collection"
32
41
  end
33
42
  end
34
43
 
@@ -37,18 +46,5 @@ module QueryReviewer
37
46
  end
38
47
  end
39
48
 
40
- QueryReviewer.load_configuration
41
-
42
- if QueryReviewer.enabled?
43
- require "query_reviewer/query_warning"
44
- require "query_reviewer/array_extensions"
45
- require "query_reviewer/sql_query"
46
- require "query_reviewer/mysql_analyzer"
47
- require "query_reviewer/sql_sub_query"
48
- require "query_reviewer/mysql_adapter_extensions"
49
- require "query_reviewer/controller_extensions"
50
- require "query_reviewer/sql_query_collection"
51
- end
52
-
53
49
  # Rails Integration
54
- require 'query_reviewer/rails' if defined?(Rails)
50
+ require 'query_reviewer/rails' if defined?(Rails)
@@ -24,10 +24,14 @@ if defined?(Rails::Railtie)
24
24
  end
25
25
 
26
26
  initializer "query_reviewer.initialize" do
27
+ QueryReviewer.load_configuration
28
+
27
29
  QueryReviewer.inject_reviewer if QueryReviewer.enabled?
28
30
  end
29
31
  end
30
32
  end
31
33
  else # Rails 2
34
+ QueryReviewer.load_configuration
35
+
32
36
  QueryReviewer.inject_reviewer
33
- end
37
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: query_reviewer
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
5
- prerelease:
4
+ hash: 31
5
+ prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - dsboulder, nesquena
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-22 00:00:00 -08:00
18
+ date: 2011-03-07 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  requirements: []
90
90
 
91
91
  rubyforge_project:
92
- rubygems_version: 1.5.2
92
+ rubygems_version: 1.3.7
93
93
  signing_key:
94
94
  specification_version: 3
95
95
  summary: Runs explain before each select query and displays results in an overlayed div