cardboard23 2.1.1a

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7488a71d6ab4d19d4a43934619c42472a432bb6a
4
+ data.tar.gz: 4d61ed8c9784cfc2e550bd1ec427d9931b7e1049
5
+ SHA512:
6
+ metadata.gz: e2691725c88ddb053a2c4a27642c6606e6f30ee47418b82f980d71d3e373c2f6ebc6c64c52c3db4005228517e23edaa5cb71d2ab9701bd83bcf4bb93f9bfe63b
7
+ data.tar.gz: cc1da56f11720943ba82c05eadf672e09cfd27d48504ca9118190ca467b9c322a680c94ac1596857ce4e30edc177cbef2f29faf293c2fbf1ccf1c80b43fecfd2
@@ -0,0 +1,3 @@
1
+ /.bundle
2
+ /.ruby-version
3
+ /cardboard-*.gem
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec
@@ -0,0 +1,107 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ cardboard23 (3.1.2)
5
+ boxen23 (~> 3.1)
6
+ librarian-puppet (~> 2.2)
7
+ puppet-lint (~> 2.3)
8
+ puppetlabs_spec_helper (~> 2.4)
9
+ rspec-puppet (~> 2.6)
10
+
11
+ GEM
12
+ remote: http://rubygems.org/
13
+ specs:
14
+ addressable (2.3.8)
15
+ ansi (1.5.0)
16
+ boxen23 (3.1.7)
17
+ ansi (~> 1.5)
18
+ hiera (~> 3.4.2)
19
+ highline (~> 1.7.8)
20
+ json_pure (>= 1.8.3, < 2.0)
21
+ octokit (~> 3.8, >= 3.8.0)
22
+ puppet (~> 4.10)
23
+ diff-lcs (1.3)
24
+ facter (2.5.1)
25
+ faraday (0.9.2)
26
+ multipart-post (>= 1.2, < 3)
27
+ faraday_middleware (0.10.1)
28
+ faraday (>= 0.7.4, < 1.0)
29
+ fast_gettext (1.1.0)
30
+ gettext (3.2.4)
31
+ locale (>= 2.0.5)
32
+ text (>= 1.3.0)
33
+ gettext-setup (0.28)
34
+ fast_gettext (~> 1.1.0)
35
+ gettext (>= 3.0.2)
36
+ locale
37
+ hiera (3.4.2)
38
+ highline (1.7.8)
39
+ json_pure (1.8.6)
40
+ librarian-puppet (2.2.3)
41
+ librarianp (>= 0.6.3)
42
+ puppet_forge (~> 2.1)
43
+ rsync
44
+ librarianp (0.6.4)
45
+ thor (~> 0.15)
46
+ locale (2.1.2)
47
+ metaclass (0.0.4)
48
+ minitar (0.6.1)
49
+ mocha (1.3.0)
50
+ metaclass (~> 0.0.1)
51
+ multipart-post (2.0.0)
52
+ octokit (3.8.0)
53
+ sawyer (~> 0.6.0, >= 0.5.3)
54
+ puppet (4.10.9)
55
+ facter (> 2.0, < 4)
56
+ gettext-setup (>= 0.10, < 1)
57
+ hiera (>= 2.0, < 4)
58
+ json_pure (~> 1.8)
59
+ locale (~> 2.1)
60
+ puppet-lint (2.3.3)
61
+ puppet-syntax (2.4.1)
62
+ rake
63
+ puppet_forge (2.2.8)
64
+ faraday (~> 0.9.0)
65
+ faraday_middleware (>= 0.9.0, < 0.11.0)
66
+ gettext-setup (~> 0.11)
67
+ minitar
68
+ semantic_puppet (~> 1.0)
69
+ puppetlabs_spec_helper (2.5.0)
70
+ mocha (~> 1.0)
71
+ puppet-lint (~> 2.0)
72
+ puppet-syntax (~> 2.0)
73
+ rspec-puppet (~> 2.0)
74
+ rake (12.3.0)
75
+ rspec (3.7.0)
76
+ rspec-core (~> 3.7.0)
77
+ rspec-expectations (~> 3.7.0)
78
+ rspec-mocks (~> 3.7.0)
79
+ rspec-core (3.7.0)
80
+ rspec-support (~> 3.7.0)
81
+ rspec-expectations (3.7.0)
82
+ diff-lcs (>= 1.2.0, < 2.0)
83
+ rspec-support (~> 3.7.0)
84
+ rspec-mocks (3.7.0)
85
+ diff-lcs (>= 1.2.0, < 2.0)
86
+ rspec-support (~> 3.7.0)
87
+ rspec-puppet (2.6.9)
88
+ rspec
89
+ rspec-support (3.7.0)
90
+ rsync (1.0.9)
91
+ sawyer (0.6.0)
92
+ addressable (~> 2.3.5)
93
+ faraday (~> 0.8, < 0.10)
94
+ semantic_puppet (1.0.1)
95
+ gettext-setup (>= 0.3)
96
+ text (1.3.1)
97
+ thor (0.20.0)
98
+
99
+ PLATFORMS
100
+ ruby
101
+ x86_64-darwin-16
102
+
103
+ DEPENDENCIES
104
+ cardboard23!
105
+
106
+ BUNDLED WITH
107
+ 1.16.0
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2012 GitHub, Inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,45 @@
1
+ # Cardboard Boxen
2
+
3
+ Development tools for Boxen's puppet module projects. This `cardboard`
4
+ RubyGem contains shared development behavior for and is a dependency
5
+ of each of the `boxen/puppet-*` module projects.
6
+
7
+ To make porting easy and interfaces simple, none of Cardboard's
8
+ commands are called directly. Instead, shims in a module project's
9
+ `scripts/` directory delegate to Cardboard's `libexec/` commands after
10
+ making sure all dependencies are up-to-date.
11
+
12
+ ## Available Commands
13
+
14
+ ### `bootstrap`
15
+
16
+ Called before any other command, `bootstrap` makes sure any Puppet
17
+ modules needed to run specs are available. It only runs if
18
+ `spec/fixtures/Puppetfile` exists.
19
+
20
+ ### `cibuild`
21
+
22
+ FIX: Runs `script/syntax`, `script/lint`, and `script/specs` if they
23
+ exist.
24
+
25
+ ### `lint`
26
+
27
+ Runs `puppet-lint` on all `.pp` files in `manifests/`.
28
+
29
+ ### `specs`
30
+
31
+ Runs all specs under `spec/`.
32
+
33
+ ### `syntax`
34
+
35
+ Validates the syntax of all Puppet and Ruby files.
36
+
37
+ ## Using Cardboard in Your Boxen Modules
38
+
39
+ It's probably best to follow the structure of
40
+ [Boxen's template puppet module][template].
41
+
42
+ [template]: https://github.com/boxen/puppet-template
43
+
44
+ Boxen's template makes Cardboard commands available via shims, so
45
+ `script/cibuild` will run Cardboard's `libexec/cibuild` command.
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env ruby
2
+ # A proxy for libexec.
3
+
4
+ require "pathname"
5
+
6
+ libexec = Pathname.new(__FILE__).realpath + "../../libexec"
7
+
8
+ if ARGV.empty?
9
+ Dir.chdir(libexec)
10
+ entries = ''
11
+ Dir.glob('*').each { |entry|
12
+ entries += " #{entry}\n"
13
+ }
14
+ usage = "usage: cardboard <script>\n\nAvailable scripts are:\n#{entries}"
15
+
16
+ abort "cardboard: No script given.\n#{usage}"
17
+ end
18
+
19
+ script = libexec + ARGV.shift
20
+
21
+ unless script.executable?
22
+ abort "cardboard: Unknown script: #{script}"
23
+ end
24
+
25
+ exec script.to_s, *ARGV
@@ -0,0 +1,60 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'fileutils'
4
+
5
+ def run(args)
6
+ if args[0].nil?
7
+ abort "cardboardify: Please specify the name of the module you wish to make"
8
+ elsif args.length > 1
9
+ abort "cardboardify: Too many arguments, one at a time please."
10
+ end
11
+
12
+ application_name = args[0]
13
+ module_name = "puppet-#{args[0]}"
14
+ if File.exists?(module_name)
15
+ warn "cardboardify: #{module_name}/ already exists"
16
+ return 1
17
+ elsif File.exists?(module_name.downcase)
18
+ warn "cardboardify: '#{module_name.downcase}' exists, which could conflict with `#{module_name}'"
19
+ return 1
20
+ else
21
+ puts "cardboardify: Creating '#{module_name}', this may take a few minutes"
22
+ FileUtils.mkdir_p(module_name)
23
+ get_boxen_template(module_name)
24
+ modify_template_files(module_name, application_name)
25
+ puts "cardboardify complete!"
26
+ return 0
27
+ end
28
+ end
29
+
30
+ def modify_template_files(module_name, application_name)
31
+ Dir.chdir(module_name) do
32
+ FileUtils.mv "spec/fixtures/modules/template/", "spec/fixtures/modules/#{application_name}/"
33
+ FileUtils.mv "spec/classes/template_spec.rb", "spec/classes/#{application_name}_spec.rb"
34
+ remove_template_references(application_name)
35
+ end
36
+ end
37
+
38
+ def get_boxen_template(target_dir)
39
+ Dir.chdir(target_dir) do
40
+ download = `curl -s -L https://github.com/boxen/puppet-template/archive/master.tar.gz | tar zx --strip-components 1`
41
+ setup_bundle = `bundle install --binstubs .bundle/binstubs --path .bundle --quiet`
42
+ remove_git = `rm -rf .git`
43
+ git_init = `git init .`
44
+ end
45
+ end
46
+
47
+ def remove_template_references(application_name)
48
+ files_to_fix = ["manifests/init.pp", "spec/classes/#{application_name}_spec.rb"]
49
+ files_to_fix.each do | file_to_fix |
50
+ replace = ""
51
+ File.open(file_to_fix) do |file|
52
+ file.lines.each do |line|
53
+ replace << line.gsub(/template/,"#{application_name}")
54
+ end
55
+ end
56
+ File.open(file_to_fix, "w") {|file| file.puts replace}
57
+ end
58
+ end
59
+
60
+ run(ARGV)
@@ -0,0 +1,21 @@
1
+ Gem::Specification.new do |gem|
2
+ gem.name = "cardboard23"
3
+ gem.version = "2.1.1a"
4
+ gem.authors = ["John Barnette", "Will Farrington"]
5
+ gem.email = ["jbarnette@github.com", "wfarr@github.com"]
6
+ gem.description = "Development tools for Boxen's puppet modules."
7
+ gem.summary = "Development dependencies for the ecosystem."
8
+ gem.homepage = "https://github.com/boxen/cardboard"
9
+ gem.license = "MIT"
10
+
11
+ gem.executables = ["cardboard", "cardboardify"]
12
+ gem.files = `git ls-files`.split $/
13
+ gem.test_files = gem.files.grep /^test/
14
+ gem.require_paths = ["lib"]
15
+
16
+ gem.add_dependency "boxen23", "~> 3.1"
17
+ gem.add_dependency "librarian-puppet", "~> 2.2"
18
+ gem.add_dependency "puppet-lint", "~> 2.3"
19
+ gem.add_dependency "puppetlabs_spec_helper", "~> 2.4"
20
+ gem.add_dependency "rspec-puppet", "~> 2.6"
21
+ end
@@ -0,0 +1,8 @@
1
+ #!/bin/bash
2
+ # Install Puppet deps for specs if necessary.
3
+
4
+ set -e
5
+
6
+ if [ -f spec/fixtures/Puppetfile ]; then
7
+ cd spec/fixtures && ../../.bundle/binstubs/librarian-puppet install
8
+ fi
@@ -0,0 +1,13 @@
1
+ #!/bin/bash
2
+ # Check everything for CI.
3
+
4
+ libexec=$(dirname "$0")
5
+
6
+ echo "--> Checking syntax:"
7
+ "$libexec/syntax" "$@" || exit 1
8
+
9
+ echo "--> Running specs:"
10
+ "$libexec/specs" "$@" || exit 1
11
+
12
+ echo "--> Checking lint:"
13
+ "$libexec/lint" "$@" || exit 1
@@ -0,0 +1,20 @@
1
+ #!/bin/sh
2
+ # Check the idiom of all Puppet files.
3
+
4
+ set -e
5
+
6
+ puppets=`find . -type f -path './manifests/*' -name '*.pp' -print 2>/dev/null`
7
+
8
+ for puppet in $puppets; do
9
+ /bin/echo -n "${puppet}: "
10
+ .bundle/binstubs/puppet-lint \
11
+ --fail-on-warnings \
12
+ --no-80chars-check \
13
+ --no-140chars-check \
14
+ --no-autoloader_layout-check \
15
+ --no-class_inherits_from_params_class-check \
16
+ $puppet && echo "Lint OK"
17
+ if [ $? -ne 0 ]; then
18
+ exit 1
19
+ fi
20
+ done
@@ -0,0 +1,11 @@
1
+ #!/bin/bash
2
+ # Run the Puppet RSpecs.
3
+
4
+ if [ "$1" == "-v" ]; then
5
+ err_out=/dev/stderr
6
+ else
7
+ err_out=/dev/null
8
+ fi
9
+
10
+ find spec -name '*_spec.rb' -not -path 'spec/fixtures/*' -print0 |
11
+ xargs -0 bundle exec rspec 2>$err_out
@@ -0,0 +1,32 @@
1
+ #!/bin/bash
2
+ # Check the syntax of all Puppet and Ruby files.
3
+
4
+ set -e
5
+
6
+ puppets=`find . -type f -path './manifests/*' -name '*.pp' -print 2>/dev/null`
7
+ rubies=`find . -type f -path './lib/*' -or -path './spec/*' -not -path './spec/fixtures/*' -name '*.rb' -print 2>/dev/null`
8
+ templates=`find . -type f -path './templates/*' -name '*.erb' -print 2>/dev/null`
9
+
10
+ for puppet in $puppets; do
11
+ /bin/echo -n "${puppet}: "
12
+ .bundle/binstubs/puppet parser validate $puppet && echo "Syntax OK"
13
+ if [ $? -ne 0 ]; then
14
+ exit 1
15
+ fi
16
+ done
17
+
18
+ for ruby in $rubies; do
19
+ /bin/echo -n "${ruby}: "
20
+ ruby -wc $ruby
21
+ if [ $? -ne 0 ]; then
22
+ exit 1
23
+ fi
24
+ done
25
+
26
+ for template in $templates; do
27
+ /bin/echo -n "${template}: "
28
+ erb -P -x -T '-' ${template} | ruby -wc
29
+ if [ $? -ne 0 ]; then
30
+ exit 1
31
+ fi
32
+ done
@@ -0,0 +1,9 @@
1
+ #!/bin/sh
2
+ # Make sure all local dependencies are available.
3
+
4
+ set -e
5
+
6
+ cd $(dirname "$0")/..
7
+
8
+ rm -rf .bundle/config
9
+ bundle install --path .bundle --quiet
@@ -0,0 +1,38 @@
1
+ #!/bin/sh
2
+ # Tag and push a release.
3
+
4
+ set -e
5
+
6
+ # Make sure we're in the project root.
7
+
8
+ cd $(dirname "$0")/..
9
+
10
+ # Build a new gem archive.
11
+
12
+ rm -rf cardboard-*.gem
13
+ gem build -q cardboard.gemspec
14
+
15
+ # Make sure we're on the master branch.
16
+
17
+ (git branch | grep '* master') || {
18
+ echo "Only release from the master branch."
19
+ exit 1
20
+ }
21
+
22
+ # Figure out what version we're releasing.
23
+
24
+ tag=v`ls cardboard-*.gem | sed 's/^cardboard-\(.*\)\.gem$/\1/'`
25
+
26
+ # Make sure we haven't released this version before.
27
+
28
+ git fetch -t origin
29
+
30
+ (git tag -l | grep "$tag") && {
31
+ echo "Whoops, there's already a '${tag}' tag."
32
+ exit 1
33
+ }
34
+
35
+ # Tag it and bag it.
36
+
37
+ gem push cardboard-*.gem && git tag "$tag" &&
38
+ git push origin master && git push origin "$tag"
metadata ADDED
@@ -0,0 +1,133 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cardboard23
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.1.1a
5
+ platform: ruby
6
+ authors:
7
+ - John Barnette
8
+ - Will Farrington
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2018-02-20 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: boxen23
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: '3.1'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: '3.1'
28
+ - !ruby/object:Gem::Dependency
29
+ name: librarian-puppet
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: '2.2'
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '2.2'
42
+ - !ruby/object:Gem::Dependency
43
+ name: puppet-lint
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '2.3'
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '2.3'
56
+ - !ruby/object:Gem::Dependency
57
+ name: puppetlabs_spec_helper
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '2.4'
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '2.4'
70
+ - !ruby/object:Gem::Dependency
71
+ name: rspec-puppet
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: '2.6'
77
+ type: :runtime
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: '2.6'
84
+ description: Development tools for Boxen's puppet modules.
85
+ email:
86
+ - jbarnette@github.com
87
+ - wfarr@github.com
88
+ executables:
89
+ - cardboard
90
+ - cardboardify
91
+ extensions: []
92
+ extra_rdoc_files: []
93
+ files:
94
+ - ".gitignore"
95
+ - Gemfile
96
+ - Gemfile.lock
97
+ - LICENSE
98
+ - README.md
99
+ - bin/cardboard
100
+ - bin/cardboardify
101
+ - cardboard.gemspec
102
+ - libexec/bootstrap
103
+ - libexec/cibuild
104
+ - libexec/lint
105
+ - libexec/specs
106
+ - libexec/syntax
107
+ - script/bootstrap
108
+ - script/release
109
+ homepage: https://github.com/boxen/cardboard
110
+ licenses:
111
+ - MIT
112
+ metadata: {}
113
+ post_install_message:
114
+ rdoc_options: []
115
+ require_paths:
116
+ - lib
117
+ required_ruby_version: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - ">="
120
+ - !ruby/object:Gem::Version
121
+ version: '0'
122
+ required_rubygems_version: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - ">"
125
+ - !ruby/object:Gem::Version
126
+ version: 1.3.1
127
+ requirements: []
128
+ rubyforge_project:
129
+ rubygems_version: 2.5.2
130
+ signing_key:
131
+ specification_version: 4
132
+ summary: Development dependencies for the ecosystem.
133
+ test_files: []