Class: Braid::Command
- Inherits:
-
Object
- Object
- Braid::Command
- Extended by:
- Operations::Git, Operations::Helpers
- Includes:
- Operations::Helpers, Operations::Mirror
- Defined in:
- lib/braid/command.rb
Direct Known Subclasses
Braid::Commands::Add, Braid::Commands::Diff, Braid::Commands::Remove, Braid::Commands::Setup, Braid::Commands::Update
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Operations::Git
git_checkout, git_commit, git_fetch, git_merge_base, git_merge_ours, git_merge_subtree, git_read_tree, git_remote_add, git_reset_hard, git_rev_parse, git_rm_r, local_changes?
Methods included from Operations::Helpers
clean_svn_revision, determine_target_commit, display_revision, extract_version, find_git_revision, validate_revision_option, validate_svn_revision, verify_version
Methods included from Operations::Mirror
#add_config_file, #check_merge_status, #create_work_branch, #fetch_remote, #find_remote, #get_current_branch, #get_work_head
Class Method Details
.msg(str) ⇒ Object
33 34 35 |
# File 'lib/braid/command.rb', line 33 def msg(str) puts str end |
.run(command, *args) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/braid/command.rb', line 10 def run(command, *args) raise Braid::Git::GitVersionTooLow unless verify_version("git", REQUIRED_GIT_VERSION) raise Braid::Git::GitSvnVersionTooLow unless verify_version("git svn", REQUIRED_GIT_SVN_VERSION) klass = Braid::Commands.const_get(command.to_s.capitalize) klass.new.run(*args) rescue Braid::Git::LocalChangesPresent => e msg "Local changes are present. You have to commit or stash them before running braid commands." msg "Exiting." rescue Braid::Git::GitVersionTooLow => e msg "This version of braid requires at least git #{REQUIRED_GIT_VERSION}. You have #{extract_version("git")}." msg "Exiting." rescue Braid::Git::GitSvnVersionTooLow => e msg "This version of braid requires at least git svn #{REQUIRED_GIT_SVN_VERSION}. You have #{extract_version("git svn")}." msg "Exiting." rescue => e puts "braid error: " + e. end |
Instance Method Details
#config ⇒ Object
38 39 40 |
# File 'lib/braid/command.rb', line 38 def config @config ||= Braid::Config.new end |