cascade-rb 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d26998810ac71323dc84adce37888cb7bbce2127
4
- data.tar.gz: ac4635ee292536f00506ecd96a6cee059ec0745e
3
+ metadata.gz: a7c6aadcd330b397cf46bd735ec764579c5a221d
4
+ data.tar.gz: a3e28fcdd18696b60c7ac067f3cbbfc87fa5acca
5
5
  SHA512:
6
- metadata.gz: f2942683553dbdef1d91b028f7720e9f284d8df08640bd76c9403da70b77ec2a959292aa0f268835fd0c647c4eae715c55fba061510423415c8f8067e3806a55
7
- data.tar.gz: bebf683f1b2bbabf727555aca0c114373612c93a7f0cced61ffc836e07f2f576d37d365b791c66f5e56fdd82a4e1074c0c095944e0c8e277fc9861efeddee482
6
+ metadata.gz: 3a4a9bd0fb79bbe8e23f7ef0255c5ea0b650018325189ac2204aa2281de0cf75933ab475a18cc7c0c310dc0748c7dd7a84c84f37453a3dec5c9c38a6badd005b
7
+ data.tar.gz: 556e36c7e5c1d20f2f17fe69c36e9596297820d2c92b6bf8e5c9664d949b9065dea650fbdde1baaf2e1d1e1a816713b0b036c2027d4746db2a1003b16cf875f8
data/README.md CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
  [![Codeship Status for ignat-zakrevsky/cascade](https://codeship.com/projects/d7590880-9943-0132-4aa6-1e41bc68e178/status?branch=master)](https://codeship.com/projects/63625) [![Code Climate](https://codeclimate.com/github/ignat-zakrevsky/cascade/badges/gpa.svg)](https://codeclimate.com/github/ignat-zakrevsky/cascade) [![Test Coverage](https://codeclimate.com/github/ignat-zakrevsky/cascade/badges/coverage.svg)](https://codeclimate.com/github/ignat-zakrevsky/cascade) [![Gem Version](https://badge.fury.io/rb/cascade-rb.svg)](http://badge.fury.io/rb/cascade-rb) [![Codacy Badge](https://api.codacy.com/project/badge/grade/3d27b4bc418341dcb4f704cafebffd4d)](https://www.codacy.com/app/iezakrevsky/cascade)
4
4
 
5
- The main aim of this gem is to provide some kind of template for parsing files.
6
- Usually, parsing file process contains next steps:
5
+ The main goal of this gem is to provide some kind of template for parsing files.
6
+ Usually, file parsing process consists of the following steps:
7
7
 
8
- 1. Retreiving info from file
8
+ 1. Retrieve info from file
9
9
  2. Distinguish content from each file line
10
10
  3. Parse each column with corresponding parser
11
11
  4. Generate some kind of data record
@@ -52,26 +52,26 @@ Cascade.configuration do
52
52
  end
53
53
  ```
54
54
 
55
- Provide iteratable object for parsing and run it!
55
+ Provide enumerable object for parsing and run it!
56
56
  ```ruby
57
57
  Cascade::DataParser.new(data_provider: Csv.open("data_test.csv")).call
58
58
  ```
59
59
 
60
60
  ## Columns mapping
61
- Parsing file description should have next structure [(example)](https://github.com/ignat-zakrevsky/cascade-example/blob/master/columns_mapping.yml)
61
+ Parsing file description should have the following structure [(example)](https://github.com/ignat-zakrevsky/cascade-example/blob/master/columns_mapping.yml)
62
62
  ```yaml
63
63
  mapping:
64
64
  name: type
65
65
  ```
66
66
 
67
67
  ## Columns parsing
68
- There are several alredy defined fields parsers (types):
68
+ There are already several defined field parsers (types):
69
69
 
70
70
  - currency
71
71
  - boolean
72
72
  - string
73
73
 
74
- Feel free to add new fields parsers and provide it through PR.
74
+ Feel free to add new field parsers through PR.
75
75
 
76
76
  ## Components replaceability
77
77
  There is a lot of DI in this gem, so, you can replace each component of the parser. Let's assume you want to parse JSON files instead of CSV, save this to ActiveRecord model, and you need Date fields parsing, ok!
@@ -8,7 +8,7 @@ module Cascade
8
8
  extend Configuration
9
9
  using HashRefinements
10
10
 
11
- DEFAULT_PROCESSOR = ->(value) { value }
11
+ DEFAULT_PROCESSOR = ->(value) { value && value.to_s.strip }
12
12
 
13
13
  define_setting :use_default_presenter, false
14
14
  define_setting :deafult_presenter, -> { DEFAULT_PROCESSOR }
@@ -1,4 +1,4 @@
1
1
  module Cascade
2
2
  # current gem version
3
- VERSION = "0.2.2"
3
+ VERSION = "0.2.3"
4
4
  end
@@ -26,7 +26,7 @@ describe Cascade::RowProcessor do
26
26
  it "collect row values with corresponding keys" do
27
27
  processed_row = described_class.new(columns_matching:
28
28
  columns_matching).call(row)
29
- assert_equal(processed_row, a: :a_value, b: :b_value, c: :c_value)
29
+ assert_equal(processed_row, a: "a_value", b: "b_value", c: "c_value")
30
30
  end
31
31
  end
32
32
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cascade-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ignat Zakrevsky
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-28 00:00:00.000000000 Z
11
+ date: 2016-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler