swiss_admin 0.6.1 → 0.7.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.
- checksums.yaml +4 -4
- data/.travis.yml +7 -0
- data/CHANGELOG.md +8 -0
- data/README.md +18 -9
- data/Rakefile +1 -1
- data/lib/swiss_admin/cli/web_cli.rb +1 -1
- data/lib/swiss_admin/version.rb +1 -1
- data/lib/swiss_admin/web/app.rb +1 -1
- data/lib/swiss_admin/web/views/layout.erb +1 -1
- data/test/web/test_api.rb +1 -1
- data/test/web/test_host_info.rb +6 -11
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a629a910831c07e9a07e3bdc9479977dd658aae
|
4
|
+
data.tar.gz: 7e84d4ff6947116fc8a06e4f13d3580356fe4ce8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a355e2423ef7eff8298a2c9663e3c917813ad88240e5a2b94ac60ca900f6a134d87a7441cfaf62a265c4003549bcdde928f6122e90e6bc760b3aaee3946a80e5
|
7
|
+
data.tar.gz: 2029af073e0b518cb8823a4f6fd803f2cb1afd7fd5bc652d9b067655f0509c7f84d9b1b4dd869a0fb7b00330f48e38e7b3c567df4819d30205033b9e776a5275
|
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# SwissAdmin
|
2
2
|
|
3
|
+
[](http://badge.fury.io/rb/swiss_admin)
|
4
|
+
|
5
|
+
[](https://travis-ci.org/bradleyd/swiss_admin)
|
6
|
+
|
3
7
|
A generous, but not too bloated, system/host helpers for any self respecting system administrator ;)
|
4
8
|
|
5
9
|
SwissAdmin can either be included in your project or can used from the CLI.
|
@@ -12,8 +16,9 @@ I find it best to install swissadmin in your global gemset.
|
|
12
16
|
|
13
17
|
1. It offers just the right amount of information about the system/host your are running it on.
|
14
18
|
2. Provides a web server for REST calls.
|
15
|
-
3.
|
16
|
-
4.
|
19
|
+
3. Pretty simple to add new commands
|
20
|
+
4. Provides a DRb server to query host for information. (see todo)
|
21
|
+
5. Everytime you use it puppies and rainbows shoot into the sky.
|
17
22
|
|
18
23
|
There a tons of tools that do similar stuff, but I find them to contain way to much information.
|
19
24
|
I do not have the brain capacity to remember all those arguments and parsing features.
|
@@ -163,15 +168,9 @@ Every CLI command can be accessed via the REST API
|
|
163
168
|
```ruby
|
164
169
|
curl localhost:8080/api/host/loadavg #=> {"load_average":"0.29 0.29 0.28 2/972 27659\n"}
|
165
170
|
```
|
166
|
-
## Contributing
|
167
|
-
|
168
|
-
1. Fork it
|
169
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
170
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
171
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
172
|
-
5. Create new Pull Request
|
173
171
|
|
174
172
|
## Add a new command
|
173
|
+
|
175
174
|
### This is a work in progress and might not be worth a dam
|
176
175
|
|
177
176
|
To add a new command you must understand the directory structures of ```lib/``` and ```cli/```
|
@@ -273,3 +272,13 @@ swissadmin foo answer #=> 42
|
|
273
272
|
* Show all commands available in CLI
|
274
273
|
* Show all commands available in Web
|
275
274
|
* Write pid, port file path to `~/.swissadmin/.web.conf
|
275
|
+
|
276
|
+
## Contributing
|
277
|
+
|
278
|
+
1. Fork it
|
279
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
280
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
281
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
282
|
+
5. Create new Pull Request
|
283
|
+
|
284
|
+
|
data/Rakefile
CHANGED
data/lib/swiss_admin/version.rb
CHANGED
data/lib/swiss_admin/web/app.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2
2
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
3
3
|
<head>
|
4
|
-
<title>
|
4
|
+
<title>SwissAdmin</title>
|
5
5
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
6
|
<meta name="description" content="SwissAdmin" />
|
7
7
|
<link rel="stylesheet" type="text/css" href="/css/base.css" />
|
data/test/web/test_api.rb
CHANGED
data/test/web/test_host_info.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require_relative "../test_helper"
|
2
2
|
|
3
|
-
class HostInfoTest <
|
3
|
+
class HostInfoTest < Minitest::Test
|
4
4
|
include Rack::Test::Methods
|
5
5
|
|
6
6
|
def app
|
@@ -10,35 +10,30 @@ class HostInfoTest < MiniTest::Unit::TestCase
|
|
10
10
|
def test_it_retruns_hardware_info
|
11
11
|
get '/host_info'
|
12
12
|
assert last_response.ok?
|
13
|
-
assert_match /Memory Total
|
13
|
+
assert_match /Memory Total/ , last_response.body
|
14
14
|
end
|
15
15
|
|
16
16
|
def test_it_retruns_host_name
|
17
17
|
get '/host_info'
|
18
18
|
assert last_response.ok?
|
19
|
-
assert_match /Host Name
|
19
|
+
assert_match /Host Name/ , last_response.body
|
20
20
|
end
|
21
21
|
|
22
22
|
def test_it_retruns_host_load
|
23
23
|
get '/host_info'
|
24
24
|
assert last_response.ok?
|
25
|
-
assert_match /Load Average
|
25
|
+
assert_match /Load Average/ , last_response.body
|
26
26
|
end
|
27
27
|
|
28
28
|
def test_it_retruns_hardware_cpus
|
29
29
|
get '/host_info'
|
30
30
|
assert last_response.ok?
|
31
|
-
assert_match /Total
|
31
|
+
assert_match /Total CPUS/ , last_response.body
|
32
32
|
end
|
33
33
|
|
34
34
|
def test_it_retruns_network_ipaddresses
|
35
35
|
get '/host_info'
|
36
36
|
assert last_response.ok?
|
37
|
-
assert_match /IP
|
37
|
+
assert_match /IP Address/ , last_response.body
|
38
38
|
end
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
39
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swiss_admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bradley Smith
|
@@ -131,6 +131,8 @@ extensions: []
|
|
131
131
|
extra_rdoc_files: []
|
132
132
|
files:
|
133
133
|
- ".gitignore"
|
134
|
+
- ".travis.yml"
|
135
|
+
- CHANGELOG.md
|
134
136
|
- Gemfile
|
135
137
|
- LICENSE.txt
|
136
138
|
- README.md
|