Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

use rvm and bundler

  • Loading branch information...
commit e2b144d12eccb387d44887a51b0d0d1ce99e7179 1 parent 9f19e47
@flyerhzm authored
View
4 .gitignore
@@ -5,3 +5,7 @@ lib/.DS_Store
.*.swp
coverage.data
tags
+.bundle
+.rvmrc
+*.gem
+Gemfile.lock
View
3  .rspec
@@ -1 +1,2 @@
---colour --format d
+--colour
+--format nested
View
2  .rvmrc.example
@@ -0,0 +1,2 @@
+rvm_gemset_create_on_use_flag=1
+rvm gemset use bullet
View
24 .watchr
@@ -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
+
View
9 Gemfile
@@ -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"
View
2  MIT-LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2009 Richard Huang (flyerhzm@gmail.com)
+Copyright (c) 2009 - 2010 Richard Huang (flyerhzm@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
View
2  README.textile
@@ -412,4 +412,4 @@ In the meanwhile, there's a log appended into <code>log/bullet.log</code> file.
****************************************************************************
-Copyright (c) 2009 Richard Huang (flyerhzm@gmail.com), released under the MIT license
+Copyright (c) 2009 - 2010 Richard Huang (flyerhzm@gmail.com), released under the MIT license
View
2  README_for_rails2.textile
@@ -418,4 +418,4 @@ In the meanwhile, there's a log appended into <code>log/bullet.log</code> file.
****************************************************************************
-Copyright (c) 2009 Richard Huang (flyerhzm@gmail.com), released under the MIT license
+Copyright (c) 2009 - 2010 Richard Huang (flyerhzm@gmail.com), released under the MIT license
View
72 Rakefile
@@ -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
View
1  VERSION
@@ -1 +0,0 @@
-2.0.0.rc1
View
1  autotest/discover.rb
@@ -1 +0,0 @@
-Autotest.add_discovery { "rspec2" }
View
100 bullet.gemspec
@@ -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
View
5 lib/bullet/version.rb
@@ -0,0 +1,5 @@
+# encoding: utf-8
+module Bullet
+ VERSION = "2.0.0"
+end
+
Please sign in to comment.
Something went wrong with that request. Please try again.