puppetry_toolbox 0.0.4 → 0.0.5

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: 2d6648354d4386e03c4d382bac0e88e612e3e3c7
4
- data.tar.gz: de74d6251ae3c93d93404649808a6bb7ad9b6d60
3
+ metadata.gz: 03fd1542bb8b18110ac356393ce59f3f6ab563d0
4
+ data.tar.gz: e828268fe9f59f82498051145f6795dfa30266db
5
5
  SHA512:
6
- metadata.gz: 809c7654c522771faa47721c6db158027e7621194877afef2e8549111be6140df70e3188318838f2fade27cd79f9045ee72f2d001689c2b3c662de7795af38c7
7
- data.tar.gz: 3a507a31ed1bc4f12b48a71ddf540dd9748abee3e8b83526f098bca09f45554ac75bad6435db2e23b598e52f1c29397310d2a0c3d7a922330a3e46597b63e560
6
+ metadata.gz: 2d4890f0fd0f9223e5abe7ca9dcc7d486255092c3d89aa0d2421d8c7790ea7c6be6c7b14ea13372c449d5c1db74b080d0266e362c78224bfb2c5ecca0b7297ea
7
+ data.tar.gz: ac4080ca69e1aa247d4b35c8996d3847ddd30f0b6ae55c1a25e0eb6c0495de218e2e9c715504bd74926f23ebb81262125ab0ab999480c39698a46fad4750f6ba
@@ -1 +1 @@
1
- 2.0.0-p0
1
+ 2.0.0-p195
data/README.md CHANGED
@@ -36,9 +36,13 @@ This will generate a `my_nice_module` subdirectory in the current working
36
36
  directory. This directory will contain everything you need to start developing
37
37
  your new module.
38
38
 
39
- ### Adding a new test
39
+ In particular, created directory will be a Git repository tracking a remote
40
+ named `skeleton` that points to the skeleton module used to scaffold the newly
41
+ created one. So, it's possible to update the current scaffolding configuration
42
+ by simply issuing:
40
43
  ```
41
- $ puppetry test new_class
42
- $ puppetry test -c new_class
43
- $ puppetry test --class new_class
44
+ git pull skeleton master
44
45
  ```
46
+
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.
@@ -13,11 +13,12 @@ module Puppetry
13
13
 
14
14
  desc "new NAME", "Create a new module called NAME"
15
15
  def new(name)
16
- Grit::Git.new(name).clone({}, "git://github.com/stefanozanella/puppet-skeleton", name)
17
- # This looks rather rough, but maybe it's the simplest way to erase all
18
- # git history from the folder?
16
+ repo = Grit::Repo.init(name)
17
+ repo.remote_add 'skeleton', 'https://github.com/stefanozanella/puppet-skeleton'
19
18
  FileUtils.cd name do
20
- FileUtils.rm_rf File.expand_path('.git', '.')
19
+ # No support for push/pull in Grit?
20
+ `git pull skeleton master`
21
+
21
22
  Bundler.with_clean_env do
22
23
  system "bundle install --path vendor/bundle"
23
24
  end
@@ -1,3 +1,3 @@
1
1
  module Puppetry
2
- Version = VERSION = '0.0.4'.freeze
2
+ Version = VERSION = '0.0.5'.freeze
3
3
  end
@@ -38,7 +38,8 @@ describe "puppetry" do
38
38
 
39
39
  it "creates a new module starting from a scaffolded one" do
40
40
  module_dir.must_contain_a_puppet_module
41
- module_dir.wont_be_a_git_repository
41
+ module_dir.must_be_a_git_repository
42
+ module_dir.must_track_remote "skeleton"
42
43
  assert_bundler_is_initialized_in module_dir
43
44
  end
44
45
  end
@@ -1,3 +1,5 @@
1
+ require 'grit'
2
+
1
3
  module MiniTest::Assertions
2
4
  def assert_contains_a_puppet_module(dir)
3
5
  assert Dir.exists?(dir), "Module folder #{dir} wasn't created"
@@ -5,16 +7,21 @@ module MiniTest::Assertions
5
7
  Dir.entries(dir).must_include "manifests"
6
8
  end
7
9
 
8
- def refute_git_repository(dir)
9
- Dir.entries(dir).wont_include ".git"
10
+ def assert_is_git_repository(dir)
11
+ assert Dir.entries(dir).include?(".git"), "Expected directory #{dir} to be a git repository"
12
+ end
13
+
14
+ def assert_tracks_remote(dir, remote)
15
+ assert Grit::Repo.new(dir).git.remote.split.include?(remote), "Expected repo #{dir} to track remote #{remote}"
10
16
  end
11
17
 
12
18
  def assert_bundler_is_initialized_in(dir)
13
- assert Dir.entries(dir).include?(".bundle"), "Bundler hasn't been initialized in folder #{dir}"
19
+ assert Dir.entries(dir).include?(".bundle"), "Expected Bundler to be initialized in folder #{dir}"
14
20
  end
15
21
  end
16
22
 
17
23
  module MiniTest::Expectations
18
24
  infect_an_assertion :assert_contains_a_puppet_module, :must_contain_a_puppet_module, :only_one_argument
19
- infect_an_assertion :refute_git_repository, :wont_be_a_git_repository, :only_one_argument
25
+ infect_an_assertion :assert_is_git_repository, :must_be_a_git_repository, :only_one_argument
26
+ infect_an_assertion :assert_tracks_remote, :must_track_remote, :do_not_flip
20
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppetry_toolbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Zanella