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.5.3 lib/terraspace/seeder/actions.rb
terraspace-0.5.2 lib/terraspace/seeder/actions.rb
terraspace-0.5.1 lib/terraspace/seeder/actions.rb
terraspace-0.5.0 lib/terraspace/seeder/actions.rb
terraspace-0.4.4 lib/terraspace/seeder/actions.rb
terraspace-0.4.3 lib/terraspace/seeder/actions.rb
terraspace-0.4.2 lib/terraspace/seeder/actions.rb
terraspace-0.4.1 lib/terraspace/seeder/actions.rb
terraspace-0.4.0 lib/terraspace/seeder/actions.rb
terraspace-0.3.6 lib/terraspace/seeder/actions.rb
terraspace-0.3.5 lib/terraspace/seeder/actions.rb
terraspace-0.3.4 lib/terraspace/seeder/actions.rb
terraspace-0.3.3 lib/terraspace/seeder/actions.rb
terraspace-0.3.2 lib/terraspace/seeder/actions.rb
terraspace-0.3.1 lib/terraspace/seeder/actions.rb
terraspace-0.3.0 lib/terraspace/seeder/actions.rb
terraspace-0.2.4 lib/terraspace/seeder/actions.rb
terraspace-0.2.3 lib/terraspace/seeder/actions.rb
terraspace-0.2.2 lib/terraspace/seeder/actions.rb
terraspace-0.2.1 lib/terraspace/seeder/actions.rb