hsume2-aka 0.3.2 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -3
  3. data/bin/aka +18 -0
  4. data/bin/build +37 -0
  5. data/bin/postinstall +3 -0
  6. data/bin/postremove +3 -0
  7. data/lib/aka/configuration.pb.rb +41 -0
  8. data/lib/aka/configuration.proto +20 -0
  9. data/lib/aka/link_manager.rb +30 -0
  10. data/lib/aka/man/aka-add.1 +1 -1
  11. data/lib/aka/man/aka-add.1.txt +1 -1
  12. data/lib/aka/man/aka-edit.1 +1 -1
  13. data/lib/aka/man/aka-edit.1.txt +1 -1
  14. data/lib/aka/man/aka-generate.1 +1 -1
  15. data/lib/aka/man/aka-generate.1.txt +1 -1
  16. data/lib/aka/man/aka-link.1 +1 -1
  17. data/lib/aka/man/aka-link.1.txt +1 -1
  18. data/lib/aka/man/aka-list.1 +1 -1
  19. data/lib/aka/man/aka-list.1.txt +1 -1
  20. data/lib/aka/man/aka-remove.1 +1 -1
  21. data/lib/aka/man/aka-remove.1.txt +1 -1
  22. data/lib/aka/man/aka-show.1 +1 -1
  23. data/lib/aka/man/aka-show.1.txt +1 -1
  24. data/lib/aka/man/aka-sync.1 +1 -1
  25. data/lib/aka/man/aka-sync.1.txt +1 -1
  26. data/lib/aka/man/aka-upgrade.1 +3 -3
  27. data/lib/aka/man/aka-upgrade.1.txt +3 -3
  28. data/lib/aka/man/aka.7 +4 -4
  29. data/lib/aka/man/aka.7.txt +4 -4
  30. data/lib/aka/shortcut.rb +43 -0
  31. data/lib/aka/{shortcuts.rb → shortcut_manager.rb} +16 -34
  32. data/lib/aka/store.rb +92 -39
  33. data/lib/aka/upgrader.rb +45 -12
  34. data/lib/aka/version.rb +1 -1
  35. data/lib/aka.rb +4 -3
  36. metadata +23 -74
  37. data/.gitignore +0 -11
  38. data/.ruby-version.example +0 -1
  39. data/.travis.yml +0 -4
  40. data/Gemfile +0 -8
  41. data/Guardfile +0 -6
  42. data/Rakefile +0 -98
  43. data/aka.gemspec +0 -28
  44. data/features/aka/add.feature +0 -199
  45. data/features/aka/edit.feature +0 -196
  46. data/features/aka/generate.feature +0 -117
  47. data/features/aka/help.feature +0 -112
  48. data/features/aka/link.feature +0 -339
  49. data/features/aka/list.feature +0 -62
  50. data/features/aka/remove.feature +0 -52
  51. data/features/aka/show.feature +0 -38
  52. data/features/aka/upgrade.feature +0 -137
  53. data/features/step_definitions/aka_steps.rb +0 -3
  54. data/features/support/env.rb +0 -80
  55. data/lib/aka/configuration.rb +0 -94
  56. data/lib/aka/links.rb +0 -33
  57. data/lib/aka/man/.gitkeep +0 -0
  58. data/man/aka-add.1.ronn +0 -32
  59. data/man/aka-edit.1.ronn +0 -67
  60. data/man/aka-generate.1.ronn +0 -51
  61. data/man/aka-link.1.ronn +0 -49
  62. data/man/aka-list.1.ronn +0 -51
  63. data/man/aka-remove.1.ronn +0 -21
  64. data/man/aka-show.1.ronn +0 -27
  65. data/man/aka-sync.1.ronn +0 -31
  66. data/man/aka-upgrade.1.ronn +0 -22
  67. data/man/aka.7.ronn +0 -120
  68. data/test/tc_something.rb +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d9c12245b08544fb9d60f66311be76887244bc34
4
- data.tar.gz: 9f9df10ff81c6eadde4b92dc3be8b2063155880c
3
+ metadata.gz: 8f0b27b609206bce2e4823a1a725eb4cd306a1df
4
+ data.tar.gz: 3722a3fb045fd6de7ccb08d76ced37375d96a3a0
5
5
  SHA512:
