senju_kan_non 0.1.3 → 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 +4 -4
- data/.gitignore +1 -0
- data/lib/senju_kan_non/config.rb +2 -0
- data/lib/senju_kan_non/version.rb +1 -1
- data/lib/senju_kan_non.rb +16 -4
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 74ee0a4888ea950fb43f90c5abf1ce94ec867da6
|
|
4
|
+
data.tar.gz: 606aaf8d70e4e28bd7cf7334eb603f5be27cebfb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 67a1c35ef0c3fd53d54bc726fe6a733c76cf4cdd8c70e4eb0ef5c59d47a3cdcf0c587315371904ec9d0bfb41928ce64740a666fce0a5ab9c2d34e4c45f11f2d9
|
|
7
|
+
data.tar.gz: 23d486ddccc6e157c23b86f1569070bf0d69e38b07ac9c0771e6c4c071157f91fb708aa57a44e92f43e83993620bc2c88d4bc6161a170e179a004e4719326bb5
|
data/.gitignore
CHANGED
data/lib/senju_kan_non/config.rb
CHANGED
|
@@ -14,11 +14,13 @@ module SenjuKanNon
|
|
|
14
14
|
config_accessor :file_output
|
|
15
15
|
config_accessor :file_output_path
|
|
16
16
|
config_accessor :file_output_extension
|
|
17
|
+
config_accessor :use_file
|
|
17
18
|
end
|
|
18
19
|
|
|
19
20
|
configure do |config|
|
|
20
21
|
config.file_output = false
|
|
21
22
|
config.file_output_path = "test/senju_kan_non/"
|
|
22
23
|
config.file_output_extension = "txt"
|
|
24
|
+
config.use_file = false
|
|
23
25
|
end
|
|
24
26
|
end
|
data/lib/senju_kan_non.rb
CHANGED
|
@@ -3,10 +3,18 @@ require "senju_kan_non/config"
|
|
|
3
3
|
|
|
4
4
|
module SenjuKanNon
|
|
5
5
|
class << self
|
|
6
|
-
def redeem(issai_shujo)
|
|
6
|
+
def redeem(issai_shujo, time=nil)
|
|
7
7
|
return false unless issai_shujo.kind_of?(Hash)
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
if SenjuKanNon.config.use_file && File.exist?(SenjuKanNon.config.file_output_path + file_name(issai_shujo.keys, time))
|
|
10
|
+
File.open(SenjuKanNon.config.file_output_path + file_name(issai_shujo.keys, time)) do |file|
|
|
11
|
+
file.read.split("\n").each do |history|
|
|
12
|
+
p history
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
else
|
|
16
|
+
sekke(issai_shujo)
|
|
17
|
+
end
|
|
10
18
|
end
|
|
11
19
|
|
|
12
20
|
private
|
|
@@ -61,13 +69,17 @@ module SenjuKanNon
|
|
|
61
69
|
end
|
|
62
70
|
|
|
63
71
|
def genze_riyaku(keys, formatted_riyaku)
|
|
64
|
-
file_name = "#{Time.now.strftime("%Y%m%d%H%M%S")}_#{keys.join("_")}.#{SenjuKanNon.config.file_output_extension}"
|
|
65
72
|
FileUtils.mkdir_p(SenjuKanNon.config.file_output_path) unless FileTest.exist?(SenjuKanNon.config.file_output_path)
|
|
66
|
-
File.open(SenjuKanNon.config.file_output_path + file_name, "w") do |f|
|
|
73
|
+
File.open(SenjuKanNon.config.file_output_path + file_name(keys), "w") do |f|
|
|
67
74
|
formatted_riyaku.each do |fr|
|
|
68
75
|
f.puts(fr.to_s)
|
|
69
76
|
end
|
|
70
77
|
end
|
|
71
78
|
end
|
|
79
|
+
|
|
80
|
+
def file_name(keys, time=nil)
|
|
81
|
+
time = Time.now.strftime("%Y%m%d%H%M%S") unless time
|
|
82
|
+
"#{time}_#{keys.join("_")}.#{SenjuKanNon.config.file_output_extension}"
|
|
83
|
+
end
|
|
72
84
|
end
|
|
73
85
|
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.
|
|
4
|
+
version: 0.2.0
|
|
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
|
+
date: 2017-10-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
108
108
|
version: '0'
|
|
109
109
|
requirements: []
|
|
110
110
|
rubyforge_project:
|
|
111
|
-
rubygems_version: 2.6.
|
|
111
|
+
rubygems_version: 2.6.13
|
|
112
112
|
signing_key:
|
|
113
113
|
specification_version: 4
|
|
114
114
|
summary: generate array for pairwise testing.
|