whiskey_disk 0.0.3 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.5
data/lib/tasks/deploy.rb CHANGED
@@ -9,6 +9,8 @@ namespace :deploy do
9
9
  WhiskeyDisk.checkout_main_repository if WhiskeyDisk.remote?
10
10
  WhiskeyDisk.install_hooks if WhiskeyDisk.remote?
11
11
  WhiskeyDisk.checkout_configuration_repository
12
+ WhiskeyDisk.update_main_repository_checkout if WhiskeyDisk.remote?
13
+ WhiskeyDisk.update_configuration_repository_checkout
12
14
  WhiskeyDisk.refresh_configuration
13
15
  WhiskeyDisk.run_post_setup_hooks
14
16
  WhiskeyDisk.flush
@@ -41,7 +41,7 @@ class WhiskeyDisk
41
41
 
42
42
  def project_name(config)
43
43
  return '' unless config['repository'] and config['repository'] != ''
44
- config['repository'].sub(%r{^.*/}, '').sub(%r{\.git$}, '')
44
+ config['repository'].sub(%r{^.*[/:]}, '').sub(%r{\.git$}, '')
45
45
  end
46
46
 
47
47
  def load_main_data
@@ -23,6 +23,8 @@ describe 'rake tasks' do
23
23
  :checkout_main_repository,
24
24
  :install_hooks,
25
25
  :checkout_configuration_repository,
26
+ :update_main_repository_checkout,
27
+ :update_configuration_repository_checkout,
26
28
  :refresh_configuration,
27
29
  :run_post_setup_hooks,
28
30
  :flush
@@ -61,6 +63,16 @@ describe 'rake tasks' do
61
63
  @rake["deploy:setup"].invoke
62
64
  end
63
65
 
66
+ it 'should update the main repository checkout' do
67
+ WhiskeyDisk.should.receive(:update_main_repository_checkout)
68
+ @rake["deploy:setup"].invoke
69
+ end
70
+
71
+ it 'should update the configuration repository checkout' do
72
+ WhiskeyDisk.should.receive(:update_configuration_repository_checkout)
73
+ @rake["deploy:setup"].invoke
74
+ end
75
+
64
76
  it 'should refresh the configuration' do
65
77
  WhiskeyDisk.should.receive(:refresh_configuration)
66
78
  @rake["deploy:setup"].invoke
@@ -85,6 +97,7 @@ describe 'rake tasks' do
85
97
  [
86
98
  :ensure_config_parent_path_is_present,
87
99
  :checkout_configuration_repository,
100
+ :update_configuration_repository_checkout,
88
101
  :refresh_configuration,
89
102
  :run_post_setup_hooks,
90
103
  :flush
@@ -122,6 +135,11 @@ describe 'rake tasks' do
122
135
  @rake["deploy:setup"].invoke
123
136
  end
124
137
 
138
+ it 'should update the configuration repository checkout' do
139
+ WhiskeyDisk.should.receive(:update_configuration_repository_checkout)
140
+ @rake["deploy:setup"].invoke
141
+ end
142
+
125
143
  it 'should refresh the configuration' do
126
144
  WhiskeyDisk.should.receive(:refresh_configuration)
127
145
  @rake["deploy:setup"].invoke
@@ -234,9 +234,17 @@ describe WhiskeyDisk::Config do
234
234
  WhiskeyDisk::Config.project_name({ 'repository' => 'git@foo/bar/baz'}).should == 'baz'
235
235
  end
236
236
 
237
- it 'should return the last pasth segment, stripping .git, if the repository ends in .git' do
237
+ it 'should return the last path segment, stripping .git, if the repository ends in .git' do
238
238
  WhiskeyDisk::Config.project_name({ 'repository' => 'git@foo/bar/baz.git'}).should == 'baz'
239
239
  end
240
+
241
+ it 'should return the last :-delimited segment if the repository does not end in .git' do
242
+ WhiskeyDisk::Config.project_name({ 'repository' => 'git@foo/bar:baz'}).should == 'baz'
243
+ end
244
+
245
+ it 'should return the last :-delimited segment, stripping .git, if the repository ends in .git' do
246
+ WhiskeyDisk::Config.project_name({ 'repository' => 'git@foo/bar:baz.git'}).should == 'baz'
247
+ end
240
248
  end
241
249
 
242
250
  describe 'finding the main configuration file' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whiskey_disk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rick Bradley