immortalize 0.1.2 → 0.1.3

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 (4) hide show
  1. data/VERSION +1 -1
  2. data/bin/immortalize +4 -5
  3. data/immortalize.gemspec +1 -1
  4. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
data/bin/immortalize CHANGED
@@ -116,7 +116,7 @@ class Immortal
116
116
  def start!
117
117
  # Run the command and gather the pid
118
118
  pid = nil
119
- open("|echo \"#{@reg[:command]}\" | sh & echo $!") do |f|
119
+ open("|echo \"#{@reg[:command]}\" 1>/dev/null 2>&1 | sh & echo $!") do |f|
120
120
  pid = f.sysread(5).chomp.to_i
121
121
  end
122
122
  # Log the pid
@@ -164,7 +164,6 @@ end
164
164
 
165
165
  # Curate the command string
166
166
  if ARGV[1].to_s.length > 1 && ARGV[1] !~ /^\d+$/
167
- puts ARGV.inspect
168
167
  $command_string = ARGV[1]
169
168
  # Complain about the string if it does not have proper output redirections
170
169
  cmds = $command_string.split(/; ?/)
@@ -172,7 +171,7 @@ if ARGV[1].to_s.length > 1 && ARGV[1] !~ /^\d+$/
172
171
  lst,out_s = last_cmd.split(/(?: \d)? ?>/,2)
173
172
  cmds << lst
174
173
  outs = last_cmd.scan(/(?: \d)? ?> ?\S+/)
175
- outs = outs.map {|o| o.sub(/ ?> ?/,">").sub(/^>/,"1>") }
174
+ outs = outs.map {|o| o.sub(/^ ?> ?/,">").sub(/^>/,"1>").sub(/^ /,'') }
176
175
  unless outs.any? {|o| o =~ /^2>/}
177
176
  warn "Appending default STDERR redirection: 2>&1 (STDERR > STDOUT)"
178
177
  outs << "2>&1"
@@ -195,8 +194,8 @@ unless ::Object.const_defined?(:IRB)
195
194
  warn "Couldn't find installed version of the 'immortalize' command! (Try `which immortalize`)"
196
195
  exit
197
196
  end
198
- crons.reject! {|c| c =~ /immortalize > #{$log_location}\/cron.log$/}
199
- crons << "* * * * * #{immortalize_cmd} > #{$log_location}/cron.log\n"
197
+ crons.reject! {|c| c =~ /immortalize > #{$log_location}\/cron.log/}
198
+ crons << "* * * * * #{immortalize_cmd} > #{$log_location}/cron.log 2>&1\n"
200
199
  puts "Installing crons:\n\t#{crons.join("\n\t")}"
201
200
  f = IO.popen("crontab -", 'w')
202
201
  f << crons.join("\n")
data/immortalize.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{immortalize}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["BehindLogic"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 2
9
- version: 0.1.2
8
+ - 3
9
+ version: 0.1.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - BehindLogic