6
- metadata.gz: 98608e94159c7df89ad75b2557c57226e05c848c8d03a042b0d101460bde9723463223b28a6ffd0112397818c48464356b5fc4814078a1bad8373ad5186075bd
7
- data.tar.gz: 717ad752d5aadc2ffe7a82c1d2e2b8439b5ced1680b6ef5db821adc31315c44d7d8f5afeec550f4e1febdbe6e86815f02c5ddeb784bee3d222a98a2567519a9e
6
+ metadata.gz: 2112b82f8e06dfb5396cb85ba2abc7612438f6e4b3dd0364e53c40da3ee852400bd86dea97445a0891640fc20c4baa9d47a1979aeee21840b22541718047f338
7
+ data.tar.gz: 070aa70d2079222da19ae3b193b30ffdfe4946c088c4050bca63141183d5a7f7f55868eb68cfe72a9a2080b18416ead2cc02ce95da508a8d0ce023622b0488ef
data/README.md CHANGED
@@ -38,6 +38,14 @@ With **aka**, you can add, show, edit, remove, list keyboard shortcuts. On top o
38
38
 
39
39
  $ gem install hsume2-aka
40
40
 
41
+ ### Debian/Ubuntu
42
+
43
+ $ curl -OL https://github.com/hsume2/aka/raw/v0.4.0/pkg/aka_0.4.0_amd64.deb && sudo dpkg -i aka_0.4.0_amd64.deb
44
+
45
+ ### OS X
46
+
47
+ $ curl -OL https://github.com/hsume2/aka/raw/v0.4.0/pkg/aka-0.4.0.pkg && open aka-0.4.0.pkg
48
+
41
49
  ## EXAMPLES
42
50
 
43
51
  Add a keyboard shortcut and generate the output script:
@@ -117,10 +125,10 @@ Synchronize links:
117
125
  Upgrade links from v0 to v1:
118
126
 
119
127
  $ aka upgrade
120
- Upgraded ~/.aka.yml.
121
- Backed up to ~/.aka.yml.backup.
128
+ Upgraded ~/.aka.db.
129
+ Backed up to ~/.aka.db.backup.
122
130
 
123
131
  ## ENVIRONMENT
124
132
 
125
133
  * `AKA`:<br>
126
- The file where **aka** stores everything. Default: ~/.aka.yml
134
+ The file where **aka** stores everything. Default: ~/.aka.db
data/bin/aka CHANGED
@@ -1,5 +1,23 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ # resolve bin path, ignoring symlinks
4
+ require "pathname"
5
+ bin_file = Pathname.new(__FILE__).realpath
6
+
7
+ # add locally vendored gems to libpath
8
+ gem_dir = File.expand_path("../../vendor/gems", bin_file)
9
+ Dir["#{gem_dir}/**/lib"].each do |libdir|
10
+ $:.unshift libdir
11
+ end
12
+
13
+ # add self to libpath
14
+ $:.unshift File.expand_path("../../lib", bin_file)
15
+
16
+ if RUBY_VERSION < '1.9.0' # this is a string comparison, but it should work for any old ruby version
17
+ $stderr.puts "aka requires Ruby 1.9+."
18
+ exit 1
19
+ end
20
+
3
21
  require 'aka.rb'
4
22
 
5
23
  Aka::App.go!
