Permalink
Browse files

Don't stip things that *look* like comments

We don't have any comments to be stripped anyhow. So if this later
becomes important, we'll bring it back.
  • Loading branch information...
stevenharman committed Feb 6, 2013
1 parent 3ab4224 commit 0bdea1808cd7501ee513a91ab48c22f192ec1b2f
Showing with 9 additions and 5 deletions.
  1. +1 −5 lib/git_tracker/standalone.rb
  2. +8 −0 spec/git_tracker/standalone_spec.rb
@@ -47,15 +47,11 @@ def ruby_executable
def inline_source(code, io)
code.each_line do |line|
- io << line unless comment?(line) || require_own_file?(line)
+ io << line unless require_own_file?(line)
end
io.puts ''
end
- def comment?(line)
- line =~ /^\s*#/
- end
-
def require_own_file?(line)
line =~ /^\s*require\s+["']git_tracker\//
end
@@ -45,6 +45,14 @@
expect(subject).to include('VERSION')
end
+ it 'inlines the message HEREDOC' do
+ expect(standalone).to include('#{preamble.strip}')
+ end
+
+ it 'inlines the shebang for the hook' do
+ expect(standalone).to include('#!/usr/bin/env bash')
+ end
+
it 'does not inline the standalone code' do
expect(subject).to_not include('module Standalone')
end

0 comments on commit 0bdea18

Please sign in to comment.