Class: Pandora::Commands::Create

Inherits:
Object
  • Object
show all
Defined in:
lib/pandora/commands/create.rb

Instance Method Summary collapse

Constructor Details

#initialize(path, name, organization, open_when_completed = false, verbose = true) ⇒ Create

Initializes the command

Parameters:

  • directory (String)

    where the framework will be created.

  • framework (String)

    name.

  • framework (String)

    organization.

  • open (Bool)

    the project once the command finishes.

  • verbose. (Bool)


18
19
20
21
22
23
24
25
# File 'lib/pandora/commands/create.rb', line 18

def initialize(path, name, organization, open_when_completed = false, verbose = true)
  @path = path
  @name = name
  @organization = organization
  @url = "https://github.com/frameworkoriented/template/archive/master.zip"
  @open_when_completed = open_when_completed
  @verbose = verbose
end

Instance Method Details

#executeObject

Executes the command



28
29
30
31
32
33
34
35
# File 'lib/pandora/commands/create.rb', line 28

def execute
  self.download_template
  self.unzip_template
  self.rename_files(self.framework_path)
  self.rename_files_content
  puts "Enjoy #{@name} FRAMEWORK! #yatusabes".colorize(:light_yellow) if @verbose
  system "open #{project_path}" if @open_when_completed
end