forked from flyerhzm/bullet
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
98 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,7 @@ lib/.DS_Store | |
.*.swp | ||
coverage.data | ||
tags | ||
.bundle | ||
.rvmrc | ||
*.gem | ||
Gemfile.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
--colour --format d | ||
--colour | ||
--format nested |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
rvm_gemset_create_on_use_flag=1 | ||
rvm gemset use bullet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# vim:set filetype=ruby: | ||
def run(cmd) | ||
puts cmd | ||
system cmd | ||
end | ||
|
||
def spec(file) | ||
if File.exists?(file) | ||
run("rspec #{file}") | ||
else | ||
puts("Spec: #{file} does not exist.") | ||
end | ||
end | ||
|
||
watch("spec/.*/*_spec\.rb") do |match| | ||
puts(match[0]) | ||
spec(match[0]) | ||
end | ||
|
||
watch("lib/(.*/.*)\.rb") do |match| | ||
puts(match[1]) | ||
spec("spec/#{match[1]}_spec.rb") | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Use `bundle install` in order to install these gems | ||
# Use `bundle exec rake` in order to run the specs using the bundle | ||
source "http://rubygems.org" | ||
|
||
gem 'rails', '3.0.0' | ||
gem 'sqlite3-ruby', :require => 'sqlite3' | ||
|
||
gem "rspec", "~> 2.0.0.rc" | ||
gem "watchr", "~> 0.7" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,45 @@ | ||
require 'rake' | ||
require 'rspec/core/rake_task' | ||
require 'rake/rdoctask' | ||
require 'jeweler' | ||
require "bundler" | ||
Bundler.setup | ||
|
||
desc 'Default: run unit tests.' | ||
task :default => :spec | ||
require "rake" | ||
require "rake/rdoctask" | ||
require "rspec" | ||
require "rspec/core/rake_task" | ||
|
||
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__) | ||
require "bullet/version" | ||
|
||
desc 'Generate documentation for the bullet plugin.' | ||
Rake::RDocTask.new(:rdoc) do |rdoc| | ||
rdoc.rdoc_dir = 'rdoc' | ||
rdoc.title = 'Bullet' | ||
rdoc.options << '--line-numbers' << '--inline-source' | ||
rdoc.rdoc_files.include('README') | ||
rdoc.rdoc_files.include('lib/**/*.rb') | ||
task :build do | ||
system "gem build bullet.gemspec" | ||
end | ||
|
||
RSpec::Core::RakeTask.new(:spec) | ||
task :install => :build do | ||
system "sudo gem install bullet-#{Bullet::VERSION}.gem" | ||
end | ||
|
||
desc "Run all examples using rcov" | ||
RSpec::Core::RakeTask.new :rcov => :cleanup_rcov_files do |t| | ||
t.rcov = true | ||
t.rcov_opts = %[-Ilib -Ispec --exclude "gems/*,spec/spec_helper.rb"] | ||
t.rcov_opts << %[--no-html --aggregate coverage.data] | ||
task :release => :build do | ||
puts "Tagging #{Bullet::VERSION}..." | ||
system "git tag -a #{Bullet::VERSION} -m 'Tagging #{Bullet::VERSION}'" | ||
puts "Pushing to Github..." | ||
system "git push --tags" | ||
puts "Pushing to rubygems.org..." | ||
system "gem push bullet-#{Bullet::VERSION}.gem" | ||
end | ||
|
||
task :cleanup_rcov_files do | ||
rm_rf 'coverage.data' | ||
Rspec::Core::RakeTask.new(:spec) do |spec| | ||
spec.pattern = "spec/**/*_spec.rb" | ||
end | ||
|
||
task :clobber do | ||
rm_rf 'pkg' | ||
rm_rf 'tmp' | ||
rm_rf 'coverage' | ||
Rspec::Core::RakeTask.new('spec:progress') do |spec| | ||
spec.rspec_opts = %w(--format progress) | ||
spec.pattern = "spec/**/*_spec.rb" | ||
end | ||
|
||
begin | ||
Jeweler::Tasks.new do |gemspec| | ||
gemspec.name = "bullet" | ||
gemspec.summary = "A rails plugin to kill N+1 queries and unused eager loading" | ||
gemspec.description = "The Bullet plugin is designed to help you increase your application's performance by reducing the number of queries it makes. It will watch your queries while you develop your application and notify you when you should add eager loading (N+1 queries) or when you're using eager loading that isn't necessary." | ||
gemspec.email = "flyerhzm@gmail.com" | ||
gemspec.homepage = "http://github.com/flyerhzm/bullet" | ||
gemspec.authors = ["Richard Huang"] | ||
gemspec.files.exclude '.gitignore' | ||
gemspec.files.exclude 'log/*' | ||
end | ||
Jeweler::GemcutterTasks.new | ||
rescue LoadError | ||
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler" | ||
Rake::RDocTask.new do |rdoc| | ||
rdoc.rdoc_dir = "rdoc" | ||
rdoc.title = "bullet #{Bullet::VERSION}" | ||
rdoc.rdoc_files.include("README*") | ||
rdoc.rdoc_files.include("lib/**/*.rb") | ||
end | ||
|
||
task :default => :spec |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,90 +1,22 @@ | ||
# Generated by jeweler | ||
# DO NOT EDIT THIS FILE DIRECTLY | ||
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command | ||
# -*- encoding: utf-8 -*- | ||
lib = File.expand_path('../lib/', __FILE__) | ||
$:.unshift lib unless $:.include?(lib) | ||
|
||
Gem::Specification.new do |s| | ||
s.name = %q{bullet} | ||
s.version = "2.0.0.rc1" | ||
require "bullet/version" | ||
|
||
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version= | ||
s.authors = ["Richard Huang"] | ||
s.date = %q{2010-08-10} | ||
s.description = %q{The Bullet plugin is designed to help you increase your application's performance by reducing the number of queries it makes. It will watch your queries while you develop your application and notify you when you should add eager loading (N+1 queries) or when you're using eager loading that isn't necessary.} | ||
s.email = %q{flyerhzm@gmail.com} | ||
s.extra_rdoc_files = [ | ||
"README.textile", | ||
"README_for_rails2.textile" | ||
] | ||
s.files = [ | ||
".rspec", | ||
"Hacking.textile", | ||
"MIT-LICENSE", | ||
"README.textile", | ||
"README_for_rails2.textile", | ||
"Rakefile", | ||
"VERSION", | ||
"autotest/discover.rb", | ||
"bullet.gemspec", | ||
"lib/bullet.rb", | ||
"lib/bullet/action_controller2.rb", | ||
"lib/bullet/active_record2.rb", | ||
"lib/bullet/active_record3.rb", | ||
"lib/bullet/detector.rb", | ||
"lib/bullet/detector/association.rb", | ||
"lib/bullet/detector/base.rb", | ||
"lib/bullet/detector/counter.rb", | ||
"lib/bullet/detector/n_plus_one_query.rb", | ||
"lib/bullet/detector/unused_eager_association.rb", | ||
"lib/bullet/notification.rb", | ||
"lib/bullet/notification/base.rb", | ||
"lib/bullet/notification/counter_cache.rb", | ||
"lib/bullet/notification/n_plus_one_query.rb", | ||
"lib/bullet/notification/unused_eager_loading.rb", | ||
"lib/bullet/notification_collector.rb", | ||
"lib/bullet/presenter.rb", | ||
"lib/bullet/presenter/base.rb", | ||
"lib/bullet/presenter/bullet_logger.rb", | ||
"lib/bullet/presenter/growl.rb", | ||
"lib/bullet/presenter/javascript_alert.rb", | ||
"lib/bullet/presenter/javascript_console.rb", | ||
"lib/bullet/presenter/javascript_helpers.rb", | ||
"lib/bullet/presenter/rails_logger.rb", | ||
"lib/bullet/presenter/xmpp.rb", | ||
"lib/bullet/rack.rb", | ||
"lib/bullet/registry.rb", | ||
"lib/bullet/registry/association.rb", | ||
"lib/bullet/registry/base.rb", | ||
"lib/bullet/registry/object.rb", | ||
"rails/init.rb", | ||
"spec/bullet/association_for_chris_spec.rb", | ||
"spec/bullet/association_for_peschkaj_spec.rb", | ||
"spec/bullet/association_spec.rb", | ||
"spec/bullet/counter_spec.rb", | ||
"spec/spec_helper.rb", | ||
"tasks/bullet_tasks.rake" | ||
] | ||
s.homepage = %q{http://github.com/flyerhzm/bullet} | ||
s.rdoc_options = ["--charset=UTF-8"] | ||
s.require_paths = ["lib"] | ||
s.rubygems_version = %q{1.3.6} | ||
s.summary = %q{A rails plugin to kill N+1 queries and unused eager loading} | ||
s.test_files = [ | ||
"spec/spec_helper.rb", | ||
"spec/bullet/counter_spec.rb", | ||
"spec/bullet/association_spec.rb", | ||
"spec/bullet/association_for_chris_spec.rb", | ||
"spec/bullet/association_for_peschkaj_spec.rb" | ||
] | ||
Gem::Specification.new do |s| | ||
s.name = "bullet" | ||
s.version = Bullet::VERSION | ||
s.platform = Gem::Platform::RUBY | ||
s.authors = ["Richard Huang"] | ||
s.email = ["flyerhzm@gmail.com"] | ||
s.homepage = "http://github.com/flyerhzm/bullet" | ||
s.summary = "A rails plugin to kill N+1 queries and unused eager loading." | ||
s.description = "A rails plugin to kill N+1 queries and unused eager loading." | ||
|
||
if s.respond_to? :specification_version then | ||
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION | ||
s.specification_version = 3 | ||
s.required_rubygems_version = ">= 1.3.6" | ||
|
||
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then | ||
else | ||
end | ||
else | ||
end | ||
s.extra_rdoc_files = %w(MIT-LICENSE README.textile README_for_rails2.textile) | ||
s.files = Dir.glob("lib/**/*") + %w(MIT-LICENSE README.textile README_for_rails2.textile) | ||
s.require_path = 'lib' | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# encoding: utf-8 | ||
module Bullet | ||
VERSION = "2.0.0" | ||
end | ||
|