ServState 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 87c031d696bbfdc9ce8ec611fc1edb4a9857a54e
4
- data.tar.gz: 15578dabb6fdea0aabf1693dbbbce6b5a0c84475
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ M2FjZGFiMjAzMjY2ZGQ4NWFjNjA5MmZlYzU1MDQ0YjczOTVkODI0Ng==
5
+ data.tar.gz: !binary |-
6
+ N2QwOGUzMjc1Yjk4MTI0ZWM3NDA4MWI0YTAyMWU1ZTcyNDIwN2FmNw==
5
7
  SHA512:
6
- metadata.gz: dc65f5668264217b337da72f61651aa799ec06833dd74d2496d11b0cf061979671d6808ca375629234c8de4e37570b4bf1defe967adb98434a646683cb1ac813
7
- data.tar.gz: 757b2179c1831de7fe0bd42b048035cecd6019de9dfcd6ac01fc92f2afb714b8b54ef16d7b1509ba5ce874991911bcb2dc9d9d639d85ca9eacf8f1e705644f36
8
+ metadata.gz: !binary |-
9
+ NTI2Y2I4N2Y1MzczZjRhMDE5NjEwODdkMWFmNWJmNjU1OGM4NThlOTI1OGU0
10
+ NTBlY2M2MDc2NDU0ZjRhMmZiZGRjOGM1OTc1YWQzMmU3ODdjOTU5NjQ1ZmRl
11
+ MmExNzQ5YTFmNGIwYjcwMTA5NDkyZDFjMWYwZjQ2YWM3NGMzNjI=
12
+ data.tar.gz: !binary |-
13
+ OTRmM2E5ODM5N2VmOGY3ZWM5Y2Y3OWM1Nzc4ODk3YmQxYzhhYjc1YTFjNWI3
14
+ NDM1ZjFjMmI3OWU4ZmQ0YTRkNGM1ZDFmMmNhOTc4ODE2MzYwYjBhMzdiZjZh
15
+ MTZhYTQ1MTg4YTA5OWI5MDk0YTVjYWVhMzQyMzRhNzMxYWQ1ZjM=
data/.gitignore CHANGED
@@ -5,6 +5,7 @@
5
5
  .yardoc
6
6
  .rspec
7
7
  .rvmrc
8
+ .coveralls.yml
8
9
  Gemfile.lock
9
10
  InstalledFiles
10
11
  _yardoc
data/.travis.yml CHANGED
@@ -2,9 +2,10 @@ bundler_args: --without dev
2
2
  rvm:
3
3
  - 2.0.0
4
4
  - 2.1.0
5
+ - 1.9.3
5
6
 
6
7
  branches:
7
8
  only:
8
9
  - master
9
10
  - dev
