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
17 18 19 20 21 |
# File 'lib/avm/eac_ruby_base1/sources/base/rake.rb', line 17 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
29 30 31 |
# File 'lib/avm/eac_ruby_base1/sources/base/rake.rb', line 29 def rake_task?(task_name) rake_tasks.include?(task_name) end |
#rake_tasks ⇒ Array<String>
34 35 36 37 |
# File 'lib/avm/eac_ruby_base1/sources/base/rake.rb', line 34 def rake_tasks rake('--all', '--tasks').execute!.each_line .map { |line| RAKE_TASKS_LINE_PARSER.parse!(line) } end |
#rakefile_path ⇒ Pathname
24 25 26 |
# File 'lib/avm/eac_ruby_base1/sources/base/rake.rb', line 24 def rakefile_path path.join(RAKEFILE_BASENAME) end |