frontsau 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (280) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +16 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE +21 -0
  5. data/README.md +30 -0
  6. data/Rakefile +2 -0
  7. data/bin/frontsau +15 -0
  8. data/bin/frontsau-phaml-compiler +35 -0
  9. data/example/.frontsau +12 -0
  10. data/example/assets/head.jpg +0 -0
  11. data/example/assets/script.js +4 -0
  12. data/example/assets/style.css +6 -0
  13. data/example/css/includes.sass +2 -0
  14. data/example/css/style.sass +6 -0
  15. data/example/image/head.jpg +0 -0
  16. data/example/index.html +0 -0
  17. data/example/js/script.coffee +1 -0
  18. data/frontsau.gemspec +41 -0
  19. data/lib/Phamlp/Phamlp.php +72 -0
  20. data/lib/Phamlp/PhamlpException.php +31 -0
  21. data/lib/Phamlp/haml/HamlException.php +29 -0
  22. data/lib/Phamlp/haml/HamlHelpers.php +199 -0
  23. data/lib/Phamlp/haml/HamlParser.php +1250 -0
  24. data/lib/Phamlp/haml/filters/HamlBaseFilter.php +30 -0
  25. data/lib/Phamlp/haml/filters/HamlCdataFilter.php +29 -0
  26. data/lib/Phamlp/haml/filters/HamlCssFilter.php +30 -0
  27. data/lib/Phamlp/haml/filters/HamlEscapedFilter.php +32 -0
  28. data/lib/Phamlp/haml/filters/HamlJavascriptFilter.php +31 -0
  29. data/lib/Phamlp/haml/filters/HamlPhpFilter.php +27 -0
  30. data/lib/Phamlp/haml/filters/HamlPlainFilter.php +28 -0
  31. data/lib/Phamlp/haml/filters/HamlPreserveFilter.php +29 -0
  32. data/lib/Phamlp/haml/filters/HamlSassFilter.php +37 -0
  33. data/lib/Phamlp/haml/filters/HamlScssFilter.php +37 -0
  34. data/lib/Phamlp/haml/filters/_HamlMarkdownFilter.php +50 -0
  35. data/lib/Phamlp/haml/filters/_HamlTextileFilter.php +50 -0
  36. data/lib/Phamlp/haml/messages/_i18n.php +32 -0
  37. data/lib/Phamlp/haml/messages/de.php +32 -0
  38. data/lib/Phamlp/haml/messages/fr.php +32 -0
  39. data/lib/Phamlp/haml/renderers/HamlCompactRenderer.php +32 -0
  40. data/lib/Phamlp/haml/renderers/HamlCompressedRenderer.php +48 -0
  41. data/lib/Phamlp/haml/renderers/HamlExpandedRenderer.php +58 -0
  42. data/lib/Phamlp/haml/renderers/HamlNestedRenderer.php +77 -0
  43. data/lib/Phamlp/haml/renderers/HamlRenderer.php +137 -0
  44. data/lib/Phamlp/haml/tree/HamlCodeBlockNode.php +58 -0
  45. data/lib/Phamlp/haml/tree/HamlCommentNode.php +41 -0
  46. data/lib/Phamlp/haml/tree/HamlDoctypeNode.php +27 -0
  47. data/lib/Phamlp/haml/tree/HamlElementNode.php +52 -0
  48. data/lib/Phamlp/haml/tree/HamlFilterNode.php +50 -0
  49. data/lib/Phamlp/haml/tree/HamlHelperNode.php +73 -0
  50. data/lib/Phamlp/haml/tree/HamlNode.php +253 -0
  51. data/lib/Phamlp/haml/tree/HamlNodeExceptions.php +19 -0
  52. data/lib/Phamlp/haml/tree/HamlRootNode.php +58 -0
  53. data/lib/Phamlp/sass/SassException.php +29 -0
  54. data/lib/Phamlp/sass/SassFile.php +164 -0
  55. data/lib/Phamlp/sass/SassParser.php +848 -0
  56. data/lib/Phamlp/sass/extensions/compass/config.php +65 -0
  57. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/_blueprint.scss +47 -0
  58. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_buttons.scss +101 -0
  59. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_colors.scss +32 -0
  60. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_debug.scss +11 -0
  61. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_fancy-type.scss +86 -0
  62. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_form.scss +68 -0
  63. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_grid.scss +249 -0
  64. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_ie.scss +109 -0
  65. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_interaction.scss +57 -0
  66. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_link-icons.scss +37 -0
  67. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_liquid.scss +147 -0
  68. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_print.scss +93 -0
  69. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_reset.scss +3 -0
  70. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_rtl.scss +133 -0
  71. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_scaffolding.scss +54 -0
  72. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_typography.scss +104 -0
  73. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_utilities.scss +37 -0
  74. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/reset/_utilities.scss +58 -0
  75. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/basic/grid.png +0 -0
  76. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/basic/ie.sass +4 -0
  77. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/basic/manifest.rb +30 -0
  78. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/basic/partials/_base.sass +10 -0
  79. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/basic/print.sass +4 -0
  80. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/basic/screen.sass +12 -0
  81. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/buttons/buttons/cross.png +0 -0
  82. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/buttons/buttons/key.png +0 -0
  83. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/buttons/buttons/tick.png +0 -0
  84. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/buttons/buttons.sass +49 -0
  85. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/buttons/manifest.rb +17 -0
  86. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/doc.png +0 -0
  87. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/email.png +0 -0
  88. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/external.png +0 -0
  89. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/feed.png +0 -0
  90. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/im.png +0 -0
  91. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/pdf.png +0 -0
  92. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/visited.png +0 -0
  93. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/xls.png +0 -0
  94. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons.sass +13 -0
  95. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/manifest.rb +23 -0
  96. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/project/grid.png +0 -0
  97. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/project/ie.sass +16 -0
  98. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/project/manifest.rb +30 -0
  99. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/project/partials/_base.sass +11 -0
  100. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/project/print.sass +8 -0
  101. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/project/screen.sass +45 -0
  102. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/grid.png +0 -0
  103. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/ie.sass +16 -0
  104. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/manifest.rb +33 -0
  105. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/partials/_base.sass +10 -0
  106. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/partials/_form.sass +6 -0
  107. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/partials/_page.sass +18 -0
  108. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/partials/_two_col.sass +38 -0
  109. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/print.sass +5 -0
  110. data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/screen.sass +14 -0
  111. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/_compass.scss +2 -0
  112. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/_css3.scss +15 -0
  113. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/_layout.scss +1 -0
  114. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/_reset.scss +3 -0
  115. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/_utilities.scss +6 -0
  116. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_background-clip.scss +43 -0
  117. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_background-origin.scss +42 -0
  118. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_background-size.scss +14 -0
  119. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_border-radius.scss +135 -0
  120. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_box-shadow.scss +50 -0
  121. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_box-sizing.scss +13 -0
  122. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_box.scss +112 -0
  123. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_columns.scss +55 -0
  124. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_font-face.scss +33 -0
  125. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_gradient.scss +82 -0
  126. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_inline-block.scss +12 -0
  127. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_opacity.scss +27 -0
  128. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_shared.scss +47 -0
  129. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_text-shadow.scss +25 -0
  130. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_transform.scss +85 -0
  131. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_transition.scss +85 -0
  132. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/layout/_sticky-footer.scss +23 -0
  133. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/reset/_utilities.scss +133 -0
  134. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/_general.scss +6 -0
  135. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/_links.scss +3 -0
  136. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/_lists.scss +4 -0
  137. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/_print.scss +17 -0
  138. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/_sprites.scss +1 -0
  139. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/_tables.scss +3 -0
  140. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/_text.scss +3 -0
  141. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss +31 -0
  142. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/general/_float.scss +15 -0
  143. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/general/_hacks.scss +35 -0
  144. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/general/_min.scss +16 -0
  145. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/general/_reset.scss +2 -0
  146. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/general/_tabs.scss +1 -0
  147. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/general/_tag-cloud.scss +18 -0
  148. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/links/_hover-link.scss +5 -0
  149. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/links/_link-colors.scss +28 -0
  150. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/links/_unstyled-link.scss +7 -0
  151. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/lists/_bullets.scss +34 -0
  152. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/lists/_horizontal-list.scss +52 -0
  153. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/lists/_inline-block-list.scss +47 -0
  154. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/lists/_inline-list.scss +29 -0
  155. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/sprites/_sprite-img.scss +56 -0
  156. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/tables/_alternating-rows-and-columns.scss +20 -0
  157. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/tables/_borders.scss +27 -0
  158. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/tables/_scaffolding.scss +9 -0
  159. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/text/_ellipsis.scss +25 -0
  160. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/text/_nowrap.scss +2 -0
  161. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/text/_replacement.scss +34 -0
  162. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/ellipsis/ellipsis.sass +9 -0
  163. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/ellipsis/manifest.rb +27 -0
  164. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/ellipsis/xml/ellipsis.xml +14 -0
  165. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/extension/manifest.rb +20 -0
  166. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/extension/stylesheets/main.sass +1 -0
  167. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/extension/templates/project/manifest.rb +2 -0
  168. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/extension/templates/project/screen.sass +2 -0
  169. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/project/USAGE.markdown +32 -0
  170. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/project/ie.sass +6 -0
  171. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/project/manifest.rb +4 -0
  172. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/project/print.sass +6 -0
  173. data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/project/screen.sass +7 -0
  174. data/lib/Phamlp/sass/extensions/compass/functions/colourStops.php +268 -0
  175. data/lib/Phamlp/sass/extensions/compass/functions/constants.php +44 -0
  176. data/lib/Phamlp/sass/extensions/compass/functions/fontFiles.php +30 -0
  177. data/lib/Phamlp/sass/extensions/compass/functions/imageSize.php +39 -0
  178. data/lib/Phamlp/sass/extensions/compass/functions/inlineData.php +84 -0
  179. data/lib/Phamlp/sass/extensions/compass/functions/lists.php +47 -0
  180. data/lib/Phamlp/sass/extensions/compass/functions/selectors.php +128 -0
  181. data/lib/Phamlp/sass/extensions/compass/functions/urls.php +143 -0
  182. data/lib/Phamlp/sass/extensions/compass/stylesheets/_compass.scss +2 -0
  183. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/_css3.scss +15 -0
  184. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/_layout.scss +1 -0
  185. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/_reset.scss +3 -0
  186. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/_utilities.scss +6 -0
  187. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_background-clip.scss +43 -0
  188. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_background-origin.scss +42 -0
  189. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_background-size.scss +14 -0
  190. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_border-radius.scss +135 -0
  191. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_box-shadow.scss +50 -0
  192. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_box-sizing.scss +13 -0
  193. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_box.scss +112 -0
  194. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_columns.scss +55 -0
  195. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_font-face.scss +33 -0
  196. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_gradient.scss +96 -0
  197. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_inline-block.scss +12 -0
  198. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_opacity.scss +27 -0
  199. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_shared.scss +47 -0
  200. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_text-shadow.scss +25 -0
  201. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_transform.scss +85 -0
  202. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_transition.scss +85 -0
  203. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/layout/_sticky-footer.scss +23 -0
  204. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/reset/_utilities.scss +133 -0
  205. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/_general.scss +6 -0
  206. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/_links.scss +3 -0
  207. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/_lists.scss +4 -0
  208. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/_print.scss +17 -0
  209. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/_sprites.scss +1 -0
  210. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/_tables.scss +3 -0
  211. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/_text.scss +3 -0
  212. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/general/_clearfix.scss +31 -0
  213. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/general/_float.scss +15 -0
  214. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/general/_hacks.scss +35 -0
  215. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/general/_min.scss +16 -0
  216. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/general/_reset.scss +2 -0
  217. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/general/_tabs.scss +1 -0
  218. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/general/_tag-cloud.scss +18 -0
  219. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/links/_hover-link.scss +5 -0
  220. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/links/_link-colors.scss +28 -0
  221. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/links/_unstyled-link.scss +7 -0
  222. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/lists/_bullets.scss +34 -0
  223. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/lists/_horizontal-list.scss +52 -0
  224. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/lists/_inline-block-list.scss +47 -0
  225. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/lists/_inline-list.scss +29 -0
  226. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/sprites/_sprite-img.scss +56 -0
  227. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/tables/_alternating-rows-and-columns.scss +20 -0
  228. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/tables/_borders.scss +27 -0
  229. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/tables/_scaffolding.scss +9 -0
  230. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/text/_ellipsis.scss +25 -0
  231. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/text/_nowrap.scss +2 -0
  232. data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/text/_replacement.scss +34 -0
  233. data/lib/Phamlp/sass/messages/_i18n.php +122 -0
  234. data/lib/Phamlp/sass/messages/de.php +70 -0
  235. data/lib/Phamlp/sass/messages/fr.php +70 -0
  236. data/lib/Phamlp/sass/renderers/SassCompactRenderer.php +130 -0
  237. data/lib/Phamlp/sass/renderers/SassCompressedRenderer.php +102 -0
  238. data/lib/Phamlp/sass/renderers/SassExpandedRenderer.php +62 -0
  239. data/lib/Phamlp/sass/renderers/SassNestedRenderer.php +61 -0
  240. data/lib/Phamlp/sass/renderers/SassRenderer.php +51 -0
  241. data/lib/Phamlp/sass/script/SassScriptFunction.php +169 -0
  242. data/lib/Phamlp/sass/script/SassScriptFunctions.php +751 -0
  243. data/lib/Phamlp/sass/script/SassScriptLexer.php +114 -0
  244. data/lib/Phamlp/sass/script/SassScriptOperation.php +151 -0
  245. data/lib/Phamlp/sass/script/SassScriptParser.php +192 -0
  246. data/lib/Phamlp/sass/script/SassScriptParserExceptions.php +40 -0
  247. data/lib/Phamlp/sass/script/SassScriptVariable.php +57 -0
  248. data/lib/Phamlp/sass/script/literals/SassBoolean.php +67 -0
  249. data/lib/Phamlp/sass/script/literals/SassColour.php +886 -0
  250. data/lib/Phamlp/sass/script/literals/SassLiteral.php +359 -0
  251. data/lib/Phamlp/sass/script/literals/SassLiteralExceptions.php +47 -0
  252. data/lib/Phamlp/sass/script/literals/SassNumber.php +503 -0
  253. data/lib/Phamlp/sass/script/literals/SassString.php +106 -0
  254. data/lib/Phamlp/sass/tree/SassCommentNode.php +64 -0
  255. data/lib/Phamlp/sass/tree/SassContext.php +120 -0
  256. data/lib/Phamlp/sass/tree/SassDebugNode.php +84 -0
  257. data/lib/Phamlp/sass/tree/SassDirectiveNode.php +76 -0
  258. data/lib/Phamlp/sass/tree/SassElseNode.php +28 -0
  259. data/lib/Phamlp/sass/tree/SassExtendNode.php +47 -0
  260. data/lib/Phamlp/sass/tree/SassForNode.php +99 -0
  261. data/lib/Phamlp/sass/tree/SassIfNode.php +95 -0
  262. data/lib/Phamlp/sass/tree/SassImportNode.php +69 -0
  263. data/lib/Phamlp/sass/tree/SassMixinDefinitionNode.php +88 -0
  264. data/lib/Phamlp/sass/tree/SassMixinNode.php +91 -0
  265. data/lib/Phamlp/sass/tree/SassNode.php +342 -0
  266. data/lib/Phamlp/sass/tree/SassNodeExceptions.php +117 -0
  267. data/lib/Phamlp/sass/tree/SassPropertyNode.php +239 -0
  268. data/lib/Phamlp/sass/tree/SassRootNode.php +100 -0
  269. data/lib/Phamlp/sass/tree/SassRuleNode.php +337 -0
  270. data/lib/Phamlp/sass/tree/SassVariableNode.php +90 -0
  271. data/lib/Phamlp/sass/tree/SassWhileNode.php +64 -0
  272. data/lib/frontsau/assets/rack.rb +12 -0
  273. data/lib/frontsau/assets/sprockets.rb +59 -0
  274. data/lib/frontsau/assets/static_assets_compiler.rb +50 -0
  275. data/lib/frontsau/assets/url_rewriter.rb +22 -0
  276. data/lib/frontsau/assets/watcher.rb +60 -0
  277. data/lib/frontsau/thor_app.rb +118 -0
  278. data/lib/frontsau/version.rb +3 -0
  279. data/lib/frontsau.rb +64 -0
  280. metadata +578 -0
