query_diet 0.5.3 → 0.7.0

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 (73) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +86 -0
  3. data/lib/query_diet/active_record_ext.rb +6 -8
  4. data/lib/query_diet/rack/reset_logger.rb +2 -2
  5. data/lib/query_diet/version.rb +1 -1
  6. data/lib/query_diet/widget.rb +20 -5
  7. metadata +22 -172
  8. data/.gitignore +0 -4
  9. data/README.rdoc +0 -56
  10. data/Rakefile +0 -44
  11. data/query_diet.gemspec +0 -22
  12. data/spec/rails-2.3/Gemfile +0 -9
  13. data/spec/rails-2.3/Gemfile.lock +0 -60
  14. data/spec/rails-2.3/Rakefile +0 -11
  15. data/spec/rails-2.3/app_root/config/boot.rb +0 -114
  16. data/spec/rails-2.3/app_root/config/database.yml +0 -4
  17. data/spec/rails-2.3/app_root/config/environment.rb +0 -14
  18. data/spec/rails-2.3/app_root/config/environments/test.rb +0 -0
  19. data/spec/rails-2.3/app_root/config/routes.rb +0 -4
  20. data/spec/rails-2.3/app_root/log/.gitignore +0 -1
  21. data/spec/rails-2.3/spec.opts +0 -5
  22. data/spec/rails-2.3/spec_helper.rb +0 -27
  23. data/spec/rails-3.0/.rspec +0 -2
  24. data/spec/rails-3.0/Gemfile +0 -9
  25. data/spec/rails-3.0/Gemfile.lock +0 -116
  26. data/spec/rails-3.0/Rakefile +0 -10
  27. data/spec/rails-3.0/app_root/.gitignore +0 -4
  28. data/spec/rails-3.0/app_root/config/application.rb +0 -32
  29. data/spec/rails-3.0/app_root/config/boot.rb +0 -13
  30. data/spec/rails-3.0/app_root/config/database.yml +0 -4
  31. data/spec/rails-3.0/app_root/config/environment.rb +0 -5
  32. data/spec/rails-3.0/app_root/config/environments/test.rb +0 -35
  33. data/spec/rails-3.0/app_root/config/initializers/backtrace_silencers.rb +0 -7
  34. data/spec/rails-3.0/app_root/config/initializers/inflections.rb +0 -10
  35. data/spec/rails-3.0/app_root/config/initializers/mime_types.rb +0 -5
  36. data/spec/rails-3.0/app_root/config/initializers/secret_token.rb +0 -7
  37. data/spec/rails-3.0/app_root/config/initializers/session_store.rb +0 -8
  38. data/spec/rails-3.0/app_root/config/routes.rb +0 -58
  39. data/spec/rails-3.0/app_root/lib/tasks/.gitkeep +0 -0
  40. data/spec/rails-3.0/app_root/log/.gitkeep +0 -0
  41. data/spec/rails-3.0/app_root/script/rails +0 -6
  42. data/spec/rails-3.0/rcov.opts +0 -2
  43. data/spec/rails-3.0/spec_helper.rb +0 -31
  44. data/spec/rails-3.2/.rspec +0 -2
  45. data/spec/rails-3.2/Gemfile +0 -10
  46. data/spec/rails-3.2/Gemfile.lock +0 -127
  47. data/spec/rails-3.2/Rakefile +0 -10
  48. data/spec/rails-3.2/app_root/.gitignore +0 -4
  49. data/spec/rails-3.2/app_root/config/application.rb +0 -32
  50. data/spec/rails-3.2/app_root/config/boot.rb +0 -13
  51. data/spec/rails-3.2/app_root/config/database.yml +0 -4
  52. data/spec/rails-3.2/app_root/config/environment.rb +0 -5
  53. data/spec/rails-3.2/app_root/config/environments/test.rb +0 -35
  54. data/spec/rails-3.2/app_root/config/initializers/backtrace_silencers.rb +0 -7
  55. data/spec/rails-3.2/app_root/config/initializers/inflections.rb +0 -10
  56. data/spec/rails-3.2/app_root/config/initializers/mime_types.rb +0 -5
  57. data/spec/rails-3.2/app_root/config/initializers/secret_token.rb +0 -7
  58. data/spec/rails-3.2/app_root/config/initializers/session_store.rb +0 -8
  59. data/spec/rails-3.2/app_root/config/routes.rb +0 -58
  60. data/spec/rails-3.2/app_root/log/.gitignore +0 -1
  61. data/spec/rails-3.2/rcov.opts +0 -2
  62. data/spec/rails-3.2/spec_helper.rb +0 -31
  63. data/spec/shared/app_root/app/controllers/application_controller.rb +0 -2
  64. data/spec/shared/app_root/app/controllers/query_diet_controller.rb +0 -13
  65. data/spec/shared/app_root/app/models/movie.rb +0 -3
  66. data/spec/shared/app_root/app/views/layouts/screen.html.erb +0 -7
  67. data/spec/shared/app_root/app/views/query_diet/no_query.html.erb +0 -3
  68. data/spec/shared/app_root/app/views/query_diet/two_queries.html.erb +0 -3
  69. data/spec/shared/app_root/db/.gitignore +0 -1
  70. data/spec/shared/app_root/db/migrate/001_create_movies.rb +0 -14
  71. data/spec/shared/query_diet/helpers/widget_spec.rb +0 -32
  72. data/spec/shared/query_diet/integration/widget_spec.rb +0 -23
  73. data/spec/shared/query_diet/logger_spec.rb +0 -91
