Sha256: f7f535c66ae5552ec9d14452561fcadb7a0a29cdfb98b55c848395e65c1cc91d

Contents?: true

Size: 659 Bytes

Versions: 5

Compression:

Stored size: 659 Bytes

Contents

require "thor/group"

module Figaro
  class CLI < Thor
    class Install < Thor::Group
      include Thor::Actions

      class_option "path",
        aliases: ["-p"],
        default: "config/application.yml",
        desc: "Specify a configuration file path"

      def self.source_root
        File.expand_path("../install", __FILE__)
      end

      def create_configuration
        copy_file("application.yml", options[:path])
      end

      def ignore_configuration
        if File.exists?(".gitignore")
          append_to_file(".gitignore", <<-EOF)

# Ignore application configuration
/#{options[:path]}
EOF
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
figaro-1.2.0 lib/figaro/cli/install.rb
seielit-figaro-1.1.2 lib/figaro/cli/install.rb
figaro-1.1.1 lib/figaro/cli/install.rb
figaro-1.1.0 lib/figaro/cli/install.rb
figaro-1.0.0 lib/figaro/cli/install.rb