Sha256: 060f7e676bb2379ec00307260b3a4bd6bfcb4a0e6308e18a65c2ac5cbab3718a
Contents?: true
Size: 1.53 KB
Versions: 13
Compression:
Stored size: 1.53 KB
Contents
# frozen_string_literal: true require 'eac_cli/core_ext' require 'avm/eac_rails_base1/runner/code_runner' module Avm module Tools class Runner < ::EacRubyUtils::Console::DocoptRunner class EacRedmineBase0 < ::Avm::EacRailsBase1::Runner class ProjectRename runner_with ::Avm::EacRailsBase1::RunnerWith::Bundle do pos_arg :from pos_arg :to end def run bundle_run end def start_banner infov 'From', from infov 'To', to end delegate :from, :to, to: :parsed def bundle_args %w[exec rails runner] + [code] end def code <<~CODE from_arg = '#{from}' to_arg = '#{to}' project = ::Project.where(identifier: from_arg).first if project.present? puts "Project found: \#{project}" puts "Renaming..." project.update_column(:identifier, to_arg) puts "Renamed. Testing..." project = ::Project.where(identifier: to_arg).first if project puts "Project found: \#{project}" else fail "After rename: project not found with identifier \\"\#{to_arg}\\"" end else fail "Before rename: project not found with identifier \\"\#{from_arg}\\"" end CODE end end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems