recap 1.0.9 → 1.0.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MWUzNWEyMGYyMjA1NGRjZWIyNmUzZDEzZTI5OTZlOWJhOWVkNmM3OA==
5
- data.tar.gz: !binary |-
6
- ZTM3MTU4NmUxY2I3M2JmOTNmZDYxODRmNzYyNjYyMTk4NDlmMDA3ZQ==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- MmZlMDUxZjMzOTJjNTc5NTE2YzU5NjhmYjhhN2IxYTY4YTIxODU2ZWU3YjQ3
10
- NGRiYTNlZmIwYTc0ZjFkYjlhZmQ0NzJiNmFkZDE4YmZiY2I2N2Y5MGI2MzQy
11
- OTMxYjg0YTQ2YzRhMTE5OTRiMzg0Y2UxMGM2ZWUzYjhkZWU1MmI=
12
- data.tar.gz: !binary |-
13
- OTlmZWI1MTM1Yzc1MTgyZjgxYTM2OWRiOWJkYWU4NGU1ZTk2Y2I3ZDQ1ZDdh
14
- NGM3YmZhYzFjODEzYzk1MWM0MjcwNDU2YTY2OGNhOTIxODVkNWZiMGUxM2Ix
15
- MjExZGYxYzM4ZTg3MTQ3Y2I0YjRhZmM4NGY4ZWFiMzI2YzJkYTc=
2
+ SHA1:
3
+ metadata.gz: 7725e63c0610e3cf0ae3c53d3b59fd5e1477272b
4
+ data.tar.gz: 8af4f97d82ca7d2ab19f8f6b7fd728386d712c1a
5
+ SHA512:
6
+ metadata.gz: 13cf736a6a86b8ae1d73f645af5771b17ae0d9d130c9cd159d23fce6799e60b44d6aebb3fa00febc5be4a4504aec644d6108e3bef9dc8845e5793671db80e43c
7
+ data.tar.gz: 3fd1259eff8a43848ecf4bcbb481220b69b3c03f8ba0f3b685f889fcb827484ff94a4b11dc0d7e3cbfc567df0bd1e341dd92cbf99fc0a65ffd1e83642b96f4cb
@@ -208,6 +208,7 @@ module ProjectSupport
208
208
  def regenerate_bundle
209
209
  write_and_commit_file 'Gemfile', gemfile
210
210
  # Nasty hack to generate a Gemfile.lock
211
+ @server.run "cd /recap/share/projects/#{name} && /opt/ruby/bin/bundle install"
211
212
  commit_files 'Gemfile.lock'
212
213
  end
213
214
 
@@ -65,6 +65,10 @@ fi
65
65
  run "git config --global user.name '#{git_user_name}'"
66
66
  run "git config --global user.email '#{git_user_email}'"
67
67
  sudo "usermod --append -G #{application_group} #{remote_username}"
68
+
69
+ if repository.match /github\.com/
70
+ run "(mkdir -p ~/.ssh && touch ~/.ssh/known_hosts && ssh-keygen -f ~/.ssh/known_hosts -H -F github.com | grep 'github.com') || ssh-keyscan -H github.com > ~/.ssh/known_hosts"
71
+ end
68
72
  end
69
73
 
70
74
  # The `bootstrap` task simply runs both the `bootstrap:application` and `bootstrap:user` tasks
@@ -30,7 +30,7 @@ module Recap::Tasks::Rails
30
30
  end
31
31
 
32
32
  task :migrate do
33
- if deployed_file_exists?("db/schema.rb") && trigger_update?("db/schema.rb")
33
+ if deployed_file_exists?("db/schema.rb") && trigger_update?("db/migrations/")
34
34
  as_app './bin/rake db:migrate'
35
35
  end
36
36
  end
data/lib/recap/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Recap
2
- VERSION = '1.0.9'
2
+ VERSION = '1.0.10'
3
3
  end
data/recap.gemspec CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
21
21
  s.add_dependency('open4')
22
22
  s.add_development_dependency('rake', '~>0.9.2')
23
23
  s.add_development_dependency('fl-rocco', '~>1.0.0')
