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,120 @@
|
|
|
1
|
+
require 'compass/commands/project_base'
|
|
2
|
+
require 'fileutils'
|
|
3
|
+
|
|
4
|
+
module Compass
|
|
5
|
+
module Commands
|
|
6
|
+
module ExtensionOptionsParser
|
|
7
|
+
def set_options(opts)
|
|
8
|
+
opts.banner = %Q{
|
|
9
|
+
Usage: compass unpack EXTENSION
|
|
10
|
+
|
|
11
|
+
Description:
|
|
12
|
+
Copy an extension into your extensions folder for easy access to the source code.
|
|
13
|
+
This makes it easier to peruse the source in unfamiliar projects. It is not recommended
|
|
14
|
+
that you change other extensions' source -- this makes it hard to take updates from
|
|
15
|
+
the original author. The following extensions are available:
|
|
16
|
+
|
|
17
|
+
FRAMEWORKS
|
|
18
|
+
|
|
19
|
+
Options:
|
|
20
|
+
}.strip.split("\n").map{|l| l.gsub(/^ {0,10}/,'')}.join("\n")
|
|
21
|
+
opts.banner.gsub!(/FRAMEWORKS/,Compass::Frameworks.pretty_print(true))
|
|
22
|
+
super
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
class UnpackExtension < ProjectBase
|
|
27
|
+
|
|
28
|
+
register :unpack
|
|
29
|
+
|
|
30
|
+
def initialize(working_path, options)
|
|
31
|
+
super
|
|
32
|
+
assert_project_directory_exists!
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def perform
|
|
36
|
+
framework = Compass::Frameworks[options[:framework]]
|
|
37
|
+
unless framework
|
|
38
|
+
raise Compass::Error, "No extension named \"#{options[:framework]}\" was found."
|
|
39
|
+
end
|
|
40
|
+
files = Dir["#{framework.path}/**/*"]
|
|
41
|
+
extension_dir = File.join(Compass.configuration.extensions_path, framework.name)
|
|
42
|
+
FileUtils.rm_rf extension_dir
|
|
43
|
+
FileUtils.mkdir_p extension_dir
|
|
44
|
+
write_file File.join(extension_dir, "DO_NOT_MODIFY"), readme(framework)
|
|
45
|
+
files.each do |f|
|
|
46
|
+
next if File.directory?(f)
|
|
47
|
+
ending = f[(framework.path.size+1)..-1]
|
|
48
|
+
destination = File.join(extension_dir, ending)
|
|
49
|
+
FileUtils.mkdir_p(File.dirname(destination))
|
|
50
|
+
copy f, destination
|
|
51
|
+
end
|
|
52
|
+
puts "\nYou have unpacked \"#{framework.name}\""
|
|
53
|
+
puts
|
|
54
|
+
puts readme(framework)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def readme(framework)
|
|
58
|
+
%Q{| This is a copy of the "#{framework.name}" extension.
|
|
59
|
+
|
|
|
60
|
+
| It now overrides the original which was found here:
|
|
61
|
+
|
|
|
62
|
+
| #{framework.path}
|
|
63
|
+
|
|
|
64
|
+
| Unpacking an extension is useful when you need to easily peruse the
|
|
65
|
+
| extension's source. You might find yourself tempted to change the
|
|
66
|
+
| stylesheets here. If you do this, you'll find it harder to take
|
|
67
|
+
| updates from the original author. Sometimes this seems like a good
|
|
68
|
+
| idea at the time, but in a few months, you'll probably regret it.
|
|
69
|
+
|
|
|
70
|
+
| In the future, if you take an update of this framework, you'll need to run
|
|
71
|
+
|
|
|
72
|
+
| compass unpack #{framework.name}
|
|
73
|
+
|
|
|
74
|
+
| again or remove this unpacked extension.
|
|
75
|
+
|}.gsub(/^\s*\| ?/,"")
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def skip_extension_discovery?
|
|
79
|
+
true
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
class << self
|
|
83
|
+
|
|
84
|
+
def option_parser(arguments)
|
|
85
|
+
parser = Compass::Exec::CommandOptionParser.new(arguments)
|
|
86
|
+
parser.extend(Compass::Exec::GlobalOptionsParser)
|
|
87
|
+
parser.extend(Compass::Exec::ProjectOptionsParser)
|
|
88
|
+
parser.extend(ExtensionOptionsParser)
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
def usage
|
|
92
|
+
option_parser([]).to_s
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def description(command)
|
|
96
|
+
"Copy an extension into your extensions folder."
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def parse!(arguments)
|
|
100
|
+
parser = option_parser(arguments)
|
|
101
|
+
parser.parse!
|
|
102
|
+
parse_arguments!(parser, arguments)
|
|
103
|
+
parser.options
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
def parse_arguments!(parser, arguments)
|
|
107
|
+
if arguments.size == 1
|
|
108
|
+
parser.options[:framework] = arguments.shift
|
|
109
|
+
elsif arguments.size == 0
|
|
110
|
+
raise Compass::Error, "Please specify an extension to unpack."
|
|
111
|
+
else
|
|
112
|
+
raise Compass::Error, "Too many arguments were specified."
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
end
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
require 'compass/commands/project_base'
|
|
2
|
+
require 'compass/compiler'
|
|
3
|
+
|
|
4
|
+
module Compass
|
|
5
|
+
module Commands
|
|
6
|
+
module CompileProjectOptionsParser
|
|
7
|
+
def set_options(opts)
|
|
8
|
+
opts.banner = %Q{
|
|
9
|
+
Usage: compass compile [path/to/project] [path/to/project/src/file.sass ...] [options]
|
|
10
|
+
|
|
11
|
+
Description:
|
|
12
|
+
compile project at the path specified or the current directory if not specified.
|
|
13
|
+
|
|
14
|
+
Options:
|
|
15
|
+
}.split("\n").map{|l| l.gsub(/^ */,'')}.join("\n")
|
|
16
|
+
|
|
17
|
+
opts.on("--[no-]sourcemap", "Generate a sourcemap during compilation.") do |sm|
|
|
18
|
+
self.options[:sourcemap] = sm
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
opts.on("--time", "Display compilation times.") do
|
|
22
|
+
self.options[:time] = true
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
opts.on("--debug-info", "Turns on sass's debuging information") do
|
|
26
|
+
self.options[:debug_info]= true
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
opts.on("--no-debug-info", "Turns off sass's debuging information") do
|
|
30
|
+
self.options[:debug_info]= false
|
|
31
|
+
end
|
|
32
|
+
super
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
class UpdateProject < ProjectBase
|
|
37
|
+
|
|
38
|
+
register :compile
|
|
39
|
+
|
|
40
|
+
def initialize(working_path, options)
|
|
41
|
+
super
|
|
42
|
+
assert_project_directory_exists!
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def perform
|
|
46
|
+
compiler = new_compiler_instance
|
|
47
|
+
check_for_sass_files!(compiler)
|
|
48
|
+
prepare_project!(compiler)
|
|
49
|
+
compiler.compile!
|
|
50
|
+
if compiler.error_count > 0
|
|
51
|
+
compiler.logger.red do
|
|
52
|
+
compiler.logger.log "Compilation failed in #{compiler.error_count} files."
|
|
53
|
+
end
|
|
54
|
+
failed!
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def prepare_project!(compiler)
|
|
59
|
+
if options[:project_name]
|
|
60
|
+
Compass.configuration.project_path = File.expand_path(options[:project_name])
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
if config_file = new_config?(compiler)
|
|
64
|
+
compiler.logger.record :modified, relativize(config_file)
|
|
65
|
+
compiler.logger.record :clean, relativize(Compass.configuration.css_path)
|
|
66
|
+
compiler.clean!
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Determines if the configuration file is newer than any css file
|
|
71
|
+
def new_config?(compiler)
|
|
72
|
+
config_file = Compass.detect_configuration_file
|
|
73
|
+
return false unless config_file
|
|
74
|
+
config_mtime = File.mtime(config_file)
|
|
75
|
+
compiler.file_list.each do |(_, css_filename, _)|
|
|
76
|
+
return config_file if File.exist?(css_filename) && config_mtime > File.mtime(css_filename)
|
|
77
|
+
end
|
|
78
|
+
nil
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def check_for_sass_files!(compiler)
|
|
82
|
+
file_list = compiler.file_list
|
|
83
|
+
if file_list.empty?
|
|
84
|
+
message = "Compass can't find any Sass files to compile.\nIs your compass configuration correct?.\nIf you're trying to start a new project, you have left off the directory argument.\n"
|
|
85
|
+
message << "Run \"compass -h\" to get help."
|
|
86
|
+
raise Compass::Error, message
|
|
87
|
+
elsif missing = file_list.find {|(sass_file, _, _)| !File.exist?(sass_file)}
|
|
88
|
+
raise Compass::Error, "File not found: #{missing[0]}"
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
def new_compiler_instance
|
|
93
|
+
Compass::SassCompiler.new(compiler_options)
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
def compiler_options
|
|
97
|
+
transfer_options(options, {}, :time, :debug_info, :only_sass_files, :force, :quiet)
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
def transfer_options(from, to, *keys)
|
|
101
|
+
keys.each do |k|
|
|
102
|
+
to[k] = from[k] unless from[k].nil?
|
|
103
|
+
end
|
|
104
|
+
to
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
class << self
|
|
108
|
+
def option_parser(arguments)
|
|
109
|
+
parser = Compass::Exec::CommandOptionParser.new(arguments)
|
|
110
|
+
parser.extend(Compass::Exec::GlobalOptionsParser)
|
|
111
|
+
parser.extend(Compass::Exec::ProjectOptionsParser)
|
|
112
|
+
parser.extend(CompileProjectOptionsParser)
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
def usage
|
|
116
|
+
option_parser([]).to_s
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def primary; true; end
|
|
120
|
+
|
|
121
|
+
def description(command)
|
|
122
|
+
"Compile Sass stylesheets to CSS"
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
def parse!(arguments)
|
|
126
|
+
parser = option_parser(arguments)
|
|
127
|
+
parser.parse!
|
|
128
|
+
parse_arguments!(parser, arguments)
|
|
129
|
+
parser.options
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
def parse_arguments!(parser, arguments)
|
|
133
|
+
if arguments.size > 0
|
|
134
|
+
parser.options[:project_name] = arguments.shift if File.directory?(arguments.first)
|
|
135
|
+
unless arguments.empty?
|
|
136
|
+
parser.options[:only_sass_files] = absolutize(*arguments)
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
def absolutize(*paths)
|
|
142
|
+
paths.map {|path| File.expand_path(path) }
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
end
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
require 'compass/commands/project_base'
|
|
2
|
+
require 'compass/commands/update_project'
|
|
3
|
+
|
|
4
|
+
module Compass
|
|
5
|
+
module Commands
|
|
6
|
+
module ValidationOptionsParser
|
|
7
|
+
def set_options(opts)
|
|
8
|
+
opts.banner = %Q{
|
|
9
|
+
Usage: compass validate [path/to/project] [options]
|
|
10
|
+
|
|
11
|
+
Description:
|
|
12
|
+
Compile project at the path specified or the current
|
|
13
|
+
directory if not specified and then validate the
|
|
14
|
+
generated CSS.
|
|
15
|
+
|
|
16
|
+
Options:
|
|
17
|
+
}.strip.split("\n").map{|l| l.gsub(/^ {0,10}/,'')}.join("\n")
|
|
18
|
+
|
|
19
|
+
super
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
class ValidateProject < ProjectBase
|
|
23
|
+
|
|
24
|
+
register :validate
|
|
25
|
+
|
|
26
|
+
def initialize(working_path, options)
|
|
27
|
+
super
|
|
28
|
+
assert_project_directory_exists!
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def perform
|
|
32
|
+
require 'compass/validator'
|
|
33
|
+
UpdateProject.new(working_path, options).perform
|
|
34
|
+
Dir.chdir Compass.configuration.project_path do
|
|
35
|
+
Validator.new(project_css_subdirectory).validate()
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
class << self
|
|
40
|
+
|
|
41
|
+
def option_parser(arguments)
|
|
42
|
+
parser = Compass::Exec::CommandOptionParser.new(arguments)
|
|
43
|
+
parser.extend(Compass::Exec::GlobalOptionsParser)
|
|
44
|
+
parser.extend(Compass::Exec::ProjectOptionsParser)
|
|
45
|
+
parser.extend(ValidationOptionsParser)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def usage
|
|
49
|
+
option_parser([]).to_s
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def description(command)
|
|
53
|
+
"Validate your generated css."
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def parse!(arguments)
|
|
57
|
+
parser = option_parser(arguments)
|
|
58
|
+
parser.parse!
|
|
59
|
+
parse_arguments!(parser, arguments)
|
|
60
|
+
parser.options
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def parse_arguments!(parser, arguments)
|
|
64
|
+
if arguments.size == 1
|
|
65
|
+
parser.options[:project_name] = arguments.shift
|
|
66
|
+
elsif arguments.size == 0
|
|
67
|
+
# default to the current directory.
|
|
68
|
+
else
|
|
69
|
+
raise Compass::Error, "Too many arguments were specified."
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
require 'fileutils'
|
|
3
|
+
require 'pathname'
|
|
4
|
+
require 'compass/commands/update_project'
|
|
5
|
+
require "compass/sass_compiler"
|
|
6
|
+
|
|
7
|
+
module Compass
|
|
8
|
+
module Commands
|
|
9
|
+
module WatchProjectOptionsParser
|
|
10
|
+
def set_options(opts)
|
|
11
|
+
super
|
|
12
|
+
|
|
13
|
+
opts.banner = %Q{
|
|
14
|
+
Usage: compass watch [path/to/project] [path/to/project/src/file.sass ...] [options]
|
|
15
|
+
|
|
16
|
+
Description:
|
|
17
|
+
watch the project for changes and recompile when they occur.
|
|
18
|
+
|
|
19
|
+
Options:
|
|
20
|
+
}.split("\n").map{|l| l.gsub(/^ */,'')}.join("\n")
|
|
21
|
+
|
|
22
|
+
opts.on("--poll", :NONE, "Check periodically if there's been changes.") do
|
|
23
|
+
self.options[:poll] = 1 # check every 1 second.
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
class WatchProject < UpdateProject
|
|
30
|
+
|
|
31
|
+
register :watch
|
|
32
|
+
|
|
33
|
+
attr_accessor :last_update_time, :last_sass_files
|
|
34
|
+
|
|
35
|
+
def perform
|
|
36
|
+
compiler = new_compiler_instance
|
|
37
|
+
compiler.logger.time = true if options[:time]
|
|
38
|
+
prepare_project!(compiler)
|
|
39
|
+
compiler.logger.log ">>> #{compiler.logger.color(:green)}Compass is watching for changes.#{compiler.logger.color(:clear)} #{compiler.logger.color(:red)}Press Ctrl-C to Stop.#{compiler.logger.color(:clear)}"
|
|
40
|
+
begin
|
|
41
|
+
compiler.watch!(:additional_watch_paths => additional_watch_paths, &method(:notify_watches))
|
|
42
|
+
happy_styling!(compiler.logger)
|
|
43
|
+
rescue Interrupt
|
|
44
|
+
happy_styling!(compiler.logger)
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def happy_styling!(logger)
|
|
49
|
+
logger.log "\n#{logger.color(:yellow)}★★★ #{logger.color(:blue)}Happy Styling!#{logger.color(:yellow)} ★★★#{logger.color(:clear)}"
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def compiler_options
|
|
53
|
+
super.merge(:poll => options[:poll], :full_exception => true)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def additional_watch_paths
|
|
57
|
+
Compass.configuration.watches.map do |watch|
|
|
58
|
+
pathname = Pathname.new(File.join(Compass.configuration.project_path, watch.glob))
|
|
59
|
+
real_path = nil
|
|
60
|
+
pathname.ascend do |p|
|
|
61
|
+
if p.exist?
|
|
62
|
+
real_path = p
|
|
63
|
+
break
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
real_path
|
|
67
|
+
end.compact.uniq
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def notify_watches(modified, added, removed)
|
|
71
|
+
project_path = Compass.configuration.project_path
|
|
72
|
+
files = {:modified => modified,
|
|
73
|
+
:added => added,
|
|
74
|
+
:removed => removed}
|
|
75
|
+
|
|
76
|
+
run_once, run_each = Compass.configuration.watches.partition {|w| w.run_once_per_changeset?}
|
|
77
|
+
|
|
78
|
+
run_once.each do |watcher|
|
|
79
|
+
if file = files.values.flatten.detect{|f| watcher.match?(f) }
|
|
80
|
+
action = files.keys.detect{|k| files[k].include?(file) }
|
|
81
|
+
watcher.run_callback(project_path, relative_to(file, project_path), action)
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
run_each.each do |watcher|
|
|
86
|
+
files.each do |action, list|
|
|
87
|
+
list.each do |file|
|
|
88
|
+
if watcher.match?(file)
|
|
89
|
+
watcher.run_callback(project_path, relative_to(file, project_path), action)
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
def relative_to(f, dir)
|
|
97
|
+
Pathname.new(f).relative_path_from(Pathname.new(dir))
|
|
98
|
+
rescue ArgumentError # does not share a common path.
|
|
99
|
+
f
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
class << self
|
|
103
|
+
def description(command)
|
|
104
|
+
"Compile Sass stylesheets to CSS when they change"
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def option_parser(arguments)
|
|
108
|
+
parser = Compass::Exec::CommandOptionParser.new(arguments)
|
|
109
|
+
parser.extend(Compass::Exec::GlobalOptionsParser)
|
|
110
|
+
parser.extend(Compass::Exec::ProjectOptionsParser)
|
|
111
|
+
parser.extend(CompileProjectOptionsParser)
|
|
112
|
+
parser.extend(WatchProjectOptionsParser)
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
end
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
require 'compass/commands/project_base'
|
|
2
|
+
|
|
3
|
+
module Compass
|
|
4
|
+
module Commands
|
|
5
|
+
module ConfigurationOptionsParser
|
|
6
|
+
def set_options(opts)
|
|
7
|
+
opts.banner = %Q{
|
|
8
|
+
Usage: compass config [path/to/config_file.rb] [options]
|
|
9
|
+
|
|
10
|
+
Description:
|
|
11
|
+
Generate a configuration file for the options specified.
|
|
12
|
+
Compass will recognize configuration files in the
|
|
13
|
+
following locations relative to the project root:
|
|
14
|
+
* #{Compass::Configuration::Helpers::KNOWN_CONFIG_LOCATIONS.join("
|
|
15
|
+
* ")}
|
|
16
|
+
Any other location, and you'll need to specify it when working with the command line tool using the -c option.
|
|
17
|
+
|
|
18
|
+
Options:
|
|
19
|
+
}.strip.split("\n").map{|l| l.gsub(/^ {0,10}/,'')}.join("\n")
|
|
20
|
+
opts.on("--debug [PROPERTY]", "Debug your configuration by printing out details.") do |prop|
|
|
21
|
+
self.options[:debug] = prop.nil? ? true : prop.to_sym
|
|
22
|
+
end
|
|
23
|
+
opts.on("-p PROPERTY", "--property PROPERTY", "Print out the value of a particular configuration property") do |prop|
|
|
24
|
+
self.options[:display] = prop.to_sym
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
super
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
class WriteConfiguration < ProjectBase
|
|
31
|
+
|
|
32
|
+
register :config
|
|
33
|
+
|
|
34
|
+
include InstallerCommand
|
|
35
|
+
|
|
36
|
+
def initialize(working_path, options)
|
|
37
|
+
super
|
|
38
|
+
assert_project_directory_exists!
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def add_project_configuration
|
|
42
|
+
Compass.add_project_configuration
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def perform
|
|
46
|
+
if options[:display]
|
|
47
|
+
if Compass.configuration.respond_to?(options[:display])
|
|
48
|
+
puts Compass.configuration.send(options[:display])
|
|
49
|
+
else
|
|
50
|
+
raise Compass::Error, "ERROR: configuration property '#{options[:display]}' does not exist"
|
|
51
|
+
end
|
|
52
|
+
elsif options[:debug]
|
|
53
|
+
puts "Configuration sources:"
|
|
54
|
+
c = Compass.configuration
|
|
55
|
+
while c
|
|
56
|
+
print c.name
|
|
57
|
+
c = c.inherited_data
|
|
58
|
+
print ", " if c
|
|
59
|
+
end
|
|
60
|
+
print "\n"
|
|
61
|
+
Compass.configuration.debug.each do |prop, values|
|
|
62
|
+
if options[:debug].is_a?(Symbol)
|
|
63
|
+
next unless prop == options[:debug]
|
|
64
|
+
end
|
|
65
|
+
puts "***** #{prop} = #{values.first[:resolved].inspect} *****"
|
|
66
|
+
[:default, :value, :raw, :resolved].each do |kind|
|
|
67
|
+
puts "#{kind}: " + values.inject([]){|m, v| m << v[kind]}.map{|v| v.nil? ? '-' : v.inspect}.join(", ")
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
else
|
|
71
|
+
config_file = options[:configuration_file]
|
|
72
|
+
config_file ||= Compass.detect_configuration_file
|
|
73
|
+
config_file ||= Compass::Configuration::Helpers::KNOWN_CONFIG_LOCATIONS.first
|
|
74
|
+
directory File.dirname(config_file)
|
|
75
|
+
installer.write_configuration_files(config_file)
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def installer_args
|
|
80
|
+
[nil, project_directory, options]
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def explicit_config_file_must_be_readable?
|
|
84
|
+
false
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
class << self
|
|
88
|
+
|
|
89
|
+
def option_parser(arguments)
|
|
90
|
+
parser = Compass::Exec::CommandOptionParser.new(arguments)
|
|
91
|
+
parser.extend(Compass::Exec::GlobalOptionsParser)
|
|
92
|
+
parser.extend(Compass::Exec::ProjectOptionsParser)
|
|
93
|
+
parser.extend(ConfigurationOptionsParser)
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
def usage
|
|
97
|
+
option_parser([]).to_s
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
def description(command)
|
|
101
|
+
"Generate a configuration file for the provided command line options."
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
def parse!(arguments)
|
|
105
|
+
parser = option_parser(arguments)
|
|
106
|
+
parser.parse!
|
|
107
|
+
parse_arguments!(parser, arguments)
|
|
108
|
+
parser.options
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
def parse_arguments!(parser, arguments)
|
|
112
|
+
if arguments.size == 1
|
|
113
|
+
parser.options[:configuration_file] = arguments.shift
|
|
114
|
+
elsif arguments.size == 0
|
|
115
|
+
# default to the current directory.
|
|
116
|
+
else
|
|
117
|
+
raise Compass::Error, "Too many arguments were specified."
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module Compass::Commands
|
|
2
|
+
end
|
|
3
|
+
|
|
4
|
+
require 'compass/commands/registry'
|
|
5
|
+
|
|
6
|
+
%w(base project_base default help list_frameworks
|
|
7
|
+
update_project watch_project create_project clean_project extension_command
|
|
8
|
+
imports installer_command print_version project_stats stamp_pattern
|
|
9
|
+
sprite validate_project write_configuration interactive unpack_extension
|
|
10
|
+
).each do |lib|
|
|
11
|
+
require "compass/commands/#{lib}"
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
Compass.discover_extensions!
|