diff --git a/CHANGELOG.md b/CHANGELOG.md index 87507da..e2c3e28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Version History +* 1.2.2 - Add rake task to export all models at once. Addresses [issue 15](https://github.com/nirds/timecapsule/issues/15). * 1.2.1 - Fix potential bug by rescuing from potential ActiveRecord#attributes errors. -* 1.2.0 - Add rake task such as `rake timecapsule:users`. Addresses [issue 13](https://github.com/nirds/timecapsule/issues/13) +* 1.2.0 - Add rake task such as `rake timecapsule:users`. Addresses [issue 13](https://github.com/nirds/timecapsule/issues/13). * 1.1.2 - Add new authors. Hurray! diff --git a/lib/timecapsule/tasks.rb b/lib/timecapsule/tasks.rb index 9e66dc1..09f3c40 100644 --- a/lib/timecapsule/tasks.rb +++ b/lib/timecapsule/tasks.rb @@ -1,6 +1,13 @@ namespace :timecapsule do model_list = Dir['app/models/*.rb'].map{ |file| File.basename(file, '.*') } + desc "Generates individual CSV files of all the models" + task :all => :environment do + model_list.each do |klass| + run_timecapsule_for(klass) + end + end + model_list.each do |klass| desc "Generates CSV dump of all #{klass} records" task klass.pluralize.to_sym => :environment do diff --git a/lib/timecapsule/version.rb b/lib/timecapsule/version.rb index 727ae59..d9d5f17 100644 --- a/lib/timecapsule/version.rb +++ b/lib/timecapsule/version.rb @@ -1,3 +1,3 @@ class Timecapsule - VERSION = '1.2.1' + VERSION = '1.2.2' end diff --git a/timecapsule.gemspec b/timecapsule.gemspec index 2e11489..523a97d 100644 --- a/timecapsule.gemspec +++ b/timecapsule.gemspec @@ -5,11 +5,11 @@ Gem::Specification.new do |s| s.name = 'timecapsule' s.version = Timecapsule::VERSION s.authors = ['Renée Hendricksen', 'Kerri Miller', 'Risa Batta'] - s.description = "Great for creating seed data from data entered through your app's UI or the console" + s.description = "Gem for importing and exporting ActiveRecord data as CSV files. Alternative to getting database dumps. :)" s.email = 'robots@nird.us' s.homepage = 'https://github.com/nirds/timecapsule' s.license = 'MIT' - s.summary = 'gem for importing and exporting ActiveRecord data.' + s.summary = 'gem for importing and exporting ActiveRecord data as CSV files.' s.add_runtime_dependency 'activerecord', '>= 2.3.5' s.add_runtime_dependency 'activesupport', '>= 2.3.5'