Sha256: ba7b82b14777a29a94e90d6c13ea3802c34e303bf49dcf330328519cb3cff4cd

Contents?: true

Size: 766 Bytes

Versions: 12

Compression:

Stored size: 766 Bytes

Contents

# frozen_string_literal: true

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

            attribute :text, :string
            attribute :out, default: $stdout

            validates :text, presence: true if ConvenientService::Dependencies.support_has_result_params_validations_using_active_model_validations?

            def result
              out.puts

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

              success
            end
          end
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

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