Class: Rubyfox::Server::CLI
- Inherits:
-
Thor
- Object
- Thor
- Rubyfox::Server::CLI
- Includes:
- Thor::Actions
- Defined in:
- lib/rubyfox/server/cli.rb
Class Method Summary collapse
Instance Method Summary collapse
- #configure(target_dir, template_dir) ⇒ Object
- #install(target_dir) ⇒ Object
- #start(target_dir) ⇒ Object
- #version ⇒ Object
Class Method Details
Instance Method Details
#configure(target_dir, template_dir) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/rubyfox/server/cli.rb', line 27 def configure(target_dir, template_dir) template_dir = File.(template_dir, Dir.pwd) target_dir = File.(target_dir, Dir.pwd) Dir["#{template_dir}/**/*"].each do |file| if File.file?(file) part = file.partition(template_dir).last target_file = "#{target_dir}/#{part}" if file_plain?(file) template file, target_file else copy_file file, target_file end end end end |
#install(target_dir) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/rubyfox/server/cli.rb', line 18 def install(target_dir) if File.exist?(target_dir) abort "Directory #{target_dir} already exists!" end directory self.class.source_root, target_dir end |
#start(target_dir) ⇒ Object
46 47 48 49 50 |
# File 'lib/rubyfox/server/cli.rb', line 46 def start(target_dir) inside(target_dir) do system "sh ./sfs2x.sh" end end |