Sha256: 4ef164237b7cddd6ddec01e907393e0d99767d58d08cfacdf4066ddfcfd2e8a2

Contents?: true

Size: 733 Bytes

Versions: 13

Compression:

Stored size: 733 Bytes

Contents

# frozen_string_literal: true

##
# Usage example:
#
#   ConvenientService::Examples::Dry::Gemfile::Services::PrintShellCommand.result(text: "ls -a")
#
module ConvenientService
  module Examples
    module Dry
      module Gemfile
        module Services
          class PrintShellCommand
            include DryService::Config

            option :text
            option :out, default: -> { $stdout }

            contract do
              schema do
                required(:text).filled(:string)
              end
            end

            def result
              out.puts

              out.puts ::Paint["$ #{text}", :blue, :bold]

              success
            end
          end
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
convenient_service-0.12.0 lib/convenient_service/examples/dry/gemfile/services/print_shell_command.rb
convenient_service-0.11.0 lib/convenient_service/examples/dry/gemfile/services/print_shell_command.rb
convenient_service-0.10.1 lib/convenient_service/examples/dry/gemfile/services/print_shell_command.rb
convenient_service-0.10.0 lib/convenient_service/examples/dry/gemfile/services/print_shell_command.rb
convenient_service-0.9.0 lib/convenient_service/examples/dry/gemfile/services/print_shell_command.rb
convenient_service-0.8.0 lib/convenient_service/examples/dry/gemfile/services/print_shell_command.rb
convenient_service-0.7.0 lib/convenient_service/examples/dry/gemfile/services/print_shell_command.rb
convenient_service-0.6.0 lib/convenient_service/examples/dry/gemfile/services/print_shell_command.rb
convenient_service-0.5.0 lib/convenient_service/examples/dry/gemfile/services/print_shell_command.rb
convenient_service-0.4.0 lib/convenient_service/examples/dry/gemfile/services/print_shell_command.rb
convenient_service-0.3.1 lib/convenient_service/examples/dry/gemfile/services/print_shell_command.rb
convenient_service-0.3.0 lib/convenient_service/examples/dry/gemfile/services/print_shell_command.rb
convenient_service-0.2.1 lib/convenient_service/examples/dry/gemfile/services/print_shell_command.rb