compass 0.8.17 → 0.10.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.markdown +165 -0
- data/README.markdown +15 -3
- data/Rakefile +46 -7
- data/VERSION.yml +3 -2
- data/bin/compass +22 -4
- data/examples/blueprint_default/index.html.haml +3 -3
- data/examples/blueprint_default/parts/forms.html.haml +2 -0
- data/examples/blueprint_default/src/screen.sass +1 -1
- data/examples/blueprint_plugins/index.html.haml +6 -6
- data/examples/blueprint_plugins/src/buttons.sass +2 -2
- data/examples/blueprint_plugins/src/link_icons.sass +1 -1
- data/examples/blueprint_plugins/src/rtl_screen.sass +3 -3
- data/examples/blueprint_plugins/src/screen.sass +2 -2
- data/examples/blueprint_scoped/src/ie.sass +2 -1
- data/examples/blueprint_scoped/src/print.sass +2 -1
- data/examples/blueprint_scoped/src/screen.sass +2 -1
- data/examples/blueprint_semantic/parts/fancy_type.html.haml +1 -1
- data/examples/blueprint_semantic/src/liquid.sass +5 -6
- data/examples/blueprint_semantic/src/screen.sass +4 -5
- data/examples/compass/bootstrap.rb +3 -0
- data/{frameworks → examples/compass/extensions}/yui/stylesheets/_yui.sass +0 -0
- data/examples/compass/extensions/yui/stylesheets/yui/modules/_base.sass +70 -0
- data/{frameworks → examples/compass/extensions}/yui/stylesheets/yui/modules/_fonts.sass +8 -1
- data/{frameworks → examples/compass/extensions}/yui/stylesheets/yui/modules/_grids.sass +174 -130
- data/{frameworks → examples/compass/extensions}/yui/stylesheets/yui/modules/_reset.sass +0 -0
- data/{frameworks → examples/compass/extensions}/yui/templates/project/manifest.rb +0 -0
- data/{frameworks → examples/compass/extensions}/yui/templates/project/screen.sass +0 -0
- data/examples/compass/src/utilities.sass +2 -2
- data/examples/css3/config.rb +6 -0
- data/examples/css3/extensions/fancy-fonts/templates/project/Vtks Revolt.ttf +0 -0
- data/examples/css3/extensions/fancy-fonts/templates/project/angelina.ttf +0 -0
- data/examples/css3/extensions/fancy-fonts/templates/project/fancy-fonts.sass +7 -0
- data/examples/css3/extensions/fancy-fonts/templates/project/manifest.rb +5 -0
- data/examples/css3/images/fresh-peas.jpg +0 -0
- data/examples/css3/index.html.haml +55 -0
- data/examples/css3/src/_base.sass +14 -0
- data/examples/css3/src/fancy-fonts.sass +7 -0
- data/examples/css3/src/gradient.sass +10 -0
- data/examples/css3/src/main.sass +80 -0
- data/examples/css3/stylesheets/fonts/Vtks Revolt.ttf +0 -0
- data/examples/css3/stylesheets/fonts/angelina.ttf +0 -0
- data/examples/downloader.rb +57 -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/susy/bootstrap.rb +3 -0
- data/examples/susy/config.rb +9 -0
- data/examples/susy/extensions/susy/LICENSE.txt +28 -0
- data/examples/susy/extensions/susy/README.mkdn +235 -0
- data/examples/susy/extensions/susy/compass-susy-plugin.gemspec +35 -0
- data/examples/susy/extensions/susy/docs/tutorial/build.sh +141 -0
- data/examples/susy/extensions/susy/docs/tutorial/code/01_target/src/_defaults.sass +100 -0
- data/examples/susy/extensions/susy/docs/tutorial/code/01_target/src/screen.sass +98 -0
- data/examples/susy/extensions/susy/docs/tutorial/code/02_container/src/_defaults.sass +147 -0
- data/examples/susy/extensions/susy/docs/tutorial/code/02_container/src/screen.sass +19 -0
- data/examples/susy/extensions/susy/docs/tutorial/code/03_structure/src/_defaults.sass +147 -0
- data/examples/susy/extensions/susy/docs/tutorial/code/03_structure/src/screen.sass +48 -0
- data/examples/susy/extensions/susy/docs/tutorial/code/_common/config.rb +14 -0
- data/examples/susy/extensions/susy/docs/tutorial/code/_common/images/grid.png +0 -0
- data/examples/susy/extensions/susy/docs/tutorial/code/_common/images/susy_logo.png +0 -0
- data/examples/susy/extensions/susy/docs/tutorial/code/_common/src/_base.sass +63 -0
- data/examples/susy/extensions/susy/docs/tutorial/code/_tools/Markdown.pl +1450 -0
- data/examples/susy/extensions/susy/docs/tutorial/code/site/src/_defaults.sass +100 -0
- data/examples/susy/extensions/susy/docs/tutorial/code/site/src/screen.sass +91 -0
- data/examples/susy/extensions/susy/docs/tutorial/figures/susy_element.png +0 -0
- data/examples/susy/extensions/susy/docs/tutorial/figures/susy_grid.png +0 -0
- data/examples/susy/extensions/susy/docs/tutorial/index.mkdn +301 -0
- data/examples/susy/extensions/susy/lib/susy.rb +2 -0
- data/examples/susy/extensions/susy/lib/susy/compass_plugin.rb +5 -0
- data/examples/susy/extensions/susy/lib/susy/sass_extensions.rb +79 -0
- data/examples/susy/extensions/susy/sass/susy/_grid.sass +128 -0
- data/examples/susy/extensions/susy/sass/susy/_reset.sass +7 -0
- data/examples/susy/extensions/susy/sass/susy/_susy.sass +23 -0
- data/examples/susy/extensions/susy/sass/susy/_text.sass +15 -0
- data/examples/susy/extensions/susy/sass/susy/_utils.sass +81 -0
- data/examples/susy/extensions/susy/templates/project/_base.sass +62 -0
- data/examples/susy/extensions/susy/templates/project/_defaults.sass +147 -0
- data/examples/susy/extensions/susy/templates/project/ie.sass +9 -0
- data/examples/susy/extensions/susy/templates/project/manifest.rb +5 -0
- data/examples/susy/extensions/susy/templates/project/print.sass +7 -0
- data/examples/susy/extensions/susy/templates/project/screen.sass +44 -0
- data/examples/susy/src/_base.sass +62 -0
- data/examples/susy/src/_defaults.sass +148 -0
- data/examples/susy/src/screen.sass +114 -0
- data/examples/yui/bootstrap.rb +3 -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/features/command_line.feature +226 -0
- data/features/extensions.feature +20 -0
- data/features/step_definitions/command_line_steps.rb +223 -0
- data/features/step_definitions/extension_steps.rb +13 -0
- data/lib/compass.rb +6 -7
- data/lib/compass/actions.rb +7 -1
- data/lib/compass/app_integration.rb +23 -4
- data/lib/compass/app_integration/merb.rb +1 -43
- data/lib/compass/app_integration/merb/runtime.rb +63 -0
- data/lib/compass/app_integration/rails.rb +24 -10
- data/lib/compass/app_integration/rails/configuration_defaults.rb +45 -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/stand_alone.rb +22 -0
- data/lib/compass/app_integration/stand_alone/configuration_defaults.rb +28 -0
- data/lib/compass/app_integration/stand_alone/installer.rb +83 -0
- data/lib/compass/commands.rb +11 -0
- data/lib/compass/commands/base.rb +4 -1
- data/lib/compass/commands/create_project.rb +108 -5
- data/lib/compass/commands/generate_grid_background.rb +73 -6
- data/lib/compass/commands/help.rb +89 -0
- data/lib/compass/commands/installer_command.rb +20 -13
- data/lib/compass/commands/interactive.rb +61 -0
- data/lib/compass/commands/list_frameworks.rb +2 -2
- data/lib/compass/commands/print_version.rb +72 -4
- data/lib/compass/commands/project_base.rb +14 -34
- data/lib/compass/commands/project_stats.rb +162 -0
- data/lib/compass/commands/registry.rb +22 -0
- data/lib/compass/commands/stamp_pattern.rb +56 -3
- data/lib/compass/commands/update_project.rb +60 -6
- data/lib/compass/commands/validate_project.rb +62 -6
- data/lib/compass/commands/watch_project.rb +12 -5
- data/lib/compass/commands/write_configuration.rb +89 -4
- data/lib/compass/compiler.rb +13 -4
- data/lib/compass/configuration.rb +29 -310
- data/lib/compass/configuration/adapters.rb +59 -0
- data/lib/compass/configuration/comments.rb +22 -0
- data/lib/compass/configuration/data.rb +106 -0
- data/lib/compass/configuration/defaults.rb +138 -0
- data/lib/compass/configuration/helpers.rb +120 -0
- data/lib/compass/configuration/inheritance.rb +170 -0
- data/lib/compass/configuration/serialization.rb +86 -0
- data/lib/compass/dependencies.rb +4 -8
- data/lib/compass/errors.rb +4 -1
- data/lib/compass/exec.rb +11 -246
- 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 +46 -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 +70 -7
- data/lib/compass/frameworks/blueprint/stylesheets/_blueprint.sass +31 -0
- data/{frameworks/blueprint/stylesheets/blueprint/modules → lib/compass/frameworks/blueprint/stylesheets/blueprint}/_buttons.sass +27 -27
- data/{frameworks/blueprint/stylesheets/blueprint/modules → lib/compass/frameworks/blueprint/stylesheets/blueprint}/_colors.sass +0 -0
- data/{frameworks/blueprint/stylesheets/blueprint/modules → lib/compass/frameworks/blueprint/stylesheets/blueprint}/_debug.sass +2 -2
- data/{frameworks/blueprint/stylesheets/blueprint/modules → lib/compass/frameworks/blueprint/stylesheets/blueprint}/_fancy_type.sass +19 -19
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_form.sass +56 -0
- data/{frameworks/blueprint/stylesheets/blueprint/modules → lib/compass/frameworks/blueprint/stylesheets/blueprint}/_grid.sass +34 -33
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_ie.sass +99 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_interaction.sass +58 -0
- data/{frameworks/blueprint/stylesheets/blueprint/modules → lib/compass/frameworks/blueprint/stylesheets/blueprint}/_link_icons.sass +9 -9
- data/{frameworks/blueprint/stylesheets/blueprint/modules → lib/compass/frameworks/blueprint/stylesheets/blueprint}/_liquid.sass +29 -29
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_print.sass +87 -0
- data/{frameworks/blueprint/stylesheets/blueprint/modules → lib/compass/frameworks/blueprint/stylesheets/blueprint}/_reset.sass +20 -18
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_rtl.sass +123 -0
- data/{frameworks/blueprint/stylesheets/blueprint/modules → lib/compass/frameworks/blueprint/stylesheets/blueprint}/_scaffolding.sass +6 -4
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_screen.sass +2 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_typography.sass +162 -0
- data/{frameworks/blueprint/stylesheets/blueprint/modules → lib/compass/frameworks/blueprint/stylesheets/blueprint}/_utilities.sass +15 -15
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_buttons.sass +2 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_colors.sass +2 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_debug.sass +2 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_fancy_type.sass +2 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_form.sass +2 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_grid.sass +2 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_interaction.sass +2 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_link_icons.sass +2 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_liquid.sass +3 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_reset.sass +2 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_rtl.sass +2 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_scaffolding.sass +2 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_typography.sass +2 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_utilities.sass +2 -0
- data/{frameworks → lib/compass/frameworks}/blueprint/templates/buttons/buttons.sass +4 -4
- data/{frameworks → lib/compass/frameworks}/blueprint/templates/buttons/buttons/cross.png +0 -0
- data/{frameworks → lib/compass/frameworks}/blueprint/templates/buttons/buttons/key.png +0 -0
- data/{frameworks → lib/compass/frameworks}/blueprint/templates/buttons/buttons/tick.png +0 -0
- data/lib/compass/frameworks/blueprint/templates/buttons/manifest.rb +17 -0
- data/{frameworks → lib/compass/frameworks}/blueprint/templates/link_icons/link_icons.sass +1 -1
- data/{frameworks → lib/compass/frameworks}/blueprint/templates/link_icons/link_icons/doc.png +0 -0
- data/{frameworks → lib/compass/frameworks}/blueprint/templates/link_icons/link_icons/email.png +0 -0
- data/{frameworks → lib/compass/frameworks}/blueprint/templates/link_icons/link_icons/external.png +0 -0
- data/{frameworks → lib/compass/frameworks}/blueprint/templates/link_icons/link_icons/feed.png +0 -0
- data/{frameworks → lib/compass/frameworks}/blueprint/templates/link_icons/link_icons/im.png +0 -0
- data/{frameworks → lib/compass/frameworks}/blueprint/templates/link_icons/link_icons/pdf.png +0 -0
- data/{frameworks → lib/compass/frameworks}/blueprint/templates/link_icons/link_icons/visited.png +0 -0
- data/{frameworks → lib/compass/frameworks}/blueprint/templates/link_icons/link_icons/xls.png +0 -0
- data/lib/compass/frameworks/blueprint/templates/link_icons/manifest.rb +23 -0
- data/{frameworks → 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 +32 -0
- data/{frameworks → lib/compass/frameworks}/blueprint/templates/project/partials/_base.sass +0 -0
- data/lib/compass/frameworks/blueprint/templates/project/print.sass +8 -0
- data/{frameworks → lib/compass/frameworks}/blueprint/templates/project/screen.sass +3 -2
- data/lib/compass/frameworks/blueprint/templates/project/welcome.html.haml +21 -0
- data/lib/compass/frameworks/compass/stylesheets/_compass.sass +2 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/_css3.sass +14 -0
- data/{frameworks → lib/compass/frameworks}/compass/stylesheets/compass/_layout.sass +0 -0
- data/{frameworks → lib/compass/frameworks}/compass/stylesheets/compass/_misc.sass +12 -12
- data/{frameworks → lib/compass/frameworks}/compass/stylesheets/compass/_reset.sass +0 -0
- data/{frameworks → lib/compass/frameworks}/compass/stylesheets/compass/_utilities.sass +0 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/css3/_background_clip.sass +16 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/css3/_background_origin.sass +18 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/css3/_background_size.sass +14 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/css3/_border_radius.sass +47 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/css3/_box_shadow.sass +20 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/css3/_box_sizing.sass +13 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/css3/_columns.sass +37 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/css3/_font_face.sass +31 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/css3/_gradient.sass +40 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/css3/_inline_block.sass +7 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/css3/_opacity.sass +18 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/css3/_text_shadow.sass +15 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/css3/_transform.sass +62 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/css3/_transition.sass +57 -0
- data/{frameworks → lib/compass/frameworks}/compass/stylesheets/compass/layout/_sticky_footer.sass +9 -7
- data/{frameworks → lib/compass/frameworks}/compass/stylesheets/compass/utilities/_general.sass +0 -1
- data/{frameworks → lib/compass/frameworks}/compass/stylesheets/compass/utilities/_links.sass +1 -1
- data/{frameworks → lib/compass/frameworks}/compass/stylesheets/compass/utilities/_lists.sass +0 -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/{frameworks → lib/compass/frameworks}/compass/stylesheets/compass/utilities/_tables.sass +0 -0
- data/{frameworks → lib/compass/frameworks}/compass/stylesheets/compass/utilities/_text.sass +0 -0
- data/{frameworks → lib/compass/frameworks}/compass/stylesheets/compass/utilities/general/_clearfix.sass +7 -7
- data/{frameworks → lib/compass/frameworks}/compass/stylesheets/compass/utilities/general/_float.sass +2 -2
- data/{frameworks → lib/compass/frameworks}/compass/stylesheets/compass/utilities/general/_hacks.sass +2 -2
- data/{frameworks → lib/compass/frameworks}/compass/stylesheets/compass/utilities/general/_reset.sass +28 -28
- data/{frameworks → 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/{frameworks → lib/compass/frameworks}/compass/stylesheets/compass/utilities/links/_hover_link.sass +2 -2
- data/{frameworks → lib/compass/frameworks}/compass/stylesheets/compass/utilities/links/_link_colors.sass +6 -6
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/links/_unstyled_link.sass +7 -0
- data/{frameworks → lib/compass/frameworks}/compass/stylesheets/compass/utilities/lists/_bullets.sass +6 -6
- data/{frameworks → lib/compass/frameworks}/compass/stylesheets/compass/utilities/lists/_horizontal_list.sass +6 -6
- data/{frameworks → lib/compass/frameworks}/compass/stylesheets/compass/utilities/lists/_inline_list.sass +9 -9
- 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/{frameworks → lib/compass/frameworks}/compass/stylesheets/compass/utilities/text/_ellipsis.sass +0 -0
- data/{frameworks → lib/compass/frameworks}/compass/stylesheets/compass/utilities/text/_nowrap.sass +1 -1
- data/{frameworks → lib/compass/frameworks}/compass/stylesheets/compass/utilities/text/_replacement.sass +6 -6
- data/{frameworks → lib/compass/frameworks}/compass/templates/ellipsis/ellipsis.sass +0 -0
- data/lib/compass/frameworks/compass/templates/ellipsis/manifest.rb +27 -0
- data/{frameworks → lib/compass/frameworks}/compass/templates/ellipsis/xml/ellipsis.xml +0 -0
- data/lib/compass/frameworks/compass/templates/extension/manifest.rb +20 -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/USAGE.markdown +32 -0
- data/{frameworks → lib/compass/frameworks}/compass/templates/project/ie.sass +0 -0
- data/{frameworks → lib/compass/frameworks}/compass/templates/project/manifest.rb +1 -0
- data/{frameworks → lib/compass/frameworks}/compass/templates/project/print.sass +0 -0
- data/{frameworks → lib/compass/frameworks}/compass/templates/project/screen.sass +0 -0
- data/lib/compass/grid_builder.rb +15 -11
- data/lib/compass/installers.rb +3 -5
- data/lib/compass/installers/bare_installer.rb +58 -0
- data/lib/compass/installers/base.rb +40 -51
- data/lib/compass/installers/manifest.rb +55 -2
- data/lib/compass/installers/manifest_installer.rb +59 -0
- data/lib/compass/installers/template_context.rb +44 -0
- data/lib/compass/logger.rb +28 -2
- data/lib/compass/sass_extensions.rb +2 -2
- data/lib/compass/sass_extensions/functions.rb +4 -2
- data/lib/compass/sass_extensions/functions/color_stop.rb +10 -0
- data/lib/compass/sass_extensions/functions/font_files.rb +11 -0
- data/lib/compass/sass_extensions/functions/inline_image.rb +22 -1
- data/lib/compass/sass_extensions/functions/selectors.rb +4 -1
- data/lib/compass/sass_extensions/functions/urls.rb +22 -2
- data/lib/compass/sass_extensions/monkey_patches.rb +3 -3
- data/lib/compass/sass_extensions/monkey_patches/traversal.rb +23 -0
- data/lib/compass/stats.rb +92 -0
- data/lib/compass/validator.rb +2 -3
- data/lib/vendor/fssm/state.rb +1 -1
- data/test/command_line_helper.rb +19 -16
- data/test/command_line_test.rb +5 -4
- data/test/compass_test.rb +16 -15
- data/test/configuration_test.rb +24 -19
- data/test/fixtures/stylesheets/blueprint/css/typography.css +5 -3
- data/test/fixtures/stylesheets/blueprint/sass/screen.sass +1 -1
- data/test/fixtures/stylesheets/blueprint/sass/typography.sass +2 -2
- data/test/fixtures/stylesheets/compass/css/layout.css +2 -0
- data/test/fixtures/stylesheets/compass/css/print.css +2 -8
- data/test/fixtures/stylesheets/compass/css/reset.css +3 -3
- data/test/fixtures/stylesheets/image_urls/css/screen.css +2 -0
- data/test/fixtures/stylesheets/relative/assets/images/testing.png +0 -0
- data/test/fixtures/stylesheets/relative/config.rb +9 -0
- data/test/fixtures/stylesheets/relative/css/ie.css +1 -0
- data/test/fixtures/stylesheets/relative/css/print.css +1 -0
- data/test/fixtures/stylesheets/relative/css/screen.css +1 -0
- data/test/fixtures/stylesheets/relative/sass/ie.sass +6 -0
- data/test/fixtures/stylesheets/relative/sass/print.sass +6 -0
- data/test/fixtures/stylesheets/relative/sass/screen.sass +3 -0
- data/test/io_helper.rb +36 -0
- data/test/rails_helper.rb +40 -0
- data/test/rails_integration_test.rb +7 -44
- data/test/sass_extensions_test.rb +2 -2
- data/test/test_helper.rb +9 -2
- metadata +257 -110
- data/frameworks/blueprint.rb +0 -2
- data/frameworks/blueprint/stylesheets/_blueprint.sass +0 -3
- data/frameworks/blueprint/stylesheets/blueprint/_ie.sass +0 -93
- data/frameworks/blueprint/stylesheets/blueprint/_print.sass +0 -83
- data/frameworks/blueprint/stylesheets/blueprint/_reset.sass +0 -3
- data/frameworks/blueprint/stylesheets/blueprint/_screen.sass +0 -15
- data/frameworks/blueprint/stylesheets/blueprint/modules/_form.sass +0 -55
- data/frameworks/blueprint/stylesheets/blueprint/modules/_interaction.sass +0 -58
- data/frameworks/blueprint/stylesheets/blueprint/modules/_rtl.sass +0 -104
- data/frameworks/blueprint/stylesheets/blueprint/modules/_typography.sass +0 -155
- data/frameworks/blueprint/templates/buttons/manifest.rb +0 -5
- data/frameworks/blueprint/templates/link_icons/manifest.rb +0 -10
- data/frameworks/blueprint/templates/project/ie.sass +0 -15
- data/frameworks/blueprint/templates/project/manifest.rb +0 -6
- data/frameworks/blueprint/templates/project/print.sass +0 -3
- data/frameworks/compass.rb +0 -2
- data/frameworks/compass/stylesheets/_compass.sass +0 -1
- data/frameworks/compass/stylesheets/compass/utilities/_print.sass +0 -24
- data/frameworks/compass/stylesheets/compass/utilities/_sprites.sass +0 -1
- data/frameworks/compass/stylesheets/compass/utilities/general/_inline_block.sass +0 -6
- data/frameworks/compass/stylesheets/compass/utilities/general/_tag_cloud.sass +0 -19
- data/frameworks/compass/stylesheets/compass/utilities/links/_unstyled_link.sass +0 -5
- data/frameworks/compass/stylesheets/compass/utilities/sprites/_sprite_img.sass +0 -12
- data/frameworks/compass/stylesheets/compass/utilities/tables/_alternating_rows_and_columns.sass +0 -20
- data/frameworks/compass/stylesheets/compass/utilities/tables/_borders.sass +0 -27
- data/frameworks/compass/stylesheets/compass/utilities/tables/_scaffolding.sass +0 -9
- data/frameworks/compass/templates/ellipsis/manifest.rb +0 -2
- data/frameworks/yui.rb +0 -2
- data/frameworks/yui/stylesheets/yui/modules/_base.sass +0 -60
- data/lib/compass/installers/rails.rb +0 -135
- data/lib/compass/installers/stand_alone.rb +0 -60
- data/test/fixtures/stylesheets/yui/config.rb +0 -9
- data/test/fixtures/stylesheets/yui/css/mixins.css +0 -13
- data/test/fixtures/stylesheets/yui/sass/base.sass +0 -3
- data/test/fixtures/stylesheets/yui/sass/fonts.sass +0 -3
- data/test/fixtures/stylesheets/yui/sass/grids.sass +0 -3
- data/test/fixtures/stylesheets/yui/sass/mixins.sass +0 -16
@@ -1,5 +1,5 @@
|
|
1
1
|
module Compass::SassExtensions
|
2
2
|
end
|
3
3
|
|
4
|
-
require
|
5
|
-
require
|
4
|
+
require 'compass/sass_extensions/functions'
|
5
|
+
require 'compass/sass_extensions/monkey_patches'
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module Compass::SassExtensions::Functions
|
2
2
|
end
|
3
3
|
|
4
|
-
|
5
|
-
require
|
4
|
+
%w(selectors enumerate urls display inline_image color_stop font_files).each do |func|
|
5
|
+
require "compass/sass_extensions/functions/#{func}"
|
6
6
|
end
|
7
7
|
|
8
8
|
module Sass::Script::Functions
|
@@ -11,6 +11,8 @@ module Sass::Script::Functions
|
|
11
11
|
include Compass::SassExtensions::Functions::Urls
|
12
12
|
include Compass::SassExtensions::Functions::Display
|
13
13
|
include Compass::SassExtensions::Functions::InlineImage
|
14
|
+
include Compass::SassExtensions::Functions::ColorStop
|
15
|
+
include Compass::SassExtensions::Functions::FontFiles
|
14
16
|
end
|
15
17
|
|
16
18
|
# Wierd that this has to be re-included to pick up sub-modules. Ruby bug?
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module Compass::SassExtensions::Functions::ColorStop
|
2
|
+
def color_stop(*args)
|
3
|
+
raise Sass::SyntaxError, "An even number of arguments must be passed to color-stop()" unless args.size % 2 == 0
|
4
|
+
stops = []
|
5
|
+
while args.size > 0
|
6
|
+
stops << "color-stop(#{args.shift}, #{args.shift})"
|
7
|
+
end
|
8
|
+
Sass::Script::String.new(stops.join(", "))
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Compass::SassExtensions::Functions::FontFiles
|
2
|
+
def font_files(*args)
|
3
|
+
raise Sass::SyntaxError, "An even number of arguments must be passed to font_files()" unless args.size % 2 == 0
|
4
|
+
files = []
|
5
|
+
while args.size > 0
|
6
|
+
files << "#{font_url(args.shift)} format('#{args.shift}')"
|
7
|
+
end
|
8
|
+
Sass::Script::String.new(files.join(", "))
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
@@ -3,11 +3,24 @@ module Compass::SassExtensions::Functions::InlineImage
|
|
3
3
|
|
4
4
|
def inline_image(path, mime_type = nil)
|
5
5
|
path = path.value
|
6
|
-
real_path = File.join(Compass.configuration.
|
6
|
+
real_path = File.join(Compass.configuration.images_path, path)
|
7
7
|
url = "url('data:#{compute_mime_type(path,mime_type)};base64,#{data(real_path)}')"
|
8
8
|
Sass::Script::String.new(url)
|
9
9
|
end
|
10
10
|
|
11
|
+
def inline_font_files(*args)
|
12
|
+
raise Sass::SyntaxError, "An even number of arguments must be passed to font_files()" unless args.size % 2 == 0
|
13
|
+
path = path.value
|
14
|
+
files = []
|
15
|
+
while args.size > 0
|
16
|
+
path = args.shift.value
|
17
|
+
real_path = File.join(Compass.configuration.fonts_path, path)
|
18
|
+
url = "url('data:#{compute_mime_type(path,mime_type)};base64,#{data(real_path)}')"
|
19
|
+
files << "#{url} format('#{args.shift}')"
|
20
|
+
end
|
21
|
+
Sass::Script::String.new(files.join(", "))
|
22
|
+
end
|
23
|
+
|
11
24
|
private
|
12
25
|
def compute_mime_type(path, mime_type)
|
13
26
|
return mime_type if mime_type
|
@@ -18,6 +31,14 @@ private
|
|
18
31
|
'image/jpeg'
|
19
32
|
when /\.gif$/i
|
20
33
|
'image/gif'
|
34
|
+
when /\.otf$/i
|
35
|
+
'font/opentype'
|
36
|
+
when /\.ttf$/i
|
37
|
+
'font/truetype'
|
38
|
+
when /\.woff$/i
|
39
|
+
'font/woff'
|
40
|
+
when /\.off$/i
|
41
|
+
'font/openfont'
|
21
42
|
when /\.([a-zA-Z]+)$/
|
22
43
|
"image/#{Regexp.last_match(1).downcase}"
|
23
44
|
else
|
@@ -33,7 +33,10 @@ module Compass::SassExtensions::Functions::Selectors
|
|
33
33
|
# #{append_selector(!selector, !to_append)}
|
34
34
|
# width: 2px
|
35
35
|
def append_selector(selector, to_append)
|
36
|
-
|
36
|
+
ancestors = selector.value.split(COMMA_SEPARATOR)
|
37
|
+
descendants = to_append.value.split(COMMA_SEPARATOR)
|
38
|
+
nested = ancestors.map{|a| descendants.map{|d| "#{a}#{d}"}.join(", ")}.join(", ")
|
39
|
+
Sass::Script::String.new(nested)
|
37
40
|
end
|
38
41
|
|
39
42
|
end
|
@@ -8,14 +8,34 @@ module Compass::SassExtensions::Functions::Urls
|
|
8
8
|
elsif Compass.configuration.http_stylesheets_path
|
9
9
|
Compass.configuration.http_stylesheets_path
|
10
10
|
else
|
11
|
-
Compass.configuration.
|
11
|
+
Compass.configuration.http_root_relative(Compass.configuration.css_dir)
|
12
12
|
end
|
13
13
|
|
14
14
|
url("#{http_stylesheets_path}/#{path}")
|
15
15
|
end
|
16
16
|
|
17
|
+
def font_url(path)
|
18
|
+
path = path.value # get to the string value of the literal.
|
19
|
+
|
20
|
+
# Short curcuit if they have provided an absolute url.
|
21
|
+
if absolute_path?(path)
|
22
|
+
return Sass::Script::String.new("url(#{path})")
|
23
|
+
end
|
24
|
+
|
25
|
+
# Compute the path to the font file, either root relative or stylesheet relative
|
26
|
+
# or nil if the http_fonts_path cannot be determined from the configuration.
|
27
|
+
http_fonts_path = if relative?
|
28
|
+
compute_relative_path(Compass.configuration.fonts_dir)
|
29
|
+
else
|
30
|
+
Compass.configuration.http_fonts_path
|
31
|
+
end
|
32
|
+
|
33
|
+
url("#{http_fonts_path}/#{path}")
|
34
|
+
end
|
35
|
+
|
17
36
|
def image_url(path)
|
18
37
|
path = path.value # get to the string value of the literal.
|
38
|
+
|
19
39
|
# Short curcuit if they have provided an absolute url.
|
20
40
|
if absolute_path?(path)
|
21
41
|
return Sass::Script::String.new("url(#{path})")
|
@@ -28,7 +48,7 @@ module Compass::SassExtensions::Functions::Urls
|
|
28
48
|
elsif Compass.configuration.http_images_path
|
29
49
|
Compass.configuration.http_images_path
|
30
50
|
else
|
31
|
-
Compass.configuration.
|
51
|
+
Compass.configuration.http_root_relative(Compass.configuration.images_dir)
|
32
52
|
end
|
33
53
|
|
34
54
|
# Compute the real path to the image on the file stystem if the images_dir is set.
|
@@ -1,3 +1,3 @@
|
|
1
|
-
|
2
|
-
require
|
3
|
-
end
|
1
|
+
%w(stylesheet_updating traversal).each do |patch|
|
2
|
+
require "compass/sass_extensions/monkey_patches/#{patch}"
|
3
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Sass
|
2
|
+
module Tree
|
3
|
+
class Node
|
4
|
+
unless method_defined?(:visit_depth_first)
|
5
|
+
def visit_depth_first(visitor)
|
6
|
+
visitor.visit(self)
|
7
|
+
visitor.down(self) if children.any? and visitor.respond_to?(:down)
|
8
|
+
if is_a?(ImportNode) && visitor.import?(self)
|
9
|
+
root = Sass::Files.tree_for(import, @options)
|
10
|
+
imported_children = root.children
|
11
|
+
end
|
12
|
+
|
13
|
+
(imported_children || children).each do |child|
|
14
|
+
break if visitor.respond_to?(:stop?) && visitor.stop?
|
15
|
+
child.visit_depth_first(visitor)
|
16
|
+
end
|
17
|
+
visitor.up(self) if children.any?
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
@@ -0,0 +1,92 @@
|
|
1
|
+
module Compass
|
2
|
+
module Stats
|
3
|
+
class StatsVisitor
|
4
|
+
attr_accessor :rule_count, :prop_count, :mixin_def_count, :mixin_count
|
5
|
+
def initialize
|
6
|
+
self.rule_count = 0
|
7
|
+
self.prop_count = 0
|
8
|
+
self.mixin_def_count = 0
|
9
|
+
self.mixin_count = 0
|
10
|
+
end
|
11
|
+
def visit(node)
|
12
|
+
self.prop_count += 1 if node.is_a?(Sass::Tree::PropNode) && !node.children.any?
|
13
|
+
if node.is_a?(Sass::Tree::RuleNode)
|
14
|
+
self.rule_count += node.rules.map{|r| r.split(/,/)}.flatten.compact.size
|
15
|
+
end
|
16
|
+
self.mixin_def_count += 1 if node.is_a?(Sass::Tree::MixinDefNode)
|
17
|
+
self.mixin_count += 1 if node.is_a?(Sass::Tree::MixinNode)
|
18
|
+
end
|
19
|
+
def up(node)
|
20
|
+
end
|
21
|
+
def down(node)
|
22
|
+
end
|
23
|
+
def import?(node)
|
24
|
+
return false
|
25
|
+
full_filename = node.send(:import)
|
26
|
+
full_filename != Compass.deprojectize(full_filename)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
class CssFile
|
30
|
+
attr_accessor :path, :css
|
31
|
+
attr_accessor :selector_count, :prop_count
|
32
|
+
def initialize(path)
|
33
|
+
require 'css_parser'
|
34
|
+
self.path = path
|
35
|
+
self.css = CssParser::Parser.new
|
36
|
+
self.css.add_block!(contents)
|
37
|
+
self.selector_count = 0
|
38
|
+
self.prop_count = 0
|
39
|
+
end
|
40
|
+
def contents
|
41
|
+
@contents ||= File.read(path)
|
42
|
+
end
|
43
|
+
def lines
|
44
|
+
contents.inject(0){|m,c| m + 1 }
|
45
|
+
end
|
46
|
+
def analyze!
|
47
|
+
css.each_selector do |selector, declarations, specificity|
|
48
|
+
sels = selector.split(/,/).size
|
49
|
+
props = declarations.split(/;/).size
|
50
|
+
self.selector_count += sels
|
51
|
+
self.prop_count += props
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
class SassFile
|
56
|
+
attr_accessor :path
|
57
|
+
attr_reader :visitor
|
58
|
+
def initialize(path)
|
59
|
+
self.path = path
|
60
|
+
end
|
61
|
+
def contents
|
62
|
+
@contents ||= File.read(path)
|
63
|
+
end
|
64
|
+
def tree
|
65
|
+
@tree = Sass::Engine.new(contents, Compass.configuration.to_sass_engine_options).to_tree
|
66
|
+
end
|
67
|
+
def visit_tree!
|
68
|
+
@visitor = StatsVisitor.new
|
69
|
+
tree.visit_depth_first(@visitor)
|
70
|
+
@visitor
|
71
|
+
end
|
72
|
+
def analyze!
|
73
|
+
visit_tree!
|
74
|
+
end
|
75
|
+
def lines
|
76
|
+
contents.inject(0){|m,c| m + 1 }
|
77
|
+
end
|
78
|
+
def rule_count
|
79
|
+
visitor.rule_count
|
80
|
+
end
|
81
|
+
def prop_count
|
82
|
+
visitor.prop_count
|
83
|
+
end
|
84
|
+
def mixin_def_count
|
85
|
+
visitor.mixin_def_count
|
86
|
+
end
|
87
|
+
def mixin_count
|
88
|
+
visitor.mixin_count
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
data/lib/compass/validator.rb
CHANGED
@@ -2,9 +2,8 @@ begin
|
|
2
2
|
require 'rubygems'
|
3
3
|
require 'compass-validator'
|
4
4
|
rescue LoadError
|
5
|
-
|
5
|
+
raise Compass::MissingDependency, %Q{The Compass CSS Validator could not be loaded. Please install it:
|
6
6
|
|
7
7
|
sudo gem install chriseppstein-compass-validator --source http://gems.github.com/
|
8
8
|
}
|
9
|
-
|
10
|
-
end
|
9
|
+
end
|
data/lib/vendor/fssm/state.rb
CHANGED
data/test/command_line_helper.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'timeout'
|
2
|
+
|
1
3
|
module Compass::CommandLineHelper
|
2
4
|
def compass(*arguments)
|
3
5
|
options = arguments.last.is_a?(Hash) ? arguments.pop : {}
|
@@ -17,30 +19,38 @@ module Compass::CommandLineHelper
|
|
17
19
|
else
|
18
20
|
eof_at = nil
|
19
21
|
timeout(1) do
|
20
|
-
|
22
|
+
partial_output = io.readpartial(1024)
|
23
|
+
# puts "))))#{partial_output}((((("
|
24
|
+
output << partial_output
|
21
25
|
end
|
22
|
-
prompt = output.split("\n").last
|
26
|
+
prompt = output.split("\n").last.strip
|
23
27
|
if response = responder.response_for(prompt)
|
24
28
|
io.puts response
|
25
29
|
end
|
26
30
|
end
|
27
31
|
end
|
28
32
|
responder.assert_required_responses!
|
29
|
-
@last_result = output
|
33
|
+
@last_result = decolorize(output)
|
30
34
|
else
|
31
35
|
#child process
|
32
36
|
execute *arguments
|
33
37
|
end
|
34
38
|
end
|
35
39
|
else
|
36
|
-
@
|
37
|
-
|
40
|
+
@last_error = capture_warning do
|
41
|
+
@last_result = decolorize(capture_output do
|
42
|
+
@last_exit_code = execute *arguments
|
43
|
+
end)
|
38
44
|
end
|
39
45
|
end
|
40
46
|
rescue Timeout::Error
|
41
47
|
fail "Read from child process timed out"
|
42
48
|
end
|
43
49
|
|
50
|
+
def decolorize(str)
|
51
|
+
str.gsub(/\e\[\d+m/,'')
|
52
|
+
end
|
53
|
+
|
44
54
|
class Responder
|
45
55
|
Response = Struct.new(:prompt, :text, :required, :responded)
|
46
56
|
def initialize
|
@@ -73,7 +83,7 @@ module Compass::CommandLineHelper
|
|
73
83
|
actions_found << line.first if line.last == path
|
74
84
|
end
|
75
85
|
message = "Action #{action.inspect} was not performed on: #{path}."
|
76
|
-
message += "The following actions were performed: #{actions_found.join(", ")}" if actions_found.any?
|
86
|
+
message += "The following actions were performed: #{actions_found.map{|a|a.inspect}.join(", ")}" if actions_found.any?
|
77
87
|
puts @last_result
|
78
88
|
fail message
|
79
89
|
end
|
@@ -88,15 +98,8 @@ module Compass::CommandLineHelper
|
|
88
98
|
FileUtils.rm_rf(d)
|
89
99
|
end
|
90
100
|
|
91
|
-
def capture_output
|
92
|
-
real_stdout, $stdout = $stdout, StringIO.new
|
93
|
-
yield
|
94
|
-
$stdout.string
|
95
|
-
ensure
|
96
|
-
$stdout = real_stdout
|
97
|
-
end
|
98
|
-
|
99
101
|
def execute(*arguments)
|
100
|
-
Compass::Exec::
|
102
|
+
command_line_class = Compass::Exec::Helpers.select_appropriate_command_line_ui(arguments)
|
103
|
+
command_line_class.new(arguments).run!
|
101
104
|
end
|
102
|
-
end
|
105
|
+
end
|
data/test/command_line_test.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require 'test_helper'
|
2
2
|
require 'fileutils'
|
3
3
|
require 'compass'
|
4
4
|
require 'compass/exec'
|
@@ -7,9 +7,10 @@ require 'timeout'
|
|
7
7
|
class CommandLineTest < Test::Unit::TestCase
|
8
8
|
include Compass::TestCaseHelper
|
9
9
|
include Compass::CommandLineHelper
|
10
|
+
include Compass::IoHelper
|
10
11
|
|
11
12
|
def teardown
|
12
|
-
Compass.
|
13
|
+
Compass.reset_configuration!
|
13
14
|
end
|
14
15
|
|
15
16
|
def test_print_version
|
@@ -19,7 +20,7 @@ class CommandLineTest < Test::Unit::TestCase
|
|
19
20
|
|
20
21
|
def test_list_frameworks
|
21
22
|
compass "--list-frameworks"
|
22
|
-
assert_equal(%w(blueprint compass
|
23
|
+
assert_equal(%w(blueprint compass), @last_result.split.sort)
|
23
24
|
end
|
24
25
|
|
25
26
|
def test_basic_install
|
@@ -63,4 +64,4 @@ class CommandLineTest < Test::Unit::TestCase
|
|
63
64
|
end
|
64
65
|
end
|
65
66
|
|
66
|
-
end
|
67
|
+
end
|
data/test/compass_test.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
require
|
1
|
+
require 'test_helper'
|
2
2
|
require 'fileutils'
|
3
3
|
require 'compass'
|
4
4
|
|
5
5
|
class CompassTest < Test::Unit::TestCase
|
6
6
|
include Compass::TestCaseHelper
|
7
7
|
def setup
|
8
|
-
Compass.
|
8
|
+
Compass.reset_configuration!
|
9
9
|
end
|
10
10
|
|
11
11
|
def teardown
|
12
|
-
teardown_fixtures :blueprint, :
|
12
|
+
teardown_fixtures :blueprint, :empty, :compass, :image_urls, :relative
|
13
13
|
end
|
14
14
|
|
15
15
|
def teardown_fixtures(*project_names)
|
@@ -37,15 +37,6 @@ class CompassTest < Test::Unit::TestCase
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
-
def test_yui
|
41
|
-
within_project('yui') do |proj|
|
42
|
-
each_css_file(proj.css_path) do |css_file|
|
43
|
-
assert_no_errors css_file, 'yui'
|
44
|
-
end
|
45
|
-
assert_renders_correctly :mixins
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
40
|
def test_compass
|
50
41
|
within_project('compass') do |proj|
|
51
42
|
each_css_file(proj.css_path) do |css_file|
|
@@ -64,6 +55,15 @@ class CompassTest < Test::Unit::TestCase
|
|
64
55
|
end
|
65
56
|
end
|
66
57
|
|
58
|
+
def test_image_urls
|
59
|
+
within_project('relative') do |proj|
|
60
|
+
each_css_file(proj.css_path) do |css_file|
|
61
|
+
assert_no_errors css_file, 'relative'
|
62
|
+
end
|
63
|
+
assert_renders_correctly :screen
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
67
|
private
|
68
68
|
def assert_no_errors(css_file, project_name)
|
69
69
|
file = css_file[(tempfile_path(project_name).size+1)..-1]
|
@@ -77,7 +77,7 @@ private
|
|
77
77
|
actual_result_file = "#{tempfile_path(@current_project)}/#{name}.css"
|
78
78
|
expected_result_file = "#{result_path(@current_project)}/#{name}.css"
|
79
79
|
actual_lines = File.read(actual_result_file).split("\n")
|
80
|
-
expected_lines = File.read(expected_result_file).split("\n")
|
80
|
+
expected_lines = ERB.new(File.read(expected_result_file)).result(binding).split("\n")
|
81
81
|
expected_lines.zip(actual_lines).each_with_index do |pair, line|
|
82
82
|
message = "template: #{name}\nline: #{line + 1}"
|
83
83
|
assert_equal(pair.first, pair.last, message)
|
@@ -90,8 +90,9 @@ private
|
|
90
90
|
|
91
91
|
def within_project(project_name)
|
92
92
|
@current_project = project_name
|
93
|
-
Compass.
|
93
|
+
Compass.add_configuration(configuration_file(project_name)) if File.exists?(configuration_file(project_name))
|
94
94
|
Compass.configuration.project_path = project_path(project_name)
|
95
|
+
Compass.configuration.environment = :production
|
95
96
|
args = Compass.configuration.to_compiler_arguments(:logger => Compass::NullLogger.new)
|
96
97
|
if Compass.configuration.sass_path && File.exists?(Compass.configuration.sass_path)
|
97
98
|
compiler = Compass::Compiler.new *args
|
@@ -138,4 +139,4 @@ private
|
|
138
139
|
File.join(project_path(project_name), "saved")
|
139
140
|
end
|
140
141
|
|
141
|
-
end
|
142
|
+
end
|