Class: WhatTheGem::Gem
- Defined in:
- lib/whatthegem/gem.rb,
lib/whatthegem/gem/github.rb,
lib/whatthegem/gem/bundled.rb,
lib/whatthegem/gem/rubygems.rb
Defined Under Namespace
Classes: Bundled, GitHub, NoGem, RubyGems
Constant Summary collapse
- GITHUB_URI_PATTERN =
%r{^https?://(www\.)?github\.com/}
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #exists? ⇒ Boolean
-
#initialize(name) ⇒ Gem
constructor
A new instance of Gem.
Constructor Details
#initialize(name) ⇒ Gem
Returns a new instance of Gem.
23 24 25 |
# File 'lib/whatthegem/gem.rb', line 23 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
21 22 23 |
# File 'lib/whatthegem/gem.rb', line 21 def name @name end |
Class Method Details
.fetch(name) ⇒ Object
15 16 17 18 19 |
# File 'lib/whatthegem/gem.rb', line 15 def self.fetch(name) # Empty hash in rubygems info means it does not exist. # FIXME: Could be wrong in case of: a) private gems and b) "local-only" command checks new(name).then { |gem| gem.rubygems.info.empty? ? NoGem.new(name) : gem } end |
Instance Method Details
#exists? ⇒ Boolean
27 28 29 |
# File 'lib/whatthegem/gem.rb', line 27 def exists? true end |