Module: GitTrend

Defined in:
lib/git_trend.rb,
lib/git_trend/cli.rb,
lib/git_trend/project.rb,
lib/git_trend/scraper.rb,
lib/git_trend/version.rb,
lib/git_trend/formatter.rb

Defined Under Namespace

Modules: Formatters Classes: CLI, Formatter, Project, ScrapeException, Scraper

Constant Summary collapse

VERSION =
"1.1.8"

Class Method Summary collapse

Class Method Details

.get(*opts) ⇒ Object

GitTrend.get GitTrend.get(‘ruby’) GitTrend.get(:ruby)

GitTrend.get(since: :weekly) GitTrend.get(since: :week) GitTrend.get(since: :w)

GitTrend.get(‘ruby’, ‘weekly’) GitTrend.get(:ruby, :weekly) GitTrend.get(language: :ruby, since: :weekly)



25
26
27
28
29
30
31
32
33
34
# File 'lib/git_trend.rb', line 25

def self.get(*opts)
  if opts[0].instance_of?(Hash)
    hash = opts[0]
    language = hash.key?(:language) ? hash[:language] : nil
    since = hash.key?(:since) ? hash[:since] : nil
    Scraper.new.get(language, since)
  else
    Scraper.new.get(*opts)
  end
end

.languagesObject



36
37
38
# File 'lib/git_trend.rb', line 36

def self.languages
  Scraper.new.languages
end