episopass 0.1.3 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/data/{EpisoPassCLI.html → sample.html} +0 -0
- data/exe/episopass +22 -4
- data/lib/episopass/version.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c5108b92f5194129b84b26f6bd1b3e14d8833cfe9bef4eab613eec2e1bfd91b
|
4
|
+
data.tar.gz: 739dda69738dc4e2e12ce2388dca4130a38b2cc7b806958fb0983192f5890014
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a5bb33232b244ca76d36b5227c899506c50d1e955c2e45bf5cdd1efe2f7dc6cc13c07d3cf9820bc507b18757519159d1b361c963b0e3a8589361124047d64ec
|
7
|
+
data.tar.gz: 21eee76111ab6ec862ee82ef07d79a90cc2947afee87d7b7a7ec5502dda096c71c809af054784804cb1f6a0a0307ff959f12f7e43fed020128e645bca5b60cb0
|
File without changes
|
data/exe/episopass
CHANGED
@@ -1,8 +1,29 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# コマンドラインからEpisoPassを開いてパスワード文字列を得る
|
4
|
+
#
|
2
5
|
|
6
|
+
require 'net/http'
|
7
|
+
require 'uri'
|
3
8
|
require 'webrick'
|
4
9
|
require "episopass"
|
5
10
|
|
11
|
+
html = ''
|
12
|
+
arg = ARGV[0]
|
13
|
+
if arg
|
14
|
+
if arg =~ /^http/
|
15
|
+
html = Net::HTTP.get(URI.parse(arg))
|
16
|
+
elsif File.exist?(arg)
|
17
|
+
html = File.read(arg)
|
18
|
+
end
|
19
|
+
else
|
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)
|
25
|
+
end
|
26
|
+
|
6
27
|
opencmd = "open"
|
7
28
|
opencmd = "xdg-open" if File.exist?("/usr/bin/xdg-open")
|
8
29
|
|
@@ -15,13 +36,10 @@ server = WEBrick::HTTPServer.new( # サーバを立てる
|
|
15
36
|
|
16
37
|
# パスワード計算後に/EpisoPassResultに移動
|
17
38
|
server.mount_proc('/EpisoPassCall') do |req, res|
|
18
|
-
# body = File.read(File.expand_path('~/Passwords/EpisoPassCLI.html')) # パスワード計算するHTML
|
19
|
-
|
20
|
-
body = File.read("#{__dir__}/../data/EpisoPassCLI.html")
|
21
39
|
|
22
40
|
res.status = 200
|
23
41
|
res['Content-Type'] = 'text/html'
|
24
|
-
res.body =
|
42
|
+
res.body = html
|
25
43
|
end
|
26
44
|
|
27
45
|
# /EpisoPassResult?qwerty のような形式でパスワードを返す
|
data/lib/episopass/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: episopass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
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-09 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Run EpisoPass from CLI
|
14
14
|
email:
|
@@ -18,7 +18,7 @@ executables:
|
|
18
18
|
extensions: []
|
19
19
|
extra_rdoc_files: []
|
20
20
|
files:
|
21
|
-
- data/
|
21
|
+
- data/sample.html
|
22
22
|
- exe/episopass
|
23
23
|
- lib/episopass.rb
|
24
24
|
- lib/episopass/version.rb
|