Class: Rake::VegaTask
- Inherits:
-
TaskLib
- Object
- TaskLib
- Rake::VegaTask
- Defined in:
- lib/rake-latex/vega.rb
Instance Attribute Summary collapse
-
#dest ⇒ Object
Returns the value of attribute dest.
-
#language ⇒ Object
Returns the value of attribute language.
-
#name ⇒ Object
Returns the value of attribute name.
-
#output ⇒ Object
Returns the value of attribute output.
-
#source ⇒ Object
Returns the value of attribute source.
Instance Method Summary collapse
- #define ⇒ Object
- #init(name, language, output) ⇒ Object
-
#initialize(name, language, output) {|_self| ... } ⇒ VegaTask
constructor
A new instance of VegaTask.
Constructor Details
#initialize(name, language, output) {|_self| ... } ⇒ VegaTask
Returns a new instance of VegaTask.
37 38 39 40 41 |
# File 'lib/rake-latex/vega.rb', line 37 def initialize(name, language, output) init(name, language, output) yield self if block_given? define end |
Instance Attribute Details
#dest ⇒ Object
Returns the value of attribute dest.
35 36 37 |
# File 'lib/rake-latex/vega.rb', line 35 def dest @dest end |
#language ⇒ Object
Returns the value of attribute language.
35 36 37 |
# File 'lib/rake-latex/vega.rb', line 35 def language @language end |
#name ⇒ Object
Returns the value of attribute name.
35 36 37 |
# File 'lib/rake-latex/vega.rb', line 35 def name @name end |
#output ⇒ Object
Returns the value of attribute output.
35 36 37 |
# File 'lib/rake-latex/vega.rb', line 35 def output @output end |
#source ⇒ Object
Returns the value of attribute source.
35 36 37 |
# File 'lib/rake-latex/vega.rb', line 35 def source @source end |
Instance Method Details
#define ⇒ Object
57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/rake-latex/vega.rb', line 57 def define file @dest => [@source] do sh %{vega -l #{@language} -o #{@output} #{@source} #{@dest}} end task :listings => [@dest] task :clean do rm_f @dest end end |
#init(name, language, output) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/rake-latex/vega.rb', line 43 def init(name, language, output) source_ext = VEGA_EXTS[language] source_file = name.to_s.ext(source_ext) dest_ext = VEGA_EXTS[output] dest_file = name.to_s.ext(dest_ext) @name = dest_file @source = Rake.rootdir + source_file @dest = Rake.rootdir + dest_file @language = language @output = output end |