compass-edge 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- 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,16 @@
|
|
1
|
+
module Compass
|
2
|
+
module Commands
|
3
|
+
class ListFrameworks < ProjectBase
|
4
|
+
attr_accessor :options
|
5
|
+
def initialize(working_path, options)
|
6
|
+
super
|
7
|
+
end
|
8
|
+
|
9
|
+
def execute
|
10
|
+
Compass::Frameworks::ALL.each do |framework|
|
11
|
+
puts framework.name
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,91 @@
|
|
1
|
+
module Compass
|
2
|
+
module Commands
|
3
|
+
module VersionOptionsParser
|
4
|
+
def set_options(opts)
|
5
|
+
opts.banner = %Q{Usage: compass version [options]
|
6
|
+
|
7
|
+
Options:
|
8
|
+
}
|
9
|
+
opts.on_tail("-?", "-h", "--help", "Print out this message.") do
|
10
|
+
puts opts
|
11
|
+
exit
|
12
|
+
end
|
13
|
+
opts.on("-q", "--quiet", "Just print the version string.") do
|
14
|
+
self.options[:quiet] = true
|
15
|
+
end
|
16
|
+
opts.on("--major", "Print the major version number") do
|
17
|
+
self.options[:major] = true
|
18
|
+
self.options[:custom] = true
|
19
|
+
end
|
20
|
+
opts.on("--minor", "Print up to the minor version number") do
|
21
|
+
self.options[:major] = true
|
22
|
+
self.options[:minor] = true
|
23
|
+
self.options[:custom] = true
|
24
|
+
end
|
25
|
+
opts.on("--patch", "Print up to the patch version number") do
|
26
|
+
self.options[:major] = true
|
27
|
+
self.options[:minor] = true
|
28
|
+
self.options[:patch] = true
|
29
|
+
self.options[:custom] = true
|
30
|
+
end
|
31
|
+
opts.on("--revision", "Include the source control revision") do
|
32
|
+
self.options[:revision] = true
|
33
|
+
self.options[:custom] = true
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
class PrintVersion < Base
|
39
|
+
register :version
|
40
|
+
|
41
|
+
class << self
|
42
|
+
def option_parser(arguments)
|
43
|
+
parser = Compass::Exec::CommandOptionParser.new(arguments)
|
44
|
+
parser.extend(VersionOptionsParser)
|
45
|
+
end
|
46
|
+
def usage
|
47
|
+
option_parser([]).to_s
|
48
|
+
end
|
49
|
+
def description(command)
|
50
|
+
"Print out version information"
|
51
|
+
end
|
52
|
+
def parse!(arguments)
|
53
|
+
parser = option_parser(arguments)
|
54
|
+
parser.parse!
|
55
|
+
parser.options
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
attr_accessor :options
|
60
|
+
|
61
|
+
def initialize(working_path, options)
|
62
|
+
self.options = options
|
63
|
+
end
|
64
|
+
|
65
|
+
def execute
|
66
|
+
if options[:custom]
|
67
|
+
version = ""
|
68
|
+
version << "#{Compass.version[:major]}" if options[:major]
|
69
|
+
version << ".#{Compass.version[:minor]}" if options[:minor]
|
70
|
+
version << ".#{Compass.version[:teeny]}" if options[:patch]
|
71
|
+
if options[:revision]
|
72
|
+
if version.size > 0
|
73
|
+
version << " [#{Compass.version[:rev][0..6]}]"
|
74
|
+
else
|
75
|
+
version << Compass.version[:rev]
|
76
|
+
end
|
77
|
+
end
|
78
|
+
puts version
|
79
|
+
elsif options[:quiet]
|
80
|
+
puts ::Compass.version[:string]
|
81
|
+
else
|
82
|
+
lines = []
|
83
|
+
lines << "Compass #{::Compass.version[:string]}"
|
84
|
+
lines << "Copyright (c) 2008-2009 Chris Eppstein"
|
85
|
+
lines << "Released under the MIT License."
|
86
|
+
puts lines.join("\n")
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
require 'pathname'
|
3
|
+
require 'compass/commands/base'
|
4
|
+
require 'compass/commands/installer_command'
|
5
|
+
|
6
|
+
module Compass
|
7
|
+
module Commands
|
8
|
+
class ProjectBase < Base
|
9
|
+
attr_accessor :project_directory, :project_name, :options
|
10
|
+
|
11
|
+
def initialize(working_path, options = {})
|
12
|
+
super(working_path, options)
|
13
|
+
self.project_name = determine_project_name(working_path, options)
|
14
|
+
Compass.configuration.project_path = determine_project_directory(working_path, options)
|
15
|
+
configure!
|
16
|
+
end
|
17
|
+
|
18
|
+
def execute
|
19
|
+
super
|
20
|
+
end
|
21
|
+
|
22
|
+
protected
|
23
|
+
|
24
|
+
def configure!
|
25
|
+
add_project_configuration
|
26
|
+
if File.exists?(Compass.configuration.extensions_path)
|
27
|
+
Compass::Frameworks.discover(Compass.configuration.extensions_path)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def add_project_configuration
|
32
|
+
Compass.add_project_configuration(options[:configuration_file])
|
33
|
+
end
|
34
|
+
|
35
|
+
def projectize(path)
|
36
|
+
Compass.projectize(path)
|
37
|
+
end
|
38
|
+
|
39
|
+
def project_directory
|
40
|
+
Compass.configuration.project_path
|
41
|
+
end
|
42
|
+
|
43
|
+
def project_css_subdirectory
|
44
|
+
Compass.configuration.css_dir
|
45
|
+
end
|
46
|
+
|
47
|
+
def project_src_subdirectory
|
48
|
+
Compass.configuration.sass_dir
|
49
|
+
end
|
50
|
+
|
51
|
+
def project_images_subdirectory
|
52
|
+
Compass.configuration.images_dir
|
53
|
+
end
|
54
|
+
|
55
|
+
def assert_project_directory_exists!
|
56
|
+
if File.exists?(project_directory) && !File.directory?(project_directory)
|
57
|
+
raise Compass::FilesystemConflict.new("#{project_directory} is not a directory.")
|
58
|
+
elsif !File.directory?(project_directory)
|
59
|
+
raise Compass::Error.new("#{project_directory} does not exist.")
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
private
|
64
|
+
|
65
|
+
def determine_project_name(working_path, options)
|
66
|
+
if options[:project_name]
|
67
|
+
File.basename(strip_trailing_separator(options[:project_name]))
|
68
|
+
else
|
69
|
+
File.basename(working_path)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
def determine_project_directory(working_path, options)
|
74
|
+
if options[:project_name]
|
75
|
+
if absolute_path?(options[:project_name])
|
76
|
+
options[:project_name]
|
77
|
+
else
|
78
|
+
File.join(working_path, options[:project_name])
|
79
|
+
end
|
80
|
+
else
|
81
|
+
working_path
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
def absolute_path?(path)
|
86
|
+
# This is only going to work on unix, gonna need a better implementation.
|
87
|
+
path.index(File::SEPARATOR) == 0
|
88
|
+
end
|
89
|
+
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Compass::Commands
|
2
|
+
module Registry
|
3
|
+
def register(name, command_class)
|
4
|
+
@commands ||= Hash.new
|
5
|
+
@commands[name.to_sym] = command_class
|
6
|
+
end
|
7
|
+
def get(name)
|
8
|
+
@commands ||= Hash.new
|
9
|
+
@commands[name.to_sym]
|
10
|
+
end
|
11
|
+
def command_exists?(name)
|
12
|
+
@commands ||= Hash.new
|
13
|
+
name && @commands.has_key?(name.to_sym)
|
14
|
+
end
|
15
|
+
def all
|
16
|
+
@commands.keys
|
17
|
+
end
|
18
|
+
alias_method :[], :get
|
19
|
+
alias_method :[]=, :register
|
20
|
+
end
|
21
|
+
extend Registry
|
22
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
require 'compass/commands/base'
|
3
|
+
require 'compass/commands/update_project'
|
4
|
+
|
5
|
+
module Compass
|
6
|
+
module Commands
|
7
|
+
module StampPatternOptionsParser
|
8
|
+
def set_options(opts)
|
9
|
+
opts.banner = %Q{Usage: compass install extension/pattern [path/to/project] [options]
|
10
|
+
|
11
|
+
Description:
|
12
|
+
Install an extension's pattern into your compass project
|
13
|
+
|
14
|
+
Example:
|
15
|
+
compass install blueprint/buttons
|
16
|
+
|
17
|
+
Options:
|
18
|
+
}
|
19
|
+
super
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
class StampPattern < ProjectBase
|
24
|
+
|
25
|
+
register :install
|
26
|
+
|
27
|
+
class << self
|
28
|
+
def option_parser(arguments)
|
29
|
+
parser = Compass::Exec::CommandOptionParser.new(arguments)
|
30
|
+
parser.extend(Compass::Exec::GlobalOptionsParser)
|
31
|
+
parser.extend(Compass::Exec::ProjectOptionsParser)
|
32
|
+
parser.extend(StampPatternOptionsParser)
|
33
|
+
end
|
34
|
+
def usage
|
35
|
+
option_parser([]).to_s
|
36
|
+
end
|
37
|
+
def description(command)
|
38
|
+
"Install an extension's pattern into your compass project"
|
39
|
+
end
|
40
|
+
def parse!(arguments)
|
41
|
+
parser = option_parser(arguments)
|
42
|
+
parser.parse!
|
43
|
+
parse_arguments!(parser, arguments)
|
44
|
+
parser.options
|
45
|
+
end
|
46
|
+
def parse_arguments!(parser, arguments)
|
47
|
+
if arguments.size == 0
|
48
|
+
raise OptionParser::ParseError, "Please specify a pattern."
|
49
|
+
end
|
50
|
+
pattern = arguments.shift.split('/', 2)
|
51
|
+
parser.options[:framework] = pattern[0]
|
52
|
+
parser.options[:pattern] = pattern[1]
|
53
|
+
if arguments.size > 0
|
54
|
+
parser.options[:project_name] = arguments.shift
|
55
|
+
end
|
56
|
+
if arguments.size > 0
|
57
|
+
raise OptionParser::ParseError, "Unexpected trailing arguments: #{arguments.join(" ")}"
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
include InstallerCommand
|
63
|
+
|
64
|
+
def initialize(working_path, options)
|
65
|
+
super(working_path, options)
|
66
|
+
end
|
67
|
+
|
68
|
+
# all commands must implement perform
|
69
|
+
def perform
|
70
|
+
installer.init
|
71
|
+
installer.run(:skip_finalization => true)
|
72
|
+
UpdateProject.new(working_path, options).perform if installer.compilation_required?
|
73
|
+
installer.finalize(:create => is_project_creation?)
|
74
|
+
end
|
75
|
+
|
76
|
+
def is_project_creation?
|
77
|
+
false
|
78
|
+
end
|
79
|
+
|
80
|
+
def template_directory(pattern)
|
81
|
+
File.join(framework.templates_directory, pattern)
|
82
|
+
end
|
83
|
+
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'compass/commands/project_base'
|
2
|
+
require 'compass/compiler'
|
3
|
+
|
4
|
+
module Compass
|
5
|
+
module Commands
|
6
|
+
class UpdateProject < ProjectBase
|
7
|
+
|
8
|
+
def initialize(working_path, options)
|
9
|
+
super
|
10
|
+
assert_project_directory_exists! unless dry_run?
|
11
|
+
end
|
12
|
+
|
13
|
+
def perform
|
14
|
+
compiler = new_compiler_instance
|
15
|
+
if compiler.sass_files.empty? && !dry_run?
|
16
|
+
message = "Nothing to compile. If you're trying to start a new project, you have left off the directory argument.\n"
|
17
|
+
message << "Run \"compass -h\" to get help."
|
18
|
+
raise Compass::Error, message
|
19
|
+
else
|
20
|
+
compiler.run
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def dry_run?
|
25
|
+
options[:dry_run]
|
26
|
+
end
|
27
|
+
|
28
|
+
def new_compiler_instance(additional_options = {})
|
29
|
+
Compass::Compiler.new(working_path,
|
30
|
+
projectize(Compass.configuration.sass_dir),
|
31
|
+
projectize(Compass.configuration.css_dir),
|
32
|
+
Compass.sass_engine_options.merge(:quiet => options[:quiet],
|
33
|
+
:force => options[:force]).merge(additional_options))
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'compass/commands/project_base'
|
2
|
+
require 'compass/commands/update_project'
|
3
|
+
|
4
|
+
module Compass
|
5
|
+
module Commands
|
6
|
+
class ValidateProject < ProjectBase
|
7
|
+
|
8
|
+
def initialize(working_path, options)
|
9
|
+
super
|
10
|
+
assert_project_directory_exists!
|
11
|
+
end
|
12
|
+
|
13
|
+
def perform
|
14
|
+
require 'compass/validator'
|
15
|
+
UpdateProject.new(working_path, options).perform
|
16
|
+
Validator.new(project_css_subdirectory).validate()
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
require 'pathname'
|
3
|
+
require 'compass/commands/base'
|
4
|
+
require 'compass/commands/update_project'
|
5
|
+
|
6
|
+
module Compass
|
7
|
+
module Commands
|
8
|
+
class WatchProject < UpdateProject
|
9
|
+
|
10
|
+
attr_accessor :last_update_time, :last_sass_files
|
11
|
+
|
12
|
+
def perform
|
13
|
+
Signal.trap("INT") do
|
14
|
+
puts ""
|
15
|
+
exit 0
|
16
|
+
end
|
17
|
+
|
18
|
+
recompile
|
19
|
+
|
20
|
+
puts ">>> Compass is watching for changes. Press Ctrl-C to Stop."
|
21
|
+
|
22
|
+
begin
|
23
|
+
require 'fssm'
|
24
|
+
rescue LoadError
|
25
|
+
$: << File.join(Compass.lib_directory, 'vendor')
|
26
|
+
retry
|
27
|
+
end
|
28
|
+
|
29
|
+
FSSM.monitor do |monitor|
|
30
|
+
Compass.configuration.sass_load_paths.each do |load_path|
|
31
|
+
monitor.path load_path do |path|
|
32
|
+
path.glob '**/*.sass'
|
33
|
+
|
34
|
+
path.update &method(:recompile)
|
35
|
+
path.delete {|base, relative| remove_obsolete_css(base,relative); recompile(base, relative)}
|
36
|
+
path.create &method(:recompile)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
def remove_obsolete_css(base = nil, relative = nil)
|
45
|
+
compiler = new_compiler_instance(:quiet => true)
|
46
|
+
sass_files = compiler.sass_files
|
47
|
+
deleted_sass_files = (last_sass_files || []) - sass_files
|
48
|
+
deleted_sass_files.each do |deleted_sass_file|
|
49
|
+
css_file = compiler.corresponding_css_file(deleted_sass_file)
|
50
|
+
remove(css_file) if File.exists?(css_file)
|
51
|
+
end
|
52
|
+
self.last_sass_files = sass_files
|
53
|
+
end
|
54
|
+
|
55
|
+
def recompile(base = nil, relative = nil)
|
56
|
+
compiler = new_compiler_instance(:quiet => true)
|
57
|
+
if file = compiler.out_of_date?
|
58
|
+
begin
|
59
|
+
puts ">>> Change detected to: #{file}"
|
60
|
+
compiler.run
|
61
|
+
rescue StandardError => e
|
62
|
+
::Compass::Exec.report_error(e, options)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'compass/commands/project_base'
|
2
|
+
|
3
|
+
module Compass
|
4
|
+
module Commands
|
5
|
+
class WriteConfiguration < ProjectBase
|
6
|
+
|
7
|
+
include InstallerCommand
|
8
|
+
|
9
|
+
def initialize(working_path, options)
|
10
|
+
super
|
11
|
+
assert_project_directory_exists!
|
12
|
+
end
|
13
|
+
|
14
|
+
def add_project_configuration
|
15
|
+
Compass.add_project_configuration
|
16
|
+
end
|
17
|
+
|
18
|
+
def perform
|
19
|
+
installer.write_configuration_files(options[:configuration_file])
|
20
|
+
end
|
21
|
+
|
22
|
+
def installer_args
|
23
|
+
[nil, project_directory, options]
|
24
|
+
end
|
25
|
+
|
26
|
+
def explicit_config_file_must_be_readable?
|
27
|
+
false
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|