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-1.0.4 lib/terraspace/seeder/actions.rb
terraspace-1.0.3 lib/terraspace/seeder/actions.rb
terraspace-1.0.2 lib/terraspace/seeder/actions.rb
terraspace-1.0.1 lib/terraspace/seeder/actions.rb
terraspace-1.0.0 lib/terraspace/seeder/actions.rb
terraspace-0.7.2 lib/terraspace/seeder/actions.rb
terraspace-0.7.1 lib/terraspace/seeder/actions.rb
terraspace-0.7.0 lib/terraspace/seeder/actions.rb
terraspace-0.6.23 lib/terraspace/seeder/actions.rb
terraspace-0.6.22 lib/terraspace/seeder/actions.rb
terraspace-0.6.21 lib/terraspace/seeder/actions.rb
terraspace-0.6.20 lib/terraspace/seeder/actions.rb
terraspace-0.6.19 lib/terraspace/seeder/actions.rb
terraspace-0.6.18 lib/terraspace/seeder/actions.rb
terraspace-0.6.17 lib/terraspace/seeder/actions.rb
terraspace-0.6.16 lib/terraspace/seeder/actions.rb
terraspace-0.6.15 lib/terraspace/seeder/actions.rb
terraspace-0.6.13 lib/terraspace/seeder/actions.rb
terraspace-0.6.12 lib/terraspace/seeder/actions.rb
terraspace-0.6.11 lib/terraspace/seeder/actions.rb