Compare commits
453 Commits
remove_hoo
...
master
Author | SHA1 | Date |
---|---|---|
Thomas Reynolds | b6167b1369 | |
Thomas Reynolds | 30217d2c04 | |
Thomas Reynolds | 073f273fe4 | |
Thomas Reynolds | e30f413376 | |
Stanislav | a680fb30c5 | |
Jonathan Allard | 42e31c8c5e | |
sandstrom | 046d15cfa5 | |
Thomas Reynolds | 5adea781c9 | |
James Pearson | 97082d5fc4 | |
René Klačan | 604c0e2b5d | |
Mike Vastola | 7c968b9572 | |
Kevin Glowacz | 197093b36c | |
Kevin Glowacz | ea2115f3f8 | |
Thomas Reynolds | 07651c63a6 | |
Mark Rowe | 65462cbc43 | |
Eliott Appleford | c264b05906 | |
Mark Rowe | dcd36a4f99 | |
Thomas Reynolds | 7027b4933a | |
Peter Sankauskas | cbad571338 | |
sandstrom | ffef14deb4 | |
Thomas Reynolds | 62dba443a0 | |
Adam Heath | 389e3f5a8c | |
Thomas Reynolds | ea39d16d81 | |
Peter Suschlik | 1581bfc27e | |
Thomas Reynolds | e8f10fe3c2 | |
Thomas Reynolds | 1efa585c11 | |
Shawn Van Ittersum | 0d5c9e4313 | |
Thomas Reynolds | 51ccfe1143 | |
Thomas Reynolds | 4ffaa9dde5 | |
Thomas Reynolds | 6440d53e7a | |
Ben Hollis | 38a9025560 | |
Steven Sloan | 5de9e86a55 | |
Thomas Reynolds | ccc1cc1288 | |
Thomas Reynolds | 849fc65260 | |
Matthew Lehner | 3e4187568b | |
PiotrMisiurek | 1c57626445 | |
Steven Sloan | cf4d40caff | |
Dennis Günnewig | 599cf1e6d3 | |
Thomas Reynolds | 3ebd902ec3 | |
Thomas Reynolds | 158c3e9f25 | |
Thomas Reynolds | cdcd2bd42d | |
Thomas Bruketta | 4918704800 | |
Nick Giancola | 8a8ee768ac | |
Thomas Reynolds | 71a20bb3ee | |
Daniel Bayerlein | ce58073539 | |
Thomas Reynolds | 13d62cb276 | |
Thomas Reynolds | 0f2bc1e0ea | |
Thomas Reynolds | a14934e08b | |
Morton Fox | a95f721490 | |
Thomas Reynolds | 2b0f720850 | |
Thomas Reynolds | b386dcdc40 | |
Thomas Reynolds | 0ac5650229 | |
Thomas Reynolds | 7e3baed196 | |
Thomas Reynolds | 09a7d89fd3 | |
Thomas Reynolds | 6872e07d34 | |
Thomas Reynolds | a01656df39 | |
Thomas Reynolds | f2535f4fda | |
Thomas Reynolds | dd2413857e | |
Thomas Reynolds | b058d26564 | |
Thomas Reynolds | b794961916 | |
Thomas Reynolds | 4791e01f10 | |
Thomas Reynolds | ac974ca05f | |
Thomas Reynolds | c7669609e6 | |
Thomas Reynolds | e99649b33e | |
Thomas Reynolds | ec213efb95 | |
Joshua Lusk | 21f4f40e21 | |
Thomas Reynolds | 16c82fe57a | |
Thomas Reynolds | 058a63a0de | |
Thomas Reynolds | 49da6156a0 | |
Thomas Reynolds | 3cbd9fdede | |
Thomas Reynolds | 7ae8e904a6 | |
Thomas Reynolds | 55230229f6 | |
Jim Derry | 9e774b608a | |
Thomas Reynolds | b950af89ac | |
Thomas Reynolds | 5a2f9c8ca6 | |
Thomas Reynolds | bca8b854dd | |
Thomas Reynolds | ebc2baa13f | |
Brad Gessler | 179d6c0be4 | |
Thomas Reynolds | 2701bede2a | |
James | cc25c784f9 | |
Thomas Reynolds | 9d29cd58de | |
Adam Heath | 025e35f6a1 | |
FearGoidte | f5a668d380 | |
Thomas Reynolds | 0df7f0d6ac | |
FearGoidte | d461473f81 | |
Thomas Reynolds | 8425692b86 | |
Thomas Reynolds | aab7bac8a6 | |
Thomas Reynolds | 7e42954258 | |
Thomas Reynolds | 02a0b557f6 | |
Gregory McIntyre | d539d4aa3d | |
Gregory McIntyre | 0436c211c6 | |
Thomas Reynolds | d22bd914ae | |
Thomas Reynolds | dfa389bde4 | |
Thomas Reynolds | 5337d0640b | |
Thomas Reynolds | 7484c9f242 | |
Gregory McIntyre | 563da9d45b | |
Thomas Reynolds | 0904652c6f | |
Thomas Reynolds | 1f3bf47e3c | |
Thomas Reynolds | d624dc4601 | |
Thomas Reynolds | 260a9cd94c | |
Greg Tarsa | fbc572f920 | |
Thomas Reynolds | 737e6f5e64 | |
Thomas Reynolds | 7b59f240d5 | |
Thomas Reynolds | c44f7482b1 | |
Thomas Reynolds | e14107ba65 | |
Thomas Reynolds | d776f07bfc | |
Adam Heath | d883152e99 | |
Thomas Reynolds | 0d983231d0 | |
Thomas Reynolds | 4733488e8d | |
Thomas Reynolds | edb1a53060 | |
Thomas Reynolds | b695f6da1e | |
Thomas Reynolds | e36fd3f476 | |
Thomas Reynolds | eaac03ab4b | |
Adam Heath | 351003b4fe | |
Thomas Reynolds | 476287452d | |
Steven Sloan | fc0f5d24d6 | |
Thomas Reynolds | a24e5986a2 | |
Melvin Lammerts | b7886aa14c | |
Thomas Reynolds | 6c8fc2ee07 | |
Jim Cushing | 7bd417fad1 | |
Thomas Reynolds | d7967a86bb | |
Jim Cushing | b1778a92cd | |
Thomas Reynolds | a2181a2fd9 | |
Thomas Reynolds | 6de25dfd0e | |
Thomas Reynolds | f596d8ebf5 | |
Thomas Reynolds | 3f18efeed9 | |
Thomas Reynolds | c5aabbbe4f | |
Thomas Reynolds | 598d72480f | |
Thomas Reynolds | 8c27d9a2e7 | |
FearGoidte | d863733160 | |
FearGoidte | 13c351f2bf | |
James | 17f5f19002 | |
FearGoidte | 007c626d58 | |
Thomas Reynolds | e169d3d07e | |
Jim Dalton | cc36267de5 | |
FearGoidte | 475fa41de0 | |
Thomas Reynolds | 2bba7888b0 | |
Thomas Reynolds | 0c29fd4abf | |
Thomas Reynolds | 9553796731 | |
Thomas Reynolds | 24ef35026e | |
Ben Hollis | 8881389b42 | |
Thomas Reynolds | e7d9c8ad0e | |
Thomas Reynolds | deae5d2216 | |
Thomas Reynolds | 4deaa65a6d | |
Thomas Reynolds | c7a4618166 | |
Thomas Reynolds | b8c0fd34e7 | |
Thomas Reynolds | e0818e2118 | |
Thomas Reynolds | 4e8273295b | |
Thomas Reynolds | 92d96f6604 | |
Thomas Reynolds | 8bacc35bf2 | |
Jim Dalton | 68127003b9 | |
Thomas Reynolds | 5586784947 | |
Thomas Reynolds | 6d1c3562a7 | |
Thomas Reynolds | ffa662a917 | |
Thomas Reynolds | 827d5fbb1d | |
Thomas Reynolds | 2864902fa0 | |
Thomas Reynolds | 6077ae43e9 | |
Thomas Reynolds | 65aebc1887 | |
Thomas Reynolds | 801a83f7cb | |
Thomas Reynolds | c2999786ee | |
Thomas Reynolds | 2b88773640 | |
Thomas Reynolds | 7bf4e4681f | |
Juhamatti Niemelä | 22812cb340 | |
Thomas Reynolds | 732ac7cbe9 | |
Jim Dalton | dc3eac9e96 | |
Thomas Reynolds | 03c95f0863 | |
Thomas Reynolds | 5529062bc4 | |
Thomas Reynolds | a47b2138f8 | |
Thomas Reynolds | be2788b6ca | |
Thomas Reynolds | ff9c34bca9 | |
Thomas Reynolds | d82ac590db | |
Thomas Reynolds | 5f8beba4b3 | |
Thomas Reynolds | c213bd19df | |
Thomas Reynolds | 8daa5eba3e | |
Thomas Reynolds | 18e4ee41d0 | |
Thomas Reynolds | 95c7a53291 | |
Thomas Reynolds | 56d71fe7d6 | |
Jim Dalton | f954415c95 | |
Thomas Reynolds | edd5eb2057 | |
Thomas Reynolds | 7bc9e03642 | |
Thomas Reynolds | 179268a4f6 | |
Thomas Reynolds | 8f66077dd0 | |
Thomas Reynolds | 98fe7ce7d2 | |
Thomas Reynolds | c6401f1cd9 | |
Thomas Reynolds | 5cac6a1896 | |
Thomas Reynolds | b4a6a503b3 | |
Thomas Reynolds | 47d0e1cb7b | |
Thomas Reynolds | 4243676073 | |
Nathan Feaver | 17df162e7b | |
Thomas Reynolds | 46ca147560 | |
Nick Muerdter | 37be89ed68 | |
Nick Muerdter | 0563523a81 | |
Thomas Reynolds | 1e8080b44c | |
Thomas Reynolds | a0105c9b48 | |
Tiou Lims | a7631b2f0d | |
Johnny Shields | 133c02d05c | |
Thomas Reynolds | 1605f425e8 | |
Thomas Reynolds | bfb6a7fa16 | |
Thomas Reynolds | 41212d7fa3 | |
Thomas Reynolds | 62b17d38ad | |
Thomas Reynolds | fed3fae6bb | |
Ulrich Gabor | 298b3909ed | |
Ulrich Gabor | 1ca5be7b19 | |
Ulrich Gabor | bdeb19059a | |
Dennis Günnewig | b0a4d53963 | |
Thomas Reynolds | 5684caeee6 | |
Thomas Reynolds | 03e13c5a26 | |
Thomas Reynolds | da1f3f7af6 | |
Ben Hollis | 9311a72e4a | |
Ben Hollis | 412f6ac1fc | |
Ben Hollis | d464162e8e | |
Ryunosuke SATO | e56227c945 | |
Ryunosuke SATO | 2dcd2c5b1d | |
Thomas Reynolds | 3b596d5e3e | |
Ryunosuke SATO | 3fdd963923 | |
Thomas Reynolds | 4a8cd4c3d2 | |
Thomas Reynolds | a5821bccec | |
Thomas Reynolds | ba0416b330 | |
Thomas Reynolds | 6aeda854c0 | |
Thomas Reynolds | 5d0f12e6ca | |
jordanandree | e035d625c8 | |
Thomas Reynolds | b2b461935d | |
Thomas Reynolds | 9e5b137ed8 | |
Thomas Reynolds | 6af784d5d5 | |
Thomas Reynolds | 0e620a1ba1 | |
Johnny Shields | 308ea6db5a | |
Thomas Reynolds | 79b5e82b3c | |
Jim Dalton | f3296815c8 | |
Thomas Reynolds | 4122bd7351 | |
Thomas Reynolds | defa6daa6d | |
Thomas Reynolds | 82220eab4e | |
Thomas Reynolds | 3c1d28ce1b | |
Thomas Reynolds | 01f899f529 | |
Thomas Reynolds | b6befd3fc3 | |
Thomas Reynolds | bb0f11d002 | |
Thomas Reynolds | 28a0071be7 | |
Thomas Reynolds | 76f591788e | |
Thomas Reynolds | d3a5494062 | |
Thomas Reynolds | 658b28c337 | |
Thomas Reynolds | 2674981d0b | |
Thomas Reynolds | 9b0b82c00b | |
Thomas Reynolds | cb6e8bcd95 | |
Thomas Reynolds | 2178a755e2 | |
Thomas Reynolds | 7b3f5384e9 | |
Thomas Reynolds | 07a216d5ca | |
Thomas Reynolds | e9b3a8abe4 | |
Thomas Reynolds | 578ff18fa0 | |
Thomas Reynolds | ae15d203a8 | |
Thomas Reynolds | e47b0ae29a | |
Thomas Reynolds | 16b997498b | |
Thomas Reynolds | a546e0f523 | |
Thomas Reynolds | f2db1567a4 | |
Thomas Reynolds | 309733b067 | |
Thomas Reynolds | 6de88a832e | |
Thomas Reynolds | b4697e4541 | |
Thomas Reynolds | dd0ee24ca3 | |
Zac Pullar-Strecker | e23bd151bf | |
Thomas Reynolds | 822a9f0ecc | |
Thomas Reynolds | 4594f46fb8 | |
Thomas Reynolds | b0582bcebf | |
Johnny Shields | 13a14d43d4 | |
Thomas Reynolds | 45939e7e93 | |
Steven Sloan | 6ab6669456 | |
Steven Sloan | 49a7435dc9 | |
Steven Sloan | f16fc2229e | |
Thomas Reynolds | 37d96a9b14 | |
Thomas Reynolds | 169b6f2c0a | |
Thomas Reynolds | fbf77d2ad2 | |
Dennis Günnewig | 022779ef27 | |
Dennis Günnewig | ce998cf685 | |
Dennis Günnewig | 8c7e156bd4 | |
Thomas Reynolds | 916a5a508b | |
Thomas Reynolds | b4457c98d2 | |
Thomas Reynolds | 684a80c906 | |
Thomas Reynolds | 90490d696f | |
Dennis Günnewig | 0f8ea86119 | |
Dennis Günnewig | a61b2e3b87 | |
Thomas Reynolds | ec99a7b28f | |
Dan Allen | c48c81cbba | |
Thomas Reynolds | 30e37293b3 | |
Thomas Reynolds | 765c28114a | |
Dan Allen | 4995bd23d7 | |
Dan Allen | c07af953f8 | |
Eliott Appleford | 19d21d2295 | |
Thomas Reynolds | 3cd84eb4d1 | |
Thomas Reynolds | 62d7fa0676 | |
Thomas Reynolds | d2251de898 | |
Thomas Reynolds | 6357f4f5b8 | |
Thomas Reynolds | eb82f402a0 | |
Thomas Reynolds | f4bff73b7b | |
yuuji.yaginuma | e26f83e1c2 | |
Thomas Reynolds | e9abfe1134 | |
inoue_sachiro | 67fc3d0c05 | |
Thomas Reynolds | fd6a2376bd | |
Thomas Reynolds | d828067189 | |
Thomas Reynolds | 0698d7f5aa | |
Eliott Appleford | 9686c1ec7a | |
Eliott Appleford | b389c26b4e | |
Eliott Appleford | 9df1a45301 | |
Thomas Reynolds | 5e3ddbf988 | |
Thomas Reynolds | d9fc7a95e1 | |
Thomas Reynolds | 04c133c90f | |
Thomas Reynolds | 32891dc6fe | |
Eliott Appleford | 97cd1c1411 | |
Thomas Reynolds | fe66beacc3 | |
Eliott Appleford | ddc4a3cabc | |
Thomas Reynolds | 5afc138eb8 | |
Eliott Appleford | 47bdcb2d9c | |
Eliott Appleford | 11fc90f93c | |
Eliott Appleford | 91a06a1a35 | |
Eliott Appleford | 62f431b5ae | |
Thomas Reynolds | d3d32731e1 | |
Thomas Reynolds | 765de5ab11 | |
Thomas Reynolds | 3e1fc0aa1f | |
Thomas Reynolds | 3ae28874bf | |
Thomas Reynolds | 2907761556 | |
Thomas Reynolds | fdabd87957 | |
Thomas Reynolds | 409a892da7 | |
Thomas Reynolds | a251c82562 | |
Thomas Reynolds | 2b2ee10d81 | |
Thomas Reynolds | 260c6be66c | |
Thomas Reynolds | ed405b266f | |
Thomas Reynolds | 8c02eb2a26 | |
Thomas Reynolds | d99b922e67 | |
Thomas Reynolds | 40f023f01c | |
Thomas Reynolds | 441dc2faa6 | |
Thomas Reynolds | 8a349322ac | |
Rafał Komorowski | 0d4d82a01a | |
Thomas Reynolds | d849930e51 | |
Thomas Reynolds | 7a28fd0a50 | |
Thomas Reynolds | 5cab7c46a9 | |
Thomas Reynolds | 60d88139af | |
Brad Gessler | 8bdeab50ee | |
Thomas Reynolds | f76561d101 | |
Thomas Reynolds | 9ed0796b4a | |
Thomas Reynolds | 3485f49f74 | |
Thomas Reynolds | 0861fad2e1 | |
Thomas Reynolds | 241fe69f7d | |
Thomas Reynolds | 9886e04a95 | |
Thomas Reynolds | 226099d64e | |
Thomas Reynolds | 50bf848ee8 | |
Thomas Reynolds | bb6b8c7f13 | |
Thomas Reynolds | 23cf612dd9 | |
Thomas Reynolds | fb6bca234f | |
Thomas Reynolds | ee5e8ff4a1 | |
Jim Dalton | 1a3f96b58f | |
Thomas Reynolds | 8cce9b8a8c | |
Thomas Reynolds | dcbeb7dc76 | |
Thomas Reynolds | b0c90e1192 | |
Max Meyer | dc4057d8dc | |
Thomas Reynolds | 0fba2ae2f6 | |
Thomas Reynolds | 837a679aa7 | |
Thomas Reynolds | a528659034 | |
Thomas Reynolds | 7bfacd565a | |
Dennis Günnewig | 63e9cd9b5f | |
Thomas Reynolds | c69099c451 | |
Thomas Reynolds | 0a8ceb24b0 | |
Thomas Reynolds | 1d69bcd4bc | |
Mauro Otonelli | dcc52d967c | |
Mauro Otonelli | c11a9e6f39 | |
Eliott Appleford | 4364d754a5 | |
Thomas Reynolds | d2f8dc9932 | |
Thomas Reynolds | df13c62a6b | |
Mauro Otonelli | 68a6eacc33 | |
Thomas Reynolds | 55f909d9cf | |
Eliott Appleford | a855b634e6 | |
Mauro Otonelli | d18e5ed973 | |
Mauro Otonelli | 63d6a00ed9 | |
Mauro Otonelli | c14fd72d04 | |
Max Meyer | 6aa7ce741a | |
Max Meyer | 232aca91bc | |
Thomas Reynolds | 724e249b49 | |
Thomas Reynolds | 9abcdaa7f7 | |
Thomas Reynolds | 8bbda9ea7b | |
Thomas Reynolds | 709a0d1a6c | |
Thomas Reynolds | 3fca2c6961 | |
Thomas Reynolds | 1efe6a27c5 | |
Thomas Reynolds | 7383f67874 | |
Thomas Reynolds | e09f7fadb5 | |
Eliott Appleford | 3cbe2acaf7 | |
Eliott Appleford | 70d4671d2c | |
Thomas Reynolds | c0ddf15add | |
Todd Fisher | ae2d1487fa | |
Thomas Reynolds | 6562716aa5 | |
Thomas Reynolds | 3e46e8139f | |
Thomas Reynolds | bb44e59e6e | |
Thomas Reynolds | 915b059e4a | |
Max Meyer | 3935a7cf5f | |
Thomas Reynolds | b2cb90c20f | |
Thomas Reynolds | a38a20322f | |
Thomas Reynolds | 5630395b40 | |
Thomas Reynolds | ca8655744a | |
Thomas Reynolds | 5e30ef98a1 | |
Thomas Reynolds | 68adbfeb2a | |
Thomas Reynolds | 81a77828bd | |
Thomas Reynolds | 7eedf6b28f | |
François Vantomme | d7d37e4ae0 | |
Eliott Appleford | 3b88496803 | |
Thomas Reynolds | f5fe46cb59 | |
Shin'ya Ueoka | 43211d1bc6 | |
Thomas Reynolds | d842023903 | |
Thomas Reynolds | bca04841fe | |
Shin'ya Ueoka | 407a17bc77 | |
Ryan McGeary | 2875dbec2a | |
Eliott Appleford | f2f82a4ff9 | |
Luís Ferreira | af2e90cb0a | |
Thomas Reynolds | a25e9c6382 | |
Thomas Reynolds | f7ba4ada20 | |
Thomas Reynolds | d3c7436647 | |
Thomas Reynolds | 6502b37934 | |
Thomas Reynolds | ed5236ef37 | |
Thomas Reynolds | b20d855f2c | |
Thomas Reynolds | 651b5fc1c3 | |
Thomas Reynolds | 9de1f16f3b | |
Thomas Reynolds | 72916dec13 | |
Paulo | f2f8a42f00 | |
Paulo | 647ec149ca | |
Ben Hollis | 28498b2fbe | |
Ben Hollis | 6afda2a34c | |
Thomas Reynolds | 74c2413c20 | |
Dennis Günnewig | fd88e50db6 | |
Dennis Günnewig | 1a23ab3938 | |
Dennis Günnewig | 9741c68d34 | |
Ben Hollis | 38e5fde04e | |
Thomas Reynolds | 70dd18e8f1 | |
Thomas Reynolds | 211f1b5a85 | |
yterajima | 013b4a8394 | |
Thomas Reynolds | 051f102aa0 | |
Eliott Appleford | 588f42f1df | |
yterajima | c444b3f232 | |
Eliott Appleford | 27684e2ef3 | |
Thomas Reynolds | 486d34a2c1 | |
Thomas Reynolds | 4626193f97 | |
Thomas Reynolds | 9d3c30ee53 | |
Thomas Reynolds | cee53d0f2d | |
Thomas Reynolds | ee0f9f00f5 | |
Thomas Reynolds | de5234818d | |
Thomas Reynolds | 08c3969eb3 | |
Ben Hollis | 9f5080edf9 | |
Ben Hollis | 08dee580aa | |
Thomas Reynolds | 69e66b04df | |
Thomas Reynolds | bd67f8ad0e | |
Thomas Reynolds | e64954fbff | |
Ben Hollis | 126888272c | |
Ben Hollis | cf58acda30 | |
Karl Freeman | f366325b3b | |
Ben Hollis | f8e4f6f059 | |
Thomas Reynolds | 9932d0da84 | |
Thomas Reynolds | d1211cc089 | |
Ben Hollis | 572f86985b | |
Thomas Reynolds | 2b1a4ed1b8 | |
Simon-Pierre LeBel | 4e88a66083 | |
Andrew Kvalheim | 049dabbf15 |
|
@ -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
|
|
@ -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.
|
|
@ -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
|
||||
|
|
26
.rubocop.yml
26
.rubocop.yml
|
@ -10,11 +10,13 @@ AllCops:
|
|||
- '**/tmp/**/*'
|
||||
- '**/bin/**/*'
|
||||
- 'middleman-core/lib/middleman-core/step_definitions/**/*'
|
||||
- 'middleman-core/lib/vendored-middleman-deps/**/*'
|
||||
- 'middleman-cli/lib/middleman-templates/**/*'
|
||||
- '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:
|
||||
|
@ -25,14 +27,10 @@ ClassLength:
|
|||
Enabled: false
|
||||
Documentation:
|
||||
Enabled: false
|
||||
Encoding:
|
||||
Enabled: false
|
||||
HashSyntax:
|
||||
EnforcedStyle: ruby19
|
||||
SpaceAroundEqualsInParameterDefault:
|
||||
EnforcedStyle: no_space
|
||||
BlockDelimiters:
|
||||
Enabled: false
|
||||
PerlBackrefs:
|
||||
Enabled: false
|
||||
ClassAndModuleChildren:
|
||||
|
@ -41,8 +39,6 @@ AssignmentInCondition:
|
|||
Enabled: false
|
||||
CyclomaticComplexity:
|
||||
Enabled: false
|
||||
AbcSize:
|
||||
Enabled: false
|
||||
HandleExceptions:
|
||||
Enabled: false
|
||||
EndAlignment:
|
||||
|
@ -56,8 +52,20 @@ FormatString:
|
|||
CaseIndentation:
|
||||
IndentWhenRelativeTo: end
|
||||
TrivialAccessors:
|
||||
ExactNameMatch: true
|
||||
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
|
||||
|
|
14
.travis.yml
14
.travis.yml
|
@ -5,25 +5,19 @@ before_script:
|
|||
- bundle update
|
||||
rvm:
|
||||
- ruby-head
|
||||
- jruby-head
|
||||
- jruby-19mode
|
||||
- 2.2
|
||||
- 2.1
|
||||
- 2.0
|
||||
- 2.3.1
|
||||
- 2.2.4
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
# - osx
|
||||
matrix:
|
||||
fast_finish: true
|
||||
allow_failures:
|
||||
- rvm: ruby-head
|
||||
- rvm: jruby-19mode
|
||||
- rvm: jruby-head
|
||||
env:
|
||||
global:
|
||||
- JRUBY_OPTS='-J-Xmx1024M'
|
||||
- TEST=true
|
||||
- CODECLIMATE_REPO_TOKEN=81787f7b1c3bfa937edadcafbc94f807bf5af5c1142c7b793f2d9969a271de1f
|
||||
- CODECLIMATE_REPO_TOKEN=81787f7b1c3bfa937edadcafbc94f807bf5af5c1142c7b793f2d9969a271de1f
|
||||
script: bundle exec rake test
|
||||
notifications:
|
||||
slack: middleman:JW9OvXmn1m3XrSERe8866nBR
|
||||
|
|
128
CHANGELOG.md
128
CHANGELOG.md
|
@ -1,10 +1,135 @@
|
|||
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_templates`, which auto binds copies of extension-local methods into a Template context.
|
||||
* 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.
|
||||
|
@ -33,3 +158,4 @@ master
|
|||
* Remove deprecated `request` instance
|
||||
* Remove old module-style extension support
|
||||
* Placed all `config.rb` evaluation inside the `ConfigContext` class
|
||||
* 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`
|
||||
|
|
32
Gemfile
32
Gemfile
|
@ -5,25 +5,34 @@ gem 'rake', '~> 10.3', require: false
|
|||
gem 'yard', '~> 0.8', require: false
|
||||
|
||||
# Test tools
|
||||
gem 'pry', '~> 0.10', group: :development, require: false
|
||||
gem 'pry-byebug'
|
||||
gem 'pry-stack_explorer'
|
||||
gem 'aruba', '~> 0.6', require: false
|
||||
gem 'byebug'
|
||||
gem 'aruba', '~> 0.7.4', require: false
|
||||
gem 'rspec', '~> 3.0', require: false
|
||||
gem 'fivemat', '~> 1.3', require: false
|
||||
gem 'cucumber', '~> 1.3', 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.5', require: false
|
||||
gem 'sassc', '~> 1.8', require: false
|
||||
gem 'coffee-script', '~> 2.2', require: false
|
||||
gem 'kramdown', '~> 1.2', require: false
|
||||
gem 'less', '2.3', require: false
|
||||
gem 'slim', '>= 2.0', require: false
|
||||
gem 'liquid', '>= 2.6', require: false
|
||||
gem 'stylus', '>= 1.0', require: false
|
||||
gem 'sinatra', '>= 1.4', require: false
|
||||
gem 'redcarpet', '>= 3.1', require: false unless RUBY_ENGINE == 'jruby'
|
||||
gem 'asciidoctor', '~> 0.1', require: false
|
||||
gem 'sinatra', '>= 2.0.0.beta2', require: false
|
||||
gem 'redcarpet', '>= 3.1', require: false
|
||||
|
||||
# Dns server to test preview server
|
||||
gem 'rubydns', '~> 1.0.1', require: false
|
||||
|
||||
# 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
|
||||
|
@ -31,12 +40,13 @@ gem 'therubyracer', '>= 0.12', platforms: :ruby
|
|||
|
||||
# Code Quality
|
||||
gem 'rubocop', '~> 0.24', require: false
|
||||
gem 'simplecov', '~> 0.9', 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-cli', path: 'middleman-cli'
|
||||
gem 'middleman-core', path: 'middleman-core'
|
||||
|
||||
# gem 'middleman-compass', github: 'middleman/middleman-compass', require: false
|
||||
# gem 'middleman-sprockets', github: 'middleman/middleman-sprockets', require: false
|
||||
|
|
|
@ -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:
|
|
@ -10,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?
|
||||
|
@ -19,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
|
||||
|
@ -91,7 +91,7 @@ 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
|
||||
|
||||
|
@ -121,5 +121,6 @@ Copyright (c) 2010-2015 Thomas Reynolds. MIT Licensed, see [LICENSE] for details
|
|||
[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
|
||||
|
|
11
Rakefile
11
Rakefile
|
@ -1,10 +1,9 @@
|
|||
require 'rubygems' unless defined?(Gem)
|
||||
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-cli middleman)
|
||||
GEM_PATHS = middleman_gems.freeze
|
||||
|
@ -37,7 +36,7 @@ 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
|
||||
|
||||
|
@ -46,16 +45,14 @@ 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
|
||||
|
||||
Rake::Task['rubocop'].invoke
|
||||
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
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
require 'rubygems' unless defined?(Gem)
|
||||
require 'rake'
|
||||
require 'yard'
|
||||
|
||||
|
@ -21,15 +20,14 @@ Cucumber::Rake::Task.new do |t|
|
|||
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)
|
||||
exempt_tags << '--tags ~@nowindows' if Gem.win_platform?
|
||||
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
|
||||
|
||||
require 'rspec/core/rake_task'
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -4,11 +4,37 @@ 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
|
||||
|
@ -19,5 +45,26 @@ 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(ARGV)
|
||||
|
|
|
@ -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 |
|
|
@ -57,11 +57,15 @@ Feature: Middleman CLI
|
|||
Then a directory named "MY_PROJECT" should exist
|
||||
|
||||
Scenario: Create a new project using Middleman directory
|
||||
When I run `middleman init MY_PROJECT -T amicus`
|
||||
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 "README.md" should contain "Amicus"
|
||||
And the file ".gitignore" should not exist
|
||||
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
|
|
@ -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 ///
|
||||
"""
|
|
@ -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"
|
||||
"""
|
|
@ -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')
|
|
@ -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
|
|
@ -0,0 +1 @@
|
|||
<h1>Welcome</h1>
|
|
@ -0,0 +1,9 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>My Sample Site</title>
|
||||
<!-- Comment in layout -->
|
||||
</head>
|
||||
<body>
|
||||
<%= yield %>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,8 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>Custom Layout</title>
|
||||
</head>
|
||||
<body>
|
||||
<%= yield %>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1 @@
|
|||
I am real
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
layout: false
|
||||
---
|
||||
|
||||
I am real: <%= @num %>
|
|
@ -0,0 +1 @@
|
|||
<h1>Ignore me!</h1>
|
|
@ -0,0 +1 @@
|
|||
<h1>Ignore me! 2</h1>
|
|
@ -0,0 +1 @@
|
|||
<h1>Ignore me! 3</h1>
|
|
@ -0,0 +1 @@
|
|||
Static, no code!
|
|
@ -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
|
|
@ -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>
|
|
@ -21,13 +21,3 @@ module Middleman::Cli
|
|||
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'
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
require 'middleman-core/application'
|
||||
|
||||
# CLI Module
|
||||
module Middleman::Cli
|
||||
# The CLI Build class
|
||||
|
@ -8,12 +10,15 @@ module Middleman::Cli
|
|||
|
||||
class_option :environment,
|
||||
aliases: '-e',
|
||||
default: ENV['MM_ENV'] || ENV['RACK_ENV'] || 'production',
|
||||
desc: 'The environment Middleman will run under'
|
||||
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',
|
||||
|
@ -24,7 +29,7 @@ module Middleman::Cli
|
|||
default: false,
|
||||
desc: 'Print debug messages'
|
||||
class_option :instrument,
|
||||
type: :string,
|
||||
type: :boolean,
|
||||
default: false,
|
||||
desc: 'Print instrument messages'
|
||||
class_option :profile,
|
||||
|
@ -32,6 +37,8 @@ module Middleman::Cli
|
|||
default: false,
|
||||
desc: 'Generate profiling report for the build'
|
||||
|
||||
Middleman::Cli.import_config(self)
|
||||
|
||||
# Core build Thor command
|
||||
# @return [void]
|
||||
def build
|
||||
|
@ -44,34 +51,44 @@ module Middleman::Cli
|
|||
require 'middleman-core/builder'
|
||||
require 'fileutils'
|
||||
|
||||
env = options['environment'].to_sym
|
||||
verbose = options['verbose'] ? 0 : 1
|
||||
instrument = options['instrument']
|
||||
|
||||
@app = ::Middleman::Application.new do
|
||||
config[:mode] = :build
|
||||
config[:environment] = env
|
||||
config[:show_exceptions] = false
|
||||
::Middleman::Logger.singleton(verbose, instrument)
|
||||
builder = nil
|
||||
cli_options = options
|
||||
|
||||
::Middleman::Logger.singleton(verbose, instrument)
|
||||
|
||||
::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
|
||||
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
|
||||
|
||||
builder = Middleman::Builder.new(@app,
|
||||
glob: options['glob'],
|
||||
clean: options['clean'],
|
||||
parallel: options['parallel'])
|
||||
builder.thor = self
|
||||
builder.on_build_event(&method(:on_event))
|
||||
::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
|
||||
|
||||
if builder.run!
|
||||
clean_directories! if options['clean']
|
||||
else
|
||||
msg = 'There were errors during this build'
|
||||
unless options['verbose']
|
||||
msg << ', re-run with `middleman build --verbose` to see the full exception.'
|
||||
exit(1)
|
||||
end
|
||||
shell.say msg, :red
|
||||
|
||||
exit(1)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -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
|
|
@ -30,8 +30,8 @@ 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
|
||||
|
|
|
@ -4,6 +4,8 @@ module Middleman::Cli
|
|||
class Init < Thor::Group
|
||||
include Thor::Actions
|
||||
|
||||
GIT_CMD = 'git'.freeze
|
||||
|
||||
check_unknown_options!
|
||||
|
||||
argument :target, type: :string, default: '.'
|
||||
|
@ -25,11 +27,18 @@ module Middleman::Cli
|
|||
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
|
||||
|
||||
repo_path, repo_branch = if shortname?(options[:template])
|
||||
require 'open-uri'
|
||||
require 'json'
|
||||
|
||||
api = 'http://directory.middlemanapp.com/api'
|
||||
api = 'https://directory.middlemanapp.com/api'
|
||||
uri = ::URI.parse("#{api}/#{options[:template]}.json")
|
||||
|
||||
begin
|
||||
|
@ -39,7 +48,7 @@ module Middleman::Cli
|
|||
rescue ::OpenURI::HTTPError
|
||||
say "Template `#{options[:template]}` not found in Middleman Directory."
|
||||
say 'Did you mean to use a full `user/repo` path?'
|
||||
exit
|
||||
exit 1
|
||||
end
|
||||
else
|
||||
repo_name, repo_branch = options[:template].split('#')
|
||||
|
@ -51,11 +60,12 @@ module Middleman::Cli
|
|||
begin
|
||||
branch_cmd = repo_branch ? "-b #{repo_branch} " : ''
|
||||
|
||||
run("git clone --depth 1 #{branch_cmd}#{repo_path} #{dir}")
|
||||
git_path = "#{branch_cmd}#{repo_path}"
|
||||
run("#{GIT_CMD} clone --depth 1 #{branch_cmd}#{repo_path} #{dir}")
|
||||
|
||||
unless File.directory?(dir)
|
||||
say 'Git clone failed, maybe the url is invalid or you don\'t have the permissions?', :red
|
||||
exit
|
||||
unless $?.success?
|
||||
say "Git clone command failed. Make sure git repository exists: #{git_path}", :red
|
||||
exit 1
|
||||
end
|
||||
|
||||
inside(target) do
|
||||
|
@ -79,12 +89,31 @@ module Middleman::Cli
|
|||
|
||||
protected
|
||||
|
||||
# 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 : "git://github.com/#{repo}.git"
|
||||
repo.include?('://') || repo.include?('git@') ? repo : "https://github.com/#{repo}.git"
|
||||
end
|
||||
|
||||
# Add to CLI
|
||||
|
|
|
@ -5,41 +5,32 @@ module Middleman::Cli
|
|||
check_unknown_options!
|
||||
|
||||
class_option :environment,
|
||||
aliases: '-e',
|
||||
default: ENV['MM_ENV'] || ENV['RACK_ENV'] || 'development',
|
||||
desc: 'The environment Middleman will run under'
|
||||
class_option :host,
|
||||
type: :string,
|
||||
aliases: '-h',
|
||||
desc: 'Bind to HOST address'
|
||||
aliases: '-e'
|
||||
class_option :port,
|
||||
aliases: '-p',
|
||||
desc: 'The port Middleman will listen on'
|
||||
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: :string,
|
||||
default: false,
|
||||
desc: 'Print instrument messages'
|
||||
class_option :disable_watcher,
|
||||
type: :boolean,
|
||||
default: false,
|
||||
desc: 'Disable the file change and delete watcher process'
|
||||
desc: 'Print instrument messages'
|
||||
class_option :profile,
|
||||
type: :boolean,
|
||||
default: false,
|
||||
desc: 'Generate profiling report for server startup'
|
||||
class_option :force_polling,
|
||||
class_option :daemon,
|
||||
type: :boolean,
|
||||
aliases: '-d',
|
||||
default: false,
|
||||
desc: 'Force file watcher into polling mode'
|
||||
class_option :latency,
|
||||
type: :numeric,
|
||||
aliases: '-l',
|
||||
default: 0.5,
|
||||
desc: 'Set file watcher latency, in seconds'
|
||||
desc: 'Daemonize preview server'
|
||||
|
||||
Middleman::Cli.import_config(self)
|
||||
|
||||
# Start the server
|
||||
def server
|
||||
|
@ -52,19 +43,14 @@ module Middleman::Cli
|
|||
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']
|
||||
daemon: options['daemon']
|
||||
}
|
||||
|
||||
puts '== The Middleman is loading'
|
||||
::Middleman::PreviewServer.start(params)
|
||||
::Middleman::PreviewServer.start(params, options)
|
||||
end
|
||||
|
||||
# Add to CLI
|
||||
|
|
|
@ -13,7 +13,6 @@ end
|
|||
|
||||
group :test do
|
||||
gem 'cucumber'
|
||||
gem 'fivemat'
|
||||
gem 'aruba'
|
||||
gem 'rspec'
|
||||
end
|
||||
|
|
|
@ -4,7 +4,7 @@ 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'
|
||||
|
|
|
@ -1,38 +1,6 @@
|
|||
# Require core library
|
||||
require 'middleman-core'
|
||||
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
|
||||
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)
|
||||
|
|
|
@ -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
|
|
@ -1 +0,0 @@
|
|||
require '<%= name %>'
|
|
@ -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'])
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
--color
|
|
@ -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')
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
default: --require features --tags ~@wip
|
||||
wip: --require features --tags @wip
|
|
@ -12,7 +12,7 @@ Feature: Assets get file hashes appended to them and references to them are upda
|
|||
| images/300px-59adce76.jpg |
|
||||
| images/100px-5fd6fb90.gif |
|
||||
| javascripts/application-1d8d5276.js |
|
||||
| stylesheets/site-7474cadd.css |
|
||||
| stylesheets/site-8bc55985.css |
|
||||
| index.html |
|
||||
| subdir/index.html |
|
||||
| other/index.html |
|
||||
|
@ -26,21 +26,21 @@ Feature: Assets get file hashes appended to them and references to them are upda
|
|||
| stylesheets/site.css |
|
||||
|
||||
And the file "javascripts/application-1d8d5276.js" should contain "img.src = '/images/100px-5fd6fb90.jpg'"
|
||||
And the file "stylesheets/site-7474cadd.css" should contain:
|
||||
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-7474cadd.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-7474cadd.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-7474cadd.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'
|
||||
|
@ -50,26 +50,42 @@ Feature: Assets get file hashes appended to them and references to them are upda
|
|||
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: 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:
|
||||
| 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-7474cadd.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-7474cadd.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-7474cadd.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-7474cadd.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'
|
||||
|
@ -78,6 +94,11 @@ Feature: Assets get file hashes appended to them and references to them are upda
|
|||
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: Hashed assets work with Slim
|
||||
Given the Server is running at "asset-hash-app"
|
||||
|
@ -86,17 +107,69 @@ Feature: Assets get file hashes appended to them and references to them are upda
|
|||
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
|
||||
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-1fdf4fb5.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-1fdf4fb5.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-1fdf4fb5.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"'
|
||||
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"
|
||||
|
@ -106,14 +179,14 @@ Feature: Assets get file hashes appended to them and references to them are upda
|
|||
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"
|
||||
|
@ -127,12 +200,10 @@ Feature: Assets get file hashes appended to them and references to them are upda
|
|||
"""
|
||||
Given the Server is running at "asset-hash-app"
|
||||
When I go to "/"
|
||||
Then I should see 'href="stylesheets/site-ac2166fd.css'
|
||||
When I go to "stylesheets/site-ac2166fd.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-7474cadd.css"
|
||||
Then I should see 'Not Found'
|
||||
|
||||
Scenario: Hashed-asset files are not produced for ignored paths
|
||||
Given a fixture app "asset-hash-app"
|
||||
|
@ -170,16 +241,84 @@ Feature: Assets get file hashes appended to them and references to them are upda
|
|||
| javascripts/application-1d8d5276.js |
|
||||
| stylesheets/site-7474cadd.css |
|
||||
|
||||
# @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: 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>
|
||||
"""
|
||||
|
||||
# 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: 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)}
|
||||
"""
|
||||
|
||||
# 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"
|
||||
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 "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"
|
||||
|
|
|
@ -8,19 +8,25 @@ Feature: Alternate between multiple asset hosts
|
|||
"""
|
||||
And the Server is running
|
||||
When I go to "/asset_host.html"
|
||||
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 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)
|
||||
hash = Digest::MD5.digest(asset).bytes.map!(&:ord).reduce(&:+)
|
||||
"http://assets%d.example.com" % (hash % 4)
|
||||
}
|
||||
"""
|
||||
And the Server is running
|
||||
|
@ -28,6 +34,22 @@ Feature: Alternate between multiple asset hosts
|
|||
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 content matching %r{http://assets1.example.com/}
|
||||
Then I should not 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/}
|
||||
|
|
|
@ -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"'
|
||||
|
|
|
@ -20,13 +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"
|
||||
|
||||
|
||||
Scenario: Build glob
|
||||
Given a successfully built app at "glob-app" with flags "--glob '*.css'"
|
||||
When I cd to "build"
|
||||
|
@ -34,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"
|
||||
|
|
|
@ -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"'
|
||||
|
|
|
@ -7,16 +7,19 @@ 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 "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"
|
||||
|
@ -29,7 +32,7 @@ Feature: Templates should be chainable
|
|||
And a template named "my_partial.html.md.erb" with:
|
||||
"""
|
||||
## My Partial
|
||||
|
||||
|
||||
<%= 'hello world' %>
|
||||
"""
|
||||
And the Server is running
|
||||
|
@ -58,7 +61,7 @@ Feature: Templates should be chainable
|
|||
And a template named "my_partial.html.md.erb" with:
|
||||
"""
|
||||
## My Partial
|
||||
|
||||
|
||||
<%= 'hello world' %>
|
||||
"""
|
||||
And the Server is running
|
||||
|
@ -87,7 +90,7 @@ Feature: Templates should be chainable
|
|||
And a template named "my_partial.html.erb" with:
|
||||
"""
|
||||
<h2>My Partial</h2>
|
||||
|
||||
|
||||
<%= 'hello world' %>
|
||||
"""
|
||||
And the Server is running
|
||||
|
|
|
@ -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 |
|
||||
|
|
|
@ -98,7 +98,7 @@ Feature: Collections
|
|||
And a file named "source/index.html.erb" with:
|
||||
"""
|
||||
<% collection(:articles).each do |article| %>
|
||||
Article: <%= article.data.title || article.source_file[:relative_path] %>
|
||||
Article: <%= article.data.title || article.file_descriptor[:relative_path] %>
|
||||
<% end %>
|
||||
"""
|
||||
Given the Server is running at "collections-app"
|
||||
|
@ -144,6 +144,33 @@ Feature: Collections
|
|||
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"
|
||||
|
@ -192,4 +219,47 @@ Feature: Collections
|
|||
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'
|
||||
|
|
|
@ -12,6 +12,8 @@ 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"
|
||||
|
@ -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:
|
||||
|
|
|
@ -11,6 +11,22 @@ Feature: Custom layouts
|
|||
When I go to "/custom-layout.html"
|
||||
Then I should see "Custom Layout"
|
||||
|
||||
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 "/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 a fixture app "custom-layout-app2"
|
||||
And a file named "config.rb" with:
|
||||
|
@ -65,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"
|
||||
|
|
|
@ -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>"
|
||||
|
|
|
@ -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>"
|
||||
|
|
@ -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,12 +22,13 @@ 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 "Filled with Evil Spaces"
|
||||
|
||||
|
||||
Scenario: Preview normal file
|
||||
Given the Server is running at "indexable-app"
|
||||
When I go to "/needs_index/"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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 "äöü"
|
|
@ -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"
|
||||
|
|
@ -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 ///"
|
|
@ -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"
|
||||
|
|
|
@ -28,40 +28,23 @@ Feature: YAML Front Matter
|
|||
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"
|
||||
|
|
|
@ -22,7 +22,7 @@ Feature: GZIP assets during build
|
|||
Given a fixture app "gzip-app"
|
||||
And a file named "config.rb" with:
|
||||
"""
|
||||
activate :gzip, exts: %w(.js .html .htm)
|
||||
activate :gzip, exts: %w(.htm .html .js .xhtml)
|
||||
"""
|
||||
And a successfully built app at "gzip-app"
|
||||
Then the following files should exist:
|
||||
|
|
|
@ -40,19 +40,29 @@ Feature: link_to helper
|
|||
"""
|
||||
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 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"
|
||||
|
@ -113,7 +123,7 @@ 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:
|
||||
|
|
|
@ -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'
|
|
@ -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"
|
|
@ -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"
|
||||
|
|
|
@ -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'
|
|
@ -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
|
||||
"""
|
|
@ -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"'
|
|
@ -1,4 +1,3 @@
|
|||
@nojava
|
||||
Feature: Markdown (Redcarpet) support
|
||||
In order to test included Redcarpet support
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
@nojava
|
||||
Feature: Markdown support in Haml
|
||||
In order to test support of the Haml markdown filter
|
||||
|
||||
|
|
|
@ -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"'
|
|
@ -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 "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,11 +28,27 @@ 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
|
||||
|
@ -46,6 +65,7 @@ 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 "/inline-css.html"
|
||||
|
@ -58,11 +78,13 @@ 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
|
||||
|
@ -88,6 +110,8 @@ 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"
|
||||
|
@ -106,11 +130,13 @@ 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:
|
||||
"""
|
||||
config[:sass_source_maps] = false
|
||||
|
||||
activate :minify_css, inline: true
|
||||
"""
|
||||
And the Server is running at "minify-css-app"
|
||||
|
@ -120,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
|
||||
|
|
|
@ -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:
|
||||
|
@ -86,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:
|
||||
"""
|
||||
|
@ -119,7 +119,7 @@ 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:
|
||||
|
@ -146,6 +146,42 @@ Feature: Minify Javascript
|
|||
</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:
|
||||
|
@ -157,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"
|
||||
|
@ -172,7 +219,7 @@ Feature: Minify Javascript
|
|||
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:
|
||||
|
@ -182,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:
|
||||
|
@ -200,7 +247,7 @@ Feature: Minify Javascript
|
|||
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:
|
||||
|
@ -216,4 +263,4 @@ Feature: Minify Javascript
|
|||
And the Server is running at "passthrough-app"
|
||||
When I go to "/javascripts/coffee_test.js"
|
||||
Then I should see "11" lines
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
Feature: Move files
|
||||
|
||||
Scenario: Move one path to another
|
||||
Given a fixture app "large-build-app"
|
||||
And a file named "config.rb" with:
|
||||
"""
|
||||
move_file "/static.html", "/static2.html"
|
||||
"""
|
||||
And the Server is running at "large-build-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: Move one path to another with directory indexes
|
||||
Given a fixture app "large-build-app"
|
||||
And a file named "config.rb" with:
|
||||
"""
|
||||
activate :directory_indexes
|
||||
move_file "/static.html", "/static2.html"
|
||||
"""
|
||||
And the Server is running at "large-build-app"
|
||||
When I go to "/static.html"
|
||||
Then I should see 'Not Found'
|
||||
When I go to "/static/index.html"
|
||||
Then I should see 'Not Found'
|
||||
When I go to "/static2.html"
|
||||
Then I should see 'Static, no code!'
|
||||
|
||||
Scenario: Move one path to another with directory indexes (using dest path)
|
||||
Given a fixture app "large-build-app"
|
||||
And a file named "config.rb" with:
|
||||
"""
|
||||
activate :directory_indexes
|
||||
move_file "/static/index.html", "/static2.html"
|
||||
"""
|
||||
And the Server is running at "large-build-app"
|
||||
When I go to "/static.html"
|
||||
Then I should see 'Not Found'
|
||||
When I go to "/static/index.html"
|
||||
Then I should see 'Not Found'
|
||||
When I go to "/static2.html"
|
||||
Then I should see 'Static, no code!'
|
||||
|
|
@ -5,37 +5,37 @@ Feature: Allow nesting of layouts
|
|||
When I go to "/index.html"
|
||||
Then I should see:
|
||||
"""
|
||||
Master
|
||||
Master Erb
|
||||
<h1>Index Title</h1>
|
||||
Outer
|
||||
Inner
|
||||
I am Outer
|
||||
I am Inner
|
||||
Template
|
||||
|
||||
|
||||
"""
|
||||
When I go to "/another.html"
|
||||
Then I should see:
|
||||
"""
|
||||
Master
|
||||
Master Erb
|
||||
<h1>New Article Title</h1>
|
||||
Outer
|
||||
Inner
|
||||
I am Outer
|
||||
I am Inner
|
||||
<p>The Article Content</p>
|
||||
"""
|
||||
|
||||
|
||||
Scenario: A page uses an inner layout when uses an outer layout (slim)
|
||||
Given the Server is running at "nested-layout-app"
|
||||
When I go to "/slim-test.html"
|
||||
Then I should see "<h1>Master</h1><p>New Article Title</p><div><h2>Outer</h2><h3>Inner</h3><p>The Article Content</p>"
|
||||
|
||||
Then I should see "<h1>Master Slim</h1><p>New Article Title</p><div><h2>I am Outer</h2><h3>I am Inner</h3><p>The Article Content</p>"
|
||||
|
||||
Scenario: A page uses an inner layout when uses an outer layout (haml)
|
||||
Given the Server is running at "nested-layout-app"
|
||||
When I go to "/haml-test.html"
|
||||
Then I should see:
|
||||
"""
|
||||
Master
|
||||
Master Haml
|
||||
<h1>New Article Title</h1>
|
||||
Outer
|
||||
Inner
|
||||
I am Outer
|
||||
I am Inner
|
||||
<p>The Article Content</p>
|
||||
"""
|
||||
|
||||
|
@ -43,13 +43,16 @@ Feature: Allow nesting of layouts
|
|||
Given the Server is running at "nested-layout-app"
|
||||
When I go to "/data-one.html"
|
||||
Then I should see "Page Number One"
|
||||
And I should see "Inner"
|
||||
And I should see "Page #1"
|
||||
And I should see "I am Inner"
|
||||
And I should see "I am Outer"
|
||||
And I should see "Master Erb"
|
||||
When I go to "/data-two.html"
|
||||
Then I should see "Page Number Two"
|
||||
And I should not see "Inner"
|
||||
And I should not see "I am Inner"
|
||||
When I go to "/data-one.html"
|
||||
Then I should see "Page Number One"
|
||||
And I should see "Inner"
|
||||
And I should see "I am Inner"
|
||||
When I go to "/data-two.html"
|
||||
Then I should see "Page Number Two"
|
||||
And I should not see "Inner"
|
||||
And I should not see "I am Inner"
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
Feature: Page IDs
|
||||
|
||||
Scenario: link_to works with blocks (erb)
|
||||
Given the Server is running at "page-id-app"
|
||||
When I go to "/index.html"
|
||||
Then I should see "I am: index"
|
||||
And I should see "URL1: /fm.html"
|
||||
And I should see "URL2: /2.html"
|
||||
And I should see 'URL3: <a href="/3.html">Hi</a>'
|
||||
And I should see 'URL4: <a href="/overwrites/from-default.html">Sym</a>'
|
||||
And I should see 'URL5: <a href="/implicit.html">Imp</a>'
|
||||
And I should see 'URL6: <a href="/folder/foldern.html">Foldern</a>'
|
||||
And I should see 'URL7: <a href="/feed.xml">Feed</a>'
|
||||
|
||||
When I go to "/fm.html"
|
||||
Then I should see "I am: frontmatter"
|
||||
When I go to "/implicit.html"
|
||||
Then I should see "I am: implicit"
|
||||
When I go to "/feed.xml"
|
||||
Then I should see "I am: feed.xml"
|
||||
When I go to "/folder/foldern.html"
|
||||
Then I should see "I am: folder/foldern"
|
||||
|
||||
When I go to "/1.html"
|
||||
Then I should see "I am: page1"
|
||||
When I go to "/2.html"
|
||||
Then I should see "I am: page2"
|
||||
When I go to "/3.html"
|
||||
Then I should see "I am: page3"
|
||||
|
||||
When I go to "/overwrites/from-default.html"
|
||||
Then I should see "I am: something-else"
|
||||
|
||||
When I go to "/overwrites/from-frontmatter.html"
|
||||
Then I should see "I am: from_frontmatter"
|
||||
|
||||
Scenario: Override page ID derivation with a proc
|
||||
Given a fixture app "page-id-app"
|
||||
And app "page-id-app" is using config "proc"
|
||||
And the Server is running at "page-id-app"
|
||||
|
||||
When I go to "/index.html"
|
||||
Then I should see "I am: index.html-foo"
|
||||
And I should see "URL1: /fm.html"
|
||||
And I should see "URL2: /2.html"
|
||||
And I should see 'URL3: <a href="/3.html">Hi</a>'
|
||||
And I should see 'URL4: <a href="/overwrites/from-default.html">Sym</a>'
|
||||
And I should see 'URL8: <a href="/implicit.html">Imp</a>'
|
||||
And I should see 'URL9: <a href="/folder/foldern.html">Foldern</a>'
|
||||
And I should see 'URL10: <a href="/feed.xml">Feed</a>'
|
||||
|
||||
When I go to "/fm.html"
|
||||
Then I should see "I am: frontmatter"
|
||||
When I go to "/implicit.html"
|
||||
Then I should see "I am: implicit.html-foo"
|
||||
When I go to "/feed.xml"
|
||||
Then I should see "I am: feed.xml-foo"
|
||||
When I go to "/folder/foldern.html"
|
||||
Then I should see "I am: folder/foldern.html-foo"
|
||||
|
||||
When I go to "/1.html"
|
||||
Then I should see "I am: page1"
|
||||
When I go to "/2.html"
|
||||
Then I should see "I am: page2"
|
||||
When I go to "/3.html"
|
||||
Then I should see "I am: page3"
|
||||
|
||||
When I go to "/overwrites/from-default.html"
|
||||
Then I should see "I am: something-else"
|
||||
|
||||
When I go to "/overwrites/from-frontmatter.html"
|
||||
Then I should see "I am: from_frontmatter"
|
|
@ -5,25 +5,30 @@ Feature: Provide Sane Defaults for Partial Behavior
|
|||
When I go to "/index.html"
|
||||
Then I should see "Header"
|
||||
And I should see "Footer"
|
||||
|
||||
|
||||
Scenario: Finds shared partials relative to the root (sub)
|
||||
Given the Server is running at "partials-app"
|
||||
When I go to "/sub/index.html"
|
||||
Then I should see "Header"
|
||||
And I should see "Footer"
|
||||
|
||||
|
||||
Scenario: Flags error when partial is not found
|
||||
Given the Server is running at "partials-app"
|
||||
When I go to "/index_missing.html"
|
||||
Then I should see "Error: Could not locate partial"
|
||||
|
||||
Scenario: Prefers partials of the same engine type
|
||||
Given the Server is running at "partials-app"
|
||||
When I go to "/index.html"
|
||||
Then I should see "ERb Main"
|
||||
|
||||
|
||||
Scenario: Prefers partials of the same engine type
|
||||
Given the Server is running at "partials-app"
|
||||
When I go to "/second.html"
|
||||
Then I should see "Str Main"
|
||||
And I should see "Header"
|
||||
And I should see "Footer"
|
||||
|
||||
|
||||
Scenario: Finds partial relative to template
|
||||
Given the Server is running at "partials-app"
|
||||
When I go to "/sub/index.html"
|
||||
|
@ -33,7 +38,7 @@ Feature: Provide Sane Defaults for Partial Behavior
|
|||
Given the Server is running at "partials-app"
|
||||
When I go to "/locals.html"
|
||||
Then I should see "Local var is bar"
|
||||
|
||||
|
||||
Scenario: Partial and Layout use different engines
|
||||
Given the Server is running at "different-engine-partial"
|
||||
When I go to "/index.html"
|
||||
|
@ -50,3 +55,10 @@ Feature: Provide Sane Defaults for Partial Behavior
|
|||
Then I should see "File Not Found"
|
||||
When I go to "/_code_snippet.html"
|
||||
Then I should see "File Not Found"
|
||||
|
||||
Scenario: Works with blocks
|
||||
Given the Server is running at "partials-app"
|
||||
When I go to "/block.html"
|
||||
Then I should see "Start"
|
||||
And I should see "Contents"
|
||||
And I should see "End"
|
||||
|
|
|
@ -8,6 +8,7 @@ Feature: Meta redirects
|
|||
"""
|
||||
And the Server is running at "large-build-app"
|
||||
When I go to "/hello.html"
|
||||
Then I should see '<link rel="canonical" href="world.html"'
|
||||
Then I should see '<meta http-equiv=refresh content="0; url=world.html"'
|
||||
|
||||
Scenario: Redirect to external site
|
||||
|
|
|
@ -21,6 +21,12 @@ Feature: Relative Assets
|
|||
Given "relative_assets" feature is "disabled"
|
||||
And the Server is running at "relative-assets-app"
|
||||
When I go to "/relative_image.html"
|
||||
Then I should see '"/stylesheets/relative_assets.css"'
|
||||
Then I should see '"/javascripts/app.js"'
|
||||
Then I should see "/images/blank.gif"
|
||||
When I go to "/absolute_image_relative_css.html"
|
||||
Then I should see '"stylesheets/relative_assets.css"'
|
||||
Then I should see '"javascripts/app.js"'
|
||||
Then I should see "/images/blank.gif"
|
||||
|
||||
Scenario: Rendering css with the feature enabled
|
||||
|
@ -30,6 +36,16 @@ Feature: Relative Assets
|
|||
Then I should see 'url("../images/blank.gif'
|
||||
When I go to "/javascripts/application.js"
|
||||
Then I should not see "../"
|
||||
When I go to "/stylesheets/fonts.css"
|
||||
Then I should see 'url(../fonts/roboto/roboto-regular-webfont.eot'
|
||||
And I should see 'url(../fonts/roboto/roboto-regular-webfont.woff'
|
||||
And I should see 'url(../fonts/roboto/roboto-regular-webfont.ttf'
|
||||
And I should see 'url(../fonts/roboto/roboto-regular-webfont.svg'
|
||||
When I go to "/stylesheets/fonts2.css"
|
||||
Then I should see 'url(../fonts/roboto/roboto-regular-webfont.eot'
|
||||
And I should see 'url(../fonts/roboto/roboto-regular-webfont.woff'
|
||||
And I should see 'url(../fonts/roboto/roboto-regular-webfont.ttf'
|
||||
And I should see 'url(../fonts/roboto/roboto-regular-webfont.svg'
|
||||
|
||||
Scenario: Building css with the feature enabled
|
||||
Given a fixture app "relative-assets-app"
|
||||
|
@ -53,10 +69,15 @@ Feature: Relative Assets
|
|||
When I cd to "build"
|
||||
Then the file "relative_image/index.html" should contain "../stylesheets/relative_assets.css"
|
||||
|
||||
Scenario: Rendering html with the feature enabled
|
||||
Scenario: Rendering html with the feature enabled (overrides relative option on helpers)
|
||||
Given "relative_assets" feature is "enabled"
|
||||
And the Server is running at "relative-assets-app"
|
||||
When I go to "/relative_image.html"
|
||||
Then I should see '"stylesheets/relative_assets.css"'
|
||||
Then I should see '"javascripts/app.js"'
|
||||
When I go to "/relative_image_absolute_css.html"
|
||||
Then I should see '"stylesheets/relative_assets.css"'
|
||||
Then I should see '"javascripts/app.js"'
|
||||
Then I should not see "/images/blank.gif"
|
||||
And I should see "images/blank.gif"
|
||||
|
||||
|
@ -99,7 +120,7 @@ Feature: Relative Assets
|
|||
"""
|
||||
And the Server is running at "relative-assets-app"
|
||||
When I go to "/sub/image_tag.html"
|
||||
Then I should see '<img src="../img/blank.gif" />'
|
||||
Then I should see '<img src="../img/blank.gif"'
|
||||
|
||||
Scenario: Relative assets should not break data URIs in image_tag
|
||||
Given a fixture app "relative-assets-app"
|
||||
|
@ -110,4 +131,18 @@ Feature: Relative Assets
|
|||
"""
|
||||
And the Server is running at "relative-assets-app"
|
||||
When I go to "/sub/image_tag.html"
|
||||
Then I should see '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" />'
|
||||
Then I should see '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" />'
|
||||
|
||||
Scenario: URLs are not rewritten for rewrite ignored paths
|
||||
Given a fixture app "relative-assets-app"
|
||||
And a file named "config.rb" with:
|
||||
"""
|
||||
activate :relative_assets, rewrite_ignore: [
|
||||
'/stylesheets/fonts.css',
|
||||
]
|
||||
"""
|
||||
And the Server is running at "relative-assets-app"
|
||||
When I go to "/stylesheets/relative_assets.css"
|
||||
Then I should see 'url("../images/blank.gif'
|
||||
When I go to "/stylesheets/fonts.css"
|
||||
Then I should see 'url(/fonts/roboto/roboto-regular-webfont.eot'
|
||||
|
|
|
@ -0,0 +1,123 @@
|
|||
Feature: Relative Assets (Helpers Only)
|
||||
|
||||
Scenario: Rendering css with the feature enabled
|
||||
Given a fixture app "relative-assets-app"
|
||||
And a file named "config.rb" with:
|
||||
"""
|
||||
activate :relative_assets, helpers_only: true
|
||||
"""
|
||||
And a file named "source/stylesheets/relative_assets.css.sass.erb" with:
|
||||
"""
|
||||
h1
|
||||
background: url("<%= asset_url('images/blank.gif') %>")
|
||||
h2
|
||||
background: url("<%= asset_url('/images/blank2.gif') %>")
|
||||
"""
|
||||
And a file named "source/javascripts/application.js.erb" with:
|
||||
"""
|
||||
function foo() {
|
||||
var img = document.createElement('img');
|
||||
img.src = '<%= asset_url("images/100px.jpg") %>';
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
body.insertBefore(img, body.firstChild);
|
||||
}
|
||||
|
||||
window.onload = foo;
|
||||
"""
|
||||
And a file named "source/stylesheets/fonts3.css.erb" with:
|
||||
"""
|
||||
@font-face {
|
||||
font-family: 'Roboto2';
|
||||
src: url(<%= asset_url("/fonts/roboto/roboto-regular-webfont.eot") %>);
|
||||
src: url(<%= asset_url("/fonts/roboto/roboto-regular-webfont.eot?#iefix") %>) format('embedded-opentype'),
|
||||
url(<%= asset_url("/fonts/roboto/roboto-regular-webfont.woff") %>) format('woff'),
|
||||
url(<%= asset_url("/fonts/roboto/roboto-regular-webfont.ttf") %>) format('truetype'),
|
||||
url(<%= asset_url("/fonts/roboto/roboto-regular-webfont.svg#robotoregular") %>) format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
"""
|
||||
And the Server is running at "relative-assets-app"
|
||||
When I go to "/stylesheets/relative_assets.css"
|
||||
Then I should see 'url("../images/blank.gif'
|
||||
And I should see 'url("../images/blank2.gif'
|
||||
When I go to "/javascripts/application.js"
|
||||
Then I should not see "../"
|
||||
When I go to "/stylesheets/fonts3.css"
|
||||
Then I should see 'url(../fonts/roboto/roboto-regular-webfont.eot'
|
||||
And I should see 'url(../fonts/roboto/roboto-regular-webfont.woff'
|
||||
And I should see 'url(../fonts/roboto/roboto-regular-webfont.ttf'
|
||||
And I should see 'url(../fonts/roboto/roboto-regular-webfont.svg'
|
||||
|
||||
Scenario: Relative css reference with directory indexes
|
||||
Given a fixture app "relative-assets-app"
|
||||
And a file named "config.rb" with:
|
||||
"""
|
||||
activate :directory_indexes
|
||||
activate :relative_assets, helpers_only: true
|
||||
"""
|
||||
And the Server is running at "relative-assets-app"
|
||||
When I go to "/relative_image/index.html"
|
||||
Then I should see "../stylesheets/relative_assets.css"
|
||||
|
||||
Scenario: Relative assets via image_tag
|
||||
Given a fixture app "relative-assets-app"
|
||||
And a file named "config.rb" with:
|
||||
"""
|
||||
activate :relative_assets, helpers_only: true
|
||||
"""
|
||||
And a file named "source/sub/image_tag.html.erb" with:
|
||||
"""
|
||||
<%= image_tag '/img/blank.gif' %>
|
||||
"""
|
||||
And the Server is running at "relative-assets-app"
|
||||
When I go to "/sub/image_tag.html"
|
||||
Then I should see '<img src="../img/blank.gif"'
|
||||
|
||||
Scenario: Relative assets should not break data URIs in image_tag
|
||||
Given a fixture app "relative-assets-app"
|
||||
And a file named "config.rb" with:
|
||||
"""
|
||||
activate :relative_assets, helpers_only: true
|
||||
"""
|
||||
And a file named "source/sub/image_tag.html.erb" with:
|
||||
"""
|
||||
<%= image_tag "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" %>
|
||||
"""
|
||||
And the Server is running at "relative-assets-app"
|
||||
When I go to "/sub/image_tag.html"
|
||||
Then I should see '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" />'
|
||||
|
||||
Scenario: URLs are not rewritten for rewrite ignored paths
|
||||
Given a fixture app "relative-assets-app"
|
||||
And a file named "config.rb" with:
|
||||
"""
|
||||
activate :relative_assets, rewrite_ignore: [
|
||||
'/stylesheets/fonts3.css',
|
||||
], helpers_only: true
|
||||
"""
|
||||
And a file named "source/stylesheets/relative_assets.css.sass.erb" with:
|
||||
"""
|
||||
h1
|
||||
background: url("<%= asset_url('images/blank.gif') %>")
|
||||
h2
|
||||
background: url("<%= asset_url('/images/blank2.gif') %>")
|
||||
"""
|
||||
And a file named "source/stylesheets/fonts3.css.erb" with:
|
||||
"""
|
||||
@font-face {
|
||||
font-family: 'Roboto2';
|
||||
src: url(<%= asset_url("/fonts/roboto/roboto-regular-webfont.eot") %>);
|
||||
src: url(<%= asset_url("/fonts/roboto/roboto-regular-webfont.eot?#iefix") %>) format('embedded-opentype'),
|
||||
url(<%= asset_url("/fonts/roboto/roboto-regular-webfont.woff") %>) format('woff'),
|
||||
url(<%= asset_url("/fonts/roboto/roboto-regular-webfont.ttf") %>) format('truetype'),
|
||||
url(<%= asset_url("/fonts/roboto/roboto-regular-webfont.svg#robotoregular") %>) format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
"""
|
||||
And the Server is running at "relative-assets-app"
|
||||
When I go to "/stylesheets/relative_assets.css"
|
||||
Then I should see 'url("../images/blank.gif'
|
||||
When I go to "/stylesheets/fonts3.css"
|
||||
Then I should see 'url(/fonts/roboto/roboto-regular-webfont.eot'
|
|
@ -0,0 +1,40 @@
|
|||
Feature: Sass/SCSS support in Slim
|
||||
In order to test support of the Slim sass and scss filters
|
||||
|
||||
Scenario: Sass filter in Slim works
|
||||
Given a fixture app "sass-in-slim-app"
|
||||
And a file named "config.rb" with:
|
||||
"""
|
||||
activate :directory_indexes
|
||||
"""
|
||||
And a file named "source/sass_filter.html.slim" with:
|
||||
"""
|
||||
sass:
|
||||
.sass
|
||||
margin: 0
|
||||
"""
|
||||
Given the Server is running at "sass-in-slim-app"
|
||||
When I go to "/sass_filter/"
|
||||
Then I should see "text/css"
|
||||
Then I should see ".sass"
|
||||
Then I should see "margin:0"
|
||||
|
||||
|
||||
Scenario: SCSS filter in Slim works
|
||||
Given a fixture app "sass-in-slim-app"
|
||||
And a file named "config.rb" with:
|
||||
"""
|
||||
activate :directory_indexes
|
||||
"""
|
||||
And a file named "source/scss_filter.html.slim" with:
|
||||
"""
|
||||
scss:
|
||||
.scss {
|
||||
margin: 0;
|
||||
}
|
||||
"""
|
||||
Given the Server is running at "sass-in-slim-app"
|
||||
When I go to "/scss_filter/"
|
||||
Then I should see "text/css"
|
||||
Then I should see ".scss"
|
||||
Then I should see "margin:0"
|
|
@ -78,4 +78,4 @@ Feature: Support slim templating language
|
|||
When I go to "/sass.html"
|
||||
Then I should see "html,body,div"
|
||||
When I go to "/error.html"
|
||||
Then I should see "Error: Invalid"
|
||||
Then I should see "Error:"
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
@nojava
|
||||
Feature: Stylus Updates and Partials
|
||||
Scenario: The preview server should update stylesheets when Stylus changes
|
||||
Given the Server is running at "stylus-preview-app"
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
ENV["TEST"] = "true"
|
||||
ENV["AUTOLOAD_SPROCKETS"] ||= "false"
|
||||
|
||||
require 'sassc'
|
||||
|
||||
require 'simplecov'
|
||||
SimpleCov.root(File.expand_path(File.dirname(__FILE__) + '/../..'))
|
||||
|
||||
require 'phantomjs/poltergeist'
|
||||
Capybara.javascript_driver = :poltergeist
|
||||
|
||||
require 'coveralls'
|
||||
Coveralls.wear!
|
||||
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
Around('@preserve_mime_types') do |_scenario, block|
|
||||
mime_types = ::Rack::Mime::MIME_TYPES.clone
|
||||
|
||||
block.call
|
||||
|
||||
::Rack::Mime::MIME_TYPES.replace mime_types
|
||||
end
|
|
@ -0,0 +1,26 @@
|
|||
Feature: Don't allow template locals to overwrite template helpers
|
||||
|
||||
Scenario: Normal Template
|
||||
Given an empty app
|
||||
And a file named "config.rb" with:
|
||||
"""
|
||||
class TestExt < ::Middleman::Extension
|
||||
expose_to_template foo: :foo
|
||||
|
||||
def foo
|
||||
"bar"
|
||||
end
|
||||
end
|
||||
|
||||
::Middleman::Extensions.register :test, TestExt
|
||||
|
||||
activate :test
|
||||
|
||||
page "/index.html", locals: { foo: false }
|
||||
"""
|
||||
And a file named "source/index.html.erb" with:
|
||||
"""
|
||||
<%= foo %>
|
||||
"""
|
||||
Given a built app at "empty_app"
|
||||
Then the exit status should be 1
|
|
@ -1,6 +0,0 @@
|
|||
@nojava @nowindows
|
||||
Feature: Compile a complicated Twitter bootstrap app
|
||||
|
||||
Scenario: User drops Twitter Bootstrap source into an app
|
||||
|
||||
Given a successfully built app at "twitter-bootstrap-app"
|
|
@ -1,33 +0,0 @@
|
|||
Feature: Honour working directory
|
||||
Honour the working directory during testing
|
||||
In order to support helpers which work with the current directories
|
||||
|
||||
Scenario: Set working directory for helpers in tests
|
||||
Given a fixture app "empty-app"
|
||||
And a file named "source/index.html.erb" with:
|
||||
"""
|
||||
<%= Dir.getwd %>
|
||||
"""
|
||||
And the Server is running
|
||||
When I go to "/index.html"
|
||||
Then I should see:
|
||||
"""
|
||||
aruba
|
||||
"""
|
||||
|
||||
Scenario: Set working directory for config.rb in tests
|
||||
Given a fixture app "empty-app"
|
||||
And a file named "config.rb" with:
|
||||
"""
|
||||
set :my_working_directory, Dir.getwd
|
||||
"""
|
||||
And a file named "source/index.html.erb" with:
|
||||
"""
|
||||
<%= config[:my_working_directory] %>
|
||||
"""
|
||||
And the Server is running
|
||||
When I go to "/index.html"
|
||||
Then I should see:
|
||||
"""
|
||||
aruba
|
||||
"""
|
Binary file not shown.
Binary file not shown.
|
@ -4,6 +4,9 @@
|
|||
|
||||
<h2>Image url:</h2>
|
||||
<img src="<%= image_path('100px.jpg') %>" srcset="<%= image_path('100px.jpg') %> 1x, <%= image_path('200px.jpg') %> 2x, <%= image_path('300px.jpg') %> 3x">
|
||||
<%= image_tag('100px.jpg?test') %>
|
||||
<%= image_tag('100px.jpg?#test') %>
|
||||
<%= image_tag('100px.jpg#test') %>
|
||||
|
||||
<h2>Ignored path:</h2>
|
||||
<link rel="apple-touch-icon" href="apple-touch-icon.png">
|
||||
|
|
|
@ -3,16 +3,16 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<%= stylesheet_link_tag "site" %>
|
||||
<%= stylesheet_link_tag "site", "fragment" %>
|
||||
<%= javascript_include_tag "application" %>
|
||||
<%= yield_content :head %>
|
||||
</head>
|
||||
|
||||
|
||||
<body class="<%= page_classes %>">
|
||||
|
||||
<div id="main" role="main">
|
||||
<%= yield %>
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,2 +1,5 @@
|
|||
<h2>Image url:</h2>
|
||||
<img src="<%= image_path('100px.jpg') %>">
|
||||
<img src="<%= image_path('100px.jpg?test') %>">
|
||||
<img src="<%= image_path('100px.jpg?#test') %>">
|
||||
<img src="<%= image_path('100px.jpg#test') %>">
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
#main {
|
||||
padding: 50px;
|
||||
background-image: image-url('100px.jpg');
|
||||
background-image: image-url('100px.jpg?test');
|
||||
background-image: image-url('100px.jpg?#test');
|
||||
background-image: image-url('100px.jpg#test');
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
#main {
|
||||
padding: 50px;
|
||||
background-image: image-url('100px.jpg');
|
||||
}
|
||||
background-image: url('/images/100px.jpg');
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue