hsume2-aka 0.3.1 → 0.3.2

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: c5d026442f9c86fc72053c46721c16483392b992
4
- data.tar.gz: c5707953396d050400fa42d4717ce90e21606ff0
3
+ metadata.gz: d9c12245b08544fb9d60f66311be76887244bc34
4
+ data.tar.gz: 9f9df10ff81c6eadde4b92dc3be8b2063155880c
5
5
  SHA512:
6
- metadata.gz: d36fdfee6a566e2363e743cee1a83f9c5f370cd1f41c29454b5de026efa6a7590176b63f69256a5bd1627c656275a6e3a4ef5db2147eadff88ba37043a10f0b8
7
- data.tar.gz: 6eea6f22ff1654595ccdd695fd4a52cf1d1da49dcb6ff1c46bce4ae3e459020417b97dbb5edd9e6dd0197d983fc2db55d4819b5b1bb649f41752ba04c77864b8
6
+ metadata.gz: 98608e94159c7df89ad75b2557c57226e05c848c8d03a042b0d101460bde9723463223b28a6ffd0112397818c48464356b5fc4814078a1bad8373ad5186075bd
7
+ data.tar.gz: 717ad752d5aadc2ffe7a82c1d2e2b8439b5ced1680b6ef5db821adc31315c44d7d8f5afeec550f4e1febdbe6e86815f02c5ddeb784bee3d222a98a2567519a9e
data/.travis.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.0.0
3
+ - "ruby-2.1.1"
4
4
  bundler_args: --without guard
@@ -53,6 +53,107 @@ Feature: Edit keyboard shortcuts
53
53
 
54
54
  """
55
55
 
56
+ Scenario: Edit to remove tag
57
+ Given I run `aka add ls "ls -F --color=auto" --tag zsh`
58
+ And a file named "input.txt" with:
59
+ """
60
+ Shortcut: lsf
61
+ Description:
62
+ 1
63
+ 2
64
+ 3
65
+ Function (y/n): y
66
+ Tags:
67
+ Command:
68
+ ls -F
69
+ """
70
+ When I run `aka edit ls -i input.txt`
71
+ Then the exit status should be 0
72
+ And the output should contain exactly:
73
+ """
74
+ Created shortcut.
75
+ Saved shortcut.
76
+
77
+ """
78
+ And the file ".aka.yml" should contain exactly:
79
+ """
80
+ ---
81
+ :version: '1'
82
+ :shortcuts:
83
+ 1: !ruby/object:OpenStruct
84
+ table:
85
+ :shortcut: lsf
86
+ :command: ls -F
87
+ :description: |-
88
+ 1
89
+ 2
90
+ 3
91
+ :function: true
92
+ modifiable: true
93
+
94
+ """
95
+
96
+ Scenario: Edit that clears command
97
+ Given I run `aka add ls "ls -F --color=auto" --tag zsh`
98
+ And a file named "input.txt" with:
99
+ """
100
+ Shortcut: lsf
101
+ Description:
102
+ 1
103
+ 2
104
+ 3
105
+ Function (y/n): y
106
+ Tags:
107
+ Command:
108
+ """
109
+ When I run `aka edit ls -i input.txt`
110
+ Then the exit status should be 0
111
+ And the output should contain exactly:
112
+ """
113
+ Created shortcut.
114
+ Saved shortcut.
115
+
116
+ """
117
+ And the file ".aka.yml" should contain exactly:
118
+ """
119
+ ---
120
+ :version: '1'
121
+ :shortcuts:
122
+ 1: !ruby/object:OpenStruct
123
+ table:
124
+ :shortcut: lsf
125
+ :command: ''
126
+ :description: |-
127
+ 1
128
+ 2
129
+ 3
130
+ :function: true
131
+ modifiable: true
132
+
133
+ """
134
+ When I run `aka list`
135
+ Then the exit status should be 0
136
+ And the output should contain exactly:
137
+ """
138
+ Created shortcut.
139
+ Saved shortcut.
140
+ #default
141
+ ========
142
+ lsf 1; 2; 3
143
+
144
+
145
+ """
146
+
147
+ # When in interactive mode, edit the shorcut so it looks like this:
148
+ # Shortcut: lsf
149
+ # Description:
150
+ # 1
151
+ # 2
152
+ # 3
153
+ # Function (y/n): y
154
+ # Tags: zsh, bash
155
+ # Command:
156
+ # ls -F
56
157
  @interactive
57
158
  Scenario: Edit interactively
58
159
  Given I run `aka add ls "ls -F --color=auto"`
@@ -37,7 +37,7 @@ Feature: Help with aka
37
37
  Then the exit status should be 0
38
38
  And the output should contain exactly:
39
39
  """
