class TachikomaAi::Strategies::Bundler::Gem
Constants
- GITHUB_URLS
- GITHUB_URL_JSON
- SPECS_PATH
Attributes
from[R]
name[R]
version[R]
Public Class Methods
new(name, from, version)
click to toggle source
# File lib/tachikoma_ai/strategies/bundler/gem.rb, line 15 def initialize(name, from, version) @name = name @from = from @version = version end
Public Instance Methods
compare_url()
click to toggle source
# File lib/tachikoma_ai/strategies/bundler/gem.rb, line 41 def compare_url Repository.new(github_url).compare(from, version) rescue => e "#{github_url}/compare/v#{from}...v#{version} (#{e.class} #{e})" end
github_url()
click to toggle source
# File lib/tachikoma_ai/strategies/bundler/gem.rb, line 25 def github_url if homepage.include?('github.com') homepage elsif GITHUB_URL_JSON.key?(name) "https://github.com/#{GITHUB_URL_JSON[name]}" end end
github_url?()
click to toggle source
# File lib/tachikoma_ai/strategies/bundler/gem.rb, line 21 def github_url? !github_url.nil? end
homepage()
click to toggle source
# File lib/tachikoma_ai/strategies/bundler/gem.rb, line 33 def homepage @homepage ||= if spec spec.homepage else "#{name}-#{version}" end end
Private Instance Methods
spec()
click to toggle source
# File lib/tachikoma_ai/strategies/bundler/gem.rb, line 49 def spec ::Gem::Specification.load(spec_path) end
spec_path()
click to toggle source
# File lib/tachikoma_ai/strategies/bundler/gem.rb, line 53 def spec_path "#{SPECS_PATH}/#{name}-#{version}.gemspec" end