Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 1, 2017. It is now read-only.

Sync changes from upstream repository#937

Merged
hubot merged 1 commit intomasterfromupdate-1450762505
Dec 22, 2015
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions.gitignore
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,3 +18,4 @@ tmp
.bundle
crash.log
npm-debug.log
build.txt
6 changes: 5 additions & 1 deletionGemfile
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,5 +26,9 @@ group :staging do
end

group :test do
gem 'html-proofer', '~> 2.5'
gem 'capybara', '2.4.4'
gem 'html-proofer', '~> 2.6'
gem 'rspec', '3.1'
gem 'selenium-webdriver', '2.45.0'
gem 'jsonlint', '0.1.0'
end
48 changes: 46 additions & 2 deletionsGemfile.lock
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,10 +10,19 @@ GEM
addressable (2.3.8)
awesome_print (1.6.1)
builder (3.2.2)
capybara (2.4.4)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
childprocess (0.5.8)
ffi (~> 1.0, >= 1.0.11)
colorator (0.1)
colored (1.2)
cri (2.7.0)
colored (~> 1.2)
diff-lcs (1.2.5)
dotenv (2.0.2)
ethon (0.8.0)
ffi (>= 1.3.0)
Expand All@@ -32,7 +41,8 @@ GEM
activesupport
html-pipeline (>= 1.11)
rouge (~> 1.8)
html-proofer (2.5.2)
html-proofer (2.6.1)
activesupport (~> 4.2)
addressable (~> 2.3)
colored (~> 1.2)
mercenary (~> 0.3.2)
Expand DownExpand Up@@ -66,14 +76,20 @@ GEM
jekyll-watch (1.3.0)
listen (~> 3.0)
json (1.8.3)
jsonlint (0.1.0)
oj (~> 2)
kramdown (1.9.0)
liquid (3.0.6)
listen (3.0.5)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
mercenary (0.3.5)
mime-types (3.0)
mime-types-data (~> 3.2015)
mime-types-data (3.2015.1120)
mini_portile2 (2.0.0)
minitest (5.8.3)
multi_json (1.11.2)
multipart-post (2.0.0)
nanoc (4.0.2)
cri (~> 2.3)
Expand All@@ -88,6 +104,7 @@ GEM
mini_portile2 (~> 2.0.0.rc2)
octokit (4.2.0)
sawyer (~> 0.6.0, >= 0.5.3)
oj (2.14.1)
page-toc-filter (0.0.1)
html-pipeline (~> 2.0)
nokogiri (~> 1.6.4)
Expand All@@ -96,16 +113,36 @@ GEM
rack-protection (1.5.3)
rack
rack-ssl-enforcer (0.2.9)
rack-test (0.6.3)
rack (>= 1.0)
rake (10.3.2)
rb-fsevent (0.9.6)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
rouge (1.10.1)
rspec (3.1.0)
rspec-core (~> 3.1.0)
rspec-expectations (~> 3.1.0)
rspec-mocks (~> 3.1.0)
rspec-core (3.1.7)
rspec-support (~> 3.1.0)
rspec-expectations (3.1.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.1.0)
rspec-mocks (3.1.3)
rspec-support (~> 3.1.0)
rspec-support (3.1.2)
rubyzip (1.1.7)
safe_yaml (1.0.4)
sass (3.4.19)
sawyer (0.6.0)
addressable (~> 2.3.5)
faraday (~> 0.8, < 0.10)
selenium-webdriver (2.45.0)
childprocess (~> 0.5)
multi_json (~> 1.0)
rubyzip (~> 1.0)
websocket (~> 1.0)
sinatra (1.4.6)
rack (~> 1.4)
rack-protection (~> 1.4)
Expand All@@ -127,6 +164,9 @@ GEM
activesupport (> 3.0)
octokit (> 2.1.0)
warden (> 1.0)
websocket (1.2.2)
xpath (2.0.0)
nokogiri (~> 1.3)
yell (2.0.5)

PLATFORMS
Expand All@@ -135,18 +175,22 @@ PLATFORMS
DEPENDENCIES
awesome_print (= 1.6.1)
builder (~> 3.2)
capybara (= 2.4.4)
extended-markdown-filter (~> 0.4)
gemoji (= 2.1.0)
github-markdown (= 0.6.9)
html-pipeline-rouge_filter (~> 1.0)
html-proofer (~> 2.5)
html-proofer (~> 2.6)
jekyll-auth (~> 2.0)
jsonlint (= 0.1.0)
nanoc (~> 4.0)
nanoc-conref-fs (~> 0.5)
nanoc-html-pipeline (= 0.3.3)
nokogiri (~> 1.6.0)
page-toc-filter (~> 0.0.1)
rake (= 10.3.2)
rspec (= 3.1)
selenium-webdriver (= 2.45.0)

BUNDLED WITH
1.10.6
12 changes: 11 additions & 1 deletionRakefile
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,7 +21,17 @@ task :build do
end

desc "Test the output"
task :test => [:remove_tmp_dir, :remove_output_dir, :build, :run_proofer]
task :test => [:remove_tmp_dir, :remove_output_dir, :build] do
Rake::Task['spec'].invoke
Rake::Task['run_proofer'].invoke
end

desc "Run Rspec"
task :spec do
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:rspec)
Rake::Task['rspec'].invoke
end

desc "Run the HTML-Proofer"
task :run_proofer do
Expand Down
1 change: 1 addition & 0 deletionscontent/index.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
---
title: GitHub Developer
layout: overview
hide_from_search: true
---

<div class="wrapper feature">
Expand Down
4 changes: 3 additions & 1 deletioncontent/search/search-index.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
[
<% @items.select { |item| !item.attributes[:hide_from_search] }.each do |item| %>
<% next if item[:filename].nil? || !item[:filename].end_with?('.md') %>
<% @path = item[:filename].split('/')[1..-1].join('/')[0..-4] %>
<% @path.chomp!('/index') if @path.end_with?('/index') %>
{
"title": "<%= clean_for_json(item[:title]) %>",
<%# Split off the directory name, join, then remove the '.md' extension %>
"url": "/<%=item[:filename].split('/')[1..-1].join('/')[0..-4] %>/",
"url": "/<%=@path %>/",
"body": "<%= clean_for_json(item.compiled_content) %>"
},
<% end %>
Expand Down
8 changes: 1 addition & 7 deletionsscript/cibuild
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,10 +34,4 @@ echo "NPM version: ${NPM_VERSION}"
echo "PATH: ${PATH}"
echo ""

# bootstrap gem environment changes
cd "$RACK_ROOT"
echo 'Bootstrapping gems...'
script/bootstrap

echo "==> Running tests…"
bundle exec rake test
script/test
24 changes: 24 additions & 0 deletionsscript/test
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
#!/bin/sh
# Usage: script/test
# Run test suite
#

set -e

cd "$(dirname "$0")/.."

[ -z "$DEBUG" ] || set -x

export RACK_ROOT=$(cd "$(dirname $0)"/.. && pwd)

export RAILS_ENV="test" RACK_ENV="test"

script/bootstrap

echo "===> Running tests..."

if [ -n "$JANKY_ID" ]; then
xvfb-run -a bundle exec rake test
else
bundle exec rake test
fi
21 changes: 21 additions & 0 deletionsspec/README.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
### What's in the *spec* folder?

This folder contains (almost) our entire test suite. We split these tests into different subfolders in this directory.

In addition, we use [HTML-Proofer](https://github.com/gjtorikian/html-proofer) to validate our built site. More on this below.

The tests in this directory include:

* The *content* folder contains tests which are run over our Markdown and YAML files before they are built. These tests include:
* Ensuring that reusables are written correctly.
* Ensuring that there are no Liquid errors.
* Ensuring that there are no search errors.
* The *features* folder contains tests that deal with how the site functions. These tests include:
* Whether the search links are valid.
* Whether the sidebar is working.
* Whether redirects are working.

There are two more types of tests that are controlled by HTML-Proofer:

* HTML-Proofer validates that our *internal* content is working. That means that internal links are working, our images have alt tags, etc.
* HTML-Proofer also validates our *external* content. That means URLs to external websites, external images, etc.
30 changes: 30 additions & 0 deletionsspec/content/validity_spec.rb
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
require 'spec_helper'

describe 'Validity' do
it 'has no Liquid errors' do
failed_files = []
Dir.glob('output/**/*.html').each do |html_path|
html = File.read(html_path)
failed_files.push(html_path) if html =~ /Liquid error/
end
unless failed_files.empty?
fail "Found files with broken Liquid syntax!\n\nThe following files are broken:\n #{failed_files.join("\n")}"
end
end

it 'has no unresolved conrefs' do
failed_files = []
Dir.glob('output/**/*.html').each do |html_path|
html = File.read(html_path)
failed_files.push(html_path) if html =~ /{{ site.data/
end
unless failed_files.empty?
fail "Found #{failed_files.length} files with unresolved conrefs! These are conrefs that still say `{{ site.data` in the output.\n\nThe following files are not resolving: #{failed_files.join("\n")}"
end
end

it 'has a working search' do
output = `jsonlint output/search/search-index.json`
fail output unless output.empty?
end
end
10 changes: 10 additions & 0 deletionsspec/features/navigation_spec.rb
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
require 'spec_helper'

describe 'Navigation', js: true do
it 'expands the sidebar properly' do
visit "/v3/misc/"
expect(page).to have_css('.js-current')
expect(page.first(:css, '.js-current').text).to match('Miscellaneous')
end

end
17 changes: 17 additions & 0 deletionsspec/features/redirects_spec.rb
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
require 'spec_helper'

describe 'Page Redirects' do
context 'without javascript' do
it 'shows the redirect page' do
visit '/changes/2012-9-5-watcher-api/'
expect(page).to have_text('Click here if you are not redirected.')
end
end

context 'with javascript', js: true do
it 'understands a normal redirect' do
visit '/changes/2012-9-5-watcher-api/'
expect(page).to have_text('What used to be known as "Watching" is now "Starring"')
end
end
end
15 changes: 15 additions & 0 deletionsspec/features/search_spec.rb
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
require 'spec_helper'
require 'json'

describe 'Search JSON' do
it 'has valid search URLs' do
Dir.glob('output/search/search-index.json').each do |search_json_path|
json = JSON.parse(File.read(search_json_path))
urls = json.map { |e| "output#{e['url']}/index.html" }
missing_files = urls.select { |u| !File.exist?(u) }
unless missing_files.empty?
fail "Found links in #{search_json_path} search to articles that don't exist. That means that the search is potentially broken!\n\nThe following files couldn't be found: #{missing_files.join("\n")}"
end
end
end
end
Loading

[8]ページ先頭

©2009-2025 Movatter.jp