10
- script: xvfb-run rspec
11
+ script: xvfb-run rspec
data/README.md CHANGED
@@ -4,7 +4,7 @@ Very simple tool to watch your LINUX server status.
4
4
  [Demo page](http://162.243.90.233:8080/)
5
5
 
6
6
  [![Gem Version](https://badge.fury.io/rb/ServState.png)](http://badge.fury.io/rb/ServState)
7
- [![Build Status](https://travis-ci.org/ololyay/ServState.png?branch=dev)](https://travis-ci.org/ololyay/ServState)
7
+ [![Build Status](https://travis-ci.org/ololyay/ServState.png?branch=master)](https://travis-ci.org/ololyay/ServState)
8
8
 
9
9
  ## Installation
10
10
 
data/ServState.gemspec CHANGED
@@ -28,5 +28,6 @@ Gem::Specification.new do |spec|
28
28
  spec.add_development_dependency "rspec"
29
29
  spec.add_development_dependency "capybara"
30
30
  spec.add_development_dependency "capybara-webkit"
31
+ spec.add_development_dependency "coveralls"
31
32
 
32
33
  end
@@ -1,7 +1,7 @@
1
1
  module ServState
2
2
  class NetworkUsage
3
3
 
4
- BYTES_IN_MB = 1048576
4
+ BYTES_IN_KB = 1024
5
5
 
6
6
  attr_reader :speeds
7
7
 
@@ -15,8 +15,8 @@ module ServState
15
15
  down = values[0] - @old_traffic[interface][0]
16
16
  up = values[1] - @old_traffic[interface][1]
17
17
 
18
- down_speed = (down / BYTES_IN_MB / time_diff).round(2)
19
- up_speed = (up / BYTES_IN_MB / time_diff).round(2)
18
+ down_speed = (down / BYTES_IN_KB / time_diff).round(2)
19
+ up_speed = (up / BYTES_IN_KB / time_diff).round(2)
20
20
 
21
21
  @speeds[interface] = [down_speed, up_speed]
22
22
  end
@@ -31,7 +31,7 @@ function renew(){
31
31
  var interfaces=[]
32
32
  $.each(data.network, function(key, value){
33
33
  ip=(data.interfaces[key])?(data.interfaces[key]):('');
34
- interfaces.push('<div class="uk-width-medium-1-4"><div class="uk-panel uk-panel-box"><p><span class="uk-text-bold">'+key+' </span><span id="ram" class="uk-text-muted">'+ip+'</span></p><p class="uk-text-info">Down: '+value[0]+'Mbps</p><p class="uk-text-success">Up: '+value[1]+'Mbps</p></div></div>');
34
+ interfaces.push('<div class="uk-width-medium-1-4"><div class="uk-panel uk-panel-box"><p><span class="uk-text-bold">'+key+' </span><span id="ram" class="uk-text-muted">'+ip+'</span></p><p class="uk-text-info">Down: '+value[0]+'Kbps</p><p class="uk-text-success">Up: '+value[1]+'Kbps</p></div></div>');
35
35
  });
36
36
  $('#traffic').html(interfaces.join(''));
37
37
  removeNotify($('#notification'));
@@ -13,7 +13,7 @@ module ServState
13
13
  # TODO: rewrite without using ifconfig
14
14
  def interfaces
15
15
  ifconfig_output = `ifconfig -a`
16
- ifconfig_lines = ifconfig_output.lines.map{ |line| line.chomp }
16
+ ifconfig_lines = ifconfig_output.split("\n").map{ |line| line.chomp }
17
17
 
18
18
  faces = Hash.new
19
19
  name = ''
@@ -45,7 +45,7 @@ module ServState
45
45
  usage = Hash.new
46
46
 
47
47
  # grep lines with physical devices
48
- df_output = `df`.lines.grep(/^\/dev/)
48
+ df_output = `df`.split("\n").grep(/^\/dev/)
49
49
 
50
50
  # Filesystem 1K-blocks Used Available Use% Mounted on
51
51
  # /dev/sda5 36462184 11383116 23226860 33% /
@@ -74,7 +74,7 @@ module ServState
74
74
  def ram_usage
75
75
  usage = Hash.new
76
76
 
77
- free_output = `free`.lines
77
+ free_output = `free`.split("\n")
78
78
 
79
79
  total_ram = (free_output[1].split[1].to_f / KB_IN_GB).round(2)
80
80
  used_ram = (free_output[2].split[2].to_f / KB_IN_GB).round(2)
@@ -1,3 +1,3 @@
1
1
  module ServState
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'coveralls'
2
+ Coveralls.wear!
1
3
  require 'capybara/rspec'
2
4
  require 'capybara-webkit'
3
5
  require './lib/ServState'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ServState
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Sergienko
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-03-17 00:00:00.000000000 Z
12
+ date: 2014-03-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra
@@ -71,56 +71,70 @@ dependencies:
71
71
  name: rake
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - '>='
74
+ - - ! '>='
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - '>='
81
+ - - ! '>='
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: rspec
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - '>='
88
+ - - ! '>='
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0'
91
91
  type: :development
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - '>='
95
+ - - ! '>='
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: capybara
100
100
  requirement: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - '>='
102
+ - - ! '>='
103
103
  - !ruby/object:Gem::Version
104
104
  version: '0'
105
105
  type: :development
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
- - - '>='
109
+ - - ! '>='
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
112
  - !ruby/object:Gem::Dependency
113
113
  name: capybara-webkit
114
114
  requirement: !ruby/object:Gem::Requirement
115
115
  requirements:
116
- - - '>='
116
+ - - ! '>='
117
117
  - !ruby/object:Gem::Version
118
118
  version: '0'
119
119
  type: :development
120
120
  prerelease: false
121
121
  version_requirements: !ruby/object:Gem::Requirement
122
122
  requirements:
123
- - - '>='
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: coveralls
128
+ requirement: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ! '>='
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ type: :development
134
+ prerelease: false
135
+ version_requirements: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - ! '>='
124
138
  - !ruby/object:Gem::Version
125
139
  version: '0'
126
140
  description: Simple tool to watch your linux server state
@@ -180,17 +194,17 @@ require_paths:
180
194
  - lib
181
195
  required_ruby_version: !ruby/object:Gem::Requirement
182
196
  requirements:
183
- - - '>='
197
+ - - ! '>='
184
198
  - !ruby/object:Gem::Version
185
199
  version: '0'
186
200
  required_rubygems_version: !ruby/object:Gem::Requirement
187
201
  requirements:
188
- - - '>='
202
+ - - ! '>='
189
203
  - !ruby/object:Gem::Version
190
204
  version: '0'
191
205
  requirements: []
192
206
  rubyforge_project:
193
- rubygems_version: 2.2.1
207
+ rubygems_version: 2.2.2
194
208
  signing_key:
195
209
  specification_version: 4
196
210
  summary: http://github.com/ololyay/ServState