Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base: master
...
compare: master
Checking mergeability… Don’t worry, you can still create the pull request.
  • 8 commits
  • 12 files changed
  • 0 commit comments
  • 2 contributors
View
5 .document
@@ -1,5 +0,0 @@
-README.rdoc
-lib/**/*.rb
-bin/*
-features/**/*.feature
-LICENSE
View
30 .gitignore
@@ -1,6 +1,28 @@
-*.sw?
.DS_Store
-coverage
-rdoc
-pkg
+.rvmrc
.idea
+*.pgz
+config/database.yml
+log/*.log
+public/flash/*.swf
+tmp/**/*
+*.tmproj
+public/stylesheets/packaged/*.css
+public/javascripts/packaged/*.js
+tmp
+log
+config/*.sphinx.conf
+db/sphinx/
+sphinx/**/*
+public/packages/*
+.gitconfig
+config/sphinx.yml
+.bundle
+bin/*
+.sass-cache
+project.rvmrc
+public/assets
+*.gem
+
+/.ey_local_data
+/.vagrant
View
1  .rbenv-version
@@ -0,0 +1 @@
+1.9.3-p194
View
59 CHANGELOG.rdoc
@@ -1,59 +0,0 @@
-== 1.0.0.beta0 / 2010-12-21
-
-* Added Gemfile and updated gemspec to list all dependencies
-* Require all libraries needed (YAML and singleton)
-* Updated tests to work with latest shoulda
-
-== 1.0.0.beta0 / 2010-12-20
-
-* Updating to Rails 3 compat
-
-== 0.5.2 / 2009-07-09
-
-* Improved backtrace output.
-
-== 0.5.1 / 2009-07-07
-
-* Fixed a couple of bugs that caused the data to be preloaded multiple times or deleted multiple times.
-
-== 0.5.0 / 2009-07-07
-
-* Added better error handling. The data[:key] = record form is deprecated in favor of data.add(:key) { record }.
-* Allow preloaders to be redefined. This should make this more compatible with autotest.
-
-== 0.4.3 / 2009-06-05
-
-* Added shoulda and mocha development dependencies.
-
-== 0.4.2 / 2009-06-02
-
-* Raise an appropriate error when the developer tries to get a record for a preloader that was never run.
-
-== 0.4.1 / 2009-06-01
-
-* Updated documentation (Forgot to for the 0.4.0 release).
-
-== 0.4.0 / 2009-06-01
-
-* Added ability to only preload some of the types.
-* During preloading, print to the console to indicate the records being preloaded and a benchmark.
-
-== 0.3.2 / 2009-04-07
-
-* Fixed a bug with the ordering of the dependent preloaders.
-
-== 0.3.1 / 2009-03-30
-
-* Updated documentation. (Forgot to for 0.3.0 release)
-
-== 0.3.0 / 2009-03-30
-
-* Added logic to auto load the factory_data files.
-
-== 0.2.0 / 2009-03-30
-
-* Added :depends_on option to the preloader, to force the preloaders to load in the correct order based on your foreign keys and table dependencies.
-
-== 0.1.0 / 2009-03-30
-
-* Initial release
View
52 Gemfile.lock
@@ -1,42 +1,41 @@
PATH
remote: .
specs:
- factory_data_preloader (1.0.0.beta0)
+ factory_data_preloader (1.0.2)
GEM
remote: http://rubygems.org/
specs:
- activemodel (3.0.3)
- activesupport (= 3.0.3)
- builder (~> 2.1.2)
- i18n (~> 0.4)
- activerecord (3.0.3)
- activemodel (= 3.0.3)
- activesupport (= 3.0.3)
- arel (~> 2.0.2)
- tzinfo (~> 0.3.23)
- activesupport (3.0.3)
- arel (2.0.6)
- builder (2.1.2)
- columnize (0.3.2)
- git (1.2.5)
- i18n (0.5.0)
- jeweler (1.5.2)
- bundler (~> 1.0.0)
- git (>= 1.2.5)
- rake
- linecache (0.43)
- mocha (0.9.10)
- rake
- rake (0.8.7)
+ activemodel (3.2.9)
+ activesupport (= 3.2.9)
+ builder (~> 3.0.0)
+ activerecord (3.2.9)
+ activemodel (= 3.2.9)
+ activesupport (= 3.2.9)
+ arel (~> 3.0.2)
+ tzinfo (~> 0.3.29)
+ activesupport (3.2.9)
+ i18n (~> 0.6)
+ multi_json (~> 1.0)
+ arel (3.0.2)
+ builder (3.0.4)
+ columnize (0.3.6)
+ i18n (0.6.1)
+ linecache (0.46)
+ rbx-require-relative (> 0.0.4)
+ mocha (0.9.12)
+ multi_json (1.5.0)
+ rbx-require-relative (0.0.9)
ruby-debug (0.10.4)
columnize (>= 0.1)
ruby-debug-base (~> 0.10.4.0)
ruby-debug-base (0.10.4)
linecache (>= 0.3)
shoulda (2.11.3)
- sqlite3-ruby (1.3.2)
- tzinfo (0.3.23)
+ sqlite3 (1.3.6)
+ sqlite3-ruby (1.3.3)
+ sqlite3 (>= 1.3.3)
+ tzinfo (0.3.35)
PLATFORMS
ruby
@@ -45,7 +44,6 @@ DEPENDENCIES
activerecord (>= 2.3.0)
activesupport (>= 2.3.0)
factory_data_preloader!
- jeweler
mocha (>= 0.9.10, < 0.10.0)
ruby-debug (>= 0.10.3)
shoulda (>= 2.11.3, < 2.12.0)
View
20 LICENSE
@@ -1,20 +0,0 @@
-Copyright (c) 2009 Myron Marston, Kashless.org
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
64 Rakefile
@@ -1,59 +1,5 @@
-require 'rubygems'
-require 'yaml'
-require 'rake'
-
-begin
- require 'jeweler'
- Jeweler::Tasks.new do |gem|
- gem.name = "factory_data_preloader"
- gem.summary = %Q{A library for preloading test data in rails applications.}
- gem.email = "myron.marston@gmail.com"
- gem.homepage = "http://github.com/myronmarston/factory_data_preloader"
- gem.authors = ["Myron Marston"]
- gem.add_development_dependency 'Shoulda'
- gem.add_development_dependency 'mocha'
-
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
- end
-rescue LoadError
- puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
-end
-
-require 'rake/testtask'
-Rake::TestTask.new(:test) do |test|
- test.libs << 'lib' << 'test'
- test.pattern = 'test/**/*_test.rb'
- test.verbose = false
-end
-
-begin
- require 'rcov/rcovtask'
- Rcov::RcovTask.new do |test|
- test.libs << 'test'
- test.pattern = 'test/**/*_test.rb'
- test.verbose = true
- end
-rescue LoadError
- task :rcov do
- abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
- end
-end
-
-
-task :default => :test
-
-require 'rake/rdoctask'
-Rake::RDocTask.new do |rdoc|
- if File.exist?('VERSION.yml')
- config = YAML.load(File.read('VERSION.yml'))
- version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}.#{config[:build]}"
- else
- version = ""
- end
-
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = "factory_data_preloader #{version}"
- rdoc.rdoc_files.include('README*')
- rdoc.rdoc_files.include('lib/**/*.rb')
-end
-
+require 'bundler'
+require 'rspec/core/rake_task'
+Bundler::GemHelper.install_tasks
+RSpec::Core::RakeTask.new(:spec)
+task :default => :spec
View
5 VERSION.yml
@@ -1,5 +0,0 @@
----
-:major: 1
-:minor: 0
-:patch: 0
-:build: 'beta0'
View
37 factory_data_preloader.gemspec
@@ -2,35 +2,21 @@
Gem::Specification.new do |s|
s.name = %q{factory_data_preloader}
- s.version = "1.0.0.beta0"
+ s.version = "1.0.3"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Myron Marston"]
+ s.authors = ["Kyle J. Ginavan"]
s.date = %q{2009-07-09}
- s.email = %q{myron.marston@gmail.com}
- s.extra_rdoc_files = ["README.rdoc", "LICENSE"]
- s.files = ["CHANGELOG.rdoc",
- "README.rdoc",
- "VERSION.yml",
- "lib/factory_data_preloader",
- "lib/factory_data_preloader/core_ext.rb",
- "lib/factory_data_preloader/factory_data.rb",
- "lib/factory_data_preloader/preloaded_data_hash.rb",
- "lib/factory_data_preloader/preloader.rb",
- "lib/factory_data_preloader/preloader_collection.rb",
- "lib/factory_data_preloader/rails_core_ext.rb",
- "lib/factory_data_preloader/railtie.rb",
- "lib/factory_data_preloader.rb",
- "test/factory_data_test.rb",
- "test/lib",
- "test/lib/models.rb",
- "test/lib/schema.rb",
- "test/preloaded_data_hash_test.rb",
- "test/preloader_test.rb",
- "test/test_helper.rb",
- "LICENSE"]
+ s.email = %q{kylejginavan@gmail.com}
+ s.extra_rdoc_files = ["README.rdoc"]
+
+ 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"]
+
s.has_rdoc = true
- s.homepage = %q{http://github.com/myronmarston/factory_data_preloader}
+ s.homepage = %q{http://github.com/kylejginavan/factory_data_preloader}
s.rdoc_options = ["--inline-source", "--charset=UTF-8"]
s.require_paths = ["lib"]
s.rubygems_version = %q{1.3.1}
@@ -40,6 +26,5 @@ Gem::Specification.new do |s|
s.add_development_dependency("mocha", [">= 0.9.10", "< 0.10.0"])
s.add_development_dependency("activerecord", [">= 2.3.0"])
s.add_development_dependency("activesupport", [">= 2.3.0"])
- s.add_development_dependency("jeweler", [">= 0"])
s.add_development_dependency("sqlite3-ruby", [">= 1.3.2", "< 1.4.0"])
end
View
1  lib/factory_data_preloader.rb
@@ -1,4 +1,3 @@
-require 'test/unit'
require 'rubygems'
require 'singleton'
View
22 lib/factory_data_preloader/rails_core_ext.rb
@@ -8,8 +8,8 @@
patch_module = defined?(ActiveRecord::TestFixtures) ? ActiveRecord::TestFixtures : Test::Unit::TestCase
patch_module.class_eval do
- def load_fixtures_with_preloaded_factory_data
- val = load_fixtures_without_preloaded_factory_data
+ def setup_fixtures_with_preloaded_factory_data
+ val = setup_fixtures_without_preloaded_factory_data
FactoryData.preload_data!
val
end
@@ -19,17 +19,21 @@ def teardown_fixtures_with_preloaded_factory_data
teardown_fixtures_without_preloaded_factory_data
end
- alias_method_chain :load_fixtures, :preloaded_factory_data
+ alias_method_chain :setup_fixtures, :preloaded_factory_data
alias_method_chain :teardown_fixtures, :preloaded_factory_data
end
-class Fixtures
- def delete_existing_fixtures_with_preloaded_factory_data
- delete_existing_fixtures_without_preloaded_factory_data
- FactoryData.delete_preload_data!
- end
+# Fixtures#delete_existing_fixtures was removed in Rails 3.1
+# see: https://github.com/rails/rails/commit/f9ea47736e270152c264bb5f8fdbfaa1d04fe82f
+if ActiveRecord::Fixtures.instance_methods(false).include?(:delete_existing_fixtures)
+ class Fixtures
+ def delete_existing_fixtures_with_preloaded_factory_data
+ delete_existing_fixtures_without_preloaded_factory_data
+ FactoryData.delete_preload_data!
+ end
- alias_method_chain :delete_existing_fixtures, :preloaded_factory_data
+ alias_method_chain :delete_existing_fixtures, :preloaded_factory_data
+ end
end
class ActiveSupport::TestCase
View
2  test/test_helper.rb
@@ -1,5 +1,4 @@
require 'rubygems'
-require 'test/unit'
require 'shoulda'
require 'sqlite3'
@@ -11,7 +10,6 @@
# ruby-debug wasn't available so neither can the debugging be
end
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))

No commit comments for this range

Something went wrong with that request. Please try again.