Class: XsdMappers::Mappers
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- XsdMappers::Mappers
- Includes:
- Thor::Actions
- Defined in:
- lib/thor/xsd_mappers.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
35 36 37 |
# File 'lib/thor/xsd_mappers.rb', line 35 def self.source_root File.dirname(__FILE__) end |
Instance Method Details
#create_lib_file ⇒ Object
43 44 45 46 |
# File 'lib/thor/xsd_mappers.rb', line 43 def create_lib_file filename = "#{name.underscore}_mapper.rb" template('templates/mapper_class.erb', File.join('app/mappers/', module_path, filename)) end |
#create_test_file ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/thor/xsd_mappers.rb', line 48 def create_test_file test = [:test_framework] == "test" ? :test : :spec filename = "#{name.underscore}_mapper_#{test}.rb" with_padding do template 'templates/mapper_spec.erb', File.join("#{test}/mappers/", module_path, filename) end end |
#module_path ⇒ Object
39 40 41 |
# File 'lib/thor/xsd_mappers.rb', line 39 def module_path [:module_name] ? [:module_name].underscore : "" end |