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,170 @@
|
|
|
1
|
+
module Compass
|
|
2
|
+
module Configuration
|
|
3
|
+
# The inheritance module makes it easy for configuration data to inherit from
|
|
4
|
+
# other instances of configuration data. This makes it easier for external code to layer
|
|
5
|
+
# bits of configuration from various sources.
|
|
6
|
+
module Inheritance
|
|
7
|
+
|
|
8
|
+
def self.included(base)
|
|
9
|
+
# inherited_data stores configuration data that this configuration object will
|
|
10
|
+
# inherit if not provided explicitly.
|
|
11
|
+
base.send :attr_accessor, :inherited_data, :set_attributes, :top_level
|
|
12
|
+
|
|
13
|
+
base.send(:include, InstanceMethods)
|
|
14
|
+
base.extend(ClassMethods)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
module ClassMethods
|
|
18
|
+
def inherited_writer(*attributes)
|
|
19
|
+
attributes.each do |attribute|
|
|
20
|
+
line = __LINE__ + 1
|
|
21
|
+
class_eval %Q{
|
|
22
|
+
def #{attribute}=(value) # def css_dir=(value)
|
|
23
|
+
@set_attributes ||= {} # @set_attributes ||= {}
|
|
24
|
+
@set_attributes[#{attribute.inspect}] = true # @set_attributes[:css_dir] = true
|
|
25
|
+
@#{attribute} = value # @css_dir = value
|
|
26
|
+
end # end
|
|
27
|
+
|
|
28
|
+
def unset_#{attribute}! # def unset_css_dir!
|
|
29
|
+
unset!(#{attribute.inspect}) # unset!(:css_dir)
|
|
30
|
+
end # end
|
|
31
|
+
|
|
32
|
+
def #{attribute}_set? # def css_dir_set?
|
|
33
|
+
set?(#{attribute.inspect}) # set?(:css_dir)
|
|
34
|
+
end # end
|
|
35
|
+
}, __FILE__, line
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Defines the default reader to be an inherited_reader that will look at the inherited_data for its
|
|
40
|
+
# value when not set. The inherited reader calls to a raw reader that acts like a normal attribute
|
|
41
|
+
# reader but prefixes the attribute name with "raw_".
|
|
42
|
+
def inherited_reader(*attributes)
|
|
43
|
+
attributes.each do |attribute|
|
|
44
|
+
line = __LINE__ + 1
|
|
45
|
+
class_eval %Q{
|
|
46
|
+
def raw_#{attribute} # def raw_css_dir
|
|
47
|
+
@#{attribute} # @css_dir
|
|
48
|
+
end # end
|
|
49
|
+
def #{attribute}_without_default # def css_dir_without_default
|
|
50
|
+
read_without_default(#{attribute.inspect}) # read_without_default(:css_dir)
|
|
51
|
+
end # end
|
|
52
|
+
def #{attribute} # def css_dir
|
|
53
|
+
read(#{attribute.inspect}) # read(:css_dir)
|
|
54
|
+
end # end
|
|
55
|
+
}, __FILE__, line
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def inherited_accessor(*attributes)
|
|
60
|
+
inherited_reader(*attributes)
|
|
61
|
+
inherited_writer(*attributes)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
module InstanceMethods
|
|
68
|
+
|
|
69
|
+
def on_top!
|
|
70
|
+
self.set_top_level(self)
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def set_top_level(new_top)
|
|
74
|
+
self.top_level = new_top
|
|
75
|
+
if self.inherited_data.respond_to?(:set_top_level)
|
|
76
|
+
self.inherited_data.set_top_level(new_top)
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def inherit_from!(data)
|
|
82
|
+
if self.inherited_data
|
|
83
|
+
self.inherited_data.inherit_from!(data)
|
|
84
|
+
else
|
|
85
|
+
self.inherited_data = data
|
|
86
|
+
end
|
|
87
|
+
self
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
def unset!(attribute)
|
|
91
|
+
@set_attributes ||= {}
|
|
92
|
+
send("#{attribute}=", nil)
|
|
93
|
+
@set_attributes.delete(attribute)
|
|
94
|
+
nil
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
def set?(attribute)
|
|
98
|
+
@set_attributes ||= {}
|
|
99
|
+
@set_attributes[attribute]
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
def default_for(attribute)
|
|
103
|
+
method = "default_#{attribute}".to_sym
|
|
104
|
+
if respond_to?(method)
|
|
105
|
+
send(method)
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Read an explicitly set value that is either inherited or set on this instance
|
|
110
|
+
def read_without_default(attribute)
|
|
111
|
+
if set?(attribute)
|
|
112
|
+
send("raw_#{attribute}")
|
|
113
|
+
elsif inherited_data.respond_to?("#{attribute}_without_default")
|
|
114
|
+
inherited_data.send("#{attribute}_without_default")
|
|
115
|
+
elsif inherited_data.respond_to?(attribute)
|
|
116
|
+
inherited_data.send(attribute)
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Read a value that is either inherited or set on this instance, if we get to the bottom-most configuration instance,
|
|
121
|
+
# we ask for the default starting at the top level.
|
|
122
|
+
def read(attribute)
|
|
123
|
+
if !(v = send("#{attribute}_without_default")).nil?
|
|
124
|
+
v
|
|
125
|
+
else
|
|
126
|
+
top_level.default_for(attribute)
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
def method_missing(meth)
|
|
131
|
+
if inherited_data
|
|
132
|
+
inherited_data.send(meth)
|
|
133
|
+
else
|
|
134
|
+
raise NoMethodError, meth.to_s
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
def respond_to?(meth)
|
|
139
|
+
if super
|
|
140
|
+
true
|
|
141
|
+
elsif inherited_data
|
|
142
|
+
inherited_data.respond_to?(meth)
|
|
143
|
+
else
|
|
144
|
+
false
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
def debug
|
|
149
|
+
instances = [self]
|
|
150
|
+
instances << instances.last.inherited_data while instances.last.inherited_data
|
|
151
|
+
normalized_attrs = {}
|
|
152
|
+
ATTRIBUTES.each do |prop|
|
|
153
|
+
values = []
|
|
154
|
+
instances.each do |instance|
|
|
155
|
+
values << {
|
|
156
|
+
:raw => (instance.send("raw_#{prop}") rescue nil),
|
|
157
|
+
:value => (instance.send("#{prop}_without_default") rescue nil),
|
|
158
|
+
:default => (instance.send("default_#{prop}") rescue nil),
|
|
159
|
+
:resoved => instance.send(prop)
|
|
160
|
+
}
|
|
161
|
+
end
|
|
162
|
+
normalized_attrs[prop] = values
|
|
163
|
+
end
|
|
164
|
+
normalized_attrs
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
end
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
module Compass
|
|
2
|
+
module Configuration
|
|
3
|
+
# The serialization module manages reading and writing the configuration file(s).
|
|
4
|
+
module Serialization
|
|
5
|
+
def self.included(base)
|
|
6
|
+
base.send(:include, InstanceMethods)
|
|
7
|
+
base.extend ClassMethods
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
module ClassMethods
|
|
11
|
+
def new_from_file(config_file)
|
|
12
|
+
data = Data.new
|
|
13
|
+
data.parse(config_file)
|
|
14
|
+
data
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def new_from_string(contents, filename)
|
|
18
|
+
data = Data.new
|
|
19
|
+
data.parse_string(contents, filename)
|
|
20
|
+
data
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
module InstanceMethods
|
|
25
|
+
# parses a configuration file which is a ruby script
|
|
26
|
+
def parse(config_file)
|
|
27
|
+
unless File.readable?(config_file)
|
|
28
|
+
raise Compass::Error, "Configuration file, #{config_file}, not found or not readable."
|
|
29
|
+
end
|
|
30
|
+
open(config_file) do |f|
|
|
31
|
+
parse_string(f.read, config_file)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def parse_string(contents, filename)
|
|
36
|
+
bind = binding
|
|
37
|
+
eval(contents, bind, filename)
|
|
38
|
+
ATTRIBUTES.each do |prop|
|
|
39
|
+
value = eval(prop.to_s, bind) rescue nil
|
|
40
|
+
self.send("#{prop}=", value) if value
|
|
41
|
+
end
|
|
42
|
+
if @added_import_paths
|
|
43
|
+
self.additional_import_paths ||= []
|
|
44
|
+
self.additional_import_paths += @added_import_paths
|
|
45
|
+
end
|
|
46
|
+
issue_deprecation_warnings
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def serialize
|
|
50
|
+
contents = ""
|
|
51
|
+
required_libraries.each do |lib|
|
|
52
|
+
contents << %Q{require '#{lib}'\n}
|
|
53
|
+
end
|
|
54
|
+
contents << "# Require any additional compass plugins here.\n"
|
|
55
|
+
contents << "\n" if required_libraries.any?
|
|
56
|
+
ATTRIBUTES.each do |prop|
|
|
57
|
+
value = send("#{prop}_without_default")
|
|
58
|
+
if value.is_a?(Proc)
|
|
59
|
+
$stderr.puts "WARNING: #{prop} is code and cannot be written to a file. You'll need to copy it yourself."
|
|
60
|
+
end
|
|
61
|
+
if respond_to?("comment_for_#{prop}")
|
|
62
|
+
contents << send("comment_for_#{prop}")
|
|
63
|
+
end
|
|
64
|
+
if block_given? && (to_emit = yield(prop, value))
|
|
65
|
+
contents << to_emit
|
|
66
|
+
else
|
|
67
|
+
contents << serialize_property(prop, value) unless value.nil?
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
contents
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def serialize_property(prop, value)
|
|
74
|
+
%Q(#{prop} = #{value.inspect}\n)
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def issue_deprecation_warnings
|
|
78
|
+
if http_images_path == :relative
|
|
79
|
+
$stderr.puts "DEPRECATION WARNING: Please set relative_assets = true to enable relative paths."
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
data/lib/compass/exec.rb
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
require 'compass/dependencies'
|
|
2
|
+
require 'optparse'
|
|
3
|
+
require 'compass/logger'
|
|
4
|
+
require 'compass/errors'
|
|
5
|
+
require 'compass/actions'
|
|
6
|
+
require 'compass/commands'
|
|
7
|
+
|
|
8
|
+
module Compass::Exec
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
%w(helpers switch_ui sub_command_ui
|
|
12
|
+
global_options_parser project_options_parser
|
|
13
|
+
command_option_parser).each do |lib|
|
|
14
|
+
require "compass/exec/#{lib}"
|
|
15
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module Compass::Exec
|
|
2
|
+
class CommandOptionParser
|
|
3
|
+
attr_accessor :options, :arguments, :opts
|
|
4
|
+
def initialize(arguments)
|
|
5
|
+
self.arguments = arguments
|
|
6
|
+
self.options = {}
|
|
7
|
+
end
|
|
8
|
+
def parse!
|
|
9
|
+
opts.parse!(arguments)
|
|
10
|
+
end
|
|
11
|
+
def opts
|
|
12
|
+
OptionParser.new do |opts|
|
|
13
|
+
self.set_options(opts)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
def set_options(opts)
|
|
17
|
+
|
|
18
|
+
end
|
|
19
|
+
def to_s
|
|
20
|
+
opts.to_s
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
module Compass::Exec::GlobalOptionsParser
|
|
2
|
+
def set_options(opts)
|
|
3
|
+
super
|
|
4
|
+
set_global_options(opts)
|
|
5
|
+
end
|
|
6
|
+
def set_global_options(opts)
|
|
7
|
+
opts.on('-r LIBRARY', '--require LIBRARY',
|
|
8
|
+
"Require the given ruby LIBRARY before running commands.",
|
|
9
|
+
" This is used to access compass plugins without having a",
|
|
10
|
+
" project configuration file.") do |library|
|
|
11
|
+
::Compass.configuration.require library
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
opts.on('-q', '--quiet', :NONE, 'Quiet mode.') do
|
|
15
|
+
self.options[:quiet] = true
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
opts.on('--trace', :NONE, 'Show a full stacktrace on error') do
|
|
19
|
+
self.options[:trace] = true
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
opts.on('--force', :NONE, 'Allows some failing commands to succeed instead.') do
|
|
23
|
+
self.options[:force] = true
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
opts.on('--dry-run', :NONE, 'Dry Run. Tells you what it plans to do.') do
|
|
27
|
+
self.options[:dry_run] = true
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
opts.on_tail("-?", "-h", "--help", "Show this message") do
|
|
31
|
+
puts opts
|
|
32
|
+
exit
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module Compass::Exec
|
|
2
|
+
module Helpers
|
|
3
|
+
extend self
|
|
4
|
+
def select_appropriate_command_line_ui(arguments)
|
|
5
|
+
if Compass::Commands.command_exists? arguments.first
|
|
6
|
+
SubCommandUI
|
|
7
|
+
else
|
|
8
|
+
SwitchUI
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
def report_error(e, options)
|
|
12
|
+
$stderr.puts "#{e.class} on line #{get_line e} of #{get_file e}: #{e.message}"
|
|
13
|
+
if options[:trace]
|
|
14
|
+
e.backtrace[1..-1].each { |t| $stderr.puts " #{t}" }
|
|
15
|
+
else
|
|
16
|
+
$stderr.puts "Run with --trace to see the full backtrace"
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def get_file(exception)
|
|
21
|
+
exception.backtrace[0].split(/:/, 2)[0]
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def get_line(exception)
|
|
25
|
+
exception.backtrace[0].scan(/:(\d+)/)[0]
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
module Compass::Exec::ProjectOptionsParser
|
|
2
|
+
def set_options(opts)
|
|
3
|
+
super
|
|
4
|
+
set_project_options(opts)
|
|
5
|
+
end
|
|
6
|
+
def set_project_options(opts)
|
|
7
|
+
opts.on('-c', '--config CONFIG_FILE', 'Specify the location of the configuration file explicitly.') do |configuration_file|
|
|
8
|
+
self.options[:configuration_file] = configuration_file
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
opts.on('--sass-dir SRC_DIR', "The source directory where you keep your sass stylesheets.") do |sass_dir|
|
|
12
|
+
self.options[:sass_dir] = sass_dir
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
opts.on('--css-dir CSS_DIR', "The target directory where you keep your css stylesheets.") do |css_dir|
|
|
16
|
+
self.options[:css_dir] = css_dir
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
opts.on('--images-dir IMAGES_DIR', "The directory where you keep your images.") do |images_dir|
|
|
20
|
+
self.options[:images_dir] = images_dir
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
opts.on('--javascripts-dir JS_DIR', "The directory where you keep your javascripts.") do |javascripts_dir|
|
|
24
|
+
self.options[:javascripts_dir] = javascripts_dir
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
opts.on('-e ENV', '--environment ENV', [:development, :production], 'Use sensible defaults for your current environment.',
|
|
28
|
+
' One of: development, production (default)') do |env|
|
|
29
|
+
self.options[:environment] = env
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
opts.on('-s STYLE', '--output-style STYLE', [:nested, :expanded, :compact, :compressed], 'Select a CSS output mode.',
|
|
33
|
+
' One of: nested, expanded, compact, compressed') do |style|
|
|
34
|
+
self.options[:output_style] = style
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
opts.on('--relative-assets', :NONE, 'Make compass asset helpers generate relative urls to assets.') do
|
|
38
|
+
self.options[:relative_assets] = true
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
require 'compass/exec/global_options_parser'
|
|
2
|
+
require 'compass/exec/project_options_parser'
|
|
3
|
+
|
|
4
|
+
module Compass::Exec
|
|
5
|
+
class SubCommandUI
|
|
6
|
+
|
|
7
|
+
attr_accessor :args
|
|
8
|
+
|
|
9
|
+
def initialize(args)
|
|
10
|
+
self.args = args
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def run!
|
|
14
|
+
begin
|
|
15
|
+
perform!
|
|
16
|
+
rescue Exception => e
|
|
17
|
+
raise e if e.is_a? SystemExit
|
|
18
|
+
if e.is_a?(::Compass::Error) || e.is_a?(OptionParser::ParseError)
|
|
19
|
+
$stderr.puts e.message
|
|
20
|
+
else
|
|
21
|
+
::Compass::Exec::Helpers.report_error(e, @options || {})
|
|
22
|
+
end
|
|
23
|
+
return 1
|
|
24
|
+
end
|
|
25
|
+
return 0
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
protected
|
|
29
|
+
|
|
30
|
+
def perform!
|
|
31
|
+
$command = args.shift
|
|
32
|
+
command_class = Compass::Commands[$command]
|
|
33
|
+
@options = if command_class.respond_to?("parse_#{$command}!")
|
|
34
|
+
command_class.send("parse_#{$command}!", args)
|
|
35
|
+
else
|
|
36
|
+
command_class.parse!(args)
|
|
37
|
+
end
|
|
38
|
+
command_class.new(Dir.getwd, @options).execute
|
|
39
|
+
rescue OptionParser::ParseError => e
|
|
40
|
+
puts "Error: #{e.message}"
|
|
41
|
+
puts command_class.usage
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
end
|
|
45
|
+
end
|