Sha256: 686c3e873d42f1d7807ec34dd6f2ed45716af76e5add249ecd153eb0f83f1bdd

Contents?: true

Size: 525 Bytes

Versions: 55

Compression:

Stored size: 525 Bytes

Contents

# frozen_string_literal: true

require "dry/monads"

module Gemsmith
  module Tools
    # Edits a gem within default editor.
    class Editor
      include Import[:executor, :environment]
      include Dry::Monads[:result]

      def call specification
        executor.capture3(client, specification.source_path.to_s).then do |_stdout, stderr, status|
          status.success? ? Success(specification) : Failure(stderr)
        end
      end

      private

      def client = environment.fetch("EDITOR")
    end
  end
end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
gemsmith-21.0.0 lib/gemsmith/tools/editor.rb
gemsmith-20.7.0 lib/gemsmith/tools/editor.rb
gemsmith-20.6.1 lib/gemsmith/tools/editor.rb
gemsmith-20.6.0 lib/gemsmith/tools/editor.rb
gemsmith-20.5.0 lib/gemsmith/tools/editor.rb
gemsmith-20.4.0 lib/gemsmith/tools/editor.rb
gemsmith-20.3.0 lib/gemsmith/tools/editor.rb
gemsmith-20.2.1 lib/gemsmith/tools/editor.rb
gemsmith-20.2.0 lib/gemsmith/tools/editor.rb
gemsmith-20.1.0 lib/gemsmith/tools/editor.rb
gemsmith-20.0.0 lib/gemsmith/tools/editor.rb
gemsmith-19.8.0 lib/gemsmith/tools/editor.rb
gemsmith-19.7.0 lib/gemsmith/tools/editor.rb
gemsmith-19.6.0 lib/gemsmith/tools/editor.rb
gemsmith-19.5.2 lib/gemsmith/tools/editor.rb
gemsmith-19.5.1 lib/gemsmith/tools/editor.rb
gemsmith-19.5.0 lib/gemsmith/tools/editor.rb
gemsmith-19.4.0 lib/gemsmith/tools/editor.rb
gemsmith-19.3.0 lib/gemsmith/tools/editor.rb
gemsmith-19.2.0 lib/gemsmith/tools/editor.rb