Permalink
Browse files

More better configs for debug

  • Loading branch information...
1 parent 8189e87 commit 9adbfa6500d21c5ef6bb9a8c46d2f11470dbc8a0 Charles Jolley committed Jan 23, 2009
Showing with 22 additions and 1 deletion.
  1. +5 −1 Buildfile
  2. +17 −0 lib/sproutcore/tools.rb
View
@@ -72,7 +72,11 @@ mode :debug do
# debug settings for sc-server
:serve_exceptions => true,
- :reload_project => true
+ :reload_project => true,
+
+ # set default build number in debug mode since caching is not used
+ # anyway.
+ :build_number => 'current'
end
View
@@ -64,6 +64,7 @@ def warn(description)
'--mode' => :optional,
'--environment' => :optional, # deprecated
'--logfile' => :optional,
+ '--build' => :optional,
['--verbose', '-v'] => false,
['--very-verbose', '-V'] => false })
def initialize(options, *args)
@@ -73,6 +74,7 @@ def initialize(options, *args)
def invoke(*args)
prepare_logger!
prepare_mode!
+ prepare_build_numbers!
super
end
@@ -88,6 +90,21 @@ def prepare_mode!(preferred_mode = 'production')
SC.build_mode = build_mode
end
+ def prepare_build_numbers!
+ return if (numbers = options.build).nil?
+ numbers = numbers.split(',').map { |n| n.split(':') }
+ if numbers.size==1 && numbers.first.size==1
+ SC.env.build_number = numbers.first.first
+ else
+ hash = {}
+ numbers.each do |pair|
+ key = pair[0]
+ key = "/#{key}" if !(key =~ /^\//)
+ hash[key.to_sym] = pair[1]
+ end
+ end
+ end
+
# Find the project...
attr_accessor :project
def requires_project!

0 comments on commit 9adbfa6

Please sign in to comment.