Sha256: e41c02ff74247a35bb3efcaf405efee6926bd72d65cfca75e469afa7424740c7

Contents?: true

Size: 550 Bytes

Versions: 51

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.capture2 self.class.editor, specification.path
      end

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

      private

      attr_reader :shell
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
gemsmith-14.7.0 lib/gemsmith/gem/inspector.rb
gemsmith-14.6.0 lib/gemsmith/gem/inspector.rb
gemsmith-14.5.0 lib/gemsmith/gem/inspector.rb
gemsmith-14.4.0 lib/gemsmith/gem/inspector.rb
gemsmith-14.3.0 lib/gemsmith/gem/inspector.rb
gemsmith-14.2.0 lib/gemsmith/gem/inspector.rb
gemsmith-14.1.3 lib/gemsmith/gem/inspector.rb
gemsmith-14.1.2 lib/gemsmith/gem/inspector.rb
gemsmith-14.1.1 lib/gemsmith/gem/inspector.rb
gemsmith-14.1.0 lib/gemsmith/gem/inspector.rb
gemsmith-14.0.2 lib/gemsmith/gem/inspector.rb
gemsmith-14.0.1 lib/gemsmith/gem/inspector.rb
gemsmith-14.0.0 lib/gemsmith/gem/inspector.rb
gemsmith-13.8.0 lib/gemsmith/gem/inspector.rb
gemsmith-13.7.2 lib/gemsmith/gem/inspector.rb
gemsmith-13.7.1 lib/gemsmith/gem/inspector.rb
gemsmith-13.7.0 lib/gemsmith/gem/inspector.rb
gemsmith-13.6.0 lib/gemsmith/gem/inspector.rb
gemsmith-13.5.0 lib/gemsmith/gem/inspector.rb
gemsmith-13.4.0 lib/gemsmith/gem/inspector.rb