sproutcore 0.9.12 → 0.9.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +4 -0
- data/bin/sc-build +1 -1
- data/lib/sproutcore/bundle.rb +6 -6
- data/lib/sproutcore/bundle_manifest.rb +44 -42
- data/lib/sproutcore/helpers/static_helper.rb +1 -0
- data/lib/sproutcore/library.rb +1 -1
- data/lib/sproutcore/version.rb +1 -1
- metadata +1 -1
data/History.txt
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
|
|
2
|
+
* Fixed critical bug that prevented sc-build from correctly compiling stylesheets and javascript.
|
|
3
|
+
|
|
4
|
+
== 0.9.12
|
|
5
|
+
|
|
2
6
|
* Added :include_method = :link|:import option to the stylesheets_for_client helper. This allows you to select between inclusion using link tags vs @import (which is required for OpenSocial apps) - Thanks Johannes Fahrenkrug!
|
|
3
7
|
|
|
4
8
|
* Proxy now handles posts and rewrites Location headers so they stay in the same domain. Should make this feature far more robust.
|
data/bin/sc-build
CHANGED
|
@@ -140,7 +140,7 @@ SC.logger.info("Selected Languages: #{languages.join(', ')}")
|
|
|
140
140
|
SC.logger.info('')
|
|
141
141
|
bundles.each do |bundle|
|
|
142
142
|
SC.logger.info("Building #{bundle.bundle_name} > #{bundle.build_root}...")
|
|
143
|
-
|
|
143
|
+
|
|
144
144
|
if clean
|
|
145
145
|
SC.logger.debug("~ Cleaning #{bundle.build_root}")
|
|
146
146
|
FileUtils.rm_rf(bundle.build_root)
|
data/lib/sproutcore/bundle.rb
CHANGED
|
@@ -74,7 +74,7 @@ module SproutCore
|
|
|
74
74
|
# The default build mode for bundles. This should be set once before you
|
|
75
75
|
# start using bundles. You can override this when you create a specific
|
|
76
76
|
# bundle, but that should not be the typical behavior
|
|
77
|
-
def self.build_mode; @build_mode || :development; end
|
|
77
|
+
def self.build_mode; (@build_mode || :development).to_sym; end
|
|
78
78
|
|
|
79
79
|
def self.build_mode=(new_mode); @build_mode = new_mode; end
|
|
80
80
|
|
|
@@ -210,7 +210,7 @@ module SproutCore
|
|
|
210
210
|
@index_root = opts[:index_root] || ['',(index_prefix.nil? || index_prefix.size==0) ? nil : index_prefix, bundle_name.to_s].compact.join('/')
|
|
211
211
|
|
|
212
212
|
# build_mode:: The build mode to use when combining resources.
|
|
213
|
-
@build_mode = opts[:build_mode] || SproutCore::Bundle.build_mode
|
|
213
|
+
@build_mode = (opts[:build_mode] || SproutCore::Bundle.build_mode || :development).to_sym
|
|
214
214
|
|
|
215
215
|
# layout: Path to the layout resource. This should be of the form
|
|
216
216
|
@layout = opts[:layout] || 'sproutcore:lib/index.rhtml'
|
|
@@ -253,7 +253,7 @@ module SproutCore
|
|
|
253
253
|
with_hidden = opts[:hidden] || :none
|
|
254
254
|
|
|
255
255
|
language = opts[:language] || preferred_language
|
|
256
|
-
mode = opts[:build_mode] || build_mode
|
|
256
|
+
mode = (opts[:build_mode] || build_mode).to_sym
|
|
257
257
|
manifest = manifest_for(language, mode)
|
|
258
258
|
|
|
259
259
|
ret = manifest.entries_for(resource_type)
|
|
@@ -280,7 +280,7 @@ module SproutCore
|
|
|
280
280
|
with_hidden = opts[:hidden] || :none
|
|
281
281
|
|
|
282
282
|
language = opts[:language] || preferred_language
|
|
283
|
-
mode = opts[:build_mode] || build_mode
|
|
283
|
+
mode = (opts[:build_mode] || build_mode).to_sym
|
|
284
284
|
manifest = manifest_for(language, mode)
|
|
285
285
|
|
|
286
286
|
ret = manifest.entry_for(resource_name)
|
|
@@ -359,7 +359,7 @@ module SproutCore
|
|
|
359
359
|
with_hidden = opts[:hidden] || :none
|
|
360
360
|
|
|
361
361
|
language = opts[:language] || preferred_language
|
|
362
|
-
mode = opts[:build_mode] || build_mode
|
|
362
|
+
mode = (opts[:build_mode] || build_mode).to_sym
|
|
363
363
|
manifest = manifest_for(language, mode)
|
|
364
364
|
|
|
365
365
|
ret = manifest.entries
|
|
@@ -627,7 +627,7 @@ module SproutCore
|
|
|
627
627
|
#
|
|
628
628
|
def strings_hash(opts={})
|
|
629
629
|
|
|
630
|
-
build_mode = opts[:build_mode] ||= build_mode
|
|
630
|
+
build_mode = (opts[:build_mode] ||= self.build_mode).to_sym
|
|
631
631
|
language = opts[:language] ||= preferred_language
|
|
632
632
|
key = [build_mode.to_s, language.to_s].join(':').to_sym
|
|
633
633
|
|
|
@@ -92,56 +92,53 @@ module SproutCore
|
|
|
92
92
|
|
|
93
93
|
# STEP 3: Handle special build modes...
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
95
|
+
# a. Merge fixture types into JS types & tests
|
|
96
|
+
if self.include_fixtures? && !entries[:fixture].nil?
|
|
97
|
+
entries[:javascript] = (entries[:javascript] || []) + entries[:fixture]
|
|
98
|
+
else
|
|
99
|
+
entries.delete(:fixture)
|
|
100
|
+
end
|
|
101
101
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
end
|
|
109
|
-
|
|
110
|
-
(entries[:stylesheet] ||= []).each do | entry |
|
|
111
|
-
setup_timestamp_token(entry)
|
|
112
|
-
end
|
|
113
|
-
|
|
114
|
-
# c. Rewrite the URLs for all other resources to go through the _src
|
|
115
|
-
# symlink
|
|
116
|
-
## -----> Already done build_entry_for()
|
|
117
|
-
# a. Combine the JS file paths into a single entry for the
|
|
118
|
-
# javascript.js
|
|
119
|
-
hide_composite = self.combine_javascript?
|
|
120
|
-
if (working = entries[:javascript]) && working.size>0
|
|
121
|
-
entry = build_entry_for('javascript.js', :javascript, working, hide_composite)
|
|
122
|
-
setup_timestamp_token(entry) if self.build_mode == :development
|
|
123
|
-
entry.hidden = true unless hide_composite
|
|
124
|
-
working << entry
|
|
102
|
+
# b. Rewrite all of the JS & CSS file paths and URLs to point to
|
|
103
|
+
# cached versions
|
|
104
|
+
# (Cached versions are written to _cache/filename-ctime.ext)
|
|
105
|
+
if self.build_mode == :development
|
|
106
|
+
(entries[:javascript] ||= []).each do | entry |
|
|
107
|
+
setup_timestamp_token(entry)
|
|
125
108
|
end
|
|
126
109
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
hide_composite = self.combine_stylesheets?
|
|
130
|
-
if (working = entries[:stylesheet]) && working.size>0
|
|
131
|
-
entry = build_entry_for('stylesheet.css', :stylesheet, working, hide_composite)
|
|
132
|
-
setup_timestamp_token(entry) if self.build_mode == :development
|
|
133
|
-
entry.hidden = true unless hide_composite
|
|
134
|
-
working << entry
|
|
110
|
+
(entries[:stylesheet] ||= []).each do | entry |
|
|
111
|
+
setup_timestamp_token(entry)
|
|
135
112
|
end
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
113
|
+
|
|
139
114
|
# c. Remove the entries for anything that is not JS, CSS, HTML or
|
|
140
|
-
# Resource
|
|
115
|
+
# Resource in non-development modes
|
|
141
116
|
else
|
|
142
117
|
entries.delete(:test)
|
|
143
118
|
end
|
|
144
119
|
|
|
120
|
+
# c. Rewrite the URLs for all other resources to go through the _src
|
|
121
|
+
# symlink
|
|
122
|
+
## -----> Already done build_entry_for()
|
|
123
|
+
# a. Combine the JS file paths into a single entry for the
|
|
124
|
+
# javascript.js
|
|
125
|
+
hide_composite = self.combine_javascript?
|
|
126
|
+
if (working = entries[:javascript]) && working.size>0
|
|
127
|
+
entry = build_entry_for('javascript.js', :javascript, working, hide_composite)
|
|
128
|
+
setup_timestamp_token(entry) if self.build_mode == :development
|
|
129
|
+
entry.hidden = true unless hide_composite
|
|
130
|
+
working << entry
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# b. Combine the CSS file paths into a single entry for the
|
|
134
|
+
# stylesheet.css
|
|
135
|
+
hide_composite = self.combine_stylesheets?
|
|
136
|
+
if (working = entries[:stylesheet]) && working.size>0
|
|
137
|
+
entry = build_entry_for('stylesheet.css', :stylesheet, working, hide_composite)
|
|
138
|
+
setup_timestamp_token(entry) if self.build_mode == :development
|
|
139
|
+
entry.hidden = true unless hide_composite
|
|
140
|
+
working << entry
|
|
141
|
+
end
|
|
145
142
|
|
|
146
143
|
# Save entries into hashes
|
|
147
144
|
@entries_by_type = entries
|
|
@@ -272,7 +269,12 @@ module SproutCore
|
|
|
272
269
|
# well
|
|
273
270
|
unless composite.nil?
|
|
274
271
|
composite.each { |x| x.hidden = true } if hide_composite
|
|
275
|
-
|
|
272
|
+
|
|
273
|
+
# IMPORTANT: The array of composite entries passed in here can come
|
|
274
|
+
# directly from the entries hash, which will later be updated to
|
|
275
|
+
# include the composite entry (ret) itself. Dup the array here to
|
|
276
|
+
# make sure the list of composites maintained here does not change.
|
|
277
|
+
ret.composite = composite.dup
|
|
276
278
|
end
|
|
277
279
|
|
|
278
280
|
# The build path is the build_root + the filename
|
data/lib/sproutcore/library.rb
CHANGED
|
@@ -276,7 +276,7 @@ module SproutCore
|
|
|
276
276
|
# The build modes wherein javascript should be combined.
|
|
277
277
|
def combine_stylesheets_build_modes
|
|
278
278
|
env = base_environment || {}
|
|
279
|
-
[(env[:combine_stylesheets] ||
|
|
279
|
+
[(env[:combine_stylesheets] || :production)].flatten
|
|
280
280
|
end
|
|
281
281
|
|
|
282
282
|
# ==== Returns
|
data/lib/sproutcore/version.rb
CHANGED