puppetry_toolbox 0.0.5 → 0.0.6.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/puppetry/cli.rb +18 -1
- data/lib/puppetry/version.rb +1 -1
- data/test/end_to_end/puppetry_test.rb +1 -0
- data/test/lib/puppetry/test/custom_assertions.rb +24 -3
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6ad790da036bbdefb70173e457f0654a88bd713
|
4
|
+
data.tar.gz: 07bce9312ed8c0de89cb972deea398fa337e154c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 699aa7d08aa99094c16a92ace6ee54fa962da228d326456a8f7d4742d93e28d725c2ad8a80b01ced508f2d1951d89fa1438da516cd981112319e29f021a2005a
|
7
|
+
data.tar.gz: fb47dfe07b069653b3e45c464f046d82aaddf472b877f4d2e51a41c32851fde3b2fddf3b45fe1d48884f25d61168fe177e853e8a2f35b51c72daedb880b6b1df
|
data/README.md
CHANGED
data/lib/puppetry/cli.rb
CHANGED
@@ -11,7 +11,16 @@ module Puppetry
|
|
11
11
|
output.puts "Puppetry v#{Puppetry::Version}"
|
12
12
|
end
|
13
13
|
|
14
|
-
desc "new
|
14
|
+
desc "new DEST", "Create a new module in DEST"
|
15
|
+
long_desc <<-EOS
|
16
|
+
`puppetry new DEST` will initialize a new module in the DEST directory.
|
17
|
+
|
18
|
+
The name of the module is calculated from the basename of DEST (i.e. the
|
19
|
+
latest segment of the path), so all the following will create a module
|
20
|
+
named `apache`:
|
21
|
+
> puppetry new apache
|
22
|
+
> puppetry new ~/code/puppet/apache
|
23
|
+
EOS
|
15
24
|
def new(name)
|
16
25
|
repo = Grit::Repo.init(name)
|
17
26
|
repo.remote_add 'skeleton', 'https://github.com/stefanozanella/puppet-skeleton'
|
@@ -22,6 +31,14 @@ module Puppetry
|
|
22
31
|
Bundler.with_clean_env do
|
23
32
|
system "bundle install --path vendor/bundle"
|
24
33
|
end
|
34
|
+
|
35
|
+
spec_module_dir = File.join("spec", "fixtures", "modules", File.basename(name))
|
36
|
+
FileUtils.mkdir spec_module_dir
|
37
|
+
FileUtils.cd spec_module_dir do
|
38
|
+
["manifests", "lib", "templates", "files"].each do |dir|
|
39
|
+
File.symlink File.join(*Array.new(4, '..'), dir), dir
|
40
|
+
end
|
41
|
+
end
|
25
42
|
end
|
26
43
|
end
|
27
44
|
|
data/lib/puppetry/version.rb
CHANGED
@@ -8,15 +8,36 @@ module MiniTest::Assertions
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def assert_is_git_repository(dir)
|
11
|
-
assert Dir.entries(dir).include?(".git"),
|
11
|
+
assert Dir.entries(dir).include?(".git"),
|
12
|
+
"Expected directory #{dir} to be a git repository"
|
12
13
|
end
|
13
14
|
|
14
15
|
def assert_tracks_remote(dir, remote)
|
15
|
-
assert Grit::Repo.new(dir).git.remote.split.include?(remote),
|
16
|
+
assert Grit::Repo.new(dir).git.remote.split.include?(remote),
|
17
|
+
"Expected repo #{dir} to track remote #{remote}"
|
16
18
|
end
|
17
19
|
|
18
20
|
def assert_bundler_is_initialized_in(dir)
|
19
|
-
assert Dir.entries(dir).include?(".bundle"),
|
21
|
+
assert Dir.entries(dir).include?(".bundle"),
|
22
|
+
"Expected Bundler to be initialized in folder #{dir}"
|
23
|
+
end
|
24
|
+
|
25
|
+
def assert_rspec_puppet_is_initialized_in(dir)
|
26
|
+
module_name = File.basename(dir).gsub(/^puppet-/, '')
|
27
|
+
|
28
|
+
assert Dir.entries(File.join(dir, "spec", "fixtures", "modules")).include?(module_name),
|
29
|
+
"Expected directory spec/fixtures/modules to contain subdirectory for current module"
|
30
|
+
|
31
|
+
module_image_dir = File.join(dir, "spec", "fixtures", "modules", module_name)
|
32
|
+
|
33
|
+
["manifests", "lib", "files", "templates"].each do |module_component|
|
34
|
+
assert Dir.entries(module_image_dir).include?(module_component),
|
35
|
+
"Expected directory #{module_image_dir} to contain directory #{module_component}"
|
36
|
+
|
37
|
+
assert File.symlink?(File.join(module_image_dir, module_component)),
|
38
|
+
"Expected directory #{File.join(module_image_dir, module_component)} to"\
|
39
|
+
"be a symlink to its counterpart in the module's root"
|
40
|
+
end
|
20
41
|
end
|
21
42
|
end
|
22
43
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppetry_toolbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefano Zanella
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -122,12 +122,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
122
122
|
version: '0'
|
123
123
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
124
|
requirements:
|
125
|
-
- - '
|
125
|
+
- - '>'
|
126
126
|
- !ruby/object:Gem::Version
|
127
|
-
version:
|
127
|
+
version: 1.3.1
|
128
128
|
requirements: []
|
129
129
|
rubyforge_project:
|
130
|
-
rubygems_version: 2.0.
|
130
|
+
rubygems_version: 2.0.2
|
131
131
|
signing_key:
|
132
132
|
specification_version: 4
|
133
133
|
summary: Puppetry is a CLI tool to aid Puppet modules development.
|