Skip to content
Browse files

for some reason, CONFIG is still being set... TODO... why?

  • Loading branch information...
1 parent c965050 commit 70447035190137beb6495ae4263b6ff2c711925f @wycats wycats committed
View
14 lib/buildtasks/manifest.rake
@@ -70,7 +70,7 @@ namespace :manifest do
# these directories are to be excluded unless CONFIG.load_"dirname" = true
dirnames = %w(debug tests fixtures protocols).reject do |k|
- env[:config][:"load_#{k}"]
+ CONFIG[:"load_#{k}"]
end
# loop through entries and hide those that do not below...
@@ -197,7 +197,7 @@ namespace :manifest do
end
# Add summary entry
- if env[:config][:load_tests]
+ if CONFIG[:load_tests]
manifest.add_entry 'tests/-index.json',
:composite => true,
:source_entries => test_entries,
@@ -211,7 +211,7 @@ namespace :manifest do
desc "scans for javascript files, annotates them and prepares combined entries for each output target"
task :javascript => :setup do |task, env|
manifest = env[:manifest]
- config = env[:config]
+ config = CONFIG
# select all original entries with with ext of css
entries = manifest.entries.select do |e|
@@ -260,7 +260,7 @@ namespace :manifest do
task :bundle_info => %w(setup) do |task, env|
target = env[:target]
manifest = env[:manifest]
- config = env[:config]
+ config = CONFIG
# Populate bundle_info for all dynamic_required frameworks.
# Add :debug_dynamic_required and :test_dynamic_required depending on
@@ -314,7 +314,7 @@ namespace :manifest do
desc "generates combined entries for javascript and css"
task :combine => %w(setup css javascript bundle_info bundle_loaded sass scss less) do |task, env|
manifest = env[:manifest]
- config = env[:config]
+ config = CONFIG
# sort entries...
css_entries = {}
@@ -453,7 +453,7 @@ namespace :manifest do
task :html => :setup do |task, env|
target = env[:target]
manifest = env[:manifest]
- config = env[:config]
+ config = CONFIG
# select all entries with proper extensions
known_ext = %w(rhtml erb haml)
@@ -552,7 +552,7 @@ namespace :manifest do
desc "creates transform entries for all css and Js entries to minify them if needed"
task :minify => %w(setup javascript bundle_info bundle_loaded css combine sass scss less) do |task, env|
manifest = env[:manifest]
- config = env[:config]
+ config = CONFIG
minify_css = config[:minify_css]
minify_css = config[:minify] if minify_css.nil?
View
2 lib/buildtasks/target.rake
@@ -13,7 +13,7 @@ namespace :target do
task :prepare do |task, env|
target = env[:target]
- config = env[:config]
+ config = CONFIG
project = env[:project]
# use url_root config or merge url_prefix + target_name
View
15 lib/sproutcore/models/manifest_entry.rb
@@ -97,7 +97,10 @@ def to_hash(opts={})
def hidden?; self[:hidden] ||= false; end
# Sets the entry's hidden? property to true
- def hide!; self[:hidden] = true; self; end
+ def hide!
+ self[:hidden] = true
+ self
+ end
# true if the manifest entry represents a composite resource built from
# one or more source entries. Composite resources will have their
@@ -107,6 +110,14 @@ def composite?; self[:composite]; end
# Marks the entry as composite. Returns self
def composite!; self[:composite] = true; self; end
+ def extension
+ @extension ||= File.extname(self[:filename])
+ end
+
+ def rootname
+ @rootname ||= self[:filename].sub(/#{extension}$/, '')
+ end
+
# The owner manifest
attr_accessor :manifest
@@ -211,7 +222,7 @@ def discover_build_directives!
target.begin_attr_changes
- self.required = []
+ self[:required] = []
entry = self.transform? ? self[:source_entry] : self
entry.scan_source(BUILD_DIRECTIVES_REGEX) do |matches|
# strip off any file ext
View
2 lib/sproutcore/models/project.rb
@@ -181,7 +181,7 @@ def target_for(target_name)
# new target
#
def add_target(target_name, target_type, options={})
- targets[target_name] = Target.new(target_name.to_sym,
+ targets[target_name.to_sym] = Target.new(target_name.to_sym,
target_type.to_sym, options.merge(:project => self))
end

0 comments on commit 7044703

Please sign in to comment.
Something went wrong with that request. Please try again.