Module: Avm::EacRubyBase1::Sources::Base::Rake
- Defined in:
- lib/avm/eac_ruby_base1/sources/base/rake.rb
Constant Summary collapse
- RAKEFILE_BASENAME =
'Rakefile'- RAKE_TASKS_LINE_PARSER =
/\Arake\s+(\S+)\s+/.to_parser do |m| m[1] end
Instance Method Summary collapse
- #rake(*args) ⇒ Avm::EacRubyBase1::Sources::Base::BundleCommand
- #rake_task?(task_name) ⇒ Boolean
- #rake_tasks ⇒ Array<String>
- #rakefile_path ⇒ Pathname
Instance Method Details
#rake(*args) ⇒ Avm::EacRubyBase1::Sources::Base::BundleCommand
14 15 16 17 18 |
# File 'lib/avm/eac_ruby_base1/sources/base/rake.rb', line 14 def rake(*args) raise "File \"#{rakefile_path}\" does not exist" unless rakefile_path.exist? bundle('exec', 'rake', '--rakefile', rakefile_path, *args) end |
#rake_task?(task_name) ⇒ Boolean
26 27 28 |
# File 'lib/avm/eac_ruby_base1/sources/base/rake.rb', line 26 def rake_task?(task_name) rake_tasks.include?(task_name) end |
#rake_tasks ⇒ Array<String>
31 32 33 34 |
# File 'lib/avm/eac_ruby_base1/sources/base/rake.rb', line 31 def rake_tasks rake('--all', '--tasks').execute!.each_line .map { |line| RAKE_TASKS_LINE_PARSER.parse!(line) } end |
#rakefile_path ⇒ Pathname
21 22 23 |
# File 'lib/avm/eac_ruby_base1/sources/base/rake.rb', line 21 def rakefile_path path.join(RAKEFILE_BASENAME) end |