Class: FubuRake::MvcApp
- Inherits:
-
Object
- Object
- FubuRake::MvcApp
- Defined in:
- lib/fuburake.rb
Instance Method Summary collapse
-
#initialize(options) ⇒ MvcApp
constructor
A new instance of MvcApp.
- #to_task(name, args, description) ⇒ Object
Constructor Details
#initialize(options) ⇒ MvcApp
Returns a new instance of MvcApp.
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 |
# File 'lib/fuburake.rb', line 218 def initialize() cleaned_name = [:name].gsub('.', '_').downcase run_args = "--directory #{[:directory]}" if .has_key?(:config) run_args += " --config #{[:config]}" end if .has_key?(:application) run_args += " --application #{[:application]}" end if .has_key?(:build) run_args += " --build #{[:build]}" end task = Rake::Task.define_task "#{cleaned_name}:alias" do sh "bottles alias #{cleaned_name} #{[:directory]}" end task.add_description "Add the alias for #{[:directory]}" Rake::Task[:default].enhance ["#{cleaned_name}:alias"] to_task "#{cleaned_name}:restart", "restart #{cleaned_name}", "touch the web.config file to force ASP.Net hosting to recycle" to_task "#{cleaned_name}:run", "run #{run_args} --open", "run the application with Katana hosting" to_task "#{cleaned_name}:firefox", "run #{run_args} --browser Firefox --watched", "run the application with Katana hosting and 'watch' the application w/ Firefox" to_task "#{cleaned_name}:chrome", "run #{run_args} --browser Chrome --watched", "run the application with Katana hosting and 'watch' the application w/ Chrome" end |
Instance Method Details
#to_task(name, args, description) ⇒ Object
248 249 250 251 252 253 254 255 |
# File 'lib/fuburake.rb', line 248 def to_task(name, args, description) task = Rake::Task.define_task name do sh "fubu #{args}" end task.add_description description return task end |