40
- aka version 0.3.1
40
+ aka version 0.3.2
41
41
 
42
42
  """
43
43
 
@@ -51,7 +51,7 @@ Feature: Link keyboard shortcuts
51
51
  modifiable: true
52
52
  3: !ruby/object:OpenStruct
53
53
  table:
54
- :shortcut: ..
54
+ :shortcut: ".."
55
55
  :command: cd ..
56
56
  modifiable: true
57
57
  :links:
@@ -59,7 +59,7 @@ Feature: Link keyboard shortcuts
59
59
  table:
60
60
  :tag:
61
61
  - os:darwin
62
- :output: .aka.zsh
62
+ :output: ".aka.zsh"
63
63
  modifiable: true
64
64
 
65
65
  """
@@ -106,7 +106,7 @@ Feature: Link keyboard shortcuts
106
106
  modifiable: true
107
107
  3: !ruby/object:OpenStruct
108
108
  table:
109
- :shortcut: ..
109
+ :shortcut: ".."
110
110
  :command: cd ..
111
111
  modifiable: true
112
112
  :links:
@@ -114,7 +114,7 @@ Feature: Link keyboard shortcuts
114
114
  table:
115
115
  :tag:
116
116
  - os:darwin
117
- :output: .aka.zsh
117
+ :output: ".aka.zsh"
118
118
  modifiable: true
119
119
 
120
120
  """
@@ -163,7 +163,7 @@ Feature: Link keyboard shortcuts
163
163
  modifiable: true
164
164
  3: !ruby/object:OpenStruct
165
165
  table:
166
- :shortcut: ..
166
+ :shortcut: ".."
167
167
  :command: cd ..
168
168
  modifiable: true
169
169
 
@@ -211,7 +211,7 @@ Feature: Link keyboard shortcuts
211
211
  modifiable: true
212
212
  3: !ruby/object:OpenStruct
213
213
  table:
214
- :shortcut: ..
214
+ :shortcut: ".."
215
215
  :command: cd ..
216
216
  modifiable: true
217
217
 
@@ -73,7 +73,7 @@ Feature: Upgrade aka
73
73
  table:
74
74
  :tag:
75
75
  - os:darwin
76
- :output: .aka.zsh
76
+ :output: ".aka.zsh"
77
77
  modifiable: true
78
78
 
79
79
  """
@@ -101,7 +101,7 @@ Feature: Upgrade aka
101
101
  table:
102
102
  :tag:
103
103
  - os:darwin
104
- :output: .aka.zsh
104
+ :output: ".aka.zsh"
105
105
  modifiable: true
106
106
 
107
107
  """
@@ -131,7 +131,7 @@ Feature: Upgrade aka
131
131
  table:
132
132
  :tag:
133
133
  - os:darwin
134
- :output: .aka.zsh
134
+ :output: ".aka.zsh"
135
135
  modifiable: true
136
136
 
137
137
  """
data/lib/aka/shortcuts.rb CHANGED
@@ -106,7 +106,7 @@ module Aka
106
106
 
107
107
  def by_tag
108
108
  @shortcuts.inject({ :default => [] }) do |acc, (_, row)|
109
- if row.tag
109
+ if row.tag && !row.tag.empty?
110
110
  row.tag.each do |tag|
111
111
  acc[tag] ||= []
112
112
  acc[tag] << row
data/lib/aka/store.rb CHANGED
@@ -145,7 +145,7 @@ module Aka
145
145
  tags = ''
146
146
  end
