puppet_pal 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013 Michael Owings
1
+ Copyright (c) 2014 Turbosquid, Inc.
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -34,7 +34,7 @@ specified, then the module is pulled from puppetforge (via a `puppet
34
34
  module install` call).
35
35
 
36
36
  Otherwise, you may pass the `:git` option to specify a git repo, as well as a `:path`
37
- option to specify a particular path within that repo.
37
+ and/or `:branch` option to specify a particular path within that repo.
38
38
 
39
39
  ### forge
40
40
  For backward compatibility -- does nothing
@@ -52,7 +52,8 @@ For backward compatibility -- does nothing
52
52
  :path=> "modules/base_packages"
53
53
  mod 'solr',
54
54
  :git => puppet_common_git,
55
- :path=> "modules/solr"
55
+ :path=> "modules/solr",
56
+ :branch => "develop"
56
57
  mod 'mysql',
57
58
  :git => puppet_common_git,
58
59
  :path=> "modules/mysql"
@@ -39,7 +39,12 @@ module PuppetPal
39
39
  working_dir
40
40
  end
41
41
 
42
- def copy_module(name, source_path)
42
+ def copy_module(name, source_path, branch='master')
43
+ current_branch = `cd #{source_path} && git symbolic-ref --short HEAD`.strip
44
+ if current_branch != branch
45
+ success = system("cd #{source_path} && git checkout #{branch}")
46
+ raise "git checkout failed" unless success
47
+ end
43
48
  target = File.join(@module_dir,name)
44
49
  FileUtils.rm_rf(target)
45
50
  FileUtils.cp_r(source_path, target, preserve: true)
@@ -59,9 +64,9 @@ module PuppetPal
59
64
  def mod(name, options={})
60
65
  puts "Processing module: #{name}"
61
66
  if options[:git]
62
- working_dir = pull_repo(options[:git])
67
+ working_dir = pull_repo(options[:git], :git )
63
68
  path = options[:path] || ""
64
- copy_module(name, File.join(working_dir, path))
69
+ copy_module(name, File.join(working_dir, path), options[:branch] || 'master')
65
70
  else # Assume we are pulling from puppet forge
66
71
  pull_from_puppetforge(name)
67
72
  end
@@ -1,3 +1,3 @@
1
1
  module PuppetPal
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet_pal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-30 00:00:00.000000000 Z
12
+ date: 2014-04-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler