csv_to_products 0.0.1 → 0.0.2

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
  SHA1:
3
- metadata.gz: 733c30bb4373296ea1d8f6679cdcf574b3692709
4
- data.tar.gz: 0a175e31df96210a6a65ef1af490eae96478a5cd
3
+ metadata.gz: 6e285540ef01ff26252480802898ad88e594133a
4
+ data.tar.gz: b35ce20c31cd227dbaed7bc895e27db829d53332
5
5
  SHA512:
6
- metadata.gz: 865c9b1baed471873c5a35912eb75e551b32c9f84dd05488677a5b9d8af8aed164664bf5d51aafe6e63e404bf32f5d1efa1fc0ba4862516235861c596f183f29
7
- data.tar.gz: 377db736f3b275f609e408143505675f765b5e697cf19f7c00ecc8c6e58a51540b0568cbd22684111a204eb9f74f3d28f8751c4de2a8f66d4ea7bd78fea1a1f3
6
+ metadata.gz: 8f9ff4f8d8dcad04aab68851f332a205508b38bb1b41e21cc03c3e057d1a4b677977f7e6a9851808ec3f6efb87315f39f6f00f53666729c08bd35a4e201e0bb1
7
+ data.tar.gz: 0613d038e20b055e0d25b621a067a6d3eb46a7eb2b8dc01b2d1215bc5a089b565d8267ee5380a093e8ffaf758b767b6c88555199e9bbb4be2c032298b3d72469
@@ -0,0 +1,10 @@
1
+ # Older implementations called #row even if other wasn't a CSV::Row
2
+
3
+ class CSV
4
+ class Row
5
+ def ==(other)
6
+ return @row == other.row if other.is_a? CSV::Row
7
+ @row == other
8
+ end
9
+ end
10
+ end
@@ -1,6 +1,7 @@
1
1
  require 'csv'
2
2
  require 'fileutils'
3
3
  require_relative 'pairs'
4
+ require_relative 'core_ext/csv_row'
4
5
 
5
6
  module CSVToProducts
6
7
  class << self
@@ -44,11 +45,11 @@ module CSVToProducts
44
45
  end
45
46
 
46
47
  def product_path
47
- File.expand_path("#{dasherize(row['name'])}.md", folder)
48
+ File.expand_path("#{sanitize(row['name'])}.md", folder)
48
49
  end
49
50
 
50
- def dasherize(s)
51
- s.to_s.gsub(' ', '-').downcase
51
+ def sanitize(s)
52
+ s.to_s.gsub(/[ \/\\]/, '-').downcase
52
53
  end
53
54
 
54
55
  def is_number?(s)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csv_to_products
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max White
@@ -34,6 +34,7 @@ files:
34
34
  - LICENSE.txt
35
35
  - README.md
36
36
  - bin/csv_to_products
37
+ - lib/core_ext/csv_row.rb
37
38
  - lib/csv_to_products.rb
38
39
  - lib/pairs.rb
39
40
  homepage: https://github.com/jekyll-store/csv_to_products
@@ -56,7 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
57
  version: '0'
57
58
  requirements: []
58
59
  rubyforge_project:
59
- rubygems_version: 2.2.2
60
+ rubygems_version: 2.4.5
60
61
  signing_key:
61
62
  specification_version: 4
62
63
  summary: Jekyll-Store cmdline tool to translate CSV file to products.