Sha256: 2d0fa4dcb303cd6355dabf2b9e0aecbfd8fa9582a9b9de7fbbf1f0c0851cf53c

Contents?: true

Size: 445 Bytes

Versions: 55

Compression:

Stored size: 445 Bytes

Contents

# frozen_string_literal: true

require "dry/monads"

module Gemsmith
  module Tools
    # Views a gem within default browser.
    class Viewer
      include Import[:executor]
      include Dry::Monads[:result]

      def call specification
        executor.capture3("open", specification.homepage_url).then do |_stdout, stderr, status|
          status.success? ? Success(specification) : Failure(stderr)
        end
      end
    end
  end
end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
gemsmith-22.10.0 lib/gemsmith/tools/viewer.rb
gemsmith-22.9.0 lib/gemsmith/tools/viewer.rb
gemsmith-22.8.0 lib/gemsmith/tools/viewer.rb
gemsmith-22.7.0 lib/gemsmith/tools/viewer.rb
gemsmith-22.6.0 lib/gemsmith/tools/viewer.rb
gemsmith-22.5.0 lib/gemsmith/tools/viewer.rb
gemsmith-22.4.0 lib/gemsmith/tools/viewer.rb
gemsmith-22.3.0 lib/gemsmith/tools/viewer.rb
gemsmith-22.2.0 lib/gemsmith/tools/viewer.rb
gemsmith-22.1.0 lib/gemsmith/tools/viewer.rb
gemsmith-22.0.0 lib/gemsmith/tools/viewer.rb
gemsmith-21.10.0 lib/gemsmith/tools/viewer.rb
gemsmith-21.9.0 lib/gemsmith/tools/viewer.rb
gemsmith-21.6.0 lib/gemsmith/tools/viewer.rb
gemsmith-21.5.1 lib/gemsmith/tools/viewer.rb
gemsmith-21.5.0 lib/gemsmith/tools/viewer.rb
gemsmith-21.4.0 lib/gemsmith/tools/viewer.rb
gemsmith-21.3.0 lib/gemsmith/tools/viewer.rb
gemsmith-21.2.0 lib/gemsmith/tools/viewer.rb
gemsmith-21.1.0 lib/gemsmith/tools/viewer.rb