swiss_admin 0.6.1 → 0.7.0

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: 63eff973bde4a3cbdc4db697e985346757472687
4
- data.tar.gz: 5daea5b752c885c7539c7289cbb9c9da2bf287c2
3
+ metadata.gz: 4a629a910831c07e9a07e3bdc9479977dd658aae
4
+ data.tar.gz: 7e84d4ff6947116fc8a06e4f13d3580356fe4ce8
5
5
  SHA512:
6
- metadata.gz: 4a469600791cf64ef5d448c4da69a8cdedcb65de6b0afaee0e63e376153451fba0f3be6dda574a77dc4fd021cedc3ad3ac45a1bfed4b2d42ec39dfb70472fc76
7
- data.tar.gz: abd5c1846b50ea41da4b414720e98e86f702f49b9f62fd2ca27ad5aa0f3a15a8292f14a6c4ca43e6da8af44c0d52fc207e1352e190a1e9514a71a397466bf3e7
6
+ metadata.gz: a355e2423ef7eff8298a2c9663e3c917813ad88240e5a2b94ac60ca900f6a134d87a7441cfaf62a265c4003549bcdde928f6122e90e6bc760b3aaee3946a80e5
7
+ data.tar.gz: 2029af073e0b518cb8823a4f6fd803f2cb1afd7fd5bc652d9b067655f0509c7f84d9b1b4dd869a0fb7b00330f48e38e7b3c567df4819d30205033b9e776a5275
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+ sudo: false
3
+ rvm:
4
+ - "1.9.3"
5
+ - "2.1.0"
6
+ - "2.2.0"
7
+ script: bundle exec rake test
data/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ ## CHANGELOG
2
+
3
+ ### 0.7.0
4
+
5
+ * Fix path issue for web host_info.
6
+ * Fix web host_info tests.
7
+ * Fix layout title.
8
+ * Fix bug where pidfile was not getting set from method_options.
data/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # SwissAdmin
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/swiss_admin.svg)](http://badge.fury.io/rb/swiss_admin)
4
+
5
+ [![Build Status](https://travis-ci.org/bradleyd/swiss_admin.svg)](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. Provides a DRb server to query host for information. (see todo)
16
- 4. Everytime you use it puppies and rainbows shoot into the sky.
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
@@ -4,5 +4,5 @@ require 'rake/testtask'
4
4
  Rake::TestTask.new do |t|
5
5
  t.options = "-v"
6
6
  t.libs << "test"
7
- t.test_files = FileList["test/*_test.rb", "test/cli/*_test.rb"]
7
+ t.test_files = FileList["test/*_test.rb", "test/cli/*_test.rb", "test/web/test_*.rb"]
8
8
  end
@@ -31,7 +31,7 @@ module SwissAdmin
31
31
  $stdout.puts "Starting..."
32
32
  Rack::Server.start(app: SwissAdmin::HostInfo,
33
33
  daemonize: true,
34
- pid: options[:pid_file],
34
+ pid: options[:pid_file] || "/tmp/swissadmin.pid",
35
35
  Port: options[:port])
36
36
  end
37
37
 
@@ -1,3 +1,3 @@
1
1
  module SwissAdmin
2
- VERSION = "0.6.1"
2
+ VERSION = "0.7.0"
3
3
  end
@@ -24,7 +24,7 @@ module SwissAdmin
24
24
  "hello world"
25
25
  end
26
26
 
27
- get "/info" do
27
+ get "/host_info" do
28
28
  @memory = SwissAdmin::Hardware.memory
29
29
  @host_name = SwissAdmin::Host.name
30
30
  @users = SwissAdmin::User.active
@@ -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>Sensu Portal</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
@@ -1,6 +1,6 @@
1
1
  require_relative "../test_helper"
2
2
 
3
- class HostInfoAPITest < MiniTest::Unit::TestCase
3
+ class HostWebAPITest < Minitest::Test
4
4
  include Rack::Test::Methods
5
5
 
6
6
  def app
@@ -1,6 +1,6 @@
1
1
  require_relative "../test_helper"
2
2
 
3
- class HostInfoTest < MiniTest::Unit::TestCase
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:/ , last_response.body
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:/ , last_response.body
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:/ , last_response.body
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 Cpus:/ , last_response.body
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 Addresses:/ , last_response.body
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.6.1
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