metabuild 0.3.1 → 0.3.2

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/Rakefile +1 -1
  2. data/lib/metabuild.rb +10 -10
  3. data/metabuild.gemspec +2 -2
  4. metadata +3 -3
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('metabuild', '0.3.1') do |s|
5
+ Echoe.new('metabuild', '0.3.2') do |s|
6
6
  s.author = "F. Brault"
7
7
  s.email = "castorpilot@yahoo.com"
8
8
  s.description = "MetaBuild is a ruby make-like tool that builds components. It supports tracking of dependencies among components, and a hierarchical reporting facility."
@@ -567,34 +567,34 @@ module Metabuild
567
567
 
568
568
  def setup_script(cmd, env)
569
569
  file = Tempfile.new("output")
570
- file.close
571
570
  script = Tempfile.new("script")
572
571
  if @has_bash
573
572
  script.puts "exec > >(tee #{file.path}) 2>&1" # Redirect output to tmpfile + tee
573
+ shell = "bash "
574
574
  else
575
575
  script.puts "exec > #{file.path} 2>&1" # Redirect output to tmpfile
576
+ shell = "sh "
576
577
  end
577
578
  env.each { |k, v| script.puts "export #{k}=#{v}"}
578
579
  script.puts cmd
579
- script.close
580
- return script.path, file.path
580
+ script.flush
581
+ return script, file, shell
581
582
  end
582
583
 
583
584
  def env_system(cmd, env)
584
- script, file = setup_script(cmd, env)
585
+ script, file, shell = setup_script(cmd, env)
585
586
  puts "@@@@@@@@@@@ Running #{cmd} @@@@@@@@@@@@@"
586
- shell = @has_bash ? "bash " : "sh "
587
- success = system(shell + script)
588
- output = File.new(file).read.strip
589
- File.delete script
590
- File.delete file
587
+ success = system(shell + script.path)
588
+ output = file.read.strip
589
+ script.close
590
+ file.close
591
591
  return success, output
592
592
  end
593
593
 
594
594
  def env_spawn(cmd, env, fail_msg = "", success_msg = "")
595
595
  script, file, shell = setup_script(cmd, env)
596
596
  puts "@@@@@@@@@@@ Running #{cmd} in background @@@@@@@@@@@@@"
597
- pid = spawn(shell + script)
597
+ pid = spawn(shell + script.path)
598
598
  return [pid, file, script, cmd, fail_msg, success_msg]
599
599
  end
600
600
 
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{metabuild}
5
- s.version = "0.3.1"
5
+ s.version = "0.3.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["F. Brault"]
9
- s.date = %q{2010-05-25}
9
+ s.date = %q{2010-05-28}
10
10
  s.description = %q{MetaBuild is a ruby make-like tool that builds components. It supports tracking of dependencies among components, and a hierarchical reporting facility.}
11
11
  s.email = %q{castorpilot@yahoo.com}
12
12
  s.extra_rdoc_files = ["README", "lib/metabuild.rb"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 1
9
- version: 0.3.1
8
+ - 2
9
+ version: 0.3.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - F. Brault
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-05-25 00:00:00 +02:00
17
+ date: 2010-05-28 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies: []
20
20