Skip to content

Commit

Permalink
Change path of translations in generate/test scripts, output/ -> outp…
Browse files Browse the repository at this point in the history
…ut/ja, source/ -> source/ja
  • Loading branch information
hanachin committed May 12, 2015
1 parent a8d0176 commit 89ed8e7
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions guides/allocate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 ' '
Expand Down
7 changes: 3 additions & 4 deletions guides/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

4 changes: 2 additions & 2 deletions guides/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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__))

0 comments on commit 89ed8e7

Please sign in to comment.