cardboard 0.0.0 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
1
  /.bundle
2
- /bin
2
+ /.ruby-version
3
+ /cardboard-*.gem
data/Gemfile.lock CHANGED
@@ -2,8 +2,7 @@ PATH
2
2
  remote: .
3
3
  specs:
4
4
  cardboard (0.0.0)
5
- librarian-puppet (~> 0.9)
6
- puppet (~> 3.0)
5
+ boxen (~> 0.6)
7
6
  puppet-lint (~> 0.3)
8
7
  puppetlabs_spec_helper (~> 0.3)
9
8
  rspec-puppet (~> 0.1)
@@ -11,35 +10,62 @@ PATH
11
10
  GEM
12
11
  remote: http://rubygems.org/
13
12
  specs:
13
+ addressable (2.3.2)
14
+ ansi (1.4.3)
15
+ boxen (0.6.0)
16
+ ansi (~> 1.4)
17
+ hiera (~> 1.0.0)
18
+ highline (~> 1.6)
19
+ json_pure (~> 1.7)
20
+ librarian-puppet (~> 0.9)
21
+ octokit (~> 1.15)
22
+ puppet (~> 3.0)
14
23
  diff-lcs (1.1.3)
15
- facter (1.6.15)
24
+ facter (1.6.17)
25
+ faraday (0.8.4)
26
+ multipart-post (~> 1.1)
27
+ faraday_middleware (0.9.0)
28
+ faraday (>= 0.7.4, < 0.9)
29
+ hashie (1.2.0)
16
30
  hiera (1.0.0)
17
- json (1.7.5)
31
+ highline (1.6.15)
32
+ json (1.7.6)
33
+ json_pure (1.7.6)
18
34
  librarian-puppet (0.9.7)
19
35
  json
20
36
  puppet
21
37
  thor (~> 0.15)
22
38
  metaclass (0.0.1)
23
- mocha (0.13.0)
39
+ mocha (0.13.1)
24
40
  metaclass (~> 0.0.1)
25
- puppet (3.0.1)
41
+ multi_json (1.5.0)
42
+ multipart-post (1.1.5)
43
+ netrc (0.7.7)
44
+ octokit (1.22.0)
45
+ addressable (~> 2.2)
46
+ faraday (~> 0.8)
47
+ faraday_middleware (~> 0.9)
48
+ hashie (~> 1.2)
49
+ multi_json (~> 1.3)
50
+ netrc (~> 0.7.7)
51
+ puppet (3.0.2)
26
52
  facter (~> 1.6.11)
27
53
  hiera (~> 1.0.0)
28
54
  puppet-lint (0.3.2)
29
- puppetlabs_spec_helper (0.3.0)
55
+ puppetlabs_spec_helper (0.4.0)
30
56
  mocha (>= 0.10.5)
31
57
  rake
32
58
  rspec (>= 2.9.0)
33
59
  rspec-puppet (>= 0.1.1)
34
- rake (10.0.2)
60
+ rake (10.0.3)
35
61
  rspec (2.12.0)
36
62
  rspec-core (~> 2.12.0)
37
63
  rspec-expectations (~> 2.12.0)
38
64
  rspec-mocks (~> 2.12.0)
39
- rspec-core (2.12.0)
40
- rspec-expectations (2.12.0)
65
+ rspec-core (2.12.2)
66
+ rspec-expectations (2.12.1)
41
67
  diff-lcs (~> 1.1.3)
42
- rspec-mocks (2.12.0)
68
+ rspec-mocks (2.12.1)
43
69
  rspec-puppet (0.1.5)
44
70
  rspec
45
71
  thor (0.16.0)
data/README.md CHANGED
@@ -1,3 +1,47 @@
1
1
  # Cardboard Boxen
2
2
 
3
- Development tools for Boxen's puppet modules.
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]. You can generate a stub
41
+ from this template by running `boxen --new-module <module-name>`
42
+ anywhere Boxen is installed.
43
+
44
+ [template]: https://github.com/boxen/puppet-template
45
+
46
+ Boxen's template makes Cardboard commands available via shims, so
47
+ `script/cibuild` will run Cardboard's `libexec/cibuild` command.
data/bin/cardboard ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+ # A proxy for libexec.
3
+
4
+ require "pathname"
5
+
6
+ libexec = Pathname.new(__FILE__).realpath + "../../libexec"
7
+ script = libexec + ARGV.pop
8
+
9
+ unless script.executable?
10
+ abort "cardboard: Unknown script: #{script}"
11
+ end
12
+
13
+ exec script.to_s, *ARGV
data/cardboard.gemspec CHANGED
@@ -1,21 +1,19 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
1
  Gem::Specification.new do |gem|
