akaer 1.0.0 → 1.5.0
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.
- data/.gitignore +6 -21
- data/.yardopts +1 -1
- data/Gemfile.lock +19 -19
- data/akaer.gemspec +2 -5
- data/bin/akaer +33 -74
- data/doc/Akaer/Application.html +2134 -0
- data/doc/Akaer/Configuration.html +282 -0
- data/doc/Akaer/Errors/InvalidConfiguration.html +123 -0
- data/doc/Akaer/Errors.html +115 -0
- data/doc/Akaer/Logger.html +596 -0
- data/doc/Akaer/Version.html +189 -0
- data/doc/Akaer.html +130 -0
- data/doc/Fixnum.html +200 -0
- data/doc/_index.html +147 -0
- data/doc/class_list.html +53 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +328 -0
- data/doc/file.README.html +140 -0
- data/doc/file_list.html +55 -0
- data/doc/frames.html +28 -0
- data/doc/index.html +140 -0
- data/doc/js/app.js +214 -0
- data/doc/js/full_list.js +173 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +204 -0
- data/doc/top-level-namespace.html +112 -0
- data/lib/akaer/application.rb +28 -35
- data/lib/akaer/version.rb +1 -1
- data/lib/akaer.rb +1 -1
- data/spec/akaer/application_spec.rb +32 -16
- data/spec/coverage_helper.rb +3 -2
- metadata +29 -23
data/.gitignore
CHANGED
@@ -1,21 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
lib/bundler/man
|
8
|
-
pkg
|
9
|
-
rdoc
|
10
|
-
spec/reports
|
11
|
-
test/tmp
|
12
|
-
test/version_tmp
|
13
|
-
tmp
|
14
|
-
|
15
|
-
# YARD artifacts
|
16
|
-
.yardoc
|
17
|
-
_yardoc
|
18
|
-
doc/
|
19
|
-
|
20
|
-
# RubyMine
|
21
|
-
.idea/
|
1
|
+
Gemfile.lock
|
2
|
+
tester.rb
|
3
|
+
coverage/
|
4
|
+
pkg/
|
5
|
+
.idea/
|
6
|
+
.yardoc/
|
data/.yardopts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
-m markdown
|
data/Gemfile.lock
CHANGED
@@ -1,16 +1,15 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
akaer (1.
|
5
|
-
|
6
|
-
gli (~> 1.6.0)
|
4
|
+
akaer (1.5.0)
|
5
|
+
mamertes (>= 1.1.0)
|
7
6
|
|
8
7
|
GEM
|
9
8
|
remote: http://rubygems.org/
|
10
9
|
specs:
|
11
|
-
actionpack (3.2.
|
12
|
-
activemodel (= 3.2.
|
13
|
-
activesupport (= 3.2.
|
10
|
+
actionpack (3.2.8)
|
11
|
+
activemodel (= 3.2.8)
|
12
|
+
activesupport (= 3.2.8)
|
14
13
|
builder (~> 3.0.0)
|
15
14
|
erubis (~> 2.7.0)
|
16
15
|
journey (~> 1.0.4)
|
@@ -18,31 +17,33 @@ GEM
|
|
18
17
|
rack-cache (~> 1.2)
|
19
18
|
rack-test (~> 0.6.1)
|
20
19
|
sprockets (~> 2.1.3)
|
21
|
-
activemodel (3.2.
|
22
|
-
activesupport (= 3.2.
|
20
|
+
activemodel (3.2.8)
|
21
|
+
activesupport (= 3.2.8)
|
23
22
|
builder (~> 3.0.0)
|
24
|
-
activesupport (3.2.
|
23
|
+
activesupport (3.2.8)
|
25
24
|
i18n (~> 0.6)
|
26
25
|
multi_json (~> 1.0)
|
27
|
-
bovem (
|
26
|
+
bovem (1.1.0)
|
28
27
|
lazier (~> 1.0)
|
29
|
-
|
28
|
+
open4 (~> 1.3.0)
|
30
29
|
builder (3.0.0)
|
31
30
|
coderay (1.0.7)
|
32
31
|
diff-lcs (1.1.3)
|
33
32
|
erubis (2.7.0)
|
34
|
-
github-markup (0.7.
|
35
|
-
gli (1.6.0)
|
33
|
+
github-markup (0.7.4)
|
36
34
|
hike (1.2.1)
|
37
35
|
i18n (0.6.0)
|
38
36
|
journey (1.0.4)
|
39
|
-
json (1.7.
|
40
|
-
lazier (1.0.
|
37
|
+
json (1.7.5)
|
38
|
+
lazier (1.0.3)
|
41
39
|
actionpack (~> 3.0)
|
42
40
|
json (~> 1.7.0)
|
43
41
|
tzinfo (~> 0.3.0)
|
42
|
+
mamertes (1.1.0)
|
43
|
+
bovem (~> 1.1.0)
|
44
44
|
method_source (0.8)
|
45
45
|
multi_json (1.3.6)
|
46
|
+
open4 (1.3.0)
|
46
47
|
pry (0.9.10)
|
47
48
|
coderay (~> 1.0.5)
|
48
49
|
method_source (~> 0.8)
|
@@ -52,17 +53,16 @@ GEM
|
|
52
53
|
rack (>= 0.4)
|
53
54
|
rack-test (0.6.1)
|
54
55
|
rack (>= 1.0)
|
55
|
-
rainbow (1.1.4)
|
56
56
|
rake (0.9.2.2)
|
57
57
|
redcarpet (2.1.1)
|
58
58
|
rspec (2.11.0)
|
59
59
|
rspec-core (~> 2.11.0)
|
60
60
|
rspec-expectations (~> 2.11.0)
|
61
61
|
rspec-mocks (~> 2.11.0)
|
62
|
-
rspec-core (2.11.
|
63
|
-
rspec-expectations (2.11.
|
62
|
+
rspec-core (2.11.1)
|
63
|
+
rspec-expectations (2.11.2)
|
64
64
|
diff-lcs (~> 1.1.3)
|
65
|
-
rspec-mocks (2.11.
|
65
|
+
rspec-mocks (2.11.2)
|
66
66
|
simplecov (0.6.4)
|
67
67
|
multi_json (~> 1.0)
|
68
68
|
simplecov-html (~> 0.5.3)
|
data/akaer.gemspec
CHANGED
@@ -21,8 +21,7 @@ Gem::Specification.new do |gem|
|
|
21
21
|
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
22
22
|
gem.require_paths = ["lib"]
|
23
23
|
|
24
|
-
gem.add_dependency("
|
25
|
-
gem.add_dependency("gli", "~> 1.6.0")
|
24
|
+
gem.add_dependency("mamertes", ">= 1.1.0")
|
26
25
|
|
27
26
|
gem.add_development_dependency("rspec", "~> 2.11.0")
|
28
27
|
gem.add_development_dependency("rake", "~> 0.9.0")
|
@@ -31,6 +30,4 @@ Gem::Specification.new do |gem|
|
|
31
30
|
gem.add_development_dependency("yard", "~> 0.8.0")
|
32
31
|
gem.add_development_dependency("redcarpet", "~> 2.1.0")
|
33
32
|
gem.add_development_dependency("github-markup", "~> 0.7.0")
|
34
|
-
end
|
35
|
-
|
36
|
-
|
33
|
+
end
|
data/bin/akaer
CHANGED
@@ -6,86 +6,45 @@
|
|
6
6
|
|
7
7
|
require "rubygems"
|
8
8
|
require "akaer"
|
9
|
-
require "gli"
|
10
9
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
version
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
desc("The number of aliases to add.")
|
32
|
-
default_value(5)
|
33
|
-
arg_name("ALIASES")
|
34
|
-
flag(:S, :aliases)
|
35
|
-
|
36
|
-
desc("The command to run for adding an alias.")
|
37
|
-
default_value("sudo ifconfig @INTERFACE@ alias @ALIAS@")
|
38
|
-
arg_name("COMMAND")
|
39
|
-
flag(:c, :"add-command")
|
40
|
-
|
41
|
-
desc("The command to run for adding an alias.")
|
42
|
-
default_value("sudo ifconfig @INTERFACE@ -alias @ALIAS@")
|
43
|
-
arg_name("COMMAND")
|
44
|
-
flag(:C, :"remove-command")
|
45
|
-
|
46
|
-
desc("The default log file.")
|
47
|
-
default_value("STDOUT")
|
48
|
-
arg_name("LOG")
|
49
|
-
flag([:l, :log])
|
50
|
-
|
51
|
-
desc("The default log level. Valid values are from 0 to 5 where 0 means \"all messages\".")
|
52
|
-
default_value(1)
|
53
|
-
arg_name("LEVEL")
|
54
|
-
flag([:L, :"log-level"])
|
55
|
-
|
56
|
-
desc("Only show which modifications will be done")
|
57
|
-
switch([:n, :"dry-run"])
|
58
|
-
|
59
|
-
desc("Do not show any message.")
|
60
|
-
switch([:q, :quiet])
|
61
|
-
|
62
|
-
desc("Add aliases.")
|
63
|
-
command [:a, :add] do |c|
|
64
|
-
c.action do |globals, locals, args|
|
65
|
-
Akaer::Application.instance(globals, locals, args).action_add()
|
10
|
+
Mamertes.App do
|
11
|
+
name "Akaer"
|
12
|
+
description "A small utility to add aliases to network interfaces."
|
13
|
+
version Akaer::Version::STRING
|
14
|
+
|
15
|
+
option "configuration", [], {:help => "The configuration file to use. Default is \"~/.akaer_config\".", :default => "~/.akaer_config"}
|
16
|
+
option "interface", [], {:help => "The default interface to manage. Default is \"lo0\".", :default => "lo0"}
|
17
|
+
option "addresses", [], {:type => Array, :help => "The default list of aliases to add. Overrides sequential list"}
|
18
|
+
option "start-address", [], {:help => "The starting address for sequential aliases. Default is \"10.0.0.1\".", :default => "10.0.0.1", :meta => "ADDRESS"}
|
19
|
+
option "aliases", [:S], {:type => Integer, :help => "The number of aliases to add. Default is 5.", :default => 5}
|
20
|
+
option "add-command", [:A], {:help => "The command to run for adding an alias. Default is \"sudo ifconfig @INTERFACE@ alias @ALIAS@\".", :default => "sudo ifconfig @INTERFACE@ alias @ALIAS@", :meta => "COMMAND"}
|
21
|
+
option "remove-command", [:R], {:help => "The command to run for removing an alias. Default is \"sudo ifconfig @INTERFACE@ -alias @ALIAS@\".", :default => "sudo ifconfig @INTERFACE@ -alias @ALIAS@", :meta => "COMMAND"}
|
22
|
+
option "log-file", [], {:help => "The default log file. Default is standard output.", :default => "STDOUT", :meta => "FILE"}
|
23
|
+
option "log-level", [:L], {:type => Integer, :help => "The default log level. Valid values are from 0 to 5 where 0 means \"all messages\". Default is 1.", :default => 1, :meta => "LEVEL"}
|
24
|
+
option "dry-run", [:n], {:help => "Only show which modifications will be done."}
|
25
|
+
option "quiet", [], {:help => "Do not show any message."}
|
26
|
+
|
27
|
+
command :add do
|
28
|
+
description "Adds aliases."
|
29
|
+
action { |command| Akaer::Application.instance(command).action_add() }
|
66
30
|
end
|
67
|
-
end
|
68
31
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
Akaer::Application.instance(globals, locals, args).action_remove()
|
32
|
+
command :remove do
|
33
|
+
description "Removes aliases."
|
34
|
+
action { |command| Akaer::Application.instance(command).action_remove() }
|
73
35
|
end
|
74
|
-
end
|
75
36
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
Akaer::Application.instance(globals, locals, args).action_install()
|
37
|
+
command :install do
|
38
|
+
description "Installs the application to autolaunch."
|
39
|
+
action { |command| Akaer::Application.instance(command).action_install() }
|
80
40
|
end
|
81
|
-
end
|
82
41
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
Akaer::Application.instance(globals, locals, args).action_uninstall()
|
42
|
+
command :uninstall do
|
43
|
+
description "Uninstalls the application from autolaunch."
|
44
|
+
action { |command| Akaer::Application.instance(command).action_uninstall() }
|
87
45
|
end
|
88
|
-
end
|
89
46
|
|
90
|
-
|
91
|
-
|
47
|
+
action do |command|
|
48
|
+
self.commands["add"].execute(ARGV)
|
49
|
+
end
|
50
|
+
end
|