24
- s.add_development_dependency('rspec', '~>2.7.0')
24
+ s.add_development_dependency('rspec', '~>2.13.0')
25
25
  s.add_development_dependency('mocha', '~>0.10.0')
26
26
  s.add_development_dependency('cucumber', '~>1.1.4')
27
27
  s.add_development_dependency('faker', '~>1.0.1')
@@ -38,4 +38,35 @@ describe Recap::Support::CapistranoExtensions do
38
38
  config.edit_file('remote/path/to/file')
39
39
  end
40
40
  end
41
- end
41
+
42
+ describe '#trigger_update?' do
43
+ context 'when forcing full deploy' do
44
+ before(:each) do
45
+ config.stubs(:force_full_deploy).returns(true)
46
+ end
47
+
48
+ it 'returns true' do
49
+ config.trigger_update?('path/to/file').should be_true
50
+ end
51
+ end
52
+
53
+ context 'when not forcing full deploy' do
54
+ before(:each) do
55
+ config.stubs(:force_full_deploy).returns(false)
56
+ config.stubs(:changed_files).returns(['path/to/changed/file', 'directory/containing/changed/file'])
57
+ end
58
+
59
+ it 'returns false for a file path which has not changed' do
60
+ config.trigger_update?('no/changes/here').should be_false
61
+ end
62
+
63
+ it 'returns true for a file path which has changed' do
64
+ config.trigger_update?('path/to/changed/file').should be_true
65
+ end
66
+
67
+ it 'returns true for a directory path which contains a changed file' do
68
+ config.trigger_update?('directory/containing/changed/').should be_true
69
+ end
70
+ end
71
+ end
72
+ end
@@ -47,23 +47,22 @@ describe Recap::Tasks::Rails do
47
47
  end
48
48
 
49
49
  describe 'rails:db:migrate' do
50
- it 'runs migrations if the schema has changed' do
50
+ it 'runs migrations if migrations have changed' do
51
51
  namespace.stubs(:deployed_file_exists?).with('db/schema.rb').returns(true)
52
- namespace.stubs(:trigger_update?).with('db/schema.rb').returns(true)
52
+ namespace.stubs(:trigger_update?).with('db/migrations/').returns(true)
53
53
  namespace.expects(:as_app).with('./bin/rake db:migrate')
54
54
  config.find_and_execute_task('rails:db:migrate')
55
55
  end
56
56
 
57
- it 'does nothing if the schema has not changed' do
57
+ it 'does nothing if the migrations have not changed' do
58
58
  namespace.stubs(:deployed_file_exists?).with('db/schema.rb').returns(true)
59
- namespace.stubs(:trigger_update?).with('db/schema.rb').returns(false)
59
+ namespace.stubs(:trigger_update?).with('db/migrations/').returns(false)
60
60
  namespace.expects(:as_app).never
61
61
  config.find_and_execute_task('rails:db:migrate')
62
62
  end
63
63
 
64
64
  it 'does nothing if the schema does not exist' do
65
65
  namespace.stubs(:deployed_file_exists?).with('db/schema.rb').returns(false)
66
- namespace.stubs(:trigger_update?).with('db/schema.rb').returns(true)
67
66
  namespace.expects(:as_app).never
68
67
  config.find_and_execute_task('rails:db:migrate')
69
68
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 1.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Ward
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-04 00:00:00.000000000 Z
11
+ date: 2013-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -28,28 +28,28 @@ dependencies:
28
28
  name: thor
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: open4
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - ~>
88
88
  - !ruby/object:Gem::Version
89
- version: 2.7.0
89
+ version: 2.13.0
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - ~>
95
95
  - !ruby/object:Gem::Version
96
- version: 2.7.0
96
+ version: 2.13.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: mocha
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -212,12 +212,12 @@ require_paths:
212
212
  - lib
213
213
  required_ruby_version: !ruby/object:Gem::Requirement
214
214
  requirements:
215
- - - ! '>='
215
+ - - '>='
216
216
  - !ruby/object:Gem::Version
217
217
  version: '0'
218
218
  required_rubygems_version: !ruby/object:Gem::Requirement
219
219
  requirements:
220
- - - ! '>='
220
+ - - '>='
221
221
  - !ruby/object:Gem::Version
222
222
  version: '0'
223
223
  requirements: []