sheltered-girl 4.0.4.5 → 4.0.5
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/.env +3 -3
- data/Gemfile +2 -2
- data/README.md +11 -11
- data/bin/aqua +247 -247
- data/bin/bmi +56 -56
- data/bin/bmi-license +118 -118
- data/bin/heat +14 -14
- data/bin/katakana +35 -35
- data/bin/koyomi +55 -55
- data/bin/romaji +34 -34
- data/bin/sheltered-girl +317 -317
- data/bin/speak +42 -57
- data/bin/tenji +42 -42
- data/bin/tenji_log +42 -42
- data/bin/tweet +79 -79
- data/lib/all.rb +45 -45
- data/lib/all_log.rb +50 -50
- data/lib/and.rb +48 -48
- data/lib/autocal.rb +21 -21
- data/lib/bmi.rb +28 -28
- data/lib/bmi_version.rb +21 -21
- data/lib/calendar.rb +17 -17
- data/lib/count.rb +43 -43
- data/lib/decript.rb +20 -20
- data/lib/druby_erb.rb +45 -45
- data/lib/druby_reci.rb +23 -23
- data/lib/feed.rb +13 -13
- data/lib/frame.rb +212 -212
- data/lib/frame_version.rb +21 -21
- data/lib/gc.rb +17 -17
- data/lib/gem_version.rb +9 -9
- data/lib/himekuri.rb +175 -175
- data/lib/himekuri_version.rb +21 -21
- data/lib/hyaku.rb +55 -55
- data/lib/install.rb +230 -230
- data/lib/katakana.rb +666 -666
- data/lib/kome.rb +41 -41
- data/lib/mail.rb +47 -47
- data/lib/match.rb +50 -50
- data/lib/mini.rb +47 -47
- data/lib/minitest/full_runner.rb +105 -105
- data/lib/minitest/runner.rb +74 -74
- data/lib/not.rb +48 -48
- data/lib/or.rb +49 -49
- data/lib/require_sec_seiki.rb +2 -2
- data/lib/rice.rb +37 -37
- data/lib/romaji.rb +666 -666
- data/lib/saikoro.rb +17 -17
- data/lib/seiki.rb +12 -12
- data/lib/suihan.rb +40 -40
- data/lib/summa.rb +14 -14
- data/lib/tanraku.rb +156 -156
- data/lib/tenji.rb +4715 -4715
- data/lib/tenji_log.rb +4715 -4715
- data/lib/timestamp.py +61 -61
- data/lib/title.rb +16 -16
- data/lib/tubuyaki.rb +71 -71
- data/lib/tubuyaki_memo.rb +87 -87
- data/lib/tweet_cmd.rb +27 -27
- data/lib/version.rb +21 -19
- data/lib/zella.rb +46 -46
- data/req/aqua.rb +8 -8
- data/req/bmi.rb +6 -6
- data/req/frame.rb +7 -7
- data/req/full_run.rb +20 -20
- data/req/full_runner.rb +8 -8
- data/req/himekuri.rb +7 -7
- data/req/katakana.rb +7 -7
- data/req/koyomi.rb +6 -6
- data/req/mini_run.rb +20 -20
- data/req/romaji.rb +7 -7
- data/req/rubygems.rb +12 -12
- data/req/runner.rb +8 -8
- data/req/sheltered-girl.rb +7 -7
- data/req/speak.rb +19 -10
- data/req/zella.rb +4 -4
- data/runner/full.rb +57 -57
- data/runner/katakana.rb +110 -110
- data/runner/mini.rb +57 -57
- data/runner/romaji.rb +110 -110
- data/shell/romaji_runner_1.rb +669 -669
- data/shell/romaji_runner_10.rb +669 -669
- data/shell/romaji_runner_2.rb +669 -669
- data/shell/romaji_runner_3.rb +669 -669
- data/shell/romaji_runner_4.rb +669 -669
- data/shell/romaji_runner_5.rb +669 -669
- data/shell/romaji_runner_6.rb +669 -669
- data/shell/romaji_runner_7.rb +669 -669
- data/shell/romaji_runner_8.rb +669 -669
- data/shell/romaji_runner_9.rb +669 -669
- data/shell_ka/katakana_runner_1.rb +669 -669
- data/shell_ka/katakana_runner_10.rb +669 -669
- data/shell_ka/katakana_runner_2.rb +669 -669
- data/shell_ka/katakana_runner_3.rb +669 -669
- data/shell_ka/katakana_runner_4.rb +669 -669
- data/shell_ka/katakana_runner_5.rb +669 -669
- data/shell_ka/katakana_runner_6.rb +669 -669
- data/shell_ka/katakana_runner_7.rb +669 -669
- data/shell_ka/katakana_runner_8.rb +669 -669
- data/shell_ka/katakana_runner_9.rb +669 -669
- data/sheltered-girl.gemspec +46 -46
- data/wiki/README.md +69 -69
- metadata +1 -1
data/lib/all.rb
CHANGED
@@ -1,45 +1,45 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'require_sec_seiki'
|
4
|
-
require 'bmi'
|
5
|
-
|
6
|
-
# All search loads.
|
7
|
-
module All
|
8
|
-
module_function
|
9
|
-
|
10
|
-
def search
|
11
|
-
encoding_style
|
12
|
-
|
13
|
-
one = ARGV[1]
|
14
|
-
|
15
|
-
File.open(one) do |f|
|
16
|
-
while (str2 = f.gets)
|
17
|
-
str = str2.chomp!
|
18
|
-
twice = ARGV[2]
|
19
|
-
three_act = /#{twice}/o
|
20
|
-
ext = 'else文には到達しないはずです!'
|
21
|
-
|
22
|
-
begin
|
23
|
-
str =~ three_act ? printf("%2d : %s\n", f.lineno, str) : ext
|
24
|
-
rescue Timeout::Error
|
25
|
-
exit!
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
if f.eof?
|
30
|
-
f.close
|
31
|
-
elsif !f.eof
|
32
|
-
begin
|
33
|
-
raise All
|
34
|
-
rescue StandardError => ee
|
35
|
-
puts ee.backtrace
|
36
|
-
puts ee.backtrace_locations
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
GC.compact
|
44
|
-
|
45
|
-
__END__
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'require_sec_seiki'
|
4
|
+
require 'bmi'
|
5
|
+
|
6
|
+
# All search loads.
|
7
|
+
module All
|
8
|
+
module_function
|
9
|
+
|
10
|
+
def search
|
11
|
+
encoding_style
|
12
|
+
|
13
|
+
one = ARGV[1]
|
14
|
+
|
15
|
+
File.open(one) do |f|
|
16
|
+
while (str2 = f.gets)
|
17
|
+
str = str2.chomp!
|
18
|
+
twice = ARGV[2]
|
19
|
+
three_act = /#{twice}/o
|
20
|
+
ext = 'else文には到達しないはずです!'
|
21
|
+
|
22
|
+
begin
|
23
|
+
str =~ three_act ? printf("%2d : %s\n", f.lineno, str) : ext
|
24
|
+
rescue Timeout::Error
|
25
|
+
exit!
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
if f.eof?
|
30
|
+
f.close
|
31
|
+
elsif !f.eof
|
32
|
+
begin
|
33
|
+
raise All
|
34
|
+
rescue StandardError => ee
|
35
|
+
puts ee.backtrace
|
36
|
+
puts ee.backtrace_locations
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
GC.compact
|
44
|
+
|
45
|
+
__END__
|
data/lib/all_log.rb
CHANGED
@@ -1,51 +1,51 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'require_sec_seiki'
|
4
|
-
require 'bmi'
|
5
|
-
|
6
|
-
Dir.mkdir('log', perm = 0o777) unless FileTest.exist?('log')
|
7
|
-
|
8
|
-
# match search loads.
|
9
|
-
module Mat
|
10
|
-
module_function
|
11
|
-
|
12
|
-
def search
|
13
|
-
encoding_style
|
14
|
-
|
15
|
-
one = ARGV[1]
|
16
|
-
File.open(one) do |f|
|
17
|
-
while (str2 = f.gets)
|
18
|
-
str = str2.chomp!
|
19
|
-
twice = ARGV[2]
|
20
|
-
three_act = /#{twice}/o
|
21
|
-
|
22
|
-
begin
|
23
|
-
File.open('log/output.txt', 'a:utf-8', perm = 0o777) do |fi|
|
24
|
-
if str.match(three_act) || {}[:match]
|
25
|
-
fi.puts(str)
|
26
|
-
printf('%2d : %s', f.lineno, str)
|
27
|
-
puts ''
|
28
|
-
end
|
29
|
-
end
|
30
|
-
rescue Timeout::Error
|
31
|
-
exit!
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
if f.eof?
|
36
|
-
f.close
|
37
|
-
elsif !f.eof
|
38
|
-
begin
|
39
|
-
raise All
|
40
|
-
rescue StandardError => e
|
41
|
-
puts e.backtrace
|
42
|
-
puts e.backtrace_locations
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
GC.compact
|
50
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'require_sec_seiki'
|
4
|
+
require 'bmi'
|
5
|
+
|
6
|
+
Dir.mkdir('log', perm = 0o777) unless FileTest.exist?('log')
|
7
|
+
|
8
|
+
# match search loads.
|
9
|
+
module Mat
|
10
|
+
module_function
|
11
|
+
|
12
|
+
def search
|
13
|
+
encoding_style
|
14
|
+
|
15
|
+
one = ARGV[1]
|
16
|
+
File.open(one) do |f|
|
17
|
+
while (str2 = f.gets)
|
18
|
+
str = str2.chomp!
|
19
|
+
twice = ARGV[2]
|
20
|
+
three_act = /#{twice}/o
|
21
|
+
|
22
|
+
begin
|
23
|
+
File.open('log/output.txt', 'a:utf-8', perm = 0o777) do |fi|
|
24
|
+
if str.match(three_act) || {}[:match]
|
25
|
+
fi.puts(str)
|
26
|
+
printf('%2d : %s', f.lineno, str)
|
27
|
+
puts ''
|
28
|
+
end
|
29
|
+
end
|
30
|
+
rescue Timeout::Error
|
31
|
+
exit!
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
if f.eof?
|
36
|
+
f.close
|
37
|
+
elsif !f.eof
|
38
|
+
begin
|
39
|
+
raise All
|
40
|
+
rescue StandardError => e
|
41
|
+
puts e.backtrace
|
42
|
+
puts e.backtrace_locations
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
GC.compact
|
50
|
+
|
51
51
|
__END__
|
data/lib/and.rb
CHANGED
@@ -1,48 +1,48 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'require_sec_seiki'
|
4
|
-
require 'bmi'
|
5
|
-
|
6
|
-
# And Search loads.
|
7
|
-
module And
|
8
|
-
module_function
|
9
|
-
|
10
|
-
def search
|
11
|
-
encoding_style
|
12
|
-
|
13
|
-
one = ARGV[1]
|
14
|
-
|
15
|
-
File.open(one) do |f|
|
16
|
-
while (str2 = f.gets)
|
17
|
-
str = str2.chomp!
|
18
|
-
twice = ARGV[2]
|
19
|
-
three_act2 = /^(?=.*#{twice})/o
|
20
|
-
|
21
|
-
begin
|
22
|
-
if str =~ three_act2
|
23
|
-
printf('%2d : %s', f.lineno, str)
|
24
|
-
puts ''
|
25
|
-
end
|
26
|
-
rescue Timeout::Error
|
27
|
-
exit!
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
if f.eof?
|
32
|
-
f.close
|
33
|
-
elsif !f.eof
|
34
|
-
begin
|
35
|
-
raise And
|
36
|
-
rescue StandardError => ee
|
37
|
-
puts ee.backtrace
|
38
|
-
puts ee.backtrace_locations
|
39
|
-
exit!
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
GC.compact
|
47
|
-
|
48
|
-
__END__
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'require_sec_seiki'
|
4
|
+
require 'bmi'
|
5
|
+
|
6
|
+
# And Search loads.
|
7
|
+
module And
|
8
|
+
module_function
|
9
|
+
|
10
|
+
def search
|
11
|
+
encoding_style
|
12
|
+
|
13
|
+
one = ARGV[1]
|
14
|
+
|
15
|
+
File.open(one) do |f|
|
16
|
+
while (str2 = f.gets)
|
17
|
+
str = str2.chomp!
|
18
|
+
twice = ARGV[2]
|
19
|
+
three_act2 = /^(?=.*#{twice})/o
|
20
|
+
|
21
|
+
begin
|
22
|
+
if str =~ three_act2
|
23
|
+
printf('%2d : %s', f.lineno, str)
|
24
|
+
puts ''
|
25
|
+
end
|
26
|
+
rescue Timeout::Error
|
27
|
+
exit!
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
if f.eof?
|
32
|
+
f.close
|
33
|
+
elsif !f.eof
|
34
|
+
begin
|
35
|
+
raise And
|
36
|
+
rescue StandardError => ee
|
37
|
+
puts ee.backtrace
|
38
|
+
puts ee.backtrace_locations
|
39
|
+
exit!
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
GC.compact
|
47
|
+
|
48
|
+
__END__
|
data/lib/autocal.rb
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
require 'date'
|
2
|
-
require 'pycall/import'
|
3
|
-
include PyCall::Import
|
4
|
-
require 'bmi'
|
5
|
-
|
6
|
-
module Auto
|
7
|
-
module_function
|
8
|
-
|
9
|
-
def view
|
10
|
-
encoding_style
|
11
|
-
|
12
|
-
yr = ARGV[1]
|
13
|
-
mh = ARGV[2]
|
14
|
-
pyimport :calendar
|
15
|
-
puts (calendar.month(yr.to_i,mh.to_i))
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
GC.compact
|
20
|
-
|
21
|
-
__END__
|
1
|
+
require 'date'
|
2
|
+
require 'pycall/import'
|
3
|
+
include PyCall::Import
|
4
|
+
require 'bmi'
|
5
|
+
|
6
|
+
module Auto
|
7
|
+
module_function
|
8
|
+
|
9
|
+
def view
|
10
|
+
encoding_style
|
11
|
+
|
12
|
+
yr = ARGV[1]
|
13
|
+
mh = ARGV[2]
|
14
|
+
pyimport :calendar
|
15
|
+
puts (calendar.month(yr.to_i,mh.to_i))
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
GC.compact
|
20
|
+
|
21
|
+
__END__
|
data/lib/bmi.rb
CHANGED
@@ -1,28 +1,28 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
lib = File.expand_path('lib', __dir__)
|
4
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
-
|
6
|
-
require "#{File.dirname(__FILE__)}/../req/bmi"
|
7
|
-
|
8
|
-
module BMI
|
9
|
-
module_function
|
10
|
-
|
11
|
-
def encoding_style
|
12
|
-
Encoding.default_internal = Encoding::UTF_8
|
13
|
-
Encoding.default_external = Encoding::UTF_8
|
14
|
-
end
|
15
|
-
|
16
|
-
def encoding_style_sjis
|
17
|
-
Encoding.default_internal = Encoding::SJIS
|
18
|
-
Encoding.default_external = Encoding::SJIS
|
19
|
-
end
|
20
|
-
|
21
|
-
def calc(kg, m)
|
22
|
-
kg.to_f / (m.to_f ** 2)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
include BMI
|
27
|
-
|
28
|
-
__END__
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
|
6
|
+
require "#{File.dirname(__FILE__)}/../req/bmi"
|
7
|
+
|
8
|
+
module BMI
|
9
|
+
module_function
|
10
|
+
|
11
|
+
def encoding_style
|
12
|
+
Encoding.default_internal = Encoding::UTF_8
|
13
|
+
Encoding.default_external = Encoding::UTF_8
|
14
|
+
end
|
15
|
+
|
16
|
+
def encoding_style_sjis
|
17
|
+
Encoding.default_internal = Encoding::SJIS
|
18
|
+
Encoding.default_external = Encoding::SJIS
|
19
|
+
end
|
20
|
+
|
21
|
+
def calc(kg, m)
|
22
|
+
kg.to_f / (m.to_f ** 2)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
include BMI
|
27
|
+
|
28
|
+
__END__
|
data/lib/bmi_version.rb
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'date'
|
4
|
-
|
5
|
-
begin
|
6
|
-
|
7
|
-
# bmi_version = x.x.x-xxxx.xx.xx
|
8
|
-
module BMI_CLI
|
9
|
-
bmi_version = '1.0.3.2'
|
10
|
-
t = Date.today
|
11
|
-
build_day = t.strftime('%Y.%m.%d')
|
12
|
-
BMI_VERSION = "#{bmi_version}-#{build_day}".freeze
|
13
|
-
end
|
14
|
-
|
15
|
-
rescue StandardError => e
|
16
|
-
puts e.backtrace
|
17
|
-
ensure
|
18
|
-
GC.compact
|
19
|
-
end
|
20
|
-
|
21
|
-
__END__
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
begin
|
6
|
+
|
7
|
+
# bmi_version = x.x.x-xxxx.xx.xx
|
8
|
+
module BMI_CLI
|
9
|
+
bmi_version = '1.0.3.2'
|
10
|
+
t = Date.today
|
11
|
+
build_day = t.strftime('%Y.%m.%d')
|
12
|
+
BMI_VERSION = "#{bmi_version}-#{build_day}".freeze
|
13
|
+
end
|
14
|
+
|
15
|
+
rescue StandardError => e
|
16
|
+
puts e.backtrace
|
17
|
+
ensure
|
18
|
+
GC.compact
|
19
|
+
end
|
20
|
+
|
21
|
+
__END__
|
data/lib/calendar.rb
CHANGED
@@ -1,17 +1,17 @@
|
|
1
|
-
require 'date'
|
2
|
-
require 'pycall/import'
|
3
|
-
include PyCall::Import
|
4
|
-
|
5
|
-
module Calendar
|
6
|
-
module_function
|
7
|
-
|
8
|
-
def view
|
9
|
-
d = Date.today
|
10
|
-
pyimport :calendar
|
11
|
-
puts (calendar.month(d.year,d.month))
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
GC.compact
|
16
|
-
|
17
|
-
__END__
|
1
|
+
require 'date'
|
2
|
+
require 'pycall/import'
|
3
|
+
include PyCall::Import
|
4
|
+
|
5
|
+
module Calendar
|
6
|
+
module_function
|
7
|
+
|
8
|
+
def view
|
9
|
+
d = Date.today
|
10
|
+
pyimport :calendar
|
11
|
+
puts (calendar.month(d.year,d.month))
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
GC.compact
|
16
|
+
|
17
|
+
__END__
|
data/lib/count.rb
CHANGED
@@ -1,43 +1,43 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'require_sec_seiki'
|
4
|
-
require 'bmi'
|
5
|
-
|
6
|
-
# Count method.
|
7
|
-
module Count
|
8
|
-
module_function
|
9
|
-
|
10
|
-
def search
|
11
|
-
encoding_style
|
12
|
-
|
13
|
-
one = ARGV[1]
|
14
|
-
|
15
|
-
File.open(one) do |f|
|
16
|
-
while (str2 = f.gets)
|
17
|
-
str = str2.chomp!
|
18
|
-
twice = ARGV[2]
|
19
|
-
three_act2 = /^(?=.*#{twice})/o
|
20
|
-
|
21
|
-
begin
|
22
|
-
puts str.count(three_act2.to_s)
|
23
|
-
rescue Timeout::Error
|
24
|
-
exit!
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
if f.eof?
|
29
|
-
f.close
|
30
|
-
elsif !f.eof
|
31
|
-
begin
|
32
|
-
raise And
|
33
|
-
rescue StandardError => ee
|
34
|
-
puts ee.backtrace
|
35
|
-
puts ee.backtrace_locations
|
36
|
-
exit!
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
GC.compact
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'require_sec_seiki'
|
4
|
+
require 'bmi'
|
5
|
+
|
6
|
+
# Count method.
|
7
|
+
module Count
|
8
|
+
module_function
|
9
|
+
|
10
|
+
def search
|
11
|
+
encoding_style
|
12
|
+
|
13
|
+
one = ARGV[1]
|
14
|
+
|
15
|
+
File.open(one) do |f|
|
16
|
+
while (str2 = f.gets)
|
17
|
+
str = str2.chomp!
|
18
|
+
twice = ARGV[2]
|
19
|
+
three_act2 = /^(?=.*#{twice})/o
|
20
|
+
|
21
|
+
begin
|
22
|
+
puts str.count(three_act2.to_s)
|
23
|
+
rescue Timeout::Error
|
24
|
+
exit!
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
if f.eof?
|
29
|
+
f.close
|
30
|
+
elsif !f.eof
|
31
|
+
begin
|
32
|
+
raise And
|
33
|
+
rescue StandardError => ee
|
34
|
+
puts ee.backtrace
|
35
|
+
puts ee.backtrace_locations
|
36
|
+
exit!
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
GC.compact
|
data/lib/decript.rb
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'openssl'
|
4
|
-
|
5
|
-
# 暗号化クラス
|
6
|
-
class String_encrypt
|
7
|
-
|
8
|
-
def use_case_hash
|
9
|
-
# data, key 暗号化対象文字列
|
10
|
-
data = ARGV[0]
|
11
|
-
key = ARGV[1]
|
12
|
-
digest = OpenSSL::HMAC.new(key, 'sha256')
|
13
|
-
digest.update(data)
|
14
|
-
puts digest.hexdigest #暗号化
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
GC.compact
|
19
|
-
|
20
|
-
__END__
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'openssl'
|
4
|
+
|
5
|
+
# 暗号化クラス
|
6
|
+
class String_encrypt
|
7
|
+
|
8
|
+
def use_case_hash
|
9
|
+
# data, key 暗号化対象文字列
|
10
|
+
data = ARGV[0]
|
11
|
+
key = ARGV[1]
|
12
|
+
digest = OpenSSL::HMAC.new(key, 'sha256')
|
13
|
+
digest.update(data)
|
14
|
+
puts digest.hexdigest #暗号化
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
GC.compact
|
19
|
+
|
20
|
+
__END__
|
data/lib/druby_erb.rb
CHANGED
@@ -1,45 +1,45 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'date'
|
4
|
-
require 'drb/drb'
|
5
|
-
require 'erb'
|
6
|
-
require 'bmi'
|
7
|
-
|
8
|
-
# dRuby class method.
|
9
|
-
class Remindar
|
10
|
-
encoding_style
|
11
|
-
|
12
|
-
def initialize(remindar)
|
13
|
-
@remindar = remindar
|
14
|
-
@erb = ERB.new(erb_src)
|
15
|
-
end
|
16
|
-
|
17
|
-
def erb_src
|
18
|
-
<<~SRC
|
19
|
-
<html>
|
20
|
-
<head>時刻表示</head>
|
21
|
-
<body>
|
22
|
-
<p><%= Time.new.strftime('%Y年%m月%d日 %H時%M分%S秒') %><p>
|
23
|
-
</body>
|
24
|
-
</html>
|
25
|
-
SRC
|
26
|
-
end
|
27
|
-
|
28
|
-
def to_html
|
29
|
-
@erb.result(binding)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
# Druby Class
|
34
|
-
class Druby
|
35
|
-
def main
|
36
|
-
DRb.start_service
|
37
|
-
there = DRbObject.new_with_uri('druby://localhost:8888')
|
38
|
-
writer = Remindar.new(there)
|
39
|
-
there.puts(writer.to_html)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
GC.compact
|
44
|
-
|
45
|
-
__END__
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
require 'drb/drb'
|
5
|
+
require 'erb'
|
6
|
+
require 'bmi'
|
7
|
+
|
8
|
+
# dRuby class method.
|
9
|
+
class Remindar
|
10
|
+
encoding_style
|
11
|
+
|
12
|
+
def initialize(remindar)
|
13
|
+
@remindar = remindar
|
14
|
+
@erb = ERB.new(erb_src)
|
15
|
+
end
|
16
|
+
|
17
|
+
def erb_src
|
18
|
+
<<~SRC
|
19
|
+
<html>
|
20
|
+
<head>時刻表示</head>
|
21
|
+
<body>
|
22
|
+
<p><%= Time.new.strftime('%Y年%m月%d日 %H時%M分%S秒') %><p>
|
23
|
+
</body>
|
24
|
+
</html>
|
25
|
+
SRC
|
26
|
+
end
|
27
|
+
|
28
|
+
def to_html
|
29
|
+
@erb.result(binding)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# Druby Class
|
34
|
+
class Druby
|
35
|
+
def main
|
36
|
+
DRb.start_service
|
37
|
+
there = DRbObject.new_with_uri('druby://localhost:8888')
|
38
|
+
writer = Remindar.new(there)
|
39
|
+
there.puts(writer.to_html)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
GC.compact
|
44
|
+
|
45
|
+
__END__
|