Sha256: 29df3a5ff0b2bb19e3d44a18c979d377bbdb2ed462ea69802e6d87d5d528b15a

Contents?: true

Size: 578 Bytes

Versions: 35

Compression:

Stored size: 578 Bytes

Contents

class Kubes::CLI::New
  class Helper < Kubes::CLI::Sequence
    argument :name, default: "custom"

    def self.options
      [
        [:force, aliases: ["y"], type: :boolean, desc: "Bypass overwrite are you sure prompt for existing files"],
      ]
    end
    options.each { |args| class_option(*args) }

  private
    def underscored_name
      name.include?("_helper") ? name : "#{name}_helper"
    end

  public
    def create_helper
      set_source("new/helper")
      file = "#{underscored_name}.rb"
      template "file.rb", ".kubes/helpers/#{file}"
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
kubes-0.7.5 lib/kubes/cli/new/helper.rb
kubes-0.7.4 lib/kubes/cli/new/helper.rb
kubes-0.7.3 lib/kubes/cli/new/helper.rb
kubes-0.7.2 lib/kubes/cli/new/helper.rb
kubes-0.7.1 lib/kubes/cli/new/helper.rb
kubes-0.7.0 lib/kubes/cli/new/helper.rb
kubes-0.6.8 lib/kubes/cli/new/helper.rb
kubes-0.6.7 lib/kubes/cli/new/helper.rb
kubes-0.6.6 lib/kubes/cli/new/helper.rb
kubes-0.6.5 lib/kubes/cli/new/helper.rb
kubes-0.6.4 lib/kubes/cli/new/helper.rb
kubes-0.6.3 lib/kubes/cli/new/helper.rb
kubes-0.6.2 lib/kubes/cli/new/helper.rb
kubes-0.6.1 lib/kubes/cli/new/helper.rb
kubes-0.6.0 lib/kubes/cli/new/helper.rb