watnow 0.0.1 → 0.0.2
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.
- data/lib/watnow.rb +6 -2
- data/lib/watnow/config.rb +1 -1
- data/lib/watnow/version.rb +1 -1
- metadata +2 -2
data/lib/watnow.rb
CHANGED
@@ -100,16 +100,20 @@ module Watnow
|
|
100
100
|
# Supported editors are TextMate, Vim & Sublime Text
|
101
101
|
def open_file_at_line(filename, line)
|
102
102
|
command = filename
|
103
|
+
editor = ENV['EDITOR']
|
103
104
|
|
104
105
|
if ENV['EDITOR'] =~ /mate/
|
105
106
|
command = "#{filename} --line #{line}"
|
107
|
+
# Remove TextMate -w (wait) option
|
108
|
+
editor =~ /(-\w*(w))/
|
109
|
+
editor = editor.gsub($1, $1.gsub($2, ''))
|
106
110
|
elsif ENV['EDITOR'] =~ /vi|vim/
|
107
111
|
command = "+#{line} #{filename}"
|
108
112
|
elsif ENV['EDITOR'] =~ /subl/
|
109
113
|
command = "#{filename}:#{line}"
|
110
114
|
end
|
111
115
|
|
112
|
-
Kernel.system("
|
116
|
+
Kernel.system("#{editor} #{command}")
|
113
117
|
end
|
114
118
|
|
115
119
|
# Remove line from given file
|
@@ -139,7 +143,7 @@ module Watnow
|
|
139
143
|
tag_spaces = Array.new(tag_spaces_count + 1).join(' ')
|
140
144
|
|
141
145
|
# Boolean. True if current user is being mentioned in the annotation line
|
142
|
-
is_mentioned = (annotation_line.mention.downcase == Config.username.downcase)
|
146
|
+
is_mentioned = !Config.username.empty? && (annotation_line.mention.downcase == Config.username.downcase)
|
143
147
|
|
144
148
|
# The actual outputting
|
145
149
|
display_text '[ ', 'green', is_mentioned
|
data/lib/watnow/config.rb
CHANGED
@@ -22,7 +22,7 @@ module Watnow::Config
|
|
22
22
|
|
23
23
|
# Merge defaults with custom options
|
24
24
|
# Add default constants
|
25
|
-
options = defaults.merge(custom_options)
|
25
|
+
options = custom_options ? defaults.merge(custom_options) : defaults
|
26
26
|
options['folder_ignore'].concat(FOLDER_IGNORE)
|
27
27
|
options['file_extension_ignore'].concat(FILE_EXTENSION_IGNORE)
|
28
28
|
options['patterns'].concat(PATTERNS)
|
data/lib/watnow/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: watnow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-09-
|
12
|
+
date: 2012-09-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: colored
|