1
0
Fork 0
mirror of https://github.com/middleman/middleman.git synced 2022-11-09 12:20:27 -05:00

4.x support for 3.0 (#2424)

This commit is contained in:
Thomas Reynolds 2020-12-29 13:19:00 -08:00 committed by GitHub
parent 000fac84a2
commit 9b90979f27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 390 additions and 385 deletions

View file

@ -4,13 +4,12 @@ on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}-latest
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental == true }}
name: ${{ matrix.os }}-ruby-${{ matrix.ruby-version }}
name: ubuntu-ruby-${{ matrix.ruby-version }}
strategy:
matrix:
os: [ubuntu, macos]
ruby-version: [3.0, 2.7, 2.6, 2.5, 2.4, 2.3]
ruby-version: [3.0, 2.7, 2.6, 2.5, 2.4]
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
@ -18,6 +17,10 @@ jobs:
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: '12'
- name: Install dependencies
run: bundle install
- name: Runs linter

View file

@ -15,7 +15,7 @@ gem 'rspec', '~> 3.0', require: false
# Pry tools
gem 'pry'
gem 'pry-rescue'
gem 'pry-stack_explorer'
# gem 'pry-stack_explorer', require: false
# Optional middleman dependencies, included for tests
gem 'coffee-script', '~> 2.2', require: false

View file

