Sha256: 26c08e689926d7f60b006b9cfcaa1cd923af0713c1f895f567c6ab550e967baa

Contents?: true

Size: 720 Bytes

Versions: 104

Compression:

Stored size: 720 Bytes

Contents

require "thor"

# Usage:
#
#    @actions = Actions.new
#    @actions.create_file("content", "/path/to/file.txt")
#
class Terraspace::Seeder
  class Actions
    # What's needed for a Thor::Group or "Sequence"
    # Gives us Thor::Actions commands like create_file
    include Thor::Actions
    include Thor::Base

    attr_reader :options # Thor requires options
    # Override Thor::Base initialize to set destination_root
    def initialize(options={})
      # Thor::Base.initialize(args = [], local_options = {}, config = {}) <= original signature
      options[:force] = options[:yes]
      super([], options)
      self.destination_root = Dir.pwd # Thor::Actions require destination_root to be set
    end
  end
end

Version data entries

104 entries across 104 versions & 1 rubygems

Version Path
terraspace-0.2.0 lib/terraspace/seeder/actions.rb
terraspace-0.1.2 lib/terraspace/seeder/actions.rb
terraspace-0.1.1 lib/terraspace/seeder/actions.rb
terraspace-0.1.0 lib/terraspace/seeder/actions.rb