diff --git a/Gemfile b/Gemfile index a87ae8b2f..b5620936e 100644 --- a/Gemfile +++ b/Gemfile @@ -1,11 +1,13 @@ source 'https://rubygems.org' -gem "middleman", "~> 3.3.6" +gem "middleman", "~> 4.0.0" gem "middleman-syntax" gem "middleman-blog" gem "middleman-favicon-maker" gem "middleman-livereload" +gem 'bigdecimal', '1.3.5' + group :development do gem "bundler", "~> 1.17.3" # Middleman depend in bundler 1.x gem "bourbon" diff --git a/Gemfile.lock b/Gemfile.lock index a1ffbaf63..31be569d9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,88 +1,90 @@ GEM remote: https://rubygems.org/ specs: - activesupport (4.1.16) - i18n (~> 0.6, >= 0.6.9) - json (~> 1.7, >= 1.7.7) + activesupport (4.2.11.3) + i18n (~> 0.7) minitest (~> 5.1) - thread_safe (~> 0.1) + thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - addressable (2.3.8) + addressable (2.4.0) + backports (3.18.1) + bigdecimal (1.3.5) bourbon (4.2.2) sass (~> 3.4) thor builder (3.2.4) - celluloid (0.16.0) - timers (~> 4.0.0) - chunky_png (1.3.4) + capybara (2.5.0) + mime-types (>= 1.16) + nokogiri (>= 1.3.3) + rack (>= 1.0.0) + rack-test (>= 0.5.4) + xpath (~> 2.0) coffee-script (2.4.1) coffee-script-source execjs - coffee-script-source (1.9.1.1) - compass (1.0.3) - chunky_png (~> 1.2) - compass-core (~> 1.0.2) - compass-import-once (~> 1.0.5) - rb-fsevent (>= 0.9.3) - rb-inotify (>= 0.9) - sass (>= 3.3.13, < 3.5) - compass-core (1.0.3) - multi_json (~> 1.0) - sass (>= 3.3.0, < 3.5) + coffee-script-source (1.12.2) compass-import-once (1.0.5) sass (>= 3.2, < 3.5) + concurrent-ruby (0.9.2) + contracts (0.12.0) docile (1.1.5) em-websocket (0.5.1) eventmachine (>= 0.12.9) http_parser.rb (~> 0.6.0) erubis (2.7.0) eventmachine (1.2.7) - execjs (2.5.2) + execjs (2.7.0) + fastimage (1.8.1) + addressable (~> 2.3, >= 2.3.5) favicon_maker (1.3) docile (~> 1.1) - ffi (1.9.25) + ffi (1.13.1) haml (5.1.2) temple (>= 0.8.0) tilt - hike (1.2.3) - hitimes (1.2.2) - hooks (0.4.0) - uber (~> 0.0.4) + hamster (2.0.0) + concurrent-ruby (~> 0.8) + hashie (3.6.0) http_parser.rb (0.6.0) i18n (0.7.0) - json (1.8.6) - kramdown (1.6.0) - listen (2.10.0) - celluloid (~> 0.16.0) - rb-fsevent (>= 0.9.3) - rb-inotify (>= 0.9) - middleman (3.3.11) + json (2.3.1) + kramdown (1.17.0) + listen (3.2.1) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + middleman (4.0.0) coffee-script (~> 2.2) - compass (>= 1.0.0, < 2.0.0) compass-import-once (= 1.0.5) - execjs (~> 2.0) haml (>= 4.0.5) kramdown (~> 1.2) - middleman-core (= 3.3.11) - middleman-sprockets (>= 3.1.2) + middleman-cli (= 4.0.0) + middleman-core (= 4.0.0) sass (>= 3.4.0, < 4.0) - uglifier (~> 2.5) - middleman-blog (3.5.3) - addressable (~> 2.3.5) - middleman-core (~> 3.2) + middleman-blog (4.0.3) + addressable (~> 2.3) + middleman-core (>= 4.0.0) tzinfo (>= 0.3.0) - middleman-core (3.3.11) - activesupport (~> 4.1.0) + middleman-cli (4.0.0) + thor (>= 0.17.0, < 2.0) + middleman-core (4.0.0) + activesupport (~> 4.2) + addressable (~> 2.4.0) + backports (~> 3.6) bundler (~> 1.1) + capybara (~> 2.5.0) + contracts (~> 0.12.0) erubis - hooks (~> 0.3) + execjs (~> 2.0) + fastimage (~> 1.8) + hamster (~> 2.0) + hashie (~> 3.4) i18n (~> 0.7.0) - listen (>= 2.7.9, < 3.0) - padrino-helpers (~> 0.12.3) + listen (~> 3.0) + padrino-helpers (~> 0.13.0) rack (>= 1.4.5, < 2.0) - rack-test (~> 0.6.2) - thor (>= 0.15.2, < 2.0) - tilt (~> 1.4.1, < 2.0) + sass (>= 3.4) + tilt (~> 1.4.1) + uglifier (~> 2.6) middleman-favicon-maker (3.7) favicon_maker (~> 1.3) middleman-core (>= 3.0.0) @@ -90,71 +92,73 @@ GEM em-websocket (~> 0.5.1) middleman-core (>= 3.3) rack-livereload (~> 0.3.15) - middleman-sprockets (3.4.2) - middleman-core (>= 3.3) - sprockets (~> 2.12.1) - sprockets-helpers (~> 1.1.0) - sprockets-sass (~> 1.3.0) middleman-syntax (3.2.0) middleman-core (>= 3.2) rouge (~> 3.2) - minitest (5.11.3) - multi_json (1.11.0) + mime-types (3.3.1) + mime-types-data (~> 3.2015) + mime-types-data (3.2020.0512) + mini_portile2 (2.4.0) + minitest (5.14.1) neat (1.7.2) bourbon (>= 4.0) sass (>= 3.3) +<<<<<<< HEAD padrino-helpers (0.12.5) +======= + net-sftp (3.0.0) + net-ssh (>= 5.0.0, < 7.0.0) + net-ssh (6.0.2) + nokogiri (1.10.10) + mini_portile2 (~> 2.4.0) + padrino-helpers (0.13.3.4) +>>>>>>> 65b656a1... Resulting lock file, note I'm using bundler 1 because of upgrading i18n (~> 0.6, >= 0.6.7) - padrino-support (= 0.12.5) - tilt (~> 1.4.1) - padrino-support (0.12.5) + padrino-support (= 0.13.3.4) + tilt (>= 1.4.1, < 3) + padrino-support (0.13.3.4) activesupport (>= 3.1) +<<<<<<< HEAD rack (1.6.12) +======= + ptools (1.3.5) + rack (1.6.13) +>>>>>>> 65b656a1... Resulting lock file, note I'm using bundler 1 because of upgrading rack-contrib (1.8.0) rack (~> 1.4) rack-livereload (0.3.17) rack - rack-test (0.6.3) - rack (>= 1.0) - rb-fsevent (0.9.4) - rb-inotify (0.9.5) - ffi (>= 0.5.0) + rack-test (1.1.0) + rack (>= 1.0, < 3) + rb-fsevent (0.10.4) + rb-inotify (0.10.1) + ffi (~> 1.0) rouge (3.19.0) - sass (3.4.13) + sass (3.4.25) slim (3.0.9) temple (>= 0.7.6, < 0.9) tilt (>= 1.3.3, < 2.1) - sprockets (2.12.3) - hike (~> 1.2) - multi_json (~> 1.0) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - sprockets-helpers (1.1.0) - sprockets (~> 2.0) - sprockets-sass (1.3.1) - sprockets (~> 2.0) - tilt (~> 1.1) temple (0.8.2) - thor (0.19.1) + thor (1.0.1) thread_safe (0.3.6) tilt (1.4.1) - timers (4.0.1) - hitimes - tzinfo (1.2.5) + tzinfo (1.2.7) thread_safe (~> 0.1) - uber (0.0.13) - uglifier (2.7.1) + uglifier (2.7.2) execjs (>= 0.3.0) json (>= 1.8.0) + xpath (2.1.0) + nokogiri (~> 1.3) PLATFORMS ruby DEPENDENCIES + bigdecimal (= 1.3.5) bourbon builder (~> 3.0) bundler (~> 1.17.3) - middleman (~> 3.3.6) + middleman (~> 4.0.0) middleman-blog middleman-favicon-maker middleman-livereload @@ -164,4 +168,4 @@ DEPENDENCIES slim BUNDLED WITH - 2.1.2 + 1.17.3 diff --git a/config.rb b/config.rb index a1e60b519..ec75b7b01 100644 --- a/config.rb +++ b/config.rb @@ -1,6 +1,11 @@ $LOAD_PATH << File.expand_path('../lib', __FILE__) require 'patches/uri' +# Assets +# Framework requires set themselves up +require 'bourbon' +require 'neat' + # dev mode addons activate :livereload if ENV['LIVERELOAD'] @@ -46,14 +51,15 @@ def configure_blog(blog) activate :directory_indexes page "documentation/**/*.html", directory_index: false -config[:ignored_sitemap_matchers][:partials] = ->(file) do +config[:ignored_sitemap_matchers][:partials] = ->(source_file, _) do + path = source_file.relative_path.to_s # Only files with 1 (but not two) underscores at the start # of the file name are candidates for being considered a partial. - return false unless file =~ %r{/_[^_]} + return false unless path =~ %r{/_[^_]} # ...but not our generated docs -- YARD generates `_index.html` files # which are not partials. - file !~ %r{source/documentation/[0-9\.]+/} + path !~ %r{source/documentation/[0-9\.]+/} end set :build_dir, 'docs' @@ -68,39 +74,39 @@ def configure_blog(blog) configure :build do activate :minify_css, ignore: 'documentation/*' activate :minify_javascript, ignore: 'documentation/*' - activate :favicon_maker, icons: { "_favicon_template.png" => - [ - { icon: "apple-touch-icon-152x152-precomposed.png" }, # Same as apple-touch-icon-57x57.png, for retina iPad with iOS7. - { icon: "apple-touch-icon-144x144-precomposed.png" }, # Same as apple-touch-icon-57x57.png, for retina iPad with iOS6 or prior. - { icon: "apple-touch-icon-120x120-precomposed.png" }, # Same as apple-touch-icon-57x57.png, for retina iPhone with iOS7. - { icon: "apple-touch-icon-114x114-precomposed.png" }, # Same as apple-touch-icon-57x57.png, for retina iPhone with iOS6 or prior. - { icon: "apple-touch-icon-76x76-precomposed.png" }, # Same as apple-touch-icon-57x57.png, for non-retina iPad with iOS7. - { icon: "apple-touch-icon-72x72-precomposed.png" }, # Same as apple-touch-icon-57x57.png, for non-retina iPad with iOS6 or prior. - { icon: "apple-touch-icon-60x60-precomposed.png" }, # Same as apple-touch-icon-57x57.png, for non-retina iPhone with iOS7. - { icon: "apple-touch-icon-57x57-precomposed.png" }, # iPhone and iPad users can turn web pages into icons on their home screen. Such link appears as a regular iOS native application. When this happens, the device looks for a specific picture. The 57x57 resolution is convenient for non-retina iPhone with iOS6 or prior. Learn more in Apple docs. - { icon: "apple-touch-icon-precomposed.png", size: "57x57" }, # Same as apple-touch-icon.png, expect that is already have rounded corners (but neither drop shadow nor gloss effect). - { icon: "apple-touch-icon.png", size: "57x57" }, # Same as apple-touch-icon-57x57.png, for "default" requests, as some devices may look for this specific file. This picture may save some 404 errors in your HTTP logs. See Apple docs - { icon: "favicon-196x196.png" }, # For Android Chrome M31+. - { icon: "favicon-160x160.png" }, # For Opera Speed Dial (up to Opera 12; this icon is deprecated starting from Opera 15), although the optimal icon is not square but rather 256x160. If Opera is a major platform for you, you should create this icon yourself. - { icon: "favicon-96x96.png" }, # For Google TV. - { icon: "favicon-32x32.png" }, # For Safari on Mac OS. - { icon: "favicon-16x16.png" }, # The classic favicon, displayed in the tabs. - { icon: "favicon.png", size: "16x16" }, # The classic favicon, displayed in the tabs. - { icon: "favicon.ico", size: "64x64,32x32,24x24,16x16" }, # Used by IE, and also by some other browsers if we are not careful. - { icon: "mstile-70x70.png", size: "70x70" }, # For Windows 8 / IE11. - { icon: "mstile-144x144.png", size: "144x144" }, - { icon: "mstile-150x150.png", size: "150x150" }, - { icon: "mstile-310x310.png", size: "310x310" }, - ] - } + # activate :favicon_maker, icons: { "_favicon_template.png" => + # [ + # { icon: "apple-touch-icon-152x152-precomposed.png" }, # Same as apple-touch-icon-57x57.png, for retina iPad with iOS7. + # { icon: "apple-touch-icon-144x144-precomposed.png" }, # Same as apple-touch-icon-57x57.png, for retina iPad with iOS6 or prior. + # { icon: "apple-touch-icon-120x120-precomposed.png" }, # Same as apple-touch-icon-57x57.png, for retina iPhone with iOS7. + # { icon: "apple-touch-icon-114x114-precomposed.png" }, # Same as apple-touch-icon-57x57.png, for retina iPhone with iOS6 or prior. + # { icon: "apple-touch-icon-76x76-precomposed.png" }, # Same as apple-touch-icon-57x57.png, for non-retina iPad with iOS7. + # { icon: "apple-touch-icon-72x72-precomposed.png" }, # Same as apple-touch-icon-57x57.png, for non-retina iPad with iOS6 or prior. + # { icon: "apple-touch-icon-60x60-precomposed.png" }, # Same as apple-touch-icon-57x57.png, for non-retina iPhone with iOS7. + # { icon: "apple-touch-icon-57x57-precomposed.png" }, # iPhone and iPad users can turn web pages into icons on their home screen. Such link appears as a regular iOS native application. When this happens, the device looks for a specific picture. The 57x57 resolution is convenient for non-retina iPhone with iOS6 or prior. Learn more in Apple docs. + # { icon: "apple-touch-icon-precomposed.png", size: "57x57" }, # Same as apple-touch-icon.png, expect that is already have rounded corners (but neither drop shadow nor gloss effect). + # { icon: "apple-touch-icon.png", size: "57x57" }, # Same as apple-touch-icon-57x57.png, for "default" requests, as some devices may look for this specific file. This picture may save some 404 errors in your HTTP logs. See Apple docs + # { icon: "favicon-196x196.png" }, # For Android Chrome M31+. + # { icon: "favicon-160x160.png" }, # For Opera Speed Dial (up to Opera 12; this icon is deprecated starting from Opera 15), although the optimal icon is not square but rather 256x160. If Opera is a major platform for you, you should create this icon yourself. + # { icon: "favicon-96x96.png" }, # For Google TV. + # { icon: "favicon-32x32.png" }, # For Safari on Mac OS. + # { icon: "favicon-16x16.png" }, # The classic favicon, displayed in the tabs. + # { icon: "favicon.png", size: "16x16" }, # The classic favicon, displayed in the tabs. + # { icon: "favicon.ico", size: "64x64,32x32,24x24,16x16" }, # Used by IE, and also by some other browsers if we are not careful. + # { icon: "mstile-70x70.png", size: "70x70" }, # For Windows 8 / IE11. + # { icon: "mstile-144x144.png", size: "144x144" }, + # { icon: "mstile-150x150.png", size: "150x150" }, + # { icon: "mstile-310x310.png", size: "310x310" }, + # ] + # } end require 'rspec_info/helpers' helpers RSpecInfo::Helpers -RSpecInfo::Helpers.rspec_documentation_latest(source_dir).each do |gem_name, version| - Dir.glob(File.join(source_dir, "/documentation/#{version}/#{gem_name}/**/*")).select { |f| File.file? f }.each do |f| - relative_path = Pathname.new(f).relative_path_from(Pathname.new(source_dir)) +RSpecInfo::Helpers.rspec_documentation_latest(app.source_dir).each do |gem_name, version| + Dir.glob(File.join(app.source_dir, "/documentation/#{version}/#{gem_name}/**/*")).select { |f| File.file? f }.each do |f| + relative_path = Pathname.new(f).relative_path_from(Pathname.new(app.source_dir)) proxy relative_path.to_s.gsub(version, 'latest'), "redirect-latest.html", locals: { url: '/' + relative_path.to_s } end end diff --git a/lib/rspec_info/helpers.rb b/lib/rspec_info/helpers.rb index 0b274551f..a117a04f2 100644 --- a/lib/rspec_info/helpers.rb +++ b/lib/rspec_info/helpers.rb @@ -1,5 +1,9 @@ module RSpecInfo module Helpers + def source_dir + app.source_dir + end + def current_blog blog(current_blog_name) end diff --git a/source/stylesheets/_application.css.scss b/source/stylesheets/_application.scss similarity index 100% rename from source/stylesheets/_application.css.scss rename to source/stylesheets/_application.scss diff --git a/source/stylesheets/_normalize.css b/source/stylesheets/_normalize.scss similarity index 100% rename from source/stylesheets/_normalize.css rename to source/stylesheets/_normalize.scss diff --git a/source/stylesheets/asciinema-player.css b/source/stylesheets/asciinema-player.scss similarity index 100% rename from source/stylesheets/asciinema-player.css rename to source/stylesheets/asciinema-player.scss diff --git a/source/stylesheets/pages/about.css.scss b/source/stylesheets/pages/about.scss similarity index 98% rename from source/stylesheets/pages/about.css.scss rename to source/stylesheets/pages/about.scss index dde98796a..822e9f5d7 100644 --- a/source/stylesheets/pages/about.css.scss +++ b/source/stylesheets/pages/about.scss @@ -1,4 +1,4 @@ -@import "application"; +@import "./../application"; section { @include outer-container; diff --git a/source/stylesheets/pages/blog.css.scss b/source/stylesheets/pages/blog.scss similarity index 98% rename from source/stylesheets/pages/blog.css.scss rename to source/stylesheets/pages/blog.scss index a1198868d..d71079ec9 100644 --- a/source/stylesheets/pages/blog.css.scss +++ b/source/stylesheets/pages/blog.scss @@ -1,4 +1,4 @@ -@import "partials/standard_article"; +@import "./../partials/standard_article"; .blog_post { pre { diff --git a/source/stylesheets/pages/contributing.css.scss b/source/stylesheets/pages/contributing.scss similarity index 100% rename from source/stylesheets/pages/contributing.css.scss rename to source/stylesheets/pages/contributing.scss diff --git a/source/stylesheets/pages/documentation.css.scss b/source/stylesheets/pages/documentation.scss similarity index 100% rename from source/stylesheets/pages/documentation.css.scss rename to source/stylesheets/pages/documentation.scss diff --git a/source/stylesheets/pages/help.css.scss b/source/stylesheets/pages/help.scss similarity index 100% rename from source/stylesheets/pages/help.css.scss rename to source/stylesheets/pages/help.scss diff --git a/source/stylesheets/pages/index.css.scss b/source/stylesheets/pages/index.scss similarity index 86% rename from source/stylesheets/pages/index.css.scss rename to source/stylesheets/pages/index.scss index d7b8d13ba..02cf63a30 100644 --- a/source/stylesheets/pages/index.css.scss +++ b/source/stylesheets/pages/index.scss @@ -1,4 +1,4 @@ -@import "application"; +@import "./../application"; @import "partials/hero"; @import "partials/features"; @import "partials/get_started"; diff --git a/source/stylesheets/pages/ja.css.scss b/source/stylesheets/pages/ja.scss similarity index 100% rename from source/stylesheets/pages/ja.css.scss rename to source/stylesheets/pages/ja.scss diff --git a/source/stylesheets/pages/upgrading-from-rspec-2.css.scss b/source/stylesheets/pages/upgrading-from-rspec-2.scss similarity index 100% rename from source/stylesheets/pages/upgrading-from-rspec-2.css.scss rename to source/stylesheets/pages/upgrading-from-rspec-2.scss diff --git a/source/stylesheets/partials/_buttons.css.scss b/source/stylesheets/partials/_buttons.scss similarity index 100% rename from source/stylesheets/partials/_buttons.css.scss rename to source/stylesheets/partials/_buttons.scss diff --git a/source/stylesheets/partials/_code.css.scss.erb b/source/stylesheets/partials/_code.scss similarity index 100% rename from source/stylesheets/partials/_code.css.scss.erb rename to source/stylesheets/partials/_code.scss diff --git a/source/stylesheets/partials/_features.css.scss b/source/stylesheets/partials/_features.scss similarity index 100% rename from source/stylesheets/partials/_features.css.scss rename to source/stylesheets/partials/_features.scss diff --git a/source/stylesheets/partials/_footer.css.scss b/source/stylesheets/partials/_footer.scss similarity index 100% rename from source/stylesheets/partials/_footer.css.scss rename to source/stylesheets/partials/_footer.scss diff --git a/source/stylesheets/partials/_get_started.css.scss b/source/stylesheets/partials/_get_started.scss similarity index 100% rename from source/stylesheets/partials/_get_started.css.scss rename to source/stylesheets/partials/_get_started.scss diff --git a/source/stylesheets/partials/_header.css.scss b/source/stylesheets/partials/_header.scss similarity index 100% rename from source/stylesheets/partials/_header.css.scss rename to source/stylesheets/partials/_header.scss diff --git a/source/stylesheets/partials/_hero.css.scss b/source/stylesheets/partials/_hero.scss similarity index 100% rename from source/stylesheets/partials/_hero.css.scss rename to source/stylesheets/partials/_hero.scss diff --git a/source/stylesheets/partials/_standard_article.css.scss b/source/stylesheets/partials/_standard_article.scss similarity index 91% rename from source/stylesheets/partials/_standard_article.css.scss rename to source/stylesheets/partials/_standard_article.scss index 04db2619d..937f71e89 100644 --- a/source/stylesheets/partials/_standard_article.css.scss +++ b/source/stylesheets/partials/_standard_article.scss @@ -1,4 +1,4 @@ -@import "application"; +@import "./../application"; section { padding: 3em 2em; diff --git a/source/stylesheets/partials/_variables.css.scss b/source/stylesheets/partials/_variables.scss similarity index 100% rename from source/stylesheets/partials/_variables.css.scss rename to source/stylesheets/partials/_variables.scss