simp-module-repoclosure 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
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,15 @@
1
+ {
2
+ "name": "test-dep1",
3
+ "version": "0.1.0",
4
+ "author": "test",
5
+ "summary": "Test Dep",
6
+ "license": "Apache-2.0",
7
+ "source": "",
8
+ "project_page": null,
9
+ "issues_url": null,
10
+ "dependencies": [
11
+ {"name":"test-dep2","version_requirement":">= 0.1.0"}
12
+ ],
13
+ "data_provider": null
14
+ }
15
+
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+ describe 'dep1' do
3
+
4
+ context 'with default values for all parameters' do
5
+ it { should contain_class('dep1') }
6
+ end
7
+ end
@@ -0,0 +1 @@
1
+ require 'puppetlabs_spec_helper/module_spec_helper'
@@ -0,0 +1,12 @@
1
+ # The baseline for module testing used by Puppet Labs is that each manifest
2
+ # should have a corresponding test manifest that declares that class or defined
3
+ # type.
4
+ #
5
+ # Tests are then run by using puppet apply --noop (to check for compilation
6
+ # errors and view a log of events) or by fully applying the test in a virtual
7
+ # environment (to compare the resulting system state to the desired state).
8
+ #
9
+ # Learn more about module testing here:
10
+ # https://docs.puppetlabs.com/guides/tests_smoke.html
11
+ #
12
+ include ::dep1
@@ -0,0 +1,14 @@
1
+ source ENV['GEM_SOURCE'] || 'https://rubygems.org'
2
+
3
+ puppetversion = ENV.key?('PUPPET_VERSION') ? "#{ENV['PUPPET_VERSION']}" : ['>= 3.3']
4
+ gem 'metadata-json-lint'
5
+ gem 'puppet', puppetversion
6
+ gem 'puppetlabs_spec_helper', '>= 1.0.0'
7
+ gem 'puppet-lint', '>= 1.0.0'
8
+ gem 'facter', '>= 1.7.0'
9
+ gem 'rspec-puppet'
10
+
11
+ # rspec must be v2 for ruby 1.8.7
12
+ if RUBY_VERSION >= '1.8.7' and RUBY_VERSION < '1.9'
13
+ gem 'rspec', '~> 2.0'
14
+ end
@@ -0,0 +1,83 @@
1
+ # dep2
2
+
3
+ #### Table of Contents
4
+
5
+ 1. [Description](#description)
6
+ 1. [Setup - The basics of getting started with dep2](#setup)
7
+ * [What dep2 affects](#what-dep2-affects)
8
+ * [Setup requirements](#setup-requirements)
9
+ * [Beginning with dep2](#beginning-with-dep2)
10
+ 1. [Usage - Configuration options and additional functionality](#usage)
11
+ 1. [Reference - An under-the-hood peek at what the module is doing and how](#reference)
12
+ 1. [Limitations - OS compatibility, etc.](#limitations)
13
+ 1. [Development - Guide for contributing to the module](#development)
14
+
15
+ ## Description
16
+
17
+ Start with a one- or two-sentence summary of what the module does and/or what
18
+ problem it solves. This is your 30-second elevator pitch for your module.
19
+ Consider including OS/Puppet version it works with.
20
+
21
+ You can give more descriptive information in a second paragraph. This paragraph
22
+ should answer the questions: "What does this module *do*?" and "Why would I use
23
+ it?" If your module has a range of functionality (installation, configuration,
24
+ management, etc.), this is the time to mention it.
25
+
26
+ ## Setup
27
+
28
+ ### What dep2 affects **OPTIONAL**
29
+
30
+ If it's obvious what your module touches, you can skip this section. For
31
+ example, folks can probably figure out that your mysql_instance module affects
32
+ their MySQL instances.
33
+
34
+ If there's more that they should know about, though, this is the place to mention:
35
+
36
+ * A list of files, packages, services, or operations that the module will alter,
37
+ impact, or execute.
38
+ * Dependencies that your module automatically installs.
39
+ * Warnings or other important notices.
40
+
41
+ ### Setup Requirements **OPTIONAL**
42
+
43
+ If your module requires anything extra before setting up (pluginsync enabled,
44
+ etc.), mention it here.
45
+
46
+ If your most recent release breaks compatibility or requires particular steps
47
+ for upgrading, you might want to include an additional "Upgrading" section
48
+ here.
49
+
50
+ ### Beginning with dep2
51
+
52
+ The very basic steps needed for a user to get the module up and running. This
53
+ can include setup steps, if necessary, or it can be an example of the most
54
+ basic use of the module.
55
+
56
+ ## Usage
57
+
58
+ This section is where you describe how to customize, configure, and do the
59
+ fancy stuff with your module here. It's especially helpful if you include usage
60
+ examples and code samples for doing things with your module.
61
+
62
+ ## Reference
63
+
64
+ Here, include a complete list of your module's classes, types, providers,
65
+ facts, along with the parameters for each. Users refer to this section (thus
66
+ the name "Reference") to find specific details; most users don't read it per
67
+ se.
68
+
69
+ ## Limitations
70
+
71
+ This is where you list OS compatibility, version compatibility, etc. If there
72
+ are Known Issues, you might want to include them under their own heading here.
73
+
74
+ ## Development
75
+
76
+ Since your module is awesome, other users will want to play with it. Let them
77
+ know what the ground rules for contributing are.
78
+
79
+ ## Release Notes/Contributors/Etc. **Optional**
80
+
81
+ If you aren't using changelog, put your release notes here (though you should
82
+ consider using changelog). You can also add any additional sections you feel
83
+ are necessary or important to include here. Please use the `## ` header.
@@ -0,0 +1,17 @@
1
+ require 'puppetlabs_spec_helper/rake_tasks'
2
+ require 'puppet-lint/tasks/puppet-lint'
3
+ PuppetLint.configuration.send('disable_80chars')
4
+ PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"]
5
+
6
+ desc "Validate manifests, templates, and ruby files"
7
+ task :validate do
8
+ Dir['manifests/**/*.pp'].each do |manifest|
9
+ sh "puppet parser validate --noop #{manifest}"
10
+ end
11
+ Dir['spec/**/*.rb','lib/**/*.rb'].each do |ruby_file|
12
+ sh "ruby -c #{ruby_file}" unless ruby_file =~ /spec\/fixtures/
13
+ end
14
+ Dir['templates/**/*.erb'].each do |template|
15
+ sh "erb -P -x -T '-' #{template} | ruby -c"
16
+ end
17
+ end
@@ -0,0 +1,48 @@
1
+ # Class: dep2
2
+ # ===========================
3
+ #
4
+ # Full description of class dep2 here.
5
+ #
6
+ # Parameters
7
+ # ----------
8
+ #
9
+ # Document parameters here.
10
+ #
11
+ # * `sample parameter`
12
+ # Explanation of what this parameter affects and what it defaults to.
13
+ # e.g. "Specify one or more upstream ntp servers as an array."
14
+ #
15
+ # Variables
16
+ # ----------
17
+ #
18
+ # Here you should define a list of variables that this module would require.
19
+ #
20
+ # * `sample variable`
21
+ # Explanation of how this variable affects the function of this class and if
22
+ # it has a default. e.g. "The parameter enc_ntp_servers must be set by the
23
+ # External Node Classifier as a comma separated list of hostnames." (Note,
24
+ # global variables should be avoided in favor of class parameters as
25
+ # of Puppet 2.6.)
26
+ #
27
+ # Examples
28
+ # --------
29
+ #
30
+ # @example
31
+ # class { 'dep2':
32
+ # servers => [ 'pool.ntp.org', 'ntp.local.company.com' ],
33
+ # }
34
+ #
35
+ # Authors
36
+ # -------
37
+ #
38
+ # Author Name <author@domain.com>
39
+ #
40
+ # Copyright
41
+ # ---------
42
+ #
43
+ # Copyright 2016 Your name here, unless otherwise noted.
44
+ #
45
+ class dep2 {
46
+
47
+
48
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "test-dep2",
3
+ "version": "0.1.0",
4
+ "author": "test",
5
+ "summary": "Test Dep",
6
+ "license": "Apache-2.0",
7
+ "source": "",
8
+ "project_page": null,
9
+ "issues_url": null,
10
+ "dependencies": [
11
+ ],
12
+ "data_provider": null
13
+ }
14
+
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+ describe 'dep2' do
3
+
4
+ context 'with default values for all parameters' do
5
+ it { should contain_class('dep2') }
6
+ end
7
+ end
@@ -0,0 +1 @@
1
+ require 'puppetlabs_spec_helper/module_spec_helper'
@@ -0,0 +1,12 @@
1
+ # The baseline for module testing used by Puppet Labs is that each manifest
2
+ # should have a corresponding test manifest that declares that class or defined
3
+ # type.
4
+ #
5
+ # Tests are then run by using puppet apply --noop (to check for compilation
6
+ # errors and view a log of events) or by fully applying the test in a virtual
7
+ # environment (to compare the resulting system state to the desired state).
8
+ #
9
+ # Learn more about module testing here:
10
+ # https://docs.puppetlabs.com/guides/tests_smoke.html
11
+ #
12
+ include ::dep2
@@ -0,0 +1,14 @@
1
+ source ENV['GEM_SOURCE'] || 'https://rubygems.org'
2
+
3
+ puppetversion = ENV.key?('PUPPET_VERSION') ? "#{ENV['PUPPET_VERSION']}" : ['>= 3.3']
4
+ gem 'metadata-json-lint'
5
+ gem 'puppet', puppetversion
6
+ gem 'puppetlabs_spec_helper', '>= 1.0.0'
7
+ gem 'puppet-lint', '>= 1.0.0'
8
+ gem 'facter', '>= 1.7.0'
9
+ gem 'rspec-puppet'
10
+
11
+ # rspec must be v2 for ruby 1.8.7
12
+ if RUBY_VERSION >= '1.8.7' and RUBY_VERSION < '1.9'
13
+ gem 'rspec', '~> 2.0'
14
+ end
@@ -0,0 +1,83 @@
1
+ # dep3
2
+
3
+ #### Table of Contents
4
+
5
+ 1. [Description](#description)
6
+ 1. [Setup - The basics of getting started with dep3](#setup)
7
+ * [What dep3 affects](#what-dep3-affects)
8
+ * [Setup requirements](#setup-requirements)
9
+ * [Beginning with dep3](#beginning-with-dep3)
10
+ 1. [Usage - Configuration options and additional functionality](#usage)
11
+ 1. [Reference - An under-the-hood peek at what the module is doing and how](#reference)
12
+ 1. [Limitations - OS compatibility, etc.](#limitations)
13
+ 1. [Development - Guide for contributing to the module](#development)
14
+
15
+ ## Description
16
+
17
+ Start with a one- or two-sentence summary of what the module does and/or what
18
+ problem it solves. This is your 30-second elevator pitch for your module.
19
+ Consider including OS/Puppet version it works with.
20
+
21
+ You can give more descriptive information in a second paragraph. This paragraph
22
+ should answer the questions: "What does this module *do*?" and "Why would I use
23
+ it?" If your module has a range of functionality (installation, configuration,
24
+ management, etc.), this is the time to mention it.
25
+
26
+ ## Setup
27
+
28
+ ### What dep3 affects **OPTIONAL**
29
+
30
+ If it's obvious what your module touches, you can skip this section. For
31
+ example, folks can probably figure out that your mysql_instance module affects
32
+ their MySQL instances.
33
+
34
+ If there's more that they should know about, though, this is the place to mention:
35
+
36
+ * A list of files, packages, services, or operations that the module will alter,
37
+ impact, or execute.
38
+ * Dependencies that your module automatically installs.
39
+ * Warnings or other important notices.
40
+
41
+ ### Setup Requirements **OPTIONAL**
42
+
43
+ If your module requires anything extra before setting up (pluginsync enabled,
44
+ etc.), mention it here.
45
+
46
+ If your most recent release breaks compatibility or requires particular steps
47
+ for upgrading, you might want to include an additional "Upgrading" section
48
+ here.
49
+
50
+ ### Beginning with dep3
51
+
52
+ The very basic steps needed for a user to get the module up and running. This
53
+ can include setup steps, if necessary, or it can be an example of the most
54
+ basic use of the module.
55
+
56
+ ## Usage
57
+
58
+ This section is where you describe how to customize, configure, and do the
59
+ fancy stuff with your module here. It's especially helpful if you include usage
60
+ examples and code samples for doing things with your module.
61
+
62
+ ## Reference
63
+
64
+ Here, include a complete list of your module's classes, types, providers,
65
+ facts, along with the parameters for each. Users refer to this section (thus
66
+ the name "Reference") to find specific details; most users don't read it per
67
+ se.
68
+
69
+ ## Limitations
70
+
71
+ This is where you list OS compatibility, version compatibility, etc. If there
72
+ are Known Issues, you might want to include them under their own heading here.
73
+
74
+ ## Development
75
+
76
+ Since your module is awesome, other users will want to play with it. Let them
77
+ know what the ground rules for contributing are.
78
+
79
+ ## Release Notes/Contributors/Etc. **Optional**
80
+
81
+ If you aren't using changelog, put your release notes here (though you should
82
+ consider using changelog). You can also add any additional sections you feel
83
+ are necessary or important to include here. Please use the `## ` header.
@@ -0,0 +1,17 @@
1
+ require 'puppetlabs_spec_helper/rake_tasks'
2
+ require 'puppet-lint/tasks/puppet-lint'
3
+ PuppetLint.configuration.send('disable_80chars')
4
+ PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"]
5
+
6
+ desc "Validate manifests, templates, and ruby files"
7
+ task :validate do
8
+ Dir['manifests/**/*.pp'].each do |manifest|
9
+ sh "puppet parser validate --noop #{manifest}"
10
+ end
11
+ Dir['spec/**/*.rb','lib/**/*.rb'].each do |ruby_file|
12
+ sh "ruby -c #{ruby_file}" unless ruby_file =~ /spec\/fixtures/
13
+ end
14
+ Dir['templates/**/*.erb'].each do |template|
15
+ sh "erb -P -x -T '-' #{template} | ruby -c"
16
+ end
17
+ end
@@ -0,0 +1,48 @@
1
+ # Class: dep3
2
+ # ===========================
3
+ #
4
+ # Full description of class dep3 here.
5
+ #
6
+ # Parameters
7
+ # ----------
8
+ #
9
+ # Document parameters here.
10
+ #
11
+ # * `sample parameter`
12
+ # Explanation of what this parameter affects and what it defaults to.
13
+ # e.g. "Specify one or more upstream ntp servers as an array."
14
+ #
15
+ # Variables
16
+ # ----------
17
+ #
18
+ # Here you should define a list of variables that this module would require.
19
+ #
20
+ # * `sample variable`
21
+ # Explanation of how this variable affects the function of this class and if
22
+ # it has a default. e.g. "The parameter enc_ntp_servers must be set by the
23
+ # External Node Classifier as a comma separated list of hostnames." (Note,
24
+ # global variables should be avoided in favor of class parameters as
25
+ # of Puppet 2.6.)
26
+ #
27
+ # Examples
28
+ # --------
29
+ #
30
+ # @example
31
+ # class { 'dep3':
32
+ # servers => [ 'pool.ntp.org', 'ntp.local.company.com' ],
33
+ # }
34
+ #
35
+ # Authors
36
+ # -------
37
+ #
38
+ # Author Name <author@domain.com>
39
+ #
40
+ # Copyright
41
+ # ---------
42
+ #
43
+ # Copyright 2016 Your name here, unless otherwise noted.
44
+ #
45
+ class dep3 {
46
+
47
+
48
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "test-dep3",
3
+ "version": "0.1.0",
4
+ "author": "test",
5
+ "summary": "Test Dep",
6
+ "license": "Apache-2.0",
7
+ "source": "",
8
+ "project_page": null,
9
+ "issues_url": null,
10
+ "dependencies": [
11
+ ],
12
+ "data_provider": null
13
+ }
14
+
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+ describe 'dep3' do
3
+
4
+ context 'with default values for all parameters' do
5
+ it { should contain_class('dep3') }
6
+ end
7
+ end
@@ -0,0 +1 @@
1
+ require 'puppetlabs_spec_helper/module_spec_helper'