Michael Granger avatar Michael Granger committed a4e246d

Fix the template-path auto-discovery for some configurations.

Comments (0)

Files changed (2)

lib/strelka/app.rb

 	### to the 'app' section of the config that will be passed to you when the config
 	### is loaded.
 	def self::configure( config=nil )
-		if config
-			self.devmode          = true if config[:devmode]
-			self.app_glob_pattern = config[:app_glob_pattern]
-			self.local_data_dirs  = config[:local_data_dirs]
-		else
-			self.devmode          = $DEBUG ? true : false
-			self.app_glob_pattern = APP_GLOB_PATTERN
-			self.local_data_dirs  = LOCAL_DATA_DIRS
-		end
+		config = self.defaults.merge( config || {} )
+
+		self.devmode = config[:devmode] || $DEBUG
+		self.app_glob_pattern = config[:app_glob_pattern]
+		self.local_data_dirs  = config[:local_data_dirs]
 
 		self.log.info "Enabled developer mode." if self.devmode?
 	end

spec/strelka/app_spec.rb

 		end
 	end
 
+	it "uses the default local data directory if the config is present without that key" do
+		config = Configurability::Config.new( 'devmode: true' )
+		@app.configure( config )
+		@app.local_data_dirs.should == Strelka::App::CONFIG_DEFAULTS[:local_data_dirs]
+	end
+
 	it "closes async uploads with a 413 Request Entity Too Large by default" do
 		@req.headers.x_mongrel2_upload_start = 'an/uploaded/file/path'
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.