mini_portile 0.7.0.rc3 → 0.7.0.rc4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b543ca78884927062b44e38c56d01e69b89bcb79
4
- data.tar.gz: 366e7c9a6610c2ad0d7df9d506cf039596ce4c4d
3
+ metadata.gz: 13e154f5ec48faf357e723128554adbf010dbb83
4
+ data.tar.gz: 2df757250068da8befe741764764c2c0d59bef16
5
5
  SHA512:
6
- metadata.gz: c5572f248c68e6139cbed61da20f3c680465eb1ce1e1f5936316f6d56a538e7d26aad85770d1dc37ad72fbe6fe5795349925bbb069e8b676e212710ed0276b95
7
- data.tar.gz: e99707c84d0149e132b27d5b17e1fee04cd281aa78c6a0ccc0bc643998fa4cba75ef750a7f95506e2e829b15751165d98d1fd4a12f2a5fab6d958eebed0fe87e
6
+ metadata.gz: 7a3abf6d4f20ed7202f9e821c46ccfc3a06bbbf2d2071108c04fee2a4240c8f277fc8f8f5a78f0be5cf8baad5bcca5622dde6db09813d636017c383709a701de
7
+ data.tar.gz: 1a6e61c274a691e8a7ec4d4f07c6d50db6c6d9e8992c8c0f657954fe5cc3f4156861387ec7bd1ec2855d7b3464ea2c8a188d133df9b7efb1a7610a49849e5ce8
@@ -8,8 +8,4 @@ rvm:
8
8
  - 2.2
9
9
  - ruby-head
10
10
  - jruby-1.7.22
11
- - jruby-9.0.0.0
12
-
13
- matrix:
14
- allow_failures:
15
- - rvm: jruby-9.0.0.0
11
+ - jruby-9.0.1.0
@@ -1,3 +1,8 @@
1
+ ### 0.7.0.rc4 / 2015-08-24
2
+
3
+ * Updated tests for Windows. No functional change. Final release candidate?
4
+
5
+
1
6
  ### 0.7.0.rc3 / 2015-08-24
2
7
 
3
8
  * Restore backwards-compatible behavior with respect to escaped strings.
@@ -8,6 +8,7 @@ require 'digest/md5'
8
8
  require 'open-uri'
9
9
  require 'cgi'
10
10
  require 'rbconfig'
11
+ require 'shellwords'
11
12
 
12
13
  # Monkey patch for Net::HTTP by ruby open-uri fix:
13
14
  # https://github.com/ruby/ruby/commit/58835a9
@@ -342,12 +343,12 @@ private
342
343
  pid = spawn(*args)
343
344
  Process.wait(pid)
344
345
  else
345
- if command.kind_of?(Array)
346
- system(*command)
347
- else
348
- redirected = %Q{#{command} > "#{log_out}" 2>&1}
349
- system(redirected)
350
- end
346
+ redirected = if command.kind_of?(Array)
347
+ %Q{#{command.map(&:shellescape).join(" ")} > #{log_out.shellescape} 2>&1}
348
+ else
349
+ %Q{#{command} > #{log_out.shellescape} 2>&1}
350
+ end
351
+ system redirected
351
352
  end
352
353
 
353
354
  if $?.success?
@@ -497,8 +498,8 @@ private
497
498
  end
498
499
 
499
500
  def unescape_options_from command
500
- return command unless unescape_commands
501
- [command].flatten.map do |opt|
501
+ return command unless unescape_commands && command.kind_of?(Array)
502
+ command.map do |opt|
502
503
  if opt =~ /\\/
503
504
  warn "NOTICE: MiniPortile: escaping shell characters is not necessary in MiniPortile 0.7.0+ (\"#{opt}\"). Set the `:unescape_commands` option to false if you actually want to preserve escapes."
504
505
  opt.gsub!(/\\/, "")
@@ -1,3 +1,3 @@
1
1
  class MiniPortile
2
- VERSION = "0.7.0.rc3"
2
+ VERSION = "0.7.0.rc4"
3
3
  end
@@ -8,10 +8,19 @@ class TestUnescapingCommands < TestCase
8
8
  end
9
9
  end
10
10
 
11
+ def is_windows
12
+ !! (RbConfig::CONFIG['target_os'] =~ /mingw32|mswin/)
13
+ end
14
+
11
15
  def echo_helper recipe, string
12
16
  FileUtils.mkdir_p File.join(recipe.send(:tmp_path), "workdir")
13
- recipe.send :execute, "echo", ["echo", "-en", string]
14
- File.read Dir.glob("tmp/**/echo.log").first
17
+ command = if is_windows
18
+ ["cmd", "/C", "echo", string]
19
+ else
20
+ ["/usr/bin/env", "echo", string]
21
+ end
22
+ recipe.send :execute, "echo", command
23
+ File.read(Dir.glob("tmp/**/echo.log").first).chop
15
24
  end
16
25
 
17
26
  def test_setting_unescape_to_true_unescapes_escaped_strings
@@ -21,7 +30,7 @@ class TestUnescapingCommands < TestCase
21
30
 
22
31
  def test_setting_unescape_to_false_does_not_touch_unescaped_strings
23
32
  recipe = MiniPortile.new("foo", "1.0", :unescape_commands => false)
24
- assert_equal "this\tthat", echo_helper(recipe, 'this\tthat')
33
+ assert_equal 'this\tthat', echo_helper(recipe, 'this\tthat')
25
34
  end
26
35
 
27
36
  def test_default_unescape_setting_is_true
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.7.0.rc3
4
+ version: 0.7.0.rc4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luis Lavena
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-09-03 00:00:00.000000000 Z
12
+ date: 2015-09-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler