Sha256: 120d2ccb8293158eee337f5f56f29390ebb6161db9ece73919dafb74a203e419
Contents?: true
Size: 1.13 KB
Versions: 3
Compression:
Stored size: 1.13 KB
Contents
require File.expand_path("command", __dir__) module Cardio class Commands # enhance standard rake command with some decko/card -specific options class RakeCommand < Command def initialize gem, command, args={} @command = command @task = "#{gem}:#{command}" @args = [args].flatten # opts = {} # if args.is_a? Array # Parser.new(rake_task, opts).parse!(args) # else # opts = args # end # @envs = Array(opts[:envs]) end def run commands.each do |cmd| # puts cmd # exit_with_child_status cmd result = `#{cmd}` process = $CHILD_STATUS puts result exit process.exitstatus unless process.success? end end def commands task_cmd = "bundle exec rake #{@task}" task_cmd += " -- #{@args.join ' '}" if !@args.empty? return [task_cmd] if !@envs || @envs.empty? # @envs.map do |env| # "env RAILS_ENV=#{env} #{task_cmd}" # end end end end end # require File.expand_path("rake_command/parser", __dir__)
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
card-1.104.2 | lib/cardio/commands/rake_command.rb |
card-1.104.1 | lib/cardio/commands/rake_command.rb |
card-1.104.0 | lib/cardio/commands/rake_command.rb |