sproutit-sproutcore 1.0.0.20090721125122 → 1.0.126
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/Rakefile +190 -29
- data/VERSION.yml +5 -0
- data/lib/sproutcore/tools/build.rb +1 -1
- data/lib/sproutcore.rb +9 -1
- metadata +6 -60
- data/gen/app/templates/apps/{target_name}/core.js +0 -27
- data/gen/app/templates/apps/{target_name}/english.lproj/loading.rhtml +0 -9
- data/gen/app/templates/apps/{target_name}/english.lproj/main_page.js +0 -22
- data/gen/app/templates/apps/{target_name}/english.lproj/strings.js +0 -15
- data/gen/app/templates/apps/{target_name}/main.js +0 -30
- data/gen/controller/templates/controllers/{filename}.js +0 -18
- data/gen/controller/templates/tests/controllers/{filename}.js +0 -15
- data/gen/framework/templates/frameworks/{target_name}/core.js +0 -21
- data/gen/framework/templates/frameworks/{target_name}/english.lproj/strings.js +0 -15
- data/gen/language/templates/{filename}/strings.js +0 -14
- data/gen/model/templates/fixtures/{filename}.js +0 -35
- data/gen/model/templates/models/{filename}.js +0 -19
- data/gen/model/templates/tests/models/{filename}.js +0 -15
- data/gen/project/templates/{filename}/Buildfile +0 -7
- data/gen/project/templates/{filename}/README +0 -7
- data/gen/test/templates/tests/{filename}.js +0 -15
- data/gen/theme/templates/themes/{target_name}/english.lproj/strings.js +0 -15
- data/gen/view/templates/tests/views/{filename}.js +0 -15
- data/gen/view/templates/views/{filename}.js +0 -18
- data/spec/buildtasks/manifest/localize_spec.rb +0 -97
- data/spec/buildtasks/manifest/prepare_build_tasks/combine_spec.rb +0 -246
- data/spec/buildtasks/manifest/prepare_build_tasks/css_spec.rb +0 -87
- data/spec/buildtasks/manifest/prepare_build_tasks/html_spec.rb +0 -175
- data/spec/buildtasks/manifest/prepare_build_tasks/javascript_spec.rb +0 -65
- data/spec/buildtasks/manifest/prepare_build_tasks/minify_spec.rb +0 -70
- data/spec/buildtasks/manifest/prepare_build_tasks/packed_spec.rb +0 -152
- data/spec/buildtasks/manifest/prepare_build_tasks/sass_spec.rb +0 -98
- data/spec/buildtasks/manifest/prepare_build_tasks/strings_spec.rb +0 -64
- data/spec/buildtasks/manifest/prepare_build_tasks/tests_spec.rb +0 -163
- data/spec/buildtasks/manifest/prepare_spec.rb +0 -43
- data/spec/fixtures/entry_for_project/apps/test_app/entry.txt +0 -0
- data/vendor/jsdoc/README.txt +0 -151
- data/vendor/jsdoc/changes.txt +0 -47
@@ -1,35 +0,0 @@
|
|
1
|
-
// ==========================================================================
|
2
|
-
// Project: <%= namespace_class_name %> Fixtures
|
3
|
-
// Copyright: ©<%= Time.now.year %> My Company, Inc.
|
4
|
-
// ==========================================================================
|
5
|
-
/*globals <%= namespace %> */
|
6
|
-
|
7
|
-
sc_require('models/<%= filename.ext('') %>');
|
8
|
-
|
9
|
-
<%= namespace_class_name %>.FIXTURES = [
|
10
|
-
|
11
|
-
// TODO: Add your data fixtures here.
|
12
|
-
// All fixture records must have a unique primary key (default 'guid'). See
|
13
|
-
// the example below.
|
14
|
-
|
15
|
-
// { guid: 1,
|
16
|
-
// firstName: "Michael",
|
17
|
-
// lastName: "Scott" },
|
18
|
-
//
|
19
|
-
// { guid: 2,
|
20
|
-
// firstName: "Dwight",
|
21
|
-
// lastName: "Schrute" },
|
22
|
-
//
|
23
|
-
// { guid: 3,
|
24
|
-
// firstName: "Jim",
|
25
|
-
// lastName: "Halpert" },
|
26
|
-
//
|
27
|
-
// { guid: 4,
|
28
|
-
// firstName: "Pam",
|
29
|
-
// lastName: "Beesly" },
|
30
|
-
//
|
31
|
-
// { guid: 5,
|
32
|
-
// firstName: "Ryan",
|
33
|
-
// lastName: "Howard" }
|
34
|
-
|
35
|
-
];
|
@@ -1,19 +0,0 @@
|
|
1
|
-
// ==========================================================================
|
2
|
-
// Project: <%= namespace_class_name %>
|
3
|
-
// Copyright: ©<%= Time.now.year %> My Company, Inc.
|
4
|
-
// ==========================================================================
|
5
|
-
/*globals <%= namespace %> */
|
6
|
-
|
7
|
-
/** @class
|
8
|
-
|
9
|
-
(Document your Model here)
|
10
|
-
|
11
|
-
@extends <%= base_class_name || 'SC.Record' %>
|
12
|
-
@version 0.1
|
13
|
-
*/
|
14
|
-
<%= namespace_class_name %> = <%= base_class_name || 'SC.Record' %>.extend(
|
15
|
-
/** @scope <%= namespace_class_name %>.prototype */ {
|
16
|
-
|
17
|
-
// TODO: Add your own code here.
|
18
|
-
|
19
|
-
}) ;
|
@@ -1,15 +0,0 @@
|
|
1
|
-
// ==========================================================================
|
2
|
-
// Project: <%= namespace_class_name %> Unit Test
|
3
|
-
// Copyright: ©<%= Time.now.year %> My Company, Inc.
|
4
|
-
// ==========================================================================
|
5
|
-
/*globals <%= namespace %> module test ok equals same stop start */
|
6
|
-
|
7
|
-
module("<%= namespace_class_name %>");
|
8
|
-
|
9
|
-
// TODO: Replace with real unit test for <%= class_name %>
|
10
|
-
test("test description", function() {
|
11
|
-
var expected = "test";
|
12
|
-
var result = "test";
|
13
|
-
equals(result, expected, "test should equal test");
|
14
|
-
});
|
15
|
-
|
@@ -1,7 +0,0 @@
|
|
1
|
-
# ===========================================================================
|
2
|
-
# Project: <%= namespace %>
|
3
|
-
# Copyright: ©<%= Time.now.year %> My Company, Inc.
|
4
|
-
# ===========================================================================
|
5
|
-
|
6
|
-
# Add initial buildfile information here
|
7
|
-
config :all, :required => :sproutcore
|
@@ -1,7 +0,0 @@
|
|
1
|
-
=============================================================================
|
2
|
-
Project: <%= namespace %>
|
3
|
-
Copyright: ©<%= Time.now.year %> My Company, Inc.
|
4
|
-
=============================================================================
|
5
|
-
|
6
|
-
TODO: Describe Your Project
|
7
|
-
|
@@ -1,15 +0,0 @@
|
|
1
|
-
// ==========================================================================
|
2
|
-
// Project: <%= namespace %> Unit Test
|
3
|
-
// Copyright: ©<%= Time.now.year %> My Company, Inc.
|
4
|
-
// ==========================================================================
|
5
|
-
/*globals <%= namespace %> module test ok equals same stop start */
|
6
|
-
|
7
|
-
module("<%= namespace %>");
|
8
|
-
|
9
|
-
// TODO: Replace with real unit test
|
10
|
-
test("test description", function() {
|
11
|
-
var expected = "test";
|
12
|
-
var result = "test";
|
13
|
-
equals(result, expected, "test should equal test");
|
14
|
-
});
|
15
|
-
|
@@ -1,15 +0,0 @@
|
|
1
|
-
// ==========================================================================
|
2
|
-
// Project: <%= namespace %> Strings
|
3
|
-
// Copyright: ©<%= Time.now.year %> My Company, Inc.
|
4
|
-
// ==========================================================================
|
5
|
-
/*globals <%= namespace %> */
|
6
|
-
|
7
|
-
// Place strings you want to localize here. In your app, use the key and
|
8
|
-
// localize it using "key string".loc(). HINT: For your key names, use the
|
9
|
-
// english string with an underscore in front. This way you can still see
|
10
|
-
// how your UI will look and you'll notice right away when something needs a
|
11
|
-
// localized string added to this file!
|
12
|
-
//
|
13
|
-
SC.stringsFor('English', {
|
14
|
-
// "_String Key": "Localized String"
|
15
|
-
}) ;
|
@@ -1,15 +0,0 @@
|
|
1
|
-
// ==========================================================================
|
2
|
-
// Project: <%= namespace_class_name %> Unit Test
|
3
|
-
// Copyright: ©<%= Time.now.year %> My Company, Inc.
|
4
|
-
// ==========================================================================
|
5
|
-
/*globals <%= namespace %> module test ok equals same stop start */
|
6
|
-
|
7
|
-
module("<%= namespace_class_name %>");
|
8
|
-
|
9
|
-
// TODO: Replace with real unit test for <%= namespace_class_name %>
|
10
|
-
test("test description", function() {
|
11
|
-
var expected = "test";
|
12
|
-
var result = "test";
|
13
|
-
equals(result, expected, "test should equal test");
|
14
|
-
});
|
15
|
-
|
@@ -1,18 +0,0 @@
|
|
1
|
-
// ==========================================================================
|
2
|
-
// Project: <%= namespace_class_name %>
|
3
|
-
// Copyright: ©<%= Time.now.year %> My Company, Inc.
|
4
|
-
// ==========================================================================
|
5
|
-
/*globals <%= namespace %> */
|
6
|
-
|
7
|
-
/** @class
|
8
|
-
|
9
|
-
(Document Your View Here)
|
10
|
-
|
11
|
-
@extends <%= base_class_name || 'SC.View' %>
|
12
|
-
*/
|
13
|
-
<%= namespace_class_name %> = <%= base_class_name || 'SC.View' %>.extend(
|
14
|
-
/** @scope <%= namespace_class_name %>.prototype */ {
|
15
|
-
|
16
|
-
// TODO: Add your own code here.
|
17
|
-
|
18
|
-
});
|
@@ -1,97 +0,0 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), 'spec_helper')
|
2
|
-
|
3
|
-
describe "manifest:localize" do
|
4
|
-
|
5
|
-
include SC::SpecHelpers
|
6
|
-
include SC::ManifestSpecHelpers
|
7
|
-
|
8
|
-
before do
|
9
|
-
std_before
|
10
|
-
end
|
11
|
-
|
12
|
-
def run_task
|
13
|
-
@manifest.prepare!
|
14
|
-
super('manifest:localize')
|
15
|
-
end
|
16
|
-
|
17
|
-
it "should run manifest:catalog && hide_buildfiles as prereq" do
|
18
|
-
should_run('manifest:catalog') { run_task }
|
19
|
-
should_run('manifest:hide_buildfiles') { run_task }
|
20
|
-
end
|
21
|
-
|
22
|
-
it "should not alter non-localized files" do
|
23
|
-
run_task
|
24
|
-
entry = entry_for('core.js')
|
25
|
-
entry.should_not be_nil
|
26
|
-
entry.should_not be_hidden
|
27
|
-
end
|
28
|
-
|
29
|
-
it "should mark all entries with localized? = true" do
|
30
|
-
run_task
|
31
|
-
@manifest.entries.each do |entry|
|
32
|
-
if entry.source_path =~ /\.lproj/
|
33
|
-
entry.localized?.should be_true
|
34
|
-
else
|
35
|
-
entry.localized?.should_not be_true
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
it "should remove foo.lproj from filename, build_path, and url of localized except for css and js files, which get 'lproj' instead" do
|
41
|
-
run_task
|
42
|
-
@manifest.entries.each do |entry|
|
43
|
-
next unless entry.localized?
|
44
|
-
new_filename = entry.source_path.match(/\.lproj\/(.+)$/).to_a[1]
|
45
|
-
if entry.ext == 'js'
|
46
|
-
new_filename = "lproj/#{new_filename}"
|
47
|
-
end
|
48
|
-
|
49
|
-
entry.filename.should eql(new_filename)
|
50
|
-
entry.build_path = File.join(@manifest.build_root, new_filename.split('/'))
|
51
|
-
entry.url = [@manifest.url_root, new_filename.split('/')].flatten.join('/')
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
it "should assign language to localized entries" do
|
56
|
-
run_task
|
57
|
-
# we just test this by spot checking to make sure any entry in the
|
58
|
-
# french.lproj actually has a french language code assigned...
|
59
|
-
@manifest.entries.each do |entry|
|
60
|
-
next unless entry.localize? && (entry.source_path =~ /french\.lproj/)
|
61
|
-
entry.language.should eql(:fr)
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
it "should not hide resources in current language" do
|
66
|
-
run_task
|
67
|
-
entry = entry_for('lproj/french-resource.js')
|
68
|
-
entry.localized?.should be_true
|
69
|
-
entry.should_not be_hidden
|
70
|
-
entry.language.should eql(:fr)
|
71
|
-
end
|
72
|
-
|
73
|
-
it "should not hide resource in preferred language that are not also found in current language" do
|
74
|
-
run_task
|
75
|
-
entry = entry_for('demo.html')
|
76
|
-
entry.localized?.should be_true
|
77
|
-
entry.language.should eql(:en)
|
78
|
-
entry.should_not be_hidden
|
79
|
-
end
|
80
|
-
|
81
|
-
it "should prefer resource in current language over those in preferred language" do
|
82
|
-
run_task
|
83
|
-
# a 'strings.js' is defined in english.lproj, french.lproj, & german
|
84
|
-
# this should use the french version since that one is current
|
85
|
-
entry = @manifest.entry_for('lproj/strings.js')
|
86
|
-
entry.localized?.should be_true
|
87
|
-
entry.should_not be_hidden
|
88
|
-
entry.language.should eql(:fr)
|
89
|
-
end
|
90
|
-
|
91
|
-
it "should hide resources in languages not part of current language or preferred language" do
|
92
|
-
run_task
|
93
|
-
entry = entry_for('lproj/german-resource.js')
|
94
|
-
entry.should be_hidden
|
95
|
-
end
|
96
|
-
|
97
|
-
end
|
@@ -1,246 +0,0 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), %w(.. spec_helper))
|
2
|
-
|
3
|
-
# Creates combined entries for javascript & css
|
4
|
-
describe "manifest:prepare_build_tasks:combine" do
|
5
|
-
|
6
|
-
include SC::SpecHelpers
|
7
|
-
include SC::ManifestSpecHelpers
|
8
|
-
|
9
|
-
before do
|
10
|
-
std_before
|
11
|
-
end
|
12
|
-
|
13
|
-
def run_task
|
14
|
-
# capture any log warnings...
|
15
|
-
@msg = capture('stderr') {
|
16
|
-
@manifest.prepare!
|
17
|
-
super('manifest:prepare_build_tasks:combine')
|
18
|
-
}
|
19
|
-
end
|
20
|
-
|
21
|
-
it "should run setup, javascript, css, & sass as prereq" do
|
22
|
-
%w(setup javascript css sass).each do |task_name|
|
23
|
-
should_run("manifest:prepare_build_tasks:#{task_name}") { run_task }
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
#######################################
|
28
|
-
# stylesheet.css support
|
29
|
-
#
|
30
|
-
describe "whem CONFIG.combine_stylesheets = true" do
|
31
|
-
|
32
|
-
before do
|
33
|
-
@config.combine_stylesheets = true
|
34
|
-
run_task
|
35
|
-
end
|
36
|
-
|
37
|
-
it "creates a combined stylesheet entry for each resource named in files" do
|
38
|
-
# spot check...
|
39
|
-
entry = entry_for 'stylesheet.css'
|
40
|
-
expected = entry_for('source/has_require.css', :entry_type => :css)
|
41
|
-
entry.source_entries.should include(expected)
|
42
|
-
|
43
|
-
expected = entry_for('source/no_require.css', :entry_type => :css)
|
44
|
-
entry.source_entries.should include(expected)
|
45
|
-
|
46
|
-
# Test that sass file is included...
|
47
|
-
expected = entry_for('source/demo2.css', :entry_type => :css)
|
48
|
-
entry.source_entries.should include(expected)
|
49
|
-
|
50
|
-
entry = entry_for 'bar.css'
|
51
|
-
expected = entry_for('source/sc_resource.css', :entry_type => :css)
|
52
|
-
entry.source_entries.should include(expected)
|
53
|
-
end
|
54
|
-
|
55
|
-
it "entries have a build_task = build:combine:css" do
|
56
|
-
entry_for('stylesheet.css').build_task.should == 'build:combine'
|
57
|
-
entry_for('bar.css').build_task.should == 'build:combine'
|
58
|
-
end
|
59
|
-
|
60
|
-
it "hides source entries" do
|
61
|
-
%w(stylesheet.css bar.css).each do |filename|
|
62
|
-
entry_for(filename).source_entries.each do |entry|
|
63
|
-
entry.should be_hidden
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
|
69
|
-
describe "adds ENTRY.ordered_entries propery with entries following load order" do
|
70
|
-
|
71
|
-
before do
|
72
|
-
@project = fixture_project :ordered_entries
|
73
|
-
end
|
74
|
-
|
75
|
-
it "orders entries as lproj/strings -> core -> utils -> others alphabetically without requires" do
|
76
|
-
|
77
|
-
@target = @project.target_for :no_requires
|
78
|
-
@buildfile = @target.buildfile
|
79
|
-
@config = @target.config
|
80
|
-
@manifest = @target.manifest_for(:language => :en)
|
81
|
-
@target.prepare! # make sure its ready for the manifest...
|
82
|
-
|
83
|
-
run_task
|
84
|
-
entry = @manifest.entry_for('stylesheet.css')
|
85
|
-
|
86
|
-
# get the expected set of ordered entries...based on contents of
|
87
|
-
# project...
|
88
|
-
expected = %w(source/a.css source/a/a.css source/a/b.css source/B.css source/b/a.css source/c.css)
|
89
|
-
|
90
|
-
entry.ordered_entries.should_not be_nil
|
91
|
-
filenames = entry.ordered_entries.map { |e| e.filename }
|
92
|
-
filenames.should eql(expected)
|
93
|
-
end
|
94
|
-
|
95
|
-
it "will override default order respecting ENTRY.required" do
|
96
|
-
|
97
|
-
@target = @project.target_for :with_requires
|
98
|
-
@buildfile = @target.buildfile
|
99
|
-
@config = @target.config
|
100
|
-
@manifest = @target.manifest_for(:language => :en)
|
101
|
-
@target.prepare! # make sure its ready for the manifest...
|
102
|
-
|
103
|
-
run_task
|
104
|
-
entry = @manifest.entry_for('stylesheet.css')
|
105
|
-
|
106
|
-
# get the expected set of ordered entries...based on contents of
|
107
|
-
# project...
|
108
|
-
expected = %w(source/c.css source/a.css source/b.css)
|
109
|
-
|
110
|
-
entry.ordered_entries.should_not be_nil
|
111
|
-
filenames = entry.ordered_entries.map { |e| e.filename }
|
112
|
-
filenames.should eql(expected)
|
113
|
-
end
|
114
|
-
|
115
|
-
end
|
116
|
-
|
117
|
-
end
|
118
|
-
|
119
|
-
describe "when CONFIG.combine_stylesheets = false" do
|
120
|
-
|
121
|
-
before do
|
122
|
-
@config.combine_stylesheets = false
|
123
|
-
run_task
|
124
|
-
end
|
125
|
-
|
126
|
-
it "still creates combined CSS entry" do
|
127
|
-
entry = entry_for('stylesheet.css')
|
128
|
-
entry.should_not be_nil
|
129
|
-
end
|
130
|
-
|
131
|
-
it "does not hide source CSS entries" do
|
132
|
-
entry = entry_for('stylesheet.css')
|
133
|
-
entry.should_not be_nil
|
134
|
-
entry.source_entries.each { |entry| entry.should_not be_hidden }
|
135
|
-
end
|
136
|
-
end
|
137
|
-
|
138
|
-
#######################################
|
139
|
-
# javascript.js support
|
140
|
-
#
|
141
|
-
|
142
|
-
describe "whem CONFIG.combine_javascript = true" do
|
143
|
-
|
144
|
-
before do
|
145
|
-
@config.combine_javascript = true
|
146
|
-
run_task
|
147
|
-
end
|
148
|
-
|
149
|
-
it "creates a combined JS entry for each resource named in files" do
|
150
|
-
# spot check...
|
151
|
-
entry = entry_for 'javascript.js'
|
152
|
-
expected = entry_for('source/has_require.js', :entry_type => :javascript)
|
153
|
-
entry.source_entries.should include(expected)
|
154
|
-
|
155
|
-
expected = entry_for('source/no_require.js', :entry_type => :javascript)
|
156
|
-
entry.source_entries.should include(expected)
|
157
|
-
|
158
|
-
entry = entry_for 'bar.js'
|
159
|
-
expected = entry_for('source/sc_resource.js', :entry_type => :javascript)
|
160
|
-
entry.source_entries.should include(expected)
|
161
|
-
end
|
162
|
-
|
163
|
-
it "entries have a build_task = build:combine:javascript" do
|
164
|
-
%w(javascript.js bar.js).each do |filename|
|
165
|
-
entry_for(filename).build_task.should == 'build:combine'
|
166
|
-
end
|
167
|
-
end
|
168
|
-
|
169
|
-
it "hides source entries" do
|
170
|
-
%w(javascript.js bar.js).each do |filename|
|
171
|
-
entry_for(filename).source_entries.each do |entry|
|
172
|
-
entry.should be_hidden
|
173
|
-
end
|
174
|
-
end
|
175
|
-
end
|
176
|
-
|
177
|
-
describe "adds ENTRY.ordered_entries propery with entries following load order" do
|
178
|
-
|
179
|
-
before do
|
180
|
-
@project = fixture_project :ordered_entries
|
181
|
-
end
|
182
|
-
|
183
|
-
it "orders entries as lproj/strings -> core -> utils -> others alphabetically without requires" do
|
184
|
-
|
185
|
-
@target = @project.target_for :no_requires
|
186
|
-
@buildfile = @target.buildfile
|
187
|
-
@config = @target.config
|
188
|
-
@manifest = @target.manifest_for(:language => :en)
|
189
|
-
@target.prepare! # make sure its ready for the manifest...
|
190
|
-
|
191
|
-
run_task
|
192
|
-
entry = @manifest.entry_for('javascript.js')
|
193
|
-
|
194
|
-
# get the expected set of ordered entries...based on contents of
|
195
|
-
# project...
|
196
|
-
expected = %w(source/lproj/strings.js source/core.js source/utils.js source/1.js source/a.js source/a/a.js source/a/b.js source/B.js source/b/a.js source/c.js)
|
197
|
-
|
198
|
-
entry.ordered_entries.should_not be_nil
|
199
|
-
filenames = entry.ordered_entries.map { |e| e.filename }
|
200
|
-
filenames.should eql(expected)
|
201
|
-
end
|
202
|
-
|
203
|
-
it "will override default order respecting ENTRY.required" do
|
204
|
-
|
205
|
-
@target = @project.target_for :with_requires
|
206
|
-
@buildfile = @target.buildfile
|
207
|
-
@config = @target.config
|
208
|
-
@manifest = @target.manifest_for(:language => :en)
|
209
|
-
@target.prepare! # make sure its ready for the manifest...
|
210
|
-
|
211
|
-
run_task
|
212
|
-
entry = @manifest.entry_for('javascript.js')
|
213
|
-
|
214
|
-
# get the expected set of ordered entries...based on contents of
|
215
|
-
# project... note that we require 'd', which should match 'lproj/d'
|
216
|
-
expected = %w(source/c.js source/a.js source/lproj/d.js source/b.js)
|
217
|
-
|
218
|
-
entry.ordered_entries.should_not be_nil
|
219
|
-
filenames = entry.ordered_entries.map { |e| e.filename }
|
220
|
-
filenames.should eql(expected)
|
221
|
-
end
|
222
|
-
|
223
|
-
end
|
224
|
-
|
225
|
-
end
|
226
|
-
|
227
|
-
describe "when CONFIG.combine_javascript = false" do
|
228
|
-
|
229
|
-
before do
|
230
|
-
@config.combine_javascript = false
|
231
|
-
run_task
|
232
|
-
end
|
233
|
-
|
234
|
-
it "still creates combined JS entry" do
|
235
|
-
entry = entry_for('javascript.js')
|
236
|
-
entry.should_not be_nil
|
237
|
-
end
|
238
|
-
|
239
|
-
it "does not hide source JS entries" do
|
240
|
-
entry = entry_for('javascript.js')
|
241
|
-
entry.should_not be_nil
|
242
|
-
entry.source_entries.each { |entry| entry.should_not be_hidden }
|
243
|
-
end
|
244
|
-
end
|
245
|
-
|
246
|
-
end
|
@@ -1,87 +0,0 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), %w(.. spec_helper))
|
2
|
-
|
3
|
-
# This task prepares a single CSS entry for every untagged source entry.
|
4
|
-
describe "manifest:prepare_build_tasks:css" do
|
5
|
-
|
6
|
-
include SC::SpecHelpers
|
7
|
-
include SC::ManifestSpecHelpers
|
8
|
-
|
9
|
-
before do
|
10
|
-
std_before
|
11
|
-
end
|
12
|
-
|
13
|
-
def run_task
|
14
|
-
@manifest.prepare!
|
15
|
-
super('manifest:prepare_build_tasks:css')
|
16
|
-
end
|
17
|
-
|
18
|
-
it "should run manifest:prepare_build_tasks:setup as prereq" do
|
19
|
-
should_run('manifest:prepare_build_tasks:setup') { run_task }
|
20
|
-
end
|
21
|
-
|
22
|
-
# This rewriting is done to make sure source entries are disambiguated from
|
23
|
-
# the generated stylesheet.css that will live at the root level
|
24
|
-
it "rewrites all css entries to begin with 'source/...'" do
|
25
|
-
run_task
|
26
|
-
entries = @manifest.entries.select { |e| e.entry_type == :css }
|
27
|
-
entries.each do |entry|
|
28
|
-
%w(filename url build_path).each do |key|
|
29
|
-
entry[key].should =~ /source\//
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
it "creates a transform entry for each css entry" do
|
35
|
-
run_task
|
36
|
-
|
37
|
-
# find all original CSS entries...
|
38
|
-
originals = @manifest.entries(:hidden => true).select do |entry|
|
39
|
-
entry.original? && entry.ext == 'css'
|
40
|
-
end
|
41
|
-
originals.size.should > 0 # precondition
|
42
|
-
|
43
|
-
# transformed entries
|
44
|
-
entries = @manifest.entries.select { |e| e.entry_type == :css }
|
45
|
-
entries.size.should == originals.size #precondition
|
46
|
-
|
47
|
-
# one transformed entry should exist for each original entry.
|
48
|
-
entries.each do |entry|
|
49
|
-
entry.should be_transform
|
50
|
-
entry.source_entry.should_not be_nil
|
51
|
-
originals.should include(entry.source_entry)
|
52
|
-
originals.delete(entry.source_entry) # so as not to allow doubles
|
53
|
-
end
|
54
|
-
originals.size.should == 0
|
55
|
-
end
|
56
|
-
|
57
|
-
describe "supports require() and sc_require() statements" do
|
58
|
-
|
59
|
-
it "adds a entry.required property with empty array of no requires are specified in file" do
|
60
|
-
run_task
|
61
|
-
entry = @manifest.entry_for('source/no_require.css')
|
62
|
-
entry.required.should == []
|
63
|
-
end
|
64
|
-
|
65
|
-
it "searches files for require() & sc_requires() statements and adds them to entry.required array -- (also should ignore any ext)" do
|
66
|
-
run_task
|
67
|
-
entry = @manifest.entry_for('source/has_require.css')
|
68
|
-
entry.required.sort.should == ['demo2', 'no_require']
|
69
|
-
end
|
70
|
-
|
71
|
-
end
|
72
|
-
|
73
|
-
describe "supports sc_resource() statement" do
|
74
|
-
it "sets entry.resource = 'stylesheet' if no sc_resource statement is found in files" do
|
75
|
-
run_task
|
76
|
-
entry = @manifest.entry_for('source/no_require.css')
|
77
|
-
entry.resource.should == 'stylesheet'
|
78
|
-
end
|
79
|
-
|
80
|
-
it "searches files for sc_resource() statement and stores last value in entry.resource property" do
|
81
|
-
run_task
|
82
|
-
entry = @manifest.entry_for 'source/sc_resource.css'
|
83
|
-
entry.resource.should == 'bar'
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
|
-
end
|