frontsau 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +16 -0
- data/Gemfile +4 -0
- data/LICENSE +21 -0
- data/README.md +30 -0
- data/Rakefile +2 -0
- data/bin/frontsau +15 -0
- data/bin/frontsau-phaml-compiler +35 -0
- data/example/.frontsau +12 -0
- data/example/assets/head.jpg +0 -0
- data/example/assets/script.js +4 -0
- data/example/assets/style.css +6 -0
- data/example/css/includes.sass +2 -0
- data/example/css/style.sass +6 -0
- data/example/image/head.jpg +0 -0
- data/example/index.html +0 -0
- data/example/js/script.coffee +1 -0
- data/frontsau.gemspec +41 -0
- data/lib/Phamlp/Phamlp.php +72 -0
- data/lib/Phamlp/PhamlpException.php +31 -0
- data/lib/Phamlp/haml/HamlException.php +29 -0
- data/lib/Phamlp/haml/HamlHelpers.php +199 -0
- data/lib/Phamlp/haml/HamlParser.php +1250 -0
- data/lib/Phamlp/haml/filters/HamlBaseFilter.php +30 -0
- data/lib/Phamlp/haml/filters/HamlCdataFilter.php +29 -0
- data/lib/Phamlp/haml/filters/HamlCssFilter.php +30 -0
- data/lib/Phamlp/haml/filters/HamlEscapedFilter.php +32 -0
- data/lib/Phamlp/haml/filters/HamlJavascriptFilter.php +31 -0
- data/lib/Phamlp/haml/filters/HamlPhpFilter.php +27 -0
- data/lib/Phamlp/haml/filters/HamlPlainFilter.php +28 -0
- data/lib/Phamlp/haml/filters/HamlPreserveFilter.php +29 -0
- data/lib/Phamlp/haml/filters/HamlSassFilter.php +37 -0
- data/lib/Phamlp/haml/filters/HamlScssFilter.php +37 -0
- data/lib/Phamlp/haml/filters/_HamlMarkdownFilter.php +50 -0
- data/lib/Phamlp/haml/filters/_HamlTextileFilter.php +50 -0
- data/lib/Phamlp/haml/messages/_i18n.php +32 -0
- data/lib/Phamlp/haml/messages/de.php +32 -0
- data/lib/Phamlp/haml/messages/fr.php +32 -0
- data/lib/Phamlp/haml/renderers/HamlCompactRenderer.php +32 -0
- data/lib/Phamlp/haml/renderers/HamlCompressedRenderer.php +48 -0
- data/lib/Phamlp/haml/renderers/HamlExpandedRenderer.php +58 -0
- data/lib/Phamlp/haml/renderers/HamlNestedRenderer.php +77 -0
- data/lib/Phamlp/haml/renderers/HamlRenderer.php +137 -0
- data/lib/Phamlp/haml/tree/HamlCodeBlockNode.php +58 -0
- data/lib/Phamlp/haml/tree/HamlCommentNode.php +41 -0
- data/lib/Phamlp/haml/tree/HamlDoctypeNode.php +27 -0
- data/lib/Phamlp/haml/tree/HamlElementNode.php +52 -0
- data/lib/Phamlp/haml/tree/HamlFilterNode.php +50 -0
- data/lib/Phamlp/haml/tree/HamlHelperNode.php +73 -0
- data/lib/Phamlp/haml/tree/HamlNode.php +253 -0
- data/lib/Phamlp/haml/tree/HamlNodeExceptions.php +19 -0
- data/lib/Phamlp/haml/tree/HamlRootNode.php +58 -0
- data/lib/Phamlp/sass/SassException.php +29 -0
- data/lib/Phamlp/sass/SassFile.php +164 -0
- data/lib/Phamlp/sass/SassParser.php +848 -0
- data/lib/Phamlp/sass/extensions/compass/config.php +65 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/_blueprint.scss +47 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_buttons.scss +101 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_colors.scss +32 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_debug.scss +11 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_fancy-type.scss +86 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_form.scss +68 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_grid.scss +249 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_ie.scss +109 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_interaction.scss +57 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_link-icons.scss +37 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_liquid.scss +147 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_print.scss +93 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_reset.scss +3 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_rtl.scss +133 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_scaffolding.scss +54 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_typography.scss +104 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_utilities.scss +37 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/reset/_utilities.scss +58 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/basic/grid.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/basic/ie.sass +4 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/basic/manifest.rb +30 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/basic/partials/_base.sass +10 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/basic/print.sass +4 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/basic/screen.sass +12 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/buttons/buttons/cross.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/buttons/buttons/key.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/buttons/buttons/tick.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/buttons/buttons.sass +49 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/buttons/manifest.rb +17 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/doc.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/email.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/external.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/feed.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/im.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/pdf.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/visited.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/xls.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons.sass +13 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/manifest.rb +23 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/project/grid.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/project/ie.sass +16 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/project/manifest.rb +30 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/project/partials/_base.sass +11 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/project/print.sass +8 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/project/screen.sass +45 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/grid.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/ie.sass +16 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/manifest.rb +33 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/partials/_base.sass +10 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/partials/_form.sass +6 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/partials/_page.sass +18 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/partials/_two_col.sass +38 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/print.sass +5 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/screen.sass +14 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/_compass.scss +2 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/_css3.scss +15 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/_layout.scss +1 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/_reset.scss +3 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/_utilities.scss +6 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_background-clip.scss +43 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_background-origin.scss +42 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_background-size.scss +14 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_border-radius.scss +135 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_box-shadow.scss +50 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_box-sizing.scss +13 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_box.scss +112 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_columns.scss +55 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_font-face.scss +33 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_gradient.scss +82 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_inline-block.scss +12 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_opacity.scss +27 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_shared.scss +47 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_text-shadow.scss +25 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_transform.scss +85 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_transition.scss +85 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/layout/_sticky-footer.scss +23 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/reset/_utilities.scss +133 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/_general.scss +6 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/_links.scss +3 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/_lists.scss +4 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/_print.scss +17 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/_sprites.scss +1 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/_tables.scss +3 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/_text.scss +3 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss +31 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/general/_float.scss +15 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/general/_hacks.scss +35 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/general/_min.scss +16 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/general/_reset.scss +2 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/general/_tabs.scss +1 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/general/_tag-cloud.scss +18 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/links/_hover-link.scss +5 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/links/_link-colors.scss +28 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/links/_unstyled-link.scss +7 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/lists/_bullets.scss +34 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/lists/_horizontal-list.scss +52 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/lists/_inline-block-list.scss +47 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/lists/_inline-list.scss +29 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/sprites/_sprite-img.scss +56 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/tables/_alternating-rows-and-columns.scss +20 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/tables/_borders.scss +27 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/tables/_scaffolding.scss +9 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/text/_ellipsis.scss +25 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/text/_nowrap.scss +2 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/text/_replacement.scss +34 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/ellipsis/ellipsis.sass +9 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/ellipsis/manifest.rb +27 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/ellipsis/xml/ellipsis.xml +14 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/extension/manifest.rb +20 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/extension/stylesheets/main.sass +1 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/extension/templates/project/manifest.rb +2 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/extension/templates/project/screen.sass +2 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/project/USAGE.markdown +32 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/project/ie.sass +6 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/project/manifest.rb +4 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/project/print.sass +6 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/project/screen.sass +7 -0
- data/lib/Phamlp/sass/extensions/compass/functions/colourStops.php +268 -0
- data/lib/Phamlp/sass/extensions/compass/functions/constants.php +44 -0
- data/lib/Phamlp/sass/extensions/compass/functions/fontFiles.php +30 -0
- data/lib/Phamlp/sass/extensions/compass/functions/imageSize.php +39 -0
- data/lib/Phamlp/sass/extensions/compass/functions/inlineData.php +84 -0
- data/lib/Phamlp/sass/extensions/compass/functions/lists.php +47 -0
- data/lib/Phamlp/sass/extensions/compass/functions/selectors.php +128 -0
- data/lib/Phamlp/sass/extensions/compass/functions/urls.php +143 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/_compass.scss +2 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/_css3.scss +15 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/_layout.scss +1 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/_reset.scss +3 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/_utilities.scss +6 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_background-clip.scss +43 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_background-origin.scss +42 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_background-size.scss +14 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_border-radius.scss +135 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_box-shadow.scss +50 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_box-sizing.scss +13 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_box.scss +112 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_columns.scss +55 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_font-face.scss +33 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_gradient.scss +96 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_inline-block.scss +12 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_opacity.scss +27 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_shared.scss +47 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_text-shadow.scss +25 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_transform.scss +85 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_transition.scss +85 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/layout/_sticky-footer.scss +23 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/reset/_utilities.scss +133 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/_general.scss +6 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/_links.scss +3 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/_lists.scss +4 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/_print.scss +17 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/_sprites.scss +1 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/_tables.scss +3 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/_text.scss +3 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/general/_clearfix.scss +31 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/general/_float.scss +15 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/general/_hacks.scss +35 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/general/_min.scss +16 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/general/_reset.scss +2 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/general/_tabs.scss +1 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/general/_tag-cloud.scss +18 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/links/_hover-link.scss +5 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/links/_link-colors.scss +28 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/links/_unstyled-link.scss +7 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/lists/_bullets.scss +34 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/lists/_horizontal-list.scss +52 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/lists/_inline-block-list.scss +47 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/lists/_inline-list.scss +29 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/sprites/_sprite-img.scss +56 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/tables/_alternating-rows-and-columns.scss +20 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/tables/_borders.scss +27 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/tables/_scaffolding.scss +9 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/text/_ellipsis.scss +25 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/text/_nowrap.scss +2 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/text/_replacement.scss +34 -0
- data/lib/Phamlp/sass/messages/_i18n.php +122 -0
- data/lib/Phamlp/sass/messages/de.php +70 -0
- data/lib/Phamlp/sass/messages/fr.php +70 -0
- data/lib/Phamlp/sass/renderers/SassCompactRenderer.php +130 -0
- data/lib/Phamlp/sass/renderers/SassCompressedRenderer.php +102 -0
- data/lib/Phamlp/sass/renderers/SassExpandedRenderer.php +62 -0
- data/lib/Phamlp/sass/renderers/SassNestedRenderer.php +61 -0
- data/lib/Phamlp/sass/renderers/SassRenderer.php +51 -0
- data/lib/Phamlp/sass/script/SassScriptFunction.php +169 -0
- data/lib/Phamlp/sass/script/SassScriptFunctions.php +751 -0
- data/lib/Phamlp/sass/script/SassScriptLexer.php +114 -0
- data/lib/Phamlp/sass/script/SassScriptOperation.php +151 -0
- data/lib/Phamlp/sass/script/SassScriptParser.php +192 -0
- data/lib/Phamlp/sass/script/SassScriptParserExceptions.php +40 -0
- data/lib/Phamlp/sass/script/SassScriptVariable.php +57 -0
- data/lib/Phamlp/sass/script/literals/SassBoolean.php +67 -0
- data/lib/Phamlp/sass/script/literals/SassColour.php +886 -0
- data/lib/Phamlp/sass/script/literals/SassLiteral.php +359 -0
- data/lib/Phamlp/sass/script/literals/SassLiteralExceptions.php +47 -0
- data/lib/Phamlp/sass/script/literals/SassNumber.php +503 -0
- data/lib/Phamlp/sass/script/literals/SassString.php +106 -0
- data/lib/Phamlp/sass/tree/SassCommentNode.php +64 -0
- data/lib/Phamlp/sass/tree/SassContext.php +120 -0
- data/lib/Phamlp/sass/tree/SassDebugNode.php +84 -0
- data/lib/Phamlp/sass/tree/SassDirectiveNode.php +76 -0
- data/lib/Phamlp/sass/tree/SassElseNode.php +28 -0
- data/lib/Phamlp/sass/tree/SassExtendNode.php +47 -0
- data/lib/Phamlp/sass/tree/SassForNode.php +99 -0
- data/lib/Phamlp/sass/tree/SassIfNode.php +95 -0
- data/lib/Phamlp/sass/tree/SassImportNode.php +69 -0
- data/lib/Phamlp/sass/tree/SassMixinDefinitionNode.php +88 -0
- data/lib/Phamlp/sass/tree/SassMixinNode.php +91 -0
- data/lib/Phamlp/sass/tree/SassNode.php +342 -0
- data/lib/Phamlp/sass/tree/SassNodeExceptions.php +117 -0
- data/lib/Phamlp/sass/tree/SassPropertyNode.php +239 -0
- data/lib/Phamlp/sass/tree/SassRootNode.php +100 -0
- data/lib/Phamlp/sass/tree/SassRuleNode.php +337 -0
- data/lib/Phamlp/sass/tree/SassVariableNode.php +90 -0
- data/lib/Phamlp/sass/tree/SassWhileNode.php +64 -0
- data/lib/frontsau/assets/rack.rb +12 -0
- data/lib/frontsau/assets/sprockets.rb +59 -0
- data/lib/frontsau/assets/static_assets_compiler.rb +50 -0
- data/lib/frontsau/assets/url_rewriter.rb +22 -0
- data/lib/frontsau/assets/watcher.rb +60 -0
- data/lib/frontsau/thor_app.rb +118 -0
- data/lib/frontsau/version.rb +3 -0
- data/lib/frontsau.rb +64 -0
- metadata +578 -0
@@ -0,0 +1,90 @@
|
|
1
|
+
<?php
|
2
|
+
/* SVN FILE: $Id: SassVariableNode.php 118 2010-09-21 09:45:11Z chris.l.yates@gmail.com $ */
|
3
|
+
/**
|
4
|
+
* SassVariableNode class file.
|
5
|
+
* @author Chris Yates <chris.l.yates@gmail.com>
|
6
|
+
* @copyright Copyright (c) 2010 PBM Web Development
|
7
|
+
* @license http://phamlp.googlecode.com/files/license.txt
|
8
|
+
* @package PHamlP
|
9
|
+
* @subpackage Sass.tree
|
10
|
+
*/
|
11
|
+
|
12
|
+
/**
|
13
|
+
* SassVariableNode class.
|
14
|
+
* Represents a variable.
|
15
|
+
* @package PHamlP
|
16
|
+
* @subpackage Sass.tree
|
17
|
+
*/
|
18
|
+
class SassVariableNode extends SassNode {
|
19
|
+
const MATCH = '/^([!$])([\w-]+)\s*:?\s*((\|\|)?=)?\s*(.+?)\s*(!default)?;?$/i';
|
20
|
+
const IDENTIFIER = 1;
|
21
|
+
const NAME = 2;
|
22
|
+
const SASS_ASSIGNMENT = 3;
|
23
|
+
const SASS_DEFAULT = 4;
|
24
|
+
const VALUE = 5;
|
25
|
+
const SCSS_DEFAULT = 6;
|
26
|
+
const SASS_IDENTIFIER = '!';
|
27
|
+
const SCSS_IDENTIFIER = '$';
|
28
|
+
|
29
|
+
/**
|
30
|
+
* @var string name of the variable
|
31
|
+
*/
|
32
|
+
private $name;
|
33
|
+
/**
|
34
|
+
* @var string value of the variable or expression to evaluate
|
35
|
+
*/
|
36
|
+
private $value;
|
37
|
+
/**
|
38
|
+
* @var boolean whether the variable is optionally assigned
|
39
|
+
*/
|
40
|
+
private $isDefault;
|
41
|
+
|
42
|
+
/**
|
43
|
+
* SassVariableNode constructor.
|
44
|
+
* @param object source token
|
45
|
+
* @return SassVariableNode
|
46
|
+
*/
|
47
|
+
public function __construct($token) {
|
48
|
+
parent::__construct($token);
|
49
|
+
preg_match(self::MATCH, $token->source, $matches);
|
50
|
+
if (empty($matches[self::NAME]) || ($matches[self::VALUE] === '')) {
|
51
|
+
throw new SassVariableNodeException('Invalid variable definition; name and expression required', array(), $this);
|
52
|
+
}
|
53
|
+
$this->name = $matches[self::NAME];
|
54
|
+
$this->value = $matches[self::VALUE];
|
55
|
+
$this->isDefault = (!empty($matches[self::SASS_DEFAULT]) || !empty($matches[self::SCSS_DEFAULT]));
|
56
|
+
|
57
|
+
// Warn about deprecated features
|
58
|
+
if ($matches[self::IDENTIFIER] === self::SASS_IDENTIFIER) {
|
59
|
+
$this->addWarning('Variables prefixed with "!" is deprecated; use "${name}"', array('{name}'=>$this->name));
|
60
|
+
}
|
61
|
+
if (!empty($matches[SassVariableNode::SASS_ASSIGNMENT])) {
|
62
|
+
$this->addWarning('Setting variables with "{sassDefault}=" is deprecated; use "${name}: {value}{scssDefault}"', array('{sassDefault}'=>(!empty($matches[SassVariableNode::SASS_DEFAULT])?'||':''), '{name}'=>$this->name, '{value}'=>$this->value, '{scssDefault}'=>(!empty($matches[SassVariableNode::SASS_DEFAULT])?' !default':'')));
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
/**
|
67
|
+
* Parse this node.
|
68
|
+
* Sets the variable in the current context.
|
69
|
+
* @param SassContext the context in which this node is parsed
|
70
|
+
* @return array the parsed node - an empty array
|
71
|
+
*/
|
72
|
+
public function parse($context) {
|
73
|
+
if (!$this->isDefault || !$context->hasVariable($this->name)) {
|
74
|
+
$context->setVariable(
|
75
|
+
$this->name, $this->evaluate($this->value, $context)
|
76
|
+
);
|
77
|
+
}
|
78
|
+
$this->parseChildren($context); // Parse any warnings
|
79
|
+
return array();
|
80
|
+
}
|
81
|
+
|
82
|
+
/**
|
83
|
+
* Returns a value indicating if the token represents this type of node.
|
84
|
+
* @param object token
|
85
|
+
* @return boolean true if the token represents this type of node, false if not
|
86
|
+
*/
|
87
|
+
public static function isa($token) {
|
88
|
+
return $token->source[0] === self::SASS_IDENTIFIER || $token->source[0] === self::SCSS_IDENTIFIER;
|
89
|
+
}
|
90
|
+
}
|
@@ -0,0 +1,64 @@
|
|
1
|
+
<?php
|
2
|
+
/* SVN FILE: $Id: SassWhileNode.php 118 2010-09-21 09:45:11Z chris.l.yates@gmail.com $ */
|
3
|
+
/**
|
4
|
+
* SassWhileNode class file.
|
5
|
+
* @author Chris Yates <chris.l.yates@gmail.com>
|
6
|
+
* @copyright Copyright (c) 2010 PBM Web Development
|
7
|
+
* @license http://phamlp.googlecode.com/files/license.txt
|
8
|
+
* @package PHamlP
|
9
|
+
* @subpackage Sass.tree
|
10
|
+
*/
|
11
|
+
|
12
|
+
/**
|
13
|
+
* SassWhileNode class.
|
14
|
+
* Represents a Sass @while loop and a Sass @do loop.
|
15
|
+
* @package PHamlP
|
16
|
+
* @subpackage Sass.tree
|
17
|
+
*/
|
18
|
+
class SassWhileNode extends SassNode {
|
19
|
+
const MATCH = '/^@(do|while)\s+(.+)$/i';
|
20
|
+
const LOOP = 1;
|
21
|
+
const EXPRESSION = 2;
|
22
|
+
const IS_DO = 'do';
|
23
|
+
/**
|
24
|
+
* @var boolean whether this is a do/while.
|
25
|
+
* A do/while loop is guarenteed to run at least once.
|
26
|
+
*/
|
27
|
+
private $isDo;
|
28
|
+
/**
|
29
|
+
* @var string expression to evaluate
|
30
|
+
*/
|
31
|
+
private $expression;
|
32
|
+
|
33
|
+
/**
|
34
|
+
* SassWhileNode constructor.
|
35
|
+
* @param object source token
|
36
|
+
* @return SassWhileNode
|
37
|
+
*/
|
38
|
+
public function __construct($token) {
|
39
|
+
parent::__construct($token);
|
40
|
+
preg_match(self::MATCH, $token->source, $matches);
|
41
|
+
$this->expression = $matches[self::EXPRESSION];
|
42
|
+
$this->isDo = ($matches[self::LOOP] === SassWhileNode::IS_DO);
|
43
|
+
}
|
44
|
+
|
45
|
+
/**
|
46
|
+
* Parse this node.
|
47
|
+
* @param SassContext the context in which this node is parsed
|
48
|
+
* @return array the parsed child nodes
|
49
|
+
*/
|
50
|
+
public function parse($context) {
|
51
|
+
$children = array();
|
52
|
+
if ($this->isDo) {
|
53
|
+
do {
|
54
|
+
$children = array_merge($children, $this->parseChildren($context));
|
55
|
+
} while ($this->evaluate($this->expression, $context)->toBoolean());
|
56
|
+
}
|
57
|
+
else {
|
58
|
+
while ($this->evaluate($this->expression, $context)->toBoolean()) {
|
59
|
+
$children = array_merge($children, $this->parseChildren($context));
|
60
|
+
}
|
61
|
+
}
|
62
|
+
return $children;
|
63
|
+
}
|
64
|
+
}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
module Frontsau
|
2
|
+
module Assets
|
3
|
+
class Sprockets < ::Sprockets::Environment
|
4
|
+
attr_accessor :source_paths, :output_path
|
5
|
+
|
6
|
+
def initialize
|
7
|
+
super()
|
8
|
+
self.output_path = File.expand_path Frontsau.config[:assets][:path]
|
9
|
+
Frontsau.config[:assets][:sources].each do |glob_dir|
|
10
|
+
Dir[File.expand_path(glob_dir)].each do |dir|
|
11
|
+
append_path dir
|
12
|
+
end
|
13
|
+
end
|
14
|
+
self.register_postprocessor 'text/css', UrlRewriter
|
15
|
+
end
|
16
|
+
|
17
|
+
def manifest
|
18
|
+
m = {}
|
19
|
+
compilable_paths.each do |path|
|
20
|
+
asset = self[path]
|
21
|
+
next unless asset.present?
|
22
|
+
m[path] = {
|
23
|
+
digest: asset.digest,
|
24
|
+
modified: asset.mtime
|
25
|
+
}
|
26
|
+
end
|
27
|
+
m
|
28
|
+
end
|
29
|
+
|
30
|
+
def compilable_paths
|
31
|
+
return enum_for(:compilable_paths) unless block_given?
|
32
|
+
each_logical_path do |path|
|
33
|
+
Frontsau.config[:assets][:compile].each do |glob|
|
34
|
+
yield path if File.fnmatch(glob, path)
|
35
|
+
#puts "#{path} => #{glob} :: #{File.fnmatch(glob, path)}"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def dump path
|
41
|
+
|
42
|
+
file = File.join output_path, path
|
43
|
+
|
44
|
+
if !Dir.exist? File.dirname(file)
|
45
|
+
FileUtils.mkpath File.dirname(file)
|
46
|
+
end
|
47
|
+
|
48
|
+
begin
|
49
|
+
content = self[path].to_s
|
50
|
+
File.write file, content
|
51
|
+
return true
|
52
|
+
rescue
|
53
|
+
return false
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
module Frontsau
|
2
|
+
|
3
|
+
class StaticAssetsCompiler
|
4
|
+
def is_type type, file
|
5
|
+
filetype = File.extname file
|
6
|
+
filetype == ".#{type}"
|
7
|
+
end
|
8
|
+
|
9
|
+
def compile_coffee file
|
10
|
+
filename = File.basename file,'.*'
|
11
|
+
type = File.extname file
|
12
|
+
path = File.dirname file
|
13
|
+
input = File.read file
|
14
|
+
output = "// FILE GENERATED FROM #{filename}.coffee\n\n"+CoffeeScript.compile(input)
|
15
|
+
output_file = File.expand_path "#{filename}.js",path
|
16
|
+
File.write output_file,output
|
17
|
+
end
|
18
|
+
|
19
|
+
|
20
|
+
def compile_sass file
|
21
|
+
filename = File.basename file,'.*'
|
22
|
+
type = File.extname file
|
23
|
+
path = File.dirname file
|
24
|
+
input = File.read file
|
25
|
+
paths = Dir['plugins/*/static/css', 'vendor/bower/compass/core/stylesheets', 'vendor/bower']
|
26
|
+
output = "/* FILE GENERATED FROM #{filename}.sass */\n\n"+Sass.compile(input, syntax: :sass, load_paths: paths)
|
27
|
+
output_file = File.expand_path "#{filename}.css",path
|
28
|
+
File.write output_file,output
|
29
|
+
end
|
30
|
+
|
31
|
+
def compile_haml file
|
32
|
+
`php plugins/Room13Web/bin/haml-compiler.php #{file}`
|
33
|
+
end
|
34
|
+
|
35
|
+
def compile file, type
|
36
|
+
puts " => #{file}"
|
37
|
+
begin
|
38
|
+
send "compile_#{type}", file
|
39
|
+
rescue => e
|
40
|
+
puts ""
|
41
|
+
puts " --------------------------------------------"
|
42
|
+
puts " ERROR: "+e.message
|
43
|
+
puts " --------------------------------------------"
|
44
|
+
puts ""
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
|
50
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Frontsau
|
2
|
+
module Assets
|
3
|
+
class UrlRewriter < ::Sprockets::Processor
|
4
|
+
def evaluate(context, locals)
|
5
|
+
data.gsub /(?<=[:\s])url\(['"]?([^\s)]+\.[a-z]+)(\?\d+)?['"]?\)/i do |url|
|
6
|
+
uri = URI.parse($1)
|
7
|
+
#puts uri
|
8
|
+
next url if uri.absolute?
|
9
|
+
parts = uri.path.split '/'
|
10
|
+
# remove ../image
|
11
|
+
parts.shift
|
12
|
+
parts.shift
|
13
|
+
# add assets base path
|
14
|
+
parts.unshift Frontsau.config[:assets][:path]
|
15
|
+
rewritten_url = '/'+parts.join('/')
|
16
|
+
#puts "Rewriting #{uri.path} to #{rewritten_url}"
|
17
|
+
next "url(#{rewritten_url})"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
module Frontsau
|
2
|
+
module Assets
|
3
|
+
class Watcher
|
4
|
+
|
5
|
+
EXT_MAP = {
|
6
|
+
".haml" => ".html",
|
7
|
+
".less" => ".css",
|
8
|
+
".sass" => ".css",
|
9
|
+
".coffee" => ".js",
|
10
|
+
}
|
11
|
+
|
12
|
+
def initialize &callback
|
13
|
+
@callback = callback
|
14
|
+
@watches = Frontsau.config[:assets][:sources].map{|s| Dir[s] }.flatten.uniq
|
15
|
+
filewatcher()
|
16
|
+
end
|
17
|
+
|
18
|
+
def filewatcher
|
19
|
+
FileWatcher.new(@watches).watch do |file|
|
20
|
+
next if File.directory? file
|
21
|
+
@watches.each do |p|
|
22
|
+
if p.start_with? p
|
23
|
+
file = file.gsub "#{p}/", ""
|
24
|
+
end
|
25
|
+
file
|
26
|
+
end
|
27
|
+
ext = File.extname file
|
28
|
+
base = File.basename file, ext
|
29
|
+
dir = File.dirname file
|
30
|
+
if EXT_MAP[ext.downcase].present?
|
31
|
+
ext = EXT_MAP[ext.downcase]
|
32
|
+
end
|
33
|
+
@callback.call "#{dir}/#{base}#{ext}"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def fsevent
|
38
|
+
fsevent = FSEvent.new
|
39
|
+
opts = {
|
40
|
+
watch_root: true,
|
41
|
+
file_events: true
|
42
|
+
}
|
43
|
+
fsevent.watch @watches do |path|
|
44
|
+
puts path
|
45
|
+
end
|
46
|
+
fsevent.run
|
47
|
+
end
|
48
|
+
|
49
|
+
def inotify
|
50
|
+
notifier = INotify::Notifier.new
|
51
|
+
@watches.each do |path|
|
52
|
+
notifier.watch path do
|
53
|
+
puts "wee #{path}"
|
54
|
+
end
|
55
|
+
end
|
56
|
+
notifier.run
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,118 @@
|
|
1
|
+
module Frontsau
|
2
|
+
class ThorApp < Thor
|
3
|
+
|
4
|
+
include Thor::Actions
|
5
|
+
|
6
|
+
desc "compile", "Compiles all available assets."
|
7
|
+
def compile
|
8
|
+
say "Dumping assets:"
|
9
|
+
inside Frontsau.assets_path do
|
10
|
+
paths = Frontsau.sprockets.compilable_paths
|
11
|
+
manifest = {}
|
12
|
+
p = ProgressBar.create(
|
13
|
+
total: paths.count,
|
14
|
+
format: " %p% | %B"
|
15
|
+
)
|
16
|
+
paths.each do |path|
|
17
|
+
p.increment
|
18
|
+
begin
|
19
|
+
asset = Frontsau.sprockets[path]
|
20
|
+
data = asset.to_s
|
21
|
+
create_file path, data, force: true, verbose: false
|
22
|
+
manifest[path] = {
|
23
|
+
digest: asset.digest,
|
24
|
+
modified: asset.mtime
|
25
|
+
}
|
26
|
+
rescue Exception => e
|
27
|
+
say ""
|
28
|
+
say ""
|
29
|
+
say "#{e.class.name} ", :red
|
30
|
+
say "#{e.message}"
|
31
|
+
say ""
|
32
|
+
say ""
|
33
|
+
end
|
34
|
+
end
|
35
|
+
say ""
|
36
|
+
create_file "manifest.json", JSON.pretty_generate(manifest), force: true
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
desc "clean", "Removes all precompiled artefacts."
|
41
|
+
def clean
|
42
|
+
Dir[Frontsau.config[:assets][:path]+"/*"].each do |f|
|
43
|
+
remove_file f
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
|
48
|
+
desc "watch", "Watches for filechanges and compiles to the asset path immediatly."
|
49
|
+
def watch
|
50
|
+
compile
|
51
|
+
say "Watching for asset changes:"
|
52
|
+
Frontsau::Assets::Watcher.new do |path|
|
53
|
+
begin
|
54
|
+
asset = Frontsau.sprockets[path]
|
55
|
+
create_file path, asset.to_s, force: true, verbose: true
|
56
|
+
rescue Exception => e
|
57
|
+
say ""
|
58
|
+
say ""
|
59
|
+
say "#{e.class.name} ", :red
|
60
|
+
say "#{e.message}"
|
61
|
+
say ""
|
62
|
+
say ""
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
|
68
|
+
desc "debug WHAT", "Dump all logical asset paths to the console."
|
69
|
+
def debug what = "all"
|
70
|
+
puts ""
|
71
|
+
if what == "all"
|
72
|
+
Frontsau.sprockets.each_logical_path do |path|
|
73
|
+
puts " #{path}"
|
74
|
+
end
|
75
|
+
elsif
|
76
|
+
Frontsau.sprockets.compilable_paths.each do |path|
|
77
|
+
puts " #{path}"
|
78
|
+
end
|
79
|
+
end
|
80
|
+
puts ""
|
81
|
+
end
|
82
|
+
|
83
|
+
desc "server", "Starts a local assets server."
|
84
|
+
def server
|
85
|
+
app = Rack::Builder.new do
|
86
|
+
use Rack::CommonLogger
|
87
|
+
use Rack::ShowExceptions
|
88
|
+
use Rack::Cors do
|
89
|
+
allow do
|
90
|
+
origins '*'
|
91
|
+
resource '*'
|
92
|
+
end
|
93
|
+
end
|
94
|
+
map "/" do
|
95
|
+
run Frontsau::Assets::Rack.new
|
96
|
+
end
|
97
|
+
map "/#{Frontsau.config[:assets][:path]}" do
|
98
|
+
run Frontsau.sprockets
|
99
|
+
end
|
100
|
+
end
|
101
|
+
Rack::Handler::WEBrick.run app, :Port => 9292
|
102
|
+
end
|
103
|
+
|
104
|
+
desc "haml", "Compiles a phampl template."
|
105
|
+
def haml input
|
106
|
+
if !File.exist? input
|
107
|
+
raise "Input file does not exist!"
|
108
|
+
end
|
109
|
+
path = File.dirname input
|
110
|
+
name = File.basename input, '.haml'
|
111
|
+
tool_root = File.dirname(File.dirname(File.dirname(__FILE__)))
|
112
|
+
cmd = File.join(tool_root,"bin/frontsau-phaml-compiler")
|
113
|
+
html = `#{cmd} '#{input}'`
|
114
|
+
output = File.join(path,"#{name}.php")
|
115
|
+
File.write output, html
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
data/lib/frontsau.rb
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
require 'filewatcher'
|
2
|
+
require 'pry'
|
3
|
+
require 'pathname'
|
4
|
+
require 'uri'
|
5
|
+
|
6
|
+
require 'rack'
|
7
|
+
require 'rack/cors'
|
8
|
+
require 'sinatra/base'
|
9
|
+
require 'sinatra/json'
|
10
|
+
|
11
|
+
require 'sprockets'
|
12
|
+
require 'tilt'
|
13
|
+
require 'coffee-script'
|
14
|
+
require 'sass'
|
15
|
+
require 'less'
|
16
|
+
|
17
|
+
require 'frontsau/version'
|
18
|
+
require 'frontsau/assets/sprockets'
|
19
|
+
require 'frontsau/assets/url_rewriter'
|
20
|
+
require 'frontsau/assets/rack'
|
21
|
+
require 'frontsau/assets/watcher'
|
22
|
+
require 'ruby-progressbar'
|
23
|
+
|
24
|
+
require 'rb-fsevent'
|
25
|
+
#require 'rb-inotify'
|
26
|
+
require 'filewatcher'
|
27
|
+
|
28
|
+
module Frontsau
|
29
|
+
|
30
|
+
mattr_accessor :config
|
31
|
+
mattr_accessor :root_path
|
32
|
+
mattr_accessor :sprockets
|
33
|
+
|
34
|
+
def self.init root_path
|
35
|
+
|
36
|
+
# define project root
|
37
|
+
self.root_path = root_path
|
38
|
+
|
39
|
+
# load configuration
|
40
|
+
config_file = File.expand_path '.frontsau'
|
41
|
+
raise "No .frontsau found in #{root_path}!" unless File.exists? config_file
|
42
|
+
raw_config = YAML.load File.read config_file
|
43
|
+
self.config = ActiveSupport::HashWithIndifferentAccess.new raw_config['frontsau']
|
44
|
+
|
45
|
+
|
46
|
+
#Sprockets::Engines
|
47
|
+
#Sprockets.register_engine '.haml', Tilt::HamlTemplate
|
48
|
+
|
49
|
+
|
50
|
+
# initialize sprockets
|
51
|
+
self.sprockets = Frontsau::Assets::Sprockets.new
|
52
|
+
sprockets.cache = Sprockets::Cache::FileStore.new(config[:assets][:cache])
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
def self.assets_path
|
57
|
+
config[:assets][:path]
|
58
|
+
end
|
59
|
+
|
60
|
+
def self.asset_path path
|
61
|
+
assets_path+path
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|