alfred_git 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/alfred_git.gemspec +1 -1
- data/bin/alfred_git +3 -3
- data/lib/alfred_git/version.rb +2 -2
- data/lib/alfred_git.rb +44 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2625773fbf4e725ceb03180ece65ba75401fdb50
|
4
|
+
data.tar.gz: cdb43c31a5c7d1e7bd0a9128460599b22aedb8a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11b268d82a70249a833db0d657d51a85477f02165cd9f751f59ba557cefb454c04b6e3c9fb6020d5775c226b3072874ae8221c2334d5b38dafffbee81ebbb110
|
7
|
+
data.tar.gz: aae44b8b8fd4e75a60a57539f9d8674492d184b6c7e4af3257dd460a8d971ad3164c3b52d4ae1f69f87022d094af8626153ff616b92b44a434234f516babc9e9
|
data/README.md
CHANGED
@@ -37,7 +37,7 @@ I've tried to make the command syntax as intuitive as possible. Essentially,
|
|
37
37
|
you'll send in a few parameters (the exact number of parameters required
|
38
38
|
changes based on what git command you need to run - you can't run a `git
|
39
39
|
checkout` without a branch name, for instance) separated by spaces; the
|
40
|
-
important thing to remember is that repos you want to work with *always* be
|
40
|
+
important thing to remember is that repos you want to work with will *always* be
|
41
41
|
your last/last few parameters and will also be separated by spaces. Want to do
|
42
42
|
all of the repos, but don't want to type them all out? Of course you do! Why
|
43
43
|
else would you be using this app? Just run AlfredGit with the word 'all' as
|
data/alfred_git.gemspec
CHANGED
data/bin/alfred_git
CHANGED
data/lib/alfred_git/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
module
|
2
|
-
VERSION = "0.
|
1
|
+
module AlfredGitVersion
|
2
|
+
VERSION = "0.3.0"
|
3
3
|
end
|
data/lib/alfred_git.rb
CHANGED
@@ -1,11 +1,17 @@
|
|
1
1
|
require 'YAML'
|
2
2
|
require 'rainbow'
|
3
|
+
require 'fileutils'
|
4
|
+
|
5
|
+
require_relative './alfred_git/version'
|
3
6
|
|
4
7
|
module AlfredGit
|
5
8
|
class AlfredGit
|
9
|
+
include AlfredGitVersion
|
6
10
|
|
7
11
|
def initialize
|
8
12
|
set_app_directory
|
13
|
+
# If there's just one, it's the current version.
|
14
|
+
restore_settings unless Dir.glob("#{@app_directory.chomp('/alfred_git-#{VERSION}')}/alfred_git*").length > 1
|
9
15
|
config unless File.exists?("#{@app_directory}/lib/config.yaml")
|
10
16
|
config_yaml = YAML.load_file("#{@app_directory}/lib/config.yaml")
|
11
17
|
|
@@ -253,6 +259,44 @@ module AlfredGit
|
|
253
259
|
abort
|
254
260
|
end
|
255
261
|
|
262
|
+
# Attempt to restore settings from previous version.
|
263
|
+
def restore_settings
|
264
|
+
lines_pretty_print 'I see that I\'ve been recently updated.'
|
265
|
+
lines_pretty_print Rainbow('Would you like to restore the settings from the previous installation?').yellow
|
266
|
+
|
267
|
+
answered = false
|
268
|
+
|
269
|
+
until answered
|
270
|
+
answer = STDIN.gets.strip!
|
271
|
+
|
272
|
+
single_space
|
273
|
+
|
274
|
+
if answer == 'yes' || answer == 'y' || answer == 'no' || answer == 'n'
|
275
|
+
answered = true
|
276
|
+
else
|
277
|
+
lines_pretty_print 'You\'re hilarious. Really.'
|
278
|
+
lines_pretty_print Rainbow('Please input either \'yes\' or \'no\'.').yellow
|
279
|
+
end
|
280
|
+
end
|
281
|
+
|
282
|
+
return if answer == 'no' || answer == 'n'
|
283
|
+
|
284
|
+
lines_pretty_print 'One moment, please.'
|
285
|
+
|
286
|
+
single_space
|
287
|
+
|
288
|
+
all_gems = Dir.glob("#{@app_directory.chomp("/alfred_git-#{VERSION}")}/alfred_git*")
|
289
|
+
|
290
|
+
# glob orders things in the array alphabetically, so the second-to-last one in the array is the
|
291
|
+
# most recent version that is not the current version.
|
292
|
+
previous_config_file = "#{all_gems[-2]}/lib/config.yaml"
|
293
|
+
FileUtils.copy_file(previous_config_file, "#{@app_directory}/lib/config.yaml")
|
294
|
+
|
295
|
+
lines_pretty_print 'Done! Please run me again when you\'re ready.'
|
296
|
+
|
297
|
+
abort
|
298
|
+
end
|
299
|
+
|
256
300
|
def second_argument_missing?
|
257
301
|
@arguments[1].nil? || @arguments[1] == ''
|
258
302
|
end
|
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.
|
4
|
+
version: 0.3.0
|
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-
|
11
|
+
date: 2016-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rainbow
|