alfred_git 0.3.3 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 85c685e1aef2b822eaf4edc821970746671b4fe5
4
- data.tar.gz: 7e68d31d0e4ebde37386af375d1fe3c08614bbf3
3
+ metadata.gz: 6629306f7be0d646d12625f9eea72a7e7a8a26dd
4
+ data.tar.gz: 43d1c389ba26a435223289702e6c92839306ff84
5
5
  SHA512:
6
- metadata.gz: 3701c2ba56ad251fbc160003f7c578d625f712bc69dd1f00a17db006351001628c0f4433c750d5f837892c8dbf26a35e4aa7ba29c9363c94a177e68535abfc39
7
- data.tar.gz: 652aa6fb3fcc104992bf78e4c5bbba9c01e1fb19e3f0b4213ee63316201fa915d4aa02f3cb2b944ef4df4e75032eb7dd0c9e981d1ee0cb144cb423ce57cc1a7e
6
+ metadata.gz: f09bc6b64ebe7b899c069de47cd87bd47afdd61047c517d99ae3388992738974e366cc23b961c99d8273aa941573b75928b93ad64b6f832294653648e7d15f27
7
+ data.tar.gz: 40c8594214c540b7f023d35294038318f9c0c0762fd4f4acec2a2457a8a38bc98437110d54bc505c99d1b0843bd569d4bc4d0d598c845891b5904eeedb32e7c5
data/README.md CHANGED
@@ -60,6 +60,13 @@ followed by a description of what they run. Most of these should be intuitive.
60
60
  * `status` - Runs a `git status`
61
61
  * `branch` or `branches` - Lists the branch(es) your repo(s) currently have
62
62
  checked out.
63
+ * `woa` or `wielder_of_anor` - Integrates AlfredGit with
64
+ [WielderOfAnor](https://github.com/iamsellek/wielder_of_anor).
65
+ This command takes up to two parameters. The
66
+ first will always be your commit message. The
67
+ second is optional, can only be the number 1 (it
68
+ will be ignored if it is anything else), and it
69
+ will skip checking for forbidden words.
63
70
 
64
71
  To send a custom command to any number of branches, just send it as your first
65
72
  parameter. Here's the important part to remember, though: if your custom command
@@ -88,6 +95,13 @@ How about checking out a branch named 'branch_name' on multiple repos at once?
88
95
 
89
96
  `> alfred_git checkout branch_name repo_1 repo_2`
90
97
 
98
+ Need to run a commit via [WielderOfAnor](https://github.com/iamsellek/wielder_of_anor)
99
+ on repos 1 and 2 because it's another awesome app that you can't live without?
100
+ Psh of course. Here's how. *The 1 is optional and only used if you want to skip
101
+ the checking for forbidden words.*
102
+
103
+ `> alfred_git woa "This is a terrible commit message." 1 repo_1 repo_2`
104
+
91
105
  What about those sexy-sounding custom commands you heard about? No problem!
92
106
  Just send your command as the first parameter. Just keep in mind what I
93
107
  mentioned about commands with a space in them! Wrap those bad boys in quotes!
@@ -1,3 +1,3 @@
1
1
  module AlfredGitVersion
2
- VERSION = "0.3.3"
2
+ VERSION = "0.4.3"
3
3
  end
data/lib/alfred_git.rb CHANGED
@@ -124,10 +124,12 @@ module AlfredGit
124
124
  case @arguments[0]
125
125
  when 'pull'
126
126
  command = 'git pull'
127
- @arguments.delete_at(0)
127
+
128
+ delete_arguments(1)
128
129
  when 'push'
129
130
  command = 'git push'
130
- @arguments.delete_at(0)
131
+
132
+ delete_arguments(1)
131
133
  when 'checkout'
132
134
  if second_argument_missing?
133
135
  lines_pretty_print Rainbow('I need a branch name to execute the \'checkout\' command, Master '\
@@ -138,8 +140,7 @@ module AlfredGit
138
140
 
139
141
  command = "git checkout #{@arguments[1]}"
140
142
 
141
- @arguments.delete_at(0)
142
- @arguments.delete_at(0)
143
+ delete_arguments(2)
143
144
  when 'commit'
144
145
  if second_argument_missing?
145
146
  lines_pretty_print Rainbow('I need a commit message to execute the \'commit\' command, Master '\
@@ -149,15 +150,36 @@ module AlfredGit
149
150
  end
150
151
 
151
152
  command = %Q[git commit -m "#{@arguments[1]}"]
153
+
154
+ delete_arguments(2)
152
155
  when 'status'
153
156
  command = 'git status'
154
- @arguments.delete_at(0)
157
+
158
+ delete_arguments(1)
155
159
  when 'branches', 'branch'
156
160
  command = 'git rev-parse --abbrev-ref HEAD'
157
- @arguments.delete_at(0)
161
+
162
+ delete_arguments(1)
163
+ when 'woa', 'wielder_of_anor'
164
+ if second_argument_missing?
165
+ lines_pretty_print Rainbow("I need a commit message to pass to wielder_of_anor, Master #{@name}.").red
166
+
167
+ abort
168
+ end
169
+
170
+ if @arguments[2] == '1'
171
+ command = %Q[wielder_of_anor "#{@arguments[1]}" 1]
172
+
173
+ delete_arguments(3)
174
+ else
175
+ command = %Q[wielder_of_anor "#{@arguments[1]}"]
176
+
177
+ delete_arguments(2)
178
+ end
158
179
  else
159
180
  command = @arguments[0] # Allow users to send any command to all repos.
160
- @arguments.delete_at(0)
181
+
182
+ delete_arguments(1)
161
183
  end
162
184
 
163
185
  command
@@ -302,6 +324,13 @@ module AlfredGit
302
324
  @arguments[1].nil? || @arguments[1] == ''
303
325
  end
304
326
 
327
+ def delete_arguments(number_to_delete)
328
+ (1..number_to_delete).each do
329
+ # Deleting the first one each time because the array shifts left when one is deleted.
330
+ @arguments.delete_at(0)
331
+ end
332
+ end
333
+
305
334
  def bash(directory, command)
306
335
  # Dir.chdir ensures all bash commands are being run from the correct
307
336
  # directory.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alfred_git
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Sellek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-17 00:00:00.000000000 Z
11
+ date: 2016-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rainbow