Permalink
Browse files

Start using bundler for development.

  • Loading branch information...
1 parent 1d5fbb1 commit 6d20467bd1f39e314543e1e3bf36164d1447dcaa @midas committed Jan 5, 2012
Showing with 80 additions and 182 deletions.
  1. +4 −4 .gitignore
  2. +4 −0 .rspec
  3. +4 −0 Gemfile
  4. +5 −0 Guardfile
  5. +0 −42 History.txt
  6. +1 −50 Rakefile
  7. +0 −1 VERSION
  8. +28 −72 genesis.gemspec
  9. +1 −2 lib/genesis.rb
  10. +3 −0 lib/genesis/version.rb
  11. +7 −5 spec/generators/genesis_generator_spec.rb
  12. +23 −6 spec/spec_helper.rb
View
@@ -1,5 +1,5 @@
-*.sw?
+*.gem
.DS_Store
-coverage
-rdoc
-pkg
+.bundle
+Gemfile.lock
+pkg/*
View
@@ -0,0 +1,4 @@
+--color
+--format documentation
+--backtrace
+--debug
View
@@ -0,0 +1,4 @@
+source "http://rubygems.org"
+
+# Specify your gem's dependencies in genesis.gemspec
+gemspec
View
@@ -0,0 +1,5 @@
+guard 'rspec', :version => 2, :all_on_start => true, :all_after_pass => false, :cli => '--color --format doc' do
+ watch( %r{^spec/.+_spec\.rb$} )
+ watch( %r{^lib/(.+)\.rb$} ) { |m| "spec/lib/#{m[1]}_spec.rb" }
+ watch( 'spec/spec_helper.rb' ) { "spec" }
+end
View
@@ -1,42 +0,0 @@
-== 1.2.1 2010-09-19
-
-* Fix issue with outputting seed delimiter message when the class names are too long.
-* Add seeding start and end messages with contexts referenced.
-* Add total seeding time message.
-
-
-== 1.2.0 2010-09-19
-
-* Make create_or_update_by_* methods able to convert AR objects to IDs if the attribute name includes '_id'.
-* Add contexts.
-
-
-== 1.1.0 2010-07-27
-
-* Fixed issue with version attribute colliding with ActiveRecord's magic attribute name.
-
-
-== 1.0.0 2010-07-08
-
-* Using the ActiveRecord#[] method to access the version attribute of the current version.
-* Made the generators Rails 3 compliant.
-
-
-== 0.0.3 2010-01-04
-
-* Fixed a file include issue to make Genesis work with bundler gem.
-
-
-== 0.0.2 2009-12-15
-
-* Fixed bug with camelcase vs camelize causing different results (ie. methodName vs MethodName) on
- linux systems
-
-
-== 0.0.1 2009-12-12
-
-* Added prepare seeding generator
-* Added seed file generator
-* Added seed version task
-* Added seed task
-* Added mulligan task
View
@@ -1,50 +1 @@
-require 'rubygems'
-require 'rake'
-
-begin
- require 'jeweler'
- Jeweler::Tasks.new do |gem|
- gem.name = "genesis"
- gem.summary = %Q{A data seeding solution for Ruby on Rails.}
- gem.description = %Q{A data seeding solution for Ruby on Rails providing seeding facilities far more advanced than the current built in Ruby on Rails solution.}
- gem.email = "jason@lookforwardenterprises.com"
- gem.homepage = "http://github.com/midas/genesis"
- gem.authors = ["C. Jason Harrelson (midas)"]
- gem.add_dependency "activerecord", ">= 2.0"
- gem.add_development_dependency "rspec"
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
- end
- Jeweler::GemcutterTasks.new
-rescue LoadError
- puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
-end
-
-require 'spec/rake/spectask'
-Spec::Rake::SpecTask.new(:spec) do |spec|
- spec.libs << 'lib' << 'spec'
- spec.spec_files = FileList['spec/**/*_spec.rb']
-end
-
-Spec::Rake::SpecTask.new(:rcov) do |spec|
- spec.libs << 'lib' << 'spec'
- spec.pattern = 'spec/**/*_spec.rb'
- spec.rcov = true
-end
-
-task :spec => :check_dependencies
-
-task :default => :spec
-
-require 'rake/rdoctask'
-Rake::RDocTask.new do |rdoc|
- if File.exist?('VERSION')
- version = File.read('VERSION')
- else
- version = ""
- end
-
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = "genesis #{version}"
- rdoc.rdoc_files.include('README*')
- rdoc.rdoc_files.include('lib/**/*.rb')
-end
+require "bundler/gem_tasks"
View
@@ -1 +0,0 @@
-1.2.1
View
@@ -1,80 +1,36 @@
-# Generated by jeweler
-# DO NOT EDIT THIS FILE DIRECTLY
-# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
# -*- encoding: utf-8 -*-
+$:.push File.expand_path("../lib", __FILE__)
+require "genesis/version"
Gem::Specification.new do |s|
- s.name = %q{genesis}
- s.version = "1.2.1"
-
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["C. Jason Harrelson (midas)"]
- s.date = %q{2010-09-19}
+ s.name = "genesis"
+ s.version = Genesis::VERSION
+ s.authors = ["C. Jason Harrelson"]
+ s.email = ["jason@lookforwardenterprises.com"]
+ s.homepage = "https://github.com/midas/genesis"
+ s.date = %q{2010-09-19}
+ s.summary = %q{A data seeding solution for Ruby on Rails.}
s.description = %q{A data seeding solution for Ruby on Rails providing seeding facilities far more advanced than the current built in Ruby on Rails solution.}
- s.email = %q{jason@lookforwardenterprises.com}
- s.extra_rdoc_files = [
- "LICENSE",
- "README.rdoc"
- ]
- s.files = [
- ".document",
- ".gitignore",
- "History.txt",
- "LICENSE",
- "README.rdoc",
- "Rakefile",
- "VERSION",
- "genesis.gemspec",
- "lib/generators/genesis/genesis_generator.rb",
- "lib/generators/genesis/templates/migration.erb",
- "lib/generators/genesis_contexts/genesis_contexts_generator.rb",
- "lib/generators/prepare_genesis/prepare_genesis_generator.rb",
- "lib/generators/prepare_genesis/templates/genesis.rake",
- "lib/generators/prepare_genesis/templates/genesis_callbacks.rb",
- "lib/genesis.rb",
- "lib/genesis/active_record_extensions.rb",
- "lib/genesis/create_schema_seeds.rb",
- "lib/genesis/schema_seed.rb",
- "lib/genesis/seeder.rb",
- "rails_generators/genesis/USAGE",
- "rails_generators/genesis/genesis_generator.rb",
- "rails_generators/genesis/templates/genesis_override.rake",
- "rails_generators/genesis/templates/migration.rb",
- "rails_generators/genesis_contexts/USAGE",
- "rails_generators/genesis_contexts/genesis_contexts_generator.rb",
- "rails_generators/prepare_seeding/USAGE",
- "rails_generators/prepare_seeding/prepare_seeding_generator.rb",
- "rails_generators/prepare_seeding/templates/genesis.rake",
- "rails_generators/prepare_seeding/templates/genesis_callbacks.rb",
- "spec/generators/genesis_generator_spec.rb",
- "spec/genesis_spec.rb",
- "spec/spec_helper.rb"
- ]
- s.homepage = %q{http://github.com/midas/genesis}
- s.rdoc_options = ["--charset=UTF-8"]
- s.require_paths = ["lib"]
- s.rubygems_version = %q{1.3.7}
- s.summary = %q{A data seeding solution for Ruby on Rails.}
- s.test_files = [
- "spec/generators/genesis_generator_spec.rb",
- "spec/genesis_spec.rb",
- "spec/spec_helper.rb"
- ]
- if s.respond_to? :specification_version then
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- s.specification_version = 3
+ s.rubyforge_project = "genesis"
+
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ s.require_paths = ["lib"]
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<activerecord>, [">= 2.0"])
- s.add_development_dependency(%q<rspec>, [">= 0"])
- else
- s.add_dependency(%q<activerecord>, [">= 2.0"])
- s.add_dependency(%q<rspec>, [">= 0"])
- end
- else
- s.add_dependency(%q<activerecord>, [">= 2.0"])
- s.add_dependency(%q<rspec>, [">= 0"])
+ %w(
+ gem-dandy
+ rspec
+ ruby-debug
+ guard
+ rb-fsevent
+ growl
+ guard-rspec
+ rails
+ ).each do |development_dependency|
+ s.add_development_dependency development_dependency
end
-end
+ # s.add_runtime_dependency "rest-client"
+end
View
@@ -6,8 +6,7 @@
require 'genesis/schema_seed'
module Genesis
- VERSION = '1.2.1'
SEEDS_ROOT = 'db/seeds'
end
-ActiveRecord::Base.send :include, Genesis::ActiveRecordExtensions if defined? ActiveRecord::Base
+ActiveRecord::Base.send :include, Genesis::ActiveRecordExtensions if defined? ActiveRecord::Base
@@ -0,0 +1,3 @@
+module Genesis
+ VERSION = "1.2.1"
+end
@@ -2,23 +2,25 @@
require 'generators/genesis/genesis_generator'
describe GenesisGenerator do
+
before :each do
@destination = File.join 'tmp', 'test_app'
@source = GenesisGenerator.source_root
GenesisGenerator.start '', :destination_root => @destination
end
-
+
after :each do
FileUtils.rm_rf @destination
end
-
- {}.each do |file, path|
+
+ {}.each do |file, path|
it "should copy '#{file}' to '#{path}'" do
File.exists?( File.join( @destination, path ) ).should be_true
end
-
+
# it "should agree that the contents of '#{file}' are identical to '#{path}'" do
# File.read( File.join( @source, file ) ).should eql File.read( File.join( @destination, path ) )
# end
end
-end
+
+end
View
@@ -1,9 +1,26 @@
-$LOAD_PATH.unshift(File.dirname(__FILE__))
-$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+require 'rubygems'
+# require 'active_record'
+# require 'rails'
+require 'bundler/setup'
+
require 'genesis'
-require 'spec'
-require 'spec/autorun'
-Spec::Runner.configure do |config|
-
+RSpec.configure do |config|
+
+ config.mock_with :rspec
+
+end
+
+class Hash
+
+ # for excluding keys
+ def except(*exclusions)
+ self.reject { |key, value| exclusions.include? key.to_sym }
+ end
+
+ # for overriding keys
+ def with(overrides = {})
+ self.merge overrides
+ end
+
end

0 comments on commit 6d20467

Please sign in to comment.