Sha256: 0ce53d871cad731066fcb6cfc529ce7838f2bfebff9c2e728c1827de3ecf0dc4

Contents?: true

Size: 439 Bytes

Versions: 11

Compression:

Stored size: 439 Bytes

Contents

require 'anvil/task'

module Projects
  class ListTask < Anvil::Task
    description 'List the projects that anvil can manage.'

    def initialize(options = {}); end

    def task
      Dir.chdir(Anvil::Config.base_projects_path) { list_projects(projects) }
    end

    def projects
      Dir.glob('*').select { |f| File.directory?(f) }.sort
    end

    def list_projects(names)
      printf("%s\n", names.join("\n"))
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
anvil-core-0.4.2 lib/tasks/projects/list_task.rb
anvil-core-0.4.1 lib/tasks/projects/list_task.rb
anvil-core-0.4.0 lib/tasks/projects/list_task.rb
anvil-core-0.3.2 lib/tasks/projects/list_task.rb
anvil-core-0.3.1 lib/tasks/projects/list_task.rb
anvil-core-0.3.0 lib/tasks/projects/list_task.rb
anvil-core-0.2.0 lib/tasks/projects/list_task.rb
anvil-core-0.1.0 lib/tasks/projects/list_task.rb
anvil-core-0.0.1.pre.alpha.3 lib/tasks/projects/list_task.rb
anvil-core-0.0.1.pre.alpha.2 lib/tasks/projects/list_task.rb
anvil-core-0.0.1.alpha.1 lib/tasks/projects/list_task.rb