hooray 0.1.8 → 0.1.9

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
  SHA1:
3
- metadata.gz: 2b6ba8e1a0e98fdcef75ae3803ecc84d430a14e7
4
- data.tar.gz: 9191775fb0feb7c4137f8ddea30d3442cb387bcf
3
+ metadata.gz: 01dbc476c1b307bbc38b11487bcfc8bb1e038041
4
+ data.tar.gz: 9c7b3175552fbf3c979b4dc03a1a438942b99688
5
5
  SHA512:
6
- metadata.gz: af30c78db97d13f77c137eb3a7e38c2129f36ea8f52f6c353406b2d60d247552e3ff35b1f0c8fc4210c036ff692d83716ddfd6f84e37f53bf9deadc44acb3eac
7
- data.tar.gz: 21f46636f41389ab80335963bb262fb588858bcca24ce0b6bba3e80d7d86c9150e3e59a9fddf387cfaf076d7c97f26674c55fc118e18fd6eec940487dfe48434
6
+ metadata.gz: be790c61d159a70f45a15917a334a25d3628d8178bab7770c8936a011c006a2173ad94aea37594f88b68f75e42575562b2b82ee1f6ff30867baa9747284395ba
7
+ data.tar.gz: 57354d535ad19aa5becd0ebae1054fcf81b2675e3c42540e2c6236612941286fbc4e0485752005b984bc7cdc3e142b04d0c834eddbb4a7b87f4cb4698c4a8f6f
data/.gitignore CHANGED
@@ -5,4 +5,5 @@ pkg
5
5
  .bundle
6
6
  Gemfile.lock
7
7
  *.gem
8
- *.log
8
+ *.log
9
+ doc/
data/.hound.yml ADDED
@@ -0,0 +1,2 @@
1
+ ruby:
2
+ enabled: true
data/.travis.yml CHANGED
@@ -1,8 +1,10 @@
1
1
  language: ruby
2
+ env: CI="travis"
2
3
  rvm:
3
4
  - 1.9.3
4
- - 2.0.0
5
+ - 2.0
5
6
  - 2.1
7
+ - 2.2
6
8
  - rbx-2
7
9
  - ruby-head
8
10
  matrix:
data/Gemfile CHANGED
@@ -2,13 +2,14 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- gem 'pry'
6
- gem 'coveralls'
7
- gem 'rake'
8
- gem 'rspec', '>= 3'
9
- gem 'rubocop'
10
- gem 'guard'
11
- gem 'guard-rspec'
12
- gem 'guard-rubocop'
5
+ group :test do
6
+ gem 'pry'
7
+ gem 'rake'
8
+ gem 'rspec', '>= 3'
9
+ gem 'rubocop'
10
+ gem 'guard'
11
+ gem 'guard-rspec'
12
+ gem 'guard-rubocop'
13
13
 
14
- gem 'coveralls', require: false if ENV['CI']
14
+ gem 'coveralls', require: false if ENV['CI']
15
+ end
data/MIT-LICENSE CHANGED
@@ -1,12 +1,11 @@
1
- Copyright (c) 2007-2008 Andreas Neuhaus <zargony@zargony.com>
1
+ Copyright (c) 2014-2015 Hooray Authors
2
2
 
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
3
+ Permission is hereby granted, free of charge, to any person obtaining a
4
+ copy of this software and associated documentation files (the "Software"),
5
+ to deal in the Software without restriction, including without limitation
6
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
7
+ and/or sell copies of the Software, and to permit persons to whom the
8
+ Software is furnished to do so, subject to the following conditions:
10
9
 
11
10
  The above copyright notice and this permission notice shall be
12
11
  included in all copies or substantial portions of the Software.