4
2
  gem.name = "cardboard"
5
- gem.version = "0.0.0"
3
+ gem.version = "0.1.0"
6
4
  gem.authors = ["John Barnette", "Will Farrington"]
7
5
  gem.email = ["jbarnette@github.com", "wfarr@github.com"]
8
6
  gem.description = "Development tools for Boxen's puppet modules."
9
- gem.summary = "Because copypasta is for toolbags."
7
+ gem.summary = "Development dependencies for the ecosystem."
10
8
  gem.homepage = "https://github.com/boxen/cardboard"
11
9
 
10
+ gem.executables = ["cardboard"]
12
11
  gem.files = `git ls-files`.split $/
13
12
  gem.test_files = gem.files.grep /^test/
14
13
  gem.require_paths = ["lib"]
15
14
 
16
- gem.add_dependency "librarian-puppet", "~> 0.9"
17
- gem.add_dependency "puppet", "~> 3.0"
15
+ gem.add_dependency "boxen", "~> 0.8"
18
16
  gem.add_dependency "puppet-lint", "~> 0.3"
19
- gem.add_dependency "puppetlabs_spec_helper", "~> 0.3"
17
+ gem.add_dependency "puppetlabs_spec_helper", "~> 0.4"
20
18
  gem.add_dependency "rspec-puppet", "~> 0.1"
21
19
  end
