Sha256: ac91a40bce6db6e45adf9a905562d11f45f958e437b9879bbe329fa3fd849056

Contents?: true

Size: 738 Bytes

Versions: 7

Compression:

Stored size: 738 Bytes

Contents

<% namespace do %>
  module CLI
    module Actions
      # Handles the config action.
      class Config
        include <%= configuration.project_class %>::Import[:kernel, :logger]

        def initialize(client: Configuration::Loader::CLIENT, **)
          super(**)
          @client = client
        end

        def call selection
          case selection
            when :edit then edit
            when :view then view
            else logger.error { "Invalid configuration selection: #{selection}." }
          end
        end

        private

        attr_reader :client

        def edit = kernel.system("$EDITOR #{client.current}")

        def view = kernel.system("cat #{client.current}")
      end
    end
  end
<% end %>

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
gemsmith-19.8.0 lib/gemsmith/templates/%project_name%/lib/%project_path%/cli/actions/config.rb.erb
gemsmith-19.7.0 lib/gemsmith/templates/%project_name%/lib/%project_path%/cli/actions/config.rb.erb
gemsmith-19.6.0 lib/gemsmith/templates/%project_name%/lib/%project_path%/cli/actions/config.rb.erb
gemsmith-19.5.2 lib/gemsmith/templates/%project_name%/lib/%project_path%/cli/actions/config.rb.erb
gemsmith-19.5.1 lib/gemsmith/templates/%project_name%/lib/%project_path%/cli/actions/config.rb.erb
gemsmith-19.5.0 lib/gemsmith/templates/%project_name%/lib/%project_path%/cli/actions/config.rb.erb
gemsmith-19.4.0 lib/gemsmith/templates/%project_name%/lib/%project_path%/cli/actions/config.rb.erb