mini_portile 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/History.txt +5 -0
  2. data/Rakefile +1 -1
  3. data/lib/mini_portile.rb +19 -3
  4. metadata +3 -3
@@ -1,3 +1,8 @@
1
+ === 0.5.1 / 2013-07-07
2
+
3
+ * Bugfixes:
4
+ * Detect tar executable without shelling out. [jtimberman]
5
+
1
6
  === 0.5.0 / 2012-11-17
2
7
 
3
8
  * Enhancements:
data/Rakefile CHANGED
@@ -4,7 +4,7 @@ require "rubygems/package_task"
4
4
  GEM_SPEC = Gem::Specification.new do |s|
5
5
  # basic information
6
6
  s.name = "mini_portile"
7
- s.version = "0.5.0"
7
+ s.version = "0.5.1"
8
8
  s.platform = Gem::Platform::RUBY
9
9
 
10
10
  # description and details
@@ -40,7 +40,7 @@ class MiniPortile
40
40
  next unless File.exists?(full_path)
41
41
  output "Running git apply with #{full_path}..."
42
42
  execute('patch', %Q(git apply #{full_path}))
43
- end
43
+ end
44
44
  end
45
45
 
46
46
  def configure_options
@@ -186,11 +186,27 @@ private
186
186
 
187
187
  def tar_exe
188
188
  @@tar_exe ||= begin
189
- dev_null = RbConfig::CONFIG['host_os'] =~ /mingw|mswin/ ? 'NUL' : '/dev/null'
190
189
  %w[tar bsdtar basic-bsdtar].find { |c|
191
- system("#{c} --version >> #{dev_null} 2>&1")
190
+ which(c)
191
+ }
192
+ end
193
+ end
194
+
195
+ # From: http://stackoverflow.com/a/5471032/7672
196
+ # Thanks, Mislav!
197
+ #
198
+ # Cross-platform way of finding an executable in the $PATH.
199
+ #
200
+ # which('ruby') #=> /usr/bin/ruby
201
+ def which(cmd)
202
+ exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
203
+ ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
204
+ exts.each { |ext|
205
+ exe = File.join(path, "#{cmd}#{ext}")
206
+ return exe if File.executable? exe
192
207
  }
193
208
  end
209
+ return nil
194
210
  end
195
211
 
196
212
  def detect_host
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mini_portile
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-17 00:00:00.000000000 Z
12
+ date: 2013-07-07 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Simplistic port-like solution for developers. It provides a standard
15
15
  and simplified way to compile against dependency libraries without messing up your
@@ -53,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
53
53
  version: 1.3.5
54
54
  requirements: []
55
55
  rubyforge_project:
56
- rubygems_version: 1.8.24
56
+ rubygems_version: 1.8.25
57
57
  signing_key:
58
58
  specification_version: 3
59
59
  summary: Simplistic port-like solution for developers