Class: Generators::Builder
- Inherits:
-
Templater::Generator
- Object
- Templater::Generator
- Generators::Builder
- Defined in:
- lib/staticmatic/builder.rb
Class Method Summary collapse
- .file(name, *args, &block) ⇒ Object
-
.source_root ⇒ Object
Define source and desintation.
-
.template(name, *args, &block) ⇒ Object
Override template to ask staticmatic for the correct extension to output.
Instance Method Summary collapse
Class Method Details
.file(name, *args, &block) ⇒ Object
25 26 27 28 29 |
# File 'lib/staticmatic/builder.rb', line 25 def self.file(name, *args, &block) return if args.first.include?('/sass/') args[1] = args[0].gsub('pages/', '') if (args[0] === args[1]) super(name, *args, &block) end |
.source_root ⇒ Object
Define source and desintation
10 |
# File 'lib/staticmatic/builder.rb', line 10 def self.source_root; Dir.pwd; end |
.template(name, *args, &block) ⇒ Object
Override template to ask staticmatic for the correct extension to output
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/staticmatic/builder.rb', line 14 def self.template(name, *args, &block) return if args.first.include?('/layout/') return if File.basename(args.first)[0,1] == '_' if (args[0] === args[1]) args[1] = args[0].gsub(File.extname(args.first), '').gsub('pages/', '') end super(name, *args, &block) end |
Instance Method Details
#destination_root ⇒ Object
11 |
# File 'lib/staticmatic/builder.rb', line 11 def destination_root; File.join(Dir.pwd, 'build'); end |