cardboard 1.0.4 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 89731773896a7cd65f5495e3420cee7360bb4743
4
+ data.tar.gz: acf02bd31cb0509ed6e5151281a914a25b8855e1
5
+ SHA512:
6
+ metadata.gz: 99e43edb27e52db77c561ddd734de7bd766e1422e5e5e6beec460d44a9c0390fe9de64785c7442cc56dc1498698f055e6a80f83a75625768ce0e8d6f14703c04
7
+ data.tar.gz: 7aad5495b31b78e29e01e607f26d2256da5ccf3cb188eee9f6bebfc878607fef49a6c1a2bf4a23a82f796a9cec68a6fad95079422d523b95a6116178950965f2
@@ -1,74 +1,69 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cardboard (0.0.0)
5
- boxen (~> 0.6)
4
+ cardboard (1.0.4)
5
+ boxen (~> 2.1)
6
6
  puppet-lint (~> 0.3)
7
- puppetlabs_spec_helper (~> 0.3)
7
+ puppetlabs_spec_helper (~> 0.4)
8
8
  rspec-puppet (~> 0.1)
9
9
 
10
10
  GEM
11
11
  remote: http://rubygems.org/
12
12
  specs:
13
- addressable (2.3.2)
13
+ addressable (2.3.5)
14
14
  ansi (1.4.3)
15
- boxen (0.6.0)
15
+ boxen (2.1.0)
16
16
  ansi (~> 1.4)
17
- hiera (~> 1.0.0)
17
+ hiera (~> 1.0)
18
18
  highline (~> 1.6)
19
- json_pure (~> 1.7)
20
- librarian-puppet (~> 0.9)
21
- octokit (~> 1.15)
19
+ json_pure (>= 1.7.7, < 2.0)
20
+ librarian-puppet (~> 0.9.9)
21
+ octokit (~> 2.3.0)
22
22
  puppet (~> 3.0)
23
- diff-lcs (1.1.3)
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)
30
- hiera (1.0.0)
31
- highline (1.6.15)
32
- json (1.7.6)
33
- json_pure (1.7.6)
34
- librarian-puppet (0.9.7)
23
+ diff-lcs (1.2.5)
24
+ facter (1.7.3)
25
+ faraday (0.8.8)
26
+ multipart-post (~> 1.2.0)
27
+ hiera (1.2.1)
28
+ json_pure
29
+ highline (1.6.20)
30
+ json (1.8.1)
31
+ json_pure (1.8.1)
32
+ librarian-puppet (0.9.10)
35
33
  json
36
- puppet
37
34
  thor (~> 0.15)
38
35
  metaclass (0.0.1)
39
- mocha (0.13.1)
36
+ mocha (0.14.0)
40
37
  metaclass (~> 0.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)
52
- facter (~> 1.6.11)
53
- hiera (~> 1.0.0)
38
+ multipart-post (1.2.0)
39
+ octokit (2.3.1)
40
+ sawyer (~> 0.5.1)
41
+ puppet (3.3.2)
42
+ facter (~> 1.6)
43
+ hiera (~> 1.0)
44
+ rgen (~> 0.6.5)
54
45
  puppet-lint (0.3.2)
55
- puppetlabs_spec_helper (0.4.0)
46
+ puppetlabs_spec_helper (0.4.1)
56
47
  mocha (>= 0.10.5)
57
48
  rake
58
49
  rspec (>= 2.9.0)
59
50
  rspec-puppet (>= 0.1.1)
60
- rake (10.0.3)
61
- rspec (2.12.0)
62
- rspec-core (~> 2.12.0)
63
- rspec-expectations (~> 2.12.0)
64
- rspec-mocks (~> 2.12.0)
65
- rspec-core (2.12.2)
66
- rspec-expectations (2.12.1)
67
- diff-lcs (~> 1.1.3)
68
- rspec-mocks (2.12.1)
69
- rspec-puppet (0.1.5)
51
+ rake (10.1.0)
52
+ rgen (0.6.6)
53
+ rspec (2.14.1)
54
+ rspec-core (~> 2.14.0)
55
+ rspec-expectations (~> 2.14.0)
56
+ rspec-mocks (~> 2.14.0)
57
+ rspec-core (2.14.7)
58
+ rspec-expectations (2.14.4)
59
+ diff-lcs (>= 1.1.3, < 2.0)
60
+ rspec-mocks (2.14.4)
61
+ rspec-puppet (0.1.6)
70
62
  rspec
71
- thor (0.16.0)
63
+ sawyer (0.5.1)
64
+ addressable (~> 2.3.5)
65
+ faraday (~> 0.8, < 0.10)
66
+ thor (0.18.1)
72
67
 
73
68
  PLATFORMS
74
69
  ruby
data/README.md CHANGED
@@ -37,9 +37,7 @@ Validates the syntax of all Puppet and Ruby files.
37
37
  ## Using Cardboard in Your Boxen Modules
38
38
 
39
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.
40
+ [Boxen's template puppet module][template].
43
41
 
44
42
  [template]: https://github.com/boxen/puppet-template
45
43
 
@@ -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)
@@ -1,18 +1,18 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = "cardboard"
3
- gem.version = "1.0.4"
3
+ gem.version = "2.0.0"
4
4
  gem.authors = ["John Barnette", "Will Farrington"]
