immortalize 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/bin/immortalize +7 -7
  3. data/immortalize.gemspec +1 -1
  4. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
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]}\" 1>/dev/null 2>&1 | sh & echo $!") do |f|
119
+ open("|echo \"#{@reg[:command]}\" 1>/dev/null 2>&1 & echo $!") do |f|
120
120
  pid = f.sysread(5).chomp.to_i
121
121
  end
122
122
  # Log the pid
@@ -170,14 +170,14 @@ if ARGV[1].to_s.length > 1 && ARGV[1] !~ /^\d+$/
170
170
  last_cmd = cmds.pop
171
171
  lst,out_s = last_cmd.split(/(?: \d)? ?>/,2)
172
172
  cmds << lst
173
- outs = last_cmd.scan(/(?: \d)? ?> ?\S+/)
174
- outs = outs.map {|o| o.sub(/^ ?> ?/,">").sub(/^>/,"1>").sub(/^ /,'') }
173
+ outs = last_cmd.scan(/(?: \d)? ?>>? ?\S+/)
174
+ outs = outs.map {|o| o.sub(/^ ?(>>)? ?/,"\\1").sub(/^>/,"1>").sub(/^ /,'') }
175
175
  unless outs.any? {|o| o =~ /^2>/}
176
176
  warn "Appending default STDERR redirection: 2>&1 (STDERR > STDOUT)"
177
177
  outs << "2>&1"
178
178
  end
179
- unless outs.any? {|o| o =~ /^1?>/}
180
- warn "#{$command_string}\nInvalid command: You need to add proper STDOUT redirection, ex: > /dev/null or 1>log/run.log or 1 > log/run.log"
179
+ unless outs.any? {|o| o =~ /^1>/}
180
+ warn "#{$command_string}\nInvalid command: You need to add proper STDOUT redirection, ex: >/dev/null or 1>log/run.log"
181
181
  exit
182
182
  end
183
183
  $command_string = cmds.join('; ') + ' ' + outs.join(' ')
@@ -194,8 +194,8 @@ unless ::Object.const_defined?(:IRB)
194
194
  warn "Couldn't find installed version of the 'immortalize' command! (Try `which immortalize`)"
195
195
  exit
196
196
  end
197
- crons.reject! {|c| c =~ /immortalize > #{$log_location}\/cron.log/}
198
- crons << "* * * * * #{immortalize_cmd} > #{$log_location}/cron.log 2>&1\n"
197
+ crons.reject! {|c| c =~ /immortalize >> #{$log_location}\/cron.log/}
198
+ crons << "* * * * * #{immortalize_cmd} >> #{$log_location}/cron.log 2>&1\n"
199
199
  puts "Installing crons:\n\t#{crons.join("\n\t")}"
200
200
  f = IO.popen("crontab -", 'w')
201
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.3"
8
+ s.version = "0.1.4"
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
- - 3
9
- version: 0.1.3
8
+ - 4
9
+ version: 0.1.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - BehindLogic