compass-edge 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.markdown +528 -0
- data/LICENSE.markdown +29 -0
- data/README.markdown +46 -0
- data/REVISION +1 -0
- data/Rakefile +131 -0
- data/VERSION.yml +4 -0
- data/bin/compass +26 -0
- data/deps.rip +1 -0
- data/examples/README.markdown +4 -0
- data/examples/blueprint_default/config.rb +7 -0
- data/examples/blueprint_default/images/grid.png +0 -0
- data/examples/blueprint_default/index.html.haml +85 -0
- data/examples/blueprint_default/parts/elements.html.haml +282 -0
- data/examples/blueprint_default/parts/forms.html.haml +190 -0
- data/examples/blueprint_default/parts/grid.html.haml +274 -0
- data/examples/blueprint_default/parts/test-small.jpg +0 -0
- data/examples/blueprint_default/parts/test.jpg +0 -0
- data/examples/blueprint_default/parts/valid.png +0 -0
- data/examples/blueprint_default/src/ie.sass +3 -0
- data/examples/blueprint_default/src/images/grid.png +0 -0
- data/examples/blueprint_default/src/print.sass +3 -0
- data/examples/blueprint_default/src/screen.sass +8 -0
- data/examples/blueprint_plugins/config.rb +8 -0
- data/examples/blueprint_plugins/images/buttons/cross.png +0 -0
- data/examples/blueprint_plugins/images/buttons/key.png +0 -0
- data/examples/blueprint_plugins/images/buttons/tick.png +0 -0
- data/examples/blueprint_plugins/images/grid.png +0 -0
- data/examples/blueprint_plugins/images/link_icons/doc.png +0 -0
- data/examples/blueprint_plugins/images/link_icons/email.png +0 -0
- data/examples/blueprint_plugins/images/link_icons/external.png +0 -0
- data/examples/blueprint_plugins/images/link_icons/feed.png +0 -0
- data/examples/blueprint_plugins/images/link_icons/im.png +0 -0
- data/examples/blueprint_plugins/images/link_icons/pdf.png +0 -0
- data/examples/blueprint_plugins/images/link_icons/visited.png +0 -0
- data/examples/blueprint_plugins/images/link_icons/xls.png +0 -0
- data/examples/blueprint_plugins/images/test-small.jpg +0 -0
- data/examples/blueprint_plugins/images/test.jpg +0 -0
- data/examples/blueprint_plugins/images/valid.png +0 -0
- data/examples/blueprint_plugins/index.html.haml +96 -0
- data/examples/blueprint_plugins/plugins/buttons.html.haml +67 -0
- data/examples/blueprint_plugins/plugins/fancy_type.html.haml +100 -0
- data/examples/blueprint_plugins/plugins/link_icons.html.haml +61 -0
- data/examples/blueprint_plugins/plugins/rtl.html.haml +100 -0
- data/examples/blueprint_plugins/src/buttons.sass +49 -0
- data/examples/blueprint_plugins/src/ie.sass +3 -0
- data/examples/blueprint_plugins/src/images/grid.png +0 -0
- data/examples/blueprint_plugins/src/link_icons.sass +13 -0
- data/examples/blueprint_plugins/src/print.sass +3 -0
- data/examples/blueprint_plugins/src/rtl_screen.sass +13 -0
- data/examples/blueprint_plugins/src/screen.sass +11 -0
- data/examples/blueprint_scoped/images/grid.png +0 -0
- data/examples/blueprint_scoped/src/ie.sass +4 -0
- data/examples/blueprint_scoped/src/print.sass +4 -0
- data/examples/blueprint_scoped/src/screen.sass +5 -0
- data/examples/blueprint_scoped_form/images/grid.png +0 -0
- data/examples/blueprint_scoped_form/src/ie.sass +3 -0
- data/examples/blueprint_scoped_form/src/print.sass +3 -0
- data/examples/blueprint_scoped_form/src/screen.sass +10 -0
- data/examples/blueprint_semantic/config.rb +7 -0
- data/examples/blueprint_semantic/images/grid.png +0 -0
- data/examples/blueprint_semantic/index.html.haml +86 -0
- data/examples/blueprint_semantic/parts/fancy_type.html.haml +100 -0
- data/examples/blueprint_semantic/parts/liquid.html.haml +100 -0
- data/examples/blueprint_semantic/parts/test-small.jpg +0 -0
- data/examples/blueprint_semantic/parts/test.jpg +0 -0
- data/examples/blueprint_semantic/parts/valid.png +0 -0
- data/examples/blueprint_semantic/src/ie.sass +3 -0
- data/examples/blueprint_semantic/src/images/grid.png +0 -0
- data/examples/blueprint_semantic/src/liquid.sass +69 -0
- data/examples/blueprint_semantic/src/print.sass +3 -0
- data/examples/blueprint_semantic/src/screen.sass +70 -0
- data/examples/compass/compass.html.haml +39 -0
- data/examples/compass/config.rb +7 -0
- data/examples/compass/images/blue_arrow.gif +0 -0
- data/examples/compass/src/compass.sass +47 -0
- data/examples/compass/src/images/blue_arrow.gif +0 -0
- data/examples/compass/src/sticky_footer.sass +11 -0
- data/examples/compass/src/utilities.sass +108 -0
- data/examples/compass/sticky_footer.html.haml +14 -0
- data/examples/compass/utilities.html.haml +189 -0
- data/examples/downloader.rb +57 -0
- data/examples/logo/logo.html.haml +40 -0
- data/examples/logo/src/ie.sass +6 -0
- data/examples/logo/src/print.sass +6 -0
- data/examples/logo/src/screen.sass +29 -0
- data/examples/ninesixty/bootstrap.rb +4 -0
- data/examples/ninesixty/config.rb +9 -0
- data/examples/ninesixty/extensions/ninesixty/README.mkdn +56 -0
- data/examples/ninesixty/extensions/ninesixty/compass-960-plugin.gemspec +36 -0
- data/examples/ninesixty/extensions/ninesixty/lib/ninesixty.rb +1 -0
- data/examples/ninesixty/extensions/ninesixty/lib/ninesixty/compass_plugin.rb +5 -0
- data/examples/ninesixty/extensions/ninesixty/sass/960/_grid.sass +64 -0
- data/examples/ninesixty/extensions/ninesixty/sass/960/_text.sass +59 -0
- data/examples/ninesixty/extensions/ninesixty/templates/project/grid.sass +34 -0
- data/examples/ninesixty/extensions/ninesixty/templates/project/manifest.rb +2 -0
- data/examples/ninesixty/extensions/ninesixty/templates/project/text.sass +10 -0
- data/examples/ninesixty/src/grid.sass +16 -0
- data/examples/ninesixty/src/text.sass +10 -0
- data/examples/yui/bootstrap.rb +3 -0
- data/examples/yui/divisions.html.haml +179 -0
- data/examples/yui/extensions/yui/stylesheets/_yui.sass +7 -0
- data/examples/yui/extensions/yui/stylesheets/yui/modules/_base.sass +70 -0
- data/examples/yui/extensions/yui/stylesheets/yui/modules/_fonts.sass +45 -0
- data/examples/yui/extensions/yui/stylesheets/yui/modules/_grids.sass +385 -0
- data/examples/yui/extensions/yui/stylesheets/yui/modules/_reset.sass +61 -0
- data/examples/yui/extensions/yui/templates/project/manifest.rb +1 -0
- data/examples/yui/extensions/yui/templates/project/screen.sass +4 -0
- data/examples/yui/index.html.haml +19 -0
- data/examples/yui/src/screen.sass +13 -0
- data/examples/yui/sub_divisions.html.haml +169 -0
- data/examples/yui/templates.html.haml +54 -0
- data/examples/yui/test.jpg +0 -0
- data/examples/yui/typography.html.haml +132 -0
- data/lib/compass.rb +22 -0
- data/lib/compass/actions.rb +116 -0
- data/lib/compass/app_integration.rb +3 -0
- data/lib/compass/app_integration/merb.rb +1 -0
- data/lib/compass/app_integration/merb/runtime.rb +63 -0
- data/lib/compass/app_integration/rails.rb +8 -0
- data/lib/compass/app_integration/rails/action_controller.rb +15 -0
- data/lib/compass/app_integration/rails/configuration_defaults.rb +29 -0
- data/lib/compass/app_integration/rails/installer.rb +127 -0
- data/lib/compass/app_integration/rails/runtime.rb +14 -0
- data/lib/compass/app_integration/rails/sass_plugin.rb +5 -0
- data/lib/compass/app_integration/rails/templates/compass-install-rails.rb +80 -0
- data/lib/compass/app_integration/rails/urls.rb +14 -0
- data/lib/compass/app_integration/stand_alone.rb +3 -0
- data/lib/compass/app_integration/stand_alone/configuration_defaults.rb +24 -0
- data/lib/compass/app_integration/stand_alone/installer.rb +71 -0
- data/lib/compass/commands.rb +11 -0
- data/lib/compass/commands/base.rb +36 -0
- data/lib/compass/commands/create_project.rb +113 -0
- data/lib/compass/commands/generate_grid_background.rb +91 -0
- data/lib/compass/commands/help.rb +62 -0
- data/lib/compass/commands/installer_command.rb +34 -0
- data/lib/compass/commands/list_frameworks.rb +16 -0
- data/lib/compass/commands/print_version.rb +91 -0
- data/lib/compass/commands/project_base.rb +92 -0
- data/lib/compass/commands/registry.rb +22 -0
- data/lib/compass/commands/stamp_pattern.rb +86 -0
- data/lib/compass/commands/update_project.rb +38 -0
- data/lib/compass/commands/validate_project.rb +21 -0
- data/lib/compass/commands/watch_project.rb +69 -0
- data/lib/compass/commands/write_configuration.rb +32 -0
- data/lib/compass/compiler.rb +54 -0
- data/lib/compass/configuration.rb +38 -0
- data/lib/compass/configuration/adapters.rb +59 -0
- data/lib/compass/configuration/comments.rb +22 -0
- data/lib/compass/configuration/data.rb +103 -0
- data/lib/compass/configuration/defaults.rb +107 -0
- data/lib/compass/configuration/helpers.rb +83 -0
- data/lib/compass/configuration/inheritance.rb +170 -0
- data/lib/compass/configuration/serialization.rb +86 -0
- data/lib/compass/core_ext.rb +14 -0
- data/lib/compass/dependencies.rb +6 -0
- data/lib/compass/errors.rb +7 -0
- data/lib/compass/exec.rb +15 -0
- data/lib/compass/exec/command_option_parser.rb +23 -0
- data/lib/compass/exec/global_options_parser.rb +37 -0
- data/lib/compass/exec/helpers.rb +28 -0
- data/lib/compass/exec/project_options_parser.rb +42 -0
- data/lib/compass/exec/sub_command_ui.rb +45 -0
- data/lib/compass/exec/switch_ui.rb +166 -0
- data/lib/compass/frameworks.rb +53 -0
- data/lib/compass/frameworks/blueprint/stylesheets/_blueprint.sass +3 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_ie.sass +99 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_print.sass +90 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_reset.sass +3 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_screen.sass +29 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_buttons.sass +84 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_colors.sass +33 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_debug.sass +9 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_fancy_type.sass +82 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_form.sass +55 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_grid.sass +178 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_interaction.sass +58 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_link_icons.sass +44 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_liquid.sass +141 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_reset.sass +56 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_rtl.sass +122 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_scaffolding.sass +47 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_typography.sass +160 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_utilities.sass +37 -0
- data/lib/compass/frameworks/blueprint/templates/buttons/buttons.sass +49 -0
- data/lib/compass/frameworks/blueprint/templates/buttons/buttons/cross.png +0 -0
- data/lib/compass/frameworks/blueprint/templates/buttons/buttons/key.png +0 -0
- data/lib/compass/frameworks/blueprint/templates/buttons/buttons/tick.png +0 -0
- data/lib/compass/frameworks/blueprint/templates/buttons/manifest.rb +5 -0
- data/lib/compass/frameworks/blueprint/templates/link_icons/link_icons.sass +13 -0
- data/lib/compass/frameworks/blueprint/templates/link_icons/link_icons/doc.png +0 -0
- data/lib/compass/frameworks/blueprint/templates/link_icons/link_icons/email.png +0 -0
- data/lib/compass/frameworks/blueprint/templates/link_icons/link_icons/external.png +0 -0
- data/lib/compass/frameworks/blueprint/templates/link_icons/link_icons/feed.png +0 -0
- data/lib/compass/frameworks/blueprint/templates/link_icons/link_icons/im.png +0 -0
- data/lib/compass/frameworks/blueprint/templates/link_icons/link_icons/pdf.png +0 -0
- data/lib/compass/frameworks/blueprint/templates/link_icons/link_icons/visited.png +0 -0
- data/lib/compass/frameworks/blueprint/templates/link_icons/link_icons/xls.png +0 -0
- data/lib/compass/frameworks/blueprint/templates/link_icons/manifest.rb +10 -0
- data/lib/compass/frameworks/blueprint/templates/project/grid.png +0 -0
- data/lib/compass/frameworks/blueprint/templates/project/ie.sass +16 -0
- data/lib/compass/frameworks/blueprint/templates/project/manifest.rb +8 -0
- data/lib/compass/frameworks/blueprint/templates/project/partials/_base.sass +11 -0
- data/lib/compass/frameworks/blueprint/templates/project/print.sass +8 -0
- data/lib/compass/frameworks/blueprint/templates/project/screen.sass +47 -0
- data/lib/compass/frameworks/blueprint/templates/project/welcome.html.haml +13 -0
- data/lib/compass/frameworks/compass/stylesheets/_compass.sass +1 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/_layout.sass +1 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/_misc.sass +24 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/_reset.sass +3 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/_utilities.sass +7 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/layout/_sticky_footer.sass +19 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/_css3.sass +6 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/_general.sass +5 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/_links.sass +3 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/_lists.sass +3 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/_print.sass +18 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/_sprites.sass +1 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/_tables.sass +3 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/_text.sass +2 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/css3/_border_radius.sass +47 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/css3/_box_shadow.sass +12 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/css3/_box_sizing.sass +13 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/css3/_columns.sass +37 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/css3/_inline_block.sass +7 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/css3/_opacity.sass +18 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.sass +24 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/general/_float.sass +17 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/general/_hacks.sass +6 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/general/_reset.sass +134 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/general/_tabs.sass +0 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/general/_tag_cloud.sass +19 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/links/_hover_link.sass +5 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/links/_link_colors.sass +24 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/links/_unstyled_link.sass +7 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/lists/_bullets.sass +21 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/lists/_horizontal_list.sass +52 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/lists/_inline_list.sass +29 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/sprites/_sprite_img.sass +52 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/tables/_alternating_rows_and_columns.sass +20 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/tables/_borders.sass +27 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/tables/_scaffolding.sass +9 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/text/_ellipsis.sass +13 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/text/_nowrap.sass +3 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/text/_replacement.sass +17 -0
- data/lib/compass/frameworks/compass/templates/ellipsis/ellipsis.sass +6 -0
- data/lib/compass/frameworks/compass/templates/ellipsis/manifest.rb +2 -0
- data/lib/compass/frameworks/compass/templates/ellipsis/xml/ellipsis.xml +14 -0
- data/lib/compass/frameworks/compass/templates/extension/manifest.rb +6 -0
- data/lib/compass/frameworks/compass/templates/extension/stylesheets/main.sass +1 -0
- data/lib/compass/frameworks/compass/templates/extension/templates/project/manifest.rb +2 -0
- data/lib/compass/frameworks/compass/templates/extension/templates/project/screen.sass +2 -0
- data/lib/compass/frameworks/compass/templates/project/ie.sass +6 -0
- data/lib/compass/frameworks/compass/templates/project/manifest.rb +3 -0
- data/lib/compass/frameworks/compass/templates/project/print.sass +6 -0
- data/lib/compass/frameworks/compass/templates/project/screen.sass +13 -0
- data/lib/compass/grid_builder.rb +76 -0
- data/lib/compass/installers.rb +3 -0
- data/lib/compass/installers/base.rb +186 -0
- data/lib/compass/installers/manifest.rb +79 -0
- data/lib/compass/installers/template_context.rb +44 -0
- data/lib/compass/logger.rb +42 -0
- data/lib/compass/sass_extensions.rb +5 -0
- data/lib/compass/sass_extensions/functions.rb +19 -0
- data/lib/compass/sass_extensions/functions/display.rb +22 -0
- data/lib/compass/sass_extensions/functions/enumerate.rb +6 -0
- data/lib/compass/sass_extensions/functions/inline_image.rb +35 -0
- data/lib/compass/sass_extensions/functions/selectors.rb +42 -0
- data/lib/compass/sass_extensions/functions/urls.rb +105 -0
- data/lib/compass/sass_extensions/monkey_patches.rb +3 -0
- data/lib/compass/sass_extensions/monkey_patches/stylesheet_updating.rb +23 -0
- data/lib/compass/test_case.rb +38 -0
- data/lib/compass/validator.rb +10 -0
- data/lib/compass/version.rb +57 -0
- data/lib/vendor/fssm.rb +28 -0
- data/lib/vendor/fssm/backends/fsevents.rb +78 -0
- data/lib/vendor/fssm/backends/polling.rb +24 -0
- data/lib/vendor/fssm/ext.rb +7 -0
- data/lib/vendor/fssm/monitor.rb +21 -0
- data/lib/vendor/fssm/path.rb +88 -0
- data/lib/vendor/fssm/state.rb +46 -0
- data/lib/vendor/fssm/support.rb +26 -0
- data/test/command_line_helper.rb +97 -0
- data/test/command_line_test.rb +67 -0
- data/test/compass_test.rb +132 -0
- data/test/configuration_test.rb +123 -0
- data/test/fixtures/stylesheets/blueprint/config.rb +9 -0
- data/test/fixtures/stylesheets/blueprint/css/typography.css +158 -0
- data/test/fixtures/stylesheets/blueprint/images/grid.png +0 -0
- data/test/fixtures/stylesheets/blueprint/sass/ie.sass +3 -0
- data/test/fixtures/stylesheets/blueprint/sass/print.sass +3 -0
- data/test/fixtures/stylesheets/blueprint/sass/screen.sass +17 -0
- data/test/fixtures/stylesheets/blueprint/sass/typography.sass +3 -0
- data/test/fixtures/stylesheets/compass/config.rb +9 -0
- data/test/fixtures/stylesheets/compass/css/layout.css +15 -0
- data/test/fixtures/stylesheets/compass/css/print.css +18 -0
- data/test/fixtures/stylesheets/compass/css/reset.css +60 -0
- data/test/fixtures/stylesheets/compass/css/utilities.css +17 -0
- data/test/fixtures/stylesheets/compass/sass/layout.sass +3 -0
- data/test/fixtures/stylesheets/compass/sass/print.sass +5 -0
- data/test/fixtures/stylesheets/compass/sass/reset.sass +10 -0
- data/test/fixtures/stylesheets/compass/sass/utilities.sass +6 -0
- data/test/fixtures/stylesheets/image_urls/config.rb +17 -0
- data/test/fixtures/stylesheets/image_urls/css/screen.css +3 -0
- data/test/fixtures/stylesheets/image_urls/images/grid.png +0 -0
- data/test/fixtures/stylesheets/image_urls/sass/screen.sass +6 -0
- data/test/io_helper.rb +19 -0
- data/test/rails_integration_test.rb +84 -0
- data/test/sass_extensions_test.rb +31 -0
- data/test/test_case_helper.rb +13 -0
- data/test/test_helper.rb +27 -0
- data/test/test_rails_helper.rb +20 -0
- metadata +404 -0
@@ -0,0 +1,54 @@
|
|
1
|
+
module Compass
|
2
|
+
class Compiler
|
3
|
+
|
4
|
+
include Actions
|
5
|
+
|
6
|
+
attr_accessor :working_path, :from, :to, :options
|
7
|
+
|
8
|
+
def initialize(working_path, from, to, options)
|
9
|
+
self.working_path = working_path
|
10
|
+
self.from, self.to = from, to
|
11
|
+
self.logger = options.delete(:logger)
|
12
|
+
self.options = options
|
13
|
+
self.options[:cache_location] ||= File.join(from, ".sass-cache")
|
14
|
+
end
|
15
|
+
|
16
|
+
def sass_files
|
17
|
+
@sass_files || Dir.glob(separate("#{from}/**/[^_]*.sass"))
|
18
|
+
end
|
19
|
+
|
20
|
+
def stylesheet_name(sass_file)
|
21
|
+
sass_file[("#{from}/".length)..-6]
|
22
|
+
end
|
23
|
+
|
24
|
+
def css_files
|
25
|
+
@css_files ||= sass_files.map{|sass_file| corresponding_css_file(sass_file)}
|
26
|
+
end
|
27
|
+
|
28
|
+
def corresponding_css_file(sass_file)
|
29
|
+
"#{to}/#{stylesheet_name(sass_file)}.css"
|
30
|
+
end
|
31
|
+
|
32
|
+
def target_directories
|
33
|
+
css_files.map{|css_file| File.dirname(css_file)}.uniq.sort.sort_by{|d| d.length }
|
34
|
+
end
|
35
|
+
|
36
|
+
def out_of_date?
|
37
|
+
Compass.configure_sass_plugin! unless Compass.sass_plugin_configured?
|
38
|
+
sass_files.zip(css_files).each do |sass_filename, css_filename|
|
39
|
+
return sass_filename if Sass::Plugin.exact_stylesheet_needs_update?(css_filename, sass_filename)
|
40
|
+
end
|
41
|
+
false
|
42
|
+
end
|
43
|
+
|
44
|
+
def run
|
45
|
+
Compass.configure_sass_plugin! unless Compass.sass_plugin_configured?
|
46
|
+
target_directories.each do |dir|
|
47
|
+
directory dir
|
48
|
+
end
|
49
|
+
sass_files.zip(css_files).each do |sass_filename, css_filename|
|
50
|
+
compile sass_filename, css_filename, options
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module Compass
|
2
|
+
module Configuration
|
3
|
+
|
4
|
+
ATTRIBUTES = [
|
5
|
+
:project_type,
|
6
|
+
:project_path,
|
7
|
+
:css_dir,
|
8
|
+
:sass_dir,
|
9
|
+
:images_dir,
|
10
|
+
:javascripts_dir,
|
11
|
+
:extensions_dir,
|
12
|
+
:css_path,
|
13
|
+
:sass_path,
|
14
|
+
:images_path,
|
15
|
+
:javascripts_path,
|
16
|
+
:extensions_path,
|
17
|
+
:http_path,
|
18
|
+
:http_images_dir,
|
19
|
+
:http_stylesheets_dir,
|
20
|
+
:http_javascripts_dir,
|
21
|
+
:http_images_path,
|
22
|
+
:http_stylesheets_path,
|
23
|
+
:http_javascripts_path,
|
24
|
+
:output_style,
|
25
|
+
:environment,
|
26
|
+
:relative_assets,
|
27
|
+
:additional_import_paths,
|
28
|
+
:sass_options,
|
29
|
+
:asset_host,
|
30
|
+
:asset_cache_buster
|
31
|
+
]
|
32
|
+
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
['adapters', 'comments', 'defaults', 'helpers', 'inheritance', 'serialization', 'data'].each do |lib|
|
37
|
+
require "compass/configuration/#{lib}"
|
38
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
module Compass
|
2
|
+
module Configuration
|
3
|
+
# The adapters module provides methods that make configuration data from a compass project
|
4
|
+
# adapt to various consumers of configuration data
|
5
|
+
module Adapters
|
6
|
+
def to_compiler_arguments(additional_options)
|
7
|
+
[project_path, sass_path, css_path, to_sass_engine_options.merge(additional_options)]
|
8
|
+
end
|
9
|
+
|
10
|
+
def to_sass_plugin_options
|
11
|
+
locations = {}
|
12
|
+
locations[sass_path] = css_path if sass_path && css_path
|
13
|
+
Compass::Frameworks::ALL.each do |framework|
|
14
|
+
locations[framework.stylesheets_directory] = css_path || css_dir || "."
|
15
|
+
end
|
16
|
+
resolve_additional_import_paths.each do |additional_path|
|
17
|
+
locations[additional_path] = File.join(css_path || css_dir || ".", File.basename(additional_path))
|
18
|
+
end
|
19
|
+
plugin_opts = {:template_location => locations}
|
20
|
+
plugin_opts[:style] = output_style if output_style
|
21
|
+
plugin_opts[:line_comments] = line_comments if environment
|
22
|
+
plugin_opts.merge!(sass_options || {})
|
23
|
+
plugin_opts
|
24
|
+
end
|
25
|
+
|
26
|
+
def resolve_additional_import_paths
|
27
|
+
(additional_import_paths || []).map do |path|
|
28
|
+
if project_path && !absolute_path?(path)
|
29
|
+
File.join(project_path, path)
|
30
|
+
else
|
31
|
+
path
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def absolute_path?(path)
|
37
|
+
# This is only going to work on unix, gonna need a better implementation.
|
38
|
+
path.index(File::SEPARATOR) == 0
|
39
|
+
end
|
40
|
+
|
41
|
+
def to_sass_engine_options
|
42
|
+
engine_opts = {:load_paths => sass_load_paths}
|
43
|
+
engine_opts[:style] = output_style if output_style
|
44
|
+
engine_opts[:line_comments] = line_comments if environment
|
45
|
+
engine_opts.merge!(sass_options || {})
|
46
|
+
end
|
47
|
+
|
48
|
+
def sass_load_paths
|
49
|
+
load_paths = []
|
50
|
+
load_paths << sass_path if sass_path
|
51
|
+
Compass::Frameworks::ALL.each do |framework|
|
52
|
+
load_paths << framework.stylesheets_directory
|
53
|
+
end
|
54
|
+
load_paths += resolve_additional_import_paths
|
55
|
+
load_paths
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Compass
|
2
|
+
module Configuration
|
3
|
+
# Comments are emitted into the configuration file when serialized and make it easier to understand for new users.
|
4
|
+
module Comments
|
5
|
+
|
6
|
+
def comment_for_http_path
|
7
|
+
"# Set this to the root of your project when deployed:\n"
|
8
|
+
end
|
9
|
+
|
10
|
+
def comment_for_relative_assets
|
11
|
+
unless relative_assets
|
12
|
+
%q{# To enable relative paths to assets via compass helper functions. Uncomment:
|
13
|
+
# relative_assets = true
|
14
|
+
}
|
15
|
+
else
|
16
|
+
""
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,103 @@
|
|
1
|
+
module Compass
|
2
|
+
module Configuration
|
3
|
+
# The Compass configuration data storage class manages configuration data that comes from a variety of
|
4
|
+
# different sources and aggregates them together into a consistent API
|
5
|
+
# Some of the possible sources of configuration data:
|
6
|
+
# * Compass default project structure for stand alone projects
|
7
|
+
# * App framework specific project structures for rails, etc.
|
8
|
+
# * User supplied explicit configuration
|
9
|
+
# * Configuration data provided via the command line interface
|
10
|
+
#
|
11
|
+
# There are two kinds of configuration data that doesn't come from the user:
|
12
|
+
#
|
13
|
+
# 1. Configuration data that is defaulted as if the user had provided it themselves.
|
14
|
+
# This is useful for providing defaults that the user is likely to want to edit
|
15
|
+
# but shouldn't have to provide explicitly when getting started
|
16
|
+
# 2. Configuration data that is defaulted behind the scenes because _some_ value is
|
17
|
+
# required.
|
18
|
+
class Data
|
19
|
+
|
20
|
+
attr_accessor :required_libraries
|
21
|
+
|
22
|
+
include Compass::Configuration::Inheritance
|
23
|
+
include Compass::Configuration::Serialization
|
24
|
+
include Compass::Configuration::Adapters
|
25
|
+
|
26
|
+
inherited_accessor *ATTRIBUTES
|
27
|
+
|
28
|
+
def initialize(attr_hash = nil)
|
29
|
+
self.required_libraries = []
|
30
|
+
set_all(attr_hash) if attr_hash
|
31
|
+
self.top_level = self
|
32
|
+
end
|
33
|
+
|
34
|
+
def set_all(attr_hash)
|
35
|
+
# assert_valid_keys!(attr_hash)
|
36
|
+
attr_hash.each do |a, v|
|
37
|
+
if self.respond_to?("#{a}=")
|
38
|
+
self.send("#{a}=", v)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def add_import_path(*paths)
|
44
|
+
# The @added_import_paths variable works around an issue where
|
45
|
+
# the additional_import_paths gets overwritten during parse
|
46
|
+
@added_import_paths ||= []
|
47
|
+
@added_import_paths += paths
|
48
|
+
self.additional_import_paths ||= []
|
49
|
+
self.additional_import_paths += paths
|
50
|
+
end
|
51
|
+
|
52
|
+
# When called with a block, defines the asset host url to be used.
|
53
|
+
# The block must return a string that starts with a protocol (E.g. http).
|
54
|
+
# The block will be passed the root-relative url of the asset.
|
55
|
+
# When called without a block, returns the block that was previously set.
|
56
|
+
def asset_host(&block)
|
57
|
+
if block_given?
|
58
|
+
@asset_host = block
|
59
|
+
else
|
60
|
+
@asset_host
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
# When called with a block, defines the cache buster strategy to be used.
|
65
|
+
# The block must return nil or a string that can be appended to a url as a query parameter.
|
66
|
+
# The returned string must not include the starting '?'.
|
67
|
+
# The block will be passed the root-relative url of the asset.
|
68
|
+
# If the block accepts two arguments, it will also be passed a File object
|
69
|
+
# that points to the asset on disk -- which may or may not exist.
|
70
|
+
# When called without a block, returns the block that was previously set.
|
71
|
+
def asset_cache_buster(&block)
|
72
|
+
if block_given?
|
73
|
+
@asset_cache_buster = block
|
74
|
+
else
|
75
|
+
@asset_cache_buster
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
# Require a compass plugin and capture that it occured so that the configuration serialization works next time.
|
80
|
+
def require(lib)
|
81
|
+
required_libraries << lib
|
82
|
+
super
|
83
|
+
end
|
84
|
+
|
85
|
+
def relative_assets?
|
86
|
+
# the http_images_path is deprecated, but here for backwards compatibility.
|
87
|
+
relative_assets || http_images_path == :relative
|
88
|
+
end
|
89
|
+
|
90
|
+
private
|
91
|
+
|
92
|
+
def assert_valid_keys!(attr_hash)
|
93
|
+
illegal_attrs = attr_hash.keys - ATTRIBUTES
|
94
|
+
if illegal_attrs.size == 1
|
95
|
+
raise Error, "#{illegal_attrs.first.inspect} is not a valid configuration attribute."
|
96
|
+
elsif illegal_attrs.size > 0
|
97
|
+
raise Error, "Illegal configuration attributes: #{illegal_attrs.map{|a| a.inspect}.join(", ")}"
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
@@ -0,0 +1,107 @@
|
|
1
|
+
module Compass
|
2
|
+
module Configuration
|
3
|
+
module Defaults
|
4
|
+
|
5
|
+
def default_project_type
|
6
|
+
:stand_alone
|
7
|
+
end
|
8
|
+
|
9
|
+
def http_path_without_default
|
10
|
+
"/"
|
11
|
+
end
|
12
|
+
|
13
|
+
def default_extensions_dir
|
14
|
+
"extensions"
|
15
|
+
end
|
16
|
+
|
17
|
+
def default_output_style
|
18
|
+
if top_level.environment == :development
|
19
|
+
:expanded
|
20
|
+
else
|
21
|
+
:compact
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def default_line_comments
|
26
|
+
top_level.environment == :development
|
27
|
+
end
|
28
|
+
|
29
|
+
def default_sass_path
|
30
|
+
if (pp = top_level.project_path) && (dir = top_level.sass_dir)
|
31
|
+
File.join(pp, dir)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def default_css_path
|
36
|
+
if (pp = top_level.project_path) && (dir = top_level.css_dir)
|
37
|
+
File.join(pp, dir)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def default_images_path
|
42
|
+
if (pp = top_level.project_path) && (dir = top_level.images_dir)
|
43
|
+
File.join(pp, dir)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def default_javascripts_path
|
48
|
+
if (pp = top_level.project_path) && (dir = top_level.javascripts_dir)
|
49
|
+
File.join(pp, dir)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def default_extensions_path
|
54
|
+
if (pp = top_level.project_path) && (dir = top_level.extensions_dir)
|
55
|
+
File.join(pp, dir)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
|
60
|
+
def default_http_images_dir
|
61
|
+
top_level.images_dir
|
62
|
+
end
|
63
|
+
|
64
|
+
def default_http_images_path
|
65
|
+
http_root_relative top_level.http_images_dir
|
66
|
+
end
|
67
|
+
|
68
|
+
def default_http_stylesheets_dir
|
69
|
+
top_level.css_dir
|
70
|
+
end
|
71
|
+
|
72
|
+
def default_http_stylesheets_path
|
73
|
+
http_root_relative top_level.http_stylesheets_dir
|
74
|
+
end
|
75
|
+
|
76
|
+
def default_http_javascripts_dir
|
77
|
+
top_level.javascripts_dir
|
78
|
+
end
|
79
|
+
|
80
|
+
def default_http_javascripts_path
|
81
|
+
http_root_relative top_level.http_javascripts_dir
|
82
|
+
end
|
83
|
+
|
84
|
+
# helper functions
|
85
|
+
|
86
|
+
def http_join(*segments)
|
87
|
+
segments.map do |segment|
|
88
|
+
segment = http_pathify(segment)
|
89
|
+
segment[-1..-1] == "/" ? segment[0..-2] : segment
|
90
|
+
end.join("/")
|
91
|
+
end
|
92
|
+
|
93
|
+
def http_pathify(path)
|
94
|
+
if File::SEPARATOR == "/"
|
95
|
+
path
|
96
|
+
else
|
97
|
+
path.gsub(File::SEPARATOR, "/")
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
def http_root_relative(path)
|
102
|
+
http_join top_level.http_path, path
|
103
|
+
end
|
104
|
+
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
@@ -0,0 +1,83 @@
|
|
1
|
+
module Compass
|
2
|
+
module Configuration
|
3
|
+
# The helpers are available as methods on the Compass module. E.g. Compass.configuration
|
4
|
+
module Helpers
|
5
|
+
def configuration
|
6
|
+
@configuration ||= default_configuration
|
7
|
+
if block_given?
|
8
|
+
yield @configuration
|
9
|
+
end
|
10
|
+
@configuration
|
11
|
+
end
|
12
|
+
|
13
|
+
def default_configuration
|
14
|
+
Data.new.extend(Defaults).extend(Comments)
|
15
|
+
end
|
16
|
+
|
17
|
+
def add_configuration(config, filename = nil)
|
18
|
+
return if config.nil?
|
19
|
+
data = if config.is_a?(Compass::Configuration::Data)
|
20
|
+
config
|
21
|
+
elsif config.respond_to?(:read)
|
22
|
+
Compass::Configuration::Data.new_from_string(config.read, filename)
|
23
|
+
elsif config.is_a?(Hash)
|
24
|
+
Compass::Configuration::Data.new(config)
|
25
|
+
elsif config.is_a?(String)
|
26
|
+
Compass::Configuration::Data.new_from_file(config)
|
27
|
+
else
|
28
|
+
raise "I don't know what to do with: #{config.inspect}"
|
29
|
+
end
|
30
|
+
data.inherit_from!(configuration)
|
31
|
+
data.on_top!
|
32
|
+
@configuration = data
|
33
|
+
end
|
34
|
+
|
35
|
+
# Support for testing.
|
36
|
+
def reset_configuration!
|
37
|
+
@configuration = nil
|
38
|
+
end
|
39
|
+
|
40
|
+
def sass_plugin_configuration
|
41
|
+
configuration.to_sass_plugin_options
|
42
|
+
end
|
43
|
+
|
44
|
+
def configure_sass_plugin!
|
45
|
+
@sass_plugin_configured = true
|
46
|
+
Sass::Plugin.options.merge!(sass_plugin_configuration)
|
47
|
+
end
|
48
|
+
|
49
|
+
def sass_plugin_configured?
|
50
|
+
@sass_plugin_configured
|
51
|
+
end
|
52
|
+
|
53
|
+
def sass_engine_options
|
54
|
+
configuration.to_sass_engine_options
|
55
|
+
end
|
56
|
+
|
57
|
+
# Read the configuration file for this project
|
58
|
+
def add_project_configuration(configuration_file_path = nil)
|
59
|
+
configuration_file_path ||= detect_configuration_file
|
60
|
+
Compass.add_configuration(configuration_file_path) if configuration_file_path
|
61
|
+
end
|
62
|
+
|
63
|
+
# Returns a full path to the relative path to the project directory
|
64
|
+
def projectize(path, project_path = nil)
|
65
|
+
project_path ||= configuration.project_path
|
66
|
+
File.join(project_path, *path.split('/'))
|
67
|
+
end
|
68
|
+
|
69
|
+
# TODO: Deprecate the src/config.rb location.
|
70
|
+
KNOWN_CONFIG_LOCATIONS = [".compass/config.rb", "config/compass.config", "config.rb", "src/config.rb"]
|
71
|
+
|
72
|
+
# Finds the configuration file, if it exists in a known location.
|
73
|
+
def detect_configuration_file(project_path = nil)
|
74
|
+
possible_files = KNOWN_CONFIG_LOCATIONS.map{|f| projectize(f, project_path) }
|
75
|
+
possible_files.detect{|f| File.exists?(f)}
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
extend Configuration::Helpers
|
82
|
+
|
83
|
+
end
|