senju_kan_non 0.2.1 → 0.2.2
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/lib/senju_kan_non.rb +3 -8
- data/lib/senju_kan_non/config.rb +0 -2
- data/lib/senju_kan_non/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: 24004cf95f61e3d25bbc0db56bb602e2d11bdd0e
|
|
4
|
+
data.tar.gz: fca73c01424375e79ef0c8efdf3b94802f89082c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 50621652045b31f5d44f86997264052942a24c34508b459cb7a9947a8b69b2fa94f60bafb9b513ab8a0f33c9dc53a7641bb1f0fae98d3e8b824bf0806666d8f7
|
|
7
|
+
data.tar.gz: ee5b60ee98766ec534c7c6a8883b71cde78ae1a02cb00ae5f8e4d368ec70ba85494bb4baed06cfd643a58faefd6b3fb80d89f1019541af73c02f2ec1c98c1c2a
|
data/lib/senju_kan_non.rb
CHANGED
|
@@ -8,11 +8,8 @@ module SenjuKanNon
|
|
|
8
8
|
return false unless issai_shujo.kind_of?(Hash)
|
|
9
9
|
|
|
10
10
|
if SenjuKanNon.config.use_file && File.exist?(SenjuKanNon.config.file_output_path + file_name(issai_shujo.keys, time))
|
|
11
|
-
@formatted_riyaku = []
|
|
12
11
|
File.open(SenjuKanNon.config.file_output_path + file_name(issai_shujo.keys, time)) do |file|
|
|
13
|
-
|
|
14
|
-
@formatted_riyaku << JSON.parse(row)
|
|
15
|
-
end
|
|
12
|
+
JSON.load(file)
|
|
16
13
|
end
|
|
17
14
|
else
|
|
18
15
|
sekke(issai_shujo)
|
|
@@ -73,15 +70,13 @@ module SenjuKanNon
|
|
|
73
70
|
def genze_riyaku(keys, formatted_riyaku)
|
|
74
71
|
FileUtils.mkdir_p(SenjuKanNon.config.file_output_path) unless FileTest.exist?(SenjuKanNon.config.file_output_path)
|
|
75
72
|
File.open(SenjuKanNon.config.file_output_path + file_name(keys), "w") do |f|
|
|
76
|
-
formatted_riyaku
|
|
77
|
-
f.puts(fr.to_s)
|
|
78
|
-
end
|
|
73
|
+
JSON.dump(formatted_riyaku, f)
|
|
79
74
|
end
|
|
80
75
|
end
|
|
81
76
|
|
|
82
77
|
def file_name(keys, time=nil)
|
|
83
78
|
time = Time.now.strftime("%Y%m%d%H%M%S") unless time
|
|
84
|
-
"#{time}_#{keys.join("_")}
|
|
79
|
+
"#{time}_#{keys.join("_")}.json"
|
|
85
80
|
end
|
|
86
81
|
end
|
|
87
82
|
end
|
data/lib/senju_kan_non/config.rb
CHANGED
|
@@ -13,14 +13,12 @@ module SenjuKanNon
|
|
|
13
13
|
include ::ActiveSupport::Configurable
|
|
14
14
|
config_accessor :file_output
|
|
15
15
|
config_accessor :file_output_path
|
|
16
|
-
config_accessor :file_output_extension
|
|
17
16
|
config_accessor :use_file
|
|
18
17
|
end
|
|
19
18
|
|
|
20
19
|
configure do |config|
|
|
21
20
|
config.file_output = false
|
|
22
21
|
config.file_output_path = "test/senju_kan_non/"
|
|
23
|
-
config.file_output_extension = "txt"
|
|
24
22
|
config.use_file = false
|
|
25
23
|
end
|
|
26
24
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: senju_kan_non
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- hanahiroAze
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-11-
|
|
11
|
+
date: 2017-11-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|