episopass 0.1.5 → 0.1.6
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/exe/episopass +15 -2
- data/lib/episopass/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2badbf05230c2cddd7c09644ff0571eeebf3a51513aac860f67bf254a51f563
|
4
|
+
data.tar.gz: 7b01bef0ccbec7b1b272c094eafc6704aabb3ad123de244565366f14d7cb3aae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c1685c870d8e1da30de7f8e2fcdda0f4fe319c1df794b7e064fe9530c6e34f6a520d116d74ba55eadba7553edf0272b2adf15ae9f5e89d19a43767c207c5562
|
7
|
+
data.tar.gz: f873b47c9c716ded6463a264ed456016982f9eb119eb3b119cfbf6c276a9472a2964fcca5882b31391f96d284bd588c5b65946d3da638839fadfa58db287fc82
|
data/exe/episopass
CHANGED
@@ -1,8 +1,22 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
+
require 'net/http'
|
4
|
+
require 'uri'
|
3
5
|
require 'webrick'
|
4
6
|
require "episopass"
|
5
7
|
|
8
|
+
html = ''
|
9
|
+
arg = ARGV[0]
|
10
|
+
if arg
|
11
|
+
if arg =~ /^http/
|
12
|
+
html = Net::HTTP.get(URI.parse(arg))
|
13
|
+
elsif File.exist?(arg)
|
14
|
+
html = File.read(arg)
|
15
|
+
end
|
16
|
+
else
|
17
|
+
html = File.read("#{__dir__}/../data/EpisoPassCLI.html") # gemのファイル指定する方法は?
|
18
|
+
end
|
19
|
+
|
6
20
|
opencmd = "open"
|
7
21
|
opencmd = "xdg-open" if File.exist?("/usr/bin/xdg-open")
|
8
22
|
|
@@ -15,11 +29,10 @@ server = WEBrick::HTTPServer.new( # サーバを立てる
|
|
15
29
|
|
16
30
|
# パスワード計算後に/EpisoPassResultに移動
|
17
31
|
server.mount_proc('/EpisoPassCall') do |req, res|
|
18
|
-
body = File.read("#{__dir__}/../data/EpisoPassCLI.html") # gemのファイル指定する方法は?
|
19
32
|
|
20
33
|
res.status = 200
|
21
34
|
res['Content-Type'] = 'text/html'
|
22
|
-
res.body =
|
35
|
+
res.body = html
|
23
36
|
end
|
24
37
|
|
25
38
|
# /EpisoPassResult?qwerty のような形式でパスワードを返す
|
data/lib/episopass/version.rb
CHANGED