Class: Installer::Handler

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

Instance Method Summary collapse

Constructor Details

#initialize(source = nil) ⇒ Handler

Returns a new instance of Handler.



10
11
12
13
14
15
16
# File 'lib/commands/install.rb', line 10

def initialize(source = nil)
  if source.nil?
    @@source = "http://sedat.us/installer/"
  else
    @@source = source
  end
end

Instance Method Details

#get_composerObject



19
20
21
22
23
24
# File 'lib/commands/install.rb', line 19

def get_composer
  if ! File.exist?('/usr/local/bin/composer')
    system("curl -sS https://getcomposer.org/installer | php")
    system("mv composer.phar /usr/local/bin/composer")
  end
end

#get_laravel(path, project_name) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
# File 'lib/commands/install.rb', line 26

def get_laravel(path,project_name)
    if path.empty? or project_name.empty?
      puts "Please input a path and project_name"
    else
      include FileUtils
      cd(path, :verbose => false)
      system("composer create-project laravel/laravel #{project_name} --prefer-dist")
      system("clear")
      puts "Laravel project is created !"
    end
end