deploku 0.0.2 → 0.0.3

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: 942092e42da5e25b193ee4e9be8de62c05154400
4
- data.tar.gz: e8ca04042d008990470a87f2654d978e835d3196
3
+ metadata.gz: 8226fffff5db14477c2c7cf7ef4d1dc3b98ba6e9
4
+ data.tar.gz: b1db428d6b0a74f3ba26f63691a299713d40417d
5
5
  SHA512:
6
- metadata.gz: bd6cd3b22e7d50b99ee2b82a100b21fbd5b8b9945c586d098b47f0d1eeacab71043f787cf9c3624852af6fe2523fe21a459b968f13da66758f2b80942994447b
7
- data.tar.gz: 82fb4cc0f5f605e63868f987af7342d64f786d32bc7252df12a48ddeab56b0272511fdfa10222663554f08140a6277f5904f740416e0a9ebe56925ca5781fa2f
6
+ metadata.gz: 4027fa583e0edbcb6bb0d93f49456ce04a6bd31185feae85be5a36c62270f9a022a8bb09f4420895b56b0c2f20a85c8e93a1740fb44a7b4636a8ae39990252cc
7
+ data.tar.gz: c206964fd810a25fed6471b1f7151d5f0c6d5c42f3a2673e9d84d7e7badda27c24fa75ff0722c571439c7542830876727230354f4c992caa9775402d1a5594e0
data/deploku.gemspec CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Bill Horsman"]
10
10
  spec.email = ["bill@logicalcobwebs.com"]
11
11
  spec.summary = %q{Convenient way of deploying to Heroku}
12
- spec.homepage = ""
12
+ spec.homepage = "https://github.com/billhorsman/deploku"
13
13
  spec.license = "MIT"
14
14
 
15
15
  spec.files = `git ls-files -z`.split("\x0")
@@ -14,11 +14,13 @@ module Deploku
14
14
  end
15
15
 
16
16
  def remote_commit_exists_locally?
17
- test_command("git show #{remote_commit}")
17
+ return @remote_commit_exists_locally if defined? @remote_commit_exists_locally
18
+ @remote_commit_exists_locally = test_command("git show #{remote_commit}")
18
19
  end
19
20
 
20
21
  def database_configured?
21
- test_command("rake db:migrate:status")
22
+ return @database_configured if defined? @database_configured
23
+ @database_configured = test_command("rake db:migrate:status")
22
24
  end
23
25
 
24
26
  def behind
@@ -30,7 +32,7 @@ module Deploku
30
32
  end
31
33
 
32
34
  def count_rev_list(range)
33
- run_command("git rev-list #{range}").slice("\n").size
35
+ run_command("git rev-list #{range}").split("\n").size
34
36
  end
35
37
 
36
38
  def remote_commit
@@ -104,14 +106,14 @@ module Deploku
104
106
 
105
107
  def deploy_commands
106
108
  return @deploy_commands if @deploy_commands
107
- maintenance_mode = pending_migration_count > 0 && maintenance == :use
109
+ maintenance_mode = false
108
110
  list = []
109
- if pending_migration_count > 0
111
+ if migration_required?
110
112
  case maintenance
111
113
  when :use
112
114
  maintenance_mode = true
113
115
  when :skip
114
- maintenance_mode = false
116
+ # OK, nothing to do
115
117
  else
116
118
  puts "There are migrations to run. Please either choose maintenance or maintenance:skip"
117
119
  exit 1
@@ -119,12 +121,16 @@ module Deploku
119
121
  end
120
122
  list << "heroku maintenance:on --app #{app_name}" if maintenance_mode
121
123
  list << "git push#{force ? " --force" : ""} #{remote} #{local_branch}:master"
122
- list << "heroku run rake db:migrate --app #{app_name}" if pending_migration_count > 0
123
- list << "heroku restart --app #{app_name}" if pending_migration_count > 0
124
+ list << "heroku run rake db:migrate --app #{app_name}" if migration_required?
125
+ list << "heroku restart --app #{app_name}" if migration_required?
124
126
  list << "heroku maintenance:off --app #{app_name}" if maintenance_mode
125
127
  @deploy_commands = list
126
128
  end
127
129
 
130
+ def migration_required?
131
+ database_configured? && pending_migration_count > 0
132
+ end
133
+
128
134
  def local_branch
129
135
  @local_branch ||= run_command("git symbolic-ref HEAD").chomp.sub(/^\/?refs\/heads\//, '')
130
136
  end
@@ -1,3 +1,3 @@
1
1
  module Deploku
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deploku
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bill Horsman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-06 00:00:00.000000000 Z
11
+ date: 2014-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -59,7 +59,7 @@ files:
59
59
  - lib/deploku/remote.rb
60
60
  - lib/deploku/runnable.rb
61
61
  - lib/deploku/version.rb
62
- homepage: ''
62
+ homepage: https://github.com/billhorsman/deploku
63
63
  licenses:
64
64
  - MIT
65
65
  metadata: {}