mini_portile 0.7.0.rc2 → 0.7.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/README.md +1 -1
- data/appveyor.yml +6 -6
- data/lib/mini_portile/mini_portile.rb +18 -2
- data/lib/mini_portile/version.rb +1 -1
- data/test/test_unescaping_commands.rb +31 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b543ca78884927062b44e38c56d01e69b89bcb79
|
4
|
+
data.tar.gz: 366e7c9a6610c2ad0d7df9d506cf039596ce4c4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5572f248c68e6139cbed61da20f3c680465eb1ce1e1f5936316f6d56a538e7d26aad85770d1dc37ad72fbe6fe5795349925bbb069e8b676e212710ed0276b95
|
7
|
+
data.tar.gz: e99707c84d0149e132b27d5b17e1fee04cd281aa78c6a0ccc0bc643998fa4cba75ef750a7f95506e2e829b15751165d98d1fd4a12f2a5fab6d958eebed0fe87e
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
### 0.7.0.rc3 / 2015-08-24
|
2
|
+
|
3
|
+
* Restore backwards-compatible behavior with respect to escaped strings.
|
4
|
+
|
5
|
+
|
6
|
+
### 0.7.0.rc2 / 2015-08-24
|
7
|
+
|
8
|
+
* Restore support for Ruby 1.9.2
|
9
|
+
* Add Ruby 2.0.0 and Ruby 2.1.x to Appveyor suite
|
10
|
+
|
11
|
+
|
1
12
|
### 0.7.0.rc1 / 2015-08-24
|
2
13
|
|
3
14
|
Many thanks to @larskanis, @knu, and @kirikak2, who all contributed
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# MiniPortile
|
2
2
|
|
3
3
|
[![travis status](https://travis-ci.org/flavorjones/mini_portile.svg?branch=master)](https://travis-ci.org/flavorjones/mini_portile?branch=master)
|
4
|
-
[![appveyor status](https://ci.appveyor.com/api/projects/status/
|
4
|
+
[![appveyor status](https://ci.appveyor.com/api/projects/status/509669xx1qlhqqab/branch/master?svg=true)](https://ci.appveyor.com/project/flavorjones/mini-portile/branch/master)
|
5
5
|
|
6
6
|
* Documentation: http://www.rubydoc.info/github/flavorjones/mini_portile
|
7
7
|
* Source Code: https://github.com/flavorjones/mini_portile
|
data/appveyor.yml
CHANGED
@@ -15,10 +15,10 @@ test_script:
|
|
15
15
|
|
16
16
|
environment:
|
17
17
|
matrix:
|
18
|
-
- ruby_version: "193"
|
19
|
-
- ruby_version: "200"
|
20
|
-
- ruby_version: "200-x64"
|
21
|
-
- ruby_version: "21"
|
22
|
-
- ruby_version: "21-x64"
|
23
|
-
- ruby_version: "22"
|
24
18
|
- ruby_version: "22-x64"
|
19
|
+
- ruby_version: "22"
|
20
|
+
- ruby_version: "21-x64"
|
21
|
+
- ruby_version: "21"
|
22
|
+
- ruby_version: "200-x64"
|
23
|
+
- ruby_version: "200"
|
24
|
+
- ruby_version: "193"
|
@@ -28,11 +28,11 @@ class Net::HTTP
|
|
28
28
|
end
|
29
29
|
|
30
30
|
class MiniPortile
|
31
|
-
attr_reader :name, :version, :original_host
|
31
|
+
attr_reader :name, :version, :original_host, :unescape_commands
|
32
32
|
attr_writer :configure_options
|
33
33
|
attr_accessor :host, :files, :patch_files, :target, :logger
|
34
34
|
|
35
|
-
def initialize(name, version)
|
35
|
+
def initialize(name, version, options={})
|
36
36
|
@name = name
|
37
37
|
@version = version
|
38
38
|
@target = 'ports'
|
@@ -42,6 +42,8 @@ class MiniPortile
|
|
42
42
|
@logger = STDOUT
|
43
43
|
|
44
44
|
@original_host = @host = detect_host
|
45
|
+
|
46
|
+
@unescape_commands = options.fetch(:unescape_commands) { true }
|
45
47
|
end
|
46
48
|
|
47
49
|
def download
|
@@ -333,6 +335,8 @@ private
|
|
333
335
|
message "Running '#{action}' for #{@name} #{@version}... "
|
334
336
|
end
|
335
337
|
|
338
|
+
command = unescape_options_from command
|
339
|
+
|
336
340
|
if Process.respond_to?(:spawn) && ! RbConfig.respond_to?(:java)
|
337
341
|
args = [command].flatten + [{[:out, :err]=>[log_out, "a"]}]
|
338
342
|
pid = spawn(*args)
|
@@ -491,4 +495,16 @@ private
|
|
491
495
|
m = ENV['MAKE'] || ENV['make'] || 'make'
|
492
496
|
return m.dup
|
493
497
|
end
|
498
|
+
|
499
|
+
def unescape_options_from command
|
500
|
+
return command unless unescape_commands
|
501
|
+
[command].flatten.map do |opt|
|
502
|
+
if opt =~ /\\/
|
503
|
+
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
|
+
opt.gsub!(/\\/, "")
|
505
|
+
else
|
506
|
+
opt
|
507
|
+
end
|
508
|
+
end
|
509
|
+
end
|
494
510
|
end
|
data/lib/mini_portile/version.rb
CHANGED
@@ -0,0 +1,31 @@
|
|
1
|
+
require File.expand_path('../helper', __FILE__)
|
2
|
+
require 'mini_portile'
|
3
|
+
|
4
|
+
class TestUnescapingCommands < TestCase
|
5
|
+
class << self
|
6
|
+
def startup
|
7
|
+
FileUtils.rm_rf "tmp" # remove any previous test files
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def echo_helper recipe, string
|
12
|
+
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
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_setting_unescape_to_true_unescapes_escaped_strings
|
18
|
+
recipe = MiniPortile.new("foo", "1.0", :unescape_commands => true)
|
19
|
+
assert_equal "thistthat", echo_helper(recipe, 'this\tthat')
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_setting_unescape_to_false_does_not_touch_unescaped_strings
|
23
|
+
recipe = MiniPortile.new("foo", "1.0", :unescape_commands => false)
|
24
|
+
assert_equal "this\tthat", echo_helper(recipe, 'this\tthat')
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_default_unescape_setting_is_true
|
28
|
+
recipe = MiniPortile.new("foo", "1.0")
|
29
|
+
assert_true recipe.unescape_commands
|
30
|
+
end
|
31
|
+
end
|
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.
|
4
|
+
version: 0.7.0.rc3
|
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-
|
12
|
+
date: 2015-09-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -96,6 +96,7 @@ files:
|
|
96
96
|
- test/test_cook.rb
|
97
97
|
- test/test_digest.rb
|
98
98
|
- test/test_proxy.rb
|
99
|
+
- test/test_unescaping_commands.rb
|
99
100
|
homepage: http://github.com/flavorjones/mini_portile
|
100
101
|
licenses:
|
101
102
|
- MIT
|
@@ -116,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
117
|
version: 1.3.1
|
117
118
|
requirements: []
|
118
119
|
rubyforge_project:
|
119
|
-
rubygems_version: 2.4.
|
120
|
+
rubygems_version: 2.4.8
|
120
121
|
signing_key:
|
121
122
|
specification_version: 4
|
122
123
|
summary: Simplistic port-like solution for developers
|
@@ -130,3 +131,4 @@ test_files:
|
|
130
131
|
- test/test_cook.rb
|
131
132
|
- test/test_digest.rb
|
132
133
|
- test/test_proxy.rb
|
134
|
+
- test/test_unescaping_commands.rb
|