Sha256: d86b35f456211dd57c1dde6f634fe5991261863db10f49818ecbf04cf8890d72

Contents?: true

Size: 762 Bytes

Versions: 17

Compression:

Stored size: 762 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, **dependencies
          super(**dependencies)

          @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

17 entries across 17 versions & 1 rubygems

Version Path
gemsmith-19.3.0 lib/gemsmith/templates/%project_name%/lib/%project_path%/cli/actions/config.rb.erb
gemsmith-19.2.0 lib/gemsmith/templates/%project_name%/lib/%project_path%/cli/actions/config.rb.erb
gemsmith-19.1.0 lib/gemsmith/templates/%project_name%/lib/%project_path%/cli/actions/config.rb.erb
gemsmith-19.0.0 lib/gemsmith/templates/%project_name%/lib/%project_path%/cli/actions/config.rb.erb
gemsmith-18.9.0 lib/gemsmith/templates/%project_name%/lib/%project_path%/cli/actions/config.rb.erb
gemsmith-18.8.0 lib/gemsmith/templates/%project_name%/lib/%project_path%/cli/actions/config.rb.erb
gemsmith-18.7.0 lib/gemsmith/templates/%project_name%/lib/%project_path%/cli/actions/config.rb.erb
gemsmith-18.6.0 lib/gemsmith/templates/%project_name%/lib/%project_path%/cli/actions/config.rb.erb
gemsmith-18.5.0 lib/gemsmith/templates/%project_name%/lib/%project_path%/cli/actions/config.rb.erb
gemsmith-18.4.0 lib/gemsmith/templates/%project_name%/lib/%project_path%/cli/actions/config.rb.erb
gemsmith-18.3.0 lib/gemsmith/templates/%project_name%/lib/%project_path%/cli/actions/config.rb.erb
gemsmith-18.2.0 lib/gemsmith/templates/%project_name%/lib/%project_path%/cli/actions/config.rb.erb
gemsmith-18.1.1 lib/gemsmith/templates/%project_name%/lib/%project_path%/cli/actions/config.rb.erb
gemsmith-18.1.0 lib/gemsmith/templates/%project_name%/lib/%project_path%/cli/actions/config.rb.erb
gemsmith-18.0.2 lib/gemsmith/templates/%project_name%/lib/%project_path%/cli/actions/config.rb.erb
gemsmith-18.0.1 lib/gemsmith/templates/%project_name%/lib/%project_path%/cli/actions/config.rb.erb
gemsmith-18.0.0 lib/gemsmith/templates/%project_name%/lib/%project_path%/cli/actions/config.rb.erb