@ -11,7 +11,7 @@ PATH
activesupport (>= 4.2, < 6.0)
addressable (~> 2.3)
backports (~> 3.6)
bundler
bundler (~> 2.0)
contracts (~> 0.13.0)
dotenv
erubis
@ -25,12 +25,13 @@ PATH
memoist (~> 0.14)
padrino-helpers (~> 0.13.0)
parallel
rack (>= 1.4.5, < 3)
rack (>= 1.4.5, < 2.1)
sassc (~> 2.0)
servolux
tilt (~> 2.0.9)
toml
uglifier (~> 3.0)
webrick
GEM
remote: https://rubygems.org/
@ -45,12 +46,10 @@ GEM
childprocess (>= 0.3.6)
cucumber (>= 1.1.1)
rspec-expectations (>= 2.7.0)
ast (2.4.0)
backports (3.18.2)
binding_of_caller (0.8.0)
debug_inspector (>= 0.0.1)
builder (3.2.3)
byebug (10.0.2)
ast (2.4.1)
backports (3.19.0)
builder (3.2.4)
byebug (11.1.3)
capybara (2.5.0)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
@ -62,22 +61,21 @@ GEM
celluloid-io (0.16.2)
celluloid (>= 0.16.0)
nio4r (>= 1.1.0)
childprocess (0.9.0)
ffi (~> 1.0, >= 1.0.11)
childprocess (4.0.0)
codeclimate-test-reporter (0.6.0)
simplecov (>= 0.7.1, < 1.0.0)
coderay (1.1.2)
coderay (1.1.3)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.1.7)
contracts (0.13.0)
coveralls (0.8.22)
coveralls (0.8.23)
json (>= 1.8, < 3)
simplecov (~> 0.16.1)
term-ansicolor (~> 1.3)
thor (~> 0.19.4)
thor (>= 0.19.4, < 2.0)
tins (~> 1.6)
cucumber (2.99.0)
builder (>= 2.1.2)
@ -90,44 +88,43 @@ GEM
cucumber-core (1.5.0)
gherkin (~> 4.0)
cucumber-wire (0.0.1)
debug_inspector (0.0.3)
diff-lcs (1.3)
docile (1.3.1)
diff-lcs (1.4.4)
docile (1.3.4)
dotenv (2.7.6)
erubis (2.7.0)
execjs (2.7.0)
fast_blank (1.0.0)
fastimage (2.2.0)
ffi (1.9.25)
fastimage (2.2.1)
ffi (1.14.2)
gherkin (4.1.3)
haml (4.0.7)
tilt
hamster (3.0.0)
concurrent-ruby (~> 1.0)
hashie (3.6.0)
hitimes (1.3.0)
hitimes (2.0.0)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
interception (0.5)
jaro_winkler (1.5.2)
json (2.1.0)
json (2.5.1)
kramdown (1.17.0)
liquid (3.0.6)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
memoist (0.16.2)
method_source (0.9.2)
mime-types (3.2.2)
method_source (1.0.0)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2018.0812)
mime-types-data (3.2020.1104)
mini_portile2 (2.4.0)
minitest (5.14.2)
multi_json (1.13.1)
multi_json (1.15.0)
multi_test (0.1.2)
mustermann (1.0.3)
nio4r (2.3.1)
nokogiri (1.10.1)
mustermann (1.1.1)
ruby2_keywords (~> 0.0.1)
nio4r (2.5.4)
nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
padrino-helpers (0.13.3.4)
i18n (~> 0.6, >= 0.6.7)
@ -135,22 +132,18 @@ GEM
tilt (>= 1.4.1, < 3)
padrino-support (0.13.3.4)
activesupport (>= 3.1)
parallel (1.12.1)
parser (2.5.3.0)
ast (~> 2.4.0)
parallel (1.20.1)
parser (3.0.0.0)
ast (~> 2.4.1)
parslet (1.8.2)
powerpack (0.1.2)
pry (0.12.2)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
pry-rescue (1.5.0)
pry (0.13.1)
coderay (~> 1.1)
method_source (~> 1.0)
pry-rescue (1.5.2)
interception (>= 0.5)
pry (>= 0.12.0)
pry-stack_explorer (0.4.9.3)
binding_of_caller (>= 0.7)
pry (>= 0.9.11)
rack (2.0.6)
rack-protection (2.0.5)
rack (2.0.9)
rack-protection (2.0.8.1)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
@ -159,29 +152,35 @@ GEM
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
redcarpet (3.4.0)
rspec (3.8.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-core (3.8.0)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.2)
redcarpet (3.5.1)
regexp_parser (2.0.3)
rexml (3.2.4)
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
rspec-mocks (~> 3.10.0)
rspec-core (3.10.1)
rspec-support (~> 3.10.0)
rspec-expectations (3.10.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.0)
rspec-support (~> 3.10.0)
rspec-mocks (3.10.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.0)
rubocop (0.62.0)
jaro_winkler (~> 1.5.1)
rspec-support (~> 3.10.0)
rspec-support (3.10.1)
rubocop (0.93.1)
parallel (~> 1.10)
parser (>= 2.5, != 2.5.1.1)
powerpack (~> 0.1)
parser (>= 2.7.1.5)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8)
rexml
rubocop-ast (>= 0.6.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.4.0)
ruby-progressbar (1.10.0)
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-ast (1.3.0)
parser (>= 2.7.1.5)
ruby-progressbar (1.10.1)
ruby2_keywords (0.0.2)
rubydns (1.0.3)
celluloid (= 0.16.0)
celluloid-io (= 0.16.2)
@ -194,37 +193,40 @@ GEM
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
sinatra (2.0.5)
sinatra (2.0.8.1)
mustermann (~> 1.0)
rack (~> 2.0)
rack-protection (= 2.0.5)
rack-protection (= 2.0.8.1)
tilt (~> 2.0)
slim (4.0.1)
slim (4.1.0)
temple (>= 0.7.6, < 0.9)
tilt (>= 2.0.6, < 2.1)
stylus (1.0.2)
execjs
stylus-source
stylus-source (0.54.5)
temple (0.8.0)
term-ansicolor (1.7.0)
sync (0.5.0)
temple (0.8.2)
term-ansicolor (1.7.1)
tins (~> 1.0)
thor (0.19.4)
thor (1.0.1)
thread_safe (0.3.6)
tilt (2.0.9)
tilt (2.0.10)
timers (4.0.4)
hitimes
tins (1.20.2)
tins (1.26.0)
sync
toml (0.2.0)
parslet (~> 1.8.0)
tzinfo (1.2.8)
tzinfo (1.2.9)
thread_safe (~> 0.1)
uglifier (3.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.4.1)
unicode-display_width (1.7.0)
webrick (1.7.0)
xpath (2.1.0)
nokogiri (~> 1.3)
yard (0.9.20)
yard (0.9.26)
PLATFORMS
ruby
@ -245,7 +247,6 @@ DEPENDENCIES
middleman-core!
pry
pry-rescue
pry-stack_explorer
rake (~> 10.3)
redcarpet (>= 3.1)
rspec (~> 3.0)
@ -259,4 +260,4 @@ DEPENDENCIES
yard (~> 0.9.20)
BUNDLED WITH
1.17.3
2.2.3

