class Git::Daily::Config

Constants

SUBCOMMAND

Public Instance Methods

help() click to toggle source
# File lib/git-daily/command/config.rb, line 45
def help
  "config\tSet or show config"
end
run() click to toggle source
# File lib/git-daily/command/config.rb, line 49
def run
  subcommand = ARGV.shift
  if SUBCOMMAND.has_key?(subcommand)
    return SUBCOMMAND[subcommand].call
  end

  # show config
  r = `git config --list`.split(/\n/).select {|a| a[/^gitdaily/] }
  if r.empty?
    raise "git-daily: not initialized. please run: git daily init"
  else
    r.each do |s|
      puts s
    end
  end
  r
end
usage() click to toggle source
# File lib/git-daily/command/config.rb, line 67
      def usage
        <<-EOS
Usage: git daily config remote origin

Example:

    Remote name :
        git daily config remote origin

    Branch name of develop :
        git daily config develop develop

    Branch name of master :
        git daily config master master

    URL template for dump list (will dump commit hash instead of "%s") :
        GitWeb :  git daily config logurl "http://example.com/?p=repositories/example.git;a=commit;h=%s"
        GitHub :  git daily config logurl "https://github.com/sotarok/git-daily/commit/%s"
EOS
      end