Commit b2eb5892 authored by Hiroyuki Sato's avatar Hiroyuki Sato 🇯🇵

feature.yml の構造変更に対応

parent 45213f4d
# If you do not have OpenSSL installed, change
# the following line to use 'http://'
source 'https://rubygems.org'
gem 'middleman', '~> 4.2'
gem 'middleman-autoprefixer', '~> 2.7'
# For faster file watcher updates on Windows:
gem 'wdm', '~> 0.1.0', platforms: %i[mswin mingw x64_mingw]
# Windows does not come with time zone data
gem 'tzinfo-data', platforms: %i[mswin mingw x64_mingw jruby]
# Middleman Gems
gem 'middleman', '~> 4.3'
gem 'middleman-blog', '~> 4.0'
gem 'middleman-livereload'
gem 'middleman-minify-html'
gem 'tzinfo-data', platforms: %i[mswin mingw jruby]
gem 'wdm', '~> 0.1', platforms: %i[mswin mingw]
gem 'middleman-autoprefixer', '~> 2.7.1'
gem 'middleman-syntax'
gem 'haml', '~> 4.0'
gem 'kramdown', '~> 1.10'
gem 'nokogiri', '>= 1.10.3'
gem 'sassc'
gem 'stringex'
gem 'countries'
gem 'nokogiri'
# Replacement of therubyracer
gem 'mini_racer', '~> 0.2'
gem 'builder'
# For feed.xml.builder
gem 'builder', '~> 3.0'
gem 'kramdown', '~> 1.10'
# Direction generation
gem 'faraday', '>= 0.15.0'
gem 'faraday_middleware'
gem 'faraday_middleware-parse_oj', '~> 0.3'
# Handbook CHANGELOG generation
gem 'gitlab'
gem "rss", "~> 0.2.8"
# Greenhouse API
gem 'greenhouse_io'
group :development, :test do
gem 'html-proofer'
gem 'docopt'
gem 'rspec', '~> 3.5', require: false
gem 'rubocop', '~> 0.59.0', require: false
gem 'capybara'
gem 'capybara-screenshot'
gem 'selenium-webdriver'
end
GEM
remote: https://rubygems.org/
specs:
activesupport (5.0.7)
activesupport (5.0.7.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
addressable (2.5.2)
addressable (2.6.0)
public_suffix (>= 2.0.2, < 4.0)
autoprefixer-rails (8.6.4)
ast (2.4.0)
autoprefixer-rails (6.7.7.2)
execjs
backports (3.11.3)
backports (3.11.4)
builder (3.2.3)
capybara (3.13.2)
addressable
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (~> 1.2)
xpath (~> 3.2)
capybara-screenshot (1.0.22)
capybara (>= 1.0, < 4)
launchy
childprocess (0.9.0)
ffi (~> 1.0, >= 1.0.11)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.12.2)
compass-import-once (1.0.5)
sass (>= 3.2, < 3.5)
concurrent-ruby (1.0.5)
colorize (0.8.1)
concurrent-ruby (1.1.4)
contracts (0.13.0)
dotenv (2.5.0)
countries (3.0.0)
i18n_data (~> 0.8.0)
sixarm_ruby_unaccent (~> 1.1)
unicode_utils (~> 1.4)
diff-lcs (1.3)
docopt (0.6.1)
dotenv (2.6.0)
em-websocket (0.5.1)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
erubis (2.7.0)
ethon (0.12.0)
ffi (>= 1.3.0)
eventmachine (1.2.7)
execjs (2.7.0)
faraday (0.15.4)
multipart-post (>= 1.2, < 3)
faraday_middleware (0.13.1)
faraday (>= 0.7.4, < 1.0)
faraday_middleware-parse_oj (0.3.2)
faraday (~> 0.9)
faraday_middleware (>= 0.9.1, < 1.0)
oj (>= 2.0, < 4.0)
fast_blank (1.0.0)
fastimage (2.1.3)
fastimage (2.1.5)
ffi (1.9.25)
haml (4.0.7)
gitlab (4.9.0)
httparty (~> 0.14, >= 0.14.0)
terminal-table (~> 1.5, >= 1.5.1)
greenhouse_io (2.5.0)
httmultiparty (~> 0.3.16)
haml (5.0.4)
temple (>= 0.8.0)
tilt
hamster (3.0.0)
concurrent-ruby (~> 1.0)
hashie (3.5.7)
hashie (3.6.0)
html-proofer (3.10.2)
activesupport (>= 4.2, < 6.0)
addressable (~> 2.3)
colorize (~> 0.8)
mercenary (~> 0.3.2)
nokogiri (~> 1.9)
parallel (~> 1.3)
typhoeus (~> 1.3)
yell (~> 2.0)
htmlcompressor (0.2.0)
httmultiparty (0.3.16)
httparty (>= 0.7.3)
mimemagic
multipart-post
http_parser.rb (0.6.0)
i18n (0.7.0)
httparty (0.16.4)
mime-types (~> 3.0)
multi_xml (>= 0.5.2)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
i18n_data (0.8.0)
jaro_winkler (1.5.2)
kramdown (1.17.0)
launchy (2.4.3)
addressable (~> 2.3)
libv8 (6.7.288.46.1)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
memoist (0.16.0)
middleman (4.2.1)
mercenary (0.3.6)
middleman (4.3.3)
coffee-script (~> 2.2)
compass-import-once (= 1.0.5)
haml (>= 4.0.5)
kramdown (~> 1.2)
middleman-cli (= 4.2.1)
middleman-core (= 4.2.1)
sass (>= 3.4.0, < 4.0)
middleman-autoprefixer (2.9.0)
autoprefixer-rails (~> 8.0)
middleman-cli (= 4.3.3)
middleman-core (= 4.3.3)
middleman-autoprefixer (2.7.1)
autoprefixer-rails (>= 6.5.2, < 7.0.0)
middleman-core (>= 3.3.3)
middleman-blog (4.0.2)
middleman-blog (4.0.3)
addressable (~> 2.3)
middleman-core (~> 4.0)
middleman-core (>= 4.0.0)
tzinfo (>= 0.3.0)
middleman-cli (4.2.1)
middleman-cli (4.3.3)
thor (>= 0.17.0, < 2.0)
middleman-core (4.2.1)
middleman-core (4.3.3)
activesupport (>= 4.2, < 5.1)
addressable (~> 2.3)
backports (~> 3.6)
bundler (~> 1.1)
bundler
contracts (~> 0.13.0)
dotenv
erubis
......@@ -73,15 +129,15 @@ GEM
fastimage (~> 2.0)
hamster (~> 3.0)
hashie (~> 3.4)
i18n (~> 0.7.0)
i18n (~> 0.9.0)
listen (~> 3.0.0)
memoist (~> 0.14)
padrino-helpers (~> 0.13.0)
parallel
rack (>= 1.4.5, < 3)
sass (>= 3.4)
sassc (~> 2.0)
servolux
tilt (~> 2.0)
tilt (~> 2.0.9)
uglifier (~> 3.0)
middleman-livereload (3.4.6)
em-websocket (~> 0.5.1)
......@@ -90,49 +146,129 @@ GEM
middleman-minify-html (3.4.1)
htmlcompressor (~> 0.2.0)
middleman-core (>= 3.2)
mini_portile2 (2.3.0)
middleman-syntax (3.0.0)
middleman-core (>= 3.2)
rouge (~> 2.0)
mime-types (3.2.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2018.0812)
mimemagic (0.3.3)
mini_mime (1.0.1)
mini_portile2 (2.4.0)
mini_racer (0.2.4)
libv8 (>= 6.3)
minitest (5.11.3)
nokogiri (1.8.4)
mini_portile2 (~> 2.3.0)
multi_xml (0.6.0)
multipart-post (2.0.0)
nokogiri (1.10.3)
mini_portile2 (~> 2.4.0)
oj (3.7.9)
padrino-helpers (0.13.3.4)
i18n (~> 0.6, >= 0.6.7)
padrino-support (= 0.13.3.4)
tilt (>= 1.4.1, < 3)
padrino-support (0.13.3.4)
activesupport (>= 3.1)
parallel (1.12.1)
public_suffix (3.0.2)
rack (2.0.5)
parallel (1.13.0)
parser (2.6.0.0)
ast (~> 2.4.0)
powerpack (0.1.2)
public_suffix (3.0.3)
rack (2.0.6)
rack-livereload (0.3.17)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rainbow (3.0.0)
rake (12.3.2)
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
sass (3.4.25)
rb-inotify (0.10.0)
ffi (~> 1.0)
regexp_parser (1.3.0)
rouge (2.2.1)
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)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.0)
rss (0.2.8)
rubocop (0.59.2)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.5, != 2.5.1.1)
powerpack (~> 0.1)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.10.0)
rubyzip (1.2.2)
sassc (2.0.0)
ffi (~> 1.9.6)
rake
selenium-webdriver (3.141.0)
childprocess (~> 0.5)
rubyzip (~> 1.2, >= 1.2.2)
servolux (0.13.0)
thor (0.20.0)
sixarm_ruby_unaccent (1.2.0)
stringex (2.8.5)
temple (0.8.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
thor (0.20.3)
thread_safe (0.3.6)
tilt (2.0.8)
tilt (2.0.9)
typhoeus (1.3.1)
ethon (>= 0.9.0)
tzinfo (1.2.5)
thread_safe (~> 0.1)
uglifier (3.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.4.1)
unicode_utils (1.4.0)
xpath (3.2.0)
nokogiri (~> 1.8)
yell (2.0.7)
PLATFORMS
ruby
DEPENDENCIES
builder
haml (~> 4.0)
builder (~> 3.0)
capybara
capybara-screenshot
countries
docopt
faraday (>= 0.15.0)
faraday_middleware
faraday_middleware-parse_oj (~> 0.3)
gitlab
greenhouse_io
html-proofer
kramdown (~> 1.10)
middleman (~> 4.2)
middleman-autoprefixer (~> 2.7)
middleman (~> 4.3)
middleman-autoprefixer (~> 2.7.1)
middleman-blog (~> 4.0)
middleman-livereload
middleman-minify-html
nokogiri
middleman-syntax
mini_racer (~> 0.2)
nokogiri (>= 1.10.3)
rspec (~> 3.5)
rss (~> 0.2.8)
rubocop (~> 0.59.0)
sassc
selenium-webdriver
stringex
tzinfo-data
wdm (~> 0.1)
wdm (~> 0.1.0)
BUNDLED WITH
1.16.3
1.17.3
require 'extensions/breadcrumbs'
require 'lib/homepage'
require 'lib/mermaid'
require "thwait"
# Activate and configure extensions
# https://middlemanapp.com/advanced/configuration/#configuring-extensions
......@@ -36,27 +39,17 @@ page '/*.xml', layout: false
page '/*.json', layout: false
page '/*.txt', layout: false
# Proxy comparison PDF pages
# Used for old pages, can delete once we 301 redirect old content: https://gitlab.com/gitlab-com/www-gitlab-com/issues/2543
data.features.comparisons.each do |key, comparison|
file_name = key.dup.tr('_', '-')
proxy "/comparison/pdfs/#{file_name}.html", '/comparison/pdfs/template.html', locals: {
comparison_block: comparison,
key_one: comparison.product_one.to_sym,
key_two: comparison.product_two.to_sym
}, ignore: true
end
# Proxy Comparison html and PDF pages
data.features.competitors.each_key do |competitor|
next if competitor[0..6] == 'gitlab_'
file_name = "#{competitor}-vs-gitlab".tr('_', '-')
proxy "/comparison/#{file_name}.html", "/templates/comparison.html", locals: {
key_one: competitor,
data.features.devops_tools.each_key do |devops_tool|
next if devops_tool[0..6] == 'gitlab_'
file_name = "#{devops_tool}-vs-gitlab".tr('_', '-')
proxy "/devops-tools/#{file_name}.html", "/templates/comparison.html", locals: {
key_one: devops_tool,
key_two: 'gitlab_ultimate'
}
proxy "/comparison/pdfs/#{file_name}.html", '/comparison/pdfs/template.html', locals: {
key_one: competitor,
proxy "/devops-tools/pdfs/#{file_name}.html", '/devops-tools/pdfs/template.html', locals: {
key_one: devops_tool,
key_two: 'gitlab_ultimate'
}, ignore: true
end
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
require 'yaml'
module Gitlab
module Homepage
class Category
attr_reader :key
def initialize(key, data)
@key = key
@data = data
end
# rubocop:disable Style/MethodMissingSuper
# rubocop:disable Style/MissingRespondToMissing
##
# Middeman Data File objects compatibility
#
def method_missing(name, *args, &block)
@data[name.to_s]
end
# rubocop:enable Style/MethodMissingSuper
# rubocop:enable Style/MissingRespondToMissing
def features?
!features.empty?
end
def features
@features ||= Feature.for_category(self)
end
def missing_features?
!missing_features.empty?
end
def missing_features
@missing_features ||= features.dup.keep_if(&:missing?)
end
def self.all!
@categories ||= YAML.load_file('data/categories.yml')
@categories.map do |key, data|
new(key, data)
end
end
def self.for_stage(stage)
all!.dup.keep_if { |category| category.stage == stage.key }
end
end
end
end
# frozen_string_literal: true
require 'gitlab'
require 'date'
require_relative 'changelog/merge_request'
require_relative 'changelog/file'
require_relative 'changelog/rss'
Gitlab.configure do |config|
config.endpoint = 'https://gitlab.com/api/v4'
config.private_token = ENV.fetch('PRIVATE_TOKEN', nil)