]> gitweb.fluxo.info Git - leap/leap_cli.git/commitdiff
added custom_vagrant_vm_line to Leapfile
authorelijah <elijah@riseup.net>
Mon, 28 Jan 2013 10:23:50 +0000 (02:23 -0800)
committerelijah <elijah@riseup.net>
Mon, 28 Jan 2013 10:23:50 +0000 (02:23 -0800)
bin/leap
lib/leap_cli/commands/project.rb
lib/leap_cli/commands/vagrant.rb
lib/leap_cli/leapfile.rb

index 5c0d2e8f491d1b27fcb9749e435bfb1965572ed0..0339d5414aa6bee79194bcb6666449b4ff5faeca 100755 (executable)
--- a/bin/leap
+++ b/bin/leap
@@ -39,9 +39,7 @@ module LeapCli::Commands
   extend GLI::App
   extend Forwardable
 
-  #
   # delegate highline methods to make them available to sub-commands
-  #
   @terminal = HighLine.new
   def_delegator :@terminal, :ask,    'self.ask'
   def_delegator :@terminal, :agree,  'self.agree'
@@ -50,9 +48,7 @@ module LeapCli::Commands
   def_delegator :@terminal, :color,  'self.color'
   def_delegator :@terminal, :list,   'self.list'
 
-  #
   # make config manager available as 'manager'
-  #
   def self.manager
     @manager ||= begin
       manager = LeapCli::Config::Manager.new
@@ -61,30 +57,27 @@ module LeapCli::Commands
     end
   end
 
-  #
   # make provider config available as 'provider'
-  #
   def self.provider
     manager.provider
   end
 
-  #
+  # make leapfile available as 'leapfile'
+  def self.leapfile
+    LeapCli::leapfile
+  end
+
   # info about leap command line suite
-  #
   program_desc       LeapCli::SUMMARY
   program_long_desc  LeapCli::DESCRIPTION
 
-  #
   # handle --version ourselves
-  #
   if ARGV.grep(/--version/).any?
     puts "leap #{LeapCli::VERSION}, ruby #{RUBY_VERSION}"
     exit(0)
   end
 
-  #
   # load commands and run
-  #
   commands_from('leap_cli/commands')
   exit run(ARGV)
 end
index 2f36bc5564e8a2252c3e06a59d5667fe1f687628..12d159bb7ecc960e9041c2df7cb3edd45e3e8634 100644 (file)
@@ -61,10 +61,13 @@ module LeapCli; module Commands
   end
 
   def leapfile_content(options)
-    %[@platform_directory_path = "#{options[:platform]}"
+    %[## Required:
+@platform_directory_path = "#{options[:platform]}"
+@leap_version = "#{LeapCli::VERSION}"
+
+## Optional:
+# @custom_vagrant_vm_line = "config.vm.boot_mode = :gui"
 ]
-    # leap_version = "#{LeapCli::VERSION}"
-    # platform_version = ""
   end
 
   GITIGNORE_CONTENT = <<EOS
index dfa32f2e42cb2ee933263a1f338df24fa2d1d5d2..02f47a4642c560539f7da9d30388b9273eb3706a 100644 (file)
@@ -113,6 +113,7 @@ module LeapCli; module Commands
         lines << %[    config.vm.box_url = "http://cloud.github.com/downloads/leapcode/minimal-debian-vagrant/leap-wheezy.box"]
         lines << %[    config.vm.network :hostonly, "#{node.ip_address}", :netmask => "#{netmask}"]
         lines << %[    config.vm.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]]
+        lines << %[    #{leapfile.custom_vagrant_vm_line}] if leapfile.custom_vagrant_vm_line
         lines << %[  end]
       end
     end
index 25598647f894f5a40053b626b6e55e5f6616a956..f369c9a262eefb80a7c5a051d0676f65ab46a01a 100644 (file)
@@ -12,6 +12,8 @@ module LeapCli
   class Leapfile
     attr_accessor :platform_directory_path
     attr_accessor :provider_directory_path
+    attr_accessor :custom_vagrant_vm_line
+    attr_accessor :leap_version
 
     def load
       directory = File.expand_path(find_in_directory_tree('Leapfile'))