Class: RailsAppGenerator::GemQuery

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_app_generator/gem_query.rb

Overview

GemQuery queries RubyGems for GemEntry.

Class Method Summary collapse

Class Method Details

.get(name) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/rails_app_generator/gem_query.rb', line 8

def get(name)
  gem_info = query_ruby_gems(name)

  return gem_info if gem_info

  return query_ruby_gems(name.gsub('_', '-')) if name.include?('_')
  return query_ruby_gems(name.gsub('-', '_')) if name.include?('-')

  abort "Cannot find GEM (#{name}) on RubyGems.org"
end