kdwatch 0.5.5 → 0.5.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/kds +14 -1
  3. data/lib/kdwatch/version.rb +1 -1
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6566f3e18e0382e8884beeca9cacc476052a969ca2fdb2b2444776cf5cbd841c
4
- data.tar.gz: ec6c75ac9f53726c514263bc288862d3406d601e71e7cdc0a263a3a83eac04a9
3
+ metadata.gz: d6f55d1aea6dc1fc73bc7b993228ecf1d752d95f0cb301b4a818ace03602d95e
4
+ data.tar.gz: e6e729ba9dda676793ef37e9adac49bba40e75ca72e903003ad64cd850725139
5
5
  SHA512:
6
- metadata.gz: eb70454412b047f97acb4906b471dcd87e8a56908ed976f7f2094e34422284f38032eea6d1b97a1653cb5d15965400935c9e271a503e52f2077ae2fec61a9e60
7
- data.tar.gz: ea35944c3d007676c43c009f06a4deb506fbfaebf9ab71521e6f048818fcccaf89967d31076d710f5b1fb09fd4866412f8e4ce9c8e2a1e516a7c48d16292fca9
6
+ metadata.gz: 1841395cafc0d9826d6630e9d8a5be14f9adc83775481577055636fc73400423b7d7f7d1c76f79eb83d4a9fa8177d5007a8029a0a6c37ce47b071e9d10d31090
7
+ data.tar.gz: 2b2c5949dce3507ccec14790ab894581c83a24ce18ec909f2ec37761a2d8001102ec69bae8206d3b23479d1312037cb6c37c66e2a425b0845772b38eb398f9ca
data/bin/kds CHANGED
@@ -3,12 +3,14 @@ require 'socket'
3
3
  require 'uri'
4
4
  require 'open-uri'
5
5
  require 'optparse'
6
+ require 'optparse/uri'
6
7
 
7
8
  KDWATCH_VERSION=Gem.loaded_specs["kdwatch"].version rescue "unknown-version"
8
9
 
9
10
  loport = 7991
10
11
  hiport = 7999
11
12
  match = nil
13
+ uri = URI.parse("http://127.0.0.1")
12
14
 
13
15
  op = OptionParser.new do |opts|
14
16
  opts.banner = <<BANNER
@@ -23,11 +25,20 @@ BANNER
23
25
  puts opts
24
26
  exit
25
27
  end
28
+ opts.on("-uURI", "--uri=URI", URI, "Use base URI (#{uri})") do |v|
29
+ uri = v
30
+ unless uri.host # questionable convenience feature
31
+ uri.host = uri.path #.sub(/\A([A-Za-z0-9:]+)\z/) {"[#{$1}]"}
32
+ uri.path = ""
33
+ end
34
+ uri.scheme ||= "http"
35
+ end
26
36
  opts.on("-fNUM", "--from=NUM", Integer, "Search from port number (#{loport})") do |v|
27
37
  loport = v
28
38
  end
29
39
  opts.on("-tNUM", "--to=NUM", Integer, "Search to port number (#{hiport})") do |v|
30
40
  hiport = v
41
+ hiport += 8000 if hiport < loport # questionable convenience feature
31
42
  end
32
43
  end
33
44
  op.parse!
@@ -37,7 +48,9 @@ if ARGV.size != 0
37
48
  end
38
49
 
39
50
  (loport..hiport).each do |p|
40
- url = "http://127.0.0.1:#{p}"
51
+ uri.port = p
52
+ url = uri.to_s
53
+ print "#{p}\r" if $stdout.tty?
41
54
  URI(url).open do |f|
42
55
  s = f.readpartial(40000)
43
56
  sc = s.scan(/id="title".*?<|Internal server error/)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kdwatch
4
- VERSION = "0.5.5"
4
+ VERSION = "0.5.7"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kdwatch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carsten Bormann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-08 00:00:00.000000000 Z
11
+ date: 2024-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -159,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
159
  - !ruby/object:Gem::Version
160
160
  version: '0'
161
161
  requirements: []
162
- rubygems_version: 3.4.6
162
+ rubygems_version: 3.4.10
163
163
  signing_key:
164
164
  specification_version: 4
165
165
  summary: 'kdwatch: open auto-reloaded HTML for kramdown-rfc in a browser.'