csv_db 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
@@ -1,6 +1,6 @@
1
1
  = csv_db
2
2
  is a gem for rails apps that adds to rake db tasks. The command rake db:csv_to_db pushes csv content to a db table
3
- and the command rake db:db_to_csv pulls a db table into a csv
3
+ and the command rake db:db_to_csv pulls a database table into a csv
4
4
 
5
5
  == Install
6
6
  gem install csv_db
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('csv_db', '1.0.1') do |p|
5
+ Echoe.new('csv_db', '1.0.2') do |p|
6
6
  p.description = "Backup a db table to a csv or push csv content to a database table"
7
7
  p.url = "http://github.com/phongsi/csv_db"
8
8
  p.author = "Phong Si"
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "csv_db"
5
- s.version = "1.0.1"
5
+ s.version = "1.0.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Phong Si"]
@@ -1,6 +1,8 @@
1
+ # code by Phong Si
1
2
  require 'csv'
2
3
 
3
4
  namespace :db do
5
+ desc "pulls database table into a csv file"
4
6
  task :db_to_csv => :environment do
5
7
  model_dir = Dir['**/models/**/*.rb'].detect {|f| ENV['model'] == File.basename(f, '.*').camelize}
6
8
  if !model_dir.eql?(nil)
@@ -21,6 +23,8 @@ namespace :db do
21
23
  puts "Table #{ENV['model']} could not be found"
22
24
  end
23
25
  end
26
+
27
+ desc "pushes csv content into a database table"
24
28
  task :csv_to_db => :environment do
25
29
  model = ENV['csv'].constantize
26
30
  columns = Array.new
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: csv_db
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.1
5
+ version: 1.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Phong Si
metadata.gz.sig CHANGED
Binary file