@@ -0,0 +1,268 @@
1
+ <?php
2
+ /* SVN FILE: $Id: SassBoolean.php 49 2010-04-04 10:51:24Z chris.l.yates $ */
3
+ /**
4
+ * Compass extension SassScript colour stop objects and functions 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.extensions.compass.functions
10
+ */
11
+
12
+ /**
13
+ * Compass extension List object.
14
+ * @package PHamlP
15
+ * @subpackage Sass.extensions.compass.functions
16
+ */
17
+ class CompassList extends SassLiteral {
18
+ public function __construct($values) {
19
+ $this->value = $values;
20
+ }
21
+
22
+ public function getValues() {
23
+ return $this->value;
24
+ }
25
+
26
+ /**
27
+ * Returns the type of this
28
+ * @return string the type of this
29
+ */
30
+ protected function getTypeOf() {
31
+ return 'list';
32
+ }
33
+
34
+ public function toString() {
35
+ $values = array();
36
+ foreach ($this->value as $value) {
37
+ $values[] = $value->toString();
38
+ }
39
+ return join(', ', $values);
40
+ }
41
+
42
+ public static function isa($subject) {}
43
+ }
44
+
45
+ class CompassColourStop extends SassLiteral {
46
+ private $colour;
47
+ public $stop;
48
+
49
+ public function __construct($colour, $stop = null) {
50
+ $this->colour = $colour;
51
+ $this->stop = $stop;
52
+ }
53
+
54
+ protected function getColor() {
55
+ return $this->getColour();
56
+ }
57
+
58
+ protected function getColour() {
59
+ return $this->colour;
60
+ }
61
+
62
+ public function toString() {
63
+ $s = $this->colour->toString();
64
+ if (!empty($this->stop)) {
65
+ $s .= ' ';
66
+ if ($this->stop->isUnitless()) {
67
+ $s .= $this->stop->op_times(new SassNumber('100%'))->toString();
68
+ }
69
+ else {
70
+ $s .= $this->stop->toString();
71
+ }
72
+ }
73
+ return $s;
74
+ }
75
+
76
+ public static function isa($subject) {}
77
+ }
78
+
79
+ /**
80
+ * Compass extension SassScript colour stops functions class.
81
+ * A collection of functions for use in SassSCript.
82
+ * @package PHamlP
83
+ * @subpackage Sass.extensions.compass.functions
84
+ */
85
+ class SassExtentionsCompassFunctionsColourStops {
86
+ # returns color-stop() calls for use in webkit.
87
+ public static function grad_color_stops($colour_list) {
88
+ return self::grad_colour_stops($colour_list);
89
+ }
90
+
91
+ public static function grad_colour_stops($colour_list) {
92
+ SassLiteral::assertType($colour_list, 'CompassList');
93
+ self::normalize_stops($colour_list);
94
+ $v = array_reverse($colour_list->values);
95
+ $max = $v[0]->stop;
96
+ $last_value = null;
97
+
98
+ $colourStops = array();
99
+
100
+ foreach ($colour_list->values as $pos) {
101
+ # have to convert absolute units to percentages for use in colour stop functions.
102
+ $stop = $pos->stop;
103
+ if ($stop->numeratorUnits === $max->numeratorUnits) {
104
+ $stop = $stop->op_div($max)->op_times(new SassNumber('100%'));
105
+ }
106
+ # Make sure the colour stops are specified in the right order.
107
+ if ($last_value && $last_value->value > $stop->value) {
108
+ throw new SassScriptFunctionException('Colour stops must be specified in increasing order', array(), SassScriptParser::$context->node);
109
+ }
110
+
111
+ $last_value = $stop;
112
+ $colourStops[] = "colour-stop({$stop->toString()}, {$pos->colour->toString()})";
113
+ }
114
+
115
+ return new SassString(join(', ', $colourStops));
116
+ }
117
+
118
+ # returns the end position of the gradient from the colour stop
119
+ public static function grad_end_position($colourList, $radial = null) {
120
+ SassLiteral::assertType($colourList, 'CompassList');
121
+ if (is_null($radial)) {
122
+ $radial = new SassBoolean(false);
123
+ }
124
+ else {
125
+ SassLiteral::assertType($radial, 'SassBoolean');
126
+ }
127
+ return self::grad_position($colourList, new SassNumber(sizeof($colourList->values)), new SassNumber(100), $radial);
128
+ }
129
+
130
+ public static function grad_position($colourList, $index, $default, $radial = null) {
131
+ SassLiteral::assertType($colourList, 'CompassList');
132
+ if (is_null($radial)) {
133
+ $radial = new SassBoolean(false);
134
+ }
135
+ else {
136
+ SassLiteral::assertType($radial, 'SassBoolean');
137
+ }
138
+ $stop = $colourList->values[$index->value - 1]->stop;
139
+ if ($stop && $radial->value) {
140
+ $orig_stop = $stop;
141
+ if ($stop->isUnitless()) {
142
+ if ($stop->value <= 1) {
143
+ # A unitless number is assumed to be a percentage when it's between 0 and 1
144
+ $stop = $stop->op_times(new SassNumber('100%'));
145
+ }
146
+ else {
147
+ # Otherwise, a unitless number is assumed to be in pixels
148
+ $stop = $stop->op_times(new SassNumber('1px'));
149
+ }
150
+ }
151
+
152
+ if ($stop->numeratorUnits === '%' && isset($colourList->values[sizeof($colourList->values)-1]->stop) && $colourList->values[sizeof($colourList->values)-1]->stop->numeratorUnits === 'px')
153
+ $stop = $stop->op_times($colourList->values[sizeof($colourList->values)-1]->stop)->op_div(new SassNumber('100%'));
154
+ //Compass::Logger.new.record(:warning, "Webkit only supports pixels for the start and end stops for radial gradients. Got: #{orig_stop}") if stop.numerator_units != ["px"];
155
+ return $stop->op_div(new SassNumber('1'.$stop->units));
156
+ }
157
+ elseif ($stop)
158
+ return $stop;
159
+ else
160
+ return $default;
161
+ }
162
+
163
+ # takes the given position and returns a point in percentages
164
+ public static function grad_point($position) {
165
+ $position = $position->value;
166
+ if (strpos($position, ' ') !== false) {
167
+ if (preg_match('/(top|bottom|center) (left|right|center)/', $position, $matches))
168
+ $position = "{$matches[2]} {$matches[1]}";
169
+ }
170
+ else {
171
+ switch ($position) {
172
+ case 'top':
173
+ case 'bottom':
174
+ $position = "left $position";
175
+ break;
176
+ case 'left':
177
+ case 'right':
178
+ $position .= ' top';
179
+ break;
180
+ }
181
+ }
182
+
183
+ return new SassString(preg_replace(
184
+ array('/top/', '/bottom/', '/left/', '/right/', '/center/'),
185
+ array('0%', '100%', '0%', '100%', '50%'), $position
186
+ ));
187
+ }
188
+
189
+ public static function color_stops() {
190
+ return self::colour_stops(func_get_args());
191
+ }
192
+
193
+ public static function colour_stops() {
194
+ $args = func_get_args();
195
+ $list = array();
196
+
197
+ foreach ($args as $arg) {
198
+ if ($arg instanceof SassColour) {
199
+ $list[] = new CompassColourStop($arg);
200
+ }
201
+ elseif ($arg instanceof SassString) {
202
+ # We get a string as the result of concatenation
203
+ # So we have to reparse the expression
204
+ $colour = $stop = null;
205
+ if (empty($parser))
206
+ $parser = new SassScriptParser();
207
+ $expr = $parser->parse($arg->value, SassScriptParser::$context);
208
+
209
+ $x = array_pop($expr);
210
+
211
+ if ($x instanceof SassColour)
212
+ $colour = $x;
213
+ elseif ($x instanceof SassScriptOperation) {
214
+ if ($x->operator != 'concat')
215
+ # This should never happen.
216
+ throw new SassScriptFunctionException("Couldn't parse a colour stop from: {value}", array('{value}'=>$arg->value), SassScriptParser::$context->node);
217
+ $colour = $expr[0];
218
+ $stop = $expr[1];
219
+ }
220
+ else
221
+ throw new SassScriptFunctionException("Couldn't parse a colour stop from: {value}", array('{value}'=>$arg->value), SassScriptParser::$context->node);
222
+ $list[] = new CompassColourStop($colour, $stop);
223
+ }
224
+ else
225
+ throw new SassScriptFunctionException('Not a valid color stop: {arg}', array('{arg}'=>$arg->value), SassScriptParser::$context->node);
226
+ }
227
+ return new CompassList($list);
228
+ }
229
+
230
+ private static function normalize_stops($colourList) {
231
+ $positions = $colourList->values;
232
+ $s = sizeof($positions);
233
+
234
+ # fill in the start and end positions, if unspecified
235
+ if (empty($positions[0]->stop))
236
+ $positions[0]->stop = new SassNumber(0);
237
+ if (empty($positions[$s-1]->stop))
238
+ $positions[$s-1]->stop = new SassNumber('100%');
239
+
240
+ # fill in empty values
241
+ for ($i = 0; $i<$s; $i++) {
242
+ if (is_null($positions[$i]->stop)) {
243
+ $num = 2;
244
+ for ($j = $i+1; $j<$s; $j++) {
245
+ if (isset($positions[$j]->stop)) {
246
+ $positions[$i]->stop = $positions[$i-1]->stop->op_plus($positions[$j]->stop->op_minus($positions[$i-1]->stop))->op_div(new SassNumber($num));
247
+ break;
248
+ }
249
+ else
250
+ $num += 1;
251
+ }
252
+ }
253
+ }
254
+ # normalize unitless numbers
255
+ foreach ($positions as &$pos) {
256
+ if ($pos->stop->isUnitless()) {
257
+ $pos->stop = ($pos->stop->value <= 1 ?
258
+ $pos->stop->op_times(new SassNumber('100%')) :
259
+ $pos->stop->op_times(new SassNumber('1px'))
260
+ );
261
+ }
262
+ }
263
+ if ($positions[$s-1]->stop->op_eq(new SassNumber('0px'))->toBoolean() ||
264
+ $positions[$s-1]->stop->op_eq(new SassNumber('0%'))->toBoolean())
265
+ throw new SassScriptFunctionException('Colour stops must be specified in increasing order', array(), SassScriptParser::$context->node);
266
+ return null;
267
+ }
268
+ }
@@ -0,0 +1,44 @@
1
+ <?php
2
+ /* SVN FILE: $Id: SassBoolean.php 49 2010-04-04 10:51:24Z chris.l.yates $ */
3
+ /**
4
+ * Compass extension SassScript constants functions 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.extensions.compass.functions
10
+ */
11
+
12
+ /**
13
+ * Compass extension SassScript constants functions class.
14
+ * A collection of functions for use in SassSCript.
15
+ * @package PHamlP
16
+ * @subpackage Sass.extensions.compass.functions
17
+ */
18
+ class SassExtentionsCompassFunctionsConstants {
19
+ public static function opposite_position($pos) {
20
+ $opposites = array();
21
+ foreach (explode(' ', $pos->toString()) as $position) {
22
+ switch (trim($position)) {
23
+ case 'top':
24
+ $opposites[] = 'bottom';
25
+ break;
26
+ case 'right':
27
+ $opposites[] = 'left';
28
+ break;
29
+ case 'bottom':
30
+ $opposites[] = 'top';
31
+ break;
32
+ case 'left':
33
+ $opposites[] = 'right';
34
+ break;
35
+ case 'center':
36
+ $opposites[] = 'center';
37
+ break;
38
+ default:
39
+ throw new Exception('Cannot determine the opposite of '.trim($position));
40
+ }
41
+ }
42
+ return new SassString(join(' ', $opposites));
43
+ }
44
+ }
@@ -0,0 +1,30 @@
1
+ <?php
2
+ /* SVN FILE: $Id: SassBoolean.php 49 2010-04-04 10:51:24Z chris.l.yates $ */
3
+ /**
4
+ * Compass extension SassScript font files functions 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.extensions.compass.functions
10
+ */
11
+
12
+ /**
13
+ * Compass extension SassScript font files functions class.
14
+ * A collection of functions for use in SassSCript.
15
+ * @package PHamlP
16
+ * @subpackage Sass.extensions.compass.functions
17
+ */
18
+ class SassExtentionsCompassFunctionsFontFiles {
19
+ public function font_files() {
20
+ if (func_num_args() % 2)
21
+ throw new SassScriptFunctionException('An even number of arguments must be passed to font_files()', array(), SassScriptParser::$context->node);
22
+
23
+ $args = func_get_args();
24
+ $files = array();
25
+ while ($args) {
26
+ $files[] = '#{font_url('.array_shift($args)."} format('".array_shift($args)."')";
27
+ }
28
+ return new SassString(join(", ", $files));
29
+ }
30
+ }
@@ -0,0 +1,39 @@
1
+ <?php
2
+ /* SVN FILE: $Id: SassBoolean.php 49 2010-04-04 10:51:24Z chris.l.yates $ */
3
+ /**
4
+ * Compass extension SassScript image size functions 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.extensions.compass.functions
10
+ */
11
+
12
+ /**
13
+ * Compass extension SassScript image size functions class.
14
+ * A collection of functions for use in SassSCript.
15
+ * @package PHamlP
16
+ * @subpackage Sass.extensions.compass.functions
17
+ */
18
+ class SassExtentionsCompassFunctionsImageSize {
19
+ # Returns the $width of the image relative to the images directory
20
+ public function image_width($image_file) {
21
+ $image_size = getimagesize(self::real_path($image_file));
22
+ return new SassNumber($image_size[0].'px');
23
+ }
24
+
25
+ # Returns the height of the image relative to the images directory
26
+ public function image_height($image_file) {
27
+ $image_size = getimagesize(self::real_path($image_file));
28
+ return new SassNumber($image_size[1].'px');
29
+ }
30
+
31
+ private function real_path($image_file) {
32
+ $path = $image_file->value;
33
+ # Compute the real path to the image on the file stystem if the images_dir is set.
34
+ if (SassExtentionsCompassConfig::config('images_path'))
35
+ return SassExtentionsCompassConfig::config('images_path').DIRECTORY_SEPARATOR.$path;
36
+ else
37
+ return SassExtentionsCompassConfig::config('project_path').DIRECTORY_SEPARATOR.$path;
38
+ }
39
+ }
@@ -0,0 +1,84 @@
1
+ <?php
2
+ /* SVN FILE: $Id: SassBoolean.php 49 2010-04-04 10:51:24Z chris.l.yates $ */
3
+ /**
4
+ * Compass extension SassScript inline data 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.extensions.compass.functions
10
+ */
11
+
12
+ /**
13
+ * Compass extension SassScript inline data functions class.
14
+ * A collection of functions for use in SassSCript.
15
+ * @package PHamlP
16
+ * @subpackage Sass.extensions.compass.functions
17
+ */
18
+ class SassExtentionsCompassFunctionsInlineData {
19
+ public function inline_image($path, $mime_type = null) {
20
+ $path = $path->value;
21
+ $real_path = SassExtentionsCompassConfig::config('images_path').DIRECTORY_SEPARATOR.$path;
22
+ $url = 'url(data:'.self::compute_mime_type($path, $mime_type).';base64,'.self::data($real_path).')';
23
+ return new SassString($url);
24
+ }
25
+
26
+ public function inline_font_files() {
27
+ if (func_num_args() % 2)
28
+ throw new SassScriptFunctionException('An even number of arguments must be passed to inline_font_files()', array(), SassScriptParser::$context->node);
29
+
30
+ $args = func_get_args();
31
+ $files = array();
32
+ while ($args) {
33
+ $path = array_shift($args);
34
+ $real_path = SassExtentionsCompassConfig::config('fonts_path').DIRECTORY_SEPARATOR.$path->value;
35
+ $fp = fopen($real_path, 'rb');
36
+ $url = 'url(data:'.self::compute_mime_type($path).';base64,'.self::data($real_path).')';
37
+ $files[] = "$url format('".array_shift($args)."')";
38
+ }
39
+ return new SassString(join(", ", $files));
40
+ }
41
+
42
+ private function compute_mime_type($path, $mime_type = null) {
43
+ if ($mime_type) return $mime_type;
44
+
45
+ switch (true) {
46
+ case preg_match('/\.png$/i', $path):
47
+ return 'image/png';
48
+ break;
49
+ case preg_match('/\.jpe?g$/i', $path):
50
+ return 'image/jpeg';
51
+ break;
52
+ case preg_match('/\.gif$/i', $path):
53
+ return 'image/gif';
54
+ break;
55
+ case preg_match('/\.otf$/i', $path):
56
+ return 'font/opentype';
57
+ break;
58
+ case preg_match('/\.ttf$/i', $path):
59
+ return 'font/truetype';
60
+ break;
61
+ case preg_match(' /\.woff$/i', $path):
62
+ return 'font/woff';
63
+ break;
64
+ case preg_match(' /\.off$/i', $path):
65
+ return 'font/openfont';
66
+ break;
67
+ case preg_match('/\.([a-zA-Z]+)$/i', $path, $matches):
68
+ return 'image/'.strtolower($matches[1]);
69
+ break;
70
+ default:
71
+ throw new SassScriptFunctionException('Unable to determine mime type for {what}, please specify one explicitly', array('{what}'=>$path), SassScriptParser::$context->node);
72
+ break;
73
+ }
74
+ }
75
+
76
+ private function data($real_path) {
77
+ if (file_exists($real_path)) {
78
+ $fp = fopen($real_path, 'rb');
79
+ return base64_encode(fread($fp, filesize($real_path)));
80
+ }
81
+ else
82
+ throw new SassScriptFunctionException('Unable to find {what}: {filename}', array('{what}'=>'file', '{filename}'=>$real_path), SassScriptParser::$context->node);
83
+ }
84
+ }
@@ -0,0 +1,47 @@
1
+ <?php
2
+ /* SVN FILE: $Id: SassBoolean.php 49 2010-04-04 10:51:24Z chris.l.yates $ */
3
+ /**
4
+ * Compass extension SassScript lists functions 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.extensions.compass.functions
10
+ */
11
+
12
+ /**
13
+ * Compass extension SassScript lists functions class.
14
+ * A collection of functions for use in SassSCript.
15
+ * @package PHamlP
16
+ * @subpackage Sass.extensions.compass.functions
17
+ */
18
+ class SassExtentionsCompassFunctionsLists {
19
+ const SPACE_SEPARATOR = '/\s+/';
20
+
21
+ # Return the first value from a space separated list.
22
+ public static function first_value_of($list) {
23
+ if ($list instanceof SassString) {
24
+ $items = preg_split(self::SPACE_SEPARATOR, $list->value);
25
+ return new SassString($items[0]);
26
+ }
27
+ else return $list;
28
+ }
29
+
30
+ # Return the nth value from a space separated list.
31
+ public static function nth_value_of($list, $n) {
32
+ if ($list instanceof SassString) {
33
+ $items = preg_split(self::SPACE_SEPARATOR, $list->value);
34
+ return new SassString($items[$n->toInt()-1]);
35
+ }
36
+ else return $list;
37
+ }
38
+
39
+ # Return the last value from a space separated list.
40
+ public static function last_value_of($list) {
41
+ if ($list instanceof SassString) {
42
+ $items = array_reverse(preg_split(self::SPACE_SEPARATOR, $list->value));
43
+ return new SassString($items[0]);
44
+ }
45
+ else return $list;
46
+ }
47
+ }
@@ -0,0 +1,128 @@
1
+ <?php
2
+ /* SVN FILE: $Id: SassBoolean.php 49 2010-04-04 10:51:24Z chris.l.yates $ */
3
+ /**
4
+ * Compass extension SassScript selectors functions 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.extensions.compass.functions
10
+ */
11
+
12
+ /**
13
+ * Compass extension SassScript selectors functions class.
14
+ * A collection of functions for use in SassSCript.
15
+ * @package PHamlP
16
+ * @subpackage Sass.extensions.compass.functions
17
+ */
18
+ class SassExtentionsCompassFunctionsSelectors {
19
+ const COMMA_SEPARATOR = '/\s*,\s*/';
20
+
21
+ private static $defaultDisplay = array(
22
+ 'block' => array('address', 'blockquote', 'center', 'dir', 'div', 'dd',
23
+ 'dl', 'dt', 'fieldset', 'form', 'frameset h1', 'h2', 'h3', 'h4', 'h5',
24
+ 'h6', 'hr', 'isindex', 'menu', 'noframes', 'noscript', 'ol', 'p', 'pre',
25
+ 'ul'),
26
+ 'inline' => array('a', 'abbr', 'acronym', 'b', 'basefont', 'bdo', 'big',
27
+ 'br', 'cite', 'code', 'dfn', 'em', 'font', 'i', 'img', 'input', 'kbd',
28
+ 'label', 'q', 's', 'samp', 'select', 'small', 'span', 'strike', 'strong',
29
+ 'sub', 'sup', 'textarea', 'tt', 'u', 'var'),
30
+ 'table' => array('table'),
31
+ 'list-item' => array('li'),
32
+ 'table-row-group' => array('tbody'),
33
+ 'table-header-group' => array('thead'),
34
+ 'table-footer-group' => array('tfoot'),
35
+ 'table-row' => array('tr'),
36
+ 'table-cell' => array('th', 'td')
37
+ );
38
+
39
+ # Permute multiple selectors each of which may be comma delimited, the end result is
40
+ # a new selector that is the equivalent of nesting each under the previous selector.
41
+ # To illustrate, the following mixins are equivalent:
42
+ # =mixin-a($selector1, $selector2, $selector3)
43
+ # #{$selector1}
44
+ # #{$selector2}
45
+ # #{$selector3}
46
+ # width: 2px
47
+ # =mixin-b($selector1, $selector2, $selector3)
48
+ # #{nest($selector, $selector2, $selector3)}
49
+ # width: 2px
50
+ public static function nest() {
51
+ if (func_num_args() < 2)
52
+ throw new SassScriptFunctionException('nest() requires two or more arguments', array(), SassScriptParser::$context->node);
53
+
54
+ $args = func_get_args();
55
+ $arg = array_shift($args);
56
+ $ancestors = preg_split(self::COMMA_SEPARATOR, $arg->value);
57
+
58
+ foreach ($args as $arg) {
59
+ $nested = array();
60
+ foreach (preg_split(self::COMMA_SEPARATOR, $arg->value) as $descenant) {
61
+ foreach ($ancestors as $ancestor) {
62
+ $nested[] = "$ancestor $descenant";
63
+ }
64
+ }
65
+ $ancestors = $nested;
66
+ }
67
+ sort($nested);
68
+ return new SassString(join(', ', $nested));
69
+ }
70
+
71
+ # Permute two selectors, the first may be comma delimited.
72
+ # The end result is a new selector that is the equivalent of nesting the second
73
+ # selector under the first one in a sass file and preceding it with an &.
74
+ # To illustrate, the following mixins are equivalent:
75
+ # =mixin-a($selector, $to_append)
76
+ # #{$selector}
77
+ # &#{$to_append}
78
+ # width: 2px
79
+ # =mixin-b($selector, $to_append)
80
+ # #{append_selector($selector, $to_append)}
81
+ # width: 2px
82
+ public static function append_selector($selector, $to_append) {
83
+ $appended = array();
84
+ foreach (preg_split(self::COMMA_SEPARATOR, $selector->value) as $ancestor) {
85
+ foreach (preg_split(self::COMMA_SEPARATOR, $to_append->value) as $descendant) {
86
+ $appended[] = $ancestor.$descendant;
87
+ }
88
+ }
89
+ return new SassString(join(', ', $appended));
90
+ }
91
+
92
+ # Return the header selectors for the levels indicated
93
+ # Defaults to all headers h1 through h6
94
+ # For example:
95
+ # headers(all) => h1, h2, h3, h4, h5, h6
96
+ # headers(4) => h1, h2, h3, h4
97
+ # headers(2,4) => h2, h3, h4
98
+ public static function headers($from = null, $to = null) {
99
+ if (!$from || ($from instanceof SassString && $from->value === "all")) {
100
+ $from = new SassNumber(1);
101
+ $to = new SassNumber(6);
102
+ }
103
+ elseif ($from && !$to) {
104
+ $to = $from;
105
+ $from = new SassNumber(1);
106
+ }
107
+
108
+ return new SassString('h' . join(', h', range($from->value, $to->value)));
109
+ }
110
+
111
+ public static function headings($from = null, $to = null) {
112
+ return self::headers($from, $to);
113
+ }
114
+
115
+ # Return an enumerated set of comma separated selectors.
116
+ # For example
117
+ # enumerate('foo', 1, 4) => foo-1, foo-2, foo-3, foo-4
118
+ public static function enumerate($prefix, $from, $to, $separator = null) {
119
+ $_prefix = $prefix->value . (!$separator ? '-' : $separator->value);
120
+ return new SassString($_prefix . join(', '.$_prefix, range($from->value, $to->value)));
121
+ }
122
+
123
+ # returns a comma delimited string for all the
124
+ # elements according to their default css3 display value.
125
+ public static function elements_of_type($display) {
126
+ return new SassString(join(', ', self::$defaultDisplay[$display->value]));
127
+ }
128
+ }