lib/tmuxinator/cli.rb
# Open a config file, it's created if it doesn't exist already.
Open a config file, it's created if it doesn't exist already.
Open a config file it ' s created if it doesn ' t exist already .
def open *args
        exit!("You must specify a name for the new project") unless args.size > 0
        puts "warning: passing multiple arguments to open will be ignored" if args.size > 1
        @name = args.shift
        config_path = "#{root_dir}#{@name}.yml"
        unless File.exists?(config_path)
          template = File.exists?(user_config) ? user_config : sample_config
          erb      = ERB.new(File.read(template)).result(binding)
          tmp      = File.open(config_path, 'w') {|f| f.write(erb) }
        end
        system("$EDITOR #{config_path}")
      end
def open * args exit! ( "You must specify a name for the new project" ) unless args . size > 0 puts "warning: passing multiple arguments to open will be ignored" if args . size > 1 @name = args . shift config_path = "#{root_dir}#{@name}.yml" unless File . exists? ( config_path ) template = File . exists? ( user_config ) ? user_config : sample_config erb = ERB . new ( File . read ( template ) ) . result ( binding ) tmp = File . open ( config_path , 'w' ) { | f | f . write ( erb ) } end system ( "$EDITOR #{config_path}" ) end
Open a config file, it's created if it doesn't exist already.
Open a config file it ' s created if it doesn ' t exist already .
args
<not_specific>