Module: Djin

Defined in:
lib/djin.rb,
lib/djin/cli.rb,
lib/djin/version.rb,
lib/djin/executor.rb,
lib/djin/interpreter.rb,
lib/djin/memory_cache.rb,
lib/djin/config_loader.rb,
lib/djin/entities/task.rb,
lib/djin/task_contract.rb,
lib/djin/entities/types.rb,
lib/djin/root_cli_parser.rb,
lib/djin/entities/file_config.rb,
lib/djin/extensions/hash_extensions.rb,
lib/djin/extensions/object_extensions.rb,
lib/djin/interpreter/base_command_builder.rb,
lib/djin/interpreter/local_command_builder.rb,
lib/djin/interpreter/docker_command_builder.rb,
lib/djin/interpreter/docker_compose_command_builder.rb

Defined Under Namespace

Modules: HashExtensions, ObjectExtensions, Types Classes: CLI, ConfigLoader, Error, Executor, FileConfig, Interpreter, MemoryCache, RootCliParser, Task, TaskContract

Constant Summary collapse

VERSION =
'0.10.0'

Class Method Summary collapse

Class Method Details

.cacheObject



58
59
60
# File 'lib/djin.rb', line 58

def self.cache
  @cache ||= MemoryCache.new
end

.load_tasks!(*file_paths) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/djin.rb', line 35

def self.load_tasks!(*file_paths)
  files = file_paths.presence || RootCliParser.parse![:files] || ['djin.yml']

  file_config = ConfigLoader.load_files!(*files)

  # TODO: Make all tasks be under 'tasks' key, passing only the tasks here
  tasks = Interpreter.load!(file_config)

  @task_repository = TaskRepository.new(tasks)
  CLI.load_tasks!(tasks)
rescue Djin::Interpreter::InvalidConfigurationError => e
  error_name = e.class.name.split('::').last
  abort("[#{error_name}] #{e.message}")
end

.root_pathObject



62
63
64
# File 'lib/djin.rb', line 62

def self.root_path
  Pathname.new File.expand_path(File.dirname(__FILE__) + '/..')
end

.task_repositoryObject



54
55
56
# File 'lib/djin.rb', line 54

def self.task_repository
  @task_repository ||= TaskRepository.new
end

.tasksObject



50
51
52
# File 'lib/djin.rb', line 50

def self.tasks
  task_repository.all
end