data/README.md CHANGED
@@ -1,32 +1,52 @@
1
- Hooray
2
- ======
1
+ # Hooray
2
+ [![Gem Version](https://badge.fury.io/rb/hooray.png)](http://badge.fury.io/rb/hooray)
3
+ [![Coverage Status](https://coveralls.io/repos/nofxx/hooray/badge.png?branch=master)](https://coveralls.io/r/nofxx/hooray?branch=master)
4
+ [![Code Climate](https://codeclimate.com/github/nofxx/hooray.png)](https://codeclimate.com/github/nofxx/hooray)
5
+ [![Build Status](https://travis-ci.org/nofxx/hooray.png?branch=master)](https://travis-ci.org/nofxx/hooray)
6
+
7
+
8
+
9
+ , ________
10
+ /| | \ /
11
+ |___| __ __ ,_ __, \ /
12
+ | |\/ \_/ \_/ | / | | | \ /
13
+ | |/\__/ \__/ |_/\_/|_/ \_/|/ \/
14
+ /| ()
15
+ \|
16
+
17
+
3
18
 
4
19
  Find devices around you. Fast and without hyphens.
5
20
 
21
+
22
+ ## Install
23
+
6
24
  gem install hooray
7
25
 
8
26
 
9
- And use the executable `hoo`:
27
+ ## Use `hoo`
10
28
 
11
29
 
12
30
  ```
13
31
  hoo list
14
32
  ```
15
33
  ```
16
- NAME | IP | MAC
17
- ----------------------------|---------------|------------------
18
- Motorola Mobility | 192.168.1.70 | 34:bb:XX:XX:XX:XX
19
- Giga-byte Technology Co. | 192.168.1.71 | 94:de:XX:XX:XX:XX
20
- Veih's Android | 192.168.1.72 | 04:46:XX:XX:XX:XX
21
- Nery's LG | 192.168.1.73 | cc:fa:XX:XX:XX:XX
22
- nofxx's iPhone | 192.168.1.77 | 64:a3:XX:XX:XX:XX
23
- LG Electronics | 192.168.1.79 | cc:fa:XX:XX:XX:XX
24
- TP-Link | 192.168.1.253 | f8:d1:XX:XX:XX:XX
25
- Siemens Subscriber Networks | 192.168.1.254 | 00:0b:XX:XX:XX:XX
34
+ NAME | IP | MAC
35
+ ----------------------------|------------|------------------
36
+ Motorola Mobility | 10.1.1.70 | 34:bb:XX:XX:XX:XX
37
+ Giga-byte Technology Co. | 10.1.1.71 | 94:de:XX:XX:XX:XX
38
+ Veih's Android | 10.1.1.72 | 04:46:XX:XX:XX:XX
39
+ Nery's LG | 10.1.1.73 | cc:fa:XX:XX:XX:XX
40
+ nofxx's iPhone | 10.1.1.77 | 64:a3:XX:XX:XX:XX
41
+ LG Electronics | 10.1.1.79 | cc:fa:XX:XX:XX:XX
42
+ TP-Link | 10.1.1.253 | f8:d1:XX:XX:XX:XX
43
+ Siemens Subscriber Networks | 10.1.1.254 | 00:0b:XX:XX:XX:XX
26
44
  ---
27
- 8 devices @ 2014-12-11 13:32:04 -0200 2.27s
45
+ 8 nodes @ 2015-01-08 00:33:07 -0200 1.27s
28
46
  ```
29
47
 
48
+ **That's the idea: 1 second to find a device.**
49
+
30
50
 
31
51
  ## Find running services
32
52
 
@@ -40,7 +60,7 @@ dsl modem | 192.168.1.1 | 64:a3:XX:XX:XX:XX
40
60
  test server | 192.168.1.75 | 64:a3:XX:XX:XX:XX
41
61
  nofxx desktop | 192.168.1.77 | 64:a3:XX:XX:XX:XX
42
62
  ---
43
- 3 devices @ 2014-12-11 19:23:11 -0200 1.10s
63
+ 3 nodes @ 2014-12-11 19:23:11 -0200 1.10s
44
64
  ```
45
65
 
46
66
  Or simply by ports:
@@ -80,8 +100,8 @@ You can use any program, not just ssh.
80
100
 
81
101
  ```
82
102
  require 'hooray'
83
- Hooray::Seek.lan(port, protocol).devices
84
- Hooray::Seek.new(network, port, protocol).devices
103
+ Hooray::Seek.lan(port, protocol).nodes
104
+ Hooray::Seek.new(network, port, protocol).nodes
85
105
  ```
86
106
 
87
107
  * Nil port means ICMP ping.
@@ -93,8 +113,8 @@ Possible protocols: tcp, udp, http, wmi & icmp (requires root).
93
113
 
94
114
  ## Why?
95
115
 
96
- Bind macs or fix IP's is also boring and a per device work.
97
- As more we use wifi/ethernet devices in our company, nmap gets boring.
116
+ Bind macs or fix IP's is also boring and a per device/node work.
117
+ As more we use connected (IoT) devices in our company, nmap gets boring.
98
118
  Not to mention slow, there's no easy way to assign names to devices I know,
99
119
  which makes OS scan/port scan a needed option most times (thus making it slower).
100
120
  Also (please open a issue if you know how) even in fast mode nmap won't run in under 2s.
data/Rakefile CHANGED
@@ -6,4 +6,4 @@ require 'rubocop/rake_task'
6
6
  RSpec::Core::RakeTask.new
7
7
  RuboCop::RakeTask.new
8
8
 
9
- task default: [:spec, :rubocop]
9
+ task default: :spec
data/hooray.gemspec CHANGED
@@ -6,6 +6,7 @@ require 'hooray/version'
6
6
  Gem::Specification.new do |s|
7
7
  s.name = 'hooray'
8
8
  s.version = Hooray::VERSION
9
+ s.platform = Gem::Platform::RUBY
9
10
 
10
11
  s.authors = ['Marcos Piccinini']
11
12
  s.homepage = 'http://github.com/nofxx/hooray'
@@ -22,6 +23,7 @@ Gem::Specification.new do |s|
22
23
  s.require_paths = ["lib"]
23
24
 
24
25
  s.add_dependency 'thor'
26
+ s.add_dependency 'psych', '2.0.8'
25
27
  s.add_dependency 'paint'
26
28
  s.add_dependency 'macaddr'
27
29
  s.add_dependency 'net-ping'
data/lib/hooray/seek.rb CHANGED
@@ -11,7 +11,6 @@ module Hooray
11
11
 
12
12
  def initialize(network = nil, *params)
13
13
  @scan = {}
14
- @bots = []
15
14
  config_network network
16
15
  config_filters params
17
16
  end
@@ -56,7 +55,7 @@ module Hooray
56
55
  # Creates a bot per port on IP
57
56
  def scan_bot(ip)
58
57
  (ports || [nil]).each do |port|
59
- @bots << Thread.new do
58
+ Thread.new do
60
59
  if ping_class.new(ip.to_s, port, TIMEOUT).ping?
61
60
  @scan[ip] << port
62
61
  print '.'
@@ -73,7 +72,7 @@ module Hooray
73
72
  @scan[ip] = []
74
73
  scan_bot(ip)
75
74
  end
76
- @bots.each(&:join)
75
+ Thread.list.reject { |t| t == Thread.current }.each(&:join)
77
76
  @scan.reject! { |_k, v| v.empty? }
78
77
  end
79
78
 
@@ -1,4 +1,4 @@
1
1
  # Hooray version
2
2
  module Hooray
3
- VERSION = '0.1.8'
3
+ VERSION = '0.1.9'
4
4
  end
@@ -9,8 +9,10 @@ describe 'Node' do
9
9
  expect(Node.new(ip: '10.1.1.1').ip).to be_a(IPAddr)
10
10
  end
11
11
 
12
- it 'should have mac address' do
13
- expect(Node.new(mac: 'aa:cc:dd:ee:ff:gg').mac).to eq('aa:cc:dd:ee:ff:gg')
12
+ unless ENV['CI']
13
+ it 'should have mac address' do
14
+ expect(Node.new(mac: 'aa:cc:dd:ee:ff:gg').mac).to eq('aa:cc:dd:ee:ff:gg')
15
+ end
14
16
  end
15
17
 
16
18
  it 'should have name' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hooray
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcos Piccinini
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-17 00:00:00.000000000 Z
11
+ date: 2015-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: psych
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '='
32
+ - !ruby/object:Gem::Version
33
+ version: 2.0.8
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '='
39
+ - !ruby/object:Gem::Version
40
+ version: 2.0.8
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: paint
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -89,6 +103,7 @@ extra_rdoc_files: []
89
103
  files:
90
104
  - ".coveralls.yml"
91
105
  - ".gitignore"
106
+ - ".hound.yml"
92
107
  - ".travis.yml"
93
108
  - Gemfile
94
109
  - Guardfile
@@ -132,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
147
  version: '0'
133
148
  requirements: []
134
149
  rubyforge_project:
135
- rubygems_version: 2.4.3
150
+ rubygems_version: 2.4.5
136
151
  signing_key:
137
152
  specification_version: 4
138
153
  summary: Find devices connected in LAN