sinatra-packrat 0.1.3 → 0.2.0

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.
Files changed (2) hide show
  1. data/bin/packrat +13 -0
  2. metadata +3 -3
data/bin/packrat CHANGED
@@ -52,4 +52,17 @@ config["modules"].each do |mod|
52
52
  print "Cloning #{full_git_path} into #{repo_path} \n"
53
53
  `git clone #{full_git_path} #{repo_path}`
54
54
  end
55
+
56
+ Dir.chdir repo_path do
57
+ if (mod["ref"] || mod["tag"])
58
+ `git checkout #{mod["ref"] || mod["tag"]}`
59
+ elsif mod["branch"]
60
+ branch = mod["branch"]
61
+ out = `git checkout #{branch}`
62
+ unless $?.exitstatus == 0
63
+ `git checkout --track -b #{branch} origin/#{branch}`
64
+ end
65
+ end
66
+ end
67
+
55
68
  end if config["modules"].respond_to? :each
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 1
8
- - 3
9
- version: 0.1.3
7
+ - 2
8
+ - 0
9
+ version: 0.2.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Brennan Roberts