ranch-manager 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +35 -0
- data/README.rdoc +6 -0
- data/Rakefile +15 -0
- data/bin/ranch-manager +89 -0
- data/html/README_rdoc.html +101 -0
- data/html/RanchManager/Hostname.html +224 -0
- data/html/RanchManager/IpManager.html +271 -0
- data/html/RanchManager/Logger.html +189 -0
- data/html/RanchManager/Setup.html +155 -0
- data/html/RanchManager.html +120 -0
- data/html/RancherManagerCLI/RanchManager.html +96 -0
- data/html/RancherManagerCLI.html +107 -0
- data/html/created.rid +10 -0
- data/html/css/fonts.css +167 -0
- data/html/css/rdoc.css +590 -0
- data/html/fonts/Lato-Light.ttf +0 -0
- data/html/fonts/Lato-LightItalic.ttf +0 -0
- data/html/fonts/Lato-Regular.ttf +0 -0
- data/html/fonts/Lato-RegularItalic.ttf +0 -0
- data/html/fonts/SourceCodePro-Bold.ttf +0 -0
- data/html/fonts/SourceCodePro-Regular.ttf +0 -0
- data/html/images/add.png +0 -0
- data/html/images/arrow_up.png +0 -0
- data/html/images/brick.png +0 -0
- data/html/images/brick_link.png +0 -0
- data/html/images/bug.png +0 -0
- data/html/images/bullet_black.png +0 -0
- data/html/images/bullet_toggle_minus.png +0 -0
- data/html/images/bullet_toggle_plus.png +0 -0
- data/html/images/date.png +0 -0
- data/html/images/delete.png +0 -0
- data/html/images/find.png +0 -0
- data/html/images/loadingAnimation.gif +0 -0
- data/html/images/macFFBgHack.png +0 -0
- data/html/images/package.png +0 -0
- data/html/images/page_green.png +0 -0
- data/html/images/page_white_text.png +0 -0
- data/html/images/page_white_width.png +0 -0
- data/html/images/plugin.png +0 -0
- data/html/images/ruby.png +0 -0
- data/html/images/tag_blue.png +0 -0
- data/html/images/tag_green.png +0 -0
- data/html/images/transparent.png +0 -0
- data/html/images/wrench.png +0 -0
- data/html/images/wrench_orange.png +0 -0
- data/html/images/zoom.png +0 -0
- data/html/index.html +114 -0
- data/html/js/darkfish.js +161 -0
- data/html/js/jquery.js +4 -0
- data/html/js/navigation.js +142 -0
- data/html/js/navigation.js.gz +0 -0
- data/html/js/search.js +109 -0
- data/html/js/search_index.js +1 -0
- data/html/js/search_index.js.gz +0 -0
- data/html/js/searcher.js +229 -0
- data/html/js/searcher.js.gz +0 -0
- data/html/table_of_contents.html +120 -0
- data/lib/ranch-manager/constants.rb +4 -0
- data/lib/ranch-manager/hostname.rb +13 -0
- data/lib/ranch-manager/ip_manager.rb +41 -0
- data/lib/ranch-manager/logger.rb +11 -0
- data/lib/ranch-manager/setup.rb +32 -0
- data/lib/ranch-manager/version.rb +3 -0
- data/lib/ranch-manager.rb +16 -0
- data/ranch-manager.gemspec +31 -0
- data/ranch-manager.rdoc +0 -0
- metadata +189 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e99d309c22402c6099afa066e8b4df6621843542
|
4
|
+
data.tar.gz: f0f0e1e2fdcd75c0b5edc8f6361996521775404c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1e9661588065b4e0415e5b9c030456ae4fa3b0c226d85780f9df75b6d71db7364f1f91c4b1dec6ae77954bb26f782471ab8cb27543ef5ebf4dc0b730dd23046a
|
7
|
+
data.tar.gz: 10a7b092635befc1325024b41346ec71563c878477c67fcbbc01d585974fec644186592a8453c36191c72405156c9debe1c8f768308f7327f1d95e6a5cc5aee6
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
ranch-manager (0.0.1)
|
5
|
+
ghost (= 1.0.0)
|
6
|
+
gli (= 2.16.0)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
coderay (1.1.1)
|
12
|
+
ghost (1.0.0)
|
13
|
+
unindent (= 1.0)
|
14
|
+
gli (2.16.0)
|
15
|
+
method_source (0.8.2)
|
16
|
+
pry (0.10.4)
|
17
|
+
coderay (~> 1.1.0)
|
18
|
+
method_source (~> 0.8.1)
|
19
|
+
slop (~> 3.4)
|
20
|
+
rake (12.0.0)
|
21
|
+
rdoc (5.1.0)
|
22
|
+
slop (3.6.0)
|
23
|
+
unindent (1.0)
|
24
|
+
|
25
|
+
PLATFORMS
|
26
|
+
ruby
|
27
|
+
|
28
|
+
DEPENDENCIES
|
29
|
+
pry
|
30
|
+
rake
|
31
|
+
ranch-manager!
|
32
|
+
rdoc
|
33
|
+
|
34
|
+
BUNDLED WITH
|
35
|
+
1.13.7
|
data/README.rdoc
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'rake/clean'
|
2
|
+
require 'rubygems'
|
3
|
+
require 'rubygems/package_task'
|
4
|
+
require 'rdoc/task'
|
5
|
+
|
6
|
+
Rake::RDocTask.new do |rd|
|
7
|
+
rd.main = "README.rdoc"
|
8
|
+
rd.rdoc_files.include("README.rdoc","lib/**/*.rb","bin/**/*")
|
9
|
+
rd.title = 'Rancher Manager'
|
10
|
+
end
|
11
|
+
|
12
|
+
spec = eval(File.read('ranch-manager.gemspec'))
|
13
|
+
|
14
|
+
Gem::PackageTask.new(spec) do |pkg|
|
15
|
+
end
|
data/bin/ranch-manager
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
module RancherManagerCLI
|
3
|
+
require 'gli'
|
4
|
+
require 'ranch-manager'
|
5
|
+
|
6
|
+
include GLI::App
|
7
|
+
# our cli is wrapped in a module (to not pollute the global namespace with GLI methods),
|
8
|
+
# so we need to extend here for things to work
|
9
|
+
extend self
|
10
|
+
|
11
|
+
program_desc 'Command line tools for using Rancher in a development environment'
|
12
|
+
|
13
|
+
version RanchManager::VERSION
|
14
|
+
|
15
|
+
subcommand_option_handling :normal
|
16
|
+
arguments :strict
|
17
|
+
|
18
|
+
desc 'Creates files and directories needed by rancher-manager'
|
19
|
+
command :setup do |c|
|
20
|
+
c.action do |global_options,options,args|
|
21
|
+
RanchManager::Setup.setup
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
desc 'Manage IP addresses assigned to hostnames'
|
26
|
+
command :ip do |c|
|
27
|
+
|
28
|
+
c.desc 'Refreshes all managed hostnames to point to your current IP Address'
|
29
|
+
c.arg_name 'ip address', :optional
|
30
|
+
c.command :refresh do |refresh|
|
31
|
+
refresh.action do |global_options,options,args|
|
32
|
+
RanchManager::IpManager.update_all(args[0])
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
c.desc 'Adds a hostname to manage'
|
37
|
+
c.arg_name 'hostname'
|
38
|
+
c.arg_name 'ip address', :optional
|
39
|
+
c.command :add do |add|
|
40
|
+
add.action do |global_options,options,args|
|
41
|
+
RanchManager::IpManager.add(args[0], args[1])
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
c.desc 'Updates the IP address of a hostname (removes then adds)'
|
46
|
+
c.arg_name 'hostname'
|
47
|
+
c.arg_name 'ip address', :optional
|
48
|
+
c.command :update do |add|
|
49
|
+
add.action do |global_options,options,args|
|
50
|
+
RanchManager::IpManager.update(args[0], args[1])
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
c.desc 'Removes a hostname from management'
|
55
|
+
c.arg_name 'hostname'
|
56
|
+
c.command :remove do |add|
|
57
|
+
add.action do |global_options,options,args|
|
58
|
+
RanchManager::IpManager.remove(args[0])
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
pre do |global,command,options,args|
|
64
|
+
if command.parent && command.parent.name == :ip
|
65
|
+
message = ":ip commands must be run as sudo because they make changes to /etc/hosts"
|
66
|
+
exit_now!(message) unless Process.euid == 0
|
67
|
+
end
|
68
|
+
# Pre logic here
|
69
|
+
# Return true to proceed; false to abort and not call the
|
70
|
+
# chosen command
|
71
|
+
# Use skips_pre before a command to skip this block
|
72
|
+
# on that command only
|
73
|
+
true
|
74
|
+
end
|
75
|
+
|
76
|
+
post do |global,command,options,args|
|
77
|
+
# Post logic here
|
78
|
+
# Use skips_post before a command to skip this
|
79
|
+
# block on that command only
|
80
|
+
end
|
81
|
+
|
82
|
+
on_error do |exception|
|
83
|
+
# Error logic here
|
84
|
+
# return false to skip default error handling
|
85
|
+
true
|
86
|
+
end
|
87
|
+
|
88
|
+
exit run(ARGV)
|
89
|
+
end
|
@@ -0,0 +1,101 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>README - Rancher Manager</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "./";
|
11
|
+
var index_rel_prefix = "./";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="./js/jquery.js"></script>
|
15
|
+
<script src="./js/darkfish.js"></script>
|
16
|
+
|
17
|
+
<link href="./css/fonts.css" rel="stylesheet">
|
18
|
+
<link href="./css/rdoc.css" rel="stylesheet">
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
<body id="top" role="document" class="file">
|
23
|
+
<nav role="navigation">
|
24
|
+
<div id="project-navigation">
|
25
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
26
|
+
<h2>
|
27
|
+
<a href="./index.html" rel="home">Home</a>
|
28
|
+
</h2>
|
29
|
+
|
30
|
+
<div id="table-of-contents-navigation">
|
31
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
32
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
33
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
34
|
+
</div>
|
35
|
+
</div>
|
36
|
+
|
37
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
38
|
+
<form action="#" method="get" accept-charset="utf-8">
|
39
|
+
<div id="search-field-wrapper">
|
40
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
41
|
+
aria-autocomplete="list" aria-controls="search-results"
|
42
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
43
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<ul id="search-results" aria-label="Search Results"
|
47
|
+
aria-busy="false" aria-expanded="false"
|
48
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
49
|
+
</form>
|
50
|
+
</div>
|
51
|
+
|
52
|
+
</div>
|
53
|
+
|
54
|
+
|
55
|
+
<div class="nav-section">
|
56
|
+
<h3>Table of Contents</h3>
|
57
|
+
|
58
|
+
<ul class="link-list" role="directory">
|
59
|
+
<li><a href="#label-ranch-manager">ranch-manager</a>
|
60
|
+
<li><a href="#label-ranch-manager">ranch-manager</a>
|
61
|
+
</ul>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
|
65
|
+
<div id="project-metadata">
|
66
|
+
<div id="fileindex-section" class="nav-section">
|
67
|
+
<h3>Pages</h3>
|
68
|
+
|
69
|
+
<ul class="link-list">
|
70
|
+
|
71
|
+
<li><a href="./README_rdoc.html">README</a>
|
72
|
+
|
73
|
+
</ul>
|
74
|
+
</div>
|
75
|
+
|
76
|
+
</div>
|
77
|
+
</nav>
|
78
|
+
|
79
|
+
<main role="main" aria-label="Page README.rdoc">
|
80
|
+
|
81
|
+
<h1 id="label-ranch-manager">ranch-manager<span><a href="#label-ranch-manager">¶</a> <a href="#top">↑</a></span></h1>
|
82
|
+
|
83
|
+
<p>Describe your project here</p>
|
84
|
+
|
85
|
+
<h1 id="label-ranch-manager">ranch-manager<span><a href="#label-ranch-manager">¶</a> <a href="#top">↑</a></span></h1>
|
86
|
+
|
87
|
+
<p>Generate this with</p>
|
88
|
+
|
89
|
+
<pre>ranch-manager rdoc</pre>
|
90
|
+
|
91
|
+
<p>After you have described your command line interface</p>
|
92
|
+
</main>
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
<footer id="validator-badges" role="contentinfo">
|
97
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
98
|
+
<p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.1.0.
|
99
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
100
|
+
</footer>
|
101
|
+
|
@@ -0,0 +1,224 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class RanchManager::Hostname - Rancher Manager</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "../";
|
11
|
+
var index_rel_prefix = "../";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="../js/jquery.js"></script>
|
15
|
+
<script src="../js/darkfish.js"></script>
|
16
|
+
|
17
|
+
<link href="../css/fonts.css" rel="stylesheet">
|
18
|
+
<link href="../css/rdoc.css" rel="stylesheet">
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
<body id="top" role="document" class="class">
|
23
|
+
<nav role="navigation">
|
24
|
+
<div id="project-navigation">
|
25
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
26
|
+
<h2>
|
27
|
+
<a href="../index.html" rel="home">Home</a>
|
28
|
+
</h2>
|
29
|
+
|
30
|
+
<div id="table-of-contents-navigation">
|
31
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
32
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
33
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
34
|
+
</div>
|
35
|
+
</div>
|
36
|
+
|
37
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
38
|
+
<form action="#" method="get" accept-charset="utf-8">
|
39
|
+
<div id="search-field-wrapper">
|
40
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
41
|
+
aria-autocomplete="list" aria-controls="search-results"
|
42
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
43
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<ul id="search-results" aria-label="Search Results"
|
47
|
+
aria-busy="false" aria-expanded="false"
|
48
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
49
|
+
</form>
|
50
|
+
</div>
|
51
|
+
|
52
|
+
</div>
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
<div id="class-metadata">
|
57
|
+
|
58
|
+
<div id="parent-class-section" class="nav-section">
|
59
|
+
<h3>Parent</h3>
|
60
|
+
|
61
|
+
|
62
|
+
<p class="link">Object
|
63
|
+
|
64
|
+
</div>
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
<!-- Method Quickref -->
|
69
|
+
<div id="method-list-section" class="nav-section">
|
70
|
+
<h3>Methods</h3>
|
71
|
+
|
72
|
+
<ul class="link-list" role="directory">
|
73
|
+
|
74
|
+
<li ><a href="#method-c-all">::all</a>
|
75
|
+
|
76
|
+
<li ><a href="#method-c-new">::new</a>
|
77
|
+
|
78
|
+
</ul>
|
79
|
+
</div>
|
80
|
+
|
81
|
+
</div>
|
82
|
+
</nav>
|
83
|
+
|
84
|
+
<main role="main" aria-labelledby="class-RanchManager::Hostname">
|
85
|
+
<h1 id="class-RanchManager::Hostname" class="class">
|
86
|
+
class RanchManager::Hostname
|
87
|
+
</h1>
|
88
|
+
|
89
|
+
<section class="description">
|
90
|
+
|
91
|
+
</section>
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
<section class="attribute-method-details" class="method-section">
|
105
|
+
<header>
|
106
|
+
<h3>Attributes</h3>
|
107
|
+
</header>
|
108
|
+
|
109
|
+
|
110
|
+
<div id="attribute-i-ip" class="method-detail">
|
111
|
+
<div class="method-heading attribute-method-heading">
|
112
|
+
<span class="method-name">ip</span><span
|
113
|
+
class="attribute-access-type">[RW]</span>
|
114
|
+
</div>
|
115
|
+
|
116
|
+
<div class="method-description">
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
</div>
|
121
|
+
</div>
|
122
|
+
|
123
|
+
<div id="attribute-i-name" class="method-detail">
|
124
|
+
<div class="method-heading attribute-method-heading">
|
125
|
+
<span class="method-name">name</span><span
|
126
|
+
class="attribute-access-type">[RW]</span>
|
127
|
+
</div>
|
128
|
+
|
129
|
+
<div class="method-description">
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
</div>
|
134
|
+
</div>
|
135
|
+
|
136
|
+
</section>
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
141
|
+
<header>
|
142
|
+
<h3>Public Class Methods</h3>
|
143
|
+
</header>
|
144
|
+
|
145
|
+
|
146
|
+
<div id="method-c-all" class="method-detail ">
|
147
|
+
|
148
|
+
<div class="method-heading">
|
149
|
+
<span class="method-name">all</span><span
|
150
|
+
class="method-args">()</span>
|
151
|
+
|
152
|
+
<span class="method-click-advice">click to toggle source</span>
|
153
|
+
|
154
|
+
</div>
|
155
|
+
|
156
|
+
|
157
|
+
<div class="method-description">
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
<div class="method-source-code" id="all-source">
|
165
|
+
<pre><span class="ruby-comment"># File lib/ranch-manager/hostname.rb, line 9</span>
|
166
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">all</span>
|
167
|
+
<span class="ruby-constant">YAML</span>.<span class="ruby-identifier">load_file</span>(<span class="ruby-constant">RanchManager</span><span class="ruby-operator">::</span><span class="ruby-constant">HOSTNAMES_FILE</span>).<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">split</span>
|
168
|
+
<span class="ruby-keyword">end</span></pre>
|
169
|
+
</div>
|
170
|
+
|
171
|
+
</div>
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
</div>
|
177
|
+
|
178
|
+
|
179
|
+
<div id="method-c-new" class="method-detail ">
|
180
|
+
|
181
|
+
<div class="method-heading">
|
182
|
+
<span class="method-name">new</span><span
|
183
|
+
class="method-args">(name, ip)</span>
|
184
|
+
|
185
|
+
<span class="method-click-advice">click to toggle source</span>
|
186
|
+
|
187
|
+
</div>
|
188
|
+
|
189
|
+
|
190
|
+
<div class="method-description">
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
<div class="method-source-code" id="new-source">
|
198
|
+
<pre><span class="ruby-comment"># File lib/ranch-manager/hostname.rb, line 4</span>
|
199
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">ip</span>)
|
200
|
+
<span class="ruby-ivar">@name</span> = <span class="ruby-identifier">name</span>
|
201
|
+
<span class="ruby-ivar">@ip</span> = <span class="ruby-identifier">ip</span>
|
202
|
+
<span class="ruby-keyword">end</span></pre>
|
203
|
+
</div>
|
204
|
+
|
205
|
+
</div>
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
</div>
|
211
|
+
|
212
|
+
|
213
|
+
</section>
|
214
|
+
|
215
|
+
</section>
|
216
|
+
</main>
|
217
|
+
|
218
|
+
|
219
|
+
<footer id="validator-badges" role="contentinfo">
|
220
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
221
|
+
<p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.1.0.
|
222
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
223
|
+
</footer>
|
224
|
+
|