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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 28f0236107bedf4ea0ae1e2439a6f96c01ea9b2412742d7df5156b079197e118
4
- data.tar.gz: 138e4745058762762934c5b0791918bc85f96ee5e470ddc5a00ca1a4f9d722a7
3
+ metadata.gz: 3c5108b92f5194129b84b26f6bd1b3e14d8833cfe9bef4eab613eec2e1bfd91b
4
+ data.tar.gz: 739dda69738dc4e2e12ce2388dca4130a38b2cc7b806958fb0983192f5890014
5
5
  SHA512:
6
- metadata.gz: 61e66b77843554ca5f20c6aa36357c79226877c38f1f2af4efb33e4fdd623587bc8bb6d075889125f87214842d161f28612394231c517fb05d619a8e110dc924
7
- data.tar.gz: da659962dfe6daeccb89e2e68bdf94175451de0081c188116db8c547c058b7bddcb462edaf5579821e2fc70e0570142ec9142570a603ed70be9fc8374a550f8e
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 = body
42
+ res.body = html
25
43
  end
26
44
 
27
45
  # /EpisoPassResult?qwerty のような形式でパスワードを返す
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Episopass
4
- VERSION = "0.1.3"
3
+ module EpisoPass
4
+ VERSION = "0.1.8"
5
5
  end
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.3
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-08 00:00:00.000000000 Z
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/EpisoPassCLI.html
21
+ - data/sample.html
22
22
  - exe/episopass
23
23
  - lib/episopass.rb
24
24
  - lib/episopass/version.rb