data/libexec/bootstrap ADDED
@@ -0,0 +1,8 @@
1
+ #!/bin/sh
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
data/libexec/cibuild ADDED
@@ -0,0 +1,8 @@
1
+ #!/bin/sh
2
+ # Check everything for CI.
3
+
4
+ set -e
5
+
6
+ bundle exec cardboard syntax &&
7
+ bundle exec cardboard specs &&
8
+ bundle exec cardboard lint
data/libexec/lint ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/sh
2
+ # Check the idiom of all Puppet files.
3
+
4
+ set -e
5
+
6
+ exec .bundle/binstubs/puppet-lint \
7
+ --fail-on-warnings --no-80chars-check --with-filename manifests "$@"
data/libexec/specs ADDED
@@ -0,0 +1,5 @@
1
+ #!/bin/sh
2
+ # Run the Puppet RSpecs.
3
+
4
+ find spec -name '*_spec.rb' -not -path 'spec/fixtures/*' -print0 |
5
+ xargs -0 bundle exec rspec 2>/dev/null
data/libexec/syntax ADDED
@@ -0,0 +1,32 @@
1
+ #!/bin/sh
2
+ # Check the syntax of all Puppet and Ruby files.
3
+
4
+ set -e
5
+
6
+ puppets=`find manifests -name '*.pp' -print 2>/dev/null`
7
+ rubies=`find lib spec -name '*.rb' -not -path 'spec/fixtures/*' -print 2>/dev/null`
8
+ templates=`find templates -type f -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
data/script/bootstrap CHANGED
@@ -6,4 +6,4 @@ set -e
6
6
  cd $(dirname "$0")/..
7
7
 
8
8
  rm -rf .bundle/config
9
- bundle install --binstubs bin --path .bundle --quiet
9
+ bundle install --path .bundle --quiet
metadata CHANGED
@@ -1,135 +1,129 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: cardboard
3
- version: !ruby/object:Gem::Version
4
- version: 0.0.0
5
- prerelease:
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 0
9
+ version: 0.1.0
6
10
  platform: ruby
7
- authors:
11
+ authors:
8
12
  - John Barnette
9
13
  - Will Farrington
10
14
  autorequire:
11
15
  bindir: bin
12
16
  cert_chain: []
13
- date: 2012-11-29 00:00:00.000000000 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: librarian-puppet
17
- requirement: !ruby/object:Gem::Requirement
18
- none: false
19
- requirements:
20
- - - ~>
21
- - !ruby/object:Gem::Version
22
- version: '0.9'
23
- type: :runtime
17
+
18
+ date: 2013-02-13 00:00:00 -08:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: boxen
24
23
  prerelease: false
25
- version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
- requirements:
28
- - - ~>
29
- - !ruby/object:Gem::Version
30
- version: '0.9'
31
- - !ruby/object:Gem::Dependency
32
- name: puppet
33
- requirement: !ruby/object:Gem::Requirement
34
- none: false
35
- requirements:
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ requirements:
36
26
  - - ~>
37
- - !ruby/object:Gem::Version
38
- version: '3.0'
27
+ - !ruby/object:Gem::Version
28
+ segments:
29
+ - 0
30
+ - 8
31
+ version: "0.8"
39
32
  type: :runtime
40
- prerelease: false
41
- version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
- requirements:
44
- - - ~>
45
- - !ruby/object:Gem::Version
46
- version: '3.0'
47
- - !ruby/object:Gem::Dependency
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
48
35
  name: puppet-lint
49
- requirement: !ruby/object:Gem::Requirement
50
- none: false
51
- requirements:
52
- - - ~>
53
- - !ruby/object:Gem::Version
54
- version: '0.3'
55
- type: :runtime
56
36
  prerelease: false
57
- version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
- requirements:
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ requirements:
60
39
  - - ~>
61
- - !ruby/object:Gem::Version
62
- version: '0.3'
63
- - !ruby/object:Gem::Dependency
64
- name: puppetlabs_spec_helper
65
- requirement: !ruby/object:Gem::Requirement
66
- none: false
67
- requirements:
68
- - - ~>
69
- - !ruby/object:Gem::Version
70
- version: '0.3'
40
+ - !ruby/object:Gem::Version
41
+ segments:
42
+ - 0
43
+ - 3
44
+ version: "0.3"
71
45
  type: :runtime
46
+ version_requirements: *id002
47
+ - !ruby/object:Gem::Dependency
48
+ name: puppetlabs_spec_helper
72
49
  prerelease: false
73
- version_requirements: !ruby/object:Gem::Requirement
74
- none: false
75
- requirements:
50
+ requirement: &id003 !ruby/object:Gem::Requirement
51
+ requirements:
76
52
  - - ~>
77
- - !ruby/object:Gem::Version
78
- version: '0.3'
79
- - !ruby/object:Gem::Dependency
80
- name: rspec-puppet
81
- requirement: !ruby/object:Gem::Requirement
82
- none: false
83
- requirements:
84
- - - ~>
85
- - !ruby/object:Gem::Version
86
- version: '0.1'
53
+ - !ruby/object:Gem::Version
54
+ segments:
55
+ - 0
56
+ - 4
57
+ version: "0.4"
87
58
  type: :runtime
59
+ version_requirements: *id003
60
+ - !ruby/object:Gem::Dependency
61
+ name: rspec-puppet
88
62
  prerelease: false
89
- version_requirements: !ruby/object:Gem::Requirement
90
- none: false
91
- requirements:
63
+ requirement: &id004 !ruby/object:Gem::Requirement
64
+ requirements:
92
65
  - - ~>
93
- - !ruby/object:Gem::Version
94
- version: '0.1'
66
+ - !ruby/object:Gem::Version
67
+ segments:
68
+ - 0
69
+ - 1
70
+ version: "0.1"
71
+ type: :runtime
72
+ version_requirements: *id004
95
73
  description: Development tools for Boxen's puppet modules.
96
- email:
74
+ email:
97
75
  - jbarnette@github.com
98
76
  - wfarr@github.com
99
- executables: []
77
+ executables:
78
+ - cardboard
100
79
  extensions: []
80
+
101
81
  extra_rdoc_files: []
102
- files:
82
+
83
+ files:
103
84
  - .gitignore
104
85
  - Gemfile
105
86
  - Gemfile.lock
106
87
  - LICENSE
107
88
  - README.md
89
+ - bin/cardboard
108
90
  - cardboard.gemspec
91
+ - libexec/bootstrap
92
+ - libexec/cibuild
93
+ - libexec/lint
94
+ - libexec/specs
95
+ - libexec/syntax
109
96
  - script/bootstrap
110
97
  - script/release
98
+ has_rdoc: true
111
99
  homepage: https://github.com/boxen/cardboard
112
100
  licenses: []
101
+
113
102
  post_install_message:
114
103
  rdoc_options: []
115
- require_paths:
104
+
105
+ require_paths:
116
106
  - lib
117
- required_ruby_version: !ruby/object:Gem::Requirement
118
- none: false
119
- requirements:
120
- - - ! '>='
121
- - !ruby/object:Gem::Version
122
- version: '0'
123
- required_rubygems_version: !ruby/object:Gem::Requirement
124
- none: false
125
- requirements:
126
- - - ! '>='
127
- - !ruby/object:Gem::Version
128
- version: '0'
107
+ required_ruby_version: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ segments:
112
+ - 0
113
+ version: "0"
114
+ required_rubygems_version: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ segments:
119
+ - 0
120
+ version: "0"
129
121
  requirements: []
122
+
130
123
  rubyforge_project:
131
- rubygems_version: 1.8.23
124
+ rubygems_version: 1.3.6
132
125
  signing_key:
133
126
  specification_version: 3
134
- summary: Because copypasta is for toolbags.
127
+ summary: Development dependencies for the ecosystem.
135
128
  test_files: []
129
+