mini_portile2 2.2.0 → 2.5.2

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
- SHA1:
3
- metadata.gz: 2a300c53f89d0d5c33f152aedaf83c93fd7cf2da
4
- data.tar.gz: ea999f1800170b0eca5d7d2f4ebc34b27ea1dcbd
2
+ SHA256:
3
+ metadata.gz: a50c7c03eb4dcb7395372836a55084a65dbb7b29fde587cb9a0e795464008e50
4
+ data.tar.gz: d6ec7eda8e8e8fec8c50824ec50d25062cfc21ad8f745002d35ddbb31c8f4e7d
5
5
  SHA512:
6
- metadata.gz: 47e8494cf606445724bf155bcd430568526c17142659a7dc4596dc0f8572f6b88ac2322565a63cf5323e9cb29a311cfd1c3ed866c323bec7c95e1e885142f5f9
7
- data.tar.gz: '08246743bb302ab883fefa47657ea49d0b132bdeb2c59daf85d890c1b45aacc155111c1e7568e9f228a859150b20535169ad9281148cdf8278506cbfa4b84996'
6
+ metadata.gz: a5b8423782025822fed3b7ad9b24c3db71791042a510adb90260d40138286090e3bc981671d57da3639dd80a559bdb77bac222551b6a3eef9259cee63aa9d98e
7
+ data.tar.gz: 52ec801b7006e8bc74a4ccb87a636e5a9d222d58d18a2c2d609778a45f83a1381e74a16e9065ecff51558781561547ad96ba495c09679c759b893b6a9328bb79
@@ -0,0 +1 @@
1
+ tidelift: "rubygems/mini_portile2"
@@ -0,0 +1,62 @@
1
+ name: Continuous Integration
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ types: [opened, synchronize]
8
+ branches: [main]
9
+ schedule:
10
+ - cron: "0 8 * * 5" # At 08:00 on Friday # https://crontab.guru/#0_8_*_*_5
11
+ workflow_dispatch:
12
+
13
+ jobs:
14
+ test-unit:
15
+ env:
16
+ MAKEFLAGS: -j2
17
+ strategy:
18
+ matrix:
19
+ platform: [ubuntu-latest, windows-latest]
20
+ ruby: ["2.3", "2.4", "2.5", "2.6", "2.7", "3.0", "head"]
21
+ runs-on: ${{ matrix.platform }}
22
+ steps:
23
+ - name: configure git crlf on windows
24
+ if: matrix.platform == 'windows-latest'
25
+ run: |
26
+ git config --system core.autocrlf false
27
+ git config --system core.eol lf
28
+ - uses: actions/checkout@v2
29
+ - uses: MSP-Greg/setup-ruby-pkgs@v1
30
+ with:
31
+ apt-get: _update_ build-essential cmake
32
+ mingw: _upgrade_ cmake
33
+ ruby-version: ${{ matrix.ruby }}
34
+ bundler-cache: true
35
+ - run: bundle exec rake test:unit
36
+
37
+ test-examples:
38
+ env:
39
+ MAKEFLAGS: -j2
40
+ strategy:
41
+ matrix:
42
+ platform: [ubuntu-latest, windows-latest]
43
+ ruby: ["3.0"]
44
+ runs-on: ${{ matrix.platform }}
45
+ steps:
46
+ - name: configure git crlf on windows
47
+ if: matrix.platform == 'windows-latest'
48
+ run: |
49
+ git config --system core.autocrlf false
50
+ git config --system core.eol lf
51
+ - uses: actions/checkout@v2
52
+ - uses: MSP-Greg/setup-ruby-pkgs@v1
53
+ with:
54
+ apt-get: _update_ build-essential cmake
55
+ mingw: _upgrade_ cmake
56
+ ruby-version: ${{ matrix.ruby }}
57
+ bundler-cache: true
58
+ - uses: actions/cache@v2
59
+ with:
60
+ path: examples/ports/archives
61
+ key: ${{ matrix.platform }}-examples-${{ hashFiles('examples/Rakefile') }}
62
+ - run: bundle exec rake test:examples
data/.gitignore CHANGED
@@ -1,7 +1,5 @@
1
- pkg
2
- tmp
3
- Gemfile.lock
4
1
  .bundle
2
+ Gemfile.lock
3
+ pkg
5
4
  ports
