file_processor 0.1.0 → 0.2.0

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 ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MTM0MzYxZjMxMmZmNTZkY2E2MTE0NGFjZTE5NGUzYTJiZDdjMzgxZg==
5
+ data.tar.gz: !binary |-
6
+ YTVkYmExNWM2NTYyZTBhMzMxNzUzN2ZiMzFmMTYxZTBmMGQ5ZjVjNQ==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ MzUzMGM5ZGY5Mjg3Mjc4MjdlMmEyZmQ4ZGNhYjE3YmQ1ZGI1MTc4YjMyOGNi
10
+ MTEwNDM2MGY1MmMwYTEyYTczN2JiMDAzYWUyMzE4ODUwZjU1MjQxZTliNjQ3
11
+ ZWQ5MGQzYTIzYjg0MWQ5MjU3N2ExZGNkNDAyMDVjZWZhNjI1NWQ=
12
+ data.tar.gz: !binary |-
13
+ YmM0MWM1NjYzYWQyYzg5MjQ3ZjkxY2Y2NDZhMDNmZGExYWU4OWZhZWFjYzVl
14
+ ZDZmNTIzNjI0YTViNTU3OTkyNWFlMGY1ZGRhNWYzN2RmMTAxOWZlYzNiMzBl
15
+ YmFjMWYwYzNiMWVjZTQ3ZDI2MmYzODgzMTFlZjViMDdlY2ZjMTE=
data/.rspec CHANGED
@@ -1,4 +1,3 @@
1
1
  --color
2
2
  --format documentation
3
3
  --drb
4
- --debugger
data/.travis.yml CHANGED
@@ -1,3 +1,4 @@
1
- nguage: ruby
1
+ language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
+ bundler_args: --without development
data/Gemfile.lock CHANGED
@@ -1,30 +1,30 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- file_processor (0.1.0)
4
+ file_processor (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
9
  columnize (0.3.6)
10
- debugger (1.6.0)
10
+ debugger (1.6.2)
11
11
  columnize (>= 0.3.1)
12
12
  debugger-linecache (~> 1.2.0)
13
- debugger-ruby_core_source (~> 1.2.1)
13
+ debugger-ruby_core_source (~> 1.2.3)
14
14
  debugger-linecache (1.2.0)
15
- debugger-ruby_core_source (1.2.2)
15
+ debugger-ruby_core_source (1.2.3)
16
16
  diff-lcs (1.2.4)
17
17
  json (1.7.7)
18
- multi_json (1.7.4)
19
- rake (10.0.4)
20
- rspec (2.14.0.rc1)
21
- rspec-core (= 2.14.0.rc1)
22
- rspec-expectations (= 2.14.0.rc1)
23
- rspec-mocks (= 2.14.0.rc1)
24
- rspec-core (2.14.0.rc1)
25
- rspec-expectations (2.14.0.rc1)
18
+ multi_json (1.8.2)
19
+ rake (10.1.0)
20
+ rspec (2.14.1)
21
+ rspec-core (~> 2.14.0)
22
+ rspec-expectations (~> 2.14.0)
23
+ rspec-mocks (~> 2.14.0)
24
+ rspec-core (2.14.7)
25
+ rspec-expectations (2.14.3)
26
26
  diff-lcs (>= 1.1.3, < 2.0)
27
- rspec-mocks (2.14.0.rc1)
27
+ rspec-mocks (2.14.4)
28
28
  simplecov (0.7.1)
29
29
  multi_json (~> 1.0)
30
30
  simplecov-html (~> 0.7.1)
data/README.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # FileProcessor
2
2
 
3
- [![Build Status](https://travis-ci.org/dtmconsultoria/file_processor.png)](https://travis-ci.org/dtmconsultoria/file_processor)
3
+ [![build status][1]][2]
4
+ [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/dtmtec/file_processor/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
5
+
6
+ [1]: https://travis-ci.org/dtmtec/file_processor.png
7
+ [2]: http://travis-ci.org/dtmtec/file_processor
4
8
 
5
9
  A more powerful CSV file processor
6
10
 
@@ -120,15 +120,14 @@ module FileProcessor
120
120
  tempfile.write(line)
121
121
  end
122
122
  ensure
123
- tempfile.close
124
- loaded_io.close
123
+ tempfile.close if tempfile
124
+ loaded_io.close if loaded_io
125
125
  Encoding.default_internal = @original_default_internal
126
126
  end
127
127
 
128
128
  def decompress(loaded_io)
129
129
  if detect_compression? || gzipped?
130
- Zlib::GzipReader.open(loaded_io).tap do |decompressed_io|
131
- decompressed_io.getc # attempt to read from a compressed io
130
+ Zlib::GzipReader.new(loaded_io).tap do
132
131
  @gzipped = true
133
132
  end
134
133
  else
@@ -1,3 +1,3 @@
1
1
  module FileProcessor
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
data/spec/spec_helper.rb CHANGED
@@ -5,6 +5,11 @@ SimpleCov.start
5
5
 
6
6
  Bundler.require :default
7
7
 
8
+ begin
9
+ require 'debugger'
10
+ rescue LoadError
11
+ end
12
+
8
13
  root = File.expand_path('../..', __FILE__)
9
14
 
10
15
  Dir[File.join(root, "spec/support/**/*.rb")].each { |f| require f }
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: file_processor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
5
- prerelease:
4
+ version: 0.2.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Vicente Mundim
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-06-14 00:00:00.000000000 Z
11
+ date: 2014-04-03 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: A more powerful CSV file processor
15
14
  email:
@@ -50,33 +49,26 @@ files:
50
49
  - spec/support/fixtures/base.csv.gz
51
50
  homepage:
52
51
  licenses: []
52
+ metadata: {}
53
53
  post_install_message:
54
54
  rdoc_options: []
55
55
  require_paths:
56
56
  - lib
57
57
  required_ruby_version: !ruby/object:Gem::Requirement
58
- none: false
59
58
  requirements:
60
59
  - - ! '>='
61
60
  - !ruby/object:Gem::Version
62
61
  version: '0'
63
- segments:
64
- - 0
65
- hash: -785318963478006114
66
62
  required_rubygems_version: !ruby/object:Gem::Requirement
67
- none: false
68
63
  requirements:
69
64
  - - ! '>='
70
65
  - !ruby/object:Gem::Version
71
66
  version: '0'
72
- segments:
73
- - 0
74
- hash: -785318963478006114
75
67
  requirements: []
76
68
  rubyforge_project:
77
- rubygems_version: 1.8.25
69
+ rubygems_version: 2.2.2
78
70
  signing_key:
79
- specification_version: 3
71
+ specification_version: 4
80
72
  summary: A more powerful CSV file processor
81
73
  test_files:
82
74
  - spec/file_processor/csv_spec.rb