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

View file

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

View file

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

View file

@ -110,7 +110,7 @@ Constraint][pvc] with two digits of precision. For example:
## License ## 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 [middleman]: http://middlemanapp.com
[gem]: https://rubygems.org/gems/middleman [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 ~@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?
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

View file

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

View file

@ -171,6 +171,7 @@ 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")'
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 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"
And the file "source/stylesheets/_partial.sass" has the contents And the file "source/stylesheets/_partial.sass" has the contents

View file

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

View file

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

View file

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