Compare commits
699 commits
Author | SHA1 | Date | |
---|---|---|---|
b6167b1369 | |||
30217d2c04 | |||
073f273fe4 | |||
e30f413376 | |||
a680fb30c5 | |||
42e31c8c5e | |||
046d15cfa5 | |||
5adea781c9 | |||
97082d5fc4 | |||
604c0e2b5d | |||
7c968b9572 | |||
197093b36c | |||
ea2115f3f8 | |||
07651c63a6 | |||
65462cbc43 | |||
c264b05906 | |||
dcd36a4f99 | |||
7027b4933a | |||
cbad571338 | |||
ffef14deb4 | |||
62dba443a0 | |||
389e3f5a8c | |||
ea39d16d81 | |||
1581bfc27e | |||
e8f10fe3c2 | |||
1efa585c11 | |||
0d5c9e4313 | |||
51ccfe1143 | |||
4ffaa9dde5 | |||
6440d53e7a | |||
38a9025560 | |||
5de9e86a55 | |||
ccc1cc1288 | |||
849fc65260 | |||
3e4187568b | |||
1c57626445 | |||
cf4d40caff | |||
599cf1e6d3 | |||
3ebd902ec3 | |||
158c3e9f25 | |||
cdcd2bd42d | |||
4918704800 | |||
8a8ee768ac | |||
71a20bb3ee | |||
ce58073539 | |||
13d62cb276 | |||
0f2bc1e0ea | |||
a14934e08b | |||
a95f721490 | |||
2b0f720850 | |||
b386dcdc40 | |||
0ac5650229 | |||
7e3baed196 | |||
09a7d89fd3 | |||
6872e07d34 | |||
a01656df39 | |||
f2535f4fda | |||
dd2413857e | |||
b058d26564 | |||
b794961916 | |||
4791e01f10 | |||
ac974ca05f | |||
c7669609e6 | |||
e99649b33e | |||
ec213efb95 | |||
21f4f40e21 | |||
16c82fe57a | |||
058a63a0de | |||
49da6156a0 | |||
3cbd9fdede | |||
7ae8e904a6 | |||
55230229f6 | |||
9e774b608a | |||
b950af89ac | |||
5a2f9c8ca6 | |||
bca8b854dd | |||
ebc2baa13f | |||
179d6c0be4 | |||
2701bede2a | |||
cc25c784f9 | |||
9d29cd58de | |||
025e35f6a1 | |||
f5a668d380 | |||
0df7f0d6ac | |||
d461473f81 | |||
8425692b86 | |||
aab7bac8a6 | |||
7e42954258 | |||
02a0b557f6 | |||
d539d4aa3d | |||
0436c211c6 | |||
d22bd914ae | |||
dfa389bde4 | |||
5337d0640b | |||
7484c9f242 | |||
563da9d45b | |||
0904652c6f | |||
1f3bf47e3c | |||
d624dc4601 | |||
260a9cd94c | |||
fbc572f920 | |||
737e6f5e64 | |||
7b59f240d5 | |||
c44f7482b1 | |||
e14107ba65 | |||
d776f07bfc | |||
d883152e99 | |||
0d983231d0 | |||
4733488e8d | |||
edb1a53060 | |||
b695f6da1e | |||
e36fd3f476 | |||
eaac03ab4b | |||
351003b4fe | |||
476287452d | |||
fc0f5d24d6 | |||
a24e5986a2 | |||
b7886aa14c | |||
6c8fc2ee07 | |||
7bd417fad1 | |||
d7967a86bb | |||
b1778a92cd | |||
a2181a2fd9 | |||
6de25dfd0e | |||
f596d8ebf5 | |||
3f18efeed9 | |||
c5aabbbe4f | |||
598d72480f | |||
8c27d9a2e7 | |||
d863733160 | |||
13c351f2bf | |||
17f5f19002 | |||
007c626d58 | |||
e169d3d07e | |||
cc36267de5 | |||
475fa41de0 | |||
2bba7888b0 | |||
0c29fd4abf | |||
9553796731 | |||
24ef35026e | |||
8881389b42 | |||
e7d9c8ad0e | |||
deae5d2216 | |||
4deaa65a6d | |||
c7a4618166 | |||
b8c0fd34e7 | |||
e0818e2118 | |||
4e8273295b | |||
92d96f6604 | |||
8bacc35bf2 | |||
68127003b9 | |||
5586784947 | |||
6d1c3562a7 | |||
ffa662a917 | |||
827d5fbb1d | |||
2864902fa0 | |||
6077ae43e9 | |||
65aebc1887 | |||
801a83f7cb | |||
c2999786ee | |||
2b88773640 | |||
7bf4e4681f | |||
22812cb340 | |||
732ac7cbe9 | |||
dc3eac9e96 | |||
03c95f0863 | |||
5529062bc4 | |||
a47b2138f8 | |||
be2788b6ca | |||
ff9c34bca9 | |||
d82ac590db | |||
5f8beba4b3 | |||
c213bd19df | |||
8daa5eba3e | |||
18e4ee41d0 | |||
95c7a53291 | |||
56d71fe7d6 | |||
f954415c95 | |||
edd5eb2057 | |||
7bc9e03642 | |||
179268a4f6 | |||
8f66077dd0 | |||
98fe7ce7d2 | |||
c6401f1cd9 | |||
5cac6a1896 | |||
b4a6a503b3 | |||
47d0e1cb7b | |||
4243676073 | |||
17df162e7b | |||
46ca147560 | |||
37be89ed68 | |||
0563523a81 | |||
1e8080b44c | |||
a0105c9b48 | |||
a7631b2f0d | |||
133c02d05c | |||
1605f425e8 | |||
bfb6a7fa16 | |||
41212d7fa3 | |||
62b17d38ad | |||
fed3fae6bb | |||
298b3909ed | |||
1ca5be7b19 | |||
bdeb19059a | |||
b0a4d53963 | |||
5684caeee6 | |||
03e13c5a26 | |||
da1f3f7af6 | |||
9311a72e4a | |||
412f6ac1fc | |||
d464162e8e | |||
e56227c945 | |||
2dcd2c5b1d | |||
3b596d5e3e | |||
3fdd963923 | |||
4a8cd4c3d2 | |||
a5821bccec | |||
ba0416b330 | |||
6aeda854c0 | |||
5d0f12e6ca | |||
e035d625c8 | |||
b2b461935d | |||
9e5b137ed8 | |||
6af784d5d5 | |||
0e620a1ba1 | |||
308ea6db5a | |||
79b5e82b3c | |||
f3296815c8 | |||
4122bd7351 | |||
defa6daa6d | |||
82220eab4e | |||
3c1d28ce1b | |||
01f899f529 | |||
b6befd3fc3 | |||
bb0f11d002 | |||
28a0071be7 | |||
76f591788e | |||
d3a5494062 | |||
658b28c337 | |||
2674981d0b | |||
9b0b82c00b | |||
cb6e8bcd95 | |||
2178a755e2 | |||
7b3f5384e9 | |||
07a216d5ca | |||
e9b3a8abe4 | |||
578ff18fa0 | |||
ae15d203a8 | |||
e47b0ae29a | |||
16b997498b | |||
a546e0f523 | |||
f2db1567a4 | |||
309733b067 | |||
6de88a832e | |||
b4697e4541 | |||
dd0ee24ca3 | |||
e23bd151bf | |||
822a9f0ecc | |||
4594f46fb8 | |||
b0582bcebf | |||
13a14d43d4 | |||
45939e7e93 | |||
6ab6669456 | |||
49a7435dc9 | |||
f16fc2229e | |||
37d96a9b14 | |||
169b6f2c0a | |||
fbf77d2ad2 | |||
022779ef27 | |||
ce998cf685 | |||
8c7e156bd4 | |||
916a5a508b | |||
b4457c98d2 | |||
684a80c906 | |||
90490d696f | |||
0f8ea86119 | |||
a61b2e3b87 | |||
ec99a7b28f | |||
c48c81cbba | |||
30e37293b3 | |||
765c28114a | |||
4995bd23d7 | |||
c07af953f8 | |||
19d21d2295 | |||
3cd84eb4d1 | |||
62d7fa0676 | |||
d2251de898 | |||
6357f4f5b8 | |||
eb82f402a0 | |||
f4bff73b7b | |||
e26f83e1c2 | |||
e9abfe1134 | |||
67fc3d0c05 | |||
fd6a2376bd | |||
d828067189 | |||
0698d7f5aa | |||
9686c1ec7a | |||
b389c26b4e | |||
9df1a45301 | |||
5e3ddbf988 | |||
d9fc7a95e1 | |||
04c133c90f | |||
32891dc6fe | |||
97cd1c1411 | |||
fe66beacc3 | |||
ddc4a3cabc | |||
5afc138eb8 | |||
47bdcb2d9c | |||
11fc90f93c | |||
91a06a1a35 | |||
62f431b5ae | |||
d3d32731e1 | |||
765de5ab11 | |||
3e1fc0aa1f | |||
3ae28874bf | |||
2907761556 | |||
fdabd87957 | |||
409a892da7 | |||
a251c82562 | |||
2b2ee10d81 | |||
260c6be66c | |||
ed405b266f | |||
8c02eb2a26 | |||
d99b922e67 | |||
40f023f01c | |||
441dc2faa6 | |||
8a349322ac | |||
0d4d82a01a | |||
d849930e51 | |||
7a28fd0a50 | |||
5cab7c46a9 | |||
60d88139af | |||
8bdeab50ee | |||
f76561d101 | |||
9ed0796b4a | |||
3485f49f74 | |||
0861fad2e1 | |||
241fe69f7d | |||
9886e04a95 | |||
226099d64e | |||
50bf848ee8 | |||
bb6b8c7f13 | |||
fb6bca234f | |||
ee5e8ff4a1 | |||
1a3f96b58f | |||
8cce9b8a8c | |||
0fba2ae2f6 | |||
1efe6a27c5 | |||
7383f67874 | |||
c0ddf15add | |||
ae2d1487fa | |||
b2cb90c20f | |||
81a77828bd | |||
bca04841fe | |||
407a17bc77 | |||
211f1b5a85 | |||
013b4a8394 | |||
051f102aa0 | |||
c444b3f232 | |||
486d34a2c1 | |||
4626193f97 | |||
9d3c30ee53 | |||
cee53d0f2d | |||
ee0f9f00f5 | |||
69e66b04df | |||
e64954fbff | |||
f8e4f6f059 | |||
d1211cc089 | |||
b9f0330869 | |||
9454536b12 | |||
5591c3337b | |||
a9056d0e25 | |||
c97c65d655 | |||
82b84668b0 | |||
33cb9b3ba9 | |||
b127283040 | |||
2403fa2d81 | |||
c87e2e026e | |||
4be3fcfd31 | |||
c25229065a | |||
22ce56492f | |||
55c5a46440 | |||
4740159a3a | |||
40e01b0b21 | |||
3b1a00cf47 | |||
f61e08a9c3 | |||
30721436c0 | |||
6fef5b3a93 | |||
26c6f453f3 | |||
c94e5d0f4d | |||
ce2d5028b2 | |||
a3772428c1 | |||
973f79a103 | |||
e2ae2e5e42 | |||
4d75ba7749 | |||
ceb4769325 | |||
13a24d99ba | |||
bf9f94989d | |||
5cb880064d | |||
640c87c13a | |||
3c5c677a07 | |||
d97e380db8 | |||
19db9f3be1 | |||
986b9fcf51 | |||
28199950e9 | |||
04da75a2eb | |||
98b06878a5 | |||
a5c65bac53 | |||
e4b7d4fff0 | |||
b666a7aaee | |||
7bec48c688 | |||
46ebc9d518 | |||
9ba1dc040f | |||
f02713788d | |||
0409c5bcbe | |||
14e1cb1cd6 | |||
a771b15700 | |||
ddc048e075 | |||
69f8245f7b | |||
39c7c9df54 | |||
857c99fab5 | |||
8e743aea94 | |||
96e05128a1 | |||
f16510d034 | |||
302a891bbb | |||
eb1a658b25 | |||
ef0b996004 | |||
ee4c68b03c | |||
d8e8b06cb6 | |||
be98103e05 | |||
91d0d39569 | |||
c7922c4a35 | |||
6a3d2e7e4e | |||
d0a9f01b2f | |||
54e10cf472 | |||
127fba17ef | |||
a95dbb6367 | |||
445443cffc | |||
f73e89370d | |||
e4090760e8 | |||
ba6ca5b3b7 | |||
00b4ac6867 | |||
e28850c9d7 | |||
df22160173 | |||
5c18b85a8e | |||
1d5ae59db9 | |||
84acb50b02 | |||
6ef96cc15a | |||
c3492b1f7b | |||
07ac578a31 | |||
9b88906784 | |||
ad93f3d8ae | |||
d4010c9dc4 | |||
e9661a88c5 | |||
96c4416246 | |||
e886eeaa3e | |||
0f785a448a | |||
767db6ff26 | |||
ff11be93a0 | |||
bfd4e5d7fa | |||
5e20fca73e | |||
21c38b707c | |||
feef2bf71c | |||
bb0b4e7992 | |||
bedf235ff6 | |||
525e700bfa | |||
9087da05d5 | |||
debf3c704b | |||
22dace72df | |||
8f4057736a | |||
6678ea1ae3 | |||
1f3e2043cb | |||
332ce2bebc | |||
c74d03777a | |||
1f69967652 | |||
3ae16111ef | |||
886fe40922 | |||
840c927ac0 | |||
215ddad660 | |||
7e068cc77d | |||
9ae8a3128b | |||
6ccab8e071 | |||
08b75f06ef | |||
fafeea0857 | |||
0dc5843b57 | |||
c9d0dc7fb0 | |||
bf03c14518 | |||
f2e5918e79 | |||
0185d37473 | |||
928eb82d65 | |||
52dcf37f24 | |||
004ba36741 | |||
50c6b3f4b9 | |||
a1fe810a50 | |||
f47a586332 | |||
b02c9e5724 | |||
bf4310697d | |||
0cbc232dac | |||
a19c1cbecc | |||
7e47006f4f | |||
13acee8fd5 | |||
6752a86b83 | |||
c94470d33f | |||
0ca6c37e5d | |||
60bbe44e0e | |||
300ef8d8fe | |||
c0a6d8ac4c | |||
09c31b848b | |||
571704322d | |||
336b80cbbd | |||
3a19cc668d | |||
3a2cab4775 | |||
1bd7dab1a3 | |||
6bb9673630 | |||
5a936d315d | |||
52c8109ca3 | |||
a2f67a4f37 | |||
4330ff52ae | |||
f6dd2f6e52 | |||
dfecfebc69 | |||
838e25085a | |||
d7fd48ef7d | |||
c4dac7803f | |||
434d55b1ae | |||
ad4b441dc3 | |||
8989e27769 | |||
c6543b7c27 | |||
e7108a5656 | |||
2ef842a730 | |||
f63feaf017 | |||
f07bed4ecf | |||
416428444c | |||
e6ec5f31de | |||
85cebdb7e9 | |||
cb2b13778e | |||
2beb774eb9 | |||
b0ea4e7608 | |||
5760d64ef9 | |||
0309753561 | |||
096f5ee356 | |||
bf8f02d563 | |||
213c672969 | |||
78b7bbb92a | |||
d687677e38 | |||
adfad92f8f | |||
5c04c2f42b | |||
d83d6e077c | |||
c285848866 | |||
69396d34c1 | |||
c59cefdafc | |||
449d38bcd2 | |||
a21dca025e | |||
d035b449ea | |||
c3b22fe325 | |||
7840ebf98a | |||
4b5c6738e5 | |||
ee1d89fe55 | |||
29bf25ace6 | |||
3879be0f23 | |||
c53773a4a1 | |||
927a1758ba | |||
1006739e98 | |||
ba01a0a72b | |||
be5fad55ca | |||
00bbdfa254 | |||
c2512e9093 | |||
7a5865a407 | |||
b48a767595 | |||
7108c29035 | |||
ce914e508a | |||
18884cac95 | |||
6561fea296 | |||
70b3b87905 | |||
fed95f9c5e | |||
e649bc2809 | |||
67bb394852 | |||
5d4cae2a06 | |||
f89a76747e | |||
4ab88e6577 | |||
9a3f9fe488 | |||
dd7f06968a | |||
18da7bb692 | |||
f60a49d2ce | |||
1a7da200d1 | |||
5f9dec3dc8 | |||
82636e3596 | |||
6238bb0716 | |||
b81ce2956b | |||
6b10d9d428 | |||
2312f875e6 | |||
5c75d26c86 | |||
b79a74b35b | |||
6515f01800 | |||
ef9da685de | |||
d179343ce7 | |||
5fc5e15975 | |||
ab238c32e5 | |||
113b352474 | |||
f513ab77b3 | |||
6760d855bc | |||
147b0a6626 | |||
1e43784cc2 | |||
ffe9226aac | |||
1840176340 | |||
1f98d0f4f0 | |||
e57318f7c6 | |||
07aa2113b9 | |||
4b53549ae4 | |||
6a34bf544a | |||
d4d1391bbb | |||
fac4928d50 | |||
6d2f8cd50c | |||
1c37cc6a34 | |||
f99e333f30 | |||
5ce8549f03 | |||
c1f7299cfd | |||
abeee38126 | |||
a6c37f3dd3 | |||
10eca91311 | |||
60f712e6ba | |||
91675c4588 | |||
8bc2fddb9d | |||
1b6af9a4c1 | |||
37a8caf3fa | |||
d3e9108f12 | |||
6c84ed4674 | |||
04d9ecbb5a | |||
f4bcfc885a | |||
5a38827b01 | |||
174c04d5c8 | |||
57534b6e7c | |||
283583629e | |||
1de871a57b | |||
ce83e502f6 | |||
c5609dc889 | |||
c1ef5fc2bf | |||
845d529a50 | |||
ad14766278 | |||
ce7636ad18 | |||
1721dff4c7 | |||
04d94d9b60 | |||
8e8ddbc301 | |||
fc3658bc9d | |||
5616838007 | |||
87acf687d5 | |||
32716f3729 | |||
24f7143973 | |||
554577b139 | |||
9de092ba5f | |||
323d8d769c | |||
9fb4470248 | |||
772de85ce3 | |||
23b1b8464d | |||
8b20b39b31 | |||
10f8715bde | |||
f2b7e224ee | |||
220d1e8948 | |||
9e9bed0043 | |||
5de4e337c1 | |||
c9a640a3e2 | |||
ca45440ffe | |||
81baf8c47c | |||
f3c4c30853 | |||
0f9b199bfa | |||
e662b6433f | |||
c5b0ba17ea | |||
7b46fd6524 | |||
7310693b5f | |||
d6f9e8c640 | |||
2ad91339bb | |||
247a152d39 | |||
6ad90766a7 | |||
5a974ce75a | |||
6219c95040 | |||
89044396d9 | |||
164b6bd983 | |||
27c596fd35 | |||
df1236412b | |||
1dc9b97a5e | |||
504a1c2eba | |||
98e3c8aa79 | |||
614d69dc18 | |||
f40903e663 | |||
c06fbcfc93 | |||
926ba0036c | |||
bea2515a41 | |||
09c7bda6b1 | |||
305d2f99ed | |||
9798f152ca | |||
5afa66f194 | |||
d77ef04774 | |||
95eaeba960 | |||
0a288131c1 | |||
42fb8c229a | |||
8a9fae0e35 | |||
a610608785 | |||
b5fec39df8 | |||
572bf533f8 | |||
c95c924d53 |
13
.editorconfig
Normal file
13
.editorconfig
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
# editorconfig.org
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
end_of_line = lf
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
trim_trailing_whitespace = false
|
3
CONTRIBUTING.md → .github/CONTRIBUTING.md
vendored
3
CONTRIBUTING.md → .github/CONTRIBUTING.md
vendored
|
@ -29,6 +29,9 @@ Ideally, a bug report should include a pull request with failing specs.
|
||||||
[gist]: https://gist.github.com/
|
[gist]: https://gist.github.com/
|
||||||
|
|
||||||
## Submitting a Pull Request
|
## Submitting a Pull Request
|
||||||
|
|
||||||
|
**WE DO NOT ACCEPT NEW FEATURES FOR THE V3 BRANCH ANYMORE**
|
||||||
|
|
||||||
1. [Fork the repository.][fork]
|
1. [Fork the repository.][fork]
|
||||||
2. Create a topic [branch]. `git checkout -b local_topic_branch`
|
2. Create a topic [branch]. `git checkout -b local_topic_branch`
|
||||||
3. Add specs for your unimplemented feature or bug fix.
|
3. Add specs for your unimplemented feature or bug fix.
|
6
.gitignore
vendored
6
.gitignore
vendored
|
@ -1,3 +1,6 @@
|
||||||
|
.byebug_history
|
||||||
|
npm-debug.log
|
||||||
|
manifest.yaml
|
||||||
/.bundle
|
/.bundle
|
||||||
.DS_Store
|
.DS_Store
|
||||||
coverage
|
coverage
|
||||||
|
@ -10,6 +13,7 @@ Gemfile.lock
|
||||||
docs
|
docs
|
||||||
.rbenv-*
|
.rbenv-*
|
||||||
.ruby-version
|
.ruby-version
|
||||||
|
.ruby-gemset
|
||||||
.*.swp
|
.*.swp
|
||||||
build
|
build
|
||||||
doc
|
doc
|
||||||
|
@ -20,4 +24,4 @@ Makefile
|
||||||
.idea
|
.idea
|
||||||
*.sublime-workspace
|
*.sublime-workspace
|
||||||
/bin
|
/bin
|
||||||
middleman-core/fixtures/compass-sprites-app/source/images/icon-s0de2218f58.png
|
middleman-core/fixtures/compass-sprites-app/source/images/icon-s0de2218f58.png
|
||||||
|
|
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -1,3 +0,0 @@
|
||||||
[submodule "middleman-core/lib/middleman-more/templates/smacss"]
|
|
||||||
path = middleman-core/lib/middleman-more/templates/smacss
|
|
||||||
url = git@github.com:nsteiner/middleman-smacss.git
|
|
22
.rubocop.yml
22
.rubocop.yml
|
@ -10,11 +10,15 @@ AllCops:
|
||||||
- '**/tmp/**/*'
|
- '**/tmp/**/*'
|
||||||
- '**/bin/**/*'
|
- '**/bin/**/*'
|
||||||
- 'middleman-core/lib/middleman-core/step_definitions/**/*'
|
- 'middleman-core/lib/middleman-core/step_definitions/**/*'
|
||||||
- 'middleman-core/lib/vendored-middleman-deps/**/*'
|
|
||||||
- 'middleman-core/fixtures/**/*'
|
- 'middleman-core/fixtures/**/*'
|
||||||
- 'middleman-core/features/**/*'
|
- 'middleman-core/features/**/*'
|
||||||
- 'middleman-core/spec/**/*'
|
- 'middleman-core/spec/**/*'
|
||||||
DisplayCopNames: true
|
- 'middleman-cli/lib/middleman-cli/templates/**/*'
|
||||||
|
- 'middleman-cli/fixtures/**/*'
|
||||||
|
- 'middleman-cli/features/**/*'
|
||||||
|
- 'middleman-cli/spec/**/*'
|
||||||
|
DoubleNegation:
|
||||||
|
Enabled: false
|
||||||
LineLength:
|
LineLength:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
MethodLength:
|
MethodLength:
|
||||||
|
@ -47,7 +51,21 @@ FormatString:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
CaseIndentation:
|
CaseIndentation:
|
||||||
IndentWhenRelativeTo: end
|
IndentWhenRelativeTo: end
|
||||||
|
TrivialAccessors:
|
||||||
|
Enabled: false
|
||||||
|
SingleLineBlockParams:
|
||||||
|
Enabled: false
|
||||||
Metrics/AbcSize:
|
Metrics/AbcSize:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
Metrics/PerceivedComplexity:
|
Metrics/PerceivedComplexity:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
Style/ParallelAssignment:
|
||||||
|
Enabled: false
|
||||||
|
Style/BlockDelimiters:
|
||||||
|
Enabled: false
|
||||||
|
Style/MultilineBlockChain:
|
||||||
|
Enabled: false
|
||||||
|
Style/SpecialGlobalVars:
|
||||||
|
Enabled: false
|
||||||
|
Style/FrozenStringLiteralComment:
|
||||||
|
Enabled: false
|
||||||
|
|
23
.travis.yml
23
.travis.yml
|
@ -1,22 +1,23 @@
|
||||||
language: ruby
|
language: ruby
|
||||||
bundler_args: --without development
|
sudo: false
|
||||||
|
cache: bundler
|
||||||
|
before_script:
|
||||||
|
- bundle update
|
||||||
rvm:
|
rvm:
|
||||||
- ruby-head
|
- ruby-head
|
||||||
- 2.2
|
- 2.3.1
|
||||||
- 2.1
|
- 2.2.4
|
||||||
- 2.0
|
|
||||||
- 1.9.3
|
|
||||||
os:
|
os:
|
||||||
- linux
|
- linux
|
||||||
- osx
|
# - osx
|
||||||
cache: bundler
|
|
||||||
sudo: false
|
|
||||||
matrix:
|
matrix:
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- rvm: ruby-head
|
- rvm: ruby-head
|
||||||
env: TEST=true
|
env:
|
||||||
before_install: git submodule update --init --recursive
|
global:
|
||||||
|
- TEST=true
|
||||||
|
- CODECLIMATE_REPO_TOKEN=81787f7b1c3bfa937edadcafbc94f807bf5af5c1142c7b793f2d9969a271de1f
|
||||||
script: bundle exec rake test
|
script: bundle exec rake test
|
||||||
notifications:
|
notifications:
|
||||||
slack: middleman:JW9OvXmn1m3XrSERe8866nBR
|
slack: middleman:JW9OvXmn1m3XrSERe8866nBR
|
||||||
|
|
13
.yardopts
13
.yardopts
|
@ -1,10 +1,11 @@
|
||||||
middleman-*/lib/**/*.rb
|
middleman-*/lib/**/*.rb
|
||||||
--exclude middleman-core/lib/vendored-middleman-deps/
|
--exclude middleman-core/lib/vendored-middleman-deps/
|
||||||
--exclude middleman-core/lib/middleman-core/step_definitions
|
--exclude middleman-core/lib/middleman-core/step_definitions
|
||||||
--exclude middleman-core/lib/middleman-core/templates/default/
|
--exclude middleman-cli/lib/middleman-cli/templates/default/
|
||||||
--exclude middleman-core/lib/middleman-core/templates/html5/
|
--exclude middleman-cli/lib/middleman-cli/templates/html5/
|
||||||
--exclude middleman-core/lib/middleman-core/templates/mobile/
|
--exclude middleman-cli/lib/middleman-cli/templates/mobile/
|
||||||
--exclude middleman-core/lib/middleman-core/templates/shared/
|
--exclude middleman-cli/lib/middleman-cli/templates/shared/
|
||||||
--exclude middleman-core/lib/middleman-core/templates/extension/
|
--exclude middleman-cli/lib/middleman-cli/templates/extension/
|
||||||
--no-private
|
--no-private
|
||||||
--hide-void-return
|
--hide-void-return
|
||||||
|
--markup=markdown
|
690
CHANGELOG.md
690
CHANGELOG.md
|
@ -1,541 +1,161 @@
|
||||||
master
|
master
|
||||||
===
|
===
|
||||||
|
|
||||||
3.4.0
|
# 4.1.13
|
||||||
===
|
|
||||||
|
|
||||||
* Fix webrick restarts on Ruby 2.2
|
* Change how config options are passed to Thor. Removes new Thor warnings from #2017
|
||||||
* Empower link_to in a i18n context.
|
|
||||||
* Add retina files support on automatic_image_sizes
|
|
||||||
* Fix woff/woff2 confusion in asset hashing.
|
|
||||||
* Support `relative: false` on `stylesheet_link_tag` and `javascript_include_tag`
|
|
||||||
* New host detection in preview server. Provides better externally accessible host/ip information for connecting from mobile devices and virtual machines.
|
|
||||||
|
|
||||||
3.3.12
|
# 4.1.12
|
||||||
===
|
|
||||||
|
* Fix broken `ignore { |p| true }` form.
|
||||||
|
|
||||||
|
# 4.1.11
|
||||||
|
|
||||||
|
* Upgrade to Rack 2.
|
||||||
|
|
||||||
|
# 4.1.10
|
||||||
|
|
||||||
|
* Fix unicode issues in URL deeplinks.
|
||||||
|
* Add prefix option to asset_hash (#1949)
|
||||||
|
|
||||||
|
# 4.1.9
|
||||||
|
|
||||||
|
* Fix `--watcher-*` CLI flags.
|
||||||
|
* Allow spaces in paths to work with `link_to`. Fixes #1914
|
||||||
|
* Add support for dotenv
|
||||||
|
* Fix asset_url with asset_hash (#1919)
|
||||||
|
* Allow partial lookups without a current_resource (#1912)
|
||||||
|
|
||||||
|
# 4.1.8
|
||||||
|
|
||||||
|
* Expose `development?` and `production?` helpers to template context.
|
||||||
|
* require the `try` core extension (#1911)
|
||||||
|
* Fix contract for Sitemap::Store.register_resource_list_manipulator (#1907)
|
||||||
|
* Loosen contract on Resource#source_file to Maybe[String] (#1906)
|
||||||
|
* Let collection loops access ConfigContext for helpers. #1879
|
||||||
|
* Use https:// to clone templates (#1901)
|
||||||
|
* Allow numbers to be unique page_ids (#1886)
|
||||||
|
* Prevent infinite loop when encountering files where base filename is a possible templating engine
|
||||||
|
|
||||||
|
# 4.1.7
|
||||||
|
|
||||||
|
* Upgrade fastimage to 2.0
|
||||||
|
* Fix shutdown of external_pipeline commands when config.rb is changed. #1877
|
||||||
|
* Allow calls to `app.` to work as collections after initial config parse. #1876
|
||||||
|
|
||||||
|
|
||||||
|
# 4.1.5-4.1.6
|
||||||
|
|
||||||
|
* Fix file recursion when looking for possible asset dependencies. Major preview server performance improvement.
|
||||||
|
|
||||||
|
# 4.1.4
|
||||||
|
|
||||||
|
* Unify default extensions for all URL processing extensions. #1855
|
||||||
|
* Fix URL regex for `content: ` context of CSS. #1853
|
||||||
|
* Make sure CLI config over-rides `config.rb` order.
|
||||||
|
* Fix relative assets in some contexts. #1842
|
||||||
|
|
||||||
|
# 4.1.3
|
||||||
|
|
||||||
|
* Expose all top-level config options to CLI (flags now match config. latency -> watcher_latency, etc).
|
||||||
|
* Fix directory indexes with `.htm` and `.xhtml` files. #1821
|
||||||
|
|
||||||
|
# 4.1.2
|
||||||
|
|
||||||
|
* Add `page_id` concept. Using the `id` key in frontmatter, proxy or page will set an ID on a resource which can be referenced by `url_for` and `link_to`.
|
||||||
|
* Allow looking for `Gemfile` when setting up a project to fail gracefully.
|
||||||
|
* Send correct exit code when external_pipeline fails during build.
|
||||||
|
* Fix error when customizing `layouts_dir`. #1028
|
||||||
|
* Fix collections (commands in loops) not being processed by `page` command. #1226
|
||||||
|
* Correctly asset_hash sourcemap references.
|
||||||
|
|
||||||
|
# 4.1.1
|
||||||
|
|
||||||
|
* Fix bad code that made `/__middleman/` break.
|
||||||
|
|
||||||
|
# 4.1.0
|
||||||
|
|
||||||
|
* Add rewrite_ignore option to asset_hash, asset_host, cache_buster & relative_assets. This proc let's you opt-out of the extension behavior on a per-path basis.
|
||||||
|
* gzip extension now compresses svgs by default
|
||||||
|
* Fix the `encoding` option.
|
||||||
|
* Fix relative paths on `image_tag` helper.
|
||||||
|
* Correctly exit with error code on failed `init`
|
||||||
|
* Fixed `asset_hash` when path has query string or #hashes
|
||||||
|
* Fix new extension template
|
||||||
|
* Don't parse frontmatter on ignored files.
|
||||||
|
* Fix displaying frontmatter on `/__middleman/sitemap`
|
||||||
|
* Add `skip_build_clean` config which when set to a block, will avoid removing non-generated paths from build, like .git #1716
|
||||||
|
* Minor performance improvements
|
||||||
|
* DRY-up config.rb-specific commands like `ignore` or `path`.
|
||||||
|
* Fix automatic images with absolute (or images dir missing) paths in markdown. Fixes #1755
|
||||||
|
* Fix asset_host in combination with Google Analytics snippet. #1751
|
||||||
|
* Show an error message when git CLI is not available. #1765
|
||||||
|
* Correctly show file names of GZIP'ed assets. #1364
|
||||||
|
* Build file output is now parallel-ized! Use `middleman build --no-parallel` to disable.
|
||||||
|
* Make template file extensions that get layouts by default configurable via `config[:extensions_with_layout]`
|
||||||
|
* Remove `=` from inline url matcher. This means paths in HTML attributes MUST be quoted. Fixes #1780
|
||||||
|
|
||||||
|
# 4.0.0
|
||||||
|
|
||||||
|
* Add `:locales` and `:data` source types to the list of files which trigger a live-reload.
|
||||||
|
* Rename i18n `lang` and `langs` to `locale` and `locales`.
|
||||||
|
* Avoid matching URLs across new lines. #1689
|
||||||
|
* Load Middleman Directory when doing `init` over SSL
|
||||||
|
* Fix `external_pipeline` first runs running out of sequence.
|
||||||
|
|
||||||
|
# 4.0.0.rc.2
|
||||||
|
|
||||||
|
* Rather than applying layouts to all files which are not .txt, .css, .js, .json: the new behavior is to only default layouts to active for .html
|
||||||
|
* Switch from Ruby Sass to SassC.
|
||||||
|
* `relative_assets` extension overrides local `relative: false` option to stylesheet/javascript tag helpers.
|
||||||
|
* Add `before_server`-hook to the preview server which is run before the Webrick server is started
|
||||||
|
* Add `-d` to `middleman server` to make it run as daemon
|
||||||
|
* Trigger "Possible File Change" events on files which share an output or template type with a changed file. Allows LiveReload to update on partial changes.
|
||||||
|
* Added `import_file SOURCE, TARGET` and `import_path SOURCE_FOLDER` to copy resources from outside the project in. Does NOT do file change watching. Perfect for `bower_components`.
|
||||||
|
|
||||||
|
# 4.0.0.rc.1
|
||||||
|
|
||||||
|
* Removed ability to use JSON as frontmatter. Still allowed in data/ folder.
|
||||||
|
* Added YAML data postscript. Like frontmatter, but reversed. Attach content after the key/value data as a `:postscript` key to the data structure (if Hash).
|
||||||
|
|
||||||
|
# 4.0.0.beta.2
|
||||||
|
|
||||||
|
* Fixed regression causing exceptions to be silently thrown away outside of `--verbose` mode in the dev server.
|
||||||
|
* Pull in `--ssl` option from stable.
|
||||||
|
* Replace `hooks` gem with custom callback solution.
|
||||||
|
|
||||||
|
# 4.0.0.beta.1
|
||||||
|
|
||||||
|
* Add `resources` class method to extensions to allow simple string-based resource generation.
|
||||||
|
* rename `app.add_to_instance` to `Extension.expose_to_application` for adding extension-local methods to the shared app instance.
|
||||||
|
* rename `app.add_to_config_context` to `Extension.expose_to_config` for adding extension-local methods to the sandboxed scope of `config.rb`
|
||||||
|
* Add `Extension.expose_to_template`, which auto binds copies of extension-local methods into a Template context.
|
||||||
|
* Remove side-loading of CLI tasks from `tasks/`
|
||||||
|
* Add the option of naming `config.rb` as `middleman.rb`.
|
||||||
|
* Builder extracted from Thor. `after_build` hook now passes an instance of a Builder instead of the Thor CLI.
|
||||||
|
* New FileWatcher API.
|
||||||
|
* Remove the `partials_dir` setting. Partials should live next to content, or be addressed with absolute paths.
|
||||||
|
* Partials must be named with a leading underscore. `_my_snippet.html.erb`, not `my_snippet.html.erb`.
|
||||||
|
* Removed the `proxy` and `ignore` options for the `page` command in `config.rb`. Use the `proxy` and `ignore` commands instead of passing these options to `page`.
|
||||||
|
* The `page` command in `config.rb` can now be used to add data to the page via the `data` argument. It is accessed the same way as frontmatter data, via `current_resource.data`.
|
||||||
|
* Add support for `environments` with the `-e` CLI flag. Loads additional config from `environments/envname.rb`. Removed `development?` helper in favor of `environment?(:development)`. Added `server?` helper to differentiate between build and server mode.
|
||||||
|
* Removed `with_layout`. Use loops of `page` instead.
|
||||||
|
* Removed Queryable Sitemap API
|
||||||
|
* Removed `css_compressor` setting, use `activate :minify_css, :compressor =>` instead.
|
||||||
|
* Removed `js_compressor` setting, use `activate :minify_javascript, :compressor =>` instead.
|
||||||
|
* Removed ability to server folders of content statically (non-Middleman projects).
|
||||||
|
* Prevent local templates being loaded when $HOME is not set
|
||||||
|
* Removed "Implied Extension feature"
|
||||||
|
* Remove 'upgrade' and 'install' CLI commands.
|
||||||
|
* Gemfile may be in a parent directory of your Middleman project root (where 'config.rb' is).
|
||||||
|
* All dependencies for your Middleman project must be expressed in `Gemfile` - Bundler is no longer optional.
|
||||||
|
* Asciidoc information now available with the `asciidoc` local, which is a normal hash.
|
||||||
|
* Remove `page` template local. Use `current_resource` instead.
|
||||||
|
* Dropped support for providing a block to `page` & `proxy`.
|
||||||
|
* Dropped support for instance variables inside templates.
|
||||||
|
* Moved all rendering into `TemplateRenderer` and `FileRenderer`
|
||||||
|
* Placed all template evaluation inside the `TemplateContext` class
|
||||||
|
* 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`
|
* 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`
|
||||||
* The preview server URL will use the local hostname rather than '0.0.0.0'. It will also print out a URL based on the host's public IP in case that's useful.
|
|
||||||
* The `--host` flag and `config.rb` setting have been removed - the preview server will always bind to all interfaces.
|
|
||||||
|
|
||||||
3.3.11
|
|
||||||
===
|
|
||||||
* Add `srcset` option to `image_tag`. Also enables them in Markdown.
|
|
||||||
* Add jruby to the list of envs requiring tzinfo-data.
|
|
||||||
* Don't lookup resource for path if the path is absolute. Fixes #1195
|
|
||||||
* Make preview host and port configurable in config.rb and also expose those variables to extensions which are curious. Closes #1477
|
|
||||||
* Append assets hash to .woff2 files
|
|
||||||
* Rack support has been broken since v3.3.9, fix that. #1501
|
|
||||||
|
|
||||||
3.3.10
|
|
||||||
===
|
|
||||||
* Fixes #1469, missing `cattr_accessor` in Redcarpet support.
|
|
||||||
* Fix slim >= 3.0.0 deprecation warning
|
|
||||||
|
|
||||||
3.3.9
|
|
||||||
===
|
|
||||||
* Moved main `Application` from requiring to autoloading to work around some double-loading issues in Docker.
|
|
||||||
|
|
||||||
3.3.8
|
|
||||||
===
|
|
||||||
* Define a mime type for sourcemaps. #1451
|
|
||||||
* Asset hashing for image references in srcset
|
|
||||||
* Import patch to bugfix from Padrino Helpers #1401
|
|
||||||
* Better URI encoding and decoding #1406
|
|
||||||
* Update version of i18n
|
|
||||||
|
|
||||||
3.3.7
|
|
||||||
===
|
|
||||||
* Update new project template Gemfile to use HTTPS by default. #1372
|
|
||||||
|
|
||||||
3.3.6
|
|
||||||
===
|
|
||||||
|
|
||||||
* Use full paths instead of relative for `listen` gem. Fixes #1374
|
|
||||||
* Add force option to "middleman init". #1369
|
|
||||||
* Configuration addition for compass 1 compatibility.
|
|
||||||
* Catch File read exceptions in frontmatter.
|
|
||||||
* Remove duplicate attr_accessor. Closes #1352
|
|
||||||
* Update sass dependency to >= 3.4.0.
|
|
||||||
* Update compass dependency to >= 1.0.0, < 2.0.0
|
|
||||||
* Accept pandoc-style YAML frontmatter. #1350
|
|
||||||
* Add webp to image type lists.
|
|
||||||
|
|
||||||
3.3.5
|
|
||||||
===
|
|
||||||
|
|
||||||
* Update Padrino to ~> 0.12.3 (removed breadcrumb helper)
|
|
||||||
* Update compass-import-once to 1.0.5
|
|
||||||
* Fix issue with Slim partials. #1327
|
|
||||||
|
|
||||||
3.3.4
|
|
||||||
===
|
|
||||||
|
|
||||||
* Fix `automatic_alt_tags` error. #1341
|
|
||||||
* `partial` now looks for i18n suffixed filenames. #1333
|
|
||||||
* Allow excluding paths from `gzip`. #1268
|
|
||||||
* Let LiveReload work on 404 pages.
|
|
||||||
* Update `listen` dependency.
|
|
||||||
|
|
||||||
3.3.3
|
|
||||||
===
|
|
||||||
|
|
||||||
* Fix thread-safety issue #501 which could cause excepts when livereloading.
|
|
||||||
* Update to support Hooks 0.4.x dep.
|
|
||||||
* Update to support Padrino 0.12.2+ dep.
|
|
||||||
* Fix `after_render` manipulation of content. #1278
|
|
||||||
* Fix combo of compass-import-once and sass-globs. middleman/middleman-sprockets#56
|
|
||||||
|
|
||||||
3.3.0-3.3.2
|
|
||||||
===
|
|
||||||
|
|
||||||
* Update Padrino to 0.12.1. Introduces BREAKING CHANGE for Haml. Helpers which take blocks used to require `-` instead of `=` to work correctly. Now, all helpers which output content should use `=`. See: http://www.padrinorb.com/blog/upgrading-padrino-from-0-11-x-to-0-12-0-guide
|
|
||||||
* Update Haml to 4.x
|
|
||||||
* Disable Webrick reverse DNS lookup, vastly improving performance when accessing from a VM.
|
|
||||||
* Ignore `node_modules` in FileWatcher
|
|
||||||
* Add `tzinfo-data` for Windows users.
|
|
||||||
* Prefer loading layouts from `layouts_dir`
|
|
||||||
* Add `before_build` hook.
|
|
||||||
* Depend on Erubis and remove support for specifying another ERb engine.
|
|
||||||
* Removed the ability to set the `sass_cache_path`.
|
|
||||||
* Improved /__middleman/ meta pages. For example, sitemap view now calls out ignored resources, prints data/options better, and shows which special locals are available on a page.
|
|
||||||
* Bump Uglifier to 2.5.x
|
|
||||||
|
|
||||||
3.2.2
|
|
||||||
===
|
|
||||||
|
|
||||||
* Specify the full path to the NEWLINE constant
|
|
||||||
* Refactor some internals which were dependent on certain order of operations
|
|
||||||
* Updated i18n dep
|
|
||||||
* Updated Uglifier dep
|
|
||||||
|
|
||||||
3.2.1
|
|
||||||
===
|
|
||||||
|
|
||||||
* Allow path to be passed to page_classes. #1120
|
|
||||||
* Parallelize gzip extension using four threads. #1116
|
|
||||||
* Fix locale issue when using gzip extension
|
|
||||||
* Better handle UTF-8 filenames
|
|
||||||
* Update Padrino to 0.11.4 and Tilt to 1.4.1
|
|
||||||
|
|
||||||
3.2.0
|
|
||||||
===
|
|
||||||
|
|
||||||
* Dropped support for Ruby 1.8
|
|
||||||
* Dropped empty "middleman-more" gem
|
|
||||||
* Support the AsciiDoc format
|
|
||||||
* `page_classes` now prefixes class names starting with numbers with an alpha character. "x" by default.
|
|
||||||
* AREL-style sitemap query language no longer mutates on filter
|
|
||||||
* Logging can now be forwarded to a file
|
|
||||||
* Syntax errors in config.rb no longer hang the server
|
|
||||||
* Fixed memory leak when adding blocks to resources. #1020
|
|
||||||
* Support HEAD requests in the server
|
|
||||||
|
|
||||||
3.1.6
|
|
||||||
===
|
|
||||||
|
|
||||||
* Magic sitemap-aware links and image references now work when your markdown engine is Kramdown (the default for Middleman).
|
|
||||||
* Having the build directory be a symlink no longer causes the --clean (default) option to wipe out your build.
|
|
||||||
* Fix handling paths and URLs with spaces in them. #961
|
|
||||||
* Loosen up Kramdown dependency to allow for using version 1.2.
|
|
||||||
* Loosen up Listen dependency so it works with sass betas.
|
|
||||||
* Look for assets using url_for before falling back to the "images" directory. #1017
|
|
||||||
* Do not cache generated redirect index file. #1019
|
|
||||||
* Make an effort to handle spaces in filenames in a way that url_for can handle. #961
|
|
||||||
* Fix localization via filename extension. #1015
|
|
||||||
|
|
||||||
3.1.5
|
|
||||||
===
|
|
||||||
|
|
||||||
* Escape filenames in regexes. Fixes #942.
|
|
||||||
* Create automated alt tag addition, based on image name.
|
|
||||||
* Add listener latency option. (Aliased to -l)
|
|
||||||
* Add support/tests for Redcarpet 3.0.0 features
|
|
||||||
- :underline
|
|
||||||
- :highlight
|
|
||||||
- :disable_indented_code_blocks
|
|
||||||
* Fix support for
|
|
||||||
- :link_attributes
|
|
||||||
- :filter_html
|
|
||||||
|
|
||||||
3.1.4
|
|
||||||
===
|
|
||||||
|
|
||||||
* Support kramdown 1.1
|
|
||||||
* Support redcarpet's :no_links & :no_images. #951
|
|
||||||
|
|
||||||
3.1.3
|
|
||||||
===
|
|
||||||
|
|
||||||
* Fixed typo in rack extensions block
|
|
||||||
* Add support for nojekyll dotfile
|
|
||||||
|
|
||||||
3.1.2
|
|
||||||
===
|
|
||||||
|
|
||||||
* Locales regex was broken, selecting .yml files from data folder.
|
|
||||||
* Fix for implied extensions getting a layout. (Mentioned in #901)git pu
|
|
||||||
* Added `redirect` command for generating meta refreshes
|
|
||||||
|
|
||||||
3.1.1
|
|
||||||
===
|
|
||||||
|
|
||||||
* Check if set is redefining a param at the class level. Fixes #939
|
|
||||||
* Correctly escape `content_tag` when using a block. Fixes #941
|
|
||||||
|
|
||||||
3.1.0 Highlights
|
|
||||||
===
|
|
||||||
|
|
||||||
* Autoload support (moving away from middleman-more)
|
|
||||||
* New Configuration System
|
|
||||||
* New v4 Extension API
|
|
||||||
* `/__middleman' inspector
|
|
||||||
* Added Ruby 2.0, dropped Ruby 1.9.2
|
|
||||||
* Fully tested on JRuby 1.9
|
|
||||||
* Build defaults to --clean
|
|
||||||
|
|
||||||
3.1.0.rc.4
|
|
||||||
===
|
|
||||||
|
|
||||||
* Blocks with different templating languages than their layout now work as expected. #860
|
|
||||||
* Ruby 1.8 users will need to add the following to their Gemfiles:
|
|
||||||
platforms :mri_18 do
|
|
||||||
gem "ruby18_source_location"
|
|
||||||
end
|
|
||||||
* The `endpoint` method allows the building of Rack-based files or arbitrary content.
|
|
||||||
|
|
||||||
3.1.0.rc.2
|
|
||||||
===
|
|
||||||
|
|
||||||
* `layouts_dir` is now configurable
|
|
||||||
* Custom template classes can now override the file used for creating the project Gemfile.
|
|
||||||
* Add an "empty" template that produces the minimum necessary structure for a Middleman project.
|
|
||||||
* Fix ignoring layouts from the sitemap when the source directory has been set to something other than 'source'. #896
|
|
||||||
* Track test coverage with simplecov
|
|
||||||
* i18n only autodetects languages in the `locales` root
|
|
||||||
* Frontmatter cache fixes solve performance regressions found in 3.1.x
|
|
||||||
* Vendor padrino-* to avoid dep hell
|
|
||||||
* `middleman-more` gem returns, but it's empty for backwards compat
|
|
||||||
* Prefer internal files.exists? over ruby's slow File.exists?
|
|
||||||
|
|
||||||
3.1.0.rc.1
|
|
||||||
===
|
|
||||||
|
|
||||||
* Move more into core, autoloaded if gems are available.
|
|
||||||
* DataStore may now be accessed like a hash with #[] and #has_key?. #880
|
|
||||||
* The i18n extension now supports providing localized templates as separate files, like index.es.html.haml. #816, #823
|
|
||||||
* The list of regular expressions for which files are ignored by the file watcher are now configurable.
|
|
||||||
* Revert to Thor 0.15.x
|
|
||||||
* Revert to padrino-helpers 0.10.x (dependency hell)
|
|
||||||
* Drop i18n dep to match activesupport at 0.6.1
|
|
||||||
|
|
||||||
3.1.0.beta.2
|
|
||||||
===
|
|
||||||
|
|
||||||
* Extension template uses new class-based Extension
|
|
||||||
* Fix missing children in some sitemap traversal operations. #837
|
|
||||||
* Add respond_to? to DataStore. #872
|
|
||||||
* Allow discovery of prerelease gems. #873
|
|
||||||
* Include middleman-livereload in default Gemfile
|
|
||||||
* Update Rack dependency to 1.5.x
|
|
||||||
* Update to Listen 1.0.x
|
|
||||||
* Update to padrino-helpers 0.11.x
|
|
||||||
* Update uglifier to 2.0.x
|
|
||||||
* Convert all of middleman-more to new class-based Extensions
|
|
||||||
|
|
||||||
3.1.0.beta.1
|
|
||||||
===
|
|
||||||
|
|
||||||
* Support Slim 2.0 ::Slim::Embedded
|
|
||||||
* "middleman build" will clean out old files from the build directory by default now, without needing to pass "--clean". Pass "--no-clean" to disable. #862
|
|
||||||
* Allow frontmatter to be side-loaded from a neighboring file with a .frontmatter extension: #855
|
|
||||||
* Allow frontmatter "renderer_options" key to overwrite renderer options on a per-file basis. #859
|
|
||||||
* A custom :partials_dir may be configured, and partials will be looked up from it. #854
|
|
||||||
* The sprockets environment is now available before config.rb is run, so you can mess with it.
|
|
||||||
* Added a "t" helper that delegates to I18n.t, just like Rails. #853.
|
|
||||||
* I18n will fall back to the default locale if a translation in the current locale is not found. You can disable this behavior by passing `:no_fallbacks => true` when activating `:i18n`. More settings documented at https://github.com/svenfuchs/i18n/wiki/Fallbacks . #853
|
|
||||||
* Switched default Markdown engine to Kramdown. #852
|
|
||||||
* Overhaul content-type handling, and add a `:content_type` parameter for `page`, `proxy`, and frontmatter that allows for overriding the default content type. #851
|
|
||||||
* Fixes for upcoming Sass versions.
|
|
||||||
* Fix markdown filters in Haml 4 so that they don't throw errors when generating links/images and so they use our magic image_tag/link_to methods. #662
|
|
||||||
* Fix a number of bugs with i18n. Add a `:lang` option that can be used with `page` or `proxy` to set the I18n.locale of a page. #845
|
|
||||||
* Directory names in the data folder are treated as part of the data key. #836
|
|
||||||
* Properly reload the server when files change in "lib" or "helpers". #835
|
|
||||||
* Replace Rainpress CSS minifier with the one built into Sass.
|
|
||||||
* Changed 'default' and 'html5' templates to use 'current_page.data.title' instead of 'data.page.title'. #825
|
|
||||||
* Include file extension in template cache. #798
|
|
||||||
* Support for Ruby 2.0.0.
|
|
||||||
* "middleman console" will give you a console where you can mess around inside your middleman context. #775
|
|
||||||
* Add to Compass import paths instead of resetting them. #707
|
|
||||||
* There are now metadata pages in the preview server at "/__middleman/" that show information about the sitemap and site configuration. #374 and #776
|
|
||||||
* The sitemap is now queryable with an ARel-like API. #650
|
|
||||||
* Reorganize SMACSS template. #591
|
|
||||||
* No longer bundle native file watchers - add an appropriate gem (rb-fsevent for OS X, rb-inotify for Linux, wdm for windows) to your Gemfile.
|
|
||||||
* `activate :asset_host, :host => hostname` can be used to configure `:asset_host`.
|
|
||||||
* Path matchers (for things like ignore and page) correctly work with string matchers. #689
|
|
||||||
* Configuration has been moved to Middleman::Configuration::ConfigurationManager. This is backwards-compatible, but offers a nicer way of getting and setting configuration for extensions, including documenting those settings and their defaults. #620.
|
|
||||||
|
|
||||||
3.0.13
|
|
||||||
===
|
|
||||||
|
|
||||||
* Require Tilt 1.3.6 (older versions have errant .csv template type)
|
|
||||||
* Unregister Tilt HTML handler
|
|
||||||
* Fix dynamic multi-byte utf-8 files rebuilding. #806
|
|
||||||
* Force locale to english for number_to_human_size in the gzip extension. #804
|
|
||||||
* Don't use the logger from a trap context. Ruby 2.0.0 support. #801.
|
|
||||||
* Serve extensionless files or dotfiles with text/plain MIME type
|
|
||||||
|
|
||||||
3.0.12
|
|
||||||
===
|
|
||||||
|
|
||||||
* Update to listen 0.7.x. No longer depend on rb-inotify. *nix users should add to Gemfile.
|
|
||||||
* Support Haml 4
|
|
||||||
* :debug_assets can no longer be turned on in the build environment.
|
|
||||||
* Helpers now work with JS/CSS files with .erb processing.
|
|
||||||
* Provide an informative exception when link_to is used improperly.
|
|
||||||
* Force .svgz files to be treated as binary.
|
|
||||||
* Add a url_for method that performs the link_to magic URL generation without a link. Make form_for use url_for. #739
|
|
||||||
* Fix issues when combining relative assets and cache buster.
|
|
||||||
* Support the .yaml extension for data files.
|
|
||||||
* Handle non-english default languages in i18n. Fixes #584. #771
|
|
||||||
* Allow frontmatter to be parsed on templates outside the project root
|
|
||||||
* Improve detection of binary files. #763
|
|
||||||
* Add before_render and after_render hooks that can be used by extensions to modify templates before they're rendered or modify the rendered output before it's returned. #761 & #774
|
|
||||||
* Tightened up dependencies
|
|
||||||
* Print the command for running middleman in verbose mode with quotes so Bundler doesn't swallow the verbose flag. #750
|
|
||||||
|
|
||||||
3.0.11
|
|
||||||
====
|
|
||||||
|
|
||||||
* Mitigate major perf regression caused by the Middleman::Util#binary? method
|
|
||||||
|
|
||||||
3.0.10
|
|
||||||
====
|
|
||||||
|
|
||||||
* Avoid looking in binary files for frontmatter. #728
|
|
||||||
* Allow nested i18n files. #725
|
|
||||||
* Better adapt to Rack interface. #709
|
|
||||||
* Add --force-polling flag. #730, #644
|
|
||||||
|
|
||||||
3.0.9
|
|
||||||
====
|
|
||||||
|
|
||||||
* Lock Rack to 1.4.1 until BodyProxy bug is resolved. #709
|
|
||||||
* Safely de-register Tilt extensions which are missing gems. #713
|
|
||||||
|
|
||||||
3.0.8
|
|
||||||
====
|
|
||||||
|
|
||||||
* Directly send binary files in preview and copy them in build, avoiding reading large binary files into memory for rendering. #643 #699
|
|
||||||
* Make link_to helper ignore QueryString values when looking up Sitemap resources
|
|
||||||
* Directly copy binary files during build, and stream them during preview, to avoid reading them into memory
|
|
||||||
* Make sure all paths in Sitemap are using Pathname
|
|
||||||
|
|
||||||
3.0.7
|
|
||||||
====
|
|
||||||
|
|
||||||
* Turn html5 boilerplate into a layout
|
|
||||||
* Fix errors when templates have empty YAML
|
|
||||||
* Show the hostname when initializing MM
|
|
||||||
* Fix issues when using Redcarpet inside Slim
|
|
||||||
* Make automatic_image_sizes avoid SVGs
|
|
||||||
|
|
||||||
3.0.6
|
|
||||||
====
|
|
||||||
* Make Sitemap more thread-safe.
|
|
||||||
* Asset-hash fixes in conjunction with Sprockets.
|
|
||||||
* Proxy improvements.
|
|
||||||
* Handle directories with a tilde (~) in their path.
|
|
||||||
* Print better error message which port is already in use.
|
|
||||||
* Terminal signal improvements, shutsdown correctly when Terminal closed.
|
|
||||||
* Bundled Normalize.css updated to 2.0.1
|
|
||||||
* Fixed Encoding extension activation
|
|
||||||
* Reload i18n on file changes (#616)
|
|
||||||
|
|
||||||
3.0.5
|
|
||||||
====
|
|
||||||
* Require newer version of listen.
|
|
||||||
* Handful of sitemap speed improvements.
|
|
||||||
* Fix previewing of directories with periods in their name.
|
|
||||||
* Add CLI ability to skip gemfile and bundler init.
|
|
||||||
* Fix asset_hash when used in conjunction with Rack middleware.
|
|
||||||
* Fix LiveReload extension issues.
|
|
||||||
|
|
||||||
3.0.3-3.0.4
|
|
||||||
====
|
|
||||||
* Add reload_paths to server CLI to add additional paths to reload MM on change.
|
|
||||||
* Re-organize app reloading code, don't need to restart listen every time.
|
|
||||||
|
|
||||||
3.0.2
|
|
||||||
====
|
|
||||||
* Logger has no such method .warning. Closes #582
|
|
||||||
|
|
||||||
3.0.1
|
|
||||||
====
|
|
||||||
* HTML5 Boilerplate version 4.0.0
|
|
||||||
* Use wdm for Windows
|
|
||||||
* Fix buggy color renaming in built-in CSS minifier. #576
|
|
||||||
* Fix Sass/Scss filter in Slim templates
|
|
||||||
* Added SMACSS template
|
|
||||||
* Give file metadata (such as frontmatter) precedence over path meta. #552
|
|
||||||
* Add `sass_assets_paths` option for arbitrary sass partial locations.
|
|
||||||
* Don't catch CoffeeScript errors when in build mode.
|
|
||||||
* Extract load_paths so they aren't locked into the binary
|
|
||||||
* Add middleman/rack for better config.ru support
|
|
||||||
* Use centralized Logger and add benchmark methods
|
|
||||||
|
|
||||||
3.0.0
|
|
||||||
====
|
|
||||||
* Improve asset methods and link_to by making them more clever and aware of options such as relative_assets and http_prefix
|
|
||||||
* Refer to --verbose, instead of --debug in CLI error message (#505)
|
|
||||||
* Cleanup listener setup and teardown
|
|
||||||
* Update to Padrino 0.10.7 and Thor 0.15 (#495)
|
|
||||||
* Build output correctly shows update and identical, instead of create for all.
|
|
||||||
* automatic_directory_matcher (#491)
|
|
||||||
|
|
||||||
3.0.0.rc.2
|
|
||||||
====
|
|
||||||
* Doing a build now shows identical files (#475)
|
|
||||||
* asset_hash, minify_javascript, and minify_css can now accept regexes, globs,
|
|
||||||
and procs (#489, #480)
|
|
||||||
* The `link_to` helper can now accept a sitemap Resource as a URL (#474)
|
|
||||||
* The preview server now correctly listens for changes (#487, #464)
|
|
||||||
* HTMLs are now served with a 'utf-8' charset instead of 'utf8' (#478)
|
|
||||||
* UTF-8 is now the new default encoding for data and templates (#486, #483)
|
|
||||||
* New :encoding setting that allows users to change default encoding
|
|
||||||
* You may now use the `use` method with a block when adding Rack middleware
|
|
||||||
* Middleman now depends on Listen 0.4.5+ and ActiveSupport 3.2.6+
|
|
||||||
* Attempt to avoid issues with RVM's default Bundler (#466)
|
|
||||||
* Fix issue where Middleman won't start with Compass 0.12.2.rc.1 (#469)
|
|
||||||
|
|
||||||
3.0.0.rc.1
|
|
||||||
====
|
|
||||||
* Split into 3 gems (middleman-core, middleman-more and middleman which simply includes both)
|
|
||||||
* Rewritten to work directly with Rack (Sinatra apps can still be mounted)
|
|
||||||
* Sitemap maintains own state
|
|
||||||
* New Extension Registration API
|
|
||||||
* Remove old 1.x mm- binaries and messaging
|
|
||||||
* New default layout functionality: https://github.com/middleman/middleman/issues/165
|
|
||||||
* Enable chained templates outside of sprockets (file.html.markdown.erb)
|
|
||||||
* Sitemap object representing the known world
|
|
||||||
* FileWatcher proxies file change events
|
|
||||||
* Unified callback solution
|
|
||||||
* Removed Slim from base install. Will need to be installed and required by the user (in - config.rb)
|
|
||||||
* Activate mobile html5boilerplate template
|
|
||||||
* Update to Redcarpet for Markdown (breaks Haml :markdown filter)
|
|
||||||
* Return correct exit codes (0 for success, 1 for failure) from CLI
|
|
||||||
* Yard code docs: http://rubydoc.info/github/middleman/middleman
|
|
||||||
* config.rb and extensions can add command-line commands
|
|
||||||
* Nested layouts using `wrap_layout` helper
|
|
||||||
* Support for placekitten.com
|
|
||||||
* Added MM_ROOT environmental variable
|
|
||||||
* activating extensions can now take an options hash
|
|
||||||
* Don't re-minify files with ".min" in their name
|
|
||||||
* Serve purely static folders directly (without source/ and config.rb)
|
|
||||||
* Set ignored files and disable directory_indexes from YAML frontmatter
|
|
||||||
* Automatically load helper modules in helpers/ directory
|
|
||||||
* Add pid for cleanup
|
|
||||||
* Use guard/listen for file watching
|
|
||||||
* Merge full i18n support
|
|
||||||
* Implied file extensions (style.scss => style.css)
|
|
||||||
* Padrino 0.10.6
|
|
||||||
* `middleman init` generates a `Gemfile` by default.
|
|
||||||
* Errors stop the build and print a stacktrace rather than silently getting printed into files.
|
|
||||||
* `with_layout` works with globs or regexes.
|
|
||||||
* Setting `directory_index` from `page` with a glob or regex now works.
|
|
||||||
* `:gzip` extension for pre-gzipping files for better compression with no server CPU cost.
|
|
||||||
* `:asset_hash` extension that generates unique-by-content filenames for assets and rewrites references to use those filenames, so you can set far-future expires on your assets.
|
|
||||||
* Removed the `--relative` CLI option.
|
|
||||||
* Properly output Compass-generated sprited images.
|
|
||||||
* Switch built-in CSS compressor to Rainpress.
|
|
||||||
* Automatically load helper modules from `helpers/`, like Rails.
|
|
||||||
* `ignore` and `page` both work with file globs or regexes.
|
|
||||||
* `layout`, `ignore`, and `directory_index` can be set from front matter.
|
|
||||||
* JavaScript and CSS are minified no matter where they are in the site, including in inline code blocks.
|
|
||||||
* Files with just a template extension get output with the correct exension (foo.erb => foo.html)
|
|
||||||
* `link_to` is smart about source paths, and can produce relative URLs with the `:relative` option or the sitewide `:relative_links` setting.
|
|
||||||
* Include vendored assets in sprockets path.
|
|
||||||
* Finally support Compass in Sprockets! Thanks to @xdite and @petebrowne
|
|
||||||
* Moved Sprockets into an extension
|
|
||||||
* Support loading Less @imports
|
|
||||||
|
|
||||||
2.0.14
|
|
||||||
====
|
|
||||||
* Minor fix for i18n
|
|
||||||
|
|
||||||
2.0.13.2
|
|
||||||
====
|
|
||||||
* Update Windows eventmachine dep
|
|
||||||
|
|
||||||
2.0.13.1
|
|
||||||
====
|
|
||||||
* build --clean shouldn't remove dotfiles
|
|
||||||
|
|
||||||
2.0.13
|
|
||||||
====
|
|
||||||
* middleman build --clean keeps the build directory clean of leftover files
|
|
||||||
* Padrino 0.10.5 and Rack 1.3.5
|
|
||||||
|
|
||||||
2.0.12
|
|
||||||
====
|
|
||||||
* Sinatra 1.3.1 and Padrino 0.10.4
|
|
||||||
|
|
||||||
2.0.11
|
|
||||||
=====
|
|
||||||
* Lock Padrino and Sinatra versions (for now)
|
|
||||||
|
|
||||||
2.0.9
|
|
||||||
=====
|
|
||||||
* Added --glob option to build which only builds matching files
|
|
||||||
* Allow data/ files to be in JSON format as well
|
|
||||||
* Enabled Liquid {% include %} tag
|
|
||||||
* RubyInstaller-specific gem
|
|
||||||
* Allow access to data/ in config.rb
|
|
||||||
* Add mobile html5boilerplate template
|
|
||||||
|
|
||||||
2.0.8
|
|
||||||
=====
|
|
||||||
* Support accessing variables and data objects in ERb Sprockets files (library.js.coffee.erb)
|
|
||||||
* Make :markdown_engine support simple symbol names (:maruku instead of ::Tilt::MarkukuTemplate)
|
|
||||||
* Update Padrino deps to 0.10.2
|
|
||||||
* Include therubyracer on *nix
|
|
||||||
* Enable frontmatter for Liquid templates
|
|
||||||
|
|
||||||
2.0.7
|
|
||||||
=====
|
|
||||||
* Updated HTML5 Boilerplate to v2
|
|
||||||
* Make Rails 3.1 javascript gems available to Sprockets
|
|
||||||
|
|
||||||
2.0.6
|
|
||||||
=====
|
|
||||||
* Pulled out livereload feature into its own extension, still installed by default.
|
|
||||||
|
|
||||||
2.0.5
|
|
||||||
=====
|
|
||||||
* Vendored Padrino 0.10.0
|
|
||||||
|
|
||||||
2.0.4
|
|
||||||
=====
|
|
||||||
* Pulled out undocumented remote data feature into its own extension
|
|
||||||
|
|
||||||
2.0.3
|
|
||||||
=====
|
|
||||||
* Pulled out undocumented Blog feature into its own extension
|
|
||||||
|
|
||||||
2.0.2
|
|
||||||
=====
|
|
||||||
* Fixed Sprockets circular error
|
|
||||||
* Added auto-requiring extensions
|
|
||||||
|
|
||||||
2.0.0
|
|
||||||
=====
|
|
||||||
* Guard-powered auto-reloading of config.rb
|
|
||||||
* Guard LiveReload
|
|
||||||
* Sprockets JS
|
|
||||||
* Refactored Dynamically Reloadable Core
|
|
||||||
* Combine views/ and public/ into a single source/ folder.
|
|
||||||
* Support YAML front-matter
|
|
||||||
* Added callback to run code after Compass is configured
|
|
||||||
* Added support for a compass.config file which is passed directly to Compass
|
|
||||||
* Blog-aware Feature (and project template)
|
|
||||||
* Thor-based, unified `middleman` binary
|
|
||||||
* :directory_indexes feature
|
|
||||||
|
|
36
Gemfile
36
Gemfile
|
@ -5,36 +5,48 @@ gem 'rake', '~> 10.3', require: false
|
||||||
gem 'yard', '~> 0.8', require: false
|
gem 'yard', '~> 0.8', require: false
|
||||||
|
|
||||||
# Test tools
|
# Test tools
|
||||||
gem 'pry', '~> 0.10', group: :development
|
gem 'byebug'
|
||||||
gem 'aruba', '~> 0.7.4'
|
gem 'aruba', '~> 0.7.4', require: false
|
||||||
gem 'rspec', '~> 3.0'
|
gem 'rspec', '~> 3.0', require: false
|
||||||
gem 'cucumber', '~> 2.0'
|
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
|
# Optional middleman dependencies, included for tests
|
||||||
gem 'less', '2.3', require: false
|
gem 'haml', '>= 4.0.5', require: false
|
||||||
|
gem 'sassc', '~> 1.8', require: false
|
||||||
|
gem 'coffee-script', '~> 2.2', require: false
|
||||||
|
gem 'kramdown', '~> 1.2', require: false
|
||||||
gem 'slim', '>= 2.0', require: false
|
gem 'slim', '>= 2.0', require: false
|
||||||
gem 'liquid', '>= 2.6', require: false
|
gem 'liquid', '>= 2.6', require: false
|
||||||
gem 'stylus', '>= 1.0', require: false
|
gem 'stylus', '>= 1.0', require: false
|
||||||
gem 'sinatra', '>= 1.4', require: false
|
gem 'sinatra', '>= 2.0.0.beta2', require: false
|
||||||
gem 'redcarpet', '>= 3.1', require: false unless RUBY_ENGINE == 'jruby'
|
gem 'redcarpet', '>= 3.1', require: false
|
||||||
gem 'asciidoctor', '~> 0.1', require: false
|
|
||||||
|
|
||||||
# Dns server to test preview server
|
# Dns server to test preview server
|
||||||
gem 'rubydns', '~> 1.0.1', require: false
|
gem 'rubydns', '~> 1.0.1', require: false
|
||||||
|
|
||||||
# To test javascript
|
# To test javascript
|
||||||
gem 'poltergeist', '~> 1.6.0', require: false
|
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
|
# For less, note there is no compatible JS runtime for windows
|
||||||
gem 'therubyracer', '>= 0.12', platforms: :ruby
|
|
||||||
gem 'therubyrhino', '>= 2.0', platforms: :jruby
|
gem 'therubyrhino', '>= 2.0', platforms: :jruby
|
||||||
|
gem 'therubyracer', '>= 0.12', platforms: :ruby
|
||||||
|
|
||||||
# Code Quality
|
# Code Quality
|
||||||
gem 'rubocop', '~> 0.24', require: false
|
gem 'rubocop', '~> 0.24', require: false
|
||||||
gem 'simplecov', '~> 0.10', require: false
|
gem 'simplecov', '~> 0.10', require: false
|
||||||
gem 'coveralls', '~> 0.8', require: false
|
gem 'coveralls', '~> 0.8', require: false
|
||||||
|
gem 'codeclimate-test-reporter', '~> 0.3', require: false, group: :test
|
||||||
|
|
||||||
# Middleman itself
|
# Middleman itself
|
||||||
gem 'middleman', path: 'middleman'
|
gem 'middleman-cli', path: 'middleman-cli'
|
||||||
gem 'middleman-core', path: 'middleman-core'
|
gem 'middleman-core', path: 'middleman-core'
|
||||||
gem 'middleman-sprockets', github: 'middleman/middleman-sprockets', branch: 'v3-stable-real'
|
|
||||||
|
# gem 'middleman-compass', github: 'middleman/middleman-compass', require: false
|
||||||
|
# gem 'middleman-sprockets', github: 'middleman/middleman-sprockets', require: false
|
||||||
|
|
9
ISSUE_TEMPLATE.md
Normal file
9
ISSUE_TEMPLATE.md
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
## Expected behavior and actual behavior
|
||||||
|
|
||||||
|
## Steps to reproduce the problem (from a clean middleman installation)
|
||||||
|
|
||||||
|
## Additional information
|
||||||
|
|
||||||
|
- Ruby version:
|
||||||
|
- Middleman version:
|
||||||
|
- OS version:
|
|
@ -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
|
* [Sass](http://sass-lang.com/) for DRY stylesheets
|
||||||
* [CoffeeScript](http://coffeescript.org/) for safer and less verbose javascript
|
* [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
|
* [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?
|
**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
|
## 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
|
gem install middleman
|
||||||
|
@ -91,7 +91,7 @@ The best way to get quick responses to your issues and swift fixes to your bugs
|
||||||
|
|
||||||
## Donate
|
## 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
|
## Versioning
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ introduced with new major versions. As a result of this policy, you can (and
|
||||||
should) specify a dependency on this gem using the [Pessimistic Version
|
should) specify a dependency on this gem using the [Pessimistic Version
|
||||||
Constraint][pvc] with two digits of precision. For example:
|
Constraint][pvc] with two digits of precision. For example:
|
||||||
|
|
||||||
spec.add_dependency 'middleman-core', '~> 3.0'
|
spec.add_dependency 'middleman-core', '~> 4.0'
|
||||||
|
|
||||||
[semver]: http://semver.org/
|
[semver]: http://semver.org/
|
||||||
[pvc]: http://guides.rubygems.org/patterns/#pessimistic-version-constraint
|
[pvc]: http://guides.rubygems.org/patterns/#pessimistic-version-constraint
|
||||||
|
@ -121,5 +121,6 @@ Copyright (c) 2010-2015 Thomas Reynolds. MIT Licensed, see [LICENSE] for details
|
||||||
[codeclimate]: https://codeclimate.com/github/middleman/middleman
|
[codeclimate]: https://codeclimate.com/github/middleman/middleman
|
||||||
[gittip]: https://www.gittip.com/middleman/
|
[gittip]: https://www.gittip.com/middleman/
|
||||||
[rubyinstaller]: http://rubyinstaller.org/
|
[rubyinstaller]: http://rubyinstaller.org/
|
||||||
|
[RubyInstaller-Devkit]: http://rubyinstaller.org/add-ons/devkit/
|
||||||
[rubydoc]: http://rubydoc.info/github/middleman/middleman
|
[rubydoc]: http://rubydoc.info/github/middleman/middleman
|
||||||
[LICENSE]: https://github.com/middleman/middleman/blob/master/LICENSE.md
|
[LICENSE]: https://github.com/middleman/middleman/blob/master/LICENSE.md
|
||||||
|
|
11
Rakefile
11
Rakefile
|
@ -1,12 +1,11 @@
|
||||||
require 'rubygems' unless defined?(Gem)
|
|
||||||
require 'rake'
|
require 'rake'
|
||||||
|
|
||||||
require File.expand_path('../middleman-core/lib/middleman-core/version.rb', __FILE__)
|
require File.expand_path('../middleman-core/lib/middleman-core/version.rb', __FILE__)
|
||||||
|
|
||||||
ROOT = File.expand_path(File.dirname(__FILE__))
|
ROOT = File.expand_path(File.dirname(__FILE__))
|
||||||
GEM_NAME = 'middleman'
|
GEM_NAME = 'middleman'.freeze
|
||||||
|
|
||||||
middleman_gems = %w(middleman-core middleman)
|
middleman_gems = %w(middleman-core middleman-cli middleman)
|
||||||
GEM_PATHS = middleman_gems.freeze
|
GEM_PATHS = middleman_gems.freeze
|
||||||
|
|
||||||
def sh_rake(command)
|
def sh_rake(command)
|
||||||
|
@ -37,7 +36,7 @@ end
|
||||||
desc 'Generate documentation for all middleman gems'
|
desc 'Generate documentation for all middleman gems'
|
||||||
task :doc do
|
task :doc do
|
||||||
GEM_PATHS.each do |g|
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -46,14 +45,14 @@ task :test do
|
||||||
Rake::Task['rubocop'].invoke
|
Rake::Task['rubocop'].invoke
|
||||||
|
|
||||||
GEM_PATHS.each do |g|
|
GEM_PATHS.each do |g|
|
||||||
Dir.chdir("#{File.join(ROOT, g)}") { sh "#{Gem.ruby} -S rake test" }
|
Dir.chdir(File.join(ROOT, g).to_s) { sh "#{Gem.ruby} -S rake test" }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'Run specs for all middleman gems'
|
desc 'Run specs for all middleman gems'
|
||||||
task :spec do
|
task :spec do
|
||||||
GEM_PATHS.each do |g|
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
require 'rubygems' unless defined?(Gem)
|
|
||||||
require 'rake'
|
require 'rake'
|
||||||
require 'yard'
|
require 'yard'
|
||||||
|
|
||||||
|
@ -21,15 +20,14 @@ Cucumber::Rake::Task.new do |t|
|
||||||
exempt_tags << '--tags ~@encoding' unless Object.const_defined?(:Encoding)
|
exempt_tags << '--tags ~@encoding' unless Object.const_defined?(:Encoding)
|
||||||
exempt_tags << '--tags ~@nowindows' if Gem.win_platform?
|
exempt_tags << '--tags ~@nowindows' if Gem.win_platform?
|
||||||
exempt_tags << '--tags ~@travishatesme' if ENV['TRAVIS'] == 'true'
|
exempt_tags << '--tags ~@travishatesme' if ENV['TRAVIS'] == 'true'
|
||||||
t.cucumber_opts = "--require features --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
|
end
|
||||||
|
|
||||||
Cucumber::Rake::Task.new(:cucumber_wip) do |t|
|
Cucumber::Rake::Task.new(:cucumber_wip) do |t|
|
||||||
exempt_tags = ['--tags @wip']
|
exempt_tags = ['--tags @wip']
|
||||||
exempt_tags << '--tags ~@nojava' if RUBY_PLATFORM == 'java'
|
|
||||||
exempt_tags << '--tags ~@encoding' unless Object.const_defined?(:Encoding)
|
exempt_tags << '--tags ~@encoding' unless Object.const_defined?(:Encoding)
|
||||||
exempt_tags << '--tags ~@nowindows' if Gem.win_platform?
|
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
|
end
|
||||||
|
|
||||||
require 'rspec/core/rake_task'
|
require 'rspec/core/rake_task'
|
||||||
|
|
7
middleman-cli/.simplecov
Normal file
7
middleman-cli/.simplecov
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
SimpleCov.start do
|
||||||
|
add_filter '/fixtures/'
|
||||||
|
add_filter '/features/'
|
||||||
|
add_filter '/spec/'
|
||||||
|
add_filter '/step_definitions/'
|
||||||
|
add_filter '/lib/vendored-middleman-deps/'
|
||||||
|
end
|
9
middleman-cli/.yardopts
Normal file
9
middleman-cli/.yardopts
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
lib/**/*.rb
|
||||||
|
--exclude lib/middleman-cli/templates/default/
|
||||||
|
--exclude lib/middleman-cli/templates/html5/
|
||||||
|
--exclude lib/middleman-cli/templates/mobile/
|
||||||
|
--exclude lib/middleman-cli/templates/shared/
|
||||||
|
--exclude lib/middleman-cli/templates/extension/
|
||||||
|
--no-private
|
||||||
|
--hide-void-return
|
||||||
|
--markup=markdown
|
4
middleman-cli/Rakefile
Normal file
4
middleman-cli/Rakefile
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
# coding:utf-8
|
||||||
|
RAKE_ROOT = __FILE__.freeze
|
||||||
|
GEM_NAME = 'middleman-cli'.freeze
|
||||||
|
require File.expand_path(File.dirname(__FILE__) + '/../gem_rake_helper')
|
70
middleman-cli/bin/middleman
Executable file
70
middleman-cli/bin/middleman
Executable file
|
@ -0,0 +1,70 @@
|
||||||
|
#!/usr/bin/env ruby
|
||||||
|
|
||||||
|
require 'middleman-core/profiling'
|
||||||
|
if ARGV.include? '--profile'
|
||||||
|
Middleman::Profiling.profiler = Middleman::Profiling::RubyProfProfiler.new
|
||||||
|
end
|
||||||
|
# Middleman::Profiling.start
|
||||||
|
|
||||||
|
require "middleman-core/load_paths"
|
||||||
|
Middleman.setup_load_paths
|
||||||
|
|
||||||
|
require 'dotenv'
|
||||||
|
::Dotenv.load
|
||||||
|
|
||||||
|
require 'middleman-core'
|
||||||
|
require 'middleman-core/logger'
|
||||||
|
|
||||||
|
module Middleman::Cli
|
||||||
|
class << self
|
||||||
|
attr_accessor :config
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.import_config(base)
|
||||||
|
::Middleman::Cli.config.all_settings.each do |setting|
|
||||||
|
if setting.default.is_a?(String) || setting.default.is_a?(NilClass)
|
||||||
|
base.class_option setting.key,
|
||||||
|
type: :string,
|
||||||
|
desc: setting.description
|
||||||
|
elsif setting.default.is_a?(TrueClass) || setting.default.is_a?(FalseClass)
|
||||||
|
base.class_option setting.key,
|
||||||
|
type: :boolean,
|
||||||
|
desc: setting.description
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
require "middleman-cli"
|
||||||
|
|
||||||
|
# Change directory to the root
|
||||||
|
Dir.chdir(ENV["MM_ROOT"]) if ENV["MM_ROOT"]
|
||||||
|
|
||||||
|
# Default command is server
|
||||||
|
if ARGV[0] != 'help' && (ARGV.length < 1 || ARGV.first.include?('-'))
|
||||||
|
ARGV.unshift('server')
|
||||||
|
end
|
||||||
|
|
||||||
|
::Middleman::Logger.singleton(3)
|
||||||
|
::Middleman::Cli.config = ::Middleman::Application.new do
|
||||||
|
#
|
||||||
|
config[:environment] = (ENV['MM_ENV'] || ENV['RACK_ENV'] || 'development').to_sym
|
||||||
|
config[:mode] = :config
|
||||||
|
config[:exit_before_ready] = true
|
||||||
|
config[:watcher_disable] = true
|
||||||
|
config[:disable_sitemap] = true
|
||||||
|
end.config
|
||||||
|
|
||||||
|
# Require the Middleman version
|
||||||
|
require 'middleman-core/version'
|
||||||
|
|
||||||
|
# Include the core CLI items
|
||||||
|
require 'middleman-cli/init'
|
||||||
|
require 'middleman-cli/extension'
|
||||||
|
require 'middleman-cli/server'
|
||||||
|
require 'middleman-cli/build'
|
||||||
|
require 'middleman-cli/console'
|
||||||
|
require 'middleman-cli/config'
|
||||||
|
|
||||||
|
# Start the CLI
|
||||||
|
Middleman::Cli::Base.start(ARGV)
|
|
@ -9,6 +9,6 @@ Feature: Middleman New Extension CLI
|
||||||
| Rakefile |
|
| Rakefile |
|
||||||
| my-extension-library.gemspec |
|
| my-extension-library.gemspec |
|
||||||
| features/support/env.rb |
|
| features/support/env.rb |
|
||||||
| lib/middleman_extension.rb |
|
| lib/my-extension-library/extension.rb |
|
||||||
| lib/my-extension-library.rb |
|
| lib/my-extension-library.rb |
|
||||||
| .gitignore |
|
| .gitignore |
|
93
middleman-cli/features/cli_init.feature
Normal file
93
middleman-cli/features/cli_init.feature
Normal file
|
@ -0,0 +1,93 @@
|
||||||
|
Feature: Middleman CLI
|
||||||
|
|
||||||
|
Scenario: Create a new project
|
||||||
|
When I run `middleman init MY_PROJECT` interactively
|
||||||
|
And I type "y"
|
||||||
|
And I type "y"
|
||||||
|
And I type "y"
|
||||||
|
And I type "y"
|
||||||
|
Then the exit status should be 0
|
||||||
|
When I cd to "MY_PROJECT"
|
||||||
|
Then the following files should exist:
|
||||||
|
| Gemfile |
|
||||||
|
| .gitignore |
|
||||||
|
| config.rb |
|
||||||
|
| source/index.html.erb |
|
||||||
|
| source/layouts/layout.erb |
|
||||||
|
| source/javascripts/all.js |
|
||||||
|
| source/stylesheets/site.css.scss |
|
||||||
|
| source/stylesheets/_normalize.scss |
|
||||||
|
|
||||||
|
Scenario: Create a new project in the current directory
|
||||||
|
Given a directory named "MY_PROJECT"
|
||||||
|
When I cd to "MY_PROJECT"
|
||||||
|
And I run `middleman init` interactively
|
||||||
|
And I type "y"
|
||||||
|
And I type "y"
|
||||||
|
And I type "y"
|
||||||
|
And I type "y"
|
||||||
|
Then the exit status should be 0
|
||||||
|
And the following files should exist:
|
||||||
|
| Gemfile |
|
||||||
|
| config.rb |
|
||||||
|
| source/index.html.erb |
|
||||||
|
|
||||||
|
Scenario: Create a new project (alias i)
|
||||||
|
When I run `middleman i MY_PROJECT` interactively
|
||||||
|
And I type "y"
|
||||||
|
And I type "y"
|
||||||
|
And I type "y"
|
||||||
|
And I type "y"
|
||||||
|
Then a directory named "MY_PROJECT" should exist
|
||||||
|
|
||||||
|
Scenario: Create a new project (alias new)
|
||||||
|
When I run `middleman new MY_PROJECT` interactively
|
||||||
|
And I type "y"
|
||||||
|
And I type "y"
|
||||||
|
And I type "y"
|
||||||
|
And I type "y"
|
||||||
|
Then a directory named "MY_PROJECT" should exist
|
||||||
|
|
||||||
|
Scenario: Create a new project (alias n)
|
||||||
|
When I run `middleman n MY_PROJECT` interactively
|
||||||
|
And I type "y"
|
||||||
|
And I type "y"
|
||||||
|
And I type "y"
|
||||||
|
And I type "y"
|
||||||
|
Then a directory named "MY_PROJECT" should exist
|
||||||
|
|
||||||
|
Scenario: Create a new project using Middleman directory
|
||||||
|
When I run `middleman init MY_PROJECT -T blog`
|
||||||
|
Then a directory named "MY_PROJECT" should exist
|
||||||
|
When I cd to "MY_PROJECT"
|
||||||
|
And the file "Gemfile" should contain "middleman-blog"
|
||||||
|
And the file ".gitignore" should exist
|
||||||
|
|
||||||
|
Scenario: Create an invalid project using Middleman directory
|
||||||
|
When I run `middleman init MY_PROJECT -T does-not-exist-for-reals`
|
||||||
|
Then the exit status should be 1
|
||||||
|
|
||||||
|
Scenario: Create a new project using github(user/repository)
|
||||||
|
When I run `middleman init MY_PROJECT -T middleman/middleman-templates-default` interactively
|
||||||
|
And I type "y"
|
||||||
|
And I type "y"
|
||||||
|
And I type "y"
|
||||||
|
And I type "y"
|
||||||
|
Then a directory named "MY_PROJECT" should exist
|
||||||
|
|
||||||
|
Scenario: Create a new project using github(user/repository#branch)
|
||||||
|
When I run `middleman init MY_PROJECT -T middleman/middleman-templates-default#master` interactively
|
||||||
|
And I type "y"
|
||||||
|
And I type "y"
|
||||||
|
And I type "y"
|
||||||
|
And I type "y"
|
||||||
|
Then a directory named "MY_PROJECT" should exist
|
||||||
|
And the output should contain "-b master"
|
||||||
|
|
||||||
|
Scenario: Create a new project using full path(://)
|
||||||
|
When I run `middleman init MY_PROJECT -T https://github.com/middleman/middleman-templates-default.git` interactively
|
||||||
|
And I type "y"
|
||||||
|
And I type "y"
|
||||||
|
And I type "y"
|
||||||
|
And I type "y"
|
||||||
|
Then a directory named "MY_PROJECT" should exist
|
17
middleman-cli/features/preview_server-hook.feature
Normal file
17
middleman-cli/features/preview_server-hook.feature
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
Feature: Run preview server before hook
|
||||||
|
|
||||||
|
Scenario: When run
|
||||||
|
Given a fixture app "preview-server-hook-app"
|
||||||
|
And the default aruba timeout is 30 seconds
|
||||||
|
When I run `middleman server --server-name localhost --bind-address 127.0.0.1` interactively
|
||||||
|
And I stop middleman if the output contains:
|
||||||
|
"""
|
||||||
|
### END ###
|
||||||
|
"""
|
||||||
|
Then the output should contain:
|
||||||
|
"""
|
||||||
|
/// 127.0.0.1:4567 ///
|
||||||
|
/// 4567 ///
|
||||||
|
/// localhost ///
|
||||||
|
/// http://localhost:4567 ///
|
||||||
|
"""
|
|
@ -31,7 +31,7 @@ Feature: Run the preview server
|
||||||
"""
|
"""
|
||||||
Then the output should contain:
|
Then the output should contain:
|
||||||
"""
|
"""
|
||||||
The Middleman preview server is bind to ":::4567", "0.0.0.0:4567"
|
The Middleman preview server is bound to ":::4567", "0.0.0.0:4567"
|
||||||
"""
|
"""
|
||||||
And the output should contain:
|
And the output should contain:
|
||||||
"""
|
"""
|
||||||
|
@ -42,7 +42,7 @@ Feature: Run the preview server
|
||||||
Inspect your site configuration at "http://
|
Inspect your site configuration at "http://
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ruby-2.1
|
@wip
|
||||||
Scenario: Start the server with defaults in verbose mode, when a local mdns server resolves the local hostname
|
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
|
Given I start a mdns server for the local hostname
|
||||||
When I run `middleman server --verbose` interactively
|
When I run `middleman server --verbose` interactively
|
||||||
|
@ -52,7 +52,7 @@ Feature: Run the preview server
|
||||||
"""
|
"""
|
||||||
Then the output should contain:
|
Then the output should contain:
|
||||||
"""
|
"""
|
||||||
The Middleman preview server is bind to ":::4567", "0.0.0.0:4567"
|
The Middleman preview server is bound to ":::4567", "0.0.0.0:4567"
|
||||||
"""
|
"""
|
||||||
And the output should contain:
|
And the output should contain:
|
||||||
"""
|
"""
|
||||||
|
@ -76,7 +76,7 @@ Feature: Run the preview server
|
||||||
"""
|
"""
|
||||||
Then the output should contain:
|
Then the output should contain:
|
||||||
"""
|
"""
|
||||||
The Middleman preview server is bind to "127.0.0.1:4567"
|
The Middleman preview server is bound to "127.0.0.1:4567"
|
||||||
"""
|
"""
|
||||||
And the output should contain:
|
And the output should contain:
|
||||||
"""
|
"""
|
||||||
|
@ -104,7 +104,7 @@ Feature: Run the preview server
|
||||||
"""
|
"""
|
||||||
Then the output should contain:
|
Then the output should contain:
|
||||||
"""
|
"""
|
||||||
The Middleman preview server is bind to "127.0.0.1:4567"
|
The Middleman preview server is bound to "127.0.0.1:4567"
|
||||||
"""
|
"""
|
||||||
And the output should contain:
|
And the output should contain:
|
||||||
"""
|
"""
|
||||||
|
@ -115,6 +115,7 @@ Feature: Run the preview server
|
||||||
Inspect your site configuration at "http://127.0.0.1:4567/__middleman"
|
Inspect your site configuration at "http://127.0.0.1:4567/__middleman"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@wip
|
||||||
Scenario: Start the server with bind address 127.0.0.5
|
Scenario: Start the server with bind address 127.0.0.5
|
||||||
|
|
||||||
This will have no hostname attached because the hosts file, the DNS server
|
This will have no hostname attached because the hosts file, the DNS server
|
||||||
|
@ -127,7 +128,7 @@ Feature: Run the preview server
|
||||||
"""
|
"""
|
||||||
Then the output should contain:
|
Then the output should contain:
|
||||||
"""
|
"""
|
||||||
The Middleman preview server is bind to "127.0.0.5:4567"
|
The Middleman preview server is bound to "127.0.0.5:4567"
|
||||||
"""
|
"""
|
||||||
And the output should contain:
|
And the output should contain:
|
||||||
"""
|
"""
|
||||||
|
@ -151,7 +152,7 @@ Feature: Run the preview server
|
||||||
"""
|
"""
|
||||||
Then the output should contain:
|
Then the output should contain:
|
||||||
"""
|
"""
|
||||||
The Middleman preview server is bind to "::1:4567"
|
The Middleman preview server is bound to "::1:4567"
|
||||||
"""
|
"""
|
||||||
And the output should contain:
|
And the output should contain:
|
||||||
"""
|
"""
|
||||||
|
@ -170,7 +171,7 @@ Feature: Run the preview server
|
||||||
"""
|
"""
|
||||||
Then the output should contain:
|
Then the output should contain:
|
||||||
"""
|
"""
|
||||||
The Middleman preview server is bind to "0.0.0.0:4567"
|
The Middleman preview server is bound to "0.0.0.0:4567"
|
||||||
"""
|
"""
|
||||||
And the output should contain:
|
And the output should contain:
|
||||||
"""
|
"""
|
||||||
|
@ -189,7 +190,7 @@ Feature: Run the preview server
|
||||||
"""
|
"""
|
||||||
Then the output should contain:
|
Then the output should contain:
|
||||||
"""
|
"""
|
||||||
The Middleman preview server is bind to ":::4567"
|
The Middleman preview server is bound to ":::4567"
|
||||||
"""
|
"""
|
||||||
And the output should contain:
|
And the output should contain:
|
||||||
"""
|
"""
|
||||||
|
@ -213,7 +214,7 @@ Feature: Run the preview server
|
||||||
"""
|
"""
|
||||||
Then the output should contain:
|
Then the output should contain:
|
||||||
"""
|
"""
|
||||||
The Middleman preview server is bind to "127.0.0.1:4567"
|
The Middleman preview server is bound to "127.0.0.1:4567"
|
||||||
"""
|
"""
|
||||||
And the output should contain:
|
And the output should contain:
|
||||||
"""
|
"""
|
||||||
|
@ -241,7 +242,7 @@ Feature: Run the preview server
|
||||||
"""
|
"""
|
||||||
Then the output should contain:
|
Then the output should contain:
|
||||||
"""
|
"""
|
||||||
The Middleman preview server is bind to "127.0.0.1:4567"
|
The Middleman preview server is bound to "127.0.0.1:4567"
|
||||||
"""
|
"""
|
||||||
And the output should contain:
|
And the output should contain:
|
||||||
"""
|
"""
|
||||||
|
@ -265,7 +266,7 @@ Feature: Run the preview server
|
||||||
"""
|
"""
|
||||||
Then the output should contain:
|
Then the output should contain:
|
||||||
"""
|
"""
|
||||||
The Middleman preview server is bind to "127.0.0.1:4567"
|
The Middleman preview server is bound to "127.0.0.1:4567"
|
||||||
"""
|
"""
|
||||||
And the output should contain:
|
And the output should contain:
|
||||||
"""
|
"""
|
||||||
|
@ -284,7 +285,7 @@ Feature: Run the preview server
|
||||||
"""
|
"""
|
||||||
Then the output should contain:
|
Then the output should contain:
|
||||||
"""
|
"""
|
||||||
The Middleman preview server is bind to "127.0.0.1:4567"
|
The Middleman preview server is bound to "127.0.0.1:4567"
|
||||||
"""
|
"""
|
||||||
And the output should contain:
|
And the output should contain:
|
||||||
"""
|
"""
|
||||||
|
@ -303,7 +304,7 @@ Feature: Run the preview server
|
||||||
"""
|
"""
|
||||||
Then the output should contain:
|
Then the output should contain:
|
||||||
"""
|
"""
|
||||||
The Middleman preview server is bind to "::1:4567"
|
The Middleman preview server is bound to "::1:4567"
|
||||||
"""
|
"""
|
||||||
And the output should contain:
|
And the output should contain:
|
||||||
"""
|
"""
|
||||||
|
@ -322,7 +323,7 @@ Feature: Run the preview server
|
||||||
"""
|
"""
|
||||||
Then the output should contain:
|
Then the output should contain:
|
||||||
"""
|
"""
|
||||||
The Middleman preview server is bind to ":::4567", "0.0.0.0:4567"
|
The Middleman preview server is bound to ":::4567", "0.0.0.0:4567"
|
||||||
"""
|
"""
|
||||||
And the output should contain:
|
And the output should contain:
|
||||||
"""
|
"""
|
||||||
|
@ -341,7 +342,7 @@ Feature: Run the preview server
|
||||||
"""
|
"""
|
||||||
Then the output should contain:
|
Then the output should contain:
|
||||||
"""
|
"""
|
||||||
The Middleman preview server is bind to ":::65432", "0.0.0.0:65432"
|
The Middleman preview server is bound to ":::65432", "0.0.0.0:65432"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
Scenario: Start the server with port 65432 configured via config.rb
|
Scenario: Start the server with port 65432 configured via config.rb
|
||||||
|
@ -356,9 +357,10 @@ Feature: Run the preview server
|
||||||
"""
|
"""
|
||||||
Then the output should contain:
|
Then the output should contain:
|
||||||
"""
|
"""
|
||||||
The Middleman preview server is bind to ":::65432", "0.0.0.0:65432"
|
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
|
Scenario: Start the server when port is blocked by other middleman instance
|
||||||
Given `middleman server` is running in background
|
Given `middleman server` is running in background
|
||||||
When I run `middleman server --verbose` interactively
|
When I run `middleman server --verbose` interactively
|
||||||
|
@ -456,7 +458,7 @@ Feature: Run the preview server
|
||||||
"""
|
"""
|
||||||
Then the output should contain:
|
Then the output should contain:
|
||||||
"""
|
"""
|
||||||
The Middleman preview server is bind to "127.0.0.1:4567"
|
The Middleman preview server is bound to "127.0.0.1:4567"
|
||||||
"""
|
"""
|
||||||
And the output should contain:
|
And the output should contain:
|
||||||
"""
|
"""
|
||||||
|
@ -467,7 +469,8 @@ Feature: Run the preview server
|
||||||
Inspect your site configuration at "http://www.example.com:4567/__middleman", "http://127.0.0.1:4567/__middleman"
|
Inspect your site configuration at "http://www.example.com:4567/__middleman", "http://127.0.0.1:4567/__middleman"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ruby-2.1
|
@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
|
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".
|
To make the mdns resolver resolve a name, it needs to end with ".local".
|
||||||
|
@ -488,7 +491,7 @@ Feature: Run the preview server
|
||||||
"""
|
"""
|
||||||
Then the output should contain:
|
Then the output should contain:
|
||||||
"""
|
"""
|
||||||
The Middleman preview server is bind to "127.0.0.1:4567"
|
The Middleman preview server is bound to "127.0.0.1:4567"
|
||||||
"""
|
"""
|
||||||
And the output should contain:
|
And the output should contain:
|
||||||
"""
|
"""
|
||||||
|
@ -499,7 +502,8 @@ Feature: Run the preview server
|
||||||
Inspect your site configuration at "http://host.local:4567/__middleman", "http://127.0.0.1:4567/__middleman"
|
Inspect your site configuration at "http://host.local:4567/__middleman", "http://127.0.0.1:4567/__middleman"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ruby-2.1
|
@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
|
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
|
To make the mdns resolver resolve a name, it needs to end with ".local". If
|
||||||
|
@ -520,7 +524,7 @@ Feature: Run the preview server
|
||||||
"""
|
"""
|
||||||
Then the output should contain:
|
Then the output should contain:
|
||||||
"""
|
"""
|
||||||
The Middleman preview server is bind to "127.0.0.1:4567"
|
The Middleman preview server is bound to "127.0.0.1:4567"
|
||||||
"""
|
"""
|
||||||
And the output should contain:
|
And the output should contain:
|
||||||
"""
|
"""
|
19
middleman-cli/features/support/env.rb
Normal file
19
middleman-cli/features/support/env.rb
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
ENV["TEST"] = "true"
|
||||||
|
|
||||||
|
require 'sassc'
|
||||||
|
|
||||||
|
require 'simplecov'
|
||||||
|
SimpleCov.root(File.expand_path(File.dirname(__FILE__) + '/../..'))
|
||||||
|
|
||||||
|
require 'phantomjs/poltergeist'
|
||||||
|
Capybara.javascript_driver = :poltergeist
|
||||||
|
|
||||||
|
require 'coveralls'
|
||||||
|
Coveralls.wear!
|
||||||
|
|
||||||
|
require 'codeclimate-test-reporter'
|
||||||
|
CodeClimate::TestReporter.start
|
||||||
|
|
||||||
|
PROJECT_ROOT_PATH = File.dirname(File.dirname(File.dirname(__FILE__)))
|
||||||
|
require File.join(PROJECT_ROOT_PATH, 'lib', 'middleman-cli')
|
||||||
|
require File.join(File.dirname(PROJECT_ROOT_PATH), 'middleman-core', 'lib', 'middleman-core', 'step_definitions')
|
|
@ -24,7 +24,7 @@ interfaces = [
|
||||||
|
|
||||||
|
|
||||||
# Start the RubyDNS server
|
# Start the RubyDNS server
|
||||||
RubyDNS::run_server(:listen => interfaces) do
|
RubyDNS::run_server(listen: interfaces) do
|
||||||
db.each do |matcher, result|
|
db.each do |matcher, result|
|
||||||
match(matcher, Resolv::DNS::Resource::IN::A) do |transaction|
|
match(matcher, Resolv::DNS::Resource::IN::A) do |transaction|
|
||||||
transaction.respond!(result)
|
transaction.respond!(result)
|
19
middleman-cli/fixtures/preview-server-hook-app/config.rb
Normal file
19
middleman-cli/fixtures/preview-server-hook-app/config.rb
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
set :layout, false
|
||||||
|
|
||||||
|
class MyFeature < Middleman::Extension
|
||||||
|
def initialize(app, options_hash = {}, &block)
|
||||||
|
super
|
||||||
|
|
||||||
|
app.before_server do |server_information|
|
||||||
|
puts "/// #{server_information.listeners.first} ///"
|
||||||
|
puts "/// #{server_information.port} ///"
|
||||||
|
puts "/// #{server_information.server_name} ///"
|
||||||
|
puts "/// #{server_information.site_addresses.first} ///"
|
||||||
|
puts "/// ### END ### ///"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
::Middleman::Extensions.register(:my_feature, MyFeature)
|
||||||
|
|
||||||
|
activate :my_feature
|
|
@ -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>
|
23
middleman-cli/lib/middleman-cli.rb
Normal file
23
middleman-cli/lib/middleman-cli.rb
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
# rubocop:disable FileName
|
||||||
|
|
||||||
|
# Setup our load paths
|
||||||
|
libdir = File.expand_path(File.dirname(__FILE__))
|
||||||
|
$LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
|
||||||
|
|
||||||
|
# Require Thor since that's what the whole CLI is built around
|
||||||
|
require 'thor'
|
||||||
|
|
||||||
|
# CLI Module
|
||||||
|
module Middleman::Cli
|
||||||
|
# The base task from which everything else extends
|
||||||
|
class Base < ::Thor
|
||||||
|
desc 'version', 'Show version'
|
||||||
|
def version
|
||||||
|
say "Middleman #{Middleman::VERSION}"
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.exit_on_failure?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
140
middleman-cli/lib/middleman-cli/build.rb
Normal file
140
middleman-cli/lib/middleman-cli/build.rb
Normal file
|
@ -0,0 +1,140 @@
|
||||||
|
require 'middleman-core/application'
|
||||||
|
|
||||||
|
# CLI Module
|
||||||
|
module Middleman::Cli
|
||||||
|
# The CLI Build class
|
||||||
|
class Build < Thor::Group
|
||||||
|
include Thor::Actions
|
||||||
|
|
||||||
|
check_unknown_options!
|
||||||
|
|
||||||
|
class_option :environment,
|
||||||
|
aliases: '-e',
|
||||||
|
default: ENV['MM_ENV'] || ENV['RACK_ENV'] || :production
|
||||||
|
class_option :clean,
|
||||||
|
type: :boolean,
|
||||||
|
default: true,
|
||||||
|
desc: 'Remove orphaned files from build (--no-clean to disable)'
|
||||||
|
class_option :parallel,
|
||||||
|
type: :boolean,
|
||||||
|
default: true,
|
||||||
|
desc: 'Output files in parallel (--no-parallel to disable)'
|
||||||
|
class_option :glob,
|
||||||
|
type: :string,
|
||||||
|
aliases: '-g',
|
||||||
|
default: nil,
|
||||||
|
desc: 'Build a subset of the project'
|
||||||
|
class_option :verbose,
|
||||||
|
type: :boolean,
|
||||||
|
default: false,
|
||||||
|
desc: 'Print debug messages'
|
||||||
|
class_option :instrument,
|
||||||
|
type: :boolean,
|
||||||
|
default: false,
|
||||||
|
desc: 'Print instrument messages'
|
||||||
|
class_option :profile,
|
||||||
|
type: :boolean,
|
||||||
|
default: false,
|
||||||
|
desc: 'Generate profiling report for the build'
|
||||||
|
|
||||||
|
Middleman::Cli.import_config(self)
|
||||||
|
|
||||||
|
# Core build Thor command
|
||||||
|
# @return [void]
|
||||||
|
def build
|
||||||
|
unless ENV['MM_ROOT']
|
||||||
|
raise Thor::Error, 'Error: Could not find a Middleman project config, perhaps you are in the wrong folder?'
|
||||||
|
end
|
||||||
|
|
||||||
|
require 'middleman-core'
|
||||||
|
require 'middleman-core/logger'
|
||||||
|
require 'middleman-core/builder'
|
||||||
|
require 'fileutils'
|
||||||
|
|
||||||
|
verbose = options['verbose'] ? 0 : 1
|
||||||
|
instrument = options['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
|
||||||
|
|
||||||
|
::Middleman::Util.instrument 'builder.run' do
|
||||||
|
if builder.run!
|
||||||
|
clean_directories! if options['clean']
|
||||||
|
shell.say 'Project built successfully.'
|
||||||
|
else
|
||||||
|
msg = 'There were errors during this build'
|
||||||
|
unless options['verbose']
|
||||||
|
msg << ', re-run with `middleman build --verbose` to see the full exception.'
|
||||||
|
end
|
||||||
|
shell.say msg, :red
|
||||||
|
|
||||||
|
exit(1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
protected
|
||||||
|
|
||||||
|
# Handles incoming events from the builder.
|
||||||
|
# @param [Symbol] event_type The type of event.
|
||||||
|
# @param [String] contents The event contents.
|
||||||
|
# @param [String] extra The extra information.
|
||||||
|
# @return [void]
|
||||||
|
def on_event(event_type, target, extra=nil)
|
||||||
|
case event_type
|
||||||
|
when :error
|
||||||
|
say_status :error, target, :red
|
||||||
|
shell.say extra, :red if options['verbose']
|
||||||
|
when :deleted
|
||||||
|
say_status :remove, target, :green
|
||||||
|
when :created
|
||||||
|
say_status :create, target, :green
|
||||||
|
when :identical
|
||||||
|
say_status :identical, target, :blue
|
||||||
|
when :updated
|
||||||
|
say_status :updated, target, :yellow
|
||||||
|
else
|
||||||
|
say_status event_type, extra, :blue
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Find empty directories in the build folder and remove them.
|
||||||
|
# @return [Boolean]
|
||||||
|
def clean_directories!
|
||||||
|
all_build_files = File.join(@app.config[:build_dir], '**', '*')
|
||||||
|
|
||||||
|
empty_directories = Dir[all_build_files].select do |d|
|
||||||
|
File.directory?(d)
|
||||||
|
end
|
||||||
|
|
||||||
|
empty_directories.each do |d|
|
||||||
|
remove_file d, force: true if Pathname(d).children.empty?
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Add to CLI
|
||||||
|
Base.register(self, 'build', 'build [options]', 'Builds the static site for deployment')
|
||||||
|
|
||||||
|
# Map "b" to "build"
|
||||||
|
Base.map('b' => 'build')
|
||||||
|
end
|
||||||
|
end
|
41
middleman-cli/lib/middleman-cli/config.rb
Normal file
41
middleman-cli/lib/middleman-cli/config.rb
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
# CLI Module
|
||||||
|
module Middleman::Cli
|
||||||
|
# The CLI Config class
|
||||||
|
class Config < Thor::Group
|
||||||
|
include Thor::Actions
|
||||||
|
|
||||||
|
check_unknown_options!
|
||||||
|
|
||||||
|
class_option :environment,
|
||||||
|
aliases: '-e',
|
||||||
|
default: ENV['MM_ENV'] || ENV['RACK_ENV'] || 'development',
|
||||||
|
desc: 'The environment Middleman will run under'
|
||||||
|
def console
|
||||||
|
require 'json'
|
||||||
|
require 'middleman-core'
|
||||||
|
require 'middleman-core/logger'
|
||||||
|
|
||||||
|
opts = {
|
||||||
|
environment: options['environment']
|
||||||
|
}
|
||||||
|
|
||||||
|
# Don't output info messages
|
||||||
|
::Middleman::Logger.singleton(2, false)
|
||||||
|
|
||||||
|
app = ::Middleman::Application.new do
|
||||||
|
config[:mode] = :config
|
||||||
|
config[:disable_sitemap] = true
|
||||||
|
config[:watcher_disable] = true
|
||||||
|
config[:exit_before_ready] = true
|
||||||
|
config[:environment] = opts[:environment].to_sym if opts[:environment]
|
||||||
|
end
|
||||||
|
|
||||||
|
puts JSON.pretty_generate(app.config.to_h)
|
||||||
|
|
||||||
|
app.shutdown!
|
||||||
|
end
|
||||||
|
|
||||||
|
# Add to CLI
|
||||||
|
Base.register(self, 'config', 'config [options]', 'Output a Middleman configuration in JSON format')
|
||||||
|
end
|
||||||
|
end
|
51
middleman-cli/lib/middleman-cli/console.rb
Normal file
51
middleman-cli/lib/middleman-cli/console.rb
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
# CLI Module
|
||||||
|
module Middleman::Cli
|
||||||
|
# The CLI Console class
|
||||||
|
class Console < 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'
|
||||||
|
class_option :verbose,
|
||||||
|
type: :boolean,
|
||||||
|
default: false,
|
||||||
|
desc: 'Print debug messages'
|
||||||
|
def console
|
||||||
|
require 'middleman-core'
|
||||||
|
require 'irb'
|
||||||
|
|
||||||
|
opts = {
|
||||||
|
environment: options['environment'],
|
||||||
|
debug: options['verbose']
|
||||||
|
}
|
||||||
|
|
||||||
|
@app = ::Middleman::Application.new do
|
||||||
|
config[:environment] = opts[:environment].to_sym if opts[:environment]
|
||||||
|
|
||||||
|
::Middleman::Logger.singleton(opts[:debug] ? 0 : 1, opts[:instrumenting] || false)
|
||||||
|
end
|
||||||
|
|
||||||
|
self.class.interact_with @app
|
||||||
|
end
|
||||||
|
|
||||||
|
# Start an interactive console in the context of the provided object.
|
||||||
|
# @param [Object] context
|
||||||
|
# @return [void]
|
||||||
|
def self.interact_with(context)
|
||||||
|
IRB.setup nil
|
||||||
|
IRB.conf[:MAIN_CONTEXT] = IRB::Irb.new.context
|
||||||
|
require 'irb/ext/multi-irb'
|
||||||
|
IRB.irb nil, context
|
||||||
|
end
|
||||||
|
|
||||||
|
# Add to CLI
|
||||||
|
Base.register(self, 'console', 'console [options]', 'Start an interactive console in the context of your Middleman application')
|
||||||
|
|
||||||
|
# Map "c" to "console"
|
||||||
|
Base.map('c' => 'console')
|
||||||
|
end
|
||||||
|
end
|
42
middleman-cli/lib/middleman-cli/extension.rb
Normal file
42
middleman-cli/lib/middleman-cli/extension.rb
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
# CLI Module
|
||||||
|
module Middleman::Cli
|
||||||
|
# A thor task for creating new projects
|
||||||
|
class Extension < Thor::Group
|
||||||
|
include Thor::Actions
|
||||||
|
|
||||||
|
check_unknown_options!
|
||||||
|
|
||||||
|
# Required path for the new project to be generated
|
||||||
|
argument :name, type: :string
|
||||||
|
|
||||||
|
# Template files are relative to this file
|
||||||
|
# @return [String]
|
||||||
|
def self.source_root
|
||||||
|
File.join(File.dirname(__FILE__), 'templates')
|
||||||
|
end
|
||||||
|
|
||||||
|
class_option 'skip-git',
|
||||||
|
type: :boolean,
|
||||||
|
default: false,
|
||||||
|
desc: 'Skip Git ignores and keeps'
|
||||||
|
|
||||||
|
# Output a .gitignore file
|
||||||
|
class_option :git, type: :boolean, default: true
|
||||||
|
|
||||||
|
# The extension task
|
||||||
|
# @param [String] name
|
||||||
|
def extension
|
||||||
|
copy_file 'extension/gitignore', File.join(name, '.gitignore') unless options[:'skip-git']
|
||||||
|
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/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
|
||||||
|
|
||||||
|
# Add to CLI
|
||||||
|
Base.register(self, 'extension', 'extension [options]', 'Create a new Middleman extension')
|
||||||
|
end
|
||||||
|
end
|
129
middleman-cli/lib/middleman-cli/init.rb
Normal file
129
middleman-cli/lib/middleman-cli/init.rb
Normal file
|
@ -0,0 +1,129 @@
|
||||||
|
# CLI Module
|
||||||
|
module Middleman::Cli
|
||||||
|
# A thor task for creating new projects
|
||||||
|
class Init < Thor::Group
|
||||||
|
include Thor::Actions
|
||||||
|
|
||||||
|
GIT_CMD = 'git'.freeze
|
||||||
|
|
||||||
|
check_unknown_options!
|
||||||
|
|
||||||
|
argument :target, type: :string, default: '.'
|
||||||
|
|
||||||
|
class_option 'template',
|
||||||
|
aliases: '-T',
|
||||||
|
default: 'middleman/middleman-templates-default',
|
||||||
|
desc: 'Use a project template'
|
||||||
|
|
||||||
|
# Do not run bundle install
|
||||||
|
class_option 'skip-bundle',
|
||||||
|
type: :boolean,
|
||||||
|
aliases: '-B',
|
||||||
|
default: false,
|
||||||
|
desc: 'Skip bundle install'
|
||||||
|
|
||||||
|
# The init task
|
||||||
|
def init
|
||||||
|
require 'fileutils'
|
||||||
|
require 'tmpdir'
|
||||||
|
|
||||||
|
unless git_present?
|
||||||
|
msg = 'You need to install the git command line tool to initialize a new project. '
|
||||||
|
msg << "For help installing git, please refer to GitHub's tutorial at https://help.github.com/articles/set-up-git"
|
||||||
|
say msg, :red
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
|
|
||||||
|
repo_path, repo_branch = if shortname?(options[:template])
|
||||||
|
require 'open-uri'
|
||||||
|
require 'json'
|
||||||
|
|
||||||
|
api = 'https://directory.middlemanapp.com/api'
|
||||||
|
uri = ::URI.parse("#{api}/#{options[:template]}.json")
|
||||||
|
|
||||||
|
begin
|
||||||
|
data = ::JSON.parse(uri.read)
|
||||||
|
data['links']['github']
|
||||||
|
data['links']['github'].split('#')
|
||||||
|
rescue ::OpenURI::HTTPError
|
||||||
|
say "Template `#{options[:template]}` not found in Middleman Directory."
|
||||||
|
say 'Did you mean to use a full `user/repo` path?'
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
|
else
|
||||||
|
repo_name, repo_branch = options[:template].split('#')
|
||||||
|
[repository_path(repo_name), repo_branch]
|
||||||
|
end
|
||||||
|
|
||||||
|
dir = Dir.mktmpdir
|
||||||
|
|
||||||
|
begin
|
||||||
|
branch_cmd = repo_branch ? "-b #{repo_branch} " : ''
|
||||||
|
|
||||||
|
git_path = "#{branch_cmd}#{repo_path}"
|
||||||
|
run("#{GIT_CMD} clone --depth 1 #{branch_cmd}#{repo_path} #{dir}")
|
||||||
|
|
||||||
|
unless $?.success?
|
||||||
|
say "Git clone command failed. Make sure git repository exists: #{git_path}", :red
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
|
|
||||||
|
inside(target) do
|
||||||
|
thorfile = File.join(dir, 'Thorfile')
|
||||||
|
|
||||||
|
if File.exist?(thorfile)
|
||||||
|
::Thor::Util.load_thorfile(thorfile)
|
||||||
|
|
||||||
|
invoke 'middleman:generator'
|
||||||
|
else
|
||||||
|
source_paths << dir
|
||||||
|
directory dir, '.', exclude_pattern: /\.git\/|\.gitignore$/
|
||||||
|
end
|
||||||
|
|
||||||
|
run('bundle install') unless ENV['TEST'] || options[:'skip-bundle']
|
||||||
|
end
|
||||||
|
ensure
|
||||||
|
FileUtils.remove_entry(dir) if File.directory?(dir)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
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 : "https://github.com/#{repo}.git"
|
||||||
|
end
|
||||||
|
|
||||||
|
# Add to CLI
|
||||||
|
Base.register(self, 'init', 'init TARGET [options]', 'Create new project at TARGET')
|
||||||
|
|
||||||
|
# Map "i", "new" and "n" to "init"
|
||||||
|
Base.map(
|
||||||
|
'i' => 'init',
|
||||||
|
'new' => 'init',
|
||||||
|
'n' => 'init'
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
62
middleman-cli/lib/middleman-cli/server.rb
Normal file
62
middleman-cli/lib/middleman-cli/server.rb
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
# CLI Module
|
||||||
|
module Middleman::Cli
|
||||||
|
# Server thor task
|
||||||
|
class Server < Thor::Group
|
||||||
|
check_unknown_options!
|
||||||
|
|
||||||
|
class_option :environment,
|
||||||
|
aliases: '-e'
|
||||||
|
class_option :port,
|
||||||
|
aliases: '-p'
|
||||||
|
class_option :server_name,
|
||||||
|
aliases: '-s'
|
||||||
|
class_option :bind_address,
|
||||||
|
aliases: '-b'
|
||||||
|
class_option :verbose,
|
||||||
|
type: :boolean,
|
||||||
|
default: false,
|
||||||
|
desc: 'Print debug messages'
|
||||||
|
class_option :instrument,
|
||||||
|
type: :boolean,
|
||||||
|
default: false,
|
||||||
|
desc: 'Print instrument messages'
|
||||||
|
class_option :profile,
|
||||||
|
type: :boolean,
|
||||||
|
default: false,
|
||||||
|
desc: 'Generate profiling report for server startup'
|
||||||
|
class_option :daemon,
|
||||||
|
type: :boolean,
|
||||||
|
aliases: '-d',
|
||||||
|
default: false,
|
||||||
|
desc: 'Daemonize preview server'
|
||||||
|
|
||||||
|
Middleman::Cli.import_config(self)
|
||||||
|
|
||||||
|
# Start the server
|
||||||
|
def server
|
||||||
|
require 'middleman-core'
|
||||||
|
require 'middleman-core/preview_server'
|
||||||
|
|
||||||
|
unless ENV['MM_ROOT']
|
||||||
|
puts '== Could not find a Middleman project config.rb'
|
||||||
|
exit
|
||||||
|
end
|
||||||
|
|
||||||
|
params = {
|
||||||
|
debug: options['verbose'],
|
||||||
|
instrumenting: options['instrument'],
|
||||||
|
reload_paths: options['reload_paths'],
|
||||||
|
daemon: options['daemon']
|
||||||
|
}
|
||||||
|
|
||||||
|
puts '== The Middleman is loading'
|
||||||
|
::Middleman::PreviewServer.start(params, options)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Add to CLI
|
||||||
|
Base.register(self, 'server', 'server [options]', 'Start the preview server')
|
||||||
|
|
||||||
|
# Map "s" to "server"
|
||||||
|
Base.map('s' => 'server')
|
||||||
|
end
|
||||||
|
end
|
|
@ -4,7 +4,7 @@ Bundler::GemHelper.install_tasks
|
||||||
require 'cucumber/rake/task'
|
require 'cucumber/rake/task'
|
||||||
|
|
||||||
Cucumber::Rake::Task.new(:cucumber, 'Run features that should pass') do |t|
|
Cucumber::Rake::Task.new(:cucumber, 'Run features that should pass') do |t|
|
||||||
t.cucumber_opts = "--color --tags ~@wip --strict"
|
t.cucumber_opts = '--color --tags ~@wip --strict'
|
||||||
end
|
end
|
||||||
|
|
||||||
require 'rake/clean'
|
require 'rake/clean'
|
|
@ -0,0 +1,6 @@
|
||||||
|
require "middleman-core"
|
||||||
|
|
||||||
|
Middleman::Extensions.register :<%= name %> do
|
||||||
|
require "my-extension/extension"
|
||||||
|
MyExtension
|
||||||
|
end
|
|
@ -24,15 +24,8 @@ class MyExtension < ::Middleman::Extension
|
||||||
# def manipulate_resource_list(resources)
|
# def manipulate_resource_list(resources)
|
||||||
# end
|
# end
|
||||||
|
|
||||||
# module do
|
# helpers do
|
||||||
# def a_helper
|
# def a_helper
|
||||||
# end
|
# end
|
||||||
# end
|
# end
|
||||||
end
|
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)
|
|
2
middleman-cli/lib/middleman-core/cli.rb
Normal file
2
middleman-cli/lib/middleman-core/cli.rb
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# Backwards compat
|
||||||
|
require 'middleman-cli'
|
24
middleman-cli/middleman-cli.gemspec
Normal file
24
middleman-cli/middleman-cli.gemspec
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
# -*- encoding: utf-8 -*-
|
||||||
|
$LOAD_PATH.push File.expand_path('../lib', __FILE__)
|
||||||
|
require File.expand_path('../../middleman-core/lib/middleman-core/version', __FILE__)
|
||||||
|
|
||||||
|
Gem::Specification.new do |s|
|
||||||
|
s.name = 'middleman-cli'
|
||||||
|
s.version = Middleman::VERSION
|
||||||
|
s.platform = Gem::Platform::RUBY
|
||||||
|
s.license = 'MIT'
|
||||||
|
s.authors = ['Thomas Reynolds', 'Ben Hollis']
|
||||||
|
s.email = ['me@tdreyno.com', 'ben@benhollis.net']
|
||||||
|
s.homepage = 'http://middlemanapp.com'
|
||||||
|
s.summary = 'Hand-crafted frontend development'
|
||||||
|
s.description = 'A static site generator. Provides dozens of templating languages (Haml, Sass, Compass, Slim, CoffeeScript, and more). Makes minification, compression, cache busting, Yaml data (and more) an easy part of your development cycle.'
|
||||||
|
|
||||||
|
s.files = `git ls-files -z`.split("\0")
|
||||||
|
s.test_files = `git ls-files -z -- {fixtures,features}/*`.split("\0")
|
||||||
|
s.executable = 'middleman'
|
||||||
|
s.require_path = 'lib'
|
||||||
|
s.required_ruby_version = '>= 2.2.0'
|
||||||
|
|
||||||
|
# CLI
|
||||||
|
s.add_dependency('thor', ['>= 0.17.0', '< 2.0'])
|
||||||
|
end
|
1
middleman-cli/spec/middleman/.gitkeep
Normal file
1
middleman-cli/spec/middleman/.gitkeep
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.gitkeep
|
|
@ -1,10 +1,6 @@
|
||||||
lib/**/*.rb
|
lib/**/*.rb
|
||||||
--exclude lib/vendored-middleman-deps/
|
--exclude lib/vendored-middleman-deps/
|
||||||
--exclude lib/middleman-core/step_definitions
|
--exclude lib/middleman-core/step_definitions
|
||||||
--exclude lib/middleman-core/templates/default/
|
|
||||||
--exclude lib/middleman-core/templates/html5/
|
|
||||||
--exclude lib/middleman-core/templates/mobile/
|
|
||||||
--exclude lib/middleman-core/templates/shared/
|
|
||||||
--exclude lib/middleman-core/templates/extension/
|
|
||||||
--no-private
|
--no-private
|
||||||
--hide-void-return
|
--hide-void-return
|
||||||
|
--markup=markdown
|
|
@ -1,7 +1,4 @@
|
||||||
# coding:utf-8
|
# coding:utf-8
|
||||||
RAKE_ROOT = __FILE__
|
RAKE_ROOT = __FILE__.freeze
|
||||||
|
|
||||||
GEM_NAME = ENV['NAME'] || 'middleman-core'
|
GEM_NAME = ENV['NAME'] || 'middleman-core'
|
||||||
|
|
||||||
require 'rubygems'
|
|
||||||
require File.expand_path(File.dirname(__FILE__) + '/../gem_rake_helper')
|
require File.expand_path(File.dirname(__FILE__) + '/../gem_rake_helper')
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
#!/usr/bin/env ruby
|
|
||||||
|
|
||||||
require 'middleman-core/profiling'
|
|
||||||
if ARGV.include? '--profile'
|
|
||||||
Middleman::Profiling.profiler = Middleman::Profiling::RubyProfProfiler.new
|
|
||||||
end
|
|
||||||
Middleman::Profiling.start
|
|
||||||
|
|
||||||
require "middleman-core/load_paths"
|
|
||||||
Middleman.setup_load_paths
|
|
||||||
|
|
||||||
require "middleman-core/cli"
|
|
||||||
|
|
||||||
# Change directory to the root
|
|
||||||
Dir.chdir(ENV["MM_ROOT"]) if ENV["MM_ROOT"]
|
|
||||||
|
|
||||||
# Start the CLI
|
|
||||||
Middleman::Cli::Base.start
|
|
|
@ -1,15 +0,0 @@
|
||||||
Feature: Allow config.rb and extensions to add CLI commands
|
|
||||||
|
|
||||||
Scenario: Command autoloaded from tasks/ directory
|
|
||||||
Given an empty app
|
|
||||||
And a file named "tasks/hello_task.rb" with:
|
|
||||||
"""
|
|
||||||
class Hello < Thor
|
|
||||||
desc "hello", "Say hello"
|
|
||||||
def hello
|
|
||||||
puts "Hello World"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
"""
|
|
||||||
When I run `middleman hello`
|
|
||||||
Then the output should contain "Hello World"
|
|
|
@ -1,155 +0,0 @@
|
||||||
Feature: AsciiDoc Support
|
|
||||||
In order to test included AsciiDoc support
|
|
||||||
|
|
||||||
Scenario: Rendering html
|
|
||||||
Given the Server is running at "asciidoc-app"
|
|
||||||
When I go to "/hello.html"
|
|
||||||
Then I should see:
|
|
||||||
"""
|
|
||||||
<div class="paragraph">
|
|
||||||
<p>Hello, AsciiDoc!
|
|
||||||
Middleman, I am in you.</p>
|
|
||||||
</div>
|
|
||||||
"""
|
|
||||||
|
|
||||||
Scenario: Rendering html with default layout
|
|
||||||
Given a fixture app "asciidoc-app"
|
|
||||||
And a file named "config.rb" with:
|
|
||||||
"""
|
|
||||||
set :layout, :default
|
|
||||||
"""
|
|
||||||
Given the Server is running at "asciidoc-app"
|
|
||||||
When I go to "/hello.html"
|
|
||||||
Then I should see:
|
|
||||||
"""
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Fallback</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="paragraph">
|
|
||||||
<p>Hello, AsciiDoc!
|
|
||||||
Middleman, I am in you.</p>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
"""
|
|
||||||
|
|
||||||
Scenario: Rendering html with explicit layout
|
|
||||||
Given the Server is running at "asciidoc-app"
|
|
||||||
When I go to "/hello-with-layout.html"
|
|
||||||
Then I should see:
|
|
||||||
"""
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Fallback</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="paragraph">
|
|
||||||
<p>Hello, AsciiDoc!</p>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
"""
|
|
||||||
|
|
||||||
Scenario: Rendering html with no layout
|
|
||||||
Given the Server is running at "asciidoc-app"
|
|
||||||
When I go to "/hello-no-layout.html"
|
|
||||||
Then I should see:
|
|
||||||
"""
|
|
||||||
<div class="paragraph">
|
|
||||||
<p>Hello, AsciiDoc!</p>
|
|
||||||
</div>
|
|
||||||
"""
|
|
||||||
|
|
||||||
Scenario: Rendering html using title from document
|
|
||||||
Given the Server is running at "asciidoc-app"
|
|
||||||
When I go to "/hello-with-title.html"
|
|
||||||
Then I should see:
|
|
||||||
"""
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Page Title</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Page Title</h1>
|
|
||||||
<div id="preamble">
|
|
||||||
<div class="sectionbody">
|
|
||||||
<div class="paragraph">
|
|
||||||
<p>Hello, AsciiDoc!</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
"""
|
|
||||||
|
|
||||||
Scenario: Rendering html with title and layout from front matter
|
|
||||||
Given the Server is running at "asciidoc-app"
|
|
||||||
When I go to "/hello-with-front-matter.html"
|
|
||||||
Then I should see:
|
|
||||||
"""
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Page Title</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="paragraph">
|
|
||||||
<p>Hello, AsciiDoc!</p>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
"""
|
|
||||||
|
|
||||||
Scenario: Including a file relative to source root
|
|
||||||
Given the Server is running at "asciidoc-app"
|
|
||||||
When I go to "/master.html"
|
|
||||||
Then I should see:
|
|
||||||
"""
|
|
||||||
<div class="literalblock">
|
|
||||||
<div class="content">
|
|
||||||
<pre>I'm included content.</pre>
|
|
||||||
</div>
|
|
||||||
"""
|
|
||||||
|
|
||||||
Scenario: Linking to an image
|
|
||||||
Given the Server is running at "asciidoc-app"
|
|
||||||
When I go to "/gallery.html"
|
|
||||||
Then I should see:
|
|
||||||
"""
|
|
||||||
<div class="imageblock">
|
|
||||||
<div class="content">
|
|
||||||
<img src="/images/tiger.gif" alt="tiger">
|
|
||||||
</div>
|
|
||||||
"""
|
|
||||||
|
|
||||||
Scenario: Configuring custom AsciiDoc attributes
|
|
||||||
Given a fixture app "asciidoc-app"
|
|
||||||
And a file named "config.rb" with:
|
|
||||||
"""
|
|
||||||
set :asciidoc_attributes, %w(foo=bar)
|
|
||||||
"""
|
|
||||||
Given the Server is running at "asciidoc-app"
|
|
||||||
When I go to "/custom-attribute.html"
|
|
||||||
Then I should see "bar"
|
|
||||||
|
|
||||||
Scenario: Highlighting source code
|
|
||||||
Given a fixture app "asciidoc-app"
|
|
||||||
And a file named "config.rb" with:
|
|
||||||
"""
|
|
||||||
set :asciidoc_attributes, %w(source-highlighter=html-pipeline)
|
|
||||||
"""
|
|
||||||
Given the Server is running at "asciidoc-app"
|
|
||||||
When I go to "/code.html"
|
|
||||||
Then I should see:
|
|
||||||
"""
|
|
||||||
<div class="listingblock">
|
|
||||||
<div class="content">
|
|
||||||
<pre lang="ruby"><code>puts "Is this mic on?"</code></pre>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
"""
|
|
|
@ -1,4 +1,4 @@
|
||||||
Feature: Assets get a file hash appended to their and references to them are updated
|
Feature: Assets get file hashes appended to them and references to them are updated
|
||||||
Scenario: Hashed-asset files are produced, and HTML, CSS, JSON and JavaScript gets rewritten to reference the new files
|
Scenario: Hashed-asset files are produced, and HTML, CSS, JSON and JavaScript gets rewritten to reference the new files
|
||||||
Given a successfully built app at "asset-hash-app"
|
Given a successfully built app at "asset-hash-app"
|
||||||
When I cd to "build"
|
When I cd to "build"
|
||||||
|
@ -12,7 +12,7 @@ Feature: Assets get a file hash appended to their and references to them are upd
|
||||||
| images/300px-59adce76.jpg |
|
| images/300px-59adce76.jpg |
|
||||||
| images/100px-5fd6fb90.gif |
|
| images/100px-5fd6fb90.gif |
|
||||||
| javascripts/application-1d8d5276.js |
|
| javascripts/application-1d8d5276.js |
|
||||||
| stylesheets/site-50eaa978.css |
|
| stylesheets/site-8bc55985.css |
|
||||||
| index.html |
|
| index.html |
|
||||||
| subdir/index.html |
|
| subdir/index.html |
|
||||||
| other/index.html |
|
| other/index.html |
|
||||||
|
@ -26,18 +26,21 @@ Feature: Assets get a file hash appended to their and references to them are upd
|
||||||
| stylesheets/site.css |
|
| stylesheets/site.css |
|
||||||
|
|
||||||
And the file "javascripts/application-1d8d5276.js" should contain "img.src = '/images/100px-5fd6fb90.jpg'"
|
And the file "javascripts/application-1d8d5276.js" should contain "img.src = '/images/100px-5fd6fb90.jpg'"
|
||||||
And the file "stylesheets/site-50eaa978.css" should contain "background-image: url('../images/100px-5fd6fb90.jpg')"
|
And the file "stylesheets/site-8bc55985.css" should contain:
|
||||||
|
"""
|
||||||
|
background-image: url("../images/100px-5fd6fb90.jpg")
|
||||||
|
"""
|
||||||
And the file "index.html" should contain 'href="apple-touch-icon.png"'
|
And the file "index.html" should contain 'href="apple-touch-icon.png"'
|
||||||
And the file "index.html" should contain 'href="stylesheets/site-50eaa978.css"'
|
And the file "index.html" should contain 'href="stylesheets/site-8bc55985.css"'
|
||||||
And the file "index.html" should contain 'src="javascripts/application-1d8d5276.js"'
|
And the file "index.html" should contain 'src="javascripts/application-1d8d5276.js"'
|
||||||
And the file "index.html" should contain 'src="images/100px-5fd6fb90.jpg"'
|
And the file "index.html" should contain 'src="images/100px-5fd6fb90.jpg"'
|
||||||
|
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 '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-5fd6fb90.gif"'
|
||||||
And the file "index.html" should contain 'src="images/100px-1242c368.png"'
|
And the file "index.html" should contain 'src="images/100px-1242c368.png"'
|
||||||
And the file "subdir/index.html" should contain 'href="../stylesheets/site-50eaa978.css"'
|
|
||||||
And the file "subdir/index.html" should contain 'src="../javascripts/application-1d8d5276.js"'
|
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 "subdir/index.html" should contain 'src="../images/100px-5fd6fb90.jpg"'
|
||||||
And the file "other/index.html" should contain 'href="../stylesheets/site-50eaa978.css"'
|
And the file "other/index.html" should contain 'href="../stylesheets/site-8bc55985.css"'
|
||||||
And the file "other/index.html" should contain 'src="../javascripts/application-1d8d5276.js"'
|
And the file "other/index.html" should contain 'src="../javascripts/application-1d8d5276.js"'
|
||||||
And the file "other/index.html" should contain 'src="../images/100px-5fd6fb90.jpg"'
|
And the file "other/index.html" should contain 'src="../images/100px-5fd6fb90.jpg"'
|
||||||
And the file "api.json" should contain 'images/100px-5fd6fb90.gif'
|
And the file "api.json" should contain 'images/100px-5fd6fb90.gif'
|
||||||
|
@ -60,22 +63,29 @@ Feature: Assets get a file hash appended to their and references to them are upd
|
||||||
Given the Server is running at "asset-hash-app"
|
Given the Server is running at "asset-hash-app"
|
||||||
When I go to "/"
|
When I go to "/"
|
||||||
Then I should see 'href="apple-touch-icon.png"'
|
Then I should see 'href="apple-touch-icon.png"'
|
||||||
And I should see 'href="stylesheets/site-50eaa978.css"'
|
And I should see 'href="stylesheets/site-d1a750ca.css"'
|
||||||
|
And I should see 'href="stylesheets/fragment-99b76247.css"'
|
||||||
And I should see 'src="javascripts/application-1d8d5276.js"'
|
And I should see 'src="javascripts/application-1d8d5276.js"'
|
||||||
And I should see 'src="images/100px-5fd6fb90.jpg"'
|
And I should see 'src="images/100px-5fd6fb90.jpg"'
|
||||||
And I should see 'srcset="images/100px-5fd6fb90.jpg 1x, images/200px-c11eb203.jpg 2x, images/300px-59adce76.jpg 3x"'
|
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/"
|
When I go to "/subdir/"
|
||||||
Then I should see 'href="../stylesheets/site-50eaa978.css"'
|
Then I should see 'href="../stylesheets/site-d1a750ca.css"'
|
||||||
And I should see 'src="../javascripts/application-1d8d5276.js"'
|
And I should see 'src="../javascripts/application-1d8d5276.js"'
|
||||||
And I should see 'src="../images/100px-5fd6fb90.jpg"'
|
And I should see 'src="../images/100px-5fd6fb90.jpg"'
|
||||||
When I go to "/other/"
|
When I go to "/other/"
|
||||||
Then I should see 'href="../stylesheets/site-50eaa978.css"'
|
Then I should see 'href="../stylesheets/site-d1a750ca.css"'
|
||||||
And I should see 'src="../javascripts/application-1d8d5276.js"'
|
And I should see 'src="../javascripts/application-1d8d5276.js"'
|
||||||
And I should see 'src="../images/100px-5fd6fb90.jpg"'
|
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"
|
When I go to "/javascripts/application-1d8d5276.js"
|
||||||
Then I should see "img.src = '/images/100px-5fd6fb90.jpg'"
|
Then I should see "img.src = '/images/100px-5fd6fb90.jpg'"
|
||||||
When I go to "/stylesheets/site-50eaa978.css"
|
When I go to "/stylesheets/site-d1a750ca.css"
|
||||||
Then I should see "background-image: url('../images/100px-5fd6fb90.jpg')"
|
Then I should see 'background-image: url("../images/100px-5fd6fb90.jpg");'
|
||||||
When I go to "/api.json"
|
When I go to "/api.json"
|
||||||
Then I should see 'images/100px-5fd6fb90.gif'
|
Then I should see 'images/100px-5fd6fb90.gif'
|
||||||
And I should see 'images/100px-5fd6fb90.jpg'
|
And I should see 'images/100px-5fd6fb90.jpg'
|
||||||
|
@ -84,6 +94,11 @@ Feature: Assets get a file hash appended to their and references to them are upd
|
||||||
Then I should see 'images/100px-5fd6fb90.gif'
|
Then I should see 'images/100px-5fd6fb90.gif'
|
||||||
And I should see 'images/100px-5fd6fb90.jpg'
|
And I should see 'images/100px-5fd6fb90.jpg'
|
||||||
And I should see 'images/100px-1242c368.png'
|
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
|
Scenario: Hashed assets work with Slim
|
||||||
Given the Server is running at "asset-hash-app"
|
Given the Server is running at "asset-hash-app"
|
||||||
|
@ -92,20 +107,69 @@ Feature: Assets get a file hash appended to their and references to them are upd
|
||||||
And I should see 'src="images/100px-5fd6fb90.jpg"'
|
And I should see 'src="images/100px-5fd6fb90.jpg"'
|
||||||
And I should see 'srcset="images/100px-5fd6fb90.jpg 1x, images/200px-c11eb203.jpg 2x, images/300px-59adce76.jpg 3x"'
|
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"
|
Given the Server is running at "asset-hash-host-app"
|
||||||
When I go to "/"
|
When I go to "/"
|
||||||
Then I should see 'href="http://middlemanapp.com/stylesheets/site-54baaf3a.css"'
|
Then I should see 'href="http://middlemanapp.com/stylesheets/site-7474cadd.css"'
|
||||||
|
Then I should see 'href="http://middlemanapp.com/stylesheets/fragment-2902933e.css"'
|
||||||
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg"'
|
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg"'
|
||||||
|
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/"
|
When I go to "/subdir/"
|
||||||
Then I should see 'href="http://middlemanapp.com/stylesheets/site-54baaf3a.css"'
|
Then I should see 'href="http://middlemanapp.com/stylesheets/site-7474cadd.css"'
|
||||||
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg"'
|
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg"'
|
||||||
When I go to "/other/"
|
When I go to "/other/"
|
||||||
Then I should see 'href="http://middlemanapp.com/stylesheets/site-54baaf3a.css"'
|
Then I should see 'href="http://middlemanapp.com/stylesheets/site-7474cadd.css"'
|
||||||
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg"'
|
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg"'
|
||||||
# Asset helpers don't appear to work from Compass right now
|
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg?test"'
|
||||||
# When I go to "/stylesheets/site-e5a31a3e.css"
|
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg?#test"'
|
||||||
# Then I should see "background-image: url('http://middlemanapp.com/images/100px-5fd6fb90.jpg')"
|
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg#test"'
|
||||||
|
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
|
Scenario: The asset hash should change when a SASS partial changes
|
||||||
Given the Server is running at "asset-hash-app"
|
Given the Server is running at "asset-hash-app"
|
||||||
|
@ -115,14 +179,14 @@ Feature: Assets get a file hash appended to their and references to them are upd
|
||||||
font-size: 14px
|
font-size: 14px
|
||||||
"""
|
"""
|
||||||
When I go to "/partials/"
|
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
|
And the file "source/stylesheets/_partial.sass" has the contents
|
||||||
"""
|
"""
|
||||||
body
|
body
|
||||||
font-size: 18px !important
|
font-size: 18px !important
|
||||||
"""
|
"""
|
||||||
When I go to "/partials/"
|
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
|
Scenario: The asset hash should change when a Rack-based filter changes
|
||||||
Given a fixture app "asset-hash-app"
|
Given a fixture app "asset-hash-app"
|
||||||
|
@ -132,22 +196,25 @@ Feature: Assets get a file hash appended to their and references to them are upd
|
||||||
activate :relative_assets
|
activate :relative_assets
|
||||||
activate :directory_indexes
|
activate :directory_indexes
|
||||||
require 'lib/middleware.rb'
|
require 'lib/middleware.rb'
|
||||||
use Middleware
|
use ::Middleware
|
||||||
"""
|
"""
|
||||||
Given the Server is running at "asset-hash-app"
|
Given the Server is running at "asset-hash-app"
|
||||||
When I go to "/"
|
When I go to "/"
|
||||||
Then I should see 'href="stylesheets/site-5770af52.css'
|
Then I should see 'href="stylesheets/site-5ad7def0.css'
|
||||||
When I go to "stylesheets/site-5770af52.css"
|
When I go to "stylesheets/site-5ad7def0.css"
|
||||||
Then I should see 'background-image'
|
Then I should see 'background-image: url("../images/100px-5fd6fb90.jpg")'
|
||||||
Then I should see 'Added by Rack filter'
|
Then I should see 'Added by Rack filter'
|
||||||
When I go to "stylesheets/site-50eaa978.css"
|
|
||||||
Then I should see 'Not Found'
|
|
||||||
|
|
||||||
Scenario: Hashed-asset files are not produced for ignored paths
|
Scenario: Hashed-asset files are not produced for ignored paths
|
||||||
Given a fixture app "asset-hash-app"
|
Given a fixture app "asset-hash-app"
|
||||||
And a file named "config.rb" with:
|
And a file named "config.rb" with:
|
||||||
"""
|
"""
|
||||||
activate :asset_hash, :ignore => [%r(javascripts/*), 'images/*']
|
is_stylesheet = proc { |path| path.start_with? 'stylesheets' }
|
||||||
|
activate :asset_hash, ignore: [
|
||||||
|
%r(javascripts/*),
|
||||||
|
'images/*',
|
||||||
|
is_stylesheet
|
||||||
|
]
|
||||||
activate :relative_assets
|
activate :relative_assets
|
||||||
activate :directory_indexes
|
activate :directory_indexes
|
||||||
"""
|
"""
|
||||||
|
@ -161,7 +228,7 @@ Feature: Assets get a file hash appended to their and references to them are upd
|
||||||
| images/100px.jpg |
|
| images/100px.jpg |
|
||||||
| images/100px.gif |
|
| images/100px.gif |
|
||||||
| javascripts/application.js |
|
| javascripts/application.js |
|
||||||
| stylesheets/site-50eaa978.css |
|
| stylesheets/site.css |
|
||||||
| index.html |
|
| index.html |
|
||||||
| subdir/index.html |
|
| subdir/index.html |
|
||||||
| other/index.html |
|
| other/index.html |
|
||||||
|
@ -172,18 +239,86 @@ Feature: Assets get a file hash appended to their and references to them are upd
|
||||||
| images/100px-5fd6fb90.jpg |
|
| images/100px-5fd6fb90.jpg |
|
||||||
| images/100px-5fd6fb90.gif |
|
| images/100px-5fd6fb90.gif |
|
||||||
| javascripts/application-1d8d5276.js |
|
| javascripts/application-1d8d5276.js |
|
||||||
|
| stylesheets/site-7474cadd.css |
|
||||||
|
|
||||||
|
Scenario: Hashed-asset files are not replaced for rewrite ignored paths
|
||||||
|
Given a fixture app "asset-hash-app"
|
||||||
|
And a file named "config.rb" with:
|
||||||
|
"""
|
||||||
|
is_stylesheet = proc { |path| path.start_with? '/stylesheets' }
|
||||||
|
activate :asset_hash, rewrite_ignore: [
|
||||||
|
%r(javascripts/*),
|
||||||
|
'/subdir/*',
|
||||||
|
is_stylesheet
|
||||||
|
]
|
||||||
|
activate :relative_assets
|
||||||
|
activate :directory_indexes
|
||||||
|
"""
|
||||||
|
And a successfully built app at "asset-hash-app"
|
||||||
|
When I cd to "build"
|
||||||
|
Then the following files should exist:
|
||||||
|
| index.html |
|
||||||
|
| subdir/index.html |
|
||||||
|
| images/100px-5fd6fb90.jpg |
|
||||||
|
| javascripts/application-1d8d5276.js |
|
||||||
|
| stylesheets/site-8bc55985.css |
|
||||||
|
And the following files should not exist:
|
||||||
|
| images/100px.jpg |
|
||||||
|
| javascripts/application.js |
|
||||||
| stylesheets/site.css |
|
| stylesheets/site.css |
|
||||||
|
And the file "javascripts/application-1d8d5276.js" should contain "img.src = '/images/100px.jpg'"
|
||||||
|
And the file "stylesheets/site-8bc55985.css" should contain:
|
||||||
|
"""
|
||||||
|
background-image: url("../images/100px.jpg")
|
||||||
|
"""
|
||||||
|
And the file "index.html" should contain 'href="stylesheets/site-8bc55985.css"'
|
||||||
|
And the file "index.html" should contain 'src="javascripts/application-1d8d5276.js"'
|
||||||
|
And the file "index.html" should contain 'src="images/100px-5fd6fb90.jpg"'
|
||||||
|
And the file "subdir/index.html" should contain:
|
||||||
|
"""
|
||||||
|
<h2>Image url3:</h2>
|
||||||
|
<p><img src="../images/100px.jpg"></p>
|
||||||
|
"""
|
||||||
|
|
||||||
# @wip Currently broken, we should move all asset-host functionality out of Compass and into something more similar to asset_hash with Rack-based rewrites
|
Scenario: Already minified files should still be hashed
|
||||||
# Scenario: Enabling an asset host and referencing assets in CSS with URL fragments are rewritten correctly
|
Given a successfully built app at "asset-hash-minified-app"
|
||||||
# Given a successfully built app at "asset-hash-host-app"
|
When I cd to "build"
|
||||||
# When I cd to "build"
|
Then the following files should exist:
|
||||||
|
| javascripts/jquery.min-276c87ff.js |
|
||||||
|
| stylesheets/test-7de2ad06.css |
|
||||||
|
And the following files should not exist:
|
||||||
|
| javascripts/jquery.min.js |
|
||||||
|
And the file "stylesheets/test-7de2ad06.css" should contain:
|
||||||
|
"""
|
||||||
|
.no-bug{background-image:url(/images/100px-5fd6fb90.jpg)}
|
||||||
|
.bug{content:"";background-image:url(/images/100px-5fd6fb90.jpg)}
|
||||||
|
.no-bug{content:""; background-image:url(/images/100px-5fd6fb90.jpg)}
|
||||||
|
"""
|
||||||
|
|
||||||
# Then the following files should exist:
|
Scenario: Source map paths include the hash
|
||||||
# | images/100px-5fd6fb90.jpg |
|
Given a successfully built app at "asset-hash-source-map"
|
||||||
# | stylesheets/fragment-c058ecb2.css |
|
When I cd to "build"
|
||||||
# And the following files should not exist:
|
Then the following files should exist:
|
||||||
# | images/100px.jpg |
|
| index.html |
|
||||||
|
| javascripts/application-4553338c.js |
|
||||||
|
| javascripts/application.js-22cc2b5f.map |
|
||||||
|
| index.html |
|
||||||
|
And the following files should not exist:
|
||||||
|
| javascripts/application.js |
|
||||||
|
| javascripts/application.js.map |
|
||||||
|
|
||||||
# And the file "stylesheets/fragment-c058ecb2.css" should contain "http://middlemanapp.com/images/100px-5fd6fb90.jpg#test"
|
And the file "javascripts/application-4553338c.js" should contain "//# sourceMappingURL=application.js-22cc2b5f.map"
|
||||||
# And the file "stylesheets/fragment-c058ecb2.css" should not contain "http://middlemanapp.com/images/100px.jpg#test"
|
|
||||||
|
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"
|
||||||
|
|
|
@ -1,56 +1,55 @@
|
||||||
Feature: Alternate between multiple asset hosts
|
Feature: Alternate between multiple asset hosts
|
||||||
In order to speed up page loading
|
|
||||||
|
|
||||||
Scenario: Set single host globally
|
|
||||||
Given a fixture app "asset-host-app"
|
|
||||||
And a file named "config.rb" with:
|
|
||||||
"""
|
|
||||||
activate :asset_host
|
|
||||||
set :asset_host, "http://assets1.example.com"
|
|
||||||
"""
|
|
||||||
And the Server is running
|
|
||||||
When I go to "/asset_host.html"
|
|
||||||
Then I should see "http://assets1"
|
|
||||||
When I go to "/stylesheets/asset_host.css"
|
|
||||||
Then I should see "http://assets1"
|
|
||||||
|
|
||||||
Scenario: Set proc host globally
|
|
||||||
Given a fixture app "asset-host-app"
|
|
||||||
And a file named "config.rb" with:
|
|
||||||
"""
|
|
||||||
activate :asset_host
|
|
||||||
set :asset_host do |asset|
|
|
||||||
"http://assets%d.example.com" % (asset.hash % 4)
|
|
||||||
end
|
|
||||||
"""
|
|
||||||
And the Server is running
|
|
||||||
When I go to "/asset_host.html"
|
|
||||||
Then I should see "http://assets"
|
|
||||||
When I go to "/stylesheets/asset_host.css"
|
|
||||||
Then I should see "http://assets"
|
|
||||||
|
|
||||||
Scenario: Set single host with inline-option
|
Scenario: Set single host with inline-option
|
||||||
Given a fixture app "asset-host-app"
|
Given a fixture app "asset-host-app"
|
||||||
And a file named "config.rb" with:
|
And a file named "config.rb" with:
|
||||||
"""
|
"""
|
||||||
activate :asset_host, :host => "http://assets1.example.com"
|
activate :asset_host, host: "http://assets1.example.com"
|
||||||
"""
|
"""
|
||||||
And the Server is running
|
And the Server is running
|
||||||
When I go to "/asset_host.html"
|
When I go to "/asset_host.html"
|
||||||
Then I should see "http://assets1"
|
Then I should see "'.google-analytics.com/ga.js'"
|
||||||
|
Then I should see 'src="https://code.jquery.com/jquery-2.1.3.min.js"'
|
||||||
|
Then I should see content matching %r{http://assets1.example.com/}
|
||||||
|
Then I should not see content matching %r{http://assets1.example.com//}
|
||||||
|
Then I should see content matching %r{<a href="https://github.com/angular/angular.js">Angular.js</a>}
|
||||||
|
Then I should see content matching %r{'//www.example.com/script.js'}
|
||||||
When I go to "/stylesheets/asset_host.css"
|
When I go to "/stylesheets/asset_host.css"
|
||||||
Then I should see "http://assets1"
|
Then I should see content matching %r{http://assets1.example.com/}
|
||||||
|
Then I should not see content matching %r{http://assets1.example.com//}
|
||||||
|
When I go to "/javascripts/asset_host.js"
|
||||||
|
Then I should not see content matching %r{http://assets1.example.com/}
|
||||||
|
|
||||||
Scenario: Set proc host with inline-option
|
Scenario: Set proc host with inline-option
|
||||||
Given a fixture app "asset-host-app"
|
Given a fixture app "asset-host-app"
|
||||||
And a file named "config.rb" with:
|
And a file named "config.rb" with:
|
||||||
"""
|
"""
|
||||||
activate :asset_host, :host => Proc.new { |asset|
|
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
|
And the Server is running
|
||||||
When I go to "/asset_host.html"
|
When I go to "/asset_host.html"
|
||||||
Then I should see "http://assets"
|
Then I should see 'src="https://code.jquery.com/jquery-2.1.3.min.js"'
|
||||||
|
Then I should see content matching %r{http://assets1.example.com/}
|
||||||
|
Then I should not see content matching %r{http://assets1.example.com//}
|
||||||
|
Then I should see content matching %r{<a href="https://github.com/angular/angular.js">Angular.js</a>}
|
||||||
|
Then I should see content matching %r{'//www.example.com/script.js'}
|
||||||
When I go to "/stylesheets/asset_host.css"
|
When I go to "/stylesheets/asset_host.css"
|
||||||
Then I should see "http://assets"
|
Then I should see content matching %r{http://assets1.example.com/}
|
||||||
|
Then I should not see content matching %r{http://assets1.example.com//}
|
||||||
|
|
||||||
|
Scenario: Hosts are not rewritten for rewrite ignored paths
|
||||||
|
Given a fixture app "asset-host-app"
|
||||||
|
And a file named "config.rb" with:
|
||||||
|
"""
|
||||||
|
activate :asset_host, host: "http://assets1.example.com", rewrite_ignore: [
|
||||||
|
'/stylesheets/asset_host.css',
|
||||||
|
]
|
||||||
|
"""
|
||||||
|
And the Server is running
|
||||||
|
When I go to "/asset_host.html"
|
||||||
|
Then I should see content matching %r{http://assets1.example.com/}
|
||||||
|
When I go to "/stylesheets/asset_host.css"
|
||||||
|
Then I should not see content matching %r{http://assets1.example.com/}
|
||||||
|
|
|
@ -2,15 +2,28 @@ Feature: Automatically detect and insert image dimensions into tags
|
||||||
In order to speed up development and appease YSlow
|
In order to speed up development and appease YSlow
|
||||||
|
|
||||||
Scenario: Rendering an image with the feature disabled
|
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"
|
And the Server is running at "automatic-image-size-app"
|
||||||
When I go to "/auto-image-sizes.html"
|
When I go to "/auto-image-sizes.html"
|
||||||
Then I should not see "width="
|
Then I should not see "width="
|
||||||
And I should not see "height="
|
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
|
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"
|
And the Server is running at "automatic-image-size-app"
|
||||||
When I go to "/auto-image-sizes.html"
|
When I go to "/auto-image-sizes.html"
|
||||||
Then I should see "width="
|
Then I should see 'width="1"'
|
||||||
And I should see "height="
|
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 |
|
| layout |
|
||||||
| layouts/custom |
|
| layouts/custom |
|
||||||
| layouts/content_for |
|
| layouts/content_for |
|
||||||
|
|
||||||
And the file "index.html" should contain "Comment in layout"
|
And the file "index.html" should contain "Comment in layout"
|
||||||
And the file "index.html" should contain "<h1>Welcome</h1>"
|
And the file "index.html" should contain "<h1>Welcome</h1>"
|
||||||
And the file "static.html" should contain "Static, no code!"
|
And the file "static.html" should contain "Static, no code!"
|
||||||
And the file "services/index.html" should contain "Services"
|
And the file "services/index.html" should contain "Services"
|
||||||
And the file "stylesheets/static.css" should contain "body"
|
And the file "stylesheets/static.css" should contain "body"
|
||||||
|
|
||||||
Scenario: Build glob
|
Scenario: Build glob
|
||||||
Given a successfully built app at "glob-app" with flags "--glob '*.css'"
|
Given a successfully built app at "glob-app" with flags "--glob '*.css'"
|
||||||
When I cd to "build"
|
When I cd to "build"
|
||||||
|
@ -34,16 +34,28 @@ Feature: Builder
|
||||||
| index.html |
|
| index.html |
|
||||||
Then the following files should exist:
|
Then the following files should exist:
|
||||||
| stylesheets/site.css |
|
| stylesheets/site.css |
|
||||||
|
|
||||||
Scenario: Build with errors
|
Scenario: Build with errors
|
||||||
Given a built app at "build-with-errors-app"
|
Given a built app at "build-with-errors-app"
|
||||||
Then the exit status should be 1
|
Then the exit status should be 1
|
||||||
|
|
||||||
Scenario: Build empty errors
|
Scenario: Build empty errors
|
||||||
Given a built app at "empty-app"
|
Given a built app at "empty-app"
|
||||||
Then the exit status should be 1
|
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)
|
Scenario: Build alias (b)
|
||||||
Given a fixture app "large-build-app"
|
Given a fixture app "large-build-app"
|
||||||
When I run `middleman b`
|
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"
|
||||||
|
|
|
@ -5,7 +5,7 @@ Feature: Generate mtime-based query string for busting browser caches
|
||||||
Given "cache_buster" feature is "disabled"
|
Given "cache_buster" feature is "disabled"
|
||||||
And the Server is running at "cache-buster-app"
|
And the Server is running at "cache-buster-app"
|
||||||
When I go to "/stylesheets/relative_assets.css"
|
When I go to "/stylesheets/relative_assets.css"
|
||||||
Then I should see "blank.gif'"
|
Then I should see 'blank.gif"'
|
||||||
|
|
||||||
Scenario: Rendering html with the feature disabled
|
Scenario: Rendering html with the feature disabled
|
||||||
Given "cache_buster" feature is "disabled"
|
Given "cache_buster" feature is "disabled"
|
||||||
|
@ -39,4 +39,18 @@ Feature: Generate mtime-based query string for busting browser caches
|
||||||
And the Server is running at "cache-buster-app"
|
And the Server is running at "cache-buster-app"
|
||||||
When I go to "/cache-buster.html"
|
When I go to "/cache-buster.html"
|
||||||
Then I should see "site.css?"
|
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,13 +7,13 @@ Feature: Templates should be chainable
|
||||||
Then I should see "Title</h1>"
|
Then I should see "Title</h1>"
|
||||||
And I should see "Subtitle</h2>"
|
And I should see "Subtitle</h2>"
|
||||||
And I should see "Sup</h3>"
|
And I should see "Sup</h3>"
|
||||||
|
|
||||||
Scenario: Build chained template
|
Scenario: Build chained template
|
||||||
Given a successfully built app at "chained-app"
|
Given a successfully built app at "chained-app"
|
||||||
When I cd to "build"
|
When I cd to "build"
|
||||||
Then the following files should exist:
|
Then the following files should exist:
|
||||||
| index.html |
|
| index.html |
|
||||||
| test.erb.combobreaker |
|
| test.erb.combobreaker |
|
||||||
And the file "index.html" should contain "Title</h1>"
|
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 "Subtitle</h2>"
|
||||||
And the file "index.html" should contain "Sup</h3>"
|
And the file "index.html" should contain "Sup</h3>"
|
||||||
|
@ -32,7 +32,7 @@ Feature: Templates should be chainable
|
||||||
And a template named "my_partial.html.md.erb" with:
|
And a template named "my_partial.html.md.erb" with:
|
||||||
"""
|
"""
|
||||||
## My Partial
|
## My Partial
|
||||||
|
|
||||||
<%= 'hello world' %>
|
<%= 'hello world' %>
|
||||||
"""
|
"""
|
||||||
And the Server is running
|
And the Server is running
|
||||||
|
@ -61,7 +61,7 @@ Feature: Templates should be chainable
|
||||||
And a template named "my_partial.html.md.erb" with:
|
And a template named "my_partial.html.md.erb" with:
|
||||||
"""
|
"""
|
||||||
## My Partial
|
## My Partial
|
||||||
|
|
||||||
<%= 'hello world' %>
|
<%= 'hello world' %>
|
||||||
"""
|
"""
|
||||||
And the Server is running
|
And the Server is running
|
||||||
|
@ -90,7 +90,7 @@ Feature: Templates should be chainable
|
||||||
And a template named "my_partial.html.erb" with:
|
And a template named "my_partial.html.erb" with:
|
||||||
"""
|
"""
|
||||||
<h2>My Partial</h2>
|
<h2>My Partial</h2>
|
||||||
|
|
||||||
<%= 'hello world' %>
|
<%= 'hello world' %>
|
||||||
"""
|
"""
|
||||||
And the Server is running
|
And the Server is running
|
||||||
|
|
|
@ -16,6 +16,22 @@ Feature: Build Clean
|
||||||
| build/should_be_ignored3.html |
|
| build/should_be_ignored3.html |
|
||||||
And the file "build/index.html" should contain "Comment in layout"
|
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
|
Scenario: Clean build an app with newly ignored files and a nested output directory
|
||||||
Given a fixture app "clean-nested-app"
|
Given a fixture app "clean-nested-app"
|
||||||
When a file named "config.rb" with:
|
When a file named "config.rb" with:
|
||||||
|
@ -42,3 +58,21 @@ Feature: Build Clean
|
||||||
Then the following files should not exist:
|
Then the following files should not exist:
|
||||||
| sub/dir/about.html |
|
| sub/dir/about.html |
|
||||||
| sub/dir/nested/nested.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 |
|
||||||
|
|
|
@ -1,151 +0,0 @@
|
||||||
Feature: Middleman CLI
|
|
||||||
|
|
||||||
Scenario: Create a new project
|
|
||||||
Given I run `middleman init MY_PROJECT`
|
|
||||||
Then the exit status should be 0
|
|
||||||
When I cd to "MY_PROJECT"
|
|
||||||
Then the following files should exist:
|
|
||||||
| Gemfile |
|
|
||||||
| .gitignore |
|
|
||||||
| config.rb |
|
|
||||||
| source/index.html.erb |
|
|
||||||
| source/images/background.png |
|
|
||||||
| source/images/middleman.png |
|
|
||||||
| source/layouts/layout.erb |
|
|
||||||
| source/javascripts/all.js |
|
|
||||||
| source/stylesheets/all.css |
|
|
||||||
| source/stylesheets/normalize.css |
|
|
||||||
|
|
||||||
Scenario: Create a new project in the current directory
|
|
||||||
Given a directory named "MY_PROJECT"
|
|
||||||
When I cd to "MY_PROJECT"
|
|
||||||
And I run `middleman init`
|
|
||||||
Then the exit status should be 0
|
|
||||||
And the following files should exist:
|
|
||||||
| Gemfile |
|
|
||||||
| config.rb |
|
|
||||||
| source/index.html.erb |
|
|
||||||
|
|
||||||
Scenario: Create a new project (alias i)
|
|
||||||
When I run `middleman i MY_PROJECT`
|
|
||||||
Then a directory named "MY_PROJECT" should exist
|
|
||||||
|
|
||||||
Scenario: Create a new project (alias new)
|
|
||||||
When I run `middleman new MY_PROJECT`
|
|
||||||
Then a directory named "MY_PROJECT" should exist
|
|
||||||
|
|
||||||
Scenario: Create a new project (alias n)
|
|
||||||
When I run `middleman n MY_PROJECT`
|
|
||||||
Then a directory named "MY_PROJECT" should exist
|
|
||||||
|
|
||||||
Scenario: Create a new project with Rack
|
|
||||||
When I run `middleman init MY_PROJECT --rack`
|
|
||||||
Then a directory named "MY_PROJECT" should exist
|
|
||||||
When I cd to "MY_PROJECT"
|
|
||||||
Then the following files should exist:
|
|
||||||
| config.rb |
|
|
||||||
| config.ru |
|
|
||||||
| Gemfile |
|
|
||||||
|
|
||||||
Scenario: Create a new HTML5 project
|
|
||||||
When I run `middleman init MY_PROJECT --template=html5`
|
|
||||||
Then a directory named "MY_PROJECT" should exist
|
|
||||||
When I cd to "MY_PROJECT"
|
|
||||||
Then the following files should exist:
|
|
||||||
| config.rb |
|
|
||||||
| Gemfile |
|
|
||||||
Then the following files should not exist:
|
|
||||||
| config.ru |
|
|
||||||
And the file "config.rb" should contain "set :js_dir, 'js'"
|
|
||||||
Then a directory named "source" should exist
|
|
||||||
When I cd to "source"
|
|
||||||
Then the following files should exist:
|
|
||||||
| index.html.erb |
|
|
||||||
| layouts/layout.erb |
|
|
||||||
| humans.txt |
|
|
||||||
| js/main.js |
|
|
||||||
|
|
||||||
Scenario: Create a new HTML5 project with Rack
|
|
||||||
When I run `middleman init MY_PROJECT --rack --template=html5`
|
|
||||||
Then a directory named "MY_PROJECT" should exist
|
|
||||||
When I cd to "MY_PROJECT"
|
|
||||||
Then the following files should exist:
|
|
||||||
| config.rb |
|
|
||||||
| config.ru |
|
|
||||||
| Gemfile |
|
|
||||||
|
|
||||||
Scenario: Create a new Mobile HTML5 project
|
|
||||||
When I run `middleman init MY_PROJECT --template=mobile`
|
|
||||||
Then a directory named "MY_PROJECT" should exist
|
|
||||||
When I cd to "MY_PROJECT"
|
|
||||||
Then the following files should exist:
|
|
||||||
| config.rb |
|
|
||||||
| Gemfile |
|
|
||||||
Then the following files should not exist:
|
|
||||||
| config.ru |
|
|
||||||
Then a directory named "source" should exist
|
|
||||||
When I cd to "source"
|
|
||||||
Then the following files should exist:
|
|
||||||
| index.html |
|
|
||||||
| humans.txt |
|
|
||||||
| js/libs/respond.min.js |
|
|
||||||
|
|
||||||
Scenario: Create a new Mobile HTML5 project with Rack
|
|
||||||
When I run `middleman init MY_PROJECT --rack --template=mobile`
|
|
||||||
Then a directory named "MY_PROJECT" should exist
|
|
||||||
When I cd to "MY_PROJECT"
|
|
||||||
Then the following files should exist:
|
|
||||||
| config.rb |
|
|
||||||
| config.ru |
|
|
||||||
| Gemfile |
|
|
||||||
|
|
||||||
Scenario: Enforce creation of Mobile HTML5 project
|
|
||||||
When I run `middleman init MY_PROJECT --template=mobile`
|
|
||||||
When I run `middleman init MY_PROJECT --template=mobile --force`
|
|
||||||
Then a directory named "MY_PROJECT" should exist
|
|
||||||
And the output should contain:
|
|
||||||
"""
|
|
||||||
identical
|
|
||||||
"""
|
|
||||||
And the output should contain:
|
|
||||||
"""
|
|
||||||
exist
|
|
||||||
"""
|
|
||||||
Scenario: Enforce creation of HTML5 project
|
|
||||||
When I run `middleman init MY_PROJECT --template=html5`
|
|
||||||
When I run `middleman init MY_PROJECT --template=html5 --force`
|
|
||||||
Then a directory named "MY_PROJECT" should exist
|
|
||||||
And the output should contain:
|
|
||||||
"""
|
|
||||||
identical
|
|
||||||
"""
|
|
||||||
And the output should contain:
|
|
||||||
"""
|
|
||||||
exist
|
|
||||||
"""
|
|
||||||
|
|
||||||
Scenario: Enforce creation of default project
|
|
||||||
When I run `middleman init MY_PROJECT --template=default`
|
|
||||||
When I run `middleman init MY_PROJECT --template=default --force`
|
|
||||||
Then a directory named "MY_PROJECT" should exist
|
|
||||||
And the output should contain:
|
|
||||||
"""
|
|
||||||
identical
|
|
||||||
"""
|
|
||||||
And the output should contain:
|
|
||||||
"""
|
|
||||||
exist
|
|
||||||
"""
|
|
||||||
|
|
||||||
Scenario: Enforce creation of empty project
|
|
||||||
When I run `middleman init MY_PROJECT --template=empty`
|
|
||||||
When I run `middleman init MY_PROJECT --template=empty --force`
|
|
||||||
Then a directory named "MY_PROJECT" should exist
|
|
||||||
And the output should contain:
|
|
||||||
"""
|
|
||||||
identical
|
|
||||||
"""
|
|
||||||
And the output should contain:
|
|
||||||
"""
|
|
||||||
exist
|
|
||||||
"""
|
|
265
middleman-core/features/collections.feature
Normal file
265
middleman-core/features/collections.feature
Normal file
|
@ -0,0 +1,265 @@
|
||||||
|
Feature: Collections
|
||||||
|
Scenario: Lazy query
|
||||||
|
Given a fixture app "collections-app"
|
||||||
|
And a file named "config.rb" with:
|
||||||
|
"""
|
||||||
|
articles1 = collection :articles1, resources.select { |r|
|
||||||
|
matcher = ::Middleman::Util::UriTemplates.uri_template('blog1/{year}-{month}-{day}-{title}.html')
|
||||||
|
::Middleman::Util::UriTemplates.extract_params(matcher, ::Middleman::Util.normalize_path(r.url))
|
||||||
|
}
|
||||||
|
|
||||||
|
everything = resources.select do |r|
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
def get_tags(resource)
|
||||||
|
if resource.data.tags.is_a? String
|
||||||
|
resource.data.tags.split(',').map(&:strip)
|
||||||
|
else
|
||||||
|
resource.data.tags
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def group_lookup(resource, sum)
|
||||||
|
results = Array(get_tags(resource)).map(&:to_s).map(&:to_sym)
|
||||||
|
|
||||||
|
results.each do |k|
|
||||||
|
sum[k] ||= []
|
||||||
|
sum[k] << resource
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
tags = everything
|
||||||
|
.select { |resource| resource.data.tags }
|
||||||
|
.each_with_object({}, &method(:group_lookup))
|
||||||
|
|
||||||
|
class Wrapper
|
||||||
|
attr_reader :stuff
|
||||||
|
|
||||||
|
def initialize
|
||||||
|
@stuff = Set.new
|
||||||
|
end
|
||||||
|
|
||||||
|
def <<((k, v))
|
||||||
|
@stuff << k
|
||||||
|
self
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
collection :wrapped, tags.reduce(Wrapper.new, :<<)
|
||||||
|
|
||||||
|
set :tags, tags # Expose to templates
|
||||||
|
|
||||||
|
collection :first_tag, tags.keys.sort.first
|
||||||
|
"""
|
||||||
|
And a file named "source/index.html.erb" with:
|
||||||
|
"""
|
||||||
|
<% collection(:articles1).each do |article| %>
|
||||||
|
Article1: <%= article.data.title %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
Tag Count: <%= collection(:wrapped).stuff.length %>
|
||||||
|
|
||||||
|
<% config[:tags].value.each do |k, items| %>
|
||||||
|
Tag: <%= k %> (<%= items.length %>)
|
||||||
|
<% items.each do |article| %>
|
||||||
|
Article (<%= k %>): <%= article.data.title %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
First Tag: <%= collection(:first_tag) %>
|
||||||
|
"""
|
||||||
|
Given the Server is running at "collections-app"
|
||||||
|
When I go to "index.html"
|
||||||
|
Then I should see 'Article1: Blog1 Newer Article'
|
||||||
|
And I should see 'Article1: Blog1 Another Article'
|
||||||
|
And I should see 'Tag: foo (4)'
|
||||||
|
And I should see 'Article (foo): Blog1 Newer Article'
|
||||||
|
And I should see 'Article (foo): Blog1 Another Article'
|
||||||
|
And I should see 'Article (foo): Blog2 Newer Article'
|
||||||
|
And I should see 'Article (foo): Blog2 Another Article'
|
||||||
|
And I should see 'Tag: bar (2)'
|
||||||
|
And I should see 'Article (bar): Blog1 Newer Article'
|
||||||
|
And I should see 'Article (bar): Blog2 Newer Article'
|
||||||
|
And I should see 'Tag: 120 (1)'
|
||||||
|
And I should see 'Article (120): Blog1 Another Article'
|
||||||
|
And I should see 'First Tag: 120'
|
||||||
|
And I should see 'Tag Count: 3'
|
||||||
|
|
||||||
|
Scenario: Collected resources update with file changes
|
||||||
|
Given a fixture app "collections-app"
|
||||||
|
And a file named "config.rb" with:
|
||||||
|
"""
|
||||||
|
collection :articles, resources.select { |r|
|
||||||
|
matcher = ::Middleman::Util::UriTemplates.uri_template('blog2/{year}-{month}-{day}-{title}.html')
|
||||||
|
::Middleman::Util::UriTemplates.extract_params(matcher, ::Middleman::Util.normalize_path(r.url))
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
And a file named "source/index.html.erb" with:
|
||||||
|
"""
|
||||||
|
<% collection(:articles).each do |article| %>
|
||||||
|
Article: <%= article.data.title || article.file_descriptor[:relative_path] %>
|
||||||
|
<% end %>
|
||||||
|
"""
|
||||||
|
Given the Server is running at "collections-app"
|
||||||
|
When I go to "index.html"
|
||||||
|
Then I should not see "Article: index.html.erb"
|
||||||
|
Then I should see 'Article: Blog2 Newer Article'
|
||||||
|
And I should see 'Article: Blog2 Another Article'
|
||||||
|
|
||||||
|
And the file "source/blog2/2011-01-02-another-article.html.markdown" has the contents
|
||||||
|
"""
|
||||||
|
---
|
||||||
|
title: "Blog3 Another Article"
|
||||||
|
date: 2011-01-02
|
||||||
|
tags:
|
||||||
|
- foo
|
||||||
|
---
|
||||||
|
|
||||||
|
Another Article Content
|
||||||
|
|
||||||
|
"""
|
||||||
|
When I go to "index.html"
|
||||||
|
Then I should see "Article: Blog2 Newer Article"
|
||||||
|
And I should not see "Article: Blog2 Another Article"
|
||||||
|
And I should see 'Article: Blog3 Another Article'
|
||||||
|
|
||||||
|
And the file "source/blog2/2011-01-01-new-article.html.markdown" is removed
|
||||||
|
When I go to "index.html"
|
||||||
|
Then I should not see "Article: Blog2 Newer Article"
|
||||||
|
And I should see 'Article: Blog3 Another Article'
|
||||||
|
|
||||||
|
And the file "source/blog2/2014-01-02-yet-another-article.html.markdown" has the contents
|
||||||
|
"""
|
||||||
|
---
|
||||||
|
title: "Blog2 Yet Another Article"
|
||||||
|
date: 2011-01-02
|
||||||
|
tags:
|
||||||
|
- foo
|
||||||
|
---
|
||||||
|
|
||||||
|
Yet Another Article Content
|
||||||
|
"""
|
||||||
|
When I go to "index.html"
|
||||||
|
And I should see 'Article: Blog3 Another Article'
|
||||||
|
And I should see 'Article: Blog2 Yet Another Article'
|
||||||
|
|
||||||
|
Scenario: Work with local helpers
|
||||||
|
Given a fixture app "collections-app"
|
||||||
|
And a file named "config.rb" with:
|
||||||
|
"""
|
||||||
|
module TestHelper
|
||||||
|
def help_me
|
||||||
|
"ok"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
include TestHelper
|
||||||
|
|
||||||
|
data.articles.each_with_index do |a, i|
|
||||||
|
proxy "/#{i}-#{help_me}.html", a
|
||||||
|
end
|
||||||
|
"""
|
||||||
|
And a file named "data/articles.yaml" with:
|
||||||
|
"""
|
||||||
|
---
|
||||||
|
- "/blog1/2011-01-01-new-article.html"
|
||||||
|
- "/blog2/2011-01-02-another-article.html"
|
||||||
|
"""
|
||||||
|
Given the Server is running at "collections-app"
|
||||||
|
When I go to "0-ok.html"
|
||||||
|
Then I should see 'Newer Article Content'
|
||||||
|
When I go to "1-ok.html"
|
||||||
|
Then I should see 'Another Article Content'
|
||||||
|
|
||||||
|
Scenario: Collected data update with file changes
|
||||||
|
Given a fixture app "collections-app"
|
||||||
|
And a file named "config.rb" with:
|
||||||
|
"""
|
||||||
|
data.articles.each_with_index do |a, i|
|
||||||
|
proxy "/#{i}.html", a
|
||||||
|
end
|
||||||
|
"""
|
||||||
|
And a file named "data/articles.yaml" with:
|
||||||
|
"""
|
||||||
|
---
|
||||||
|
- "/blog1/2011-01-01-new-article.html"
|
||||||
|
- "/blog2/2011-01-02-another-article.html"
|
||||||
|
"""
|
||||||
|
Given the Server is running at "collections-app"
|
||||||
|
When I go to "0.html"
|
||||||
|
Then I should see 'Newer Article Content'
|
||||||
|
When I go to "1.html"
|
||||||
|
Then I should see 'Another Article Content'
|
||||||
|
When I go to "2.html"
|
||||||
|
Then I should see 'Not Found'
|
||||||
|
|
||||||
|
When the file "data/articles.yaml" has the contents
|
||||||
|
"""
|
||||||
|
---
|
||||||
|
- "/blog1/2011-01-01-new-article.html"
|
||||||
|
"""
|
||||||
|
When I go to "0.html"
|
||||||
|
Then I should see 'Newer Article Content'
|
||||||
|
When I go to "1.html"
|
||||||
|
Then I should see 'Not Found'
|
||||||
|
When I go to "2.html"
|
||||||
|
Then I should see 'Not Found'
|
||||||
|
|
||||||
|
When the file "data/articles.yaml" has the contents
|
||||||
|
"""
|
||||||
|
---
|
||||||
|
- "/blog2/2011-01-02-another-article.html"
|
||||||
|
- "/blog1/2011-01-01-new-article.html"
|
||||||
|
- "/blog2/2011-01-01-new-article.html"
|
||||||
|
"""
|
||||||
|
When I go to "0.html"
|
||||||
|
Then I should see 'Another Article Content'
|
||||||
|
When I go to "1.html"
|
||||||
|
Then I should see 'Newer Article Content'
|
||||||
|
When I go to "2.html"
|
||||||
|
Then I should see 'Again'
|
||||||
|
|
||||||
|
Scenario: Arbitrary live datasets
|
||||||
|
Given a fixture app "collections-app"
|
||||||
|
And a file named "config.rb" with:
|
||||||
|
"""
|
||||||
|
ignore "/description_template.html"
|
||||||
|
|
||||||
|
live {
|
||||||
|
Dir[File.join(root, "descriptions/*.txt")]
|
||||||
|
}.each do |description_name|
|
||||||
|
base = File.basename(description_name, '.txt')
|
||||||
|
proxy "#{base}.html", "/description_template.html", locals: {
|
||||||
|
contents: File.read(description_name)
|
||||||
|
}
|
||||||
|
end
|
||||||
|
"""
|
||||||
|
And a file named "source/description_template.html.erb" with:
|
||||||
|
"""
|
||||||
|
<%= contents %>
|
||||||
|
"""
|
||||||
|
And a file named "descriptions/test1.txt" with:
|
||||||
|
"""
|
||||||
|
Test1
|
||||||
|
"""
|
||||||
|
Given the Server is running at "collections-app"
|
||||||
|
When I go to "test1.html"
|
||||||
|
Then I should see 'Test1'
|
||||||
|
When I go to "test2.html"
|
||||||
|
Then I should see 'Not Found'
|
||||||
|
|
||||||
|
When the file "descriptions/test2.txt" has the contents
|
||||||
|
"""
|
||||||
|
Test2
|
||||||
|
"""
|
||||||
|
When I go to "test1.html"
|
||||||
|
Then I should see 'Test1'
|
||||||
|
When I go to "test2.html"
|
||||||
|
Then I should see 'Test2'
|
||||||
|
|
||||||
|
When the file "descriptions/test1.txt" is removed
|
||||||
|
When I go to "test1.html"
|
||||||
|
Then I should see 'Not Found'
|
||||||
|
When I go to "test2.html"
|
||||||
|
Then I should see 'Test2'
|
|
@ -1,6 +0,0 @@
|
||||||
Feature: Compass sprites should be generated on build and copied
|
|
||||||
Scenario: Building a clean site with sprites
|
|
||||||
Given a successfully built app at "compass-sprites-app"
|
|
||||||
When I cd to "build"
|
|
||||||
Then the following files should exist:
|
|
||||||
| images/icon-s0de2218f58.png |
|
|
|
@ -1,8 +1,9 @@
|
||||||
Feature: Console
|
Feature: Console
|
||||||
|
|
||||||
Scenario: Enter and exit the console
|
Scenario: Enter and exit the console
|
||||||
Given I run `middleman console` interactively
|
Given a fixture app "large-build-app"
|
||||||
When I type "puts 'Hello from the console.'"
|
When I run `middleman console` interactively
|
||||||
|
And I type "puts 'Hello from the console.'"
|
||||||
And I type "exit"
|
And I type "exit"
|
||||||
Then it should pass with:
|
Then it should pass with:
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -19,8 +19,8 @@ Feature: Setting the right content type for files
|
||||||
Given a fixture app "content-type-app"
|
Given a fixture app "content-type-app"
|
||||||
And a file named "config.rb" with:
|
And a file named "config.rb" with:
|
||||||
"""
|
"""
|
||||||
page "README", :content_type => 'text/awesome'
|
page "README", content_type: 'text/awesome'
|
||||||
proxy "bar", "index.html", :content_type => 'text/custom'
|
proxy "bar", "index.html", content_type: 'text/custom'
|
||||||
proxy "foo", "README" # auto-delegate to target content type
|
proxy "foo", "README" # auto-delegate to target content type
|
||||||
"""
|
"""
|
||||||
And the Server is running at "content-type-app"
|
And the Server is running at "content-type-app"
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
Feature: Support old request.path object used by many extensions
|
|
||||||
|
|
||||||
Scenario: Viewing the root path
|
|
||||||
Given the Server is running at "current-page-app"
|
|
||||||
When I go to "/request-path.html"
|
|
||||||
Then I should see "true"
|
|
|
@ -1,26 +1,38 @@
|
||||||
Feature: Custom layouts
|
Feature: Custom layouts
|
||||||
In order easily switch between relative and absolute paths
|
In order easily switch between relative and absolute paths
|
||||||
|
|
||||||
Scenario: Using custom :layout attribute
|
Scenario: Using custom :layout attribute
|
||||||
Given page "/custom-layout.html" has layout "custom"
|
Given a fixture app "custom-layout-app2"
|
||||||
And the Server is running at "custom-layout-app2"
|
And a file named "config.rb" with:
|
||||||
When I go to "/custom-layout.html"
|
"""
|
||||||
Then I should see "Custom Layout"
|
page '/custom-layout.html', layout: :custom
|
||||||
|
"""
|
||||||
Scenario: Using with_layout block
|
|
||||||
Given "/custom-layout.html" with_layout block has layout "custom"
|
|
||||||
And the Server is running at "custom-layout-app2"
|
And the Server is running at "custom-layout-app2"
|
||||||
When I go to "/custom-layout.html"
|
When I go to "/custom-layout.html"
|
||||||
Then I should see "Custom Layout"
|
Then I should see "Custom Layout"
|
||||||
|
|
||||||
Scenario: Using with_layout block with globs
|
Scenario: Using custom :layout attribute with proxy
|
||||||
Given "/custom-*" with_layout block has layout "custom"
|
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"
|
And the Server is running at "custom-layout-app2"
|
||||||
When I go to "/custom-layout.html"
|
When I go to "/test/me.html"
|
||||||
Then I should see "Custom Layout"
|
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
|
Scenario: Using custom :layout attribute with folders
|
||||||
Given page "/custom-layout-dir/" has layout "custom"
|
Given a fixture app "custom-layout-app2"
|
||||||
|
And a file named "config.rb" with:
|
||||||
|
"""
|
||||||
|
page '/custom-layout-dir/', layout: :custom
|
||||||
|
"""
|
||||||
And the Server is running at "custom-layout-app2"
|
And the Server is running at "custom-layout-app2"
|
||||||
When I go to "/custom-layout-dir"
|
When I go to "/custom-layout-dir"
|
||||||
Then I should see "Custom Layout"
|
Then I should see "Custom Layout"
|
||||||
|
@ -28,9 +40,13 @@ Feature: Custom layouts
|
||||||
Then I should see "Custom Layout"
|
Then I should see "Custom Layout"
|
||||||
When I go to "/custom-layout-dir/index.html"
|
When I go to "/custom-layout-dir/index.html"
|
||||||
Then I should see "Custom Layout"
|
Then I should see "Custom Layout"
|
||||||
|
|
||||||
Scenario: Using custom :layout attribute with folders
|
Scenario: Using custom :layout attribute with folders
|
||||||
Given page "/custom-layout-dir" has layout "custom"
|
Given a fixture app "custom-layout-app2"
|
||||||
|
And a file named "config.rb" with:
|
||||||
|
"""
|
||||||
|
page '/custom-layout-dir', layout: :custom
|
||||||
|
"""
|
||||||
And the Server is running at "custom-layout-app2"
|
And the Server is running at "custom-layout-app2"
|
||||||
When I go to "/custom-layout-dir"
|
When I go to "/custom-layout-dir"
|
||||||
Then I should see "Custom Layout"
|
Then I should see "Custom Layout"
|
||||||
|
@ -38,9 +54,13 @@ Feature: Custom layouts
|
||||||
Then I should see "Custom Layout"
|
Then I should see "Custom Layout"
|
||||||
When I go to "/custom-layout-dir/index.html"
|
When I go to "/custom-layout-dir/index.html"
|
||||||
Then I should see "Custom Layout"
|
Then I should see "Custom Layout"
|
||||||
|
|
||||||
Scenario: Using custom :layout attribute with folders
|
Scenario: Using custom :layout attribute with folders
|
||||||
Given page "/custom-layout-dir/index.html" has layout "custom"
|
Given a fixture app "custom-layout-app2"
|
||||||
|
And a file named "config.rb" with:
|
||||||
|
"""
|
||||||
|
page '/custom-layout-dir/index.html', layout: :custom
|
||||||
|
"""
|
||||||
And the Server is running at "custom-layout-app2"
|
And the Server is running at "custom-layout-app2"
|
||||||
When I go to "/custom-layout-dir"
|
When I go to "/custom-layout-dir"
|
||||||
Then I should see "Custom Layout"
|
Then I should see "Custom Layout"
|
||||||
|
@ -48,7 +68,7 @@ Feature: Custom layouts
|
||||||
Then I should see "Custom Layout"
|
Then I should see "Custom Layout"
|
||||||
When I go to "/custom-layout-dir/index.html"
|
When I go to "/custom-layout-dir/index.html"
|
||||||
Then I should see "Custom Layout"
|
Then I should see "Custom Layout"
|
||||||
|
|
||||||
Scenario: Setting layout inside a matching page block
|
Scenario: Setting layout inside a matching page block
|
||||||
Given the Server is running at "page-helper-layout-block-app"
|
Given the Server is running at "page-helper-layout-block-app"
|
||||||
When I go to "/index.html"
|
When I go to "/index.html"
|
||||||
|
@ -61,4 +81,4 @@ Feature: Custom layouts
|
||||||
When I go to "/path/index.html"
|
When I go to "/path/index.html"
|
||||||
Then I should see "Alt"
|
Then I should see "Alt"
|
||||||
And I should see "Monde"
|
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 "title1:Hello"
|
||||||
Then I should see "title2:More"
|
Then I should see "title2:More"
|
||||||
Then I should see "title3:Stuff"
|
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>"
|
||||||
|
|
90
middleman-core/features/default-layout.feature
Normal file
90
middleman-core/features/default-layout.feature
Normal file
|
@ -0,0 +1,90 @@
|
||||||
|
Feature: Describe which files get layouts
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given an empty app
|
||||||
|
And a file named "config.rb" with:
|
||||||
|
"""
|
||||||
|
page "/about.html", layout: :layout2
|
||||||
|
"""
|
||||||
|
And a file named "source/layouts/layout.erb" with:
|
||||||
|
"""
|
||||||
|
In Layout
|
||||||
|
<%= yield %>
|
||||||
|
"""
|
||||||
|
And a file named "source/layouts/layout2.erb" with:
|
||||||
|
"""
|
||||||
|
<root>
|
||||||
|
<title>Second Layout</title>
|
||||||
|
<%= yield %>
|
||||||
|
</root>
|
||||||
|
"""
|
||||||
|
And a file named "source/index.html.erb" with:
|
||||||
|
"""
|
||||||
|
In Index
|
||||||
|
"""
|
||||||
|
And a file named "source/about.html.erb" with:
|
||||||
|
"""
|
||||||
|
In About
|
||||||
|
"""
|
||||||
|
And a file named "source/style.css.scss" with:
|
||||||
|
"""
|
||||||
|
html { border: 1; }
|
||||||
|
"""
|
||||||
|
And a file named "source/style2.scss" with:
|
||||||
|
"""
|
||||||
|
html { border: 2; }
|
||||||
|
"""
|
||||||
|
And a file named "source/data.json" with:
|
||||||
|
"""
|
||||||
|
{ "hello": "world" }
|
||||||
|
"""
|
||||||
|
And a file named "source/script.js" with:
|
||||||
|
"""
|
||||||
|
helloWorld();
|
||||||
|
"""
|
||||||
|
And a file named "source/test.xml.erb" with:
|
||||||
|
"""
|
||||||
|
---
|
||||||
|
layout: layout2
|
||||||
|
---
|
||||||
|
|
||||||
|
<test>Hi</test>
|
||||||
|
"""
|
||||||
|
And the Server is running at "empty_app"
|
||||||
|
|
||||||
|
Scenario: Normal Template
|
||||||
|
When I go to "/index.html"
|
||||||
|
Then I should see "In Index"
|
||||||
|
And I should see "In Layout"
|
||||||
|
|
||||||
|
Scenario: Normal Template with override
|
||||||
|
When I go to "/about.html"
|
||||||
|
Then I should see "In About"
|
||||||
|
And I should see "Second Layout"
|
||||||
|
And I should not see "In Layout"
|
||||||
|
|
||||||
|
Scenario: Sass
|
||||||
|
When I go to "/style.css"
|
||||||
|
Then I should see "border: 1"
|
||||||
|
And I should not see "In Layout"
|
||||||
|
|
||||||
|
Scenario: Sass with extension
|
||||||
|
When I go to "/style2"
|
||||||
|
Then I should see "border: 2"
|
||||||
|
And I should not see "In Layout"
|
||||||
|
|
||||||
|
Scenario: JSON
|
||||||
|
When I go to "/data.json"
|
||||||
|
Then I should see "hello"
|
||||||
|
And I should not see "In Layout"
|
||||||
|
|
||||||
|
Scenario: JS
|
||||||
|
When I go to "/script.js"
|
||||||
|
Then I should see "helloWorld()"
|
||||||
|
And I should not see "In Layout"
|
||||||
|
|
||||||
|
Scenario: XML
|
||||||
|
When I go to "/test.xml"
|
||||||
|
Then I should see "<test>Hi</test>"
|
||||||
|
And I should see "<title>Second Layout</title>"
|
||||||
|
|
|
@ -9,6 +9,7 @@ Feature: Directory Index
|
||||||
| a_folder/needs_index/index.html |
|
| a_folder/needs_index/index.html |
|
||||||
| leave_me_alone.html |
|
| leave_me_alone.html |
|
||||||
| wildcard_leave_me_alone.html |
|
| wildcard_leave_me_alone.html |
|
||||||
|
| regex_leave_me_alone2.html |
|
||||||
| evil spaces/index.html |
|
| evil spaces/index.html |
|
||||||
| regular/index.html |
|
| regular/index.html |
|
||||||
| .htaccess |
|
| .htaccess |
|
||||||
|
@ -21,17 +22,18 @@ Feature: Directory Index
|
||||||
| a_folder/needs_index.html |
|
| a_folder/needs_index.html |
|
||||||
| leave_me_alone/index.html |
|
| leave_me_alone/index.html |
|
||||||
| wildcard_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 "needs_index/index.html" should contain "Indexable"
|
||||||
And the file "a_folder/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 "leave_me_alone.html" should contain "Stay away"
|
||||||
And the file "regular/index.html" should contain "Regular"
|
And the file "regular/index.html" should contain "Regular"
|
||||||
And the file "evil spaces/index.html" should contain "Filled with Evil Spaces"
|
And the file "evil spaces/index.html" should contain "Filled with Evil Spaces"
|
||||||
|
|
||||||
Scenario: Preview normal file
|
Scenario: Preview normal file
|
||||||
Given the Server is running at "indexable-app"
|
Given the Server is running at "indexable-app"
|
||||||
When I go to "/needs_index/"
|
When I go to "/needs_index/"
|
||||||
Then I should see "Indexable"
|
Then I should see "Indexable"
|
||||||
|
|
||||||
Scenario: Preview normal file with spaces in filename
|
Scenario: Preview normal file with spaces in filename
|
||||||
Given the Server is running at "indexable-app"
|
Given the Server is running at "indexable-app"
|
||||||
When I go to "/evil spaces/"
|
When I go to "/evil spaces/"
|
||||||
|
@ -41,7 +43,7 @@ Feature: Directory Index
|
||||||
Given the Server is running at "indexable-app"
|
Given the Server is running at "indexable-app"
|
||||||
When I go to "/a_folder/needs_index/"
|
When I go to "/a_folder/needs_index/"
|
||||||
Then I should see "Indexable"
|
Then I should see "Indexable"
|
||||||
|
|
||||||
Scenario: Preview ignored file
|
Scenario: Preview ignored file
|
||||||
Given the Server is running at "indexable-app"
|
Given the Server is running at "indexable-app"
|
||||||
When I go to "/leave_me_alone/"
|
When I go to "/leave_me_alone/"
|
||||||
|
@ -68,14 +70,13 @@ Feature: Directory Index
|
||||||
And the Server is running at "indexable-app"
|
And the Server is running at "indexable-app"
|
||||||
When I go to "/link_to/"
|
When I go to "/link_to/"
|
||||||
Then I should see 'link_to: <a href="/needs_index/">Needs Index</a>'
|
Then I should see 'link_to: <a href="/needs_index/">Needs Index</a>'
|
||||||
Then I should see 'explicit_link_to: <a href="/needs_index/index.html">Explicit</a>'
|
Then I should see 'explicit_link_to: <a href="/needs_index/">Explicit</a>'
|
||||||
Then I should see 'unknown_link_to: <a href="/unknown.html">Unknown</a>'
|
Then I should see 'unknown_link_to: <a href="/unknown.html">Unknown</a>'
|
||||||
Then I should see 'relative_link_to: <a href="/needs_index/">Relative</a>'
|
Then I should see 'relative_link_to: <a href="/needs_index/">Relative</a>'
|
||||||
Then I should see 'link_to_with_spaces: <a href="/evil%20spaces/">Spaces</a>'
|
Then I should see 'link_to_with_spaces: <a href="/evil%20spaces/">Spaces</a>'
|
||||||
When I go to "/link_to/sub/"
|
When I go to "/link_to/sub/"
|
||||||
Then I should see 'link_to: <a href="/needs_index/">Needs Index</a>'
|
Then I should see 'link_to: <a href="/needs_index/">Needs Index</a>'
|
||||||
Then I should see 'explicit_link_to: <a href="/needs_index/index.html">Explicit</a>'
|
Then I should see 'explicit_link_to: <a href="/needs_index/">Explicit</a>'
|
||||||
Then I should see 'unknown_link_to: <a href="/unknown.html">Unknown</a>'
|
Then I should see 'unknown_link_to: <a href="/unknown.html">Unknown</a>'
|
||||||
Then I should see 'relative_link_to: <a href="/needs_index/">Relative</a>'
|
Then I should see 'relative_link_to: <a href="/needs_index/">Relative</a>'
|
||||||
Then I should see 'link_to_with_spaces: <a href="/evil%20spaces/">Spaces</a>'
|
Then I should see 'link_to_with_spaces: <a href="/evil%20spaces/">Spaces</a>'
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,8 @@ Feature: Dynamic Pages
|
||||||
| should_be_ignored6.html |
|
| should_be_ignored6.html |
|
||||||
| should_be_ignored7.html |
|
| should_be_ignored7.html |
|
||||||
| should_be_ignored8.html |
|
| should_be_ignored8.html |
|
||||||
|
| should_be_ignored9.html |
|
||||||
|
|
||||||
Scenario: Preview basic proxy
|
Scenario: Preview basic proxy
|
||||||
Given the Server is running at "dynamic-pages-app"
|
Given the Server is running at "dynamic-pages-app"
|
||||||
When I go to "/fake.html"
|
When I go to "/fake.html"
|
||||||
|
@ -42,46 +43,46 @@ Feature: Dynamic Pages
|
||||||
Then I should see "I am real"
|
Then I should see "I am real"
|
||||||
When I go to "/fake4.html"
|
When I go to "/fake4.html"
|
||||||
Then I should see "I am real"
|
Then I should see "I am real"
|
||||||
|
|
||||||
Scenario: Preview proxy with variable one
|
Scenario: Preview proxy with variable one
|
||||||
Given the Server is running at "dynamic-pages-app"
|
Given the Server is running at "dynamic-pages-app"
|
||||||
When I go to "/fake/one.html"
|
When I go to "/fake/one.html"
|
||||||
Then I should see "I am real: one"
|
Then I should see "I am real: one"
|
||||||
Then I should see "Global: I am one glob"
|
Then I should see "Global: I am one glob"
|
||||||
Then I should see "All: I am all glob"
|
Then I should see "All: I am all glob"
|
||||||
|
|
||||||
When I go to "/fake2/one.html"
|
When I go to "/fake2/one.html"
|
||||||
Then I should see "I am real: one"
|
Then I should see "I am real: one"
|
||||||
Then I should see "Global: I am two glob"
|
Then I should see "Global: I am two glob"
|
||||||
Then I should see "All: I am all glob"
|
Then I should see "All: I am all glob"
|
||||||
|
|
||||||
When I go to "/fake3/one.html"
|
When I go to "/fake3/one.html"
|
||||||
Then I should see "I am real: one"
|
Then I should see "I am real: one"
|
||||||
Then I should see "Global: I am three glob"
|
Then I should see "Global: I am three glob"
|
||||||
Then I should see "All: I am all glob"
|
Then I should see "All: I am all glob"
|
||||||
|
|
||||||
When I go to "/fake4/one.html"
|
When I go to "/fake4/one.html"
|
||||||
Then I should see "I am real: one"
|
Then I should see "I am real: one"
|
||||||
Then I should see "Global: I am four glob"
|
Then I should see "Global: I am four glob"
|
||||||
Then I should see "All: I am all glob"
|
Then I should see "All: I am all glob"
|
||||||
|
|
||||||
Scenario: Preview proxy with variable two
|
Scenario: Preview proxy with variable two
|
||||||
Given the Server is running at "dynamic-pages-app"
|
Given the Server is running at "dynamic-pages-app"
|
||||||
When I go to "/fake/two.html"
|
When I go to "/fake/two.html"
|
||||||
Then I should see "I am real: two"
|
Then I should see "I am real: two"
|
||||||
Then I should see "Global: I am one glob"
|
Then I should see "Global: I am one glob"
|
||||||
Then I should see "All: I am all glob"
|
Then I should see "All: I am all glob"
|
||||||
|
|
||||||
When I go to "/fake2/two.html"
|
When I go to "/fake2/two.html"
|
||||||
Then I should see "I am real: two"
|
Then I should see "I am real: two"
|
||||||
Then I should see "Global: I am two glob"
|
Then I should see "Global: I am two glob"
|
||||||
Then I should see "All: I am all glob"
|
Then I should see "All: I am all glob"
|
||||||
|
|
||||||
When I go to "/fake3/two.html"
|
When I go to "/fake3/two.html"
|
||||||
Then I should see "I am real: two"
|
Then I should see "I am real: two"
|
||||||
Then I should see "Global: I am three glob"
|
Then I should see "Global: I am three glob"
|
||||||
Then I should see "All: I am all glob"
|
Then I should see "All: I am all glob"
|
||||||
|
|
||||||
When I go to "/fake4/two.html"
|
When I go to "/fake4/two.html"
|
||||||
Then I should see "I am real: two"
|
Then I should see "I am real: two"
|
||||||
Then I should see "Global: I am four glob"
|
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 "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 "Global: I am three glob"
|
||||||
Then the file "fake3/one.html" should contain "All: I am all glob"
|
Then the file "fake3/one.html" should contain "All: I am all glob"
|
||||||
|
|
||||||
Scenario: Target ignore
|
Scenario: Target ignore
|
||||||
Given the Server is running at "dynamic-pages-app"
|
Given the Server is running at "dynamic-pages-app"
|
||||||
When I go to "/target_ignore.html"
|
When I go to "/target_ignore.html"
|
||||||
|
@ -112,7 +113,7 @@ Feature: Dynamic Pages
|
||||||
Then I should see "Ignore me! 7"
|
Then I should see "Ignore me! 7"
|
||||||
When I go to "/target_ignore4.html"
|
When I go to "/target_ignore4.html"
|
||||||
Then I should see "Ignore me! 8"
|
Then I should see "Ignore me! 8"
|
||||||
|
|
||||||
Scenario: Preview ignored paths
|
Scenario: Preview ignored paths
|
||||||
Given the Server is running at "dynamic-pages-app"
|
Given the Server is running at "dynamic-pages-app"
|
||||||
When I go to "/should_be_ignored.html"
|
When I go to "/should_be_ignored.html"
|
||||||
|
@ -130,4 +131,6 @@ Feature: Dynamic Pages
|
||||||
When I go to "/should_be_ignored7.html"
|
When I go to "/should_be_ignored7.html"
|
||||||
Then I should see "File Not Found"
|
Then I should see "File Not Found"
|
||||||
When I go to "/should_be_ignored8.html"
|
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"
|
||||||
|
|
28
middleman-core/features/encoding_option.feature
Normal file
28
middleman-core/features/encoding_option.feature
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
# encoding: iso-8859-1
|
||||||
|
Feature: encoding option
|
||||||
|
|
||||||
|
Scenario: No encoding set
|
||||||
|
Given a fixture app "clean-app"
|
||||||
|
Given the Server is running at "clean-app"
|
||||||
|
|
||||||
|
When I go to "/index.html"
|
||||||
|
Then the "Content-Type" header should contain "text/html"
|
||||||
|
Then the "Content-Type" header should contain "charset=utf-8"
|
||||||
|
|
||||||
|
@wip
|
||||||
|
Scenario: Custom encoding set
|
||||||
|
Given a fixture app "i-8859-1-app"
|
||||||
|
And a file named "config.rb" with:
|
||||||
|
"""
|
||||||
|
set :encoding, "ISO-8859-1"
|
||||||
|
|
||||||
|
::Rack::Mime::MIME_TYPES['.html'] = 'text/html; charset=iso-8859-1'
|
||||||
|
::Rack::Mime::MIME_TYPES['.htm'] = 'text/html; charset=iso-8859-1'
|
||||||
|
::Rack::Mime::MIME_TYPES['.map'] = 'application/json; charset=iso-8859-1'
|
||||||
|
"""
|
||||||
|
Given the Server is running at "i-8859-1-app"
|
||||||
|
|
||||||
|
When I go to "/index.html"
|
||||||
|
Then the "Content-Type" header should contain "text/html"
|
||||||
|
Then the "Content-Type" header should contain "charset=iso-8859-1"
|
||||||
|
Then I should see "äöü"
|
10
middleman-core/features/extension_api_deprecations.feature
Normal file
10
middleman-core/features/extension_api_deprecations.feature
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
Feature: Extension author could use some hooks
|
||||||
|
|
||||||
|
Scenario: When build
|
||||||
|
Given a fixture app "extension-api-deprecations-app"
|
||||||
|
When I run `middleman build`
|
||||||
|
Then the exit status should be 0
|
||||||
|
And the output should contain "`set :layout` is deprecated"
|
||||||
|
And the file "build/index.html" should contain "In Index"
|
||||||
|
And the file "build/index.html" should not contain "In Layout"
|
||||||
|
|
13
middleman-core/features/extension_hooks.feature
Normal file
13
middleman-core/features/extension_hooks.feature
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
Feature: Extension author could use some hooks
|
||||||
|
|
||||||
|
Scenario: When build
|
||||||
|
Given a fixture app "extension-hooks-app"
|
||||||
|
When I run `middleman build`
|
||||||
|
Then the exit status should be 0
|
||||||
|
And the output should contain "/// after_configuration ///"
|
||||||
|
And the output should contain "/// ready ///"
|
||||||
|
And the output should contain "/// before_build ///"
|
||||||
|
And the output should contain "/// before ///"
|
||||||
|
And the output should contain "/// before_render ///"
|
||||||
|
And the output should contain "/// after_render ///"
|
||||||
|
And the output should contain "/// after_build ///"
|
|
@ -1,15 +0,0 @@
|
||||||
Feature: Web Fonts
|
|
||||||
|
|
||||||
Scenario: Checking built folder for content
|
|
||||||
Given a successfully built app at "fonts-app"
|
|
||||||
When I cd to "build"
|
|
||||||
Then the following files should exist:
|
|
||||||
| stylesheets/fonts.css |
|
|
||||||
And the file "stylesheets/fonts.css" should contain "/fonts/StMarie-Thin.otf"
|
|
||||||
And the file "stylesheets/fonts.css" should contain "/fonts/blank/blank.otf"
|
|
||||||
|
|
||||||
Scenario: Rendering scss
|
|
||||||
Given the Server is running at "fonts-app"
|
|
||||||
When I go to "/stylesheets/fonts.css"
|
|
||||||
Then I should see "/fonts/StMarie-Thin.otf"
|
|
||||||
And I should see "/fonts/blank/blank.otf"
|
|
|
@ -2,11 +2,6 @@ Feature: Neighboring YAML Front Matter
|
||||||
|
|
||||||
Scenario: Rendering html (yaml)
|
Scenario: Rendering html (yaml)
|
||||||
Given the Server is running at "frontmatter-neighbor-app"
|
Given the Server is running at "frontmatter-neighbor-app"
|
||||||
When I go to "/front-matter-auto.html"
|
|
||||||
Then I should see "<h1>This is the title</h1>"
|
|
||||||
Then I should not see "---"
|
|
||||||
When I go to "/front-matter-auto.erb.frontmatter"
|
|
||||||
Then I should see "File Not Found"
|
|
||||||
When I go to "/front-matter-2.php"
|
When I go to "/front-matter-2.php"
|
||||||
Then I should see "<h1>This is the title</h1>"
|
Then I should see "<h1>This is the title</h1>"
|
||||||
Then I should see "<?php"
|
Then I should see "<?php"
|
||||||
|
@ -27,7 +22,7 @@ Feature: Neighboring YAML Front Matter
|
||||||
Then I should not see "---"
|
Then I should not see "---"
|
||||||
When I go to "/raw-front-matter.php.frontmatter"
|
When I go to "/raw-front-matter.php.frontmatter"
|
||||||
Then I should see "File Not Found"
|
Then I should see "File Not Found"
|
||||||
|
|
||||||
Scenario: YAML not on first line, with encoding
|
Scenario: YAML not on first line, with encoding
|
||||||
Given the Server is running at "frontmatter-neighbor-app"
|
Given the Server is running at "frontmatter-neighbor-app"
|
||||||
When I go to "/front-matter-encoding.html"
|
When I go to "/front-matter-encoding.html"
|
||||||
|
@ -35,31 +30,12 @@ Feature: Neighboring YAML Front Matter
|
||||||
Then I should not see "---"
|
Then I should not see "---"
|
||||||
When I go to "/front-matter-encoding.html.erb.frontmatter"
|
When I go to "/front-matter-encoding.html.erb.frontmatter"
|
||||||
Then I should see "File Not Found"
|
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-auto.html"
|
|
||||||
Then I should see "<h1>This is the title</h1>"
|
|
||||||
Then I should not see ";;;"
|
|
||||||
When I go to "/json-front-matter-auto.erb.frontmatter"
|
|
||||||
Then I should see "File Not Found"
|
|
||||||
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.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
|
Scenario: A template changes frontmatter during preview
|
||||||
Given the Server is running at "frontmatter-neighbor-app"
|
Given the Server is running at "frontmatter-neighbor-app"
|
||||||
And the file "source/front-matter-change.html.erb" has the contents
|
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
|
And the file "source/front-matter-change.html.erb.frontmatter" has the contents
|
||||||
"""
|
"""
|
||||||
|
@ -67,6 +43,8 @@ Feature: Neighboring YAML Front Matter
|
||||||
title: Hello World
|
title: Hello World
|
||||||
layout: false
|
layout: false
|
||||||
---
|
---
|
||||||
|
|
||||||
|
FileB
|
||||||
"""
|
"""
|
||||||
When I go to "/front-matter-change.html"
|
When I go to "/front-matter-change.html"
|
||||||
Then I should see "Hello World"
|
Then I should see "Hello World"
|
||||||
|
@ -76,6 +54,8 @@ Feature: Neighboring YAML Front Matter
|
||||||
title: Hola Mundo
|
title: Hola Mundo
|
||||||
layout: false
|
layout: false
|
||||||
---
|
---
|
||||||
|
|
||||||
|
FileC
|
||||||
"""
|
"""
|
||||||
When I go to "/front-matter-change.html"
|
When I go to "/front-matter-change.html"
|
||||||
Then I should see "Hola Mundo"
|
Then I should see "Hola Mundo"
|
||||||
|
@ -150,21 +130,22 @@ Feature: Neighboring YAML Front Matter
|
||||||
When I go to "/page_mentioned.html.erb.frontmatter"
|
When I go to "/page_mentioned.html.erb.frontmatter"
|
||||||
Then I should see "File Not Found"
|
Then I should see "File Not Found"
|
||||||
|
|
||||||
Scenario: Neighbor frontmatter for destination of proxy resources
|
# Scenario: Neighbor frontmatter for destination of proxy resources
|
||||||
Given the Server is running at "frontmatter-settings-neighbor-app"
|
# Given the Server is running at "frontmatter-settings-neighbor-app"
|
||||||
And the file "source/proxied_with_frontmatter.html.frontmatter" has the contents
|
# And the file "source/proxied_with_frontmatter.html.frontmatter" has the contents
|
||||||
"""
|
# """
|
||||||
---
|
# ---
|
||||||
title: Proxied title
|
# title: Proxied title
|
||||||
---
|
# ---
|
||||||
"""
|
# """
|
||||||
And the file "source/ignored.html.erb" has the contents
|
# And the file "source/ignored.html.erb" has the contents
|
||||||
"""
|
# """
|
||||||
---
|
# ---
|
||||||
ignored: true
|
# ignored: true
|
||||||
---
|
# ---
|
||||||
|
|
||||||
<%= current_resource.data.title %>
|
# <%= current_resource.data.inspect %>
|
||||||
"""
|
# <%= current_resource.data.title %>
|
||||||
When I go to "/proxied_with_frontmatter.html"
|
# """
|
||||||
Then I should see "Proxied title"
|
# When I go to "/proxied_with_frontmatter.html"
|
||||||
|
# Then I should see "Proxied title"
|
||||||
|
|
|
@ -3,9 +3,6 @@ Feature: YAML Front Matter
|
||||||
|
|
||||||
Scenario: Rendering html (yaml)
|
Scenario: Rendering html (yaml)
|
||||||
Given the Server is running at "frontmatter-app"
|
Given the Server is running at "frontmatter-app"
|
||||||
When I go to "/front-matter-auto.html"
|
|
||||||
Then I should see "<h1>This is the title</h1>"
|
|
||||||
Then I should not see "---"
|
|
||||||
When I go to "/front-matter-2.php"
|
When I go to "/front-matter-2.php"
|
||||||
Then I should see "<h1>This is the title</h1>"
|
Then I should see "<h1>This is the title</h1>"
|
||||||
Then I should see "<?php"
|
Then I should see "<?php"
|
||||||
|
@ -31,43 +28,23 @@ Feature: YAML Front Matter
|
||||||
Then I should not see "layout: false"
|
Then I should not see "layout: false"
|
||||||
Then I should not see "title: Pandoc likes trailing dots..."
|
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
|
Scenario: YAML not on first line, no encoding
|
||||||
Given the Server is running at "frontmatter-app"
|
Given the Server is running at "frontmatter-app"
|
||||||
When I go to "/front-matter-line-2.html"
|
When I go to "/front-matter-line-2.html"
|
||||||
Then I should see "<h1></h1>"
|
Then I should see "<h1></h1>"
|
||||||
Then I should see "---"
|
Then I should see "---"
|
||||||
|
|
||||||
Scenario: YAML not on first line, with encoding
|
Scenario: YAML not on first line, with encoding
|
||||||
Given the Server is running at "frontmatter-app"
|
Given the Server is running at "frontmatter-app"
|
||||||
When I go to "/front-matter-encoding.html"
|
When I go to "/front-matter-encoding.html"
|
||||||
Then I should see "<h1>This is the title</h1>"
|
Then I should see "<h1>This is the title</h1>"
|
||||||
Then I should not see "---"
|
Then I should not see "---"
|
||||||
|
|
||||||
Scenario: Rendering html (json)
|
|
||||||
Given the Server is running at "frontmatter-app"
|
|
||||||
When I go to "/json-front-matter-auto.html"
|
|
||||||
Then I should see "<h1>This is the title</h1>"
|
|
||||||
Then I should not see ";;;"
|
|
||||||
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
|
Scenario: A template changes frontmatter during preview
|
||||||
Given the Server is running at "frontmatter-app"
|
Given the Server is running at "frontmatter-app"
|
||||||
|
|
|
@ -22,7 +22,7 @@ Feature: GZIP assets during build
|
||||||
Given a fixture app "gzip-app"
|
Given a fixture app "gzip-app"
|
||||||
And a file named "config.rb" with:
|
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"
|
And a successfully built app at "gzip-app"
|
||||||
Then the following files should exist:
|
Then the following files should exist:
|
||||||
|
|
|
@ -5,8 +5,8 @@ Feature: content_tag helper
|
||||||
And an empty file named "config.rb"
|
And an empty file named "config.rb"
|
||||||
And a file named "source/index.html.erb" with:
|
And a file named "source/index.html.erb" with:
|
||||||
"""
|
"""
|
||||||
<%= content_tag :div, "<hello>world</hello>", :class => 'one' %>
|
<%= content_tag :div, "<hello>world</hello>", class: 'one' %>
|
||||||
<% content_tag :where, :class => 'the hell is' do %>
|
<% content_tag :where, class: 'the hell is' do %>
|
||||||
<my>damn croissant</my>
|
<my>damn croissant</my>
|
||||||
<% end %>
|
<% end %>
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -5,16 +5,16 @@ Feature: form_tag helper
|
||||||
And an empty file named "config.rb"
|
And an empty file named "config.rb"
|
||||||
And a file named "source/form_tag.html.erb" with:
|
And a file named "source/form_tag.html.erb" with:
|
||||||
"""
|
"""
|
||||||
absolute: <% form_tag "/needs_index.html#absolute", :relative => true do %>
|
absolute: <% form_tag "/needs_index.html#absolute", relative: true do %>
|
||||||
<% end %>
|
<% end %>
|
||||||
relative: <% form_tag "needs_index.html#relative", :relative => true do %>
|
relative: <% form_tag "needs_index.html#relative", relative: true do %>
|
||||||
<% end %>
|
<% end %>
|
||||||
"""
|
"""
|
||||||
And a file named "source/form_tag/sub.html.erb" with:
|
And a file named "source/form_tag/sub.html.erb" with:
|
||||||
"""
|
"""
|
||||||
absolute: <% form_tag "/needs_index.html#absolute", :relative => true do %>
|
absolute: <% form_tag "/needs_index.html#absolute", relative: true do %>
|
||||||
<% end %>
|
<% end %>
|
||||||
relative: <% form_tag "../needs_index.html#relative", :relative => true do %>
|
relative: <% form_tag "../needs_index.html#relative", relative: true do %>
|
||||||
<% end %>
|
<% end %>
|
||||||
"""
|
"""
|
||||||
And the Server is running at "indexable-app"
|
And the Server is running at "indexable-app"
|
||||||
|
|
|
@ -38,21 +38,31 @@ Feature: link_to helper
|
||||||
And an empty file named "config.rb"
|
And an empty file named "config.rb"
|
||||||
And a file named "source/link_to.html.erb" with:
|
And a file named "source/link_to.html.erb" with:
|
||||||
"""
|
"""
|
||||||
absolute: <%= link_to "Needs Index", "/needs_index.html", :relative => true %>
|
absolute: <%= link_to "Needs Index", "/needs_index.html", relative: true %>
|
||||||
relative: <%= link_to "Relative", "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:
|
And a file named "source/link_to/sub.html.erb" with:
|
||||||
"""
|
"""
|
||||||
absolute: <%= link_to "Needs Index", "/needs_index.html", :relative => true %>
|
absolute: <%= link_to "Needs Index", "/needs_index.html", relative: true %>
|
||||||
relative: <%= link_to "Relative", "../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"
|
And the Server is running at "indexable-app"
|
||||||
When I go to "/link_to.html"
|
When I go to "/link_to.html"
|
||||||
Then I should see 'absolute: <a href="needs_index.html">Needs Index</a>'
|
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 '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"
|
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 '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 '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
|
Scenario: link_to relative works with strip_index_file
|
||||||
Given a fixture app "indexable-app"
|
Given a fixture app "indexable-app"
|
||||||
|
@ -97,7 +107,7 @@ Feature: link_to helper
|
||||||
And a file named "source/link_to.html.erb" with:
|
And a file named "source/link_to.html.erb" with:
|
||||||
"""
|
"""
|
||||||
absolute: <%= link_to "Needs Index", "/needs_index.html" %>
|
absolute: <%= link_to "Needs Index", "/needs_index.html" %>
|
||||||
relative: <%= link_to "Relative", "needs_index.html", :relative => false %>
|
relative: <%= link_to "Relative", "needs_index.html", relative: false %>
|
||||||
unknown: <%= link_to "Unknown", "foo.html" %>
|
unknown: <%= link_to "Unknown", "foo.html" %>
|
||||||
"""
|
"""
|
||||||
And a file named "source/link_to/sub.html.erb" with:
|
And a file named "source/link_to/sub.html.erb" with:
|
||||||
|
@ -113,18 +123,18 @@ Feature: link_to helper
|
||||||
When I go to "/link_to/sub.html"
|
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 '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 'relative: <a href="../needs_index.html">Relative</a>'
|
||||||
|
|
||||||
Scenario: link_to knows about directory indexes
|
Scenario: link_to knows about directory indexes
|
||||||
Given a fixture app "indexable-app"
|
Given a fixture app "indexable-app"
|
||||||
And a file named "source/link_to.html.erb" with:
|
And a file named "source/link_to.html.erb" with:
|
||||||
"""
|
"""
|
||||||
absolute: <%= link_to "Needs Index", "/needs_index.html", :relative => true %>
|
absolute: <%= link_to "Needs Index", "/needs_index.html", relative: true %>
|
||||||
relative: <%= link_to "Relative", "needs_index.html", :relative => true %>
|
relative: <%= link_to "Relative", "needs_index.html", relative: true %>
|
||||||
"""
|
"""
|
||||||
And a file named "source/link_to/sub.html.erb" with:
|
And a file named "source/link_to/sub.html.erb" with:
|
||||||
"""
|
"""
|
||||||
absolute: <%= link_to "Needs Index", "/needs_index.html", :relative => true %>
|
absolute: <%= link_to "Needs Index", "/needs_index.html", relative: true %>
|
||||||
relative: <%= link_to "Relative", "../needs_index.html", :relative => true %>
|
relative: <%= link_to "Relative", "../needs_index.html", relative: true %>
|
||||||
"""
|
"""
|
||||||
And the Server is running at "indexable-app"
|
And the Server is running at "indexable-app"
|
||||||
When I go to "/link_to/"
|
When I go to "/link_to/"
|
||||||
|
@ -176,8 +186,8 @@ Feature: link_to helper
|
||||||
Given a fixture app "indexable-app"
|
Given a fixture app "indexable-app"
|
||||||
And a file named "source/link_to.html.erb" with:
|
And a file named "source/link_to.html.erb" with:
|
||||||
"""
|
"""
|
||||||
<%= link_to "Needs Index String", "/needs_index.html", :query => "foo" %>
|
<%= link_to "Needs Index String", "/needs_index.html", query: "foo" %>
|
||||||
<%= link_to "Needs Index Hash", "/needs_index.html", :query => { :foo => :bar } %>
|
<%= link_to "Needs Index Hash", "/needs_index.html", query: { foo: :bar } %>
|
||||||
"""
|
"""
|
||||||
And the Server is running at "indexable-app"
|
And the Server is running at "indexable-app"
|
||||||
When I go to "/link_to/"
|
When I go to "/link_to/"
|
||||||
|
|
|
@ -5,13 +5,13 @@ Feature: url_for helper
|
||||||
And an empty file named "config.rb"
|
And an empty file named "config.rb"
|
||||||
And a file named "source/url_for.html.erb" with:
|
And a file named "source/url_for.html.erb" with:
|
||||||
"""
|
"""
|
||||||
absolute: <%= url_for "/needs_index.html", :relative => true %>
|
absolute: <%= url_for "/needs_index.html", relative: true %>
|
||||||
relative: <%= url_for "needs_index.html", :relative => true %>
|
relative: <%= url_for "needs_index.html", relative: true %>
|
||||||
"""
|
"""
|
||||||
And a file named "source/url_for/sub.html.erb" with:
|
And a file named "source/url_for/sub.html.erb" with:
|
||||||
"""
|
"""
|
||||||
absolute: <%= url_for "/needs_index.html", :relative => true %>
|
absolute: <%= url_for "/needs_index.html", relative: true %>
|
||||||
relative: <%= url_for "../needs_index.html", :relative => true %>
|
relative: <%= url_for "../needs_index.html", relative: true %>
|
||||||
"""
|
"""
|
||||||
And the Server is running at "indexable-app"
|
And the Server is running at "indexable-app"
|
||||||
When I go to "/url_for.html"
|
When I go to "/url_for.html"
|
||||||
|
@ -64,7 +64,7 @@ Feature: url_for helper
|
||||||
And a file named "source/url_for.html.erb" with:
|
And a file named "source/url_for.html.erb" with:
|
||||||
"""
|
"""
|
||||||
absolute: <%= url_for "/needs_index.html" %>
|
absolute: <%= url_for "/needs_index.html" %>
|
||||||
relative: <%= url_for "needs_index.html", :relative => false %>
|
relative: <%= url_for "needs_index.html", relative: false %>
|
||||||
unknown: <%= url_for "foo.html" %>
|
unknown: <%= url_for "foo.html" %>
|
||||||
"""
|
"""
|
||||||
And a file named "source/url_for/sub.html.erb" with:
|
And a file named "source/url_for/sub.html.erb" with:
|
||||||
|
@ -85,13 +85,13 @@ Feature: url_for helper
|
||||||
Given a fixture app "indexable-app"
|
Given a fixture app "indexable-app"
|
||||||
And a file named "source/url_for.html.erb" with:
|
And a file named "source/url_for.html.erb" with:
|
||||||
"""
|
"""
|
||||||
absolute: <%= url_for "/needs_index.html", :relative => true %>
|
absolute: <%= url_for "/needs_index.html", relative: true %>
|
||||||
relative: <%= url_for "needs_index.html", :relative => true %>
|
relative: <%= url_for "needs_index.html", relative: true %>
|
||||||
"""
|
"""
|
||||||
And a file named "source/url_for/sub.html.erb" with:
|
And a file named "source/url_for/sub.html.erb" with:
|
||||||
"""
|
"""
|
||||||
absolute: <%= url_for "/needs_index.html", :relative => true %>
|
absolute: <%= url_for "/needs_index.html", relative: true %>
|
||||||
relative: <%= url_for "../needs_index.html", :relative => true %>
|
relative: <%= url_for "../needs_index.html", relative: true %>
|
||||||
"""
|
"""
|
||||||
And the Server is running at "indexable-app"
|
And the Server is running at "indexable-app"
|
||||||
When I go to "/url_for/"
|
When I go to "/url_for/"
|
||||||
|
@ -143,8 +143,8 @@ Feature: url_for helper
|
||||||
Given a fixture app "indexable-app"
|
Given a fixture app "indexable-app"
|
||||||
And a file named "source/url_for.html.erb" with:
|
And a file named "source/url_for.html.erb" with:
|
||||||
"""
|
"""
|
||||||
Needs Index String <%= url_for "/needs_index.html", :query => "foo" %>
|
Needs Index String <%= url_for "/needs_index.html", query: "foo" %>
|
||||||
Needs Index Hash <%= url_for "/needs_index.html", :query => { :foo => :bar } %>
|
Needs Index Hash <%= url_for "/needs_index.html", query: { foo: :bar } %>
|
||||||
"""
|
"""
|
||||||
And the Server is running at "indexable-app"
|
And the Server is running at "indexable-app"
|
||||||
When I go to "/url_for/"
|
When I go to "/url_for/"
|
||||||
|
|
|
@ -49,7 +49,7 @@ Feature: i18n Builder
|
||||||
Given a fixture app "i18n-test-app"
|
Given a fixture app "i18n-test-app"
|
||||||
And a file named "config.rb" with:
|
And a file named "config.rb" with:
|
||||||
"""
|
"""
|
||||||
activate :i18n, :path => "/lang_:locale/"
|
activate :i18n, path: "/lang_:locale/"
|
||||||
"""
|
"""
|
||||||
Given a successfully built app at "i18n-test-app"
|
Given a successfully built app at "i18n-test-app"
|
||||||
When I cd to "build"
|
When I cd to "build"
|
||||||
|
@ -69,7 +69,7 @@ Feature: i18n Builder
|
||||||
Given a fixture app "i18n-alt-root-app"
|
Given a fixture app "i18n-alt-root-app"
|
||||||
And a file named "config.rb" with:
|
And a file named "config.rb" with:
|
||||||
"""
|
"""
|
||||||
activate :i18n, :templates_dir => "lang_data"
|
activate :i18n, templates_dir: "lang_data"
|
||||||
"""
|
"""
|
||||||
Given a successfully built app at "i18n-alt-root-app"
|
Given a successfully built app at "i18n-alt-root-app"
|
||||||
When I cd to "build"
|
When I cd to "build"
|
||||||
|
@ -89,7 +89,7 @@ Feature: i18n Builder
|
||||||
Given a fixture app "i18n-test-app"
|
Given a fixture app "i18n-test-app"
|
||||||
And a file named "config.rb" with:
|
And a file named "config.rb" with:
|
||||||
"""
|
"""
|
||||||
activate :i18n, :lang_map => { :en => :english, :es => :spanish }
|
activate :i18n, lang_map: { en: :english, es: :spanish }
|
||||||
"""
|
"""
|
||||||
Given a successfully built app at "i18n-test-app"
|
Given a successfully built app at "i18n-test-app"
|
||||||
When I cd to "build"
|
When I cd to "build"
|
||||||
|
@ -109,7 +109,7 @@ Feature: i18n Builder
|
||||||
Given a fixture app "i18n-test-app"
|
Given a fixture app "i18n-test-app"
|
||||||
And a file named "config.rb" with:
|
And a file named "config.rb" with:
|
||||||
"""
|
"""
|
||||||
activate :i18n, :mount_at_root => false
|
activate :i18n, mount_at_root: false
|
||||||
"""
|
"""
|
||||||
Given a successfully built app at "i18n-test-app"
|
Given a successfully built app at "i18n-test-app"
|
||||||
When I cd to "build"
|
When I cd to "build"
|
||||||
|
@ -130,7 +130,7 @@ Feature: i18n Builder
|
||||||
Given a fixture app "i18n-test-app"
|
Given a fixture app "i18n-test-app"
|
||||||
And a file named "config.rb" with:
|
And a file named "config.rb" with:
|
||||||
"""
|
"""
|
||||||
activate :i18n, :langs => [:en]
|
activate :i18n, langs: [:en]
|
||||||
"""
|
"""
|
||||||
Given a successfully built app at "i18n-test-app"
|
Given a successfully built app at "i18n-test-app"
|
||||||
When I cd to "build"
|
When I cd to "build"
|
||||||
|
|
|
@ -4,7 +4,7 @@ Feature: i18n Paths
|
||||||
Given a fixture app "empty-app"
|
Given a fixture app "empty-app"
|
||||||
And a file named "data/pages.yml" with:
|
And a file named "data/pages.yml" with:
|
||||||
"""
|
"""
|
||||||
- hello.html
|
- hello.html
|
||||||
"""
|
"""
|
||||||
And a file named "locales/en.yml" with:
|
And a file named "locales/en.yml" with:
|
||||||
"""
|
"""
|
||||||
|
@ -50,24 +50,24 @@ Feature: i18n Paths
|
||||||
Given the Server is running at "empty-app"
|
Given the Server is running at "empty-app"
|
||||||
When I go to "/hello.html"
|
When I go to "/hello.html"
|
||||||
Then I should see "Page: Hello"
|
Then I should see "Page: Hello"
|
||||||
Then I should see '<a class="current" href="/index.html">Current Home</a>'
|
Then I should see '<a href="/index.html" class="current">Current Home</a>'
|
||||||
Then I should see '<a title="Other Home" href="/es/index.html">Other Home</a>'
|
Then I should see '<a href="/es/index.html" title="Other Home">Other Home</a>'
|
||||||
Then I should see '<a class="current" href="/index.html"><span>Home: Current Block</span></a>'
|
Then I should see '<a href="/index.html" class="current"><span>Home: Current Block</span></a>'
|
||||||
Then I should see '<a title="Other Home" href="/es/index.html"><span>Home: Other 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 class="current" href="/hello.html">Current hello.html</a>'
|
Then I should see '<a href="/hello.html" class="current">Current hello.html</a>'
|
||||||
Then I should see '<a title="Other hello.html" href="/es/hola.html">Other 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 class="current" href="/hello.html"><span>Current Block</span></a>'
|
Then I should see '<a href="/hello.html" class="current"><span>Current Block</span></a>'
|
||||||
Then I should see '<a title="Other hello.html" href="/es/hola.html"><span>Other 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"
|
When I go to "/es/hola.html"
|
||||||
Then I should see "Page: Hola"
|
Then I should see "Page: Hola"
|
||||||
Then I should see '<a class="current" href="/es/index.html">Current Home</a>'
|
Then I should see '<a href="/es/index.html" class="current">Current Home</a>'
|
||||||
Then I should see '<a title="Other Home" href="/index.html">Other Home</a>'
|
Then I should see '<a href="/index.html" title="Other Home">Other Home</a>'
|
||||||
Then I should see '<a class="current" href="/es/index.html"><span>Home: Current Block</span></a>'
|
Then I should see '<a href="/es/index.html" class="current"><span>Home: Current Block</span></a>'
|
||||||
Then I should see '<a title="Other Home" href="/index.html"><span>Home: Other 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 class="current" href="/es/hola.html">Current hello.html</a>'
|
Then I should see '<a href="/es/hola.html" class="current">Current hello.html</a>'
|
||||||
Then I should see '<a title="Other hello.html" href="/hello.html">Other hello.html</a>'
|
Then I should see '<a href="/hello.html" title="Other hello.html">Other hello.html</a>'
|
||||||
Then I should see '<a class="current" href="/es/hola.html"><span>Current Block</span></a>'
|
Then I should see '<a href="/es/hola.html" class="current"><span>Current Block</span></a>'
|
||||||
Then I should see '<a title="Other hello.html" href="/hello.html"><span>Other 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
|
Scenario: link_to is i18n aware and supports relative_links
|
||||||
Given a fixture app "empty-app"
|
Given a fixture app "empty-app"
|
||||||
|
@ -124,30 +124,30 @@ Feature: i18n Paths
|
||||||
Then I should see "assets/css/main.css"
|
Then I should see "assets/css/main.css"
|
||||||
When I go to "/hello.html"
|
When I go to "/hello.html"
|
||||||
Then I should see "Page: Hello"
|
Then I should see "Page: Hello"
|
||||||
Then I should see '<a class="current" href="index.html">Current Home</a>'
|
Then I should see '<a href="index.html" class="current">Current Home</a>'
|
||||||
Then I should see '<a title="Other Home" href="es/index.html">Other Home</a>'
|
Then I should see '<a href="es/index.html" title="Other Home">Other Home</a>'
|
||||||
Then I should see '<a class="current" href="index.html"><span>Home: Current Block</span></a>'
|
Then I should see '<a href="index.html" class="current"><span>Home: Current Block</span></a>'
|
||||||
Then I should see '<a title="Other Home" href="es/index.html"><span>Home: Other 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 class="current" href="hello.html">Current hello.html</a>'
|
Then I should see '<a href="hello.html" class="current">Current hello.html</a>'
|
||||||
Then I should see '<a title="Other hello.html" href="es/hola.html">Other 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 class="current" href="hello.html"><span>Current Block</span></a>'
|
Then I should see '<a href="hello.html" class="current"><span>Current Block</span></a>'
|
||||||
Then I should see '<a title="Other hello.html" href="es/hola.html"><span>Other 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"
|
When I go to "/es/hola.html"
|
||||||
Then I should see "Page: Hola"
|
Then I should see "Page: Hola"
|
||||||
Then I should see '<a class="current" href="index.html">Current Home</a>'
|
Then I should see '<a href="index.html" class="current">Current Home</a>'
|
||||||
Then I should see '<a title="Other Home" href="../index.html">Other Home</a>'
|
Then I should see '<a href="../index.html" title="Other Home">Other Home</a>'
|
||||||
Then I should see '<a class="current" href="index.html"><span>Home: Current Block</span></a>'
|
Then I should see '<a href="index.html" class="current"><span>Home: Current Block</span></a>'
|
||||||
Then I should see '<a title="Other Home" href="../index.html"><span>Home: Other 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 class="current" href="hola.html">Current hello.html</a>'
|
Then I should see '<a href="hola.html" class="current">Current hello.html</a>'
|
||||||
Then I should see '<a title="Other hello.html" href="../hello.html">Other hello.html</a>'
|
Then I should see '<a href="../hello.html" title="Other hello.html">Other hello.html</a>'
|
||||||
Then I should see '<a class="current" href="hola.html"><span>Current Block</span></a>'
|
Then I should see '<a href="hola.html" class="current"><span>Current Block</span></a>'
|
||||||
Then I should see '<a title="Other hello.html" href="../hello.html"><span>Other 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
|
Scenario: url_for is i18n aware
|
||||||
Given a fixture app "empty-app"
|
Given a fixture app "empty-app"
|
||||||
And a file named "data/pages.yml" with:
|
And a file named "data/pages.yml" with:
|
||||||
"""
|
"""
|
||||||
- hello.html
|
- hello.html
|
||||||
- article.html
|
- article.html
|
||||||
"""
|
"""
|
||||||
And a file named "locales/en.yml" with:
|
And a file named "locales/en.yml" with:
|
||||||
|
|
39
middleman-core/features/i18n_mixed_sources.feature
Normal file
39
middleman-core/features/i18n_mixed_sources.feature
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
Feature: i18n merging path trees
|
||||||
|
|
||||||
|
Scenario: Mixing localized and non-localized sources and merging the path trees (see issue #1709)
|
||||||
|
Given a fixture app "i18n-test-app"
|
||||||
|
And a file named "config.rb" with:
|
||||||
|
"""
|
||||||
|
activate :i18n, mount_at_root: :en, langs: [:en, :es]
|
||||||
|
"""
|
||||||
|
Given the Server is running at "i18n-mixed-sources"
|
||||||
|
|
||||||
|
When I go to "/"
|
||||||
|
Then I should see "Current locale: en"
|
||||||
|
Then I should see "path: is-localized Home"
|
||||||
|
When I go to "/es"
|
||||||
|
Then I should see "Current locale: es"
|
||||||
|
Then I should see "path: is-localized Home"
|
||||||
|
|
||||||
|
When I go to "/a/"
|
||||||
|
Then I should see "Current locale: en"
|
||||||
|
Then I should see "path: is-localized Home # a/index.html.erb"
|
||||||
|
When I go to "/es/a/"
|
||||||
|
Then I should see "Current locale: es"
|
||||||
|
Then I should see "path: is-localized Home # a/index.html.erb"
|
||||||
|
|
||||||
|
When I go to "/b/"
|
||||||
|
Then I should see "Current locale: en"
|
||||||
|
Then I should see "path: is-localized Home # b/index.html.erb"
|
||||||
|
|
||||||
|
When I go to "/a/sub.html"
|
||||||
|
Then I should see "Current locale: en"
|
||||||
|
Then I should see "path: is-localized Home # a/index.html.erb # a/sub.html.erb"
|
||||||
|
|
||||||
|
When I go to "/b/sub.html"
|
||||||
|
Then I should see "Current locale: en"
|
||||||
|
Then I should see "path: is-localized Home # b/index.html.erb # b/sub.html.erb"
|
||||||
|
|
||||||
|
When I go to "/es/b/sub.html"
|
||||||
|
Then I should see "Current locale: es"
|
||||||
|
Then I should see "path: is-localized Home # b/index.html.erb # b/sub.html.erb"
|
|
@ -67,7 +67,7 @@ Feature: i18n Preview
|
||||||
Given a fixture app "i18n-test-app"
|
Given a fixture app "i18n-test-app"
|
||||||
And a file named "config.rb" with:
|
And a file named "config.rb" with:
|
||||||
"""
|
"""
|
||||||
activate :i18n, :path => "/lang_:locale/"
|
activate :i18n, path: "/lang_:locale/"
|
||||||
"""
|
"""
|
||||||
Given the Server is running at "i18n-test-app"
|
Given the Server is running at "i18n-test-app"
|
||||||
When I go to "/"
|
When I go to "/"
|
||||||
|
@ -86,7 +86,7 @@ Feature: i18n Preview
|
||||||
Given a fixture app "i18n-alt-root-app"
|
Given a fixture app "i18n-alt-root-app"
|
||||||
And a file named "config.rb" with:
|
And a file named "config.rb" with:
|
||||||
"""
|
"""
|
||||||
activate :i18n, :templates_dir => "lang_data"
|
activate :i18n, templates_dir: "lang_data"
|
||||||
"""
|
"""
|
||||||
Given the Server is running at "i18n-alt-root-app"
|
Given the Server is running at "i18n-alt-root-app"
|
||||||
When I go to "/"
|
When I go to "/"
|
||||||
|
@ -104,7 +104,7 @@ Feature: i18n Preview
|
||||||
Given a fixture app "i18n-test-app"
|
Given a fixture app "i18n-test-app"
|
||||||
And a file named "config.rb" with:
|
And a file named "config.rb" with:
|
||||||
"""
|
"""
|
||||||
activate :i18n, :lang_map => { :en => :english, :es => :spanish }
|
activate :i18n, lang_map: { en: :english, es: :spanish }
|
||||||
"""
|
"""
|
||||||
Given the Server is running at "i18n-test-app"
|
Given the Server is running at "i18n-test-app"
|
||||||
When I go to "/"
|
When I go to "/"
|
||||||
|
@ -122,7 +122,7 @@ Feature: i18n Preview
|
||||||
Given a fixture app "i18n-test-app"
|
Given a fixture app "i18n-test-app"
|
||||||
And a file named "config.rb" with:
|
And a file named "config.rb" with:
|
||||||
"""
|
"""
|
||||||
activate :i18n, :mount_at_root => :es
|
activate :i18n, mount_at_root: :es
|
||||||
"""
|
"""
|
||||||
Given the Server is running at "i18n-test-app"
|
Given the Server is running at "i18n-test-app"
|
||||||
When I go to "/en/index.html"
|
When I go to "/en/index.html"
|
||||||
|
@ -150,7 +150,7 @@ Feature: i18n Preview
|
||||||
Given a fixture app "i18n-test-app"
|
Given a fixture app "i18n-test-app"
|
||||||
And a file named "config.rb" with:
|
And a file named "config.rb" with:
|
||||||
"""
|
"""
|
||||||
activate :i18n, :langs => :es
|
activate :i18n, langs: :es
|
||||||
"""
|
"""
|
||||||
Given the Server is running at "i18n-test-app"
|
Given the Server is running at "i18n-test-app"
|
||||||
When I go to "/en/index.html"
|
When I go to "/en/index.html"
|
||||||
|
@ -173,7 +173,7 @@ Feature: i18n Preview
|
||||||
Given a fixture app "i18n-test-app"
|
Given a fixture app "i18n-test-app"
|
||||||
And a file named "config.rb" with:
|
And a file named "config.rb" with:
|
||||||
"""
|
"""
|
||||||
activate :i18n, :mount_at_root => false
|
activate :i18n, mount_at_root: false
|
||||||
"""
|
"""
|
||||||
Given the Server is running at "i18n-test-app"
|
Given the Server is running at "i18n-test-app"
|
||||||
When I go to "/en/index.html"
|
When I go to "/en/index.html"
|
||||||
|
@ -193,7 +193,7 @@ Feature: i18n Preview
|
||||||
Given a fixture app "i18n-test-app"
|
Given a fixture app "i18n-test-app"
|
||||||
And a file named "config.rb" with:
|
And a file named "config.rb" with:
|
||||||
"""
|
"""
|
||||||
activate :i18n, :langs => [:en]
|
activate :i18n, langs: [:en]
|
||||||
"""
|
"""
|
||||||
Given the Server is running at "i18n-test-app"
|
Given the Server is running at "i18n-test-app"
|
||||||
When I go to "/"
|
When I go to "/"
|
||||||
|
@ -228,7 +228,7 @@ Feature: i18n Preview
|
||||||
Given a fixture app "i18n-default-app"
|
Given a fixture app "i18n-default-app"
|
||||||
And a file named "config.rb" with:
|
And a file named "config.rb" with:
|
||||||
"""
|
"""
|
||||||
activate :i18n, :mount_at_root => :es
|
activate :i18n, mount_at_root: :es
|
||||||
"""
|
"""
|
||||||
Given the Server is running at "i18n-default-app"
|
Given the Server is running at "i18n-default-app"
|
||||||
When I go to "/en/"
|
When I go to "/en/"
|
||||||
|
|
|
@ -12,7 +12,7 @@ Feature: Ignoring paths
|
||||||
And the following files should not exist:
|
And the following files should not exist:
|
||||||
| build/plain.html |
|
| build/plain.html |
|
||||||
| build/about.html |
|
| build/about.html |
|
||||||
|
|
||||||
Scenario: Ignore a single path (server)
|
Scenario: Ignore a single path (server)
|
||||||
Given a fixture app "ignore-app"
|
Given a fixture app "ignore-app"
|
||||||
And a file named "config.rb" with:
|
And a file named "config.rb" with:
|
||||||
|
@ -28,6 +28,35 @@ Feature: Ignoring paths
|
||||||
When I go to "/about.html"
|
When I go to "/about.html"
|
||||||
Then I should see "File Not Found"
|
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)
|
Scenario: Ignore a globbed path (build)
|
||||||
Given a fixture app "ignore-app"
|
Given a fixture app "ignore-app"
|
||||||
And a file named "config.rb" with:
|
And a file named "config.rb" with:
|
||||||
|
@ -47,7 +76,7 @@ Feature: Ignoring paths
|
||||||
| build/reports/index.html |
|
| build/reports/index.html |
|
||||||
| build/reports/another.html |
|
| build/reports/another.html |
|
||||||
| build/images/icons/messages.png |
|
| build/images/icons/messages.png |
|
||||||
|
|
||||||
Scenario: Ignore a globbed path (server)
|
Scenario: Ignore a globbed path (server)
|
||||||
Given a fixture app "ignore-app"
|
Given a fixture app "ignore-app"
|
||||||
And a file named "config.rb" with:
|
And a file named "config.rb" with:
|
||||||
|
@ -93,7 +122,7 @@ Feature: Ignoring paths
|
||||||
| build/reports/index.html |
|
| build/reports/index.html |
|
||||||
| build/reports/another.html |
|
| build/reports/another.html |
|
||||||
| build/images/icons/messages.png |
|
| build/images/icons/messages.png |
|
||||||
|
|
||||||
Scenario: Ignore a regex (server)
|
Scenario: Ignore a regex (server)
|
||||||
Given a fixture app "ignore-app"
|
Given a fixture app "ignore-app"
|
||||||
And a file named "config.rb" with:
|
And a file named "config.rb" with:
|
||||||
|
@ -118,4 +147,4 @@ Feature: Ignoring paths
|
||||||
When I go to "/reports/another.html"
|
When I go to "/reports/another.html"
|
||||||
Then I should see "File Not Found"
|
Then I should see "File Not Found"
|
||||||
When I go to "/images/icons/messages.png"
|
When I go to "/images/icons/messages.png"
|
||||||
Then I should see "File Not Found"
|
Then I should see "File Not Found"
|
||||||
|
|
|
@ -1,69 +0,0 @@
|
||||||
Feature: Use default extensions when user doesn't supply them
|
|
||||||
|
|
||||||
Scenario: Default extensions preview
|
|
||||||
Given the Server is running at "implied-extensions-app"
|
|
||||||
When I go to "/"
|
|
||||||
Then I should see "hello: world"
|
|
||||||
When I go to "/index.html"
|
|
||||||
Then I should see "hello: world"
|
|
||||||
When I go to "/index.erb"
|
|
||||||
Then I should see "File Not Found"
|
|
||||||
When I go to "/index"
|
|
||||||
Then I should see "File Not Found"
|
|
||||||
|
|
||||||
Scenario: Override erb extension
|
|
||||||
Given a fixture app "implied-extensions-app"
|
|
||||||
And a file named "config.rb" with:
|
|
||||||
"""
|
|
||||||
template_extensions :erb => :htm
|
|
||||||
"""
|
|
||||||
And the Server is running
|
|
||||||
When I go to "/"
|
|
||||||
Then I should see "File Not Found"
|
|
||||||
When I go to "/index.htm"
|
|
||||||
Then I should see "hello: world"
|
|
||||||
When I go to "/index.erb"
|
|
||||||
Then I should see "File Not Found"
|
|
||||||
When I go to "/index"
|
|
||||||
Then I should see "File Not Found"
|
|
||||||
When I go to "/index.html"
|
|
||||||
Then I should see "File Not Found"
|
|
||||||
|
|
||||||
Scenario: Override erb extension
|
|
||||||
Given a fixture app "implied-extensions-app"
|
|
||||||
And a file named "config.rb" with:
|
|
||||||
"""
|
|
||||||
set :index_file, "index.htm"
|
|
||||||
template_extensions :erb => :htm
|
|
||||||
"""
|
|
||||||
And the Server is running
|
|
||||||
When I go to "/"
|
|
||||||
Then I should see "hello: world"
|
|
||||||
When I go to "/index.htm"
|
|
||||||
Then I should see "hello: world"
|
|
||||||
|
|
||||||
Scenario: Default extensions build
|
|
||||||
Given a fixture app "implied-extensions-app"
|
|
||||||
And a successfully built app at "implied-extensions-app"
|
|
||||||
When I cd to "build"
|
|
||||||
Then the following files should exist:
|
|
||||||
| index.html |
|
|
||||||
Then the following files should not exist:
|
|
||||||
| index |
|
|
||||||
| index.erb |
|
|
||||||
And the file "index.html" should contain "hello: world"
|
|
||||||
|
|
||||||
Scenario: Default extensions build with override
|
|
||||||
Given a fixture app "implied-extensions-app"
|
|
||||||
And a file named "config.rb" with:
|
|
||||||
"""
|
|
||||||
template_extensions :erb => :htm
|
|
||||||
"""
|
|
||||||
And a successfully built app at "implied-extensions-app"
|
|
||||||
When I cd to "build"
|
|
||||||
Then the following files should exist:
|
|
||||||
| index.htm |
|
|
||||||
Then the following files should not exist:
|
|
||||||
| index |
|
|
||||||
| index.erb |
|
|
||||||
| index.html |
|
|
15
middleman-core/features/import_files.feature
Normal file
15
middleman-core/features/import_files.feature
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
Feature: Import files
|
||||||
|
|
||||||
|
Scenario: Move one path to another
|
||||||
|
Given the Server is running at "import-app"
|
||||||
|
When I go to "/static.html"
|
||||||
|
Then I should see 'Not Found'
|
||||||
|
When I go to "/static2.html"
|
||||||
|
Then I should see 'Static, no code!'
|
||||||
|
|
||||||
|
Scenario: Import all of bower
|
||||||
|
Given the Server is running at "import-app"
|
||||||
|
When I go to "/bower_components/jquery/dist/jquery.js"
|
||||||
|
Then I should see 'jQuery'
|
||||||
|
When I go to "/bower_components2/jquery/dist/jquery.js"
|
||||||
|
Then I should see 'jQuery'
|
|
@ -1,9 +0,0 @@
|
||||||
Feature: Instance Variables
|
|
||||||
Scenario: A dynamic page template using instance variables
|
|
||||||
Given the Server is running at "instance-vars-app"
|
|
||||||
When I go to "/a.html"
|
|
||||||
Then I should see "A: 'set'"
|
|
||||||
Then I should see "B: ''"
|
|
||||||
When I go to "/b.html"
|
|
||||||
Then I should see "A: ''"
|
|
||||||
Then I should see "B: 'set'"
|
|
|
@ -6,7 +6,7 @@ Feature: Markdown (Kramdown) support
|
||||||
And a file named "config.rb" with:
|
And a file named "config.rb" with:
|
||||||
"""
|
"""
|
||||||
set :markdown_engine, :kramdown
|
set :markdown_engine, :kramdown
|
||||||
set :markdown, :smartypants => true
|
set :markdown, smartypants: true
|
||||||
"""
|
"""
|
||||||
Given the Server is running at "markdown-app"
|
Given the Server is running at "markdown-app"
|
||||||
When I go to "/smarty_pants.html"
|
When I go to "/smarty_pants.html"
|
||||||
|
|
42
middleman-core/features/markdown_kramdown_in_slim.feature
Normal file
42
middleman-core/features/markdown_kramdown_in_slim.feature
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
Feature: Markdown support in Slim (Kramdown)
|
||||||
|
In order to test support of the Slim markdown filter
|
||||||
|
|
||||||
|
Scenario: Markdown filter in Slim works (with Kramdown)
|
||||||
|
Given a fixture app "markdown-in-slim-app"
|
||||||
|
And a file named "config.rb" with:
|
||||||
|
"""
|
||||||
|
set :markdown_engine, :kramdown
|
||||||
|
activate :directory_indexes
|
||||||
|
"""
|
||||||
|
And a file named "source/markdown_filter.html.slim" with:
|
||||||
|
"""
|
||||||
|
markdown:
|
||||||
|
# H1
|
||||||
|
|
||||||
|
paragraph
|
||||||
|
"""
|
||||||
|
Given the Server is running at "markdown-in-slim-app"
|
||||||
|
When I go to "/markdown_filter/"
|
||||||
|
Then I should see ">H1</h1>"
|
||||||
|
Then I should see "<p>paragraph</p>"
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: Markdown filter in Slim uses our link_to and image_tag helpers (with Kramdown)
|
||||||
|
Given a fixture app "markdown-in-slim-app"
|
||||||
|
And a file named "config.rb" with:
|
||||||
|
"""
|
||||||
|
set :markdown_engine, :kramdown
|
||||||
|
activate :directory_indexes
|
||||||
|
"""
|
||||||
|
And a file named "source/link_and_image.html.slim" with:
|
||||||
|
"""
|
||||||
|
markdown:
|
||||||
|
[A link](/link_target.html)
|
||||||
|
|
||||||
|
![image](blank.gif){: srcset="image_2x.jpg 2x"}
|
||||||
|
"""
|
||||||
|
Given the Server is running at "markdown-in-slim-app"
|
||||||
|
When I go to "/link_and_image/"
|
||||||
|
Then I should see "/link_target/"
|
||||||
|
Then I should see "/images/image_2x.jpg 2x"
|
||||||
|
Then I should see 'src="/images/blank.gif"'
|
|
@ -1,4 +1,3 @@
|
||||||
@nojava
|
|
||||||
Feature: Markdown (Redcarpet) support
|
Feature: Markdown (Redcarpet) support
|
||||||
In order to test included Redcarpet support
|
In order to test included Redcarpet support
|
||||||
|
|
||||||
|
@ -7,14 +6,14 @@ Feature: Markdown (Redcarpet) support
|
||||||
And a file named "config.rb" with:
|
And a file named "config.rb" with:
|
||||||
"""
|
"""
|
||||||
set :markdown_engine, :redcarpet
|
set :markdown_engine, :redcarpet
|
||||||
set :markdown, :no_intra_emphasis => true,
|
set :markdown, no_intra_emphasis: true,
|
||||||
:tables => true,
|
tables: true,
|
||||||
:fenced_code_blocks => true,
|
fenced_code_blocks: true,
|
||||||
:autolink => true,
|
autolink: true,
|
||||||
:strikethrough => true,
|
strikethrough: true,
|
||||||
:space_after_headers => true,
|
space_after_headers: true,
|
||||||
:superscript => true,
|
superscript: true,
|
||||||
:lax_spacing => true
|
lax_spacing: true
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Given the Server is running at "markdown-app"
|
Given the Server is running at "markdown-app"
|
||||||
|
@ -42,9 +41,9 @@ Feature: Markdown (Redcarpet) support
|
||||||
And a file named "config.rb" with:
|
And a file named "config.rb" with:
|
||||||
"""
|
"""
|
||||||
set :markdown_engine, :redcarpet
|
set :markdown_engine, :redcarpet
|
||||||
set :markdown, :underline => true,
|
set :markdown, underline: true,
|
||||||
:highlight => true,
|
highlight: true,
|
||||||
:disable_indented_code_blocks => true
|
disable_indented_code_blocks: true
|
||||||
"""
|
"""
|
||||||
Given the Server is running at "markdown-app"
|
Given the Server is running at "markdown-app"
|
||||||
When I go to "/underline.html"
|
When I go to "/underline.html"
|
||||||
|
@ -59,7 +58,7 @@ Feature: Markdown (Redcarpet) support
|
||||||
And a file named "config.rb" with:
|
And a file named "config.rb" with:
|
||||||
"""
|
"""
|
||||||
set :markdown_engine, :redcarpet
|
set :markdown_engine, :redcarpet
|
||||||
set :markdown, :smartypants => true
|
set :markdown, smartypants: true
|
||||||
"""
|
"""
|
||||||
Given the Server is running at "markdown-app"
|
Given the Server is running at "markdown-app"
|
||||||
When I go to "/smarty_pants.html"
|
When I go to "/smarty_pants.html"
|
||||||
|
@ -70,13 +69,13 @@ Feature: Markdown (Redcarpet) support
|
||||||
And a file named "config.rb" with:
|
And a file named "config.rb" with:
|
||||||
"""
|
"""
|
||||||
set :markdown_engine, :redcarpet
|
set :markdown_engine, :redcarpet
|
||||||
set :markdown, :filter_html => true,
|
set :markdown, filter_html: true,
|
||||||
:no_images => true,
|
no_images: true,
|
||||||
:no_links => true,
|
no_links: true,
|
||||||
:with_toc_data => true,
|
with_toc_data: true,
|
||||||
:hard_wrap => true,
|
hard_wrap: true,
|
||||||
:safe_links_only => true,
|
safe_links_only: true,
|
||||||
:prettify => true
|
prettify: true
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Given the Server is running at "markdown-app"
|
Given the Server is running at "markdown-app"
|
||||||
|
@ -103,7 +102,7 @@ Feature: Markdown (Redcarpet) support
|
||||||
And a file named "config.rb" with:
|
And a file named "config.rb" with:
|
||||||
"""
|
"""
|
||||||
set :markdown_engine, :redcarpet
|
set :markdown_engine, :redcarpet
|
||||||
set :markdown, :link_attributes => { :target => "_blank" }
|
set :markdown, link_attributes: { target: "_blank" }
|
||||||
"""
|
"""
|
||||||
And a file named "source/link.html.markdown" with:
|
And a file named "source/link.html.markdown" with:
|
||||||
"""
|
"""
|
||||||
|
@ -118,8 +117,8 @@ Feature: Markdown (Redcarpet) support
|
||||||
And a file named "config.rb" with:
|
And a file named "config.rb" with:
|
||||||
"""
|
"""
|
||||||
set :markdown_engine, :redcarpet
|
set :markdown_engine, :redcarpet
|
||||||
set :markdown, :xhtml => true,
|
set :markdown, xhtml: true,
|
||||||
:hard_wrap => true
|
hard_wrap: true
|
||||||
"""
|
"""
|
||||||
Given the Server is running at "markdown-app"
|
Given the Server is running at "markdown-app"
|
||||||
When I go to "/hard_wrap.html"
|
When I go to "/hard_wrap.html"
|
||||||
|
@ -130,7 +129,7 @@ Feature: Markdown (Redcarpet) support
|
||||||
And a file named "config.rb" with:
|
And a file named "config.rb" with:
|
||||||
"""
|
"""
|
||||||
set :markdown_engine, :redcarpet
|
set :markdown_engine, :redcarpet
|
||||||
set :markdown, :smartypants => true
|
set :markdown, smartypants: true
|
||||||
"""
|
"""
|
||||||
Given the Server is running at "markdown-frontmatter-options-app"
|
Given the Server is running at "markdown-frontmatter-options-app"
|
||||||
When I go to "/smarty_pants-default.html"
|
When I go to "/smarty_pants-default.html"
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
@nojava
|
|
||||||
Feature: Markdown support in Haml
|
Feature: Markdown support in Haml
|
||||||
In order to test support of the Haml markdown filter
|
In order to test support of the Haml markdown filter
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue