episopass 0.1.6 → 0.2.3
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/data/{EpisoPassCLI.html → sample.html} +0 -0
- data/exe/episopass +8 -1
- data/exe/episounzip +28 -0
- data/exe/episozip +63 -0
- data/lib/episopass/version.rb +1 -1
- metadata +8 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7067a39c4eba3696ad23261b3c2665255d7bc3ca6e7587974bea08c727799345
|
4
|
+
data.tar.gz: 10b52aab734c784daa224afa1e348455587c84834f42fe1fe66734d3a0b02d7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16d7c43d1d606645c7ad609822aaf9ff0c11955b49330ff95c54692b6813113f4896a09e1c199d1191203f5b895cc41b8fdd40bd007bd900b2a9bd094a8d4724
|
7
|
+
data.tar.gz: 490662d500144550dc85ff3bba4cd70db48d6d4a92707d1f023522d1880b2ffed45c0d9042ef3028609979fab8b58c1aa9d2039fd484d7d72b1d65554c77b47a
|
File without changes
|
data/exe/episopass
CHANGED
@@ -1,4 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# コマンドラインからEpisoPassを開いてパスワード文字列を得る
|
4
|
+
#
|
2
5
|
|
3
6
|
require 'net/http'
|
4
7
|
require 'uri'
|
@@ -14,7 +17,11 @@ if arg
|
|
14
17
|
html = File.read(arg)
|
15
18
|
end
|
16
19
|
else
|
17
|
-
|
20
|
+
path = "#{__dir__}/../data/sample.html" # gemのファイル指定する方法は?
|
21
|
+
localpath = File.expand_path("~/.episopass.html")
|
22
|
+
path = localpath if File.exist?(localpath)
|
23
|
+
|
24
|
+
html = File.read(path)
|
18
25
|
end
|
19
26
|
|
20
27
|
opencmd = "open"
|
data/exe/episounzip
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# % epunzip out.episopass
|
4
|
+
#
|
5
|
+
|
6
|
+
epfile = ARGV[0]
|
7
|
+
if !epfile || !File.exist?(epfile)
|
8
|
+
STDERR.puts "% epunzip file.episopass"
|
9
|
+
exit
|
10
|
+
end
|
11
|
+
|
12
|
+
dir = "/tmp/EpisoPassDir#{$$}"
|
13
|
+
if File.exist?(dir)
|
14
|
+
STDERR.puts "もう一度実行してください"
|
15
|
+
exit
|
16
|
+
end
|
17
|
+
Dir.mkdir(dir)
|
18
|
+
|
19
|
+
path = File.expand_path(epfile)
|
20
|
+
system "pushd #{dir} > /dev/null; unzip #{path} ; unzip -P `episopass episopass.html` episopass.zip; rm episopass.zip episopass.html ; popd > /dev/null"
|
21
|
+
|
22
|
+
system "/bin/mv #{dir}/{*,.[a-z]*} ."
|
23
|
+
system "/bin/rm -r #{dir}"
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
data/exe/episozip
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# % episozip [-P episopassのHTML] out.episopass file1 file2
|
4
|
+
#
|
5
|
+
|
6
|
+
path = "#{__dir__}/../data/sample.html" # gemのファイル指定する方法は?
|
7
|
+
localpath = File.expand_path("~/.episopass.html")
|
8
|
+
path = localpath if File.exist?(localpath)
|
9
|
+
|
10
|
+
if ARGV[0] == "-P"
|
11
|
+
path = ARGV[1]
|
12
|
+
ARGV.shift 2
|
13
|
+
end
|
14
|
+
|
15
|
+
html = ''
|
16
|
+
if path =~ /^http/
|
17
|
+
html = Net::HTTP.get(URI.parse(arg))
|
18
|
+
elsif File.exist?(path)
|
19
|
+
html = File.read(path)
|
20
|
+
end
|
21
|
+
|
22
|
+
if html == ''
|
23
|
+
STDERR.puts "EpisoPass問題(#{path})がみつかりません"
|
24
|
+
exit
|
25
|
+
end
|
26
|
+
|
27
|
+
dir = "/tmp/EpisoPassDir#{$$}"
|
28
|
+
if File.exist?(dir)
|
29
|
+
STDERR.puts "もう一度試してください"
|
30
|
+
exit
|
31
|
+
end
|
32
|
+
|
33
|
+
system "mkdir #{dir}"
|
34
|
+
|
35
|
+
File.open("#{dir}/episopass.html","w"){ |f|
|
36
|
+
f.print html
|
37
|
+
}
|
38
|
+
|
39
|
+
zipfile = ARGV.shift
|
40
|
+
if !zipfile
|
41
|
+
STDERR.puts "出力ファイル名を指定してください"
|
42
|
+
system "/bin/rm -r #{dir}"
|
43
|
+
exit
|
44
|
+
end
|
45
|
+
if zipfile !~ /\.episopass$/
|
46
|
+
STDERR.puts "出力ファイルの拡張子は.episopassにしてください"
|
47
|
+
system "/bin/rm -r #{dir}"
|
48
|
+
exit
|
49
|
+
end
|
50
|
+
if File.exist?(zipfile)
|
51
|
+
STDERR.puts "#{zipfile}が既に存在します"
|
52
|
+
system "/bin/rm -r #{dir}"
|
53
|
+
exit
|
54
|
+
end
|
55
|
+
|
56
|
+
system "zip -e -P `episopass #{dir}/episopass.html` #{dir}/episopass.zip #{ARGV.join(' ')}"
|
57
|
+
system "pushd #{dir} > /dev/null; zip #{zipfile} episopass.zip episopass.html; popd > /dev/null"
|
58
|
+
system "/bin/mv #{dir}/#{zipfile} ."
|
59
|
+
system "/bin/rm -r #{dir}"
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
data/lib/episopass/version.rb
CHANGED
metadata
CHANGED
@@ -1,25 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: episopass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toshiyuki Masui
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Run EpisoPass from CLI
|
14
14
|
email:
|
15
15
|
- masui@pitecan.com
|
16
16
|
executables:
|
17
17
|
- episopass
|
18
|
+
- episounzip
|
19
|
+
- episozip
|
18
20
|
extensions: []
|
19
21
|
extra_rdoc_files: []
|
20
22
|
files:
|
21
|
-
- data/
|
23
|
+
- data/sample.html
|
22
24
|
- exe/episopass
|
25
|
+
- exe/episounzip
|
26
|
+
- exe/episozip
|
23
27
|
- lib/episopass.rb
|
24
28
|
- lib/episopass/version.rb
|
25
29
|
homepage: http://EpisoPass.com
|
@@ -43,8 +47,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
43
47
|
- !ruby/object:Gem::Version
|
44
48
|
version: '0'
|
45
49
|
requirements: []
|
46
|
-
|
47
|
-
rubygems_version: 2.7.6.2
|
50
|
+
rubygems_version: 3.0.3
|
48
51
|
signing_key:
|
49
52
|
specification_version: 4
|
50
53
|
summary: Run EpisoPass from CLI
|