puppetfile-resolver 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/puppetfile-resolver/data/ruby_ca_certs.pem +67 -79
- data/lib/puppetfile-resolver/resolution_provider.rb +15 -8
- data/lib/puppetfile-resolver/resolver.rb +2 -1
- data/lib/puppetfile-resolver/spec_searchers/configuration.rb +21 -0
- data/lib/puppetfile-resolver/spec_searchers/forge.rb +17 -19
- data/lib/puppetfile-resolver/spec_searchers/forge_configuration.rb +17 -0
- data/lib/puppetfile-resolver/spec_searchers/git.rb +15 -3
- data/lib/puppetfile-resolver/spec_searchers/git_configuration.rb +9 -0
- data/lib/puppetfile-resolver/spec_searchers/local.rb +3 -2
- data/lib/puppetfile-resolver/spec_searchers/local_configuration.rb +13 -0
- data/lib/puppetfile-resolver/util.rb +24 -0
- data/lib/puppetfile-resolver/version.rb +1 -1
- data/puppetfile-cli.rb +14 -1
- data/spec/fixtures/modulepath/test_module/README.md +1 -0
- data/spec/fixtures/modulepath/test_module/metadata.json +9 -0
- data/spec/fixtures/proxy.rb +9 -0
- data/spec/integration/deprecation_spec.rb +32 -0
- data/spec/integration/kitchensink_spec.rb +44 -0
- data/spec/integration/proxy_spec.rb +91 -0
- data/spec/spec_helper.rb +2 -0
- data/spec/unit/puppetfile-resolver/resolver_spec.rb +1 -1
- metadata +24 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13421ecc14c66fd0cd147d6cfd5f20dc62c1ef3afb4e337582c95299ace22da5
|
4
|
+
data.tar.gz: 2c17b4f6b538189298a17baef3c9986104123026877c0181ffab7861c31d9656
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14b4bf1ae349fa8387f7444f1de8080e3a9ad41944a108695cc559a6dbff783eb7a6dffaf4ebba2ba438ced4d9c397afd9ce0519f28b345043d1f6c2eb4ab719
|
7
|
+
data.tar.gz: 89f06203dc1bc4c0db58c43489cb73e5b6aca114c0e75218b217f2c35fd6ca9a942d38b9de047cb221d62c02e42374330f8f88eb43068fe407f64e634638476e
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
[![
|
1
|
+
[![CI for Puppetfile Resolver](https://github.com/glennsarti/puppetfile-resolver/workflows/CI%20for%20Puppetfile%20Resolver/badge.svg)](https://github.com/glennsarti/puppetfile-resolver/actions?query=workflow%3A%22CI+for+Puppetfile+Resolver%22)
|
2
2
|
[![Gem Version](https://img.shields.io/gem/v/puppetfile-resolver)](https://rubygems.org/gems/puppetfile-resolver)
|
3
3
|
|
4
4
|
# Puppetfile Resolver
|
@@ -1,7 +1,7 @@
|
|
1
1
|
##
|
2
2
|
## Bundle of CA Root Certificates
|
3
3
|
##
|
4
|
-
## Certificate data from Mozilla as of:
|
4
|
+
## Certificate data from Mozilla as of: Tue Dec 8 04:12:05 2020 GMT
|
5
5
|
##
|
6
6
|
## This is a bundle of X.509 certificates of public Certificate Authorities
|
7
7
|
## (CA). These were automatically extracted from Mozilla's root certificates
|
@@ -14,7 +14,7 @@
|
|
14
14
|
## Just configure this file as the SSLCACertificateFile.
|
15
15
|
##
|
16
16
|
## Conversion done with mk-ca-bundle.pl version 1.28.
|
17
|
-
## SHA256:
|
17
|
+
## SHA256: d820b8696d8ffe42064a1384a56a8981cdc7e7e198036bbb5fa04a6c282dd9a2
|
18
18
|
##
|
19
19
|
|
20
20
|
|
@@ -448,36 +448,6 @@ KVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEYWQPJIrSPnNVeKtelttQKbfi3
|
|
448
448
|
QBFGmh95DmK/D5fs4C8fF5Q=
|
449
449
|
-----END CERTIFICATE-----
|
450
450
|
|
451
|
-
Taiwan GRCA
|
452
|
-
===========
|
453
|
-
-----BEGIN CERTIFICATE-----
|
454
|
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|
482
452
|
===========================
|
483
453
|
-----BEGIN CERTIFICATE-----
|
@@ -806,29 +776,6 @@ FAkK+qDmfQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdvGDeA
|
|
806
776
|
U/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY=
|
807
777
|
-----END CERTIFICATE-----
|
808
778
|
|
809
|
-
OISTE WISeKey Global Root GA CA
|
810
|
-
===============================
|
811
|
-
-----BEGIN CERTIFICATE-----
|
812
|
-
MIID8TCCAtmgAwIBAgIQQT1yx/RrH4FDffHSKFTfmjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UE
|
813
|
-
BhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxGzAZBgNVBAsTEkNvcHlyaWdodCAoYykgMjAwNTEiMCAG
|
814
|
-
A1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNlZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBH
|
815
|
-
bG9iYWwgUm9vdCBHQSBDQTAeFw0wNTEyMTExNjAzNDRaFw0zNzEyMTExNjA5NTFaMIGKMQswCQYD
|
816
|
-
VQQGEwJDSDEQMA4GA1UEChMHV0lTZUtleTEbMBkGA1UECxMSQ29weXJpZ2h0IChjKSAyMDA1MSIw
|
817
|
-
IAYDVQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5
|
818
|
-
IEdsb2JhbCBSb290IEdBIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy0+zAJs9
|
819
|
-
Nt350UlqaxBJH+zYK7LG+DKBKUOVTJoZIyEVRd7jyBxRVVuuk+g3/ytr6dTqvirdqFEr12bDYVxg
|
820
|
-
Asj1znJ7O7jyTmUIms2kahnBAbtzptf2w93NvKSLtZlhuAGio9RN1AU9ka34tAhxZK9w8RxrfvbD
|
821
|
-
d50kc3vkDIzh2TbhmYsFmQvtRTEJysIA2/dyoJaqlYfQjse2YXMNdmaM3Bu0Y6Kff5MTMPGhJ9vZ
|
822
|
-
/yxViJGg4E8HsChWjBgbl0SOid3gF27nKu+POQoxhILYQBRJLnpB5Kf+42TMwVlxSywhp1t94B3R
|
823
|
-
LoGbw9ho972WG6xwsRYUC9tguSYBBQIDAQABo1EwTzALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUw
|
824
|
-
AwEB/zAdBgNVHQ4EFgQUswN+rja8sHnR3JQmthG+IbJphpQwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ
|
825
|
-
KoZIhvcNAQEFBQADggEBAEuh/wuHbrP5wUOxSPMowB0uyQlB+pQAHKSkq0lPjz0e701vvbyk9vIm
|
826
|
-
MMkQyh2I+3QZH4VFvbBsUfk2ftv1TDI6QU9bR8/oCy22xBmddMVHxjtqD6wU2zz0c5ypBd8A3HR4
|
827
|
-
+vg1YFkCExh8vPtNsCBtQ7tgMHpnM1zFmdH4LTlSc/uMqpclXHLZCB6rTjzjgTGfA6b7wP4piFXa
|
828
|
-
hNVQA7bihKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZiFj4A4xylNoEY
|
829
|
-
okxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ/L7fCg0=
|
830
|
-
-----END CERTIFICATE-----
|
831
|
-
|
832
779
|
Certigna
|
833
780
|
========
|
834
781
|
-----BEGIN CERTIFICATE-----
|
@@ -1709,30 +1656,6 @@ P0HHRwA11fXT91Q+gT3aSWqas+8QPebrb9HIIkfLzM8BMZLZGOMivgkeGj5asuRrDFR6fUNOuIml
|
|
1709
1656
|
e9eiPZaGzPImNC1qkp2aGtAw4l1OBLBfiyB+d8E9lYLRRpo7PHi4b6HQDWSieB4pTpPDpFQUWw==
|
1710
1657
|
-----END CERTIFICATE-----
|
1711
1658
|
|
1712
|
-
EE Certification Centre Root CA
|
1713
|
-
===============================
|
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
|
1727
|
-
MEUGA1UdJQQ+MDwGCCsGAQUFBwMCBggrBgEFBQcDAQYIKwYBBQUHAwMGCCsGAQUFBwMEBggrBgEF
|
1728
|
-
BQcDCAYIKwYBBQUHAwkwDQYJKoZIhvcNAQEFBQADggEBAHv25MANqhlHt01Xo/6tu7Fq1Q+e2+Rj
|
1729
|
-
xY6hUFaTlrg4wCQiZrxTFGGVv9DHKpY5P30osxBAIWrEr7BSdxjhlthWXePdNl4dp1BUoMUq5KqM
|
1730
|
-
lIpPnTX/dqQGE5Gion0ARD9V04I8GtVbvFZMIi5GQ4okQC3zErg7cBqklrkar4dBGmoYDQZPxz5u
|
1731
|
-
uSlNDUmJEYcyW+ZLBMjkXOZ0c5RdFpgTlf7727FE5TpwrDdr5rMzcijJs1eg9gIWiAYLtqZLICjU
|
1732
|
-
3j2LrTcFU3T+bsy8QxdxXvnFzBqpYe73dgzzcvRyrc9yAjYHR8/vGVCJYMzpJJUPwssd8m92kMfM
|
1733
|
-
dcGWxZ0=
|
1734
|
-
-----END CERTIFICATE-----
|
1735
|
-
|
1736
1659
|
D-TRUST Root Class 3 CA 2 2009
|
1737
1660
|
==============================
|
1738
1661
|
-----BEGIN CERTIFICATE-----
|
@@ -3445,3 +3368,68 @@ Sxfj03k9bWtJySgOLnRQvwzZRjoQhsmnP+mg7H/rpXdYaXHmgwo38oZJar55CJD2AhZkPuXaTH4M
|
|
3445
3368
|
NMn5X7azKFGnpyuqSfqNZSlO42sTp5SjLVFteAxEy9/eCG/Oo2Sr05WE1LlSVHJ7liXMvGnjSG4N
|
3446
3369
|
0MedJ5qq+BOS3R7fY581qRY27Iy4g/Q9iY/NtBde17MXQRBdJ3NghVdJIgc=
|
3447
3370
|
-----END CERTIFICATE-----
|
3371
|
+
|
3372
|
+
Trustwave Global Certification Authority
|
3373
|
+
========================================
|
3374
|
+
-----BEGIN CERTIFICATE-----
|
3375
|
+
MIIF2jCCA8KgAwIBAgIMBfcOhtpJ80Y1LrqyMA0GCSqG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DMHzLJ8n9HmYAsC7TIS+OMxZsmO0QqAfWzJPP
|
3401
|
+
29FpHOTKyeC2nOnOcXHebD8WpHk=
|
3402
|
+
-----END CERTIFICATE-----
|
3403
|
+
|
3404
|
+
Trustwave Global ECC P256 Certification Authority
|
3405
|
+
=================================================
|
3406
|
+
-----BEGIN CERTIFICATE-----
|
3407
|
+
MIICYDCCAgegAwIBAgIMDWpfCD8oXD5Rld9dMAoGCCqGSM49BAMCMIGRMQswCQYDVQQGEwJVUzER
|
3408
|
+
MA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0NoaWNhZ28xITAfBgNVBAoTGFRydXN0d2F2ZSBI
|
3409
|
+
b2xkaW5ncywgSW5jLjE6MDgGA1UEAxMxVHJ1c3R3YXZlIEdsb2JhbCBFQ0MgUDI1NiBDZXJ0aWZp
|
3410
|
+
Y2F0aW9uIEF1dGhvcml0eTAeFw0xNzA4MjMxOTM1MTBaFw00MjA4MjMxOTM1MTBaMIGRMQswCQYD
|
3411
|
+
VQQGEwJVUzERMA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0NoaWNhZ28xITAfBgNVBAoTGFRy
|
3412
|
+
dXN0d2F2ZSBIb2xkaW5ncywgSW5jLjE6MDgGA1UEAxMxVHJ1c3R3YXZlIEdsb2JhbCBFQ0MgUDI1
|
3413
|
+
NiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABH77bOYj
|
3414
|
+
43MyCMpg5lOcunSNGLB4kFKA3TjASh3RqMyTpJcGOMoNFWLGjgEqZZ2q3zSRLoHB5DOSMcT9CTqm
|
3415
|
+
P62jQzBBMA8GA1UdEwEB/wQFMAMBAf8wDwYDVR0PAQH/BAUDAwcGADAdBgNVHQ4EFgQUo0EGrJBt
|
3416
|
+
0UrrdaVKEJmzsaGLSvcwCgYIKoZIzj0EAwIDRwAwRAIgB+ZU2g6gWrKuEZ+Hxbb/ad4lvvigtwjz
|
3417
|
+
RM4q3wghDDcCIC0mA6AFvWvR9lz4ZcyGbbOcNEhjhAnFjXca4syc4XR7
|
3418
|
+
-----END CERTIFICATE-----
|
3419
|
+
|
3420
|
+
Trustwave Global ECC P384 Certification Authority
|
3421
|
+
=================================================
|
3422
|
+
-----BEGIN CERTIFICATE-----
|
3423
|
+
MIICnTCCAiSgAwIBAgIMCL2Fl2yZJ6SAaEc7MAoGCCqGSM49BAMDMIGRMQswCQYDVQQGEwJVUzER
|
3424
|
+
MA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0NoaWNhZ28xITAfBgNVBAoTGFRydXN0d2F2ZSBI
|
3425
|
+
b2xkaW5ncywgSW5jLjE6MDgGA1UEAxMxVHJ1c3R3YXZlIEdsb2JhbCBFQ0MgUDM4NCBDZXJ0aWZp
|
3426
|
+
Y2F0aW9uIEF1dGhvcml0eTAeFw0xNzA4MjMxOTM2NDNaFw00MjA4MjMxOTM2NDNaMIGRMQswCQYD
|
3427
|
+
VQQGEwJVUzERMA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0NoaWNhZ28xITAfBgNVBAoTGFRy
|
3428
|
+
dXN0d2F2ZSBIb2xkaW5ncywgSW5jLjE6MDgGA1UEAxMxVHJ1c3R3YXZlIEdsb2JhbCBFQ0MgUDM4
|
3429
|
+
NCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTB2MBAGByqGSM49AgEGBSuBBAAiA2IABGvaDXU1CDFH
|
3430
|
+
Ba5FmVXxERMuSvgQMSOjfoPTfygIOiYaOs+Xgh+AtycJj9GOMMQKmw6sWASr9zZ9lCOkmwqKi6vr
|
3431
|
+
/TklZvFe/oyujUF5nQlgziip04pt89ZF1PKYhDhloKNDMEEwDwYDVR0TAQH/BAUwAwEB/zAPBgNV
|
3432
|
+
HQ8BAf8EBQMDBwYAMB0GA1UdDgQWBBRVqYSJ0sEyvRjLbKYHTsjnnb6CkDAKBggqhkjOPQQDAwNn
|
3433
|
+
ADBkAjA3AZKXRRJ+oPM+rRk6ct30UJMDEr5E0k9BpIycnR+j9sKS50gU/k6bpZFXrsY3crsCMGcl
|
3434
|
+
CrEMXu6pY5Jv5ZAL/mYiykf9ijH3g/56vxC+GCsej/YpHpRZ744hN8tRmKVuSw==
|
3435
|
+
-----END CERTIFICATE-----
|
@@ -5,27 +5,34 @@ require 'puppetfile-resolver/cache/base'
|
|
5
5
|
require 'puppetfile-resolver/spec_searchers/forge'
|
6
6
|
require 'puppetfile-resolver/spec_searchers/git'
|
7
7
|
require 'puppetfile-resolver/spec_searchers/local'
|
8
|
+
require 'puppetfile-resolver/spec_searchers/configuration'
|
8
9
|
|
9
10
|
module PuppetfileResolver
|
10
11
|
class ResolutionProvider
|
11
12
|
include Molinillo::SpecificationProvider
|
12
13
|
|
13
14
|
# options
|
14
|
-
# module_paths
|
15
|
-
# strict_mode
|
15
|
+
# module_paths : Array of paths (Deprecated)
|
16
|
+
# strict_mode : [Boolean] Whether missing dependencies throw an error (default: false)
|
17
|
+
# spec_searcher_configuration : PuppetfileResolver::SpecSearchers::Configuration
|
16
18
|
def initialize(puppetfile_document, puppet_version, resolver_ui, options = {})
|
17
19
|
require 'semantic_puppet'
|
18
20
|
|
19
21
|
@puppetfile_document = puppetfile_document
|
20
22
|
raise 'The UI object must be of type Molinillo::UI' if resolver_ui.nil? || !resolver_ui.is_a?(Molinillo::UI)
|
21
23
|
@resolver_ui = resolver_ui
|
22
|
-
|
23
|
-
@puppet_module_paths = options[:module_paths].nil? ? [] : options[:module_paths]
|
24
|
+
@spec_searcher_configuration = options[:spec_searcher_configuration] || PuppetfileResolver::SpecSearchers::Configuration.new
|
24
25
|
@allow_missing_modules = options[:allow_missing_modules].nil? ? true : options[:allow_missing_modules] == true
|
25
26
|
# There can be only one puppet specification in existance so we pre-load here.
|
26
27
|
@puppet_specification = Models::PuppetSpecification.new(puppet_version)
|
27
28
|
@module_info = {}
|
28
29
|
@cache = options[:cache].nil? ? Cache::Base.new : options[:cache]
|
30
|
+
|
31
|
+
# Check for deprecated options
|
32
|
+
unless options[:module_paths].nil? # rubocop:disable Style/GuardClause
|
33
|
+
Warning.warn 'The use of the module_paths option has been deprecated'
|
34
|
+
@spec_searcher_configuration.local.puppet_module_paths = options[:module_paths]
|
35
|
+
end
|
29
36
|
end
|
30
37
|
|
31
38
|
# Search for the specifications that match the given dependency.
|
@@ -137,9 +144,9 @@ module PuppetfileResolver
|
|
137
144
|
unless mod.nil?
|
138
145
|
case mod.module_type
|
139
146
|
when Puppetfile::FORGE_MODULE
|
140
|
-
@module_info[dependency.name] = safe_spec_search(dependency) { SpecSearchers::Forge.find_all(dependency, @cache, @resolver_ui) }
|
147
|
+
@module_info[dependency.name] = safe_spec_search(dependency) { SpecSearchers::Forge.find_all(dependency, @cache, @resolver_ui, @spec_searcher_configuration.forge) }
|
141
148
|
when Puppetfile::GIT_MODULE
|
142
|
-
@module_info[dependency.name] = safe_spec_search(dependency) { SpecSearchers::Git.find_all(mod, dependency, @cache, @resolver_ui) }
|
149
|
+
@module_info[dependency.name] = safe_spec_search(dependency) { SpecSearchers::Git.find_all(mod, dependency, @cache, @resolver_ui, @spec_searcher_configuration.git) }
|
143
150
|
else # rubocop:disable Style/EmptyElse
|
144
151
|
# Errr.... Nothing
|
145
152
|
end
|
@@ -147,13 +154,13 @@ module PuppetfileResolver
|
|
147
154
|
return @module_info[dependency.name] unless @module_info[dependency.name].empty?
|
148
155
|
|
149
156
|
# It's not in the Puppetfile, so perhaps it's in our modulepath?
|
150
|
-
@module_info[dependency.name] = safe_spec_search(dependency) { SpecSearchers::Local.find_all(mod,
|
157
|
+
@module_info[dependency.name] = safe_spec_search(dependency) { SpecSearchers::Local.find_all(mod, dependency, @cache, @resolver_ui, @spec_searcher_configuration.local) }
|
151
158
|
return @module_info[dependency.name] unless @module_info[dependency.name].empty?
|
152
159
|
|
153
160
|
# It's not in the Puppetfile and not on disk, so perhaps it's on the Forge?
|
154
161
|
# The forge needs an owner and name to be able to resolve
|
155
162
|
if dependency.name && dependency.owner # rubocop:disable Style/IfUnlessModifier
|
156
|
-
@module_info[dependency.name] = safe_spec_search(dependency) { SpecSearchers::Forge.find_all(dependency, @cache, @resolver_ui) }
|
163
|
+
@module_info[dependency.name] = safe_spec_search(dependency) { SpecSearchers::Forge.find_all(dependency, @cache, @resolver_ui, @spec_searcher_configuration.forge) }
|
157
164
|
end
|
158
165
|
|
159
166
|
# If we can't find any specifications for the module and we're allowing missing modules
|
@@ -20,7 +20,8 @@ module PuppetfileResolver
|
|
20
20
|
|
21
21
|
# options
|
22
22
|
# :cache => Cache Object
|
23
|
-
# :module_paths => Array[String]
|
23
|
+
# :module_paths => Array[String] (Deprecated)
|
24
|
+
# :spec_searcher_configuration => PuppetfileResolver::SpecSearchers::Configuration
|
24
25
|
def resolve(options = {})
|
25
26
|
if options[:ui]
|
26
27
|
raise 'The UI object must be of type Molinillo::UI' unless options[:ui].is_a?(Molinillo::UI)
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'puppetfile-resolver/spec_searchers/forge_configuration'
|
4
|
+
require 'puppetfile-resolver/spec_searchers/git_configuration'
|
5
|
+
require 'puppetfile-resolver/spec_searchers/local_configuration'
|
6
|
+
|
7
|
+
module PuppetfileResolver
|
8
|
+
module SpecSearchers
|
9
|
+
class Configuration
|
10
|
+
attr_reader :local
|
11
|
+
attr_reader :forge
|
12
|
+
attr_reader :git
|
13
|
+
|
14
|
+
def initialize
|
15
|
+
@local = LocalConfiguration.new
|
16
|
+
@forge = ForgeConfiguration.new
|
17
|
+
@git = GitConfiguration.new
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -1,6 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'puppetfile-resolver/util'
|
3
4
|
require 'puppetfile-resolver/spec_searchers/common'
|
5
|
+
require 'puppetfile-resolver/spec_searchers/forge_configuration'
|
4
6
|
require 'uri'
|
5
7
|
require 'net/http'
|
6
8
|
require 'openssl'
|
@@ -9,9 +11,7 @@ require 'json'
|
|
9
11
|
module PuppetfileResolver
|
10
12
|
module SpecSearchers
|
11
13
|
module Forge
|
12
|
-
|
13
|
-
|
14
|
-
def self.find_all(dependency, cache, resolver_ui)
|
14
|
+
def self.find_all(dependency, cache, resolver_ui, config)
|
15
15
|
dep_id = ::PuppetfileResolver::SpecSearchers::Common.dependency_cache_id(self, dependency)
|
16
16
|
|
17
17
|
# Has the information been cached?
|
@@ -19,7 +19,7 @@ module PuppetfileResolver
|
|
19
19
|
|
20
20
|
result = []
|
21
21
|
# Query the forge
|
22
|
-
fetch_all_module_releases(dependency.owner, dependency.name, resolver_ui) do |partial_releases|
|
22
|
+
fetch_all_module_releases(dependency.owner, dependency.name, resolver_ui, config) do |partial_releases|
|
23
23
|
partial_releases.each do |release|
|
24
24
|
result << Models::ModuleSpecification.new(
|
25
25
|
name: release['module']['name'],
|
@@ -35,38 +35,36 @@ module PuppetfileResolver
|
|
35
35
|
result
|
36
36
|
end
|
37
37
|
|
38
|
-
def self.fetch_all_module_releases(owner, name,
|
38
|
+
def self.fetch_all_module_releases(owner, name, resolver_ui, config, &block)
|
39
39
|
raise 'Requires a block to yield' unless block
|
40
|
-
uri = ::URI.parse("#{
|
40
|
+
uri = ::URI.parse("#{config.forge_api}/v3/releases")
|
41
41
|
params = { :module => "#{owner}-#{name}", :exclude_fields => 'readme changelog license reference tasks', :limit => 50 }
|
42
42
|
uri.query = ::URI.encode_www_form(params)
|
43
43
|
|
44
44
|
loops = 0
|
45
45
|
loop do
|
46
46
|
resolver_ui.debug { "Querying the forge for a module with #{uri}" }
|
47
|
-
|
48
|
-
|
49
|
-
# Because on Windows Ruby doesn't use the Windows certificate store which has up-to date
|
50
|
-
# CA certs, we can't depend on someone setting the environment variable correctly. So use our
|
51
|
-
# static CA PEM file if SSL_CERT_FILE is not set.
|
52
|
-
http_options[:ca_file] = PuppetfileResolver::Util.static_ca_cert_file if ENV['SSL_CERT_FILE'].nil?
|
53
|
-
|
47
|
+
err_msg = "Unable to find module #{owner}-#{name} on #{config.forge_api}"
|
48
|
+
err_msg += config.proxy ? " with proxy #{config.proxy}: " : ': '
|
54
49
|
response = nil
|
55
|
-
|
56
|
-
|
57
|
-
response =
|
50
|
+
|
51
|
+
begin
|
52
|
+
response = ::PuppetfileResolver::Util.net_http_get(uri, config.proxy)
|
53
|
+
rescue ::StandardError => e
|
54
|
+
raise err_msg + e.message
|
58
55
|
end
|
59
|
-
|
56
|
+
|
57
|
+
raise err_msg + "Expected HTTP Code 200, but received #{response.code}" unless response.code == '200'
|
60
58
|
|
61
59
|
reply = ::JSON.parse(response.body)
|
62
60
|
yield reply['results']
|
63
61
|
|
64
62
|
break if reply['pagination'].nil? || reply['pagination']['next'].nil?
|
65
|
-
uri = ::URI.parse("#{
|
63
|
+
uri = ::URI.parse("#{config.forge_api}#{reply['pagination']['next']}")
|
66
64
|
|
67
65
|
# Circuit breaker in case the worst happens (max 1000 module releases)
|
68
66
|
loops += 1
|
69
|
-
raise "Too many Forge API requests #{loops
|
67
|
+
raise err_msg + "Too many Forge API requests #{loops}" if loops > 20
|
70
68
|
end
|
71
69
|
end
|
72
70
|
private_class_method :fetch_all_module_releases
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module PuppetfileResolver
|
4
|
+
module SpecSearchers
|
5
|
+
class ForgeConfiguration
|
6
|
+
DEFAULT_FORGE_URI ||= 'https://forgeapi.puppet.com'
|
7
|
+
|
8
|
+
def forge_api
|
9
|
+
@forge_api || DEFAULT_FORGE_URI
|
10
|
+
end
|
11
|
+
|
12
|
+
attr_writer :forge_api
|
13
|
+
|
14
|
+
attr_accessor :proxy
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -1,11 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'puppetfile-resolver/util'
|
3
4
|
require 'puppetfile-resolver/spec_searchers/common'
|
5
|
+
require 'puppetfile-resolver/spec_searchers/git_configuration'
|
4
6
|
|
5
7
|
module PuppetfileResolver
|
6
8
|
module SpecSearchers
|
7
9
|
module Git
|
8
|
-
def self.find_all(puppetfile_module, dependency, cache, resolver_ui)
|
10
|
+
def self.find_all(puppetfile_module, dependency, cache, resolver_ui, config)
|
9
11
|
dep_id = ::PuppetfileResolver::SpecSearchers::Common.dependency_cache_id(self, dependency)
|
10
12
|
# Has the information been cached?
|
11
13
|
return cache.load(dep_id) if cache.exist?(dep_id)
|
@@ -39,9 +41,19 @@ module PuppetfileResolver
|
|
39
41
|
require 'net/http'
|
40
42
|
require 'uri'
|
41
43
|
|
42
|
-
resolver_ui.debug { "Querying
|
43
|
-
|
44
|
+
resolver_ui.debug { "Querying GitHub with #{metadata_url}" }
|
45
|
+
err_msg = "Unable to find module at #{puppetfile_module.remote}"
|
46
|
+
err_msg += config.proxy ? " with proxy #{config.proxy}: " : ': '
|
47
|
+
response = nil
|
48
|
+
|
49
|
+
begin
|
50
|
+
response = ::PuppetfileResolver::Util.net_http_get(metadata_url, config.proxy)
|
51
|
+
rescue ::StandardError => e
|
52
|
+
raise err_msg + e.message
|
53
|
+
end
|
54
|
+
|
44
55
|
if response.code != '200'
|
56
|
+
resolver_ui.debug(err_msg + "Expected HTTP Code 200, but received #{response.code}")
|
45
57
|
cache.save(dep_id, [])
|
46
58
|
return []
|
47
59
|
end
|
@@ -1,18 +1,19 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'puppetfile-resolver/spec_searchers/common'
|
4
|
+
require 'puppetfile-resolver/spec_searchers/local_configuration'
|
4
5
|
|
5
6
|
module PuppetfileResolver
|
6
7
|
module SpecSearchers
|
7
8
|
module Local
|
8
|
-
def self.find_all(_puppetfile_module,
|
9
|
+
def self.find_all(_puppetfile_module, dependency, cache, resolver_ui, config)
|
9
10
|
dep_id = ::PuppetfileResolver::SpecSearchers::Common.dependency_cache_id(self, dependency)
|
10
11
|
# Has the information been cached?
|
11
12
|
return cache.load(dep_id) if cache.exist?(dep_id)
|
12
13
|
|
13
14
|
result = []
|
14
15
|
# Find the module in the modulepaths
|
15
|
-
puppet_module_paths.each do |module_path|
|
16
|
+
config.puppet_module_paths.each do |module_path|
|
16
17
|
next unless Dir.exist?(module_path)
|
17
18
|
module_dir = File.expand_path(File.join(module_path, dependency.name))
|
18
19
|
next unless Dir.exist?(module_dir)
|
@@ -19,5 +19,29 @@ module PuppetfileResolver
|
|
19
19
|
def self.static_ca_cert_file
|
20
20
|
@static_ca_cert_file ||= File.expand_path(File.join(__dir__, 'data', 'ruby_ca_certs.pem'))
|
21
21
|
end
|
22
|
+
|
23
|
+
# Execute a HTTP/S GET query and return the response
|
24
|
+
# @param [String, URI] uri The URI to request
|
25
|
+
# @param [nil, String, URI] proxy The URI of the proxy server to use. Defaults to nil (No proxy server)
|
26
|
+
# @return [Net::HTTPResponse] the response of the request
|
27
|
+
def self.net_http_get(uri, proxy = nil)
|
28
|
+
uri = URI.parse(uri) unless uri.is_a?(URI)
|
29
|
+
|
30
|
+
http_options = { :use_ssl => uri.class == URI::HTTPS }
|
31
|
+
# Because on Windows Ruby doesn't use the Windows certificate store which has up-to date
|
32
|
+
# CA certs, we can't depend on someone setting the environment variable correctly. So use our
|
33
|
+
# static CA PEM file if SSL_CERT_FILE is not set.
|
34
|
+
http_options[:ca_file] = PuppetfileResolver::Util.static_ca_cert_file if ENV['SSL_CERT_FILE'].nil?
|
35
|
+
|
36
|
+
start_args = [uri.host, uri.port]
|
37
|
+
|
38
|
+
unless proxy.nil?
|
39
|
+
proxy = URI.parse(proxy) unless proxy.is_a?(URI)
|
40
|
+
start_args.concat([proxy.host, proxy.port, proxy.user, proxy.password])
|
41
|
+
end
|
42
|
+
|
43
|
+
Net::HTTP.start(*start_args, http_options) { |http| return http.request(Net::HTTP::Get.new(uri)) }
|
44
|
+
nil
|
45
|
+
end
|
22
46
|
end
|
23
47
|
end
|
data/puppetfile-cli.rb
CHANGED
@@ -18,6 +18,7 @@ class CommandLineParser
|
|
18
18
|
cache_dir: nil,
|
19
19
|
module_paths: [],
|
20
20
|
path: nil,
|
21
|
+
proxy: nil,
|
21
22
|
puppet_version: nil,
|
22
23
|
strict: false
|
23
24
|
}
|
@@ -41,6 +42,10 @@ class CommandLineParser
|
|
41
42
|
args[:debug] = true
|
42
43
|
end
|
43
44
|
|
45
|
+
opts.on('--proxy=PROXY_URL', 'HTTP/S Proxy server to use. For example http://localhost:8888') do |proxy|
|
46
|
+
args[:proxy] = proxy
|
47
|
+
end
|
48
|
+
|
44
49
|
opts.on('-s', '--strict', 'Do not allow missing dependencies. Default false which marks dependencies as missing and does not raise an error.') do
|
45
50
|
args[:strict] = true
|
46
51
|
end
|
@@ -88,7 +93,15 @@ if options[:debug]
|
|
88
93
|
else
|
89
94
|
ui = nil
|
90
95
|
end
|
91
|
-
|
96
|
+
|
97
|
+
config = PuppetfileResolver::SpecSearchers::Configuration.new
|
98
|
+
config.local.puppet_module_paths = options[:module_paths]
|
99
|
+
unless options[:proxy].nil?
|
100
|
+
config.git.proxy = options[:proxy]
|
101
|
+
config.forge.proxy = options[:proxy]
|
102
|
+
end
|
103
|
+
|
104
|
+
opts = { cache: cache, ui: ui, spec_searcher_configuration: config, allow_missing_modules: !options[:strict] }
|
92
105
|
|
93
106
|
# Resolve
|
94
107
|
result = resolver.resolve(opts)
|
@@ -0,0 +1 @@
|
|
1
|
+
This test fixture contains a valid module with classes, types and functions.
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
require 'puppetfile-resolver/resolver'
|
4
|
+
require 'puppetfile-resolver/puppetfile'
|
5
|
+
|
6
|
+
|
7
|
+
describe 'Depreaction Tests' do
|
8
|
+
context 'With module_paths option' do
|
9
|
+
it 'should resolve a complete Puppetfile' do
|
10
|
+
|
11
|
+
content = <<-PUPFILE
|
12
|
+
forge 'https://forge.puppet.com'
|
13
|
+
|
14
|
+
# Local module path module
|
15
|
+
mod 'testfixture/test_module', :latest
|
16
|
+
PUPFILE
|
17
|
+
|
18
|
+
puppetfile = ::PuppetfileResolver::Puppetfile::Parser::R10KEval.parse(content)
|
19
|
+
resolver = PuppetfileResolver::Resolver.new(puppetfile)
|
20
|
+
|
21
|
+
expect(Warning).to receive(:warn).with(/module_paths/).and_return(nil)
|
22
|
+
|
23
|
+
result = resolver.resolve({
|
24
|
+
allow_missing_modules: false,
|
25
|
+
module_paths: [File.join(FIXTURES_DIR, 'modulepath')]
|
26
|
+
})
|
27
|
+
|
28
|
+
expect(result.specifications).to include('test_module')
|
29
|
+
expect(result.specifications['test_module'].version.to_s).to eq('0.1.0')
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
require 'puppetfile-resolver/resolver'
|
4
|
+
require 'puppetfile-resolver/puppetfile'
|
5
|
+
|
6
|
+
|
7
|
+
describe 'KitchenSink Tests' do
|
8
|
+
it 'should resolve a complete Puppetfile' do
|
9
|
+
|
10
|
+
content = <<-PUPFILE
|
11
|
+
forge 'https://forge.puppet.com'
|
12
|
+
|
13
|
+
mod 'powershell',
|
14
|
+
:git => 'https://github.com/puppetlabs/puppetlabs-powershell',
|
15
|
+
:tag => 'v4.0.0'
|
16
|
+
|
17
|
+
mod 'puppetlabs/stdlib', '6.3.0'
|
18
|
+
|
19
|
+
# Local module path module
|
20
|
+
mod 'testfixture/test_module', :latest
|
21
|
+
|
22
|
+
PUPFILE
|
23
|
+
|
24
|
+
puppetfile = ::PuppetfileResolver::Puppetfile::Parser::R10KEval.parse(content)
|
25
|
+
|
26
|
+
config = PuppetfileResolver::SpecSearchers::Configuration.new
|
27
|
+
config.local.puppet_module_paths = [File.join(FIXTURES_DIR, 'modulepath')]
|
28
|
+
|
29
|
+
resolver = PuppetfileResolver::Resolver.new(puppetfile)
|
30
|
+
result = resolver.resolve({
|
31
|
+
allow_missing_modules: false,
|
32
|
+
spec_searcher_configuration: config,
|
33
|
+
})
|
34
|
+
|
35
|
+
expect(result.specifications).to include('powershell')
|
36
|
+
expect(result.specifications['powershell'].version.to_s).to eq('4.0.0')
|
37
|
+
|
38
|
+
expect(result.specifications).to include('stdlib')
|
39
|
+
expect(result.specifications['stdlib'].version.to_s).to eq('6.3.0')
|
40
|
+
|
41
|
+
expect(result.specifications).to include('test_module')
|
42
|
+
expect(result.specifications['test_module'].version.to_s).to eq('0.1.0')
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,91 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'open3'
|
3
|
+
require 'puppetfile-resolver/resolver'
|
4
|
+
require 'puppetfile-resolver/puppetfile'
|
5
|
+
|
6
|
+
describe 'Proxy Tests' do
|
7
|
+
let(:content) do <<-PUPFILE
|
8
|
+
forge 'https://forge.puppet.com'
|
9
|
+
|
10
|
+
mod 'powershell',
|
11
|
+
:git => 'https://github.com/puppetlabs/puppetlabs-powershell',
|
12
|
+
:tag => 'v4.0.0'
|
13
|
+
|
14
|
+
mod 'puppetlabs/stdlib', '6.3.0'
|
15
|
+
PUPFILE
|
16
|
+
end
|
17
|
+
let(:puppetfile) { ::PuppetfileResolver::Puppetfile::Parser::R10KEval.parse(content) }
|
18
|
+
let(:resolver_config) do
|
19
|
+
PuppetfileResolver::SpecSearchers::Configuration.new.tap do |obj|
|
20
|
+
obj.git.proxy = 'http://localhost:32768'
|
21
|
+
obj.forge.proxy = 'http://localhost:32768'
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
context 'with an invalid proxy server' do
|
26
|
+
it 'should not resolve a complete Puppetfile' do
|
27
|
+
resolver = PuppetfileResolver::Resolver.new(puppetfile)
|
28
|
+
result = resolver.resolve({
|
29
|
+
allow_missing_modules: true,
|
30
|
+
spec_searcher_configuration: resolver_config,
|
31
|
+
})
|
32
|
+
|
33
|
+
expect(result.specifications).to include('powershell')
|
34
|
+
expect(result.specifications['powershell']).to be_a(PuppetfileResolver::Models::MissingModuleSpecification)
|
35
|
+
|
36
|
+
expect(result.specifications).to include('stdlib')
|
37
|
+
expect(result.specifications['stdlib']).to be_a(PuppetfileResolver::Models::MissingModuleSpecification)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
context 'with a valid proxy server' do
|
42
|
+
def start_proxy_server(start_options = ['--timeout=5'])
|
43
|
+
cmd = "ruby \"#{File.join(FIXTURES_DIR, 'proxy.rb')}\" 32768"
|
44
|
+
|
45
|
+
stdin, stdout, stderr, wait_thr = Open3.popen3(cmd)
|
46
|
+
# Wait for the Proxy server to indicate it started
|
47
|
+
line = nil
|
48
|
+
begin
|
49
|
+
line = stderr.readline
|
50
|
+
end until line =~ /#start/
|
51
|
+
stdout.close
|
52
|
+
stdin.close
|
53
|
+
[wait_thr, stderr]
|
54
|
+
end
|
55
|
+
|
56
|
+
before(:each) do
|
57
|
+
@server_thr, @server_pipe = start_proxy_server
|
58
|
+
end
|
59
|
+
|
60
|
+
after(:each) do
|
61
|
+
begin
|
62
|
+
Process.kill("KILL", @server_thr[:pid])
|
63
|
+
Process.wait(@server_thr[:pid])
|
64
|
+
rescue
|
65
|
+
# The server process may not exist and checking in a cross platform way in ruby is difficult
|
66
|
+
# Instead just swallow any errors
|
67
|
+
end
|
68
|
+
|
69
|
+
begin
|
70
|
+
@server_pipe.close
|
71
|
+
rescue
|
72
|
+
# The server process may not exist and checking in a cross platform way in ruby is difficult
|
73
|
+
# Instead just swallow any errors
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
it 'should resolve a complete Puppetfile' do
|
78
|
+
resolver = PuppetfileResolver::Resolver.new(puppetfile)
|
79
|
+
result = resolver.resolve({
|
80
|
+
allow_missing_modules: false,
|
81
|
+
spec_searcher_configuration: resolver_config,
|
82
|
+
})
|
83
|
+
|
84
|
+
expect(result.specifications).to include('powershell')
|
85
|
+
expect(result.specifications['powershell'].version.to_s).to eq('4.0.0')
|
86
|
+
|
87
|
+
expect(result.specifications).to include('stdlib')
|
88
|
+
expect(result.specifications['stdlib'].version.to_s).to eq('6.3.0')
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -4,6 +4,8 @@ root = File.join(__dir__,'..',)
|
|
4
4
|
# Add the language server into the load path
|
5
5
|
$LOAD_PATH.unshift(File.join(root,'lib'))
|
6
6
|
|
7
|
+
FIXTURES_DIR = File.join(__dir__,'fixtures')
|
8
|
+
|
7
9
|
# A cache which we can preload for the purposes of testing, mimicing
|
8
10
|
# Local modules
|
9
11
|
require 'puppetfile-resolver/cache/base'
|
@@ -7,7 +7,7 @@ describe PuppetfileResolver::Resolver do
|
|
7
7
|
let(:puppet_version) { nil }
|
8
8
|
let(:subject) { PuppetfileResolver::Resolver.new(puppetfile_document, puppet_version) }
|
9
9
|
let(:cache) { MockLocalModuleCache.new }
|
10
|
-
let(:default_resolve_options) { { cache: cache
|
10
|
+
let(:default_resolve_options) { { cache: cache } }
|
11
11
|
let(:resolve_options) { default_resolve_options }
|
12
12
|
|
13
13
|
RSpec.shared_examples 'a resolver flag' do |flag|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppetfile-resolver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Glenn Sarti
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: molinillo
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.0'
|
41
41
|
description: Resolves the Puppet Modules in a Puppetfile with a full dependency graph,
|
42
|
-
including Puppet version
|
42
|
+
including Puppet version checks.
|
43
43
|
email:
|
44
44
|
- glennsarti@users.noreply.github.com
|
45
45
|
executables: []
|
@@ -81,14 +81,24 @@ files:
|
|
81
81
|
- lib/puppetfile-resolver/resolution_result.rb
|
82
82
|
- lib/puppetfile-resolver/resolver.rb
|
83
83
|
- lib/puppetfile-resolver/spec_searchers/common.rb
|
84
|
+
- lib/puppetfile-resolver/spec_searchers/configuration.rb
|
84
85
|
- lib/puppetfile-resolver/spec_searchers/forge.rb
|
86
|
+
- lib/puppetfile-resolver/spec_searchers/forge_configuration.rb
|
85
87
|
- lib/puppetfile-resolver/spec_searchers/git.rb
|
88
|
+
- lib/puppetfile-resolver/spec_searchers/git_configuration.rb
|
86
89
|
- lib/puppetfile-resolver/spec_searchers/local.rb
|
90
|
+
- lib/puppetfile-resolver/spec_searchers/local_configuration.rb
|
87
91
|
- lib/puppetfile-resolver/ui/debug_ui.rb
|
88
92
|
- lib/puppetfile-resolver/ui/null_ui.rb
|
89
93
|
- lib/puppetfile-resolver/util.rb
|
90
94
|
- lib/puppetfile-resolver/version.rb
|
91
95
|
- puppetfile-cli.rb
|
96
|
+
- spec/fixtures/modulepath/test_module/README.md
|
97
|
+
- spec/fixtures/modulepath/test_module/metadata.json
|
98
|
+
- spec/fixtures/proxy.rb
|
99
|
+
- spec/integration/deprecation_spec.rb
|
100
|
+
- spec/integration/kitchensink_spec.rb
|
101
|
+
- spec/integration/proxy_spec.rb
|
92
102
|
- spec/spec_helper.rb
|
93
103
|
- spec/unit/puppetfile-resolver/puppetfile/document_spec.rb
|
94
104
|
- spec/unit/puppetfile-resolver/puppetfile/parser/r10k_eval_spec.rb
|
@@ -97,7 +107,7 @@ homepage: https://glennsarti.github.io/puppetfile-resolver/
|
|
97
107
|
licenses:
|
98
108
|
- Apache-2.0
|
99
109
|
metadata: {}
|
100
|
-
post_install_message:
|
110
|
+
post_install_message:
|
101
111
|
rdoc_options: []
|
102
112
|
require_paths:
|
103
113
|
- lib
|
@@ -105,18 +115,24 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
105
115
|
requirements:
|
106
116
|
- - ">="
|
107
117
|
- !ruby/object:Gem::Version
|
108
|
-
version: 2.
|
118
|
+
version: 2.5.3
|
109
119
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
120
|
requirements:
|
111
121
|
- - ">="
|
112
122
|
- !ruby/object:Gem::Version
|
113
123
|
version: '0'
|
114
124
|
requirements: []
|
115
|
-
rubygems_version: 3.1.
|
116
|
-
signing_key:
|
125
|
+
rubygems_version: 3.1.4
|
126
|
+
signing_key:
|
117
127
|
specification_version: 4
|
118
128
|
summary: Dependency resolver for Puppetfiles
|
119
129
|
test_files:
|
130
|
+
- spec/fixtures/modulepath/test_module/metadata.json
|
131
|
+
- spec/fixtures/modulepath/test_module/README.md
|
132
|
+
- spec/fixtures/proxy.rb
|
133
|
+
- spec/integration/deprecation_spec.rb
|
134
|
+
- spec/integration/kitchensink_spec.rb
|
135
|
+
- spec/integration/proxy_spec.rb
|
120
136
|
- spec/spec_helper.rb
|
121
137
|
- spec/unit/puppetfile-resolver/puppetfile/document_spec.rb
|
122
138
|
- spec/unit/puppetfile-resolver/puppetfile/parser/r10k_eval_spec.rb
|