class Dotenv::Sync::CommandLine

Public Class Methods

handle_no_command_error(command) click to toggle source
# File lib/dotenv/sync/command_line.rb, line 63
def self.handle_no_command_error(command)
  raise CommandNotFound.new
end
start(args) click to toggle source
Calls superclass method
# File lib/dotenv/sync/command_line.rb, line 9
def self.start(args)
  begin
    super(args)
  rescue Dotenv::Sync::CommandNotFound => e
    begin
      require "dotenv/cli"
      Dotenv::CLI.new(ARGV).run
    rescue Exception
      puts "dotenv gem not installed, falling back to dotenv-sync"
      super(["--help"])
    end
  end
end

Public Instance Methods

any() click to toggle source
# File lib/dotenv/sync/command_line.rb, line 24
def any()
  raise NotImplementedError.new
end
generate_key() click to toggle source
# File lib/dotenv/sync/command_line.rb, line 59
def generate_key
  Syncer.new(options).generate_key
end
merge() click to toggle source
# File lib/dotenv/sync/command_line.rb, line 45
def merge
  Syncer.new(options).merge
end
pull() click to toggle source
# File lib/dotenv/sync/command_line.rb, line 37
def pull
  Syncer.new(options).pull
end
push() click to toggle source
# File lib/dotenv/sync/command_line.rb, line 53
def push
  Syncer.new(options).push
end
sort(filename = Dotenv::Sync::Syncer::DEFAULT_SORT_FILE) click to toggle source
# File lib/dotenv/sync/command_line.rb, line 29
def sort(filename = Dotenv::Sync::Syncer::DEFAULT_SORT_FILE)
  Syncer.new.sort(filename)
end