simp-module-repoclosure 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. checksums.yaml +7 -0
  2. data/.document +3 -0
  3. data/.gitignore +20 -0
  4. data/.rspec +2 -0
  5. data/.travis.yml +6 -0
  6. data/.yardopts +1 -0
  7. data/ChangeLog.md +4 -0
  8. data/Gemfile +13 -0
  9. data/Guardfile +78 -0
  10. data/LICENSE +27 -0
  11. data/LICENSE.txt +202 -0
  12. data/NOTICE.txt +5 -0
  13. data/README.md +99 -0
  14. data/Rakefile +32 -0
  15. data/docs/img/simp-module-repoclosure design.png +0 -0
  16. data/docs/img/simp-module-repoclosure design.svg +2430 -0
  17. data/docs/img/simp-module-repoclosure tests.png +0 -0
  18. data/docs/img/simp-module-repoclosure tests.svg +1 -0
  19. data/docs/simp-module-repoclosure design.gliffy +1 -0
  20. data/docs/simp-module-repoclosure tests.gliffy +1 -0
  21. data/lib/simp/module/repoclosure.rb +207 -0
  22. data/lib/simp/module/repoclosure/version.rb +27 -0
  23. data/simp-module-repoclosure.gemspec +40 -0
  24. data/spec/files/modules/dep1/Gemfile +14 -0
  25. data/spec/files/modules/dep1/README.md +83 -0
  26. data/spec/files/modules/dep1/Rakefile +17 -0
  27. data/spec/files/modules/dep1/manifests/init.pp +48 -0
  28. data/spec/files/modules/dep1/metadata.json +15 -0
  29. data/spec/files/modules/dep1/spec/classes/init_spec.rb +7 -0
  30. data/spec/files/modules/dep1/spec/spec_helper.rb +1 -0
  31. data/spec/files/modules/dep1/tests/init.pp +12 -0
  32. data/spec/files/modules/dep2/Gemfile +14 -0
  33. data/spec/files/modules/dep2/README.md +83 -0
  34. data/spec/files/modules/dep2/Rakefile +17 -0
  35. data/spec/files/modules/dep2/manifests/init.pp +48 -0
  36. data/spec/files/modules/dep2/metadata.json +14 -0
  37. data/spec/files/modules/dep2/spec/classes/init_spec.rb +7 -0
  38. data/spec/files/modules/dep2/spec/spec_helper.rb +1 -0
  39. data/spec/files/modules/dep2/tests/init.pp +12 -0
  40. data/spec/files/modules/dep3/Gemfile +14 -0
  41. data/spec/files/modules/dep3/README.md +83 -0
  42. data/spec/files/modules/dep3/Rakefile +17 -0
  43. data/spec/files/modules/dep3/manifests/init.pp +48 -0
  44. data/spec/files/modules/dep3/metadata.json +14 -0
  45. data/spec/files/modules/dep3/spec/classes/init_spec.rb +7 -0
  46. data/spec/files/modules/dep3/spec/spec_helper.rb +1 -0
  47. data/spec/files/modules/dep3/tests/init.pp +12 -0
  48. data/spec/files/modules/dep3a/Gemfile +14 -0
  49. data/spec/files/modules/dep3a/README.md +83 -0
  50. data/spec/files/modules/dep3a/Rakefile +17 -0
  51. data/spec/files/modules/dep3a/manifests/init.pp +48 -0
  52. data/spec/files/modules/dep3a/metadata.json +14 -0
  53. data/spec/files/modules/dep3a/spec/classes/init_spec.rb +7 -0
  54. data/spec/files/modules/dep3a/spec/spec_helper.rb +1 -0
  55. data/spec/files/modules/dep3a/tests/init.pp +12 -0
  56. data/spec/files/modules/dep4/Gemfile +14 -0
  57. data/spec/files/modules/dep4/README.md +83 -0
  58. data/spec/files/modules/dep4/Rakefile +17 -0
  59. data/spec/files/modules/dep4/manifests/init.pp +48 -0
  60. data/spec/files/modules/dep4/metadata.json +15 -0
  61. data/spec/files/modules/dep4/spec/classes/init_spec.rb +7 -0
  62. data/spec/files/modules/dep4/spec/spec_helper.rb +1 -0
  63. data/spec/files/modules/dep4/tests/init.pp +12 -0
  64. data/spec/files/modules/module01/Gemfile +14 -0
  65. data/spec/files/modules/module01/README.md +83 -0
  66. data/spec/files/modules/module01/Rakefile +17 -0
  67. data/spec/files/modules/module01/manifests/init.pp +48 -0
  68. data/spec/files/modules/module01/metadata.json +15 -0
  69. data/spec/files/modules/module01/spec/classes/init_spec.rb +7 -0
  70. data/spec/files/modules/module01/spec/spec_helper.rb +1 -0
  71. data/spec/files/modules/module01/tests/init.pp +12 -0
  72. data/spec/files/modules/module02/.fixtures.yml +8 -0
  73. data/spec/files/modules/module02/Gemfile +14 -0
  74. data/spec/files/modules/module02/README.md +83 -0
  75. data/spec/files/modules/module02/Rakefile +17 -0
  76. data/spec/files/modules/module02/manifests/init.pp +48 -0
  77. data/spec/files/modules/module02/metadata.json +15 -0
  78. data/spec/files/modules/module02/spec/classes/init_spec.rb +7 -0
  79. data/spec/files/modules/module02/spec/spec_helper.rb +1 -0
  80. data/spec/files/modules/module02/tests/init.pp +12 -0
  81. data/spec/files/modules/module03/.fixtures.yml +6 -0
  82. data/spec/files/modules/module03/Gemfile +14 -0
  83. data/spec/files/modules/module03/README.md +83 -0
  84. data/spec/files/modules/module03/Rakefile +17 -0
  85. data/spec/files/modules/module03/manifests/init.pp +48 -0
  86. data/spec/files/modules/module03/metadata.json +15 -0
  87. data/spec/files/modules/module03/spec/classes/init_spec.rb +7 -0
  88. data/spec/files/modules/module03/spec/spec_helper.rb +1 -0
  89. data/spec/files/modules/module03/tests/init.pp +12 -0
  90. data/spec/files/modules/mut1/Gemfile +14 -0
  91. data/spec/files/modules/mut1/README.md +83 -0
  92. data/spec/files/modules/mut1/Rakefile +17 -0
  93. data/spec/files/modules/mut1/manifests/init.pp +48 -0
  94. data/spec/files/modules/mut1/metadata.json +15 -0
  95. data/spec/files/modules/mut1/spec/classes/init_spec.rb +7 -0
  96. data/spec/files/modules/mut1/spec/spec_helper.rb +1 -0
  97. data/spec/files/modules/mut1/tests/init.pp +12 -0
  98. data/spec/files/modules/mut2/Gemfile +14 -0
  99. data/spec/files/modules/mut2/README.md +83 -0
  100. data/spec/files/modules/mut2/Rakefile +17 -0
  101. data/spec/files/modules/mut2/manifests/init.pp +48 -0
  102. data/spec/files/modules/mut2/metadata.json +16 -0
  103. data/spec/files/modules/mut2/spec/classes/init_spec.rb +7 -0
  104. data/spec/files/modules/mut2/spec/spec_helper.rb +1 -0
  105. data/spec/files/modules/mut2/tests/init.pp +12 -0
  106. data/spec/lib/simp/module/repoclosure_spec.rb +119 -0
  107. data/spec/spec_helper.rb +23 -0
  108. metadata +345 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 73d798d180fe91e00f71781a5d20b3ff75a5ec30
