Class: Diff::Strategy::Bundler
- Inherits:
-
Base
- Object
- Base
- Diff::Strategy::Bundler
show all
- Defined in:
- lib/diff/strategy/bundler.rb
Constant Summary
collapse
- UPDATES_LINE =
/^\+\s+(?<name>[0-9a-zA-Z\-_]+)\s\((?<version>[0-9\.]+)\)$/
- OLDS_LINE =
/^\-\s+(?<name>[0-9a-zA-Z\-_]+)\s\((?<version>[0-9\.]+)\)$/
Instance Attribute Summary
Attributes inherited from Base
#diff
Instance Method Summary
collapse
Methods inherited from Base
#exists?, #initialize, #output, #to_hash
Instance Method Details
#olds ⇒ Object
16
17
18
|
# File 'lib/diff/strategy/bundler.rb', line 16
def olds
@olds ||= (OLDS_LINE)
end
|
#to_markdown(gem_name, old, updated) ⇒ Object
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/diff/strategy/bundler.rb', line 20
def to_markdown(gem_name, old, updated)
gem = Gems.info(gem_name)
sleep 0.1 if gem.empty?
super
else
source_code_uri = gem["source_code_uri"] || gem["homepage_uri"]
compare_uri = "#{source_code_uri}/compare/v#{old}...v#{updated}"
[
"- Updated:",
"[`#{gem_name}`](#{source_code_uri})",
"[#{old} => #{updated}](#{compare_uri})"
].join(' ')
end
end
|
#updates ⇒ Object
12
13
14
|
# File 'lib/diff/strategy/bundler.rb', line 12
def updates
@updates ||= (UPDATES_LINE)
end
|