ssh_bookmarker 0.0.1 → 0.0.2

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.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MjQ4NDBkODRmNGE1Y2Y2NTdiZDc1NDIzZTM2NjUzYjQwNTY3NzQzMA==
5
+ data.tar.gz: !binary |-
6
+ MTU5Y2ZiNGU4ZDhlOTY3NzczZGVjY2JkMWE1OWNiN2U1NjY2ZmIzZQ==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ ODBiY2FkNmU5N2M3YmZlYjYxZDRmYTcyMDJmZjc1MGIwNzRiZGNiMDQxZDhl
10
+ NWE3ZjU1ZmRkZGQ2NjAwNjI1NTllNWZiMzJjNzRhYTExNjIzMTQ3MDdlM2Qy
11
+ NjQ1Nzc5MDE2YWFlZmU4ZDE4NmY5MTU5NzRkOWE2NjM2MDFjN2U=
12
+ data.tar.gz: !binary |-
13
+ MjZiNmU3OTIzZWY2M2Q2NTRiYWVmYmUwMGFkZDE0MmQ2ZTgxZmEzNDcxMjE1
14
+ NzY4N2NjZDliYjNjZGZkZWQ4NTY3MmFmYmY5Zjk3OGMzODExNTk2NTFmNWRh
15
+ OGJkODM5Y2EzNmQzNzg0Zjg5ZDNhNWRlZjA3OWJmNWUzNWU5M2M=
@@ -34,13 +34,13 @@ module SSHBookmarker
34
34
  logger.info("Skipping missing SSH config file #{path}")
35
35
  next
36
36
  end
37
- parse_ssh_config(path) do |hostname, url_scheme|
37
+ parse_ssh_config(path) do |hostnames, url_scheme|
38
38
  if @protocol_override
39
- (@protocol_override.call(hostname, url_scheme) || [url_scheme]).each do |scheme|
40
- make_webloc(hostname, nil, scheme)
39
+ (@protocol_override.call(hostnames, url_scheme) || [url_scheme]).each do |scheme|
40
+ hostnames.each { |hostname| make_webloc(hostname, nil, scheme) }
41
41
  end
42
42
  else
43
- make_webloc(hostname, nil, url_scheme)
43
+ hostnames.each { |hostname| make_webloc(hostname, nil, url_scheme) }
44
44
  end
45
45
  end
46
46
  end
@@ -67,7 +67,7 @@ module SSHBookmarker
67
67
  port = ported_host_match[2]
68
68
  yield(host, port)
69
69
  else
70
- yield(hostname) unless hostname.match(/ /) || hostname.match(/^[\[]/) || hostname.match(/^[0-9\.]+$/) || hostname.match(/^[a-f0-9\:]+(%.*)?$/)
70
+ yield([hostname]) unless hostname.match(/ /) || hostname.match(/^[\[]/) || hostname.match(/^[0-9\.]+$/) || hostname.match(/^[a-f0-9\:]+(%.*)?$/)
71
71
  end
72
72
  end
73
73
  end
@@ -82,10 +82,8 @@ module SSHBookmarker
82
82
  url_schemes = extract_url_scheme($2)
83
83
  hosts = host_spec.split(/\s+/)
84
84
  logger.debug("Got hosts #{hosts.inspect}")
85
- hosts.each do |host|
86
- url_schemes.each do |url_scheme|
87
- yield(host, nil, url_scheme) unless host.match /\*/
88
- end
85
+ url_schemes.each do |url_scheme|
86
+ yield(hosts, nil, url_scheme) unless hosts.any?{ |hn| hn.match(/\*/) }
89
87
  end
90
88
  end
91
89
  end
@@ -47,6 +47,7 @@ USAGE
47
47
  opts.on('-M PATTERN', '--prevent-mosh=PATTERN', 'Prevent emitting a mosh bookmark for host names matching PATTERN') do |pattern|
48
48
  @mosh_negative_domain_patterns << to_match_expr(pattern)
49
49
  end
50
+
50
51
  opts.on('-v', '--verbose', 'More debug chunder') do
51
52
  @debug_level -= 1
52
53
  end
@@ -76,9 +77,9 @@ USAGE
76
77
  parser.logger = logger
77
78
 
78
79
  if @mosh_positive_domain_patterns.length > 0
79
- parser.protocol_override = proc do |hostname, url_scheme|
80
- if @mosh_positive_domain_patterns.find {|pattern| hostname.match(pattern)} &&
81
- !@mosh_negative_domain_patterns.find {|pattern| hostname.match(pattern)}
80
+ parser.protocol_override = proc do |hostnames, url_scheme|
81
+ if @mosh_positive_domain_patterns.find {|pattern| hostnames.any?{ |hn| hn.match(pattern) }} &&
82
+ !@mosh_negative_domain_patterns.find {|pattern| hostnames.any?{ |hn| hn.match(pattern) }}
82
83
  ['mosh']
83
84
  end
84
85
  end
@@ -1,3 +1,3 @@
1
1
  module SSHBookmarker
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ssh_bookmarker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
5
- prerelease:
4
+ version: 0.0.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Andreas Fuchs
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-07-19 00:00:00.000000000 Z
11
+ date: 2013-11-26 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ! '>='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ! '>='
44
39
  - !ruby/object:Gem::Version
@@ -66,27 +61,26 @@ files:
66
61
  homepage: ''
67
62
  licenses:
68
63
  - MIT
64
+ metadata: {}
69
65
  post_install_message:
70
66
  rdoc_options: []
71
67
  require_paths:
72
68
  - lib
73
69
  required_ruby_version: !ruby/object:Gem::Requirement
74
- none: false
75
70
  requirements:
76
71
  - - ! '>='
77
72
  - !ruby/object:Gem::Version
78
73
  version: '0'
79
74
  required_rubygems_version: !ruby/object:Gem::Requirement
80
- none: false
81
75
  requirements:
82
76
  - - ! '>='
83
77
  - !ruby/object:Gem::Version
84
78
  version: '0'
85
79
  requirements: []
86
80
  rubyforge_project:
87
- rubygems_version: 1.8.23
81
+ rubygems_version: 2.1.10
88
82
  signing_key:
89
- specification_version: 3
83
+ specification_version: 4
90
84
  summary: This gem installs a script that lets you generate SSH bookmarks from the
91
85
  (non-wildcard) entries in your SSH config and known_hosts files. It supports Mosh,
92
86
  too!