alfred_git 0.4.3 → 0.5.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: 6629306f7be0d646d12625f9eea72a7e7a8a26dd
4
- data.tar.gz: 43d1c389ba26a435223289702e6c92839306ff84
3
+ metadata.gz: 454e81034229b564d71ee4f100e427108133d60b
4
+ data.tar.gz: 01ed8820c8a024642e351d18cff840942d9d9fca
5
5
  SHA512:
6
- metadata.gz: f09bc6b64ebe7b899c069de47cd87bd47afdd61047c517d99ae3388992738974e366cc23b961c99d8273aa941573b75928b93ad64b6f832294653648e7d15f27
7
- data.tar.gz: 40c8594214c540b7f023d35294038318f9c0c0762fd4f4acec2a2457a8a38bc98437110d54bc505c99d1b0843bd569d4bc4d0d598c845891b5904eeedb32e7c5
6
+ metadata.gz: 34234e659b5d8e8833a3bc4fb909497dd7595e18e052b6c464c2e363a5826976fe97e977e9ef6585c04a186a64c9843a66a5bc415292278224f0fde8efb36485
7
+ data.tar.gz: 0dcea80dce58c8cacefe0c4faaf0b06e74a03835108dbed9fc64ae8868ee8556f36fc8da641cd28b5dc68dc6074ee27afc3381e4cb7f96a909004f8e174bbd39
data/README.md CHANGED
@@ -52,14 +52,24 @@ being on this list? Email me and I'll consider adding it!
52
52
 
53
53
  And with that, we come to the built-in commands. Here are the AlfredGit commands
54
54
  followed by a description of what they run. Most of these should be intuitive.
55
+ Any command with an underscore in it can also be typed without the underscore for
56
+ quicker access because if you're using this app you're clearly lazy and typing
57
+ underscores is hard. So for example, `add_repo` can be typed as `addrepo`.
55
58
 
56
59
  * `pull` - Runs a `git pull`
57
60
  * `push` - Runs a `git push`
58
- * `checkout second_parameter` - runs a `git checkout second_parameter`
59
- * `commit 'second_parameter'` - Runs a `git commit -m second_parameter`
61
+ * `checkout second_parameter` - Runs a `git checkout second_parameter`
62
+ * `commit 'second_parameter'` - Runs a `git commit -m 'second_parameter'`
60
63
  * `status` - Runs a `git status`
61
64
  * `branch` or `branches` - Lists the branch(es) your repo(s) currently have
62
65
  checked out.
66
+ * `list_repo` or `list_repos` - Lists all of your repo names and their locations.
67
+ * `add_repo second_parameter` - Starts the process of adding a new repo by the
68
+ name given in the second parameter. The location
69
+ of the repo will be asked for and then added to
70
+ your list of repos.
71
+ * `delete_repo second_parameter` - Deletes the repo identified by second
72
+ parameter.
63
73
  * `woa` or `wielder_of_anor` - Integrates AlfredGit with
64
74
  [WielderOfAnor](https://github.com/iamsellek/wielder_of_anor).
65
75
  This command takes up to two parameters. The
@@ -1,3 +1,3 @@
1
1
  module AlfredGitVersion
2
- VERSION = "0.4.3"
2
+ VERSION = "0.5.3"
3
3
  end
data/lib/alfred_git.rb CHANGED
@@ -41,7 +41,7 @@ module AlfredGit
41
41
  lines_pretty_print Rainbow("I need a command to run, Master #{@name}.").red
42
42
 
43
43
  abort
44
- when 'list_repo', 'list_repos'
44
+ when 'list_repo', 'list_repos', 'listrepo', 'listrepos'
45
45
  lines_pretty_print "Here are your repos and their locations, Master #{@name}:"
46
46
 
47
47
  single_space
@@ -51,11 +51,23 @@ module AlfredGit
51
51
  single_space
52
52
 
53
53
  abort
54
- when 'add_repo'
54
+ when 'add_repo', 'addrepo'
55
+ if second_argument_missing?
56
+ lines_pretty_print Rainbow("I need a repo name for the new repo, Master #{@name}.").red
57
+
58
+ abort
59
+ end
60
+
55
61
  add_repo
56
62
 
57
63
  abort
58
- when 'delete_repo'
64
+ when 'delete_repo', 'deleterepo', 'deletrepo'
65
+ if second_argument_missing?
66
+ lines_pretty_print Rainbow("I need a repo name to know which repo I'm deleting, Master #{@name}.").red
67
+
68
+ abort
69
+ end
70
+
59
71
  delete_repo
60
72
 
61
73
  abort
@@ -69,22 +81,20 @@ module AlfredGit
69
81
  end
70
82
 
71
83
  def add_repo
72
- config_yaml = YAML.load_file("#{@app_directory}/lib/config.yaml")
73
- config_file = File.open("#{@app_directory}/lib/config.yaml", 'w')
74
-
75
- lines_pretty_print "What is the 'friendly' name you'd like to give your repository? This is the "\
76
- 'name you will type when sending me commands.'
77
-
78
- repo_name = STDIN.gets.strip!
84
+ repo_name = @arguments[1]
79
85
 
80
86
  single_space
81
87
 
82
- lines_pretty_print "Thank you, #{@gender}. Now, where is that repository? Please paste the full path."
88
+ lines_pretty_print "I can add the #{repo_name} repo straight away, #{@gender}. Where is that repository? "\
89
+ 'Please paste the full path.'
83
90
 
84
91
  repo_path = STDIN.gets.strip!
85
92
 
86
93
  single_space
87
94
 
95
+ config_yaml = YAML.load_file("#{@app_directory}/lib/config.yaml")
96
+ config_file = File.open("#{@app_directory}/lib/config.yaml", 'w')
97
+
88
98
  config_yaml['repos'][repo_name] = repo_path
89
99
  YAML.dump(config_yaml, config_file)
90
100
 
@@ -94,15 +104,13 @@ module AlfredGit
94
104
  end
95
105
 
96
106
  def delete_repo
97
- config_yaml = YAML.load_file("#{@app_directory}/lib/config.yaml")
98
- config_file = File.open("#{@app_directory}/lib/config.yaml", 'w')
99
-
100
- lines_pretty_print "What repository would you like to delete from my list of repositories, #{@gender}?"
101
-
102
- repo_name = STDIN.gets.strip!
107
+ repo_name = @arguments[1]
103
108
 
104
109
  single_space
105
110
 
111
+ config_yaml = YAML.load_file("#{@app_directory}/lib/config.yaml")
112
+ config_file = File.open("#{@app_directory}/lib/config.yaml", 'w')
113
+
106
114
  if config_yaml['repos'].keys.include?(repo_name)
107
115
  config_yaml['repos'].delete(repo_name)
108
116
 
@@ -160,14 +168,14 @@ module AlfredGit
160
168
  command = 'git rev-parse --abbrev-ref HEAD'
161
169
 
162
170
  delete_arguments(1)
163
- when 'woa', 'wielder_of_anor'
171
+ when 'woa', 'wielder_of_anor', 'wielderofanor'
164
172
  if second_argument_missing?
165
173
  lines_pretty_print Rainbow("I need a commit message to pass to wielder_of_anor, Master #{@name}.").red
166
174
 
167
175
  abort
168
176
  end
169
177
 
170
- if @arguments[2] == '1'
178
+ if @arguments[2] && @arguments[2] == '1'
171
179
  command = %Q[wielder_of_anor "#{@arguments[1]}" 1]
172
180
 
173
181
  delete_arguments(3)
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.3
4
+ version: 0.5.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-20 00:00:00.000000000 Z
11
+ date: 2016-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rainbow