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-2.2.17 lib/terraspace/seeder/actions.rb
terraspace-2.2.16 lib/terraspace/seeder/actions.rb
terraspace-2.2.15 lib/terraspace/seeder/actions.rb
terraspace-2.2.14 lib/terraspace/seeder/actions.rb
terraspace-2.2.13 lib/terraspace/seeder/actions.rb
terraspace-2.2.12 lib/terraspace/seeder/actions.rb
terraspace-2.2.11 lib/terraspace/seeder/actions.rb
terraspace-2.2.10 lib/terraspace/seeder/actions.rb
terraspace-2.2.9 lib/terraspace/seeder/actions.rb
terraspace-2.2.8 lib/terraspace/seeder/actions.rb
terraspace-2.2.7 lib/terraspace/seeder/actions.rb
terraspace-2.2.6 lib/terraspace/seeder/actions.rb
terraspace-2.2.5 lib/terraspace/seeder/actions.rb
terraspace-2.2.4 lib/terraspace/seeder/actions.rb
terraspace-2.2.3 lib/terraspace/seeder/actions.rb
terraspace-2.2.2 lib/terraspace/seeder/actions.rb
terraspace-2.2.1 lib/terraspace/seeder/actions.rb
terraspace-2.2.0 lib/terraspace/seeder/actions.rb
terraspace-2.1.7 lib/terraspace/seeder/actions.rb
terraspace-2.1.6 lib/terraspace/seeder/actions.rb