From 89ed8e79a50d7839e82079cc250ed50735d42819 Mon Sep 17 00:00:00 2001 From: Seiei Miyagi Date: Mon, 11 May 2015 16:56:42 +0900 Subject: [PATCH] Change path of translations in generate/test scripts, output/ -> output/ja, source/ -> source/ja --- _config.yml | 4 ++-- guides/allocate.rb | 4 ++-- guides/main.sh | 7 +++---- guides/test.sh | 4 ++-- spec/spec_helper.rb | 2 +- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/_config.yml b/_config.yml index 5c103191c75..5be9ebb58cf 100644 --- a/_config.yml +++ b/_config.yml @@ -6,8 +6,8 @@ description: > # this means to ignore newlines until "baseurl:" baseurl: "" # the subpath of your site, e.g. /blog/ url: "http://railsguides.jp" # the base hostname & protocol for your site twitter_username: yasulab -github_username: yasulab -source: ./guides/output +github_username: yasulab +source: ./guides/output/ja destination: ./_site # Build settings diff --git a/guides/allocate.rb b/guides/allocate.rb index 75ce28a247f..984faf9e960 100755 --- a/guides/allocate.rb +++ b/guides/allocate.rb @@ -15,13 +15,13 @@ new_name = filename.gsub(".txt", "").gsub(/\.(erb|yaml)\.md/, "#{$1}") puts "Rename: #{filename}\t->\t#{new_name}" FileUtils.mv(filename, new_name) unless filename == new_name - FileUtils.cp(new_name, "./source/") + FileUtils.cp(new_name, "./source/ja/") end # Replace special characters with white spaces in *.md files # to correct some of forcedly squeezed white spaces by GTT, # which causes layout break when generating HTML files. -Dir.glob("./source/**.md") do |filename| +Dir.glob("./source/ja/**.md") do |filename| text = File.read(filename) revised = text.gsub(" ", " ").gsub(/\[W(\d)\]/) {' ' * $1.to_i} revised.gsub!(/\[BR\]/, "\n") # GTT replaces '\n' with ' ' diff --git a/guides/main.sh b/guides/main.sh index da022054268..e2b67a9fbe0 100755 --- a/guides/main.sh +++ b/guides/main.sh @@ -3,13 +3,12 @@ # Update HTMLs using 'archive.zip' downloaded by GTT ruby allocate.rb -rm -rf output -bundle exec rake guides:generate:html -cp ./source/favicon.ico ./output/ +rm -rf output/ja +bundle exec rake guides:generate:html GUIDES_LANGUAGE=ja +cp ./source/ja/favicon.ico ./output/ja # Then, manually type these commands: # $ git add . # $ git commit -m "Publish foo bar" # $ git push origin japanese # $ git push heroku japanese:master - diff --git a/guides/test.sh b/guides/test.sh index 708b1575ea7..274a3869908 100755 --- a/guides/test.sh +++ b/guides/test.sh @@ -2,8 +2,8 @@ # Test Markdown files using 'check_typo.rb' -for article in `ls source | grep md` +for article in `ls source/ja | grep md` do echo "Testing ${article}" - ruby check_typo.rb "./source/${article}" + ruby check_typo.rb "./source/ja/${article}" done diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 28feee250f1..2e3f15c1dee 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -11,4 +11,4 @@ config.color = true end -Capybara.app = Rack::File.new(File.expand_path('../../guides/output', __FILE__)) +Capybara.app = Rack::File.new(File.expand_path('../../guides/output/ja', __FILE__))