poweron 0.1.0 → 0.1.1
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.
- checksums.yaml +4 -4
- data/Gemfile +0 -2
- data/Rakefile +0 -2
- data/VERSION +1 -1
- data/lib/poweron/version.rb +7 -2
- data/lib/poweron.rb +24 -1
- data/poweron.gemspec +6 -12
- metadata +49 -48
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 462757e775040ebb0d70eb9e9370ea13ffc7016d96da13959156ff4c3e96ebeb
|
|
4
|
+
data.tar.gz: 9a35c5acac6ef545f08512a500864c98c0b72029dcc625e5ff6a2c28e7163610
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2ed9dfa913d71fb3a85f3892f95376e79daa8bfce99687153e65f46c9eeb62d0b29ad6b7d46a250624d89b4df928e23f0eaef72e60a87f627a0200b9dc9fc36a
|
|
7
|
+
data.tar.gz: 60f8cea4474a5608bffc702f1986980b17c12c37d6a7068da4aef335b6ca0a4cd1025e646d72d551ff2d7fb2533d59914dcf275bc29c92e7297018762dc104a2
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.
|
|
1
|
+
0.1.1
|
data/lib/poweron/version.rb
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
# Version information for the Poweron gem.
|
|
2
|
+
#
|
|
3
|
+
# This module is auto-generated by GemHadar and exposes the
|
|
4
|
+
# current release version as a set of constants. Do not edit it
|
|
5
|
+
# by hand; it is rewritten on every `rake version` invocation.
|
|
1
6
|
module Poweron
|
|
2
|
-
# Poweron
|
|
3
|
-
VERSION = '0.1.
|
|
7
|
+
# The current version of the Poweron gem as a String.
|
|
8
|
+
VERSION = '0.1.1'
|
|
4
9
|
VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
|
|
5
10
|
VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
|
|
6
11
|
VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
|
data/lib/poweron.rb
CHANGED
|
@@ -4,9 +4,32 @@ require 'poweron/version'
|
|
|
4
4
|
require 'socket'
|
|
5
5
|
require 'ipaddr'
|
|
6
6
|
|
|
7
|
+
# Sends a Wake-on-LAN (WOL) magic packet to power on a sleeping
|
|
8
|
+
# computer. Resolves the target MAC address from a direct MAC
|
|
9
|
+
# string or from `/etc/ethers`, then broadcasts a 102-byte UDP
|
|
10
|
+
# datagram to the specified address and port.
|
|
11
|
+
#
|
|
12
|
+
# @example Wake a machine by MAC address
|
|
13
|
+
# Poweron.poweron('aa:bb:cc:dd:ee:ff')
|
|
14
|
+
#
|
|
15
|
+
# @example Wake a machine by hostname via /etc/ethers
|
|
16
|
+
# Poweron.poweron('laptop.local')
|
|
7
17
|
module Poweron
|
|
8
18
|
module_function
|
|
9
|
-
|
|
19
|
+
# Resolves the target MAC address and sends a WOL magic packet.
|
|
20
|
+
#
|
|
21
|
+
# The interface may be a full MAC address
|
|
22
|
+
# (`aa:bb:cc:dd:ee:ff`) or a hostname / IP resolvable through
|
|
23
|
+
# `/etc/ethers`.
|
|
24
|
+
#
|
|
25
|
+
# @param interface [String] MAC address or hostname/IP to resolve
|
|
26
|
+
# @param opts [Hash] optional broadcast settings
|
|
27
|
+
# @option opts [Integer] :port UDP destination port (default: 9)
|
|
28
|
+
# @option opts [String, IPAddr] :ip broadcast address
|
|
29
|
+
# (default: '255.255.255.255')
|
|
30
|
+
#
|
|
31
|
+
# @raise [ArgumentError] if the interface cannot be resolved to a
|
|
32
|
+
# valid 6-byte MAC address, or if the port is out of range
|
|
10
33
|
def poweron(interface, opts = {})
|
|
11
34
|
mac =
|
|
12
35
|
if interface =~ /\A[0-9a-f]{2}(:[0-9a-f]{2}){5}\Z/i
|
data/poweron.gemspec
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
|
2
|
-
# stub: poweron 0.1.
|
|
2
|
+
# stub: poweron 0.1.1 ruby lib
|
|
3
3
|
|
|
4
4
|
Gem::Specification.new do |s|
|
|
5
5
|
s.name = "poweron".freeze
|
|
6
|
-
s.version = "0.1.
|
|
6
|
+
s.version = "0.1.1".freeze
|
|
7
7
|
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
|
9
9
|
s.require_paths = ["lib".freeze]
|
|
10
10
|
s.authors = ["Florian Frank".freeze]
|
|
11
|
-
s.date = "
|
|
11
|
+
s.date = "1980-01-02"
|
|
12
12
|
s.description = "Library to send a wake-on-lan packet in order to poweron a sleeing computer.".freeze
|
|
13
13
|
s.email = "flori@ping.de".freeze
|
|
14
14
|
s.executables = ["poweron".freeze]
|
|
@@ -18,16 +18,10 @@ Gem::Specification.new do |s|
|
|
|
18
18
|
s.licenses = ["MIT".freeze]
|
|
19
19
|
s.rdoc_options = ["--title".freeze, "Poweron -- wakes up sleeping computers".freeze, "--main".freeze, "README.md".freeze]
|
|
20
20
|
s.required_ruby_version = Gem::Requirement.new(">= 2.0".freeze)
|
|
21
|
-
s.rubygems_version = "
|
|
21
|
+
s.rubygems_version = "4.1.0".freeze
|
|
22
22
|
s.summary = "Library to power on sleeping computers,".freeze
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
s.specification_version = 4
|
|
26
|
-
end
|
|
24
|
+
s.specification_version = 4
|
|
27
25
|
|
|
28
|
-
|
|
29
|
-
s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 1.11.0"])
|
|
30
|
-
else
|
|
31
|
-
s.add_dependency(%q<gem_hadar>.freeze, ["~> 1.11.0"])
|
|
32
|
-
end
|
|
26
|
+
s.add_development_dependency("gem_hadar".freeze, [">= 2.26.1".freeze])
|
|
33
27
|
end
|
metadata
CHANGED
|
@@ -1,73 +1,74 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: poweron
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
|
-
- Florian Frank
|
|
8
|
-
autorequire:
|
|
7
|
+
- Florian Frank
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
|
-
- !ruby/object:Gem::Dependency
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: gem_hadar
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
-
|
|
17
|
+
- ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: 2.26.1
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
-
|
|
25
|
+
- ">="
|
|
26
|
+
- !ruby/object:Gem::Version
|
|
27
|
+
version: 2.26.1
|
|
27
28
|
description: Library to send a wake-on-lan packet in order to poweron a sleeing computer.
|
|
28
29
|
email: flori@ping.de
|
|
29
30
|
executables:
|
|
30
|
-
- poweron
|
|
31
|
+
- poweron
|
|
31
32
|
extensions: []
|
|
32
33
|
extra_rdoc_files:
|
|
33
|
-
- README.md
|
|
34
|
-
- lib/poweron.rb
|
|
35
|
-
- lib/poweron/version.rb
|
|
34
|
+
- README.md
|
|
35
|
+
- lib/poweron.rb
|
|
36
|
+
- lib/poweron/version.rb
|
|
36
37
|
files:
|
|
37
|
-
-
|
|
38
|
-
- Gemfile
|
|
39
|
-
- README.md
|
|
40
|
-
- Rakefile
|
|
41
|
-
- VERSION
|
|
42
|
-
- bin/poweron
|
|
43
|
-
- lib/poweron.rb
|
|
44
|
-
- lib/poweron/version.rb
|
|
45
|
-
- poweron.gemspec
|
|
46
|
-
homepage: https://github.com/flori/poweron
|
|
38
|
+
- .gitignore
|
|
39
|
+
- Gemfile
|
|
40
|
+
- README.md
|
|
41
|
+
- Rakefile
|
|
42
|
+
- VERSION
|
|
43
|
+
- bin/poweron
|
|
44
|
+
- lib/poweron.rb
|
|
45
|
+
- lib/poweron/version.rb
|
|
46
|
+
- poweron.gemspec
|
|
47
|
+
homepage: "https://github.com/flori/poweron"
|
|
47
48
|
licenses:
|
|
48
|
-
- MIT
|
|
49
|
+
- MIT
|
|
49
50
|
metadata: {}
|
|
50
|
-
post_install_message:
|
|
51
51
|
rdoc_options:
|
|
52
|
-
- "--title"
|
|
53
|
-
- Poweron -- wakes up sleeping computers
|
|
54
|
-
- "--main"
|
|
55
|
-
- README.md
|
|
52
|
+
- "--title"
|
|
53
|
+
- Poweron -- wakes up sleeping computers
|
|
54
|
+
- "--main"
|
|
55
|
+
- README.md
|
|
56
56
|
require_paths:
|
|
57
|
-
- lib
|
|
57
|
+
- lib
|
|
58
58
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
59
59
|
requirements:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
-
|
|
61
|
+
- ">="
|
|
62
|
+
- !ruby/object:Gem::Version
|
|
63
|
+
version: "2.0"
|
|
63
64
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
65
|
requirements:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
-
|
|
67
|
+
- ">="
|
|
68
|
+
- !ruby/object:Gem::Version
|
|
69
|
+
version: "0"
|
|
68
70
|
requirements: []
|
|
69
|
-
rubygems_version:
|
|
70
|
-
signing_key:
|
|
71
|
+
rubygems_version: 4.1.0
|
|
71
72
|
specification_version: 4
|
|
72
|
-
summary: Library to power on sleeping computers,
|
|
73
|
+
summary: "Library to power on sleeping computers,"
|
|
73
74
|
test_files: []
|