muzzy 0.1.12 → 0.1.13
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/exe/muzzy +9 -6
- data/lib/muzzy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70311bea7d537c03c4f4a1980a3333701752c0db
|
4
|
+
data.tar.gz: 52a3d53769438167c321c5631cb7baa5e15da5b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86d2d36ca0fa3eb1cc41c8a3c604a5f910e9d8006ea941fe94f8a3c013fe41f18dbd2f1b764a7a708bdf04ccb0a54fe81ae6da4f1f8785c86c891ab82aa0739a
|
7
|
+
data.tar.gz: 4ba9b910287dbe31f566a6d396cfad67ff44828d87173e96ca85b95b079b407c04bd2343377bc45f0b9a0e1b9a19130f5d2d45918c871271738d6190a66340f0
|
data/exe/muzzy
CHANGED
@@ -14,7 +14,7 @@ kakasi_path = File.absolute_path(File.expand_path('..', __FILE__) + "/../vendor/
|
|
14
14
|
unless File.exists?(kakasi_path)
|
15
15
|
$stderr.puts "cannot find kakasi. please check kakasi installation is successed."
|
16
16
|
$stderr.puts "expect path: #{kakasi_path}"
|
17
|
-
$stderr.puts "If you
|
17
|
+
$stderr.puts "If you had not executed `muzzy_setup` yet, please run `muzzy_setup` first."
|
18
18
|
exit 1
|
19
19
|
end
|
20
20
|
mysql_cmd = `which mysql`.to_s.chomp
|
@@ -79,7 +79,9 @@ ARGV.options do |opt|
|
|
79
79
|
else
|
80
80
|
opt.on('-f', '--file [FILEPATH]', 'path to target file') {|v| options[:file] = v }
|
81
81
|
end
|
82
|
-
|
82
|
+
if options[:file].to_s != ''
|
83
|
+
check_file(options[:file])
|
84
|
+
end
|
83
85
|
|
84
86
|
opt.on('-v', '--version') {
|
85
87
|
$stdout.puts opt.ver
|
@@ -134,14 +136,15 @@ if first_row_is_header == nil
|
|
134
136
|
end
|
135
137
|
end
|
136
138
|
|
137
|
-
|
139
|
+
# convert header row to compatible with database table columns
|
138
140
|
if first_row_is_header
|
139
141
|
first_row = first_row.map do |str|
|
140
142
|
std_out = Open3.capture2('echo', str)[0]
|
141
143
|
Open3.capture2(kakasi_path, '-Ja', '-Ha', '-Ka', '-Ea', '-i', 'utf8', '-o', 'utf8', stdin_data: std_out)[0]
|
142
|
-
end.map
|
143
|
-
# kakasi returns ko^do if 'コード' given so
|
144
|
-
|
144
|
+
end.map do |x|
|
145
|
+
# kakasi returns ko^do if 'コード' given so replace it to _
|
146
|
+
# space changes to _
|
147
|
+
x.chomp.strip.gsub(/[\^]/, '_').gsub(/\s/, '_')
|
145
148
|
end
|
146
149
|
end
|
147
150
|
|
data/lib/muzzy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: muzzy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vimtaku
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|