radiant 1.0.0.rc1 → 1.0.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of radiant might be problematic. Click here for more details.
- data/app/controllers/admin/resource_controller.rb +1 -0
- data/app/controllers/application_controller.rb +1 -1
- data/app/models/deprecated_tags.rb +5 -48
- data/app/models/user_action_observer.rb +8 -2
- data/app/views/layouts/application.html.haml +1 -1
- data/config/boot.rb +2 -2
- data/config/environment.rb +5 -3
- data/config/initializers/compass.rb +5 -0
- data/config/locales/en.yml +2 -2
- data/features/step_definitions/admin/pages_management_steps.rb +6 -1
- data/features/support/paths.rb +13 -0
- data/lib/generators/extension/templates/cucumber_env.rb +5 -1
- data/lib/generators/extension/templates/cucumber_paths.rb +20 -12
- data/lib/generators/extension/templates/gemspec.rb +10 -5
- data/lib/generators/instance/templates/instance_environment.rb +4 -2
- data/lib/radiant.rb +1 -1
- data/lib/radiant/gem_dependency_fix.rb +1 -1
- data/lib/radiant/taggable.rb +42 -3
- data/lib/tasks/framework.rake +6 -6
- data/{vendor/plugins/haml/test/sass/results/warn.css → log/.keep} +0 -0
- data/radiant.gemspec +3 -2
- data/script/console +2 -2
- data/spec/controllers/admin/pages_controller_spec.rb +1 -1
- data/spec/lib/radiant/taggable_spec.rb +53 -0
- data/vendor/extensions/archive/Rakefile +3 -3
- data/vendor/extensions/archive/features/support/env.rb +5 -1
- data/vendor/extensions/archive/features/support/paths.rb +20 -12
- data/vendor/extensions/archive/radiant-archive-extension.gemspec +10 -5
- data/vendor/extensions/archive/tmp/cache/meta/0e/da69d02186242cdfda62e46044566f2bc50f3a +0 -0
- data/vendor/extensions/{assets → clipped}/LICENSE +0 -0
- data/vendor/extensions/{assets → clipped}/README.md +21 -21
- data/vendor/extensions/{assets → clipped}/Rakefile +29 -31
- data/vendor/extensions/{assets → clipped}/app/controllers/admin/assets_controller.rb +16 -11
- data/vendor/extensions/clipped/app/controllers/admin/page_attachments_controller.rb +18 -0
- data/vendor/extensions/clipped/app/helpers/admin/assets_helper.rb +16 -0
- data/vendor/extensions/{assets → clipped}/app/models/asset.rb +12 -9
- data/vendor/extensions/{assets → clipped}/app/models/asset_tags.rb +36 -53
- data/vendor/extensions/{assets → clipped}/app/models/asset_type.rb +1 -7
- data/vendor/extensions/{assets → clipped}/app/models/old_page_attachment.rb +0 -0
- data/vendor/extensions/clipped/app/models/page_attachment.rb +21 -0
- data/vendor/extensions/{assets → clipped}/app/views/admin/assets/_asset.html.haml +2 -2
- data/vendor/extensions/{assets → clipped}/app/views/admin/assets/_asset_table.html.haml +4 -4
- data/vendor/extensions/clipped/app/views/admin/assets/_errors.html.haml +3 -0
- data/vendor/extensions/{assets → clipped}/app/views/admin/assets/_form.html.haml +2 -2
- data/vendor/extensions/{assets → clipped}/app/views/admin/assets/_page_assets.html.haml +1 -1
- data/vendor/extensions/{assets → clipped}/app/views/admin/assets/_search.html.haml +0 -0
- data/vendor/extensions/{assets → clipped}/app/views/admin/assets/_search_results.html.haml +1 -1
- data/vendor/extensions/{assets → clipped}/app/views/admin/assets/edit.html.haml +7 -8
- data/vendor/extensions/{assets → clipped}/app/views/admin/assets/index.html.haml +3 -2
- data/vendor/extensions/{assets → clipped}/app/views/admin/assets/new.html.haml +2 -2
- data/vendor/extensions/clipped/app/views/admin/assets/refresh.html.haml +14 -0
- data/vendor/extensions/{assets → clipped}/app/views/admin/assets/remove.html.haml +3 -3
- data/vendor/extensions/{assets → clipped}/app/views/admin/configuration/_edit.html.haml +1 -1
- data/vendor/extensions/{assets → clipped}/app/views/admin/configuration/_show.html.haml +1 -1
- data/vendor/extensions/clipped/app/views/admin/page_attachments/_attachment.html.haml +25 -0
- data/vendor/extensions/{assets → clipped}/app/views/admin/page_parts/_page_part.html.haml +3 -2
- data/vendor/extensions/{assets → clipped}/app/views/admin/pages/_asset_popups.html.haml +7 -7
- data/vendor/extensions/clipped/app/views/admin/pages/_assets.html.haml +11 -0
- data/vendor/extensions/{assets → clipped}/app/views/admin/removed/_assets_bucket.html.haml +1 -1
- data/vendor/extensions/{assets → clipped}/app/views/admin/removed/_assets_container.html.haml +9 -9
- data/vendor/extensions/{assets → clipped}/app/views/admin/removed/_bucket.html.haml +1 -1
- data/vendor/extensions/{assets → clipped}/app/views/admin/removed/_bucket_asset.html.haml +2 -2
- data/vendor/extensions/clipped/app/views/admin/removed/_show_bucket_link.html.haml +4 -0
- data/vendor/extensions/{assets → clipped}/app/views/admin/removed/_upload_to_page.html.haml +2 -2
- data/vendor/extensions/{assets → clipped}/app/views/admin/removed/bucket/_iframe.html.haml +0 -0
- data/vendor/extensions/{assets → clipped}/artwork/icons.png +0 -0
- data/vendor/extensions/{assets/assets_extension.rb → clipped/clipped_extension.rb} +10 -10
- data/vendor/extensions/{assets → clipped}/config/initializers/interpolation.rb +0 -0
- data/vendor/extensions/clipped/config/initializers/processors.rb +12 -0
- data/vendor/extensions/{assets → clipped}/config/initializers/radiant_config.rb +5 -4
- data/vendor/extensions/{assets → clipped}/config/locales/en.yml +6 -3
- data/vendor/extensions/{assets → clipped}/config/locales/nl.yml +1 -1
- data/vendor/extensions/{assets → clipped}/config/routes.rb +2 -2
- data/vendor/extensions/clipped/cucumber.yml +1 -0
- data/vendor/extensions/{assets → clipped}/db/migrate/001_create_assets.rb +0 -0
- data/vendor/extensions/{assets → clipped}/db/migrate/002_create_paperclip_attributes.rb +0 -0
- data/vendor/extensions/{assets → clipped}/db/migrate/003_create_user_observer.rb +0 -0
- data/vendor/extensions/{assets → clipped}/db/migrate/004_create_page_attachments.rb +0 -0
- data/vendor/extensions/{assets → clipped}/db/migrate/005_rename_users.rb +0 -0
- data/vendor/extensions/{assets → clipped}/db/migrate/20090316132151_disable_file_types.rb +0 -0
- data/vendor/extensions/{assets → clipped}/db/migrate/20110513205050_asset_uuid.rb +0 -0
- data/vendor/extensions/clipped/features/support/env.rb +11 -0
- data/vendor/extensions/clipped/features/support/paths.rb +22 -0
- data/vendor/extensions/{assets/lib/assets_admin_ui.rb → clipped/lib/clipped_admin_ui.rb} +1 -1
- data/vendor/extensions/{assets → clipped}/lib/page_asset_associations.rb +1 -1
- data/vendor/extensions/{assets → clipped}/lib/paperclip/frame_grab.rb +0 -0
- data/vendor/extensions/clipped/lib/radiant-clipped-extension.rb +2 -0
- data/vendor/extensions/clipped/lib/radiant-clipped-extension/version.rb +3 -0
- data/vendor/extensions/{assets/lib/tasks/assets_extension_tasks.rake → clipped/lib/tasks/clipped_extension_tasks.rake} +22 -16
- data/vendor/extensions/{assets → clipped}/lib/tasks/paperclip_tasks.rake +0 -0
- data/{public → vendor/extensions/clipped/public}/flash/ZeroClipboard.swf +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/add.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/archive_icon.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/audio_icon.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/audio_thumbnail.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/c_icon.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/copy.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/css_icon.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/database_icon.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/delete.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/document_icon.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/document_thumbnail.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/flash_icon.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/flash_thumbnail.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/font_icon.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/gzip_icon.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/html_icon.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/image_icon.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/image_thumbnail.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/java_icon.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/page_edit.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/perl_icon.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/php_icon.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/presentation_icon.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/python_icon.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/reorder_assets.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/ruby_icon.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/script_icon.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/spreadsheet_icon.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/tar_icon.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/unknown_icon.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/unknown_thumbnail.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/video_icon.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/video_thumbnail.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/xml_icon.png +0 -0
- data/{public → vendor/extensions/clipped/public}/images/admin/assets/zip_icon.png +0 -0
- data/vendor/extensions/{assets → clipped}/public/javascripts/admin/assets.js +66 -8
- data/vendor/extensions/{assets → clipped}/public/stylesheets/sass/admin/assets.sass +12 -6
- data/vendor/extensions/clipped/radiant-clipped-extension.gemspec +33 -0
- data/vendor/extensions/{assets → clipped}/spec/controllers/admin/assets_controller_spec.rb +0 -0
- data/vendor/extensions/clipped/spec/controllers/admin/page_attachments_controller_spec.rb +50 -0
- data/vendor/extensions/{assets → clipped}/spec/datasets/assets_dataset.rb +2 -1
- data/vendor/extensions/{assets/spec/lib/tag_deprecation_spec.rb → clipped/spec/lib/asset_tags_spec.rb} +3 -15
- data/vendor/extensions/{assets → clipped}/spec/models/asset_spec.rb +3 -2
- data/vendor/extensions/{assets → clipped}/spec/models/asset_type_spec.rb +0 -0
- data/vendor/extensions/{assets → clipped}/spec/spec.opts +0 -0
- data/vendor/extensions/{assets → clipped}/spec/spec_helper.rb +0 -0
- data/vendor/extensions/{assets → clipped}/wireframes/edit-page-assets-2.bmml +0 -0
- data/vendor/extensions/{assets → clipped}/wireframes/edit-page-assets-2.png +0 -0
- data/vendor/extensions/{assets → clipped}/wireframes/edit-page-assets-3.bmml +0 -0
- data/vendor/extensions/{assets → clipped}/wireframes/edit-page-assets-3.png +0 -0
- data/vendor/extensions/{assets → clipped}/wireframes/edit-page-assets.bmml +0 -0
- data/vendor/extensions/{assets → clipped}/wireframes/edit-page-assets.png +0 -0
- data/vendor/extensions/{assets → clipped}/wireframes/edit-page.bmml +0 -0
- data/vendor/extensions/{assets → clipped}/wireframes/edit-page.png +0 -0
- data/vendor/extensions/sheets/Rakefile +30 -18
- data/vendor/extensions/sheets/app/controllers/admin/sheet_resource_controller.rb +1 -1
- data/vendor/extensions/sheets/app/models/sheet.rb +4 -0
- data/vendor/extensions/sheets/app/views/admin/scripts/index.html.haml +9 -5
- data/vendor/extensions/sheets/app/views/admin/styles/index.html.haml +1 -1
- data/vendor/extensions/sheets/config/locales/en.yml +3 -1
- data/vendor/extensions/sheets/features/admin/managing_javascripts.feature +65 -0
- data/vendor/extensions/sheets/features/admin/managing_stylesheets.feature +65 -0
- data/vendor/extensions/sheets/features/support/env.rb +2 -7
- data/vendor/extensions/sheets/features/support/paths.rb +9 -12
- data/vendor/extensions/sheets/lib/radiant-sheets-extension/version.rb +1 -1
- data/vendor/extensions/sheets/radiant-sheets-extension.gemspec +9 -4
- data/vendor/extensions/sheets/spec/datasets/javascripts_dataset.rb +3 -1
- data/vendor/extensions/sheets/spec/datasets/stylesheets_dataset.rb +3 -1
- data/vendor/extensions/sheets/spec/lib/javascript_tags_spec.rb +4 -4
- data/vendor/extensions/sheets/spec/lib/stylesheet_tags_spec.rb +4 -4
- metadata +189 -599
- data/Gemfile +0 -3
- data/lib/generators/extension/templates/cucumber_datasets_loader.rb +0 -3
- data/public/assets/1/2375_1115822414591_1197894784_30347214_1109_n.jpg +0 -0
- data/public/assets/1/2375_1115822414591_1197894784_30347214_1109_n_icon.png +0 -0
- data/public/assets/1/2375_1115822414591_1197894784_30347214_1109_n_normal.jpg +0 -0
- data/public/assets/1/2375_1115822414591_1197894784_30347214_1109_n_thumbnail.png +0 -0
- data/public/images/roasters/banner.jpg +0 -0
- data/public/images/roasters/closelabel.gif +0 -0
- data/public/images/roasters/comment.png +0 -0
- data/public/images/roasters/gallery1.jpg +0 -0
- data/public/images/roasters/gallery2.jpg +0 -0
- data/public/images/roasters/gallery3.jpg +0 -0
- data/public/images/roasters/gallery4.jpg +0 -0
- data/public/images/roasters/gift.gif +0 -0
- data/public/images/roasters/green.gif +0 -0
- data/public/images/roasters/nav-background.gif +0 -0
- data/public/images/roasters/nav-divider.gif +0 -0
- data/public/images/roasters/nextlabel.gif +0 -0
- data/public/images/roasters/open.gif +0 -0
- data/public/images/roasters/preview-1.jpg +0 -0
- data/public/images/roasters/preview.jpg +0 -0
- data/public/images/roasters/prevlabel.gif +0 -0
- data/public/images/roasters/prize.gif +0 -0
- data/public/images/roasters/recycle.gif +0 -0
- data/public/images/roasters/rss.gif +0 -0
- data/public/images/roasters/thumb-grinder.jpg +0 -0
- data/public/images/roasters/thumb-grower.jpg +0 -0
- data/public/images/roasters/thumb-roaster.jpg +0 -0
- data/public/images/roasters/truck.gif +0 -0
- data/vendor/extensions/assets/HELP_admin.markdown +0 -69
- data/vendor/extensions/assets/VERSION +0 -1
- data/vendor/extensions/assets/app/controllers/admin/page_attachments_controller.rb +0 -45
- data/vendor/extensions/assets/app/helpers/admin/assets_helper.rb +0 -11
- data/vendor/extensions/assets/app/models/page_attachment.rb +0 -14
- data/vendor/extensions/assets/app/views/admin/assets/_errors.html.haml +0 -3
- data/vendor/extensions/assets/app/views/admin/page_attachments/_attachment.html.haml +0 -22
- data/vendor/extensions/assets/app/views/admin/page_attachments/_new_attachment.html.haml +0 -18
- data/vendor/extensions/assets/app/views/admin/pages/_assets.html.haml +0 -13
- data/vendor/extensions/assets/app/views/admin/removed/_show_bucket_link.html.haml +0 -4
- data/vendor/extensions/assets/lib/tag_deprecation.rb +0 -73
- data/vendor/extensions/assets/public/flash/ZeroClipboard.swf +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/add.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/archive_icon.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/audio_icon.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/audio_thumbnail.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/c_icon.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/copy.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/css_icon.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/database_icon.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/delete.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/document_icon.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/document_thumbnail.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/flash_icon.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/flash_thumbnail.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/font_icon.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/gzip_icon.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/html_icon.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/image_icon.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/image_thumbnail.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/java_icon.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/page_edit.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/perl_icon.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/php_icon.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/presentation_icon.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/python_icon.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/reorder_assets.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/ruby_icon.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/script_icon.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/spreadsheet_icon.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/tar_icon.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/unknown_icon.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/unknown_thumbnail.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/video_icon.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/video_thumbnail.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/xml_icon.png +0 -0
- data/vendor/extensions/assets/public/images/admin/assets/zip_icon.png +0 -0
- data/vendor/extensions/assets/spec/controllers/admin/page_attachment_controller_spec.rb +0 -51
- data/vendor/extensions/assets/spec/lib/asset_tags_spec.rb +0 -9
- data/vendor/plugins/haml/CONTRIBUTING +0 -4
- data/vendor/plugins/haml/MIT-LICENSE +0 -20
- data/vendor/plugins/haml/README.md +0 -298
- data/vendor/plugins/haml/Rakefile +0 -436
- data/vendor/plugins/haml/TODO +0 -53
- data/vendor/plugins/haml/VERSION +0 -1
- data/vendor/plugins/haml/VERSION_NAME +0 -1
- data/vendor/plugins/haml/bin/css2sass +0 -13
- data/vendor/plugins/haml/bin/haml +0 -9
- data/vendor/plugins/haml/bin/html2haml +0 -7
- data/vendor/plugins/haml/bin/sass +0 -8
- data/vendor/plugins/haml/bin/sass-convert +0 -7
- data/vendor/plugins/haml/doc-src/FAQ.md +0 -187
- data/vendor/plugins/haml/doc-src/HAML_CHANGELOG.md +0 -1091
- data/vendor/plugins/haml/doc-src/HAML_REFERENCE.md +0 -1344
- data/vendor/plugins/haml/doc-src/INDENTED_SYNTAX.md +0 -210
- data/vendor/plugins/haml/doc-src/SASS_CHANGELOG.md +0 -1914
- data/vendor/plugins/haml/doc-src/SASS_REFERENCE.md +0 -1680
- data/vendor/plugins/haml/doc-src/SCSS_FOR_SASS_USERS.md +0 -155
- data/vendor/plugins/haml/ext/extconf.rb +0 -10
- data/vendor/plugins/haml/extra/haml-mode.el +0 -753
- data/vendor/plugins/haml/extra/sass-mode.el +0 -207
- data/vendor/plugins/haml/extra/update_watch.rb +0 -13
- data/vendor/plugins/haml/haml.gemspec +0 -35
- data/vendor/plugins/haml/init.rb +0 -18
- data/vendor/plugins/haml/init.rbc +0 -404
- data/vendor/plugins/haml/lib/haml.rb +0 -44
- data/vendor/plugins/haml/lib/haml.rbc +0 -569
- data/vendor/plugins/haml/lib/haml/buffer.rb +0 -320
- data/vendor/plugins/haml/lib/haml/buffer.rbc +0 -4048
- data/vendor/plugins/haml/lib/haml/engine.rb +0 -308
- data/vendor/plugins/haml/lib/haml/engine.rbc +0 -3852
- data/vendor/plugins/haml/lib/haml/error.rb +0 -22
- data/vendor/plugins/haml/lib/haml/error.rbc +0 -339
- data/vendor/plugins/haml/lib/haml/exec.rb +0 -862
- data/vendor/plugins/haml/lib/haml/filters.rb +0 -371
- data/vendor/plugins/haml/lib/haml/filters.rbc +0 -5617
- data/vendor/plugins/haml/lib/haml/helpers.rb +0 -605
- data/vendor/plugins/haml/lib/haml/helpers.rbc +0 -7086
- data/vendor/plugins/haml/lib/haml/helpers/action_view_extensions.rb +0 -57
- data/vendor/plugins/haml/lib/haml/helpers/action_view_extensions.rbc +0 -522
- data/vendor/plugins/haml/lib/haml/helpers/action_view_mods.rb +0 -244
- data/vendor/plugins/haml/lib/haml/helpers/action_view_mods.rbc +0 -5515
- data/vendor/plugins/haml/lib/haml/helpers/xss_mods.rb +0 -165
- data/vendor/plugins/haml/lib/haml/html.rb +0 -428
- data/vendor/plugins/haml/lib/haml/html/erb.rb +0 -141
- data/vendor/plugins/haml/lib/haml/precompiler.rb +0 -1104
- data/vendor/plugins/haml/lib/haml/precompiler.rbc +0 -22247
- data/vendor/plugins/haml/lib/haml/railtie.rb +0 -21
- data/vendor/plugins/haml/lib/haml/railtie.rbc +0 -409
- data/vendor/plugins/haml/lib/haml/root.rb +0 -7
- data/vendor/plugins/haml/lib/haml/root.rbc +0 -160
- data/vendor/plugins/haml/lib/haml/shared.rb +0 -78
- data/vendor/plugins/haml/lib/haml/shared.rbc +0 -1137
- data/vendor/plugins/haml/lib/haml/template.rb +0 -97
- data/vendor/plugins/haml/lib/haml/template.rbc +0 -1838
- data/vendor/plugins/haml/lib/haml/template/options.rb +0 -16
- data/vendor/plugins/haml/lib/haml/template/options.rbc +0 -235
- data/vendor/plugins/haml/lib/haml/template/patch.rb +0 -58
- data/vendor/plugins/haml/lib/haml/template/plugin.rb +0 -122
- data/vendor/plugins/haml/lib/haml/template/plugin.rbc +0 -2720
- data/vendor/plugins/haml/lib/haml/util.rb +0 -809
- data/vendor/plugins/haml/lib/haml/util.rbc +0 -12059
- data/vendor/plugins/haml/lib/haml/util/subset_map.rb +0 -101
- data/vendor/plugins/haml/lib/haml/util/subset_map.rbc +0 -1316
- data/vendor/plugins/haml/lib/haml/version.rb +0 -102
- data/vendor/plugins/haml/lib/haml/version.rbc +0 -1671
- data/vendor/plugins/haml/lib/sass.rb +0 -29
- data/vendor/plugins/haml/lib/sass.rbc +0 -492
- data/vendor/plugins/haml/lib/sass/callbacks.rb +0 -52
- data/vendor/plugins/haml/lib/sass/callbacks.rbc +0 -388
- data/vendor/plugins/haml/lib/sass/css.rb +0 -294
- data/vendor/plugins/haml/lib/sass/engine.rb +0 -720
- data/vendor/plugins/haml/lib/sass/engine.rbc +0 -17020
- data/vendor/plugins/haml/lib/sass/environment.rb +0 -143
- data/vendor/plugins/haml/lib/sass/environment.rbc +0 -1751
- data/vendor/plugins/haml/lib/sass/error.rb +0 -198
- data/vendor/plugins/haml/lib/sass/error.rbc +0 -2801
- data/vendor/plugins/haml/lib/sass/files.rb +0 -160
- data/vendor/plugins/haml/lib/sass/files.rbc +0 -3118
- data/vendor/plugins/haml/lib/sass/less.rb +0 -382
- data/vendor/plugins/haml/lib/sass/plugin.rb +0 -276
- data/vendor/plugins/haml/lib/sass/plugin.rbc +0 -4356
- data/vendor/plugins/haml/lib/sass/plugin/configuration.rb +0 -221
- data/vendor/plugins/haml/lib/sass/plugin/configuration.rbc +0 -1343
- data/vendor/plugins/haml/lib/sass/plugin/generic.rb +0 -15
- data/vendor/plugins/haml/lib/sass/plugin/merb.rb +0 -37
- data/vendor/plugins/haml/lib/sass/plugin/rack.rb +0 -47
- data/vendor/plugins/haml/lib/sass/plugin/rack.rbc +0 -446
- data/vendor/plugins/haml/lib/sass/plugin/rails.rb +0 -32
- data/vendor/plugins/haml/lib/sass/plugin/rails.rbc +0 -879
- data/vendor/plugins/haml/lib/sass/plugin/staleness_checker.rb +0 -123
- data/vendor/plugins/haml/lib/sass/plugin/staleness_checker.rbc +0 -2019
- data/vendor/plugins/haml/lib/sass/repl.rb +0 -58
- data/vendor/plugins/haml/lib/sass/script.rb +0 -63
- data/vendor/plugins/haml/lib/sass/script.rbc +0 -1188
- data/vendor/plugins/haml/lib/sass/script/bool.rb +0 -18
- data/vendor/plugins/haml/lib/sass/script/bool.rbc +0 -366
- data/vendor/plugins/haml/lib/sass/script/color.rb +0 -491
- data/vendor/plugins/haml/lib/sass/script/color.rbc +0 -8148
- data/vendor/plugins/haml/lib/sass/script/css_lexer.rb +0 -29
- data/vendor/plugins/haml/lib/sass/script/css_lexer.rbc +0 -809
- data/vendor/plugins/haml/lib/sass/script/css_parser.rb +0 -31
- data/vendor/plugins/haml/lib/sass/script/css_parser.rbc +0 -628
- data/vendor/plugins/haml/lib/sass/script/funcall.rb +0 -77
- data/vendor/plugins/haml/lib/sass/script/funcall.rbc +0 -1805
- data/vendor/plugins/haml/lib/sass/script/functions.rb +0 -861
- data/vendor/plugins/haml/lib/sass/script/functions.rbc +0 -8418
- data/vendor/plugins/haml/lib/sass/script/interpolation.rb +0 -70
- data/vendor/plugins/haml/lib/sass/script/interpolation.rbc +0 -1225
- data/vendor/plugins/haml/lib/sass/script/lexer.rb +0 -337
- data/vendor/plugins/haml/lib/sass/script/lexer.rbc +0 -7231
- data/vendor/plugins/haml/lib/sass/script/literal.rb +0 -236
- data/vendor/plugins/haml/lib/sass/script/literal.rbc +0 -3365
- data/vendor/plugins/haml/lib/sass/script/node.rb +0 -112
- data/vendor/plugins/haml/lib/sass/script/node.rbc +0 -1418
- data/vendor/plugins/haml/lib/sass/script/number.rb +0 -423
- data/vendor/plugins/haml/lib/sass/script/number.rbc +0 -6024
- data/vendor/plugins/haml/lib/sass/script/operation.rb +0 -95
- data/vendor/plugins/haml/lib/sass/script/operation.rbc +0 -1856
- data/vendor/plugins/haml/lib/sass/script/parser.rb +0 -401
- data/vendor/plugins/haml/lib/sass/script/parser.rbc +0 -8418
- data/vendor/plugins/haml/lib/sass/script/string.rb +0 -67
- data/vendor/plugins/haml/lib/sass/script/string.rbc +0 -1357
- data/vendor/plugins/haml/lib/sass/script/string_interpolation.rb +0 -93
- data/vendor/plugins/haml/lib/sass/script/string_interpolation.rbc +0 -1643
- data/vendor/plugins/haml/lib/sass/script/unary_operation.rb +0 -57
- data/vendor/plugins/haml/lib/sass/script/unary_operation.rbc +0 -1144
- data/vendor/plugins/haml/lib/sass/script/variable.rb +0 -48
- data/vendor/plugins/haml/lib/sass/script/variable.rbc +0 -844
- data/vendor/plugins/haml/lib/sass/scss.rb +0 -17
- data/vendor/plugins/haml/lib/sass/scss.rbc +0 -242
- data/vendor/plugins/haml/lib/sass/scss/css_parser.rb +0 -46
- data/vendor/plugins/haml/lib/sass/scss/css_parser.rbc +0 -1106
- data/vendor/plugins/haml/lib/sass/scss/parser.rb +0 -846
- data/vendor/plugins/haml/lib/sass/scss/parser.rbc +0 -19348
- data/vendor/plugins/haml/lib/sass/scss/rx.rb +0 -126
- data/vendor/plugins/haml/lib/sass/scss/rx.rbc +0 -2849
- data/vendor/plugins/haml/lib/sass/scss/sass_parser.rb +0 -11
- data/vendor/plugins/haml/lib/sass/scss/sass_parser.rbc +0 -287
- data/vendor/plugins/haml/lib/sass/scss/script_lexer.rb +0 -15
- data/vendor/plugins/haml/lib/sass/scss/script_lexer.rbc +0 -439
- data/vendor/plugins/haml/lib/sass/scss/script_parser.rb +0 -25
- data/vendor/plugins/haml/lib/sass/scss/script_parser.rbc +0 -482
- data/vendor/plugins/haml/lib/sass/scss/static_parser.rb +0 -40
- data/vendor/plugins/haml/lib/sass/scss/static_parser.rbc +0 -971
- data/vendor/plugins/haml/lib/sass/selector.rb +0 -361
- data/vendor/plugins/haml/lib/sass/selector.rbc +0 -4193
- data/vendor/plugins/haml/lib/sass/selector/abstract_sequence.rb +0 -62
- data/vendor/plugins/haml/lib/sass/selector/abstract_sequence.rbc +0 -798
- data/vendor/plugins/haml/lib/sass/selector/comma_sequence.rb +0 -82
- data/vendor/plugins/haml/lib/sass/selector/comma_sequence.rbc +0 -1814
- data/vendor/plugins/haml/lib/sass/selector/sequence.rb +0 -237
- data/vendor/plugins/haml/lib/sass/selector/sequence.rbc +0 -4928
- data/vendor/plugins/haml/lib/sass/selector/simple.rb +0 -113
- data/vendor/plugins/haml/lib/sass/selector/simple.rbc +0 -1553
- data/vendor/plugins/haml/lib/sass/selector/simple_sequence.rb +0 -136
- data/vendor/plugins/haml/lib/sass/selector/simple_sequence.rbc +0 -2346
- data/vendor/plugins/haml/lib/sass/tree/charset_node.rb +0 -37
- data/vendor/plugins/haml/lib/sass/tree/charset_node.rbc +0 -606
- data/vendor/plugins/haml/lib/sass/tree/comment_node.rb +0 -128
- data/vendor/plugins/haml/lib/sass/tree/comment_node.rbc +0 -2397
- data/vendor/plugins/haml/lib/sass/tree/debug_node.rb +0 -36
- data/vendor/plugins/haml/lib/sass/tree/debug_node.rbc +0 -740
- data/vendor/plugins/haml/lib/sass/tree/directive_node.rb +0 -75
- data/vendor/plugins/haml/lib/sass/tree/directive_node.rbc +0 -1302
- data/vendor/plugins/haml/lib/sass/tree/extend_node.rb +0 -65
- data/vendor/plugins/haml/lib/sass/tree/extend_node.rbc +0 -1276
- data/vendor/plugins/haml/lib/sass/tree/for_node.rb +0 -67
- data/vendor/plugins/haml/lib/sass/tree/for_node.rbc +0 -1145
- data/vendor/plugins/haml/lib/sass/tree/if_node.rb +0 -81
- data/vendor/plugins/haml/lib/sass/tree/if_node.rbc +0 -1119
- data/vendor/plugins/haml/lib/sass/tree/import_node.rb +0 -102
- data/vendor/plugins/haml/lib/sass/tree/import_node.rbc +0 -2242
- data/vendor/plugins/haml/lib/sass/tree/mixin_def_node.rb +0 -60
- data/vendor/plugins/haml/lib/sass/tree/mixin_def_node.rbc +0 -1001
- data/vendor/plugins/haml/lib/sass/tree/mixin_node.rb +0 -123
- data/vendor/plugins/haml/lib/sass/tree/mixin_node.rbc +0 -3355
- data/vendor/plugins/haml/lib/sass/tree/node.rb +0 -465
- data/vendor/plugins/haml/lib/sass/tree/node.rbc +0 -5533
- data/vendor/plugins/haml/lib/sass/tree/prop_node.rb +0 -220
- data/vendor/plugins/haml/lib/sass/tree/prop_node.rbc +0 -3949
- data/vendor/plugins/haml/lib/sass/tree/root_node.rb +0 -157
- data/vendor/plugins/haml/lib/sass/tree/root_node.rbc +0 -3112
- data/vendor/plugins/haml/lib/sass/tree/rule_node.rb +0 -273
- data/vendor/plugins/haml/lib/sass/tree/rule_node.rbc +0 -5636
- data/vendor/plugins/haml/lib/sass/tree/variable_node.rb +0 -39
- data/vendor/plugins/haml/lib/sass/tree/variable_node.rbc +0 -845
- data/vendor/plugins/haml/lib/sass/tree/warn_node.rb +0 -42
- data/vendor/plugins/haml/lib/sass/tree/warn_node.rbc +0 -1043
- data/vendor/plugins/haml/lib/sass/tree/while_node.rb +0 -48
- data/vendor/plugins/haml/lib/sass/tree/while_node.rbc +0 -722
- data/vendor/plugins/haml/rails/init.rb +0 -1
- data/vendor/plugins/haml/test/benchmark.rb +0 -99
- data/vendor/plugins/haml/test/haml/engine_test.rb +0 -1805
- data/vendor/plugins/haml/test/haml/erb/_av_partial_1.erb +0 -12
- data/vendor/plugins/haml/test/haml/erb/_av_partial_2.erb +0 -8
- data/vendor/plugins/haml/test/haml/erb/action_view.erb +0 -62
- data/vendor/plugins/haml/test/haml/erb/standard.erb +0 -54
- data/vendor/plugins/haml/test/haml/helper_test.rb +0 -450
- data/vendor/plugins/haml/test/haml/html2haml/erb_tests.rb +0 -426
- data/vendor/plugins/haml/test/haml/html2haml_test.rb +0 -336
- data/vendor/plugins/haml/test/haml/markaby/standard.mab +0 -52
- data/vendor/plugins/haml/test/haml/mocks/article.rb +0 -6
- data/vendor/plugins/haml/test/haml/results/content_for_layout.xhtml +0 -12
- data/vendor/plugins/haml/test/haml/results/eval_suppressed.xhtml +0 -9
- data/vendor/plugins/haml/test/haml/results/filters.xhtml +0 -62
- data/vendor/plugins/haml/test/haml/results/helpers.xhtml +0 -70
- data/vendor/plugins/haml/test/haml/results/helpful.xhtml +0 -10
- data/vendor/plugins/haml/test/haml/results/just_stuff.xhtml +0 -70
- data/vendor/plugins/haml/test/haml/results/list.xhtml +0 -12
- data/vendor/plugins/haml/test/haml/results/nuke_inner_whitespace.xhtml +0 -40
- data/vendor/plugins/haml/test/haml/results/nuke_outer_whitespace.xhtml +0 -148
- data/vendor/plugins/haml/test/haml/results/original_engine.xhtml +0 -20
- data/vendor/plugins/haml/test/haml/results/partial_layout.xhtml +0 -5
- data/vendor/plugins/haml/test/haml/results/partials.xhtml +0 -21
- data/vendor/plugins/haml/test/haml/results/render_layout.xhtml +0 -3
- data/vendor/plugins/haml/test/haml/results/silent_script.xhtml +0 -74
- data/vendor/plugins/haml/test/haml/results/standard.xhtml +0 -162
- data/vendor/plugins/haml/test/haml/results/tag_parsing.xhtml +0 -23
- data/vendor/plugins/haml/test/haml/results/very_basic.xhtml +0 -5
- data/vendor/plugins/haml/test/haml/results/whitespace_handling.xhtml +0 -89
- data/vendor/plugins/haml/test/haml/spec/LICENSE +0 -14
- data/vendor/plugins/haml/test/haml/spec/README.md +0 -106
- data/vendor/plugins/haml/test/haml/spec/lua_haml_spec.lua +0 -38
- data/vendor/plugins/haml/test/haml/spec/perl_haml_test.pl +0 -81
- data/vendor/plugins/haml/test/haml/spec/ruby_haml_test.rb +0 -19
- data/vendor/plugins/haml/test/haml/spec/tests.json +0 -603
- data/vendor/plugins/haml/test/haml/spec_test.rb +0 -44
- data/vendor/plugins/haml/test/haml/template_test.rb +0 -417
- data/vendor/plugins/haml/test/haml/templates/_av_partial_1.haml +0 -9
- data/vendor/plugins/haml/test/haml/templates/_av_partial_1_ugly.haml +0 -9
- data/vendor/plugins/haml/test/haml/templates/_av_partial_2.haml +0 -5
- data/vendor/plugins/haml/test/haml/templates/_av_partial_2_ugly.haml +0 -5
- data/vendor/plugins/haml/test/haml/templates/_layout.erb +0 -3
- data/vendor/plugins/haml/test/haml/templates/_layout_for_partial.haml +0 -3
- data/vendor/plugins/haml/test/haml/templates/_partial.haml +0 -8
- data/vendor/plugins/haml/test/haml/templates/_text_area.haml +0 -3
- data/vendor/plugins/haml/test/haml/templates/action_view.haml +0 -47
- data/vendor/plugins/haml/test/haml/templates/action_view_ugly.haml +0 -47
- data/vendor/plugins/haml/test/haml/templates/breakage.haml +0 -8
- data/vendor/plugins/haml/test/haml/templates/content_for_layout.haml +0 -8
- data/vendor/plugins/haml/test/haml/templates/eval_suppressed.haml +0 -11
- data/vendor/plugins/haml/test/haml/templates/filters.haml +0 -66
- data/vendor/plugins/haml/test/haml/templates/helpers.haml +0 -55
- data/vendor/plugins/haml/test/haml/templates/helpful.haml +0 -11
- data/vendor/plugins/haml/test/haml/templates/just_stuff.haml +0 -85
- data/vendor/plugins/haml/test/haml/templates/list.haml +0 -12
- data/vendor/plugins/haml/test/haml/templates/nuke_inner_whitespace.haml +0 -32
- data/vendor/plugins/haml/test/haml/templates/nuke_outer_whitespace.haml +0 -144
- data/vendor/plugins/haml/test/haml/templates/original_engine.haml +0 -17
- data/vendor/plugins/haml/test/haml/templates/partial_layout.haml +0 -7
- data/vendor/plugins/haml/test/haml/templates/partialize.haml +0 -1
- data/vendor/plugins/haml/test/haml/templates/partials.haml +0 -12
- data/vendor/plugins/haml/test/haml/templates/render_layout.haml +0 -2
- data/vendor/plugins/haml/test/haml/templates/silent_script.haml +0 -40
- data/vendor/plugins/haml/test/haml/templates/standard.haml +0 -42
- data/vendor/plugins/haml/test/haml/templates/standard_ugly.haml +0 -42
- data/vendor/plugins/haml/test/haml/templates/tag_parsing.haml +0 -21
- data/vendor/plugins/haml/test/haml/templates/very_basic.haml +0 -4
- data/vendor/plugins/haml/test/haml/templates/whitespace_handling.haml +0 -87
- data/vendor/plugins/haml/test/haml/util/subset_map_test.rb +0 -91
- data/vendor/plugins/haml/test/haml/util_test.rb +0 -268
- data/vendor/plugins/haml/test/linked_rails.rb +0 -42
- data/vendor/plugins/haml/test/sass/callbacks_test.rb +0 -61
- data/vendor/plugins/haml/test/sass/conversion_test.rb +0 -1218
- data/vendor/plugins/haml/test/sass/css2sass_test.rb +0 -364
- data/vendor/plugins/haml/test/sass/data/hsl-rgb.txt +0 -319
- data/vendor/plugins/haml/test/sass/engine_test.rb +0 -2263
- data/vendor/plugins/haml/test/sass/extend_test.rb +0 -1348
- data/vendor/plugins/haml/test/sass/functions_test.rb +0 -556
- data/vendor/plugins/haml/test/sass/less_conversion_test.rb +0 -653
- data/vendor/plugins/haml/test/sass/more_results/more1.css +0 -9
- data/vendor/plugins/haml/test/sass/more_results/more1_with_line_comments.css +0 -26
- data/vendor/plugins/haml/test/sass/more_results/more_import.css +0 -29
- data/vendor/plugins/haml/test/sass/more_templates/_more_partial.sass +0 -2
- data/vendor/plugins/haml/test/sass/more_templates/more1.sass +0 -23
- data/vendor/plugins/haml/test/sass/more_templates/more_import.sass +0 -11
- data/vendor/plugins/haml/test/sass/plugin_test.rb +0 -433
- data/vendor/plugins/haml/test/sass/results/alt.css +0 -4
- data/vendor/plugins/haml/test/sass/results/basic.css +0 -9
- data/vendor/plugins/haml/test/sass/results/compact.css +0 -5
- data/vendor/plugins/haml/test/sass/results/complex.css +0 -86
- data/vendor/plugins/haml/test/sass/results/compressed.css +0 -1
- data/vendor/plugins/haml/test/sass/results/expanded.css +0 -19
- data/vendor/plugins/haml/test/sass/results/import.css +0 -31
- data/vendor/plugins/haml/test/sass/results/import_charset.css +0 -4
- data/vendor/plugins/haml/test/sass/results/import_charset_1_8.css +0 -4
- data/vendor/plugins/haml/test/sass/results/import_charset_ibm866.css +0 -4
- data/vendor/plugins/haml/test/sass/results/line_numbers.css +0 -49
- data/vendor/plugins/haml/test/sass/results/mixins.css +0 -95
- data/vendor/plugins/haml/test/sass/results/multiline.css +0 -24
- data/vendor/plugins/haml/test/sass/results/nested.css +0 -22
- data/vendor/plugins/haml/test/sass/results/options.css +0 -1
- data/vendor/plugins/haml/test/sass/results/parent_ref.css +0 -13
- data/vendor/plugins/haml/test/sass/results/script.css +0 -16
- data/vendor/plugins/haml/test/sass/results/scss_import.css +0 -31
- data/vendor/plugins/haml/test/sass/results/scss_importee.css +0 -2
- data/vendor/plugins/haml/test/sass/results/subdir/nested_subdir/nested_subdir.css +0 -1
- data/vendor/plugins/haml/test/sass/results/subdir/subdir.css +0 -3
- data/vendor/plugins/haml/test/sass/results/units.css +0 -11
- data/vendor/plugins/haml/test/sass/results/warn_imported.css +0 -0
- data/vendor/plugins/haml/test/sass/script_conversion_test.rb +0 -314
- data/vendor/plugins/haml/test/sass/script_test.rb +0 -470
- data/vendor/plugins/haml/test/sass/scss/css_test.rb +0 -916
- data/vendor/plugins/haml/test/sass/scss/rx_test.rb +0 -156
- data/vendor/plugins/haml/test/sass/scss/scss_test.rb +0 -1088
- data/vendor/plugins/haml/test/sass/scss/test_helper.rb +0 -37
- data/vendor/plugins/haml/test/sass/templates/_imported_charset_ibm866.sass +0 -4
- data/vendor/plugins/haml/test/sass/templates/_imported_charset_utf8.sass +0 -4
- data/vendor/plugins/haml/test/sass/templates/_partial.sass +0 -2
- data/vendor/plugins/haml/test/sass/templates/alt.sass +0 -16
- data/vendor/plugins/haml/test/sass/templates/basic.sass +0 -23
- data/vendor/plugins/haml/test/sass/templates/bork1.sass +0 -2
- data/vendor/plugins/haml/test/sass/templates/bork2.sass +0 -2
- data/vendor/plugins/haml/test/sass/templates/bork3.sass +0 -2
- data/vendor/plugins/haml/test/sass/templates/bork4.sass +0 -2
- data/vendor/plugins/haml/test/sass/templates/compact.sass +0 -17
- data/vendor/plugins/haml/test/sass/templates/complex.sass +0 -305
- data/vendor/plugins/haml/test/sass/templates/compressed.sass +0 -15
- data/vendor/plugins/haml/test/sass/templates/expanded.sass +0 -17
- data/vendor/plugins/haml/test/sass/templates/import.sass +0 -12
- data/vendor/plugins/haml/test/sass/templates/import_charset.sass +0 -7
- data/vendor/plugins/haml/test/sass/templates/import_charset_1_8.sass +0 -4
- data/vendor/plugins/haml/test/sass/templates/import_charset_ibm866.sass +0 -9
- data/vendor/plugins/haml/test/sass/templates/importee.less +0 -2
- data/vendor/plugins/haml/test/sass/templates/importee.sass +0 -19
- data/vendor/plugins/haml/test/sass/templates/line_numbers.sass +0 -13
- data/vendor/plugins/haml/test/sass/templates/mixin_bork.sass +0 -5
- data/vendor/plugins/haml/test/sass/templates/mixins.sass +0 -76
- data/vendor/plugins/haml/test/sass/templates/multiline.sass +0 -20
- data/vendor/plugins/haml/test/sass/templates/nested.sass +0 -25
- data/vendor/plugins/haml/test/sass/templates/nested_bork1.sass +0 -2
- data/vendor/plugins/haml/test/sass/templates/nested_bork2.sass +0 -2
- data/vendor/plugins/haml/test/sass/templates/nested_bork3.sass +0 -2
- data/vendor/plugins/haml/test/sass/templates/nested_bork4.sass +0 -2
- data/vendor/plugins/haml/test/sass/templates/nested_mixin_bork.sass +0 -6
- data/vendor/plugins/haml/test/sass/templates/options.sass +0 -2
- data/vendor/plugins/haml/test/sass/templates/parent_ref.sass +0 -25
- data/vendor/plugins/haml/test/sass/templates/script.sass +0 -101
- data/vendor/plugins/haml/test/sass/templates/scss_import.scss +0 -11
- data/vendor/plugins/haml/test/sass/templates/scss_importee.scss +0 -1
- data/vendor/plugins/haml/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +0 -2
- data/vendor/plugins/haml/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +0 -3
- data/vendor/plugins/haml/test/sass/templates/subdir/subdir.sass +0 -6
- data/vendor/plugins/haml/test/sass/templates/units.sass +0 -11
- data/vendor/plugins/haml/test/sass/templates/warn.sass +0 -3
- data/vendor/plugins/haml/test/sass/templates/warn_imported.sass +0 -4
- data/vendor/plugins/haml/test/test_helper.rb +0 -98
- data/vendor/plugins/haml/vendor/fssm/LICENSE +0 -20
- data/vendor/plugins/haml/vendor/fssm/README.markdown +0 -55
- data/vendor/plugins/haml/vendor/fssm/Rakefile +0 -59
- data/vendor/plugins/haml/vendor/fssm/VERSION.yml +0 -5
- data/vendor/plugins/haml/vendor/fssm/example.rb +0 -9
- data/vendor/plugins/haml/vendor/fssm/fssm.gemspec +0 -77
- data/vendor/plugins/haml/vendor/fssm/lib/fssm.rb +0 -33
- data/vendor/plugins/haml/vendor/fssm/lib/fssm/backends/fsevents.rb +0 -36
- data/vendor/plugins/haml/vendor/fssm/lib/fssm/backends/inotify.rb +0 -26
- data/vendor/plugins/haml/vendor/fssm/lib/fssm/backends/polling.rb +0 -25
- data/vendor/plugins/haml/vendor/fssm/lib/fssm/backends/rubycocoa/fsevents.rb +0 -131
- data/vendor/plugins/haml/vendor/fssm/lib/fssm/monitor.rb +0 -26
- data/vendor/plugins/haml/vendor/fssm/lib/fssm/path.rb +0 -91
- data/vendor/plugins/haml/vendor/fssm/lib/fssm/pathname.rb +0 -502
- data/vendor/plugins/haml/vendor/fssm/lib/fssm/state/directory.rb +0 -57
- data/vendor/plugins/haml/vendor/fssm/lib/fssm/state/file.rb +0 -24
- data/vendor/plugins/haml/vendor/fssm/lib/fssm/support.rb +0 -63
- data/vendor/plugins/haml/vendor/fssm/lib/fssm/tree.rb +0 -176
- data/vendor/plugins/haml/vendor/fssm/profile/prof-cache.rb +0 -40
- data/vendor/plugins/haml/vendor/fssm/profile/prof-fssm-pathname.html +0 -1231
- data/vendor/plugins/haml/vendor/fssm/profile/prof-pathname.rb +0 -68
- data/vendor/plugins/haml/vendor/fssm/profile/prof-plain-pathname.html +0 -988
- data/vendor/plugins/haml/vendor/fssm/profile/prof.html +0 -2379
- data/vendor/plugins/haml/vendor/fssm/spec/path_spec.rb +0 -75
- data/vendor/plugins/haml/vendor/fssm/spec/root/duck/quack.txt +0 -0
- data/vendor/plugins/haml/vendor/fssm/spec/root/file.css +0 -0
- data/vendor/plugins/haml/vendor/fssm/spec/root/file.rb +0 -0
- data/vendor/plugins/haml/vendor/fssm/spec/root/file.yml +0 -0
- data/vendor/plugins/haml/vendor/fssm/spec/root/moo/cow.txt +0 -0
- data/vendor/plugins/haml/vendor/fssm/spec/spec_helper.rb +0 -14
- data/vendor/plugins/haml/yard/callbacks.rb +0 -29
- data/vendor/plugins/haml/yard/default/fulldoc/html/css/common.sass +0 -26
- data/vendor/plugins/haml/yard/default/layout/html/footer.erb +0 -12
- data/vendor/plugins/haml/yard/inherited_hash.rb +0 -41
@@ -1,141 +0,0 @@
|
|
1
|
-
require 'cgi'
|
2
|
-
require 'erubis'
|
3
|
-
require 'ruby_parser'
|
4
|
-
|
5
|
-
module Haml
|
6
|
-
class HTML
|
7
|
-
# A class for converting ERB code into a format that's easier
|
8
|
-
# for the {Haml::HTML} Hpricot-based parser to understand.
|
9
|
-
#
|
10
|
-
# Uses [Erubis](http://www.kuwata-lab.com/erubis)'s extensible parsing powers
|
11
|
-
# to parse the ERB in a reliable way,
|
12
|
-
# and [ruby_parser](http://parsetree.rubyforge.org/)'s Ruby knowledge
|
13
|
-
# to figure out whether a given chunk of Ruby code starts a block or not.
|
14
|
-
#
|
15
|
-
# The ERB tags are converted to HTML tags in the following way.
|
16
|
-
# `<% ... %>` is converted into `<haml:silent> ... </haml:silent>`.
|
17
|
-
# `<%= ... %>` is converted into `<haml:loud> ... </haml:loud>`.
|
18
|
-
# Finally, if either of these opens a Ruby block,
|
19
|
-
# `<haml:block> ... </haml:block>` will wrap the entire contents of the block -
|
20
|
-
# that is, everything that should be indented beneath the previous silent or loud tag.
|
21
|
-
class ERB < Erubis::Basic::Engine
|
22
|
-
# Compiles an ERB template into a HTML document containing `haml:` tags.
|
23
|
-
#
|
24
|
-
# @param template [String] The ERB template
|
25
|
-
# @return [String] The output document
|
26
|
-
# @see Haml::HTML::ERB
|
27
|
-
def self.compile(template)
|
28
|
-
new(template).src
|
29
|
-
end
|
30
|
-
|
31
|
-
# `html2haml` doesn't support HTML-escaped expressions.
|
32
|
-
def escaped_expr(code)
|
33
|
-
raise Haml::Error.new("html2haml doesn't support escaped expressions.")
|
34
|
-
end
|
35
|
-
|
36
|
-
# The ERB-to-Hamlized-HTML conversion has no preamble.
|
37
|
-
def add_preamble(src); end
|
38
|
-
|
39
|
-
# The ERB-to-Hamlized-HTML conversion has no postamble.
|
40
|
-
def add_postamble(src); end
|
41
|
-
|
42
|
-
# Concatenates the text onto the source buffer.
|
43
|
-
#
|
44
|
-
# @param src [String] The source buffer
|
45
|
-
# @param text [String] The raw text to add to the buffer
|
46
|
-
def add_text(src, text)
|
47
|
-
src << text
|
48
|
-
end
|
49
|
-
|
50
|
-
# Concatenates a silent Ruby statement onto the source buffer.
|
51
|
-
# This uses the `<haml:silent>` tag,
|
52
|
-
# and may close and/or open a Ruby block with the `<haml:block>` tag.
|
53
|
-
#
|
54
|
-
# In particular, a block is closed if this statement is some form of `end`,
|
55
|
-
# opened if it's a block opener like `do`, `if`, or `begin`,
|
56
|
-
# and both closed and opened if it's a mid-block keyword
|
57
|
-
# like `else` or `when`.
|
58
|
-
#
|
59
|
-
# @param src [String] The source buffer
|
60
|
-
# @param code [String] The Ruby statement to add to the buffer
|
61
|
-
def add_stmt(src, code)
|
62
|
-
src << '</haml:block>' if block_closer?(code) || mid_block?(code)
|
63
|
-
src << '<haml:silent>' << h(code) << '</haml:silent>' unless code.strip == "end"
|
64
|
-
src << '<haml:block>' if block_opener?(code) || mid_block?(code)
|
65
|
-
end
|
66
|
-
|
67
|
-
# Concatenates a Ruby expression that's printed to the document
|
68
|
-
# onto the source buffer.
|
69
|
-
# This uses the `<haml:silent>` tag,
|
70
|
-
# and may open a Ruby block with the `<haml:block>` tag.
|
71
|
-
# An expression never closes a block.
|
72
|
-
#
|
73
|
-
# @param src [String] The source buffer
|
74
|
-
# @param code [String] The Ruby expression to add to the buffer
|
75
|
-
def add_expr_literal(src, code)
|
76
|
-
src << '<haml:loud>' << h(code) << '</haml:loud>'
|
77
|
-
src << '<haml:block>' if block_opener?(code)
|
78
|
-
end
|
79
|
-
|
80
|
-
# `html2haml` doesn't support debugging expressions.
|
81
|
-
def add_expr_debug(src, code)
|
82
|
-
raise Haml::Error.new("html2haml doesn't support debugging expressions.")
|
83
|
-
end
|
84
|
-
|
85
|
-
private
|
86
|
-
|
87
|
-
# HTML-escaped some text (in practice, always Ruby code).
|
88
|
-
# A utility method.
|
89
|
-
#
|
90
|
-
# @param text [String] The text to escape
|
91
|
-
# @return [String] The escaped text
|
92
|
-
def h(text)
|
93
|
-
CGI.escapeHTML(text)
|
94
|
-
end
|
95
|
-
|
96
|
-
# Returns whether the code is valid Ruby code on its own.
|
97
|
-
#
|
98
|
-
# @param code [String] Ruby code to check
|
99
|
-
# @return [Boolean]
|
100
|
-
def valid_ruby?(code)
|
101
|
-
RubyParser.new.parse(code)
|
102
|
-
rescue Racc::ParseError => e
|
103
|
-
false
|
104
|
-
end
|
105
|
-
|
106
|
-
# Checks if a string of Ruby code opens a block.
|
107
|
-
# This could either be something like `foo do |a|`
|
108
|
-
# or a keyword that requires a matching `end`
|
109
|
-
# like `if`, `begin`, or `case`.
|
110
|
-
#
|
111
|
-
# @param code [String] Ruby code to check
|
112
|
-
# @return [Boolean]
|
113
|
-
def block_opener?(code)
|
114
|
-
valid_ruby?(code + "\nend") ||
|
115
|
-
valid_ruby?(code + "\nwhen foo\nend")
|
116
|
-
end
|
117
|
-
|
118
|
-
# Checks if a string of Ruby code closes a block.
|
119
|
-
# This is always `end` followed optionally by some method calls.
|
120
|
-
#
|
121
|
-
# @param code [String] Ruby code to check
|
122
|
-
# @return [Boolean]
|
123
|
-
def block_closer?(code)
|
124
|
-
valid_ruby?("begin\n" + code)
|
125
|
-
end
|
126
|
-
|
127
|
-
# Checks if a string of Ruby code comes in the middle of a block.
|
128
|
-
# This could be a keyword like `else`, `rescue`, or `when`,
|
129
|
-
# or even `end` with a method call that takes a block.
|
130
|
-
#
|
131
|
-
# @param code [String] Ruby code to check
|
132
|
-
# @return [Boolean]
|
133
|
-
def mid_block?(code)
|
134
|
-
return if valid_ruby?(code)
|
135
|
-
valid_ruby?("if foo\n#{code}\nend") || # else, elsif
|
136
|
-
valid_ruby?("begin\n#{code}\nend") || # rescue, ensure
|
137
|
-
valid_ruby?("case foo\n#{code}\nend") # when
|
138
|
-
end
|
139
|
-
end
|
140
|
-
end
|
141
|
-
end
|
@@ -1,1104 +0,0 @@
|
|
1
|
-
require 'strscan'
|
2
|
-
require 'haml/shared'
|
3
|
-
|
4
|
-
module Haml
|
5
|
-
# Handles the internal pre-compilation from Haml into Ruby code,
|
6
|
-
# which then runs the final creation of the HTML string.
|
7
|
-
module Precompiler
|
8
|
-
include Haml::Util
|
9
|
-
|
10
|
-
# Designates an XHTML/XML element.
|
11
|
-
ELEMENT = ?%
|
12
|
-
|
13
|
-
# Designates a `<div>` element with the given class.
|
14
|
-
DIV_CLASS = ?.
|
15
|
-
|
16
|
-
# Designates a `<div>` element with the given id.
|
17
|
-
DIV_ID = ?#
|
18
|
-
|
19
|
-
# Designates an XHTML/XML comment.
|
20
|
-
COMMENT = ?/
|
21
|
-
|
22
|
-
# Designates an XHTML doctype or script that is never HTML-escaped.
|
23
|
-
DOCTYPE = ?!
|
24
|
-
|
25
|
-
# Designates script, the result of which is output.
|
26
|
-
SCRIPT = ?=
|
27
|
-
|
28
|
-
# Designates script that is always HTML-escaped.
|
29
|
-
SANITIZE = ?&
|
30
|
-
|
31
|
-
# Designates script, the result of which is flattened and output.
|
32
|
-
FLAT_SCRIPT = ?~
|
33
|
-
|
34
|
-
# Designates script which is run but not output.
|
35
|
-
SILENT_SCRIPT = ?-
|
36
|
-
|
37
|
-
# When following SILENT_SCRIPT, designates a comment that is not output.
|
38
|
-
SILENT_COMMENT = ?#
|
39
|
-
|
40
|
-
# Designates a non-parsed line.
|
41
|
-
ESCAPE = ?\\
|
42
|
-
|
43
|
-
# Designates a block of filtered text.
|
44
|
-
FILTER = ?:
|
45
|
-
|
46
|
-
# Designates a non-parsed line. Not actually a character.
|
47
|
-
PLAIN_TEXT = -1
|
48
|
-
|
49
|
-
# Keeps track of the ASCII values of the characters that begin a
|
50
|
-
# specially-interpreted line.
|
51
|
-
SPECIAL_CHARACTERS = [
|
52
|
-
ELEMENT,
|
53
|
-
DIV_CLASS,
|
54
|
-
DIV_ID,
|
55
|
-
COMMENT,
|
56
|
-
DOCTYPE,
|
57
|
-
SCRIPT,
|
58
|
-
SANITIZE,
|
59
|
-
FLAT_SCRIPT,
|
60
|
-
SILENT_SCRIPT,
|
61
|
-
ESCAPE,
|
62
|
-
FILTER
|
63
|
-
]
|
64
|
-
|
65
|
-
# The value of the character that designates that a line is part
|
66
|
-
# of a multiline string.
|
67
|
-
MULTILINE_CHAR_VALUE = ?|
|
68
|
-
|
69
|
-
# Regex to match keywords that appear in the middle of a Ruby block
|
70
|
-
# with lowered indentation.
|
71
|
-
# If a block has been started using indentation,
|
72
|
-
# lowering the indentation with one of these won't end the block.
|
73
|
-
# For example:
|
74
|
-
#
|
75
|
-
# - if foo
|
76
|
-
# %p yes!
|
77
|
-
# - else
|
78
|
-
# %p no!
|
79
|
-
#
|
80
|
-
# The block is ended after `%p no!`, because `else`
|
81
|
-
# is a member of this array.
|
82
|
-
MID_BLOCK_KEYWORD_REGEX = /^-\s*(#{%w[else elsif rescue ensure when end].join('|')})\b/
|
83
|
-
|
84
|
-
# The Regex that matches a Doctype command.
|
85
|
-
DOCTYPE_REGEX = /(\d(?:\.\d)?)?[\s]*([a-z]*)/i
|
86
|
-
|
87
|
-
# The Regex that matches a literal string or symbol value
|
88
|
-
LITERAL_VALUE_REGEX = /:(\w*)|(["'])((?![\\#]|\2).|\\.)*\2/
|
89
|
-
|
90
|
-
private
|
91
|
-
|
92
|
-
# Returns the precompiled string with the preamble and postamble
|
93
|
-
def precompiled_with_ambles(local_names)
|
94
|
-
preamble = <<END.gsub("\n", ";")
|
95
|
-
begin
|
96
|
-
extend Haml::Helpers
|
97
|
-
_hamlout = @haml_buffer = Haml::Buffer.new(@haml_buffer, #{options_for_buffer.inspect})
|
98
|
-
_erbout = _hamlout.buffer
|
99
|
-
__in_erb_template = true
|
100
|
-
END
|
101
|
-
postamble = <<END.gsub("\n", ";")
|
102
|
-
#{precompiled_method_return_value}
|
103
|
-
ensure
|
104
|
-
@haml_buffer = @haml_buffer.upper
|
105
|
-
end
|
106
|
-
END
|
107
|
-
preamble + locals_code(local_names) + precompiled + postamble
|
108
|
-
end
|
109
|
-
|
110
|
-
# Returns the string used as the return value of the precompiled method.
|
111
|
-
# This method exists so it can be monkeypatched to return modified values.
|
112
|
-
def precompiled_method_return_value
|
113
|
-
"_erbout"
|
114
|
-
end
|
115
|
-
|
116
|
-
def locals_code(names)
|
117
|
-
names = names.keys if Hash == names
|
118
|
-
|
119
|
-
names.map do |name|
|
120
|
-
# Can't use || because someone might explicitly pass in false with a symbol
|
121
|
-
sym_local = "_haml_locals[#{inspect_obj(name.to_sym)}]"
|
122
|
-
str_local = "_haml_locals[#{inspect_obj(name.to_s)}]"
|
123
|
-
"#{name} = #{sym_local}.nil? ? #{str_local} : #{sym_local}"
|
124
|
-
end.join(';') + ';'
|
125
|
-
end
|
126
|
-
|
127
|
-
# @private
|
128
|
-
class Line < Struct.new(:text, :unstripped, :full, :index, :precompiler, :eod)
|
129
|
-
alias_method :eod?, :eod
|
130
|
-
|
131
|
-
# @private
|
132
|
-
def tabs
|
133
|
-
line = self
|
134
|
-
@tabs ||= precompiler.instance_eval do
|
135
|
-
break 0 if line.text.empty? || !(whitespace = line.full[/^\s+/])
|
136
|
-
|
137
|
-
if @indentation.nil?
|
138
|
-
@indentation = whitespace
|
139
|
-
|
140
|
-
if @indentation.include?(?\s) && @indentation.include?(?\t)
|
141
|
-
raise SyntaxError.new("Indentation can't use both tabs and spaces.", line.index)
|
142
|
-
end
|
143
|
-
|
144
|
-
@flat_spaces = @indentation * @template_tabs if flat?
|
145
|
-
break 1
|
146
|
-
end
|
147
|
-
|
148
|
-
tabs = whitespace.length / @indentation.length
|
149
|
-
break tabs if whitespace == @indentation * tabs
|
150
|
-
break @template_tabs if flat? && whitespace =~ /^#{@indentation * @template_tabs}/
|
151
|
-
|
152
|
-
raise SyntaxError.new(<<END.strip.gsub("\n", ' '), line.index)
|
153
|
-
Inconsistent indentation: #{Haml::Shared.human_indentation whitespace, true} used for indentation,
|
154
|
-
but the rest of the document was indented using #{Haml::Shared.human_indentation @indentation}.
|
155
|
-
END
|
156
|
-
end
|
157
|
-
end
|
158
|
-
end
|
159
|
-
|
160
|
-
def precompile
|
161
|
-
@haml_comment = @dont_indent_next_line = @dont_tab_up_next_text = false
|
162
|
-
@indentation = nil
|
163
|
-
@line = next_line
|
164
|
-
resolve_newlines
|
165
|
-
newline
|
166
|
-
|
167
|
-
raise SyntaxError.new("Indenting at the beginning of the document is illegal.", @line.index) if @line.tabs != 0
|
168
|
-
|
169
|
-
while next_line
|
170
|
-
process_indent(@line) unless @line.text.empty?
|
171
|
-
|
172
|
-
if flat?
|
173
|
-
push_flat(@line)
|
174
|
-
@line = @next_line
|
175
|
-
next
|
176
|
-
end
|
177
|
-
|
178
|
-
process_line(@line.text, @line.index) unless @line.text.empty? || @haml_comment
|
179
|
-
|
180
|
-
if !flat? && @next_line.tabs - @line.tabs > 1
|
181
|
-
raise SyntaxError.new("The line was indented #{@next_line.tabs - @line.tabs} levels deeper than the previous line.", @next_line.index)
|
182
|
-
end
|
183
|
-
|
184
|
-
resolve_newlines unless @next_line.eod?
|
185
|
-
@line = @next_line
|
186
|
-
newline unless @next_line.eod?
|
187
|
-
end
|
188
|
-
|
189
|
-
# Close all the open tags
|
190
|
-
close until @to_close_stack.empty?
|
191
|
-
flush_merged_text
|
192
|
-
end
|
193
|
-
|
194
|
-
# Processes and deals with lowering indentation.
|
195
|
-
def process_indent(line)
|
196
|
-
return unless line.tabs <= @template_tabs && @template_tabs > 0
|
197
|
-
|
198
|
-
to_close = @template_tabs - line.tabs
|
199
|
-
to_close.times {|i| close unless to_close - 1 - i == 0 && mid_block_keyword?(line.text)}
|
200
|
-
end
|
201
|
-
|
202
|
-
# Processes a single line of Haml.
|
203
|
-
#
|
204
|
-
# This method doesn't return anything; it simply processes the line and
|
205
|
-
# adds the appropriate code to `@precompiled`.
|
206
|
-
def process_line(text, index)
|
207
|
-
@index = index + 1
|
208
|
-
|
209
|
-
case text[0]
|
210
|
-
when DIV_CLASS; render_div(text)
|
211
|
-
when DIV_ID
|
212
|
-
return push_plain(text) if text[1] == ?{
|
213
|
-
render_div(text)
|
214
|
-
when ELEMENT; render_tag(text)
|
215
|
-
when COMMENT; render_comment(text[1..-1].strip)
|
216
|
-
when SANITIZE
|
217
|
-
return push_plain(text[3..-1].strip, :escape_html => true) if text[1..2] == "=="
|
218
|
-
return push_script(text[2..-1].strip, :escape_html => true) if text[1] == SCRIPT
|
219
|
-
return push_flat_script(text[2..-1].strip, :escape_html => true) if text[1] == FLAT_SCRIPT
|
220
|
-
return push_plain(text[1..-1].strip, :escape_html => true) if text[1] == ?\s
|
221
|
-
push_plain text
|
222
|
-
when SCRIPT
|
223
|
-
return push_plain(text[2..-1].strip) if text[1] == SCRIPT
|
224
|
-
push_script(text[1..-1])
|
225
|
-
when FLAT_SCRIPT; push_flat_script(text[1..-1])
|
226
|
-
when SILENT_SCRIPT
|
227
|
-
return start_haml_comment if text[1] == SILENT_COMMENT
|
228
|
-
|
229
|
-
raise SyntaxError.new(<<END.rstrip, index) if text[1..-1].strip == "end"
|
230
|
-
You don't need to use "- end" in Haml. Un-indent to close a block:
|
231
|
-
- if foo?
|
232
|
-
%strong Foo!
|
233
|
-
- else
|
234
|
-
Not foo.
|
235
|
-
%p This line is un-indented, so it isn't part of the "if" block
|
236
|
-
END
|
237
|
-
|
238
|
-
text = handle_ruby_multiline(text)
|
239
|
-
push_silent(text[1..-1], true)
|
240
|
-
newline_now
|
241
|
-
|
242
|
-
# Handle stuff like - end.join("|")
|
243
|
-
@to_close_stack.last << false if text =~ /^-\s*end\b/ && !block_opened?
|
244
|
-
|
245
|
-
keyword = mid_block_keyword?(text)
|
246
|
-
block = block_opened? && !keyword
|
247
|
-
|
248
|
-
# It's important to preserve tabulation modification for keywords
|
249
|
-
# that involve choosing between posible blocks of code.
|
250
|
-
if %w[else elsif when].include?(keyword)
|
251
|
-
# Whether a script block has already been opened immediately above this line
|
252
|
-
was_opened = @to_close_stack.last && @to_close_stack.last.first == :script
|
253
|
-
if was_opened
|
254
|
-
@dont_indent_next_line, @dont_tab_up_next_text = @to_close_stack.last[1..2]
|
255
|
-
end
|
256
|
-
|
257
|
-
# when is unusual in that either it will be indented twice,
|
258
|
-
# or the case won't have created its own indentation.
|
259
|
-
# Also, if no block has been opened yet, we need to make sure we add an end
|
260
|
-
# once we de-indent.
|
261
|
-
if !was_opened || keyword == "when"
|
262
|
-
push_and_tabulate([
|
263
|
-
:script, @dont_indent_next_line, @dont_tab_up_next_text,
|
264
|
-
!was_opened])
|
265
|
-
end
|
266
|
-
elsif block || text =~ /^-\s*(case|if)\b/
|
267
|
-
push_and_tabulate([:script, @dont_indent_next_line, @dont_tab_up_next_text])
|
268
|
-
end
|
269
|
-
when FILTER; start_filtered(text[1..-1].downcase)
|
270
|
-
when DOCTYPE
|
271
|
-
return render_doctype(text) if text[0...3] == '!!!'
|
272
|
-
return push_plain(text[3..-1].strip, :escape_html => false) if text[1..2] == "=="
|
273
|
-
return push_script(text[2..-1].strip, :escape_html => false) if text[1] == SCRIPT
|
274
|
-
return push_flat_script(text[2..-1].strip, :escape_html => false) if text[1] == FLAT_SCRIPT
|
275
|
-
return push_plain(text[1..-1].strip, :escape_html => false) if text[1] == ?\s
|
276
|
-
push_plain text
|
277
|
-
when ESCAPE; push_plain text[1..-1]
|
278
|
-
else push_plain text
|
279
|
-
end
|
280
|
-
end
|
281
|
-
|
282
|
-
# If the text is a silent script text with one of Ruby's mid-block keywords,
|
283
|
-
# returns the name of that keyword.
|
284
|
-
# Otherwise, returns nil.
|
285
|
-
def mid_block_keyword?(text)
|
286
|
-
text[MID_BLOCK_KEYWORD_REGEX, 1]
|
287
|
-
end
|
288
|
-
|
289
|
-
# Evaluates `text` in the context of the scope object, but
|
290
|
-
# does not output the result.
|
291
|
-
def push_silent(text, can_suppress = false)
|
292
|
-
flush_merged_text
|
293
|
-
return if can_suppress && options[:suppress_eval]
|
294
|
-
@precompiled << "#{text};"
|
295
|
-
end
|
296
|
-
|
297
|
-
# Adds `text` to `@buffer` with appropriate tabulation
|
298
|
-
# without parsing it.
|
299
|
-
def push_merged_text(text, tab_change = 0, indent = true)
|
300
|
-
text = !indent || @dont_indent_next_line || @options[:ugly] ? text : "#{' ' * @output_tabs}#{text}"
|
301
|
-
@to_merge << [:text, text, tab_change]
|
302
|
-
@dont_indent_next_line = false
|
303
|
-
end
|
304
|
-
|
305
|
-
# Concatenate `text` to `@buffer` without tabulation.
|
306
|
-
def concat_merged_text(text)
|
307
|
-
@to_merge << [:text, text, 0]
|
308
|
-
end
|
309
|
-
|
310
|
-
def push_text(text, tab_change = 0)
|
311
|
-
push_merged_text("#{text}\n", tab_change)
|
312
|
-
end
|
313
|
-
|
314
|
-
def flush_merged_text
|
315
|
-
return if @to_merge.empty?
|
316
|
-
|
317
|
-
str = ""
|
318
|
-
mtabs = 0
|
319
|
-
newlines = 0
|
320
|
-
@to_merge.each do |type, val, tabs|
|
321
|
-
case type
|
322
|
-
when :text
|
323
|
-
str << inspect_obj(val)[1...-1]
|
324
|
-
mtabs += tabs
|
325
|
-
when :script
|
326
|
-
if mtabs != 0 && !@options[:ugly]
|
327
|
-
val = "_hamlout.adjust_tabs(#{mtabs}); " + val
|
328
|
-
end
|
329
|
-
str << "\#{#{"\n" * newlines}#{val}}"
|
330
|
-
mtabs = 0
|
331
|
-
newlines = 0
|
332
|
-
when :newlines
|
333
|
-
newlines += val
|
334
|
-
else
|
335
|
-
raise SyntaxError.new("[HAML BUG] Undefined entry in Haml::Precompiler@to_merge.")
|
336
|
-
end
|
337
|
-
end
|
338
|
-
|
339
|
-
unless str.empty?
|
340
|
-
@precompiled <<
|
341
|
-
if @options[:ugly]
|
342
|
-
"_hamlout.buffer << \"#{str}\";"
|
343
|
-
else
|
344
|
-
"_hamlout.push_text(\"#{str}\", #{mtabs}, #{@dont_tab_up_next_text.inspect});"
|
345
|
-
end
|
346
|
-
end
|
347
|
-
@precompiled << "\n" * newlines
|
348
|
-
@to_merge = []
|
349
|
-
@dont_tab_up_next_text = false
|
350
|
-
end
|
351
|
-
|
352
|
-
# Renders a block of text as plain text.
|
353
|
-
# Also checks for an illegally opened block.
|
354
|
-
def push_plain(text, options = {})
|
355
|
-
if block_opened?
|
356
|
-
raise SyntaxError.new("Illegal nesting: nesting within plain text is illegal.", @next_line.index)
|
357
|
-
end
|
358
|
-
|
359
|
-
if contains_interpolation?(text)
|
360
|
-
options[:escape_html] = self.options[:escape_html] if options[:escape_html].nil?
|
361
|
-
push_script(
|
362
|
-
unescape_interpolation(text, :escape_html => options[:escape_html]),
|
363
|
-
:escape_html => false)
|
364
|
-
else
|
365
|
-
push_text text
|
366
|
-
end
|
367
|
-
end
|
368
|
-
|
369
|
-
# Adds +text+ to `@buffer` while flattening text.
|
370
|
-
def push_flat(line)
|
371
|
-
text = line.full.dup
|
372
|
-
text = "" unless text.gsub!(/^#{@flat_spaces}/, '')
|
373
|
-
@filter_buffer << "#{text}\n"
|
374
|
-
end
|
375
|
-
|
376
|
-
# Causes `text` to be evaluated in the context of
|
377
|
-
# the scope object and the result to be added to `@buffer`.
|
378
|
-
#
|
379
|
-
# If `opts[:preserve_script]` is true, Haml::Helpers#find_and_flatten is run on
|
380
|
-
# the result before it is added to `@buffer`
|
381
|
-
def push_script(text, opts = {})
|
382
|
-
raise SyntaxError.new("There's no Ruby code for = to evaluate.") if text.empty?
|
383
|
-
text = handle_ruby_multiline(text)
|
384
|
-
return if options[:suppress_eval]
|
385
|
-
opts[:escape_html] = options[:escape_html] if opts[:escape_html].nil?
|
386
|
-
|
387
|
-
args = %w[preserve_script in_tag preserve_tag escape_html nuke_inner_whitespace]
|
388
|
-
args.map! {|name| opts[name.to_sym]}
|
389
|
-
args << !block_opened? << @options[:ugly]
|
390
|
-
|
391
|
-
no_format = @options[:ugly] &&
|
392
|
-
!(opts[:preserve_script] || opts[:preserve_tag] || opts[:escape_html])
|
393
|
-
output_expr = "(#{text}\n)"
|
394
|
-
static_method = "_hamlout.#{static_method_name(:format_script, *args)}"
|
395
|
-
|
396
|
-
# Prerender tabulation unless we're in a tag
|
397
|
-
push_merged_text '' unless opts[:in_tag]
|
398
|
-
|
399
|
-
unless block_opened?
|
400
|
-
@to_merge << [:script, no_format ? "#{text}\n" : "#{static_method}(#{output_expr});"]
|
401
|
-
concat_merged_text("\n") unless opts[:in_tag] || opts[:nuke_inner_whitespace]
|
402
|
-
@newlines -= 1
|
403
|
-
return
|
404
|
-
end
|
405
|
-
|
406
|
-
flush_merged_text
|
407
|
-
|
408
|
-
push_silent "haml_temp = #{text}"
|
409
|
-
newline_now
|
410
|
-
push_and_tabulate([:loud, "_hamlout.buffer << #{no_format ? "haml_temp.to_s;" : "#{static_method}(haml_temp);"}",
|
411
|
-
!(opts[:in_tag] || opts[:nuke_inner_whitespace] || @options[:ugly])])
|
412
|
-
end
|
413
|
-
|
414
|
-
# Causes `text` to be evaluated, and Haml::Helpers#find_and_flatten
|
415
|
-
# to be run on it afterwards.
|
416
|
-
def push_flat_script(text, options = {})
|
417
|
-
flush_merged_text
|
418
|
-
|
419
|
-
raise SyntaxError.new("There's no Ruby code for ~ to evaluate.") if text.empty?
|
420
|
-
push_script(text, options.merge(:preserve_script => true))
|
421
|
-
end
|
422
|
-
|
423
|
-
def start_haml_comment
|
424
|
-
return unless block_opened?
|
425
|
-
|
426
|
-
@haml_comment = true
|
427
|
-
push_and_tabulate([:haml_comment])
|
428
|
-
end
|
429
|
-
|
430
|
-
# Closes the most recent item in `@to_close_stack`.
|
431
|
-
def close
|
432
|
-
tag, *rest = @to_close_stack.pop
|
433
|
-
send("close_#{tag}", *rest)
|
434
|
-
end
|
435
|
-
|
436
|
-
# Puts a line in `@precompiled` that will add the closing tag of
|
437
|
-
# the most recently opened tag.
|
438
|
-
def close_element(value)
|
439
|
-
tag, nuke_outer_whitespace, nuke_inner_whitespace = value
|
440
|
-
@output_tabs -= 1 unless nuke_inner_whitespace
|
441
|
-
@template_tabs -= 1
|
442
|
-
rstrip_buffer! if nuke_inner_whitespace
|
443
|
-
push_merged_text("</#{tag}>" + (nuke_outer_whitespace ? "" : "\n"),
|
444
|
-
nuke_inner_whitespace ? 0 : -1, !nuke_inner_whitespace)
|
445
|
-
@dont_indent_next_line = nuke_outer_whitespace
|
446
|
-
end
|
447
|
-
|
448
|
-
# Closes a Ruby block.
|
449
|
-
def close_script(_1, _2, push_end = true)
|
450
|
-
push_silent("end", true) if push_end
|
451
|
-
@template_tabs -= 1
|
452
|
-
end
|
453
|
-
|
454
|
-
# Closes a comment.
|
455
|
-
def close_comment(has_conditional)
|
456
|
-
@output_tabs -= 1
|
457
|
-
@template_tabs -= 1
|
458
|
-
close_tag = has_conditional ? "<![endif]-->" : "-->"
|
459
|
-
push_text(close_tag, -1)
|
460
|
-
end
|
461
|
-
|
462
|
-
# Closes a loud Ruby block.
|
463
|
-
def close_loud(command, add_newline, push_end = true)
|
464
|
-
push_silent('end', true) if push_end
|
465
|
-
@precompiled << command
|
466
|
-
@template_tabs -= 1
|
467
|
-
concat_merged_text("\n") if add_newline
|
468
|
-
end
|
469
|
-
|
470
|
-
# Closes a filtered block.
|
471
|
-
def close_filtered(filter)
|
472
|
-
filter.internal_compile(self, @filter_buffer)
|
473
|
-
@flat = false
|
474
|
-
@flat_spaces = nil
|
475
|
-
@filter_buffer = nil
|
476
|
-
@template_tabs -= 1
|
477
|
-
end
|
478
|
-
|
479
|
-
def close_haml_comment
|
480
|
-
@haml_comment = false
|
481
|
-
@template_tabs -= 1
|
482
|
-
end
|
483
|
-
|
484
|
-
def close_nil(*args)
|
485
|
-
@template_tabs -= 1
|
486
|
-
end
|
487
|
-
|
488
|
-
# This is a class method so it can be accessed from {Haml::Helpers}.
|
489
|
-
#
|
490
|
-
# Iterates through the classes and ids supplied through `.`
|
491
|
-
# and `#` syntax, and returns a hash with them as attributes,
|
492
|
-
# that can then be merged with another attributes hash.
|
493
|
-
def self.parse_class_and_id(list)
|
494
|
-
attributes = {}
|
495
|
-
list.scan(/([#.])([-:_a-zA-Z0-9]+)/) do |type, property|
|
496
|
-
case type
|
497
|
-
when '.'
|
498
|
-
if attributes['class']
|
499
|
-
attributes['class'] += " "
|
500
|
-
else
|
501
|
-
attributes['class'] = ""
|
502
|
-
end
|
503
|
-
attributes['class'] += property
|
504
|
-
when '#'; attributes['id'] = property
|
505
|
-
end
|
506
|
-
end
|
507
|
-
attributes
|
508
|
-
end
|
509
|
-
|
510
|
-
def parse_static_hash(text)
|
511
|
-
attributes = {}
|
512
|
-
scanner = StringScanner.new(text)
|
513
|
-
scanner.scan(/\s+/)
|
514
|
-
until scanner.eos?
|
515
|
-
return unless key = scanner.scan(LITERAL_VALUE_REGEX)
|
516
|
-
return unless scanner.scan(/\s*=>\s*/)
|
517
|
-
return unless value = scanner.scan(LITERAL_VALUE_REGEX)
|
518
|
-
return unless scanner.scan(/\s*(?:,|$)\s*/)
|
519
|
-
attributes[eval(key).to_s] = eval(value).to_s
|
520
|
-
end
|
521
|
-
text.count("\n").times { newline }
|
522
|
-
attributes
|
523
|
-
end
|
524
|
-
|
525
|
-
# This is a class method so it can be accessed from Buffer.
|
526
|
-
def self.build_attributes(is_html, attr_wrapper, attributes = {})
|
527
|
-
quote_escape = attr_wrapper == '"' ? """ : "'"
|
528
|
-
other_quote_char = attr_wrapper == '"' ? "'" : '"'
|
529
|
-
|
530
|
-
if attributes['data'].is_a?(Hash)
|
531
|
-
attributes = attributes.dup
|
532
|
-
attributes =
|
533
|
-
Haml::Util.map_keys(attributes.delete('data')) {|name| "data-#{name}"}.merge(attributes)
|
534
|
-
end
|
535
|
-
|
536
|
-
result = attributes.collect do |attr, value|
|
537
|
-
next if value.nil?
|
538
|
-
|
539
|
-
value = filter_and_join(value, ' ') if attr == 'class'
|
540
|
-
value = filter_and_join(value, '_') if attr == 'id'
|
541
|
-
|
542
|
-
if value == true
|
543
|
-
next " #{attr}" if is_html
|
544
|
-
next " #{attr}=#{attr_wrapper}#{attr}#{attr_wrapper}"
|
545
|
-
elsif value == false
|
546
|
-
next
|
547
|
-
end
|
548
|
-
|
549
|
-
value = Haml::Helpers.preserve(Haml::Helpers.escape_once(value.to_s))
|
550
|
-
# We want to decide whether or not to escape quotes
|
551
|
-
value.gsub!('"', '"')
|
552
|
-
this_attr_wrapper = attr_wrapper
|
553
|
-
if value.include? attr_wrapper
|
554
|
-
if value.include? other_quote_char
|
555
|
-
value = value.gsub(attr_wrapper, quote_escape)
|
556
|
-
else
|
557
|
-
this_attr_wrapper = other_quote_char
|
558
|
-
end
|
559
|
-
end
|
560
|
-
" #{attr}=#{this_attr_wrapper}#{value}#{this_attr_wrapper}"
|
561
|
-
end
|
562
|
-
result.compact.sort.join
|
563
|
-
end
|
564
|
-
|
565
|
-
def self.filter_and_join(value, separator)
|
566
|
-
return "" if value == ""
|
567
|
-
value = [value] unless value.is_a?(Array)
|
568
|
-
value = value.flatten.collect {|item| item ? item.to_s : nil}.compact.join(separator)
|
569
|
-
return !value.empty? && value
|
570
|
-
end
|
571
|
-
|
572
|
-
def prerender_tag(name, self_close, attributes)
|
573
|
-
attributes_string = Precompiler.build_attributes(html?, @options[:attr_wrapper], attributes)
|
574
|
-
"<#{name}#{attributes_string}#{self_close && xhtml? ? ' /' : ''}>"
|
575
|
-
end
|
576
|
-
|
577
|
-
# Parses a line into tag_name, attributes, attributes_hash, object_ref, action, value
|
578
|
-
def parse_tag(line)
|
579
|
-
raise SyntaxError.new("Invalid tag: \"#{line}\".") unless match = line.scan(/%([-:\w]+)([-:\w\.\#]*)(.*)/)[0]
|
580
|
-
tag_name, attributes, rest = match
|
581
|
-
new_attributes_hash = old_attributes_hash = last_line = object_ref = nil
|
582
|
-
attributes_hashes = {}
|
583
|
-
while rest
|
584
|
-
case rest[0]
|
585
|
-
when ?{
|
586
|
-
break if old_attributes_hash
|
587
|
-
old_attributes_hash, rest, last_line = parse_old_attributes(rest)
|
588
|
-
attributes_hashes[:old] = old_attributes_hash
|
589
|
-
when ?(
|
590
|
-
break if new_attributes_hash
|
591
|
-
new_attributes_hash, rest, last_line = parse_new_attributes(rest)
|
592
|
-
attributes_hashes[:new] = new_attributes_hash
|
593
|
-
when ?[
|
594
|
-
break if object_ref
|
595
|
-
object_ref, rest = balance(rest, ?[, ?])
|
596
|
-
else; break
|
597
|
-
end
|
598
|
-
end
|
599
|
-
|
600
|
-
if rest
|
601
|
-
nuke_whitespace, action, value = rest.scan(/(<>|><|[><])?([=\/\~&!])?(.*)?/)[0]
|
602
|
-
nuke_whitespace ||= ''
|
603
|
-
nuke_outer_whitespace = nuke_whitespace.include? '>'
|
604
|
-
nuke_inner_whitespace = nuke_whitespace.include? '<'
|
605
|
-
end
|
606
|
-
|
607
|
-
value = value.to_s.strip
|
608
|
-
[tag_name, attributes, attributes_hashes, object_ref, nuke_outer_whitespace,
|
609
|
-
nuke_inner_whitespace, action, value, last_line || @index]
|
610
|
-
end
|
611
|
-
|
612
|
-
def parse_old_attributes(line)
|
613
|
-
line = line.dup
|
614
|
-
last_line = @index
|
615
|
-
|
616
|
-
begin
|
617
|
-
attributes_hash, rest = balance(line, ?{, ?})
|
618
|
-
rescue SyntaxError => e
|
619
|
-
if line.strip[-1] == ?, && e.message == "Unbalanced brackets."
|
620
|
-
line << "\n" << @next_line.text
|
621
|
-
last_line += 1
|
622
|
-
next_line
|
623
|
-
retry
|
624
|
-
end
|
625
|
-
|
626
|
-
raise e
|
627
|
-
end
|
628
|
-
|
629
|
-
attributes_hash = attributes_hash[1...-1] if attributes_hash
|
630
|
-
return attributes_hash, rest, last_line
|
631
|
-
end
|
632
|
-
|
633
|
-
def parse_new_attributes(line)
|
634
|
-
line = line.dup
|
635
|
-
scanner = StringScanner.new(line)
|
636
|
-
last_line = @index
|
637
|
-
attributes = {}
|
638
|
-
|
639
|
-
scanner.scan(/\(\s*/)
|
640
|
-
loop do
|
641
|
-
name, value = parse_new_attribute(scanner)
|
642
|
-
break if name.nil?
|
643
|
-
|
644
|
-
if name == false
|
645
|
-
text = (Haml::Shared.balance(line, ?(, ?)) || [line]).first
|
646
|
-
raise Haml::SyntaxError.new("Invalid attribute list: #{text.inspect}.", last_line - 1)
|
647
|
-
end
|
648
|
-
attributes[name] = value
|
649
|
-
scanner.scan(/\s*/)
|
650
|
-
|
651
|
-
if scanner.eos?
|
652
|
-
line << " " << @next_line.text
|
653
|
-
last_line += 1
|
654
|
-
next_line
|
655
|
-
scanner.scan(/\s*/)
|
656
|
-
end
|
657
|
-
end
|
658
|
-
|
659
|
-
static_attributes = {}
|
660
|
-
dynamic_attributes = "{"
|
661
|
-
attributes.each do |name, (type, val)|
|
662
|
-
if type == :static
|
663
|
-
static_attributes[name] = val
|
664
|
-
else
|
665
|
-
dynamic_attributes << inspect_obj(name) << " => " << val << ","
|
666
|
-
end
|
667
|
-
end
|
668
|
-
dynamic_attributes << "}"
|
669
|
-
dynamic_attributes = nil if dynamic_attributes == "{}"
|
670
|
-
|
671
|
-
return [static_attributes, dynamic_attributes], scanner.rest, last_line
|
672
|
-
end
|
673
|
-
|
674
|
-
def parse_new_attribute(scanner)
|
675
|
-
unless name = scanner.scan(/[-:\w]+/)
|
676
|
-
return if scanner.scan(/\)/)
|
677
|
-
return false
|
678
|
-
end
|
679
|
-
|
680
|
-
scanner.scan(/\s*/)
|
681
|
-
return name, [:static, true] unless scanner.scan(/=/) #/end
|
682
|
-
|
683
|
-
scanner.scan(/\s*/)
|
684
|
-
unless quote = scanner.scan(/["']/)
|
685
|
-
return false unless var = scanner.scan(/(@@?|\$)?\w+/)
|
686
|
-
return name, [:dynamic, var]
|
687
|
-
end
|
688
|
-
|
689
|
-
re = /((?:\\.|\#(?!\{)|[^#{quote}\\#])*)(#{quote}|#\{)/
|
690
|
-
content = []
|
691
|
-
loop do
|
692
|
-
return false unless scanner.scan(re)
|
693
|
-
content << [:str, scanner[1].gsub(/\\(.)/, '\1')]
|
694
|
-
break if scanner[2] == quote
|
695
|
-
content << [:ruby, balance(scanner, ?{, ?}, 1).first[0...-1]]
|
696
|
-
end
|
697
|
-
|
698
|
-
return name, [:static, content.first[1]] if content.size == 1
|
699
|
-
return name, [:dynamic,
|
700
|
-
'"' + content.map {|(t, v)| t == :str ? inspect_obj(v)[1...-1] : "\#{#{v}}"}.join + '"']
|
701
|
-
end
|
702
|
-
|
703
|
-
# Parses a line that will render as an XHTML tag, and adds the code that will
|
704
|
-
# render that tag to `@precompiled`.
|
705
|
-
def render_tag(line)
|
706
|
-
tag_name, attributes, attributes_hashes, object_ref, nuke_outer_whitespace,
|
707
|
-
nuke_inner_whitespace, action, value, last_line = parse_tag(line)
|
708
|
-
|
709
|
-
raise SyntaxError.new("Illegal element: classes and ids must have values.") if attributes =~ /[\.#](\.|#|\z)/
|
710
|
-
|
711
|
-
# Get rid of whitespace outside of the tag if we need to
|
712
|
-
rstrip_buffer! if nuke_outer_whitespace
|
713
|
-
|
714
|
-
preserve_tag = options[:preserve].include?(tag_name)
|
715
|
-
nuke_inner_whitespace ||= preserve_tag
|
716
|
-
preserve_tag &&= !options[:ugly]
|
717
|
-
|
718
|
-
escape_html = (action == '&' || (action != '!' && @options[:escape_html]))
|
719
|
-
|
720
|
-
case action
|
721
|
-
when '/'; self_closing = true
|
722
|
-
when '~'; parse = preserve_script = true
|
723
|
-
when '='
|
724
|
-
parse = true
|
725
|
-
if value[0] == ?=
|
726
|
-
value = unescape_interpolation(value[1..-1].strip, :escape_html => escape_html)
|
727
|
-
escape_html = false
|
728
|
-
end
|
729
|
-
when '&', '!'
|
730
|
-
if value[0] == ?= || value[0] == ?~
|
731
|
-
parse = true
|
732
|
-
preserve_script = (value[0] == ?~)
|
733
|
-
if value[1] == ?=
|
734
|
-
value = unescape_interpolation(value[2..-1].strip, :escape_html => escape_html)
|
735
|
-
escape_html = false
|
736
|
-
else
|
737
|
-
value = value[1..-1].strip
|
738
|
-
end
|
739
|
-
elsif contains_interpolation?(value)
|
740
|
-
value = unescape_interpolation(value, :escape_html => escape_html)
|
741
|
-
parse = true
|
742
|
-
escape_html = false
|
743
|
-
end
|
744
|
-
else
|
745
|
-
if contains_interpolation?(value)
|
746
|
-
value = unescape_interpolation(value, :escape_html => escape_html)
|
747
|
-
parse = true
|
748
|
-
escape_html = false
|
749
|
-
end
|
750
|
-
end
|
751
|
-
|
752
|
-
if parse && @options[:suppress_eval]
|
753
|
-
parse = false
|
754
|
-
value = ''
|
755
|
-
end
|
756
|
-
|
757
|
-
object_ref = "nil" if object_ref.nil? || @options[:suppress_eval]
|
758
|
-
|
759
|
-
attributes = Precompiler.parse_class_and_id(attributes)
|
760
|
-
attributes_list = []
|
761
|
-
|
762
|
-
if attributes_hashes[:new]
|
763
|
-
static_attributes, attributes_hash = attributes_hashes[:new]
|
764
|
-
Buffer.merge_attrs(attributes, static_attributes) if static_attributes
|
765
|
-
attributes_list << attributes_hash
|
766
|
-
end
|
767
|
-
|
768
|
-
if attributes_hashes[:old]
|
769
|
-
static_attributes = parse_static_hash(attributes_hashes[:old])
|
770
|
-
Buffer.merge_attrs(attributes, static_attributes) if static_attributes
|
771
|
-
attributes_list << attributes_hashes[:old] unless static_attributes || @options[:suppress_eval]
|
772
|
-
end
|
773
|
-
|
774
|
-
attributes_list.compact!
|
775
|
-
|
776
|
-
raise SyntaxError.new("Illegal nesting: nesting within a self-closing tag is illegal.", @next_line.index) if block_opened? && self_closing
|
777
|
-
raise SyntaxError.new("There's no Ruby code for #{action} to evaluate.", last_line - 1) if parse && value.empty?
|
778
|
-
raise SyntaxError.new("Self-closing tags can't have content.", last_line - 1) if self_closing && !value.empty?
|
779
|
-
|
780
|
-
if block_opened? && !value.empty? && !is_ruby_multiline?(value)
|
781
|
-
raise SyntaxError.new("Illegal nesting: content can't be both given on the same line as %#{tag_name} and nested within it.", @next_line.index)
|
782
|
-
end
|
783
|
-
|
784
|
-
self_closing ||= !!(!block_opened? && value.empty? && @options[:autoclose].any? {|t| t === tag_name})
|
785
|
-
value = nil if value.empty? && (block_opened? || self_closing)
|
786
|
-
|
787
|
-
dont_indent_next_line =
|
788
|
-
(nuke_outer_whitespace && !block_opened?) ||
|
789
|
-
(nuke_inner_whitespace && block_opened?)
|
790
|
-
|
791
|
-
# Check if we can render the tag directly to text and not process it in the buffer
|
792
|
-
if object_ref == "nil" && attributes_list.empty? && !preserve_script
|
793
|
-
tag_closed = !block_opened? && !self_closing && !parse
|
794
|
-
|
795
|
-
open_tag = prerender_tag(tag_name, self_closing, attributes)
|
796
|
-
if tag_closed
|
797
|
-
open_tag << "#{value}</#{tag_name}>"
|
798
|
-
open_tag << "\n" unless nuke_outer_whitespace
|
799
|
-
else
|
800
|
-
open_tag << "\n" unless parse || nuke_inner_whitespace || (self_closing && nuke_outer_whitespace)
|
801
|
-
end
|
802
|
-
|
803
|
-
push_merged_text(open_tag, tag_closed || self_closing || nuke_inner_whitespace ? 0 : 1,
|
804
|
-
!nuke_outer_whitespace)
|
805
|
-
|
806
|
-
@dont_indent_next_line = dont_indent_next_line
|
807
|
-
return if tag_closed
|
808
|
-
else
|
809
|
-
flush_merged_text
|
810
|
-
content = parse ? 'nil' : inspect_obj(value)
|
811
|
-
if attributes_list.empty?
|
812
|
-
attributes_list = ''
|
813
|
-
elsif attributes_list.size == 1
|
814
|
-
attributes_list = ", #{attributes_list.first}"
|
815
|
-
else
|
816
|
-
attributes_list = ", (#{attributes_list.join(").merge(")})"
|
817
|
-
end
|
818
|
-
|
819
|
-
args = [tag_name, self_closing, !block_opened?, preserve_tag, escape_html,
|
820
|
-
attributes, nuke_outer_whitespace, nuke_inner_whitespace
|
821
|
-
].map {|v| inspect_obj(v)}.join(', ')
|
822
|
-
push_silent "_hamlout.open_tag(#{args}, #{object_ref}, #{content}#{attributes_list})"
|
823
|
-
@dont_tab_up_next_text = @dont_indent_next_line = dont_indent_next_line
|
824
|
-
end
|
825
|
-
|
826
|
-
return if self_closing
|
827
|
-
|
828
|
-
if value.nil?
|
829
|
-
push_and_tabulate([:element, [tag_name, nuke_outer_whitespace, nuke_inner_whitespace]])
|
830
|
-
@output_tabs += 1 unless nuke_inner_whitespace
|
831
|
-
return
|
832
|
-
end
|
833
|
-
|
834
|
-
if parse
|
835
|
-
push_script(value, :preserve_script => preserve_script, :in_tag => true,
|
836
|
-
:preserve_tag => preserve_tag, :escape_html => escape_html,
|
837
|
-
:nuke_inner_whitespace => nuke_inner_whitespace)
|
838
|
-
concat_merged_text("</#{tag_name}>" + (nuke_outer_whitespace ? "" : "\n"))
|
839
|
-
end
|
840
|
-
end
|
841
|
-
|
842
|
-
# Renders a line that creates an XHTML tag and has an implicit div because of
|
843
|
-
# `.` or `#`.
|
844
|
-
def render_div(line)
|
845
|
-
render_tag('%div' + line)
|
846
|
-
end
|
847
|
-
|
848
|
-
# Renders an XHTML comment.
|
849
|
-
def render_comment(line)
|
850
|
-
conditional, line = balance(line, ?[, ?]) if line[0] == ?[
|
851
|
-
line.strip!
|
852
|
-
conditional << ">" if conditional
|
853
|
-
|
854
|
-
if block_opened? && !line.empty?
|
855
|
-
raise SyntaxError.new('Illegal nesting: nesting within a tag that already has content is illegal.', @next_line.index)
|
856
|
-
end
|
857
|
-
|
858
|
-
open = "<!--#{conditional}"
|
859
|
-
|
860
|
-
# Render it statically if possible
|
861
|
-
unless line.empty?
|
862
|
-
return push_text("#{open} #{line} #{conditional ? "<![endif]-->" : "-->"}")
|
863
|
-
end
|
864
|
-
|
865
|
-
push_text(open, 1)
|
866
|
-
@output_tabs += 1
|
867
|
-
push_and_tabulate([:comment, !conditional.nil?])
|
868
|
-
unless line.empty?
|
869
|
-
push_text(line)
|
870
|
-
close
|
871
|
-
end
|
872
|
-
end
|
873
|
-
|
874
|
-
# Renders an XHTML doctype or XML shebang.
|
875
|
-
def render_doctype(line)
|
876
|
-
raise SyntaxError.new("Illegal nesting: nesting within a header command is illegal.", @next_line.index) if block_opened?
|
877
|
-
doctype = text_for_doctype(line)
|
878
|
-
push_text doctype if doctype
|
879
|
-
end
|
880
|
-
|
881
|
-
def text_for_doctype(text)
|
882
|
-
text = text[3..-1].lstrip.downcase
|
883
|
-
if text.index("xml") == 0
|
884
|
-
return nil if html?
|
885
|
-
wrapper = @options[:attr_wrapper]
|
886
|
-
return "<?xml version=#{wrapper}1.0#{wrapper} encoding=#{wrapper}#{text.split(' ')[1] || "utf-8"}#{wrapper} ?>"
|
887
|
-
end
|
888
|
-
|
889
|
-
if html5?
|
890
|
-
'<!DOCTYPE html>'
|
891
|
-
else
|
892
|
-
version, type = text.scan(DOCTYPE_REGEX)[0]
|
893
|
-
|
894
|
-
if xhtml?
|
895
|
-
if version == "1.1"
|
896
|
-
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'
|
897
|
-
elsif version == "5"
|
898
|
-
'<!DOCTYPE html>'
|
899
|
-
else
|
900
|
-
case type
|
901
|
-
when "strict"; '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'
|
902
|
-
when "frameset"; '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">'
|
903
|
-
when "mobile"; '<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">'
|
904
|
-
when "rdfa"; '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">'
|
905
|
-
when "basic"; '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">'
|
906
|
-
else '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'
|
907
|
-
end
|
908
|
-
end
|
909
|
-
|
910
|
-
elsif html4?
|
911
|
-
case type
|
912
|
-
when "strict"; '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">'
|
913
|
-
when "frameset"; '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">'
|
914
|
-
else '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">'
|
915
|
-
end
|
916
|
-
end
|
917
|
-
end
|
918
|
-
end
|
919
|
-
|
920
|
-
# Starts a filtered block.
|
921
|
-
def start_filtered(name)
|
922
|
-
raise Error.new("Invalid filter name \":#{name}\".") unless name =~ /^\w+$/
|
923
|
-
raise Error.new("Filter \"#{name}\" is not defined.") unless filter = Filters.defined[name]
|
924
|
-
|
925
|
-
push_and_tabulate([:filtered, filter])
|
926
|
-
@flat = true
|
927
|
-
@filter_buffer = String.new
|
928
|
-
|
929
|
-
# If we don't know the indentation by now, it'll be set in Line#tabs
|
930
|
-
@flat_spaces = @indentation * @template_tabs if @indentation
|
931
|
-
end
|
932
|
-
|
933
|
-
def raw_next_line
|
934
|
-
text = @template.shift
|
935
|
-
return unless text
|
936
|
-
|
937
|
-
index = @template_index
|
938
|
-
@template_index += 1
|
939
|
-
|
940
|
-
return text, index
|
941
|
-
end
|
942
|
-
|
943
|
-
def next_line
|
944
|
-
text, index = raw_next_line
|
945
|
-
return unless text
|
946
|
-
|
947
|
-
# :eod is a special end-of-document marker
|
948
|
-
line =
|
949
|
-
if text == :eod
|
950
|
-
Line.new '-#', '-#', '-#', index, self, true
|
951
|
-
else
|
952
|
-
Line.new text.strip, text.lstrip.chomp, text, index, self, false
|
953
|
-
end
|
954
|
-
|
955
|
-
# `flat?' here is a little outdated,
|
956
|
-
# so we have to manually check if either the previous or current line
|
957
|
-
# closes the flat block,
|
958
|
-
# as well as whether a new block is opened
|
959
|
-
@line.tabs if @line
|
960
|
-
unless (flat? && !closes_flat?(line) && !closes_flat?(@line)) ||
|
961
|
-
(@line && @line.text[0] == ?: && line.full =~ %r[^#{@line.full[/^\s+/]}\s])
|
962
|
-
if line.text.empty?
|
963
|
-
newline
|
964
|
-
return next_line
|
965
|
-
end
|
966
|
-
|
967
|
-
handle_multiline(line)
|
968
|
-
end
|
969
|
-
|
970
|
-
@next_line = line
|
971
|
-
end
|
972
|
-
|
973
|
-
def closes_flat?(line)
|
974
|
-
line && !line.text.empty? && line.full !~ /^#{@flat_spaces}/
|
975
|
-
end
|
976
|
-
|
977
|
-
def un_next_line(line)
|
978
|
-
@template.unshift line
|
979
|
-
@template_index -= 1
|
980
|
-
end
|
981
|
-
|
982
|
-
def handle_multiline(line)
|
983
|
-
return unless is_multiline?(line.text)
|
984
|
-
line.text.slice!(-1)
|
985
|
-
while new_line = raw_next_line.first
|
986
|
-
break if new_line == :eod
|
987
|
-
newline and next if new_line.strip.empty?
|
988
|
-
break unless is_multiline?(new_line.strip)
|
989
|
-
line.text << new_line.strip[0...-1]
|
990
|
-
newline
|
991
|
-
end
|
992
|
-
un_next_line new_line
|
993
|
-
resolve_newlines
|
994
|
-
end
|
995
|
-
|
996
|
-
# Checks whether or not +line+ is in a multiline sequence.
|
997
|
-
def is_multiline?(text)
|
998
|
-
text && text.length > 1 && text[-1] == MULTILINE_CHAR_VALUE && text[-2] == ?\s
|
999
|
-
end
|
1000
|
-
|
1001
|
-
def handle_ruby_multiline(text)
|
1002
|
-
text = text.rstrip
|
1003
|
-
return text unless is_ruby_multiline?(text)
|
1004
|
-
un_next_line @next_line.full
|
1005
|
-
begin
|
1006
|
-
new_line = raw_next_line.first
|
1007
|
-
break if new_line == :eod
|
1008
|
-
newline and next if new_line.strip.empty?
|
1009
|
-
text << " " << new_line.strip
|
1010
|
-
newline
|
1011
|
-
end while is_ruby_multiline?(new_line.strip)
|
1012
|
-
next_line
|
1013
|
-
resolve_newlines
|
1014
|
-
text
|
1015
|
-
end
|
1016
|
-
|
1017
|
-
def is_ruby_multiline?(text)
|
1018
|
-
text && text.length > 1 && text[-1] == ?, && text[-2] != ?? && text[-3..-2] != "?\\"
|
1019
|
-
end
|
1020
|
-
|
1021
|
-
def contains_interpolation?(str)
|
1022
|
-
str.include?('#{')
|
1023
|
-
end
|
1024
|
-
|
1025
|
-
def unescape_interpolation(str, opts = {})
|
1026
|
-
res = ''
|
1027
|
-
rest = Haml::Shared.handle_interpolation inspect_obj(str) do |scan|
|
1028
|
-
escapes = (scan[2].size - 1) / 2
|
1029
|
-
res << scan.matched[0...-3 - escapes]
|
1030
|
-
if escapes % 2 == 1
|
1031
|
-
res << '#{'
|
1032
|
-
else
|
1033
|
-
content = eval('"' + balance(scan, ?{, ?}, 1)[0][0...-1] + '"')
|
1034
|
-
content = "Haml::Helpers.html_escape((#{content}))" if opts[:escape_html]
|
1035
|
-
res << '#{' + content + "}"# Use eval to get rid of string escapes
|
1036
|
-
end
|
1037
|
-
end
|
1038
|
-
res + rest
|
1039
|
-
end
|
1040
|
-
|
1041
|
-
def balance(*args)
|
1042
|
-
res = Haml::Shared.balance(*args)
|
1043
|
-
return res if res
|
1044
|
-
raise SyntaxError.new("Unbalanced brackets.")
|
1045
|
-
end
|
1046
|
-
|
1047
|
-
def block_opened?
|
1048
|
-
!flat? && @next_line.tabs > @line.tabs
|
1049
|
-
end
|
1050
|
-
|
1051
|
-
# Pushes value onto `@to_close_stack` and increases
|
1052
|
-
# `@template_tabs`.
|
1053
|
-
def push_and_tabulate(value)
|
1054
|
-
@to_close_stack.push(value)
|
1055
|
-
@template_tabs += 1
|
1056
|
-
end
|
1057
|
-
|
1058
|
-
def flat?
|
1059
|
-
@flat
|
1060
|
-
end
|
1061
|
-
|
1062
|
-
def newline
|
1063
|
-
@newlines += 1
|
1064
|
-
end
|
1065
|
-
|
1066
|
-
def newline_now
|
1067
|
-
@precompiled << "\n"
|
1068
|
-
@newlines -= 1
|
1069
|
-
end
|
1070
|
-
|
1071
|
-
def resolve_newlines
|
1072
|
-
return unless @newlines > 0
|
1073
|
-
@to_merge << [:newlines, @newlines]
|
1074
|
-
@newlines = 0
|
1075
|
-
end
|
1076
|
-
|
1077
|
-
# Get rid of and whitespace at the end of the buffer
|
1078
|
-
# or the merged text
|
1079
|
-
def rstrip_buffer!(index = -1)
|
1080
|
-
last = @to_merge[index]
|
1081
|
-
if last.nil?
|
1082
|
-
push_silent("_hamlout.rstrip!", false)
|
1083
|
-
@dont_tab_up_next_text = true
|
1084
|
-
return
|
1085
|
-
end
|
1086
|
-
|
1087
|
-
case last.first
|
1088
|
-
when :text
|
1089
|
-
last[1].rstrip!
|
1090
|
-
if last[1].empty?
|
1091
|
-
@to_merge.slice! index
|
1092
|
-
rstrip_buffer! index
|
1093
|
-
end
|
1094
|
-
when :script
|
1095
|
-
last[1].gsub!(/\(haml_temp, (.*?)\);$/, '(haml_temp.rstrip, \1);')
|
1096
|
-
rstrip_buffer! index - 1
|
1097
|
-
when :newlines
|
1098
|
-
rstrip_buffer! index - 1
|
1099
|
-
else
|
1100
|
-
raise SyntaxError.new("[HAML BUG] Undefined entry in Haml::Precompiler@to_merge.")
|
1101
|
-
end
|
1102
|
-
end
|
1103
|
-
end
|
1104
|
-
end
|