Skip to content

Commit

Permalink
Merge pull request #17 from testdouble/gemspec_in_gemfile_breaks
Browse files Browse the repository at this point in the history
Don't break when finding `gemspec` in the Gemfile
  • Loading branch information
Daniel-N-Huss authored Nov 24, 2023
2 parents 66f61d0 + 5e98b3d commit f60d4fb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/gem_dating/input.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def gems
end

def gem_line(line)
single_word_ruby_statements = %w{end else #}
single_word_ruby_statements = %w{end else # gemspec}
return if single_word_ruby_statements.include? line.strip

if line.start_with? "gem("
Expand Down
14 changes: 14 additions & 0 deletions test/input_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,18 @@ def test_conditional_versioning
gems = GemDating::Input.new(pasteboard).gems
assert_equal ["rails"], gems
end

def test_gemspec_in_gemfile
pasteboard = <<-TEXT
source "https://rubygems.org"
# Specify your gem's dependencies in gem_dating.gemspec
gemspec
gem "rake"
TEXT

gems = GemDating::Input.new(pasteboard).gems
assert_equal ["rake"], gems
end
end

0 comments on commit f60d4fb

Please sign in to comment.