episopass 0.1.8 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/episounzip +28 -0
- data/exe/episozip +60 -0
- data/lib/episopass/version.rb +1 -1
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3dba637310d7aa47252abb24738dee405a01acf5a919bd966b3b37c182da6bd4
|
4
|
+
data.tar.gz: d6acd418f315888401a2007009a415e6437d031a357f9cfebccf5e4f69e37a81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c857f952721210ede586918266842f2b9d5a61f52a549712a5b68354b77920f9e35f065deca21475a781b311ca52c5148e08690b3ec8be148ecd4189f88ba7fe
|
7
|
+
data.tar.gz: cd1cb278c1bd3261902b528c92483ce3c05ae740fe2572d3931fe52a517f0179ac81ec822f786d6a5364628e55a21851f6f3ac2f6c575180d47914e1de3459c0
|
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}/* ."
|
23
|
+
system "/bin/rm -r #{dir}"
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
data/exe/episozip
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# % episozip [-P episopassのHTML] out.episopass file1 file2
|
4
|
+
#
|
5
|
+
|
6
|
+
path = File.expand_path("~/.episopass.html")
|
7
|
+
if ARGV[0] == "-P"
|
8
|
+
path = ARGV[1]
|
9
|
+
ARGV.shift 2
|
10
|
+
end
|
11
|
+
|
12
|
+
html = ''
|
13
|
+
if path =~ /^http/
|
14
|
+
html = Net::HTTP.get(URI.parse(arg))
|
15
|
+
elsif File.exist?(path)
|
16
|
+
html = File.read(path)
|
17
|
+
end
|
18
|
+
|
19
|
+
if html == ''
|
20
|
+
STDERR.puts "EpisoPass問題(#{path})がみつかりません"
|
21
|
+
exit
|
22
|
+
end
|
23
|
+
|
24
|
+
dir = "/tmp/EpisoPassDir#{$$}"
|
25
|
+
if File.exist?(dir)
|
26
|
+
STDERR.puts "もう一度試してください"
|
27
|
+
exit
|
28
|
+
end
|
29
|
+
|
30
|
+
system "mkdir #{dir}"
|
31
|
+
|
32
|
+
File.open("#{dir}/episopass.html","w"){ |f|
|
33
|
+
f.print html
|
34
|
+
}
|
35
|
+
|
36
|
+
zipfile = ARGV.shift
|
37
|
+
if !zipfile
|
38
|
+
STDERR.puts "出力ファイル名を指定してください"
|
39
|
+
system "/bin/rm -r #{dir}"
|
40
|
+
exit
|
41
|
+
end
|
42
|
+
if zipfile !~ /\.episopass$/
|
43
|
+
STDERR.puts "出力ファイルの拡張子は.episopassにしてください"
|
44
|
+
system "/bin/rm -r #{dir}"
|
45
|
+
exit
|
46
|
+
end
|
47
|
+
if File.exist?(zipfile)
|
48
|
+
STDERR.puts "#{zipfile}が既に存在します"
|
49
|
+
system "/bin/rm -r #{dir}"
|
50
|
+
exit
|
51
|
+
end
|
52
|
+
|
53
|
+
system "zip -e -P `episopass #{dir}/episopass.html` #{dir}/episopass.zip #{ARGV.join(' ')}"
|
54
|
+
system "pushd #{dir} > /dev/null; zip #{zipfile} episopass.zip episopass.html; popd > /dev/null"
|
55
|
+
system "/bin/mv #{dir}/#{zipfile} ."
|
56
|
+
system "/bin/rm -r #{dir}"
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
|
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.1
|
4
|
+
version: 0.2.1
|
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
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
|