Compare commits

...

844 Commits

Author SHA1 Message Date
Thomas Reynolds b6167b1369 Fix #2019 2016-12-03 11:32:09 -08:00
Thomas Reynolds 30217d2c04 Change how config options are passed to Thor. Removes new Thor warnings from #2017 2016-11-29 20:14:19 -08:00
Thomas Reynolds 073f273fe4 Prep 2016-11-25 14:03:56 -08:00
Thomas Reynolds e30f413376 Fix broken block ignore form. 2016-11-25 13:59:43 -08:00
Stanislav a680fb30c5 Add bower_components ignore (#2010) 2016-11-23 09:34:53 -08:00
Jonathan Allard 42e31c8c5e Make .html implicit for page IDs (#1996)
* Make .html implicit for page IDs

* Add Pry gem

* Add setting :page_id_generator to override page ID derivation
2016-11-16 21:00:16 -08:00
sandstrom 046d15cfa5 Fix addressable require (#2009) 2016-11-16 20:59:25 -08:00
Thomas Reynolds 5adea781c9 Fix up tests 2016-11-04 08:23:33 -07:00
James Pearson 97082d5fc4 Added addressable to the gemfile (#2001)
addressable is required for middleman init, but was not installed as part of a fresh install of Middleman
2016-11-04 07:56:30 -07:00
René Klačan 604c0e2b5d Fix source watcher configuration (#1999)
* Fix source watcher configuration

* Keep old Sources#initialize signature

* Poll source on path change
2016-10-31 10:50:03 -07:00
Mike Vastola 7c968b9572 Updates to support Rails 5, Rack 3 and Sinatra 2 (beta) (#1984)
* Updates to support Rails 5, Rack 3 and Sinatra 2 (beta).

- Bump upper boundary of version for Rack dependency from 2.0 to 3 (exclusive).
- Version bump sinatra for CI testing to >= 2.0.0.beta2.
- Also replaces use of String#hash in middleman-core/features/asset_host.feature
to ensure sufficiently random variables are returned.

Closes middleman/middleman#1983.

* Testing revert of the version requirements...

To confirm my changes don't cause a regression for any of:
- Rails < 5
- Sinatra < 2
- Rack < 2

* Revert "Testing revert of the version requirements..."

This reverts commit 5cf4c2a07c0814eefa573358b1bc9b0eeb62f9c1.
2016-09-13 10:25:17 +02:00
Kevin Glowacz 197093b36c Tilt 2 (#1974)
* Updates for mappings change in tilt 2

* drop RedcarpetTemplate::Redcarpet2 which was removed in tilt 2

* require Tilt 2.0 or higher

* Make use of tilt 2's extensions_for method instead
2016-09-09 00:18:34 +02:00
Kevin Glowacz ea2115f3f8 Allow for activesupport 4.2 again (#1976)
There is no current reason to remove support for 4.2
This now makes for a backwards compatible change whereas before this would
have called for a new major version of middleman-core
2016-08-30 17:22:31 -07:00
Thomas Reynolds 07651c63a6 Update Ruby version requirement. 2016-08-13 15:41:19 -07:00
Mark Rowe 65462cbc43 Improve performance of ignoring files (#1971)
* Determine the type of ignore pattern once per pattern.

Performing this work when checking when each file was ignored accounted
for around 4.5 of the 6 seconds that processing ignored files was taking
on a site with ~14,000 files and a small number of ignore patterns.
After this change, processing ignored files takes less than 1.5 seconds.

* Cache the normalized paths on Resource and SourceFile.

Normalizing the paths is expensive, so avoid doing it multiple
times. `Util::normalize_path` is marked as memoized, but this
is not effective as:

1. `memoize` doesn't appear to work with module functions.
2. Checking whether we have a memoized value is as expensive as
   normalizing the path.

This further drops the time it takes to process ignored files on a site
with ~14,000 files from ~1.5 seconds to ~0.6 seconds.
2016-08-12 16:33:18 -07:00
Eliott Appleford c264b05906 Merge pull request #1970 from bdash/source_watcher-poll_once-perf
Eliminate quadratic behavior in SourceWatcher::poll_once!
2016-08-11 10:02:38 +01:00
Mark Rowe dcd36a4f99 Eliminate quadratic behavior in `SourceWatcher::poll_once!`.
Both `Array#reject` and `Array#include?` have linear time
complexity. This results in quadratic time complexity when
`Array#include?` is called within `Array#reject`'s block. Using
`Array`'s difference operator gives the same result in linear time.

In a site with ~14,000 files, this drops the time taken by some calls to
`SourceWatcher::poll_once!` from ~15 seconds each to just a few
milliseconds.
2016-08-11 00:24:42 -07:00
Thomas Reynolds 7027b4933a Update .travis.yml 2016-08-03 13:00:25 -07:00
Peter Sankauskas cbad571338 Updating to activesupport version 5 (#1967) 2016-08-03 12:59:57 -07:00
sandstrom ffef14deb4 Create ISSUE_TEMPLATE.md (#1966) 2016-07-29 09:00:10 -07:00
Thomas Reynolds 62dba443a0 Fix japanese characters encoding in URLs 2016-07-10 17:03:22 -07:00
Adam Heath 389e3f5a8c Add prefix option to asset_hash (#1949)
This allows manually changing the filename so that fiel header changes
can be reflected on the CDN. E.g. if you turn on crossOrigin serving
(CORS) the asset hash doesn't change, but the CDN cache needs to be
broken in order to pickup the new header.
2016-07-02 17:55:25 -07:00
Thomas Reynolds ea39d16d81 Try to be safe 2016-06-23 12:41:23 -07:00
Peter Suschlik 1581bfc27e Convert `latency` option to a Fixnum (#1928)
As @vill pointed out in https://github.com/middleman/middleman/issues/1866#issuecomment-222869287
passing `--watcher-latency=2` fails because the gem `listen` expects `latency` to be an `Fixnum`.

This commit fixes this issue.
2016-06-01 14:19:13 -07:00
Thomas Reynolds e8f10fe3c2 prep 2016-05-31 13:15:37 -07:00
Thomas Reynolds 1efa585c11 Fix #1866 2016-05-31 13:15:37 -07:00
Shawn Van Ittersum 0d5c9e4313 Prevent overwrite of Slim embedded options (#1927)
* Fix middleman/middleman#1925: Slim embedded options overwrite

* Remove context_hack from Slim renderer

* Remove debugging output
2016-05-31 13:15:21 -07:00
Thomas Reynolds 51ccfe1143 only encode if current path is broken 2016-05-25 11:25:24 -07:00
Thomas Reynolds 4ffaa9dde5 Try to encode URI before parsing so spaces in paths work. Fixes #1914 2016-05-25 11:13:59 -07:00
Thomas Reynolds 6440d53e7a Add support for dotenv 2016-05-25 10:54:49 -07:00
Ben Hollis 38a9025560 Fix asset_url with asset_hash (#1919)
* Fix asset_url with asset_hash.

* Fix asset hashes.
2016-05-22 12:31:53 -07:00
Steven Sloan 5de9e86a55 allow partial lookups without a current_resource (#1912)
current_resource is only needed for relative lookups, so for lookups from source allow them to run without a current resource.
2016-05-13 13:01:21 -07:00
Thomas Reynolds ccc1cc1288 Fix ordering in tests 2016-05-11 11:48:21 -07:00
Thomas Reynolds 849fc65260 prep 2016-05-11 10:59:48 -07:00
Matthew Lehner 3e4187568b require the `try` core extension (#1911) 2016-05-10 15:17:28 -07:00
PiotrMisiurek 1c57626445 Fix contract for Sitemap::Store.register_resource_list_manipulator (#1907)
Contract said that optional param priority can be only a number.
But the code also handle the boolean as a value to be compatibile
with old versions

Change contract to accept both Num and Bool
2016-05-06 00:12:03 -07:00
Steven Sloan cf4d40caff loosen contract on Resource#source_file to Maybe[String] (#1906)
this could legitimately return nil if there is no file_descriptor, as would be the case for a StringResource
2016-05-05 09:08:29 -07:00
Dennis Günnewig 599cf1e6d3 Use https:// to clone templates (#1901)
Using git://-protocol for cloning git repositories does not work via
HTTP proxies. By replacing it with https:// instead it works for more
users.
2016-04-29 14:23:55 -07:00
Thomas Reynolds 3ebd902ec3 Move capybara dep 2016-04-28 15:44:50 -07:00
Thomas Reynolds 158c3e9f25 Test new ruby 2016-04-28 08:47:48 -07:00
Thomas Reynolds cdcd2bd42d Expose development? and production? helpers to template context. Related #1895 2016-04-26 09:24:49 -07:00
Thomas Bruketta 4918704800 Allow numbers to be unique page_ids (#1886) 2016-04-25 09:51:11 -07:00
Nick Giancola 8a8ee768ac Fix/issue 1889 (#1892)
* Add regression test for infinite loop issue in Util::step_through_extensions (#1889)

* Prevent infinite loop when encountering files where base filename is a possible templating engine
2016-04-25 09:50:51 -07:00
Thomas Reynolds 71a20bb3ee Merge pull request #1891 from danielbayerlein/incompatibility-of-listen
Incompatibility of listen with Ruby < 2.2
2016-04-24 16:59:07 -07:00
Daniel Bayerlein ce58073539 Incompatibility of listen with Ruby < 2.2 fixed 2016-04-24 09:57:13 +02:00
Thomas Reynolds 13d62cb276 Experiment with non-rack rewriters 2016-04-22 15:52:42 -07:00
Thomas Reynolds 0f2bc1e0ea Minor perf tweaks 2016-04-21 16:12:33 -07:00
Thomas Reynolds a14934e08b Merge pull request #1888 from mortonfox/patch-1
Fix RubyInstaller Devkit link.
2016-04-20 14:22:42 -07:00
Morton Fox a95f721490 Fix RubyInstaller Devkit link. 2016-04-20 00:27:15 -04:00
Thomas Reynolds 2b0f720850 Bad merge 2016-04-19 11:54:00 -07:00
Thomas Reynolds b386dcdc40 Fix #1884 for realz 2016-04-19 11:08:23 -07:00
Thomas Reynolds 0ac5650229 Throw when trying to overwrite a template context value. Fixes #1884 2016-04-19 11:06:51 -07:00
Thomas Reynolds 7e3baed196 Throw when trying to overwrite a template context value. Fixes #1884 2016-04-19 10:37:23 -07:00
Thomas Reynolds 09a7d89fd3 Throw when trying to overwrite a template context value. Fixes #1884 2016-04-19 10:36:49 -07:00
Thomas Reynolds 6872e07d34 Expose extensions in config. Helps middleman/middleman-sprockets#111 2016-04-17 13:02:23 -07:00
Thomas Reynolds a01656df39 Steps should try passing unknown methods to config context before failing. Fixes #1879 2016-04-14 11:30:46 -07:00
Thomas Reynolds f2535f4fda Bump dep 2016-04-13 09:23:28 -07:00
Thomas Reynolds dd2413857e prep 2016-04-12 13:12:09 -07:00
Thomas Reynolds b058d26564 Bump fast image 2016-04-12 13:05:46 -07:00
Thomas Reynolds b794961916 Only rewrite urls in sitemap. Fixes #1873 2016-04-12 12:53:50 -07:00
Thomas Reynolds 4791e01f10 Merge pull request #1877 from middleman/bugfix/restarting-external-pipeline
Allow restarting external-pipeline without orphaning processes
2016-04-12 10:23:38 -07:00
Thomas Reynolds ac974ca05f Allow restarting external-pipeline without orphaning processes 2016-04-12 10:00:09 -07:00
Thomas Reynolds c7669609e6 Merge pull request #1876 from middleman/bugfix/global-collection-steps
Make global config access work inside steps
2016-04-11 16:23:07 -07:00
Thomas Reynolds e99649b33e Make global config access work inside steps 2016-04-11 16:02:31 -07:00
Thomas Reynolds ec213efb95 Merge pull request #1871 from luskjh/sprockets-readme-link-change
Update link in README to sprockets repository.
2016-04-08 13:39:57 -05:00
Joshua Lusk 21f4f40e21 Update README.md 2016-04-06 12:37:15 -04:00
Thomas Reynolds 16c82fe57a Really fix #1864 2016-03-27 14:12:32 -07:00
Thomas Reynolds 058a63a0de Make #1831 work 2016-03-26 16:43:47 -07:00
Thomas Reynolds 49da6156a0 Fixes #1860 2016-03-26 15:17:09 -07:00
Thomas Reynolds 3cbd9fdede Add back plain environment helper to context. Helps with #1861 2016-03-25 10:23:05 -07:00
Thomas Reynolds 7ae8e904a6 Merge pull request #1862 from balthisar/server_cli_fix
Fix server CLI
2016-03-25 10:17:25 -07:00
Thomas Reynolds 55230229f6 Fix #1857 2016-03-25 10:16:54 -07:00
Jim Derry 9e774b608a Fix server CLI 2016-03-25 14:00:48 +08:00
Thomas Reynolds b950af89ac Really prep 2016-03-22 16:04:00 -07:00
Thomas Reynolds 5a2f9c8ca6 Create a single default list of asset extensions. Add .ico to it. Fixes #1830. 2016-03-22 15:43:48 -07:00
Thomas Reynolds bca8b854dd prep 2016-03-22 12:34:03 -07:00
Thomas Reynolds ebc2baa13f Merge pull request #1855 from bradgessler/asset-host-extensions
Add exts to asset_host extension
2016-03-22 12:11:01 -07:00
Brad Gessler 179d6c0be4 Add extensions to asset_host extension. 2016-03-22 11:22:06 -07:00
Thomas Reynolds 2701bede2a Merge pull request #1851 from FearGoidte/master
Typo reversed meaning
2016-03-22 11:04:36 -07:00
James cc25c784f9 Merge branch 'master' into master 2016-03-22 17:35:21 +00:00
Thomas Reynolds 9d29cd58de Merge pull request #1853 from adam-h/asset-hash-1852
Fix asset_hash with content rule and uncommented CSS url
2016-03-22 10:09:53 -07:00
Adam Heath 025e35f6a1 Fix asset_hash with content rule and uncommented CSS url
Fixes middleman/middleman#1852
2016-03-22 17:34:40 +08:00
FearGoidte f5a668d380 Typo reversed meaning 2016-03-22 08:24:21 +00:00
Thomas Reynolds 0df7f0d6ac Merge pull request #1847 from FearGoidte/master
Added .xhtml
2016-03-21 12:02:19 -07:00
FearGoidte d461473f81 Added .xhtml
Fixes pretty U.R.L.s for xhtml files
2016-03-21 15:19:36 +00:00
Thomas Reynolds 8425692b86 Try to fix preview server config 2016-03-20 17:33:44 -07:00
Thomas Reynolds aab7bac8a6 Apply CLI options later in process. Fixes 1843 2016-03-20 16:44:20 -07:00
Thomas Reynolds 7e42954258 Define a :config mode, dont run external pipeline on config mode. Fixes #1844 2016-03-20 16:31:15 -07:00
Thomas Reynolds 02a0b557f6 Merge pull request #1842 from puyo/fix/asset-url-and-relative-paths
Fix asset_url and relative option bug.
2016-03-20 16:06:47 -07:00
Gregory McIntyre d539d4aa3d Merge branch 'master' into fix/asset-url-and-relative-paths 2016-03-19 16:04:44 +11:00
Gregory McIntyre 0436c211c6 Fix asset_url and relative option bug.
If the relative option is set and the asset is stored in the directory
alongside the resource referencing it, asset_url produces the
wrong path ('../images/image.jpg' rather than just 'image.jpg').
2016-03-19 13:42:41 +11:00
Thomas Reynolds d22bd914ae Add specific test for #1556 2016-03-18 10:37:02 -07:00
Thomas Reynolds dfa389bde4 bump 2016-03-17 14:47:14 -07:00
Thomas Reynolds 5337d0640b Allow skipping sitemap. Helps #1837 2016-03-17 13:23:36 -07:00
Thomas Reynolds 7484c9f242 Merge pull request #1836 from puyo/fix-proxy-metadata-lookup-during-store-rebuild
Fix bug with store rebuilding and proxy resources.
2016-03-16 10:15:20 -07:00
Gregory McIntyre 563da9d45b Fix bug with store rebuilding and proxy resources. 2016-03-16 12:22:13 +11:00
Thomas Reynolds 0904652c6f Try to fix #1832 2016-03-15 14:10:27 -07:00
Thomas Reynolds 1f3bf47e3c Expose all config options to CLIs. Helps with #1829 2016-03-12 13:55:25 -08:00
Thomas Reynolds d624dc4601 Refine gemspec 2016-03-10 13:17:44 -08:00
Thomas Reynolds 260a9cd94c Merge pull request #1826 from gltarsa/flag-missing-partial
Ensure that misspelled or missing partials generate an error
2016-03-03 09:05:24 -08:00
Greg Tarsa fbc572f920 Ensure that misspelled or missing partials generate an error 2016-03-03 11:23:17 -05:00
Thomas Reynolds 737e6f5e64 expand_path on custom source directories. Fixes #1823 2016-03-02 12:54:14 -08:00
Thomas Reynolds 7b59f240d5 Fixes #1821 2016-03-02 12:00:39 -08:00
Thomas Reynolds c44f7482b1 Fix #1822 2016-03-01 09:25:05 -08:00
Thomas Reynolds e14107ba65 prep v4.1.2 2016-02-28 20:17:35 -08:00
Thomas Reynolds d776f07bfc Merge pull request #1815 from adam-h/sourcemap-hashing
Add sourceMap comment to asset_hash and hash .map files by default
2016-02-26 10:09:18 -08:00
Adam Heath d883152e99 Add sourceMap comment to asset_hash and hash .map files by default 2016-02-26 08:46:00 +08:00
Thomas Reynolds 0d983231d0 Run helper after collections. Fixes #1226 2016-02-24 14:20:42 -08:00
Thomas Reynolds 4733488e8d Update deps 2016-02-24 13:14:50 -08:00
Thomas Reynolds edb1a53060 Add page_id concept 2016-02-22 11:17:21 -08:00
Thomas Reynolds b695f6da1e Fix #1028 2016-02-19 13:24:16 -08:00
Thomas Reynolds e36fd3f476 move contrib file 2016-02-19 11:26:15 -08:00
Thomas Reynolds eaac03ab4b Merge pull request #1809 from adam-h/external-pipeline-error
Make build fail when external_pipeline fails
2016-02-18 12:48:02 -08:00
Adam Heath 351003b4fe Make build fail when external_pipeline fails 2016-02-18 12:41:48 +08:00
Thomas Reynolds 476287452d Merge pull request #1808 from stevenosloan/loosen_data_store_contracts
loosen contracts for setting/returning data in Datastore
2016-02-17 15:06:53 -08:00
Steven Sloan fc0f5d24d6 feat(data): allow for setting & getting Arrays through #store & #data_for_path
Seeing that in #touch_file that a value in data could be an Array or Hash, loosen contracts to allow for other storage & retrieval methods to set the same types. Array & Hash being allowable is strongly tied to what *could* be returned after passing through Util.recursively_enhance

[close #1803]
2016-02-17 17:20:24 -05:00
Thomas Reynolds a24e5986a2 Merge pull request #1805 from melvinsh/fix_404_html_injection
Escape path in 404 (not found) page
2016-02-16 09:28:07 -08:00
Melvin Lammerts b7886aa14c escape path in 404 (not found) page
This escapes the `path` variable using `escape_html` from `Rack::Utils` to prevent Cross-Site Scripting in 404 (Not Found) pages.
2016-02-15 23:42:05 +01:00
Thomas Reynolds 6c8fc2ee07 Merge pull request #1792 from jimothyGator/feature/show-version-on-middleman-page
show version on Middleman Information page
2016-02-04 22:58:26 -08:00
Jim Cushing 7bd417fad1 show version on middleman page 2016-02-04 20:44:39 -05:00
Thomas Reynolds d7967a86bb Merge pull request #1791 from jimothyGator/fix/1790-blocks-with-partials
fix partials used with blocks
2016-02-04 08:53:09 -08:00
Jim Cushing b1778a92cd fix partials used with blocks 2016-02-03 16:56:12 -05:00
Thomas Reynolds a2181a2fd9 Allow findup to be false 2016-02-03 09:57:30 -08:00
Thomas Reynolds 6de25dfd0e Fix #1787 2016-02-02 18:49:14 -08:00
Thomas Reynolds f596d8ebf5 bump 2016-02-02 13:11:53 -08:00
Thomas Reynolds 3f18efeed9 split up util module, fix some rubocop complaints 2016-01-31 14:13:52 -08:00
Thomas Reynolds c5aabbbe4f Confirm nested frontmatter doesn't work 2016-01-29 10:30:08 -08:00
Thomas Reynolds 598d72480f Fix slow server boot. It was recursing through node_modules and .git on initial boot 2016-01-28 16:45:54 -08:00
Thomas Reynolds 8c27d9a2e7 Merge pull request #1781 from FearGoidte/master
Support for .xhtml
2016-01-28 10:50:39 -08:00
FearGoidte d863733160 Merge remote-tracking branch 'origin/master' 2016-01-28 08:18:35 +00:00
FearGoidte 13c351f2bf Merge remote-tracking branch 'middleman/master' 2016-01-28 08:18:25 +00:00
James 17f5f19002 Merge branch 'master' into master 2016-01-28 08:18:01 +00:00
FearGoidte 007c626d58 .xml removed from Gzip defaults 2016-01-28 08:16:23 +00:00
Thomas Reynolds e169d3d07e Merge pull request #1782 from jsdalton/allow-watcher-disable-in-server-mode
Disable file watching completely when watcher_disable is true
2016-01-28 00:05:40 -08:00
Jim Dalton cc36267de5 Disable file watching completely when watcher_disable is true 2016-01-27 20:56:17 -08:00
FearGoidte 475fa41de0 Support for .xhtml
I’ve attempted to make support for .htm and .xhtml consistent.
Extensions are in alphabetical order to make it easier to compare them.
2016-01-27 09:48:36 +00:00
Thomas Reynolds 2bba7888b0 Fixes #1780 2016-01-26 13:47:27 -08:00
Thomas Reynolds 0c29fd4abf Make templates extensions with layouts configurable 2016-01-26 13:21:39 -08:00
Thomas Reynolds 9553796731 Fix passing template locals down to partials. Helps #1753 2016-01-26 11:01:32 -08:00
Thomas Reynolds 24ef35026e Merge pull request #1779 from bhollis/minify-js
Minify inline JS when there are other attributes.
2016-01-25 10:11:09 -08:00
Ben Hollis 8881389b42 Minify inline JS when there are other attributes. 2016-01-24 22:55:48 -08:00
Thomas Reynolds e7d9c8ad0e Fix a threading issue caused by parallel 2016-01-24 13:02:39 -08:00
Thomas Reynolds deae5d2216 Fix #1778 2016-01-24 12:30:53 -08:00
Thomas Reynolds 4deaa65a6d update donate link 2016-01-23 17:14:35 -08:00
Thomas Reynolds c7a4618166 Perf work and Parallel builds 2016-01-22 15:57:07 -08:00
Thomas Reynolds b8c0fd34e7 additional perf work 2016-01-22 14:25:02 -08:00
Thomas Reynolds e0818e2118 remove debug code 2016-01-21 14:47:45 -08:00
Thomas Reynolds 4e8273295b tweak some checksums, something slightly changed file output upstream 2016-01-21 10:50:44 -08:00
Thomas Reynolds 92d96f6604 typo 2016-01-21 10:19:52 -08:00
Thomas Reynolds 8bacc35bf2 Merge pull request #1770 from jsdalton/add-mm-data-dir-env-var
Add option for MM_DATA_DIR env var to define :data_dir default value
2016-01-21 10:06:55 -08:00
Jim Dalton 68127003b9 Add option for MM_DATA_DIR env var to define :data_dir default value 2016-01-20 21:11:03 -08:00
Thomas Reynolds 5586784947 Add some options to watcher to opt out of features later 2016-01-20 13:34:12 -08:00
Thomas Reynolds 6d1c3562a7 Differentiate polling from find_new_files to remove double reads in build mode 2016-01-20 12:20:27 -08:00
Thomas Reynolds ffa662a917 Add system-wide file read cache 2016-01-20 11:50:25 -08:00
Thomas Reynolds 827d5fbb1d Still parse frontmatter on ignored resources. Proxies need it 2016-01-20 10:42:12 -08:00
Thomas Reynolds 2864902fa0 Fix #1767 2016-01-20 10:02:19 -08:00
Thomas Reynolds 6077ae43e9 rejigger cop 2016-01-19 15:35:37 -08:00
Thomas Reynolds 65aebc1887 Move some tests around 2016-01-19 14:55:47 -08:00
Thomas Reynolds 801a83f7cb Update changelog 2016-01-19 09:46:55 -08:00
Thomas Reynolds c2999786ee Merge pull request #1763 from iiska/fix-gzip-log-output
Fix gzip extension status output
2016-01-19 09:45:47 -08:00
Thomas Reynolds 2b88773640 Fix contract in i18n. Closes #1764 2016-01-19 09:44:56 -08:00
Thomas Reynolds 7bf4e4681f Show an error message when git CLI is not available. Closes #1765 2016-01-19 09:43:40 -08:00
Juhamatti Niemelä 22812cb340 Fix gzip extension status output 2016-01-18 19:55:45 +02:00
Thomas Reynolds 732ac7cbe9 Merge pull request #1762 from jsdalton/fix-removed-paths-type
Use correct type for removed paths passed to update
2016-01-16 18:49:01 -08:00
Jim Dalton dc3eac9e96 Use correct type for removed paths passed to update 2016-01-16 11:58:00 -08:00
Thomas Reynolds 03c95f0863 prep 2016-01-14 14:48:40 -08:00
Thomas Reynolds 5529062bc4 Changelog 2016-01-14 14:31:00 -08:00
Thomas Reynolds a47b2138f8 Add specific check for TLD-like strings when replacing inline urls. Fixes #1751 2016-01-14 14:29:45 -08:00
Thomas Reynolds be2788b6ca Fix automatic images with absolute (or images dir missing) paths in markdown. Fixes #1755 2016-01-14 14:14:50 -08:00
Thomas Reynolds ff9c34bca9 Allow sorting of rewriters. Fixes #1752 2016-01-14 14:02:33 -08:00
Thomas Reynolds d82ac590db Cop 2016-01-14 11:21:42 -08:00
Thomas Reynolds 5f8beba4b3 Perf 2016-01-14 11:05:41 -08:00
Thomas Reynolds c213bd19df Move block run 2016-01-12 17:11:56 -08:00
Thomas Reynolds 8daa5eba3e Add back app.ignore 2016-01-12 10:53:25 -08:00
Thomas Reynolds 18e4ee41d0 Allow 2.3 failure 2016-01-12 10:46:50 -08:00
Thomas Reynolds 95c7a53291 Convert more basic config commands to ConfigExtensions 2016-01-12 10:38:53 -08:00
Thomas Reynolds 56d71fe7d6 Merge pull request #1747 from jsdalton/mode-check-helper
Add app method to detect mode
2016-01-11 15:57:23 -08:00
Jim Dalton f954415c95 Add app method to detect mode 2016-01-11 14:24:28 -08:00
Thomas Reynolds edd5eb2057 Prep 2016-01-11 13:58:19 -08:00
Thomas Reynolds 7bc9e03642 Merge pull request #1746 from middleman/refactor/ignores
Create ConfigExtension to simplify the APIs for config vs Step.
2016-01-11 13:44:35 -08:00
Thomas Reynolds 179268a4f6 Create ConfigExtension to simplify the APIs for config vs Step. Fixes #1743. Fixes #1745 2016-01-11 13:05:41 -08:00
Thomas Reynolds 8f66077dd0 Allow 2.3.0 failure until frozen string bug is fixed upstream 2016-01-10 17:25:11 -08:00
Thomas Reynolds 98fe7ce7d2 WIP encoding test 2016-01-10 17:24:43 -08:00
Thomas Reynolds c6401f1cd9 Fixes #1716 2016-01-10 17:14:41 -08:00
Thomas Reynolds 5cac6a1896 Add test for #1718 2016-01-10 16:56:18 -08:00
Thomas Reynolds b4a6a503b3 Fixes #1719 2016-01-10 16:47:24 -08:00
Thomas Reynolds 47d0e1cb7b update changelog 2016-01-10 16:47:24 -08:00
Thomas Reynolds 4243676073 Merge pull request #1741 from jfeaver/fix/msoffice-files-as-binary
consider all MS Office files to be binary
2016-01-10 16:30:20 -08:00
Nathan Feaver 17df162e7b consider all MS Office files to be binary 2016-01-10 06:28:18 -07:00
Thomas Reynolds 46ca147560 Merge pull request #1740 from GUI/rewrite-ignore
Add rewrite_ignore option to asset_hash extension
2016-01-09 19:15:38 -08:00
Nick Muerdter 37be89ed68 Add rewrite_ignore option to asset_host, cache_buster, relative_assets. 2016-01-09 08:06:47 -07:00
Nick Muerdter 0563523a81 Add rewrite_ignore option to asset_hash extension.
This allows for configuring the files that will be skipped when
performing URL rewriting on the file content. This differs from the
existing `ignore` option, which configures the files that won't have
hashes added to the filename.
2016-01-08 15:04:45 -07:00
Thomas Reynolds 1e8080b44c Merge pull request #1739 from douo/patch-1
Fixes #1723
2016-01-07 11:38:06 -08:00
Thomas Reynolds a0105c9b48 Merge pull request #1738 from johnnyshields/patch-2
Add SVG to the default list of gzipped exts
2016-01-07 11:36:34 -08:00
Tiou Lims a7631b2f0d Fixes #1723 2016-01-07 23:23:50 +08:00
Johnny Shields 133c02d05c Add SVG to the default list of gzipped exts 2016-01-07 09:43:35 +09:00
Thomas Reynolds 1605f425e8 Fixes #1733 2016-01-05 10:58:22 -08:00
Thomas Reynolds bfb6a7fa16 Merge pull request #1725 from maxmeyer/feature/phantomjs
Added phantomjs as gem to make test suite pass
2016-01-05 10:34:46 -08:00
Thomas Reynolds 41212d7fa3 Merge pull request #1713 from tricknotes/ruby-2.3
Test against Ruby 2.3.0 on Travis CI
2016-01-05 10:34:39 -08:00
Thomas Reynolds 62b17d38ad Merge pull request #1734 from GhostGambler/issue-1702
Issue #1702
2016-01-05 09:50:41 -08:00
Thomas Reynolds fed3fae6bb Merge pull request #1733 from GhostGambler/issue-1709
Test for issue 1709; parent relations with localized and non-localized sources
2016-01-05 09:50:02 -08:00
Ulrich Gabor 298b3909ed First fix to actually use the encoding option again 2016-01-05 15:15:06 +01:00
Ulrich Gabor 1ca5be7b19 Tests for issue #1702 2016-01-05 15:15:01 +01:00
Ulrich Gabor bdeb19059a Test for issue 1709; parent relations with localized and non-localized sources 2016-01-05 15:08:26 +01:00
Dennis Günnewig b0a4d53963 Added phantomjs as gem to make test suite pass 2016-01-01 20:51:26 +01:00
Thomas Reynolds 5684caeee6 Merge pull request #1721 from bhollis/issue1721-relative-paths
relative URLs don't work in image_tag
2015-12-30 16:04:09 -08:00
Thomas Reynolds 03e13c5a26 Merge pull request #1715 from bhollis/issue1715-asset-url
Error calling Util#asset_url from DefaultHelpers#asset_url
2015-12-30 16:01:16 -08:00
Thomas Reynolds da1f3f7af6 Merge pull request #1710 from tricknotes/exit-with-1
Exit with error code on `init` command failed
2015-12-30 15:59:27 -08:00
Ben Hollis 9311a72e4a Use our relative_path_from_resource helper in asset_url. 2015-12-28 20:52:22 -08:00
Ben Hollis 412f6ac1fc Fix #1721 by passing through options to url_for. 2015-12-28 20:52:22 -08:00
Ben Hollis d464162e8e Fix #1715 by passing along path in DefaultHelpers#asset_url. 2015-12-28 17:40:21 -08:00
Ryunosuke SATO e56227c945 Exit with error code on `init` command failed 2015-12-27 18:12:53 +09:00
Ryunosuke SATO 2dcd2c5b1d Test against Ruby 2.3.0 on Travis CI 2015-12-26 01:11:15 +09:00
Thomas Reynolds 3b596d5e3e Merge pull request #1711 from tricknotes/ruby-2.2.4
Test against 2.2.4 that is the latest of Ruby 2.2
2015-12-24 15:09:20 -08:00
Ryunosuke SATO 3fdd963923 Test against 2.2.4 that is the latest of Ruby 2.2 2015-12-23 23:54:04 +09:00
Thomas Reynolds 4a8cd4c3d2 fix extension test 2015-12-21 13:27:44 -08:00
Thomas Reynolds a5821bccec Fix asset hash with query string or hash params. Closes #1411 2015-12-21 13:07:01 -08:00
Thomas Reynolds ba0416b330 Set min version in gemspec 2015-12-20 13:47:18 -08:00
Thomas Reynolds 6aeda854c0 Update local extension template 2015-12-20 12:48:05 -08:00
Thomas Reynolds 5d0f12e6ca Merge pull request #1707 from jordanandree/v4-skip-front-matter-for-ignored-resource
Skip front matter parsing for ignored resources
2015-12-17 15:28:05 -08:00
jordanandree e035d625c8 skip front matter on ingored resources 2015-12-17 14:01:37 -05:00
Thomas Reynolds b2b461935d Here we go 2015-12-15 19:58:04 -08:00
Thomas Reynolds 9e5b137ed8 Really fix #1689 2015-12-15 09:58:22 -08:00
Thomas Reynolds 6af784d5d5 One more RC 2015-12-14 11:02:07 -08:00
Thomas Reynolds 0e620a1ba1 Resolve Contracts warning 2015-12-14 10:22:27 -08:00
Johnny Shields 308ea6db5a Include :locales and :data in live-reloadable types 2015-12-14 09:51:25 -08:00
Thomas Reynolds 79b5e82b3c Merge pull request #1705 from jsdalton/feature/external-pipeline-background-option
Add explicit option to prevent external option from running in backgr…
2015-12-14 09:50:04 -08:00
Jim Dalton f3296815c8 Add explicit option to prevent external option from running in background 2015-12-13 22:12:11 -08:00
Thomas Reynolds 4122bd7351 Add back compass sprite prerender step 2015-12-13 14:30:10 -08:00
Thomas Reynolds defa6daa6d pt 3 2015-12-13 14:19:33 -08:00
Thomas Reynolds 82220eab4e fix git issue pt 2 2015-12-13 14:19:05 -08:00
Thomas Reynolds 3c1d28ce1b fix git issue pt 1 2015-12-13 14:18:54 -08:00
Thomas Reynolds 01f899f529 Print a failing build so I can debug on travis 2015-12-13 13:59:44 -08:00
Thomas Reynolds b6befd3fc3 Rubocop and disable an annoying test 2015-12-13 13:29:33 -08:00
Thomas Reynolds bb0f11d002 CHANGELOG updates. [ci skip] 2015-12-13 13:26:44 -08:00
Thomas Reynolds 28a0071be7 Rename langs to locales in i18n. Provide backwards compat. Closes #1652 2015-12-13 13:20:48 -08:00
Thomas Reynolds 76f591788e Change inline URL matcher to only match strings, not newlines. Fixes #1689 2015-12-13 13:06:05 -08:00
Thomas Reynolds d3a5494062 Handle invalid URLs in rewriter. Fixed #1638 2015-12-13 12:32:21 -08:00
Thomas Reynolds 658b28c337 Load directory over SSL 2015-12-10 13:05:57 -08:00
Thomas Reynolds 2674981d0b Fix yesterday's bone-headed commit. again 2015-12-09 17:08:58 -08:00
Thomas Reynolds 9b0b82c00b Fix yesterday's bone-headed commit 2015-12-09 17:03:55 -08:00
Thomas Reynolds cb6e8bcd95 Fix first-run issue with pipeline 2015-12-08 14:46:03 -08:00
Thomas Reynolds 2178a755e2 Minor SassC load_paths fix 2015-11-30 17:40:14 -08:00
Thomas Reynolds 7b3f5384e9 Add SassC message 2015-11-30 17:29:46 -08:00
Thomas Reynolds 07a216d5ca Remove sprockets/compass references 2015-11-30 17:14:02 -08:00
Thomas Reynolds e9b3a8abe4 Bump another 2015-11-30 16:59:15 -08:00
Thomas Reynolds 578ff18fa0 Bump some deps 2015-11-30 16:58:17 -08:00
Thomas Reynolds ae15d203a8 Fix some tests 2015-11-28 19:32:45 -08:00
Thomas Reynolds e47b0ae29a import_file and import_path APIs. Addresses #1632 2015-11-28 18:03:05 -08:00
Thomas Reynolds 16b997498b Generic related files check 2015-11-28 16:48:08 -08:00
Thomas Reynolds a546e0f523 See if that fixes travis 2015-11-28 14:51:37 -08:00
Thomas Reynolds f2db1567a4 Use SassC in tests 2015-11-27 16:19:26 -08:00
Thomas Reynolds 309733b067 Disable Travis OSX again... 2015-11-27 15:47:32 -08:00
Thomas Reynolds 6de88a832e Make Ruby Sass the default, but use SassC if available. Addresses #1648 2015-11-27 15:41:42 -08:00
Thomas Reynolds b4697e4541 Merge pull request #1696 from zacps/patch-1
Added rubyinstaller-devkit dependency for windows.
2015-11-27 15:27:04 -08:00
Thomas Reynolds dd0ee24ca3 Work around Listen :only weirdness. Addresses #1637 2015-11-27 15:26:46 -08:00
Zac Pullar-Strecker e23bd151bf Added rubyinstaller-devkit dependency for windows. 2015-11-28 12:16:13 +13:00
Thomas Reynolds 822a9f0ecc Fix layout detection on non-html files 2015-11-27 14:26:34 -08:00
Thomas Reynolds 4594f46fb8 Minor tweak to #1695 2015-11-27 14:16:55 -08:00
Thomas Reynolds b0582bcebf Merge pull request #1695 from johnnyshields/fix-sass-livereload-master
Fix SASS partial live reloading
2015-11-27 13:55:15 -08:00
Johnny Shields 13a14d43d4 In SourceWatcher, add a subroutine to find files which should be considered "also dirty" when a given file is touched. 2015-11-27 15:20:20 +09:00
Thomas Reynolds 45939e7e93 Merge pull request #1687 from stevenosloan/allow_asset_url_to_work_without_a_resource
Allow asset url to work without passing a current_resource (v4)
2015-11-13 17:33:57 -08:00
Steven Sloan 6ab6669456 fix(Util::asset_url): allow use without passing a current_resource
Most cases the current_resource isn’t actually needed, so calls could be made
from extensions and still get the correct path back.

An exception will be raised with a descriptive message if the current_resource
is needed but not given. (for example, if relative is true — it needs a resource
to base the url on)
2015-11-13 16:48:52 -05:00
Steven Sloan 49a7435dc9 spec(Util::asset_url): add specs covering each conditional branch 2015-11-13 16:37:58 -05:00
Steven Sloan f16fc2229e feat(testing): add a fixture/file helper for rspec tests 2015-11-13 16:34:08 -05:00
Thomas Reynolds 37d96a9b14 Adapt to style changes and removal of on 2015-11-11 15:30:40 -08:00
Thomas Reynolds 169b6f2c0a Merge pull request #1683 from maxmeyer/feature/preview_server_daemon
Make middleman's preview server a daemon
2015-11-11 15:11:37 -08:00
Thomas Reynolds fbf77d2ad2 Merge pull request #1684 from maxmeyer/patch-2
Add warning for master as well
2015-11-11 15:11:29 -08:00
Dennis Günnewig 022779ef27 Add warning for master as well 2015-11-11 23:30:49 +01:00
Dennis Günnewig ce998cf685 Add changelog entry 2015-11-11 23:28:38 +01:00
Dennis Günnewig 8c7e156bd4 Make middleman's preview server a daemon 2015-11-11 23:28:38 +01:00
Thomas Reynolds 916a5a508b fix some tests 2015-11-11 13:46:09 -08:00
Thomas Reynolds b4457c98d2 Merge pull request #1647 from middleman/frontmatter_delims
Frontmatter delims
2015-11-11 13:20:15 -08:00
Thomas Reynolds 684a80c906 Change no-layout to the default, except for .html 2015-11-11 12:58:07 -08:00
Thomas Reynolds 90490d696f Merge pull request #1678 from maxmeyer/feature/server_hook
Add "before_server"-hook to preview server in v4
2015-11-11 12:26:22 -08:00
Dennis Günnewig 0f8ea86119 Add hook for before_server 2015-11-08 11:03:25 +01:00
Dennis Günnewig a61b2e3b87 Move HTTPS to server_information 2015-11-07 18:50:55 +01:00
Thomas Reynolds ec99a7b28f Merge pull request #1657 from mojavelinux/issue-1656
resolves #1656 don't mangle URL inside tag
2015-10-26 14:52:30 -07:00
Dan Allen c48c81cbba resolves #1656 don't mangle URL inside tag 2015-10-26 15:30:44 -06:00
Thomas Reynolds 30e37293b3 Merge pull request #1655 from mojavelinux/issue-1653
resolves #1653 don't rewrite paths that start with //
2015-10-26 10:21:11 -07:00
Thomas Reynolds 765c28114a Merge pull request #1654 from mojavelinux/patch-1
Ignore .ruby-gemset file
2015-10-26 10:20:13 -07:00
Dan Allen 4995bd23d7 resolves #1653 don't rewrite paths that start with // 2015-10-26 00:39:48 -06:00
Dan Allen c07af953f8 Ignore .ruby-gemset file
Ignore the .ruby-gemset file used to define an RVM gemset.
2015-10-25 23:58:39 -06:00
Eliott Appleford 19d21d2295 make frontmatter delims configurable 2015-10-23 09:40:24 +00:00
Thomas Reynolds 3cd84eb4d1 move_file as a replacement for import_asset 2015-10-22 20:23:39 -07:00
Thomas Reynolds 62d7fa0676 remove unused file 2015-10-12 12:37:42 -07:00
Thomas Reynolds d2251de898 Bump Padrino 2015-10-12 12:37:33 -07:00
Thomas Reynolds 6357f4f5b8 Add back app.set, but mark as deprecated 2015-10-12 12:37:07 -07:00
Thomas Reynolds eb82f402a0 gem bumps 2015-10-05 09:48:17 -07:00
Thomas Reynolds f4bff73b7b Merge pull request #1622 from y-yagi/master_remove_unnecessary_require
remove unnecessary require
2015-10-04 17:57:55 -07:00
yuuji.yaginuma e26f83e1c2 remove unnecessary require
`require 'rubygems'` is already required in Ruby 1.9 or later.
2015-10-04 07:24:21 +09:00
Thomas Reynolds e9abfe1134 rubocop 2015-10-01 13:54:54 -07:00
inoue_sachiro 67fc3d0c05 Fix: Can't clean files when the project is under a hidden directory. 2015-10-01 13:54:45 -07:00
Thomas Reynolds fd6a2376bd Fix frontmatter on 2.0 2015-10-01 10:25:53 -07:00
Thomas Reynolds d828067189 Fix sass helpers in SassC context 2015-09-30 11:16:57 -07:00
Thomas Reynolds 0698d7f5aa Revert "Frontmatter parseing changes broke some whitespace in tests, but shouldn't be a regression"
This reverts commit 5e3ddbf988.
2015-09-30 10:24:12 -07:00
Eliott Appleford 9686c1ec7a Merge pull request #1611 from middleman/Arcovion-patch-2
Fix frontmatter regex
2015-09-30 08:17:18 +01:00
Eliott Appleford b389c26b4e Fix frontmatter regex 2015-09-30 04:58:59 +00:00
Eliott Appleford 9df1a45301 Strip newline after frontmatter
Closes #1610
2015-09-30 05:00:57 +01:00
Thomas Reynolds 5e3ddbf988 Frontmatter parseing changes broke some whitespace in tests, but shouldn't be a regression 2015-09-29 10:27:53 -07:00
Thomas Reynolds d9fc7a95e1 Fix a bad i18n regression 2015-09-28 14:52:16 -07:00
Thomas Reynolds 04c133c90f Fix minify css tests 2015-09-28 13:58:49 -07:00
Thomas Reynolds 32891dc6fe SassC, woot 2015-09-28 11:24:37 -07:00
Eliott Appleford 97cd1c1411 Fix JSON frontmatter parsing 2015-09-24 20:27:36 +01:00
Thomas Reynolds fe66beacc3 Test fix WIP 2015-09-23 16:20:16 -07:00
Eliott Appleford ddc4a3cabc Update data.rb 2015-09-23 23:40:42 +01:00
Thomas Reynolds 5afc138eb8 Merge pull request #1608 from middleman/frontmatter
Fix frontmatter parsing changes from #1608
2015-09-23 15:23:05 -07:00
Eliott Appleford 47bdcb2d9c Fix frontmatter parsing changes from #1608
Only allow frontmatter at the top of the page:
  Now manually removing encoding lines as before

Fix handling of postscript data:
  If there is no frontmatter and the filetype is known,
  parse the whole file

Allow empty frontmatter

Update the documentation comments
2015-09-23 21:45:52 +00:00
Eliott Appleford 11fc90f93c Merge pull request #1604 from middleman/frontmatter
Refactor frontmatter parsing
2015-09-21 13:33:43 +01:00
Eliott Appleford 91a06a1a35 Refactor util/data.rb further 2015-09-20 12:34:15 +00:00
Eliott Appleford 62f431b5ae Refactor frontmatter parsing
Closes #1603
2015-09-20 12:24:48 +00:00
Thomas Reynolds d3d32731e1 more test fixes 2015-09-19 16:00:38 -07:00
Thomas Reynolds 765de5ab11 Remove ancient twitter bootstrap test. Use npm or bower, y'all 2015-09-19 14:39:55 -07:00
Thomas Reynolds 3e1fc0aa1f Change test to respect global relative assets change 2015-09-19 14:26:30 -07:00
Thomas Reynolds 3ae28874bf Fix test breakage 2015-09-19 14:07:42 -07:00
Thomas Reynolds 2907761556 tweak logger ref 2015-09-17 14:46:27 -07:00
Thomas Reynolds fdabd87957 merge in fixes from stable 2015-09-17 13:53:43 -07:00
Thomas Reynolds 409a892da7 Forward port some stable changes 2015-09-17 09:41:17 -07:00
Thomas Reynolds a251c82562 Add test for #1568 2015-09-17 09:25:04 -07:00
Thomas Reynolds 2b2ee10d81 dont autoload stuff when bundler will load 2015-09-16 14:01:39 -07:00
Thomas Reynolds 260c6be66c Move compass and sprockets to template config 2015-09-16 10:53:31 -07:00
Thomas Reynolds ed405b266f bump target ruby version 2015-09-14 17:46:12 -07:00
Thomas Reynolds 8c02eb2a26 Some tweaks to get blog working 2015-09-14 17:37:35 -07:00
Thomas Reynolds d99b922e67 Let's do this 2015-09-12 16:16:26 -07:00
Thomas Reynolds 40f023f01c Let's do this 2015-09-12 16:15:32 -07:00
Thomas Reynolds 441dc2faa6 Revert breaking resource source_file api. For #1595 2015-09-09 11:55:56 -07:00
Thomas Reynolds 8a349322ac Merge pull request #1593 from komor72/patch-1
Update middleman-livereload version to more current
2015-09-03 10:09:54 -07:00
Rafał Komorowski 0d4d82a01a Update middleman-livereload version to more current
As discussed https://github.com/middleman/middleman-livereload/issues/69 but I forgot to apply the fix to source code inside MM. @tdreyno, should it be `~> 3.3.0` or `~> 3.4.0`? I looked into 3.4 changes and they seem to be MM v4 related?
2015-09-03 18:25:43 +02:00
Thomas Reynolds d849930e51 Don't set mode AND environment with the same ENV 2015-09-01 09:58:13 -07:00
Thomas Reynolds 7a28fd0a50 disable osx builds for now 2015-08-31 11:25:22 -07:00
Thomas Reynolds 5cab7c46a9 Store intermediate resources in reducer so the array is not empty the first run. Addresses #1590 2015-08-31 11:18:45 -07:00
Thomas Reynolds 60d88139af Merge pull request #1588 from bradgessler/patch-1
Fix typo in server CLI.
2015-08-28 15:29:13 -07:00
Brad Gessler 8bdeab50ee Fix typo in server CLI. 2015-08-28 13:08:56 -07:00
Thomas Reynolds f76561d101 Add logger require in rack. Addresses #1550 2015-08-28 09:58:10 -07:00
Thomas Reynolds 9ed0796b4a Move some extension setup to ready event 2015-08-20 17:45:18 -07:00
Thomas Reynolds 3485f49f74 Use Hashie Mash for recursive indifferent 2015-08-18 16:22:32 -07:00
Thomas Reynolds 0861fad2e1 Adding ignore 2015-08-17 15:59:48 -07:00
Thomas Reynolds 241fe69f7d Adding ignore 2015-08-17 14:33:19 -07:00
Thomas Reynolds 9886e04a95 Patch around seemingly invalid logic in Listen v3 2015-08-17 14:28:15 -07:00
Thomas Reynolds 226099d64e Bump listen for test 2015-08-17 10:55:34 -07:00
Thomas Reynolds 50bf848ee8 Add config CLI command 2015-08-17 10:48:56 -07:00
Thomas Reynolds bb6b8c7f13 Replace Hamster hash for user-accessible data with Hashie Indifferent access 2015-08-12 15:29:06 -07:00
Thomas Reynolds 23cf612dd9 bump sprockets branch 2015-08-12 10:51:06 -07:00
Thomas Reynolds fb6bca234f Update to newer cucumber and aruba 2015-08-10 16:58:36 -07:00
Thomas Reynolds ee5e8ff4a1 Merge pull request #1581 from jsdalton/bug/incorrect-file-watch-config
Fix misnamed config value which was causing --force-polling flag to b…
2015-08-10 16:58:17 -07:00
Jim Dalton 1a3f96b58f Fix misnamed config value which was causing --force-polling flag to be ignored by file_watcher extension 2015-08-10 15:04:47 -07:00
Thomas Reynolds 8cce9b8a8c Loudly announce external pipeline errors and exit with failure. 2015-08-10 10:00:23 -07:00
Thomas Reynolds dcbeb7dc76 Remove fivemat 2015-08-06 11:06:34 -07:00
Thomas Reynolds b0c90e1192 Merge pull request #1580 from maxmeyer/feature/bump_cucumber
Bump version of cucumber
2015-08-06 10:35:27 -07:00
Max Meyer dc4057d8dc Bump version of cucumber 2015-08-05 22:51:25 +02:00
Thomas Reynolds 0fba2ae2f6 Fix config meta page 2015-08-05 13:37:03 -07:00
Thomas Reynolds 837a679aa7 bump thor 2015-07-24 14:51:20 -07:00
Thomas Reynolds a528659034 Bump listen to 3.0 2015-07-24 14:20:04 -07:00
Thomas Reynolds 7bfacd565a Update change log 2015-07-24 13:48:43 -07:00
Dennis Günnewig 63e9cd9b5f Substitue whitespace in name 2015-07-24 13:48:32 -07:00
Thomas Reynolds c69099c451 Really fix #1568 2015-07-24 13:46:33 -07:00
Thomas Reynolds 0a8ceb24b0 Add test for #1568 2015-07-20 12:13:10 -07:00
Thomas Reynolds 1d69bcd4bc Merge pull request #1567 from mauro-oto/fix_rubocop_warnings
Fix rubocop warnings
2015-07-20 09:09:02 -07:00
Mauro Otonelli dcc52d967c Applied Rubocop feedback. 2015-07-19 20:45:45 -03:00
Mauro Otonelli c11a9e6f39 Removed invalid Rubocop blocks. 2015-07-19 20:45:10 -03:00
Eliott Appleford 4364d754a5 Merge pull request #1564 from mauro-oto/remove_dir_related_deprec_warnings
Removed most deprecation warnings from the build.
2015-07-17 01:07:17 +01:00
Thomas Reynolds d2f8dc9932 Merge pull request #1528 from maxmeyer/feature/listener
Support Bind to address for middleman
2015-07-16 15:12:09 -07:00
Thomas Reynolds df13c62a6b Revert "Attempt to help #1563"
This reverts commit 55f909d9cf.
2015-07-16 11:34:46 -07:00
Mauro Otonelli 68a6eacc33 Removed most deprecation warnings from the build. 2015-07-15 22:03:41 -03:00
Thomas Reynolds 55f909d9cf Attempt to help #1563 2015-07-15 14:08:51 -07:00
Eliott Appleford a855b634e6 Merge pull request #1560 from mauro-oto/remove_active_support_json
Drop active_support's JSON in favor of native JSON implementation
2015-07-15 12:03:06 +01:00
Mauro Otonelli d18e5ed973 Locked aruba to ~> 0.7.4, as 0.8 (latest) breaks the build. 2015-07-14 21:32:52 -03:00
Mauro Otonelli 63d6a00ed9 Use native Ruby JSON implementation instead of ActiveSupport's. 2015-07-14 19:30:17 -03:00
Mauro Otonelli c14fd72d04 Remove unused integer/inflections extension. 2015-07-14 19:26:59 -03:00
Max Meyer 6aa7ce741a Refactor preview server to support server_name and bind_address 2015-07-01 20:56:56 +02:00
Max Meyer 232aca91bc Make testing a little bit easier and require features-directory to make subdirectories in cucumber work 2015-07-01 20:56:48 +02:00
Thomas Reynolds 724e249b49 Experiment with activersupport bump 2015-06-23 15:53:12 -07:00
Thomas Reynolds 9abcdaa7f7 Experiment with activersupport bump 2015-06-23 15:49:36 -07:00
Thomas Reynolds 8bbda9ea7b Whoops again 2015-06-22 11:28:09 -07:00
Thomas Reynolds 709a0d1a6c Fix previous commit 2015-06-22 10:48:40 -07:00
Thomas Reynolds 3fca2c6961 Add relative argument to stylesheet and javascript helpers. Closes #1539 2015-06-22 10:37:17 -07:00
Thomas Reynolds 1efe6a27c5 Add tests for Slim inline filters. Refactor similar feature in Haml filters. Closes #1542 2015-06-16 16:47:42 -07:00
Thomas Reynolds 7383f67874 Implement yaml data postscript 2015-06-16 15:30:37 -07:00
Thomas Reynolds e09f7fadb5 Add better error messaging for #1541 2015-06-15 09:58:29 -07:00
Eliott Appleford 3cbe2acaf7 Merge pull request #1540 from middleman/extended-globs
Allow extended globs with ignore
2015-06-14 13:26:30 +01:00
Eliott Appleford 70d4671d2c Allow extended globs with ignore
This makes it match the default behaviour of Dir#glob
2015-06-14 12:16:34 +01:00
Thomas Reynolds c0ddf15add Merge pull request #1538 from taf2/patch-1
Update util.rb to support float in yaml files
2015-06-11 14:50:48 -07:00
Todd Fisher ae2d1487fa Update util.rb
line 128, Float type is also not something that can be dup'ed, similar to Fixnum and friends
2015-06-11 15:24:19 -04:00
Thomas Reynolds 6562716aa5 bone head move 2015-06-09 10:42:41 -07:00
Thomas Reynolds 3e46e8139f Add osx build env 2015-06-09 10:17:47 -07:00
Thomas Reynolds bb44e59e6e Blindly attempt to imrpove encoding situation 2015-06-09 10:15:55 -07:00
Thomas Reynolds 915b059e4a Merge pull request #1535 from maxmeyer/feature/capybara
Use capybara to make javascript testing possible
2015-06-09 09:39:01 -07:00
Max Meyer 3935a7cf5f Use capybara to make javascript testing possible 2015-06-09 06:57:15 +02:00
Thomas Reynolds b2cb90c20f Allow live collections based on generic data. Helps with #1527 2015-06-02 16:16:07 -07:00
Thomas Reynolds a38a20322f update changelog 2015-06-02 13:58:56 -07:00
Thomas Reynolds 5630395b40 allow bad paths in i18n links. for #850 2015-06-02 13:48:23 -07:00
Thomas Reynolds ca8655744a Support relative urls in i18n links. For #850 2015-06-01 13:53:39 -07:00
Thomas Reynolds 5e30ef98a1 Fix new link_to i18n w.r.t. index pages. For #850 2015-06-01 11:51:27 -07:00
Thomas Reynolds 68adbfeb2a Add to localized content. For #850 2015-06-01 11:32:43 -07:00
Thomas Reynolds 81a77828bd Make rack request object available in template rendering. Closes #1532 2015-06-01 11:12:34 -07:00
Thomas Reynolds 7eedf6b28f Merge pull request #1533 from akarzim/fix/asset_hash
fix #1496 : Asset hashes on WOFF vs WOFF2 fonts get confused
2015-05-28 09:56:48 -07:00
François Vantomme d7d37e4ae0 fix #1496 : Asset hashes on WOFF vs WOFF2 fonts get confused
reverse sorting the extensions regex solves this issue
2015-05-28 16:21:50 +02:00
Eliott Appleford 3b88496803 Merge pull request #1531 from middleman/backport-407a17b
Backport "Fix port suggestion from unused ports"
2015-05-28 09:38:13 +01:00
Thomas Reynolds f5fe46cb59 Merge pull request #1517 from splebel/i18n-localized-path
Added support for complete path localization
2015-05-27 12:51:39 -07:00
Shin'ya Ueoka 43211d1bc6 Fix port suggestion from unused ports
Conflicts:
	middleman-core/lib/middleman-core/preview_server.rb
2015-05-27 03:07:51 +01:00
Thomas Reynolds d842023903 Merge pull request #1529 from rmm5t/rel-canonical
Add rel=canonical URL to default RedirectResource template
2015-05-26 08:05:56 -07:00
Thomas Reynolds bca04841fe Merge pull request #1530 from iBenza/fix_port_suggestion
Fix port suggestion from unused ports
2015-05-26 08:05:31 -07:00
Shin'ya Ueoka 407a17bc77 Fix port suggestion from unused ports 2015-05-25 10:49:21 +09:00
Ryan McGeary 2875dbec2a Add rel=canonical URL to default RedirectResource template
See https://support.google.com/webmasters/answer/139066
2015-05-24 14:36:44 -06:00
Eliott Appleford f2f82a4ff9 Merge pull request #1526 from zamith/patch-1
Allow minify to correctly throw warnings
2015-05-19 16:43:35 +01:00
Luís Ferreira af2e90cb0a Allow minify to correctly throw warnings
The `path` variable was being used but never defined in the context of the `minify` method. Thus, instead of a warning we would get an error. Using an instance variable fixes this.
2015-05-19 15:41:07 +01:00
Thomas Reynolds a25e9c6382 Normalize file path string encoding on darwin. For #1506 2015-05-17 12:25:17 -07:00
Thomas Reynolds f7ba4ada20 More i18n tests and make sure templates with locale in file name take precedence over the default. 2015-05-16 13:53:09 -07:00
Thomas Reynolds d3c7436647 Tweak locale links 2015-05-16 13:21:12 -07:00
Thomas Reynolds 6502b37934 Use locale for link_to flag 2015-05-16 12:50:39 -07:00
Thomas Reynolds ed5236ef37 Fix bone-headed link_to change 2015-05-15 16:20:47 -07:00
Thomas Reynolds b20d855f2c prep 2015-05-15 11:49:22 -07:00
Thomas Reynolds 651b5fc1c3 Merge old patch to address #1430 2015-05-11 09:24:22 -07:00
Thomas Reynolds 9de1f16f3b Empower link_to in a i18n context 2015-05-11 09:13:04 -07:00
Thomas Reynolds 72916dec13 Merge pull request #1522 from paulozoom/patch-1
Add retina files support on automatic_image_sizes
2015-05-09 14:13:34 -07:00
Paulo f2f8a42f00 Fix syntax bug on retina file matching 2015-05-09 11:15:16 +02:00
Paulo 647ec149ca Add retina files support on automatic_image_sizes 2015-05-08 23:18:11 +02:00
Ben Hollis 28498b2fbe Minor cleanup of 1a23ab3938 2015-05-08 08:36:43 -07:00
Ben Hollis 6afda2a34c Merge pull request #1516 from dg-ratiodata/feature/set_hostname
Set host name and iterate over some ports...
2015-05-08 08:27:42 -07:00
Thomas Reynolds 74c2413c20 Merge pull request #1521 from bhollis/ssl
Create our own self-signed certs, rather than letting Webrick do it for us
2015-05-08 07:55:55 -07:00
Dennis Günnewig fd88e50db6 Output environment in verbose mode 2015-05-08 10:12:57 +02:00
Dennis Günnewig 1a23ab3938 Iterate over 4 ports before giving up and let the user choose a port to listen on 2015-05-08 09:26:00 +02:00
Dennis Günnewig 9741c68d34 Explicit set the hostname 2015-05-08 09:25:54 +02:00
Ben Hollis 38e5fde04e Create our own self-signed certs, rather than letting Webrick do it for us.
We now use a modified copy of Webrick's create_self_signed_certificate that generates a different certificate serial number each time (based on the current time). This avoids an error in Firefox when we serve a certificate with different details but the same serial: it throws up a "sec_error_reused_issuer_and_serial" error and refuses to let you accept the certificate. Our modified version also avoids printing garbage to $stderr.
2015-05-07 22:09:09 -07:00
Thomas Reynolds 70dd18e8f1 Attempt fix for #1506 2015-05-07 09:01:04 -07:00
Thomas Reynolds 211f1b5a85 Merge pull request #1518 from yterajima/issue/builded-text-file-permission-is-0600
fixed: Builded text file(html, css, xml, txt...)'s permission is 0600
2015-05-07 08:47:19 -07:00
yterajima 013b4a8394 fixed: Builded text file(html, css, xml, txt...)'s permission is 0600
In v3-stable branch, builded text file's permission are 0644.
But in master(v4) branch, file's permission are 0600.

When I deploy(drug-and-drop with sftp), the website isn't displayed. So
I fixed this problem.
2015-05-07 21:43:53 +09:00
Thomas Reynolds 051f102aa0 Merge pull request #1515 from yterajima/issue/after_render-hook-is-not-work
fixed 'after_render' hook is not work.
2015-05-06 08:08:29 -07:00
Eliott Appleford 588f42f1df Merge pull request #1512 from middleman/hostname
Encode hostnames to fix #1510
2015-05-06 14:36:26 +01:00
yterajima c444b3f232 fixed 'after_render' hook is not work.
- 'before_render' hook is called twice.
- add simple cucumber test about some hooks.
2015-05-06 16:28:01 +09:00
Eliott Appleford 27684e2ef3 Encode hostnames to fix #1510 2015-05-05 23:56:08 +01:00
Thomas Reynolds 486d34a2c1 prep beta.2 2015-05-04 11:05:00 -07:00
Thomas Reynolds 4626193f97 Fix show_exceptions 2015-05-04 10:50:35 -07:00
Thomas Reynolds 9d3c30ee53 Fix subscriber contract failure 2015-05-04 10:45:03 -07:00
Thomas Reynolds cee53d0f2d Fix bad merge from v3-stable 2015-05-04 10:02:32 -07:00
Thomas Reynolds ee0f9f00f5 Tweak callback delegation 2015-05-04 09:58:29 -07:00
Thomas Reynolds de5234818d Prep 2015-05-04 09:40:33 -07:00
Thomas Reynolds 08c3969eb3 Merge pull request #1509 from bhollis/localhost
Address shortcomings in #1508
2015-05-03 21:39:34 -07:00
Ben Hollis 9f5080edf9 Don't crash when running the preview server and not connected to any network (no public IP) 2015-05-03 18:48:31 -07:00
Ben Hollis 08dee580aa Address shortcomings in #1508 by removing the "host" parameter, always binding on all interfaces, and printing the preview URL with both the local hostname and the local public IP address. 2015-05-03 17:54:00 -07:00
Thomas Reynolds 69e66b04df Some immutability tweaks 2015-05-03 17:11:49 -07:00
Thomas Reynolds bd67f8ad0e Merge pull request #1508 from bhollis/localhost
Port "localhost" preview server URL to v3-stable
2015-05-03 15:51:20 -07:00
Thomas Reynolds e64954fbff Finish porting to new callbacks manager 2015-05-03 15:38:23 -07:00
Ben Hollis 126888272c The preview server URL will once again use the machine's hostname if available. 2015-05-03 15:11:46 -07:00
Ben Hollis cf58acda30 Clean up commit f366325b3b a bit 2015-05-03 15:11:21 -07:00
Karl Freeman f366325b3b return localhost when host is 0.0.0.0 #1011 2015-05-03 14:56:07 -07:00
Ben Hollis f8e4f6f059 The preview server can now serve over HTTPS using the `--https` flag. It will use an automatic self-signed cert which can be overridden using `--ssl_certificate` and `--ssl_private_key`. These settings can also be set in `config.rb`. 2015-05-03 14:52:25 -07:00
Thomas Reynolds 9932d0da84 Merge pull request #1507 from bhollis/ssl
Allow preview server to use HTTPS
2015-05-03 10:32:48 -07:00
Thomas Reynolds d1211cc089 Subtle tweaks 2015-05-02 22:44:38 -07:00
Ben Hollis 572f86985b The preview server can now serve over HTTPS using the `--https` flag. It will use an automatic self-signed cert which can be overridden using `--ssl_certificate` and `--ssl_private_key`. These settings can also be set in `config.rb`. 2015-05-02 20:54:58 -07:00
Thomas Reynolds b9f0330869 Play around with a custom, immutable callback library to replace Hooks 2015-05-02 18:47:16 -07:00
Thomas Reynolds 2b1a4ed1b8 Merge pull request #1393 from AndrewKvalheim/minify-proxied
CSS/JS isn't minified when a proxy has removed the file extension.
2015-05-02 14:28:00 -07:00
Thomas Reynolds 9454536b12 Here we go 2015-05-02 14:23:16 -07:00
Thomas Reynolds 5591c3337b released deps 2015-05-02 13:56:37 -07:00
Thomas Reynolds a9056d0e25 Fix webrick reloading on new ruby 2015-05-02 13:48:47 -07:00
Thomas Reynolds c97c65d655 Add shorthand resources to extensions 2015-05-02 13:22:36 -07:00
Thomas Reynolds 82b84668b0 Standardize exposing methods inside extensions to the outside world 2015-05-02 11:48:21 -07:00
Thomas Reynolds 33cb9b3ba9 Expand collection laziness to data 2015-04-26 13:22:58 -07:00
Thomas Reynolds b127283040 Fix up inline url confusion 2015-04-26 13:01:19 -07:00
Thomas Reynolds 2403fa2d81 Merge stable 2015-04-26 11:32:47 -07:00
Thomas Reynolds c87e2e026e Rubocop tweaks 2015-04-26 11:13:29 -07:00
Thomas Reynolds 56c7ef7905 Merge pull request #1504 from cllns/fix-whitespace
Remove spaces on empty lines in default layout.erb
2015-04-26 09:44:31 -07:00
Thomas Reynolds a43fa14f34 More tests WRT #1503 2015-04-26 09:43:20 -07:00
Thomas Reynolds 4bdf5a9005 Refactor srcset a little 2015-04-26 09:41:50 -07:00
Thomas Reynolds 45ba4bb0d4 Add slim test to asset_hash. WRT #1503 2015-04-26 09:31:39 -07:00
Sean Collins c1ce3ffd61 Remove spaces on empty lines 2015-04-26 12:16:55 -04:00
Thomas Reynolds 5f9820dc63 Update changelog. 2015-04-24 10:37:03 -07:00
Thomas Reynolds c30976ccf5 Fix Rack support. Closes #1501 2015-04-24 10:32:05 -07:00
Thomas Reynolds 4be3fcfd31 Fix recursive enhance on nil values 2015-04-24 10:28:03 -07:00
Thomas Reynolds c25229065a Better indiff logic 2015-04-24 10:28:03 -07:00
Thomas Reynolds 22ce56492f Experiment with Hamster 2015-04-24 10:28:03 -07:00
Thomas Reynolds 55c5a46440 Update contracts gem. #1494 2015-04-24 10:26:42 -07:00
Thomas Reynolds 07eca1e560 Merge pull request #1500 from dperrymorrow/srcset-support
Pull request for issue #1396 supporting srcset property in image tags
2015-04-24 09:20:43 -07:00
David Morrow 580431ca43 Resolves issue #1396 supporting srcset
allows you to use image_tag helper and have it build the asset urls for
your srcset images, just like it does for your main src. Leaves absolute
urls alone, (having // in the path)

```
<%= image_tage 'pic_1980.jpg', srcset: 'pic_640.jpg 2x, pic_1024.jpg 3x' %>
=> <img src="/images/pic_1980.jpg" srcset="/images/pic_640.jpg 2x, /images/pic_1024.jpg 3x">
```
2015-04-23 17:28:49 -07:00
Thomas Reynolds 4740159a3a Use Addressable to improve inline url detection and rewriting. Only rewrite relative paths. Closes #1499 2015-04-22 09:41:24 -07:00
Thomas Reynolds 40e01b0b21 Merge pull request #1498 from stevenosloan/allow_setting_destination_directory_for_source_watchers
allow setting a destination_dir for SourceWatcher(s)
2015-04-17 15:03:29 -07:00
Steven Sloan 3b1a00cf47 allow setting a destination_dir for SourceWatchers
This change lets a source be defined with a destination directory. That way we can mount a source (say a gem’s ‘doc’ directory) in a namespace and worry less about name collisions with  files in other sources.
2015-04-17 16:46:39 -04:00
Thomas Reynolds 60b3bfcee2 Attempt to address #1497 2015-04-16 12:11:52 -07:00
Thomas Reynolds f61e08a9c3 Allow more permissive compass versions 2015-03-30 17:05:36 -07:00
Thomas Reynolds 30721436c0 Allow extensions to activate extensions 2015-03-27 10:56:09 -07:00
Thomas Reynolds af486d7d2a prep 2015-03-24 09:14:33 -07:00
Thomas Reynolds d845503f50 Add jruby to the list of envs requiring tzinfo-data. Addresses comments in #1458 2015-03-21 11:21:03 -07:00
Simon-Pierre LeBel 4e88a66083 Added support for complete path localization 2015-03-19 16:20:19 -04:00
Thomas Reynolds 6fef5b3a93 Require forwardable. Closes #1479 2015-03-05 09:46:38 -08:00
Thomas Reynolds 7f2048b865 Don't lookup resource for path if the path is absolute. Fixes #1195 2015-03-03 13:09:46 -08:00
Thomas Reynolds a71589becd Make preview host and port configurable in config.rb and also expose those variables to extensions which are curious. Closes #1477 2015-03-01 18:17:22 -08:00
Thomas Reynolds 26c6f453f3 Add file watcher :only option 2015-02-26 17:08:40 -08:00
Thomas Reynolds d60cd3a044 Merge pull request #1473 from AndrewKvalheim/overridable-console
Move IRB initialization into a dedicated method.
2015-02-25 23:08:03 -08:00
Andrew Kvalheim 8817f4ab38 Move IRB initialization into an overridable method. 2015-02-25 17:11:29 -08:00
Andrew Kvalheim 049dabbf15 Use configurable content type for detection of minifiable content.
Squashed changes:

  - Prevent side effects of content type testing.
  - Test for inline minification in PHP files.
2015-02-25 16:08:26 -08:00
Thomas Reynolds ef835862bc Merge pull request #1472 from schurig/assets_pipeline_hash_for_woff2
Append assets hash also to .woff2 files
2015-02-25 14:20:43 -08:00
Martin Schurig 10ed3c2447
append assets hash also to .woff2 files 2015-02-25 20:43:46 +01:00
Thomas Reynolds c94e5d0f4d Merge from stable 2015-02-24 11:16:16 -08:00
Thomas Reynolds ce2d5028b2 Merge pull request #1445 from alex88/patch-1
Add Woff2 to asset hash extensions
2015-02-24 09:50:51 -07:00
Thomas Reynolds fbe71f51e4 Merge pull request #1465 from thomasritz/fix-wrong-parent
Fixes computation of `parent`.
2015-02-23 14:18:31 -07:00
Thomas Reynolds a3772428c1 Merge pull request #1456 from yterajima/feature/add-template-test
Add test to `$ middleman init` using tmeplate
2015-02-23 12:30:11 -08:00
Thomas Reynolds 973f79a103 Dropping ruby 1.9.x support 2015-02-23 12:29:51 -08:00
Thomas Reynolds a3519bdf37 Bump 2015-02-23 12:28:30 -08:00
Thomas Reynolds cac0484de8 Fixes #1469 2015-02-23 12:26:37 -08:00
Eliott Appleford e2ae2e5e42 Merge pull request #1468 from vassilevsky/fix-grammar
Fix grammar in a scenario
2015-02-23 16:52:01 +00:00
Eliott Appleford 35e01136fc Merge pull request #1467 from henrik/patch-1
Fix proxy pages link in config template
2015-02-23 16:50:40 +00:00
Ilya Vassilevsky 4d75ba7749 Fix grammar in a scenario 2015-02-23 01:53:14 +03:00
Henrik Nyh 55673480dc Fix proxy pages link in config template
Old link is broken.
2015-02-22 20:31:28 +01:00
Thomas Ritz 262e976790 Fixes computation of `parent`.
If there is a file without a basename in root, e.g. `.htaccess`,
`#parent` of another file in root finds `.htaccess` instead of
`index.html`.

Adding the `.htaccess` to the traversal-app fixture exposes this error.
The fix is to no longer scan for possible files if we know the parent
must be root.
2015-02-21 19:07:17 +01:00
Thomas Reynolds ad05b33cf6 Merge pull request #1459 from twuni/bugfix/readme-pessimistic-versioning-link
Fixing broken (outdated) link for the Pessimistic Versioning Constraint.
2015-02-19 15:00:21 -08:00
Devin Canterberry ac1e289064 Fixing broken (outdated) link for the Pessimistic Versioning Constraint. 2015-02-19 14:56:19 -08:00
Eliott Appleford a977f8bf20 Merge pull request #1416 from dg-ratiodata/feature/fix_offenses
Fix rubocop offenses
2015-02-19 00:50:46 +00:00
Thomas Reynolds 6a228bc5c9 Merge pull request #1457 from Arcovion/slim-update
Fix slim >= 3.0.0 deprecation warning
2015-02-18 16:33:56 -08:00
yterajima ceb4769325 Add test to `$ middleman init` using tmeplate
* using Middleman directory
* using github
    * user/repository
    * user/repository#branch
* using full path
    * contains "://"
2015-02-19 01:02:21 +09:00
Eliott Appleford 0230e26a8c Fix slim >= 3.0.0 deprecation warning 2015-02-18 14:22:50 +00:00
Thomas Reynolds 1cce64d463 Bump 2015-02-17 16:08:58 -08:00
Thomas Reynolds 14104aad70 Try to avoid *nix double load issue again 2015-02-17 09:39:59 -08:00
Thomas Reynolds fd3d9b206f Attempt to avoid double-load issue 2015-02-16 15:53:21 -08:00
Thomas Reynolds f11057c70c change deploy call 2015-02-13 14:42:17 -08:00
Thomas Reynolds 2f558ec571 Fix test 2015-02-13 14:39:08 -08:00
Thomas Reynolds 4d7b21185f fix strange change to how file contents are checked in aruba 2015-02-13 14:34:15 -08:00
Thomas Reynolds 85c8143d49 bump 2015-02-13 14:31:53 -08:00
Thomas Reynolds 5b39a33ab6 Serve sourcemaps as JSON so extensions which rely on mime-type function correctly 2015-02-13 14:28:12 -08:00
Thomas Reynolds 13a24d99ba Merge pull request #1449 from alex88/feature/git-ssh-template-source
Clone templates from ssh 'git@' urls
2015-02-13 09:25:06 -08:00
Alessandro Tagliapietra bf9f94989d Clone templates from ssh 'git@' urls 2015-02-13 10:08:09 +01:00
Thomas Reynolds 5cb880064d Merge pull request #1448 from alex88/feature/git-url-template
Clone template from full repository urls
2015-02-12 09:27:22 -08:00
Alessandro Tagliapietra 640c87c13a Clone template from full repository urls 2015-02-12 15:40:54 +01:00
Alessandro Tagliapietra 3c5c677a07 Add Woff2 to relative assets extension 2015-02-11 00:09:40 +01:00
Alessandro Tagliapietra d97e380db8 Add Woff2 to builder asset order 2015-02-10 23:58:29 +01:00
Alessandro Tagliapietra 19db9f3be1 Add Woff2 to asset hash extensions 2015-02-10 23:30:20 +01:00
Thomas Reynolds 986b9fcf51 Merge pull request #1444 from joost/patch-2
Add :overwrite option to gzip
2015-02-10 14:02:48 -08:00
Joost Hietbrink 28199950e9 Add :overwrite option to gzip
Useful for deployment to S3 together with gzip content-encoding.
2015-02-10 21:49:15 +01:00
Thomas Reynolds 04da75a2eb Merge pull request #1443 from hagenburger/allow-custom-option
don’t override :custom if already set
2015-02-10 07:14:15 -08:00
Nico Hagenburger 98b06878a5 fixed space 2015-02-10 09:28:31 +01:00
Nico Hagenburger a5c65bac53 don’t override :custom if already set
Sometimes Sprockets needs to access
`options[:custom][:sprockets_context]`. If this is set, it should not be
overridden. This happens when building a LivingStyleGuide file when the
Sass source uses `asset-path`, `image-url` or similar functions.
2015-02-09 23:16:20 +01:00
Thomas Reynolds e4b7d4fff0 begin prepping beta.1 2015-02-07 13:38:29 -08:00
Eliott Appleford eede4a8c5d Merge pull request #1439 from danilovaz/v3-stable
Update copyright date README
2015-02-01 02:53:29 +00:00
Danilo Vaz 19371188b0 Update copyright date README 2015-02-01 00:23:26 -02:00
Thomas Reynolds b666a7aaee Merge pull request #1434 from joost/patch-1
Fix 404 for sub-mounted apps
2015-01-26 10:40:48 -08:00
Joost Hietbrink 7bec48c688 Fix 404 for sub-mounted apps
404 now shows full path (similar to url).
2015-01-26 14:33:22 +01:00
Thomas Reynolds 46ebc9d518 Merge pull request #1427 from stevenosloan/add_specs_for_recursively_enhance
add specs for #1426 & reorganize Middleman::Util specs to a single file
2015-01-15 23:02:29 +00:00
Steven Sloan 9ba1dc040f reorganize all Middleman::Util specs to a single spec file, add specs for PR #1426 2015-01-15 13:29:37 -05:00
Thomas Reynolds f02713788d fix strange change to how file contents are checked in aruba 2015-01-15 09:56:28 +00:00
Thomas Reynolds 0409c5bcbe Merge pull request #1426 from stevenosloan/standardize_recursively_enhance_for_hash_with_indifferent_access
Standardize recursively enhance for hash with indifferent access
2015-01-15 09:43:13 +00:00
Steven Sloan 14e1cb1cd6 move all HashWithIndifferentAccess recursive enhancement over to the Util class
TODO: moving this two a class method on HashWithIndifferentAccess would really make the most sense, but there are two blockers:
- historically the method has operated out of Util. While totally ok, simply dedeferring to HashWithIndifferentAccess feels a bit awkward
- the contracts gem doesn’t support class method at this time. the assurance of frozen output is important considering the uses of the recursively_enhance method
2015-01-15 03:30:26 -05:00
Steven Sloan a771b15700 rewrite CoreExtension::Data#key? to prevent potential SystemStackError
since data_for_path can trigger respond_to?, and respond_to? uses key? — a SystemStackError could trigger if data_for_path was called.
2015-01-15 02:46:59 -05:00
Dennis Günnewig 0f95d74827 Use guard clause 2015-01-08 14:58:00 +01:00
Dennis Günnewig 88965858ec Disable some quite noisy cops 2015-01-08 14:57:38 +01:00
Dennis Günnewig 79dbfa0238 Rubcop found some new offenses 2015-01-08 14:55:03 +01:00
Dennis Günnewig 747ca86212 Fixed offense 2015-01-08 14:53:20 +01:00
Thomas Reynolds f1f5ea3e5d Merge pull request #1422 from jarednorman/fix-file-ending
Fix line ending format in all.js
2015-01-06 10:09:04 -08:00
Jared Norman a4406e7d9c Fix line ending format in all.js
Resolves #1302
2015-01-06 09:06:36 -08:00
Thomas Reynolds ddc048e075 swap rbx for another jruby 2015-01-04 16:10:58 -06:00
Thomas Reynolds 69f8245f7b bump 2015-01-04 15:42:22 -06:00
Thomas Reynolds 39c7c9df54 fix leftover flag 2015-01-04 15:28:13 -06:00
Thomas Reynolds 857c99fab5 attempt to fix interactive cli timeout 2015-01-04 15:23:37 -06:00
Thomas Reynolds 8e743aea94 fix interactive init test 2015-01-04 15:06:14 -06:00
Thomas Reynolds 96e05128a1 attempt to improve travis perf 2015-01-04 14:42:06 -06:00
Thomas Reynolds f16510d034 Update CLI 2015-01-04 14:23:35 -06:00
Thomas Reynolds 302a891bbb Update some deps 2015-01-03 14:32:21 -06:00
Eliott Appleford 96b324cf45 Merge pull request #1415 from dg-ratiodata/feature/upgrade_i18n
Update version of i18n
2014-12-28 21:48:29 +00:00
Max Meyer 67125a3f91 Supress warning because of method name offense 2014-12-28 10:50:12 +01:00
Max Meyer e69704b540 Fixed whitespace offenses 2014-12-28 10:49:46 +01:00
Max Meyer 488a4b74ab Update version of i18n 2014-12-28 10:36:33 +01:00
Thomas Reynolds eb1a658b25 over calling change callbacks which are unnecessary. 2014-12-26 14:11:58 -08:00
Thomas Reynolds ef0b996004 blog compat 2014-12-24 11:38:54 -08:00
Thomas Reynolds ee4c68b03c prep alpha, backwards compat 2014-12-23 14:54:21 -08:00
Thomas Reynolds ceeb93d0e4 Merge pull request #1414 from stevenosloan/feature/support_sidecar_frontmatter_for_proxied_resources
add support for “sidecar” frontmatter at the destination url of proxied resources
2014-12-22 13:14:05 -08:00
Steven Sloan 85fa3fac02 add support for “sidecar” frontmatter at the destination url of proxied resources
a “cheap” way to support adding data to pages created through `proxy` or `page` by adding frontmatter at the expected destination url.

for example proxying a page to `/proxied.html`, by adding a sidecar frontmatter file at `source/proxied.html.frontmatter` (or source/proxied.frontmatter if directory indexes is activated) the frontmatter will be merged with the proxy source and available to `current_resource` at the destination.
2014-12-22 13:59:27 -05:00
Thomas Reynolds 4a59ebefe3 Merge pull request #1413 from gitter-badger/gitter-badge
Add a Gitter chat badge to README.md
2014-12-11 19:04:57 -08:00
The Gitter Badger 503c5d382f Added Gitter badge 2014-12-11 17:03:49 +00:00
Thomas Reynolds 29693e4533 More URI encoding and decoding. Addresses #1406 2014-11-19 10:39:48 -08:00
Thomas Reynolds d8e8b06cb6 merge v3 2014-11-19 09:04:56 -08:00
Thomas Reynolds 17eb54b9dc Merge branch 'v3-stable' of github.com:middleman/middleman into v3-stable 2014-11-16 12:42:58 -08:00
Thomas Reynolds ab567b1cbd Merge pull request #1405 from dennisreimann/asset_hash-srcset
Asset hashing for image references in srcset
2014-11-16 12:42:51 -08:00
Thomas Reynolds 3eafb4fcf4 Merge branch 'v3-stable' of github.com:middleman/middleman into v3-stable 2014-11-16 12:35:45 -08:00
Dennis Reimann e28ed20c63 Asset hashing for image references in srcset
Fixes #1287
2014-11-16 21:25:28 +01:00
Thomas Reynolds 20552164aa Merge pull request #1404 from blech75/ignore_git_dir_on_init
exclude .git folder when init'ing a local template
2014-11-13 14:33:01 -08:00
justin blecher dcca8968c8 exclude .git folder when init'ing a local template
freshly init'd middleman projects from a local template should not
include the git files from that template because that's confusing.
this is to help users who clone git repos into `~/.middleman/`.
2014-11-12 19:12:52 -05:00
Thomas Reynolds be98103e05 An attempt to fix #1402 2014-11-09 11:30:11 -08:00
Thomas Reynolds c231e00f00 bump 2014-11-08 21:06:17 -08:00
Eliott Appleford 4f93adffcc Merge pull request #1401 from claudiob/bring-fix-1582-from-padrino-against-v3-stable
Import patch to bugfix from Padrino Helpers
2014-11-08 22:22:25 +00:00
claudiob 9d49b08426 Import patch to bugfix from Padrino Helpers
Padrino had an issue https://github.com/padrino/padrino-framework/issues/1582
which was solved at 72769fe39a (diff-526024418d0d573e08d46ba3d55c02bcR36)

This commit brings the same fix back into Middleman's method that
overrides Padrino's method.
2014-11-08 13:01:13 -08:00
Thomas Reynolds ebe2164fe9 Merge pull request #1398 from maxmeyer/feature/switch_current_working_dir
Switch to current working directory during testing
2014-11-03 08:02:48 -08:00
Max Meyer f4ce1ff99d Switch to current working directory during testing 2014-11-03 09:17:43 +01:00
Thomas Reynolds 7c37d4ba51 Merge pull request #1338 from dg-ratiodata/feature/chained_templates_partials
Chained template parsing failed if parent is "html.erb" and child is "html.md.erb"
2014-10-23 15:25:10 -07:00
Thomas Reynolds 65d3a0c84f Be a bit safer about checking source_file in Sitemap Preview. Working towards fixing #1166 2014-10-20 11:24:52 -07:00
Thomas Reynolds 91d0d39569 stylistic change 2014-10-20 11:19:30 -07:00
Thomas Reynolds c7922c4a35 move actual type detection to sprockets 2014-10-18 12:56:52 -05:00
Thomas Reynolds 6a3d2e7e4e slightly better types debug message 2014-10-18 12:50:18 -05:00
Thomas Reynolds d0a9f01b2f Treat source file types more like tags, allow a set of them 2014-10-18 12:45:49 -05:00
Thomas Reynolds 54e10cf472 yield self along with options in extension activation 2014-10-18 12:11:18 -05:00
Thomas Reynolds 127fba17ef Merge pull request #1307 from middleman/collections
Collections
2014-10-15 17:19:43 -05:00
Thomas Reynolds a95dbb6367 Collections 2014-10-15 14:34:53 -05:00
Thomas Reynolds 445443cffc Add a bit of laziness 2014-10-15 14:25:06 -05:00
Thomas Reynolds e36054b605 Merge pull request #1391 from natebird/patch-1
Add 3.3.6 changes to Changelog
2014-10-13 07:47:31 -05:00
Nate Bird fea9a38372 Add 3.3.6 changes to Changelog 2014-10-13 07:42:05 -04:00
Thomas Reynolds ddfa37faee Use HTTPS by default in new project Gemfiles. Closes #1372 2014-10-12 09:38:14 -05:00
Thomas Reynolds 49a7c1f3da Merge pull request #1389 from tricknotes/ruby-2.2
Test against Ruby 2.2.0 on Travis CI
2014-10-09 09:26:31 -07:00
Ryunosuke SATO 1142630dc8 Test against Ruby 2.2.0 on Travis CI 2014-10-09 00:30:35 +09:00
Thomas Reynolds 144660660f Merge pull request #1381 from minusfive/asset-hash-json
Parse asset-hashes on JSON files
2014-09-28 15:06:39 -07:00
minusfive 17cddce675 Parse asset-hashes on JSON files 2014-09-28 16:39:46 -04:00
Thomas Reynolds 1b0b666130 bump 2014-09-15 15:36:57 -07:00
Thomas Reynolds e326e10e98 listen gem started using full paths instead of relative. Fixes #1374 2014-09-15 15:36:41 -07:00
Thomas Reynolds f73e89370d execute modes as configure blocks 2014-09-11 09:40:10 -07:00
Thomas Reynolds e4090760e8 Merge pull request #1371 from AndrewKvalheim/console
Add a basic feature test for the console.
2014-09-10 18:27:27 -07:00
Andrew Kvalheim ba6ca5b3b7 Fix bug with starting the console. 2014-09-10 16:12:04 -07:00
Andrew Kvalheim 00b4ac6867 Add a basic feature test for the console. 2014-09-10 16:12:04 -07:00
Thomas Reynolds 2ff64fe3a3 Merge pull request #1369 from dg-ratiodata/feature/force_init
Add force option to "middleman init"
2014-09-09 08:43:27 -07:00
Dennis Günnewig d45911f7b8 Add force-option to init 2014-09-09 09:19:41 +02:00
Dennis Günnewig 55e3c93278 Feature tests for force-option 2014-09-09 09:19:31 +02:00
Dennis Günnewig fbe1585ce6 Rubocop fails faster than 'rake test' 2014-09-09 09:19:31 +02:00
Dennis Günnewig b78515ce91 Fixed rubocop offense 2014-09-09 09:02:50 +02:00
Thomas Reynolds 313a2398d4 attempt to get compass 1 working 2014-09-02 12:43:20 -07:00
Thomas Reynolds 5a85d177c2 Catch File read exceptions in frontmatter 2014-08-29 10:24:45 -07:00
Thomas Reynolds e28850c9d7 slim down travis 2014-08-24 19:06:31 -07:00
Thomas Reynolds df22160173 apparently nums are freezable 2014-08-24 18:30:14 -07:00
Thomas Reynolds 5c18b85a8e more freeze fixin 2014-08-24 18:11:56 -07:00
Thomas Reynolds 1d5ae59db9 Lazy isn't in 1.9.3 :( 2014-08-24 17:35:02 -07:00
Thomas Reynolds 84acb50b02 Optimize globbed file lookups, fixes nasty performance regression 2014-08-24 17:10:25 -07:00
Thomas Reynolds 6ef96cc15a more instrumenting 2014-08-24 15:49:53 -07:00
Thomas Reynolds c3492b1f7b Fix partial lookup 2014-08-24 14:38:06 -07:00
Thomas Reynolds 07ac578a31 merge 2014-08-24 11:36:42 -07:00
Thomas Reynolds 18825e7ced no reason for image sizes to touch the alt attr 2014-08-22 09:36:07 -07:00
Thomas Reynolds 0d2bcbabe9 Remove duplicate attr_accessor. Closes #1352 2014-08-20 09:48:55 -07:00
Thomas Reynolds a1979f11b1 Update sass dep and test new error message 2014-08-20 09:48:03 -07:00
Thomas Reynolds 9b88906784 bump ver 2014-08-18 15:32:56 -07:00
Thomas Reynolds ad93f3d8ae fix some uncaught regressions 2014-08-18 14:53:15 -07:00
Thomas Reynolds d4010c9dc4 prep for realz 2014-08-18 14:00:28 -07:00
Thomas Reynolds 51d57afc73 require new compass, fix tests 2014-08-17 13:20:29 -07:00
Thomas Reynolds 345cbdcce2 Merge pull request #1350 from docwhat/pandoc-frontmatter
Accept pandoc-style YAML frontmatter
2014-08-15 13:46:52 -07:00
Christian Höltje 6895f30ff3 Accept pandoc-style YAML frontmatter
Pandoc (and some other tools) have decided to end their YAML frontmatter
with `...` instead of `---`.  In the name of flexibility, this patch
allows either to mark the end of YAML frontmatter.

Example:

```
---
title: No place like home
...
```
2014-08-15 13:21:30 -04:00
Thomas Reynolds e9661a88c5 prep alpha 2014-08-15 10:09:08 -07:00
Thomas Reynolds 96c4416246 ver bump 2014-08-15 09:41:19 -07:00
Thomas Reynolds e886eeaa3e add middleman.rb option 2014-08-14 20:34:31 -07:00
Thomas Reynolds 0f785a448a updated from stable 2014-08-14 10:14:26 -07:00
Thomas Reynolds fae0e00f42 Add webp to our image type lists 2014-08-14 09:04:26 -07:00
Thomas Reynolds 2b928a326c Handle breaking padrino change. Closes #1349 2014-08-13 20:24:20 -07:00
Thomas Reynolds 207da11372 lock asciidoctor dep 2014-08-13 11:57:29 -07:00
Thomas Reynolds 3fb9c75585 Merge pull request #1347 from bitaculous/bump_compass_import_once
Bump “compass-import-once” dependency to version `1.0.5`.
2014-08-13 14:43:09 -04:00
Maik Kempe 309ebe6121 [➠] Bumped “compass-import-once” dependency to version `1.0.5`. 2014-08-13 11:30:45 +02:00
Thomas Reynolds a880fa464c CHANGELOG updates 2014-08-04 15:11:30 -07:00
Thomas Reynolds 625391953a Remove a Padrino hack. They fixed the bug upstream and now our hack is the problem. Closes #1327 2014-08-04 15:07:55 -07:00
Thomas Reynolds 05aa396399 more slim tests. Targets #1327 2014-08-04 14:41:22 -07:00
Thomas Reynolds 1c977a83e2 prep 2014-08-03 08:37:46 -07:00
Thomas Reynolds 724eab3ac9 fix alt tags and add test. Closes #1341 2014-08-03 08:29:29 -07:00
Dennis Günnewig fee6a8b617 Make rubocop happy 2014-07-31 13:13:07 +02:00
Dennis Günnewig 98a36d68f0 Merge branch 'v3-stable' into feature/chained_templates_partials
Conflicts:
	middleman-core/lib/middleman-core/core_extensions/rendering.rb
2014-07-31 13:00:19 +02:00
Dennis Günnewig 856f05709c Support template chaining for partials 2014-07-31 11:39:02 +02:00
Dennis Günnewig 0add2e6676 Added a step to create templates on the fly 2014-07-31 08:46:22 +02:00
Thomas Reynolds b39b913cfb Merge pull request #1337 from dg-vrnetze/feature/new_server_steps
Added some new steps to test middleman applications
2014-07-29 07:22:38 -07:00
Max Meyer 398a038523 Support check for status code 2014-07-29 09:04:10 +02:00
Max Meyer 6dc7eb6353 Support should not see block 2014-07-29 09:03:56 +02:00
Thomas Reynolds 2f545cefbe Attempt to allow i18n to override partial lookup. #1333 2014-07-24 11:11:27 -07:00
Thomas Reynolds 767db6ff26 Frozen works strangely on nils 2014-07-23 22:09:46 -07:00
Thomas Reynolds ff11be93a0 fix source type typo 2014-07-23 22:03:54 -07:00
Thomas Reynolds bfd4e5d7fa make asset hash option required 2014-07-23 21:09:25 -07:00
Thomas Reynolds 5e20fca73e Required options for extensions 2014-07-23 21:08:20 -07:00
Thomas Reynolds 21c38b707c Merge pull request #1321 from middleman/grunt
Add external command support
2014-07-22 18:39:37 -07:00
Thomas Reynolds feef2bf71c Add external command support 2014-07-22 18:38:57 -07:00
Thomas Reynolds bb0b4e7992 Merge pull request #1322 from middleman/sources
Multiple Source watchers
2014-07-22 18:38:49 -07:00
Thomas Reynolds bedf235ff6 Multiple Source watchers 2014-07-20 18:57:22 -07:00
Thomas Reynolds 525e700bfa Move all templates over to Github. Remove need for auto-loaded extensions in CLI 2014-07-20 14:25:47 -07:00
Thomas Reynolds 9087da05d5 Merge branch 'v3-stable' 2014-07-20 13:54:45 -07:00
Thomas Reynolds 15d6210df8 Use the resource instead of the request path for auto asset helpers. Fixes #1326 2014-07-20 13:53:05 -07:00
Thomas Reynolds debf3c704b Remove template lookup cache in build mode. Fixes #1301 2014-07-20 13:37:16 -07:00
Ben Hollis 22dace72df Upgrade url_for to search for resources relative to their destination paths as well as their source paths. This would fix #818. 2014-07-19 16:40:53 -07:00
Thomas Reynolds 8f4057736a merge update deps 2014-07-18 14:31:07 -07:00
Thomas Reynolds 2426abe6f5 bump deps 2014-07-18 14:16:50 -07:00
Thomas Reynolds 6678ea1ae3 merge static partial change 2014-07-18 12:54:27 -07:00
Thomas Reynolds f0603ddf2f work with static partials. Closes #1206 2014-07-18 10:54:48 -07:00
Thomas Reynolds b6951f2729 use stable sprockets branch 2014-07-17 09:32:38 -07:00
Thomas Reynolds 1f3e2043cb Deep freeze IndifferentAccess. 2014-07-14 13:19:34 -07:00
Thomas Reynolds 332ce2bebc slight util reorg 2014-07-14 09:50:44 -07:00
Thomas Reynolds c74d03777a Add edge references to compass and sprockets back to gemfile 2014-07-14 08:56:29 -07:00
Thomas Reynolds 1f69967652 Merge pull request #1319 from middleman/builder_api
Separate Build from Thor
2014-07-11 09:33:39 -07:00
Thomas Reynolds 3ae16111ef Separate Build from Thor 2014-07-11 09:22:53 -07:00
Thomas Reynolds 886fe40922 Merge pull request #1228 from middleman/file_watcher_refactor
FileWatcher Refactor
2014-07-11 09:19:45 -07:00
Thomas Reynolds 840c927ac0 Fix some bugs in the Slim renderer when converting to Extensions 2014-07-10 13:30:16 -07:00
Thomas Reynolds 215ddad660 actually, just depend on it 2014-07-10 13:11:14 -07:00
Thomas Reynolds 7e068cc77d move contracts from gemfile to gemspec 2014-07-10 13:07:27 -07:00
Thomas Reynolds 9ae8a3128b Refactor FileWatcher 2014-07-10 12:38:38 -07:00
Thomas Reynolds 6ccab8e071 Name things :) 2014-07-10 12:35:47 -07:00
Thomas Reynolds 08b75f06ef more generic duck-typed rack extractor 2014-07-09 10:59:00 -07:00
Thomas Reynolds fafeea0857 Handle Rack responses from Sprockets 2014-07-09 10:46:03 -07:00
Thomas Reynolds 0dc5843b57 autorequire less 2014-07-09 10:09:41 -07:00
Thomas Reynolds c9d0dc7fb0 remove autoload sprockets, it'll use our new auto_activation code 2014-07-09 09:50:51 -07:00
Eliott Appleford bf03c14518 merge spec fixes onto master 2014-07-09 14:10:49 +01:00
Thomas Reynolds f2e5918e79 Merge pull request #1311 from middleman/contracts
Experiment with Contracts
2014-07-08 20:41:40 -07:00
Thomas Reynolds 0185d37473 Experiment with Contracts 2014-07-08 18:18:17 -07:00
Thomas Reynolds 928eb82d65 Convert Sitemap::Extensions into actual Middleman::Extension 2014-07-08 17:02:02 -07:00
Thomas Reynolds 52dcf37f24 Merge pull request #1318 from bhollis/partials_dir
Remove partials_dir functionality
2014-07-08 09:19:36 -07:00
Ben Hollis 004ba36741 Remove partials_dir functionality 2014-07-07 23:48:49 -07:00
Ben Hollis 50c6b3f4b9 Merge pull request #1313 from bhollis/remove_neighbor
Remove neighbor frontmatter support & move resource methods into Resource
2014-07-07 22:49:23 -07:00
Ben Hollis a1fe810a50 Fixup after rebase 2014-07-07 22:12:44 -07:00
Thomas Reynolds f47a586332 no longer need warning 2014-07-07 09:51:23 -07:00
Thomas Reynolds b02c9e5724 Merge pull request #1314 from middleman/rack-out
Untangle Rack from Application
2014-07-06 23:11:56 -07:00
Ben Hollis bf4310697d Move proxy/ignore/content_type Resource methods into the Resource class 2014-07-06 16:19:33 -07:00
Ben Hollis 0cbc232dac Remove neighbor frontmatter support 2014-07-06 16:15:43 -07:00
Eliott Appleford 249c649760 Merge pull request #1312 from Arcovion/windows-specs
Fix specs on windows
2014-07-06 07:44:20 +01:00
Eliott Appleford a47b58c58d fix gemfile conflict 2014-07-06 05:48:21 +01:00
Eliott Appleford 21c2b737f5 fix gzip spec 2014-07-06 04:02:43 +01:00
Thomas Reynolds a19c1cbecc refer to v4 in readme 2014-07-05 18:46:39 -07:00
Thomas Reynolds 7e47006f4f merge 2014-07-05 18:43:41 -07:00
Thomas Reynolds 8bf523853e Merge branch 'v3-stable' of github.com:middleman/middleman into v3-stable 2014-07-05 18:42:21 -07:00
Thomas Reynolds ffa8415aaf bump aruba dep 2014-07-05 18:42:15 -07:00
Thomas Reynolds 605bd4ca24 Update README.md 2014-07-05 18:35:39 -07:00
Thomas Reynolds 5f515de2b6 Merge pull request #1315 from Arcovion/v3-stable
Update badges
2014-07-05 18:28:23 -07:00
Thomas Reynolds 13acee8fd5 Reload MM on environment and helpers_dir changes. Closes #1274. Closes #1105 2014-07-05 18:26:51 -07:00
Eliott Appleford c824807119 Update badges 2014-07-06 02:13:42 +01:00
Thomas Reynolds 6752a86b83 Make our Rack pipeline a simple class abstracted from the App. 2014-07-05 17:38:29 -07:00
Thomas Reynolds c94470d33f get i18n's hands out of app too 2014-07-05 16:50:19 -07:00
Thomas Reynolds 0ca6c37e5d Remove App include in File Watcher 2014-07-05 16:44:04 -07:00
Thomas Reynolds 60bbe44e0e Data ext doesn't need to touch the app obj 2014-07-05 16:05:00 -07:00
Thomas Reynolds 300ef8d8fe Convert renderers into first-class extensions 2014-07-05 13:41:59 -07:00
Thomas Reynolds c0a6d8ac4c Pull mixin for extension activation into a real class 2014-07-05 12:51:41 -07:00
Thomas Reynolds 09c31b848b Merge pull request #1286 from middleman/git_template
Load templates from Git
2014-07-05 11:23:44 -07:00
Thomas Reynolds 571704322d Load templates from Git 2014-07-05 11:20:08 -07:00
Thomas Reynolds 336b80cbbd Switch from ActiveSupports delegate method to Ruby 1.9+ def_delegator 2014-07-05 11:17:41 -07:00
Thomas Reynolds 3a19cc668d move Sitemap into application, it's core to the entire system 2014-07-05 10:42:03 -07:00
Eliott Appleford 5897c4c4a4 update gemfile 2014-07-05 04:27:51 +01:00
Thomas Reynolds 3a2cab4775 Whoops, leftover include 2014-07-04 10:41:25 -07:00
Thomas Reynolds 1bd7dab1a3 Make a ProxyResource which extends Resource, rather than injecting methods into Resource 2014-07-04 10:38:25 -07:00
Eliott Appleford e2e3c1e3fb fix specs on windows 2014-07-03 21:09:32 +01:00
Thomas Reynolds 6bb9673630 final copping 2014-07-02 11:05:57 -07:00
Thomas Reynolds 5a936d315d Merge remote-tracking branch 'origin/v3-stable' 2014-07-02 10:40:04 -07:00
Thomas Reynolds 52c8109ca3 rubocoping2 2014-07-02 10:39:43 -07:00
Thomas Reynolds ba38498909 Merge pull request #1310 from Arcovion/patch-1
Update listen code
2014-07-02 10:39:19 -07:00
Eliott Appleford d8f84fa97b Update listen code 2014-07-02 18:26:18 +01:00
Thomas Reynolds 7b85a44afb rubocoping 2014-07-02 10:11:52 -07:00
Thomas Reynolds a2f67a4f37 listen gem conflict 2014-07-02 09:30:58 -07:00
Thomas Reynolds bbc551624e Merge pull request #1309 from Arcovion/patch-1
Update listen gem
2014-07-02 09:24:28 -07:00
Eliott Appleford 6678decd29 Update listen gem 2014-07-02 12:57:01 +01:00
Ben Hollis 4330ff52ae Merge pull request #1308 from bhollis/slim_page
Remove options to proxy or ignore through `page`
2014-06-30 21:11:08 -07:00
Ben Hollis f6dd2f6e52 Update CHANGELOG to mention proxy and ignore are gone from page 2014-06-28 21:33:28 -07:00
Ben Hollis dfecfebc69 Remove options to proxy or ignore through `page`, and use Middleman::Util#path_match for matchers to allow a wider set of matchers. 2014-06-28 21:01:26 -07:00
Ben Hollis 838e25085a Munge build path so that path_match works against it in gzip extension 2014-06-28 21:00:59 -07:00
Ben Hollis d7fd48ef7d Merge branch 'v3-stable'
Conflicts:
	middleman-core/lib/middleman-more/extensions/asset_hash.rb
2014-06-28 18:48:49 -07:00
Ben Hollis 32bdc43ccb Merge pull request #1268 from AndrewKvalheim/gzip-ignore
Excluding paths from gzipping
2014-06-25 21:57:26 -07:00
Andrew Kvalheim 429e7d64bd Accept list of paths to exclude from gzipping. 2014-06-24 14:49:51 -07:00
Andrew Kvalheim b819d38358 Test gzip extensions option. 2014-06-24 14:49:10 -07:00
Andrew Kvalheim 13ba9dae62 Make option documentation consistent. 2014-06-24 14:47:10 -07:00
Ben Hollis 5c991ba4dc Add a protective require 2014-06-22 20:46:39 -07:00
Ben Hollis c4dac7803f Update CHANGELOG 2014-06-20 19:18:12 -07:00
Thomas Reynolds 434d55b1ae See if code climate hooks work 2014-06-20 14:09:51 -07:00
Ben Hollis ad4b441dc3 Fixed implementation of Middleman::Util#path_match, added tests for it 2014-06-16 21:44:19 -07:00
Thomas Reynolds 8989e27769 Rubocop auto fix 2014-06-16 09:05:24 -07:00
Thomas Reynolds fe5247d9d9 Add <head> to 404 so Livereload can add its script to the page 2014-06-16 08:58:16 -07:00
Thomas Reynolds c6543b7c27 Add <head> to 404 so Livereload can add its script to the page 2014-06-16 08:57:56 -07:00
Ben Hollis e7108a5656 Merge pull request #1288 from bhollis/data
@bhollis metadata rewrite/refactor
2014-06-14 17:12:10 -07:00
Ben Hollis 2ef842a730 Fix references to store in traversal 2014-06-14 13:08:03 -07:00
Ben Hollis f63feaf017 Do not use ShowExceptions during tests, it confuses things 2014-06-14 13:05:32 -07:00
Ben Hollis f07bed4ecf Fix custom layouts tests 2014-06-14 12:38:44 -07:00
Ben Hollis 416428444c Let users add metadata via #page 2014-06-14 11:31:53 -07:00
Ben Hollis e6ec5f31de Fix meta pages 2014-06-14 11:31:53 -07:00
Ben Hollis 85cebdb7e9 rubocop 2014-06-14 11:31:53 -07:00
Ben Hollis cb2b13778e Fix i18n 2014-06-14 11:31:53 -07:00
Ben Hollis 2beb774eb9 Put back request_path, I get it now 2014-06-14 11:31:53 -07:00
Ben Hollis b0ea4e7608 Tweak resource manipulator order 2014-06-14 11:31:53 -07:00
Ben Hollis 5760d64ef9 More ignores 2014-06-14 11:31:53 -07:00
Ben Hollis 0309753561 Change when file listeners are registered in order to make cache invalidation work 2014-06-14 11:31:53 -07:00
Ben Hollis 096f5ee356 Use source file, not path, to look up frontmatter data 2014-06-14 11:31:53 -07:00
Ben Hollis bf8f02d563 Turn routing into an extension 2014-06-14 11:31:52 -07:00
Ben Hollis 213c672969 Fix a lot of breakage caused by removing/hiding accessors 2014-06-14 11:31:52 -07:00
Ben Hollis 78b7bbb92a TODO metadata for path extension 2014-06-14 11:31:52 -07:00
Ben Hollis d687677e38 Mess around with liquid 2014-06-14 11:31:52 -07:00
Ben Hollis adfad92f8f Get rid of raw_data 2014-06-14 11:31:52 -07:00
Ben Hollis 5c04c2f42b More trimming 2014-06-14 11:31:52 -07:00
Ben Hollis d83d6e077c Extensionize liquid, bring back provides_metadata_for_path 2014-06-14 11:31:52 -07:00
Ben Hollis c285848866 Clean up i18n a bit, stake out some territory around routing and resource 2014-06-14 11:31:52 -07:00
Ben Hollis 69396d34c1 Start gutting the provides_metadata methods and move some of frontmatter over 2014-06-14 11:31:52 -07:00
Thomas Reynolds c59cefdafc Merge pull request #1293 from middleman/environments
Environments
2014-06-13 11:12:04 -07:00
Thomas Reynolds 449d38bcd2 Update to rspec 3 2014-06-11 13:39:40 -07:00
Thomas Reynolds a21dca025e Separate Environments from Modes 2014-06-11 10:28:30 -07:00
Thomas Reynolds d035b449ea Rename Rubocop 2014-06-11 10:23:33 -07:00
Thomas Reynolds c3b22fe325 sass renderer shouldn't explode if haml isn't available 2014-06-11 10:19:10 -07:00
Thomas Reynolds a35a38dd5f Merge pull request #1295 from nevir/patch-1
`Rubocop` is now `RuboCop`
2014-06-11 10:18:32 -07:00
Thomas Reynolds 7840ebf98a move compass ext out of the main repo 2014-06-11 09:25:59 -07:00
Thomas Reynolds 4b5c6738e5 Merge pull request #1291 from middleman/deprecate_compass
Extract compass
2014-06-11 09:20:45 -07:00
Thomas Reynolds ee1d89fe55 fix whitespace 2014-06-11 09:19:00 -07:00
Ian MacLeod d1c71e473d `Rubocop` is now `RuboCop`
See ff167d8f20
2014-06-09 17:34:33 -07:00
Thomas Reynolds 29bf25ace6 Extract compass support into extension, rewrite all features that rely on it to be pure Ruby 2014-06-03 09:01:46 -07:00
Thomas Reynolds 3879be0f23 Add proc as a means of defining a rewriter ignore. Closes #1289 2014-06-02 15:56:07 -07:00
Thomas Reynolds c53773a4a1 Merge pull request #1261 from middleman/inline_url_rewriter
Abstracted HTML rewriter
2014-05-30 14:51:41 -07:00
Thomas Reynolds 927a1758ba Rack-based HTML rewriter 2014-05-30 14:48:34 -07:00
Thomas Reynolds 1006739e98 merge PR 2014-05-30 14:23:44 -07:00
Thomas Reynolds ca0573d92a Merge pull request #1266 from 747/working
A quick fix for finding eponymous parents
2014-05-30 14:20:11 -07:00
Thomas Reynolds ba01a0a72b more templates back into cli 2014-05-26 18:44:11 -07:00
Thomas Reynolds be5fad55ca Merge branch 'master' of github.com:middleman/middleman 2014-05-26 18:00:44 -07:00
Thomas Reynolds 00bbdfa254 unvendor fastimage 2014-05-26 18:00:39 -07:00
Thomas Reynolds c2512e9093 update more files to non-hashrocket syntax 2014-05-26 17:58:35 -07:00
Ben Hollis 7a5865a407 gsub to sub 2014-05-26 17:13:16 -07:00
Ben Hollis b48a767595 Use alias_method instead of defining an alias method for current_page 2014-05-26 17:13:10 -07:00
Ben Hollis 7108c29035 Merge remote-tracking branch 'origin/v3-stable'
Conflicts:
	CHANGELOG.md
	middleman-core/lib/middleman-core/core_extensions/rendering.rb
	middleman-core/lib/middleman-core/version.rb
2014-05-26 16:59:04 -07:00
Ben Hollis ce914e508a Make rubocop TrivialAccessors warnings less annoying 2014-05-26 16:53:23 -07:00
Thomas Reynolds 18884cac95 Merge pull request #1285 from bhollis/extensions
Auto activating extensions
2014-05-26 14:26:09 -07:00
Ben Hollis 430521be83 Merge pull request #1281 from adamjonas/v3-stable
update rspec should syntax to expect
2014-05-25 21:13:34 -07:00
Ben Hollis 6561fea296 Change the auto activated extension feature to allow specifying different lifecycle events to activate at, allowing more extensions to auto activate. 2014-05-25 21:12:40 -07:00
Ben Hollis 70b3b87905 Move ExternalHelpers into a real extension 2014-05-25 21:06:37 -07:00
Ben Hollis fed95f9c5e Convert external data to a real extension 2014-05-25 21:06:37 -07:00
Ben Hollis e649bc2809 Convert FileWatcher to a real extension 2014-05-25 21:06:37 -07:00
Ben Hollis 67bb394852 Move some explicitly activated extensions to be auto activate 2014-05-25 21:06:36 -07:00
Ben Hollis 5d4cae2a06 Allow extensions to optionally register to be automatically activated before configuration. 2014-05-25 21:06:36 -07:00
Thomas Reynolds f89a76747e Removed wrap_layout 2014-05-25 12:23:00 +09:00
Thomas Reynolds 4ab88e6577 Document and cleanup TemplateContext class. 2014-05-25 11:59:21 +09:00
Thomas Reynolds 1a461154b6 prep 2014-05-24 19:27:56 +09:00
Thomas Reynolds 72b945682a Fix threadsafety issue with assignment. Fixes #501. Also, WTF? 2014-05-24 19:18:12 +09:00
Thomas Reynolds dc15006340 We are semver 2014-05-24 18:51:18 +09:00
Ben Hollis 9a3f9fe488 Clean up some Rubocop warnings that were previously suppressed. 2014-05-24 00:37:46 -07:00
Ben Hollis dd7f06968a Clean up extension activation, helper registration, and sprockets autoload 2014-05-22 23:05:15 -07:00
Ben Hollis 18da7bb692 Improve documentation and mildly clean up core_extensions/extensions.rb 2014-05-22 22:36:56 -07:00
Ben Hollis f60a49d2ce Improve documentation and variable naming for Middleman::Extensions 2014-05-22 21:48:37 -07:00
Thomas Reynolds 610716ee80 Work around possible mutable data issue #501 2014-05-22 19:20:43 +09:00
Ben Hollis 1a7da200d1 Fix before_render after change to hooks-0.4.0. Related to #1278. 2014-05-15 23:58:50 -07:00
Ben Hollis dc33f6b3fa Fix before_render after change to hooks-0.4.0. Related to #1278. 2014-05-15 23:55:39 -07:00
Ben Hollis 5f9dec3dc8 Merge remote-tracking branch 'origin/v3-stable'
Conflicts:
	middleman-core/lib/middleman-core/core_extensions/rendering.rb
	middleman/middleman.gemspec
2014-05-15 23:41:04 -07:00
Ben Hollis f29994e25a Fix tests after Padrino 0.12.2 release 2014-05-15 23:35:09 -07:00
Ben Hollis 82636e3596 Fixes to deal with Padrino 0.12.2 release 2014-05-15 23:30:49 -07:00
adamjonas 9887fe510c update rspec should syntax to expect 2014-05-15 11:51:42 -04:00
Thomas Reynolds 6238bb0716 Merge pull request #1279 from bhollis/extensions
Resource list manipulator priority
2014-05-12 09:25:24 -07:00
Thomas Reynolds b81ce2956b Merge pull request #1280 from bhollis/revert-asset-hash
Revert 1f98d0f
2014-05-12 09:25:05 -07:00
Ben Hollis 6b10d9d428 Add the ability to set a priority order for sitemap resource list manipulators.
This allows us to do things like forcing :directory_indexes to always run last, alleviating the problem of the sitemap output differing depending on when you activate your extensions.
2014-05-12 00:09:35 -07:00
Ben Hollis 2312f875e6 Revert "Add :format and :keep_original options to :asset_hash. Closes #1257"
This reverts commit 1f98d0f4f0.

Conflicts:
	middleman-core/lib/middleman-core/extensions/asset_hash.rb
2014-05-12 00:05:22 -07:00
Ben Hollis 5c75d26c86 Merge pull request #1276 from bhollis/extensions
Extensions cleanup
2014-05-11 17:20:31 -07:00
Thomas Reynolds 1c6cd27171 Merge pull request #1278 from bootstraponline/fix_after_render
Fix after_render
2014-05-11 16:03:22 -07:00
bootstraponline 3f0373adf2 Fix after_render
Example usage from config.rb:

after_render do |content, path, locs, template_class|
  # restore character entities such as &amp;#96;
  content ||= ''
  content.gsub! '&amp;', '&'
  content
end
2014-05-11 14:06:04 -04:00
Ben Hollis b79a74b35b Improve documentation for Middleman::Extension 2014-05-11 00:35:15 -07:00
Ben Hollis 6515f01800 Extension setup methods should be private, not protected 2014-05-11 00:27:12 -07:00
Ben Hollis ef9da685de Do away with InstanceMethods for CoreExtensions::Extensions 2014-05-11 00:27:12 -07:00
Ben Hollis d179343ce7 Remove unused "activate" class method from Extension 2014-05-11 00:27:12 -07:00
Ben Hollis 5fc5e15975 Move methods for handling automatic extension discovery and rubygems enumeration into their own file. 2014-05-11 00:27:12 -07:00
Ben Hollis ab238c32e5 Don't use data.page.title. This was a regression from 3.x 2014-05-10 19:37:48 -07:00
747 038d2a64f7 Merge branch 'add_tests' into working 2014-05-05 06:01:07 +09:00
747 d1d3e8dba6 add tests on eponymous parent traversal 2014-05-02 06:06:55 +09:00
Thomas Reynolds 2dd87bab74 Fix combo of compass-import-once and sass-globs. Closes middleman/middleman-sprockets#56 2014-05-01 10:01:45 -07:00
Thomas Reynolds 113b352474 have travis install rubocop 2014-04-29 11:59:10 -07:00
Thomas Reynolds f513ab77b3 Rubocop'd 2014-04-29 11:43:05 -07:00
Thomas Reynolds 6760d855bc hashrocket killa 2014-04-29 10:50:21 -07:00
Thomas Reynolds 147b0a6626 rubocopening master 2014-04-29 10:48:40 -07:00
Thomas Reynolds 8eabe4d354 rubocop 2: the reckoning 2014-04-29 10:44:24 -07:00
747 348417601b quick fix for finding eponymous parents 2014-04-29 22:43:33 +09:00
Thomas Reynolds 04dc48f13d Great rubocop-ing 2014-04-28 16:02:18 -07:00
Thomas Reynolds 1e43784cc2 remove queryable api 2014-04-28 10:28:16 -07:00
Thomas Reynolds ffe9226aac Remove root config options for minification 2014-04-28 10:21:14 -07:00
Thomas Reynolds 8f75f6516d back out IP detection 2014-04-14 10:34:53 -07:00
Thomas Reynolds 419a81fffb Merge pull request #1256 from fabianrbz/fix_rubocop_config
Fix rubocop config.
2014-04-14 10:15:13 -07:00
Fabian Rodriguez 0656cd6a31 Fix rubocop config.
Since rubycop v0.20.0 'AllCops/Excludes' and 'AllCops/Includes' where renamed to
'AllCops/Exclude' and 'AllCops/Include'
2014-04-12 18:28:13 -03:00
Thomas Reynolds 9d0eb72e73 Merge pull request #1254 from Arcovion/patch-1
Change default IP for CLI server
2014-04-11 09:39:54 -07:00
Eliott Appleford a50ca3a49d Change default IP
Enables #1248 by default.
2014-04-11 14:48:12 +01:00
953 changed files with 37562 additions and 38743 deletions

13
.editorconfig Normal file
View File

@ -0,0 +1,13 @@
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false

View File

@ -29,6 +29,9 @@ Ideally, a bug report should include a pull request with failing specs.
[gist]: https://gist.github.com/
## Submitting a Pull Request
**WE DO NOT ACCEPT NEW FEATURES FOR THE V3 BRANCH ANYMORE**
1. [Fork the repository.][fork]
2. Create a topic [branch]. `git checkout -b local_topic_branch`
3. Add specs for your unimplemented feature or bug fix.

6
.gitignore vendored
View File

@ -1,3 +1,6 @@
.byebug_history
npm-debug.log
manifest.yaml
/.bundle
.DS_Store
coverage
@ -10,6 +13,7 @@ Gemfile.lock
docs
.rbenv-*
.ruby-version
.ruby-gemset
.*.swp
build
doc
@ -20,4 +24,4 @@ Makefile
.idea
*.sublime-workspace
/bin
middleman-core/fixtures/compass-sprites-app/source/images/icon-s0de2218f58.png
middleman-core/fixtures/compass-sprites-app/source/images/icon-s0de2218f58.png

View File

@ -1,19 +1,24 @@
AllCops:
Includes:
- Rakefile
- Gemfile
- config.ru
- gem_rake_helper.rb
Excludes:
- script/**
- vendor/**
- bin/**
- middleman-core/lib/vendored-middleman-deps/**
- middleman-core/bin/**
- middleman-core/fixtures/**
- middleman-core/features/**
- middleman-core/spec/**
- middleman-templates/lib/middleman-templates/**
Include:
- '**/Rakefile'
- '**/Gemfile'
- '**/config.ru'
- '**/gem_rake_helper.rb'
Exclude:
- 'script/**/*'
- 'vendor/**/*'
- '**/tmp/**/*'
- '**/bin/**/*'
- 'middleman-core/lib/middleman-core/step_definitions/**/*'
- 'middleman-core/fixtures/**/*'
- 'middleman-core/features/**/*'
- 'middleman-core/spec/**/*'
- 'middleman-cli/lib/middleman-cli/templates/**/*'
- 'middleman-cli/fixtures/**/*'
- 'middleman-cli/features/**/*'
- 'middleman-cli/spec/**/*'
DoubleNegation:
Enabled: false
LineLength:
Enabled: false
MethodLength:
@ -22,7 +27,45 @@ ClassLength:
Enabled: false
Documentation:
Enabled: false
Encoding:
Enabled: false
HashSyntax:
EnforcedStyle: ruby19
EnforcedStyle: ruby19
SpaceAroundEqualsInParameterDefault:
EnforcedStyle: no_space
PerlBackrefs:
Enabled: false
ClassAndModuleChildren:
Enabled: false
AssignmentInCondition:
Enabled: false
CyclomaticComplexity:
Enabled: false
HandleExceptions:
Enabled: false
EndAlignment:
AlignWith: variable
SignalException:
Enabled: false
RegexpLiteral:
Enabled: false
FormatString:
Enabled: false
CaseIndentation:
IndentWhenRelativeTo: end
TrivialAccessors:
Enabled: false
SingleLineBlockParams:
Enabled: false
Metrics/AbcSize:
Enabled: false
Metrics/PerceivedComplexity:
Enabled: false
Style/ParallelAssignment:
Enabled: false
Style/BlockDelimiters:
Enabled: false
Style/MultilineBlockChain:
Enabled: false
Style/SpecialGlobalVars:
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: false

View File

@ -1,30 +1,23 @@
language: ruby
sudo: false
cache: bundler
env: TEST=true
bundler_args: --without development
before_install: git submodule update --init --recursive
before_script:
- bundle update
rvm:
- ruby-head
- ruby
- jruby-head
- jruby
- jruby-19mode
- 2.1.1
- 2.1.0
- 2.0.0
- 1.9.3
- rbx-2
- 2.3.1
- 2.2.4
os:
- linux
# - osx
matrix:
fast_finish: true
allow_failures:
- rvm: ruby-head
- rvm: ruby
- rvm: jruby-head
- rvm: jruby
- rvm: jruby-19mode
- rvm: rbx-2
env: TEST=true
before_install: git submodule update --init --recursive
env:
global:
- TEST=true
- CODECLIMATE_REPO_TOKEN=81787f7b1c3bfa937edadcafbc94f807bf5af5c1142c7b793f2d9969a271de1f
script: bundle exec rake test
notifications:
slack: middleman:JW9OvXmn1m3XrSERe8866nBR

View File

@ -7,4 +7,5 @@ middleman-*/lib/**/*.rb
--exclude middleman-cli/lib/middleman-cli/templates/shared/
--exclude middleman-cli/lib/middleman-cli/templates/extension/
--no-private
--hide-void-return
--hide-void-return
--markup=markdown

View File

@ -1,6 +1,148 @@
master
===
# 4.1.13
* Change how config options are passed to Thor. Removes new Thor warnings from #2017
# 4.1.12
* Fix broken `ignore { |p| true }` form.
# 4.1.11
* Upgrade to Rack 2.
# 4.1.10
* Fix unicode issues in URL deeplinks.
* Add prefix option to asset_hash (#1949)
# 4.1.9
* Fix `--watcher-*` CLI flags.
* Allow spaces in paths to work with `link_to`. Fixes #1914
* Add support for dotenv
* Fix asset_url with asset_hash (#1919)
* Allow partial lookups without a current_resource (#1912)
# 4.1.8
* Expose `development?` and `production?` helpers to template context.
* require the `try` core extension (#1911)
* Fix contract for Sitemap::Store.register_resource_list_manipulator (#1907)
* Loosen contract on Resource#source_file to Maybe[String] (#1906)
* Let collection loops access ConfigContext for helpers. #1879
* Use https:// to clone templates (#1901)
* Allow numbers to be unique page_ids (#1886)
* Prevent infinite loop when encountering files where base filename is a possible templating engine
# 4.1.7
* Upgrade fastimage to 2.0
* Fix shutdown of external_pipeline commands when config.rb is changed. #1877
* Allow calls to `app.` to work as collections after initial config parse. #1876
# 4.1.5-4.1.6
* Fix file recursion when looking for possible asset dependencies. Major preview server performance improvement.
# 4.1.4
* Unify default extensions for all URL processing extensions. #1855
* Fix URL regex for `content: ` context of CSS. #1853
* Make sure CLI config over-rides `config.rb` order.
* Fix relative assets in some contexts. #1842
# 4.1.3
* Expose all top-level config options to CLI (flags now match config. latency -> watcher_latency, etc).
* Fix directory indexes with `.htm` and `.xhtml` files. #1821
# 4.1.2
* Add `page_id` concept. Using the `id` key in frontmatter, proxy or page will set an ID on a resource which can be referenced by `url_for` and `link_to`.
* Allow looking for `Gemfile` when setting up a project to fail gracefully.
* Send correct exit code when external_pipeline fails during build.
* Fix error when customizing `layouts_dir`. #1028
* Fix collections (commands in loops) not being processed by `page` command. #1226
* Correctly asset_hash sourcemap references.
# 4.1.1
* Fix bad code that made `/__middleman/` break.
# 4.1.0
* Add rewrite_ignore option to asset_hash, asset_host, cache_buster & relative_assets. This proc let's you opt-out of the extension behavior on a per-path basis.
* gzip extension now compresses svgs by default
* Fix the `encoding` option.
* Fix relative paths on `image_tag` helper.
* Correctly exit with error code on failed `init`
* Fixed `asset_hash` when path has query string or #hashes
* Fix new extension template
* Don't parse frontmatter on ignored files.
* Fix displaying frontmatter on `/__middleman/sitemap`
* Add `skip_build_clean` config which when set to a block, will avoid removing non-generated paths from build, like .git #1716
* Minor performance improvements
* DRY-up config.rb-specific commands like `ignore` or `path`.
* Fix automatic images with absolute (or images dir missing) paths in markdown. Fixes #1755
* Fix asset_host in combination with Google Analytics snippet. #1751
* Show an error message when git CLI is not available. #1765
* Correctly show file names of GZIP'ed assets. #1364
* Build file output is now parallel-ized! Use `middleman build --no-parallel` to disable.
* Make template file extensions that get layouts by default configurable via `config[:extensions_with_layout]`
* Remove `=` from inline url matcher. This means paths in HTML attributes MUST be quoted. Fixes #1780
# 4.0.0
* Add `:locales` and `:data` source types to the list of files which trigger a live-reload.
* Rename i18n `lang` and `langs` to `locale` and `locales`.
* Avoid matching URLs across new lines. #1689
* Load Middleman Directory when doing `init` over SSL
* Fix `external_pipeline` first runs running out of sequence.
# 4.0.0.rc.2
* Rather than applying layouts to all files which are not .txt, .css, .js, .json: the new behavior is to only default layouts to active for .html
* Switch from Ruby Sass to SassC.
* `relative_assets` extension overrides local `relative: false` option to stylesheet/javascript tag helpers.
* Add `before_server`-hook to the preview server which is run before the Webrick server is started
* Add `-d` to `middleman server` to make it run as daemon
* Trigger "Possible File Change" events on files which share an output or template type with a changed file. Allows LiveReload to update on partial changes.
* Added `import_file SOURCE, TARGET` and `import_path SOURCE_FOLDER` to copy resources from outside the project in. Does NOT do file change watching. Perfect for `bower_components`.
# 4.0.0.rc.1
* Removed ability to use JSON as frontmatter. Still allowed in data/ folder.
* Added YAML data postscript. Like frontmatter, but reversed. Attach content after the key/value data as a `:postscript` key to the data structure (if Hash).
# 4.0.0.beta.2
* Fixed regression causing exceptions to be silently thrown away outside of `--verbose` mode in the dev server.
* Pull in `--ssl` option from stable.
* Replace `hooks` gem with custom callback solution.
# 4.0.0.beta.1
* Add `resources` class method to extensions to allow simple string-based resource generation.
* rename `app.add_to_instance` to `Extension.expose_to_application` for adding extension-local methods to the shared app instance.
* rename `app.add_to_config_context` to `Extension.expose_to_config` for adding extension-local methods to the sandboxed scope of `config.rb`
* Add `Extension.expose_to_template`, which auto binds copies of extension-local methods into a Template context.
* Remove side-loading of CLI tasks from `tasks/`
* Add the option of naming `config.rb` as `middleman.rb`.
* Builder extracted from Thor. `after_build` hook now passes an instance of a Builder instead of the Thor CLI.
* New FileWatcher API.
* Remove the `partials_dir` setting. Partials should live next to content, or be addressed with absolute paths.
* Partials must be named with a leading underscore. `_my_snippet.html.erb`, not `my_snippet.html.erb`.
* Removed the `proxy` and `ignore` options for the `page` command in `config.rb`. Use the `proxy` and `ignore` commands instead of passing these options to `page`.
* The `page` command in `config.rb` can now be used to add data to the page via the `data` argument. It is accessed the same way as frontmatter data, via `current_resource.data`.
* Add support for `environments` with the `-e` CLI flag. Loads additional config from `environments/envname.rb`. Removed `development?` helper in favor of `environment?(:development)`. Added `server?` helper to differentiate between build and server mode.
* Removed `with_layout`. Use loops of `page` instead.
* Removed Queryable Sitemap API
* Removed `css_compressor` setting, use `activate :minify_css, :compressor =>` instead.
* Removed `js_compressor` setting, use `activate :minify_javascript, :compressor =>` instead.
* Removed ability to server folders of content statically (non-Middleman projects).
* Prevent local templates being loaded when $HOME is not set
* Removed "Implied Extension feature"
@ -16,459 +158,4 @@ master
* Remove deprecated `request` instance
* Remove old module-style extension support
* Placed all `config.rb` evaluation inside the `ConfigContext` class
* Add :format and :keep_original options to :asset_hash
3.3.0-3.3.2
===
* Update Padrino to 0.12.1. Introduces BREAKING CHANGE for Haml. Helpers which take blocks used to require `-` instead of `=` to work correctly. Now, all helpers which output content should use `=`. See: http://www.padrinorb.com/blog/upgrading-padrino-from-0-11-x-to-0-12-0-guide
* Update Haml to 4.x
* Disable Webrick reverse DNS lookup, vastly improving performance when accessing from a VM.
* Ignore `node_modules` in FileWatcher
* Add `tzinfo-data` for Windows users.
* Prefer loading layouts from `layouts_dir`
* Add `before_build` hook.
* Depend on Erubis and remove support for specifying another ERb engine.
* Removed the ability to set the `sass_cache_path`.
* Improved /__middleman/ meta pages. For example, sitemap view now calls out ignored resources, prints data/options better, and shows which special locals are available on a page.
* Bump Uglifier to 2.5.x
3.2.2
===
* Specify the full path to the NEWLINE constant
* Refactor some internals which were dependent on certain order of operations
* Updated i18n dep
* Updated Uglifier dep
3.2.1
===
* Allow path to be passed to page_classes. #1120
* Parallelize gzip extension using four threads. #1116
* Fix locale issue when using gzip extension
* Better handle UTF-8 filenames
* Update Padrino to 0.11.4 and Tilt to 1.4.1
3.2.0
===
* Dropped support for Ruby 1.8
* Dropped empty "middleman-more" gem
* Support the AsciiDoc format
* `page_classes` now prefixes class names starting with numbers with an alpha character. "x" by default.
* AREL-style sitemap query language no longer mutates on filter
* Logging can now be forwarded to a file
* Syntax errors in config.rb no longer hang the server
* Fixed memory leak when adding blocks to resources. #1020
* Support HEAD requests in the server
3.1.6
===
* Magic sitemap-aware links and image references now work when your markdown engine is Kramdown (the default for Middleman).
* Having the build directory be a symlink no longer causes the --clean (default) option to wipe out your build.
* Fix handling paths and URLs with spaces in them. #961
* Loosen up Kramdown dependency to allow for using version 1.2.
* Loosen up Listen dependency so it works with sass betas.
* Look for assets using url_for before falling back to the "images" directory. #1017
* Do not cache generated redirect index file. #1019
* Make an effort to handle spaces in filenames in a way that url_for can handle. #961
* Fix localization via filename extension. #1015
3.1.5
===
* Escape filenames in regexes. Fixes #942.
* Create automated alt tag addition, based on image name.
* Add listener latency option. (Aliased to -l)
* Add support/tests for Redcarpet 3.0.0 features
- :underline
- :highlight
- :disable_indented_code_blocks
* Fix support for
- :link_attributes
- :filter_html
3.1.4
===
* Support kramdown 1.1
* Support redcarpet's :no_links & :no_images. #951
3.1.3
===
* Fixed typo in rack extensions block
* Add support for nojekyll dotfile
3.1.2
===
* Locales regex was broken, selecting .yml files from data folder.
* Fix for implied extensions getting a layout. (Mentioned in #901)git pu
* Added `redirect` command for generating meta refreshes
3.1.1
===
* Check if set is redefining a param at the class level. Fixes #939
* Correctly escape `content_tag` when using a block. Fixes #941
3.1.0 Highlights
===
* Autoload support (moving away from middleman-more)
* New Configuration System
* New v4 Extension API
* `/__middleman' inspector
* Added Ruby 2.0, dropped Ruby 1.9.2
* Fully tested on JRuby 1.9
* Build defaults to --clean
3.1.0.rc.4
===
* Blocks with different templating languages than their layout now work as expected. #860
* Ruby 1.8 users will need to add the following to their Gemfiles:
platforms :mri_18 do
gem "ruby18_source_location"
end
* The `endpoint` method allows the building of Rack-based files or arbitrary content.
3.1.0.rc.2
===
* `layouts_dir` is now configurable
* Custom template classes can now override the file used for creating the project Gemfile.
* Add an "empty" template that produces the minimum necessary structure for a Middleman project.
* Fix ignoring layouts from the sitemap when the source directory has been set to something other than 'source'. #896
* Track test coverage with simplecov
* i18n only autodetects languages in the `locales` root
* Frontmatter cache fixes solve performance regressions found in 3.1.x
* Vendor padrino-* to avoid dep hell
* `middleman-more` gem returns, but it's empty for backwards compat
* Prefer internal files.exists? over ruby's slow File.exists?
3.1.0.rc.1
===
* Move more into core, autoloaded if gems are available.
* DataStore may now be accessed like a hash with #[] and #has_key?. #880
* The i18n extension now supports providing localized templates as separate files, like index.es.html.haml. #816, #823
* The list of regular expressions for which files are ignored by the file watcher are now configurable.
* Revert to Thor 0.15.x
* Revert to padrino-helpers 0.10.x (dependency hell)
* Drop i18n dep to match activesupport at 0.6.1
3.1.0.beta.2
===
* Extension template uses new class-based Extension
* Fix missing children in some sitemap traversal operations. #837
* Add respond_to? to DataStore. #872
* Allow discovery of prerelease gems. #873
* Include middleman-livereload in default Gemfile
* Update Rack dependency to 1.5.x
* Update to Listen 1.0.x
* Update to padrino-helpers 0.11.x
* Update uglifier to 2.0.x
* Convert all of middleman-more to new class-based Extensions
3.1.0.beta.1
===
* Support Slim 2.0 ::Slim::Embedded
* "middleman build" will clean out old files from the build directory by default now, without needing to pass "--clean". Pass "--no-clean" to disable. #862
* Allow frontmatter to be side-loaded from a neighboring file with a .frontmatter extension: #855
* Allow frontmatter "renderer_options" key to overwrite renderer options on a per-file basis. #859
* A custom :partials_dir may be configured, and partials will be looked up from it. #854
* The sprockets environment is now available before config.rb is run, so you can mess with it.
* Added a "t" helper that delegates to I18n.t, just like Rails. #853.
* I18n will fall back to the default locale if a translation in the current locale is not found. You can disable this behavior by passing `:no_fallbacks => true` when activating `:i18n`. More settings documented at https://github.com/svenfuchs/i18n/wiki/Fallbacks . #853
* Switched default Markdown engine to Kramdown. #852
* Overhaul content-type handling, and add a `:content_type` parameter for `page`, `proxy`, and frontmatter that allows for overriding the default content type. #851
* Fixes for upcoming Sass versions.
* Fix markdown filters in Haml 4 so that they don't throw errors when generating links/images and so they use our magic image_tag/link_to methods. #662
* Fix a number of bugs with i18n. Add a `:lang` option that can be used with `page` or `proxy` to set the I18n.locale of a page. #845
* Directory names in the data folder are treated as part of the data key. #836
* Properly reload the server when files change in "lib" or "helpers". #835
* Replace Rainpress CSS minifier with the one built into Sass.
* Changed 'default' and 'html5' templates to use 'current_page.data.title' instead of 'data.page.title'. #825
* Include file extension in template cache. #798
* Support for Ruby 2.0.0.
* "middleman console" will give you a console where you can mess around inside your middleman context. #775
* Add to Compass import paths instead of resetting them. #707
* There are now metadata pages in the preview server at "/__middleman/" that show information about the sitemap and site configuration. #374 and #776
* The sitemap is now queryable with an ARel-like API. #650
* Reorganize SMACSS template. #591
* No longer bundle native file watchers - add an appropriate gem (rb-fsevent for OS X, rb-inotify for Linux, wdm for windows) to your Gemfile.
* `activate :asset_host, :host => hostname` can be used to configure `:asset_host`.
* Path matchers (for things like ignore and page) correctly work with string matchers. #689
* Configuration has been moved to Middleman::Configuration::ConfigurationManager. This is backwards-compatible, but offers a nicer way of getting and setting configuration for extensions, including documenting those settings and their defaults. #620.
3.0.13
===
* Require Tilt 1.3.6 (older versions have errant .csv template type)
* Unregister Tilt HTML handler
* Fix dynamic multi-byte utf-8 files rebuilding. #806
* Force locale to english for number_to_human_size in the gzip extension. #804
* Don't use the logger from a trap context. Ruby 2.0.0 support. #801.
* Serve extensionless files or dotfiles with text/plain MIME type
3.0.12
===
* Update to listen 0.7.x. No longer depend on rb-inotify. *nix users should add to Gemfile.
* Support Haml 4
* :debug_assets can no longer be turned on in the build environment.
* Helpers now work with JS/CSS files with .erb processing.
* Provide an informative exception when link_to is used improperly.
* Force .svgz files to be treated as binary.
* Add a url_for method that performs the link_to magic URL generation without a link. Make form_for use url_for. #739
* Fix issues when combining relative assets and cache buster.
* Support the .yaml extension for data files.
* Handle non-english default languages in i18n. Fixes #584. #771
* Allow frontmatter to be parsed on templates outside the project root
* Improve detection of binary files. #763
* Add before_render and after_render hooks that can be used by extensions to modify templates before they're rendered or modify the rendered output before it's returned. #761 & #774
* Tightened up dependencies
* Print the command for running middleman in verbose mode with quotes so Bundler doesn't swallow the verbose flag. #750
3.0.11
====
* Mitigate major perf regression caused by the Middleman::Util#binary? method
3.0.10
====
* Avoid looking in binary files for frontmatter. #728
* Allow nested i18n files. #725
* Better adapt to Rack interface. #709
* Add --force-polling flag. #730, #644
3.0.9
====
* Lock Rack to 1.4.1 until BodyProxy bug is resolved. #709
* Safely de-register Tilt extensions which are missing gems. #713
3.0.8
====
* Directly send binary files in preview and copy them in build, avoiding reading large binary files into memory for rendering. #643 #699
* Make link_to helper ignore QueryString values when looking up Sitemap resources
* Directly copy binary files during build, and stream them during preview, to avoid reading them into memory
* Make sure all paths in Sitemap are using Pathname
3.0.7
====
* Turn html5 boilerplate into a layout
* Fix errors when templates have empty YAML
* Show the hostname when initializing MM
* Fix issues when using Redcarpet inside Slim
* Make automatic_image_sizes avoid SVGs
3.0.6
====
* Make Sitemap more thread-safe.
* Asset-hash fixes in conjunction with Sprockets.
* Proxy improvements.
* Handle directories with a tilde (~) in their path.
* Print better error message which port is already in use.
* Terminal signal improvements, shutsdown correctly when Terminal closed.
* Bundled Normalize.css updated to 2.0.1
* Fixed Encoding extension activation
* Reload i18n on file changes (#616)
3.0.5
====
* Require newer version of listen.
* Handful of sitemap speed improvements.
* Fix previewing of directories with periods in their name.
* Add CLI ability to skip gemfile and bundler init.
* Fix asset_hash when used in conjunction with Rack middleware.
* Fix LiveReload extension issues.
3.0.3-3.0.4
====
* Add reload_paths to server CLI to add additional paths to reload MM on change.
* Re-organize app reloading code, don't need to restart listen every time.
3.0.2
====
* Logger has no such method .warning. Closes #582
3.0.1
====
* HTML5 Boilerplate version 4.0.0
* Use wdm for Windows
* Fix buggy color renaming in built-in CSS minifier. #576
* Fix Sass/Scss filter in Slim templates
* Added SMACSS template
* Give file metadata (such as frontmatter) precedence over path meta. #552
* Add `sass_assets_paths` option for arbitrary sass partial locations.
* Don't catch CoffeeScript errors when in build mode.
* Extract load_paths so they aren't locked into the binary
* Add middleman/rack for better config.ru support
* Use centralized Logger and add benchmark methods
3.0.0
====
* Improve asset methods and link_to by making them more clever and aware of options such as relative_assets and http_prefix
* Refer to --verbose, instead of --debug in CLI error message (#505)
* Cleanup listener setup and teardown
* Update to Padrino 0.10.7 and Thor 0.15 (#495)
* Build output correctly shows update and identical, instead of create for all.
* automatic_directory_matcher (#491)
3.0.0.rc.2
====
* Doing a build now shows identical files (#475)
* asset_hash, minify_javascript, and minify_css can now accept regexes, globs,
and procs (#489, #480)
* The `link_to` helper can now accept a sitemap Resource as a URL (#474)
* The preview server now correctly listens for changes (#487, #464)
* HTMLs are now served with a 'utf-8' charset instead of 'utf8' (#478)
* UTF-8 is now the new default encoding for data and templates (#486, #483)
* New :encoding setting that allows users to change default encoding
* You may now use the `use` method with a block when adding Rack middleware
* Middleman now depends on Listen 0.4.5+ and ActiveSupport 3.2.6+
* Attempt to avoid issues with RVM's default Bundler (#466)
* Fix issue where Middleman won't start with Compass 0.12.2.rc.1 (#469)
3.0.0.rc.1
====
* Split into 3 gems (middleman-core, middleman-more and middleman which simply includes both)
* Rewritten to work directly with Rack (Sinatra apps can still be mounted)
* Sitemap maintains own state
* New Extension Registration API
* Remove old 1.x mm- binaries and messaging
* New default layout functionality: https://github.com/middleman/middleman/issues/165
* Enable chained templates outside of sprockets (file.html.markdown.erb)
* Sitemap object representing the known world
* FileWatcher proxies file change events
* Unified callback solution
* Removed Slim from base install. Will need to be installed and required by the user (in - config.rb)
* Activate mobile html5boilerplate template
* Update to Redcarpet for Markdown (breaks Haml :markdown filter)
* Return correct exit codes (0 for success, 1 for failure) from CLI
* Yard code docs: http://rubydoc.info/github/middleman/middleman
* config.rb and extensions can add command-line commands
* Nested layouts using `wrap_layout` helper
* Support for placekitten.com
* Added MM_ROOT environmental variable
* activating extensions can now take an options hash
* Don't re-minify files with ".min" in their name
* Serve purely static folders directly (without source/ and config.rb)
* Set ignored files and disable directory_indexes from YAML frontmatter
* Automatically load helper modules in helpers/ directory
* Add pid for cleanup
* Use guard/listen for file watching
* Merge full i18n support
* Implied file extensions (style.scss => style.css)
* Padrino 0.10.6
* `middleman init` generates a `Gemfile` by default.
* Errors stop the build and print a stacktrace rather than silently getting printed into files.
* `with_layout` works with globs or regexes.
* Setting `directory_index` from `page` with a glob or regex now works.
* `:gzip` extension for pre-gzipping files for better compression with no server CPU cost.
* `:asset_hash` extension that generates unique-by-content filenames for assets and rewrites references to use those filenames, so you can set far-future expires on your assets.
* Removed the `--relative` CLI option.
* Properly output Compass-generated sprited images.
* Switch built-in CSS compressor to Rainpress.
* Automatically load helper modules from `helpers/`, like Rails.
* `ignore` and `page` both work with file globs or regexes.
* `layout`, `ignore`, and `directory_index` can be set from front matter.
* JavaScript and CSS are minified no matter where they are in the site, including in inline code blocks.
* Files with just a template extension get output with the correct exension (foo.erb => foo.html)
* `link_to` is smart about source paths, and can produce relative URLs with the `:relative` option or the sitewide `:relative_links` setting.
* Include vendored assets in sprockets path.
* Finally support Compass in Sprockets! Thanks to @xdite and @petebrowne
* Moved Sprockets into an extension
* Support loading Less @imports
2.0.14
====
* Minor fix for i18n
2.0.13.2
====
* Update Windows eventmachine dep
2.0.13.1
====
* build --clean shouldn't remove dotfiles
2.0.13
====
* middleman build --clean keeps the build directory clean of leftover files
* Padrino 0.10.5 and Rack 1.3.5
2.0.12
====
* Sinatra 1.3.1 and Padrino 0.10.4
2.0.11
=====
* Lock Padrino and Sinatra versions (for now)
2.0.9
=====
* Added --glob option to build which only builds matching files
* Allow data/ files to be in JSON format as well
* Enabled Liquid {% include %} tag
* RubyInstaller-specific gem
* Allow access to data/ in config.rb
* Add mobile html5boilerplate template
2.0.8
=====
* Support accessing variables and data objects in ERb Sprockets files (library.js.coffee.erb)
* Make :markdown_engine support simple symbol names (:maruku instead of ::Tilt::MarkukuTemplate)
* Update Padrino deps to 0.10.2
* Include therubyracer on *nix
* Enable frontmatter for Liquid templates
2.0.7
=====
* Updated HTML5 Boilerplate to v2
* Make Rails 3.1 javascript gems available to Sprockets
2.0.6
=====
* Pulled out livereload feature into its own extension, still installed by default.
2.0.5
=====
* Vendored Padrino 0.10.0
2.0.4
=====
* Pulled out undocumented remote data feature into its own extension
2.0.3
=====
* Pulled out undocumented Blog feature into its own extension
2.0.2
=====
* Fixed Sprockets circular error
* Added auto-requiring extensions
2.0.0
=====
* Guard-powered auto-reloading of config.rb
* Guard LiveReload
* Sprockets JS
* Refactored Dynamically Reloadable Core
* Combine views/ and public/ into a single source/ folder.
* Support YAML front-matter
* Added callback to run code after Compass is configured
* Added support for a compass.config file which is passed directly to Compass
* Blog-aware Feature (and project template)
* Thor-based, unified `middleman` binary
* :directory_indexes feature
* The preview server can now serve over HTTPS using the `--https` flag. It will use an automatic self-signed cert which can be overridden using `--ssl_certificate` and `--ssl_private_key`. These settings can also be set in `config.rb`

66
Gemfile
View File

@ -1,42 +1,52 @@
source 'https://rubygems.org'
# Build and doc tools
gem 'rake', '~> 10.0.3', require: false
gem 'yard', '~> 0.8.0', require: false
gem 'rake', '~> 10.3', require: false
gem 'yard', '~> 0.8', require: false
# Test tools
gem 'cucumber', '~> 1.3.1'
gem 'fivemat', '~> 1.2.1'
gem 'aruba', '~> 0.5.1'
gem 'rspec', '~> 2.12'
gem 'simplecov'
gem 'byebug'
gem 'aruba', '~> 0.7.4', require: false
gem 'rspec', '~> 3.0', require: false
gem 'cucumber', '~> 2.0', require: false
gem 'addressable', '~> 2.4.0', require: false
# Pry tools
gem 'pry'
gem 'pry-stack_explorer'
gem 'pry-rescue'
# Optional middleman dependencies, included for tests
gem 'haml', '~> 4.0.0', require: false # Make sure to use Haml 4 for tests
gem 'sinatra', require: false
gem 'slim', require: false
gem 'liquid', require: false
gem 'less', '~> 2.3.0', require: false
gem 'stylus', require: false
gem 'haml', '>= 4.0.5', require: false
gem 'sassc', '~> 1.8', require: false
gem 'coffee-script', '~> 2.2', require: false
gem 'kramdown', '~> 1.2', require: false
gem 'slim', '>= 2.0', require: false
gem 'liquid', '>= 2.6', require: false
gem 'stylus', '>= 1.0', require: false
gem 'sinatra', '>= 2.0.0.beta2', require: false
gem 'redcarpet', '>= 3.1', require: false
platforms :ruby do
gem 'therubyracer'
gem 'redcarpet', '~> 3.1'
gem 'pry', require: false, group: :development
end
# Dns server to test preview server
gem 'rubydns', '~> 1.0.1', require: false
platforms :jruby do
gem 'therubyrhino'
end
# To test javascript
gem 'poltergeist', '~> 1.8', require: false
gem 'phantomjs', '~> 2.1.1.0', require: false
# For less, note there is no compatible JS runtime for windows
gem 'therubyrhino', '>= 2.0', platforms: :jruby
gem 'therubyracer', '>= 0.12', platforms: :ruby
# Code Quality
gem 'cane', platforms: [:mri_19, :mri_20], require: false
gem 'coveralls', require: false
gem 'rubocop', require: false, group: :development
gem 'rubocop', '~> 0.24', require: false
gem 'simplecov', '~> 0.10', require: false
gem 'coveralls', '~> 0.8', require: false
gem 'codeclimate-test-reporter', '~> 0.3', require: false, group: :test
# Middleman itself
gem 'middleman-core', path: 'middleman-core'
gem 'middleman-cli', path: 'middleman-cli'
gem 'middleman-templates', path: 'middleman-templates'
gem 'middleman-sprockets', github: 'middleman/middleman-sprockets', require: false
gem 'middleman', path: 'middleman'
gem 'middleman-core', path: 'middleman-core'
# gem 'middleman-compass', github: 'middleman/middleman-compass', require: false
# gem 'middleman-sprockets', github: 'middleman/middleman-sprockets', require: false

9
ISSUE_TEMPLATE.md Normal file
View File

@ -0,0 +1,9 @@
## Expected behavior and actual behavior
## Steps to reproduce the problem (from a clean middleman installation)
## Additional information
- Ruby version:
- Middleman version:
- OS version:

View File

@ -1,5 +1,7 @@
# Middleman - Makes developing websites simple
[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/middleman/middleman?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
**Middleman** is a static site generator using all the shortcuts and tools in modern web development. Check out [middlemanapp.com](http://middlemanapp.com/) for detailed tutorials, including a [getting started guide](http://middlemanapp.com/basics/getting-started/). You can also follow [@middlemanapp](https://twitter.com/middlemanapp) for updates.
## Why Middleman?
@ -8,7 +10,7 @@ The last few years have seen an explosion in the amount and variety of tools dev
* [Sass](http://sass-lang.com/) for DRY stylesheets
* [CoffeeScript](http://coffeescript.org/) for safer and less verbose javascript
* Multiple asset management solutions, including [Sprockets](https://github.com/sstephenson/sprockets)
* Multiple asset management solutions, including [Sprockets](https://github.com/rails/sprockets)
* [ERb](http://ruby-doc.org/stdlib-2.0.0/libdoc/erb/rdoc/ERB.html) & [Haml](http://haml.info/) for dynamic pages and simplified HTML syntax
**Middleman** gives the stand-alone developer access to all these tools and many, many more. Why would you use a stand-alone framework instead of Ruby on Rails?
@ -17,7 +19,7 @@ These days, many websites are built with an API in mind. Rather than package the
## Installation
Middleman is built on Ruby and uses the RubyGems package manager for installation. These are usually pre-installed on Mac OS X and Linux. Windows users can install both using [RubyInstaller].
Middleman is built on Ruby and uses the RubyGems package manager for installation. These are usually pre-installed on Mac OS X and Linux. Windows users can install both using [RubyInstaller]. For windows [RubyInstaller-Devkit] is also required.
```
gem install middleman
@ -62,11 +64,13 @@ Additionally, up-to-date generated code documentation is available on [RubyDoc].
## Build & Dependency Status
[![Gem Version](http://img.shields.io/gem/v/middleman.svg)][gem]
[![Build Status](http://img.shields.io/travis/middleman/middleman.svg)][travis]
[![Code Coverage](http://img.shields.io/coveralls/middleman/middleman.svg)][coveralls]
[![Dependency Status](http://img.shields.io/gemnasium/middleman/middleman.svg)][gemnasium]
[![Code Quality](http://img.shields.io/codeclimate/github/middleman/middleman.svg)][codeclimate]
[![Gem Version](http://img.shields.io/gem/v/middleman.svg?style=flat)][gem]
[![License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)][license]
[![Dependency Status](http://img.shields.io/gemnasium/middleman/middleman.svg?style=flat)][gemnasium]
[![Build Status](http://img.shields.io/travis/middleman/middleman.svg?style=flat)][travis]
[![Code Coverage](http://img.shields.io/coveralls/middleman/middleman.svg?style=flat)][coveralls]
[![Code Quality](http://img.shields.io/codeclimate/github/middleman/middleman.svg?style=flat)][codeclimate]
[![Gittip](http://img.shields.io/gittip/middleman.svg?style=flat)][gittip]
## Community
@ -87,11 +91,27 @@ The best way to get quick responses to your issues and swift fixes to your bugs
## Donate
[Click here to lend your support to Middleman](https://spacebox.io/s/4dXbHBorC3)
[Click here to lend your support to Middleman](https://plasso.co/s/4dXbHBorC3)
## Versioning
This library aims to adhere to [Semantic Versioning 2.0.0][semver]. Violations
of this scheme should be reported as bugs. Specifically, if a minor or patch
version is released that breaks backward compatibility, that version should be
immediately yanked and/or a new version should be immediately released that
restores compatibility. Breaking changes to the public API will only be
introduced with new major versions. As a result of this policy, you can (and
should) specify a dependency on this gem using the [Pessimistic Version
Constraint][pvc] with two digits of precision. For example:
spec.add_dependency 'middleman-core', '~> 4.0'
[semver]: http://semver.org/
[pvc]: http://guides.rubygems.org/patterns/#pessimistic-version-constraint
## License
Copyright (c) 2010-2014 Thomas Reynolds. MIT Licensed, see [LICENSE] for details.
Copyright (c) 2010-2015 Thomas Reynolds. MIT Licensed, see [LICENSE] for details.
[middleman]: http://middlemanapp.com
[gem]: https://rubygems.org/gems/middleman
@ -99,6 +119,8 @@ Copyright (c) 2010-2014 Thomas Reynolds. MIT Licensed, see [LICENSE] for details
[coveralls]: https://coveralls.io/r/middleman/middleman
[gemnasium]: https://gemnasium.com/middleman/middleman
[codeclimate]: https://codeclimate.com/github/middleman/middleman
[gittip]: https://www.gittip.com/middleman/
[rubyinstaller]: http://rubyinstaller.org/
[RubyInstaller-Devkit]: http://rubyinstaller.org/add-ons/devkit/
[rubydoc]: http://rubydoc.info/github/middleman/middleman
[LICENSE]: https://github.com/middleman/middleman/blob/master/LICENSE.md

View File

@ -1,118 +1,66 @@
require 'rubygems' unless defined?(Gem)
# require 'fileutils' unless defined?(FileUtils)
require 'rake'
require File.expand_path('../middleman-core/lib/middleman-core/version.rb', __FILE__)
ROOT = File.expand_path(File.dirname(__FILE__))
GEM_NAME = 'middleman'
GEM_NAME = 'middleman'.freeze
middleman_gems = %w(middleman-core middleman-templates middleman-cli middleman)
middleman_gems = %w(middleman-core middleman-cli middleman)
GEM_PATHS = middleman_gems.freeze
def sh_rake(command)
sh "#{Gem.ruby} -S rake #{command}", :verbose => true
end
def say(text, color=:magenta)
n = { :bold => 1, :red => 31, :green => 32, :yellow => 33, :blue => 34, :magenta => 35 }.fetch(color, 0)
puts "\e[%dm%s\e[0m" % [n, text]
end
desc "Run 'install' for all projects"
task :install do
GEM_PATHS.each do |dir|
Dir.chdir(dir) { sh_rake(:install) }
end
end
desc 'Clean pkg and other stuff'
task :clean do
GEM_PATHS.each do |g|
%w[tmp pkg coverage].each { |dir| sh 'rm -rf %s' % File.join(g, dir) }
end
end
desc 'Clean pkg and other stuff'
task :uninstall do
sh 'gem search --no-version middleman | grep middleman | xargs gem uninstall -a'
sh "#{Gem.ruby} -S rake #{command}", verbose: true
end
desc 'Displays the current version'
task :version do
say "Current version: #{Middleman::VERSION}"
puts "Current version: #{Middleman::VERSION}"
end
desc 'Bumps the version number based on given version'
task :bump, [:version] do |t, args|
raise 'Please specify version=x.x.x !' unless args.version
version_path = File.dirname(__FILE__) + '/middleman-core/lib/middleman-core/version.rb'
version_text = File.read(version_path).sub(/VERSION = '[\d\.\w]+'/, "VERSION = '#{args.version}'")
say "Updating Middleman to version #{args.version}"
File.open(version_path, 'w') { |f| f.write version_text }
sh 'git commit -a -m "Bumped version to %s"' % args.version
end
desc 'Executes a fresh install removing all middleman version and then reinstall all gems'
task :fresh => [:uninstall, :install, :clean]
desc 'Pushes repository to GitHub'
task :push do
say 'Pushing to github...'
puts 'Pushing to github...'
sh "git tag v#{Middleman::VERSION}"
sh 'git push origin master'
sh 'git push'
sh "git push origin v#{Middleman::VERSION}"
end
desc 'Release all middleman gems'
task :publish => :push do
say 'Pushing to rubygems...'
task publish: :push do
puts 'Pushing to rubygems...'
GEM_PATHS.each do |dir|
Dir.chdir(dir) { sh_rake('release') }
end
Rake::Task['clean'].invoke
end
desc 'Generate documentation for all middleman gems'
task :doc do
GEM_PATHS.each do |g|
Dir.chdir("#{File.join(ROOT, g)}") { sh "#{Gem.ruby} -S rake yard" }
Dir.chdir(File.join(ROOT, g).to_s) { sh "#{Gem.ruby} -S rake yard" }
end
end
desc 'Run tests for all middleman gems'
task :test do
Rake::Task['rubocop'].invoke
GEM_PATHS.each do |g|
Dir.chdir("#{File.join(ROOT, g)}") { sh "#{Gem.ruby} -S rake test" }
Dir.chdir(File.join(ROOT, g).to_s) { sh "#{Gem.ruby} -S rake test" }
end
end
desc 'Run specs for all middleman gems'
task :spec do
GEM_PATHS.each do |g|
Dir.chdir("#{File.join(ROOT, g)}") { sh "#{Gem.ruby} -S rake spec" }
Dir.chdir(File.join(ROOT, g).to_s) { sh "#{Gem.ruby} -S rake spec" }
end
end
begin
require 'cane/rake_task'
desc 'Run cane to check quality metrics'
Cane::RakeTask.new(:quality) do |cane|
cane.no_style = true
cane.no_doc = true
cane.abc_glob = 'middleman*/lib/middleman*/**/*.rb'
end
rescue LoadError
end
begin
require 'rubocop/rake_task'
desc 'Run RuboCop to check code consistency'
Rubocop::RakeTask.new(:rubocop) do |task|
task.fail_on_error = false
end
rescue LoadError
require 'rubocop/rake_task'
desc 'Run RuboCop to check code consistency'
RuboCop::RakeTask.new(:rubocop) do |task|
task.fail_on_error = false
end
desc 'Run tests for all middleman gems'
task :default => :test
task default: :test

View File

@ -1,4 +1,3 @@
require 'rubygems' unless defined?(Gem)
require 'rake'
require 'yard'
@ -19,27 +18,28 @@ Cucumber::Rake::Task.new do |t|
exempt_tags = ['--tags ~@wip']
exempt_tags << '--tags ~@nojava' if RUBY_PLATFORM == 'java'
exempt_tags << '--tags ~@encoding' unless Object.const_defined?(:Encoding)
exempt_tags << '--tags ~@nowindows' if Gem.win_platform?
exempt_tags << '--tags ~@travishatesme' if ENV['TRAVIS'] == 'true'
t.cucumber_opts = "--color #{exempt_tags.join(" ")} --strict --format #{ENV['CUCUMBER_FORMAT'] || 'Fivemat'}"
t.cucumber_opts = "--require features --color #{exempt_tags.join(' ')} --strict" # --format #{ENV['CUCUMBER_FORMAT'] || 'Fivemat'}"
end
Cucumber::Rake::Task.new(:cucumber_wip) do |t|
exempt_tags = ['--tags @wip']
exempt_tags << '--tags ~@nojava' if RUBY_PLATFORM == 'java'
exempt_tags << '--tags ~@encoding' unless Object.const_defined?(:Encoding)
t.cucumber_opts = "--color #{exempt_tags.join(" ")} --strict --format #{ENV['CUCUMBER_FORMAT'] || 'Fivemat'}"
exempt_tags << '--tags ~@nowindows' if Gem.win_platform?
t.cucumber_opts = "--require features --color #{exempt_tags.join(' ')} --strict" # --format #{ENV['CUCUMBER_FORMAT'] || 'Fivemat'}"
end
require 'rspec/core/rake_task'
desc 'Run RSpec'
RSpec::Core::RakeTask.new do |spec|
spec.pattern = 'spec/**/*_spec.rb'
spec.rspec_opts = ['--color', '--format nested']
spec.rspec_opts = ['--color', '--format documentation']
end
desc 'Run tests, both RSpec and Cucumber'
task :test => [:spec, :cucumber]
task test: [:spec, :cucumber]
YARD::Rake::YardocTask.new
task :default => :test
task default: :test

View File

@ -5,4 +5,5 @@ lib/**/*.rb
--exclude lib/middleman-cli/templates/shared/
--exclude lib/middleman-cli/templates/extension/
--no-private
--hide-void-return
--hide-void-return
--markup=markdown

View File

@ -1,4 +1,4 @@
# coding:utf-8
RAKE_ROOT = __FILE__
GEM_NAME = 'middleman-cli'
RAKE_ROOT = __FILE__.freeze
GEM_NAME = 'middleman-cli'.freeze
require File.expand_path(File.dirname(__FILE__) + '/../gem_rake_helper')

View File

@ -4,15 +4,67 @@ require 'middleman-core/profiling'
if ARGV.include? '--profile'
Middleman::Profiling.profiler = Middleman::Profiling::RubyProfProfiler.new
end
Middleman::Profiling.start
# Middleman::Profiling.start
require "middleman-core/load_paths"
Middleman.setup_load_paths
require 'dotenv'
::Dotenv.load
require 'middleman-core'
require 'middleman-core/logger'
module Middleman::Cli
class << self
attr_accessor :config
end
def self.import_config(base)
::Middleman::Cli.config.all_settings.each do |setting|
if setting.default.is_a?(String) || setting.default.is_a?(NilClass)
base.class_option setting.key,
type: :string,
desc: setting.description
elsif setting.default.is_a?(TrueClass) || setting.default.is_a?(FalseClass)
base.class_option setting.key,
type: :boolean,
desc: setting.description
end
end
end
end
require "middleman-cli"
# Change directory to the root
Dir.chdir(ENV["MM_ROOT"]) if ENV["MM_ROOT"]
# Default command is server
if ARGV[0] != 'help' && (ARGV.length < 1 || ARGV.first.include?('-'))
ARGV.unshift('server')
end
::Middleman::Logger.singleton(3)
::Middleman::Cli.config = ::Middleman::Application.new do
#
config[:environment] = (ENV['MM_ENV'] || ENV['RACK_ENV'] || 'development').to_sym
config[:mode] = :config
config[:exit_before_ready] = true
config[:watcher_disable] = true
config[:disable_sitemap] = true
end.config
# Require the Middleman version
require 'middleman-core/version'
# Include the core CLI items
require 'middleman-cli/init'
require 'middleman-cli/extension'
require 'middleman-cli/server'
require 'middleman-cli/build'
require 'middleman-cli/console'
require 'middleman-cli/config'
# Start the CLI
Middleman::Cli::Base.start
Middleman::Cli::Base.start(ARGV)

View File

@ -9,6 +9,6 @@ Feature: Middleman New Extension CLI
| Rakefile |
| my-extension-library.gemspec |
| features/support/env.rb |
| lib/middleman_extension.rb |
| lib/my-extension-library/extension.rb |
| lib/my-extension-library.rb |
| .gitignore |

View File

@ -0,0 +1,93 @@
Feature: Middleman CLI
Scenario: Create a new project
When I run `middleman init MY_PROJECT` interactively
And I type "y"
And I type "y"
And I type "y"
And I type "y"
Then the exit status should be 0
When I cd to "MY_PROJECT"
Then the following files should exist:
| Gemfile |
| .gitignore |
| config.rb |
| source/index.html.erb |
| source/layouts/layout.erb |
| source/javascripts/all.js |
| source/stylesheets/site.css.scss |
| source/stylesheets/_normalize.scss |
Scenario: Create a new project in the current directory
Given a directory named "MY_PROJECT"
When I cd to "MY_PROJECT"
And I run `middleman init` interactively
And I type "y"
And I type "y"
And I type "y"
And I type "y"
Then the exit status should be 0
And the following files should exist:
| Gemfile |
| config.rb |
| source/index.html.erb |
Scenario: Create a new project (alias i)
When I run `middleman i MY_PROJECT` interactively
And I type "y"
And I type "y"
And I type "y"
And I type "y"
Then a directory named "MY_PROJECT" should exist
Scenario: Create a new project (alias new)
When I run `middleman new MY_PROJECT` interactively
And I type "y"
And I type "y"
And I type "y"
And I type "y"
Then a directory named "MY_PROJECT" should exist
Scenario: Create a new project (alias n)
When I run `middleman n MY_PROJECT` interactively
And I type "y"
And I type "y"
And I type "y"
And I type "y"
Then a directory named "MY_PROJECT" should exist
Scenario: Create a new project using Middleman directory
When I run `middleman init MY_PROJECT -T blog`
Then a directory named "MY_PROJECT" should exist
When I cd to "MY_PROJECT"
And the file "Gemfile" should contain "middleman-blog"
And the file ".gitignore" should exist
Scenario: Create an invalid project using Middleman directory
When I run `middleman init MY_PROJECT -T does-not-exist-for-reals`
Then the exit status should be 1
Scenario: Create a new project using github(user/repository)
When I run `middleman init MY_PROJECT -T middleman/middleman-templates-default` interactively
And I type "y"
And I type "y"
And I type "y"
And I type "y"
Then a directory named "MY_PROJECT" should exist
Scenario: Create a new project using github(user/repository#branch)
When I run `middleman init MY_PROJECT -T middleman/middleman-templates-default#master` interactively
And I type "y"
And I type "y"
And I type "y"
And I type "y"
Then a directory named "MY_PROJECT" should exist
And the output should contain "-b master"
Scenario: Create a new project using full path(://)
When I run `middleman init MY_PROJECT -T https://github.com/middleman/middleman-templates-default.git` interactively
And I type "y"
And I type "y"
And I type "y"
And I type "y"
Then a directory named "MY_PROJECT" should exist

View File

@ -0,0 +1,17 @@
Feature: Run preview server before hook
Scenario: When run
Given a fixture app "preview-server-hook-app"
And the default aruba timeout is 30 seconds
When I run `middleman server --server-name localhost --bind-address 127.0.0.1` interactively
And I stop middleman if the output contains:
"""
### END ###
"""
Then the output should contain:
"""
/// 127.0.0.1:4567 ///
/// 4567 ///
/// localhost ///
/// http://localhost:4567 ///
"""

View File

@ -0,0 +1,536 @@
Feature: Run the preview server
As a software developer
I want to start the preview server
In order to view my changes immediately in the browser
Background:
Given a fixture app "preview-server-app"
And the default aruba timeout is 30 seconds
Scenario: Start the server with defaults
When I run `middleman server` interactively
And I stop middleman if the output contains:
"""
Inspect your site configuration
"""
And the output should contain:
"""
View your site at "http://
"""
And the output should contain:
"""
Inspect your site configuration at "http://
"""
Scenario: Start the server with defaults in verbose mode
When I run `middleman server --verbose` interactively
And I stop middleman if the output contains:
"""
Inspect your site configuration
"""
Then the output should contain:
"""
The Middleman preview server is bound to ":::4567", "0.0.0.0:4567"
"""
And the output should contain:
"""
View your site at "http://
"""
And the output should contain:
"""
Inspect your site configuration at "http://
"""
@wip
Scenario: Start the server with defaults in verbose mode, when a local mdns server resolves the local hostname
Given I start a mdns server for the local hostname
When I run `middleman server --verbose` interactively
And I stop middleman if the output contains:
"""
Inspect your site configuration
"""
Then the output should contain:
"""
The Middleman preview server is bound to ":::4567", "0.0.0.0:4567"
"""
And the output should contain:
"""
View your site at "http://
"""
And the output should contain:
"""
Inspect your site configuration at "http://
"""
Scenario: Start the server with bind address 127.0.0.1
Given I have a local hosts file with:
"""
# <ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain localhost
"""
When I run `middleman server --verbose --bind-address 127.0.0.1` interactively
And I stop middleman if the output contains:
"""
Inspect your site configuration
"""
Then the output should contain:
"""
The Middleman preview server is bound to "127.0.0.1:4567"
"""
And the output should contain:
"""
View your site at "http://127.0.0.1:4567"
"""
And the output should contain:
"""
Inspect your site configuration at "http://127.0.0.1:4567/__middleman"
"""
Scenario: Start the server with bind address 127.0.0.1 configured via config.rb
Given I have a local hosts file with:
"""
# <ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain localhost
"""
And a file named "config.rb" with:
"""
set :bind_address, '127.0.0.1'
"""
When I run `middleman server --verbose` interactively
And I stop middleman if the output contains:
"""
Inspect your site configuration
"""
Then the output should contain:
"""
The Middleman preview server is bound to "127.0.0.1:4567"
"""
And the output should contain:
"""
View your site at "http://127.0.0.1:4567"
"""
And the output should contain:
"""
Inspect your site configuration at "http://127.0.0.1:4567/__middleman"
"""
@wip
Scenario: Start the server with bind address 127.0.0.5
This will have no hostname attached because the hosts file, the DNS server
and the MDNS-server do not know anything about 127.0.0.5
When I run `middleman server --verbose --bind-address 127.0.0.5` interactively
And I stop middleman if the output contains:
"""
Inspect your site configuration
"""
Then the output should contain:
"""
The Middleman preview server is bound to "127.0.0.5:4567"
"""
And the output should contain:
"""
View your site at "http://127.0.0.5:4567"
"""
And the output should contain:
"""
Inspect your site configuration at "http://127.0.0.5:4567/__middleman"
"""
Scenario: Start the server with bind address ::1
Given a file named ".hosts" with:
"""
# <ip-address> <hostname.domain.org> <hostname>
::1 localhost.localdomain localhost
"""
When I run `middleman server --verbose --bind-address ::1` interactively
And I stop middleman if the output contains:
"""
Inspect your site configuration
"""
Then the output should contain:
"""
The Middleman preview server is bound to "::1:4567"
"""
And the output should contain:
"""
View your site at "http://[::1]:4567"
"""
And the output should contain:
"""
Inspect your site configuration at "http://[::1]:4567/__middleman"
"""
Scenario: Start the server with bind address 0.0.0.0
When I run `middleman server --verbose --bind-address 0.0.0.0` interactively
And I stop middleman if the output contains:
"""
Inspect your site configuration
"""
Then the output should contain:
"""
The Middleman preview server is bound to "0.0.0.0:4567"
"""
And the output should contain:
"""
View your site at "http://
"""
And the output should contain:
"""
Inspect your site configuration at "http://
"""
Scenario: Start the server with bind address ::
When I run `middleman server --verbose --bind-address ::` interactively
And I stop middleman if the output contains:
"""
Inspect your site configuration
"""
Then the output should contain:
"""
The Middleman preview server is bound to ":::4567"
"""
And the output should contain:
"""
View your site at "http://
"""
And the output should contain:
"""
Inspect your site configuration at "http://
"""
Scenario: Start the server with server name "localhost"
Given I have a local hosts file with:
"""
# <ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain localhost
"""
When I run `middleman server --verbose --server-name localhost` interactively
And I stop middleman if the output contains:
"""
Inspect your site configuration
"""
Then the output should contain:
"""
The Middleman preview server is bound to "127.0.0.1:4567"
"""
And the output should contain:
"""
View your site at "http://localhost:4567", "http://127.0.0.1:4567"
"""
And the output should contain:
"""
Inspect your site configuration at "http://localhost:4567/__middleman", "http://127.0.0.1:4567/__middleman"
"""
Scenario: Start the server with server name "localhost" configured via config.rb
Given I have a local hosts file with:
"""
# <ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain localhost
"""
And a file named "config.rb" with:
"""
set :server_name, 'localhost'
"""
When I run `middleman server --verbose` interactively
And I stop middleman if the output contains:
"""
Inspect your site configuration
"""
Then the output should contain:
"""
The Middleman preview server is bound to "127.0.0.1:4567"
"""
And the output should contain:
"""
View your site at "http://localhost:4567", "http://127.0.0.1:4567"
"""
And the output should contain:
"""
Inspect your site configuration at "http://localhost:4567/__middleman", "http://127.0.0.1:4567/__middleman"
"""
Scenario: Start the server with server name "localhost" and bind address "127.0.0.1"
Given I have a local hosts file with:
"""
# <ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain localhost
"""
When I run `middleman server --verbose --server-name localhost --bind-address 127.0.0.1` interactively
And I stop middleman if the output contains:
"""
Inspect your site configuration
"""
Then the output should contain:
"""
The Middleman preview server is bound to "127.0.0.1:4567"
"""
And the output should contain:
"""
View your site at "http://localhost:4567", "http://127.0.0.1:4567"
"""
And the output should contain:
"""
Inspect your site configuration at "http://localhost:4567/__middleman", "http://127.0.0.1:4567/__middleman"
"""
Scenario: Start the server with server name "127.0.0.1"
When I run `middleman server --verbose --server-name 127.0.0.1` interactively
And I stop middleman if the output contains:
"""
Inspect your site configuration
"""
Then the output should contain:
"""
The Middleman preview server is bound to "127.0.0.1:4567"
"""
And the output should contain:
"""
View your site at "http://127.0.0.1:4567"
"""
And the output should contain:
"""
Inspect your site configuration at "http://127.0.0.1:4567/__middleman"
"""
Scenario: Start the server with server name "::1"
When I run `middleman server --verbose --server-name ::1` interactively
And I stop middleman if the output contains:
"""
Inspect your site configuration
"""
Then the output should contain:
"""
The Middleman preview server is bound to "::1:4567"
"""
And the output should contain:
"""
View your site at "http://[::1]:4567"
"""
And the output should contain:
"""
Inspect your site configuration at "http://[::1]:4567/__middleman"
"""
Scenario: Start the server with https
When I run `middleman server --verbose --https` interactively
And I stop middleman if the output contains:
"""
Inspect your site configuration
"""
Then the output should contain:
"""
The Middleman preview server is bound to ":::4567", "0.0.0.0:4567"
"""
And the output should contain:
"""
View your site at "https://
"""
And the output should contain:
"""
Inspect your site configuration at "https://
"""
Scenario: Start the server with port 65432
When I run `middleman server --verbose --port 65432` interactively
And I stop middleman if the output contains:
"""
Inspect your site configuration
"""
Then the output should contain:
"""
The Middleman preview server is bound to ":::65432", "0.0.0.0:65432"
"""
Scenario: Start the server with port 65432 configured via config.rb
Given a file named "config.rb" with:
"""
set :port, 65432
"""
When I run `middleman server --verbose` interactively
And I stop middleman if the output contains:
"""
Inspect your site configuration
"""
Then the output should contain:
"""
The Middleman preview server is bound to ":::65432", "0.0.0.0:65432"
"""
@wip
Scenario: Start the server when port is blocked by other middleman instance
Given `middleman server` is running in background
When I run `middleman server --verbose` interactively
And I stop all commands if the output of the last command contains:
"""
Inspect your site configuration
"""
Then the output should contain:
"""
The Middleman uses a different port
"""
Scenario: Start the server with bind address 1.1.1.1
This should fail, because "1.1.1.1" is not an interface available on this computer.
Given a file named ".hosts" with:
"""
1.1.1.1 www.example.com www
"""
When I run `middleman server --verbose --bind-address 1.1.1.1` interactively
And I stop middleman if the output contains:
"""
Running Middleman failed:
"""
Then the output should contain:
"""
Bind address "1.1.1.1" is not available on your system
"""
Scenario: Start the server with server name www.example.com and bind address 0.0.0.0
This should fail, because the user can just use `--server-name`. It does
not make sense for `middleman` to only listen on `0.0.0.0` (IPv4 all
interfaces), but not on `::` (IPv6 all interfaces). There are other tools
like `iptables` (Linux-only) or better some `kernel`-configurations to make
this possible.
When I run `middleman server --verbose --server-name www.example.com --bind-address 0.0.0.0` interactively
And I stop middleman if the output contains:
"""
Running Middleman failed:
"""
Then the output should contain:
"""
Undefined combination of options "--server-name" and "--bind-address".
"""
Scenario: Start the server with server name "www.example.com" and bind address "127.0.0.1"
This should fail because the server name does not resolve to the ip address.
Given a file named ".hosts" with:
"""
1.1.1.1 www.example.com www
"""
When I run `middleman server --verbose --server-name www.example.com --bind-address 127.0.0.1` interactively
And I stop middleman if the output contains:
"""
Running Middleman failed:
"""
Then the output should contain:
"""
Server name "www.example.com" does not resolve to bind address "127.0.0.1". Please fix that and try again.
"""
Scenario: Start the server with server name "garbage.example.com"
When I run `middleman server --verbose --server-name garbage.example.com` interactively
And I stop middleman if the output contains:
"""
Running Middleman failed:
"""
Then the output should contain:
"""
Server name "garbage.example.com" does not resolve to an ip address. Please fix that and try again.
"""
Scenario: Start the server with server name "www.example.com" and the network name server is used to resolve the server name
Given I have a local hosts file with:
"""
# empty
"""
And I start a mdns server with:
"""
# empty
"""
And I start a dns server with:
"""
www.example.com: 127.0.0.1
"""
When I run `middleman server --verbose --server-name www.example.com` interactively
And I stop middleman if the output contains:
"""
Inspect your site configuration
"""
Then the output should contain:
"""
The Middleman preview server is bound to "127.0.0.1:4567"
"""
And the output should contain:
"""
View your site at "http://www.example.com:4567", "http://127.0.0.1:4567"
"""
And the output should contain:
"""
Inspect your site configuration at "http://www.example.com:4567/__middleman", "http://127.0.0.1:4567/__middleman"
"""
@ruby-2.1
@wip
Scenario: Start the server with server name "host.local" and the link local name server is used to resolve the server name
To make the mdns resolver resolve a name, it needs to end with ".local".
Otherwise the resolver returns [].
Given I have a local hosts file with:
"""
# empty
"""
And I start a mdns server with:
"""
host.local: 127.0.0.1
"""
When I run `middleman server --verbose --server-name host.local` interactively
And I stop middleman if the output contains:
"""
Inspect your site configuration
"""
Then the output should contain:
"""
The Middleman preview server is bound to "127.0.0.1:4567"
"""
And the output should contain:
"""
View your site at "http://host.local:4567", "http://127.0.0.1:4567"
"""
And the output should contain:
"""
Inspect your site configuration at "http://host.local:4567/__middleman", "http://127.0.0.1:4567/__middleman"
"""
@ruby-2.1
@wip
Scenario: Start the server with server name "host" and the link local name server is used to resolve the server name
To make the mdns resolver resolve a name, it needs to end with ".local". If
a plain hostname is given `middleman` appends ".local" automatically.
Given I have a local hosts file with:
"""
# empty
"""
And I start a mdns server with:
"""
host.local: 127.0.0.1
"""
When I run `middleman server --verbose --server-name host` interactively
And I stop middleman if the output contains:
"""
Inspect your site configuration
"""
Then the output should contain:
"""
The Middleman preview server is bound to "127.0.0.1:4567"
"""
And the output should contain:
"""
View your site at "http://host.local:4567", "http://127.0.0.1:4567"
"""
And the output should contain:
"""
Inspect your site configuration at "http://host.local:4567/__middleman", "http://127.0.0.1:4567/__middleman"
"""

View File

@ -0,0 +1,19 @@
ENV["TEST"] = "true"
require 'sassc'
require 'simplecov'
SimpleCov.root(File.expand_path(File.dirname(__FILE__) + '/../..'))
require 'phantomjs/poltergeist'
Capybara.javascript_driver = :poltergeist
require 'coveralls'
Coveralls.wear!
require 'codeclimate-test-reporter'
CodeClimate::TestReporter.start
PROJECT_ROOT_PATH = File.dirname(File.dirname(File.dirname(__FILE__)))
require File.join(PROJECT_ROOT_PATH, 'lib', 'middleman-cli')
require File.join(File.dirname(PROJECT_ROOT_PATH), 'middleman-core', 'lib', 'middleman-core', 'step_definitions')

View File

@ -0,0 +1,33 @@
#!/usr/bin/env ruby
require 'rubydns'
require 'psych'
db_file = ARGV[0]
port = ARGV[1] || 5300
db = if File.file? db_file
$stderr.puts 'Found dns db'
Psych.load_file(db_file)
else
$stderr.puts 'Found no dns db. Use default db.'
{
/www\.example\.org/ => '1.1.1.1'
}
end
interfaces = [
[:udp, "127.0.0.1", port],
[:tcp, "127.0.0.1", port]
]
# Start the RubyDNS server
RubyDNS::run_server(listen: interfaces) do
db.each do |matcher, result|
match(matcher, Resolv::DNS::Resource::IN::A) do |transaction|
transaction.respond!(result)
end
end
end

View File

@ -0,0 +1 @@
<h1>Welcome</h1>

View File

@ -0,0 +1,9 @@
<html>
<head>
<title>My Sample Site</title>
<!-- Comment in layout -->
</head>
<body>
<%= yield %>
</body>
</html>

View File

@ -0,0 +1,8 @@
<html>
<head>
<title>Custom Layout</title>
</head>
<body>
<%= yield %>
</body>
</html>

View File

@ -0,0 +1 @@
I am real

View File

@ -0,0 +1,5 @@
---
layout: false
---
I am real: <%= @num %>

View File

@ -0,0 +1 @@
<h1>Ignore me!</h1>

View File

@ -0,0 +1 @@
<h1>Ignore me! 2</h1>

View File

@ -0,0 +1 @@
<h1>Ignore me! 3</h1>

View File

@ -0,0 +1 @@
Static, no code!

View File

@ -0,0 +1,19 @@
set :layout, false
class MyFeature < Middleman::Extension
def initialize(app, options_hash = {}, &block)
super
app.before_server do |server_information|
puts "/// #{server_information.listeners.first} ///"
puts "/// #{server_information.port} ///"
puts "/// #{server_information.server_name} ///"
puts "/// #{server_information.site_addresses.first} ///"
puts "/// ### END ### ///"
end
end
end
::Middleman::Extensions.register(:my_feature, MyFeature)
activate :my_feature

View File

@ -0,0 +1,9 @@
<html>
<head>
<meta charset="utf-8">
<title>preview-server-hook-app</title>
</head>
<body>
<h1>preview-server-hook-app</h1>
</body>
</html>

View File

@ -1,96 +1,23 @@
# rubocop:disable FileName
# Setup our load paths
libdir = File.expand_path(File.dirname(__FILE__))
$LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
# Require Thor since that's what the whole CLI is built around
require 'thor'
require 'thor/group'
# CLI Module
module Middleman
module Middleman::Cli
# The base task from which everything else extends
class Base < ::Thor
desc 'version', 'Show version'
def version
say "Middleman #{Middleman::VERSION}"
end
module Cli
# The base task from which everything else extends
class Base < Thor
class << self
def start(*args)
# Change flag to a module
ARGV.unshift('help') if ARGV.delete('--help')
# Default command is server
if ARGV[0] != 'help' && (ARGV.length < 1 || ARGV.first.include?('-'))
ARGV.unshift('server')
end
super
end
end
desc 'version', 'Show version'
def version
say "Middleman #{Middleman::VERSION}"
end
# Override the Thor help method to find help for subtasks
# @param [Symbol, String, nil] meth
# @param [Boolean] subcommand
# @return [void]
def help(meth = nil, subcommand = false)
if meth && !self.respond_to?(meth)
klass, task = Thor::Util.find_class_and_task_by_namespace("#{meth}:#{meth}")
klass.start(['-h', task].compact, :shell => self.shell)
else
list = []
Thor::Util.thor_classes_in(Middleman::Cli).each do |thor_class|
list += thor_class.printable_tasks(false)
end
list.sort!{ |a,b| a[0] <=> b[0] }
shell.say 'Tasks:'
shell.print_table(list, :ident => 2, :truncate => true)
shell.say %(\nSee 'middleman help <command>' for more information on specific command.)
shell.say
end
end
# Intercept missing methods and search subtasks for them
# @param [Symbol] meth
def method_missing(meth, *args)
meth = meth.to_s
if self.class.map.has_key?(meth)
meth = self.class.map[meth]
end
klass, task = Thor::Util.find_class_and_task_by_namespace("#{meth}:#{meth}")
if klass.nil?
tasks_dir = File.join(Dir.pwd, 'tasks')
if File.exists?(tasks_dir)
Dir[File.join(tasks_dir, '**/*_task.rb')].each { |f| require f }
klass, task = Thor::Util.find_class_and_task_by_namespace("#{meth}:#{meth}")
end
end
if klass.nil?
raise Thor::Error.new "There's no '#{meth}' command for Middleman. Try 'middleman help' for a list of commands."
else
args.unshift(task) if task
klass.start(args, :shell => self.shell)
end
end
def self.exit_on_failure?
true
end
end
end
# Require the Middleman version
require 'middleman-core/version'
# Include the core CLI items
require 'middleman-cli/init'
require 'middleman-cli/extension'
require 'middleman-cli/server'
require 'middleman-cli/build'
require 'middleman-cli/console'

View File

@ -1,301 +1,140 @@
require 'fileutils'
require 'set'
require 'middleman-core/application'
# CLI Module
module Middleman::Cli
# Alias "b" to "build"
Base.map({ 'b' => 'build' })
# The CLI Build class
class Build < Thor
class Build < Thor::Group
include Thor::Actions
attr_reader :debugging
attr_accessor :had_errors
check_unknown_options!
namespace :build
class_option :environment,
aliases: '-e',
default: ENV['MM_ENV'] || ENV['RACK_ENV'] || :production
class_option :clean,
type: :boolean,
default: true,
desc: 'Remove orphaned files from build (--no-clean to disable)'
class_option :parallel,
type: :boolean,
default: true,
desc: 'Output files in parallel (--no-parallel to disable)'
class_option :glob,
type: :string,
aliases: '-g',
default: nil,
desc: 'Build a subset of the project'
class_option :verbose,
type: :boolean,
default: false,
desc: 'Print debug messages'
class_option :instrument,
type: :boolean,
default: false,
desc: 'Print instrument messages'
class_option :profile,
type: :boolean,
default: false,
desc: 'Generate profiling report for the build'
desc 'build [options]', 'Builds the static site for deployment'
method_option :clean,
:type => :boolean,
:default => true,
:desc => 'Remove orphaned files from build (--no-clean to disable)'
method_option :glob,
:type => :string,
:aliases => '-g',
:default => nil,
:desc => 'Build a subset of the project'
method_option :verbose,
:type => :boolean,
:default => false,
:desc => 'Print debug messages'
method_option :instrument,
:type => :string,
:default => false,
:desc => 'Print instrument messages'
method_option :profile,
:type => :boolean,
:default => false,
:desc => 'Generate profiling report for the build'
Middleman::Cli.import_config(self)
# Core build Thor command
# @return [void]
def build
if !ENV['MM_ROOT']
unless ENV['MM_ROOT']
raise Thor::Error, 'Error: Could not find a Middleman project config, perhaps you are in the wrong folder?'
end
require 'middleman-core'
require 'middleman-core/logger'
require 'middleman-core/builder'
require 'fileutils'
require 'rack'
require 'rack/mock'
verbose = options['verbose'] ? 0 : 1
instrument = options['instrument']
require 'find'
builder = nil
cli_options = options
@debugging = Middleman::Cli::Base.respond_to?(:debugging) && Middleman::Cli::Base.debugging
self.had_errors = false
::Middleman::Logger.singleton(verbose, instrument)
self.class.shared_instance(options['verbose'], options['instrument'])
opts = {}
opts[:glob] = options['glob'] if options.has_key?('glob')
opts[:clean] = options['clean']
self.class.shared_instance.run_hook :before_build, self
action BuildAction.new(self, opts)
self.class.shared_instance.run_hook :after_build, self
self.class.shared_instance.config_context.execute_after_build_callbacks(self)
if self.had_errors && !self.debugging
msg = 'There were errors during this build'
unless options['verbose']
msg << ', re-run with `middleman build --verbose` to see the full exception.'
end
self.shell.say msg, :red
end
exit(1) if self.had_errors
end
# Static methods
class << self
def exit_on_failure?
true
end
# Middleman::Application singleton
#
# @return [Middleman::Application]
def shared_instance(verbose=false, instrument=false)
@_shared_instance ||= ::Middleman::Application.server.inst do
config[:environment] = :build
::Middleman::Logger.singleton(verbose ? 0 : 1, instrument)
end
end
end
end
# A Thor Action, modular code, which does the majority of the work.
class BuildAction < ::Thor::Actions::EmptyDirectory
attr_reader :source
attr_reader :logger
# Setup the action
#
# @param [Middleman::Cli::Build] base
# @param [Hash] config
def initialize(base, config={})
@app = base.class.shared_instance
@source_dir = Pathname(@app.source_dir)
@build_dir = Pathname(@app.config[:build_dir])
@to_clean = Set.new
@logger = @app.logger
@rack = ::Rack::MockRequest.new(@app.class.to_rack_app)
super(base, @build_dir, config)
end
# Execute the action
# @return [void]
def invoke!
queue_current_paths if should_clean?
execute!
clean! if should_clean?
end
protected
# Remove files which were not built in this cycle
# @return [void]
def clean!
@to_clean.each do |f|
base.remove_file f, :force => true
end
Dir[@build_dir.join('**', '*')].select {|d| File.directory?(d) }.each do |d|
base.remove_file d, :force => true if directory_empty? d
end
end
# Whether we should clean the build
# @return [Boolean]
def should_clean?
@config[:clean]
end
# Whether the given directory is empty
# @param [String, Pathname] directory
# @return [Boolean]
def directory_empty?(directory)
Pathname(directory).children.empty?
end
# Get a list of all the file paths in the destination folder and save them
# for comparison against the files we build in this cycle
# @return [void]
def queue_current_paths
return unless File.exist?(@build_dir)
paths = ::Middleman::Util.all_files_under(@build_dir).map(&:realpath).select(&:file?)
@to_clean += paths.select do |path|
path.to_s !~ /\/\./ || path.to_s =~ /\.(htaccess|htpasswd)/
end
if RUBY_PLATFORM =~ /darwin/
# handle UTF-8-MAC filename on MacOS
@to_clean = @to_clean.map { |path| path.to_s.encode('UTF-8', 'UTF-8-MAC') }
end
end
# Actually build the app
# @return [void]
def execute!
# Sort order, images, fonts, js/css and finally everything else.
sort_order = %w(.png .jpeg .jpg .gif .bmp .svg .svgz .ico .woff .otf .ttf .eot .js .css)
# Pre-request CSS to give Compass a chance to build sprites
logger.debug '== Prerendering CSS'
@app.sitemap.resources.select do |resource|
resource.ext == '.css'
end.each(&method(:build_resource))
logger.debug '== Checking for Compass sprites'
# Double-check for compass sprites
@app.files.find_new_files((@source_dir + @app.config[:images_dir]).relative_path_from(@app.root_path))
@app.sitemap.ensure_resource_list_updated!
# Sort paths to be built by the above order. This is primarily so Compass can
# find files in the build folder when it needs to generate sprites for the
# css files
logger.debug '== Building files'
resources = @app.sitemap.resources.sort_by do |r|
sort_order.index(r.ext) || 100
end
if @build_dir.expand_path.relative_path_from(@source_dir).to_s =~ /\A[.\/]+\Z/
raise ":build_dir (#{@build_dir}) cannot be a parent of :source_dir (#{@source_dir})"
end
# Loop over all the paths and build them.
resources.reject do |resource|
resource.ext == '.css'
end.each(&method(:build_resource))
::Middleman::Profiling.report('build')
end
def build_resource(resource)
return if @config[:glob] && !File.fnmatch(@config[:glob], resource.destination_path)
output_path = render_to_file(resource)
if should_clean? && output_path.exist?
if RUBY_PLATFORM =~ /darwin/
# handle UTF-8-MAC filename on MacOS
@to_clean.delete(output_path.realpath.to_s.encode('UTF-8', 'UTF-8-MAC'))
else
@to_clean.delete(output_path.realpath)
end
end
end
# Render a resource to a file.
#
# @param [Middleman::Sitemap::Resource] resource
# @return [Pathname] The full path of the file that was written
def render_to_file(resource)
output_file = @build_dir + resource.destination_path.gsub('%20', ' ')
if resource.binary?
if !output_file.exist?
base.say_status :create, output_file, :green
elsif FileUtils.compare_file(resource.source_file, output_file)
base.say_status :identical, output_file, :blue
return output_file
else
base.say_status :update, output_file, :yellow
end
output_file.dirname.mkpath
FileUtils.cp(resource.source_file, output_file)
else
begin
response = @rack.get(URI.escape(resource.request_path))
if response.status == 200
base.create_file(output_file, binary_encode(response.body))
else
handle_error(output_file, response.body)
::Middleman::Util.instrument 'builder.setup' do
@app = ::Middleman::Application.new do
config[:mode] = :build
config[:show_exceptions] = false
config[:cli_options] = cli_options.each_with_object({}) do |(k, v), sum|
sum[k] = v
end
rescue => e
handle_error(output_file, "#{e}\n#{e.backtrace.join("\n")}", e)
end
builder = Middleman::Builder.new(@app,
glob: options['glob'],
clean: options['clean'],
parallel: options['parallel'])
builder.thor = self
builder.on_build_event(&method(:on_event))
end
::Middleman::Util.instrument 'builder.run' do
if builder.run!
clean_directories! if options['clean']
shell.say 'Project built successfully.'
else
msg = 'There were errors during this build'
unless options['verbose']
msg << ', re-run with `middleman build --verbose` to see the full exception.'
end
shell.say msg, :red
exit(1)
end
end
output_file
end
def handle_error(file_name, response, e=Thor::Error.new(response))
base.had_errors = true
protected
base.say_status :error, file_name, :red
if base.debugging
raise e
exit(1)
elsif base.options['verbose']
base.shell.say response, :red
# Handles incoming events from the builder.
# @param [Symbol] event_type The type of event.
# @param [String] contents The event contents.
# @param [String] extra The extra information.
# @return [void]
def on_event(event_type, target, extra=nil)
case event_type
when :error
say_status :error, target, :red
shell.say extra, :red if options['verbose']
when :deleted
say_status :remove, target, :green
when :created
say_status :create, target, :green
when :identical
say_status :identical, target, :blue
when :updated
say_status :updated, target, :yellow
else
say_status event_type, extra, :blue
end
end
def binary_encode(string)
if string.respond_to?(:force_encoding)
string.force_encoding('ascii-8bit')
end
string
end
end
end
# Find empty directories in the build folder and remove them.
# @return [Boolean]
def clean_directories!
all_build_files = File.join(@app.config[:build_dir], '**', '*')
# Quiet down create file
class ::Thor::Actions::CreateFile
def on_conflict_behavior(&block)
if identical?
say_status :identical, :blue
else
say_status :update, :yellow
block.call unless pretend?
empty_directories = Dir[all_build_files].select do |d|
File.directory?(d)
end
empty_directories.each do |d|
remove_file d, force: true if Pathname(d).children.empty?
end
end
# Add to CLI
Base.register(self, 'build', 'build [options]', 'Builds the static site for deployment')
# Map "b" to "build"
Base.map('b' => 'build')
end
end

View File

@ -0,0 +1,41 @@
# CLI Module
module Middleman::Cli
# The CLI Config class
class Config < Thor::Group
include Thor::Actions
check_unknown_options!
class_option :environment,
aliases: '-e',
default: ENV['MM_ENV'] || ENV['RACK_ENV'] || 'development',
desc: 'The environment Middleman will run under'
def console
require 'json'
require 'middleman-core'
require 'middleman-core/logger'
opts = {
environment: options['environment']
}
# Don't output info messages
::Middleman::Logger.singleton(2, false)
app = ::Middleman::Application.new do
config[:mode] = :config
config[:disable_sitemap] = true
config[:watcher_disable] = true
config[:exit_before_ready] = true
config[:environment] = opts[:environment].to_sym if opts[:environment]
end
puts JSON.pretty_generate(app.config.to_h)
app.shutdown!
end
# Add to CLI
Base.register(self, 'config', 'config [options]', 'Output a Middleman configuration in JSON format')
end
end

View File

@ -1,48 +1,51 @@
# CLI Module
module Middleman::Cli
# Alias "c" to "console"
Base.map({ 'c' => 'console' })
# The CLI Console class
class Console < Thor
class Console < Thor::Group
include Thor::Actions
check_unknown_options!
namespace :console
desc 'console [options]', 'Start an interactive console in the context of your Middleman application'
method_option :environment,
:aliases => '-e',
:default => ENV['MM_ENV'] || ENV['RACK_ENV'] || 'development',
:desc => 'The environment Middleman will run under'
method_option :verbose,
:type => :boolean,
:default => false,
:desc => 'Print debug messages'
class_option :environment,
aliases: '-e',
default: ENV['MM_ENV'] || ENV['RACK_ENV'] || 'development',
desc: 'The environment Middleman will run under'
class_option :verbose,
type: :boolean,
default: false,
desc: 'Print debug messages'
def console
require 'middleman-core'
require 'irb'
opts = {
:environment => options['environment'],
:debug => options['verbose']
environment: options['environment'],
debug: options['verbose']
}
@app =::Middleman::Application.server.inst do
if opts[:environment]
config[:environment] = opts[:environment].to_sym
end
@app = ::Middleman::Application.new do
config[:environment] = opts[:environment].to_sym if opts[:environment]
::Middleman::Logger.singleton(opts[:debug] ? 0 : 1, opts[:instrumenting] || false)
end
# TODO: get file watcher / reload! working in console
self.class.interact_with @app
end
# Start an interactive console in the context of the provided object.
# @param [Object] context
# @return [void]
def self.interact_with(context)
IRB.setup nil
IRB.conf[:MAIN_CONTEXT] = IRB::Irb.new.context
require 'irb/ext/multi-irb'
IRB.irb nil, @app
IRB.irb nil, context
end
# Add to CLI
Base.register(self, 'console', 'console [options]', 'Start an interactive console in the context of your Middleman application')
# Map "c" to "console"
Base.map('c' => 'console')
end
end

View File

@ -1,16 +1,13 @@
# CLI Module
module Middleman::Cli
# A thor task for creating new projects
class Extension < Thor
class Extension < Thor::Group
include Thor::Actions
check_unknown_options!
namespace :extension
# Required path for the new project to be generated
argument :name, :type => :string
argument :name, type: :string
# Template files are relative to this file
# @return [String]
@ -18,11 +15,13 @@ module Middleman::Cli
File.join(File.dirname(__FILE__), 'templates')
end
desc 'extension [options]', 'Create Middleman extension scaffold NAME'
method_option 'skip-git',
:type => :boolean,
:default => false,
:desc => 'Skip Git ignores and keeps'
class_option 'skip-git',
type: :boolean,
default: false,
desc: 'Skip Git ignores and keeps'
# Output a .gitignore file
class_option :git, type: :boolean, default: true
# The extension task
# @param [String] name
@ -31,14 +30,13 @@ module Middleman::Cli
template 'extension/Rakefile', File.join(name, 'Rakefile')
template 'extension/gemspec', File.join(name, "#{name}.gemspec")
template 'extension/Gemfile', File.join(name, 'Gemfile')
template 'extension/lib/middleman_extension.rb', File.join(name, 'lib', 'middleman_extension.rb')
template 'extension/lib/lib.rb', File.join(name, 'lib', "#{name}.rb")
template 'extension/lib/lib/extension.rb', File.join(name, 'lib', name, 'extension.rb')
template 'extension/features/support/env.rb', File.join(name, 'features', 'support', 'env.rb')
empty_directory File.join(name, 'fixtures')
end
# Output a .gitignore file
class_option :git, :type => :boolean, :default => true
# Add to CLI
Base.register(self, 'extension', 'extension [options]', 'Create a new Middleman extension')
end
end

View File

@ -1,63 +1,129 @@
require 'middleman-templates'
# CLI Module
module Middleman::Cli
# A thor task for creating new projects
class Init < Thor
class Init < Thor::Group
include Thor::Actions
GIT_CMD = 'git'.freeze
check_unknown_options!
namespace :init
argument :target, type: :string, default: '.'
class_option 'template',
aliases: '-T',
default: 'middleman/middleman-templates-default',
desc: 'Use a project template'
# Do not run bundle install
class_option 'skip-bundle',
type: :boolean,
aliases: '-B',
default: false,
desc: 'Skip bundle install'
desc 'init NAME [options]', 'Create new project NAME'
available_templates = ::Middleman::Templates.registered.keys.join(', ')
method_option 'template',
:aliases => '-T',
:default => 'default',
:desc => "Use a project template: #{available_templates}"
method_option 'css_dir',
# :default => "stylesheets",
:desc => 'The path to the css files'
method_option 'js_dir',
# :default => "javascripts",
:desc => 'The path to the javascript files'
method_option 'images_dir',
# :default => "images",
:desc => 'The path to the image files'
method_option 'rack',
:type => :boolean,
:default => false,
:desc => 'Include a config.ru file'
method_option 'skip-bundle',
:type => :boolean,
:aliases => '-B',
:default => false,
:desc => "Don't run bundle install"
method_option 'skip-git',
:type => :boolean,
:default => false,
:desc => 'Skip Git ignores and keeps'
# The init task
# @param [String] name
def init(name = '.')
key = options[:template].to_sym
unless ::Middleman::Templates.registered.has_key?(key)
raise Thor::Error.new "Unknown project template '#{key}'"
def init
require 'fileutils'
require 'tmpdir'
unless git_present?
msg = 'You need to install the git command line tool to initialize a new project. '
msg << "For help installing git, please refer to GitHub's tutorial at https://help.github.com/articles/set-up-git"
say msg, :red
exit 1
end
thor_group = ::Middleman::Templates.registered[key]
thor_group.new([name], options).invoke_all
repo_path, repo_branch = if shortname?(options[:template])
require 'open-uri'
require 'json'
api = 'https://directory.middlemanapp.com/api'
uri = ::URI.parse("#{api}/#{options[:template]}.json")
begin
data = ::JSON.parse(uri.read)
data['links']['github']
data['links']['github'].split('#')
rescue ::OpenURI::HTTPError
say "Template `#{options[:template]}` not found in Middleman Directory."
say 'Did you mean to use a full `user/repo` path?'
exit 1
end
else
repo_name, repo_branch = options[:template].split('#')
[repository_path(repo_name), repo_branch]
end
dir = Dir.mktmpdir
begin
branch_cmd = repo_branch ? "-b #{repo_branch} " : ''
git_path = "#{branch_cmd}#{repo_path}"
run("#{GIT_CMD} clone --depth 1 #{branch_cmd}#{repo_path} #{dir}")
unless $?.success?
say "Git clone command failed. Make sure git repository exists: #{git_path}", :red
exit 1
end
inside(target) do
thorfile = File.join(dir, 'Thorfile')
if File.exist?(thorfile)
::Thor::Util.load_thorfile(thorfile)
invoke 'middleman:generator'
else
source_paths << dir
directory dir, '.', exclude_pattern: /\.git\/|\.gitignore$/
end
run('bundle install') unless ENV['TEST'] || options[:'skip-bundle']
end
ensure
FileUtils.remove_entry(dir) if File.directory?(dir)
end
end
end
def self.exit_on_failure?
true
end
protected
# Map "i", "new" and "n" to "init"
Base.map({
'i' => 'init',
'new' => 'init',
'n' => 'init'
})
# Copied from Bundler
def git_present?
return @git_present if defined?(@git_present)
@git_present = which(GIT_CMD) || which('git.exe')
end
# Copied from Bundler
def which(executable)
if File.file?(executable) && File.executable?(executable)
executable
elsif ENV['PATH']
path = ENV['PATH'].split(File::PATH_SEPARATOR).find do |p|
abs_path = File.join(p, executable)
File.file?(abs_path) && File.executable?(abs_path)
end
path && File.expand_path(executable, path)
end
end
def shortname?(repo)
repo.split('/').length == 1
end
def repository_path(repo)
repo.include?('://') || repo.include?('git@') ? repo : "https://github.com/#{repo}.git"
end
# Add to CLI
Base.register(self, 'init', 'init TARGET [options]', 'Create new project at TARGET')
# Map "i", "new" and "n" to "init"
Base.map(
'i' => 'init',
'new' => 'init',
'n' => 'init'
)
end
end

View File

@ -1,87 +1,62 @@
# CLI Module
module Middleman::Cli
# Server thor task
class Server < Thor
class Server < Thor::Group
check_unknown_options!
namespace :server
class_option :environment,
aliases: '-e'
class_option :port,
aliases: '-p'
class_option :server_name,
aliases: '-s'
class_option :bind_address,
aliases: '-b'
class_option :verbose,
type: :boolean,
default: false,
desc: 'Print debug messages'
class_option :instrument,
type: :boolean,
default: false,
desc: 'Print instrument messages'
class_option :profile,
type: :boolean,
default: false,
desc: 'Generate profiling report for server startup'
class_option :daemon,
type: :boolean,
aliases: '-d',
default: false,
desc: 'Daemonize preview server'
desc 'server [options]', 'Start the preview server'
method_option :environment,
:aliases => '-e',
:default => ENV['MM_ENV'] || ENV['RACK_ENV'] || 'development',
:desc => 'The environment Middleman will run under'
method_option :host,
:type => :string,
:aliases => '-h',
:default => '0.0.0.0',
:desc => 'Bind to HOST address'
method_option :port,
:aliases => '-p',
:default => '4567',
:desc => 'The port Middleman will listen on'
method_option :verbose,
:type => :boolean,
:default => false,
:desc => 'Print debug messages'
method_option :instrument,
:type => :string,
:default => false,
:desc => 'Print instrument messages'
method_option :disable_watcher,
:type => :boolean,
:default => false,
:desc => 'Disable the file change and delete watcher process'
method_option :profile,
:type => :boolean,
:default => false,
:desc => 'Generate profiling report for server startup'
method_option :reload_paths,
:type => :string,
:default => false,
:desc => 'Additional paths to auto-reload when files change'
method_option :force_polling,
:type => :boolean,
:default => false,
:desc => 'Force file watcher into polling mode'
method_option :latency,
:type => :numeric,
:aliases => '-l',
:default => 0.25,
:desc => 'Set file watcher latency, in seconds'
Middleman::Cli.import_config(self)
# Start the server
def server
require 'middleman-core'
require 'middleman-core/preview_server'
if !ENV['MM_ROOT']
unless ENV['MM_ROOT']
puts '== Could not find a Middleman project config.rb'
exit
end
params = {
:port => options['port'],
:host => options['host'],
:environment => options['environment'],
:debug => options['verbose'],
:instrumenting => options['instrument'],
:disable_watcher => options['disable_watcher'],
:reload_paths => options['reload_paths'],
:force_polling => options['force_polling'],
:latency => options['latency']
debug: options['verbose'],
instrumenting: options['instrument'],
reload_paths: options['reload_paths'],
daemon: options['daemon']
}
puts '== The Middleman is loading'
::Middleman::PreviewServer.start(params)
::Middleman::PreviewServer.start(params, options)
end
end
def self.exit_on_failure?
true
end
# Add to CLI
Base.register(self, 'server', 'server [options]', 'Start the preview server')
# Map "s" to "server"
Base.map({ 's' => 'server' })
# Map "s" to "server"
Base.map('s' => 'server')
end
end

View File

@ -1,6 +1,6 @@
# If you have OpenSSL installed, we recommend updating
# the following line to use "https"
source 'http://rubygems.org'
# If you do not have OpenSSL installed, update
# the following line to use "http://" instead
source 'https://rubygems.org'
# Specify your gem's dependencies in <%= name %>.gemspec
gemspec
@ -13,7 +13,6 @@ end
group :test do
gem 'cucumber'
gem 'fivemat'
gem 'aruba'
gem 'rspec'
end
end

View File

@ -4,11 +4,11 @@ Bundler::GemHelper.install_tasks
require 'cucumber/rake/task'
Cucumber::Rake::Task.new(:cucumber, 'Run features that should pass') do |t|
t.cucumber_opts = "--color --tags ~@wip --strict --format #{ENV['CUCUMBER_FORMAT'] || 'Fivemat'}"
t.cucumber_opts = '--color --tags ~@wip --strict'
end
require 'rake/clean'
task :test => ['cucumber']
task test: ['cucumber']
task :default => :test
task default: :test

View File

@ -1,39 +1,6 @@
# Require core library
require 'middleman-core'
# Extension namespace
class MyExtension < ::Middleman::Extension
option :my_option, 'default', 'An example option'
def initialize(app, options_hash={}, &block)
# Call super to build options from the options_hash
super
# Require libraries only when activated
# require 'necessary/library'
# set up your extension
# puts options.my_option
end
def after_configuration
# Do something
end
# A Sitemap Manipulator
# def manipulate_resource_list(resources)
# end
# module do
# def a_helper
# end
# end
require "middleman-core"
Middleman::Extensions.register :<%= name %> do
require "my-extension/extension"
MyExtension
end
# Register extensions which can be activated
# Make sure we have the version of Middleman we expect
# Name param may be omited, it will default to underscored
# version of class name
# MyExtension.register(:my_extension)

View File

@ -0,0 +1,31 @@
# Require core library
require 'middleman-core'
# Extension namespace
class MyExtension < ::Middleman::Extension
option :my_option, 'default', 'An example option'
def initialize(app, options_hash={}, &block)
# Call super to build options from the options_hash
super
# Require libraries only when activated
# require 'necessary/library'
# set up your extension
# puts options.my_option
end
def after_configuration
# Do something
end
# A Sitemap Manipulator
# def manipulate_resource_list(resources)
# end
# helpers do
# def a_helper
# end
# end
end

View File

@ -0,0 +1,2 @@
# Backwards compat
require 'middleman-cli'

View File

@ -17,7 +17,7 @@ Gem::Specification.new do |s|
s.test_files = `git ls-files -z -- {fixtures,features}/*`.split("\0")
s.executable = 'middleman'
s.require_path = 'lib'
s.required_ruby_version = '>= 1.9.3'
s.required_ruby_version = '>= 2.2.0'
# CLI
s.add_dependency('thor', ['>= 0.17.0', '< 2.0'])

1
middleman-core/.rspec Normal file
View File

@ -0,0 +1 @@
--color

View File

@ -2,4 +2,5 @@ lib/**/*.rb
--exclude lib/vendored-middleman-deps/
--exclude lib/middleman-core/step_definitions
--no-private
--hide-void-return
--hide-void-return
--markup=markdown

View File

@ -1,5 +1,4 @@
# coding:utf-8
RAKE_ROOT = __FILE__
RAKE_ROOT = __FILE__.freeze
GEM_NAME = ENV['NAME'] || 'middleman-core'
require 'rubygems'
require File.expand_path(File.dirname(__FILE__) + '/../gem_rake_helper')

View File

@ -0,0 +1,2 @@
default: --require features --tags ~@wip
wip: --require features --tags @wip

View File

@ -1,15 +0,0 @@
Feature: Allow config.rb and extensions to add CLI commands
Scenario: Command autoloaded from tasks/ directory
Given an empty app
And a file named "tasks/hello_task.rb" with:
"""
class Hello < Thor
desc "hello", "Say hello"
def hello
puts "Hello World"
end
end
"""
When I run `middleman hello`
Then the output should contain "Hello World"

View File

@ -1,5 +1,5 @@
Feature: Assets get a file hash appended to their and references to them are updated
Scenario: Hashed-asset files are produced, and HTML, CSS, and JavaScript gets rewritten to reference the new files
Feature: Assets get file hashes appended to them and references to them are updated
Scenario: Hashed-asset files are produced, and HTML, CSS, JSON and JavaScript gets rewritten to reference the new files
Given a successfully built app at "asset-hash-app"
When I cd to "build"
Then the following files should exist:
@ -8,12 +8,16 @@ Feature: Assets get a file hash appended to their and references to them are upd
| favicon.ico |
| images/100px-1242c368.png |
| images/100px-5fd6fb90.jpg |
| images/200px-c11eb203.jpg |
| images/300px-59adce76.jpg |
| images/100px-5fd6fb90.gif |
| javascripts/application-1d8d5276.js |
| stylesheets/site-50eaa978.css |
| stylesheets/site-8bc55985.css |
| index.html |
| subdir/index.html |
| other/index.html |
| api.json |
| subdir/api.json |
And the following files should not exist:
| images/100px.png |
| images/100px.jpg |
@ -22,106 +26,150 @@ Feature: Assets get a file hash appended to their and references to them are upd
| stylesheets/site.css |
And the file "javascripts/application-1d8d5276.js" should contain "img.src = '/images/100px-5fd6fb90.jpg'"
And the file "stylesheets/site-50eaa978.css" should contain "background-image: url('../images/100px-5fd6fb90.jpg')"
And the file "stylesheets/site-8bc55985.css" should contain:
"""
background-image: url("../images/100px-5fd6fb90.jpg")
"""
And the file "index.html" should contain 'href="apple-touch-icon.png"'
And the file "index.html" should contain 'href="stylesheets/site-50eaa978.css"'
And the file "index.html" should contain 'href="stylesheets/site-8bc55985.css"'
And the file "index.html" should contain 'src="javascripts/application-1d8d5276.js"'
And the file "index.html" should contain 'src="images/100px-5fd6fb90.jpg"'
And the file "subdir/index.html" should contain 'href="../stylesheets/site-50eaa978.css"'
And the file "subdir/index.html" should contain 'href="../stylesheets/site-8bc55985.css"'
And the file "index.html" should contain 'srcset="images/100px-5fd6fb90.jpg 1x, images/200px-c11eb203.jpg 2x, images/300px-59adce76.jpg 3x"'
And the file "index.html" should contain 'src="images/100px-5fd6fb90.gif"'
And the file "index.html" should contain 'src="images/100px-1242c368.png"'
And the file "subdir/index.html" should contain 'src="../javascripts/application-1d8d5276.js"'
And the file "subdir/index.html" should contain 'src="../images/100px-5fd6fb90.jpg"'
And the file "other/index.html" should contain 'href="../stylesheets/site-50eaa978.css"'
And the file "other/index.html" should contain 'href="../stylesheets/site-8bc55985.css"'
And the file "other/index.html" should contain 'src="../javascripts/application-1d8d5276.js"'
And the file "other/index.html" should contain 'src="../images/100px-5fd6fb90.jpg"'
And the file "api.json" should contain 'images/100px-5fd6fb90.gif'
And the file "api.json" should contain 'images/100px-5fd6fb90.jpg'
And the file "api.json" should contain 'images/100px-1242c368.png'
And the file "subdir/api.json" should contain 'images/100px-5fd6fb90.gif'
And the file "subdir/api.json" should contain 'images/100px-5fd6fb90.jpg'
And the file "subdir/api.json" should contain 'images/100px-1242c368.png'
Scenario: Keep Originals
Given a fixture app "asset-hash-app"
And a file named "config.rb" with:
"""
activate :asset_hash, :keep_original => true
"""
And a successfully built app at "asset-hash-app"
Scenario: Hashed fonts assets work with woff and woff2 extension
Given a successfully built app at "asset-hash-app"
When I cd to "build"
Then the following files should exist:
| images/100px-1242c368.png |
| images/100px-5fd6fb90.jpg |
| images/100px-5fd6fb90.gif |
| javascripts/application-1d8d5276.js |
| stylesheets/site-171eb3c0.css |
| images/100px.png |
| images/100px.jpg |
| images/100px.gif |
| javascripts/application.js |
| stylesheets/site.css |
Scenario: Custom format
Given a fixture app "asset-hash-app"
And a file named "config.rb" with:
"""
activate :asset_hash, :format => ':basename-.-:digest.:ext'
activate :directory_indexes
"""
And a successfully built app at "asset-hash-app"
When I cd to "build"
Then the following files should exist:
| images/100px-.-1242c368.png |
| images/100px-.-5fd6fb90.jpg |
| images/100px-.-5fd6fb90.gif |
| javascripts/application-.-1d8d5276.js |
| stylesheets/site-.-171eb3c0.css |
And the following files should not exist:
| images/100px.png |
| images/100px.jpg |
| images/100px.gif |
| javascripts/application.js |
| stylesheets/site.css |
And the file "javascripts/application-.-1d8d5276.js" should contain "img.src = '/images/100px-.-5fd6fb90.jpg'"
And the file "stylesheets/site-.-171eb3c0.css" should contain "background-image: url('/images/100px-.-5fd6fb90.jpg')"
And the file "index.html" should contain 'href="/stylesheets/site-.-171eb3c0.css"'
And the file "index.html" should contain 'src="/javascripts/application-.-1d8d5276.js"'
And the file "index.html" should contain 'src="/images/100px-.-5fd6fb90.jpg"'
And the file "subdir/index.html" should contain 'href="/stylesheets/site-.-171eb3c0.css"'
And the file "subdir/index.html" should contain 'src="/javascripts/application-.-1d8d5276.js"'
And the file "subdir/index.html" should contain 'src="/images/100px-.-5fd6fb90.jpg"'
And the file "other/index.html" should contain 'href="/stylesheets/site-.-171eb3c0.css"'
And the file "other/index.html" should contain 'src="/javascripts/application-.-1d8d5276.js"'
And the file "other/index.html" should contain 'src="/images/100px-.-5fd6fb90.jpg"'
| fonts/fontawesome-webfont-56ce13e7.woff |
| fonts/fontawesome-webfont-10752316.woff2 |
And the file "stylesheets/uses_fonts-88aa3e2b.css" should contain "src: url('../fonts/fontawesome-webfont-10752316.woff2')"
And the file "stylesheets/uses_fonts-88aa3e2b.css" should contain "url('../fonts/fontawesome-webfont-56ce13e7.woff')"
Scenario: Hashed assets work in preview server
Given the Server is running at "asset-hash-app"
When I go to "/"
Then I should see 'href="apple-touch-icon.png"'
And I should see 'href="stylesheets/site-50eaa978.css"'
And I should see 'href="stylesheets/site-d1a750ca.css"'
And I should see 'href="stylesheets/fragment-99b76247.css"'
And I should see 'src="javascripts/application-1d8d5276.js"'
And I should see 'src="images/100px-5fd6fb90.jpg"'
And I should see 'srcset="images/100px-5fd6fb90.jpg 1x, images/200px-c11eb203.jpg 2x, images/300px-59adce76.jpg 3x"'
And I should see 'src="images/100px-5fd6fb90.jpg?test"'
And I should see 'src="images/100px-5fd6fb90.jpg?#test"'
And I should see 'src="images/100px-5fd6fb90.jpg#test"'
When I go to "/subdir/"
Then I should see 'href="../stylesheets/site-50eaa978.css"'
Then I should see 'href="../stylesheets/site-d1a750ca.css"'
And I should see 'src="../javascripts/application-1d8d5276.js"'
And I should see 'src="../images/100px-5fd6fb90.jpg"'
When I go to "/other/"
Then I should see 'href="../stylesheets/site-50eaa978.css"'
Then I should see 'href="../stylesheets/site-d1a750ca.css"'
And I should see 'src="../javascripts/application-1d8d5276.js"'
And I should see 'src="../images/100px-5fd6fb90.jpg"'
And I should see 'src="../images/100px-5fd6fb90.jpg?test"'
And I should see 'src="../images/100px-5fd6fb90.jpg?#test"'
And I should see 'src="../images/100px-5fd6fb90.jpg#test"'
When I go to "/javascripts/application-1d8d5276.js"
Then I should see "img.src = '/images/100px-5fd6fb90.jpg'"
When I go to "/stylesheets/site-50eaa978.css"
Then I should see "background-image: url('../images/100px-5fd6fb90.jpg')"
When I go to "/stylesheets/site-d1a750ca.css"
Then I should see 'background-image: url("../images/100px-5fd6fb90.jpg");'
When I go to "/api.json"
Then I should see 'images/100px-5fd6fb90.gif'
And I should see 'images/100px-5fd6fb90.jpg'
And I should see 'images/100px-1242c368.png'
When I go to "/subdir/api.json"
Then I should see 'images/100px-5fd6fb90.gif'
And I should see 'images/100px-5fd6fb90.jpg'
And I should see 'images/100px-1242c368.png'
When I go to "/stylesheets/fragment-99b76247.css"
And I should see 'url("../images/100px-5fd6fb90.jpg");'
And I should see 'url("../images/100px-5fd6fb90.jpg?test");'
And I should see 'url("../images/100px-5fd6fb90.jpg?#test");'
And I should see 'url("../images/100px-5fd6fb90.jpg#test");'
Scenario: Enabling an asset host still produces hashed files and references
Scenario: Hashed assets work with Slim
Given the Server is running at "asset-hash-app"
When I go to "/slim.html"
And I should see 'src="images/300px-59adce76.jpg"'
And I should see 'src="images/100px-5fd6fb90.jpg"'
And I should see 'srcset="images/100px-5fd6fb90.jpg 1x, images/200px-c11eb203.jpg 2x, images/300px-59adce76.jpg 3x"'
Scenario: Enabling an asset host still produces hashed files and references (hash first)
Given a fixture app "asset-hash-host-app"
And a file named "config.rb" with:
"""
set :sass_source_maps, false
activate :asset_hash
activate :directory_indexes
activate :asset_host, host: 'http://middlemanapp.com'
"""
Given the Server is running at "asset-hash-host-app"
When I go to "/"
Then I should see 'href="http://middlemanapp.com/stylesheets/site-54baaf3a.css"'
Then I should see 'href="http://middlemanapp.com/stylesheets/site-7474cadd.css"'
Then I should see 'href="http://middlemanapp.com/stylesheets/fragment-2902933e.css"'
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg"'
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg?test"'
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg?#test"'
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg#test"'
When I go to "/subdir/"
Then I should see 'href="http://middlemanapp.com/stylesheets/site-54baaf3a.css"'
Then I should see 'href="http://middlemanapp.com/stylesheets/site-7474cadd.css"'
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg"'
When I go to "/other/"
Then I should see 'href="http://middlemanapp.com/stylesheets/site-54baaf3a.css"'
Then I should see 'href="http://middlemanapp.com/stylesheets/site-7474cadd.css"'
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg"'
# Asset helpers don't appear to work from Compass right now
# When I go to "/stylesheets/site-e5a31a3e.css"
# Then I should see "background-image: url('http://middlemanapp.com/images/100px-5fd6fb90.jpg')"
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg?test"'
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg?#test"'
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg#test"'
When I go to "/stylesheets/fragment-2902933e.css"
And I should see 'url("http://middlemanapp.com/images/100px-5fd6fb90.jpg");'
And I should see 'url("http://middlemanapp.com/images/100px-5fd6fb90.jpg?test");'
And I should see 'url("http://middlemanapp.com/images/100px-5fd6fb90.jpg?#test");'
And I should see 'url("http://middlemanapp.com/images/100px-5fd6fb90.jpg#test");'
Scenario: Enabling an asset host still produces hashed files and references (host first)
Given a fixture app "asset-hash-host-app"
And a file named "config.rb" with:
"""
set :sass_source_maps, false
activate :asset_host, host: 'http://middlemanapp.com'
activate :directory_indexes
activate :asset_hash
"""
Given the Server is running at "asset-hash-host-app"
When I go to "/"
Then I should see 'href="http://middlemanapp.com/stylesheets/site-7474cadd.css"'
Then I should see 'href="http://middlemanapp.com/stylesheets/fragment-2902933e.css"'
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg"'
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg?test"'
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg?#test"'
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg#test"'
When I go to "/subdir/"
Then I should see 'href="http://middlemanapp.com/stylesheets/site-7474cadd.css"'
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg"'
When I go to "/other/"
Then I should see 'href="http://middlemanapp.com/stylesheets/site-7474cadd.css"'
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg"'
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg?test"'
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg?#test"'
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg#test"'
When I go to "/stylesheets/fragment-2902933e.css"
And I should see 'url("http://middlemanapp.com/images/100px-5fd6fb90.jpg")'
And I should see 'url("http://middlemanapp.com/images/100px-5fd6fb90.jpg?test")'
And I should see 'url("http://middlemanapp.com/images/100px-5fd6fb90.jpg?#test")'
And I should see 'url("http://middlemanapp.com/images/100px-5fd6fb90.jpg#test")'
Scenario: The asset hash should change when a SASS partial changes
Given the Server is running at "asset-hash-app"
@ -131,14 +179,14 @@ Feature: Assets get a file hash appended to their and references to them are upd
font-size: 14px
"""
When I go to "/partials/"
Then I should see 'href="../stylesheets/uses_partials-423a00f7.css'
Then I should see 'href="../stylesheets/uses_partials-4d4e34e6.css'
And the file "source/stylesheets/_partial.sass" has the contents
"""
body
font-size: 18px !important
"""
When I go to "/partials/"
Then I should see 'href="../stylesheets/uses_partials-e8c3d4eb.css'
Then I should see 'href="../stylesheets/uses_partials-ec347271.css'
Scenario: The asset hash should change when a Rack-based filter changes
Given a fixture app "asset-hash-app"
@ -148,22 +196,25 @@ Feature: Assets get a file hash appended to their and references to them are upd
activate :relative_assets
activate :directory_indexes
require 'lib/middleware.rb'
use Middleware
use ::Middleware
"""
Given the Server is running at "asset-hash-app"
When I go to "/"
Then I should see 'href="stylesheets/site-5770af52.css'
When I go to "stylesheets/site-5770af52.css"
Then I should see 'background-image'
Then I should see 'href="stylesheets/site-5ad7def0.css'
When I go to "stylesheets/site-5ad7def0.css"
Then I should see 'background-image: url("../images/100px-5fd6fb90.jpg")'
Then I should see 'Added by Rack filter'
When I go to "stylesheets/site-50eaa978.css"
Then I should see 'Not Found'
Scenario: Hashed-asset files are not produced for ignored paths
Given a fixture app "asset-hash-app"
And a file named "config.rb" with:
"""
activate :asset_hash, :ignore => [%r(javascripts/*), 'images/*']
is_stylesheet = proc { |path| path.start_with? 'stylesheets' }
activate :asset_hash, ignore: [
%r(javascripts/*),
'images/*',
is_stylesheet
]
activate :relative_assets
activate :directory_indexes
"""
@ -177,27 +228,97 @@ Feature: Assets get a file hash appended to their and references to them are upd
| images/100px.jpg |
| images/100px.gif |
| javascripts/application.js |
| stylesheets/site-50eaa978.css |
| stylesheets/site.css |
| index.html |
| subdir/index.html |
| other/index.html |
| api.json |
| subdir/api.json |
And the following files should not exist:
| images/100px-1242c368.png |
| images/100px-5fd6fb90.jpg |
| images/100px-5fd6fb90.gif |
| javascripts/application-1d8d5276.js |
| stylesheets/site-7474cadd.css |
Scenario: Hashed-asset files are not replaced for rewrite ignored paths
Given a fixture app "asset-hash-app"
And a file named "config.rb" with:
"""
is_stylesheet = proc { |path| path.start_with? '/stylesheets' }
activate :asset_hash, rewrite_ignore: [
%r(javascripts/*),
'/subdir/*',
is_stylesheet
]
activate :relative_assets
activate :directory_indexes
"""
And a successfully built app at "asset-hash-app"
When I cd to "build"
Then the following files should exist:
| index.html |
| subdir/index.html |
| images/100px-5fd6fb90.jpg |
| javascripts/application-1d8d5276.js |
| stylesheets/site-8bc55985.css |
And the following files should not exist:
| images/100px.jpg |
| javascripts/application.js |
| stylesheets/site.css |
And the file "javascripts/application-1d8d5276.js" should contain "img.src = '/images/100px.jpg'"
And the file "stylesheets/site-8bc55985.css" should contain:
"""
background-image: url("../images/100px.jpg")
"""
And the file "index.html" should contain 'href="stylesheets/site-8bc55985.css"'
And the file "index.html" should contain 'src="javascripts/application-1d8d5276.js"'
And the file "index.html" should contain 'src="images/100px-5fd6fb90.jpg"'
And the file "subdir/index.html" should contain:
"""
<h2>Image url3:</h2>
<p><img src="../images/100px.jpg"></p>
"""
# @wip Currently broken, we should move all asset-host functionality out of Compass and into something more similar to asset_hash with Rack-based rewrites
# Scenario: Enabling an asset host and referencing assets in CSS with URL fragments are rewritten correctly
# Given a successfully built app at "asset-hash-host-app"
# When I cd to "build"
Scenario: Already minified files should still be hashed
Given a successfully built app at "asset-hash-minified-app"
When I cd to "build"
Then the following files should exist:
| javascripts/jquery.min-276c87ff.js |
| stylesheets/test-7de2ad06.css |
And the following files should not exist:
| javascripts/jquery.min.js |
And the file "stylesheets/test-7de2ad06.css" should contain:
"""
.no-bug{background-image:url(/images/100px-5fd6fb90.jpg)}
.bug{content:"";background-image:url(/images/100px-5fd6fb90.jpg)}
.no-bug{content:""; background-image:url(/images/100px-5fd6fb90.jpg)}
"""
# Then the following files should exist:
# | images/100px-5fd6fb90.jpg |
# | stylesheets/fragment-c058ecb2.css |
# And the following files should not exist:
# | images/100px.jpg |
Scenario: Source map paths include the hash
Given a successfully built app at "asset-hash-source-map"
When I cd to "build"
Then the following files should exist:
| index.html |
| javascripts/application-4553338c.js |
| javascripts/application.js-22cc2b5f.map |
| index.html |
And the following files should not exist:
| javascripts/application.js |
| javascripts/application.js.map |
# And the file "stylesheets/fragment-c058ecb2.css" should contain "http://middlemanapp.com/images/100px-5fd6fb90.jpg#test"
# And the file "stylesheets/fragment-c058ecb2.css" should not contain "http://middlemanapp.com/images/100px.jpg#test"
And the file "javascripts/application-4553338c.js" should contain "//# sourceMappingURL=application.js-22cc2b5f.map"
Scenario: Hashes can contain a prefix
Given a successfully built app at "asset-hash-prefix"
When I cd to "build"
Then the following files should exist:
| index.html |
| javascripts/application-myprefix-4553338c.js |
| javascripts/application.js-myprefix-22cc2b5f.map |
| index.html |
And the following files should not exist:
| javascripts/application.js |
| javascripts/application.js.map |
And the file "javascripts/application-myprefix-4553338c.js" should contain "//# sourceMappingURL=application.js-myprefix-22cc2b5f.map"

View File

@ -1,56 +1,55 @@
Feature: Alternate between multiple asset hosts
In order to speed up page loading
Scenario: Set single host globally
Given a fixture app "asset-host-app"
And a file named "config.rb" with:
"""
activate :asset_host
set :asset_host, "http://assets1.example.com"
"""
And the Server is running
When I go to "/asset_host.html"
Then I should see "http://assets1"
When I go to "/stylesheets/asset_host.css"
Then I should see "http://assets1"
Scenario: Set proc host globally
Given a fixture app "asset-host-app"
And a file named "config.rb" with:
"""
activate :asset_host
set :asset_host do |asset|
"http://assets%d.example.com" % (asset.hash % 4)
end
"""
And the Server is running
When I go to "/asset_host.html"
Then I should see "http://assets"
When I go to "/stylesheets/asset_host.css"
Then I should see "http://assets"
Scenario: Set single host with inline-option
Given a fixture app "asset-host-app"
And a file named "config.rb" with:
"""
activate :asset_host, :host => "http://assets1.example.com"
activate :asset_host, host: "http://assets1.example.com"
"""
And the Server is running
When I go to "/asset_host.html"
Then I should see "http://assets1"
Then I should see "'.google-analytics.com/ga.js'"
Then I should see 'src="https://code.jquery.com/jquery-2.1.3.min.js"'
Then I should see content matching %r{http://assets1.example.com/}
Then I should not see content matching %r{http://assets1.example.com//}
Then I should see content matching %r{<a href="https://github.com/angular/angular.js">Angular.js</a>}
Then I should see content matching %r{'//www.example.com/script.js'}
When I go to "/stylesheets/asset_host.css"
Then I should see "http://assets1"
Then I should see content matching %r{http://assets1.example.com/}
Then I should not see content matching %r{http://assets1.example.com//}
When I go to "/javascripts/asset_host.js"
Then I should not see content matching %r{http://assets1.example.com/}
Scenario: Set proc host with inline-option
Given a fixture app "asset-host-app"
And a file named "config.rb" with:
"""
activate :asset_host, :host => Proc.new { |asset|
"http://assets%d.example.com" % (asset.hash % 4)
activate :asset_host, host: Proc.new { |asset|
hash = Digest::MD5.digest(asset).bytes.map!(&:ord).reduce(&:+)
"http://assets%d.example.com" % (hash % 4)
}
"""
And the Server is running
When I go to "/asset_host.html"
Then I should see "http://assets"
Then I should see 'src="https://code.jquery.com/jquery-2.1.3.min.js"'
Then I should see content matching %r{http://assets1.example.com/}
Then I should not see content matching %r{http://assets1.example.com//}
Then I should see content matching %r{<a href="https://github.com/angular/angular.js">Angular.js</a>}
Then I should see content matching %r{'//www.example.com/script.js'}
When I go to "/stylesheets/asset_host.css"
Then I should see "http://assets"
Then I should see content matching %r{http://assets1.example.com/}
Then I should not see content matching %r{http://assets1.example.com//}
Scenario: Hosts are not rewritten for rewrite ignored paths
Given a fixture app "asset-host-app"
And a file named "config.rb" with:
"""
activate :asset_host, host: "http://assets1.example.com", rewrite_ignore: [
'/stylesheets/asset_host.css',
]
"""
And the Server is running
When I go to "/asset_host.html"
Then I should see content matching %r{http://assets1.example.com/}
When I go to "/stylesheets/asset_host.css"
Then I should not see content matching %r{http://assets1.example.com/}

View File

@ -0,0 +1,8 @@
Feature: Automatically detect and insert image dimensions into tags
In order to speed up development and appease YSlow
Scenario: Rendering an image with the feature enabled
Given "automatic_alt_tags" feature is "enabled"
And the Server is running at "automatic-alt-tags-app"
When I go to "/auto-image-sizes.html"
Then I should see 'alt="Blank"'

View File

@ -2,15 +2,28 @@ Feature: Automatically detect and insert image dimensions into tags
In order to speed up development and appease YSlow
Scenario: Rendering an image with the feature disabled
Given "automatic_image_sizes" feature is "disabled"
Given a fixture app "automatic-image-size-app"
And a file named "config.rb" with:
"""
"""
And the Server is running at "automatic-image-size-app"
When I go to "/auto-image-sizes.html"
Then I should not see "width="
And I should not see "height="
When I go to "/markdown-sizes.html"
Then I should not see "width="
And I should not see "height="
Scenario: Rendering an image with the feature enabled
Given "automatic_image_sizes" feature is "enabled"
Given a fixture app "automatic-image-size-app"
And a file named "config.rb" with:
"""
activate :automatic_image_sizes
"""
And the Server is running at "automatic-image-size-app"
When I go to "/auto-image-sizes.html"
Then I should see "width="
And I should see "height="
Then I should see 'width="1"'
And I should see 'height="1"'
When I go to "/markdown-sizes.html"
Then I should see 'width="1"'
And I should see 'height="1"'

View File

@ -9,7 +9,6 @@ Feature: Builder
| static.html |
| services/index.html |
| stylesheets/static.css |
| spaces in file.html |
| images/blank.gif |
| images/Read me (example).txt |
| images/Child folder/regular_file(example).txt |
@ -21,14 +20,13 @@ Feature: Builder
| layout |
| layouts/custom |
| layouts/content_for |
And the file "index.html" should contain "Comment in layout"
And the file "index.html" should contain "<h1>Welcome</h1>"
And the file "static.html" should contain "Static, no code!"
And the file "services/index.html" should contain "Services"
And the file "stylesheets/static.css" should contain "body"
And the file "spaces in file.html" should contain "spaces"
Scenario: Build glob
Given a successfully built app at "glob-app" with flags "--glob '*.css'"
When I cd to "build"
@ -36,16 +34,28 @@ Feature: Builder
| index.html |
Then the following files should exist:
| stylesheets/site.css |
Scenario: Build with errors
Given a built app at "build-with-errors-app"
Then the exit status should be 1
Scenario: Build empty errors
Given a built app at "empty-app"
Then the exit status should be 1
Scenario: Build external_pipeline errors
Given a built app at "external-pipeline-error"
Then the exit status should be 1
Scenario: Build alias (b)
Given a fixture app "large-build-app"
When I run `middleman b`
Then was successfully built
Then was successfully built
Scenario: Builded text file(ex: html, css, xml, txt)'s permission is 0644
Given a successfully built app at "large-build-app"
When I cd to "build"
Then the mode of filesystem object "index.html" should match "0644"
And the mode of filesystem object "stylesheets/static.css" should match "0644"
And the mode of filesystem object "feed.xml" should match "0644"
And the mode of filesystem object ".htaccess" should match "0644"

View File

@ -5,7 +5,7 @@ Feature: Generate mtime-based query string for busting browser caches
Given "cache_buster" feature is "disabled"
And the Server is running at "cache-buster-app"
When I go to "/stylesheets/relative_assets.css"
Then I should see "blank.gif'"
Then I should see 'blank.gif"'
Scenario: Rendering html with the feature disabled
Given "cache_buster" feature is "disabled"
@ -39,4 +39,18 @@ Feature: Generate mtime-based query string for busting browser caches
And the Server is running at "cache-buster-app"
When I go to "/cache-buster.html"
Then I should see "site.css?"
Then I should see "blank.gif?"
Then I should see "blank.gif?"
Scenario: URLs are not rewritten for rewrite ignored paths
Given a fixture app "cache-buster-app"
And a file named "config.rb" with:
"""
activate :cache_buster, rewrite_ignore: [
'/cache-buster.html',
]
"""
And the Server is running at "cache-buster-app"
When I go to "/cache-buster.html"
Then I should see 'site.css"'
Then I should see 'empty-with-include.js"'
Then I should see 'blank.gif"'

View File

@ -7,13 +7,103 @@ Feature: Templates should be chainable
Then I should see "Title</h1>"
And I should see "Subtitle</h2>"
And I should see "Sup</h3>"
Scenario: Build chained template
Given a successfully built app at "chained-app"
When I cd to "build"
Then the following files should exist:
| index.html |
| test.erb.combobreaker |
And the file "index.html" should contain "Title</h1>"
And the file "index.html" should contain "Subtitle</h2>"
And the file "index.html" should contain "Sup</h3>"
And the file "index.html" should contain "Sup</h3>"
And the file "test.erb.combobreaker" should contain "Title</h1>"
And the file "test.erb.combobreaker" should contain "Subtitle</h2>"
And the file "test.erb.combobreaker" should contain "Sup</h3>"
Scenario: Partials are parsed by multiple template engines: Outer template has .erb and inner .md.erb
Given a fixture app "partial-chained_templates-app"
And a template named "my_template.html.erb" with:
"""
<h1>My Template</h1>
<%= partial 'my_partial' %>
"""
And a template named "my_partial.html.md.erb" with:
"""
## My Partial
<%= 'hello world' %>
"""
And the Server is running
When I go to "/my_template.html"
Then I should see:
"""
<h1>My Template</h1>
"""
Then I should see:
"""
<h2 id="my-partial">My Partial</h2>
"""
Then I should see:
"""
<p>hello world</p>
"""
Scenario: Partials are parsed by multiple template engines: Outer template has .md.erb and inner .md.erb
Given a fixture app "partial-chained_templates-app"
And a template named "my_template.html.md.erb" with:
"""
# My Template
<%= partial 'my_partial' %>
"""
And a template named "my_partial.html.md.erb" with:
"""
## My Partial
<%= 'hello world' %>
"""
And the Server is running
When I go to "/my_template.html"
Then I should see:
"""
<h1 id="my-template">My Template</h1>
"""
Then I should see:
"""
<h2 id="my-partial">My Partial</h2>
"""
Then I should see:
"""
<p>hello world</p>
"""
Scenario: Partials are parsed by multiple template engines: Outer template has .md.erb, and inner .erb
Given a fixture app "partial-chained_templates-app"
And a template named "my_template.html.md.erb" with:
"""
# My Template
<%= partial 'my_partial' %>
"""
And a template named "my_partial.html.erb" with:
"""
<h2>My Partial</h2>
<%= 'hello world' %>
"""
And the Server is running
When I go to "/my_template.html"
Then I should see:
"""
<h1 id="my-template">My Template</h1>
"""
Then I should see:
"""
<h2>My Partial</h2>
"""
Then I should see:
"""
<p>hello world</p>
"""

View File

@ -16,6 +16,22 @@ Feature: Build Clean
| build/should_be_ignored3.html |
And the file "build/index.html" should contain "Comment in layout"
Scenario: Clean build has a whitelist
Given a fixture app "clean-app"
When a file named "build/.test" with:
"""
Hello
"""
When a file named "config.rb" with:
"""
set :skip_build_clean do |path|
path =~ /\.test/
end
"""
Given a built app at "clean-app"
Then the following files should exist:
| build/.test |
Scenario: Clean build an app with newly ignored files and a nested output directory
Given a fixture app "clean-nested-app"
When a file named "config.rb" with:
@ -42,3 +58,21 @@ Feature: Build Clean
Then the following files should not exist:
| sub/dir/about.html |
| sub/dir/nested/nested.html |
Scenario: Build and clean an app under a hidden directory
Given a fixture app "clean-app"
And app "clean-app" is using config "hidden-dir-before"
And a built app at "clean-app"
Then the following files should exist:
| .build/index.html |
| .build/should_be_ignored.html |
| .build/should_be_ignored2.html |
| .build/should_be_ignored3.html |
Given app "clean-app" is using config "hidden-dir-after"
And a built app at "clean-app"
Then the following files should exist:
| .build/index.html |
And the following files should not exist:
| .build/should_be_ignored.html |
| .build/should_be_ignored2.html |
| .build/should_be_ignored3.html |

View File

@ -1,100 +0,0 @@
Feature: Middleman CLI
Scenario: Create a new project
Given I run `middleman init MY_PROJECT`
Then the exit status should be 0
When I cd to "MY_PROJECT"
Then the following files should exist:
| Gemfile |
| .gitignore |
| config.rb |
| source/index.html.erb |
| source/images/background.png |
| source/images/middleman.png |
| source/layouts/layout.erb |
| source/javascripts/all.js |
| source/stylesheets/all.css |
| source/stylesheets/normalize.css |
Scenario: Create a new project in the current directory
Given a directory named "MY_PROJECT"
When I cd to "MY_PROJECT"
And I run `middleman init`
Then the exit status should be 0
And the following files should exist:
| Gemfile |
| config.rb |
| source/index.html.erb |
Scenario: Create a new project (alias i)
When I run `middleman i MY_PROJECT`
Then a directory named "MY_PROJECT" should exist
Scenario: Create a new project (alias new)
When I run `middleman new MY_PROJECT`
Then a directory named "MY_PROJECT" should exist
Scenario: Create a new project (alias n)
When I run `middleman n MY_PROJECT`
Then a directory named "MY_PROJECT" should exist
Scenario: Create a new project with Rack
When I run `middleman init MY_PROJECT --rack`
Then a directory named "MY_PROJECT" should exist
When I cd to "MY_PROJECT"
Then the following files should exist:
| config.rb |
| config.ru |
| Gemfile |
Scenario: Create a new HTML5 project
When I run `middleman init MY_PROJECT --template=html5`
Then a directory named "MY_PROJECT" should exist
When I cd to "MY_PROJECT"
Then the following files should exist:
| config.rb |
| Gemfile |
Then the following files should not exist:
| config.ru |
And the file "config.rb" should contain "set :js_dir, 'js'"
Then a directory named "source" should exist
When I cd to "source"
Then the following files should exist:
| index.html.erb |
| layouts/layout.erb |
| humans.txt |
| js/main.js |
Scenario: Create a new HTML5 project with Rack
When I run `middleman init MY_PROJECT --rack --template=html5`
Then a directory named "MY_PROJECT" should exist
When I cd to "MY_PROJECT"
Then the following files should exist:
| config.rb |
| config.ru |
| Gemfile |
Scenario: Create a new Mobile HTML5 project
When I run `middleman init MY_PROJECT --template=mobile`
Then a directory named "MY_PROJECT" should exist
When I cd to "MY_PROJECT"
Then the following files should exist:
| config.rb |
| Gemfile |
Then the following files should not exist:
| config.ru |
Then a directory named "source" should exist
When I cd to "source"
Then the following files should exist:
| index.html |
| humans.txt |
| js/libs/respond.min.js |
Scenario: Create a new Mobile HTML5 project with Rack
When I run `middleman init MY_PROJECT --rack --template=mobile`
Then a directory named "MY_PROJECT" should exist
When I cd to "MY_PROJECT"
Then the following files should exist:
| config.rb |
| config.ru |
| Gemfile |

View File

@ -0,0 +1,265 @@
Feature: Collections
Scenario: Lazy query
Given a fixture app "collections-app"
And a file named "config.rb" with:
"""
articles1 = collection :articles1, resources.select { |r|
matcher = ::Middleman::Util::UriTemplates.uri_template('blog1/{year}-{month}-{day}-{title}.html')
::Middleman::Util::UriTemplates.extract_params(matcher, ::Middleman::Util.normalize_path(r.url))
}
everything = resources.select do |r|
true
end
def get_tags(resource)
if resource.data.tags.is_a? String
resource.data.tags.split(',').map(&:strip)
else
resource.data.tags
end
end
def group_lookup(resource, sum)
results = Array(get_tags(resource)).map(&:to_s).map(&:to_sym)
results.each do |k|
sum[k] ||= []
sum[k] << resource
end
end
tags = everything
.select { |resource| resource.data.tags }
.each_with_object({}, &method(:group_lookup))
class Wrapper
attr_reader :stuff
def initialize
@stuff = Set.new
end
def <<((k, v))
@stuff << k
self
end
end
collection :wrapped, tags.reduce(Wrapper.new, :<<)
set :tags, tags # Expose to templates
collection :first_tag, tags.keys.sort.first
"""
And a file named "source/index.html.erb" with:
"""
<% collection(:articles1).each do |article| %>
Article1: <%= article.data.title %>
<% end %>
Tag Count: <%= collection(:wrapped).stuff.length %>
<% config[:tags].value.each do |k, items| %>
Tag: <%= k %> (<%= items.length %>)
<% items.each do |article| %>
Article (<%= k %>): <%= article.data.title %>
<% end %>
<% end %>
First Tag: <%= collection(:first_tag) %>
"""
Given the Server is running at "collections-app"
When I go to "index.html"
Then I should see 'Article1: Blog1 Newer Article'
And I should see 'Article1: Blog1 Another Article'
And I should see 'Tag: foo (4)'
And I should see 'Article (foo): Blog1 Newer Article'
And I should see 'Article (foo): Blog1 Another Article'
And I should see 'Article (foo): Blog2 Newer Article'
And I should see 'Article (foo): Blog2 Another Article'
And I should see 'Tag: bar (2)'
And I should see 'Article (bar): Blog1 Newer Article'
And I should see 'Article (bar): Blog2 Newer Article'
And I should see 'Tag: 120 (1)'
And I should see 'Article (120): Blog1 Another Article'
And I should see 'First Tag: 120'
And I should see 'Tag Count: 3'
Scenario: Collected resources update with file changes
Given a fixture app "collections-app"
And a file named "config.rb" with:
"""
collection :articles, resources.select { |r|
matcher = ::Middleman::Util::UriTemplates.uri_template('blog2/{year}-{month}-{day}-{title}.html')
::Middleman::Util::UriTemplates.extract_params(matcher, ::Middleman::Util.normalize_path(r.url))
}
"""
And a file named "source/index.html.erb" with:
"""
<% collection(:articles).each do |article| %>
Article: <%= article.data.title || article.file_descriptor[:relative_path] %>
<% end %>
"""
Given the Server is running at "collections-app"
When I go to "index.html"
Then I should not see "Article: index.html.erb"
Then I should see 'Article: Blog2 Newer Article'
And I should see 'Article: Blog2 Another Article'
And the file "source/blog2/2011-01-02-another-article.html.markdown" has the contents
"""
---
title: "Blog3 Another Article"
date: 2011-01-02
tags:
- foo
---
Another Article Content
"""
When I go to "index.html"
Then I should see "Article: Blog2 Newer Article"
And I should not see "Article: Blog2 Another Article"
And I should see 'Article: Blog3 Another Article'
And the file "source/blog2/2011-01-01-new-article.html.markdown" is removed
When I go to "index.html"
Then I should not see "Article: Blog2 Newer Article"
And I should see 'Article: Blog3 Another Article'
And the file "source/blog2/2014-01-02-yet-another-article.html.markdown" has the contents
"""
---
title: "Blog2 Yet Another Article"
date: 2011-01-02
tags:
- foo
---
Yet Another Article Content
"""
When I go to "index.html"
And I should see 'Article: Blog3 Another Article'
And I should see 'Article: Blog2 Yet Another Article'
Scenario: Work with local helpers
Given a fixture app "collections-app"
And a file named "config.rb" with:
"""
module TestHelper
def help_me
"ok"
end
end
include TestHelper
data.articles.each_with_index do |a, i|
proxy "/#{i}-#{help_me}.html", a
end
"""
And a file named "data/articles.yaml" with:
"""
---
- "/blog1/2011-01-01-new-article.html"
- "/blog2/2011-01-02-another-article.html"
"""
Given the Server is running at "collections-app"
When I go to "0-ok.html"
Then I should see 'Newer Article Content'
When I go to "1-ok.html"
Then I should see 'Another Article Content'
Scenario: Collected data update with file changes
Given a fixture app "collections-app"
And a file named "config.rb" with:
"""
data.articles.each_with_index do |a, i|
proxy "/#{i}.html", a
end
"""
And a file named "data/articles.yaml" with:
"""
---
- "/blog1/2011-01-01-new-article.html"
- "/blog2/2011-01-02-another-article.html"
"""
Given the Server is running at "collections-app"
When I go to "0.html"
Then I should see 'Newer Article Content'
When I go to "1.html"
Then I should see 'Another Article Content'
When I go to "2.html"
Then I should see 'Not Found'
When the file "data/articles.yaml" has the contents
"""
---
- "/blog1/2011-01-01-new-article.html"
"""
When I go to "0.html"
Then I should see 'Newer Article Content'
When I go to "1.html"
Then I should see 'Not Found'
When I go to "2.html"
Then I should see 'Not Found'
When the file "data/articles.yaml" has the contents
"""
---
- "/blog2/2011-01-02-another-article.html"
- "/blog1/2011-01-01-new-article.html"
- "/blog2/2011-01-01-new-article.html"
"""
When I go to "0.html"
Then I should see 'Another Article Content'
When I go to "1.html"
Then I should see 'Newer Article Content'
When I go to "2.html"
Then I should see 'Again'
Scenario: Arbitrary live datasets
Given a fixture app "collections-app"
And a file named "config.rb" with:
"""
ignore "/description_template.html"
live {
Dir[File.join(root, "descriptions/*.txt")]
}.each do |description_name|
base = File.basename(description_name, '.txt')
proxy "#{base}.html", "/description_template.html", locals: {
contents: File.read(description_name)
}
end
"""
And a file named "source/description_template.html.erb" with:
"""
<%= contents %>
"""
And a file named "descriptions/test1.txt" with:
"""
Test1
"""
Given the Server is running at "collections-app"
When I go to "test1.html"
Then I should see 'Test1'
When I go to "test2.html"
Then I should see 'Not Found'
When the file "descriptions/test2.txt" has the contents
"""
Test2
"""
When I go to "test1.html"
Then I should see 'Test1'
When I go to "test2.html"
Then I should see 'Test2'
When the file "descriptions/test1.txt" is removed
When I go to "test1.html"
Then I should see 'Not Found'
When I go to "test2.html"
Then I should see 'Test2'

View File

@ -1,6 +0,0 @@
Feature: Compass sprites should be generated on build and copied
Scenario: Building a clean site with sprites
Given a successfully built app at "compass-sprites-app"
When I cd to "build"
Then the following files should exist:
| images/icon-s0de2218f58.png |

View File

@ -0,0 +1,11 @@
Feature: Console
Scenario: Enter and exit the console
Given a fixture app "large-build-app"
When I run `middleman console` interactively
And I type "puts 'Hello from the console.'"
And I type "exit"
Then it should pass with:
"""
Hello from the console.
"""

View File

@ -12,13 +12,15 @@ Feature: Setting the right content type for files
Then the content type should be "text/css"
When I go to "/README"
Then the content type should be "text/plain"
When I go to "/index.php"
Then the content type should be "text/php"
Scenario: Content type can be set explicitly via page or proxy or frontmatter
Given a fixture app "content-type-app"
And a file named "config.rb" with:
"""
page "README", :content_type => 'text/awesome'
proxy "bar", "index.html", :content_type => 'text/custom'
page "README", content_type: 'text/awesome'
proxy "bar", "index.html", content_type: 'text/custom'
proxy "foo", "README" # auto-delegate to target content type
"""
And the Server is running at "content-type-app"
@ -31,6 +33,7 @@ Feature: Setting the right content type for files
When I go to "/override.html"
Then the content type should be "text/neato"
@preserve_mime_types
Scenario: Content types can be overridden with mime_type
Given a fixture app "content-type-app"
And a file named "config.rb" with:

View File

@ -1,26 +1,38 @@
Feature: Custom layouts
In order easily switch between relative and absolute paths
Scenario: Using custom :layout attribute
Given page "/custom-layout.html" has layout "custom"
And the Server is running at "custom-layout-app2"
When I go to "/custom-layout.html"
Then I should see "Custom Layout"
Scenario: Using with_layout block
Given "/custom-layout.html" with_layout block has layout "custom"
Given a fixture app "custom-layout-app2"
And a file named "config.rb" with:
"""
page '/custom-layout.html', layout: :custom
"""
And the Server is running at "custom-layout-app2"
When I go to "/custom-layout.html"
Then I should see "Custom Layout"
Scenario: Using with_layout block with globs
Given "/custom-*" with_layout block has layout "custom"
Scenario: Using custom :layout attribute with proxy
Given a fixture app "custom-layout-app2"
And a file named "config.rb" with:
"""
page '/test/*', layout: :custom
proxy "/test/me.html", "/custom-layout.html"
live { %w(you) }.each do |who|
proxy "/test/#{who}.html", "/custom-layout.html"
end
"""
And the Server is running at "custom-layout-app2"
When I go to "/custom-layout.html"
When I go to "/test/me.html"
Then I should see "Custom Layout"
When I go to "/test/you.html"
Then I should see "Custom Layout"
Scenario: Using custom :layout attribute with folders
Given page "/custom-layout-dir/" has layout "custom"
Given a fixture app "custom-layout-app2"
And a file named "config.rb" with:
"""
page '/custom-layout-dir/', layout: :custom
"""
And the Server is running at "custom-layout-app2"
When I go to "/custom-layout-dir"
Then I should see "Custom Layout"
@ -28,9 +40,13 @@ Feature: Custom layouts
Then I should see "Custom Layout"
When I go to "/custom-layout-dir/index.html"
Then I should see "Custom Layout"
Scenario: Using custom :layout attribute with folders
Given page "/custom-layout-dir" has layout "custom"
Given a fixture app "custom-layout-app2"
And a file named "config.rb" with:
"""
page '/custom-layout-dir', layout: :custom
"""
And the Server is running at "custom-layout-app2"
When I go to "/custom-layout-dir"
Then I should see "Custom Layout"
@ -38,9 +54,13 @@ Feature: Custom layouts
Then I should see "Custom Layout"
When I go to "/custom-layout-dir/index.html"
Then I should see "Custom Layout"
Scenario: Using custom :layout attribute with folders
Given page "/custom-layout-dir/index.html" has layout "custom"
Given a fixture app "custom-layout-app2"
And a file named "config.rb" with:
"""
page '/custom-layout-dir/index.html', layout: :custom
"""
And the Server is running at "custom-layout-app2"
When I go to "/custom-layout-dir"
Then I should see "Custom Layout"
@ -48,7 +68,7 @@ Feature: Custom layouts
Then I should see "Custom Layout"
When I go to "/custom-layout-dir/index.html"
Then I should see "Custom Layout"
Scenario: Setting layout inside a matching page block
Given the Server is running at "page-helper-layout-block-app"
When I go to "/index.html"
@ -61,4 +81,4 @@ Feature: Custom layouts
When I go to "/path/index.html"
Then I should see "Alt"
And I should see "Monde"
And I should not see "Hello"
And I should not see "Hello"

View File

@ -51,3 +51,10 @@ Feature: Local Data API
Then I should see "title1:Hello"
Then I should see "title2:More"
Then I should see "title3:Stuff"
Scenario: Using data postscript
Given the Server is running at "nested-data-app"
When I go to "/extracontent.html"
Then I should see "<h1>With Content</h1>"
Then I should see '<h2 id="header-2">Header 2</h2>'
Then I should see "<p>Paragraph 1</p>"

View File

@ -0,0 +1,90 @@
Feature: Describe which files get layouts
Background:
Given an empty app
And a file named "config.rb" with:
"""
page "/about.html", layout: :layout2
"""
And a file named "source/layouts/layout.erb" with:
"""
In Layout
<%= yield %>
"""
And a file named "source/layouts/layout2.erb" with:
"""
<root>
<title>Second Layout</title>
<%= yield %>
</root>
"""
And a file named "source/index.html.erb" with:
"""
In Index
"""
And a file named "source/about.html.erb" with:
"""
In About
"""
And a file named "source/style.css.scss" with:
"""
html { border: 1; }
"""
And a file named "source/style2.scss" with:
"""
html { border: 2; }
"""
And a file named "source/data.json" with:
"""
{ "hello": "world" }
"""
And a file named "source/script.js" with:
"""
helloWorld();
"""
And a file named "source/test.xml.erb" with:
"""
---
layout: layout2
---
<test>Hi</test>
"""
And the Server is running at "empty_app"
Scenario: Normal Template
When I go to "/index.html"
Then I should see "In Index"
And I should see "In Layout"
Scenario: Normal Template with override
When I go to "/about.html"
Then I should see "In About"
And I should see "Second Layout"
And I should not see "In Layout"
Scenario: Sass
When I go to "/style.css"
Then I should see "border: 1"
And I should not see "In Layout"
Scenario: Sass with extension
When I go to "/style2"
Then I should see "border: 2"
And I should not see "In Layout"
Scenario: JSON
When I go to "/data.json"
Then I should see "hello"
And I should not see "In Layout"
Scenario: JS
When I go to "/script.js"
Then I should see "helloWorld()"
And I should not see "In Layout"
Scenario: XML
When I go to "/test.xml"
Then I should see "<test>Hi</test>"
And I should see "<title>Second Layout</title>"

View File

@ -9,6 +9,7 @@ Feature: Directory Index
| a_folder/needs_index/index.html |
| leave_me_alone.html |
| wildcard_leave_me_alone.html |
| regex_leave_me_alone2.html |
| evil spaces/index.html |
| regular/index.html |
| .htaccess |
@ -21,28 +22,28 @@ Feature: Directory Index
| a_folder/needs_index.html |
| leave_me_alone/index.html |
| wildcard_leave_me_alone/index.html |
| regex_leave_me_alone2/index.html |
And the file "needs_index/index.html" should contain "Indexable"
And the file "a_folder/needs_index/index.html" should contain "Indexable"
And the file "leave_me_alone.html" should contain "Stay away"
And the file "regular/index.html" should contain "Regular"
And the file "evil spaces/index.html" should contain "Spaces"
And the file "evil spaces/index.html" should contain "Filled with Evil Spaces"
Scenario: Preview normal file
Given the Server is running at "indexable-app"
When I go to "/needs_index/"
Then I should see "Indexable"
Scenario: Preview normal file with spaces in filename
Given the Server is running at "indexable-app"
When I go to "/evil%20spaces/"
Then I should see "Spaces"
When I go to "/evil spaces/"
Then I should see "Filled with Evil Spaces"
Scenario: Preview normal file subdirectory
Given the Server is running at "indexable-app"
When I go to "/a_folder/needs_index/"
Then I should see "Indexable"
Scenario: Preview ignored file
Given the Server is running at "indexable-app"
When I go to "/leave_me_alone/"
@ -69,14 +70,13 @@ Feature: Directory Index
And the Server is running at "indexable-app"
When I go to "/link_to/"
Then I should see 'link_to: <a href="/needs_index/">Needs Index</a>'
Then I should see 'explicit_link_to: <a href="/needs_index/index.html">Explicit</a>'
Then I should see 'explicit_link_to: <a href="/needs_index/">Explicit</a>'
Then I should see 'unknown_link_to: <a href="/unknown.html">Unknown</a>'
Then I should see 'relative_link_to: <a href="/needs_index/">Relative</a>'
Then I should see 'link_to_with_spaces: <a href="/evil%20spaces/">Spaces</a>'
When I go to "/link_to/sub/"
Then I should see 'link_to: <a href="/needs_index/">Needs Index</a>'
Then I should see 'explicit_link_to: <a href="/needs_index/index.html">Explicit</a>'
Then I should see 'explicit_link_to: <a href="/needs_index/">Explicit</a>'
Then I should see 'unknown_link_to: <a href="/unknown.html">Unknown</a>'
Then I should see 'relative_link_to: <a href="/needs_index/">Relative</a>'
Then I should see 'link_to_with_spaces: <a href="/evil%20spaces/">Spaces</a>'

View File

@ -31,7 +31,8 @@ Feature: Dynamic Pages
| should_be_ignored6.html |
| should_be_ignored7.html |
| should_be_ignored8.html |
| should_be_ignored9.html |
Scenario: Preview basic proxy
Given the Server is running at "dynamic-pages-app"
When I go to "/fake.html"
@ -42,46 +43,46 @@ Feature: Dynamic Pages
Then I should see "I am real"
When I go to "/fake4.html"
Then I should see "I am real"
Scenario: Preview proxy with variable one
Given the Server is running at "dynamic-pages-app"
When I go to "/fake/one.html"
Then I should see "I am real: one"
Then I should see "Global: I am one glob"
Then I should see "All: I am all glob"
When I go to "/fake2/one.html"
Then I should see "I am real: one"
Then I should see "Global: I am two glob"
Then I should see "All: I am all glob"
When I go to "/fake3/one.html"
Then I should see "I am real: one"
Then I should see "Global: I am three glob"
Then I should see "All: I am all glob"
When I go to "/fake4/one.html"
Then I should see "I am real: one"
Then I should see "Global: I am four glob"
Then I should see "All: I am all glob"
Scenario: Preview proxy with variable two
Given the Server is running at "dynamic-pages-app"
When I go to "/fake/two.html"
Then I should see "I am real: two"
Then I should see "Global: I am one glob"
Then I should see "All: I am all glob"
When I go to "/fake2/two.html"
Then I should see "I am real: two"
Then I should see "Global: I am two glob"
Then I should see "All: I am all glob"
When I go to "/fake3/two.html"
Then I should see "I am real: two"
Then I should see "Global: I am three glob"
Then I should see "All: I am all glob"
When I go to "/fake4/two.html"
Then I should see "I am real: two"
Then I should see "Global: I am four glob"
@ -101,7 +102,7 @@ Feature: Dynamic Pages
Then the file "fake3/one.html" should contain "I am real: one"
Then the file "fake3/one.html" should contain "Global: I am three glob"
Then the file "fake3/one.html" should contain "All: I am all glob"
Scenario: Target ignore
Given the Server is running at "dynamic-pages-app"
When I go to "/target_ignore.html"
@ -112,7 +113,7 @@ Feature: Dynamic Pages
Then I should see "Ignore me! 7"
When I go to "/target_ignore4.html"
Then I should see "Ignore me! 8"
Scenario: Preview ignored paths
Given the Server is running at "dynamic-pages-app"
When I go to "/should_be_ignored.html"
@ -130,4 +131,6 @@ Feature: Dynamic Pages
When I go to "/should_be_ignored7.html"
Then I should see "File Not Found"
When I go to "/should_be_ignored8.html"
Then I should see "File Not Found"
Then I should see "File Not Found"
When I go to "/should_be_ignored9.html"
Then I should see "File Not Found"

View File

@ -0,0 +1,28 @@
# encoding: iso-8859-1
Feature: encoding option
Scenario: No encoding set
Given a fixture app "clean-app"
Given the Server is running at "clean-app"
When I go to "/index.html"
Then the "Content-Type" header should contain "text/html"
Then the "Content-Type" header should contain "charset=utf-8"
@wip
Scenario: Custom encoding set
Given a fixture app "i-8859-1-app"
And a file named "config.rb" with:
"""
set :encoding, "ISO-8859-1"
::Rack::Mime::MIME_TYPES['.html'] = 'text/html; charset=iso-8859-1'
::Rack::Mime::MIME_TYPES['.htm'] = 'text/html; charset=iso-8859-1'
::Rack::Mime::MIME_TYPES['.map'] = 'application/json; charset=iso-8859-1'
"""
Given the Server is running at "i-8859-1-app"
When I go to "/index.html"
Then the "Content-Type" header should contain "text/html"
Then the "Content-Type" header should contain "charset=iso-8859-1"
Then I should see "äöü"

View File

@ -0,0 +1,10 @@
Feature: Extension author could use some hooks
Scenario: When build
Given a fixture app "extension-api-deprecations-app"
When I run `middleman build`
Then the exit status should be 0
And the output should contain "`set :layout` is deprecated"
And the file "build/index.html" should contain "In Index"
And the file "build/index.html" should not contain "In Layout"

View File

@ -0,0 +1,13 @@
Feature: Extension author could use some hooks
Scenario: When build
Given a fixture app "extension-hooks-app"
When I run `middleman build`
Then the exit status should be 0
And the output should contain "/// after_configuration ///"
And the output should contain "/// ready ///"
And the output should contain "/// before_build ///"
And the output should contain "/// before ///"
And the output should contain "/// before_render ///"
And the output should contain "/// after_render ///"
And the output should contain "/// after_build ///"

View File

@ -1,15 +0,0 @@
Feature: Web Fonts
Scenario: Checking built folder for content
Given a successfully built app at "fonts-app"
When I cd to "build"
Then the following files should exist:
| stylesheets/fonts.css |
And the file "stylesheets/fonts.css" should contain "/fonts/StMarie-Thin.otf"
And the file "stylesheets/fonts.css" should contain "/fonts/blank/blank.otf"
Scenario: Rendering scss
Given the Server is running at "fonts-app"
When I go to "/stylesheets/fonts.css"
Then I should see "/fonts/StMarie-Thin.otf"
And I should see "/fonts/blank/blank.otf"

View File

@ -22,7 +22,7 @@ Feature: Neighboring YAML Front Matter
Then I should not see "---"
When I go to "/raw-front-matter.php.frontmatter"
Then I should see "File Not Found"
Scenario: YAML not on first line, with encoding
Given the Server is running at "frontmatter-neighbor-app"
When I go to "/front-matter-encoding.html"
@ -30,23 +30,12 @@ Feature: Neighboring YAML Front Matter
Then I should not see "---"
When I go to "/front-matter-encoding.html.erb.frontmatter"
Then I should see "File Not Found"
Scenario: Rendering html (json)
Given the Server is running at "frontmatter-neighbor-app"
When I go to "/json-front-matter.html.erb.frontmatter"
Then I should see "File Not Found"
When I go to "/json-front-matter-2.php"
Then I should see "<h1>This is the title</h1>"
Then I should see "<?php"
Then I should not see ";;;"
When I go to "/json-front-matter-2.php.erb.frontmatter"
Then I should see "File Not Found"
Scenario: A template changes frontmatter during preview
Given the Server is running at "frontmatter-neighbor-app"
And the file "source/front-matter-change.html.erb" has the contents
"""
<%= current_page.data.title %>
FileA <%= current_page.data.title %>
"""
And the file "source/front-matter-change.html.erb.frontmatter" has the contents
"""
@ -54,6 +43,8 @@ Feature: Neighboring YAML Front Matter
title: Hello World
layout: false
---
FileB
"""
When I go to "/front-matter-change.html"
Then I should see "Hello World"
@ -63,6 +54,8 @@ Feature: Neighboring YAML Front Matter
title: Hola Mundo
layout: false
---
FileC
"""
When I go to "/front-matter-change.html"
Then I should see "Hola Mundo"
@ -136,3 +129,23 @@ Feature: Neighboring YAML Front Matter
Then I should see "Layout in use: Override"
When I go to "/page_mentioned.html.erb.frontmatter"
Then I should see "File Not Found"
# Scenario: Neighbor frontmatter for destination of proxy resources
# Given the Server is running at "frontmatter-settings-neighbor-app"
# And the file "source/proxied_with_frontmatter.html.frontmatter" has the contents
# """
# ---
# title: Proxied title
# ---
# """
# And the file "source/ignored.html.erb" has the contents
# """
# ---
# ignored: true
# ---
# <%= current_resource.data.inspect %>
# <%= current_resource.data.title %>
# """
# When I go to "/proxied_with_frontmatter.html"
# Then I should see "Proxied title"

View File

@ -18,39 +18,33 @@ Feature: YAML Front Matter
Then I should see "<?php"
Then I should not see "---"
Scenario: Rendering markdown (template-less) (yaml)
Given the Server is running at "frontmatter-app"
When I go to "/front-matter-pandoc.html"
Then I should see ">This is a document</h1>"
Then I should see "<p>To be or not to be</p>"
Then I should see "The meaning of life is 42"
Then I should not see "..."
Then I should not see "layout: false"
Then I should not see "title: Pandoc likes trailing dots..."
Scenario: Rendering Haml (yaml)
Given the Server is running at "frontmatter-app"
When I go to "/front-matter-haml.html"
Then I should see "<h1>This is the title</h1>"
Then I should not see "---"
Scenario: YAML not on first line, no encoding
Given the Server is running at "frontmatter-app"
When I go to "/front-matter-line-2.html"
Then I should see "<h1></h1>"
Then I should see "---"
Scenario: YAML not on first line, with encoding
Given the Server is running at "frontmatter-app"
When I go to "/front-matter-encoding.html"
Then I should see "<h1>This is the title</h1>"
Then I should not see "---"
Scenario: Rendering html (json)
Given the Server is running at "frontmatter-app"
When I go to "/json-front-matter.html"
Then I should see "<h1>This is the title</h1>"
Then I should not see ";;;"
When I go to "/json-front-matter-2.php"
Then I should see "<h1>This is the title</h1>"
Then I should see "<?php"
Then I should not see ";;;"
Scenario: JSON not on first line, no encoding
Given the Server is running at "frontmatter-app"
When I go to "/json-front-matter-line-2.html"
Then I should see "<h1></h1>"
Then I should see ";;;"
Scenario: JSON not on first line, with encoding
Given the Server is running at "frontmatter-app"
When I go to "/json-front-matter-encoding.html"
Then I should see "<h1>This is the title</h1>"
Then I should not see ";;;"
Scenario: A template changes frontmatter during preview
Given the Server is running at "frontmatter-app"

View File

@ -3,14 +3,13 @@ Feature: GZIP assets during build
Scenario: Built assets should be gzipped
Given a successfully built app at "gzip-app"
Then the following files should exist:
| build/javascripts/test.js.gz |
| build/stylesheets/test.css.gz |
| build/index.html |
| build/index.html.gz |
| build/javascripts/test.js |
| build/javascripts/test.js.gz |
| build/stylesheets/test.css |
| build/index.html |
When I run `file build/javascripts/test.js.gz`
Then the output should contain "gzip"
| build/stylesheets/test.css.gz |
And the file "build/javascripts/test.js.gz" should be gzipped
Scenario: Preview server doesn't change
Given the Server is running at "gzip-app"
@ -18,4 +17,35 @@ Feature: GZIP assets during build
Then I should see "test_function"
When I go to "/stylesheets/test.css"
Then I should see "test_selector"
Scenario: Only specified extensions should be gzipped
Given a fixture app "gzip-app"
And a file named "config.rb" with:
"""
activate :gzip, exts: %w(.htm .html .js .xhtml)
"""
And a successfully built app at "gzip-app"
Then the following files should exist:
| build/index.html |
| build/index.html.gz |
| build/javascripts/test.js |
| build/javascripts/test.js.gz |
| build/stylesheets/test.css |
And the following files should not exist:
| build/stylesheets/test.css.gz |
Scenario: Gzipped files are not produced for ignored paths
Given a fixture app "gzip-app"
And a file named "config.rb" with:
"""
activate :gzip, ignore: ['index.html', %r(javascripts/.*)]
"""
And a successfully built app at "gzip-app"
Then the following files should exist:
| build/index.html |
| build/javascripts/test.js |
| build/stylesheets/test.css |
| build/stylesheets/test.css.gz |
And the following files should not exist:
| build/index.html.gz |
| build/javascripts/test.js.gz |

View File

@ -6,6 +6,11 @@ Feature: Built-in auto_javascript_include_tag view helper
When I go to "/auto-js.html"
Then I should see "javascripts/auto-js.js"
Scenario: Viewing the root path (directory index)
Given the Server is running at "auto-js-directory-index-app"
When I go to "/auto-js/index.html"
Then I should see "javascripts/auto-js.js"
Scenario: Viewing the root path (build mode)
Given a successfully built app at "auto-js-app"
When I cd to "build"

View File

@ -5,8 +5,8 @@ Feature: content_tag helper
And an empty file named "config.rb"
And a file named "source/index.html.erb" with:
"""
<%= content_tag :div, "<hello>world</hello>", :class => 'one' %>
<% content_tag :where, :class => 'the hell is' do %>
<%= content_tag :div, "<hello>world</hello>", class: 'one' %>
<% content_tag :where, class: 'the hell is' do %>
<my>damn croissant</my>
<% end %>
"""

View File

@ -5,16 +5,16 @@ Feature: form_tag helper
And an empty file named "config.rb"
And a file named "source/form_tag.html.erb" with:
"""
absolute: <% form_tag "/needs_index.html#absolute", :relative => true do %>
absolute: <% form_tag "/needs_index.html#absolute", relative: true do %>
<% end %>
relative: <% form_tag "needs_index.html#relative", :relative => true do %>
relative: <% form_tag "needs_index.html#relative", relative: true do %>
<% end %>
"""
And a file named "source/form_tag/sub.html.erb" with:
"""
absolute: <% form_tag "/needs_index.html#absolute", :relative => true do %>
absolute: <% form_tag "/needs_index.html#absolute", relative: true do %>
<% end %>
relative: <% form_tag "../needs_index.html#relative", :relative => true do %>
relative: <% form_tag "../needs_index.html#relative", relative: true do %>
<% end %>
"""
And the Server is running at "indexable-app"

View File

@ -5,6 +5,24 @@ Feature: link_to helper
When I go to "/link_to_erb.html"
Then I should see "erb <s>with html tags</s>"
Scenario: link_to works with absolute URLs (where the relative part matches a local path)
Given a fixture app "link-to-app"
And a file named "config.rb" with:
"""
set :relative_links, true
"""
And a file named "source/test.html.erb" with:
"""
Hello
"""
And a file named "source/link_to_absolute.html.erb" with:
"""
<%= link_to "test", "http://google.com/test.html" %>
"""
And the Server is running at "link-to-app"
When I go to "/link_to_absolute.html"
Then I should see '<a href="http://google.com/test.html">test</a>'
Scenario: link_to works with blocks (slim)
Given the Server is running at "link-to-app"
When I go to "/link_to_slim.html"
@ -20,21 +38,31 @@ Feature: link_to helper
And an empty file named "config.rb"
And a file named "source/link_to.html.erb" with:
"""
absolute: <%= link_to "Needs Index", "/needs_index.html", :relative => true %>
relative: <%= link_to "Relative", "needs_index.html", :relative => true %>
absolute: <%= link_to "Needs Index", "/needs_index.html", relative: true %>
relative: <%= link_to "Relative", "needs_index.html", relative: true %>
absolute spaces: <%= link_to "Spaces Index", "/evil spaces.html", relative: true %>
relative spaces: <%= link_to "Spaces Relative", "evil spaces.html", relative: true %>
"""
And a file named "source/link_to/sub.html.erb" with:
"""
absolute: <%= link_to "Needs Index", "/needs_index.html", :relative => true %>
relative: <%= link_to "Relative", "../needs_index.html", :relative => true %>
absolute: <%= link_to "Needs Index", "/needs_index.html", relative: true %>
relative: <%= link_to "Relative", "../needs_index.html", relative: true %>
absolute spaces: <%= link_to "Spaces Index", "/evil spaces.html", relative: true %>
relative spaces: <%= link_to "Spaces Relative", "../evil spaces.html", relative: true %>
"""
And the Server is running at "indexable-app"
When I go to "/link_to.html"
Then I should see 'absolute: <a href="needs_index.html">Needs Index</a>'
Then I should see 'relative: <a href="needs_index.html">Relative</a>'
Then I should see 'absolute spaces: <a href="evil%20spaces.html">Spaces Index</a>'
Then I should see 'relative spaces: <a href="evil%20spaces.html">Spaces Relative</a>'
When I go to "/link_to/sub.html"
Then I should see 'absolute: <a href="../needs_index.html">Needs Index</a>'
Then I should see 'relative: <a href="../needs_index.html">Relative</a>'
Then I should see 'absolute spaces: <a href="../evil%20spaces.html">Spaces Index</a>'
Then I should see 'relative spaces: <a href="../evil%20spaces.html">Spaces Relative</a>'
Scenario: link_to relative works with strip_index_file
Given a fixture app "indexable-app"
@ -79,7 +107,7 @@ Feature: link_to helper
And a file named "source/link_to.html.erb" with:
"""
absolute: <%= link_to "Needs Index", "/needs_index.html" %>
relative: <%= link_to "Relative", "needs_index.html", :relative => false %>
relative: <%= link_to "Relative", "needs_index.html", relative: false %>
unknown: <%= link_to "Unknown", "foo.html" %>
"""
And a file named "source/link_to/sub.html.erb" with:
@ -95,18 +123,18 @@ Feature: link_to helper
When I go to "/link_to/sub.html"
Then I should see 'absolute: <a href="../needs_index.html">Needs Index</a>'
Then I should see 'relative: <a href="../needs_index.html">Relative</a>'
Scenario: link_to knows about directory indexes
Given a fixture app "indexable-app"
And a file named "source/link_to.html.erb" with:
"""
absolute: <%= link_to "Needs Index", "/needs_index.html", :relative => true %>
relative: <%= link_to "Relative", "needs_index.html", :relative => true %>
absolute: <%= link_to "Needs Index", "/needs_index.html", relative: true %>
relative: <%= link_to "Relative", "needs_index.html", relative: true %>
"""
And a file named "source/link_to/sub.html.erb" with:
"""
absolute: <%= link_to "Needs Index", "/needs_index.html", :relative => true %>
relative: <%= link_to "Relative", "../needs_index.html", :relative => true %>
absolute: <%= link_to "Needs Index", "/needs_index.html", relative: true %>
relative: <%= link_to "Relative", "../needs_index.html", relative: true %>
"""
And the Server is running at "indexable-app"
When I go to "/link_to/"
@ -158,8 +186,8 @@ Feature: link_to helper
Given a fixture app "indexable-app"
And a file named "source/link_to.html.erb" with:
"""
<%= link_to "Needs Index String", "/needs_index.html", :query => "foo" %>
<%= link_to "Needs Index Hash", "/needs_index.html", :query => { :foo => :bar } %>
<%= link_to "Needs Index String", "/needs_index.html", query: "foo" %>
<%= link_to "Needs Index Hash", "/needs_index.html", query: { foo: :bar } %>
"""
And the Server is running at "indexable-app"
When I go to "/link_to/"

View File

@ -9,11 +9,9 @@ Feature: select_tag helper
"""
And the Server is running at "indexable-app"
When I go to "/select_tag.html"
Then I should see:
"""
<select name="colors" include_blank="Choose a color"><option value="">Choose a color</option>
<option value="red">red</option>
<option value="blue">blue</option>
<option value="blorange">blorange</option>
</select>
"""
Then I should see '<select name="colors"'
Then I should see '<option value="">Choose a color</option>'
Then I should see '<option value="red">red</option>'
Then I should see '<option value="blue">blue</option>'
Then I should see '<option value="blorange">blorange</option>'
Then I should see '</select>'

View File

@ -5,13 +5,13 @@ Feature: url_for helper
And an empty file named "config.rb"
And a file named "source/url_for.html.erb" with:
"""
absolute: <%= url_for "/needs_index.html", :relative => true %>
relative: <%= url_for "needs_index.html", :relative => true %>
absolute: <%= url_for "/needs_index.html", relative: true %>
relative: <%= url_for "needs_index.html", relative: true %>
"""
And a file named "source/url_for/sub.html.erb" with:
"""
absolute: <%= url_for "/needs_index.html", :relative => true %>
relative: <%= url_for "../needs_index.html", :relative => true %>
absolute: <%= url_for "/needs_index.html", relative: true %>
relative: <%= url_for "../needs_index.html", relative: true %>
"""
And the Server is running at "indexable-app"
When I go to "/url_for.html"
@ -64,7 +64,7 @@ Feature: url_for helper
And a file named "source/url_for.html.erb" with:
"""
absolute: <%= url_for "/needs_index.html" %>
relative: <%= url_for "needs_index.html", :relative => false %>
relative: <%= url_for "needs_index.html", relative: false %>
unknown: <%= url_for "foo.html" %>
"""
And a file named "source/url_for/sub.html.erb" with:
@ -85,13 +85,13 @@ Feature: url_for helper
Given a fixture app "indexable-app"
And a file named "source/url_for.html.erb" with:
"""
absolute: <%= url_for "/needs_index.html", :relative => true %>
relative: <%= url_for "needs_index.html", :relative => true %>
absolute: <%= url_for "/needs_index.html", relative: true %>
relative: <%= url_for "needs_index.html", relative: true %>
"""
And a file named "source/url_for/sub.html.erb" with:
"""
absolute: <%= url_for "/needs_index.html", :relative => true %>
relative: <%= url_for "../needs_index.html", :relative => true %>
absolute: <%= url_for "/needs_index.html", relative: true %>
relative: <%= url_for "../needs_index.html", relative: true %>
"""
And the Server is running at "indexable-app"
When I go to "/url_for/"
@ -143,8 +143,8 @@ Feature: url_for helper
Given a fixture app "indexable-app"
And a file named "source/url_for.html.erb" with:
"""
Needs Index String <%= url_for "/needs_index.html", :query => "foo" %>
Needs Index Hash <%= url_for "/needs_index.html", :query => { :foo => :bar } %>
Needs Index String <%= url_for "/needs_index.html", query: "foo" %>
Needs Index Hash <%= url_for "/needs_index.html", query: { foo: :bar } %>
"""
And the Server is running at "indexable-app"
When I go to "/url_for/"

View File

@ -49,7 +49,7 @@ Feature: i18n Builder
Given a fixture app "i18n-test-app"
And a file named "config.rb" with:
"""
activate :i18n, :path => "/lang_:locale/"
activate :i18n, path: "/lang_:locale/"
"""
Given a successfully built app at "i18n-test-app"
When I cd to "build"
@ -69,7 +69,7 @@ Feature: i18n Builder
Given a fixture app "i18n-alt-root-app"
And a file named "config.rb" with:
"""
activate :i18n, :templates_dir => "lang_data"
activate :i18n, templates_dir: "lang_data"
"""
Given a successfully built app at "i18n-alt-root-app"
When I cd to "build"
@ -89,7 +89,7 @@ Feature: i18n Builder
Given a fixture app "i18n-test-app"
And a file named "config.rb" with:
"""
activate :i18n, :lang_map => { :en => :english, :es => :spanish }
activate :i18n, lang_map: { en: :english, es: :spanish }
"""
Given a successfully built app at "i18n-test-app"
When I cd to "build"
@ -109,7 +109,7 @@ Feature: i18n Builder
Given a fixture app "i18n-test-app"
And a file named "config.rb" with:
"""
activate :i18n, :mount_at_root => false
activate :i18n, mount_at_root: false
"""
Given a successfully built app at "i18n-test-app"
When I cd to "build"
@ -130,7 +130,7 @@ Feature: i18n Builder
Given a fixture app "i18n-test-app"
And a file named "config.rb" with:
"""
activate :i18n, :langs => [:en]
activate :i18n, langs: [:en]
"""
Given a successfully built app at "i18n-test-app"
When I cd to "build"

View File

@ -0,0 +1,209 @@
Feature: i18n Paths
Scenario: link_to is i18n aware
Given a fixture app "empty-app"
And a file named "data/pages.yml" with:
"""
- hello.html
"""
And a file named "locales/en.yml" with:
"""
---
en:
msg: Hello
home: Home
"""
And a file named "locales/es.yml" with:
"""
---
es:
paths:
hello: "hola"
msg: Hola
home: Casa
"""
And a file named "source/localizable/index.html.erb" with:
"""
Page: <%= t(:hom) %>
"""
And a file named "source/localizable/hello.html.erb" with:
"""
Page: <%= t(:msg) %>
<%= link_to "Current Home", "/index.html", class: 'current' %>
<%= link_to "Other Home", "/index.html", title: "Other Home", locale: ::I18n.locale == :en ? :es : :en %>
<% link_to "/index.html", class: 'current' do %><span>Home: Current Block</span><% end %>
<% link_to "/index.html", title: "Other Home", locale: ::I18n.locale == :en ? :es : :en do %><span>Home: Other Block</span><% end %>
<% data.pages.each_with_index do |p, i| %>
<%= link_to "Current #{p}", "/#{p}", class: 'current' %>
<%= link_to "Other #{p}", "/#{p}", title: "Other #{p}", locale: ::I18n.locale == :en ? :es : :en %>
<% link_to "/#{p}", class: 'current' do %><span>Current Block</span><% end %>
<% link_to "/#{p}", title: "Other #{p}", locale: ::I18n.locale == :en ? :es : :en do %><span>Other Block</span><% end %>
<% end %>
"""
And a file named "config.rb" with:
"""
set :strip_index_file, false
activate :i18n, mount_at_root: :en
"""
Given the Server is running at "empty-app"
When I go to "/hello.html"
Then I should see "Page: Hello"
Then I should see '<a href="/index.html" class="current">Current Home</a>'
Then I should see '<a href="/es/index.html" title="Other Home">Other Home</a>'
Then I should see '<a href="/index.html" class="current"><span>Home: Current Block</span></a>'
Then I should see '<a href="/es/index.html" title="Other Home"><span>Home: Other Block</span></a>'
Then I should see '<a href="/hello.html" class="current">Current hello.html</a>'
Then I should see '<a href="/es/hola.html" title="Other hello.html">Other hello.html</a>'
Then I should see '<a href="/hello.html" class="current"><span>Current Block</span></a>'
Then I should see '<a href="/es/hola.html" title="Other hello.html"><span>Other Block</span></a>'
When I go to "/es/hola.html"
Then I should see "Page: Hola"
Then I should see '<a href="/es/index.html" class="current">Current Home</a>'
Then I should see '<a href="/index.html" title="Other Home">Other Home</a>'
Then I should see '<a href="/es/index.html" class="current"><span>Home: Current Block</span></a>'
Then I should see '<a href="/index.html" title="Other Home"><span>Home: Other Block</span></a>'
Then I should see '<a href="/es/hola.html" class="current">Current hello.html</a>'
Then I should see '<a href="/hello.html" title="Other hello.html">Other hello.html</a>'
Then I should see '<a href="/es/hola.html" class="current"><span>Current Block</span></a>'
Then I should see '<a href="/hello.html" title="Other hello.html"><span>Other Block</span></a>'
Scenario: link_to is i18n aware and supports relative_links
Given a fixture app "empty-app"
And a file named "locales/en.yml" with:
"""
---
en:
msg: Hello
home: Home
"""
And a file named "locales/es.yml" with:
"""
---
es:
paths:
hello: "hola"
msg: Hola
home: Casa
"""
And a file named "source/assets/css/main.css.scss" with:
"""
$color: red;
body { background: $color; }
"""
And a file named "source/localizable/index.html.erb" with:
"""
Page: <%= t(:home) %>
<%= stylesheet_link_tag :main %>
"""
And a file named "source/localizable/hello.html.erb" with:
"""
Page: <%= t(:msg) %>
<%= link_to "Current Home", "/index.html", class: 'current' %>
<%= link_to "Other Home", "/index.html", title: "Other Home", locale: ::I18n.locale == :en ? :es : :en %>
<% link_to "/index.html", class: 'current' do %><span>Home: Current Block</span><% end %>
<% link_to "/index.html", title: "Other Home", locale: ::I18n.locale == :en ? :es : :en do %><span>Home: Other Block</span><% end %>
<%= link_to "Current hello.html", "/hello.html", class: 'current' %>
<%= link_to "Other hello.html", "/hello.html", title: "Other hello.html", locale: ::I18n.locale == :en ? :es : :en %>
<% link_to "/hello.html", class: 'current' do %><span>Current Block</span><% end %>
<% link_to "/hello.html", title: "Other hello.html", locale: ::I18n.locale == :en ? :es : :en do %><span>Other Block</span><% end %>
"""
And a file named "config.rb" with:
"""
set :css_dir, 'assets/css'
set :relative_links, true
set :strip_index_file, false
activate :i18n, mount_at_root: :en
activate :relative_assets
"""
Given the Server is running at "empty-app"
When I go to "/index.html"
Then I should see "assets/css/main.css"
When I go to "/hello.html"
Then I should see "Page: Hello"
Then I should see '<a href="index.html" class="current">Current Home</a>'
Then I should see '<a href="es/index.html" title="Other Home">Other Home</a>'
Then I should see '<a href="index.html" class="current"><span>Home: Current Block</span></a>'
Then I should see '<a href="es/index.html" title="Other Home"><span>Home: Other Block</span></a>'
Then I should see '<a href="hello.html" class="current">Current hello.html</a>'
Then I should see '<a href="es/hola.html" title="Other hello.html">Other hello.html</a>'
Then I should see '<a href="hello.html" class="current"><span>Current Block</span></a>'
Then I should see '<a href="es/hola.html" title="Other hello.html"><span>Other Block</span></a>'
When I go to "/es/hola.html"
Then I should see "Page: Hola"
Then I should see '<a href="index.html" class="current">Current Home</a>'
Then I should see '<a href="../index.html" title="Other Home">Other Home</a>'
Then I should see '<a href="index.html" class="current"><span>Home: Current Block</span></a>'
Then I should see '<a href="../index.html" title="Other Home"><span>Home: Other Block</span></a>'
Then I should see '<a href="hola.html" class="current">Current hello.html</a>'
Then I should see '<a href="../hello.html" title="Other hello.html">Other hello.html</a>'
Then I should see '<a href="hola.html" class="current"><span>Current Block</span></a>'
Then I should see '<a href="../hello.html" title="Other hello.html"><span>Other Block</span></a>'
Scenario: url_for is i18n aware
Given a fixture app "empty-app"
And a file named "data/pages.yml" with:
"""
- hello.html
- article.html
"""
And a file named "locales/en.yml" with:
"""
---
en:
msg: Hello
"""
And a file named "locales/es.yml" with:
"""
---
es:
paths:
hello: "hola"
msg: Hola
"""
And a file named "source/localizable/hello.html.erb" with:
"""
Page: <%= t(:msg) %>
<% data.pages.each_with_index do |p, i| %>
Current: <%= url_for "/#{p}" %>
Other: <%= url_for "/#{p}", locale: ::I18n.locale == :en ? :es : :en %>
<% end %>
"""
And a file named "source/localizable/article.html.erb" with:
"""
Page Lang: Default
Current: <%= url_for "/article.html" %>
Other: <%= url_for "/article.html", locale: ::I18n.locale == :en ? :es : :en %>
"""
And a file named "source/localizable/article.es.html.erb" with:
"""
Page Lang: Spanish
Current: <%= url_for "/article.html" %>
Other: <%= url_for "/article.html", locale: :en %>
"""
And a file named "config.rb" with:
"""
activate :i18n, mount_at_root: :en
"""
Given the Server is running at "empty-app"
When I go to "/hello.html"
Then I should see "Page: Hello"
Then I should see 'Current: /hello.html'
Then I should see 'Other: /es/hola.html'
When I go to "/es/hola.html"
Then I should see "Page: Hola"
Then I should see 'Current: /es/hola.html'
Then I should see 'Other: /hello.html'
When I go to "/article.html"
Then I should see "Page Lang: Default"
Then I should see 'Current: /article.html'
Then I should see 'Other: /es/article.html'
When I go to "/es/article.html"
Then I should see "Page Lang: Spanish"
Then I should see 'Current: /es/article.html'
Then I should see 'Other: /article.html'

View File

@ -0,0 +1,39 @@
Feature: i18n merging path trees
Scenario: Mixing localized and non-localized sources and merging the path trees (see issue #1709)
Given a fixture app "i18n-test-app"
And a file named "config.rb" with:
"""
activate :i18n, mount_at_root: :en, langs: [:en, :es]
"""
Given the Server is running at "i18n-mixed-sources"
When I go to "/"
Then I should see "Current locale: en"
Then I should see "path: is-localized Home"
When I go to "/es"
Then I should see "Current locale: es"
Then I should see "path: is-localized Home"
When I go to "/a/"
Then I should see "Current locale: en"
Then I should see "path: is-localized Home # a/index.html.erb"
When I go to "/es/a/"
Then I should see "Current locale: es"
Then I should see "path: is-localized Home # a/index.html.erb"
When I go to "/b/"
Then I should see "Current locale: en"
Then I should see "path: is-localized Home # b/index.html.erb"
When I go to "/a/sub.html"
Then I should see "Current locale: en"
Then I should see "path: is-localized Home # a/index.html.erb # a/sub.html.erb"
When I go to "/b/sub.html"
Then I should see "Current locale: en"
Then I should see "path: is-localized Home # b/index.html.erb # b/sub.html.erb"
When I go to "/es/b/sub.html"
Then I should see "Current locale: es"
Then I should see "path: is-localized Home # b/index.html.erb # b/sub.html.erb"

View File

@ -0,0 +1,23 @@
Feature: i18n Partials
Scenario: Running localize with the default config
Given a fixture app "i18n-test-app"
And a file named "config.rb" with:
"""
activate :i18n
"""
Given the Server is running at "i18n-test-app"
When I go to "/partials/index.html"
Then I should see "Country: USA"
Then I should see "State: District of Columbia"
Then I should see "Greeting: Hello"
Then I should see "Site: Locale Site"
Then I should see "Flag: stars"
Then I should see "President: obama"
When I go to "/es/partials/index.html"
Then I should see "Country: Mexico"
Then I should see "State: Distrito Federal"
Then I should see "Greeting: Hola"
Then I should see "Site: Locale Site"
Then I should see "Flag: bars"
Then I should see "President: nieto"

View File

@ -67,7 +67,7 @@ Feature: i18n Preview
Given a fixture app "i18n-test-app"
And a file named "config.rb" with:
"""
activate :i18n, :path => "/lang_:locale/"
activate :i18n, path: "/lang_:locale/"
"""
Given the Server is running at "i18n-test-app"
When I go to "/"
@ -86,7 +86,7 @@ Feature: i18n Preview
Given a fixture app "i18n-alt-root-app"
And a file named "config.rb" with:
"""
activate :i18n, :templates_dir => "lang_data"
activate :i18n, templates_dir: "lang_data"
"""
Given the Server is running at "i18n-alt-root-app"
When I go to "/"
@ -104,7 +104,7 @@ Feature: i18n Preview
Given a fixture app "i18n-test-app"
And a file named "config.rb" with:
"""
activate :i18n, :lang_map => { :en => :english, :es => :spanish }
activate :i18n, lang_map: { en: :english, es: :spanish }
"""
Given the Server is running at "i18n-test-app"
When I go to "/"
@ -122,7 +122,7 @@ Feature: i18n Preview
Given a fixture app "i18n-test-app"
And a file named "config.rb" with:
"""
activate :i18n, :mount_at_root => :es
activate :i18n, mount_at_root: :es
"""
Given the Server is running at "i18n-test-app"
When I go to "/en/index.html"
@ -150,7 +150,7 @@ Feature: i18n Preview
Given a fixture app "i18n-test-app"
And a file named "config.rb" with:
"""
activate :i18n, :langs => :es
activate :i18n, langs: :es
"""
Given the Server is running at "i18n-test-app"
When I go to "/en/index.html"
@ -173,7 +173,7 @@ Feature: i18n Preview
Given a fixture app "i18n-test-app"
And a file named "config.rb" with:
"""
activate :i18n, :mount_at_root => false
activate :i18n, mount_at_root: false
"""
Given the Server is running at "i18n-test-app"
When I go to "/en/index.html"
@ -193,7 +193,7 @@ Feature: i18n Preview
Given a fixture app "i18n-test-app"
And a file named "config.rb" with:
"""
activate :i18n, :langs => [:en]
activate :i18n, langs: [:en]
"""
Given the Server is running at "i18n-test-app"
When I go to "/"
@ -228,7 +228,7 @@ Feature: i18n Preview
Given a fixture app "i18n-default-app"
And a file named "config.rb" with:
"""
activate :i18n, :mount_at_root => :es
activate :i18n, mount_at_root: :es
"""
Given the Server is running at "i18n-default-app"
When I go to "/en/"

View File

@ -12,7 +12,7 @@ Feature: Ignoring paths
And the following files should not exist:
| build/plain.html |
| build/about.html |
Scenario: Ignore a single path (server)
Given a fixture app "ignore-app"
And a file named "config.rb" with:
@ -28,6 +28,35 @@ Feature: Ignoring paths
When I go to "/about.html"
Then I should see "File Not Found"
Scenario: Ignoring collected values
Given a fixture app "ignore-app"
And a file named "data/ignores.yaml" with:
"""
---
- "plain"
"""
And a file named "config.rb" with:
"""
data.ignores.each do |name|
ignore "#{name}.html"
end
"""
And the Server is running
When I go to "/plain.html"
Then I should see "File Not Found"
When I go to "/about.html"
Then I should not see "File Not Found"
When the file "data/ignores.yaml" has the contents
"""
---
- "about"
"""
When I go to "/plain.html"
Then I should not see "File Not Found"
When I go to "/about.html"
Then I should see "File Not Found"
Scenario: Ignore a globbed path (build)
Given a fixture app "ignore-app"
And a file named "config.rb" with:
@ -47,7 +76,7 @@ Feature: Ignoring paths
| build/reports/index.html |
| build/reports/another.html |
| build/images/icons/messages.png |
Scenario: Ignore a globbed path (server)
Given a fixture app "ignore-app"
And a file named "config.rb" with:
@ -93,7 +122,7 @@ Feature: Ignoring paths
| build/reports/index.html |
| build/reports/another.html |
| build/images/icons/messages.png |
Scenario: Ignore a regex (server)
Given a fixture app "ignore-app"
And a file named "config.rb" with:
@ -118,4 +147,4 @@ Feature: Ignoring paths
When I go to "/reports/another.html"
Then I should see "File Not Found"
When I go to "/images/icons/messages.png"
Then I should see "File Not Found"
Then I should see "File Not Found"

View File

@ -0,0 +1,7 @@
Feature: Support srcset property as params for image_tag helper
This lets you specify responsive image sizes
Scenario: Rendering an image with the feature enabled
Given the Server is running at "image-srcset-paths-app"
When I go to "/image-srcset-paths.html"
Then I should see '//example.com/remote-image.jpg 2x, /images/blank_3x.jpg 3x'

View File

@ -0,0 +1,15 @@
Feature: Import files
Scenario: Move one path to another
Given the Server is running at "import-app"
When I go to "/static.html"
Then I should see 'Not Found'
When I go to "/static2.html"
Then I should see 'Static, no code!'
Scenario: Import all of bower
Given the Server is running at "import-app"
When I go to "/bower_components/jquery/dist/jquery.js"
Then I should see 'jQuery'
When I go to "/bower_components2/jquery/dist/jquery.js"
Then I should see 'jQuery'

View File

@ -0,0 +1,18 @@
Feature: Test a site with javascript included
As a software developer
I want to develop a site using javascript
I would like to have a server step rendering javascript correctly in order to test it
@javascript
Scenario: Existing app with javascript
Given the Server is running at "javascript-app"
When I go to "/index.html"
Then I should see:
"""
Local Hour
"""
And I should see:
"""
Local Minutes
"""

View File

@ -6,7 +6,7 @@ Feature: Markdown (Kramdown) support
And a file named "config.rb" with:
"""
set :markdown_engine, :kramdown
set :markdown, :smartypants => true
set :markdown, smartypants: true
"""
Given the Server is running at "markdown-app"
When I go to "/smarty_pants.html"

View File

@ -33,9 +33,10 @@ Feature: Markdown support in Haml (Kramdown)
:markdown
[A link](/link_target.html)
![image](blank.gif)
![image](blank.gif){: srcset="image_2x.jpg 2x"}
"""
Given the Server is running at "markdown-in-haml-app"
When I go to "/link_and_image/"
Then I should see "/link_target/"
Then I should see "/images/image_2x.jpg 2x"
Then I should see 'src="/images/blank.gif"'

View File

@ -0,0 +1,42 @@
Feature: Markdown support in Slim (Kramdown)
In order to test support of the Slim markdown filter
Scenario: Markdown filter in Slim works (with Kramdown)
Given a fixture app "markdown-in-slim-app"
And a file named "config.rb" with:
"""
set :markdown_engine, :kramdown
activate :directory_indexes
"""
And a file named "source/markdown_filter.html.slim" with:
"""
markdown:
# H1
paragraph
"""
Given the Server is running at "markdown-in-slim-app"
When I go to "/markdown_filter/"
Then I should see ">H1</h1>"
Then I should see "<p>paragraph</p>"
Scenario: Markdown filter in Slim uses our link_to and image_tag helpers (with Kramdown)
Given a fixture app "markdown-in-slim-app"
And a file named "config.rb" with:
"""
set :markdown_engine, :kramdown
activate :directory_indexes
"""
And a file named "source/link_and_image.html.slim" with:
"""
markdown:
[A link](/link_target.html)
![image](blank.gif){: srcset="image_2x.jpg 2x"}
"""
Given the Server is running at "markdown-in-slim-app"
When I go to "/link_and_image/"
Then I should see "/link_target/"
Then I should see "/images/image_2x.jpg 2x"
Then I should see 'src="/images/blank.gif"'

View File

@ -1,4 +1,3 @@
@nojava
Feature: Markdown (Redcarpet) support
In order to test included Redcarpet support
@ -7,14 +6,14 @@ Feature: Markdown (Redcarpet) support
And a file named "config.rb" with:
"""
set :markdown_engine, :redcarpet
set :markdown, :no_intra_emphasis => true,
:tables => true,
:fenced_code_blocks => true,
:autolink => true,
:strikethrough => true,
:space_after_headers => true,
:superscript => true,
:lax_spacing => true
set :markdown, no_intra_emphasis: true,
tables: true,
fenced_code_blocks: true,
autolink: true,
strikethrough: true,
space_after_headers: true,
superscript: true,
lax_spacing: true
"""
Given the Server is running at "markdown-app"
@ -42,9 +41,9 @@ Feature: Markdown (Redcarpet) support
And a file named "config.rb" with:
"""
set :markdown_engine, :redcarpet
set :markdown, :underline => true,
:highlight => true,
:disable_indented_code_blocks => true
set :markdown, underline: true,
highlight: true,
disable_indented_code_blocks: true
"""
Given the Server is running at "markdown-app"
When I go to "/underline.html"
@ -59,7 +58,7 @@ Feature: Markdown (Redcarpet) support
And a file named "config.rb" with:
"""
set :markdown_engine, :redcarpet
set :markdown, :smartypants => true
set :markdown, smartypants: true
"""
Given the Server is running at "markdown-app"
When I go to "/smarty_pants.html"
@ -70,13 +69,13 @@ Feature: Markdown (Redcarpet) support
And a file named "config.rb" with:
"""
set :markdown_engine, :redcarpet
set :markdown, :filter_html => true,
:no_images => true,
:no_links => true,
:with_toc_data => true,
:hard_wrap => true,
:safe_links_only => true,
:prettify => true
set :markdown, filter_html: true,
no_images: true,
no_links: true,
with_toc_data: true,
hard_wrap: true,
safe_links_only: true,
prettify: true
"""
Given the Server is running at "markdown-app"
@ -103,7 +102,7 @@ Feature: Markdown (Redcarpet) support
And a file named "config.rb" with:
"""
set :markdown_engine, :redcarpet
set :markdown, :link_attributes => { :target => "_blank" }
set :markdown, link_attributes: { target: "_blank" }
"""
And a file named "source/link.html.markdown" with:
"""
@ -118,8 +117,8 @@ Feature: Markdown (Redcarpet) support
And a file named "config.rb" with:
"""
set :markdown_engine, :redcarpet
set :markdown, :xhtml => true,
:hard_wrap => true
set :markdown, xhtml: true,
hard_wrap: true
"""
Given the Server is running at "markdown-app"
When I go to "/hard_wrap.html"
@ -130,7 +129,7 @@ Feature: Markdown (Redcarpet) support
And a file named "config.rb" with:
"""
set :markdown_engine, :redcarpet
set :markdown, :smartypants => true
set :markdown, smartypants: true
"""
Given the Server is running at "markdown-frontmatter-options-app"
When I go to "/smarty_pants-default.html"

View File

@ -1,4 +1,3 @@
@nojava
Feature: Markdown support in Haml
In order to test support of the Haml markdown filter

View File

@ -0,0 +1,41 @@
Feature: Markdown support in Slim
In order to test support of the Slim markdown filter
Scenario: Markdown filter in Slim works
Given a fixture app "markdown-in-slim-app"
And a file named "config.rb" with:
"""
set :markdown_engine, :redcarpet
activate :directory_indexes
"""
And a file named "source/markdown_filter.html.slim" with:
"""
markdown:
# H1
paragraph
"""
Given the Server is running at "markdown-in-slim-app"
When I go to "/markdown_filter/"
Then I should see ">H1</h1>"
Then I should see "<p>paragraph</p>"
Scenario: Markdown filter in Slim uses our link_to and image_tag helpers
Given a fixture app "markdown-in-slim-app"
And a file named "config.rb" with:
"""
set :markdown_engine, :redcarpet
activate :directory_indexes
"""
And a file named "source/link_and_image.html.slim" with:
"""
markdown:
[A link](/link_target.html)
![image](blank.gif)
"""
Given the Server is running at "markdown-in-slim-app"
When I go to "/link_and_image/"
Then I should see "/link_target/"
Then I should see 'src="/images/blank.gif"'

View File

@ -5,16 +5,19 @@ Feature: Minify CSS
Given a fixture app "minify-css-app"
And a file named "config.rb" with:
"""
config[:sass_source_maps] = false
"""
And the Server is running at "minify-css-app"
When I go to "/stylesheets/site.css"
Then I should see "50" lines
Then I should see "7" lines
And I should see "only screen and (device-width"
Scenario: Rendering external css with the feature enabled
Given a fixture app "minify-css-app"
And a file named "config.rb" with:
"""
config[:sass_source_maps] = false
activate :minify_css
"""
And the Server is running at "minify-css-app"
@ -25,29 +28,44 @@ Feature: Minify CSS
Then I should see "1" lines
When I go to "/stylesheets/report.css"
Then I should see "p{border:1px solid #ff6600}"
Scenario: Rendering external css in a proxied resource
Given a fixture app "minify-css-app"
And a file named "config.rb" with:
"""
config[:sass_source_maps] = false
activate :minify_css
proxy '/css-proxy', '/stylesheets/site.css', ignore: true
"""
And the Server is running at "minify-css-app"
When I go to "/css-proxy"
Then I should see "1" lines
And I should see "only screen and (device-width"
Scenario: Rendering external css with passthrough compressor
Given a fixture app "passthrough-app"
And a file named "config.rb" with:
"""
config[:sass_source_maps] = false
module ::PassThrough
def self.compress(data)
data
end
end
activate :minify_css
set :css_compressor, ::PassThrough
activate :minify_css, compressor: ::PassThrough
"""
And the Server is running at "passthrough-app"
When I go to "/stylesheets/site.css"
Then I should see "46" lines
Then I should see "5" lines
Scenario: Rendering inline css with the feature disabled
Given a fixture app "minify-css-app"
And a file named "config.rb" with:
"""
config[:sass_source_maps] = false
"""
And the Server is running at "minify-css-app"
When I go to "/inline-css.html"
@ -60,22 +78,22 @@ Feature: Minify CSS
}
</style>
"""
Scenario: Rendering inline css with a passthrough minifier
Given a fixture app "passthrough-app"
And a file named "config.rb" with:
"""
config[:sass_source_maps] = false
module ::PassThrough
def self.compress(data)
data
end
end
activate :minify_css, :inline => true
activate :minify_css, inline: true, compressor: ::PassThrough
set :css_compressor, ::PassThrough
page "/inline-css.html", :layout => false
page "/inline-css.html", layout: false
"""
And the Server is running at "passthrough-app"
When I go to "/inline-css.html"
@ -92,15 +110,17 @@ Feature: Minify CSS
Given a fixture app "passthrough-app"
And a file named "config.rb" with:
"""
config[:sass_source_maps] = false
module ::HelloCompressor
def self.compress(data)
"Hello"
end
end
activate :minify_css, :inline => true, :compressor => ::HelloCompressor
activate :minify_css, inline: true, compressor: ::HelloCompressor
page "/inline-css.html", :layout => false
page "/inline-css.html", layout: false
"""
And the Server is running at "passthrough-app"
When I go to "/inline-css.html"
@ -110,12 +130,14 @@ Feature: Minify CSS
Hello
</style>
"""
Scenario: Rendering inline css with the feature enabled
Given a fixture app "minify-css-app"
And a file named "config.rb" with:
"""
activate :minify_css, :inline => true
config[:sass_source_maps] = false
activate :minify_css, inline: true
"""
And the Server is running at "minify-css-app"
When I go to "/inline-css.html"
@ -124,4 +146,60 @@ Feature: Minify CSS
<style>
body{test:style;good:deal}
</style>
"""
"""
Scenario: Rendering inline css in a PHP document
Given a fixture app "minify-css-app"
And a file named "config.rb" with:
"""
config[:sass_source_maps] = false
activate :minify_css, inline: true
"""
And the Server is running at "minify-css-app"
When I go to "/inline-css.php"
Then I should see:
"""
<?='Hello'?>
<style>
body{test:style;good:deal}
</style>
"""
Scenario: Rendering inline css in a proxied resource
Given a fixture app "minify-css-app"
And a file named "config.rb" with:
"""
config[:sass_source_maps] = false
activate :minify_css, inline: true
proxy '/inline-css-proxy', '/inline-css.html', ignore: true
"""
And the Server is running at "minify-css-app"
When I go to "/inline-css-proxy"
Then I should see:
"""
<style>
body{test:style;good:deal}
</style>
"""
@preserve_mime_types
Scenario: Configuring content types of resources to be minified
Given a fixture app "minify-css-app"
And a file named "config.rb" with:
"""
config[:sass_source_maps] = false
mime_type('.xcss', 'text/x-css')
activate :minify_css, content_types: ['text/x-css'],
inline: true,
inline_content_types: ['text/html']
"""
And the Server is running at "minify-css-app"
When I go to "/stylesheets/site.xcss"
Then I should see "1" lines
And I should see "only screen and (device-width"
When I go to "/inline-css.php"
Then I should see "8" lines

View File

@ -38,7 +38,7 @@ Feature: Minify Javascript
I'm a jQuery {{template}}.
</script>
"""
Scenario: Rendering inline js with a passthrough minifier
Given a fixture app "passthrough-app"
And a file named "config.rb" with:
@ -49,11 +49,9 @@ Feature: Minify Javascript
end
end
activate :minify_javascript, :inline => true
activate :minify_javascript, inline: true, compressor: ::PassThrough
set :js_compressor, ::PassThrough
page "/inline-js.html", :layout => false
page "/inline-js.html", layout: false
"""
And the Server is running at "passthrough-app"
When I go to "/inline-js.html"
@ -88,7 +86,7 @@ Feature: Minify Javascript
</script>
"""
Scenario: Rendering inline css with a passthrough minifier using activate-style compressor
Scenario: Rendering inline JS with a passthrough minifier using activate-style compressor
Given a fixture app "passthrough-app"
And a file named "config.rb" with:
"""
@ -98,9 +96,9 @@ Feature: Minify Javascript
end
end
activate :minify_javascript, :inline => true, :compressor => ::HelloCompressor
activate :minify_javascript, inline: true, compressor: ::HelloCompressor
page "/inline-js.html", :layout => false
page "/inline-js.html", layout: false
"""
And the Server is running at "passthrough-app"
When I go to "/inline-js.html"
@ -121,12 +119,12 @@ Feature: Minify Javascript
I'm a jQuery {{template}}.
</script>
"""
Scenario: Rendering inline js with the feature enabled
Given a fixture app "minify-js-app"
And a file named "config.rb" with:
"""
activate :minify_javascript, :inline => true
activate :minify_javascript, inline: true
"""
And the Server is running at "minify-js-app"
When I go to "/inline-js.html"
@ -140,14 +138,50 @@ Feature: Minify Javascript
</script>
<script type='text/javascript'>
//<!--
!function(){line(),here()}();
!function(){one,line(),here()}();
//-->
</script>
<script type='text/html'>
I'm a jQuery {{template}}.
</script>
"""
Scenario: Rendering inline js in a PHP document
Given a fixture app "minify-js-app"
And a file named "config.rb" with:
"""
activate :minify_javascript, inline: true
"""
And the Server is running at "minify-js-app"
When I go to "/inline-js.php"
Then I should see:
"""
<?='Hello'?>
<script>
!function(){should(),all.be(),on={one:line}}();
</script>
<script type='text/javascript'>
//<!--
!function(){one,line(),here()}();
//-->
</script>
<script type='text/html'>
I'm a jQuery {{template}}.
</script>
"""
Scenario: Rendering inline js in a proxied resource
Given a fixture app "minify-js-app"
And a file named "config.rb" with:
"""
activate :minify_javascript, inline: true
proxy '/inline-js-proxy', '/inline-js.html', ignore: true
"""
And the Server is running at "minify-js-app"
When I go to "/inline-js-proxy"
Then I should see "14" lines
Scenario: Rendering external js with the feature enabled
Given a fixture app "minify-js-app"
And a file named "config.rb" with:
@ -159,7 +193,18 @@ Feature: Minify Javascript
Then I should see "1" lines
When I go to "/more-js/other.js"
Then I should see "1" lines
Scenario: Rendering external js in a proxied resource
Given a fixture app "minify-js-app"
And a file named "config.rb" with:
"""
activate :minify_javascript
proxy '/js-proxy', '/javascripts/js_test.js', ignore: true
"""
And the Server is running at "minify-js-app"
When I go to "/js-proxy"
Then I should see "1" lines
Scenario: Rendering external js with a passthrough minifier
And the Server is running at "passthrough-app"
When I go to "/javascripts/js_test.js"
@ -169,12 +214,12 @@ Feature: Minify Javascript
Given a fixture app "minify-js-app"
And a file named "config.rb" with:
"""
activate :minify_javascript, :inline => true
activate :minify_javascript, inline: true
"""
And the Server is running at "minify-js-app"
When I go to "/inline-coffeescript.html"
Then I should see "3" lines
Scenario: Rendering external js (coffeescript) with the feature enabled
Given a fixture app "minify-js-app"
And a file named "config.rb" with:
@ -184,7 +229,7 @@ Feature: Minify Javascript
And the Server is running at "minify-js-app"
When I go to "/javascripts/coffee_test.js"
Then I should see "1" lines
Scenario: Rendering inline js (coffeescript) with a passthrough minifier
Given a fixture app "passthrough-app"
And a file named "config.rb" with:
@ -195,16 +240,14 @@ Feature: Minify Javascript
end
end
activate :minify_javascript, :inline => true
activate :minify_javascript, inline: true, compressor: ::PassThrough
set :js_compressor, ::PassThrough
page "/inline-coffeescript.html", :layout => false
page "/inline-coffeescript.html", layout: false
"""
And the Server is running at "passthrough-app"
When I go to "/inline-coffeescript.html"
Then I should see "13" lines
Scenario: Rendering external js (coffeescript) with a passthrough minifier
Given a fixture app "passthrough-app"
And a file named "config.rb" with:
@ -215,11 +258,9 @@ Feature: Minify Javascript
end
end
activate :minify_javascript
set :js_compressor, ::PassThrough
activate :minify_javascript, compressor: ::PassThrough
"""
And the Server is running at "passthrough-app"
When I go to "/javascripts/coffee_test.js"
Then I should see "11" lines

Some files were not shown because too many files have changed in this diff Show More