Class: Mkgem::Cli

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/mkgem/cli.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



8
9
10
# File 'lib/mkgem/cli.rb', line 8

def self.source_root
  File.expand_path('../../../templates', __FILE__)
end

Instance Method Details

#create_dirObject



16
17
18
# File 'lib/mkgem/cli.rb', line 16

def create_dir
  directory 'gem', name
end

#init_git_repoObject



26
27
28
29
30
# File 'lib/mkgem/cli.rb', line 26

def init_git_repo
  inside(name) do
    run('git init .')
  end
end

#install_depsObject



32
33
34
35
36
# File 'lib/mkgem/cli.rb', line 32

def install_deps
  inside(name) do
    run('bundle')
  end
end

#set_permissionsObject



20
21
22
23
24
# File 'lib/mkgem/cli.rb', line 20

def set_permissions
  inside(name) do
    chmod 'bin/console', 'a+x'
  end
end

#setupObject



12
13
14
# File 'lib/mkgem/cli.rb', line 12

def setup
  @name = name.underscore
end