action_csv 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d084353a1dad4ebd1ad7ad4123a7bf5062281965603a21f541b3e7cce85d45e5
4
- data.tar.gz: aa591192c356c53be9a104326829b26d2b06d6d47c21dd97a4008cb31dd31e8a
3
+ metadata.gz: 10da0112b4e38dc497b11442f127a1e3bee478a19f975fc963484a71eed68e71
4
+ data.tar.gz: 568017d0c3cec0a38f2c0c7658b8251db98923c9fc448cfb9b25ba4171fe7104
5
5
  SHA512:
6
- metadata.gz: 2d40b0821a76a44ca351b08ece56ba3e5cbdba30df788b9de1441caf33fe7c55653ed08d2a95e5cdb9aba691c1527ccc64688c18371fd03c67b44c42f8de0c47
7
- data.tar.gz: 1537c7923ea3310d235a0c0f32c3e088687a953f2386e484ff1c2ea6a28145b9eb01332cc1ef1307de66fae5b3586b81c3af1abc09eaaa9694bc68ac48ec2a43
6
+ metadata.gz: d17eb20257d83ba338ec86cdfd4f709c63ccac8d9cad63f4ab3b29a0eec8c6a47f7131db1606635b1f957cbe903a3e6819980048905235872dc494b64947e070
7
+ data.tar.gz: 5a281662d284d984d6ed5ead5eb87fabec49bfc0f333bc59a42a2835faea2d2b2a4414731c39bc2770995de78c1f227fdc91c6594d6a36d74dd531596ea588bb
data/.irb_history CHANGED
@@ -6,3 +6,8 @@ load
6
6
  YAML.safe_load_file "./config/column_names.yml"
7
7
  require "yaml"
8
8
  YAML.safe_load_file "./config/column_names.yml"
9
+ CSV
10
+ require "csv"
11
+ CSV
12
+ ENV
13
+ File
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- action_csv (0.1.3)
4
+ action_csv (0.1.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/lib/action_csv.rb CHANGED
@@ -2,13 +2,14 @@
2
2
 
3
3
  require_relative "action_csv/version"
4
4
  require "yaml"
5
+ require "csv"
5
6
 
6
7
  module ActionCsv
7
8
  class Error < StandardError; end
8
9
  COLUMNS = YAML.safe_load_file "./config/column_names.yml"
9
10
  def self.export_csv model_name
10
11
  singularized_name = model_name.singularize.underscore
11
- file_dir = "./db/csv"
12
+ file_dir = "./db/csv/"
12
13
  FileUtils.mkdir_p file_dir unless Dir.exist? file_dir
13
14
  file_path = ENV["RACK_ENV"] == "production" ? "#{file_dir}#{model_name.pluralize.underscore}_production.csv" : "#{file_dir}#{model_name.pluralize.underscore}.csv"
14
15
  CSV.open(file_path, "w") do |csv|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActionCsv
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.5"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action_csv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI