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-22.10.0 lib/gemsmith/tools/editor.rb
gemsmith-22.9.0 lib/gemsmith/tools/editor.rb
gemsmith-22.8.0 lib/gemsmith/tools/editor.rb
gemsmith-22.7.0 lib/gemsmith/tools/editor.rb
gemsmith-22.6.0 lib/gemsmith/tools/editor.rb
gemsmith-22.5.0 lib/gemsmith/tools/editor.rb
gemsmith-22.4.0 lib/gemsmith/tools/editor.rb
gemsmith-22.3.0 lib/gemsmith/tools/editor.rb
gemsmith-22.2.0 lib/gemsmith/tools/editor.rb
gemsmith-22.1.0 lib/gemsmith/tools/editor.rb
gemsmith-22.0.0 lib/gemsmith/tools/editor.rb
gemsmith-21.10.0 lib/gemsmith/tools/editor.rb
gemsmith-21.9.0 lib/gemsmith/tools/editor.rb
gemsmith-21.6.0 lib/gemsmith/tools/editor.rb
gemsmith-21.5.1 lib/gemsmith/tools/editor.rb
gemsmith-21.5.0 lib/gemsmith/tools/editor.rb
gemsmith-21.4.0 lib/gemsmith/tools/editor.rb
gemsmith-21.3.0 lib/gemsmith/tools/editor.rb
gemsmith-21.2.0 lib/gemsmith/tools/editor.rb
gemsmith-21.1.0 lib/gemsmith/tools/editor.rb