compass-sass37 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE.markdown +1 -0
- data/Rakefile +237 -0
- data/VERSION +1 -0
- data/VERSION_NAME +1 -0
- data/bin/compass +45 -0
- data/features/command_line.feature +195 -0
- data/features/extensions.feature +27 -0
- data/features/step_definitions/command_line_steps.rb +268 -0
- data/features/step_definitions/extension_steps.rb +24 -0
- data/lib/compass/actions.rb +116 -0
- data/lib/compass/app_integration/stand_alone/configuration_defaults.rb +32 -0
- data/lib/compass/app_integration/stand_alone/installer.rb +83 -0
- data/lib/compass/app_integration/stand_alone.rb +22 -0
- data/lib/compass/app_integration.rb +39 -0
- data/lib/compass/commands/base.rb +44 -0
- data/lib/compass/commands/clean_project.rb +79 -0
- data/lib/compass/commands/create_project.rb +131 -0
- data/lib/compass/commands/default.rb +50 -0
- data/lib/compass/commands/extension_command.rb +60 -0
- data/lib/compass/commands/help.rb +85 -0
- data/lib/compass/commands/imports.rb +35 -0
- data/lib/compass/commands/installer_command.rb +32 -0
- data/lib/compass/commands/interactive.rb +61 -0
- data/lib/compass/commands/list_frameworks.rb +39 -0
- data/lib/compass/commands/print_version.rb +88 -0
- data/lib/compass/commands/project_base.rb +103 -0
- data/lib/compass/commands/project_stats.rb +178 -0
- data/lib/compass/commands/project_structure.rb +93 -0
- data/lib/compass/commands/registry.rb +40 -0
- data/lib/compass/commands/sprite.rb +89 -0
- data/lib/compass/commands/stamp_pattern.rb +90 -0
- data/lib/compass/commands/unpack_extension.rb +120 -0
- data/lib/compass/commands/update_project.rb +148 -0
- data/lib/compass/commands/validate_project.rb +77 -0
- data/lib/compass/commands/watch_project.rb +117 -0
- data/lib/compass/commands/write_configuration.rb +125 -0
- data/lib/compass/commands.rb +14 -0
- data/lib/compass/compiler.rb +249 -0
- data/lib/compass/configuration/comments.rb +62 -0
- data/lib/compass/configuration/file_data.rb +21 -0
- data/lib/compass/configuration/helpers.rb +113 -0
- data/lib/compass/configuration/serialization.rb +95 -0
- data/lib/compass/dependencies.rb +12 -0
- data/lib/compass/deprecation.rb +19 -0
- data/lib/compass/errors.rb +9 -0
- data/lib/compass/exec/command_option_parser.rb +23 -0
- data/lib/compass/exec/global_options_parser.rb +59 -0
- data/lib/compass/exec/helpers.rb +21 -0
- data/lib/compass/exec/project_options_parser.rb +74 -0
- data/lib/compass/exec/sub_command_ui.rb +51 -0
- data/lib/compass/exec.rb +23 -0
- data/lib/compass/generated_version.rb +4 -0
- data/lib/compass/installers/bare_installer.rb +58 -0
- data/lib/compass/installers/base.rb +187 -0
- data/lib/compass/installers/manifest.rb +161 -0
- data/lib/compass/installers/manifest_installer.rb +61 -0
- data/lib/compass/installers/template_context.rb +44 -0
- data/lib/compass/installers.rb +3 -0
- data/lib/compass/logger.rb +140 -0
- data/lib/compass/quick_cache.rb +15 -0
- data/lib/compass/rails.rb +2 -0
- data/lib/compass/sass_compiler.rb +152 -0
- data/lib/compass/sass_extensions/functions/sprites.rb +305 -0
- data/lib/compass/sass_extensions/functions.rb +15 -0
- data/lib/compass/sass_extensions/sprites/engines/chunky_png_engine.rb +35 -0
- data/lib/compass/sass_extensions/sprites/engines.rb +25 -0
- data/lib/compass/sass_extensions/sprites/image.rb +162 -0
- data/lib/compass/sass_extensions/sprites/image_methods.rb +52 -0
- data/lib/compass/sass_extensions/sprites/image_row.rb +47 -0
- data/lib/compass/sass_extensions/sprites/images.rb +29 -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.rb +39 -0
- data/lib/compass/sass_extensions/sprites/layout_methods.rb +53 -0
- data/lib/compass/sass_extensions/sprites/row_fitter.rb +92 -0
- data/lib/compass/sass_extensions/sprites/sprite_map.rb +93 -0
- data/lib/compass/sass_extensions/sprites/sprite_methods.rb +136 -0
- data/lib/compass/sass_extensions/sprites.rb +21 -0
- data/lib/compass/sass_extensions.rb +9 -0
- data/lib/compass/sprite_importer/binding.rb +11 -0
- data/lib/compass/sprite_importer/content.erb +87 -0
- data/lib/compass/sprite_importer.rb +117 -0
- data/lib/compass/stats.rb +99 -0
- data/lib/compass/test_case.rb +38 -0
- data/lib/compass/validator.rb +16 -0
- data/lib/compass/version.rb +42 -0
- data/lib/compass.rb +39 -0
- data/test/fixtures/extensions/only_stylesheets/compass_init.rb +1 -0
- data/test/fixtures/extensions/only_stylesheets/scss/only_stylesheets/foo.scss +3 -0
- data/test/fixtures/fonts/bgrove.base64.txt +1 -0
- data/test/fixtures/fonts/bgrove.ttf +0 -0
- data/test/fixtures/sprites/public/images/bad_extensions/ten-by-ten.gif +0 -0
- data/test/fixtures/sprites/public/images/bad_extensions/twenty-by-twenty.jpg +0 -0
- data/test/fixtures/sprites/public/images/bool/false.png +0 -0
- data/test/fixtures/sprites/public/images/bool/true.png +0 -0
- data/test/fixtures/sprites/public/images/colors/blue.png +0 -0
- data/test/fixtures/sprites/public/images/colors/yellow.png +0 -0
- data/test/fixtures/sprites/public/images/focus/ten-by-ten.png +0 -0
- data/test/fixtures/sprites/public/images/focus/ten-by-ten_active.png +0 -0
- data/test/fixtures/sprites/public/images/focus/ten-by-ten_focus.png +0 -0
- data/test/fixtures/sprites/public/images/focus/ten-by-ten_hover.png +0 -0
- data/test/fixtures/sprites/public/images/focus/ten-by-ten_target.png +0 -0
- data/test/fixtures/sprites/public/images/image_row/large.png +0 -0
- data/test/fixtures/sprites/public/images/image_row/large_square.png +0 -0
- data/test/fixtures/sprites/public/images/image_row/medium.png +0 -0
- data/test/fixtures/sprites/public/images/image_row/small.png +0 -0
- data/test/fixtures/sprites/public/images/image_row/tall.png +0 -0
- data/test/fixtures/sprites/public/images/ko/default_background.png +0 -0
- data/test/fixtures/sprites/public/images/ko/starbg26x27.png +0 -0
- data/test/fixtures/sprites/public/images/nested/squares/ten-by-ten.png +0 -0
- data/test/fixtures/sprites/public/images/numeric/200.png +0 -0
- data/test/fixtures/sprites/public/images/prefix/20-by-20.png +0 -0
- data/test/fixtures/sprites/public/images/prefix/ten-by-ten.png +0 -0
- data/test/fixtures/sprites/public/images/repeat_x/five.png +0 -0
- data/test/fixtures/sprites/public/images/repeat_x/four.png +0 -0
- data/test/fixtures/sprites/public/images/repeat_x/one.png +0 -0
- data/test/fixtures/sprites/public/images/repeat_x/three.png +0 -0
- data/test/fixtures/sprites/public/images/repeat_x/two.png +0 -0
- data/test/fixtures/sprites/public/images/selectors/ten-by-ten.png +0 -0
- data/test/fixtures/sprites/public/images/selectors/ten-by-ten_active.png +0 -0
- data/test/fixtures/sprites/public/images/selectors/ten-by-ten_hover.png +0 -0
- data/test/fixtures/sprites/public/images/selectors/ten-by-ten_target.png +0 -0
- data/test/fixtures/sprites/public/images/squares/ten-by-ten.png +0 -0
- data/test/fixtures/sprites/public/images/squares/twenty-by-twenty.png +0 -0
- data/test/fixtures/stylesheets/busted_font_urls/config.rb +32 -0
- data/test/fixtures/stylesheets/busted_font_urls/css/screen.css +9 -0
- data/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 +14 -0
- data/test/fixtures/stylesheets/busted_image_urls/config.rb +29 -0
- data/test/fixtures/stylesheets/busted_image_urls/css/screen.css +9 -0
- data/test/fixtures/stylesheets/busted_image_urls/images/feed.png +0 -0
- data/test/fixtures/stylesheets/busted_image_urls/images/flags/dk.png +0 -0
- data/test/fixtures/stylesheets/busted_image_urls/images/grid.png +0 -0
- data/test/fixtures/stylesheets/busted_image_urls/sass/screen.sass +14 -0
- data/test/fixtures/stylesheets/compass/100x150.jpg +0 -0
- data/test/fixtures/stylesheets/compass/config.rb +18 -0
- data/test/fixtures/stylesheets/compass/css/animation-with-legacy-ie.css +22 -0
- data/test/fixtures/stylesheets/compass/css/animation.css +22 -0
- data/test/fixtures/stylesheets/compass/css/appearance.css +3 -0
- data/test/fixtures/stylesheets/compass/css/background-clip.css +11 -0
- data/test/fixtures/stylesheets/compass/css/background-origin.css +11 -0
- data/test/fixtures/stylesheets/compass/css/background-size.css +17 -0
- data/test/fixtures/stylesheets/compass/css/border_radius.css +14 -0
- data/test/fixtures/stylesheets/compass/css/box-sizing.css +14 -0
- data/test/fixtures/stylesheets/compass/css/box.css +103 -0
- data/test/fixtures/stylesheets/compass/css/box_shadow.css +24 -0
- data/test/fixtures/stylesheets/compass/css/brightness.css +14 -0
- data/test/fixtures/stylesheets/compass/css/browser-support.css +335 -0
- data/test/fixtures/stylesheets/compass/css/color.css +18 -0
- data/test/fixtures/stylesheets/compass/css/columns.css +134 -0
- data/test/fixtures/stylesheets/compass/css/filters.css +53 -0
- data/test/fixtures/stylesheets/compass/css/flexbox.css +94 -0
- data/test/fixtures/stylesheets/compass/css/fonts.css +8 -0
- data/test/fixtures/stylesheets/compass/css/force-wrap.css +9 -0
- data/test/fixtures/stylesheets/compass/css/gradients.css +222 -0
- data/test/fixtures/stylesheets/compass/css/grid_background.css +79 -0
- data/test/fixtures/stylesheets/compass/css/hyphenation.css +16 -0
- data/test/fixtures/stylesheets/compass/css/image_size.css +15 -0
- data/test/fixtures/stylesheets/compass/css/images.css +8 -0
- data/test/fixtures/stylesheets/compass/css/layout.css +16 -0
- data/test/fixtures/stylesheets/compass/css/legacy_clearfix.css +26 -0
- data/test/fixtures/stylesheets/compass/css/lists.css +145 -0
- data/test/fixtures/stylesheets/compass/css/opacity.css +7 -0
- data/test/fixtures/stylesheets/compass/css/print.css +11 -0
- data/test/fixtures/stylesheets/compass/css/regions.css +9 -0
- data/test/fixtures/stylesheets/compass/css/replacement.css +66 -0
- data/test/fixtures/stylesheets/compass/css/reset.css +59 -0
- data/test/fixtures/stylesheets/compass/css/selection.css +50 -0
- data/test/fixtures/stylesheets/compass/css/sprites_with_explicit_separator.css +19 -0
- data/test/fixtures/stylesheets/compass/css/stretching.css +66 -0
- data/test/fixtures/stylesheets/compass/css/support.css +116 -0
- data/test/fixtures/stylesheets/compass/css/text_shadow.css +29 -0
- data/test/fixtures/stylesheets/compass/css/transform.css +341 -0
- data/test/fixtures/stylesheets/compass/css/transition.css +116 -0
- data/test/fixtures/stylesheets/compass/css/typography/links/hover-link.css +4 -0
- data/test/fixtures/stylesheets/compass/css/units.css +34 -0
- data/test/fixtures/stylesheets/compass/css/user-interface.css +52 -0
- data/test/fixtures/stylesheets/compass/css/utilities.css +71 -0
- data/test/fixtures/stylesheets/compass/css/vertical_rhythm.css +42 -0
- data/test/fixtures/stylesheets/compass/css/vertical_rhythm_with_ems.css +53 -0
- data/test/fixtures/stylesheets/compass/css/vertical_rhythm_with_px.css +52 -0
- data/test/fixtures/stylesheets/compass/css/vertical_rhythm_with_rems.css +67 -0
- data/test/fixtures/stylesheets/compass/images/100x150.gif +0 -0
- data/test/fixtures/stylesheets/compass/images/100x150.jpeg +0 -0
- data/test/fixtures/stylesheets/compass/images/100x150.jpg +0 -0
- data/test/fixtures/stylesheets/compass/images/100x150.png +0 -0
- data/test/fixtures/stylesheets/compass/images/4x6.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ad.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ae.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/af.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ag.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ai.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/al.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/am.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/an.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ao.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ar.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/as.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/at.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/au.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/aw.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ax.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/az.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ba.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bb.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bd.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/be.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bf.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bg.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bh.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bi.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bj.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bn.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bo.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/br.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bs.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bt.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bv.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bw.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/by.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bz.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ca.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/catalonia.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cc.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cd.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cf.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cg.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ch.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ci.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ck.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cl.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cn.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/co.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cs.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cu.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cv.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cx.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cy.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cz.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/de.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/dj.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/dk.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/dm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/do.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/dz.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ec.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ee.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/eg.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/eh.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/england.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/er.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/es.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/et.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/europeanunion.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/fam.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/fi.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/fj.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/fk.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/fm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/fo.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/fr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ga.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gb.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gd.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ge.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gf.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gh.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gi.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gl.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gn.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gp.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gq.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gs.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gt.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gu.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gw.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gy.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/hk.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/hm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/hn.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/hr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ht.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/hu.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/id-2.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ie.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/il.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/in.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/io.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/iq.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ir.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/is.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/it.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/jm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/jo.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/jp.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ke.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/kg.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/kh.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ki.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/km.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/kn.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/kp.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/kr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/kw.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ky.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/kz.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/la.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/lb.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/lc.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/li.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/lk.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/lr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ls.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/lt.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/lu.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/lv.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ly.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ma.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mc.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/md.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/me.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mg.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mh.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mk.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ml.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mn.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mo.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mp.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mq.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ms.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mt.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mu.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mv.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mw.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mx.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/my.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mz.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/na.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/nc.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ne.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/nf.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ng.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ni.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/nl.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/no.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/np.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/nr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/nu.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/nz.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/om.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pa.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pe.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pf.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pg.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ph.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pk.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pl.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pn.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ps.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pt.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pw.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/py.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/qa.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/re.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ro.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/rs.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ru.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/rw.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sa.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sb.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sc.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/scotland.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sd.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/se.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sg.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sh.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/si.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sj.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sk.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sl.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sn.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/so.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/st.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sv.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sy.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sz.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tc.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/td.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tf.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tg.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/th.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tj.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tk.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tl.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tn.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/to.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tt.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tv.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tw.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tz.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ua.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ug.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/um.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/us.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/uy.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/uz.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/va.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/vc.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ve.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/vg.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/vi.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/vn.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/vu.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/wales.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/wf.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ws.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ye.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/yt.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/za.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/zm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/zw.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag-s5b4f509715.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag_states/foo.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag_states/foo_active.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag_states/foo_focus.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag_states/foo_hover.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag_states/foo_target.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag_states-sc42d7bf926.png +0 -0
- data/test/fixtures/stylesheets/compass/sass/animation-with-legacy-ie.scss +17 -0
- data/test/fixtures/stylesheets/compass/sass/animation.scss +13 -0
- data/test/fixtures/stylesheets/compass/sass/appearance.scss +5 -0
- data/test/fixtures/stylesheets/compass/sass/background-clip.scss +5 -0
- data/test/fixtures/stylesheets/compass/sass/background-origin.scss +5 -0
- data/test/fixtures/stylesheets/compass/sass/background-size.scss +7 -0
- data/test/fixtures/stylesheets/compass/sass/border_radius.scss +5 -0
- data/test/fixtures/stylesheets/compass/sass/box-sizing.scss +11 -0
- data/test/fixtures/stylesheets/compass/sass/box.sass +50 -0
- data/test/fixtures/stylesheets/compass/sass/box_shadow.scss +7 -0
- data/test/fixtures/stylesheets/compass/sass/brightness.scss +12 -0
- data/test/fixtures/stylesheets/compass/sass/browser-support.scss +30 -0
- data/test/fixtures/stylesheets/compass/sass/color.scss +25 -0
- data/test/fixtures/stylesheets/compass/sass/columns.scss +29 -0
- data/test/fixtures/stylesheets/compass/sass/filters.scss +25 -0
- data/test/fixtures/stylesheets/compass/sass/flexbox.scss +88 -0
- data/test/fixtures/stylesheets/compass/sass/fonts.sass +8 -0
- data/test/fixtures/stylesheets/compass/sass/force-wrap.scss +3 -0
- data/test/fixtures/stylesheets/compass/sass/gradients.sass +128 -0
- data/test/fixtures/stylesheets/compass/sass/grid_background.scss +34 -0
- data/test/fixtures/stylesheets/compass/sass/hyphenation.scss +11 -0
- data/test/fixtures/stylesheets/compass/sass/image_size.sass +15 -0
- data/test/fixtures/stylesheets/compass/sass/images.scss +9 -0
- data/test/fixtures/stylesheets/compass/sass/layout.sass +3 -0
- data/test/fixtures/stylesheets/compass/sass/legacy_clearfix.scss +14 -0
- data/test/fixtures/stylesheets/compass/sass/lists.scss +12 -0
- data/test/fixtures/stylesheets/compass/sass/opacity.scss +9 -0
- data/test/fixtures/stylesheets/compass/sass/print.sass +5 -0
- data/test/fixtures/stylesheets/compass/sass/regions.scss +4 -0
- data/test/fixtures/stylesheets/compass/sass/replacement.scss +22 -0
- data/test/fixtures/stylesheets/compass/sass/reset.sass +12 -0
- data/test/fixtures/stylesheets/compass/sass/selection.scss +41 -0
- data/test/fixtures/stylesheets/compass/sass/sprites_with_explicit_separator.scss +11 -0
- data/test/fixtures/stylesheets/compass/sass/stretching.sass +34 -0
- data/test/fixtures/stylesheets/compass/sass/support.scss +174 -0
- data/test/fixtures/stylesheets/compass/sass/text_shadow.scss +12 -0
- data/test/fixtures/stylesheets/compass/sass/transform.scss +87 -0
- data/test/fixtures/stylesheets/compass/sass/transition.scss +21 -0
- data/test/fixtures/stylesheets/compass/sass/typography/links/hover-link.scss +3 -0
- data/test/fixtures/stylesheets/compass/sass/units.scss +50 -0
- data/test/fixtures/stylesheets/compass/sass/user-interface.scss +28 -0
- data/test/fixtures/stylesheets/compass/sass/utilities.scss +33 -0
- data/test/fixtures/stylesheets/compass/sass/vertical_rhythm.scss +60 -0
- data/test/fixtures/stylesheets/compass/sass/vertical_rhythm_with_ems.scss +52 -0
- data/test/fixtures/stylesheets/compass/sass/vertical_rhythm_with_px.scss +50 -0
- data/test/fixtures/stylesheets/compass/sass/vertical_rhythm_with_rems.scss +50 -0
- data/test/fixtures/stylesheets/envtest/config.rb +9 -0
- data/test/fixtures/stylesheets/envtest/css/env.css +10 -0
- data/test/fixtures/stylesheets/envtest/sass/env.scss +19 -0
- data/test/fixtures/stylesheets/error/config.rb +10 -0
- data/test/fixtures/stylesheets/error/sass/screen.sass +2 -0
- data/test/fixtures/stylesheets/image_urls/config.rb +19 -0
- data/test/fixtures/stylesheets/image_urls/css/screen.css +5 -0
- data/test/fixtures/stylesheets/image_urls/images/grid.png +0 -0
- data/test/fixtures/stylesheets/image_urls/sass/screen.sass +8 -0
- data/test/fixtures/stylesheets/relative/assets/images/testing.png +0 -0
- data/test/fixtures/stylesheets/relative/config.rb +10 -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 +5 -0
- data/test/fixtures/stylesheets/relative/sass/print.sass +3 -0
- data/test/fixtures/stylesheets/relative/sass/screen.sass +2 -0
- data/test/fixtures/stylesheets/sourcemaps/config.rb +10 -0
- data/test/fixtures/stylesheets/sourcemaps/css/another_simple.css +2 -0
- data/test/fixtures/stylesheets/sourcemaps/css/another_simple.css.map +7 -0
- data/test/fixtures/stylesheets/sourcemaps/css/simple.css +2 -0
- data/test/fixtures/stylesheets/sourcemaps/css/simple.css.map +7 -0
- data/test/fixtures/stylesheets/sourcemaps/css/with_libraries.css +2 -0
- data/test/fixtures/stylesheets/sourcemaps/css/with_libraries.css.map +7 -0
- data/test/fixtures/stylesheets/sourcemaps/sass/another_simple.scss +3 -0
- data/test/fixtures/stylesheets/sourcemaps/sass/simple.sass +2 -0
- data/test/fixtures/stylesheets/sourcemaps/sass/with_libraries.scss +5 -0
- data/test/fixtures/stylesheets/uses_only_stylesheets_ext/config.rb +25 -0
- data/test/fixtures/stylesheets/uses_only_stylesheets_ext/sass/ie.scss +5 -0
- data/test/fixtures/stylesheets/uses_only_stylesheets_ext/sass/print.scss +3 -0
- data/test/fixtures/stylesheets/uses_only_stylesheets_ext/sass/screen.scss +6 -0
- data/test/fixtures/stylesheets/uses_only_stylesheets_ext/stylesheets/ie.css +5 -0
- data/test/fixtures/stylesheets/uses_only_stylesheets_ext/stylesheets/print.css +3 -0
- data/test/fixtures/stylesheets/uses_only_stylesheets_ext/stylesheets/screen.css +68 -0
- data/test/fixtures/stylesheets/valid/config.rb +9 -0
- data/test/fixtures/stylesheets/valid/sass/another_simple.scss +3 -0
- data/test/fixtures/stylesheets/valid/sass/simple.sass +2 -0
- data/test/fixtures/stylesheets/with_sass_globbing/config.rb +26 -0
- data/test/fixtures/stylesheets/with_sass_globbing/css/screen.css +19 -0
- data/test/fixtures/stylesheets/with_sass_globbing/sass/partials/_1.scss +3 -0
- data/test/fixtures/stylesheets/with_sass_globbing/sass/partials/_2.scss +3 -0
- data/test/fixtures/stylesheets/with_sass_globbing/sass/partials/_3.scss +4 -0
- data/test/fixtures/stylesheets/with_sass_globbing/sass/screen.scss +3 -0
- data/test/helpers/command_line.rb +114 -0
- data/test/helpers/diff.rb +49 -0
- data/test/helpers/io.rb +36 -0
- data/test/helpers/rails.rb +55 -0
- data/test/helpers/test_case.rb +62 -0
- data/test/integrations/compass_test.rb +259 -0
- data/test/integrations/sprites_test.rb +1123 -0
- data/test/test_helper.rb +67 -0
- data/test/units/actions_test.rb +24 -0
- data/test/units/caniuse_test.rb +194 -0
- data/test/units/command_line_test.rb +60 -0
- data/test/units/compass_util_test.rb +11 -0
- data/test/units/compiler_test.rb +16 -0
- data/test/units/configuration_test.rb +618 -0
- data/test/units/regressions_test.rb +35 -0
- data/test/units/sass_extensions_test.rb +232 -0
- data/test/units/sass_extenstions/gradients_test.rb +30 -0
- data/test/units/sprites/engine_test.rb +48 -0
- data/test/units/sprites/image_row_test.rb +58 -0
- data/test/units/sprites/image_test.rb +116 -0
- data/test/units/sprites/images_test.rb +46 -0
- data/test/units/sprites/importer_test.rb +91 -0
- data/test/units/sprites/layout_test.rb +180 -0
- data/test/units/sprites/row_fitter_test.rb +66 -0
- data/test/units/sprites/sprite_command_test.rb +55 -0
- data/test/units/sprites/sprite_map_test.rb +169 -0
- metadata +1175 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
module Compass::Exec::ProjectOptionsParser
|
|
2
|
+
def set_options(opts)
|
|
3
|
+
super
|
|
4
|
+
set_project_options(opts)
|
|
5
|
+
end
|
|
6
|
+
def set_dir_or_path(type, dir)
|
|
7
|
+
if Pathname.new(dir).absolute?
|
|
8
|
+
self.options[:"#{type}_path"] = dir.tr('\\','/')
|
|
9
|
+
else
|
|
10
|
+
self.options[:"#{type}_dir"] = dir.tr('\\','/')
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def set_project_options(opts)
|
|
15
|
+
opts.on('-c', '--config CONFIG_FILE', 'Specify the location of the configuration file explicitly.') do |configuration_file|
|
|
16
|
+
self.options[:configuration_file] = configuration_file
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
opts.on('--app APP', 'Tell compass what kind of application it is integrating with. E.g. rails') do |project_type|
|
|
20
|
+
self.options[:project_type] = project_type.to_sym
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
opts.on('--app-dir PATH', 'The base directory for your application.') do |project_path|
|
|
24
|
+
self.options[:project_path] = project_path
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
opts.on('--sass-dir SRC_DIR', "The source directory where you keep your sass stylesheets.") do |sass_dir|
|
|
28
|
+
set_dir_or_path(:sass, sass_dir)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
opts.on('--css-dir CSS_DIR', "The target directory where you keep your css stylesheets.") do |css_dir|
|
|
32
|
+
set_dir_or_path(:css, css_dir)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
opts.on('--images-dir IMAGES_DIR', "The directory where you keep your images.") do |images_dir|
|
|
36
|
+
set_dir_or_path(:images, images_dir)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
opts.on('--javascripts-dir JS_DIR', "The directory where you keep your javascripts.") do |javascripts_dir|
|
|
40
|
+
set_dir_or_path(:javascripts, javascripts_dir)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
opts.on('--fonts-dir FONTS_DIR', "The directory where you keep your fonts.") do |fonts_dir|
|
|
44
|
+
set_dir_or_path(:fonts, fonts_dir)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
opts.on('-e ENV', '--environment ENV', [:development, :production], 'Use sensible defaults for your current environment.',
|
|
48
|
+
' One of: development (default), production') do |env|
|
|
49
|
+
self.options[:environment] = env
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
opts.on('-s STYLE', '--output-style STYLE', [:nested, :expanded, :compact, :compressed], 'Select a CSS output mode.',
|
|
53
|
+
' One of: nested, expanded, compact, compressed') do |style|
|
|
54
|
+
self.options[:output_style] = style
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
opts.on('--relative-assets', :NONE, 'Make compass asset helpers generate relative urls to assets.') do
|
|
58
|
+
self.options[:relative_assets] = true
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
opts.on('--no-line-comments', :NONE, 'Disable line comments.') do
|
|
62
|
+
self.options[:line_comments] = false
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
opts.on('--http-path HTTP_PATH', 'Set this to the root of your project when deployed') do |http_path|
|
|
66
|
+
self.options[:http_path] = http_path
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
opts.on('--generated-images-path GENERATED_IMAGES_PATH', 'The path where you generate your images') do |generated_images_path|
|
|
70
|
+
self.options[:generated_images_path] = generated_images_path
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
require 'compass/exec/global_options_parser'
|
|
2
|
+
require 'compass/exec/project_options_parser'
|
|
3
|
+
|
|
4
|
+
module Compass::Exec
|
|
5
|
+
class SubCommandUI
|
|
6
|
+
|
|
7
|
+
attr_accessor :args
|
|
8
|
+
|
|
9
|
+
def initialize(args)
|
|
10
|
+
self.args = args
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def run!
|
|
14
|
+
begin
|
|
15
|
+
return perform!
|
|
16
|
+
rescue Exception => e
|
|
17
|
+
raise e if e.is_a? SystemExit
|
|
18
|
+
if e.is_a?(::Compass::Error) || e.is_a?(OptionParser::ParseError)
|
|
19
|
+
$stderr.puts e.message
|
|
20
|
+
else
|
|
21
|
+
::Compass::Exec::Helpers.report_error(e, @options || {})
|
|
22
|
+
end
|
|
23
|
+
return 1
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
protected
|
|
28
|
+
|
|
29
|
+
def perform!
|
|
30
|
+
$command = args.shift
|
|
31
|
+
command_class = Compass::Commands[$command]
|
|
32
|
+
unless command_class
|
|
33
|
+
args.unshift($command)
|
|
34
|
+
$command = "help"
|
|
35
|
+
command_class = Compass::Commands::Default
|
|
36
|
+
end
|
|
37
|
+
@options = if command_class.respond_to?("parse_#{$command}!")
|
|
38
|
+
command_class.send("parse_#{$command}!", args)
|
|
39
|
+
else
|
|
40
|
+
command_class.parse!(args)
|
|
41
|
+
end
|
|
42
|
+
cmd = command_class.new(Dir.getwd, @options)
|
|
43
|
+
cmd.execute
|
|
44
|
+
cmd.successful? ? 0 : 1
|
|
45
|
+
rescue OptionParser::ParseError => e
|
|
46
|
+
puts "Error: #{e.message}"
|
|
47
|
+
puts command_class.usage if command_class.respond_to?(:usage)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
end
|
|
51
|
+
end
|
data/lib/compass/exec.rb
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require 'compass/dependencies'
|
|
2
|
+
require 'optparse'
|
|
3
|
+
require 'compass/logger'
|
|
4
|
+
require 'compass/errors'
|
|
5
|
+
require 'compass/actions'
|
|
6
|
+
require 'compass/installers'
|
|
7
|
+
require 'compass/commands'
|
|
8
|
+
require 'rbconfig'
|
|
9
|
+
require 'pathname'
|
|
10
|
+
begin
|
|
11
|
+
require 'win32console' if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
|
|
12
|
+
rescue LoadError
|
|
13
|
+
$boring = true
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
module Compass::Exec
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
%w(helpers sub_command_ui
|
|
20
|
+
global_options_parser project_options_parser
|
|
21
|
+
command_option_parser).each do |lib|
|
|
22
|
+
require "compass/exec/#{lib}"
|
|
23
|
+
end
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
module Compass
|
|
2
|
+
module Installers
|
|
3
|
+
|
|
4
|
+
class BareInstaller < Base
|
|
5
|
+
def completed_configuration
|
|
6
|
+
nil
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def init
|
|
10
|
+
directory targetize("")
|
|
11
|
+
directory targetize(Compass.configuration.sass_dir)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def prepare
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def install
|
|
18
|
+
config_file ||= targetize('config.rb')
|
|
19
|
+
write_file config_file, config_contents
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def config_contents
|
|
23
|
+
project_path, Compass.configuration.project_path = Compass.configuration.project_path, nil
|
|
24
|
+
Compass.configuration.serialize
|
|
25
|
+
ensure
|
|
26
|
+
Compass.configuration.project_path = project_path
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def finalize(options = {})
|
|
30
|
+
puts <<-NEXTSTEPS
|
|
31
|
+
|
|
32
|
+
*********************************************************************
|
|
33
|
+
Congratulations! Your compass project has been created.
|
|
34
|
+
|
|
35
|
+
You may now add sass stylesheets to the #{Compass.configuration.sass_dir} subdirectory of your project.
|
|
36
|
+
|
|
37
|
+
Sass files beginning with an underscore are called partials and won't be
|
|
38
|
+
compiled to CSS, but they can be imported into other sass stylesheets.
|
|
39
|
+
|
|
40
|
+
You can configure your project by editing the config.rb configuration file.
|
|
41
|
+
|
|
42
|
+
You must compile your sass stylesheets into CSS when they change.
|
|
43
|
+
This can be done in one of the following ways:
|
|
44
|
+
1. To compile on demand:
|
|
45
|
+
compass compile [path/to/project]
|
|
46
|
+
2. To monitor your project for changes and automatically recompile:
|
|
47
|
+
compass watch [path/to/project]
|
|
48
|
+
|
|
49
|
+
More Resources:
|
|
50
|
+
* Website: http://compass-style.org/
|
|
51
|
+
* Sass: http://sass-lang.com
|
|
52
|
+
* Community: http://groups.google.com/group/compass-users/
|
|
53
|
+
NEXTSTEPS
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
module Compass
|
|
2
|
+
module Installers
|
|
3
|
+
|
|
4
|
+
class Base
|
|
5
|
+
|
|
6
|
+
include Actions
|
|
7
|
+
|
|
8
|
+
attr_accessor :template_path, :target_path, :working_path
|
|
9
|
+
attr_accessor :options
|
|
10
|
+
|
|
11
|
+
def initialize(template_path, target_path, options = {})
|
|
12
|
+
@template_path = template_path
|
|
13
|
+
@target_path = target_path
|
|
14
|
+
@working_path = Dir.getwd
|
|
15
|
+
@options = options
|
|
16
|
+
self.logger = options[:logger]
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
[:css_dir, :sass_dir, :images_dir, :javascripts_dir, :http_stylesheets_path, :fonts_dir, :preferred_syntax].each do |dir|
|
|
20
|
+
define_method dir do
|
|
21
|
+
Compass.configuration.send(dir)
|
|
22
|
+
end
|
|
23
|
+
define_method "#{dir}_without_default" do
|
|
24
|
+
Compass.configuration.send("#{dir}_without_default")
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Runs the installer.
|
|
29
|
+
# Every installer must conform to the installation strategy of prepare, install, and then finalize.
|
|
30
|
+
# A default implementation is provided for each step.
|
|
31
|
+
def run(run_options = {})
|
|
32
|
+
prepare unless run_options[:skip_preparation]
|
|
33
|
+
install unless options[:prepare]
|
|
34
|
+
finalize(options.merge(run_options)) unless options[:prepare] || run_options[:skip_finalization]
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# The default prepare method -- it is a no-op.
|
|
38
|
+
# Generally you would create required directories, etc.
|
|
39
|
+
def prepare
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# The install method override this to install
|
|
43
|
+
def install
|
|
44
|
+
raise "Not Yet Implemented"
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# The default finalize method -- it is a no-op.
|
|
48
|
+
# This could print out a message or something.
|
|
49
|
+
def finalize(options = {})
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def compilation_required?
|
|
53
|
+
false
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def pattern_name_as_dir
|
|
57
|
+
"#{options[:pattern_name]}/" if options[:pattern_name]
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def self.installer(type, installer_opts = {}, &locator)
|
|
61
|
+
locator ||= lambda{|to| to}
|
|
62
|
+
loc_method = "install_location_for_#{type}".to_sym
|
|
63
|
+
define_method("simple_#{loc_method}", locator)
|
|
64
|
+
define_method(loc_method) do |to, options|
|
|
65
|
+
if options[:like] && options[:like] != type
|
|
66
|
+
send("install_location_for_#{options[:like]}", to, options)
|
|
67
|
+
else
|
|
68
|
+
send("simple_#{loc_method}", to)
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
define_method "install_#{type}" do |from, to, options|
|
|
72
|
+
from = templatize(from)
|
|
73
|
+
to = targetize(send(loc_method, to, options))
|
|
74
|
+
is_binary = installer_opts[:binary] || options[:binary]
|
|
75
|
+
if is_binary
|
|
76
|
+
copy from, to, nil, is_binary
|
|
77
|
+
else
|
|
78
|
+
contents = File.new(from).read
|
|
79
|
+
if options.delete(:erb)
|
|
80
|
+
ctx = TemplateContext.ctx(:to => to, :options => options)
|
|
81
|
+
contents = process_erb(contents, ctx)
|
|
82
|
+
end
|
|
83
|
+
write_file to, contents
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
installer :stylesheet do |to|
|
|
89
|
+
"#{sass_dir}/#{pattern_name_as_dir}#{to}"
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
def install_stylesheet(from, to, options)
|
|
93
|
+
from = templatize(from)
|
|
94
|
+
to = targetize(install_location_for_stylesheet(to, options))
|
|
95
|
+
contents = File.new(from).read
|
|
96
|
+
if options.delete(:erb)
|
|
97
|
+
ctx = TemplateContext.ctx(:to => to, :options => options)
|
|
98
|
+
contents = process_erb(contents, ctx)
|
|
99
|
+
end
|
|
100
|
+
if preferred_syntax.to_s != from[-4..-1]
|
|
101
|
+
# logger.record :convert, basename(from)
|
|
102
|
+
tree = Sass::Engine.new(contents, Compass.sass_engine_options.merge(:syntax => from[-4..-1].intern)).to_tree
|
|
103
|
+
contents = tree.send("to_#{preferred_syntax}")
|
|
104
|
+
to[-4..-1] = preferred_syntax.to_s
|
|
105
|
+
end
|
|
106
|
+
write_file to, contents
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
installer :css do |to|
|
|
110
|
+
"#{css_dir}/#{to}"
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
installer :image, :binary => true do |to|
|
|
114
|
+
"#{images_dir}/#{to}"
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
installer :javascript do |to|
|
|
118
|
+
"#{javascripts_dir}/#{to}"
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
installer :font do |to|
|
|
122
|
+
"#{fonts_dir}/#{to}"
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
installer :file do |to|
|
|
126
|
+
"#{pattern_name_as_dir}#{to}"
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
installer :html do |to|
|
|
130
|
+
"#{pattern_name_as_dir}#{to}"
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
def install_directory(from, to, options)
|
|
134
|
+
d = if within = options[:within]
|
|
135
|
+
if respond_to?(within)
|
|
136
|
+
targetize("#{send(within)}/#{to}")
|
|
137
|
+
else
|
|
138
|
+
raise Compass::Error, "Unrecognized location: #{within}"
|
|
139
|
+
end
|
|
140
|
+
else
|
|
141
|
+
targetize(to)
|
|
142
|
+
end
|
|
143
|
+
directory d
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
alias install_html_without_haml install_html
|
|
147
|
+
def install_html(from, to, options)
|
|
148
|
+
if to =~ /\.haml$/
|
|
149
|
+
require 'haml'
|
|
150
|
+
to = to[0..-(".haml".length+1)]
|
|
151
|
+
if respond_to?(:install_location_for_html)
|
|
152
|
+
to = install_location_for_html(to, options)
|
|
153
|
+
end
|
|
154
|
+
contents = File.read(templatize(from))
|
|
155
|
+
if options.delete(:erb)
|
|
156
|
+
ctx = TemplateContext.ctx(:to => to, :options => options)
|
|
157
|
+
contents = process_erb(contents, ctx)
|
|
158
|
+
end
|
|
159
|
+
Compass.configure_sass_plugin!
|
|
160
|
+
html = Haml::Engine.new(contents, :filename => templatize(from)).render
|
|
161
|
+
write_file(targetize(to), html, options)
|
|
162
|
+
else
|
|
163
|
+
install_html_without_haml(from, to, options)
|
|
164
|
+
end
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# returns an absolute path given a path relative to the current installation target.
|
|
168
|
+
# Paths can use unix style "/" and will be corrected for the current platform.
|
|
169
|
+
def targetize(path)
|
|
170
|
+
strip_trailing_separator File.join(target_path, separate(path))
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# returns an absolute path given a path relative to the current template.
|
|
174
|
+
# Paths can use unix style "/" and will be corrected for the current platform.
|
|
175
|
+
def templatize(path)
|
|
176
|
+
strip_trailing_separator File.join(template_path, separate(path))
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Emits an HTML fragment that can be used to link to the compiled css files
|
|
180
|
+
def stylesheet_links
|
|
181
|
+
""
|
|
182
|
+
end
|
|
183
|
+
end
|
|
184
|
+
end
|
|
185
|
+
end
|
|
186
|
+
require 'compass/installers/bare_installer'
|
|
187
|
+
require 'compass/installers/manifest_installer'
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
module Compass
|
|
2
|
+
module Installers
|
|
3
|
+
|
|
4
|
+
class Manifest
|
|
5
|
+
include Enumerable
|
|
6
|
+
|
|
7
|
+
# A Manifest entry
|
|
8
|
+
class Entry < Struct.new(:type, :from, :options)
|
|
9
|
+
def to
|
|
10
|
+
options[:to] || from
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
attr_reader :options
|
|
15
|
+
def initialize(manifest_file = nil, options = {})
|
|
16
|
+
@entries = []
|
|
17
|
+
@options = options
|
|
18
|
+
@generate_config = true
|
|
19
|
+
@compile_after_generation = true
|
|
20
|
+
parse(manifest_file) if manifest_file
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.known_extensions
|
|
24
|
+
@known_extensions ||= {}
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def self.plural_types
|
|
28
|
+
@plural_types ||= {}
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def self.type(t, options = {})
|
|
32
|
+
Array(options[:extensions]).each do |ext|
|
|
33
|
+
self.known_extensions[ext] = t
|
|
34
|
+
end
|
|
35
|
+
self.plural_types[options[:plural]] = t if options[:plural]
|
|
36
|
+
eval <<-END
|
|
37
|
+
def #{t}(from, options = {})
|
|
38
|
+
@entries << Entry.new(:#{t}, from, options)
|
|
39
|
+
end
|
|
40
|
+
def has_#{t}?
|
|
41
|
+
@entries.detect {|e| e.type == :#{t}}
|
|
42
|
+
end
|
|
43
|
+
def each_#{t}
|
|
44
|
+
@entries.select {|e| e.type == :#{t}}.each {|e| yield e}
|
|
45
|
+
end
|
|
46
|
+
END
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
type :stylesheet, :plural => :stylesheets, :extensions => %w(scss sass)
|
|
50
|
+
type :image, :plural => :images, :extensions => %w(png gif jpg jpeg tiff gif)
|
|
51
|
+
type :javascript, :plural => :javascripts, :extensions => %w(js)
|
|
52
|
+
type :font, :plural => :fonts, :extensions => %w(eot otf woff ttf)
|
|
53
|
+
type :html, :plural => :html, :extensions => %w(html haml)
|
|
54
|
+
type :file, :plural => :files
|
|
55
|
+
type :directory, :plural => :directories
|
|
56
|
+
|
|
57
|
+
def discover(type)
|
|
58
|
+
type = self.class.plural_types[type] || type
|
|
59
|
+
dir = File.dirname(@manifest_file)
|
|
60
|
+
Dir.glob("#{dir}/**/*").each do |file|
|
|
61
|
+
next if /manifest\.rb/ =~ file
|
|
62
|
+
short_name = file[(dir.length+1)..-1]
|
|
63
|
+
options = {}
|
|
64
|
+
ext = if File.extname(short_name) == ".erb"
|
|
65
|
+
options[:erb] = true
|
|
66
|
+
File.extname(short_name[0..-5])
|
|
67
|
+
else
|
|
68
|
+
File.extname(short_name)
|
|
69
|
+
end[1..-1]
|
|
70
|
+
file_type = self.class.known_extensions[ext]
|
|
71
|
+
file_type = :file if file_type.nil?
|
|
72
|
+
file_type = :directory if File.directory?(file)
|
|
73
|
+
if type == :all || type == file_type
|
|
74
|
+
send(file_type, short_name, options)
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def help(value = nil)
|
|
80
|
+
if value
|
|
81
|
+
@help = value
|
|
82
|
+
else
|
|
83
|
+
@help
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
attr_reader :welcome_message_options
|
|
88
|
+
|
|
89
|
+
def welcome_message(value = nil, options = {})
|
|
90
|
+
if value
|
|
91
|
+
@welcome_message = value
|
|
92
|
+
@welcome_message_options = options
|
|
93
|
+
else
|
|
94
|
+
@welcome_message
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def welcome_message_options
|
|
99
|
+
@welcome_message_options || {}
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
def description(value = nil)
|
|
103
|
+
if value
|
|
104
|
+
@description = value
|
|
105
|
+
else
|
|
106
|
+
@description
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Enumerates over the manifest files
|
|
111
|
+
def each
|
|
112
|
+
@entries.each {|e| yield e}
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
def generate_config?
|
|
116
|
+
@generate_config
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def compile?
|
|
120
|
+
@compile_after_generation
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
protected
|
|
124
|
+
|
|
125
|
+
def no_configuration_file!
|
|
126
|
+
@generate_config = false
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
def skip_compilation!
|
|
130
|
+
@compile_after_generation = false
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
def with_manifest(manifest_file)
|
|
134
|
+
@manifest_file = manifest_file
|
|
135
|
+
yield
|
|
136
|
+
ensure
|
|
137
|
+
@manifest_file = nil
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# parses a manifest file which is a ruby script
|
|
141
|
+
# evaluated in a Manifest instance context
|
|
142
|
+
def parse(manifest_file)
|
|
143
|
+
with_manifest(manifest_file) do
|
|
144
|
+
if File.exist?(manifest_file)
|
|
145
|
+
open(manifest_file) do |f|
|
|
146
|
+
eval(f.read, instance_binding, manifest_file)
|
|
147
|
+
end
|
|
148
|
+
else
|
|
149
|
+
eval("discover :all", instance_binding, manifest_file)
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
def instance_binding
|
|
156
|
+
binding
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
end
|
|
161
|
+
end
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
module Compass
|
|
2
|
+
module Installers
|
|
3
|
+
|
|
4
|
+
class ManifestInstaller < Base
|
|
5
|
+
|
|
6
|
+
attr_accessor :manifest
|
|
7
|
+
|
|
8
|
+
def initialize(template_path, target_path, options = {})
|
|
9
|
+
super
|
|
10
|
+
@manifest = Manifest.new(manifest_file, options) if template_path
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def manifest_file
|
|
14
|
+
@manifest_file ||= File.join(template_path, "manifest.rb")
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# Initializes the project to work with compass
|
|
18
|
+
def init
|
|
19
|
+
dirs = manifest.map do |entry|
|
|
20
|
+
unless entry.type == :directory
|
|
21
|
+
loc = send("install_location_for_#{entry.type}", entry.to, entry.options)
|
|
22
|
+
File.dirname(loc)
|
|
23
|
+
end
|
|
24
|
+
end.compact
|
|
25
|
+
|
|
26
|
+
if manifest.has_stylesheet?
|
|
27
|
+
dirs << sass_dir
|
|
28
|
+
dirs << css_dir
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
dirs.uniq.sort.each do |dir|
|
|
32
|
+
directory targetize(dir)
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# The default install method. Calls install_<type> methods in the order specified by the manifest.
|
|
37
|
+
def install
|
|
38
|
+
manifest.each do |entry|
|
|
39
|
+
send("install_#{entry.type}", entry.from, entry.to, entry.options)
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def stylesheet_links
|
|
44
|
+
html = "<head>\n"
|
|
45
|
+
manifest.each_stylesheet do |stylesheet|
|
|
46
|
+
# Skip partials.
|
|
47
|
+
next if File.basename(stylesheet.from)[0..0] == "_"
|
|
48
|
+
media = if stylesheet.options[:media]
|
|
49
|
+
%Q{ media="#{stylesheet.options[:media]}"}
|
|
50
|
+
end
|
|
51
|
+
ss_line = %Q{ <link href="#{http_stylesheets_path}/#{stylesheet.to.sub(/\.s[ac]ss$/,'.css')}"#{media} rel="stylesheet" type="text/css" />}
|
|
52
|
+
if stylesheet.options[:condition]
|
|
53
|
+
ss_line = " <!--[if #{stylesheet.options[:condition]}]>\n #{ss_line}\n <![endif]-->"
|
|
54
|
+
end
|
|
55
|
+
html << ss_line + "\n"
|
|
56
|
+
end
|
|
57
|
+
html << "</head>"
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
module Compass
|
|
2
|
+
module Installers
|
|
3
|
+
class TemplateContext
|
|
4
|
+
|
|
5
|
+
def self.ctx(*arguments)
|
|
6
|
+
new(*arguments).send(:get_binding)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def initialize(template, locals = {})
|
|
10
|
+
@template = template
|
|
11
|
+
@locals = locals
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def http_stylesheets_path
|
|
15
|
+
config.http_stylesheets_path ||
|
|
16
|
+
config.default_for(:http_stylesheets_path) ||
|
|
17
|
+
config.http_root_relative(config.css_dir)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
Compass::Configuration::ATTRIBUTES.each do |attribute|
|
|
21
|
+
unless instance_methods.include?(attribute.to_s)
|
|
22
|
+
define_method attribute do
|
|
23
|
+
config.send(attribute) || config.default_for(attribute)
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def config
|
|
29
|
+
Compass.configuration
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
alias configuration config
|
|
33
|
+
|
|
34
|
+
protected
|
|
35
|
+
|
|
36
|
+
def get_binding
|
|
37
|
+
@locals.each do |k, v|
|
|
38
|
+
eval("#{k} = v")
|
|
39
|
+
end
|
|
40
|
+
binding
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|