Class: Cloner

Inherits:
Object
  • Object
show all
Includes:
Github
Defined in:
lib/github_cloner.rb,
lib/github_cloner/version.rb

Defined Under Namespace

Modules: Version

Constant Summary

Constants included from Github

Github::GITHUB_URL_API

Instance Method Summary collapse

Methods included from Github

get_repos, git_config_name, inactive?, make_git_url

Constructor Details

#initialize(options) ⇒ Cloner

Returns a new instance of Cloner.



7
8
9
10
11
12
13
# File 'lib/github_cloner.rb', line 7

def initialize(options)
  @github_uname = options[:username]
  @mode = options[:method]
  @path = options[:path]
  @timeout = options[:timeout]
  @repos = options[:repos]
end

Instance Method Details

#cloneObject



15
16
17
# File 'lib/github_cloner.rb', line 15

def clone
  Github::get_repos(@github_uname, @mode, @timeout).each {|repo| system("git clone #{repo[:link]} #{@path}/#{repo[:inactive]}/#{repo[:name]}") if @repos.include? repo[:name] or @repos.empty? }
end