Class: GemMiner::Miner

Inherits:
Object
  • Object
show all
Includes:
Logger
Defined in:
lib/gem-miner/miner.rb

Constant Summary collapse

GEMFILE_REGEX =
/gem[\s]+([^\n\;]+)/
GEMSPEC_REGEX =
/dependency[\s]+([^\n\;]+)/

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Logger

#log, logger=

Constructor Details

#initialize(github_search_query, github_client = GithubClient.new) ⇒ Miner

Returns a new instance of Miner.



18
19
20
21
# File 'lib/gem-miner/miner.rb', line 18

def initialize(github_search_query, github_client = GithubClient.new)
  @github_search_query = github_search_query
  @github_client = github_client
end

Class Method Details

.gems_for(github_search_query, github_token) ⇒ Object



14
15
16
# File 'lib/gem-miner/miner.rb', line 14

def self.gems_for(github_search_query, github_token)
  new(github_search_query, GithubClient.new(github_token)).gems
end

Instance Method Details

#gemsObject

A hash of gems and the repositories they are used in:

"pry '~> 1'" => ['reevoo/flakes', 'reevoo/gem-miner'],
...



29
30
31
# File 'lib/gem-miner/miner.rb', line 29

def gems
  @gems ||= collect_gems!
end