147
147
  file.write(<<-EOS.gsub(/^ /, '')
148
- Keyword: #{row.shortcut}
148
+ Shortcut: #{row.shortcut}
149
149
  Description:
150
150
  #{row.description}
151
151
  Function (y/n): #{row.function ? 'y' : 'n'}
@@ -238,10 +238,11 @@ module Aka
238
238
  if txt =~ %r{^Function \(y/n\):\s*(y|n)}m
239
239
  row.function = ($1.strip == 'y')
240
240
  end
241
- if txt =~ /^Tags:(.+)$/
241
+ if txt =~ /^Tags:(.*)$/
242
242
  row.tag = $1.strip.split(',').map(&:strip)
243
+ row.delete_field('tag') if row.tag.empty?
243
244
  end
244
- if txt =~ /^Command:(.+)$/m
245
+ if txt =~ /^Command:(.*)$/m
245
246
  row.command = $1.strip
246
247
  end
247
248
  end
data/lib/aka/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Aka
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,97 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hsume2-aka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henry Hsu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-27 00:00:00.000000000 Z
11
+ date: 2014-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.5'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.5'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: 0.9.2
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.9.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rdoc
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: aruba
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: ronn
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: methadone
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ~>
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
89
  version: 1.3.1
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ~>
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: 1.3.1
97
97
  description: Manage Shell Keyboard Shortcuts
@@ -102,9 +102,9 @@ executables:
102
102
  extensions: []
103
103
  extra_rdoc_files: []
104
104
  files:
105
- - .gitignore
106
- - .ruby-version.example
107
- - .travis.yml
105
+ - ".gitignore"
106
+ - ".ruby-version.example"
107
+ - ".travis.yml"
108
108
  - Gemfile
109
109
  - Guardfile
110
110
  - LICENSE.txt
@@ -128,21 +128,6 @@ files:
128
128
  - lib/aka/configuration.rb
129
129
  - lib/aka/links.rb
130
130
  - lib/aka/man/.gitkeep
131
- - lib/aka/shortcuts.rb
132
- - lib/aka/store.rb
133
- - lib/aka/upgrader.rb
134
- - lib/aka/version.rb
135
- - man/aka-add.1.ronn
136
- - man/aka-edit.1.ronn
137
- - man/aka-generate.1.ronn
138
- - man/aka-link.1.ronn
139
- - man/aka-list.1.ronn
140
- - man/aka-remove.1.ronn
141
- - man/aka-show.1.ronn
142
- - man/aka-sync.1.ronn
143
- - man/aka-upgrade.1.ronn
144
- - man/aka.7.ronn
145
- - test/tc_something.rb
146
131
  - lib/aka/man/aka-add.1
147
132
  - lib/aka/man/aka-add.1.txt
148
133
  - lib/aka/man/aka-edit.1
@@ -163,6 +148,21 @@ files:
163
148
  - lib/aka/man/aka-upgrade.1.txt
164
149
  - lib/aka/man/aka.7
165
150
  - lib/aka/man/aka.7.txt
151
+ - lib/aka/shortcuts.rb
152
+ - lib/aka/store.rb
153
+ - lib/aka/upgrader.rb
154
+ - lib/aka/version.rb
155
+ - man/aka-add.1.ronn
156
+ - man/aka-edit.1.ronn
157
+ - man/aka-generate.1.ronn
158
+ - man/aka-link.1.ronn
159
+ - man/aka-list.1.ronn
160
+ - man/aka-remove.1.ronn
161
+ - man/aka-show.1.ronn
162
+ - man/aka-sync.1.ronn
163
+ - man/aka-upgrade.1.ronn
164
+ - man/aka.7.ronn
165
+ - test/tc_something.rb
166
166
  homepage: ''
167
167
  licenses:
168
168
  - MIT
@@ -173,17 +173,17 @@ require_paths:
173
173
  - lib
174
174
  required_ruby_version: !ruby/object:Gem::Requirement
175
175
  requirements:
176
- - - '>='
176
+ - - ">="
177
177
  - !ruby/object:Gem::Version
178
178
  version: '0'
179
179
  required_rubygems_version: !ruby/object:Gem::Requirement
180
180
  requirements:
181
- - - '>='
181
+ - - ">="
182
182
  - !ruby/object:Gem::Version
183
183
  version: '0'
184
184
  requirements: []
185
185
  rubyforge_project:
186
- rubygems_version: 2.0.14
186
+ rubygems_version: 2.2.2
187
187
  signing_key:
188
188
  specification_version: 4
189
189
  summary: Manage Shell Keyboard Shortcuts