hrk 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +63 -29
  3. data/lib/hrk/execute/help.rb +8 -2
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 172ab5ee4bd7bf4c32959c037180e9d0cba6b1ff
4
- data.tar.gz: 7d03ead725cf5599a4262cc6b7a9cc095ee0bff8
3
+ metadata.gz: c55c5d03bcb00380ffcff94955234658934ee118
4
+ data.tar.gz: 72e2a53ee349c5dbaece355c70b89085dc72827f
5
5
  SHA512:
6
- metadata.gz: 307c5ffa6b227953e064367f35ec37b25ebc46e0e18b4abb99b358b1839bbb975d9218292691a3dde17bce86ebbf3272022fa5ad456696cfc9abbfe17e91ecdf
7
- data.tar.gz: fd7c224100e26d2cc70b64f7eb69f10b923d13a8601207cfddc2f0dcced6379866f4c60cf6ce3b96bbed7be0cebcddb6af7bc7037bb112b126986555a75d4c1b
6
+ metadata.gz: 4c5dfad9f5057ce40bda69d34dca06ccac6d068be94e607efabb66d29e08e7f838e72e5e58128e66d732b7e2ea31d52fda5f12e3dbb6f89cec7bb7e0626c4c1f
7
+ data.tar.gz: 57f0447db88c4739215ed04c94f046e12db6da9983d2c048d34c3c0576c9c10076af74960824e4eb6d156d48688e87f46dd0a3f840f7aa62adcf0393859e1825
data/README.md CHANGED
@@ -21,66 +21,100 @@ $ bundle install
21
21
 
22
22
  And enjoy the hrk command awesome power:
23
23
  ```
24
- $ hrk your-heroku-remote-name logs
24
+ $ hrk your-heroku-remote-name: logs && hrk : run console
25
25
  ```
26
26
 
27
27
 
28
28
  ## What does it do?
29
29
 
30
- It's a command that calls the heroku toolbelt command for you, using your local
31
- heroku git remote name instead of that app's name.
30
+ It's a command that calls the heroku toolbelt command for you, remembers the
31
+ name of the previous remote so you don't have to re-type it again and again
32
+ and again each time you want to chain heroku commands.
32
33
 
33
34
  For example, let's say I've got an heroku app that's called:
34
35
 
35
- > this-really-long-app-name
36
+ > this-really-long-remote-name
36
37
 
37
38
  Well, I type my heroku commands like:
38
39
 
39
- ```
40
- $ heroku run rake do:stuff
40
+ ```bash
41
+ $ heroku run rake do:stuff -r this-really-long-remote-name
41
42
  ```
42
43
 
43
44
  And it's easy.
44
45
 
45
- Yep, but now I need a staging environment and a testing environment, so I add
46
- other heroku repositories that I aptly call:
46
+ Yep, but now I want to chain my commands:
47
47
 
48
- ```
49
- this-really-long-app-name-that-is-used-as-a-demo
50
- this-really-long-app-name-draft
48
+ ```bash
49
+ $ heroku run rake do:something:else -r this-really-long-remote-name && \
50
+ heroku run rake other:thing -r this-really-long-remote-name && \
51
+ heroku run rake yet:another:task -r this-really-long-remote-name
51
52
  ```
52
53
 
53
- Now all my heroku commands look like:
54
+ And sometimes you mistype, and the chain breaks in the middle, and it sucks.
54
55
 
55
- ```
56
- $ heroku run rake do:something:else -a this-really-long-app-name
57
- $ heroku run rake other:thing -a this-really-long-app-name-that-is-used-as-a-demo
58
- $ heroku run rake yet:another:task -a this-really-long-app-name-draft
56
+ **Wait, I can do something like that**
57
+
58
+ ```bash
59
+ $ export REMOTE_NAME=this-really-long-remote-name && \
60
+ heroku run rake do:something:else -r $REMOTE_NAME && \
61
+ heroku run rake other:thing -r $REMOTE_NAME && \
62
+ heroku run rake yet:another:task -r $REMOTE_NAME
59
63
  ```
60
64
 
61
- And, let's be frank, that sucks even when I don't have to chain these commands.
65
+ Yup. Now It doesn't look really that better now does it?
62
66
 
63
67
  **Hrk to the rescue!**
64
68
 
65
- Now, if you're like me, you've probably named your various heroku remotes in a
66
- more sensible way than just your heroku app names, for example:
69
+ Hrk remembers the previous remote you've used. So you can do:
67
70
 
71
+ ```bash
72
+ $ hrk this-relly-long-remote-name: run rake do:some:work && \
73
+ hrk : run rake arrange:stuff && \
74
+ hrk : run rake test:some:thingy
68
75
  ```
69
- prod => this-really-long-app-name
70
- staging => this-really-long-app-name-that-is-used-as-a-demo
71
- test => this-really-long-app-name-draft
72
- ```
73
76
 
74
- Which means that you could call the Hrk command instead of the heroku command
75
- using your remotes names like:
77
+ Isn't it more fun?
78
+
79
+ ## Wait, what happens when...
80
+
81
+ **...I chain hrk commands with other bash commands?**
76
82
 
83
+ No worry there, the previous remote will be remembered as long as you don't
84
+ close your terminal.
85
+
86
+ ```bash
87
+ $ git push demo && \
88
+ hrk demo: run rake set-this-once && \ # happens on demo
89
+ git push -f demo HEAD^ && \
90
+ hrk : restart # also on demo
77
91
  ```
78
- $ hrk prod run rake do:some:work
79
- $ hrk staging run rake arrange:stuff
80
- $ hrk test run rake test:some:thingy
92
+
93
+ **...I chain hrk commands on concurrent terminals for different remotes?**
94
+
95
+ No worry either, both terminals have their own memory and shouldn't overlap.
96
+ Then:
97
+
98
+ ```bash
99
+ # on terminal 1
100
+ $ hrk demo: run rake db:migrate && \ # happens on demo
101
+ hrk : restart # still on demo
102
+ # on terminal 2
103
+ $ hrk prod: run rake db:migrate && \ # happens on prod
104
+ hrk : restart # still on prod
81
105
  ```
82
106
 
83
- Easy!
107
+ **...I set another remote after completing a bunch of commands?**
108
+
109
+ The last remote set is the one used by default for subsequent commands. So:
110
+
111
+ ```bash
112
+ $ hrk demo: run rake db:migrate && \ # happens on demo
113
+ hrk : restart && \ # also on demo
114
+ hrk prod: maintenance:on && \ # happens on prod
115
+ hrk : run rake db:migrate && \ # also on prod
116
+ hrk : maintenance:off # still on prod
117
+ ```
84
118
 
85
119
  ## Do I still need the heroku toolbelt?
86
120
 
@@ -16,8 +16,14 @@ module Hrk
16
16
  def display
17
17
  puts <<-eos
18
18
  Usage:
19
- hrk remote: command..."
20
- hrk [h | help | -h | --help]"
19
+ hrk [remote]: command...
20
+ hrk [h | help | -h | --help]
21
+
22
+ hrk remembers the last remote you've used to send a command on this terminal,
23
+ and use it by default when you omit the optional [remote] argument.
24
+
25
+ The command is whatever you would give heroku, except (obviously) for the
26
+ -r or -a argument.
21
27
 
22
28
  Options:
23
29
  -h --help Display this screen.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hrk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michel Belleville