Class: Installer::Handler
- Inherits:
-
Object
- Object
- Installer::Handler
- Defined in:
- lib/commands/install.rb
Instance Method Summary collapse
- #get_composer ⇒ Object
- #get_laravel(path, project_name) ⇒ Object
-
#initialize(source = nil) ⇒ Handler
constructor
A new instance of Handler.
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_composer ⇒ Object
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 |