hookapp 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 233fe905ddbf24e32e2892b428408df0e39c2428abb2247a788cdc2430bb8112
4
- data.tar.gz: 00c3532d26a4ceeb05e955c9eced981368ef6ea6d599f2ddbbfa8cb356299b07
3
+ metadata.gz: 2823ba5fc9c9745eae3ab91e6bf0b27a88b8a030931e3c07c305d2c4aca52a70
4
+ data.tar.gz: fe130f18aac896e3058361fe26ee182cc4047c4db10e61df19c24bd24d715f87
5
5
  SHA512:
6
- metadata.gz: cc7557096f48961b2a7a4d63b1ad5af319d86e1f36565b0148eb28edbb3684733b270a0d70bfb2db52a4b9bed339c5dc7fe3ee891126b5180a6b85037296b344
7
- data.tar.gz: '09559ad538c6daacccc48198b07b699533891d98ba18c2f0f8de222784e6696ab71cdb4b8b0f8a7f67b69f08d2afbfe0495cda250ff09fa03a895ed01d53cb91'
6
+ metadata.gz: e35a77b9bc373266a5a26e653b9ad20ae2446d4ff9571fa56c054ba4bb782d4737f25d00294db5449534cc5482d94c8268b815c26799158709adc5314de10b18
7
+ data.tar.gz: f7659543f1fcda1e9f1183f071a469a1fe4e3b1bb22d68945630c652fb33194ae12e9d940504b8aff15e70e16136e6fdad56f1225c1172558e1916eb65c480b8
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hookapp (0.0.2)
4
+ hookapp (0.0.3)
5
5
  gli (= 2.19.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -64,3 +64,14 @@ The `--output_format=paths` option (abbr. `-o p`) combined with the `--files_onl
64
64
  You can open a hooked file or URL by running `hook select file1.md`. This will display a menu of all the hooks on `file1.md`, and entering the number of a selection will open that file in its default application.
65
65
 
66
66
  You can also open a file in the Hook GUI using `hook open file1.md`.
67
+
68
+ ### Changelog
69
+
70
+ #### 0.0.4
71
+
72
+ - Fix "conversion of nil into string" error
73
+
74
+ #### 0.0.3
75
+
76
+ - Fix to handle all url types, not just hook: and http:
77
+
@@ -18,15 +18,11 @@ class String
18
18
  def valid_hook
19
19
  if File.exist?(self)
20
20
  File.expand_path(self)
21
- elsif self =~ /\S+:\/\//
22
- self
21
+ elsif self =~ /^\[.*?\]\((.*?)\)$/
22
+ mdlink = $1
23
+ mdlink.valid_hook
23
24
  else
24
- if self =~ /^\[.*?\]\((.*?)\)$/
25
- mdlink = $1
26
- mdlink.valid_hook
27
- else
28
- nil
29
- end
25
+ self
30
26
  end
31
27
  end
32
28
 
@@ -42,15 +38,16 @@ class Hooker
42
38
  end
43
39
 
44
40
  def validate_format(fmt, options)
45
- valid_format_rx = options.map { |fmt| fmt.sub(/^(.)(.*)$/, '^\1(\2)?$') }
41
+ valid_format_rx = options.map { |format| format.sub(/^(.)(.*)$/, '^\1(\2)?$') }
46
42
  valid_format = false
47
43
  valid_format_rx.each_with_index do |rx, i|
48
44
  cmp = Regexp.new(rx, 'i')
49
45
  next unless fmt =~ cmp
46
+
50
47
  valid_format = options[i]
51
48
  break
52
49
  end
53
- return valid_format
50
+ valid_format
54
51
  end
55
52
 
56
53
  def bookmark_for(url)
@@ -218,9 +215,9 @@ class Hooker
218
215
  return true
219
216
  end tell
220
217
  APPLESCRIPT`
221
- return "Hook removed between #{source} and #{target}"
218
+ "Hook removed between #{source} and #{target}"
222
219
  else
223
- raise "Invalid number of URLs or files specified"
220
+ raise 'Invalid number of URLs or files specified'
224
221
 
225
222
  end
226
223
  end
@@ -228,9 +225,7 @@ class Hooker
228
225
  def link_all(args)
229
226
  args.each do |file|
230
227
  source = file.valid_hook
231
- link_to = args.dup.map(&:valid_url).reject { |url|
232
- url == source
233
- }
228
+ link_to = args.dup.map(&:valid_url).reject { |url| url == source }
234
229
  link_to.each do |url|
235
230
  `osascript <<'APPLESCRIPT'
236
231
  tell application "Hook"
@@ -1,3 +1,3 @@
1
1
  module Hook
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hookapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra