Sha256: 82580accf6c34c347e63ae762a54e4de0d4505ffb13b6674fa5ba6a2cd9ff746

Contents?: true

Size: 1.44 KB

Versions: 20

Compression:

Stored size: 1.44 KB

Contents

# frozen_string_literal: true

require "bundler/gem_tasks"

##
# NOTE: Why not `bin` folder? It has a different purpose. It should contain "binaries/executables" that can be used by the end user.
# Search for `bin` in the following links for more info.
# - https://guides.rubygems.org/what-is-a-gem/
# - https://guides.rubygems.org/faqs/
#
task :confirm do
  require "tty-prompt"

  ##
  # NOTE: `ARGV[0]` contains `confirm` (this task name).
  #
  message = ARGV[1] || "Are you sure?"

  ##
  # NOTE: Why "tty-prompt"? No time to write, maintain complex, cross-platform bash scripts if you are a full-time application developer.
  #
  prompt = TTY::Prompt.new

  ##
  # NOTE: `prompt.yes?` docs.
  # https://github.com/piotrmurach/tty-prompt#25-yesno
  #
  yes = prompt.yes?(message)

  ##
  # NOTE: Use `echo $?` to debug exit code (0 means ok, 1 - error).
  #
  yes ? exit(0) : exit(1)
end

task :playground do
  require "irb"

  require_relative "env"

  require "convenient_service"

  require_relative "spec/support/convenient_service"
  require_relative "spec/support/convenient_service/rails" if ENV["APPRAISAL_NAME"] == "all" || ENV["APPRAISAL_NAME"].include?("rails")
  require_relative "spec/support/convenient_service/dry" if ENV["APPRAISAL_NAME"] == "all" || ENV["APPRAISAL_NAME"].include?("dry")

  ##
  # NOTE: Clears `ARGV` since both `rake` and `irb` uses it.
  # https://stackoverflow.com/a/2876645/12201472
  #
  ARGV.clear

  IRB.start(__FILE__)
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
convenient_service-0.17.0 Rakefile
convenient_service-0.16.0 Rakefile
convenient_service-0.15.0 Rakefile
convenient_service-0.14.0 Rakefile
convenient_service-0.13.0 Rakefile
convenient_service-0.12.0 Rakefile
convenient_service-0.11.0 Rakefile
convenient_service-0.10.1 Rakefile
convenient_service-0.10.0 Rakefile
convenient_service-0.9.0 Rakefile
convenient_service-0.8.0 Rakefile
convenient_service-0.7.0 Rakefile
convenient_service-0.6.0 Rakefile
convenient_service-0.5.0 Rakefile
convenient_service-0.4.0 Rakefile
convenient_service-0.3.1 Rakefile
convenient_service-0.3.0 Rakefile
convenient_service-0.2.1 Rakefile
convenient_service-0.2.0 Rakefile
convenient_service-0.1.0 Rakefile