4
+ data.tar.gz: 4c5cc4893da773eb3a331b99a03d416272b3b615
5
+ SHA512:
6
+ metadata.gz: 6f203f81cddcf040a734b305d57c96bae57cf38589685b731bb6f0c3eff920e76bbed5b5f33d4179f1e026c2938cad76161bcff2c5053ee8991f85ff9e2d9327
7
+ data.tar.gz: 76a876a0a6c5343ad80d1b3aeb8a4cd1409814a92ec0f3ab53c64b00a1b952fad39d2dc52840f8fc0c6cf1bb6282ebef613bf42cf41995f59cc4df829c15e92e
@@ -0,0 +1,3 @@
1
+ -
2
+ ChangeLog.md
3
+ LICENSE
@@ -0,0 +1,20 @@
1
+ *.gem
2
+ .*.sw?
3
+ .bundle/
4
+ /.bundle
5
+ /.rspec_system
6
+ /.vagrant
7
+ /.yardoc
8
+ /.yardoc/
9
+ /Gemfile.lock
10
+ /dist/
11
+ /doc/
12
+ /junit
13
+ /log
14
+ /pkg
15
+ /pkg/
16
+ /vendor
17
+ /vendor/cache/*.gem
18
+ Gemfile.lock
19
+ /tmp
20
+ pkg/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --colour --format documentation
2
+ --fail-fast
@@ -0,0 +1,6 @@
1
+ ---
2
+ language: ruby
3
+ rvm:
4
+ - 2.0
5
+ - 2.1
6
+ - 2.2
@@ -0,0 +1 @@
1
+ --markup markdown --title "simp-module-repoclosure Documentation" --protected
@@ -0,0 +1,4 @@
1
+ ### 0.1.0 / 2016-04-16
2
+
3
+ * Initial release:
4
+
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ gem 'puppet'
6
+
7
+ group :development do
8
+ gem 'kramdown'
9
+ gem 'guard'
10
+ gem 'guard-shell'
11
+ gem 'guard-rspec'
12
+ gem 'guard-rake'
13
+ end
@@ -0,0 +1,78 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ ## Uncomment and set this to only include directories you want to watch
5
+ # directories %w(app lib config test spec feature)
6
+
7
+ ## Uncomment to clear the screen before every task
8
+ # clearing :on
9
+
10
+ ## Make Guard exit when config is changed so it can be restarted
11
+ #
12
+ ## Note: if you want Guard to automatically start up again, run guard in a
13
+ ## shell loop, e.g.:
14
+ #
15
+ # $ while bundle exec guard; do echo "Restarting Guard..."; done
16
+ #
17
+ ## Note: if you are using the `directories` clause above and you are not
18
+ ## watching the project directory ('.'), the you will want to move the Guardfile
19
+ ## to a watched dir and symlink it back, e.g.
20
+ #
21
+ # $ mkdir config
22
+ # $ mv Guardfile config/
23
+ # $ ln -s config/Guardfile .
24
+ #
25
+ # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
26
+ #
27
+ watch 'Guardfile' do
28
+ UI.info 'Exiting because Guard must be restarted for changes to take effect'
29
+ exit 0
30
+ end
31
+
32
+
33
+ # shell commands
34
+ guard :shell do
35
+ # test that the .gemspec still works
36
+ watch %r{^.*\.gemspec$} do |m|
37
+ cmd = "bundle exec gem build '#{m[0]}'"
38
+ p "== #{cmd}"
39
+ `#{cmd}`
40
+ end
41
+ end
42
+
43
+
44
+ # Run rspec tests when things change
45
+ guard :rspec, cmd: 'bundle exec rspec ' do
46
+ watch(%r{^spec/lib/.+_spec\.rb$})
47
+
48
+ # when a file changes run the tests for that file
49
+ watch(%r{^lib/(.+)\.rb$}) do |m|
50
+ File.join( 'spec', 'lib', "#{m[1]}_spec.rb" )
51
+ end
52
+
53
+ watch('spec/spec_helper.rb') { "spec" }
54
+ end
55
+
56
+
57
+ # tmux 1.7+ can send rspec results to the TMUX status pane.
58
+ notification( :tmux, {
59
+ display_message: true,
60
+ timeout: 5, # in seconds
61
+ default_message_format: '%s >> %s',
62
+ # the first %s will show the title, the second the message
63
+ # Alternately you can also configure *success_message_format*,
64
+ # *pending_message_format*, *failed_message_format*
65
+ line_separator: ' > ', # since we are single line we need a separator
66
+ color_location: 'status-left-bg', # to customize which tmux element will change color
67
+
68
+ # Other options:
69
+ default_message_color: 'black',
70
+ success: 'colour150',
71
+ failure: 'colour174',
72
+ pending: 'colour179',
73
+ # Notify on all tmux clients
74
+
75
+ display_on_all_clients: false
76
+ }) if ( ENV.fetch( 'TMUX', false ) && (%x{tmux -V}.split(' ').last.split('.').last.to_i > 6 ))
77
+ # vim:set syntax=ruby:
78
+
data/LICENSE ADDED
@@ -0,0 +1,27 @@
1
+ simp-module-repoclosure - TODO: Summary
2
+
3
+ --
4
+
5
+ Per Section 105 of the Copyright Act of 1976, these works are not entitled to
6
+ domestic copyright protection under US Federal law.
7
+
8
+ The US Government retains the right to pursue copyright protections outside of
9
+ the United States.
10
+
11
+ The United States Government has unlimited rights in this software and all
12
+ derivatives thereof, pursuant to the contracts under which it was developed and
13
+ the License under which it falls.
14
+
15
+ ---
16
+
17
+ Licensed under the Apache License, Version 2.0 (the "License");
18
+ you may not use this file except in compliance with the License.
19
+ You may obtain a copy of the License at
20
+
21
+ http://www.apache.org/licenses/LICENSE-2.0
22
+
23
+ Unless required by applicable law or agreed to in writing, software
24
+ distributed under the License is distributed on an "AS IS" BASIS,
25
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26
+ See the License for the specific language governing permissions and
27
+ limitations under the License.
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,5 @@
1
+ simp-module-repoclosure
2
+ Copyright 2016 Chris Tessmer
3
+
4
+ This product includes software developed at
5
+ The Apache Software Foundation (http://www.apache.org/).
@@ -0,0 +1,99 @@
1
+ [![Build Status](https://secure.travis-ci.org/simp/rubygem-simp-module-repoclosure.svg?branch=master)](https://travis-ci.org/simp/rubygem-simp-module-repoclosure)
2
+ [![License](http://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)
3
+ # simp-module-repoclosure
4
+
5
+ A ~~stupidly~~ admirably direct dependency validator for a Puppet module's `metadata.json`. Use a tiny dedicated Puppet Forge to stage your modules' dependences with ` puppet module install`!
6
+
7
+ #### Table of Contents
8
+ 1. [Overview](#overview)
9
+ * [What this gem does](#what-this-gem-does)
10
+ * [How it does that](#how-it-does-that)
11
+ * [Module Dependency Closuresw it does that](#how-it-does-that)
12
+ 2. [Setup](#setup)
13
+ * [Beginning with simp-module-repoclosure](#beginning-with-simp-module-repoclosure)
14
+ 3. [Methods](#methods)
15
+ 4. [Environment variables](#environment-variables)
16
+ 5. [Examples](#examples)
17
+ 6. [License](#license)
18
+
19
+ ## Overview
20
+
21
+ ### What this gem does
22
+ For each **Module-under-test** (or **MUT**):
23
+
24
+ - [x] Validate that the MUT will install from the Puppet Forge without breaking on dep-solving problems (such as version conflicts or missing dependencies).
25
+ - [x] Enable as much of this validation as possible **within network-isolated enclaves**.
26
+ - [ ] **TODO**: Detect if dependencies are _missing_ from `metadata.json` by using the contents of `mods_dir/` as the fixture modules for `spec_standalone` tests.
27
+ - [ ] **TODO**: Once missing dependencies are established, use the contents of `mods_dir/` to identify missing modules in the `.fixtures.yaml` file.
28
+
29
+
30
+ ### How it does that
31
+ The MUT + dependencies are loaded into a local Puppet Forge and running `puppet module install <MUT>` against it. If the installation succeeds, the dependencies covered to publish on the live Puppet Forge.
32
+
33
+
34
+ #### Basic flow
35
+ ![design](docs/img/simp-module-repoclosure design.png)
36
+
37
+
38
+ 1. _(optional)_ An upstream Puppet Forge can be used to install the dependencies for the MUT into a `mods_dir/` directory.
39
+ - The forge server can be changed with the environment variable [`TEST_FORGE_deps_forge`](#test_forge_deps_forge)
40
+ - With internet access and a single
41
+ 2. _(optional, enclave-friendly)_ All modules in `mods_dir/` are built into `tar.gz` archives to be served by the test Forge.
42
+ - The `mods_dir` can be changed with the environment variable [`TEST_FORGE_mods_dir`](#test_forge_mods_dir)
43
+ - If the `mods_dir` is defined, the upsteam dependency forge will not be contacted.
44
+ 3. _(enclave-friendly)_ A temporary Puppet Forge is started on `localhost` and serves modules from `tars_dir/`. In a separate process, `puppet module install` is run for each MUT against the localhost Puppet Forge (modules are installed into a temporary directory). The test passes if all installs succeed.
45
+ - The `tars_dir` can be changed with the environment variable [`TEST_FORGE_tars_dir`](#test_forge_tars_dir)
46
+
47
+
48
+ Each step of the process can be modified or skipped using [environment variables](#environment-variables) prefixed with `TEST_FORGE_` (noted in maroon text on the diagram above).
49
+ ### Module dependency scenarios
50
+
51
+
52
+ ![design](docs/img/simp-module-repoclosure tests.png)
53
+
54
+
55
+ ## Setup
56
+
57
+ ### Beginning with simp-module-repoclosure
58
+
59
+ Add this to your project's `Gemfile`:
60
+
61
+ ```ruby
62
+ gem 'simp-module-repoclosure'
63
+ ```
64
+
65
+
66
+
67
+ ## Environment variables
68
+ You can set the environment variables `TEST_FORGE_tars_dir` and
69
+ `TEST_FORGE_mods_dir` to use pre-existing diretories of modules
70
+ for the local forge.
71
+
72
+ ### TEST_FORGE_deps_forge
73
+ The upstream Puppet Forge to download MUT dependencies from.
74
+
75
+ ### TEST_FORGE_mods_dir
76
+ _(enclave-friendly)_ Customize the path of the `mods_dir/` directory of unarchived module dependencies.
77
+ - If `TEST_FORGE_mods_dir` is not set, `mods_dir/` is a temporary directory.
78
+ - If `TEST_FORGE_mods_dir` is customized, deps Puppet forge is no longer used
79
+
80
+ ### TEST_FORGE_tars_dir
81
+ _(enclave-friendly)_ Customize the path of the `tars_dir/` directory or archived `.tar.gz` modules. By the time the test Forge starts, `tars_dir/` should include the MUT(s) and all dependencies.
82
+ - If `TEST_FORGE_tars_dir` is not set, `tars_dir/` is a temporary directory.
83
+ - If `TEST_FORGE_tars_dir` is customized, the Puppet Forge and `mod_path/` compilation steps will be skipped.
84
+
85
+ ### TEST_FORGE_port
86
+ The TCP port on localhost or the temporary test Forge to use.
87
+ - If TEST_FORGE_port is no set the port will default to `8080`.
88
+
89
+
90
+ ## Examples
91
+ ```bash
92
+ TEST_FORGE_port=8888 bundle exec rake spec
93
+ ```
94
+
95
+
96
+ ## License
97
+ See [LICENSE](LICENSE)
98
+
99
+ ```