Class: HecksDomain::Generators::DomainFiles

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/hecks/domain/generators/domain_files.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ DomainFiles

Returns a new instance of DomainFiles.



8
9
10
11
12
13
14
# File 'lib/hecks/domain/generators/domain_files.rb', line 8

def initialize(args)
  @domain = args.first
  @gemspec = @domain.gemspec

  @domain_name = @domain.name.to_s.underscore
  super
end

Instance Attribute Details

#domainObject (readonly)

Returns the value of attribute domain.



6
7
8
# File 'lib/hecks/domain/generators/domain_files.rb', line 6

def domain
  @domain
end

#domain_nameObject (readonly)

Returns the value of attribute domain_name.



6
7
8
# File 'lib/hecks/domain/generators/domain_files.rb', line 6

def domain_name
  @domain_name
end

#gemspecObject (readonly)

Returns the value of attribute gemspec.



6
7
8
# File 'lib/hecks/domain/generators/domain_files.rb', line 6

def gemspec
  @gemspec
end

Class Method Details

.source_rootObject



18
19
20
# File 'lib/hecks/domain/generators/domain_files.rb', line 18

def self.source_root
  File.dirname(__FILE__) + '/../templates'
end

Instance Method Details

#write_gemspecObject



22
23
24
25
# File 'lib/hecks/domain/generators/domain_files.rb', line 22

def write_gemspec
  template('%domain_name%.gemspec.tt')
  directory('lib')
end