Permalink
Browse files

Add workaround to fix gemspec recognition issue

 * fix #27
  • Loading branch information...
1 parent 7bdf075 commit 5e0a2f1937129385e9caa676d26b551224a175ba @gonzoyumo gonzoyumo committed Nov 19, 2012
Showing with 15 additions and 2 deletions.
  1. +6 −2 lib/gemnasium/parser.rb
  2. +9 −0 spec/gemnasium/parser_spec.rb
@@ -7,11 +7,15 @@ module Parser
extend Configuration
def self.gemfile(content)
- Gemnasium::Parser::Gemfile.new(content)
+ # Remove CR chars "\r" from content since it breaks Patterns matching
+ # TODO: Find something cleaner than this workaround
+ Gemnasium::Parser::Gemfile.new(content.gsub("\r",''))
end
def self.gemspec(content)
- Gemnasium::Parser::Gemspec.new(content)
+ # Remove CR chars "\r" from content since it breaks Patterns matching
+ # TODO: Find something cleaner than this workaround
+ Gemnasium::Parser::Gemspec.new(content.gsub("\r",''))
end
end
end
@@ -10,6 +10,11 @@
it "returns a Gemfile" do
Gemnasium::Parser.gemfile("").should be_a(Gemnasium::Parser::Gemfile)
end
+
+ it "removes CR chars from content" do
+ Gemnasium::Parser.gemfile("\r").content.match("\r").should be_nil
+ end
+
end
describe ".gemspec" do
@@ -21,5 +26,9 @@
it "returns a Gemspec" do
Gemnasium::Parser.gemspec("").should be_a(Gemnasium::Parser::Gemspec)
end
+
+ it "removes CR chars from content" do
+ Gemnasium::Parser.gemspec("\r").content.match("\r").should be_nil
+ end
end
end

0 comments on commit 5e0a2f1

Please sign in to comment.