Class: LazyFork::LazyForker
- Inherits:
-
Object
- Object
- LazyFork::LazyForker
- Defined in:
- lib/lazy_fork.rb
Instance Method Summary collapse
- #fork ⇒ Object
- #fork?(repo) ⇒ Boolean
-
#initialize(options) ⇒ LazyForker
constructor
A new instance of LazyForker.
- #source(repo) ⇒ Object
Constructor Details
#initialize(options) ⇒ LazyForker
Returns a new instance of LazyForker.
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/lazy_fork.rb', line 7 def initialize() @options = # tell the user they're being a lazy fork puts "You lazy forker..." unless Dir.exist?(LAZY_FORK_HOME) puts "Creating #{LAZY_FORK_HOME}..." Dir.mkdir LAZY_FORK_HOME end authenticate_client end |
Instance Method Details
#fork ⇒ Object
21 22 23 |
# File 'lib/lazy_fork.rb', line 21 def fork clone_repo(fork_repo(get_repo(ARGV.first)), ARGV.last) end |
#fork?(repo) ⇒ Boolean
25 26 27 |
# File 'lib/lazy_fork.rb', line 25 def fork?(repo) @client.repository(repo)[:fork] end |
#source(repo) ⇒ Object
29 30 31 32 |
# File 'lib/lazy_fork.rb', line 29 def source(repo) source_slug = @client.repository(repo)[:source][:full_name] Octokit::Repository.new(source_slug) end |