data/bin/build ADDED
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'fileutils'
4
+ require 'shellwords'
5
+ require "bundler/setup"
6
+ require "aka"
7
+
8
+ GEM_BLACKLIST = %w( bundler aka )
9
+
10
+ target_dir = Dir.pwd
11
+
12
+ FileUtils.rm_rf "#{target_dir}/vendor/gems"
13
+
14
+ %x{env BUNDLE_WITHOUT="development:test" bundle show}.split("\n").each do |line|
15
+ if line =~ /^ \* (.*?) \((.*?)\)/
16
+ next if GEM_BLACKLIST.include?($1)
17
+ gem_dir = %x{ bundle show #{$1} }.strip
18
+ FileUtils.mkdir_p "#{target_dir}/vendor/gems"
19
+ %x{ cp -R "#{gem_dir}" "#{target_dir}/vendor/gems" }
20
+ end
21
+ end
22
+
23
+ FileUtils.mkdir_p "#{target_dir}/pkg"
24
+
25
+ description = Gem::Specification.find_by_name('aka').description
26
+
27
+ system("rake man:build")
28
+
29
+ %x{which pkgbuild}
30
+
31
+ if $?.success?
32
+ package_type = 'osxpkg'
33
+ else
34
+ package_type = 'deb'
35
+ end
36
+
37
+ system(%{fpm -s dir -t #{package_type} -n aka -v #{Aka::VERSION} --after-install #{target_dir}/bin/postinstall --after-remove #{target_dir}/bin/postremove --prefix /usr/local/aka --description #{Shellwords.escape(description)} -x .git -x pkg -x man -x test -x features -x tmp -x .bundle -p pkg .})
data/bin/postinstall ADDED
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+
3
+ ln -sf /usr/local/aka/bin/aka /usr/local/bin/aka
data/bin/postremove ADDED
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+
3
+ rm /usr/local/bin/aka
@@ -0,0 +1,41 @@
1
+ # encoding: utf-8
2
+
3
+ ##
4
+ # This file is auto-generated. DO NOT EDIT!
5
+ #
6
+ require 'protobuf/message'
7
+
8
+
9
+ ##
10
+ # Message Classes
11
+ #
12
+ class Configuration < ::Protobuf::Message
13
+ class Shortcut < ::Protobuf::Message; end
14
+ class Link < ::Protobuf::Message; end
15
+
16
+ end
17
+
18
+
19
+
20
+ ##
21
+ # Message Fields
22
+ #
23
+ class Configuration
24
+ class Shortcut
25
+ required :string, :shortcut, 1
26
+ required :string, :command, 2
27
+ repeated :string, :tag, 3
28
+ optional :string, :description, 4
29
+ optional :bool, :function, 5
30
+ end
31
+
32
+ class Link
33
+ repeated :string, :tag, 1
34
+ required :string, :output, 2
35
+ end
36
+
37
+ required :string, :version, 1
38
+ repeated ::Configuration::Shortcut, :shortcuts, 2
39
+ repeated ::Configuration::Link, :links, 3
40
+ end
41
+
@@ -0,0 +1,20 @@
1
+ message Configuration {
2
+ required string version = 1;
3
+
4
+ message Shortcut {
5
+ required string shortcut = 1;
6
+ required string command = 2;
7
+ repeated string tag = 3;
8
+ optional string description = 4;
9
+ optional bool function = 5;
10
+ }
11
+
12
+ repeated Shortcut shortcuts = 2;
13
+
14
+ message Link {
15
+ repeated string tag = 1;
16
+ required string output = 2;
17
+ }
18
+
19
+ repeated Link links = 3;
20
+ }
@@ -0,0 +1,30 @@
1
+ module Aka
2
+ class LinkManager
3
+ def initialize(links)
4
+ @links = links
5
+ end
6
+
7
+ def find(link)
8
+ @links.find do |item|
9
+ item == link
10
+ end
11
+ end
12
+
13
+ def add(new_link)
14
+ return if found = find(new_link)
15
+ @links << new_link
16
+ end
17
+
18
+ def remove(key)
19
+ @links.delete_at(key.to_i - 1)
20
+ end
21
+
22
+ def any?(&block)
23
+ @links.any?(&block)
24
+ end
25
+
26
+ def each(&block)
27
+ @links.each(&block)
28
+ end
29
+ end
30
+ end
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "AKA\-ADD" "1" "April 2014" "" ""
4
+ .TH "AKA\-ADD" "1" "August 2016" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBaka\-add\fR \- Add keyboard shortcuts
@@ -28,4 +28,4 @@ SEE ALSO
28
28
 
29
29
 
30
30
 
31
- April 2014 AKA-ADD(1)
31
+ August 2016 AKA-ADD(1)
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "AKA\-EDIT" "1" "April 2014" "" ""
4
+ .TH "AKA\-EDIT" "1" "August 2016" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBaka\-edit\fR \- Edit keyboard shortcuts
@@ -72,4 +72,4 @@ SEE ALSO
72
72
 
73
73
 
74
74
 
75
- April 2014 AKA-EDIT(1)
75
+ August 2016 AKA-EDIT(1)
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "AKA\-GENERATE" "1" "April 2014" "" ""
4
+ .TH "AKA\-GENERATE" "1" "August 2016" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBaka\-generate\fR \- Generate commands for loading keyboard shortcuts into your shell
@@ -67,4 +67,4 @@ SEE ALSO
67
67
 
68
68
 
69
69
 
70
- April 2014 AKA-GENERATE(1)
70
+ August 2016 AKA-GENERATE(1)
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "AKA\-LINK" "1" "April 2014" "" ""
4
+ .TH "AKA\-LINK" "1" "August 2016" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBaka\-link\fR \- Link keyboard shortcuts
@@ -59,4 +59,4 @@ SEE ALSO
59
59
 
60
60
 
61
61
 
62
- April 2014 AKA-LINK(1)
62
+ August 2016 AKA-LINK(1)
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "AKA\-LIST" "1" "April 2014" "" ""
4
+ .TH "AKA\-LIST" "1" "August 2016" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBaka\-list\fR \- List keyboard shortcuts
@@ -60,4 +60,4 @@ SEE ALSO
60
60
 
61
61
 
62
62
 
63
- April 2014 AKA-LIST(1)
63
+ August 2016 AKA-LIST(1)
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "AKA\-REMOVE" "1" "April 2014" "" ""
4
+ .TH "AKA\-REMOVE" "1" "August 2016" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBaka\-remove\fR \- Remove keyboard shortcuts
@@ -26,4 +26,4 @@ SEE ALSO
26
26
 
27
27
 
28
28
 
29
- April 2014 AKA-REMOVE(1)
29
+ August 2016 AKA-REMOVE(1)
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "AKA\-SHOW" "1" "April 2014" "" ""
4
+ .TH "AKA\-SHOW" "1" "August 2016" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBaka\-show\fR \- Show keyboard shortcuts
@@ -28,4 +28,4 @@ SEE ALSO
28
28
 
29
29
 
30
30
 
31
- April 2014 AKA-SHOW(1)
31
+ August 2016 AKA-SHOW(1)
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "AKA\-SYNC" "1" "April 2014" "" ""
4
+ .TH "AKA\-SYNC" "1" "August 2016" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBaka\-sync\fR \- Synchronize keyboard shortcuts
@@ -35,4 +35,4 @@ SEE ALSO
35
35
 
36
36
 
37
37
 
38
- April 2014 AKA-SYNC(1)
38
+ August 2016 AKA-SYNC(1)
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "AKA\-UPGRADE" "1" "April 2014" "" ""
4
+ .TH "AKA\-UPGRADE" "1" "August 2016" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBaka\-upgrade\fR \- Upgrade keyboard shortcuts
@@ -20,8 +20,8 @@ Upgrade links from v0 to v1:
20
20
  .nf
21
21
 
22
22
  $ aka upgrade
23
- Upgraded ~/\.aka\.yml\.
24
- Backed up to ~/\.aka\.yml\.backup\.
23
+ Upgraded ~/\.aka\.db\.
24
+ Backed up to ~/\.aka\.db\.backup\.
25
25
  .
26
26
  .fi
27
27
  .
@@ -17,8 +17,8 @@ EXAMPLES
17
17
 
18
18
 
19
19
  $ aka upgrade
20
- Upgraded ~/.aka.yml.
21
- Backed up to ~/.aka.yml.backup.
20
+ Upgraded ~/.aka.db.
21
+ Backed up to ~/.aka.db.backup.
22
22
 
23
23
 
24
24
 
@@ -27,4 +27,4 @@ SEE ALSO
27
27
 
28
28
 
29
29
 
30
- April 2014 AKA-UPGRADE(1)
30
+ August 2016 AKA-UPGRADE(1)
data/lib/aka/man/aka.7 CHANGED
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "AKA" "7" "April 2014" "" ""
4
+ .TH "AKA" "7" "August 2016" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBaka\fR \- Manage Shell Keyboard Shortcuts
@@ -228,8 +228,8 @@ Upgrade links from v0 to v1:
228
228
  .nf
229
229
 
230
230
  $ aka upgrade
231
- Upgraded ~/\.aka\.yml\.
232
- Backed up to ~/\.aka\.yml\.backup\."
231
+ Upgraded ~/\.aka\.db\.
232
+ Backed up to ~/\.aka\.db\.backup\."
233
233
  .
234
234
  .fi
235
235
  .
@@ -241,6 +241,6 @@ Backed up to ~/\.aka\.yml\.backup\."
241
241
  \fBAKA\fR:
242
242
  .
243
243
  .br
244
- The file where \fBaka\fR stores everything\. Default: ~/\.aka\.yml
244
+ The file where \fBaka\fR stores everything\. Default: ~/\.aka\.db
245
245
 
246
246
 
@@ -155,17 +155,17 @@ EXAMPLES
155
155
 
156
156
 
157
157
  $ aka upgrade
158
- Upgraded ~/.aka.yml.
159
- Backed up to ~/.aka.yml.backup."
158
+ Upgraded ~/.aka.db.
159
+ Backed up to ~/.aka.db.backup."
160
160
 
161
161
 
162
162
 
163
163
  ENVIRONMENT
164
164
  AKA:
165
- The file where aka stores everything. Default: ~/.aka.yml
165
+ The file where aka stores everything. Default: ~/.aka.db
166
166
 
167
167
 
168
168
 
169
169
 
170
170
 
171
- April 2014 AKA(7)
171
+ August 2016 AKA(7)
@@ -0,0 +1,43 @@
1
+ module Aka
2
+ class Shortcut
3
+ def self.parse(options)
4
+ self.new.tap do |row|
5
+ row.shortcut = options['shortcut']
6
+ row.command = options['command']
7
+ row.tag = options['tag'] if options['tag']
8
+ row.description = options['description'] if options['description']
9
+ row.function = options['function'] if options['function']
10
+ end
11
+ end
12
+
13
+ def self.generate_output(row)
14
+ string = if row.function
15
+ <<-EOS.gsub(/^ /, '')
16
+ function #{row.shortcut} {
17
+ #{row.command}
18
+ }
19
+ EOS
20
+ else
21
+ %{alias #{row.shortcut}="#{row.command.gsub(%{"}, %{\\"})}"}
22
+ end
23
+
24
+ string
25
+ end
26
+
27
+ attr_accessor :shortcut
28
+ attr_accessor :command
29
+ attr_accessor :tag
30
+ attr_accessor :description
31
+ attr_accessor :function
32
+
33
+ def to_hash
34
+ {
35
+ :shortcut => self.shortcut,
36
+ :command => self.command,
37
+ :tag => self.tag,
38
+ :description => self.description,
39
+ :function => self.function
40
+ }
41
+ end
42
+ end
43
+ end
@@ -1,42 +1,31 @@
1
1
  module Aka
2
- class Shortcuts
2
+ class ShortcutManager
3
3
  def initialize(shortcuts)
4
- @shortcuts = shortcuts.dup
4
+ @shortcuts = shortcuts
5
5
  end
6
6
 
7
- def append(shortcut)
8
- @shortcuts[count + 1] = shortcut
7
+ def add(shortcut)
8
+ @shortcuts << shortcut
9
9
  end
10
10
 
11
- def replace(key, shortcut)
12
- @shortcuts[key] = shortcut
13
- end
14
-
15
- def delete(key)
16
- @shortcuts.delete(key)
17
- end
18
-
19
- def count
20
- result, _ = @shortcuts.max { |(n, _)| n }
21
- result || 0
22
- end
23
-
24
- def all
25
- @shortcuts.dup
11
+ def remove(shortcut)
12
+ @shortcuts.delete_if do |item|
13
+ item == shortcut
14
+ end
26
15
  end
27
16
 
28
17
  def find(options)
29
18
  if options[:tag]
30
- @shortcuts.select do |_, row|
31
- next unless row.shortcut == options[:shortcut]
19
+ @shortcuts.select do |shortcut|
20
+ next unless shortcut.shortcut == options[:shortcut]
32
21
 
33
22
  options[:tag].find do |tag|
34
- row.tag && row.tag.include?(tag)
23
+ shortcut.tag && shortcut.tag.include?(tag)
35
24
  end
36
25
  end
37
26
  else
38
- @shortcuts.select do |_, row|
39
- row.shortcut == options[:shortcut]
27
+ @shortcuts.select do |shortcut|
28
+ shortcut.shortcut == options[:shortcut]
40
29
  end
41
30
  end
42
31
  end
@@ -48,9 +37,9 @@ module Aka
48
37
  excluded = match_by_tag(options[:tag] || []) do |tag, rows|
49
38
  rows.each do |row|
50
39
  unless row.function
51
- scripts << Configuration::Shortcut.generate_output(row)
40
+ scripts << Shortcut.generate_output(row)
52
41
  else
53
- functions << Configuration::Shortcut.generate_output(row)
42
+ functions << Shortcut.generate_output(row)
54
43
  end
55
44
  end
56
45
  end
@@ -80,13 +69,6 @@ module Aka
80
69
  excluded
81
70
  end
82
71
 
83
- def excluded_output(excluded)
84
- return if excluded[:tags].empty?
85
-
86
- tags = excluded[:tags].map { |t| '#' + t }.join(', ')
87
- $stderr.puts "#{excluded[:shortcuts]} shortcut(s) excluded (#{tags})."
88
- end
89
-
90
72
  def match_by_tag(tags, &blk)
91
73
  excluded = { :tags => [], :shortcuts => 0 }
92
74
 
@@ -105,7 +87,7 @@ module Aka
105
87
  end
106
88
 
107
89
  def by_tag
108
- @shortcuts.inject({ :default => [] }) do |acc, (_, row)|
90
+ @shortcuts.inject({ :default => [] }) do |acc, row|
109
91
  if row.tag && !row.tag.empty?
110
92
  row.tag.each do |tag|
111
93
  acc[tag] ||= []