mini_portile2 2.3.0 → 2.5.3

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: b1ed6b562410bfd09f8cbfedd0cadb7cce5bcce6
4
- data.tar.gz: 4ac856c665b059f6ce88b2bf8d36ca27e506220e
2
+ SHA256:
3
+ metadata.gz: b4913fc9a77207eb01b12c960a04125fd6517d57d727423af306689b5d5fc833
4
+ data.tar.gz: bc4a0a28a469ce473217fd176094b4e7238064a4f38040f39d7f514544a34842
5
5
  SHA512:
6
- metadata.gz: aefb0218e911e548cd168f0f78ec3ee5d70642446f50548578796d69d3fb0d8fb05e28ba3a1d0a99ee3a9e408f8d045a434c697a0c03f7d77f0a7e92853f3004
7
- data.tar.gz: 49f9c4665911313a37bd7eca9a3feff0b8a51b0fb8a425de13b4f082a3692328544d69fe03923560f3625642c9987d71d86a4304fdc5c290a7ae27ccfeb324b8
6
+ metadata.gz: 19b7cff7f935399f4b1162240bf0999e4db1a9af53edd0b462174dfcec32a38813afcca1901e95d7a539d4773dc1618e99349075b55181f300f43a1126936802
7
+ data.tar.gz: d872cbd565306b31f8a612fa03fcf1d7fbe2c35307806c8ae7c1099679aac729452567b5970bf7e121bcba05c504b235367acf159b950bebf08a0bd942063b07
@@ -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,4 +1,44 @@
1
- ### 2.2.1 / 2017-09-13
1
+ ## mini_portile changelog
2
+
3
+ ### 2.5.3 / 2021-05-31
4
+
5
+ Make `net-ftp` an optional dependency, since requiring it as a hard dependency in v2.5.2 caused warnings to be emitted by Ruby 2.7 and earlier. A warning message is emitted if FTP functionality is called and `net-ftp` isn't available; this should only happen in Ruby 3.1 and later.
6
+
7
+
8
+ ### 2.5.2 / 2021-05-28
9
+
10
+ #### Dependencies
11
+
12
+ 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]
13
+
14
+
15
+ ### 2.5.1 / 2021-04-28
16
+
17
+ #### Dependencies
18
+
19
+ 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/).
20
+
21
+ #### Enhancements
22
+
23
+ * `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]
24
+ * Experimental support for cmake-based projects extended to Windows. (Thanks, @larskanis!)
25
+
26
+
27
+ ### 2.5.0 / 2020-02-24
28
+
29
+ #### Enhancements
30
+
31
+ * When verifying GPG signatures, remove all imported pubkeys from keyring [#90] (Thanks, @hanazuki!)
32
+
33
+
34
+ ### 2.4.0 / 2018-12-02
35
+
36
+ #### Enhancements
37
+
38
+ * Skip progress report when Content-Length is unavailable. [#85] (Thanks, @eagletmt!)
39
+
40
+
41
+ ### 2.3.0 / 2017-09-13
2
42
 
3
43
  #### Enhancements
4
44
 
data/Gemfile CHANGED
@@ -1,4 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ gem "net-ftp" if Gem::Requirement.new("> 3.1.0.dev").satisfied_by?(Gem::Version.new(RUBY_VERSION))
4
+
3
5
  # Specify your gem's dependencies in mini_portile2.gemspec
4
6
  gemspec
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.
@@ -1,7 +1,6 @@
1
1
  require 'rbconfig'
2
2
  require 'net/http'
3
3
  require 'net/https'
4
- require 'net/ftp'
5
4
  require 'fileutils'
6
5
  require 'tempfile'
7
6
  require 'digest'
@@ -34,7 +33,17 @@ class MiniPortile
34
33
  attr_accessor :host, :files, :patch_files, :target, :logger
35
34
 
36
35
  def self.windows?
37
- RbConfig::CONFIG['target_os'] =~ /mswin|mingw32/
36
+ RbConfig::CONFIG['target_os'] =~ /mswin|mingw/
37
+ end
38
+
39
+ # GNU MinGW compiled Ruby?
40
+ def self.mingw?
41
+ RbConfig::CONFIG['target_os'] =~ /mingw/
42
+ end
43
+
44
+ # MS Visual-C compiled Ruby?
45
+ def self.mswin?
46
+ RbConfig::CONFIG['target_os'] =~ /mswin/
38
47
  end
39
48
 
40
49
  def initialize(name, version)
@@ -270,15 +279,18 @@ private
270
279
  io.close_write
271
280
  io.read
272
281
  end
273
- raise "invalid gpg key provided" unless /\[GNUPG:\] IMPORT_OK \d+ (?<key_id>[0-9a-f]+)/i =~ gpg_status
282
+ key_ids = gpg_status.scan(/\[GNUPG:\] IMPORT_OK \d+ (?<key_id>[0-9a-f]+)/i).map(&:first)
283
+ raise "invalid gpg key provided" if key_ids.empty?
274
284
 
275
285
  # verify the signature against our keyring
276
286
  gpg_status = IO.popen([gpg_exe, "--status-fd", "1", "--no-default-keyring", "--keyring", KEYRING_NAME, "--verify", signature_file, file[:local_path]], &:read)
277
287
 
278
288
  # remove the key from our keyring
279
- IO.popen([gpg_exe, "--batch", "--yes", "--no-default-keyring", "--keyring", KEYRING_NAME, "--delete-keys", key_id], &:read)
289
+ key_ids.each do |key_id|
290
+ IO.popen([gpg_exe, "--batch", "--yes", "--no-default-keyring", "--keyring", KEYRING_NAME, "--delete-keys", key_id], &:read)
291
+ raise "unable to delete the imported key" unless $?.exitstatus==0
292
+ end
280
293
 
281
- raise "unable to delete the imported key" unless $?.exitstatus==0
282
294
  raise "signature mismatch" unless gpg_status.match(/^\[GNUPG:\] VALIDSIG/)
283
295
 
284
296
  else
@@ -367,24 +379,36 @@ private
367
379
  execute('extract', [tar_exe, "#{tar_compression_switch(filename)}xf", file, "-C", target], {:cd => Dir.pwd, :initial_message => false})
368
380
  end
369
381
 
370
- def execute(action, command, options={})
371
- log_out = log_file(action)
382
+ # command could be an array of args, or one string containing a command passed to the shell. See
383
+ # Process.spawn for more information.
384
+ def execute(action, command, command_opts={})
385
+ opt_message = command_opts.fetch(:initial_message, true)
386
+ opt_debug = command_opts.fetch(:debug, false)
387
+ opt_cd = command_opts.fetch(:cd) { work_path }
388
+ opt_env = command_opts.fetch(:env) { Hash.new }
372
389
 
373
- Dir.chdir (options.fetch(:cd){ work_path }) do
374
- if options.fetch(:initial_message){ true }
375
- message "Running '#{action}' for #{@name} #{@version}... "
376
- end
390
+ log_out = log_file(action)
391
+
392
+ Dir.chdir(opt_cd) do
393
+ output "DEBUG: env is #{opt_env.inspect}" if opt_debug
394
+ output "DEBUG: command is #{command.inspect}" if opt_debug
395
+ message "Running '#{action}' for #{@name} #{@version}... " if opt_message
377
396
 
378
397
  if Process.respond_to?(:spawn) && ! RbConfig.respond_to?(:java)
379
- args = [command].flatten + [{[:out, :err]=>[log_out, "a"]}]
398
+ options = {[:out, :err]=>[log_out, "a"]}
399
+ output "DEBUG: options are #{options.inspect}" if opt_debug
400
+ args = [opt_env, command, options].flatten
380
401
  pid = spawn(*args)
381
402
  Process.wait(pid)
382
403
  else
383
- redirected = if command.kind_of?(Array)
384
- %Q{#{command.map(&:shellescape).join(" ")} > #{log_out.shellescape} 2>&1}
385
- else
386
- %Q{#{command} > #{log_out.shellescape} 2>&1}
387
- end
404
+ env_args = opt_env.map { |k,v| "#{k}=#{v}".shellescape }.join(" ")
405
+ c = if command.kind_of?(Array)
406
+ command.map(&:shellescape).join(" ")
407
+ else
408
+ command
409
+ end
410
+ redirected = %Q{env #{env_args} #{c} > #{log_out.shellescape} 2>&1}
411
+ output "DEBUG: final command is #{redirected.inspect}" if opt_debug
388
412
  system redirected
389
413
  end
390
414
 
@@ -448,15 +472,18 @@ private
448
472
  def download_file_http(url, full_path, count = 3)
449
473
  filename = File.basename(full_path)
450
474
  with_tempfile(filename, full_path) do |temp_file|
451
- progress = 0
452
475
  total = 0
453
476
  params = {
454
477
  "Accept-Encoding" => 'identity',
455
478
  :content_length_proc => lambda{|length| total = length },
456
479
  :progress_proc => lambda{|bytes|
457
- new_progress = (bytes * 100) / total
458
- message "\rDownloading %s (%3d%%) " % [filename, new_progress]
459
- progress = new_progress
480
+ if total
481
+ new_progress = (bytes * 100) / total
482
+ message "\rDownloading %s (%3d%%) " % [filename, new_progress]
483
+ else
484
+ # Content-Length is unavailable because Transfer-Encoding is chunked
485
+ message "\rDownloading %s " % [filename]
486
+ end
460
487
  }
461
488
  }
462
489
  proxy_uri = URI.parse(url).scheme.downcase == 'https' ?
@@ -500,16 +527,15 @@ private
500
527
  end
501
528
 
502
529
  def download_file_ftp(uri, full_path)
530
+ require "net/ftp"
503
531
  filename = File.basename(uri.path)
504
532
  with_tempfile(filename, full_path) do |temp_file|
505
- progress = 0
506
533
  total = 0
507
534
  params = {
508
535
  :content_length_proc => lambda{|length| total = length },
509
536
  :progress_proc => lambda{|bytes|
510
537
  new_progress = (bytes * 100) / total
511
538
  message "\rDownloading %s (%3d%%) " % [filename, new_progress]
512
- progress = new_progress
513
539
  }
514
540
  }
515
541
  if ENV["ftp_proxy"]
@@ -525,6 +551,8 @@ private
525
551
  end
526
552
  output
527
553
  end
554
+ rescue LoadError
555
+ raise LoadError, "Ruby #{RUBY_VERSION} does not provide the net-ftp gem, please add it as a dependency if you need to use FTP"
528
556
  rescue Net::FTPError
529
557
  return false
530
558
  end
@@ -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.3.0"
2
+ VERSION = "2.5.3"
3
3
  end
@@ -1,42 +1,42 @@
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_development_dependency "bundler", "~> 2.1"
37
+ spec.add_development_dependency "minitar", "~> 0.7"
38
+ spec.add_development_dependency "minitest", "~> 5.11"
39
+ spec.add_development_dependency "minitest-hooks", "~> 1.5.0"
40
+ spec.add_development_dependency "rake", "~> 13.0"
41
+ spec.add_development_dependency "webrick", "~> 1.0"
42
42
  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
@@ -18,10 +18,12 @@ describe "recipe download" do
18
18
  end
19
19
  end
20
20
 
21
- block.call
22
-
23
- thread.kill
24
- server.close
21
+ begin
22
+ block.call
23
+ ensure
24
+ thread.kill
25
+ server.close
26
+ end
25
27
 
26
28
  request_count.must_be :>, 0
27
29
  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.3.0
4
+ version: 2.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luis Lavena
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-09-13 00:00:00.000000000 Z
13
+ date: 2021-05-31 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -18,84 +18,84 @@ dependencies:
18
18
  requirements:
19
19
  - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: '1.7'
21
+ version: '2.1'
22
22
  type: :development
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - "~>"
27
27
  - !ruby/object:Gem::Version
28
- version: '1.7'
28
+ version: '2.1'
29
29
  - !ruby/object:Gem::Dependency
30
- name: rake
30
+ name: minitar
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - "~>"
34
34
  - !ruby/object:Gem::Version
35
- version: '12.0'
35
+ version: '0.7'
36
36
  type: :development
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: '12.0'
42
+ version: '0.7'
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: minitest
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - "~>"
48
48
  - !ruby/object:Gem::Version
49
- version: '5.8'
49
+ version: '5.11'
50
50
  type: :development
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - "~>"
55
55
  - !ruby/object:Gem::Version
56
- version: '5.8'
56
+ version: '5.11'
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: minitest-hooks
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - "~>"
62
62
  - !ruby/object:Gem::Version
63
- version: '1.4'
63
+ version: 1.5.0
64
64
  type: :development
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - "~>"
69
69
  - !ruby/object:Gem::Version
70
- version: '1.4'
70
+ version: 1.5.0
71
71
  - !ruby/object:Gem::Dependency
72
- name: minitar
72
+ name: rake
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
75
  - - "~>"
76
76
  - !ruby/object:Gem::Version
77
- version: '0.5'
77
+ version: '13.0'
78
78
  type: :development
79
79
  prerelease: false
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
82
  - - "~>"
83
83
  - !ruby/object:Gem::Version
84
- version: '0.5'
84
+ version: '13.0'
85
85
  - !ruby/object:Gem::Dependency
86
- name: concourse
86
+ name: webrick
87
87
  requirement: !ruby/object:Gem::Requirement
88
88
  requirements:
89
89
  - - "~>"
90
90
  - !ruby/object:Gem::Version
91
- version: '0.12'
91
+ version: '1.0'
92
92
  type: :development
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
96
  - - "~>"
97
97
  - !ruby/object:Gem::Version
98
- version: '0.12'
98
+ version: '1.0'
99
99
  description: Simplistic port-like solution for developers. It provides a standard
100
100
  and simplified way to compile against dependency libraries without messing up your
101
101
  system.
@@ -104,18 +104,15 @@ executables: []
104
104
  extensions: []
105
105
  extra_rdoc_files: []
106
106
  files:
107
- - ".concourse.yml"
107
+ - ".github/FUNDING.yml"
108
+ - ".github/workflows/ci.yml"
108
109
  - ".gitignore"
109
- - ".travis.yml"
110
110
  - CHANGELOG.md
111
111
  - Gemfile
112
112
  - LICENSE.txt
113
113
  - README.md
114
114
  - Rakefile
115
- - appveyor.yml
116
- - concourse/mini_portile.yml
117
- - concourse/tasks/rake-test/task.ps1
118
- - concourse/tasks/rake-test/task.sh
115
+ - SECURITY.md
119
116
  - lib/mini_portile2.rb
120
117
  - lib/mini_portile2/mini_portile.rb
121
118
  - lib/mini_portile2/mini_portile_cmake.rb
@@ -135,8 +132,9 @@ files:
135
132
  - test/test_cook.rb
136
133
  - test/test_digest.rb
137
134
  - test/test_download.rb
135
+ - test/test_execute.rb
138
136
  - test/test_proxy.rb
139
- homepage: http://github.com/flavorjones/mini_portile
137
+ homepage: https://github.com/flavorjones/mini_portile
140
138
  licenses:
141
139
  - MIT
142
140
  metadata: {}
@@ -148,15 +146,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
148
146
  requirements:
149
147
  - - ">="
150
148
  - !ruby/object:Gem::Version
151
- version: 1.9.2
149
+ version: 2.3.0
152
150
  required_rubygems_version: !ruby/object:Gem::Requirement
153
151
  requirements:
154
152
  - - ">="
155
153
  - !ruby/object:Gem::Version
156
154
  version: '0'
157
155
  requirements: []
158
- rubyforge_project:
159
- rubygems_version: 2.6.12
156
+ rubygems_version: 3.1.4
160
157
  signing_key:
161
158
  specification_version: 4
162
159
  summary: Simplistic port-like solution for developers
@@ -175,4 +172,5 @@ test_files:
175
172
  - test/test_cook.rb
176
173
  - test/test_digest.rb
177
174
  - test/test_download.rb
175
+ - test/test_execute.rb
178
176
  - 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