Sha256: dac16be5ea6252362c753aed0180d6cf0e7626d1335b1351775f163fe115e74e

Contents?: true

Size: 550 Bytes

Versions: 12

Compression:

Stored size: 550 Bytes

Contents

# frozen_string_literal: true

require "open3"

module Gemsmith
  module Gem
    # Provides the ability to investigate a gem in greater detail.
    class Inspector
      def self.editor
        ENV.fetch "EDITOR"
      end

      def initialize shell: Open3
        @shell = shell
      end

      def edit specification
        shell.capture3 self.class.editor, specification.path
      end

      def visit specification
        shell.capture3 "open", specification.homepage_url
      end

      private

      attr_reader :shell
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
gemsmith-15.5.0 lib/gemsmith/gem/inspector.rb
gemsmith-15.4.0 lib/gemsmith/gem/inspector.rb
gemsmith-15.3.0 lib/gemsmith/gem/inspector.rb
gemsmith-15.2.0 lib/gemsmith/gem/inspector.rb
gemsmith-15.1.1 lib/gemsmith/gem/inspector.rb
gemsmith-15.1.0 lib/gemsmith/gem/inspector.rb
gemsmith-15.0.0 lib/gemsmith/gem/inspector.rb
gemsmith-14.11.0 lib/gemsmith/gem/inspector.rb
gemsmith-14.10.1 lib/gemsmith/gem/inspector.rb
gemsmith-14.10.0 lib/gemsmith/gem/inspector.rb
gemsmith-14.9.0 lib/gemsmith/gem/inspector.rb
gemsmith-14.8.0 lib/gemsmith/gem/inspector.rb