shaddox 0.0.17 → 0.0.18

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: ada0025262c3f76abcc3572df157e2e0f560485e
4
- data.tar.gz: 0edf0ae84eb8ad620cc54577994e60a7677cb6f6
3
+ metadata.gz: c18cbc290f82297b28d769119faa938bd5c1afc8
4
+ data.tar.gz: f534a156a6935e4d83072f642ac78480da4d31f8
5
5
  SHA512:
6
- metadata.gz: e7bd7b7d6a4332c1f7e0a86e1ebddd5d065d2429ee492fa30d35f79f861cf5f0f0c57cf13f71f241a753ea7addf89b784eda8a4a33bdb05c6318d8f6c8efc0e1
7
- data.tar.gz: 104aa6e5a00267041ad5f3f38a80d0e2f01a50981667430392e90260ec733656af3c9fce4807ea3df95d229317307f39243c196bacfd505f77c247b43186dd5d
6
+ metadata.gz: 7de05a55aba7d0d29823186040d1b28bd6cdb83db93dceea037b6e4cd2373f47ef295636c7308c8f7e379994f293dbdbd2d65a117273b5ace801a95ad8e373e4
7
+ data.tar.gz: 2829ec1d6923c279296f2a891be95f5bd9a204b65ef6ab2caf489da35d3cceca167467614562a480c6cd87880d6bdc805286fbd2e107438aa46bb94ac76a08c0
data/Doxfile CHANGED
@@ -22,10 +22,7 @@ end
22
22
 
23
23
  task :install => :foobar do
24
24
  install 'zsh'
25
- repo_clone :profile, "~"
26
- cd "~/profile" do
27
- sh "shaddox install"
28
- end
25
+ repo_deploy :profile, "~/repo_test/profile"
29
26
  end
30
27
 
31
28
  task :broken => :foo do
@@ -43,7 +43,17 @@ module Shaddox
43
43
  system("test -e #{path.exp_path}")
44
44
  end
45
45
 
46
+ def exists_d(path)
47
+ system("test -d #{path.exp_path}")
48
+ end
49
+
50
+ def exists_f(path)
51
+ system("test -f #{path.exp_path}")
52
+ end
53
+
46
54
  def ln_s(source, dest, opts = {})
55
+ ensure_parent_dir(source)
56
+ ensure_parent_dir(dest)
47
57
  info "Linking '#{source}' to '#{dest}'", 1 if @verbose
48
58
  FileUtils::ln_s(source.exp_path, dest.exp_path, opts)
49
59
  end
@@ -53,6 +63,11 @@ module Shaddox
53
63
  FileUtils::mkdir_p(path.exp_path)
54
64
  end
55
65
 
66
+ def ensure_parent_dir(path)
67
+ dir, base = File.split(path.exp_path)
68
+ mkdir(dir)
69
+ end
70
+
56
71
  def ensure_git()
57
72
  unless @git_installed
58
73
  install 'git'
@@ -60,13 +75,38 @@ module Shaddox
60
75
  end
61
76
  end
62
77
 
63
- def repo_clone(repo_key, path)
64
- ensure_git()
78
+ def repo_deploy(repo_key, deploy_path, opts ={})
79
+ keep_releases = opts[:keep_releases] || 5
65
80
  repo = @repos[repo_key]
66
- cd path do
81
+
82
+ ensure_git()
83
+ ensure_parent_dir(deploy_path)
84
+ deploy_path = deploy_path.exp_path
85
+
86
+ cd deploy_path do
87
+
88
+ # Get the current release number
89
+ release = 0
90
+ cd 'releases' do
91
+ current_max = Dir.entries('.').select { |e| e =~ /\d+/ }.max
92
+ release = current_max.to_i + 1 if current_max
93
+ end
94
+
95
+ # Make a new release dir
96
+ release_path = "./releases/#{release}"
97
+ mkdir(release_path)
98
+
67
99
  case repo.vcs
68
100
  when :git
69
- sh "git clone #{repo.url}"
101
+ # Clone/update repo in vcs:
102
+ if exists_d('vcs')
103
+ cd 'vcs' do
104
+ sh "git fetch #{repo.url} #{repo.branch}:#{repo.branch} --force"
105
+ end
106
+ else
107
+ sh "git clone #{repo.url} vcs -b #{repo.branch} --bare"
108
+ end
109
+ sh "git clone ./vcs #{release_path} --recursive --brach #{repo.branch}"
70
110
  end
71
111
  end
72
112
  end
@@ -1,3 +1,3 @@
1
1
  module Shaddox
2
- VERSION = "0.0.17"
2
+ VERSION = "0.0.18"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shaddox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.17
4
+ version: 0.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - joshglendenning