locomotivecms_wagon 1.4.0 → 1.5.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -0
- data/Gemfile +6 -2
- data/README.md +7 -1
- data/bin/wagon +3 -0
- data/generators/blank/Gemfile.tt +1 -3
- data/generators/blank/config/site.yml.tt +3 -3
- data/generators/bootstrap/config/site.yml.tt +3 -3
- data/generators/bootstrap3/Gemfile.tt +1 -3
- data/generators/bootstrap3/app/views/pages/index.liquid +21 -63
- data/generators/bootstrap3/app/views/pages/index.liquid.haml +15 -57
- data/generators/bootstrap3/config/deploy.yml +15 -15
- data/generators/bootstrap3/config/site.yml.tt +2 -2
- data/generators/bootstrap3/icon.png +0 -0
- data/generators/bootstrap3/public/fonts/glyphicons-halflings-regular.eot +0 -0
- data/generators/bootstrap3/public/fonts/glyphicons-halflings-regular.svg +201 -200
- data/generators/bootstrap3/public/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/generators/bootstrap3/public/fonts/glyphicons-halflings-regular.woff +0 -0
- data/generators/{bootstrap2/app/content_types → bootstrap3/public/images}/.empty_directory +0 -0
- data/generators/bootstrap3/public/javascripts/bootstrap/affix.js +137 -0
- data/generators/bootstrap3/public/javascripts/bootstrap/alert.js +88 -0
- data/generators/bootstrap3/public/javascripts/bootstrap/button.js +107 -0
- data/generators/bootstrap3/public/javascripts/bootstrap/carousel.js +205 -0
- data/generators/bootstrap3/public/javascripts/bootstrap/collapse.js +170 -0
- data/generators/bootstrap3/public/javascripts/bootstrap/dropdown.js +147 -0
- data/generators/bootstrap3/public/javascripts/bootstrap/modal.js +243 -0
- data/generators/bootstrap3/public/javascripts/bootstrap/popover.js +110 -0
- data/generators/bootstrap3/public/javascripts/bootstrap/scrollspy.js +153 -0
- data/generators/bootstrap3/public/javascripts/bootstrap/tab.js +125 -0
- data/generators/bootstrap3/public/javascripts/bootstrap/tooltip.js +399 -0
- data/generators/bootstrap3/public/javascripts/bootstrap/transition.js +48 -0
- data/generators/bootstrap3/public/javascripts/bootstrap.min.js +12 -6
- data/generators/bootstrap3/public/stylesheets/application.css +1 -0
- data/generators/bootstrap3/public/stylesheets/application.css.scss +8 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_alerts.scss +67 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_badges.scss +55 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_breadcrumbs.scss +26 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_button-groups.scss +226 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_buttons.scss +159 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_carousel.scss +232 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_close.scss +35 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_code.scss +63 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_component-animations.scss +29 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_dropdowns.scss +213 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_forms.scss +436 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_glyphicons.scss +233 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_grid.scss +84 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_input-groups.scss +162 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_jumbotron.scss +44 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_labels.scss +64 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_list-group.scss +110 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_media.scss +56 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_mixins.scss +947 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_modals.scss +139 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_navbar.scss +620 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_navs.scss +242 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_normalize.scss +423 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_pager.scss +55 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_pagination.scss +88 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_panels.scss +241 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_popovers.scss +133 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_print.scss +101 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_progress-bars.scss +80 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_responsive-utilities.scss +74 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_scaffolding.scss +134 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_tables.scss +233 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_theme.scss +247 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_thumbnails.scss +38 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_tooltip.scss +95 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_type.scss +284 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_utilities.scss +56 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_variables.scss +833 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/_wells.scss +29 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap/bootstrap.css.scss +49 -0
- data/generators/bootstrap3/public/stylesheets/bootstrap.css +2035 -3056
- data/generators/bootstrap3/public/stylesheets/bootstrap.css.scss +49 -0
- data/generators/cloned/Gemfile.tt +1 -3
- data/generators/content_type/app/content_types/%slug%.yml.tt +57 -0
- data/generators/content_type/data/{%name%.yml.tt → %slug%.yml.tt} +2 -2
- data/generators/{bootstrap2 → foundation5}/Gemfile.tt +1 -3
- data/generators/{bootstrap2/data → foundation5/app/content_types}/.empty_directory +0 -0
- data/generators/{foundation → foundation5}/app/views/pages/404.liquid +1 -4
- data/generators/{foundation → foundation5}/app/views/pages/404.liquid.haml +1 -1
- data/generators/foundation5/app/views/pages/index.liquid +196 -0
- data/generators/foundation5/app/views/pages/index.liquid.haml +157 -0
- data/generators/foundation5/config/deploy.yml +15 -0
- data/generators/{bootstrap2 → foundation5}/config/site.yml.tt +3 -4
- data/generators/{bootstrap2 → foundation5}/config/translations.yml +0 -0
- data/generators/{bootstrap2 → foundation5}/config.ru +0 -0
- data/generators/{bootstrap2/public/samples → foundation5/data}/.empty_directory +0 -0
- data/generators/foundation5/favicon.ico +0 -0
- data/generators/foundation5/icon.png +0 -0
- data/generators/{foundation/app/content_types → foundation5/public/fonts}/.empty_directory +0 -0
- data/generators/{foundation/data → foundation5/public/images}/.empty_directory +0 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.abide.js +299 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.accordion.js +59 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.alert.js +43 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.clearing.js +534 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.dropdown.js +311 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.equalizer.js +74 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.interchange.js +331 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.joyride.js +843 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.js +611 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.magellan.js +178 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.offcanvas.js +108 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.orbit.js +610 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.reveal.js +437 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.slider.js +199 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.tab.js +167 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.tooltip.js +298 -0
- data/generators/foundation5/public/javascripts/foundation/foundation.topbar.js +425 -0
- data/generators/foundation5/public/javascripts/foundation.js +4161 -0
- data/generators/foundation5/public/javascripts/foundation.min.js +10 -0
- data/generators/{foundation → foundation5}/public/javascripts/vendor/custom.modernizr.js +0 -0
- data/generators/foundation5/public/javascripts/vendor/custom.modernizr.min.js +1 -0
- data/generators/foundation5/public/javascripts/vendor/fastclick.js +9 -0
- data/generators/foundation5/public/javascripts/vendor/fastclick.min.js +11 -0
- data/generators/foundation5/public/javascripts/vendor/jquery.autocomplete.js +645 -0
- data/generators/foundation5/public/javascripts/vendor/jquery.autocomplete.min.js +1 -0
- data/generators/foundation5/public/javascripts/vendor/jquery.cookie.js +8 -0
- data/generators/foundation5/public/javascripts/vendor/jquery.cookie.min.js +8 -0
- data/generators/foundation5/public/javascripts/vendor/jquery.js +26 -0
- data/generators/foundation5/public/javascripts/vendor/jquery.min.js +27 -0
- data/generators/foundation5/public/javascripts/vendor/modernizr.js +8 -0
- data/generators/foundation5/public/javascripts/vendor/modernizr.min.js +1 -0
- data/generators/foundation5/public/javascripts/vendor/placeholder.js +2 -0
- data/generators/foundation5/public/javascripts/vendor/placeholder.min.js +1 -0
- data/generators/{foundation/public/fonts → foundation5/public/samples}/.empty_directory +0 -0
- data/generators/foundation5/public/stylesheets/application.css +2 -0
- data/generators/foundation5/public/stylesheets/application.css.scss +3 -0
- data/generators/foundation5/public/stylesheets/foundation/_functions.scss +101 -0
- data/generators/foundation5/public/stylesheets/foundation/_settings.scss +1296 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_accordion.scss +53 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_alert-boxes.scss +126 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_block-grid.scss +132 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_breadcrumbs.scss +127 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_button-groups.scss +108 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_buttons.scss +222 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_clearing.scss +247 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_dropdown-buttons.scss +129 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_dropdown.scss +248 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_flex-video.scss +51 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_forms.scss +498 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_global.scss +434 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_grid.scss +260 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_inline-lists.scss +57 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_joyride.scss +220 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_keystrokes.scss +61 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_labels.scss +104 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_magellan.scss +34 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_offcanvas.scss +356 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_orbit.scss +423 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_pagination.scss +150 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_panels.scss +90 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_pricing-tables.scss +150 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_progress-bars.scss +79 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_range-slider.scss +148 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_reveal-new.scss +0 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_reveal.scss +216 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_side-nav.scss +115 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_split-buttons.scss +191 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_sub-nav.scss +125 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_switch.scss +294 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_tables.scss +129 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_tabs.scss +109 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_thumbs.scss +68 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_tooltips.scss +140 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_top-bar.scss +659 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_type.scss +513 -0
- data/generators/foundation5/public/stylesheets/foundation/components/_visibility.scss +408 -0
- data/generators/foundation5/public/stylesheets/foundation.css +5398 -0
- data/generators/foundation5/public/stylesheets/foundation.css.scss +45 -0
- data/generators/foundation5/public/stylesheets/normalize.css +425 -0
- data/generators/foundation5/public/stylesheets/normalize.css.scss +425 -0
- data/generators/{foundation → line_case}/Gemfile.tt +1 -3
- data/generators/line_case/app/content_types/categories.yml +56 -0
- data/generators/line_case/app/content_types/emails.yml +35 -0
- data/generators/line_case/app/content_types/projects.yml +58 -0
- data/generators/{bootstrap2 → line_case}/app/views/pages/404.liquid.haml +3 -2
- data/generators/line_case/app/views/pages/email-registered.liquid.haml +13 -0
- data/generators/line_case/app/views/pages/index.liquid.haml +110 -0
- data/generators/line_case/app/views/pages/projects/content_type_template.liquid.haml +32 -0
- data/generators/line_case/app/views/snippets/newsletter_form.liquid.haml +14 -0
- data/generators/line_case/app/views/snippets/projects.liquid.haml +17 -0
- data/generators/line_case/app/views/snippets/social_links.liquid.haml +19 -0
- data/generators/line_case/config/deploy.yml +15 -0
- data/generators/{foundation → line_case}/config/site.yml.tt +3 -3
- data/generators/{foundation → line_case}/config/translations.yml +0 -0
- data/generators/{foundation → line_case}/config.ru +0 -0
- data/generators/line_case/data/categories.yml +8 -0
- data/generators/line_case/data/emails.yml +2 -0
- data/generators/line_case/data/projects.yml +39 -0
- data/generators/line_case/icon.png +0 -0
- data/generators/line_case/public/images/banner-header.png +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.abide.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.alerts.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.clearing.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.cookie.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.dropdown.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.forms.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.interchange.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.joyride.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.magellan.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.orbit.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.placeholder.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.reveal.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.section.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.tooltips.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.topbar.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/foundation.min.js +0 -0
- data/generators/line_case/public/javascripts/vendor/custom.modernizr.js +4 -0
- data/generators/{foundation → line_case}/public/javascripts/vendor/jquery.js +0 -0
- data/generators/{foundation → line_case}/public/javascripts/vendor/zepto.js +0 -0
- data/generators/line_case/public/samples/projects/sample.jpeg +0 -0
- data/generators/line_case/public/samples/projects/sample2.jpeg +0 -0
- data/generators/line_case/public/samples/projects/sample3.jpeg +0 -0
- data/generators/line_case/public/samples/projects/sample4.jpeg +0 -0
- data/generators/line_case/public/samples/projects/sample5.jpeg +0 -0
- data/generators/line_case/public/samples/projects/sample6.jpeg +0 -0
- data/generators/line_case/public/samples/projects/sample7.jpeg +0 -0
- data/generators/line_case/public/samples/projects/sample8.jpeg +0 -0
- data/generators/line_case/public/stylesheets/_variables.css.sass +20 -0
- data/generators/line_case/public/stylesheets/foundation/_variables.scss +1290 -0
- data/generators/line_case/public/stylesheets/foundation/components/_alert-boxes.scss +107 -0
- data/generators/line_case/public/stylesheets/foundation/components/_block-grid.scss +71 -0
- data/generators/line_case/public/stylesheets/foundation/components/_breadcrumbs.scss +124 -0
- data/generators/line_case/public/stylesheets/foundation/components/_button-groups.scss +89 -0
- data/generators/line_case/public/stylesheets/foundation/components/_buttons.scss +230 -0
- data/generators/line_case/public/stylesheets/foundation/components/_clearing.scss +227 -0
- data/generators/line_case/public/stylesheets/foundation/components/_custom-forms.scss +278 -0
- data/generators/line_case/public/stylesheets/foundation/components/_dropdown-buttons.scss +115 -0
- data/generators/line_case/public/stylesheets/foundation/components/_dropdown.scss +151 -0
- data/generators/line_case/public/stylesheets/foundation/components/_flex-video.scss +46 -0
- data/generators/line_case/public/stylesheets/foundation/components/_forms.scss +411 -0
- data/generators/line_case/public/stylesheets/foundation/components/_global.scss +366 -0
- data/generators/line_case/public/stylesheets/foundation/components/_grid-5.scss +214 -0
- data/generators/line_case/public/stylesheets/foundation/components/_grid.scss +188 -0
- data/generators/line_case/public/stylesheets/foundation/components/_inline-lists.scss +53 -0
- data/generators/line_case/public/stylesheets/foundation/components/_joyride.scss +217 -0
- data/generators/line_case/public/stylesheets/foundation/components/_keystrokes.scss +57 -0
- data/generators/line_case/public/stylesheets/foundation/components/_labels.scss +85 -0
- data/generators/line_case/public/stylesheets/foundation/components/_magellan.scss +23 -0
- data/generators/line_case/public/stylesheets/foundation/components/_orbit.scss +340 -0
- data/generators/line_case/public/stylesheets/foundation/components/_pagination.scss +140 -0
- data/generators/line_case/public/stylesheets/foundation/components/_panels.scss +83 -0
- data/generators/line_case/public/stylesheets/foundation/components/_pricing-tables.scss +131 -0
- data/generators/line_case/public/stylesheets/foundation/components/_progress-bars.scss +71 -0
- data/generators/line_case/public/stylesheets/foundation/components/_reveal.scss +136 -0
- data/generators/line_case/public/stylesheets/foundation/components/_section.scss +391 -0
- data/generators/line_case/public/stylesheets/foundation/components/_side-nav.scss +69 -0
- data/generators/line_case/public/stylesheets/foundation/components/_split-buttons.scss +167 -0
- data/generators/line_case/public/stylesheets/foundation/components/_sub-nav.scss +84 -0
- data/generators/line_case/public/stylesheets/foundation/components/_switch.scss +266 -0
- data/generators/line_case/public/stylesheets/foundation/components/_tables.scss +84 -0
- data/generators/line_case/public/stylesheets/foundation/components/_thumbs.scss +53 -0
- data/generators/line_case/public/stylesheets/foundation/components/_tooltips.scss +117 -0
- data/generators/line_case/public/stylesheets/foundation/components/_top-bar.scss +576 -0
- data/generators/line_case/public/stylesheets/foundation/components/_type.scss +435 -0
- data/generators/line_case/public/stylesheets/foundation/components/_visibility.scss +322 -0
- data/generators/line_case/public/stylesheets/foundation.css.scss +43 -0
- data/generators/{foundation → line_case}/public/stylesheets/foundation.min.css +0 -0
- data/generators/{foundation/public/stylesheets/normalize.css → line_case/public/stylesheets/normalize.css.scss} +5 -5
- data/generators/line_case/public/stylesheets/pages.css.sass +163 -0
- data/generators/page/template.liquid.haml.tt +8 -5
- data/generators/page/template.liquid.tt +6 -2
- data/lib/locomotive/wagon/cli.rb +139 -43
- data/lib/locomotive/wagon/generators/content_type.rb +26 -10
- data/lib/locomotive/wagon/generators/page.rb +41 -25
- data/lib/locomotive/wagon/generators/site/base.rb +53 -0
- data/lib/locomotive/wagon/generators/site/blank.rb +9 -2
- data/lib/locomotive/wagon/generators/site/bootstrap2.rb +8 -2
- data/lib/locomotive/wagon/generators/site/bootstrap3.rb +20 -2
- data/lib/locomotive/wagon/generators/site/cloned.rb +4 -0
- data/lib/locomotive/wagon/generators/site/{foundation.rb → foundation4.rb} +10 -4
- data/lib/locomotive/wagon/generators/site/foundation5.rb +48 -0
- data/lib/locomotive/wagon/generators/site/line_case.rb +20 -0
- data/lib/locomotive/wagon/generators/site/unzip.rb +10 -2
- data/lib/locomotive/wagon/generators/site.rb +48 -2
- data/lib/locomotive/wagon/generators/snippet.rb +2 -1
- data/lib/locomotive/wagon/liquid/drops/content_types.rb +9 -3
- data/lib/locomotive/wagon/liquid/drops/page.rb +9 -1
- data/lib/locomotive/wagon/liquid/scopeable.rb +1 -1
- data/lib/locomotive/wagon/liquid/tags/fetch_page.rb +41 -0
- data/lib/locomotive/wagon/liquid/tags/model_form.rb +67 -0
- data/lib/locomotive/wagon/liquid/tags/path_helper.rb +2 -2
- data/lib/locomotive/wagon/liquid/tags/with_scope.rb +1 -1
- data/lib/locomotive/wagon/listen.rb +18 -10
- data/lib/locomotive/wagon/logger.rb +4 -0
- data/lib/locomotive/wagon/misc/core_ext.rb +8 -0
- data/lib/locomotive/wagon/misc/deployment_connection.rb +120 -0
- data/lib/locomotive/wagon/misc/hosting_api.rb +115 -0
- data/lib/locomotive/wagon/misc/httparty.rb +2 -0
- data/lib/locomotive/wagon/misc/livereload.rb +43 -0
- data/lib/locomotive/wagon/misc/mounter.rb +1 -1
- data/lib/locomotive/wagon/misc/tcp_port.rb +42 -0
- data/lib/locomotive/wagon/misc/thor.rb +15 -0
- data/lib/locomotive/wagon/server/entry_submission.rb +69 -38
- data/lib/locomotive/wagon/server/middleware.rb +4 -2
- data/lib/locomotive/wagon/server/page.rb +2 -2
- data/lib/locomotive/wagon/server.rb +11 -7
- data/lib/locomotive/wagon/version.rb +1 -1
- data/lib/locomotive/wagon.rb +141 -30
- data/locomotivecms_wagon.gemspec +7 -6
- data/spec/fixtures/default/app/content_types/bands.yml +3 -1
- data/spec/fixtures/default/app/views/pages/all.liquid.haml +3 -0
- data/spec/fixtures/default/app/views/pages/events.liquid.haml +21 -0
- data/spec/fixtures/default/app/views/pages/filtered.liquid.haml +11 -1
- data/spec/fixtures/default/app/views/pages/index.liquid.haml +1 -1
- data/spec/fixtures/default/data/bands.yml +3 -0
- data/spec/integration/server/basic_spec.rb +1 -0
- data/spec/integration/server/contact_form_spec.rb +1 -1
- data/spec/integration/server/liquid_spec.rb +8 -1
- data/spec/integration/server/new_contact_form_spec.rb +67 -0
- data/spec/integration/server/with_scope_spec.rb +10 -0
- data/spec/spec_helper.rb +3 -0
- metadata +339 -144
- data/generators/bootstrap2/app/views/pages/404.liquid +0 -13
- data/generators/bootstrap2/app/views/pages/index.liquid +0 -98
- data/generators/bootstrap2/app/views/pages/index.liquid.haml +0 -80
- data/generators/bootstrap2/app/views/snippets/footer.liquid +0 -3
- data/generators/bootstrap2/app/views/snippets/footer.liquid.haml +0 -2
- data/generators/bootstrap2/config/deploy.yml +0 -15
- data/generators/bootstrap2/public/fonts/FontAwesome.otf +0 -0
- data/generators/bootstrap2/public/fonts/fontawesome-webfont.eot +0 -0
- data/generators/bootstrap2/public/fonts/fontawesome-webfont.svg +0 -399
- data/generators/bootstrap2/public/fonts/fontawesome-webfont.ttf +0 -0
- data/generators/bootstrap2/public/fonts/fontawesome-webfont.woff +0 -0
- data/generators/bootstrap2/public/javascripts/bootstrap.js +0 -2280
- data/generators/bootstrap2/public/javascripts/bootstrap.min.js +0 -6
- data/generators/bootstrap2/public/stylesheets/application.css.scss +0 -39
- data/generators/bootstrap2/public/stylesheets/bootstrap-responsive.css +0 -1109
- data/generators/bootstrap2/public/stylesheets/bootstrap-responsive.min.css +0 -9
- data/generators/bootstrap2/public/stylesheets/bootstrap.css +0 -5568
- data/generators/bootstrap2/public/stylesheets/bootstrap.min.css +0 -9
- data/generators/bootstrap2/public/stylesheets/fonts/awesome.css.scss +0 -3
- data/generators/bootstrap2/public/stylesheets/fonts/font-awesome-ie7.css +0 -1203
- data/generators/bootstrap2/public/stylesheets/fonts/font-awesome-ie7.min.css +0 -384
- data/generators/bootstrap2/public/stylesheets/fonts/font-awesome.css +0 -1470
- data/generators/bootstrap2/public/stylesheets/fonts/font-awesome.min.css +0 -403
- data/generators/bootstrap3/public/javascripts/bootstrap.js +0 -1999
- data/generators/bootstrap3/public/stylesheets/bootstrap-theme.css +0 -384
- data/generators/bootstrap3/public/stylesheets/bootstrap-theme.min.css +0 -1
- data/generators/bootstrap3/public/stylesheets/bootstrap.min.css +0 -9
- data/generators/content_type/app/content_types/%name%.yml.tt +0 -58
- data/generators/foundation/app/views/pages/index.liquid +0 -150
- data/generators/foundation/app/views/pages/index.liquid.haml +0 -125
- data/generators/foundation/app/views/snippets/footer.liquid +0 -16
- data/generators/foundation/app/views/snippets/footer.liquid.haml +0 -22
- data/generators/foundation/config/deploy.yml +0 -15
- data/generators/foundation/public/samples/.empty_directory +0 -1
- data/generators/foundation/public/stylesheets/foundation.css +0 -4727
data/lib/locomotive/wagon.rb
CHANGED
@@ -5,14 +5,65 @@ require 'locomotive/wagon/exceptions'
|
|
5
5
|
module Locomotive
|
6
6
|
module Wagon
|
7
7
|
|
8
|
+
# Authenticate an user to the Hosting platform.
|
9
|
+
# If the user does not exist, then create an account for her/him.
|
10
|
+
# At the end, store the API key in the ~/.netrc file
|
11
|
+
#
|
12
|
+
# @param [ String ] email The email of the user
|
13
|
+
# @param [ String ] password The password of the user
|
14
|
+
# @param [ Object ] shell Used to ask for/prompt information
|
15
|
+
#
|
16
|
+
def self.authenticate(email, password, shell)
|
17
|
+
require 'locomotive/wagon/misc/hosting_api'
|
18
|
+
require 'netrc'
|
19
|
+
|
20
|
+
api_key = nil
|
21
|
+
api = Locomotive::HostingAPI.new(email: email, password: password)
|
22
|
+
|
23
|
+
if api.authenticated?
|
24
|
+
# existing account
|
25
|
+
api_key = api.api_key
|
26
|
+
shell.say "You have been successfully authenticated.", :green
|
27
|
+
else
|
28
|
+
# new account?
|
29
|
+
shell.say "No account found for #{email} or invalid credentials", :yellow
|
30
|
+
|
31
|
+
if shell.yes?('Do you want to create a new account? [Y/N]')
|
32
|
+
name = shell.ask 'What is your name?'
|
33
|
+
|
34
|
+
account = api.create_account(name: name, email: email, password: password)
|
35
|
+
|
36
|
+
if account.success?
|
37
|
+
shell.say "Your account has been successfully created.", :green
|
38
|
+
api_key = account['api_key']
|
39
|
+
else
|
40
|
+
shell.say "We were unable to create your account, reason(s): #{account.error_messages.join(', ')}", :red
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
if api_key
|
46
|
+
# record the credentials
|
47
|
+
netrc = Netrc.read
|
48
|
+
netrc[api.domain_with_port] = email, api_key
|
49
|
+
netrc.save
|
50
|
+
else
|
51
|
+
shell.say "We were unable to authenticate you on our platform.", :red
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
8
55
|
# Create a site from a site generator.
|
9
56
|
#
|
10
|
-
# @param [ String ] name The name of the site (underscored)
|
11
|
-
# @param [ String ] path The destination path of the site
|
12
57
|
# @param [ Object ] generator The wrapping class of the generator itself
|
58
|
+
# @param [ Array ] args [name of the site, destination path of the site, skip bundle flag, force_haml]
|
59
|
+
# @param [ Hash ] options General options (ex: --force-color)
|
13
60
|
#
|
14
|
-
def self.init(
|
15
|
-
|
61
|
+
def self.init(generator_klass, args, options = {})
|
62
|
+
args, opts = Thor::Options.split(args)
|
63
|
+
|
64
|
+
generator = generator_klass.new(args, opts, {})
|
65
|
+
generator.force_color_if_asked(options)
|
66
|
+
generator.invoke_all
|
16
67
|
end
|
17
68
|
|
18
69
|
# Start the thin server which serves the LocomotiveCMS site from the system.
|
@@ -22,37 +73,76 @@ module Locomotive
|
|
22
73
|
#
|
23
74
|
def self.serve(path, options)
|
24
75
|
if reader = self.require_mounter(path, true)
|
25
|
-
|
76
|
+
use_listen = !options[:disable_listen]
|
77
|
+
|
78
|
+
if options[:force]
|
79
|
+
begin
|
80
|
+
self.stop(path)
|
81
|
+
sleep(2) # make sure we wait enough for the server process to stop
|
82
|
+
rescue
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
# TODO: new feature -> pick the right Rack handler (Thin, Puma, ...etc)
|
87
|
+
server = self.thin_server(reader, options.slice(:host, :port, :disable_listen, :live_reload_port))
|
88
|
+
|
89
|
+
if options[:daemonize]
|
90
|
+
# very important to get the parent pid in order to differenciate the sub process from the parent one
|
91
|
+
parent_pid = Process.pid
|
92
|
+
|
93
|
+
# The Daemons gem closes all file descriptors when it daemonizes the process. So any logfiles that were opened before the Daemons block will be closed inside the forked process.
|
94
|
+
# So, close the current logger and set it up again when daemonized.
|
95
|
+
Locomotive::Wagon::Logger.close
|
26
96
|
|
27
|
-
|
28
|
-
|
97
|
+
server.log_file = File.join(File.expand_path(path), 'log', 'server.log')
|
98
|
+
server.pid_file = File.join(File.expand_path(path), 'log', 'server.pid')
|
99
|
+
server.daemonize
|
100
|
+
|
101
|
+
use_listen = Process.pid != parent_pid && !options[:disable_listen]
|
102
|
+
|
103
|
+
if Process.pid != parent_pid
|
104
|
+
# A "new logger" inside the daemon.
|
105
|
+
Locomotive::Wagon::Logger.setup(path, false)
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
# listen_thread = Thread.new do
|
110
|
+
Locomotive::Wagon::Listen.instance.start(reader) if use_listen
|
29
111
|
|
30
|
-
require 'thin'
|
31
|
-
server = Thin::Server.new(options[:host], options[:port], app)
|
32
|
-
server.threaded = true # TODO: make it an option ?
|
33
112
|
server.start
|
113
|
+
# end
|
114
|
+
|
115
|
+
# server_thread = Thread.new { server.start }
|
34
116
|
|
35
|
-
#
|
36
|
-
#
|
37
|
-
#
|
117
|
+
# hit Control + C to stop
|
118
|
+
# Signal.trap('INT') { EventMachine.stop }
|
119
|
+
# Signal.trap('TERM') { EventMachine.stop }
|
38
120
|
|
39
|
-
#
|
40
|
-
#
|
121
|
+
# listen_thread.join
|
122
|
+
# server_thread.join
|
41
123
|
end
|
42
124
|
end
|
43
125
|
|
126
|
+
def self.stop(path)
|
127
|
+
pid_file = File.join(File.expand_path(path), 'log', 'server.pid')
|
128
|
+
pid = File.read(pid_file).to_i
|
129
|
+
Process.kill('TERM', pid)
|
130
|
+
end
|
131
|
+
|
44
132
|
# Generate components for the LocomotiveCMS site such as content types, snippets, pages.
|
45
133
|
#
|
46
134
|
# @param [ Symbol ] name The name of the generator
|
47
135
|
# @param [ Array ] *args The arguments for the generator
|
136
|
+
# @param [ Hash ] options The options for the generator
|
48
137
|
#
|
49
|
-
def self.generate(name,
|
138
|
+
def self.generate(name, args, options = {})
|
50
139
|
Bundler.require 'misc'
|
51
140
|
|
52
141
|
lib = "locomotive/wagon/generators/#{name}"
|
53
142
|
require lib
|
54
143
|
|
55
|
-
generator = lib.camelize.constantize.new(args,
|
144
|
+
generator = lib.camelize.constantize.new(args, options, { behavior: :skip })
|
145
|
+
generator.force_color_if_asked(options)
|
56
146
|
generator.invoke_all
|
57
147
|
end
|
58
148
|
|
@@ -66,18 +156,15 @@ module Locomotive
|
|
66
156
|
def self.push(path, connection_info, options = {})
|
67
157
|
if reader = self.require_mounter(path, true)
|
68
158
|
|
69
|
-
reader.mounting_point.site.domains = connection_info['domains'] if connection_info[
|
70
|
-
reader.mounting_point.site.subdomain = connection_info['subdomain'] if connection_info[
|
71
|
-
require 'bundler'
|
72
|
-
Bundler.require 'misc'
|
159
|
+
reader.mounting_point.site.domains = connection_info['domains'] if connection_info['domains']
|
160
|
+
reader.mounting_point.site.subdomain = connection_info['subdomain'] if connection_info['subdomain']
|
73
161
|
|
74
|
-
writer
|
75
|
-
self.validate_resources(options[:resources], writer.writers)
|
162
|
+
writer = Locomotive::Mounter::Writer::Api.instance
|
163
|
+
resources = self.validate_resources(options[:resources], writer.writers)
|
76
164
|
|
77
165
|
connection_info[:uri] = "#{connection_info.delete(:host)}/locomotive/api"
|
78
166
|
|
79
|
-
_options = { mounting_point: reader.mounting_point, console: true }.merge(options).symbolize_keys
|
80
|
-
_options[:only] = _options.delete(:resources)
|
167
|
+
_options = { mounting_point: reader.mounting_point, only: resources, console: true }.merge(options).symbolize_keys
|
81
168
|
|
82
169
|
writer.run!(_options.merge(connection_info).with_indifferent_access)
|
83
170
|
end
|
@@ -91,9 +178,7 @@ module Locomotive
|
|
91
178
|
# @param [ Hash ] options The options passed to the pull process
|
92
179
|
#
|
93
180
|
def self.pull(path, connection_info, options = {})
|
94
|
-
self.require_mounter(path)
|
95
|
-
|
96
|
-
Bundler.require 'misc' unless options[:disable_misc]
|
181
|
+
self.require_mounter(path, false, options[:disable_misc])
|
97
182
|
|
98
183
|
connection_info[:uri] = "#{connection_info.delete(:host)}/locomotive/api"
|
99
184
|
|
@@ -126,7 +211,7 @@ module Locomotive
|
|
126
211
|
# generate an almost blank site
|
127
212
|
require 'locomotive/wagon/generators/site'
|
128
213
|
generator = Locomotive::Wagon::Generators::Site::Cloned
|
129
|
-
generator.start [name, path, connection_info.symbolize_keys]
|
214
|
+
generator.start [name, path, true, connection_info.symbolize_keys]
|
130
215
|
|
131
216
|
# pull the remote site
|
132
217
|
self.pull(target_path, options.merge(connection_info).with_indifferent_access, { disable_misc: true })
|
@@ -153,16 +238,22 @@ module Locomotive
|
|
153
238
|
#
|
154
239
|
# @param [ String ] path The path to the local site
|
155
240
|
# @param [ Boolean ] get_reader Tell if it builds an instance of the reader.
|
241
|
+
# @param [ Boolean ] require_misc Tell if it requires the gems inside the misc bundler group
|
156
242
|
#
|
157
243
|
# @param [ Object ] An instance of the reader is the get_reader parameter has been set.
|
158
244
|
#
|
159
|
-
def self.require_mounter(path, get_reader = false)
|
245
|
+
def self.require_mounter(path, get_reader = false, require_misc = true)
|
160
246
|
Locomotive::Wagon::Logger.setup(path, false)
|
161
247
|
|
162
248
|
require 'locomotive/mounter'
|
163
249
|
|
164
250
|
Locomotive::Mounter.logger = Locomotive::Wagon::Logger.instance.logger
|
165
251
|
|
252
|
+
if require_misc
|
253
|
+
require 'bundler'
|
254
|
+
Bundler.require 'misc'
|
255
|
+
end
|
256
|
+
|
166
257
|
if get_reader
|
167
258
|
begin
|
168
259
|
reader = Locomotive::Mounter::Reader::FileSystem.instance
|
@@ -175,12 +266,32 @@ module Locomotive
|
|
175
266
|
end
|
176
267
|
|
177
268
|
protected
|
269
|
+
|
270
|
+
def self.thin_server(reader, options)
|
271
|
+
require 'locomotive/wagon/server'
|
272
|
+
app = Locomotive::Wagon::Server.new(reader, options)
|
273
|
+
|
274
|
+
# TODO: new feature -> pick the right Rack handler (Thin, Puma, ...etc)
|
275
|
+
require 'thin'
|
276
|
+
Thin::Server.new(options[:host], options[:port], { signals: true }, app).tap do |server|
|
277
|
+
server.threaded = true
|
278
|
+
end
|
279
|
+
end
|
280
|
+
|
178
281
|
def self.validate_resources(resources, writers_or_readers)
|
179
282
|
return if resources.nil?
|
283
|
+
|
284
|
+
# FIXME: for an unknown reason, when called from Cocoa, the resources are a string
|
285
|
+
resources = resources.map { |resource| resource.split(' ') }.flatten
|
286
|
+
|
180
287
|
valid_resources = writers_or_readers.map { |thing| thing.to_s.demodulize.gsub(/Writer$|Reader$/, '').underscore }
|
288
|
+
|
181
289
|
resources.each do |resource|
|
182
290
|
raise ArgumentError, "'#{resource}' resource not recognized. Valid resources are #{valid_resources.join(', ')}." unless valid_resources.include?(resource)
|
183
291
|
end
|
292
|
+
|
293
|
+
resources
|
184
294
|
end
|
295
|
+
|
185
296
|
end
|
186
297
|
end
|
data/locomotivecms_wagon.gemspec
CHANGED
@@ -19,22 +19,23 @@ Gem::Specification.new do |gem|
|
|
19
19
|
gem.executables = ['wagon']
|
20
20
|
|
21
21
|
gem.add_dependency 'thor'
|
22
|
-
gem.add_dependency 'thin', '~> 1.
|
23
|
-
gem.add_dependency 'activesupport', '~> 3.2.
|
22
|
+
gem.add_dependency 'thin', '~> 1.6.1'
|
23
|
+
gem.add_dependency 'activesupport', '~> 3.2.18'
|
24
24
|
gem.add_dependency 'locomotivecms-solid', '~> 0.2.2.1'
|
25
25
|
gem.add_dependency 'RedCloth', '~> 4.2.8'
|
26
26
|
gem.add_dependency 'redcarpet', '~> 3.0.0'
|
27
27
|
gem.add_dependency 'dragonfly', '~> 0.9.12'
|
28
|
-
gem.add_dependency 'sprockets', '~> 2.0'
|
29
|
-
gem.add_dependency 'sprockets-sass', '~> 1.0.1'
|
30
28
|
gem.add_dependency 'rack-cache', '~> 1.1'
|
31
29
|
gem.add_dependency 'better_errors', '~> 1.0.1'
|
30
|
+
gem.add_dependency 'rubyzip', '~> 1.1.0'
|
31
|
+
gem.add_dependency 'netrc', '~> 0.7.7'
|
32
32
|
|
33
|
-
gem.add_dependency 'listen', '~>
|
33
|
+
gem.add_dependency 'listen', '~> 2.7.5'
|
34
|
+
gem.add_dependency 'rack-livereload', '~> 0.3.15'
|
34
35
|
|
35
36
|
gem.add_dependency 'httmultiparty', '0.3.10'
|
36
37
|
gem.add_dependency 'will_paginate', '~> 3.0.3'
|
37
|
-
gem.add_dependency 'locomotivecms_mounter', '~> 1.4.
|
38
|
+
gem.add_dependency 'locomotivecms_mounter', '~> 1.4.4'
|
38
39
|
|
39
40
|
gem.add_dependency 'faker', '~> 0.9.5'
|
40
41
|
|
@@ -19,6 +19,27 @@ position: 5
|
|
19
19
|
{% endfor %}
|
20
20
|
|
21
21
|
#sidebar.unit.size1of3
|
22
|
+
|
23
|
+
{% model_form 'messages', id: 'contactform' %}
|
24
|
+
%p
|
25
|
+
%label{ :for => 'name' } Name
|
26
|
+
%input{ :type => 'text', :id => 'name', :name => 'content[name]', :placeholder => 'First and last name', :tabindex => '1', required: 'required', value: '{{ message.name }}' }
|
27
|
+
%span {{ message.errors.name }}
|
28
|
+
|
29
|
+
%p
|
30
|
+
%label{ :for => 'email' } Email
|
31
|
+
%input{ :type => 'text', :id => 'email', :name => 'content[email]', :placeholder => 'example@domain.com', :tabindex => '2', required: 'required', value: '{{ message.email }}' }
|
32
|
+
%span {{ message.errors.email }}
|
33
|
+
|
34
|
+
%p
|
35
|
+
%label{ :for => 'comment' } Your Message
|
36
|
+
%textarea{ :id => 'comment', :name => 'content[message]', :tabindex => '3', required: 'required' } {{ message.message }}
|
37
|
+
%span {{ message.errors.message }}
|
38
|
+
|
39
|
+
%p.action
|
40
|
+
%input{ :name => 'submit', :type => 'submit', :tabindex => '4', :value => 'Send Message' }
|
41
|
+
{% endmodel_form %}
|
42
|
+
|
22
43
|
{% editable_long_text 'sidebar' %}
|
23
44
|
|
24
45
|
%p
|
@@ -5,6 +5,16 @@ title: Various uses of the with_scope tag
|
|
5
5
|
{% assign end = '2012-06-10 23:59:59' %}
|
6
6
|
{% assign prices = '5.0,5.5' | split: ',' | map: 'to_f' %}
|
7
7
|
|
8
|
-
{% with_scope date.gte: begin, date.lte: end, city: /Kansas/, state.ne: 'Illinois', tags: 'awesome', tags.nin: 'bad', price.in: prices %}
|
8
|
+
{% with_scope date.gte: begin, date.lte: end, city: /Kansas/, state.ne: 'Illinois', tags: 'awesome', tags.nin: 'bad', price.in: prices, order_by: 'price.desc' %}
|
9
9
|
events={{ contents.events.count }}.
|
10
|
+
{% endwith_scope %}
|
11
|
+
|
12
|
+
{% with_scope tags.in: 'awesome', order_by: 'price.desc' %}
|
13
|
+
first event={{ contents.events.first.place }}.
|
14
|
+
{% endwith_scope %}
|
15
|
+
|
16
|
+
{% assign featured = false %}
|
17
|
+
|
18
|
+
{% with_scope featured: featured %}
|
19
|
+
bands={{ contents.bands.count }}.
|
10
20
|
{% endwith_scope %}
|
@@ -7,7 +7,7 @@ title: Home page
|
|
7
7
|
%head
|
8
8
|
%meta{ :charset => "utf-8" }
|
9
9
|
|
10
|
-
%title {{ site.name }}
|
10
|
+
%title {{ site.name }} | {{ page.title }}
|
11
11
|
|
12
12
|
%meta{ :content => "{{ site.meta_description }}", :name => "description" }
|
13
13
|
%meta{ :content => "{{ site.meta_keywords }}", :name => "keywords" }
|
@@ -37,6 +37,7 @@ describe Locomotive::Wagon::Server do
|
|
37
37
|
it 'shows a content type template ' do
|
38
38
|
get '/songs/song-number-1'
|
39
39
|
last_response.body.should =~ /Song #1/
|
40
|
+
last_response.body.should =~ /Sample website | Song #1/
|
40
41
|
end
|
41
42
|
|
42
43
|
it 'renders a page under a templatized one' do
|
@@ -46,7 +46,7 @@ describe Locomotive::Wagon::Server do
|
|
46
46
|
|
47
47
|
it "writes a localized a link" do
|
48
48
|
get '/events'
|
49
|
-
last_response.body.should =~ /Plus à notre sujet: <a href="\/a-notre-sujet">Qui sommes nous \?<\/a>/
|
49
|
+
last_response.body.should =~ /Plus à notre sujet: <a href="\/fr\/a-notre-sujet">Qui sommes nous \?<\/a>/
|
50
50
|
end
|
51
51
|
|
52
52
|
it "writes a link to a page with a custom label" do
|
@@ -88,4 +88,11 @@ describe Locomotive::Wagon::Server do
|
|
88
88
|
end
|
89
89
|
end
|
90
90
|
|
91
|
+
describe 'fetch_page' do
|
92
|
+
it 'returns the title of a page' do
|
93
|
+
get '/all'
|
94
|
+
last_response.body.should =~ %r(<p>Single page: Music</p>)
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
91
98
|
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require File.dirname(__FILE__) + '/../integration_helper'
|
4
|
+
require 'locomotive/wagon/server'
|
5
|
+
require 'rack/test'
|
6
|
+
|
7
|
+
describe 'NewContactForm' do
|
8
|
+
|
9
|
+
include Rack::Test::Methods
|
10
|
+
|
11
|
+
def app
|
12
|
+
run_server
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'renders the form' do
|
16
|
+
get '/events'
|
17
|
+
last_response.body.should =~ %r(<form method="POST" enctype="multipart/form-data" id="contactform">)
|
18
|
+
end
|
19
|
+
|
20
|
+
describe '#submit' do
|
21
|
+
|
22
|
+
let(:params) { {
|
23
|
+
'content_type_slug' => 'messages',
|
24
|
+
'entry' => { 'name' => 'John', 'email' => 'j@doe.net', 'message' => 'Bla bla' } } }
|
25
|
+
let(:response) { post_contact_form(params) }
|
26
|
+
let(:status) { response.status }
|
27
|
+
|
28
|
+
context 'when not valid' do
|
29
|
+
|
30
|
+
let(:params) { { 'content_type_slug' => 'messages' } }
|
31
|
+
|
32
|
+
it 'returns a success status' do
|
33
|
+
response.status.should == 200
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'displays errors' do
|
37
|
+
response.body.to_s.should =~ /can't not be blank/
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
context 'when valid' do
|
43
|
+
|
44
|
+
let(:response) { post_contact_form(params, true) }
|
45
|
+
|
46
|
+
it 'returns a success status' do
|
47
|
+
response.status.should == 200
|
48
|
+
end
|
49
|
+
|
50
|
+
it 'displays a success message' do
|
51
|
+
response.body.should =~ /Thank you John/
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
|
58
|
+
def post_contact_form(params, follow_redirect = false)
|
59
|
+
url = '/events'
|
60
|
+
post url, params
|
61
|
+
|
62
|
+
follow_redirect! if follow_redirect
|
63
|
+
|
64
|
+
last_response
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
@@ -17,4 +17,14 @@ describe 'Complex with_scope conditions' do
|
|
17
17
|
last_response.body.should =~ /events=1./
|
18
18
|
end
|
19
19
|
|
20
|
+
it 'returns the right number of bands' do
|
21
|
+
get '/filtered'
|
22
|
+
last_response.body.should =~ /bands=2./
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'returns the first band in the right order' do
|
26
|
+
get '/filtered'
|
27
|
+
last_response.body.should =~ /first event=Browne's Market/
|
28
|
+
end
|
29
|
+
|
20
30
|
end
|