Class: Jdt::Xampp

Inherits:
Thor
  • Object
show all
Defined in:
lib/jdt/xampp.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details



74
75
76
# File 'lib/jdt/xampp.rb', line 74

def self.banner(task, namespace = true, subcommand = false)
  "#{basename} #{task.formatted_usage(self, true, subcommand)}"
end

Instance Method Details

#configureObject



21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/jdt/xampp.rb', line 21

def configure
  # get xampp path
  xampp_path = ask("Enter fully qualified xampp path (default: C:\\xampp):")

  # set xampp path default value if it has not been set
  if (xampp_path == "")
    xampp_path = "c:\\xampp"
  end

  # store it
  XamppConfig.new.xampp_path = xampp_path
end

#install_joomlaObject



44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/jdt/xampp.rb', line 44

def install_joomla
  # setup paths
  joomla_path = options[:joomla_path]
  joomla_local_path = File.join(XamppConfig.new.htdocs_path, joomla_path)
  joomla_remote_path = "http://localhost/#{joomla_path}"
  joomla_zip_location = options[:joomla_zip_location]

  # download and unzip
  download_zip(joomla_zip_location, joomla_local_path)

  # open url
  Launchy.open(joomla_remote_path)
end

#pathObject



59
60
61
# File 'lib/jdt/xampp.rb', line 59

def path
  puts "Path is #{XamppConfig.new.xampp_path}"
end

#php_iniObject



35
36
37
38
39
# File 'lib/jdt/xampp.rb', line 35

def php_ini
  File.open("#{XamppConfig.new.xampp_path}/php/php.ini").each_line do |line|
    puts line
  end
end

#phpmyadminObject



64
65
66
# File 'lib/jdt/xampp.rb', line 64

def phpmyadmin
  Launchy.open("http://localhost/phpMyAdmin")
end

#webObject



69
70
71
72
# File 'lib/jdt/xampp.rb', line 69

def web
  link = "http://localhost/"
  Launchy.open(link)
end