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 +4 -4
- data/Gemfile.lock +4 -4
- data/README.md +1 -1
- data/copy_csv.gemspec +4 -4
- data/lib/copy_csv.rb +7 -1
- data/lib/copy_csv/version.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d43b65558fb6271bf63286a0b6acab802a10a0da
|
4
|
+
data.tar.gz: a2fb4941db83d5a15605146e00512a2d0a70ecdd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1dfff8cd9a9d07cfe011ecb53c4edbd8eed50c1382c54a92f67bd222f990d3ad22c7ae32de82e6da1975017a3bd15fa702ecd17c6b61225c72a92d73e35da5e5
|
7
|
+
data.tar.gz: 47840018c9cb17c29d28710500d8c71d5705e8eee838de606ac611df5b735636ad0e2c8c013efe14cc18b00f2301d5447a9be3eeae9cf202f54b2027b7491166
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
copy_csv (1.
|
5
|
-
activesupport (
|
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.
|
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.
|
48
|
+
1.16.6
|
data/README.md
CHANGED
data/copy_csv.gemspec
CHANGED
@@ -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 =
|
13
|
-
spec.description =
|
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
|
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", "
|
29
|
+
spec.add_runtime_dependency "activesupport", "~> 5.0"
|
30
30
|
end
|
data/lib/copy_csv.rb
CHANGED
@@ -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
|
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
|
data/lib/copy_csv/version.rb
CHANGED
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:
|
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-
|
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
|
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.
|
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
|