Sha256: 51f6a3c5fd5243c18e65d280e557626a2e55f5b81dc0883febbb86cbcc3819d0

Contents?: true

Size: 584 Bytes

Versions: 10

Compression:

Stored size: 584 Bytes

Contents

require 'thor'
require 'drive_env'

module DriveEnv
  module Cli
    class Config < Thor
      desc 'set key value', ''
      def set(key, value)
        config.instance_variable_set("@#{key}", value)
        config.save
      end

      desc 'unset key', ''
      def unset(key)
        config.remove_instance_variable("@#{key}")
        config.save
      end

      desc 'list', ''
      def list
        puts YAML.dump(config)
      end

      no_commands do
        def config
          @config ||= DriveEnv::Config.load(options[:config])
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
drive_env-0.4.2 lib/drive_env/cli/config.rb
drive_env-0.4.1 lib/drive_env/cli/config.rb
drive_env-0.4.0 lib/drive_env/cli/config.rb
drive_env-0.3.1 lib/drive_env/cli/config.rb
drive_env-0.3.0 lib/drive_env/cli/config.rb
drive_env-0.2.2 lib/drive_env/cli/config.rb
drive_env-0.2.1 lib/drive_env/cli/config.rb
drive_env-0.2.0 lib/drive_env/cli/config.rb
drive_env-0.2.pre1 lib/drive_env/cli/config.rb
drive_env-0.1.0 lib/drive_env/cli/config.rb