Class: Cleon::Services::CloneCleon

Inherits:
Service
  • Object
show all
Defined in:
lib/cleon/services/clone_cleon.rb

Overview

The service copies Cleon source code into target gem sources,

changing the original Cleon name to the target gem name.

Constant Summary

Constants included from ArGuards

ArGuards::GuardModel

Instance Method Summary collapse

Methods inherited from Service

call

Constructor Details

#initialize(name) ⇒ CloneCleon

Returns a new instance of CloneCleon.

Parameters:

  • name (String)

    a gem name suitable for 'bundle gem NAME'



13
14
15
# File 'lib/cleon/services/clone_cleon.rb', line 13

def initialize(name)
  @home = Home.new(name)
end

Instance Method Details

#callObject



17
18
19
20
21
22
23
24
25
# File 'lib/cleon/services/clone_cleon.rb', line 17

def call
  Cleon.error! "Canceled. Cannot clone to an existing folder" if @home.exist?

  @log = @home.bundle
  generate_sources
  clone_sources
  # end
  @log
end