Class: PoolParty::Tasks
- Includes:
- Callbacks
- Defined in:
- lib/poolparty/tasks.rb
Instance Method Summary collapse
- #compiled_rakefile ⇒ Object
-
#define_tasks ⇒ Object
Define the tasks in the rakefile From the rakefile.
-
#initialize {|_self| ... } ⇒ Tasks
constructor
Setup and define all the tasks.
- #plugin_rakefiles ⇒ Object
- #reload! ⇒ Object
-
#run(cmd) ⇒ Object
Run the command on the local system.
-
#setup_application ⇒ Object
Basic setup action.
Methods included from Callbacks
Constructor Details
#initialize {|_self| ... } ⇒ Tasks
Setup and define all the tasks
6 7 8 |
# File 'lib/poolparty/tasks.rb', line 6 def initialize yield self if block_given? end |
Instance Method Details
#compiled_rakefile ⇒ Object
35 36 37 38 39 40 41 42 |
# File 'lib/poolparty/tasks.rb', line 35 def compiled_rakefile rake_str = [] Dir["#{File.(File.dirname(__FILE__))}/tasks/*.rake"].each { |t| rake_str << open(t).read } plugin_rakefiles @compiled_rakefile ||= eval(rake_str.join("\n")) # Not ideal end |
#define_tasks ⇒ Object
Define the tasks in the rakefile From the rakefile
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/poolparty/tasks.rb', line 11 def define_tasks # Run the command on the local system def run(cmd) Kernel.system(cmd.runnable) end # Basic setup action def setup_application @options ||= PoolParty.(ARGV.dup) end # Require the poolparty specific tasks compiled_rakefile desc "Reload the static variables" task :reload do reload! end true end |
#plugin_rakefiles ⇒ Object
43 44 45 |
# File 'lib/poolparty/tasks.rb', line 43 def plugin_rakefiles Dir["#{PoolParty.plugin_dir}/*/Rakefile"].each {|t| load t } end |
#reload! ⇒ Object
31 32 33 |
# File 'lib/poolparty/tasks.rb', line 31 def reload! @compiled_rakefile = nil end |