puppetry_toolbox 0.0.5 → 0.0.6.rc1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 03fd1542bb8b18110ac356393ce59f3f6ab563d0
4
- data.tar.gz: e828268fe9f59f82498051145f6795dfa30266db
3
+ metadata.gz: a6ad790da036bbdefb70173e457f0654a88bd713
4
+ data.tar.gz: 07bce9312ed8c0de89cb972deea398fa337e154c
5
5
  SHA512:
6
- metadata.gz: 2d4890f0fd0f9223e5abe7ca9dcc7d486255092c3d89aa0d2421d8c7790ea7c6be6c7b14ea13372c449d5c1db74b080d0266e362c78224bfb2c5ecca0b7297ea
7
- data.tar.gz: ac4080ca69e1aa247d4b35c8996d3847ddd30f0b6ae55c1a25e0eb6c0495de218e2e9c715504bd74926f23ebb81262125ab0ab999480c39698a46fad4750f6ba
6
+ metadata.gz: 699aa7d08aa99094c16a92ace6ee54fa962da228d326456a8f7d4742d93e28d725c2ad8a80b01ced508f2d1951d89fa1438da516cd981112319e29f021a2005a
7
+ data.tar.gz: fb47dfe07b069653b3e45c464f046d82aaddf472b877f4d2e51a41c32851fde3b2fddf3b45fe1d48884f25d61168fe177e853e8a2f35b51c72daedb880b6b1df
data/README.md CHANGED
@@ -45,4 +45,4 @@ git pull skeleton master
45
45
  ```
46
46
 
47
47
  **NOTE**: This could lead to conflicts if you modify any of the files tracked
48
- by the skeleton module. Normal git housekeeping apply here though.
48
+ by the skeleton module. Normal git housekeeping applies here though.
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 NAME", "Create a new module called NAME"
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
 
@@ -1,3 +1,3 @@
1
1
  module Puppetry
2
- Version = VERSION = '0.0.5'.freeze
2
+ Version = VERSION = '0.0.6.rc1'.freeze
3
3
  end
@@ -41,6 +41,7 @@ describe "puppetry" do
41
41
  module_dir.must_be_a_git_repository
42
42
  module_dir.must_track_remote "skeleton"
43
43
  assert_bundler_is_initialized_in module_dir
44
+ assert_rspec_puppet_is_initialized_in module_dir
44
45
  end
45
46
  end
46
47
  end
@@ -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"), "Expected directory #{dir} to be a git repository"
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), "Expected repo #{dir} to track remote #{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"), "Expected Bundler to be initialized in folder #{dir}"
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.5
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-23 00:00:00.000000000 Z
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: '0'
127
+ version: 1.3.1
128
128
  requirements: []
129
129
  rubyforge_project:
130
- rubygems_version: 2.0.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.