Sha256: fbab3570a39f55cc5f8ca84d37ba3b3506432caff825b63add90d721d2f1bb68

Contents?: true

Size: 793 Bytes

Versions: 1

Compression:

Stored size: 793 Bytes

Contents

# coding: utf-8
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} > /dev/null 2>&1"
  end

  def self.usage
    message = <<-EOF.chomp
      NAME:
         space2underscore - Change the space into underscore

      USAGE:
         $ space2underscore new branch -c
         =>  Switched to the new branch 'new_branch’

        Or

        $ git branch -m $(space2underscore renamed branch)

      VERSION:
         #{Space2underscore::VERSION}

      OPTIONS:
         --create, -c         create the new branch
    EOF

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
space2underscore-0.3.7 lib/space2underscore.rb