Class: New

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

Overview

The New generator

Usage

gemmy new GEMNAME

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



11
12
13
# File 'lib/gemmy/new.rb', line 11

def self.source_root
  File.dirname(__FILE__)
end

Instance Method Details

#create_gemspec_fileObject



29
30
31
# File 'lib/gemmy/new.rb', line 29

def create_gemspec_file
  template("templates/gemspec.tt", "#{name}/#{name}.gemspec")
end

#create_lib_filesObject



20
21
22
23
# File 'lib/gemmy/new.rb', line 20

def create_lib_files
  template("templates/newgem.tt", "#{name}/lib/#{name}.rb")
  empty_directory "#{name}/lib/#{name}"
end

#create_test_filesObject



25
26
27
# File 'lib/gemmy/new.rb', line 25

def create_test_files
  template("templates/spec_helper.tt", "#{name}/spec/spec_helper.rb")
end

#work_out_optionsObject



15
16
17
18
# File 'lib/gemmy/new.rb', line 15

def work_out_options
  @using_executables = yes? "Are you using using executables in your project"
  @using_rspec = true
end