compass 0.13.alpha.0 → 0.13.alpha.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +6 -4
- data/Rakefile +9 -0
- data/VERSION.yml +2 -2
- data/bin/compass +2 -1
- data/features/command_line.feature +5 -27
- data/features/step_definitions/command_line_steps.rb +3 -2
- data/frameworks/compass/stylesheets/compass/_css3.scss +3 -0
- data/frameworks/compass/stylesheets/compass/_support.scss +6 -0
- data/frameworks/compass/stylesheets/compass/css3/_animation.scss +77 -76
- data/frameworks/compass/stylesheets/compass/css3/_appearance.scss +15 -9
- data/frameworks/compass/stylesheets/compass/css3/_background-clip.scss +35 -36
- data/frameworks/compass/stylesheets/compass/css3/_background-origin.scss +36 -34
- data/frameworks/compass/stylesheets/compass/css3/_background-size.scss +15 -15
- data/frameworks/compass/stylesheets/compass/css3/_border-radius.scss +30 -48
- data/frameworks/compass/stylesheets/compass/css3/_box-shadow.scss +22 -27
- data/frameworks/compass/stylesheets/compass/css3/_box-sizing.scss +13 -8
- data/frameworks/compass/stylesheets/compass/css3/_box.scss +60 -82
- data/frameworks/compass/stylesheets/compass/css3/_columns.scss +145 -25
- data/frameworks/compass/stylesheets/compass/css3/_filter.scss +44 -0
- data/frameworks/compass/stylesheets/compass/css3/_hyphenation.scss +77 -0
- data/frameworks/compass/stylesheets/compass/css3/_images.scss +2 -2
- data/frameworks/compass/stylesheets/compass/css3/_inline-block.scss +14 -8
- data/frameworks/compass/stylesheets/compass/css3/_selection.scss +31 -0
- data/frameworks/compass/stylesheets/compass/css3/_shared.scss +207 -21
- data/frameworks/compass/stylesheets/compass/css3/_text-shadow.scss +52 -13
- data/frameworks/compass/stylesheets/compass/css3/_transform.scss +14 -14
- data/frameworks/compass/stylesheets/compass/css3/_transition.scss +127 -60
- data/frameworks/compass/stylesheets/compass/css3/_user-interface.scss +35 -15
- data/frameworks/compass/stylesheets/compass/typography/_units.scss +152 -0
- data/frameworks/compass/stylesheets/compass/typography/_vertical_rhythm.scss +174 -98
- data/frameworks/compass/stylesheets/compass/typography/lists/_horizontal-list.scss +5 -3
- data/frameworks/compass/stylesheets/compass/typography/lists/_inline-list.scss +6 -3
- data/frameworks/compass/stylesheets/compass/typography/text/_ellipsis.scss +1 -1
- data/frameworks/compass/stylesheets/compass/typography/text/_replacement.scss +35 -9
- data/frameworks/compass/stylesheets/compass/utilities/general/_float.scss +7 -3
- data/frameworks/compass/stylesheets/compass/utilities/general/_hacks.scss +2 -2
- data/frameworks/compass/stylesheets/compass/utilities/sprites/_base.scss +25 -10
- data/frameworks/compass/stylesheets/compass/utilities/tables/_borders.scss +14 -9
- data/lib/compass.rb +2 -2
- data/lib/compass/actions.rb +5 -1
- data/lib/compass/commands/project_base.rb +7 -1
- data/lib/compass/commands/update_project.rb +2 -2
- data/lib/compass/commands/watch_project.rb +6 -86
- data/lib/compass/compiler.rb +6 -0
- data/lib/compass/configuration/data.rb +1 -1
- data/lib/compass/configuration/helpers.rb +2 -0
- data/lib/compass/exec/global_options_parser.rb +1 -1
- data/lib/compass/exec/project_options_parser.rb +4 -0
- data/lib/compass/logger.rb +2 -0
- data/lib/compass/sass_extensions/functions/colors.rb +14 -0
- data/lib/compass/sass_extensions/functions/constants.rb +9 -0
- data/lib/compass/sass_extensions/functions/gradient_support.rb +44 -5
- data/lib/compass/sass_extensions/functions/image_size.rb +2 -1
- data/lib/compass/sass_extensions/functions/math.rb +14 -2
- data/lib/compass/sass_extensions/functions/sprites.rb +81 -14
- data/lib/compass/sass_extensions/functions/urls.rb +29 -2
- data/lib/compass/sass_extensions/sprites.rb +2 -0
- data/lib/compass/sass_extensions/sprites/engines/chunky_png_engine.rb +5 -1
- data/lib/compass/sass_extensions/sprites/image.rb +7 -2
- data/lib/compass/sass_extensions/sprites/image_methods.rb +5 -2
- data/lib/compass/sass_extensions/sprites/images.rb +29 -0
- data/lib/compass/sass_extensions/sprites/layout.rb +39 -0
- data/lib/compass/sass_extensions/sprites/layout/diagonal.rb +42 -0
- data/lib/compass/sass_extensions/sprites/layout/horizontal.rb +66 -0
- data/lib/compass/sass_extensions/sprites/layout/smart.rb +33 -0
- data/lib/compass/sass_extensions/sprites/layout/vertical.rb +68 -0
- data/lib/compass/sass_extensions/sprites/layout_methods.rb +9 -115
- data/lib/compass/sass_extensions/sprites/sprite_map.rb +5 -0
- data/lib/compass/sass_extensions/sprites/sprite_methods.rb +9 -5
- data/lib/compass/sprite_importer.rb +3 -3
- data/lib/compass/sprite_importer/content.erb +14 -12
- data/lib/compass/version.rb +2 -1
- data/lib/compass/watcher.rb +11 -0
- data/lib/compass/watcher/compiler.rb +59 -0
- data/lib/compass/watcher/project_watcher.rb +108 -0
- data/lib/compass/watcher/watch.rb +33 -0
- data/test/fixtures/stylesheets/busted_font_urls/config.rb +32 -0
- data/test/fixtures/stylesheets/busted_font_urls/css/screen.css +7 -0
- data/{examples/css3/extensions/fancy-fonts/templates/project/bgrove.ttf → test/fixtures/stylesheets/busted_font_urls/fonts/feed.ttf} +0 -0
- data/test/fixtures/stylesheets/busted_font_urls/fonts/grid.ttf +0 -0
- data/test/fixtures/stylesheets/busted_font_urls/fonts/sub/dk.ttf +0 -0
- data/test/fixtures/stylesheets/busted_font_urls/sass/screen.sass +11 -0
- data/test/fixtures/stylesheets/busted_font_urls/tmp/screen.css +7 -0
- data/test/fixtures/stylesheets/compass/css/animation-with-legacy-ie.css +0 -8
- data/test/fixtures/stylesheets/compass/css/animation.css +0 -8
- data/test/fixtures/stylesheets/compass/css/background-clip.css +5 -0
- data/test/fixtures/stylesheets/compass/css/background-origin.css +15 -0
- data/test/fixtures/stylesheets/compass/css/background-size.css +24 -0
- data/test/fixtures/stylesheets/compass/css/columns.css +81 -9
- data/test/fixtures/stylesheets/compass/css/filters.css +29 -0
- data/test/fixtures/stylesheets/compass/css/gradients.css +30 -27
- data/test/fixtures/stylesheets/compass/css/grid_background.css +7 -14
- data/test/fixtures/stylesheets/compass/css/hyphenation.css +16 -0
- data/test/fixtures/stylesheets/compass/css/lists.css +11 -13
- data/test/fixtures/stylesheets/compass/css/pie.css +0 -3
- data/test/fixtures/stylesheets/compass/css/replacement.css +59 -0
- data/test/fixtures/stylesheets/compass/css/reset.css +1 -1
- data/test/fixtures/stylesheets/compass/css/selection.css +13 -0
- data/test/fixtures/stylesheets/compass/css/sprites.css +250 -250
- data/test/fixtures/stylesheets/compass/css/text_shadow.css +22 -4
- data/test/fixtures/stylesheets/compass/css/transition.css +67 -11
- data/test/fixtures/stylesheets/compass/css/units.css +30 -0
- data/test/fixtures/stylesheets/compass/css/user-interface.css +12 -1
- data/test/fixtures/stylesheets/compass/css/utilities.css +15 -0
- data/test/fixtures/stylesheets/compass/css/vertical_rhythm.css +199 -27
- data/test/fixtures/stylesheets/compass/images/flag-s5b4f509715.png +0 -0
- data/test/fixtures/stylesheets/compass/sass/background-clip.scss +4 -2
- data/test/fixtures/stylesheets/compass/sass/background-origin.scss +10 -0
- data/test/fixtures/stylesheets/compass/sass/background-size.scss +12 -0
- data/test/fixtures/stylesheets/compass/sass/columns.scss +18 -0
- data/test/fixtures/stylesheets/compass/sass/filters.scss +24 -0
- data/test/fixtures/stylesheets/compass/sass/gradients.sass +10 -3
- data/test/fixtures/stylesheets/compass/sass/hyphenation.scss +11 -0
- data/test/fixtures/stylesheets/compass/sass/replacement.scss +22 -0
- data/test/fixtures/stylesheets/compass/sass/selection.scss +13 -0
- data/test/fixtures/stylesheets/compass/sass/text_shadow.scss +6 -1
- data/test/fixtures/stylesheets/compass/sass/transition.scss +11 -0
- data/test/fixtures/stylesheets/compass/sass/units.scss +45 -0
- data/test/fixtures/stylesheets/compass/sass/user-interface.scss +10 -5
- data/test/fixtures/stylesheets/compass/sass/utilities.scss +10 -0
- data/test/fixtures/stylesheets/compass/sass/vertical_rhythm.scss +208 -7
- data/test/fixtures/stylesheets/envtest/tmp/env.css +4 -4
- data/test/fixtures/stylesheets/valid/css/simple.css +4 -0
- data/test/helpers/test_case.rb +8 -1
- data/test/integrations/compass_test.rb +13 -13
- data/test/integrations/sprites_test.rb +173 -8
- data/test/test_helper.rb +4 -0
- data/test/units/command_line_test.rb +0 -2
- data/test/units/regressions_test.rb +35 -0
- data/test/units/sass_extensions_test.rb +23 -11
- data/test/units/sprites/image_test.rb +5 -0
- data/test/units/sprites/images_test.rb +46 -0
- data/test/units/sprites/layout_test.rb +18 -2
- data/test/units/watcher/compiler_test.rb +39 -0
- data/test/units/watcher/project_watcher_test.rb +65 -0
- data/test/units/watcher/watch_test.rb +42 -0
- metadata +83 -317
- data/bin/compass.compiled.rbc +0 -707
- data/examples/compass/images/emblem-a043c4f148.png +0 -0
- data/examples/compass/images/flag-03c3b29b35.png +0 -0
- data/examples/compass/images/flag-21cfbfbfc8.png +0 -0
- data/examples/css3/extensions/fancy-fonts/templates/project/Prociono.otf +0 -0
- data/examples/css3/extensions/fancy-fonts/templates/project/bgrove.otf +0 -0
- data/frameworks/blueprint/stylesheets/_blueprint.scss +0 -37
- data/frameworks/blueprint/stylesheets/blueprint/_buttons.scss +0 -101
- data/frameworks/blueprint/stylesheets/blueprint/_colors.scss +0 -36
- data/frameworks/blueprint/stylesheets/blueprint/_debug.scss +0 -28
- data/frameworks/blueprint/stylesheets/blueprint/_fancy-type.scss +0 -88
- data/frameworks/blueprint/stylesheets/blueprint/_form.scss +0 -66
- data/frameworks/blueprint/stylesheets/blueprint/_grid.scss +0 -258
- data/frameworks/blueprint/stylesheets/blueprint/_ie.scss +0 -111
- data/frameworks/blueprint/stylesheets/blueprint/_interaction.scss +0 -66
- data/frameworks/blueprint/stylesheets/blueprint/_link-icons.scss +0 -37
- data/frameworks/blueprint/stylesheets/blueprint/_liquid.scss +0 -152
- data/frameworks/blueprint/stylesheets/blueprint/_print.scss +0 -86
- data/frameworks/blueprint/stylesheets/blueprint/_reset.scss +0 -3
- data/frameworks/blueprint/stylesheets/blueprint/_rtl.scss +0 -121
- data/frameworks/blueprint/stylesheets/blueprint/_scaffolding.scss +0 -52
- data/frameworks/blueprint/stylesheets/blueprint/_typography.scss +0 -90
- data/frameworks/blueprint/stylesheets/blueprint/_utilities.scss +0 -37
- data/frameworks/blueprint/stylesheets/blueprint/reset/_utilities.scss +0 -80
- data/frameworks/blueprint/templates/basic/grid.png +0 -0
- data/frameworks/blueprint/templates/basic/ie.sass +0 -4
- data/frameworks/blueprint/templates/basic/manifest.rb +0 -30
- data/frameworks/blueprint/templates/basic/partials/_base.sass +0 -10
- data/frameworks/blueprint/templates/basic/print.sass +0 -4
- data/frameworks/blueprint/templates/basic/screen.sass +0 -12
- data/frameworks/blueprint/templates/buttons/buttons.sass +0 -49
- data/frameworks/blueprint/templates/buttons/buttons/cross.png +0 -0
- data/frameworks/blueprint/templates/buttons/buttons/key.png +0 -0
- data/frameworks/blueprint/templates/buttons/buttons/tick.png +0 -0
- data/frameworks/blueprint/templates/buttons/manifest.rb +0 -17
- data/frameworks/blueprint/templates/link_icons/link_icons.sass +0 -13
- data/frameworks/blueprint/templates/link_icons/link_icons/doc.png +0 -0
- data/frameworks/blueprint/templates/link_icons/link_icons/email.png +0 -0
- data/frameworks/blueprint/templates/link_icons/link_icons/external.png +0 -0
- data/frameworks/blueprint/templates/link_icons/link_icons/feed.png +0 -0
- data/frameworks/blueprint/templates/link_icons/link_icons/im.png +0 -0
- data/frameworks/blueprint/templates/link_icons/link_icons/pdf.png +0 -0
- data/frameworks/blueprint/templates/link_icons/link_icons/visited.png +0 -0
- data/frameworks/blueprint/templates/link_icons/link_icons/xls.png +0 -0
- data/frameworks/blueprint/templates/link_icons/manifest.rb +0 -23
- data/frameworks/blueprint/templates/project/grid.png +0 -0
- data/frameworks/blueprint/templates/project/ie.sass +0 -16
- data/frameworks/blueprint/templates/project/manifest.rb +0 -30
- data/frameworks/blueprint/templates/project/partials/_base.sass +0 -11
- data/frameworks/blueprint/templates/project/print.sass +0 -8
- data/frameworks/blueprint/templates/project/screen.sass +0 -46
- data/frameworks/blueprint/templates/semantic/grid.png +0 -0
- data/frameworks/blueprint/templates/semantic/ie.sass +0 -16
- data/frameworks/blueprint/templates/semantic/manifest.rb +0 -33
- data/frameworks/blueprint/templates/semantic/partials/_base.sass +0 -10
- data/frameworks/blueprint/templates/semantic/partials/_form.sass +0 -6
- data/frameworks/blueprint/templates/semantic/partials/_page.sass +0 -17
- data/frameworks/blueprint/templates/semantic/partials/_two_col.sass +0 -38
- data/frameworks/blueprint/templates/semantic/print.sass +0 -5
- data/frameworks/blueprint/templates/semantic/screen.sass +0 -14
- data/lib/compass.rbc +0 -796
- data/lib/compass/actions.rbc +0 -2736
- data/lib/compass/app_integration.rbc +0 -836
- data/lib/compass/app_integration/merb.rbc +0 -106
- data/lib/compass/app_integration/rails.rbc +0 -2096
- data/lib/compass/app_integration/rails/configuration_defaults.rbc +0 -2430
- data/lib/compass/app_integration/rails/installer.rbc +0 -3677
- data/lib/compass/app_integration/stand_alone.rbc +0 -589
- data/lib/compass/app_integration/stand_alone/configuration_defaults.rbc +0 -721
- data/lib/compass/app_integration/stand_alone/installer.rbc +0 -1487
- data/lib/compass/browser_support.rbc +0 -1144
- data/lib/compass/commands.rbc +0 -307
- data/lib/compass/commands/base.rbc +0 -1044
- data/lib/compass/commands/clean_project.rbc +0 -1856
- data/lib/compass/commands/create_project.rbc +0 -2691
- data/lib/compass/commands/default.rbc +0 -1677
- data/lib/compass/commands/generate_grid_background.rbc +0 -1939
- data/lib/compass/commands/help.rbc +0 -1921
- data/lib/compass/commands/imports.rbc +0 -969
- data/lib/compass/commands/installer_command.rbc +0 -807
- data/lib/compass/commands/interactive.rbc +0 -1341
- data/lib/compass/commands/list_frameworks.rbc +0 -1111
- data/lib/compass/commands/print_version.rbc +0 -2478
- data/lib/compass/commands/project_base.rbc +0 -2085
- data/lib/compass/commands/project_stats.rbc +0 -4202
- data/lib/compass/commands/registry.rbc +0 -1350
- data/lib/compass/commands/sprite.rbc +0 -2212
- data/lib/compass/commands/stamp_pattern.rbc +0 -2011
- data/lib/compass/commands/unpack_extension.rbc +0 -2348
- data/lib/compass/commands/update_project.rbc +0 -3002
- data/lib/compass/commands/validate_project.rbc +0 -1686
- data/lib/compass/commands/watch_project.rbc +0 -4155
- data/lib/compass/commands/write_configuration.rbc +0 -2896
- data/lib/compass/compiler.rbc +0 -4913
- data/lib/compass/configuration.rbc +0 -1398
- data/lib/compass/configuration/adapters.rbc +0 -2088
- data/lib/compass/configuration/comments.rbc +0 -843
- data/lib/compass/configuration/data.rbc +0 -2633
- data/lib/compass/configuration/defaults.rbc +0 -3617
- data/lib/compass/configuration/file_data.rbc +0 -643
- data/lib/compass/configuration/helpers.rbc +0 -3500
- data/lib/compass/configuration/inheritance.rbc +0 -3592
- data/lib/compass/configuration/paths.rbc +0 -412
- data/lib/compass/configuration/serialization.rbc +0 -1996
- data/lib/compass/dependencies.rbc +0 -232
- data/lib/compass/errors.rbc +0 -176
- data/lib/compass/exec.rbc +0 -500
- data/lib/compass/exec/command_option_parser.rbc +0 -676
- data/lib/compass/exec/global_options_parser.rbc +0 -1306
- data/lib/compass/exec/helpers.rbc +0 -758
- data/lib/compass/exec/project_options_parser.rbc +0 -1515
- data/lib/compass/exec/sub_command_ui.rbc +0 -1191
- data/lib/compass/frameworks.rbc +0 -3640
- data/lib/compass/grid_builder.rbc +0 -0
- data/lib/compass/installers.rbc +0 -152
- data/lib/compass/installers/bare_installer.rbc +0 -939
- data/lib/compass/installers/base.rbc +0 -4427
- data/lib/compass/installers/manifest.rbc +0 -3335
- data/lib/compass/installers/manifest_installer.rbc +0 -1591
- data/lib/compass/installers/template_context.rbc +0 -1030
- data/lib/compass/logger.rbc +0 -2317
- data/lib/compass/quick_cache.rbc +0 -324
- data/lib/compass/sass_extensions.rbc +0 -213
- data/lib/compass/sass_extensions/functions.rbc +0 -808
- data/lib/compass/sass_extensions/functions/colors.rbc +0 -1279
- data/lib/compass/sass_extensions/functions/constants.rbc +0 -1921
- data/lib/compass/sass_extensions/functions/cross_browser_support.rbc +0 -1966
- data/lib/compass/sass_extensions/functions/display.rbc +0 -1227
- data/lib/compass/sass_extensions/functions/enumerate.rbc +0 -446
- data/lib/compass/sass_extensions/functions/env.rbc +0 -299
- data/lib/compass/sass_extensions/functions/font_files.rbc +0 -821
- data/lib/compass/sass_extensions/functions/gradient_support.rbc +0 -14147
- data/lib/compass/sass_extensions/functions/image_size.rbc +0 -3152
- data/lib/compass/sass_extensions/functions/inline_image.rbc +0 -1678
- data/lib/compass/sass_extensions/functions/lists.rbc +0 -2601
- data/lib/compass/sass_extensions/functions/selectors.rbc +0 -1592
- data/lib/compass/sass_extensions/functions/sprites.rbc +0 -3792
- data/lib/compass/sass_extensions/functions/trig.rbc +0 -811
- data/lib/compass/sass_extensions/functions/urls.rbc +0 -5248
- data/lib/compass/sass_extensions/monkey_patches.rbc +0 -134
- data/lib/compass/sass_extensions/monkey_patches/browser_support.rbc +0 -2169
- data/lib/compass/sass_extensions/monkey_patches/traversal.rbc +0 -660
- data/lib/compass/sass_extensions/sprites.rbc +0 -363
- data/lib/compass/sass_extensions/sprites/base.rbc +0 -4529
- data/lib/compass/sass_extensions/sprites/engines.rbc +0 -662
- data/lib/compass/sass_extensions/sprites/engines/chunky_png_engine.rbc +0 -1074
- data/lib/compass/sass_extensions/sprites/image.rbc +0 -2961
- data/lib/compass/sass_extensions/sprites/image_methods.rbc +0 -900
- data/lib/compass/sass_extensions/sprites/image_row.rbc +0 -1168
- data/lib/compass/sass_extensions/sprites/layout_methods.rbc +0 -3236
- data/lib/compass/sass_extensions/sprites/row_fitter.rbc +0 -2067
- data/lib/compass/sass_extensions/sprites/sprite_map.rbc +0 -1991
- data/lib/compass/sass_extensions/sprites/sprite_methods.rbc +0 -3190
- data/lib/compass/sass_extensions/sprites/sprites.rbc +0 -1573
- data/lib/compass/sprite_importer.rbc +0 -3573
- data/lib/compass/util.rbc +0 -552
- data/lib/compass/version.rbc +0 -1245
- data/test/fixtures/stylesheets/blueprint/config.rb +0 -14
- data/test/fixtures/stylesheets/blueprint/css/ie.css +0 -76
- data/test/fixtures/stylesheets/blueprint/css/print.css +0 -56
- data/test/fixtures/stylesheets/blueprint/css/screen.css +0 -816
- data/test/fixtures/stylesheets/blueprint/css/single-imports/buttons.css +0 -58
- data/test/fixtures/stylesheets/blueprint/css/single-imports/colors.css +0 -80
- data/test/fixtures/stylesheets/blueprint/css/single-imports/debug.css +0 -12
- data/test/fixtures/stylesheets/blueprint/css/single-imports/fancy-type.css +0 -30
- data/test/fixtures/stylesheets/blueprint/css/single-imports/form.css +0 -42
- data/test/fixtures/stylesheets/blueprint/css/single-imports/grid.css +0 -435
- data/test/fixtures/stylesheets/blueprint/css/single-imports/ie.css +0 -76
- data/test/fixtures/stylesheets/blueprint/css/single-imports/interaction.css +0 -46
- data/test/fixtures/stylesheets/blueprint/css/single-imports/link-icons.css +0 -40
- data/test/fixtures/stylesheets/blueprint/css/single-imports/liquid.css +0 -651
- data/test/fixtures/stylesheets/blueprint/css/single-imports/print.css +0 -60
- data/test/fixtures/stylesheets/blueprint/css/single-imports/reset-utilities.css +0 -36
- data/test/fixtures/stylesheets/blueprint/css/single-imports/reset.css +0 -40
- data/test/fixtures/stylesheets/blueprint/css/single-imports/rtl.css +0 -437
- data/test/fixtures/stylesheets/blueprint/css/single-imports/scaffolding.css +0 -45
- data/test/fixtures/stylesheets/blueprint/css/single-imports/typography.css +0 -146
- data/test/fixtures/stylesheets/blueprint/css/single-imports/utilities.css +0 -35
- data/test/fixtures/stylesheets/blueprint/images/grid.png +0 -0
- data/test/fixtures/stylesheets/blueprint/images/link_icons/doc.png +0 -0
- data/test/fixtures/stylesheets/blueprint/images/link_icons/email.png +0 -0
- data/test/fixtures/stylesheets/blueprint/images/link_icons/external.png +0 -0
- data/test/fixtures/stylesheets/blueprint/images/link_icons/feed.png +0 -0
- data/test/fixtures/stylesheets/blueprint/images/link_icons/im.png +0 -0
- data/test/fixtures/stylesheets/blueprint/images/link_icons/pdf.png +0 -0
- data/test/fixtures/stylesheets/blueprint/images/link_icons/visited.png +0 -0
- data/test/fixtures/stylesheets/blueprint/images/link_icons/xls.png +0 -0
- data/test/fixtures/stylesheets/blueprint/sass/ie.sass +0 -3
- data/test/fixtures/stylesheets/blueprint/sass/print.sass +0 -3
- data/test/fixtures/stylesheets/blueprint/sass/screen.sass +0 -18
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/buttons.scss +0 -4
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/colors.scss +0 -34
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/debug.scss +0 -3
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/fancy-type.scss +0 -3
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/form.scss +0 -5
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/grid.scss +0 -3
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/ie.scss +0 -3
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/interaction.scss +0 -3
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/link-icons.scss +0 -13
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/liquid.scss +0 -3
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/print.scss +0 -5
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/reset-utilities.scss +0 -5
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/reset.scss +0 -1
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/rtl.scss +0 -3
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/scaffolding.scss +0 -5
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/typography.scss +0 -3
- data/test/fixtures/stylesheets/blueprint/sass/single-imports/utilities.scss +0 -3
- data/test/fixtures/stylesheets/compass/images/flag-s4798b5a210.png +0 -0
- data/test/helpers/command_line.rbc +0 -2820
- data/test/helpers/diff.rbc +0 -1104
- data/test/helpers/io.rbc +0 -962
- data/test/helpers/rails.rbc +0 -1116
- data/test/helpers/test_case.rbc +0 -1255
- data/test/integrations/compass_test.rbc +0 -6589
- data/test/integrations/rails_integration_test.rbc +0 -1342
- data/test/integrations/sprites_test.rbc +0 -6192
- data/test/test_helper.rbc +0 -1694
- data/test/units/actions_test.rbc +0 -644
- data/test/units/command_line_test.rbc +0 -1532
- data/test/units/compass_png_test.rbc +0 -0
- data/test/units/configuration_test.rbc +0 -3833
- data/test/units/rails_configuration_test.rbc +0 -1032
- data/test/units/sass_extensions_test.rbc +0 -3586
- data/test/units/sprites/engine_test.rbc +0 -962
- data/test/units/sprites/image_row_test.rbc +0 -1578
- data/test/units/sprites/image_test.rbc +0 -2836
- data/test/units/sprites/importer_test.rbc +0 -2620
- data/test/units/sprites/row_fitter_test.rbc +0 -1479
- data/test/units/sprites/sprite_command_test.rbc +0 -1147
- data/test/units/sprites/sprite_map_test.rbc +0 -6515
@@ -8,6 +8,8 @@ module Compass
|
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
|
+
require 'compass/sass_extensions/sprites/images'
|
12
|
+
require 'compass/sass_extensions/sprites/layout'
|
11
13
|
require 'compass/sass_extensions/sprites/image_row'
|
12
14
|
require 'compass/sass_extensions/sprites/row_fitter'
|
13
15
|
require 'compass/sass_extensions/sprites/image'
|
@@ -12,7 +12,11 @@ module Compass
|
|
12
12
|
def construct_sprite
|
13
13
|
@canvas = ChunkyPNG::Image.new(width, height, ChunkyPNG::Color::TRANSPARENT)
|
14
14
|
images.each do |image|
|
15
|
-
input_png
|
15
|
+
input_png = begin
|
16
|
+
ChunkyPNG::Image.from_file(image.file)
|
17
|
+
rescue ChunkyPNG::SignatureMismatch
|
18
|
+
raise Compass::SpriteException, "You have provided a file that does not have a PNG signature. Only PNG files are supported by the default sprite engine"
|
19
|
+
end
|
16
20
|
canvas.replace! input_png, image.left, image.top
|
17
21
|
end
|
18
22
|
end
|
@@ -8,9 +8,10 @@ module Compass
|
|
8
8
|
PARENT = %r{(.+)[-_](.+)$}
|
9
9
|
|
10
10
|
REPEAT_X = 'repeat-x'
|
11
|
+
REPEAT_Y = 'repeat-y'
|
11
12
|
NO_REPEAT = 'no-repeat'
|
12
13
|
|
13
|
-
VALID_REPEATS = [REPEAT_X, NO_REPEAT]
|
14
|
+
VALID_REPEATS = [REPEAT_Y, REPEAT_X, NO_REPEAT]
|
14
15
|
|
15
16
|
attr_reader :relative_file, :options, :base
|
16
17
|
attr_accessor :top, :left
|
@@ -50,7 +51,7 @@ module Compass
|
|
50
51
|
|
51
52
|
# Basename of the image
|
52
53
|
def name
|
53
|
-
File.basename(relative_file, '.png')
|
54
|
+
@name ||= File.basename(relative_file, '.png')
|
54
55
|
end
|
55
56
|
|
56
57
|
def get_var_file(var)
|
@@ -73,6 +74,10 @@ module Compass
|
|
73
74
|
repeat == REPEAT_X
|
74
75
|
end
|
75
76
|
|
77
|
+
def repeat_y?
|
78
|
+
repeat == REPEAT_Y
|
79
|
+
end
|
80
|
+
|
76
81
|
def no_repeat?
|
77
82
|
repeat == NO_REPEAT
|
78
83
|
end
|
@@ -4,8 +4,11 @@ module Compass
|
|
4
4
|
module ImageMethods
|
5
5
|
# Fetches the Sprite::Image object for the supplied name
|
6
6
|
def image_for(name)
|
7
|
-
|
8
|
-
|
7
|
+
if name.is_a?(Sass::Script::String)
|
8
|
+
name = name.value
|
9
|
+
end
|
10
|
+
name = name.to_s
|
11
|
+
@images.detect { |img| img.name == name}
|
9
12
|
end
|
10
13
|
|
11
14
|
# Returns true if the image name has a hover selector image
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Compass
|
2
|
+
module SassExtensions
|
3
|
+
module Sprites
|
4
|
+
class Images < Array
|
5
|
+
|
6
|
+
def sort_by!(method)
|
7
|
+
invert = false
|
8
|
+
if method.to_s[0] == '!'[0] # have todo this for 1.8.7 compat
|
9
|
+
method = method.to_s[1..-1]
|
10
|
+
invert = true
|
11
|
+
end
|
12
|
+
method = method.to_sym
|
13
|
+
self.sort! do |a, b|
|
14
|
+
unless a.send(method) == b.send(method)
|
15
|
+
a.send(method) <=> b.send(method)
|
16
|
+
else
|
17
|
+
other = ([:size, :name] - [method]).first
|
18
|
+
a.send(other) <=> b.send(other)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
self.reverse! if invert
|
22
|
+
end
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'rational'
|
2
|
+
module Compass
|
3
|
+
module SassExtensions
|
4
|
+
module Sprites
|
5
|
+
module Layout
|
6
|
+
class SpriteLayout
|
7
|
+
|
8
|
+
attr_reader :images, :options
|
9
|
+
attr_accessor :height, :width
|
10
|
+
|
11
|
+
def initialize(images, kwargs={})
|
12
|
+
@images = images
|
13
|
+
@options = kwargs
|
14
|
+
@height = 0
|
15
|
+
@width = 0
|
16
|
+
|
17
|
+
layout!
|
18
|
+
end
|
19
|
+
|
20
|
+
def layout!
|
21
|
+
raise Compass::SpriteException, "You must impliment layout!"
|
22
|
+
end
|
23
|
+
|
24
|
+
def properties
|
25
|
+
if @width.zero?
|
26
|
+
raise Compass::SpriteException, "You must set the width fetching the properties"
|
27
|
+
end
|
28
|
+
if @height.zero?
|
29
|
+
raise Compass::SpriteException, "You must set the height fetching the properties"
|
30
|
+
end
|
31
|
+
|
32
|
+
[@images, @width, @height]
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module Compass
|
2
|
+
module SassExtensions
|
3
|
+
module Sprites
|
4
|
+
module Layout
|
5
|
+
class Diagonal < SpriteLayout
|
6
|
+
|
7
|
+
def layout!
|
8
|
+
calculate_width!
|
9
|
+
calculate_height!
|
10
|
+
calculate_positions!
|
11
|
+
end
|
12
|
+
|
13
|
+
private # ===========================================================================================>
|
14
|
+
|
15
|
+
def calculate_width!
|
16
|
+
@width = @images.inject(0) {|sum, img| sum + img.width}
|
17
|
+
end
|
18
|
+
|
19
|
+
def calculate_height!
|
20
|
+
@height = @images.inject(0) {|sum, img| sum + img.height}
|
21
|
+
end
|
22
|
+
|
23
|
+
def calculate_positions!
|
24
|
+
previous = nil
|
25
|
+
@images.each_with_index do |image, index|
|
26
|
+
if previous.nil?
|
27
|
+
previous = image
|
28
|
+
image.top = @height - image.height
|
29
|
+
image.left = 0
|
30
|
+
next
|
31
|
+
end
|
32
|
+
image.top = previous.top - image.height
|
33
|
+
image.left = previous.left + previous.width
|
34
|
+
previous = image
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
module Compass
|
2
|
+
module SassExtensions
|
3
|
+
module Sprites
|
4
|
+
module Layout
|
5
|
+
class Horizontal < SpriteLayout
|
6
|
+
|
7
|
+
def layout!
|
8
|
+
calculate_height!
|
9
|
+
calculate_width!
|
10
|
+
calculate_positions!
|
11
|
+
tile_images_that_repeat!
|
12
|
+
end
|
13
|
+
|
14
|
+
private # ===========================================================================================>
|
15
|
+
|
16
|
+
def calculate_height!
|
17
|
+
@height = @images.map {|image| image.height + image.offset}.max
|
18
|
+
if repeating_images?
|
19
|
+
calculate_repeat_extra_height!
|
20
|
+
end
|
21
|
+
@height
|
22
|
+
end
|
23
|
+
|
24
|
+
def calculate_width!
|
25
|
+
@width = @images.inject(0) { |sum, image| sum += (image.width + image.spacing) }
|
26
|
+
end
|
27
|
+
|
28
|
+
def repeating_images?
|
29
|
+
@repeating_images ||= @images.any?(&:repeat_y?)
|
30
|
+
end
|
31
|
+
|
32
|
+
def calculate_repeat_extra_height!
|
33
|
+
m = @images.inject(1) {|m,img| img.repeat_y? ? m.lcm(img.height) : m }
|
34
|
+
remainder = @height % m
|
35
|
+
@height += (m - remainder) unless remainder.zero?
|
36
|
+
end
|
37
|
+
|
38
|
+
def calculate_positions!
|
39
|
+
@images.each_with_index do |image, index|
|
40
|
+
image.top = image.position.unit_str == '%' ? (@height - image.height) * (image.position.value / 100.0) : image.position.value
|
41
|
+
next if index == 0
|
42
|
+
last_image = @images[index-1]
|
43
|
+
image.left = last_image.left + last_image.width + [image.spacing, last_image.spacing].max
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def tile_images_that_repeat!
|
48
|
+
return unless repeating_images?
|
49
|
+
@images.map {|img| img if img.repeat_y?}.compact.each do |image|
|
50
|
+
y = (image.top + image.height)
|
51
|
+
while y < @height do
|
52
|
+
begin
|
53
|
+
img = image.dup
|
54
|
+
img.top = y.to_i
|
55
|
+
@images << img
|
56
|
+
y += image.height
|
57
|
+
end
|
58
|
+
end #while
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Compass
|
2
|
+
module SassExtensions
|
3
|
+
module Sprites
|
4
|
+
module Layout
|
5
|
+
class Smart < SpriteLayout
|
6
|
+
|
7
|
+
def layout!
|
8
|
+
calculate_positions!
|
9
|
+
end
|
10
|
+
|
11
|
+
private # ===========================================================================================>
|
12
|
+
|
13
|
+
def calculate_positions!
|
14
|
+
fitter = ::Compass::SassExtensions::Sprites::RowFitter.new(@images)
|
15
|
+
current_y = 0
|
16
|
+
fitter.fit!.each do |row|
|
17
|
+
current_x = 0
|
18
|
+
row.images.each_with_index do |image, index|
|
19
|
+
image.left = current_x
|
20
|
+
image.top = current_y
|
21
|
+
current_x += image.width
|
22
|
+
end
|
23
|
+
current_y += row.height
|
24
|
+
end
|
25
|
+
@width = fitter.width
|
26
|
+
@height = fitter.height
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
module Compass
|
2
|
+
module SassExtensions
|
3
|
+
module Sprites
|
4
|
+
module Layout
|
5
|
+
class Vertical < SpriteLayout
|
6
|
+
|
7
|
+
def layout!
|
8
|
+
calculate_width!
|
9
|
+
calculate_positions!
|
10
|
+
calculate_height!
|
11
|
+
tile_images_that_repeat!
|
12
|
+
end
|
13
|
+
|
14
|
+
private # ===========================================================================================>
|
15
|
+
|
16
|
+
def calculate_width!
|
17
|
+
@width = @images.map { |image| image.width + image.offset }.max
|
18
|
+
if repeating_images?
|
19
|
+
calculate_repeat_extra_width!
|
20
|
+
end
|
21
|
+
|
22
|
+
@width
|
23
|
+
end
|
24
|
+
|
25
|
+
def calculate_height!
|
26
|
+
last = @images.last
|
27
|
+
@height = last.top + last.height
|
28
|
+
end
|
29
|
+
|
30
|
+
def repeating_images?
|
31
|
+
@repeating_images ||= @images.any?(&:repeat_x?)
|
32
|
+
end
|
33
|
+
|
34
|
+
def calculate_repeat_extra_width!
|
35
|
+
m = @images.inject(1) {|m,img| img.repeat_x? ? m.lcm(img.width) : m }
|
36
|
+
remainder = @width % m
|
37
|
+
@width += (m - remainder) unless remainder.zero?
|
38
|
+
end
|
39
|
+
|
40
|
+
def calculate_positions!
|
41
|
+
@images.each_with_index do |image, index|
|
42
|
+
image.left = (image.position.unit_str == "%" ? (@width - image.width) * (image.position.value / 100.0) : image.position.value).to_i
|
43
|
+
next if index == 0
|
44
|
+
last_image = @images[index-1]
|
45
|
+
image.top = last_image.top + last_image.height + [image.spacing, last_image.spacing].max
|
46
|
+
end #each_with_index
|
47
|
+
end #method
|
48
|
+
|
49
|
+
def tile_images_that_repeat!
|
50
|
+
return unless repeating_images?
|
51
|
+
@images.map {|img| img if img.repeat_x?}.compact.each do |image|
|
52
|
+
x = image.left - (image.left / image.width).ceil * image.width
|
53
|
+
while x < @width do
|
54
|
+
begin
|
55
|
+
img = image.dup
|
56
|
+
img.top = image.top
|
57
|
+
img.left = x.to_i
|
58
|
+
@images << img
|
59
|
+
x += image.width
|
60
|
+
end #begin
|
61
|
+
end #while
|
62
|
+
end #map
|
63
|
+
end #method
|
64
|
+
end #Vertical
|
65
|
+
end #Layout
|
66
|
+
end #Sprites
|
67
|
+
end #SassExtensions
|
68
|
+
end #Compass
|
@@ -32,128 +32,22 @@ module Compass
|
|
32
32
|
def compute_image_positions!
|
33
33
|
case layout
|
34
34
|
when SMART
|
35
|
-
|
35
|
+
require 'compass/sass_extensions/sprites/layout/smart'
|
36
|
+
@images, @width, @height = Layout::Smart.new(@images, @kwargs).properties
|
36
37
|
when DIAGONAL
|
37
|
-
|
38
|
-
|
38
|
+
require 'compass/sass_extensions/sprites/layout/diagonal'
|
39
|
+
@images, @width, @height = Layout::Diagonal.new(@images, @kwargs).properties
|
39
40
|
when HORIZONTAL
|
40
|
-
|
41
|
-
|
42
|
-
@width = width_for_horizontal_layout
|
41
|
+
require 'compass/sass_extensions/sprites/layout/horizontal'
|
42
|
+
@images, @width, @height = Layout::Horizontal.new(@images, @kwargs).properties
|
43
43
|
else
|
44
|
-
|
45
|
-
|
46
|
-
a.name <=> b.name
|
47
|
-
else
|
48
|
-
b.size <=> a.size
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
@width = width_for_vertical_layout
|
53
|
-
calulate_vertical_postions
|
54
|
-
@height = height_for_vertical_layout
|
55
|
-
if @images.any?(&:repeat_x?)
|
56
|
-
calculate_repeat_extra_width!
|
57
|
-
tile_images_that_repeat
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
def tile_images_that_repeat
|
63
|
-
@images.map {|img| img if img.repeat_x?}.compact.each do |image|
|
64
|
-
x = image.left - (image.left / image.width).ceil * image.width
|
65
|
-
while x < @width do
|
66
|
-
begin
|
67
|
-
img = image.dup
|
68
|
-
img.top = image.top
|
69
|
-
img.left = x.to_i
|
70
|
-
@images << img
|
71
|
-
x += image.width
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
def calculate_repeat_extra_width!
|
78
|
-
require 'rational' #for ruby 1.8.7
|
79
|
-
m = @images.inject(1) {|m,img| img.repeat_x? ? m.lcm(img.width) : m}
|
80
|
-
remainder = @width % m
|
81
|
-
@width += (m - remainder) unless remainder.zero?
|
82
|
-
end
|
83
|
-
|
84
|
-
def calculate_smart_positions
|
85
|
-
fitter = ::Compass::SassExtensions::Sprites::RowFitter.new(@images)
|
86
|
-
current_y = 0
|
87
|
-
fitter.fit!.each do |row|
|
88
|
-
current_x = 0
|
89
|
-
row.images.each_with_index do |image, index|
|
90
|
-
image.left = current_x
|
91
|
-
image.top = current_y
|
92
|
-
current_x += image.width
|
93
|
-
end
|
94
|
-
current_y += row.height
|
95
|
-
end
|
96
|
-
@width = fitter.width
|
97
|
-
@height = fitter.height
|
98
|
-
end
|
99
|
-
|
100
|
-
|
101
|
-
def calculate_diagonal_dimensions
|
102
|
-
@width = @images.inject(0) {|sum, img| sum + img.width}
|
103
|
-
@height = @images.inject(0) {|sum, img| sum + img.height}
|
104
|
-
end
|
105
|
-
|
106
|
-
def calculate_diagonal_positions
|
107
|
-
previous = nil
|
108
|
-
@images.each_with_index do |image, index|
|
109
|
-
if previous.nil?
|
110
|
-
previous = image
|
111
|
-
image.top = @height - image.height
|
112
|
-
image.left = 0
|
113
|
-
next
|
114
|
-
end
|
115
|
-
image.top = previous.top - image.height
|
116
|
-
image.left = previous.left + previous.width
|
117
|
-
previous = image
|
44
|
+
require 'compass/sass_extensions/sprites/layout/vertical'
|
45
|
+
@images, @width, @height = Layout::Vertical.new(@images, @kwargs).properties
|
118
46
|
end
|
119
47
|
end
|
120
48
|
|
121
|
-
def calculate_horizontal_positions
|
122
|
-
@images.each_with_index do |image, index|
|
123
|
-
image.top = image.position.unit_str == '%' ? (@height - image.height) * (image.position.value / 100.0) : image.position.value
|
124
|
-
next if index == 0
|
125
|
-
last_image = @images[index-1]
|
126
|
-
image.left = last_image.left + last_image.width + [image.spacing, last_image.spacing].max
|
127
|
-
end
|
128
|
-
end
|
129
|
-
|
130
|
-
def calulate_vertical_postions
|
131
|
-
@images.each_with_index do |image, index|
|
132
|
-
image.left = (image.position.unit_str == "%" ? (@width - image.width) * (image.position.value / 100.0) : image.position.value).to_i
|
133
|
-
next if index == 0
|
134
|
-
last_image = @images[index-1]
|
135
|
-
image.top = last_image.top + last_image.height + [image.spacing, last_image.spacing].max
|
136
|
-
end
|
137
|
-
end
|
138
|
-
|
139
|
-
def height_for_vertical_layout
|
140
|
-
last = @images.last
|
141
|
-
last.top + last.height
|
142
|
-
end
|
143
|
-
|
144
|
-
def height_for_horizontal_layout
|
145
|
-
@height = @images.map {|image| image.height + image.offset}.max
|
146
|
-
end
|
147
|
-
|
148
|
-
def width_for_horizontal_layout
|
149
|
-
@images.inject(0) { |sum, image| sum += (image.width + image.spacing) }
|
150
|
-
end
|
151
|
-
|
152
|
-
def width_for_vertical_layout
|
153
|
-
@images.map { |image| image.width + image.offset }.max
|
154
|
-
end
|
155
49
|
end
|
156
50
|
end
|
157
51
|
end
|
158
52
|
end
|
159
|
-
|
53
|
+
|