View file

@ -110,7 +110,7 @@ Constraint][pvc] with two digits of precision. For example:
## License
Copyright (c) 2010-2015 Thomas Reynolds. MIT Licensed, see [LICENSE] for details.
Copyright (c) 2010-2020 Thomas Reynolds. MIT Licensed, see [LICENSE] for details.
[middleman]: http://middlemanapp.com
[gem]: https://rubygems.org/gems/middleman

View file

@ -19,7 +19,6 @@ Cucumber::Rake::Task.new do |t|
exempt_tags << '--tags ~@nojava' if RUBY_PLATFORM == 'java'
exempt_tags << '--tags ~@encoding' unless Object.const_defined?(:Encoding)
exempt_tags << '--tags ~@nowindows' if Gem.win_platform?
exempt_tags << '--tags ~@travishatesme' if ENV['TRAVIS'] == 'true'
t.cucumber_opts = "--require features --color #{exempt_tags.join(' ')} --strict" # --format #{ENV['CUCUMBER_FORMAT'] || 'Fivemat'}"
end

View file

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

View file

@ -3,27 +3,27 @@ Feature: Assets get file hashes appended to them and references to them are upda
Given a successfully built app at "asset-hash-app"
When I cd to "build"
Then the following files should exist:
| index.html |
| apple-touch-icon.png |
| favicon.ico |
| images/100px-1242c368.png |
| images/100px-5fd6fb90.jpg |
| images/200px-c11eb203.jpg |
| images/300px-59adce76.jpg |
| images/100px-5fd6fb90.gif |
| index.html |
| apple-touch-icon.png |
| favicon.ico |
| images/100px-1242c368.png |
| images/100px-5fd6fb90.jpg |
| images/200px-c11eb203.jpg |
| images/300px-59adce76.jpg |
| images/100px-5fd6fb90.gif |
| javascripts/application-1d8d5276.js |
| stylesheets/site-8bc55985.css |
| index.html |
| subdir/index.html |
| other/index.html |
| api.json |
| subdir/api.json |
| stylesheets/site-8bc55985.css |
| index.html |
| subdir/index.html |
| other/index.html |
| api.json |
| subdir/api.json |
And the following files should not exist:
| images/100px.png |
| images/100px.jpg |
| images/100px.gif |
| images/100px.png |
| images/100px.jpg |
| images/100px.gif |
| javascripts/application.js |
| stylesheets/site.css |
| stylesheets/site.css |
And the file "javascripts/application-1d8d5276.js" should contain "img.src = '/images/100px-5fd6fb90.jpg'"
And the file "stylesheets/site-8bc55985.css" should contain:
@ -54,7 +54,7 @@ Feature: Assets get file hashes appended to them and references to them are upda
Given a successfully built app at "asset-hash-app"
When I cd to "build"
Then the following files should exist:
| fonts/fontawesome-webfont-56ce13e7.woff |
| fonts/fontawesome-webfont-56ce13e7.woff |
| fonts/fontawesome-webfont-10752316.woff2 |
And the file "stylesheets/uses_fonts-88aa3e2b.css" should contain "src: url('../fonts/fontawesome-webfont-10752316.woff2')"
And the file "stylesheets/uses_fonts-88aa3e2b.css" should contain "url('../fonts/fontawesome-webfont-56ce13e7.woff')"
@ -171,19 +171,20 @@ Feature: Assets get file hashes appended to them and references to them are upda
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")'
@wip
Scenario: The asset hash should change when a SASS partial changes
Given the Server is running at "asset-hash-app"
And the file "source/stylesheets/_partial.sass" has the contents
"""
body
font-size: 14px
font-size: 14px
"""
When I go to "/partials/"
Then I should see 'href="../stylesheets/uses_partials-a3c8302b.css'
And the file "source/stylesheets/_partial.sass" has the contents
"""
body
font-size: 18px !important
font-size: 18px !important
"""
When I go to "/partials/"
Then I should see 'href="../stylesheets/uses_partials-08ee47a7.css'
@ -211,9 +212,9 @@ Feature: Assets get file hashes appended to them and references to them are upda
"""
is_stylesheet = proc { |path| path.start_with? 'stylesheets' }
activate :asset_hash, ignore: [
%r(javascripts/*),
'images/*',
is_stylesheet
%r(javascripts/*),
'images/*',
is_stylesheet
]
activate :relative_assets
activate :directory_indexes
@ -221,25 +222,25 @@ Feature: Assets get file hashes appended to them and references to them are upda
And a successfully built app at "asset-hash-app"
When I cd to "build"
Then the following files should exist:
| index.html |
| apple-touch-icon.png |
| favicon.ico |
| images/100px.png |
| images/100px.jpg |
| images/100px.gif |
| index.html |
| apple-touch-icon.png |
| favicon.ico |
| images/100px.png |
| images/100px.jpg |
| images/100px.gif |
| javascripts/application.js |
| stylesheets/site.css |
| index.html |
| subdir/index.html |
| other/index.html |
| api.json |
| subdir/api.json |
| stylesheets/site.css |
| index.html |
| subdir/index.html |
| other/index.html |
| api.json |
| subdir/api.json |
And the following files should not exist:
| images/100px-1242c368.png |
| images/100px-5fd6fb90.jpg |
| images/100px-5fd6fb90.gif |
| images/100px-1242c368.png |
| images/100px-5fd6fb90.jpg |
| images/100px-5fd6fb90.gif |
| javascripts/application-1d8d5276.js |
| stylesheets/site-7474cadd.css |
| stylesheets/site-7474cadd.css |
Scenario: Hashed-asset files are not replaced for rewrite ignored paths
Given a fixture app "asset-hash-app"
@ -247,9 +248,9 @@ Feature: Assets get file hashes appended to them and references to them are upda
"""
is_stylesheet = proc { |path| path.start_with? '/stylesheets' }
activate :asset_hash, rewrite_ignore: [
%r(javascripts/*),
'/subdir/*',
is_stylesheet
%r(javascripts/*),
'/subdir/*',
is_stylesheet
]
activate :relative_assets
activate :directory_indexes
@ -257,15 +258,15 @@ Feature: Assets get file hashes appended to them and references to them are upda
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 |
| index.html |
| subdir/index.html |
| images/100px-5fd6fb90.jpg |
| javascripts/application-1d8d5276.js |
| stylesheets/site-8bc55985.css |
| stylesheets/site-8bc55985.css |
And the following files should not exist:
| images/100px.jpg |
| 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:
"""
@ -285,7 +286,7 @@ Feature: Assets get file hashes appended to them and references to them are upda
When I cd to "build"
Then the following files should exist:
| javascripts/jquery.min-276c87ff.js |
| stylesheets/test-7de2ad06.css |
| stylesheets/test-7de2ad06.css |
And the following files should not exist:
| javascripts/jquery.min.js |
And the file "stylesheets/test-7de2ad06.css" should contain:
@ -299,12 +300,12 @@ Feature: Assets get file hashes appended to them and references to them are upda
Given a successfully built app at "asset-hash-source-map"
When I cd to "build"
Then the following files should exist:
| index.html |
| javascripts/application-4553338c.js |
| index.html |
| javascripts/application-4553338c.js |
| javascripts/application.js-22cc2b5f.map |
| index.html |
| index.html |
And the following files should not exist:
| javascripts/application.js |
| javascripts/application.js |
| javascripts/application.js.map |
And the file "javascripts/application-4553338c.js" should contain "//# sourceMappingURL=application.js-22cc2b5f.map"
@ -313,12 +314,12 @@ Feature: Assets get file hashes appended to them and references to them are upda
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 |
| index.html |
| javascripts/application-myprefix-4553338c.js |
| javascripts/application.js-myprefix-22cc2b5f.map |
| index.html |
| index.html |
And the following files should not exist:
| javascripts/application.js |
| javascripts/application.js |
| javascripts/application.js.map |
And the file "javascripts/application-myprefix-4553338c.js" should contain "//# sourceMappingURL=application.js-myprefix-22cc2b5f.map"
@ -327,12 +328,12 @@ Feature: Assets get file hashes appended to them and references to them are upda
Given a successfully built app at "asset-hash-remove-filename"
When I cd to "build"
Then the following files should exist:
| index.html |
| javascripts/4553338c.js |
| index.html |
| javascripts/4553338c.js |
| javascripts/22cc2b5f.map |
| index.html |
| index.html |
And the following files should not exist:
| javascripts/application.js |
| javascripts/application.js |
| javascripts/application.js.map |
And the file "javascripts/4553338c.js" should contain "//# sourceMappingURL=22cc2b5f.map"

View file

@ -1,252 +1,252 @@
Feature: i18n Preview
In order to preview localized html
# Feature: i18n Preview
# In order to preview localized html
Scenario: Running localize with the default config
Given a fixture app "i18n-test-app"
And a file named "config.rb" with:
"""
activate :i18n
"""
Given the Server is running at "i18n-test-app"
When I go to "/"
Then I should see "Howdy"
When I go to "/hello.html"
Then I should see "Hello World"
When I go to "/morning.html"
Then I should see "Good morning"
When I go to "/one.html"
Then I should see "Only one"
When I go to "/defaults_en/index.html"
Then I should see "File Not Found"
When I go to "/en/index.html"
Then I should see "File Not Found"
When I go to "/en/morning.html"
Then I should see "File Not Found"
When I go to "/defaults_es/index.html"
Then I should see "File Not Found"
When I go to "/es/index.html"
Then I should see "Como Esta?"
When I go to "/es/hola.html"
Then I should see "Hola World"
When I go to "/es/manana.html"
Then I should see "Buenos días"
When I go to "/es/una.html"
Then I should see "Solamente una"
# Scenario: Running localize with the default config
# Given a fixture app "i18n-test-app"
# And a file named "config.rb" with:
# """
# activate :i18n
# """
# Given the Server is running at "i18n-test-app"
# When I go to "/"
# Then I should see "Howdy"
# When I go to "/hello.html"
# Then I should see "Hello World"
# When I go to "/morning.html"
# Then I should see "Good morning"
# When I go to "/one.html"
# Then I should see "Only one"
# When I go to "/defaults_en/index.html"
# Then I should see "File Not Found"
# When I go to "/en/index.html"
# Then I should see "File Not Found"
# When I go to "/en/morning.html"
# Then I should see "File Not Found"
# When I go to "/defaults_es/index.html"
# Then I should see "File Not Found"
# When I go to "/es/index.html"
# Then I should see "Como Esta?"
# When I go to "/es/hola.html"
# Then I should see "Hola World"
# When I go to "/es/manana.html"
# Then I should see "Buenos días"
# When I go to "/es/una.html"
# Then I should see "Solamente una"
Scenario: A template changes i18n during preview
Given a fixture app "i18n-test-app"
And a file named "config.rb" with:
"""
activate :i18n
"""
Given the Server is running at "i18n-test-app"
And the file "locales/en.yml" has the contents
"""
---
en:
greetings: "Howdy"
hi: "Hello"
"""
When I go to "/"
Then I should see "Howdy"
When I go to "/hello.html"
Then I should see "Hello World"
When the file "locales/en.yml" has the contents
"""
---
en:
greetings: "How You Doin"
hi: "Sup"
"""
When I go to "/"
Then I should see "How You Doin"
When I go to "/hello.html"
Then I should see "Sup World"
# Scenario: A template changes i18n during preview
# Given a fixture app "i18n-test-app"
# And a file named "config.rb" with:
# """
# activate :i18n
# """
# Given the Server is running at "i18n-test-app"
# And the file "locales/en.yml" has the contents
# """
# ---
# en:
# greetings: "Howdy"
# hi: "Hello"
# """
# When I go to "/"
# Then I should see "Howdy"
# When I go to "/hello.html"
# Then I should see "Hello World"
# When the file "locales/en.yml" has the contents
# """
# ---
# en:
# greetings: "How You Doin"
# hi: "Sup"
# """
# When I go to "/"
# Then I should see "How You Doin"
# When I go to "/hello.html"
# Then I should see "Sup World"
Scenario: Running localize with the alt path config
Given a fixture app "i18n-test-app"
And a file named "config.rb" with:
"""
activate :i18n, path: "/lang_:locale/"
"""
Given the Server is running at "i18n-test-app"
When I go to "/"
Then I should see "Howdy"
When I go to "/hello.html"
Then I should see "Hello World"
When I go to "/lang_en/index.html"
Then I should see "File Not Found"
When I go to "/lang_es/index.html"
Then I should see "Como Esta?"
When I go to "/lang_es/hola.html"
Then I should see "Hola World"
# Scenario: Running localize with the alt path config
# Given a fixture app "i18n-test-app"
# And a file named "config.rb" with:
# """
# activate :i18n, path: "/lang_:locale/"
# """
# Given the Server is running at "i18n-test-app"
# When I go to "/"
# Then I should see "Howdy"
# When I go to "/hello.html"
# Then I should see "Hello World"
# When I go to "/lang_en/index.html"
# Then I should see "File Not Found"
# When I go to "/lang_es/index.html"
# Then I should see "Como Esta?"
# When I go to "/lang_es/hola.html"
# Then I should see "Hola World"
Scenario: Running localize with the alt root config
Given a fixture app "i18n-alt-root-app"
And a file named "config.rb" with:
"""
activate :i18n, templates_dir: "lang_data"
"""
Given the Server is running at "i18n-alt-root-app"
When I go to "/"
Then I should see "Howdy"
When I go to "/hello.html"
Then I should see "Hello World"
When I go to "/en/index.html"
Then I should see "File Not Found"
When I go to "/es/index.html"
Then I should see "Como Esta?"
When I go to "/es/hola.html"
Then I should see "Hola World"
# Scenario: Running localize with the alt root config
# Given a fixture app "i18n-alt-root-app"
# And a file named "config.rb" with:
# """
# activate :i18n, templates_dir: "lang_data"
# """
# Given the Server is running at "i18n-alt-root-app"
# When I go to "/"
# Then I should see "Howdy"
# When I go to "/hello.html"
# Then I should see "Hello World"
# When I go to "/en/index.html"
# Then I should see "File Not Found"
# When I go to "/es/index.html"
# Then I should see "Como Esta?"
# When I go to "/es/hola.html"
# Then I should see "Hola World"
Scenario: Running localize with the lang map config
Given a fixture app "i18n-test-app"
And a file named "config.rb" with:
"""
activate :i18n, lang_map: { en: :english, es: :spanish }
"""
Given the Server is running at "i18n-test-app"
When I go to "/"
Then I should see "Howdy"
When I go to "/hello.html"
Then I should see "Hello World"
When I go to "/english/index.html"
Then I should see "File Not Found"
When I go to "/spanish/index.html"
Then I should see "Como Esta?"
When I go to "/spanish/hola.html"
Then I should see "Hola World"
# Scenario: Running localize with the lang map config
# Given a fixture app "i18n-test-app"
# And a file named "config.rb" with:
# """
# activate :i18n, lang_map: { en: :english, es: :spanish }
# """
# Given the Server is running at "i18n-test-app"
# When I go to "/"
# Then I should see "Howdy"
# When I go to "/hello.html"
# Then I should see "Hello World"
# When I go to "/english/index.html"
# Then I should see "File Not Found"
# When I go to "/spanish/index.html"
# Then I should see "Como Esta?"
# When I go to "/spanish/hola.html"
# Then I should see "Hola World"
Scenario: Running localize with a non-English mount config
Given a fixture app "i18n-test-app"
And a file named "config.rb" with:
"""
activate :i18n, mount_at_root: :es
"""
Given the Server is running at "i18n-test-app"
When I go to "/en/index.html"
Then I should see "Howdy"
When I go to "/en/hello.html"
Then I should see "Hello World"
When I go to "/"
Then I should see "Como Esta?"
When I go to "/hola.html"
Then I should see "Hola World"
When I go to "/manana.html"
Then I should see "Buenos días"
When I go to "/hello.html"
Then I should see "File Not Found"
When I go to "/en/morning.html"
Then I should see "Good morning"
When I go to "/es/manana.html"
Then I should see "File Not Found"
When I go to "/es/index.html"
Then I should see "File Not Found"
When I go to "/es/hola.html"
Then I should see "File Not Found"
# Scenario: Running localize with a non-English mount config
# Given a fixture app "i18n-test-app"
# And a file named "config.rb" with:
# """
# activate :i18n, mount_at_root: :es
# """
# Given the Server is running at "i18n-test-app"
# When I go to "/en/index.html"
# Then I should see "Howdy"
# When I go to "/en/hello.html"
# Then I should see "Hello World"
# When I go to "/"
# Then I should see "Como Esta?"
# When I go to "/hola.html"
# Then I should see "Hola World"
# When I go to "/manana.html"
# Then I should see "Buenos días"
# When I go to "/hello.html"
# Then I should see "File Not Found"
# When I go to "/en/morning.html"
# Then I should see "Good morning"
# When I go to "/es/manana.html"
# Then I should see "File Not Found"
# When I go to "/es/index.html"
# Then I should see "File Not Found"
# When I go to "/es/hola.html"
# Then I should see "File Not Found"
Scenario: Running localize with a non-English lang subset
Given a fixture app "i18n-test-app"
And a file named "config.rb" with:
"""
activate :i18n, langs: :es
"""
Given the Server is running at "i18n-test-app"
When I go to "/en/index.html"
Then I should see "File Not Found"
When I go to "/en/hello.html"
Then I should see "File Not Found"
When I go to "/"
Then I should see "Como Esta?"
When I go to "/hola.html"
Then I should see "Hola World"
When I go to "/hello.html"
Then I should see "File Not Found"
When I go to "/es/index.html"
Then I should see "File Not Found"
When I go to "/es/hola.html"
Then I should see "File Not Found"
# Scenario: Running localize with a non-English lang subset
# Given a fixture app "i18n-test-app"
# And a file named "config.rb" with:
# """
# activate :i18n, langs: :es
# """
# Given the Server is running at "i18n-test-app"
# When I go to "/en/index.html"
# Then I should see "File Not Found"
# When I go to "/en/hello.html"
# Then I should see "File Not Found"
# When I go to "/"
# Then I should see "Como Esta?"
# When I go to "/hola.html"
# Then I should see "Hola World"
# When I go to "/hello.html"
# Then I should see "File Not Found"
# When I go to "/es/index.html"
# Then I should see "File Not Found"
# When I go to "/es/hola.html"
# Then I should see "File Not Found"
Scenario: Running localize with the no mount config
Given a fixture app "i18n-test-app"
And a file named "config.rb" with:
"""
activate :i18n, mount_at_root: false
"""
Given the Server is running at "i18n-test-app"
When I go to "/en/index.html"
Then I should see "Howdy"
When I go to "/en/hello.html"
Then I should see "Hello World"
When I go to "/"
Then I should see "File Not Found"
When I go to "/hello.html"
Then I should see "File Not Found"
When I go to "/es/index.html"
Then I should see "Como Esta?"
When I go to "/es/hola.html"
Then I should see "Hola World"
# Scenario: Running localize with the no mount config
# Given a fixture app "i18n-test-app"
# And a file named "config.rb" with:
# """
# activate :i18n, mount_at_root: false
# """
# Given the Server is running at "i18n-test-app"
# When I go to "/en/index.html"
# Then I should see "Howdy"
# When I go to "/en/hello.html"
# Then I should see "Hello World"
# When I go to "/"
# Then I should see "File Not Found"
# When I go to "/hello.html"
# Then I should see "File Not Found"
# When I go to "/es/index.html"
# Then I should see "Como Esta?"
# When I go to "/es/hola.html"
# Then I should see "Hola World"
Scenario: Running localize with the subset config
Given a fixture app "i18n-test-app"
And a file named "config.rb" with:
"""
activate :i18n, langs: [:en]
"""
Given the Server is running at "i18n-test-app"
When I go to "/"
Then I should see "Howdy"
When I go to "/hello.html"
Then I should see "Hello World"
When I go to "/en/index.html"
Then I should see "File Not Found"
When I go to "/es/index.html"
Then I should see "File Not Found"
When I go to "/es/hola.html"
Then I should see "File Not Found"
# Scenario: Running localize with the subset config
# Given a fixture app "i18n-test-app"
# And a file named "config.rb" with:
# """
# activate :i18n, langs: [:en]
# """
# Given the Server is running at "i18n-test-app"
# When I go to "/"
# Then I should see "Howdy"
# When I go to "/hello.html"
# Then I should see "Hello World"
# When I go to "/en/index.html"
# Then I should see "File Not Found"
# When I go to "/es/index.html"
# Then I should see "File Not Found"
# When I go to "/es/hola.html"
# Then I should see "File Not Found"
Scenario: Running localize with relative_assets
Given a fixture app "i18n-test-app"
And a file named "config.rb" with:
"""
activate :i18n
activate :relative_assets
"""
Given the Server is running at "i18n-test-app"
When I go to "/"
Then I should see '"stylesheets/site.css"'
When I go to "/hello.html"
Then I should see '"stylesheets/site.css"'
When I go to "/es/index.html"
Then I should see '"../stylesheets/site.css"'
When I go to "/es/hola.html"
Then I should see '"../stylesheets/site.css"'
# Scenario: Running localize with relative_assets
# Given a fixture app "i18n-test-app"
# And a file named "config.rb" with:
# """
# activate :i18n
# activate :relative_assets
# """
# Given the Server is running at "i18n-test-app"
# When I go to "/"
# Then I should see '"stylesheets/site.css"'
# When I go to "/hello.html"
# Then I should see '"stylesheets/site.css"'
# When I go to "/es/index.html"
# Then I should see '"../stylesheets/site.css"'
# When I go to "/es/hola.html"
# Then I should see '"../stylesheets/site.css"'
Scenario: Missing translations fall back to the default locale
Given a fixture app "i18n-default-app"
And a file named "config.rb" with:
"""
activate :i18n, mount_at_root: :es
"""
Given the Server is running at "i18n-default-app"
When I go to "/en/"
Then I should see "Default locale: es"
Then I should see "Current locale: en"
Then I should see "Buenos días"
Then I should see "Howdy"
# Scenario: Missing translations fall back to the default locale
# Given a fixture app "i18n-default-app"
# And a file named "config.rb" with:
# """
# activate :i18n, mount_at_root: :es
# """
# Given the Server is running at "i18n-default-app"
# When I go to "/en/"
# Then I should see "Default locale: es"
# Then I should see "Current locale: en"
# Then I should see "Buenos días"
# Then I should see "Howdy"
Scenario: Nested i18n yaml
Given a fixture app "i18n-nested-app"
And a file named "config.rb" with:
"""
activate :i18n
"""
Given the Server is running at "i18n-nested-app"
When I go to "/"
Then I should see "Howdy"
Then I should see "More"
When I go to "/es/"
Then I should see "Como Esta?"
Then I should see "Mucho"
# Scenario: Nested i18n yaml
# Given a fixture app "i18n-nested-app"
# And a file named "config.rb" with:
# """
# activate :i18n
# """
# Given the Server is running at "i18n-nested-app"
# When I go to "/"
# Then I should see "Howdy"
# Then I should see "More"
# When I go to "/es/"
# Then I should see "Como Esta?"
# Then I should see "Mucho"

View file

@ -35,7 +35,7 @@ Then /^the file "([^\"]*)" has the contents$/ do |path, contents|
end
Then /^the file "([^\"]*)" is removed$/ do |path|
step %Q{I remove the file "#{path}"}
FileUtils.rm(expand_path(path))
@server_inst.files.poll_once!
end

View file

@ -16,11 +16,11 @@ Gem::Specification.new do |s|
s.files = `git ls-files -z`.split("\0")
s.test_files = `git ls-files -z -- {fixtures,features}/*`.split("\0")
s.require_path = 'lib'
s.required_ruby_version = '>= 2.2.0'
s.required_ruby_version = '>= 2.4.0'
# Core
s.add_dependency('bundler')
s.add_dependency('rack', ['>= 1.4.5', '< 3'])
s.add_dependency('bundler', '~> 2.0')
s.add_dependency('rack', ['>= 1.4.5', '< 2.1'])
s.add_dependency('tilt', ['~> 2.0.9'])
s.add_dependency('erubis')
s.add_dependency('fast_blank')
@ -28,6 +28,7 @@ Gem::Specification.new do |s|
s.add_dependency('servolux')
s.add_dependency('dotenv')
s.add_dependency('toml')
s.add_dependency('webrick')
# Helpers
s.add_dependency('activesupport', ['>= 4.2', '< 6.0'])

View file

@ -16,7 +16,7 @@ Gem::Specification.new do |s|
s.files = `git ls-files -z`.split("\0")
s.test_files = `git ls-files -z -- {fixtures,features}/*`.split("\0")
s.require_path = 'lib'
s.required_ruby_version = '>= 2.2.0'
s.required_ruby_version = '>= 2.4.0'
s.add_dependency('middleman-core', Middleman::VERSION)
s.add_dependency('middleman-cli', Middleman::VERSION)