Class: GithubTV::Sync
- Inherits:
-
Object
- Object
- GithubTV::Sync
- Defined in:
- lib/github-tv.rb
Instance Method Summary collapse
-
#initialize(client, target, source_repo) ⇒ Sync
constructor
A new instance of Sync.
- #run ⇒ Object
Constructor Details
#initialize(client, target, source_repo) ⇒ Sync
Returns a new instance of Sync.
31 32 33 34 35 |
# File 'lib/github-tv.rb', line 31 def initialize(client, target, source_repo) @client = client @target = target @source, @project = source_repo.split('/') end |
Instance Method Details
#run ⇒ Object
37 38 39 40 41 42 43 44 45 |
# File 'lib/github-tv.rb', line 37 def run if @client.repository? target_repo fast_forward puts "#@project fast-forwarded" else @client.fork source_repo, organization: @target puts "#@project forked" end end |