deploku 0.0.3 → 0.0.4

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: 8226fffff5db14477c2c7cf7ef4d1dc3b98ba6e9
4
- data.tar.gz: b1db428d6b0a74f3ba26f63691a299713d40417d
3
+ metadata.gz: 94142cab90a94a372fec9dce8e2549e43aa3a7d9
4
+ data.tar.gz: 46f520ffcd139aab148bcb917ac75269d5d38731
5
5
  SHA512:
6
- metadata.gz: 4027fa583e0edbcb6bb0d93f49456ce04a6bd31185feae85be5a36c62270f9a022a8bb09f4420895b56b0c2f20a85c8e93a1740fb44a7b4636a8ae39990252cc
7
- data.tar.gz: c206964fd810a25fed6471b1f7151d5f0c6d5c42f3a2673e9d84d7e7badda27c24fa75ff0722c571439c7542830876727230354f4c992caa9775402d1a5594e0
6
+ metadata.gz: fd88b61935cd42c4ab6c801cb8aa32d3f38d499297c436a1e5139c2d4d30efc3a245d4fd5d429d594749b54a055b97eb5a59c1d9e38787b7e902013e5419c233
7
+ data.tar.gz: 4544a6a914d3548d00e2123f61757f70dffc03e646fe2ad71f37cb3fc9218c0fbd84bcb3a3da661eb02da4dadd3ecd720efaa02d0c7e077bec5ffb389cbc9970
data/README.md CHANGED
@@ -31,16 +31,16 @@ production
31
31
  staging
32
32
  ```
33
33
 
34
- Then choose a remote and run it again:
34
+ Then choose a remote and run it again to find its `status`:
35
35
 
36
36
  ```
37
- [master]$ deploku production
37
+ [master]$ deploku production status
38
38
  Heroku app my-app-production is running commit abcdef7
39
39
  It is 3 commits behind your local master branch
40
40
  There are no pending migrations
41
41
  ```
42
42
 
43
- If you want to deploy then add the `deploy` command:
43
+ If you want to deploy then use the `deploy` command instead:
44
44
 
45
45
  ```
46
46
  [master]$ deploku production deploy
@@ -56,7 +56,7 @@ Proceed? (y/N):
56
56
 
57
57
  Enter `y` to proceed or anything else to abort. Nothing will happen unless you enter `y`.
58
58
 
59
- If there are migrations pending then you will be forced to either pass in either the `maintenance` or `maintenance:skip` options.
59
+ If there are migrations pending then you will be forced to pass in either the `maintenance` or `maintenance:skip` options.
60
60
 
61
61
  ```
62
62
  [master]$ deploku production deploy maintenance
@@ -74,6 +74,12 @@ The following commands will be run:
74
74
  Proceed? (y/N):
75
75
  ```
76
76
 
77
+ ## Defaults
78
+
79
+ The default command is `deploy` since that always prompts you before doing anything anyway.
80
+
81
+ You can pick the remote just by choosing the first letter of the remote - as long as the initial letter for each remote is unique. For instance, if you have two remotes, `staging` and `production`, then you can just type `deploku s`.
82
+
77
83
  ## Contributing
78
84
 
79
85
  1. Fork it ( https://github.com/billhorsman/deploku/fork )
@@ -5,7 +5,13 @@ module Deploku
5
5
 
6
6
  def self.run(args)
7
7
  matching_remotes = remotes & args
8
- case matching_remotes.size
8
+ if matching_remotes.size == 0 && remote_index_uniq?
9
+ if key = (remote_index.keys & args)[0]
10
+ matching_remotes = [remote_index[key]]
11
+ args.delete key
12
+ end
13
+ end
14
+ case matching_remotes.compact.size
9
15
  when 0
10
16
  puts "#{remotes.size} Heroku remote#{'s' if remotes.size > 1} found:"
11
17
  puts *remotes
@@ -14,7 +20,7 @@ module Deploku
14
20
  remote = matching_remotes[0]
15
21
  args.delete remote
16
22
  commands = %w[status deploy] & args
17
- commands << "status" if commands.size == 0
23
+ commands << "deploy" if commands.size == 0
18
24
  if commands.size > 1
19
25
  puts "Choose just one command"
20
26
  exit 1
@@ -34,6 +40,14 @@ module Deploku
34
40
  }
35
41
  end
36
42
 
43
+ def self.remote_index_uniq?
44
+ remote_index.size == remotes.size
45
+ end
46
+
47
+ def self.remote_index
48
+ @remote_index ||= Hash[remotes.map{|r| [r.slice(0, 1), r] }]
49
+ end
50
+
37
51
  end
38
52
 
39
53
  end
@@ -40,6 +40,7 @@ module Deploku
40
40
  end
41
41
 
42
42
  def status(args)
43
+ puts "Looking up current status for #{remote}"
43
44
  puts "Heroku app #{app_name} is running commit #{remote_commit.slice(0, 7)}"
44
45
  if remote_commit_exists_locally?
45
46
  if behind == 0 && ahead == 0
@@ -1,3 +1,3 @@
1
1
  module Deploku
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
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.3
4
+ version: 0.0.4
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-07 00:00:00.000000000 Z
11
+ date: 2014-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler