copy_csv 1.0.0 → 2.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 05c8fd7fec59eb36302453b825ded8c7f2d386e5
4
- data.tar.gz: b1941e33bb62c4644cc3503a44fa0dfb266d119e
3
+ metadata.gz: d43b65558fb6271bf63286a0b6acab802a10a0da
4
+ data.tar.gz: a2fb4941db83d5a15605146e00512a2d0a70ecdd
5
5
  SHA512:
6
- metadata.gz: 8902421ed37191cd383bc24f2bfe7fdb732dcc2790ff726b566b9b6009e387122c722fd0c863649fd6ddc75c87429f31bf6139ab512c0deb59b38bdf3367ce0a
7
- data.tar.gz: f8010477bdefc5d105f9f842e90cd964a04794c05cd1c292b8b2dfa084d3b8bbe18aea36c3ba30e31b0875a427bf415d3152a138175b6cb79ab894c35f7b347d
6
+ metadata.gz: 1dfff8cd9a9d07cfe011ecb53c4edbd8eed50c1382c54a92f67bd222f990d3ad22c7ae32de82e6da1975017a3bd15fa702ecd17c6b61225c72a92d73e35da5e5
7
+ data.tar.gz: 47840018c9cb17c29d28710500d8c71d5705e8eee838de606ac611df5b735636ad0e2c8c013efe14cc18b00f2301d5447a9be3eeae9cf202f54b2027b7491166
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- copy_csv (1.0.0)
5
- activesupport (>= 5.0)
4
+ copy_csv (1.1.0)
5
+ activesupport (~> 5.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
@@ -14,7 +14,7 @@ GEM
14
14
  tzinfo (~> 1.1)
15
15
  concurrent-ruby (1.0.5)
16
16
  diff-lcs (1.3)
17
- i18n (1.1.0)
17
+ i18n (1.1.1)
18
18
  concurrent-ruby (~> 1.0)
19
19
  minitest (5.11.3)
20
20
  rake (10.5.0)
@@ -45,4 +45,4 @@ DEPENDENCIES
45
45
  rspec (~> 3.0)
46
46
 
47
47
  BUNDLED WITH
48
- 1.16.3
48
+ 1.16.6
data/README.md CHANGED
@@ -90,7 +90,7 @@ And it can be used in that console session.
90
90
 
91
91
  ## Documentation
92
92
 
93
- View the [docs](https://www.rubydoc.info/gems/copy_csv/0.1.0).
93
+ View the [docs](https://www.rubydoc.info/gems/copy_csv/).
94
94
 
95
95
  ## Development
96
96
 
@@ -9,14 +9,14 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Jason Stumbaugh"]
10
10
  spec.email = ["stumbaughjason@gmail.com"]
11
11
 
12
- spec.summary = %q{Copy an ActiveRecord relation to a CSV formatted string}
13
- spec.description = %q{Copy an ActiveRecord relation to a CSV formatted string}
12
+ spec.summary = "Copy an ActiveRecord relation to a CSV formatted string"
13
+ spec.description = "Copy an ActiveRecord relation from a Postgres database to a CSV formatted string"
14
14
  spec.homepage = "https://github.com/jstumbaugh/copy_csv"
15
15
  spec.license = "MIT"
16
16
 
17
17
  # Specify which files should be added to the gem when it is released.
18
18
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
19
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
19
+ spec.files = Dir.chdir(File.expand_path("..", __FILE__)) do
20
20
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
21
21
  end
22
22
  spec.bindir = "exe"
@@ -26,5 +26,5 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency "bundler", "~> 1.16"
27
27
  spec.add_development_dependency "rake", "~> 10.0"
28
28
  spec.add_development_dependency "rspec", "~> 3.0"
29
- spec.add_runtime_dependency "activesupport", ">= 5.0"
29
+ spec.add_runtime_dependency "activesupport", "~> 5.0"
30
30
  end
@@ -24,7 +24,7 @@ module CopyCsv
24
24
  raw = connection.raw_connection
25
25
  raw.copy_data(query) do
26
26
  while (row = raw.get_copy_data)
27
- io.puts row
27
+ io.puts(ensure_utf8(row))
28
28
  end
29
29
  end
30
30
 
@@ -43,5 +43,11 @@ module CopyCsv
43
43
  all.copy_csv(file)
44
44
  end
45
45
  end
46
+
47
+ private
48
+
49
+ def ensure_utf8(str)
50
+ str.to_s.encode("UTF-8", invalid: :replace, undef: :replace, replace: "?")
51
+ end
46
52
  end
47
53
  end
@@ -1,3 +1,3 @@
1
1
  module CopyCsv
2
- VERSION = "1.0.0"
2
+ VERSION = "2.0.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: copy_csv
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Stumbaugh
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-08-16 00:00:00.000000000 Z
11
+ date: 2018-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -56,17 +56,18 @@ dependencies:
56
56
  name: activesupport
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '5.0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '5.0'
69
- description: Copy an ActiveRecord relation to a CSV formatted string
69
+ description: Copy an ActiveRecord relation from a Postgres database to a CSV formatted
70
+ string
70
71
  email:
71
72
  - stumbaughjason@gmail.com
72
73
  executables: []
@@ -107,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
108
  version: '0'
108
109
  requirements: []
109
110
  rubyforge_project:
110
- rubygems_version: 2.5.2.1
111
+ rubygems_version: 2.5.2.2
111
112
  signing_key:
112
113
  specification_version: 4
113
114
  summary: Copy an ActiveRecord relation to a CSV formatted string