Skip to content

Commit

Permalink
do not enable assets by default
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee committed Aug 15, 2013
1 parent 951a230 commit 586934e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
8 changes: 5 additions & 3 deletions lib/nyara/config.rb
Expand Up @@ -61,8 +61,10 @@ def init
if self['public']
self['public'] = project_path(self['public'])
end

self['assets'] = project_path(self['assets'] || 'assets')

if self['assets']
self['assets'] = project_path(self['assets'])
end

self.logger = create_logger

Expand Down Expand Up @@ -116,7 +118,7 @@ def public_path path, strict=true
def views_path path, strict=true
path_under 'views', path, strict
end

# Get absoute path under assets path
#
# #### Options
Expand Down
3 changes: 2 additions & 1 deletion lib/nyara/nyara.rb
Expand Up @@ -114,8 +114,9 @@ def start_server
start_development_server port
end
end

def start_watch_assets
return if Config[:assets].blank?
Process.fork do
exec("bundle exec sass --scss --watch #{Config.assets_path('css')}:public/css --cache-location tmp/cache/sass")
end
Expand Down
4 changes: 2 additions & 2 deletions spec/config_spec.rb
Expand Up @@ -39,7 +39,7 @@ module Nyara
Config.init
assert_equal nil, Config['public']
assert_equal __dir__ + '/views', Config['views']
assert_equal __dir__ + '/assets', Config['assets']
assert_equal nil, Config['assets']
end

context "#project_path" do
Expand Down Expand Up @@ -86,7 +86,7 @@ module Nyara
path = Config.views_path '../..', false
assert_equal '/', path
end

it "#assets_path" do
Config.configure do
set :root, '/'
Expand Down

0 comments on commit 586934e

Please sign in to comment.