Class: GemBootstrap::GitUtils

Inherits:
Object
  • Object
show all
Defined in:
lib/gem_bootstrap/git_utils.rb

Class Method Summary collapse

Class Method Details

.create_git_project(base_dir, gem_name) ⇒ Object

create new git repository from a given directory

Parameters:

  • base_dir (String)

    the starting directory

  • gem_name (String)

    the name of the gem we are creating



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/gem_bootstrap/git_utils.rb', line 8

def create_git_project(base_dir, gem_name)
  base_dir = expand_path(base_dir)
  files = MiscUtils.files base_dir: base_dir,
                          non_exts: %w(Gemfile
                                       Rakefile
                                       Guardfile
                                       LICENSE
                                       .rubocop.yml
                                       .yardopts
                                       .gitignore) << gem_name,
                          exts: %w(md rb gemspec yml),
                          recursive: true
  git_init(base_dir)
  git_add(base_dir, files)
end