compass-edge 0.9.1
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.
- data/CHANGELOG.markdown +528 -0
- data/LICENSE.markdown +29 -0
- data/README.markdown +46 -0
- data/REVISION +1 -0
- data/Rakefile +131 -0
- data/VERSION.yml +4 -0
- data/bin/compass +26 -0
- data/deps.rip +1 -0
- data/examples/README.markdown +4 -0
- data/examples/blueprint_default/config.rb +7 -0
- data/examples/blueprint_default/images/grid.png +0 -0
- data/examples/blueprint_default/index.html.haml +85 -0
- data/examples/blueprint_default/parts/elements.html.haml +282 -0
- data/examples/blueprint_default/parts/forms.html.haml +190 -0
- data/examples/blueprint_default/parts/grid.html.haml +274 -0
- data/examples/blueprint_default/parts/test-small.jpg +0 -0
- data/examples/blueprint_default/parts/test.jpg +0 -0
- data/examples/blueprint_default/parts/valid.png +0 -0
- data/examples/blueprint_default/src/ie.sass +3 -0
- data/examples/blueprint_default/src/images/grid.png +0 -0
- data/examples/blueprint_default/src/print.sass +3 -0
- data/examples/blueprint_default/src/screen.sass +8 -0
- data/examples/blueprint_plugins/config.rb +8 -0
- data/examples/blueprint_plugins/images/buttons/cross.png +0 -0
- data/examples/blueprint_plugins/images/buttons/key.png +0 -0
- data/examples/blueprint_plugins/images/buttons/tick.png +0 -0
- data/examples/blueprint_plugins/images/grid.png +0 -0
- data/examples/blueprint_plugins/images/link_icons/doc.png +0 -0
- data/examples/blueprint_plugins/images/link_icons/email.png +0 -0
- data/examples/blueprint_plugins/images/link_icons/external.png +0 -0
- data/examples/blueprint_plugins/images/link_icons/feed.png +0 -0
- data/examples/blueprint_plugins/images/link_icons/im.png +0 -0
- data/examples/blueprint_plugins/images/link_icons/pdf.png +0 -0
- data/examples/blueprint_plugins/images/link_icons/visited.png +0 -0
- data/examples/blueprint_plugins/images/link_icons/xls.png +0 -0
- data/examples/blueprint_plugins/images/test-small.jpg +0 -0
- data/examples/blueprint_plugins/images/test.jpg +0 -0
- data/examples/blueprint_plugins/images/valid.png +0 -0
- data/examples/blueprint_plugins/index.html.haml +96 -0
- data/examples/blueprint_plugins/plugins/buttons.html.haml +67 -0
- data/examples/blueprint_plugins/plugins/fancy_type.html.haml +100 -0
- data/examples/blueprint_plugins/plugins/link_icons.html.haml +61 -0
- data/examples/blueprint_plugins/plugins/rtl.html.haml +100 -0
- data/examples/blueprint_plugins/src/buttons.sass +49 -0
- data/examples/blueprint_plugins/src/ie.sass +3 -0
- data/examples/blueprint_plugins/src/images/grid.png +0 -0
- data/examples/blueprint_plugins/src/link_icons.sass +13 -0
- data/examples/blueprint_plugins/src/print.sass +3 -0
- data/examples/blueprint_plugins/src/rtl_screen.sass +13 -0
- data/examples/blueprint_plugins/src/screen.sass +11 -0
- data/examples/blueprint_scoped/images/grid.png +0 -0
- data/examples/blueprint_scoped/src/ie.sass +4 -0
- data/examples/blueprint_scoped/src/print.sass +4 -0
- data/examples/blueprint_scoped/src/screen.sass +5 -0
- data/examples/blueprint_scoped_form/images/grid.png +0 -0
- data/examples/blueprint_scoped_form/src/ie.sass +3 -0
- data/examples/blueprint_scoped_form/src/print.sass +3 -0
- data/examples/blueprint_scoped_form/src/screen.sass +10 -0
- data/examples/blueprint_semantic/config.rb +7 -0
- data/examples/blueprint_semantic/images/grid.png +0 -0
- data/examples/blueprint_semantic/index.html.haml +86 -0
- data/examples/blueprint_semantic/parts/fancy_type.html.haml +100 -0
- data/examples/blueprint_semantic/parts/liquid.html.haml +100 -0
- data/examples/blueprint_semantic/parts/test-small.jpg +0 -0
- data/examples/blueprint_semantic/parts/test.jpg +0 -0
- data/examples/blueprint_semantic/parts/valid.png +0 -0
- data/examples/blueprint_semantic/src/ie.sass +3 -0
- data/examples/blueprint_semantic/src/images/grid.png +0 -0
- data/examples/blueprint_semantic/src/liquid.sass +69 -0
- data/examples/blueprint_semantic/src/print.sass +3 -0
- data/examples/blueprint_semantic/src/screen.sass +70 -0
- data/examples/compass/compass.html.haml +39 -0
- data/examples/compass/config.rb +7 -0
- data/examples/compass/images/blue_arrow.gif +0 -0
- data/examples/compass/src/compass.sass +47 -0
- data/examples/compass/src/images/blue_arrow.gif +0 -0
- data/examples/compass/src/sticky_footer.sass +11 -0
- data/examples/compass/src/utilities.sass +108 -0
- data/examples/compass/sticky_footer.html.haml +14 -0
- data/examples/compass/utilities.html.haml +189 -0
- data/examples/downloader.rb +57 -0
- data/examples/logo/logo.html.haml +40 -0
- data/examples/logo/src/ie.sass +6 -0
- data/examples/logo/src/print.sass +6 -0
- data/examples/logo/src/screen.sass +29 -0
- data/examples/ninesixty/bootstrap.rb +4 -0
- data/examples/ninesixty/config.rb +9 -0
- data/examples/ninesixty/extensions/ninesixty/README.mkdn +56 -0
- data/examples/ninesixty/extensions/ninesixty/compass-960-plugin.gemspec +36 -0
- data/examples/ninesixty/extensions/ninesixty/lib/ninesixty.rb +1 -0
- data/examples/ninesixty/extensions/ninesixty/lib/ninesixty/compass_plugin.rb +5 -0
- data/examples/ninesixty/extensions/ninesixty/sass/960/_grid.sass +64 -0
- data/examples/ninesixty/extensions/ninesixty/sass/960/_text.sass +59 -0
- data/examples/ninesixty/extensions/ninesixty/templates/project/grid.sass +34 -0
- data/examples/ninesixty/extensions/ninesixty/templates/project/manifest.rb +2 -0
- data/examples/ninesixty/extensions/ninesixty/templates/project/text.sass +10 -0
- data/examples/ninesixty/src/grid.sass +16 -0
- data/examples/ninesixty/src/text.sass +10 -0
- data/examples/yui/bootstrap.rb +3 -0
- data/examples/yui/divisions.html.haml +179 -0
- data/examples/yui/extensions/yui/stylesheets/_yui.sass +7 -0
- data/examples/yui/extensions/yui/stylesheets/yui/modules/_base.sass +70 -0
- data/examples/yui/extensions/yui/stylesheets/yui/modules/_fonts.sass +45 -0
- data/examples/yui/extensions/yui/stylesheets/yui/modules/_grids.sass +385 -0
- data/examples/yui/extensions/yui/stylesheets/yui/modules/_reset.sass +61 -0
- data/examples/yui/extensions/yui/templates/project/manifest.rb +1 -0
- data/examples/yui/extensions/yui/templates/project/screen.sass +4 -0
- data/examples/yui/index.html.haml +19 -0
- data/examples/yui/src/screen.sass +13 -0
- data/examples/yui/sub_divisions.html.haml +169 -0
- data/examples/yui/templates.html.haml +54 -0
- data/examples/yui/test.jpg +0 -0
- data/examples/yui/typography.html.haml +132 -0
- data/lib/compass.rb +22 -0
- data/lib/compass/actions.rb +116 -0
- data/lib/compass/app_integration.rb +3 -0
- data/lib/compass/app_integration/merb.rb +1 -0
- data/lib/compass/app_integration/merb/runtime.rb +63 -0
- data/lib/compass/app_integration/rails.rb +8 -0
- data/lib/compass/app_integration/rails/action_controller.rb +15 -0
- data/lib/compass/app_integration/rails/configuration_defaults.rb +29 -0
- data/lib/compass/app_integration/rails/installer.rb +127 -0
- data/lib/compass/app_integration/rails/runtime.rb +14 -0
- data/lib/compass/app_integration/rails/sass_plugin.rb +5 -0
- data/lib/compass/app_integration/rails/templates/compass-install-rails.rb +80 -0
- data/lib/compass/app_integration/rails/urls.rb +14 -0
- data/lib/compass/app_integration/stand_alone.rb +3 -0
- data/lib/compass/app_integration/stand_alone/configuration_defaults.rb +24 -0
- data/lib/compass/app_integration/stand_alone/installer.rb +71 -0
- data/lib/compass/commands.rb +11 -0
- data/lib/compass/commands/base.rb +36 -0
- data/lib/compass/commands/create_project.rb +113 -0
- data/lib/compass/commands/generate_grid_background.rb +91 -0
- data/lib/compass/commands/help.rb +62 -0
- data/lib/compass/commands/installer_command.rb +34 -0
- data/lib/compass/commands/list_frameworks.rb +16 -0
- data/lib/compass/commands/print_version.rb +91 -0
- data/lib/compass/commands/project_base.rb +92 -0
- data/lib/compass/commands/registry.rb +22 -0
- data/lib/compass/commands/stamp_pattern.rb +86 -0
- data/lib/compass/commands/update_project.rb +38 -0
- data/lib/compass/commands/validate_project.rb +21 -0
- data/lib/compass/commands/watch_project.rb +69 -0
- data/lib/compass/commands/write_configuration.rb +32 -0
- data/lib/compass/compiler.rb +54 -0
- data/lib/compass/configuration.rb +38 -0
- data/lib/compass/configuration/adapters.rb +59 -0
- data/lib/compass/configuration/comments.rb +22 -0
- data/lib/compass/configuration/data.rb +103 -0
- data/lib/compass/configuration/defaults.rb +107 -0
- data/lib/compass/configuration/helpers.rb +83 -0
- data/lib/compass/configuration/inheritance.rb +170 -0
- data/lib/compass/configuration/serialization.rb +86 -0
- data/lib/compass/core_ext.rb +14 -0
- data/lib/compass/dependencies.rb +6 -0
- data/lib/compass/errors.rb +7 -0
- data/lib/compass/exec.rb +15 -0
- data/lib/compass/exec/command_option_parser.rb +23 -0
- data/lib/compass/exec/global_options_parser.rb +37 -0
- data/lib/compass/exec/helpers.rb +28 -0
- data/lib/compass/exec/project_options_parser.rb +42 -0
- data/lib/compass/exec/sub_command_ui.rb +45 -0
- data/lib/compass/exec/switch_ui.rb +166 -0
- data/lib/compass/frameworks.rb +53 -0
- data/lib/compass/frameworks/blueprint/stylesheets/_blueprint.sass +3 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_ie.sass +99 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_print.sass +90 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_reset.sass +3 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_screen.sass +29 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_buttons.sass +84 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_colors.sass +33 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_debug.sass +9 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_fancy_type.sass +82 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_form.sass +55 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_grid.sass +178 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_interaction.sass +58 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_link_icons.sass +44 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_liquid.sass +141 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_reset.sass +56 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_rtl.sass +122 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_scaffolding.sass +47 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_typography.sass +160 -0
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_utilities.sass +37 -0
- data/lib/compass/frameworks/blueprint/templates/buttons/buttons.sass +49 -0
- data/lib/compass/frameworks/blueprint/templates/buttons/buttons/cross.png +0 -0
- data/lib/compass/frameworks/blueprint/templates/buttons/buttons/key.png +0 -0
- data/lib/compass/frameworks/blueprint/templates/buttons/buttons/tick.png +0 -0
- data/lib/compass/frameworks/blueprint/templates/buttons/manifest.rb +5 -0
- data/lib/compass/frameworks/blueprint/templates/link_icons/link_icons.sass +13 -0
- data/lib/compass/frameworks/blueprint/templates/link_icons/link_icons/doc.png +0 -0
- data/lib/compass/frameworks/blueprint/templates/link_icons/link_icons/email.png +0 -0
- data/lib/compass/frameworks/blueprint/templates/link_icons/link_icons/external.png +0 -0
- data/lib/compass/frameworks/blueprint/templates/link_icons/link_icons/feed.png +0 -0
- data/lib/compass/frameworks/blueprint/templates/link_icons/link_icons/im.png +0 -0
- data/lib/compass/frameworks/blueprint/templates/link_icons/link_icons/pdf.png +0 -0
- data/lib/compass/frameworks/blueprint/templates/link_icons/link_icons/visited.png +0 -0
- data/lib/compass/frameworks/blueprint/templates/link_icons/link_icons/xls.png +0 -0
- data/lib/compass/frameworks/blueprint/templates/link_icons/manifest.rb +10 -0
- data/lib/compass/frameworks/blueprint/templates/project/grid.png +0 -0
- data/lib/compass/frameworks/blueprint/templates/project/ie.sass +16 -0
- data/lib/compass/frameworks/blueprint/templates/project/manifest.rb +8 -0
- data/lib/compass/frameworks/blueprint/templates/project/partials/_base.sass +11 -0
- data/lib/compass/frameworks/blueprint/templates/project/print.sass +8 -0
- data/lib/compass/frameworks/blueprint/templates/project/screen.sass +47 -0
- data/lib/compass/frameworks/blueprint/templates/project/welcome.html.haml +13 -0
- data/lib/compass/frameworks/compass/stylesheets/_compass.sass +1 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/_layout.sass +1 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/_misc.sass +24 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/_reset.sass +3 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/_utilities.sass +7 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/layout/_sticky_footer.sass +19 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/_css3.sass +6 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/_general.sass +5 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/_links.sass +3 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/_lists.sass +3 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/_print.sass +18 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/_sprites.sass +1 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/_tables.sass +3 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/_text.sass +2 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/css3/_border_radius.sass +47 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/css3/_box_shadow.sass +12 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/css3/_box_sizing.sass +13 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/css3/_columns.sass +37 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/css3/_inline_block.sass +7 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/css3/_opacity.sass +18 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.sass +24 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/general/_float.sass +17 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/general/_hacks.sass +6 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/general/_reset.sass +134 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/general/_tabs.sass +0 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/general/_tag_cloud.sass +19 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/links/_hover_link.sass +5 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/links/_link_colors.sass +24 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/links/_unstyled_link.sass +7 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/lists/_bullets.sass +21 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/lists/_horizontal_list.sass +52 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/lists/_inline_list.sass +29 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/sprites/_sprite_img.sass +52 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/tables/_alternating_rows_and_columns.sass +20 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/tables/_borders.sass +27 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/tables/_scaffolding.sass +9 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/text/_ellipsis.sass +13 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/text/_nowrap.sass +3 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/text/_replacement.sass +17 -0
- data/lib/compass/frameworks/compass/templates/ellipsis/ellipsis.sass +6 -0
- data/lib/compass/frameworks/compass/templates/ellipsis/manifest.rb +2 -0
- data/lib/compass/frameworks/compass/templates/ellipsis/xml/ellipsis.xml +14 -0
- data/lib/compass/frameworks/compass/templates/extension/manifest.rb +6 -0
- data/lib/compass/frameworks/compass/templates/extension/stylesheets/main.sass +1 -0
- data/lib/compass/frameworks/compass/templates/extension/templates/project/manifest.rb +2 -0
- data/lib/compass/frameworks/compass/templates/extension/templates/project/screen.sass +2 -0
- data/lib/compass/frameworks/compass/templates/project/ie.sass +6 -0
- data/lib/compass/frameworks/compass/templates/project/manifest.rb +3 -0
- data/lib/compass/frameworks/compass/templates/project/print.sass +6 -0
- data/lib/compass/frameworks/compass/templates/project/screen.sass +13 -0
- data/lib/compass/grid_builder.rb +76 -0
- data/lib/compass/installers.rb +3 -0
- data/lib/compass/installers/base.rb +186 -0
- data/lib/compass/installers/manifest.rb +79 -0
- data/lib/compass/installers/template_context.rb +44 -0
- data/lib/compass/logger.rb +42 -0
- data/lib/compass/sass_extensions.rb +5 -0
- data/lib/compass/sass_extensions/functions.rb +19 -0
- data/lib/compass/sass_extensions/functions/display.rb +22 -0
- data/lib/compass/sass_extensions/functions/enumerate.rb +6 -0
- data/lib/compass/sass_extensions/functions/inline_image.rb +35 -0
- data/lib/compass/sass_extensions/functions/selectors.rb +42 -0
- data/lib/compass/sass_extensions/functions/urls.rb +105 -0
- data/lib/compass/sass_extensions/monkey_patches.rb +3 -0
- data/lib/compass/sass_extensions/monkey_patches/stylesheet_updating.rb +23 -0
- data/lib/compass/test_case.rb +38 -0
- data/lib/compass/validator.rb +10 -0
- data/lib/compass/version.rb +57 -0
- data/lib/vendor/fssm.rb +28 -0
- data/lib/vendor/fssm/backends/fsevents.rb +78 -0
- data/lib/vendor/fssm/backends/polling.rb +24 -0
- data/lib/vendor/fssm/ext.rb +7 -0
- data/lib/vendor/fssm/monitor.rb +21 -0
- data/lib/vendor/fssm/path.rb +88 -0
- data/lib/vendor/fssm/state.rb +46 -0
- data/lib/vendor/fssm/support.rb +26 -0
- data/test/command_line_helper.rb +97 -0
- data/test/command_line_test.rb +67 -0
- data/test/compass_test.rb +132 -0
- data/test/configuration_test.rb +123 -0
- data/test/fixtures/stylesheets/blueprint/config.rb +9 -0
- data/test/fixtures/stylesheets/blueprint/css/typography.css +158 -0
- data/test/fixtures/stylesheets/blueprint/images/grid.png +0 -0
- data/test/fixtures/stylesheets/blueprint/sass/ie.sass +3 -0
- data/test/fixtures/stylesheets/blueprint/sass/print.sass +3 -0
- data/test/fixtures/stylesheets/blueprint/sass/screen.sass +17 -0
- data/test/fixtures/stylesheets/blueprint/sass/typography.sass +3 -0
- data/test/fixtures/stylesheets/compass/config.rb +9 -0
- data/test/fixtures/stylesheets/compass/css/layout.css +15 -0
- data/test/fixtures/stylesheets/compass/css/print.css +18 -0
- data/test/fixtures/stylesheets/compass/css/reset.css +60 -0
- data/test/fixtures/stylesheets/compass/css/utilities.css +17 -0
- data/test/fixtures/stylesheets/compass/sass/layout.sass +3 -0
- data/test/fixtures/stylesheets/compass/sass/print.sass +5 -0
- data/test/fixtures/stylesheets/compass/sass/reset.sass +10 -0
- data/test/fixtures/stylesheets/compass/sass/utilities.sass +6 -0
- data/test/fixtures/stylesheets/image_urls/config.rb +17 -0
- data/test/fixtures/stylesheets/image_urls/css/screen.css +3 -0
- data/test/fixtures/stylesheets/image_urls/images/grid.png +0 -0
- data/test/fixtures/stylesheets/image_urls/sass/screen.sass +6 -0
- data/test/io_helper.rb +19 -0
- data/test/rails_integration_test.rb +84 -0
- data/test/sass_extensions_test.rb +31 -0
- data/test/test_case_helper.rb +13 -0
- data/test/test_helper.rb +27 -0
- data/test/test_rails_helper.rb +20 -0
- metadata +404 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module Compass::SassExtensions::Functions::Urls
|
|
2
|
+
def image_url_with_rails_integration(path)
|
|
3
|
+
if (@controller = Sass::Plugin.rails_controller) && @controller.respond_to?(:request) && @controller.request
|
|
4
|
+
begin
|
|
5
|
+
Sass::Script::String.new "url(#{image_path(path.value)})"
|
|
6
|
+
ensure
|
|
7
|
+
@controller = nil
|
|
8
|
+
end
|
|
9
|
+
else
|
|
10
|
+
image_url_without_rails_integration(path)
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
alias_method_chain :image_url, :rails_integration
|
|
14
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
module Compass
|
|
2
|
+
module AppIntegration
|
|
3
|
+
module StandAlone
|
|
4
|
+
module ConfigurationDefaults
|
|
5
|
+
def sass_dir_without_default
|
|
6
|
+
"src"
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def javascripts_dir_without_default
|
|
10
|
+
"javascripts"
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def css_dir_without_default
|
|
14
|
+
"stylesheets"
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def images_dir_without_default
|
|
18
|
+
"images"
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
module Compass
|
|
2
|
+
module Installers
|
|
3
|
+
class Base
|
|
4
|
+
end
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
module AppIntegration
|
|
8
|
+
module StandAlone
|
|
9
|
+
class Installer < Compass::Installers::Base
|
|
10
|
+
|
|
11
|
+
def init
|
|
12
|
+
directory targetize("")
|
|
13
|
+
super
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def write_configuration_files(config_file = nil)
|
|
17
|
+
config_file ||= targetize('config.rb')
|
|
18
|
+
write_file config_file, config_contents
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def config_files_exist?
|
|
22
|
+
File.exists? targetize('config.rb')
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def config_contents
|
|
26
|
+
project_path, Compass.configuration.project_path = Compass.configuration.project_path, nil
|
|
27
|
+
Compass.configuration.serialize
|
|
28
|
+
ensure
|
|
29
|
+
Compass.configuration.project_path = project_path
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def prepare
|
|
33
|
+
write_configuration_files unless config_files_exist? || !@manifest.generate_config?
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def default_configuration
|
|
37
|
+
Compass::Configuration::Data.new.extend(Compass::AppIntegration::StandAlone::ConfigurationDefaults)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def completed_configuration
|
|
41
|
+
nil
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def finalize(options = {})
|
|
45
|
+
if options[:create]
|
|
46
|
+
puts <<-NEXTSTEPS
|
|
47
|
+
|
|
48
|
+
Congratulations! Your compass project has been created.
|
|
49
|
+
You must recompile your sass stylesheets when they change.
|
|
50
|
+
This can be done in one of the following ways:
|
|
51
|
+
1. From within your project directory run:
|
|
52
|
+
compass
|
|
53
|
+
2. From any directory run:
|
|
54
|
+
compass -u path/to/project
|
|
55
|
+
3. To monitor your project for changes and automatically recompile:
|
|
56
|
+
compass --watch [path/to/project]
|
|
57
|
+
NEXTSTEPS
|
|
58
|
+
end
|
|
59
|
+
if manifest.has_stylesheet?
|
|
60
|
+
puts "\nTo import your new stylesheets add the following lines of HTML (or equivalent) to your webpage:"
|
|
61
|
+
puts stylesheet_links
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def compilation_required?
|
|
66
|
+
@manifest.compile?
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
module Compass::Commands
|
|
2
|
+
end
|
|
3
|
+
|
|
4
|
+
require 'compass/commands/registry'
|
|
5
|
+
|
|
6
|
+
%w(base generate_grid_background help list_frameworks project_base
|
|
7
|
+
update_project watch_project create_project installer_command
|
|
8
|
+
print_version stamp_pattern validate_project
|
|
9
|
+
write_configuration).each do |lib|
|
|
10
|
+
require "compass/commands/#{lib}"
|
|
11
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
module Compass
|
|
2
|
+
module Commands
|
|
3
|
+
class Base
|
|
4
|
+
def self.register(command_name)
|
|
5
|
+
Compass::Commands[command_name] = self
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
include Actions
|
|
9
|
+
|
|
10
|
+
attr_accessor :working_path, :options
|
|
11
|
+
|
|
12
|
+
def initialize(working_path, options)
|
|
13
|
+
self.working_path = working_path
|
|
14
|
+
self.options = options
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def execute
|
|
18
|
+
perform
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def perform
|
|
22
|
+
raise StandardError.new("Not Implemented")
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
protected
|
|
26
|
+
|
|
27
|
+
def framework
|
|
28
|
+
unless Compass::Frameworks[options[:framework]]
|
|
29
|
+
raise Compass::Error.new("No such framework: #{options[:framework].inspect}")
|
|
30
|
+
end
|
|
31
|
+
Compass::Frameworks[options[:framework]]
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
require 'fileutils'
|
|
2
|
+
require 'compass/commands/stamp_pattern'
|
|
3
|
+
|
|
4
|
+
module Compass
|
|
5
|
+
module Commands
|
|
6
|
+
module CreateProjectOptionsParser
|
|
7
|
+
def set_options(opts)
|
|
8
|
+
|
|
9
|
+
if $command == "create"
|
|
10
|
+
opts.banner = %Q{
|
|
11
|
+
Usage: compass create path/to/project [options]
|
|
12
|
+
|
|
13
|
+
Description:
|
|
14
|
+
Create a new compass project at the path specified.
|
|
15
|
+
|
|
16
|
+
Options:
|
|
17
|
+
}.split("\n").map{|l| l.gsub(/^ */,'')}.join("\n")
|
|
18
|
+
else
|
|
19
|
+
opts.banner = %Q{
|
|
20
|
+
Usage: compass init project_type path/to/project [options]
|
|
21
|
+
|
|
22
|
+
Description:
|
|
23
|
+
Initialize an existing project at the path specified.
|
|
24
|
+
|
|
25
|
+
Supported Project Types:
|
|
26
|
+
* rails
|
|
27
|
+
|
|
28
|
+
Options:
|
|
29
|
+
}.split("\n").map{|l| l.gsub(/^ */,'')}.join("\n").strip
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
opts.on("--using FRAMEWORK", "Framework to use when creating the project.") do |framework|
|
|
33
|
+
framework = framework.split('/', 2)
|
|
34
|
+
self.options[:framework] = framework[0]
|
|
35
|
+
self.options[:pattern] = framework[1]
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
super
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
class CreateProject < StampPattern
|
|
43
|
+
|
|
44
|
+
register :create
|
|
45
|
+
register :init
|
|
46
|
+
|
|
47
|
+
class << self
|
|
48
|
+
def option_parser(arguments)
|
|
49
|
+
parser = Compass::Exec::CommandOptionParser.new(arguments)
|
|
50
|
+
parser.extend(Compass::Exec::GlobalOptionsParser)
|
|
51
|
+
parser.extend(Compass::Exec::ProjectOptionsParser)
|
|
52
|
+
parser.extend(CreateProjectOptionsParser)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def usage
|
|
56
|
+
option_parser([]).to_s
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def description(command)
|
|
60
|
+
if command.to_sym == :create
|
|
61
|
+
"Create a new compass project"
|
|
62
|
+
else
|
|
63
|
+
"Initialize an existing project"
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def parse!(arguments)
|
|
68
|
+
parser = option_parser(arguments)
|
|
69
|
+
parse_options!(parser, arguments)
|
|
70
|
+
parse_arguments!(parser, arguments)
|
|
71
|
+
set_default_arguments(parser)
|
|
72
|
+
parser.options
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def parse_init!(arguments)
|
|
76
|
+
parser = option_parser(arguments)
|
|
77
|
+
parse_options!(parser, arguments)
|
|
78
|
+
if arguments.size > 0
|
|
79
|
+
parser.options[:project_type] = arguments.shift.to_sym
|
|
80
|
+
end
|
|
81
|
+
parse_arguments!(parser, arguments)
|
|
82
|
+
set_default_arguments(parser)
|
|
83
|
+
parser.options
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def parse_options!(parser, arguments)
|
|
87
|
+
parser.parse!
|
|
88
|
+
parser
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
def parse_arguments!(parser, arguments)
|
|
92
|
+
if arguments.size == 1
|
|
93
|
+
parser.options[:project_name] = arguments.shift
|
|
94
|
+
elsif arguments.size == 0
|
|
95
|
+
raise Compass::Error, "Please specify a path to the project."
|
|
96
|
+
else
|
|
97
|
+
raise Compass::Error, "Too many arguments were specified."
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
def set_default_arguments(parser)
|
|
102
|
+
parser.options[:framework] ||= :compass
|
|
103
|
+
parser.options[:pattern] ||= "project"
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def is_project_creation?
|
|
108
|
+
true
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
end
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
require 'compass/commands/project_base'
|
|
2
|
+
require 'compass/commands/update_project'
|
|
3
|
+
require 'compass/grid_builder'
|
|
4
|
+
|
|
5
|
+
module Compass
|
|
6
|
+
module Commands
|
|
7
|
+
module GridBackgroundOptionsParser
|
|
8
|
+
def set_options(opts)
|
|
9
|
+
banner = %Q{Usage: compass grid-img W+GxH [path/to/grid.png]
|
|
10
|
+
|
|
11
|
+
Description:
|
|
12
|
+
Generates a background image that can be used to check grid alignment.
|
|
13
|
+
|
|
14
|
+
Height is optional and defaults to 20px
|
|
15
|
+
|
|
16
|
+
By default, the image generated will be named "grid.png"
|
|
17
|
+
and be found in the images directory.
|
|
18
|
+
|
|
19
|
+
This command requires that you have both ImageMagick and RMagick installed.
|
|
20
|
+
|
|
21
|
+
Examples:
|
|
22
|
+
|
|
23
|
+
compass grid-img 40+10 # 40px column, 10px gutter, 20px height
|
|
24
|
+
compass grid-img 40+20x28 # 40px column, 20px gutter, 28px height
|
|
25
|
+
compass grid-img 60+20x28 images/wide_grid.png
|
|
26
|
+
|
|
27
|
+
Options:
|
|
28
|
+
}
|
|
29
|
+
opts.banner = banner
|
|
30
|
+
|
|
31
|
+
super
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
class GenerateGridBackground < ProjectBase
|
|
35
|
+
|
|
36
|
+
include Actions
|
|
37
|
+
|
|
38
|
+
register :"grid-img"
|
|
39
|
+
|
|
40
|
+
class << self
|
|
41
|
+
def option_parser(arguments)
|
|
42
|
+
parser = Compass::Exec::CommandOptionParser.new(arguments)
|
|
43
|
+
parser.extend(Compass::Exec::GlobalOptionsParser)
|
|
44
|
+
parser.extend(GridBackgroundOptionsParser)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def usage
|
|
48
|
+
option_parser([]).to_s
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def description(command)
|
|
52
|
+
"Generates a grid background image."
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def parse!(arguments)
|
|
56
|
+
parser = option_parser(arguments)
|
|
57
|
+
parser.parse!
|
|
58
|
+
if arguments.size == 0
|
|
59
|
+
raise OptionParser::ParseError, "Please specify the grid dimensions."
|
|
60
|
+
end
|
|
61
|
+
parser.options[:grid_dimensions] = arguments.shift
|
|
62
|
+
parser.options[:grid_filename] = arguments.shift
|
|
63
|
+
parser.options
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
def initialize(working_path, options)
|
|
67
|
+
super
|
|
68
|
+
assert_project_directory_exists!
|
|
69
|
+
Compass.add_configuration(options)
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def perform
|
|
73
|
+
unless options[:grid_dimensions] =~ /^(\d+)\+(\d+)(?:x(\d+))?$/
|
|
74
|
+
puts "ERROR: '#{options[:grid_dimensions]}' is not valid."
|
|
75
|
+
puts "Dimensions should be specified like: 30+10x20"
|
|
76
|
+
puts "where 30 is the column width, 10 is the gutter width, and 20 is the (optional) height."
|
|
77
|
+
return
|
|
78
|
+
end
|
|
79
|
+
column_width = $1.to_i
|
|
80
|
+
gutter_width = $2.to_i
|
|
81
|
+
height = $3.to_i if $3
|
|
82
|
+
filename = options[:grid_filename] || projectize("#{project_images_subdirectory}/grid.png")
|
|
83
|
+
unless GridBuilder.new(options.merge(:column_width => column_width, :gutter_width => gutter_width, :height => height, :filename => filename, :working_path => self.working_path)).generate!
|
|
84
|
+
puts "ERROR: Some library dependencies appear to be missing."
|
|
85
|
+
puts "Have you installed rmagick? If not, please run:"
|
|
86
|
+
puts "sudo gem install rmagick"
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
module Compass
|
|
2
|
+
module Commands
|
|
3
|
+
module HelpOptionsParser
|
|
4
|
+
def set_options(opts)
|
|
5
|
+
banner = %Q{Usage: compass help [command]
|
|
6
|
+
|
|
7
|
+
Description:
|
|
8
|
+
The Compass Stylesheet Authoring Framework helps you
|
|
9
|
+
build and maintain your stylesheets and makes it easy
|
|
10
|
+
for you to use stylesheet libraries provided by others.
|
|
11
|
+
|
|
12
|
+
To get help on a particular command please specify the command.
|
|
13
|
+
|
|
14
|
+
Available commands:
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
Compass::Commands.all.sort_by{|c| c.to_s}.each do |command|
|
|
18
|
+
banner << " * #{command}"
|
|
19
|
+
if Compass::Commands[command].respond_to? :description
|
|
20
|
+
banner << "\t- #{Compass::Commands[command].description(command)}"
|
|
21
|
+
end
|
|
22
|
+
banner << "\n"
|
|
23
|
+
end
|
|
24
|
+
opts.banner = banner
|
|
25
|
+
|
|
26
|
+
super
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
class Help < Base
|
|
30
|
+
register :help
|
|
31
|
+
|
|
32
|
+
class << self
|
|
33
|
+
def option_parser(arguments)
|
|
34
|
+
parser = Compass::Exec::CommandOptionParser.new(arguments)
|
|
35
|
+
parser.extend(HelpOptionsParser)
|
|
36
|
+
end
|
|
37
|
+
def usage
|
|
38
|
+
option_parser([]).to_s
|
|
39
|
+
end
|
|
40
|
+
def description(command)
|
|
41
|
+
"Get help on a compass command or extension"
|
|
42
|
+
end
|
|
43
|
+
def parse!(arguments)
|
|
44
|
+
parser = option_parser(arguments)
|
|
45
|
+
parser.parse!
|
|
46
|
+
parser.options[:help_command] = arguments.shift || 'help'
|
|
47
|
+
parser.options
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def execute
|
|
52
|
+
if Compass::Commands.command_exists? options[:help_command]
|
|
53
|
+
$command = options[:help_command]
|
|
54
|
+
puts Compass::Commands[options[:help_command]].usage
|
|
55
|
+
$command = "help"
|
|
56
|
+
else
|
|
57
|
+
raise OptionParser::ParseError, "No such command: #{options[:help_command]}"
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
require 'compass/installers'
|
|
2
|
+
|
|
3
|
+
module Compass
|
|
4
|
+
module Commands
|
|
5
|
+
module InstallerCommand
|
|
6
|
+
include Compass::Installers
|
|
7
|
+
|
|
8
|
+
def configure!
|
|
9
|
+
Compass.add_configuration(installer.default_configuration)
|
|
10
|
+
Compass.add_project_configuration
|
|
11
|
+
Compass.add_configuration(options)
|
|
12
|
+
Compass.add_configuration(installer.completed_configuration)
|
|
13
|
+
if File.exists?(Compass.configuration.extensions_path)
|
|
14
|
+
Compass::Frameworks.discover(Compass.configuration.extensions_path)
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def installer
|
|
19
|
+
project_type = options[:project_type] || Compass.configuration.project_type
|
|
20
|
+
installer_class = "Compass::AppIntegration::#{camelize(project_type)}::Installer"
|
|
21
|
+
@installer = eval("#{installer_class}.new *installer_args")
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# Stolen from ActiveSupport
|
|
25
|
+
def camelize(s)
|
|
26
|
+
s.to_s.gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase }
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def installer_args
|
|
30
|
+
[template_directory(options[:pattern] || "project"), project_directory, options]
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|