Skip to content

Commit a6353a5

Browse files
committed
Merge pull request #1 from whitequark/master
Add Python3 support and custom colors for coverage marks
2 parents dc8b53b + 6b42f39 commit a6353a5

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

README.md

+14
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,20 @@ Type `Ruby Coverage` and hit enter.
1919
Usage
2020
-----
2121

22+
To set color of the marks, add the following to your **color scheme** settings array:
23+
24+
<dict>
25+
<key>name</key>
26+
<string>coverage.uncovered</string>
27+
<key>scope</key>
28+
<string>coverage.uncovered</string>
29+
<key>settings</key>
30+
<dict>
31+
<key>foreground</key>
32+
<string>#ffff33</string>
33+
</dict>
34+
</dict>
35+
2236
Ignoring Files
2337
--------------
2438

SublimeRubyCoverage.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ def run(self, edit):
4343

4444
project_root = find_project_root(filename)
4545
if not project_root:
46-
print 'Could not find coverage directory.'
46+
print('Could not find coverage directory.')
4747
return
4848

4949
relative_file_path = os.path.relpath(filename, project_root)
5050

51-
coverage_filename = '-'.join(explode_path(relative_file_path))[1:].replace(".rb", "_rb.csv")
51+
coverage_filename = '-'.join(explode_path(relative_file_path))[1:].replace(".rb", "_rb.csv").replace(".y", "_y.csv")
5252
coverage_filepath = os.path.join(project_root, 'coverage', 'sublime-ruby-coverage', coverage_filename)
5353

5454
# Clean up
@@ -81,11 +81,11 @@ def run(self, edit):
8181
# update highlighted regions
8282
if outlines:
8383
view.add_regions('SublimeRubyCoverage', outlines,
84-
'comment', 'bookmark', sublime.HIDDEN)
84+
'coverage.uncovered', 'bookmark', sublime.HIDDEN)
8585

8686
def file_exempt(self, filename):
8787
normalized_filename = os.path.normpath(filename).replace('\\', '/')
88-
print normalized_filename
88+
print(normalized_filename)
8989

9090
exempt = [r'/test/', r'/spec/', r'/features/', r'Gemfile$', r'Rakefile$', r'\.rake$',
9191
r'\.gemspec']
@@ -97,7 +97,7 @@ def file_exempt(self, filename):
9797
exempt.append(path)
9898

9999
for pattern in exempt:
100-
print pattern
100+
print(pattern)
101101
if re.compile(pattern).search(normalized_filename) is not None:
102102
return True
103103
return False

0 commit comments

Comments
 (0)