Sha256: 743d84b6842e8cd030b97198c9124c4a363665e06c552160254d420d3cad8932

Contents?: true

Size: 750 Bytes

Versions: 1

Compression:

Stored size: 750 Bytes

Contents

require 'space2underscore/version'

module Space2underscore
  def self.convert(argv)
    argv.length == 1 ? argv[0].strip.gsub(/\s/,  '_') : argv.join('_')
  end

  def self.create_new_branch(underscore_include_sentence)
    system "git checkout -b #{underscore_include_sentence}"
  end

  def self.print_usage
    message = <<-EOF
      space2underscore #{Space2underscore::VERSION}
      Usage: space2underscore <branch name> <options>

      $ space2underscore new branch -c # Run with `--create` or `-c` options.
      =>  Switched to the new branch 'new_branch’

      Or

      $ git branch -m $(space2underscore renamed branch) # space2underscore has outputted to the standard output.
    EOF

    print message.gsub('      ', '')
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
space2underscore-0.3.3 lib/space2underscore.rb