5
5
  gem.email = ["jbarnette@github.com", "wfarr@github.com"]
6
6
  gem.description = "Development tools for Boxen's puppet modules."
7
7
  gem.summary = "Development dependencies for the ecosystem."
8
8
  gem.homepage = "https://github.com/boxen/cardboard"
9
9
 
10
- gem.executables = ["cardboard"]
10
+ gem.executables = ["cardboard", "cardboardify"]
11
11
  gem.files = `git ls-files`.split $/
12
12
  gem.test_files = gem.files.grep /^test/
13
13
  gem.require_paths = ["lib"]
14
14
 
15
- gem.add_dependency "boxen", "~> 1.0"
15
+ gem.add_dependency "boxen", "~> 2.1"
16
16
  gem.add_dependency "puppet-lint", "~> 0.3"
17
17
  gem.add_dependency "puppetlabs_spec_helper", "~> 0.4"
18
18
  gem.add_dependency "rspec-puppet", "~> 0.1"
metadata CHANGED
@@ -1,92 +1,89 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: cardboard
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 1
7
- - 0
8
- - 4
9
- version: 1.0.4
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.0
10
5
  platform: ruby
11
- authors:
6
+ authors:
12
7
  - John Barnette
13
8
  - Will Farrington
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2013-05-16 00:00:00 -04:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2013-11-18 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: boxen
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- requirements:
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
26
18
  - - ~>
27
- - !ruby/object:Gem::Version
28
- segments:
29
- - 1
30
- - 0
31
- version: "1.0"
19
+ - !ruby/object:Gem::Version
20
+ version: '2.1'
32
21
  type: :runtime
33
- version_requirements: *id001
34
- - !ruby/object:Gem::Dependency
35
- name: puppet-lint
36
22
  prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
38
- requirements:
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
39
25
  - - ~>
40
- - !ruby/object:Gem::Version
41
- segments:
42
- - 0
43
- - 3
44
- version: "0.3"
26
+ - !ruby/object:Gem::Version
27
+ version: '2.1'
28
+ - !ruby/object:Gem::Dependency
29
+ name: puppet-lint
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ~>
33
+ - !ruby/object:Gem::Version
34
+ version: '0.3'
45
35
  type: :runtime
46
- version_requirements: *id002
47
- - !ruby/object:Gem::Dependency
48
- name: puppetlabs_spec_helper
49
36
  prerelease: false
50
- requirement: &id003 !ruby/object:Gem::Requirement
51
- requirements:
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
52
39
  - - ~>
53
- - !ruby/object:Gem::Version
54
- segments:
55
- - 0
56
- - 4
57
- version: "0.4"
40
+ - !ruby/object:Gem::Version
41
+ version: '0.3'
42
+ - !ruby/object:Gem::Dependency
43
+ name: puppetlabs_spec_helper
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ~>
47
+ - !ruby/object:Gem::Version
48
+ version: '0.4'
58
49
  type: :runtime
59
- version_requirements: *id003
60
- - !ruby/object:Gem::Dependency
61
- name: rspec-puppet
62
50
  prerelease: false
63
- requirement: &id004 !ruby/object:Gem::Requirement
64
- requirements:
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ~>
54
+ - !ruby/object:Gem::Version
55
+ version: '0.4'
56
+ - !ruby/object:Gem::Dependency
57
+ name: rspec-puppet
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
65
60
  - - ~>
66
- - !ruby/object:Gem::Version
67
- segments:
68
- - 0
69
- - 1
70
- version: "0.1"
61
+ - !ruby/object:Gem::Version
62
+ version: '0.1'
71
63
  type: :runtime
72
- version_requirements: *id004
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: '0.1'
73
70
  description: Development tools for Boxen's puppet modules.
74
- email:
71
+ email:
75
72
  - jbarnette@github.com
76
73
  - wfarr@github.com
77
- executables:
74
+ executables:
78
75
  - cardboard
76
+ - cardboardify
79
77
  extensions: []
80
-
81
78
  extra_rdoc_files: []
82
-
83
- files:
79
+ files:
84
80
  - .gitignore
85
81
  - Gemfile
86
82
  - Gemfile.lock
87
83
  - LICENSE
88
84
  - README.md
89
85
  - bin/cardboard
86
+ - bin/cardboardify
90
87
  - cardboard.gemspec
91
88
  - libexec/bootstrap
92
89
  - libexec/cibuild
@@ -95,35 +92,27 @@ files:
95
92
  - libexec/syntax
96
93
  - script/bootstrap
97
94
  - script/release
98
- has_rdoc: true
99
95
  homepage: https://github.com/boxen/cardboard
100
96
  licenses: []
101
-
97
+ metadata: {}
102
98
  post_install_message:
103
99
  rdoc_options: []
104
-
105
- require_paths:
100
+ require_paths:
106
101
  - lib
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"
102
+ required_ruby_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - '>='
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ required_rubygems_version: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - '>='
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
121
112
  requirements: []
122
-
123
113
  rubyforge_project:
124
- rubygems_version: 1.3.6
114
+ rubygems_version: 2.0.3
125
115
  signing_key:
126
- specification_version: 3
116
+ specification_version: 4
127
117
  summary: Development dependencies for the ecosystem.
128
118
  test_files: []
129
-