Module: Worktree
- Defined in:
- lib/worktree.rb,
lib/worktree/cli.rb,
lib/worktree/error.rb,
lib/worktree/config.rb,
lib/worktree/command.rb,
lib/worktree/project.rb,
lib/worktree/version.rb,
lib/worktree/db_manager.rb,
lib/worktree/command/add.rb,
lib/worktree/command/open.rb,
lib/worktree/feature/jira.rb,
lib/worktree/feature/tmux.rb,
lib/worktree/command/remove.rb,
lib/worktree/tab_completion.rb,
lib/worktree/command/configure.rb,
lib/worktree/feature/clone_dbs.rb,
lib/worktree/feature/copy_files.rb,
lib/worktree/tab_completion/cli.rb,
lib/worktree/command/cherry_pick.rb,
lib/worktree/command/remove_stale.rb,
lib/worktree/tab_completion/branch_completion.rb,
lib/worktree/tab_completion/worktree_completion.rb,
lib/worktree/tab_completion/project_dir_completion.rb,
lib/worktree/tab_completion/remote_branch_completion.rb
Defined Under Namespace
Modules: Command, Config, Feature, TabCompletion
Classes: CLI, DbManager, Error, Project
Constant Summary
collapse
- JIRA_ISSUE_ID_REGEX_TEMPLATE =
ENV.fetch('JIRA_ISSUE_ID_REGEX') { '^\w\-\d+' }
- JIRA_ISSUE_ID_REGEX =
Regexp.new(JIRA_ISSUE_ID_REGEX_TEMPLATE)
- VERSION =
'0.1.0'
Class Method Summary
collapse
Class Method Details
.git_for(p_dir) ⇒ Object
32
33
34
|
# File 'lib/worktree.rb', line 32
def git_for(p_dir)
Git.open("#{p_dir}/master", log: Worktree.logger)
end
|
.logger ⇒ Object
17
18
19
20
21
22
23
|
# File 'lib/worktree.rb', line 17
def logger
return @logger if defined?(@logger)
@logger = Logger.new(STDOUT)
@logger.level = Logger::INFO
@logger
end
|
.run_command(cmd, options = {}) ⇒ Object
25
26
27
28
29
30
|
# File 'lib/worktree.rb', line 25
def run_command(cmd, options = {})
command = TTY::Command.new(output: Worktree.logger)
command.run cmd, options
rescue TTY::Command::ExitError => e
raise Error, e.message
end
|