Skip to content

Commit

Permalink
using Usagewacth module insted of original module
Browse files Browse the repository at this point in the history
  • Loading branch information
rderoldan1 committed Jul 25, 2013
1 parent e8e0bb4 commit cbf1041
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion examples/mac_example.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

require 'usagewatch_ext'

usw = UsagewatchExt
usw = Usagewatch

puts "#{usw.uw_diskused} Gigabytes Used"
puts "#{usw.uw_diskused_perc} Percentage of Gigabytes Used"
Expand Down
1 change: 1 addition & 0 deletions lib/usagewatch_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module UsagewatchExt
puts "Mac version is under development"
elsif os.include? "linux"
require "usagewatch/linux"
UsagewatchExt = Usagewatch
elsif os =~ /cygwin|mswin|mingw|bccwin|wince|emx/
puts "Windows" + text
else
Expand Down
2 changes: 1 addition & 1 deletion lib/usagewatch_ext/mac.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module UsagewatchExt
module Usagewatch

# Show disk used in GB
def self.uw_diskused
Expand Down
File renamed without changes.
16 changes: 8 additions & 8 deletions spec/mac_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
if os.include? "darwin"
describe 'IncludeLibrary' do
it 'should include the library' do
a = UsagewatchExt
a.should be UsagewatchExt
a = Usagewatch
a.should be Usagewatch
end
end

describe 'DiskUsage' do
it "should be the GB of disk used" do
a = UsagewatchExt.uw_diskused
a = Usagewatch.uw_diskused
a.class.should be(Float)
a.should_not be_nil
a.should be >= 0
Expand All @@ -21,7 +21,7 @@

describe 'CPUUsage' do
it "should be the percentage of cpu used" do
a = UsagewatchExt.uw_cpuused
a = Usagewatch.uw_cpuused
a.class.should be(Float)
a.should_not be_nil
a.should be <= 100
Expand All @@ -31,7 +31,7 @@

describe 'PercentageDiskUsage' do
it "should be the percentage of GB of disk used" do
a = UsagewatchExt.uw_diskused_perc
a = Usagewatch.uw_diskused_perc
a.class.should be(Float)
a.should_not be_nil
a.should be <= 100
Expand All @@ -41,7 +41,7 @@

describe 'LoadAverage' do
it "should be the average load of the past minute" do
a = UsagewatchExt.uw_load
a = Usagewatch.uw_load
a.class.should be(Float)
a.should_not be_nil
a.should be >= 0
Expand All @@ -50,7 +50,7 @@

describe 'TopCPUUsage' do
it "should be an array of top cpu consumption proccesses " do
a = UsagewatchExt.uw_cputop
a = Usagewatch.uw_cputop
a.class.should be(Array )
a.should_not be_nil
a[0][0].class.should be String
Expand All @@ -61,7 +61,7 @@

describe 'TopMEMUsage' do
it "should be an array of top mem consumption proccesses " do
a = UsagewatchExt.uw_cputop
a = Usagewatch.uw_cputop
a.class.should be(Array )
a.should_not be_nil
a[0][0].class.should be String
Expand Down
2 changes: 1 addition & 1 deletion spec/version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

describe 'Version' do
it 'should be the version number' do
a = Usagewatch::VERSION
a = UsagewatchExt::VERSION
a.class.should be(String)
a.should_not be_nil
end
Expand Down

0 comments on commit cbf1041

Please sign in to comment.