@@ -1,10 +0,0 @@
1
- require 'rake'
2
- require 'rspec/core/rake_task'
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
- RSpec::Core::RakeTask.new(:spec) do |t|
9
- t.pattern = defined?(SPEC) ? SPEC : ['**/*_spec.rb', '../shared/**/*_spec.rb']
10
- end
@@ -1,4 +0,0 @@
1
- .bundle
2
- db/*.sqlite3
3
- log/*.log
4
- tmp/**/*
@@ -1,32 +0,0 @@
1
- require File.expand_path('../boot', __FILE__)
2
-
3
- require 'rails/all'
4
-
5
- # If you have a Gemfile, require the gems listed there, including any gems
6
- # you've limited to :test, :development, or :production.
7
- Bundler.require(:default, Rails.env) if defined?(Bundler)
8
-
9
-
10
- module HasDefaultSpecApp
11
- class Application < Rails::Application
12
- config.encoding = "utf-8"
13
-
14
- config.cache_classes = true
15
- config.whiny_nils = true
16
-
17
- config.consider_all_requests_local = true
18
- config.action_controller.perform_caching = false
19
-
20
- config.action_dispatch.show_exceptions = false
21
-
22
- config.action_controller.allow_forgery_protection = false
23
-
24
- config.action_mailer.delivery_method = :test
25
-
26
- config.active_support.deprecation = :stderr
27
-
28
- config.root = File.expand_path('../..', __FILE__)
29
-
30
- # railties.plugins << Rails::Plugin.new(File.expand_path('../../../../..', __FILE__))
31
- end
32
- end
@@ -1,13 +0,0 @@
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,4 +0,0 @@
1
- test:
2
- adapter: sqlite3
3
- database: db/query_diet_test.db
4
- verbosity: quiet
@@ -1,5 +0,0 @@
1
- # Load the rails application
2
- require File.expand_path('../application', __FILE__)
3
-
4
- # Initialize the rails application
5
- HasDefaultSpecApp::Application.initialize!
@@ -1,35 +0,0 @@
1
- HasDefaultSpecApp::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
- # 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
@@ -1,7 +0,0 @@
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!
@@ -1,10 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Add new inflection rules using the following format
4
- # (all these examples are active by default):
5
- # ActiveSupport::Inflector.inflections do |inflect|
6
- # inflect.plural /^(ox)$/i, '\1en'
7
- # inflect.singular /^(ox)en/i, '\1'
8
- # inflect.irregular 'person', 'people'
9
- # inflect.uncountable %w( fish sheep )
10
- # end
@@ -1,5 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Add new mime types for use in respond_to blocks:
4
- # Mime::Type.register "text/richtext", :rtf
5
- # Mime::Type.register_alias "text/html", :iphone
@@ -1,7 +0,0 @@
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
- HasDefaultSpecApp::Application.config.secret_token = 'cb014a08a45243e7143f31e04774c342c1fba329fd594ae1a480d8283b1a851f425dc08044311fb4be6d000b6e6681de7c76d19148419a5ffa0a9f84556d3b33'
@@ -1,8 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- HasDefaultSpecApp::Application.config.session_store :cookie_store, :key => '_app_root_session'
4
-
5
- # Use the database for sessions instead of the cookie-based default,
6
- # which shouldn't be used to store highly confidential information
7
- # (create the session table with "rails generate session_migration")
8
- # HasDefaultSpecApp::Application.config.session_store :active_record_store
@@ -1,58 +0,0 @@
1
- HasDefaultSpecApp::Application.routes.draw do
2
- # The priority is based upon order of creation:
3
- # first created -> highest priority.
4
-
5
- # Sample of regular route:
6
- # match 'products/:id' => 'catalog#view'
7
- # Keep in mind you can assign values other than :controller and :action
8
-
9
- # Sample of named route:
10
- # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
11
- # This route can be invoked with purchase_url(:id => product.id)
12
-
13
- # Sample resource route (maps HTTP verbs to controller actions automatically):
14
- # resources :products
15
-
16
- # Sample resource route with options:
17
- # resources :products do
18
- # member do
19
- # get 'short'
20
- # post 'toggle'
21
- # end
22
- #
23
- # collection do
24
- # get 'sold'
25
- # end
26
- # end
27
-
28
- # Sample resource route with sub-resources:
29
- # resources :products do
30
- # resources :comments, :sales
31
- # resource :seller
32
- # end
33
-
34
- # Sample resource route with more complex sub-resources
35
- # resources :products do
36
- # resources :comments
37
- # resources :sales do
38
- # get 'recent', :on => :collection
39
- # end
40
- # end
41
-
42
- # Sample resource route within a namespace:
43
- # namespace :admin do
44
- # # Directs /admin/products/* to Admin::ProductsController
45
- # # (app/controllers/admin/products_controller.rb)
46
- # resources :products
47
- # end
48
-
49
- # You can have the root of your site routed with "root"
50
- # just remember to delete public/index.html.
51
- # root :to => "welcome#index"
52
-
53
- # See how all your routes lay out with "rake routes"
54
-
55
- # This is a legacy wild controller route that's not recommended for RESTful applications.
56
- # Note: This route will make all actions in every controller accessible via GET requests.
57
- match ':controller(/:action(/:id(.:format)))'
58
- end
File without changes
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env ruby1.8
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'
@@ -1,2 +0,0 @@
1
- --exclude "spec/*,gems/*"
2
- --rails
@@ -1,31 +0,0 @@
1
- $: << File.join(File.dirname(__FILE__), "/../lib" )
2
-
3
- # Set the default environment to sqlite3's in_memory database
4
- ENV['RAILS_ENV'] ||= 'test'
5
- ENV['RAILS_ROOT'] = 'app_root'
6
-
7
- # Load the Rails environment and testing framework
8
- require "#{File.dirname(__FILE__)}/app_root/config/environment"
9
- require 'rspec/rails'
10
-
11
- # Load dependencies
12
- # require 'has_defaults'
13
-
14
- # Require support code
15
- # Dir["../shared/support/**/*.rb"].each {|f| require f}
16
-
17
- FileUtils.rm(Dir.glob("#{Rails.root}/db/*.db"), :force => true)
18
-
19
- # Run the migrations
20
- print "\033[30m" # dark gray text
21
- ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate")
22
- print "\033[0m"
23
-
24
- # For some reason the first time the SqliteAdapter fetches schema information it
25
- # raises an error.
26
- Movie.create rescue nil
27
-
28
- RSpec.configure do |config|
29
- config.use_transactional_fixtures = false
30
- config.use_instantiated_fixtures = false
31
- end
@@ -1,2 +0,0 @@
1
- --colour
2
- --format progress
@@ -1,10 +0,0 @@
1
- source 'http://rubygems.org'
2
-
3
- gem 'sqlite3'
4
- gem 'rails', '~>3.2'
5
- gem 'rspec'
6
- gem 'rspec-rails'
7
- gem 'ruby-debug'
8
- gem 'webrat'
9
- gem 'database_cleaner'
10
- gem 'query_diet', :path => '../..'
@@ -1,127 +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 (3.2.8)
10
- actionpack (= 3.2.8)
11
- mail (~> 2.4.4)
12
- actionpack (3.2.8)
13
- activemodel (= 3.2.8)
14
- activesupport (= 3.2.8)
15
- builder (~> 3.0.0)
16
- erubis (~> 2.7.0)
17
- journey (~> 1.0.4)
18
- rack (~> 1.4.0)
19
- rack-cache (~> 1.2)
20
- rack-test (~> 0.6.1)
21
- sprockets (~> 2.1.3)
22
- activemodel (3.2.8)
23
- activesupport (= 3.2.8)
24
- builder (~> 3.0.0)
25
- activerecord (3.2.8)
26
- activemodel (= 3.2.8)
27
- activesupport (= 3.2.8)
28
- arel (~> 3.0.2)
29
- tzinfo (~> 0.3.29)
30
- activeresource (3.2.8)
31
- activemodel (= 3.2.8)
32
- activesupport (= 3.2.8)
33
- activesupport (3.2.8)
34
- i18n (~> 0.6)
35
- multi_json (~> 1.0)
36
- arel (3.0.2)
37
- builder (3.0.4)
38
- columnize (0.3.6)
39
- database_cleaner (0.8.0)
40
- diff-lcs (1.1.3)
41
- erubis (2.7.0)
42
- hike (1.2.1)
43
- i18n (0.6.1)
44
- journey (1.0.4)
45
- json (1.7.5)
46
- linecache (0.46)
47
- rbx-require-relative (> 0.0.4)
48
- mail (2.4.4)
49
- i18n (>= 0.4.0)
50
- mime-types (~> 1.16)
51
- treetop (~> 1.4.8)
52
- mime-types (1.19)
53
- multi_json (1.3.6)
54
- nokogiri (1.5.5)
55
- polyglot (0.3.3)
56
- rack (1.4.1)
57
- rack-cache (1.2)
58
- rack (>= 0.4)
59
- rack-ssl (1.3.2)
60
- rack
61
- rack-test (0.6.2)
62
- rack (>= 1.0)
63
- rails (3.2.8)
64
- actionmailer (= 3.2.8)
65
- actionpack (= 3.2.8)
66
- activerecord (= 3.2.8)
67
- activeresource (= 3.2.8)
68
- activesupport (= 3.2.8)
69
- bundler (~> 1.0)
70
- railties (= 3.2.8)
71
- railties (3.2.8)
72
- actionpack (= 3.2.8)
73
- activesupport (= 3.2.8)
74
- rack-ssl (~> 1.3.2)
75
- rake (>= 0.8.7)
76
- rdoc (~> 3.4)
77
- thor (>= 0.14.6, < 2.0)
78
- rake (0.9.2.2)
79
- rbx-require-relative (0.0.9)
80
- rdoc (3.12)
81
- json (~> 1.4)
82
- rspec (2.11.0)
83
- rspec-core (~> 2.11.0)
84
- rspec-expectations (~> 2.11.0)
85
- rspec-mocks (~> 2.11.0)
86
- rspec-core (2.11.1)
87
- rspec-expectations (2.11.3)
88
- diff-lcs (~> 1.1.3)
89
- rspec-mocks (2.11.3)
90
- rspec-rails (2.11.4)
91
- actionpack (>= 3.0)
92
- activesupport (>= 3.0)
93
- railties (>= 3.0)
94
- rspec (~> 2.11.0)
95
- ruby-debug (0.10.4)
96
- columnize (>= 0.1)
97
- ruby-debug-base (~> 0.10.4.0)
98
- ruby-debug-base (0.10.4)
99
- linecache (>= 0.3)
100
- sprockets (2.1.3)
101
- hike (~> 1.2)
102
- rack (~> 1.0)
103
- tilt (~> 1.1, != 1.3.0)
104
- sqlite3 (1.3.9)
105
- thor (0.16.0)
106
- tilt (1.3.3)
107
- treetop (1.4.12)
108
- polyglot
109
- polyglot (>= 0.3.1)
110
- tzinfo (0.3.34)
111
- webrat (0.7.3)
112
- nokogiri (>= 1.2.0)
113
- rack (>= 1.0)
114
- rack-test (>= 0.5.3)
115
-
116
- PLATFORMS
117
- ruby
118
-
119
- DEPENDENCIES
120
- database_cleaner
121
- query_diet!
122
- rails (~> 3.2)
123
- rspec
124
- rspec-rails
125
- ruby-debug
126
- sqlite3
127
- webrat
@@ -1,10 +0,0 @@
1
- require 'rake'
2
- require 'rspec/core/rake_task'
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
- RSpec::Core::RakeTask.new(:spec) do |t|
9
- t.pattern = defined?(SPEC) ? SPEC : ['**/*_spec.rb', '../shared/**/*_spec.rb']
10
- end
@@ -1,4 +0,0 @@
1
- .bundle
2
- db/*.sqlite3
3
- log/*.log
4
- tmp/**/*
@@ -1,32 +0,0 @@
1
- require File.expand_path('../boot', __FILE__)
2
-
3
- require 'rails/all'
4
-
5
- # If you have a Gemfile, require the gems listed there, including any gems
6
- # you've limited to :test, :development, or :production.
7
- Bundler.require(:default, Rails.env) if defined?(Bundler)
8
-
9
-
10
- module HasDefaultSpecApp
11
- class Application < Rails::Application
12
- config.encoding = "utf-8"
13
-
14
- config.cache_classes = true
15
- config.whiny_nils = true
16
-
17
- config.consider_all_requests_local = true
18
- config.action_controller.perform_caching = false
19
-
20
- config.action_dispatch.show_exceptions = false
21
-
22
- config.action_controller.allow_forgery_protection = false
23
-
24
- config.action_mailer.delivery_method = :test
25
-
26
- config.active_support.deprecation = :stderr
27
-
28
- config.root = File.expand_path('../..', __FILE__)
29
-
30
- # railties.plugins << Rails::Plugin.new(File.expand_path('../../../../..', __FILE__))
31
- end
32
- end