Skip to content

Commit 726d615

Browse files
committed
Remove dependency on ActiveSupport strip_heredoc
Instead we can use features of modern Ruby - the squiggly heredoc (<<~). Which also means we no longer need ActiveSupport 🎉
1 parent b73fa3b commit 726d615

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

git_tracker.gemspec

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ Gem::Specification.new do |spec|
3232
spec.require_paths = ["lib"]
3333
spec.platform = Gem::Platform::RUBY
3434

35-
if RUBY_VERSION >= "2.5.0"
36-
spec.add_development_dependency "activesupport", "~> 6.0"
37-
else
38-
spec.add_development_dependency "activesupport", "~> 5.0"
39-
end
4035
spec.add_development_dependency "pry-byebug", "~> 3.9"
4136
spec.add_development_dependency "rake", "~> 13.0"
4237
spec.add_development_dependency "rspec", "~> 3.9"

spec/git_tracker/commit_message_spec.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
require "git_tracker/commit_message"
2-
require "active_support/core_ext/string/strip"
32

43
RSpec.describe GitTracker::CommitMessage do
54
include CommitMessageHelper
@@ -90,15 +89,17 @@ def stub_commit_message(story_text)
9089

9190
describe "#append" do
9291
let(:fake_file) { GitTracker::FakeFile.new }
92+
9393
before do
9494
allow(File).to receive(:open).and_yield(fake_file)
9595
end
96+
9697
def stub_original_commit_message(message)
9798
allow(File).to receive(:read) { message }
9899
end
99100

100101
it "handles no existing message" do
101-
commit_message_text = <<-COMMIT_MESSAGE.strip_heredoc
102+
commit_message_text = <<~COMMIT_MESSAGE
102103
103104
104105
[#8675309]
@@ -112,7 +113,7 @@ def stub_original_commit_message(message)
112113
end
113114

114115
it "preserves existing messages" do
115-
commit_message_text = <<-COMMIT_MESSAGE.strip_heredoc
116+
commit_message_text = <<~COMMIT_MESSAGE
116117
A first line
117118
118119
With more here
@@ -128,7 +129,7 @@ def stub_original_commit_message(message)
128129
end
129130

130131
it "preserves line breaks in comments" do
131-
commit_message_text = <<-COMMIT_MESSAGE.strip_heredoc
132+
commit_message_text = <<~COMMIT_MESSAGE
132133
133134
134135
[#8675309]

0 commit comments

Comments
 (0)