6
- concourse/private.yml
7
- concourse/mini_portile.final.yml
5
+ tmp
data/CHANGELOG.md CHANGED
@@ -1,3 +1,46 @@
1
+ ## mini_portile changelog
2
+
3
+ ### 2.5.2 / 2021-05-28
4
+
5
+ #### Dependencies
6
+
7
+ Add `net-ftp` as an explicit dependency to accommodate the upcoming Ruby 3.1 changes that move this and other gems out of the "default" gem set and into the "bundled" gem set. See https://bugs.ruby-lang.org/issues/17873 [#101]
8
+
9
+
10
+ ### 2.5.1 / 2021-04-28
11
+
12
+ #### Dependencies
13
+
14
+ This release ends support for ruby < 2.3.0. If you're on 2.2.x or earlier, we strongly suggest that you find the time to upgrade, because [official support for Ruby 2.2 ended on 2018-03-31](https://www.ruby-lang.org/en/news/2018/06/20/support-of-ruby-2-2-has-ended/).
15
+
16
+ #### Enhancements
17
+
18
+ * `MiniPortile.execute` now takes an optional `:env` hash, which is merged into the environment variables for the subprocess. Likely this is only useful for specialized use cases. [#99]
19
+ * Experimental support for cmake-based projects extended to Windows. (Thanks, @larskanis!)
20
+
21
+
22
+ ### 2.5.0 / 2020-02-24
23
+
24
+ #### Enhancements
25
+
26
+ * When verifying GPG signatures, remove all imported pubkeys from keyring [#90] (Thanks, @hanazuki!)
27
+
28
+
29
+ ### 2.4.0 / 2018-12-02
30
+
31
+ #### Enhancements
32
+
33
+ * Skip progress report when Content-Length is unavailable. [#85] (Thanks, @eagletmt!)
34
+
35
+
36
+ ### 2.3.0 / 2017-09-13
37
+
38
+ #### Enhancements
39
+
40
+ * Verify checksums of files at extraction time (in addition to at download time). (#56)
41
+ * Clarify error message if a `tar` command can't be found. (#81)
42
+
43
+
1
44
  ### 2.2.0 / 2017-06-04
2
45
 
3
46
  #### Enhancements
data/README.md CHANGED
@@ -5,8 +5,8 @@ renamed to `mini_portile2`. For mini_portile versions 0.6.x and
5
5
  previous, please visit
6
6
  [the v0.6.x branch](https://github.com/flavorjones/mini_portile/tree/v0.6.x).
7
7
 
8
- [![travis status](https://travis-ci.org/flavorjones/mini_portile.svg?branch=master)](https://travis-ci.org/flavorjones/mini_portile?branch=master)
9
- [![appveyor status](https://ci.appveyor.com/api/projects/status/509669xx1qlhqqab/branch/master?svg=true)](https://ci.appveyor.com/project/flavorjones/mini-portile/branch/master)
8
+ [![Continuous Integration](https://github.com/flavorjones/mini_portile/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/flavorjones/mini_portile/actions/workflows/ci.yml)
9
+ [![Tidelift dependencies](https://tidelift.com/badges/package/rubygems/mini_portile2)](https://tidelift.com/subscription/pkg/rubygems-mini.portile2?utm_source=undefined&utm_medium=referral&utm_campaign=readme)
10
10
 
11
11
  * Documentation: http://www.rubydoc.info/github/flavorjones/mini_portile
12
12
  * Source Code: https://github.com/flavorjones/mini_portile
@@ -240,6 +240,22 @@ toolchain. This has been tested against Ubuntu, OSX and even Windows
240
240
  (RubyInstaller with DevKit)
241
241
 
242
242
 
243
+ ## Support
244
+
245
+ The bug tracker is available here:
246
+
247
+ * https://github.com/flavorjones/mini_portile/issues
248
+
249
+ Consider subscribing to [Tidelift][tidelift] which provides license assurances and timely security notifications for your open source dependencies, including Loofah. [Tidelift][tidelift] subscriptions also help the Loofah maintainers fund our [automated testing](https://ci.nokogiri.org) which in turn allows us to ship releases, bugfixes, and security updates more often.
250
+
251
+ [tidelift]: https://tidelift.com/subscription/pkg/rubygems-mini.portile2?utm_source=rubygems-mini.portile2&utm_medium=referral&utm_campaign=enterprise
252
+
253
+
254
+ ## Security
255
+
256
+ See [`SECURITY.md`](SECURITY.md) for vulnerability reporting details.
257
+
258
+
243
259
  ## License
244
260
 
245
261
  This library is licensed under MIT license. Please see LICENSE.txt for details.
data/Rakefile CHANGED
@@ -1,11 +1,10 @@
1
1
  require "rake/clean"
2
- require 'bundler/gem_tasks'
3
- require 'concourse'
2
+ require "bundler/gem_tasks"
4
3
 
5
4
  namespace :test do
6
5
  desc "Test MiniPortile by running unit tests"
7
6
  task :unit do
8
- sh "ruby -w -W2 -I. -Ilib -e \"#{Dir["test/test_*.rb"].map{|f| "require '#{f}';"}.join}\" -- #{ENV['TESTOPTS']} -v"
7
+ sh "ruby -w -W2 -I. -Ilib -e \"#{Dir["test/test_*.rb"].map { |f| "require '#{f}';" }.join}\" -- #{ENV["TESTOPTS"]} -v"
9
8
  end
10
9
 
11
10
  desc "Test MiniPortile by compiling examples"
@@ -24,6 +23,3 @@ desc "Run all tests"
24
23
  task :test => ["test:unit", "test:examples"]
25
24
 
26
25
  task :default => [:test]
27
-
28
-
29
- Concourse.new("mini_portile").create_tasks!
data/SECURITY.md ADDED
@@ -0,0 +1,13 @@
1
+ # Security and Vulnerability Reporting
2
+
3
+ The mini_portile core contributors take security very seriously and investigate all reported vulnerabilities.
4
+
5
+ If you would like to report a vulnerablity or have a security concern regarding mini_portile, please [report it via Tidelift](https://tidelift.com/security).
6
+
7
+ Your report will be acknowledged within 48 hours, and you'll receive a more detailed response within 96 hours indicating next steps in handling your report.
8
+
9
+ If you have not received a reply to your submission within 96 hours, Contact the current security coordinator, Mike Dalessio <mike.dalessio@gmail.com>.
10
+
11
+ The information you share with the mini_portile core contributors as part of this process will be kept confidential within the team, unless or until we need to share information upstream with our dependent libraries' core teams, at which point we will notify you.
12
+
13
+ If a vulnerability is first reported by you, we will credit you with the discovery in the public disclosure.
@@ -34,7 +34,17 @@ class MiniPortile
34
34
  attr_accessor :host, :files, :patch_files, :target, :logger
35
35
 
36
36
  def self.windows?
37
- RbConfig::CONFIG['target_os'] =~ /mswin|mingw32/
37
+ RbConfig::CONFIG['target_os'] =~ /mswin|mingw/
38
+ end
39
+
40
+ # GNU MinGW compiled Ruby?
41
+ def self.mingw?
42
+ RbConfig::CONFIG['target_os'] =~ /mingw/
43
+ end
44
+
45
+ # MS Visual-C compiled Ruby?
46
+ def self.mswin?
47
+ RbConfig::CONFIG['target_os'] =~ /mswin/
38
48
  end
39
49
 
40
50
  def initialize(name, version)
@@ -58,6 +68,7 @@ class MiniPortile
58
68
 
59
69
  def extract
60
70
  files_hashs.each do |file|
71
+ verify_file(file)
61
72
  extract_file(file[:local_path], tmp_path)
62
73
  end
63
74
  end
@@ -269,15 +280,18 @@ private
269
280
  io.close_write
270
281
  io.read
271
282
  end
272
- raise "invalid gpg key provided" unless /\[GNUPG:\] IMPORT_OK \d+ (?<key_id>[0-9a-f]+)/i =~ gpg_status
283
+ key_ids = gpg_status.scan(/\[GNUPG:\] IMPORT_OK \d+ (?<key_id>[0-9a-f]+)/i).map(&:first)
284
+ raise "invalid gpg key provided" if key_ids.empty?
273
285
 
274
286
  # verify the signature against our keyring
275
287
  gpg_status = IO.popen([gpg_exe, "--status-fd", "1", "--no-default-keyring", "--keyring", KEYRING_NAME, "--verify", signature_file, file[:local_path]], &:read)
276
288
 
277
289
  # remove the key from our keyring
278
- IO.popen([gpg_exe, "--batch", "--yes", "--no-default-keyring", "--keyring", KEYRING_NAME, "--delete-keys", key_id], &:read)
290
+ key_ids.each do |key_id|
291
+ IO.popen([gpg_exe, "--batch", "--yes", "--no-default-keyring", "--keyring", KEYRING_NAME, "--delete-keys", key_id], &:read)
292
+ raise "unable to delete the imported key" unless $?.exitstatus==0
293
+ end
279
294
 
280
- raise "unable to delete the imported key" unless $?.exitstatus==0
281
295
  raise "signature mismatch" unless gpg_status.match(/^\[GNUPG:\] VALIDSIG/)
282
296
 
283
297
  else
@@ -302,11 +316,12 @@ private
302
316
  }
303
317
  end
304
318
 
319
+ TAR_EXECUTABLES = %w[gtar bsdtar tar basic-bsdtar]
305
320
  def tar_exe
306
321
  @@tar_exe ||= begin
307
- %w[gtar bsdtar tar basic-bsdtar].find { |c|
322
+ TAR_EXECUTABLES.find { |c|
308
323
  which(c)
309
- }
324
+ } or raise("tar not found - please make sure that one of the following commands is in the PATH: #{TAR_EXECUTABLES.join(", ")}")
310
325
  end
311
326
  end
312
327
 
@@ -365,24 +380,36 @@ private
365
380
  execute('extract', [tar_exe, "#{tar_compression_switch(filename)}xf", file, "-C", target], {:cd => Dir.pwd, :initial_message => false})
366
381
  end
367
382
 
368
- def execute(action, command, options={})
369
- log_out = log_file(action)
383
+ # command could be an array of args, or one string containing a command passed to the shell. See
384
+ # Process.spawn for more information.
385
+ def execute(action, command, command_opts={})
386
+ opt_message = command_opts.fetch(:initial_message, true)
387
+ opt_debug = command_opts.fetch(:debug, false)
388
+ opt_cd = command_opts.fetch(:cd) { work_path }
389
+ opt_env = command_opts.fetch(:env) { Hash.new }
370
390
 
371
- Dir.chdir (options.fetch(:cd){ work_path }) do
372
- if options.fetch(:initial_message){ true }
373
- message "Running '#{action}' for #{@name} #{@version}... "
374
- end
391
+ log_out = log_file(action)
392
+
393
+ Dir.chdir(opt_cd) do
394
+ output "DEBUG: env is #{opt_env.inspect}" if opt_debug
395
+ output "DEBUG: command is #{command.inspect}" if opt_debug
396
+ message "Running '#{action}' for #{@name} #{@version}... " if opt_message
375
397
 
376
398
  if Process.respond_to?(:spawn) && ! RbConfig.respond_to?(:java)
377
- args = [command].flatten + [{[:out, :err]=>[log_out, "a"]}]
399
+ options = {[:out, :err]=>[log_out, "a"]}
400
+ output "DEBUG: options are #{options.inspect}" if opt_debug
401
+ args = [opt_env, command, options].flatten
378
402
  pid = spawn(*args)
379
403
  Process.wait(pid)
380
404
  else
381
- redirected = if command.kind_of?(Array)
382
- %Q{#{command.map(&:shellescape).join(" ")} > #{log_out.shellescape} 2>&1}
383
- else
384
- %Q{#{command} > #{log_out.shellescape} 2>&1}
385
- end
405
+ env_args = opt_env.map { |k,v| "#{k}=#{v}".shellescape }.join(" ")
406
+ c = if command.kind_of?(Array)
407
+ command.map(&:shellescape).join(" ")
408
+ else
409
+ command
410
+ end
411
+ redirected = %Q{env #{env_args} #{c} > #{log_out.shellescape} 2>&1}
412
+ output "DEBUG: final command is #{redirected.inspect}" if opt_debug
386
413
  system redirected
387
414
  end
388
415
 
@@ -452,9 +479,14 @@ private
452
479
  "Accept-Encoding" => 'identity',
453
480
  :content_length_proc => lambda{|length| total = length },
454
481
  :progress_proc => lambda{|bytes|
455
- new_progress = (bytes * 100) / total
456
- message "\rDownloading %s (%3d%%) " % [filename, new_progress]
457
- progress = new_progress
482
+ if total
483
+ new_progress = (bytes * 100) / total
484
+ message "\rDownloading %s (%3d%%) " % [filename, new_progress]
485
+ progress = new_progress
486
+ else
487
+ # Content-Length is unavailable because Transfer-Encoding is chunked
488
+ message "\rDownloading %s " % [filename]
489
+ end
458
490
  }
459
491
  }
460
492
  proxy_uri = URI.parse(url).scheme.downcase == 'https' ?
@@ -6,8 +6,10 @@ class MiniPortileCMake < MiniPortile
6
6
  end
7
7
 
8
8
  def configure_defaults
9
- if MiniPortile.windows?
10
- ['-G "NMake Makefiles"']
9
+ if MiniPortile.mswin?
10
+ ['-G', 'NMake Makefiles']
11
+ elsif MiniPortile.mingw?
12
+ ['-G', 'MSYS Makefiles']
11
13
  else
12
14
  []
13
15
  end
@@ -34,7 +36,7 @@ class MiniPortileCMake < MiniPortile
34
36
  end
35
37
 
36
38
  def make_cmd
37
- return "nmake" if MiniPortile.windows?
39
+ return "nmake" if MiniPortile.mswin?
38
40
  super
39
41
  end
40
42
  end
@@ -1,3 +1,3 @@
1
1
  class MiniPortile
2
- VERSION = "2.2.0"
2
+ VERSION = "2.5.2"
3
3
  end
@@ -1,42 +1,44 @@
1
1
  # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
2
+ lib = File.expand_path("../lib", __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'mini_portile2/version'
4
+ require "mini_portile2/version"
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = "mini_portile2"
8
- spec.version = MiniPortile::VERSION
7
+ spec.name = "mini_portile2"
8
+ spec.version = MiniPortile::VERSION
9
9
 
10
- spec.authors = ['Luis Lavena', 'Mike Dalessio', 'Lars Kanis']
11
- spec.email = 'mike.dalessio@gmail.com'
10
+ spec.authors = ["Luis Lavena", "Mike Dalessio", "Lars Kanis"]
11
+ spec.email = "mike.dalessio@gmail.com"
12
12
 
13
- spec.summary = "Simplistic port-like solution for developers"
14
- spec.description = "Simplistic port-like solution for developers. It provides a standard and simplified way to compile against dependency libraries without messing up your system."
13
+ spec.summary = "Simplistic port-like solution for developers"
14
+ spec.description = "Simplistic port-like solution for developers. It provides a standard and simplified way to compile against dependency libraries without messing up your system."
15
15
 
16
- spec.homepage = 'http://github.com/flavorjones/mini_portile'
17
- spec.licenses = ['MIT']
16
+ spec.homepage = "https://github.com/flavorjones/mini_portile"
17
+ spec.licenses = ["MIT"]
18
18
 
19
19
  begin
20
- spec.files = `git ls-files -z`.split("\x0")
20
+ spec.files = `git ls-files -z`.split("\x0")
21
21
  rescue Exception => e
22
22
  warn "WARNING: could not set spec.files: #{e.class}: #{e}"
23
23
  end
24
24
 
25
25
  # omit the `examples` directory from the gem, because it's large and
26
26
  # not necessary to be packaged in the gem.
27
- example_files = spec.files.grep(%r{^examples/})
27
+ example_files = spec.files.grep(%r{^examples/})
28
28
  spec.files -= example_files
29
29
 
30
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
31
- spec.test_files = spec.files.grep(%r{^(test|spec|features|examples)/})
30
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
31
+ spec.test_files = spec.files.grep(%r{^(test|spec|features|examples)/})
32
32
  spec.require_paths = ["lib"]
33
33
 
34
- spec.add_development_dependency "bundler", "~> 1.7"
35
- spec.add_development_dependency "rake", "~> 12.0"
36
- spec.add_development_dependency "minitest", "~> 5.8"
37
- spec.add_development_dependency "minitest-hooks", "~> 1.4"
38
- spec.add_development_dependency "minitar", "~> 0.5"
39
- spec.add_development_dependency "concourse", "~> 0.12"
34
+ spec.required_ruby_version = ">= 2.3.0"
40
35
 
41
- spec.required_ruby_version = ">= 1.9.2"
36
+ spec.add_dependency "net-ftp", "~> 0.1"
37
+
38
+ spec.add_development_dependency "bundler", "~> 2.1"
39
+ spec.add_development_dependency "minitar", "~> 0.7"
40
+ spec.add_development_dependency "minitest", "~> 5.11"
41
+ spec.add_development_dependency "minitest-hooks", "~> 1.5.0"
42
+ spec.add_development_dependency "rake", "~> 13.0"
43
+ spec.add_development_dependency "webrick", "~> 1.0"
42
44
  end
data/test/test_cmake.rb CHANGED
@@ -5,8 +5,6 @@ class TestCMake < TestCase
5
5
 
6
6
  def before_all
7
7
  super
8
- return if MiniPortile.windows?
9
-
10
8
  @assets_path = File.expand_path("../assets", __FILE__)
11
9
  @tar_path = File.expand_path("../../tmp/test-cmake-1.0.tar.gz", __FILE__)
12
10
 
@@ -19,7 +17,6 @@ class TestCMake < TestCase
19
17
  @recipe = MiniPortileCMake.new("test-cmake", "1.0").tap do |recipe|
20
18
  recipe.files << "http://localhost:#{HTTP_PORT}/#{ERB::Util.url_encode(File.basename(@tar_path))}"
21
19
  recipe.patch_files << File.join(@assets_path, "patch 1.diff")
22
- recipe.configure_options << "--option=\"path with 'space'\""
23
20
  git_dir = File.join(@assets_path, "git")
24
21
  with_custom_git_dir(git_dir) do
25
22
  recipe.cook
@@ -29,19 +26,22 @@ class TestCMake < TestCase
29
26
 
30
27
  def after_all
31
28
  super
32
- return if MiniPortile.windows?
33
-
34
29
  stop_webrick
35
30
  # leave test files for inspection
36
31
  end
37
32
 
33
+ def exe_name
34
+ case
35
+ when MiniPortile.windows? then "hello.exe"
36
+ else "hello"
37
+ end
38
+ end
39
+
38
40
  def test_cmake_inherits_from_base
39
41
  assert(MiniPortileCMake <= MiniPortile)
40
42
  end
41
43
 
42
44
  def test_configure
43
- skip if MiniPortile.windows?
44
-
45
45
  cmakecache = File.join(work_dir, "CMakeCache.txt")
46
46
  assert File.exist?(cmakecache), cmakecache
47
47
 
@@ -49,16 +49,12 @@ class TestCMake < TestCase
49
49
  end
50
50
 
51
51
  def test_compile
52
- skip if MiniPortile.windows?
53
-
54
- binary = File.join(work_dir, "hello")
52
+ binary = File.join(work_dir, exe_name)
55
53
  assert File.exist?(binary), binary
56
54
  end
57
55
 
58
56
  def test_install
59
- skip if MiniPortile.windows?
60
-
61
- binary = File.join(recipe.path, "bin", "hello")
57
+ binary = File.join(recipe.path, "bin", exe_name)
62
58
  assert File.exist?(binary), binary
63
59
  end
64
60
  end
@@ -0,0 +1,39 @@
1
+ require_relative "helper"
2
+
3
+ class TestExecute < TestCase
4
+ def setup
5
+ super
6
+ @env = {"TEST_ENV_VAR1" => "VAR1_VALUE", "TEST_ENV_VAR2" => "VAR2_VALUE"}
7
+ @recipe = MiniPortile.new("test_execute", "1.0.0")
8
+ @log_path = @recipe.send(:tmp_path)
9
+ FileUtils.mkdir_p File.join(@log_path, "subdir") # normally created by `download`
10
+ end
11
+
12
+ def test_execute_one_big_string_arg
13
+ class << @recipe
14
+ def execute_with_env(env)
15
+ execute("testenv1",
16
+ %Q(ruby -e "puts ENV['TEST_ENV_VAR1'].inspect ; exit 0"),
17
+ {:env => env, :initial_message => false, :debug => true})
18
+ end
19
+ end
20
+
21
+ @recipe.execute_with_env(@env)
22
+
23
+ assert_equal("VAR1_VALUE".inspect, IO.read(File.join(@log_path, "testenv1.log")).chomp)
24
+ end
25
+
26
+ def test_execute_array_args
27
+ class << @recipe
28
+ def execute_with_env(env)
29
+ execute("testenv2",
30
+ ["ruby", "-e", "puts ENV['TEST_ENV_VAR2'].inspect"],
31
+ {:env => env, :initial_message => false, :debug => true})
32
+ end
33
+ end
34
+
35
+ @recipe.execute_with_env(@env)
36
+
37
+ assert_equal("VAR2_VALUE".inspect, IO.read(File.join(@log_path, "testenv2.log")).chomp)
38
+ end
39
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mini_portile2
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luis Lavena
@@ -10,92 +10,106 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-06-05 00:00:00.000000000 Z
13
+ date: 2021-05-28 00:00:00.000000000 Z
14
14
  dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: net-ftp
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - "~>"
20
+ - !ruby/object:Gem::Version
21
+ version: '0.1'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - "~>"
27
+ - !ruby/object:Gem::Version
28
+ version: '0.1'
15
29
  - !ruby/object:Gem::Dependency
16
30
  name: bundler
17
31
  requirement: !ruby/object:Gem::Requirement
18
32
  requirements:
19
33
  - - "~>"
20
34
  - !ruby/object:Gem::Version
21
- version: '1.7'
35
+ version: '2.1'
22
36
  type: :development
23
37
  prerelease: false
24
38
  version_requirements: !ruby/object:Gem::Requirement
25
39
  requirements:
26
40
  - - "~>"
27
41
  - !ruby/object:Gem::Version
28
- version: '1.7'
42
+ version: '2.1'
29
43
  - !ruby/object:Gem::Dependency
30
- name: rake
44
+ name: minitar
31
45
  requirement: !ruby/object:Gem::Requirement
32
46
  requirements:
33
47
  - - "~>"
34
48
  - !ruby/object:Gem::Version
35
- version: '12.0'
49
+ version: '0.7'
36
50
  type: :development
37
51
  prerelease: false
38
52
  version_requirements: !ruby/object:Gem::Requirement
39
53
  requirements:
40
54
  - - "~>"
41
55
  - !ruby/object:Gem::Version
42
- version: '12.0'
56
+ version: '0.7'
43
57
  - !ruby/object:Gem::Dependency
44
58
  name: minitest
45
59
  requirement: !ruby/object:Gem::Requirement
46
60
  requirements:
47
61
  - - "~>"
48
62
  - !ruby/object:Gem::Version
49
- version: '5.8'
63
+ version: '5.11'
50
64
  type: :development
51
65
  prerelease: false
52
66
  version_requirements: !ruby/object:Gem::Requirement
53
67
  requirements:
54
68
  - - "~>"
55
69
  - !ruby/object:Gem::Version
56
- version: '5.8'
70
+ version: '5.11'
57
71
  - !ruby/object:Gem::Dependency
58
72
  name: minitest-hooks
59
73
  requirement: !ruby/object:Gem::Requirement
60
74
  requirements:
61
75
  - - "~>"
62
76
  - !ruby/object:Gem::Version
63
- version: '1.4'
77
+ version: 1.5.0
64
78
  type: :development
65
79
  prerelease: false
66
80
  version_requirements: !ruby/object:Gem::Requirement
67
81
  requirements:
68
82
  - - "~>"
69
83
  - !ruby/object:Gem::Version
70
- version: '1.4'
84
+ version: 1.5.0
71
85
  - !ruby/object:Gem::Dependency
72
- name: minitar
86
+ name: rake
73
87
  requirement: !ruby/object:Gem::Requirement
74
88
  requirements:
75
89
  - - "~>"
76
90
  - !ruby/object:Gem::Version
77
- version: '0.5'
91
+ version: '13.0'
78
92
  type: :development
79
93
  prerelease: false
80
94
  version_requirements: !ruby/object:Gem::Requirement
81
95
  requirements:
82
96
  - - "~>"
83
97
  - !ruby/object:Gem::Version
84
- version: '0.5'
98
+ version: '13.0'
85
99
  - !ruby/object:Gem::Dependency
86
- name: concourse
100
+ name: webrick
87
101
  requirement: !ruby/object:Gem::Requirement
88
102
  requirements:
89
103
  - - "~>"
90
104
  - !ruby/object:Gem::Version
91
- version: '0.12'
105
+ version: '1.0'
92
106
  type: :development
93
107
  prerelease: false
94
108
  version_requirements: !ruby/object:Gem::Requirement
95
109
  requirements:
96
110
  - - "~>"
97
111
  - !ruby/object:Gem::Version
98
- version: '0.12'
112
+ version: '1.0'
99
113
  description: Simplistic port-like solution for developers. It provides a standard
100
114
  and simplified way to compile against dependency libraries without messing up your
101
115
  system.
@@ -104,18 +118,15 @@ executables: []
104
118
  extensions: []
105
119
  extra_rdoc_files: []
106
120
  files:
107
- - ".concourse.yml"
121
+ - ".github/FUNDING.yml"
122
+ - ".github/workflows/ci.yml"
108
123
  - ".gitignore"
109
- - ".travis.yml"
110
124
  - CHANGELOG.md
111
125
  - Gemfile
112
126
  - LICENSE.txt
113
127
  - README.md
114
128
  - Rakefile
115
- - appveyor.yml
116
- - concourse/mini_portile.yml
117
- - concourse/tasks/rake-test/task.ps1
118
- - concourse/tasks/rake-test/task.sh
129
+ - SECURITY.md
119
130
  - lib/mini_portile2.rb
120
131
  - lib/mini_portile2/mini_portile.rb
121
132
  - lib/mini_portile2/mini_portile_cmake.rb
@@ -135,8 +146,9 @@ files:
135
146
  - test/test_cook.rb
136
147
  - test/test_digest.rb
137
148
  - test/test_download.rb
149
+ - test/test_execute.rb
138
150
  - test/test_proxy.rb
139
- homepage: http://github.com/flavorjones/mini_portile
151
+ homepage: https://github.com/flavorjones/mini_portile
140
152
  licenses:
141
153
  - MIT
142
154
  metadata: {}
@@ -148,15 +160,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
148
160
  requirements:
149
161
  - - ">="
150
162
  - !ruby/object:Gem::Version
151
- version: 1.9.2
163
+ version: 2.3.0
152
164
  required_rubygems_version: !ruby/object:Gem::Requirement
153
165
  requirements:
154
166
  - - ">="
155
167
  - !ruby/object:Gem::Version
156
168
  version: '0'
157
169
  requirements: []
158
- rubyforge_project:
159
- rubygems_version: 2.6.10
170
+ rubygems_version: 3.1.4
160
171
  signing_key:
161
172
  specification_version: 4
162
173
  summary: Simplistic port-like solution for developers
@@ -175,4 +186,5 @@ test_files:
175
186
  - test/test_cook.rb
176
187
  - test/test_digest.rb
177
188
  - test/test_download.rb
189
+ - test/test_execute.rb
178
190
  - test/test_proxy.rb
data/.concourse.yml DELETED
@@ -1,83 +0,0 @@
1
- ---
2
- resources:
3
- - name: mini_portile
4
- type: git
5
- source:
6
- uri: https://github.com/flavorjones/mini_portile
7
- branch: master
8
- jobs:
9
- - name: "Minitest"
10
- plan:
11
- - get: mini_portile
12
- - task: With version 1.9.3
13
- config:
14
- platform: linux
15
- image: docker:///ruby#1.9.3
16
- inputs:
17
- - name: mini_portile
18
- run:
19
- path: bash
20
- args:
21
- - "-c"
22
- - cd mini_portile && bundle install && rake
23
- privileged: false
24
- - task: With version 2.0
25
- config:
26
- platform: linux
27
- image: docker:///ruby#2.0
28
- inputs:
29
- - name: mini_portile
30
- run:
31
- path: bash
32
- args:
33
- - "-c"
34
- - cd mini_portile && bundle install && rake
35
- privileged: false
36
- - task: With version 2.1
37
- config:
38
- platform: linux
39
- image: docker:///ruby#2.1
40
- inputs:
41
- - name: mini_portile
42
- run:
43
- path: bash
44
- args:
45
- - "-c"
46
- - cd mini_portile && bundle install && rake
47
- privileged: false
48
- - task: With version 2.2
49
- config:
50
- platform: linux
51
- image: docker:///ruby#2.2
52
- inputs:
53
- - name: mini_portile
54
- run:
55
- path: bash
56
- args:
57
- - "-c"
58
- - cd mini_portile && bundle install && rake
59
- privileged: false
60
- - task: With version jruby-1.7.23
61
- config:
62
- platform: linux
63
- image: docker:///jruby#1.7.23
64
- inputs:
65
- - name: mini_portile
66
- run:
67
- path: bash
68
- args:
69
- - "-c"
70
- - cd mini_portile && bundle install && rake
71
- privileged: false
72
- - task: With version jruby-9.0.4.0
73
- config:
74
- platform: linux
75
- image: docker:///jruby#9.0.4.0
76
- inputs:
77
- - name: mini_portile
78
- run:
79
- path: bash
80
- args:
81
- - "-c"
82
- - cd mini_portile && bundle install && rake
83
- privileged: false
data/.travis.yml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- language: ruby
3
- sudo: false
4
- matrix:
5
- include:
6
- - rvm: 1.9.3
7
- - rvm: 2.0
8
- - rvm: 2.1
9
- - rvm: 2.2.5
10
- - rvm: 2.3.1
11
- - rvm: 2.4.0
12
- env:
13
- - RUBYOPT="--enable-frozen-string-literal --debug=frozen-string-literal"
14
- - rvm: jruby-1.7
15
- - rvm: jruby-9.1.5.0
data/appveyor.yml DELETED
@@ -1,25 +0,0 @@
1
- ---
2
- install:
3
- - ps: ((New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt', "$env:TMP\ca-bundle.crt"))
4
- - SET SSL_CERT_FILE=%TMP%\ca-bundle.crt
5
- - SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
6
- - SET RAKEOPT=-rdevkit
7
- - ruby --version
8
- - gem --version
9
- - bundle install
10
- - gpg --version
11
-
12
- build: off
13
-
14
- test_script:
15
- - bundle exec rake
16
-
17
- environment:
18
- matrix:
19
- - ruby_version: "22-x64"
20
- - ruby_version: "22"
21
- - ruby_version: "21-x64"
22
- - ruby_version: "21"
23
- - ruby_version: "200-x64"
24
- - ruby_version: "200"
25
- - ruby_version: "193"
@@ -1,160 +0,0 @@
1
- % ruby_version = RUBIES[:mri].last
2
-
3
- groups:
4
- - name: master
5
- jobs:
6
- - ruby-<%= ruby_version %>
7
- - windows-install-ruby-2.3
8
- - ruby-2.3-devkit
9
-
10
- - name: PRs
11
- jobs:
12
- - pr-pending
13
- - ruby-<%= ruby_version %>-pr
14
- - pr-success
15
-
16
- resource_types:
17
- - name: pull-request
18
- type: docker-image
19
- source:
20
- repository: jtarchie/pr
21
-
22
- resources:
23
- - name: ci
24
- type: git
25
- source:
26
- uri: https://github.com/flavorjones/mini_portile/
27
- branch: master
28
- disable_ci_skip: true # always get the latest pipeline configuration
29
-
30
- - name: nokogiri-ci
31
- type: git
32
- source:
33
- uri: https://github.com/sparklemotion/nokogiri/
34
- branch: master
35
- disable_ci_skip: true # always get the latest pipeline configuration
36
-
37
- - name: mini_portile
38
- type: git
39
- source:
40
- uri: https://github.com/flavorjones/mini_portile/
41
- branch: master
42
- ignore_paths:
43
- - concourse/**
44
-
45
- - name: mini_portile-pr
46
- type: pull-request
47
- source:
48
- repo: flavorjones/mini_portile
49
- access_token: {{github-repo-status-access-token}}
50
- ignore_paths:
51
- - concourse/**
52
-
53
- jobs:
54
- #
55
- # master
56
- #
57
- - name: ruby-<%= ruby_version %>
58
- public: true
59
- plan:
60
- - get: ci
61
- - get: mini_portile
62
- trigger: true
63
- - task: rake-test
64
- config:
65
- platform: linux
66
- image_resource:
67
- type: docker-image
68
- source: {repository: ruby, tag: "<%= ruby_version %>"}
69
- inputs:
70
- - name: ci
71
- - name: mini_portile
72
- run:
73
- path: ci/concourse/tasks/rake-test/task.sh
74
-
75
- - name: windows-install-ruby-2.3
76
- public: true
77
- serial_groups: [windows-configuration]
78
- plan:
79
- - get: nokogiri-ci
80
- - get: mini_portile
81
- trigger: true
82
- - task: setup
83
- config:
84
- platform: windows
85
- inputs:
86
- - name: nokogiri-ci
87
- path: ci
88
- run:
89
- path: powershell
90
- args: ["-File", "ci/concourse/tasks/windows-config/install-ruby-and-devkit.ps1"]
91
-
92
- - name: ruby-2.3-devkit
93
- public: true
94
- plan:
95
- - get: ci
96
- - get: nokogiri-ci
97
- - get: mini_portile
98
- trigger: true
99
- passed: ["windows-install-ruby-2.3"]
100
- - task: rake-test
101
- config:
102
- platform: windows
103
- inputs:
104
- - name: ci
105
- - name: nokogiri-ci
106
- - name: mini_portile
107
- run:
108
- path: powershell
109
- args: ["-File", "ci/concourse/tasks/rake-test/task.ps1"]
110
-
111
- #
112
- # PRs
113
- #
114
- - name: pr-pending
115
- public: true
116
- plan:
117
- - get: ci
118
- - get: mini_portile-pr
119
- trigger: true
120
- version: every
121
- - put: mini_portile-pr
122
- params: {path: mini_portile-pr, status: pending}
123
-
124
- - name: ruby-<%= ruby_version %>-pr
125
- public: true
126
- serial_groups: [pr]
127
- plan:
128
- - get: ci
129
- - get: mini_portile-pr
130
- trigger: true
131
- version: every
132
- passed: [pr-pending]
133
- - task: rake-test
134
- config:
135
- platform: linux
136
- image_resource:
137
- type: docker-image
138
- source: {repository: ruby, tag: "<%= ruby_version %>"}
139
- inputs:
140
- - name: ci
141
- - name: mini_portile-pr
142
- path: mini_portile
143
- run:
144
- path: ci/concourse/tasks/rake-test/task.sh
145
- on_failure:
146
- put: mini_portile-pr
147
- params: {path: mini_portile-pr, status: failure}
148
-
149
- - name: pr-success
150
- public: true
151
- serial_groups: [pr]
152
- disable_manual_trigger: true
153
- plan:
154
- - get: mini_portile-pr
155
- trigger: true
156
- version: every
157
- passed:
158
- - ruby-<%= ruby_version %>-pr
159
- - put: mini_portile-pr
160
- params: {path: mini_portile-pr, status: success}
@@ -1,13 +0,0 @@
1
- . "nokogiri-ci\concourse\shared\common.ps1"
2
- . "c:\var\vcap\packages\windows-ruby-dev-tools\prelude.ps1"
3
-
4
- prepend-path $ruby23_bin_path
5
- $env:RUBYOPT = "-rdevkit"
6
-
7
- push-location mini_portile
8
-
9
- stream-cmd "gem" "install bundler"
10
- stream-cmd "bundle" "install"
11
- stream-cmd "bundle" "exec rake test"
12
-
13
- pop-location
@@ -1,13 +0,0 @@
1
- #! /usr/bin/env bash
2
-
3
- set -e -x -u
4
-
5
- apt-get update
6
- apt-get install -y cmake
7
-
8
- pushd mini_portile
9
-
10
- bundle install
11
- bundle exec rake test
12
-
13
- popd