sproutcore 1.6.0.1-java → 1.7.1.beta-java
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +21 -0
- data/Gemfile +5 -0
- data/Rakefile +26 -13
- data/VERSION.yml +2 -2
- data/lib/Buildfile +43 -4
- data/lib/buildtasks/build.rake +10 -0
- data/lib/buildtasks/helpers/file_rule.rb +22 -0
- data/lib/buildtasks/helpers/file_rule_list.rb +137 -0
- data/lib/buildtasks/manifest.rake +133 -122
- data/lib/frameworks/sproutcore/CHANGELOG.md +69 -2
- data/lib/frameworks/sproutcore/apps/tests/english.lproj/strings.js +1 -0
- data/lib/frameworks/sproutcore/frameworks/bootstrap/system/browser.js +28 -22
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/array.js +9 -5
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/controller.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controls/button.js +18 -13
- data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/handlebars/bind.js +5 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/handlebars/collection.js +2 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/action_support.js +80 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/template_helpers/text_field_support.js +84 -116
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane.js +8 -5
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/event.js +157 -157
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/platform.js +5 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/root_responder.js +6 -6
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/sparse_array.js +10 -7
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/mixins/action_support.js +106 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/collection.js +18 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/handlebars.js +71 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/attribute_bindings_test.js +38 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/class_name_bindings_test.js +47 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutChildViews.js +18 -18
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutStyle.js +42 -10
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view.js +158 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/keyboard.js +26 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout_style.js +14 -8
- data/lib/frameworks/sproutcore/frameworks/datastore/models/record.js +15 -2
- data/lib/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +108 -108
- data/lib/frameworks/sproutcore/frameworks/datastore/system/query.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/datastore/system/record_array.js +2 -4
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/record/error_methods.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/single_attribute.js +26 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/query/builders.js +7 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/error_methods.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/core/system/datetime.js +4 -1
- data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/core/tests/system/datetime.js +6 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/menu.js +26 -5
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/picker.js +97 -96
- data/lib/frameworks/sproutcore/frameworks/desktop/system/drag.js +4 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/ui.js +17 -4
- data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +7 -7
- data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +7 -5
- data/lib/frameworks/sproutcore/frameworks/desktop/views/scroll.js +12 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/views/web.js +23 -14
- data/lib/frameworks/sproutcore/frameworks/experimental/Buildfile +5 -1
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/menu/render_delegates/menu_scroller.js +28 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/menu/tests/menu/scroll.js +235 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/menu/views/menu/scroll.js +363 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/menu/views/menu/scroller.js +250 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/desktop_scroller.js +92 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/native_scroll.js +25 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/scroll.js +33 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/touch_scroller.js +76 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/tests/scroll/integration.js +50 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/tests/scroll/methods.js +143 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/tests/scroll/ui.js +258 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/core_scroll.js +1164 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/core_scroller.js +332 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/desktop/scroll.js +236 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/desktop/scroller.js +347 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/scroll.js +15 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/scroller.js +10 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/touch/scroll.js +804 -0
- data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/touch/scroller.js +133 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/resources/text_field.css +3 -3
- data/lib/frameworks/sproutcore/frameworks/foundation/validators/number.js +3 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/views/text_field.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/media/views/audio.js +2 -1
- data/lib/frameworks/sproutcore/frameworks/media/views/controls.js +2 -1
- data/lib/frameworks/sproutcore/frameworks/media/views/media_slider.js +2 -4
- data/lib/frameworks/sproutcore/frameworks/media/views/mini_controls.js +2 -4
- data/lib/frameworks/sproutcore/frameworks/media/views/simple_controls.js +2 -4
- data/lib/frameworks/sproutcore/frameworks/media/views/video.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/routing/system/routes.js +29 -3
- data/lib/frameworks/sproutcore/frameworks/runtime/core.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/replace.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/private/property_chain.js +2 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/system/binding.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/runtime/system/index_set.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/runtime/system/object.js +1 -1
- data/lib/frameworks/sproutcore/themes/ace/resources/collection/normal/list_item.css +2 -2
- data/lib/frameworks/sproutcore/themes/legacy_theme/english.lproj/segmented.css +1 -1
- data/lib/gen/app/templates/apps/@target_name@/Buildfile +3 -5
- data/lib/gen/app/templates/apps/@target_name@/resources/_theme.css +18 -0
- data/lib/gen/project/templates/@filename@/Buildfile +2 -2
- data/lib/sproutcore.rb +30 -5
- data/lib/sproutcore/builders.rb +1 -0
- data/lib/sproutcore/builders/chance_file.rb +9 -16
- data/lib/sproutcore/builders/html.rb +2 -1
- data/lib/sproutcore/builders/minify.rb +4 -35
- data/lib/sproutcore/builders/module.rb +38 -1
- data/lib/sproutcore/builders/split.rb +63 -0
- data/lib/sproutcore/builders/strings.rb +7 -1
- data/lib/sproutcore/helpers.rb +1 -1
- data/lib/sproutcore/helpers/css_split.rb +190 -0
- data/lib/sproutcore/helpers/entry_sorter.rb +2 -0
- data/lib/sproutcore/helpers/minifier.rb +40 -16
- data/lib/sproutcore/helpers/static_helper.rb +35 -17
- data/lib/sproutcore/models/manifest.rb +26 -0
- data/lib/sproutcore/models/target.rb +12 -1
- data/lib/sproutcore/rack.rb +1 -0
- data/lib/sproutcore/rack/proxy.rb +244 -225
- data/lib/sproutcore/rack/restrict_ip.rb +67 -0
- data/lib/sproutcore/rack/service.rb +8 -2
- data/lib/sproutcore/tools.rb +102 -46
- data/lib/sproutcore/tools/build.rb +91 -43
- data/lib/sproutcore/tools/gen.rb +2 -3
- data/lib/sproutcore/tools/manifest.rb +22 -16
- data/lib/sproutcore/tools/server.rb +21 -0
- data/spec/buildtasks/helpers/accept_list +22 -0
- data/spec/buildtasks/helpers/accept_list.rb +128 -0
- data/spec/buildtasks/helpers/list.json +11 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/chance_2x_spec.rb +1 -39
- data/spec/buildtasks/manifest/prepare_build_tasks/chance_spec.rb +0 -38
- data/spec/buildtasks/manifest/prepare_build_tasks/combine_spec.rb +4 -4
- data/spec/buildtasks/manifest/prepare_build_tasks/module_spec.rb +2 -2
- data/spec/buildtasks/manifest/prepare_build_tasks/packed_2x_indirect_spec.rb +7 -16
- data/spec/buildtasks/manifest/prepare_build_tasks/packed_2x_spec.rb +7 -17
- data/spec/buildtasks/manifest/prepare_build_tasks/packed_spec.rb +11 -6
- data/spec/fixtures/builder_tests/Buildfile +2 -1
- data/spec/fixtures/builder_tests/apps/module_test/modules/required_module/core.js +0 -0
- data/spec/lib/builders/module_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -0
- data/sproutcore.gemspec +4 -9
- data/vendor/chance/lib/chance.rb +25 -6
- data/vendor/chance/lib/chance/factory.rb +45 -0
- data/vendor/chance/lib/chance/instance.rb +173 -28
- data/vendor/chance/lib/chance/instance/data_url.rb +0 -29
- data/vendor/chance/lib/chance/instance/slicing.rb +57 -4
- data/vendor/chance/lib/chance/instance/spriting.rb +112 -21
- data/vendor/chance/lib/chance/parser.rb +80 -52
- data/vendor/sproutcore/SCCompiler.jar +0 -0
- data/vendor/sproutcore/lib/args4j-2.0.12.jar +0 -0
- data/vendor/sproutcore/lib/yuicompressor-2.4.2.jar +0 -0
- metadata +84 -25
data/lib/sproutcore/tools/gen.rb
CHANGED
@@ -50,12 +50,11 @@ module SC
|
|
50
50
|
desc "gen generator Namespace[.ClassName] [--target=TARGET_NAME] [--filename=FILE_NAME]",
|
51
51
|
"Generates SproutCore components"
|
52
52
|
|
53
|
-
method_options(
|
54
|
-
MANIFEST_OPTIONS.merge(:help => :string,
|
53
|
+
method_options(:help => :string,
|
55
54
|
:filename => :string,
|
56
55
|
:target => :string,
|
57
56
|
'--dry-run' => false,
|
58
|
-
:force => false)
|
57
|
+
:force => false)
|
59
58
|
|
60
59
|
def gen(*arguments)
|
61
60
|
return show_help if arguments.empty?
|
@@ -8,23 +8,29 @@
|
|
8
8
|
module SC
|
9
9
|
class Tools
|
10
10
|
|
11
|
-
# Standard manifest options. Used by build tool as well.
|
12
|
-
MANIFEST_OPTIONS = { :symlink => false,
|
13
|
-
:stageroot => :string,
|
14
|
-
:format => :string,
|
15
|
-
:output => :string,
|
16
|
-
:all => false,
|
17
|
-
:buildroot => :string,
|
18
|
-
['--languages', '-L'] => :string,
|
19
|
-
['--build-numbers', '-B'] => :string,
|
20
|
-
['--include-required', '-r'] => false }
|
21
|
-
|
22
11
|
desc "manifest [TARGET..]", "Generates a manifest for the specified targets"
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
:
|
27
|
-
|
12
|
+
|
13
|
+
# Standard manifest options. Used by build tool as well.
|
14
|
+
method_option :languages, :type => :string,
|
15
|
+
:desc => "The languages to build."
|
16
|
+
method_option :symlink, :default => false
|
17
|
+
method_option :buildroot, :type => :string,
|
18
|
+
:desc => "The path to build to."
|
19
|
+
method_option :stageroot, :type => :string,
|
20
|
+
:desc => "The path to stage to."
|
21
|
+
method_option :format, :type => :string
|
22
|
+
method_option :output, :type => :string
|
23
|
+
method_option :all, :type => false
|
24
|
+
|
25
|
+
method_option :build_numbers, :type => :string, :aliases => ['-B'],
|
26
|
+
:desc => "The identifier(s) for the build."
|
27
|
+
method_option :include_required, :default => false, :aliases => '-r',
|
28
|
+
:desc => "Deprecated. All builds build dependencies."
|
29
|
+
|
30
|
+
method_option :format => :string
|
31
|
+
method_option :only => :string
|
32
|
+
method_option :except => :string
|
33
|
+
method_option :hidden => false
|
28
34
|
def manifest(*targets)
|
29
35
|
|
30
36
|
# Copy some key props to the env
|
@@ -16,11 +16,32 @@ module SC
|
|
16
16
|
:host => :string,
|
17
17
|
:irb => false,
|
18
18
|
:filesystem => true
|
19
|
+
|
20
|
+
method_option :whitelist, :type => :string,
|
21
|
+
:desc => "The whitelist to use when building. By default, Whitelist (if present)"
|
22
|
+
method_option :blacklist, :type => :string,
|
23
|
+
:desc => "The blacklist to use when building. By default, Blacklist (if present)"
|
24
|
+
method_option :accept, :type => :string,
|
25
|
+
:desc => "The SproutCore Accept file to determine which files to include. By default, Accept (if present)"
|
26
|
+
|
27
|
+
|
28
|
+
method_option :allow_from_ips,
|
29
|
+
:default => "127.0.0.1",
|
30
|
+
:desc => "One or more (comma-separated) masks to accept requests from. " +
|
31
|
+
"For example: 10.*.*.*,127.0.0.1"
|
19
32
|
def server
|
33
|
+
if options.help
|
34
|
+
help('server')
|
35
|
+
return
|
36
|
+
end
|
37
|
+
|
20
38
|
prepare_mode!('debug') # set mode again, using debug as default
|
21
39
|
|
22
40
|
SC.env[:build_prefix] = options[:buildroot] if options[:buildroot]
|
23
41
|
SC.env[:staging_prefix] = options[:stageroot] if options[:stageroot]
|
42
|
+
SC.env[:whitelist_name] = options.whitelist
|
43
|
+
SC.env[:blacklist_name] = options.blacklist
|
44
|
+
SC.env[:accept_name] = options.accept
|
24
45
|
|
25
46
|
# get project and start service.
|
26
47
|
project = requires_project!
|
@@ -0,0 +1,22 @@
|
|
1
|
+
TARGET /target1/abc
|
2
|
+
file[0-9].js
|
3
|
+
|
4
|
+
DENY
|
5
|
+
# This will deny the files we don't want, and one we do
|
6
|
+
file[2-9].js
|
7
|
+
|
8
|
+
# This will add one back
|
9
|
+
allow file4.js
|
10
|
+
|
11
|
+
# this will remove it again
|
12
|
+
file4.js
|
13
|
+
|
14
|
+
# And finally, add back the one we want.
|
15
|
+
ALLOW
|
16
|
+
file2.js
|
17
|
+
|
18
|
+
|
19
|
+
TARGET /target1/def
|
20
|
+
allow all
|
21
|
+
|
22
|
+
deny file2.js
|
@@ -0,0 +1,128 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
WHITELIST_PATH = File.dirname(__FILE__) + '/list.json'
|
4
|
+
ACCEPT_LIST_PATH = File.dirname(__FILE__) + '/accept_list'
|
5
|
+
|
6
|
+
|
7
|
+
module FileRuleListSpec
|
8
|
+
class YesRule
|
9
|
+
def include?(f)
|
10
|
+
true
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
class NoRule
|
15
|
+
def include?(f)
|
16
|
+
false
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
describe "FileRuleList" do
|
22
|
+
it "includes if ignore_list has not been unset" do
|
23
|
+
list = SproutCore::FileRuleList.new
|
24
|
+
list.include?("target1", "some_file.js").should be_true
|
25
|
+
end
|
26
|
+
|
27
|
+
it "does not include when there are no rules" do
|
28
|
+
list = SproutCore::FileRuleList.new
|
29
|
+
list.ignore_list = false
|
30
|
+
list.include?("target1", "some_file.js").should be_false
|
31
|
+
end
|
32
|
+
|
33
|
+
it "includes when there is an allow rule" do
|
34
|
+
list = SproutCore::FileRuleList.new
|
35
|
+
list.add_rule("target1", FileRuleListSpec::YesRule.new)
|
36
|
+
list.include?("target1", "some_file.js").should be_true
|
37
|
+
end
|
38
|
+
|
39
|
+
it "does not include when there is both a yes and a no rule" do
|
40
|
+
list = SproutCore::FileRuleList.new
|
41
|
+
list.add_rule("target1", FileRuleListSpec::YesRule.new)
|
42
|
+
list.add_rule("target1", FileRuleListSpec::NoRule.new)
|
43
|
+
list.include?("target1", "some_file.js").should be_false
|
44
|
+
end
|
45
|
+
|
46
|
+
it "includes when there is a yes rule, followed by a no, followed by a yes" do
|
47
|
+
list = SproutCore::FileRuleList.new
|
48
|
+
list.add_rule("target1", FileRuleListSpec::YesRule.new)
|
49
|
+
list.add_rule("target1", FileRuleListSpec::NoRule.new)
|
50
|
+
list.add_rule("target1", FileRuleListSpec::YesRule.new)
|
51
|
+
list.include?("target1", "some_file.js").should be_true
|
52
|
+
end
|
53
|
+
|
54
|
+
it "maintains separate lists for each target" do
|
55
|
+
list = SproutCore::FileRuleList.new
|
56
|
+
list.add_rule("target1", FileRuleListSpec::YesRule.new)
|
57
|
+
list.add_rule("target2", FileRuleListSpec::NoRule.new)
|
58
|
+
list.include?("target1", "some_file.js").should be_true
|
59
|
+
list.include?("target2", "some_file.js").should be_false
|
60
|
+
end
|
61
|
+
|
62
|
+
it "obeys allow_by_default" do
|
63
|
+
list = SproutCore::FileRuleList.new
|
64
|
+
list.allow_by_default = true
|
65
|
+
list.include?("target1", "some_file.js").should be_true
|
66
|
+
end
|
67
|
+
|
68
|
+
it "always allows the ALWAYS_ACCEPTED_FILE_TYPES, no matter what" do
|
69
|
+
list = SproutCore::FileRuleList.new
|
70
|
+
list.add_rule("target1", FileRuleListSpec::NoRule.new)
|
71
|
+
|
72
|
+
[
|
73
|
+
'.manifest',
|
74
|
+
'.htm',
|
75
|
+
'.html',
|
76
|
+
'.rhtml',
|
77
|
+
'.png',
|
78
|
+
'.jpg',
|
79
|
+
'.jpeg',
|
80
|
+
'.gif'
|
81
|
+
].each {|name|
|
82
|
+
list.include?("target1", "a_file#{name}").should be_true
|
83
|
+
}
|
84
|
+
|
85
|
+
list.include?("target1", "some_file.js").should be_false
|
86
|
+
end
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
describe "#read_json" do
|
92
|
+
it "reads in allow mode properly" do
|
93
|
+
list = SproutCore::FileRuleList.new
|
94
|
+
list.read_json(WHITELIST_PATH, :allow)
|
95
|
+
|
96
|
+
list.include?("/target1/abc", "file1.js").should be_true
|
97
|
+
list.include?("/target1/abc", "file3.js").should be_false
|
98
|
+
list.include?("/target1/def", "file2.js").should be_false
|
99
|
+
list.include?("/target1/def", "file4.js").should be_true
|
100
|
+
end
|
101
|
+
|
102
|
+
it "reads in deny mode properly" do
|
103
|
+
list = SproutCore::FileRuleList.new
|
104
|
+
list.allow_by_default = true
|
105
|
+
list.read_json(WHITELIST_PATH, :deny)
|
106
|
+
|
107
|
+
list.include?("/target1/abc", "file1.js").should be_false
|
108
|
+
list.include?("/target1/abc", "file3.js").should be_true
|
109
|
+
list.include?("/target1/def", "file2.js").should be_true
|
110
|
+
list.include?("/target1/def", "file4.js").should be_false
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
describe "#read" do
|
115
|
+
it "reads the list properly" do
|
116
|
+
list = SproutCore::FileRuleList.new
|
117
|
+
list.read(ACCEPT_LIST_PATH)
|
118
|
+
|
119
|
+
list.include?("/target1/abc", "file1.js").should be_true
|
120
|
+
list.include?("/target1/abc", "file3.js").should be_false
|
121
|
+
|
122
|
+
# Target1/def denies exactly one file: file2.js. Everything else is allowed.
|
123
|
+
list.include?("/target1/def", "file2.js").should be_false
|
124
|
+
list.include?("/target1/def", "fadjfhakljdf.js").should be_true
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
@@ -53,48 +53,10 @@ describe "manifest:prepare_build_tasks:chance" do
|
|
53
53
|
}
|
54
54
|
|
55
55
|
x2_entry = entry_for(name + "@2x.css")
|
56
|
-
x2_entry[:chance_file].should == "chance@2x.css"
|
56
|
+
x2_entry[:chance_file].should == "chance-sprited@2x.css"
|
57
57
|
end
|
58
58
|
originals.size.should == 0
|
59
59
|
end
|
60
60
|
|
61
|
-
it "generates js, and mhtml entries" do
|
62
|
-
run_task
|
63
|
-
|
64
|
-
have_entry('stylesheet.css')
|
65
|
-
have_entry('stylesheet@2x.css')
|
66
|
-
have_entry('__sc_chance.js')
|
67
|
-
have_entry('__sc_chance_mhtml.txt')
|
68
|
-
|
69
|
-
stylesheet = entry_for('stylesheet.css')
|
70
|
-
end
|
71
|
-
|
72
|
-
it "provides all chance instances to the mhtml and js entries" do
|
73
|
-
run_task
|
74
|
-
|
75
|
-
js_entry = entry_for('__sc_chance.js')
|
76
|
-
mhtml_entry = entry_for('__sc_chance_mhtml.txt')
|
77
|
-
|
78
|
-
resources = {}
|
79
|
-
|
80
|
-
originals = @manifest.entries(:hidden=>true).select {|entry|
|
81
|
-
entry.entry_type == :css and not entry.combined and not entry[:resource].nil?
|
82
|
-
}
|
83
|
-
originals.size.should > 0
|
84
|
-
|
85
|
-
originals.each do |entry|
|
86
|
-
next if entry[:resource].nil?
|
87
|
-
|
88
|
-
resources[entry[:resource]] ||= []
|
89
|
-
resources[entry[:resource]] << entry
|
90
|
-
end
|
91
|
-
|
92
|
-
resources.each do |name, entries|
|
93
|
-
chance_instance = entry_for(name + ".css")[:chance_instance]
|
94
|
-
js_entry.chance_instances.should include(chance_instance)
|
95
|
-
mhtml_entry.chance_instances.should include(chance_instance)
|
96
|
-
end
|
97
|
-
|
98
|
-
end
|
99
61
|
end
|
100
62
|
|
@@ -62,43 +62,5 @@ describe "manifest:prepare_build_tasks:chance" do
|
|
62
62
|
originals.size.should == 0
|
63
63
|
end
|
64
64
|
|
65
|
-
it "generates js, and mhtml entries" do
|
66
|
-
run_task
|
67
|
-
|
68
|
-
have_entry('stylesheet.css')
|
69
|
-
have_entry('stylesheet@2x.css', false)
|
70
|
-
have_entry('__sc_chance.js')
|
71
|
-
have_entry('__sc_chance_mhtml.txt')
|
72
|
-
|
73
|
-
stylesheet = entry_for('stylesheet.css')
|
74
|
-
end
|
75
|
-
|
76
|
-
it "provides all chance instances to the mhtml and js entries" do
|
77
|
-
run_task
|
78
|
-
|
79
|
-
js_entry = entry_for('__sc_chance.js')
|
80
|
-
mhtml_entry = entry_for('__sc_chance_mhtml.txt')
|
81
|
-
|
82
|
-
resources = {}
|
83
|
-
|
84
|
-
originals = @manifest.entries(:hidden=>true).select {|entry|
|
85
|
-
entry.entry_type == :css and not entry.combined and not entry[:resource].nil?
|
86
|
-
}
|
87
|
-
originals.size.should > 0
|
88
|
-
|
89
|
-
originals.each do |entry|
|
90
|
-
next if entry[:resource].nil?
|
91
|
-
|
92
|
-
resources[entry[:resource]] ||= []
|
93
|
-
resources[entry[:resource]] << entry
|
94
|
-
end
|
95
|
-
|
96
|
-
resources.each do |name, entries|
|
97
|
-
chance_instance = entry_for(name + ".css")[:chance_instance]
|
98
|
-
js_entry.chance_instances.should include(chance_instance)
|
99
|
-
mhtml_entry.chance_instances.should include(chance_instance)
|
100
|
-
end
|
101
|
-
|
102
|
-
end
|
103
65
|
end
|
104
66
|
|
@@ -201,7 +201,7 @@ describe "manifest:prepare_build_tasks:combine" do
|
|
201
201
|
|
202
202
|
# get the expected set of ordered entries...based on contents of
|
203
203
|
# project...
|
204
|
-
expected = %w(source/lproj/strings.js source/core.js source/utils.js
|
204
|
+
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 source/t.js source/resources/main_page.js source/main.js)
|
205
205
|
|
206
206
|
entry.ordered_entries.should_not be_nil
|
207
207
|
filenames = entry.ordered_entries.map { |e| e.filename }
|
@@ -241,7 +241,7 @@ describe "manifest:prepare_build_tasks:combine" do
|
|
241
241
|
|
242
242
|
# get the expected set of ordered entries...based on contents of
|
243
243
|
# project... note that we require 'd', which should match 'lproj/d'
|
244
|
-
expected = %w(
|
244
|
+
expected = %w(source/c.js source/a.js source/lproj/d.js source/b.js)
|
245
245
|
|
246
246
|
entry.ordered_entries.should_not be_nil
|
247
247
|
filenames = entry.ordered_entries.map { |e| e.filename }
|
@@ -337,14 +337,14 @@ describe "manifest:prepare_build_tasks:combine" do
|
|
337
337
|
run_task
|
338
338
|
end
|
339
339
|
|
340
|
-
it " should be included in the requirements" do
|
340
|
+
it " should not be included in the requirements" do
|
341
341
|
target = target_for('photos')
|
342
342
|
target_requirements = target.required_targets
|
343
343
|
|
344
344
|
preferences_module = target.target_for('photos/preferences')
|
345
345
|
email_module = target.target_for('photos/email')
|
346
346
|
|
347
|
-
target_requirements.
|
347
|
+
target_requirements.should_not include(preferences_module)
|
348
348
|
target_requirements.should_not include(email_module)
|
349
349
|
end
|
350
350
|
end
|
@@ -69,14 +69,14 @@ describe "Target#modules" do
|
|
69
69
|
run_task
|
70
70
|
end
|
71
71
|
|
72
|
-
it "it should be included in the requirements" do
|
72
|
+
it "it should not be included in the requirements" do
|
73
73
|
target = target_for('photos')
|
74
74
|
target_requirements = target.required_targets
|
75
75
|
|
76
76
|
preferences_module = target.target_for('photos/preferences')
|
77
77
|
email_module = target.target_for('photos/email')
|
78
78
|
|
79
|
-
target_requirements.
|
79
|
+
target_requirements.should_not include(preferences_module)
|
80
80
|
target_requirements.should_not include(email_module)
|
81
81
|
end
|
82
82
|
end
|
@@ -115,7 +115,13 @@ describe "manifest:prepare_build_tasks:packed" do
|
|
115
115
|
|
116
116
|
before do
|
117
117
|
run_task
|
118
|
-
|
118
|
+
|
119
|
+
# for 1x (but not 2x) there should be an intermediary entry for a transform
|
120
|
+
# (split_css) that... splits the CSS. See its documentation.
|
121
|
+
#
|
122
|
+
# we are looking for the stylesheet-packed.css that is set on its source entry.
|
123
|
+
@entry = entry_for('stylesheet-packed.css')[:source_entry]
|
124
|
+
|
119
125
|
@entry_2x = entry_for('stylesheet@2x-packed.css')
|
120
126
|
end
|
121
127
|
|
@@ -129,11 +135,6 @@ describe "manifest:prepare_build_tasks:packed" do
|
|
129
135
|
@entry.source_entries.each do |entry|
|
130
136
|
entry.filename.should == 'stylesheet.css'
|
131
137
|
end
|
132
|
-
|
133
|
-
@entry_2x.source_entries.size.should > 0
|
134
|
-
@entry_2x.source_entries.each do |entry|
|
135
|
-
entry.filename.should == 'stylesheet@2x.css'
|
136
|
-
end
|
137
138
|
end
|
138
139
|
|
139
140
|
it "should include ordered_entries ordered by required target order" do
|
@@ -151,16 +152,6 @@ describe "manifest:prepare_build_tasks:packed" do
|
|
151
152
|
entry.target.should == targets.shift
|
152
153
|
end
|
153
154
|
|
154
|
-
targets = @target.expand_required_targets(:theme => true) + [@target]
|
155
|
-
variation = @entry.manifest.variation
|
156
|
-
targets.reject! do |t|
|
157
|
-
t.manifest_for(variation).build!.entry_for('stylesheet@2x.css').nil?
|
158
|
-
end
|
159
|
-
|
160
|
-
@entry_2x.ordered_entries.each do |entry|
|
161
|
-
entry.target.should == targets.shift
|
162
|
-
end
|
163
|
-
|
164
155
|
end
|
165
156
|
|
166
157
|
it "should include the actual targets this packed version covers in the targets property (even those w no stylesheet.css)" do
|