codestrap 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 (150) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +20 -0
  3. data/.travis.yml +4 -0
  4. data/.yardopts +3 -0
  5. data/BOILERPLATE.md +151 -0
  6. data/CODESTRAPFILE.md +28 -0
  7. data/Gemfile +6 -0
  8. data/LICENSE.txt +13 -0
  9. data/README.md +69 -0
  10. data/Rakefile +51 -0
  11. data/bin/strap +8 -0
  12. data/bin/upstrap +8 -0
  13. data/codestrap.gemspec +37 -0
  14. data/config/projects/codestrap.rb +22 -0
  15. data/config/software/codestrap.rb +20 -0
  16. data/config/software/ruby.rb +247 -0
  17. data/config/software/zlib.rb +86 -0
  18. data/features/client.feature +99 -0
  19. data/features/fixtures/client/home/codestrap/bin/.empty +0 -0
  20. data/features/fixtures/client/home/codestrap/content/bash.erb +3 -0
  21. data/features/fixtures/client/home/codestrap/content/gem/dir/file +0 -0
  22. data/features/fixtures/client/home/codestrap/content/gem/dir/template +3 -0
  23. data/features/fixtures/client/home/codestrap/content/gem/file +1 -0
  24. data/features/fixtures/client/home/codestrap/content/gem/template +3 -0
  25. data/features/fixtures/client/home/codestrap/content/local_remote.erb +1 -0
  26. data/features/fixtures/client/home/codestrap/content/local_remote/dir/file +0 -0
  27. data/features/fixtures/client/home/codestrap/content/local_remote/dir/template +3 -0
  28. data/features/fixtures/client/home/codestrap/content/local_remote/file +1 -0
  29. data/features/fixtures/client/home/codestrap/content/local_remote/template +3 -0
  30. data/features/fixtures/client/home/codestrap/objects/local.json +3 -0
  31. data/features/fixtures/client/output/.empty +0 -0
  32. data/features/fixtures/client/var/lib/codestrap/bin/.empty +0 -0
  33. data/features/fixtures/client/var/lib/codestrap/content/bashremote.erb +3 -0
  34. data/features/fixtures/client/var/lib/codestrap/content/gemremote/dir/file +0 -0
  35. data/features/fixtures/client/var/lib/codestrap/content/gemremote/dir/template +3 -0
  36. data/features/fixtures/client/var/lib/codestrap/content/gemremote/file +0 -0
  37. data/features/fixtures/client/var/lib/codestrap/content/gemremote/template +3 -0
  38. data/features/fixtures/client/var/lib/codestrap/content/remote_local.erb +1 -0
  39. data/features/fixtures/client/var/lib/codestrap/content/remote_local/dir/file +0 -0
  40. data/features/fixtures/client/var/lib/codestrap/content/remote_local/dir/template +3 -0
  41. data/features/fixtures/client/var/lib/codestrap/content/remote_local/file +1 -0
  42. data/features/fixtures/client/var/lib/codestrap/content/remote_local/template +3 -0
  43. data/features/fixtures/client/var/lib/codestrap/content/remote_remote.erb +1 -0
  44. data/features/fixtures/client/var/lib/codestrap/content/remote_remote/dir/file +0 -0
  45. data/features/fixtures/client/var/lib/codestrap/content/remote_remote/dir/template +3 -0
  46. data/features/fixtures/client/var/lib/codestrap/content/remote_remote/file +0 -0
  47. data/features/fixtures/client/var/lib/codestrap/content/remote_remote/template +3 -0
  48. data/features/fixtures/client/var/lib/codestrap/objects/remote.json +3 -0
  49. data/features/fixtures/logging/home/logging/codestrap/bin/stubdirectory/.empty +0 -0
  50. data/features/fixtures/logging/home/logging/codestrap/bin/stubnotlink +0 -0
  51. data/features/fixtures/logging/home/logging/codestrap/content/.empty +0 -0
  52. data/features/fixtures/logging/home/logging/codestrap/objects/.empty +0 -0
  53. data/features/fixtures/server/mixed/var/lib/stub/content/address.erb +3 -0
  54. data/features/fixtures/server/mixed/var/lib/stub/content/cell.erb +3 -0
  55. data/features/fixtures/server/mixed/var/lib/stub/content/email.erb +3 -0
  56. data/features/fixtures/server/mixed/var/lib/stub/content/mobile.erb +3 -0
  57. data/features/fixtures/server/mixed/var/lib/stub/content/name.erb +3 -0
  58. data/features/fixtures/server/mixed/var/lib/stub/content/phone.erb +3 -0
  59. data/features/fixtures/server/mixed/var/lib/stub/content/puppetmodule/Modulefile +12 -0
  60. data/features/fixtures/server/mixed/var/lib/stub/content/puppetmodule/README +17 -0
  61. data/features/fixtures/server/mixed/var/lib/stub/content/puppetmodule/manifests/init.pp +42 -0
  62. data/features/fixtures/server/mixed/var/lib/stub/content/puppetmodule/spec/spec_helper.rb +18 -0
  63. data/features/fixtures/server/mixed/var/lib/stub/content/puppetmodule/tests/init.pp +13 -0
  64. data/features/fixtures/server/mixed/var/lib/stub/objects/contact.json +8 -0
  65. data/features/fixtures/server/mixed/var/lib/stub/objects/shadow/contact.json +8 -0
  66. data/features/fixtures/strap/projects/etc/.empty +0 -0
  67. data/features/fixtures/strap/projects/home/user/dir/bin/.empty +0 -0
  68. data/features/fixtures/strap/projects/home/user/dir/content/puppetmodule/Modulefile +12 -0
  69. data/features/fixtures/strap/projects/home/user/dir/content/puppetmodule/README +17 -0
  70. data/features/fixtures/strap/projects/home/user/dir/content/puppetmodule/manifests/:stub:project.name:/subclass.pp +3 -0
  71. data/features/fixtures/strap/projects/home/user/dir/content/puppetmodule/manifests/init.pp +42 -0
  72. data/features/fixtures/strap/projects/home/user/dir/content/puppetmodule/spec/spec_helper.rb +18 -0
  73. data/features/fixtures/strap/projects/home/user/dir/content/puppetmodule/tests/init.pp +13 -0
  74. data/features/fixtures/strap/projects/home/user/dir/objects/contact.json +8 -0
  75. data/features/fixtures/strap/projects/home/user/dir/objects/shadow/contact.json +8 -0
  76. data/features/fixtures/strap/projects/output/.empty +0 -0
  77. data/features/fixtures/stub/contact/etc/.empty +0 -0
  78. data/features/fixtures/stub/contact/home/user/dir/bin/.empty +0 -0
  79. data/features/fixtures/stub/contact/home/user/dir/content/address.erb +3 -0
  80. data/features/fixtures/stub/contact/home/user/dir/content/cell.erb +3 -0
  81. data/features/fixtures/stub/contact/home/user/dir/content/email.erb +3 -0
  82. data/features/fixtures/stub/contact/home/user/dir/content/mobile.erb +3 -0
  83. data/features/fixtures/stub/contact/home/user/dir/content/name.erb +3 -0
  84. data/features/fixtures/stub/contact/home/user/dir/content/phone.erb +3 -0
  85. data/features/fixtures/stub/contact/home/user/dir/objects/contact.json +8 -0
  86. data/features/fixtures/stub/contact/home/user/dir/objects/shadow/contact.json +8 -0
  87. data/features/fixtures/stub/contact/output/.empty +0 -0
  88. data/features/fixtures/stub/date/etc/.empty +0 -0
  89. data/features/fixtures/stub/date/home/user/stub/bin/.empty +0 -0
  90. data/features/fixtures/stub/date/home/user/stub/content/day.erb +3 -0
  91. data/features/fixtures/stub/date/home/user/stub/content/hour.erb +3 -0
  92. data/features/fixtures/stub/date/home/user/stub/content/minute.erb +3 -0
  93. data/features/fixtures/stub/date/home/user/stub/content/month.erb +3 -0
  94. data/features/fixtures/stub/date/home/user/stub/content/second.erb +3 -0
  95. data/features/fixtures/stub/date/home/user/stub/content/year.erb +3 -0
  96. data/features/fixtures/stub/date/home/user/stub/objects/.empty +0 -0
  97. data/features/fixtures/stub/date/output/.empty +0 -0
  98. data/features/fixtures/stub/script/etc/.empty +0 -0
  99. data/features/fixtures/stub/script/home/user/stub/bin/.empty +0 -0
  100. data/features/fixtures/stub/script/home/user/stub/content/credentials.erb +6 -0
  101. data/features/fixtures/stub/script/home/user/stub/objects/credentials.rb +11 -0
  102. data/features/fixtures/stub/script/output/.empty +0 -0
  103. data/features/logging.feature +39 -0
  104. data/features/object_scripts.feature +13 -0
  105. data/features/server.feature +36 -0
  106. data/features/step_definitions/client_steps.rb +99 -0
  107. data/features/step_definitions/logging_steps.rb +65 -0
  108. data/features/step_definitions/object_scripts_steps.rb +26 -0
  109. data/features/step_definitions/server_steps.rb +112 -0
  110. data/features/step_definitions/strap_steps.rb +69 -0
  111. data/features/step_definitions/stub_option_simple_steps.rb +31 -0
  112. data/features/step_definitions/stub_steps.rb +94 -0
  113. data/features/strap.feature +34 -0
  114. data/features/stub.feature +157 -0
  115. data/features/stub_option_simple.feature +14 -0
  116. data/features/stub_packages.feature +15 -0
  117. data/features/support/env.rb +197 -0
  118. data/lib/codestrap.rb +415 -0
  119. data/lib/codestrap/cli.rb +76 -0
  120. data/lib/codestrap/client.rb +179 -0
  121. data/lib/codestrap/config.rb +199 -0
  122. data/lib/codestrap/log.rb +56 -0
  123. data/lib/codestrap/mixin.rb +20 -0
  124. data/lib/codestrap/namespace.rb +19 -0
  125. data/lib/codestrap/object/abstract.rb +33 -0
  126. data/lib/codestrap/object/factory.rb +86 -0
  127. data/lib/codestrap/object/standard/datetime.rb +24 -0
  128. data/lib/codestrap/object/standard/files.rb +40 -0
  129. data/lib/codestrap/object/standard/project.rb +33 -0
  130. data/lib/codestrap/object/standard/rest.rb +30 -0
  131. data/lib/codestrap/patch.rb +122 -0
  132. data/lib/codestrap/server/rest.rb +177 -0
  133. data/lib/codestrap/server/version.rb +5 -0
  134. data/lib/codestrap/strap/abstract.rb +135 -0
  135. data/lib/codestrap/strap/factory.rb +85 -0
  136. data/lib/codestrap/strap/standard.rb +95 -0
  137. data/lib/codestrap/stub/abstract.rb +156 -0
  138. data/lib/codestrap/stub/factory.rb +87 -0
  139. data/lib/codestrap/stub/standard.rb +23 -0
  140. data/lib/codestrap/version.rb +3 -0
  141. data/omnibus.rb +53 -0
  142. data/package-scripts/codestrap/postinst +25 -0
  143. data/package-scripts/codestrap/postrm +17 -0
  144. data/package-scripts/codestrap/preinst +7 -0
  145. data/package-scripts/codestrap/prerm +15 -0
  146. data/resources/codestrap/pkg/background.png +0 -0
  147. data/resources/codestrap/pkg/distribution.xml.erb +22 -0
  148. data/resources/codestrap/pkg/license.html.erb +202 -0
  149. data/resources/codestrap/pkg/welcome.html.erb +7 -0
  150. metadata +466 -0
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+
3
+ # <%= local.data %>
@@ -0,0 +1,3 @@
1
+ # strap:erb
2
+
3
+ # <%= local.data %>
@@ -0,0 +1,3 @@
1
+ # strap:erb
2
+
3
+ # <%= local.data %>
@@ -0,0 +1 @@
1
+ <%= remote.data %>
@@ -0,0 +1,3 @@
1
+ # strap:erb
2
+
3
+ # <%= remote.data %>
@@ -0,0 +1,3 @@
1
+ # strap:erb
2
+
3
+ # <%= remote.data %>
@@ -0,0 +1,3 @@
1
+ {
2
+ "data": "local-data"
3
+ }
File without changes
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+
3
+ # <%= remote.data %>
@@ -0,0 +1,3 @@
1
+ # strap:erb
2
+
3
+ # <%= remote.data %>
@@ -0,0 +1,3 @@
1
+ # strap:erb
2
+
3
+ # <%= remote.data %>
@@ -0,0 +1,3 @@
1
+ # strap:erb
2
+
3
+ # <%= local.data %>
@@ -0,0 +1,3 @@
1
+ # strap:erb
2
+
3
+ # <%= local.data %>
@@ -0,0 +1,3 @@
1
+ # strap:erb
2
+
3
+ # <%= remote.data %>
@@ -0,0 +1,3 @@
1
+ # strap:erb
2
+
3
+ # <%= remote.data %>
@@ -0,0 +1,3 @@
1
+ {
2
+ "data": "remote-data"
3
+ }
@@ -0,0 +1,3 @@
1
+ # Interpolate
2
+
3
+ <%= contact.address %>
@@ -0,0 +1,3 @@
1
+ # Interpolate
2
+
3
+ <%= contact.cell %>
@@ -0,0 +1,3 @@
1
+ # Interpolate
2
+
3
+ <%= contact.email %>
@@ -0,0 +1,3 @@
1
+ # Interpolate
2
+
3
+ <%= contact.mobile %>
@@ -0,0 +1,3 @@
1
+ # Interpolate
2
+
3
+ <%= contact.name %>
@@ -0,0 +1,3 @@
1
+ # Interpolate
2
+
3
+ <%= contact.phone %>
@@ -0,0 +1,12 @@
1
+ # strap:erb
2
+ name 'dexterp/foobar'
3
+ version '0.1.0'
4
+ source 'UNKNOWN'
5
+ author '<%= contact.name %>'
6
+ license 'Apache License, Version 2.0'
7
+ summary 'UNKNOWN'
8
+ description 'UNKNOWN'
9
+ project_page 'UNKNOWN'
10
+
11
+ ## Add dependencies, if any:
12
+ # dependency 'username/name', '>= 1.2.0'
@@ -0,0 +1,17 @@
1
+ # strap:erb
2
+ foobar
3
+
4
+ This is the foobar module.
5
+
6
+ License
7
+ -------
8
+
9
+
10
+ Contact
11
+ -------
12
+
13
+
14
+ Support
15
+ -------
16
+
17
+ Please log tickets and issues at our [Projects site](http://projects.example.com)
@@ -0,0 +1,42 @@
1
+ # strap:erb
2
+ # == Class: foobar
3
+ #
4
+ # Full description of class foobar here.
5
+ #
6
+ # === Parameters
7
+ #
8
+ # Document parameters here.
9
+ #
10
+ # [*sample_parameter*]
11
+ # Explanation of what this parameter affects and what it defaults to.
12
+ # e.g. "Specify one or more upstream ntp servers as an array."
13
+ #
14
+ # === Variables
15
+ #
16
+ # Here you should define a list of variables that this module would require.
17
+ #
18
+ # [*sample_variable*]
19
+ # Explanation of how this variable affects the funtion of this class and if
20
+ # it has a default. e.g. "The parameter enc_ntp_servers must be set by the
21
+ # External Node Classifier as a comma separated list of hostnames." (Note,
22
+ # global variables should be avoided in favor of class parameters as
23
+ # of Puppet 2.6.)
24
+ #
25
+ # === Examples
26
+ #
27
+ # class { foobar:
28
+ # servers => [ 'pool.ntp.org', 'ntp.local.company.com' ],
29
+ # }
30
+ #
31
+ # === Authors
32
+ #
33
+ # <%= contact.name %> <%= contact.email %>
34
+ #
35
+ # === Copyright
36
+ #
37
+ # Copyright 2014 Your name here, unless otherwise noted.
38
+ #
39
+ class foobar {
40
+
41
+
42
+ }
@@ -0,0 +1,18 @@
1
+ ## strap:erb
2
+ #dir = File.expand_path(File.dirname(__FILE__))
3
+ #$LOAD_PATH.unshift File.join(dir, 'lib')
4
+ #
5
+ #require 'mocha'
6
+ #require 'puppet'
7
+ #require 'rspec'
8
+ #require 'spec/autorun'
9
+ #
10
+ #Spec::Runner.configure do |config|
11
+ # config.mock_with :mocha
12
+ #end
13
+ #
14
+ ## We need this because the RAL uses 'should' as a method. This
15
+ ## allows us the same behaviour but with a different method name.
16
+ #class Object
17
+ # alias :must :should
18
+ #end
@@ -0,0 +1,13 @@
1
+ # strap:erb
2
+ # The baseline for module testing used by Puppet Labs is that each manifest
3
+ # should have a corresponding test manifest that declares that class or defined
4
+ # type.
5
+ #
6
+ # Tests are then run by using puppet apply --noop (to check for compilation
7
+ # errors and view a log of events) or by fully applying the test in a virtual
8
+ # environment (to compare the resulting system state to the desired state).
9
+ #
10
+ # Learn more about module testing here:
11
+ # http://docs.puppetlabs.com/guides/tests_smoke.html
12
+ #
13
+ include foobar
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "Michonne",
3
+ "email": "dpgrps@gmail.com",
4
+ "phone": "7777 7777",
5
+ "mobile": "0444 4444 4444",
6
+ "cell": "0555 5555 5555",
7
+ "address": "10 Downing Street"
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "",
3
+ "email": "",
4
+ "phone": "",
5
+ "mobile": "",
6
+ "cell": "",
7
+ "address": ""
8
+ }
File without changes
@@ -0,0 +1,12 @@
1
+ # strap:erb
2
+ name 'dexterp/foobar'
3
+ version '0.1.0'
4
+ source 'UNKNOWN'
5
+ author '<%= contact.name %>'
6
+ license 'Apache License, Version 2.0'
7
+ summary 'UNKNOWN'
8
+ description 'UNKNOWN'
9
+ project_page 'UNKNOWN'
10
+
11
+ ## Add dependencies, if any:
12
+ # dependency 'username/name', '>= 1.2.0'
@@ -0,0 +1,17 @@
1
+ # strap:erb
2
+ foobar
3
+
4
+ This is the foobar module.
5
+
6
+ License
7
+ -------
8
+
9
+
10
+ Contact
11
+ -------
12
+
13
+
14
+ Support
15
+ -------
16
+
17
+ Please log tickets and issues at our [Projects site](http://projects.example.com)
@@ -0,0 +1,3 @@
1
+ # strap:erb
2
+ class <%= project.name %>::subclass {
3
+ }
@@ -0,0 +1,42 @@
1
+ # strap:erb
2
+ # == Class: foobar
3
+ #
4
+ # Full description of class foobar here.
5
+ #
6
+ # === Parameters
7
+ #
8
+ # Document parameters here.
9
+ #
10
+ # [*sample_parameter*]
11
+ # Explanation of what this parameter affects and what it defaults to.
12
+ # e.g. "Specify one or more upstream ntp servers as an array."
13
+ #
14
+ # === Variables
15
+ #
16
+ # Here you should define a list of variables that this module would require.
17
+ #
18
+ # [*sample_variable*]
19
+ # Explanation of how this variable affects the funtion of this class and if
20
+ # it has a default. e.g. "The parameter enc_ntp_servers must be set by the
21
+ # External Node Classifier as a comma separated list of hostnames." (Note,
22
+ # global variables should be avoided in favor of class parameters as
23
+ # of Puppet 2.6.)
24
+ #
25
+ # === Examples
26
+ #
27
+ # class { foobar:
28
+ # servers => [ 'pool.ntp.org', 'ntp.local.company.com' ],
29
+ # }
30
+ #
31
+ # === Authors
32
+ #
33
+ # <%= contact.name %> <%= contact.email %>
34
+ #
35
+ # === Copyright
36
+ #
37
+ # Copyright 2014 Your name here, unless otherwise noted.
38
+ #
39
+ class foobar {
40
+
41
+
42
+ }
@@ -0,0 +1,18 @@
1
+ ## strap:erb
2
+ #dir = File.expand_path(File.dirname(__FILE__))
3
+ #$LOAD_PATH.unshift File.join(dir, 'lib')
4
+ #
5
+ #require 'mocha'
6
+ #require 'puppet'
7
+ #require 'rspec'
8
+ #require 'spec/autorun'
9
+ #
10
+ #Spec::Runner.configure do |config|
11
+ # config.mock_with :mocha
12
+ #end
13
+ #
14
+ ## We need this because the RAL uses 'should' as a method. This
15
+ ## allows us the same behaviour but with a different method name.
16
+ #class Object
17
+ # alias :must :should
18
+ #end
@@ -0,0 +1,13 @@
1
+ # strap:erb
2
+ # The baseline for module testing used by Puppet Labs is that each manifest
3
+ # should have a corresponding test manifest that declares that class or defined
4
+ # type.
5
+ #
6
+ # Tests are then run by using puppet apply --noop (to check for compilation
7
+ # errors and view a log of events) or by fully applying the test in a virtual
8
+ # environment (to compare the resulting system state to the desired state).
9
+ #
10
+ # Learn more about module testing here:
11
+ # http://docs.puppetlabs.com/guides/tests_smoke.html
12
+ #
13
+ include foobar
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "Michonne",
3
+ "email": "dpgrps@gmail.com",
4
+ "phone": "7777 7777",
5
+ "mobile": "0444 4444 4444",
6
+ "cell": "0555 5555 5555",
7
+ "address": "10 Downing Street"
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "",
3
+ "email": "",
4
+ "phone": "",
5
+ "mobile": "",
6
+ "cell": "",
7
+ "address": ""
8
+ }
File without changes
File without changes
@@ -0,0 +1,3 @@
1
+ # Interpolate
2
+
3
+ <%= contact.address %>