ipcad2squid 1.1 → 1.1.1

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.
Files changed (3) hide show
  1. data/ipcad2squid.gemspec +1 -1
  2. data/lib/ipcad2squid.rb +10 -2
  3. metadata +1 -1
data/ipcad2squid.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'ipcad2squid'
3
- s.version = '1.1'
3
+ s.version = '1.1.1'
4
4
  s.date = '2013-01-03'
5
5
  s.summary = "Convert ipcad logs to squid logs"
6
6
  s.description = "Simple gem for converting and appending output from ipcad to squid logs formats"
data/lib/ipcad2squid.rb CHANGED
@@ -8,7 +8,11 @@ class Ipcad2squid
8
8
  @cmd2 = options[:cmd2] || 'netkit-rsh localhost show ip accounting checkpoint'
9
9
  @net = options[:net] || '192.168.0'
10
10
  @filename = options[:filename] || '/var/log/squid/access.log'
11
- @ttime = `#{@cmd1}`.split("\n").grep(/saved/) { |saved| saved.split.last }.first rescue '0'
11
+ begin
12
+ @ttime = `#{@cmd1}`.split("\n").grep(/saved/) { |saved| saved.split.last }.first
13
+ rescue
14
+ @ttime = '0'
15
+ end
12
16
  end
13
17
 
14
18
  def output
@@ -24,7 +28,11 @@ class Ipcad2squid
24
28
 
25
29
  def clear_accounting
26
30
  # move statistics to checkpoint and clear
27
- `netkit-rsh localhost clear ip accounting` rescue puts "Couldn't clear ip accounting"
31
+ begin
32
+ `netkit-rsh localhost clear ip accounting`
33
+ rescue
34
+ puts "Couldn't clear ip accounting"
35
+ end
28
36
  end
29
37
 
30
38
  def write_to_file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ipcad2squid
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.1'
4
+ version: 1.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: