Coder Social home page Coder Social logo

docs.ruby-lang.org's Introduction

docs.ruby-lang.org

WARNING

  • This repository is inconsistent with production.
  • Use only bundle exec cap production deploy. Do not use ansible-playbook.

Platform Environment

  • We use capistrano for deployments.
  • Currently hosted on AWS EC2 Tokyo region
    • All applications run as rurema user.
  • Periodic tasks run in systemd timer (systemctl list-timers)

Files and Directories

  • rurema-search: /var/rubydoc
  • docs.ruby-lang.org: /var/www/docs.ruby-lang.org
  • nginx configuration: /etc/nginx/sites-available/docs.ruby-lang.org

Files need to backup

  • old statically generated contents (old versions need to copy from old server): /var/www/docs.ruby-lang.org/shared/public/{en,ja}/*
  • Fastly API Key: /home/rurema/.docs-fastly
  • Slack webhook URL: /etc/systemd/system/notify-to-slack.env
  • Mackerel API Key and plugin configurations: /etc/mackerel-agent/mackerel-agent.conf

Related repos

Production Environment

Capstrano

cap production deploy

/etc/nginx/sites-available/docs.ruby-lang.org

Manual sync with conf/docs.ruby-lang.org. Because ansible playbooks are outdated.

/etc/mackerel-agent/mackerel-agent.conf

Install mackerel-check-plugins too.

Add/Modified:

[filesystems]
ignore = "/dev/loop*"

[plugin.checks.fileage-bc-setup-all]
command = ["check-file-age", "-i", "-w", "90000", "-c", "172800", "-f", "/run/docs.ruby-lang.org/bc-setup-all.updated"]
[plugin.checks.fileage-bc-static-all]
command = ["check-file-age", "-i", "-w", "90000", "-c", "172800", "-f", "/run/docs.ruby-lang.org/bc-static-all.updated"]
[plugin.checks.fileage-rdoc-static-all]
command = ["check-file-age", "-i", "-w", "90000", "-c", "172800", "-f", "/run/docs.ruby-lang.org/rdoc-static-all.updated"]
[plugin.checks.fileage-update-rurema-index]
command = ["check-file-age", "-i", "-w", "90000", "-c", "172800", "-f", "/run/docs.ruby-lang.org/update-rurema-index.updated"]

docs.ruby-lang.org's People

Contributors

apatniv avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar hsbt avatar jeremyevans avatar kou avatar nissyi-gh avatar nobu avatar nurse avatar okkez avatar sho-h avatar sorah avatar unak avatar yhara avatar znz avatar zzak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docs.ruby-lang.org's Issues

class Symbol のドキュメントが別のclassのものになっている

ruby/rdoc の不備なのか、 docs.ruby-lang.org の不備なのかわからなかったので、とりあえずこちらに報告します。

問題点

class Symbol のドキュメントが別の class のものになっており、正しいドキュメントが表示されない。

https://docs.ruby-lang.org/en/2.4.0/Symbol.html → Bignumのドキュメント
https://docs.ruby-lang.org/en/trunk/Symbol.html → Integerのドキュメント

他の症状

検索時に2つ候補が出てくる。どちらをクリックしても、間違ったドキュメントの文面が出てくる
2017-09-25 13 24 59

原因?

class Symbol のドキュメントは symbol.c ではなく string.c に記述されている。

https://github.com/ruby/ruby/blob/5d12e826475b859649f113638066b42f21b7784f/string.c#L9962

他のドキュメントサイト

ruby-docでは正しいドキュメントが表示できている
http://ruby-doc.org/core-2.4.2/Symbol.html

手元の Dash for macOS では正しいドキュメントが表示できている

group method index by visibility

currently the method index (methods column on the left on a class/module page) is grouped by class vs instance, it would also be useful if it were grouped by visibility

最近のbitclustの更新が反映されていなさそう

マージされたPRの変更がぱっとみ反映されてなさそうに見えます。

たとえばこちらではmetaタグでviewportを追加したのですが
rurema/bitclust#76

HTMLにはviewportが含まれておらず

$ curl -s https://docs.ruby-lang.org/ja/latest/doc/index.html | grep viewport

こちらではタイトルの末尾にリファレンスマニュアルと明記しましたが

rurema/bitclust#78

付け加えられていないように見えます

$ curl -s https://docs.ruby-lang.org/ja/latest/doc/index.html | grep title
  <title>オブジェクト指向スクリプト言語 Ruby リファレンスマニュアル (Ruby 2.6.0)</title>

Documentation needs backporting

docs.ruby-lang.org renders docs only for major versions: there is docs for 2.7.0, but not for 2.7.1 -- which implies that https://docs.ruby-lang.org/en/2.7.0/ actually contains "Generic 2.7 docs". At the same time, documentation is frequently fixed after the release. This way, documentation that is relevant for version x.y.*, but was NOT there at x.y.0 will NEVER be rendered. Some examples:

  1. What's the pattern matching syntax for 2.7? The PM docs were written after the release, so they are accessible by https://docs.ruby-lang.org/en/3.0.0/doc/syntax/pattern_matching_rdoc.html (it is 3.0's PM!), or https://docs.ruby-lang.org/en/master/doc/syntax/pattern_matching_rdoc.html (was 2.7's before 3.0's release, now it is 3.0's too).
  2. My method definition docs update was merged AFTER the 3.0 release. So endless methods and ... argument forwarding are documented here: https://docs.ruby-lang.org/en/master/doc/syntax/methods_rdoc.html, but not here: https://docs.ruby-lang.org/en/3.0.0/doc/syntax/methods_rdoc.html (implying they aren't in 3.0 at all)

I believe that something should be done about it, probably at least on releasing 3.0.1 its docs should be merged into 3.0.0 URL, or maybe rendered separately at https://docs.ruby-lang.org/en/3.0.1. Or, maybe, the docs should actually be backported into 3.0.0? Because if the Ruby installed with the local docs, 3.0.0 would forever lack them.

navigation broken

It has been a while (since the naming convention was changed I think), just follow these steps:

go to http://www.ruby-doc.com/ and then:

  • click on "Core" link at the top => 404
  • click on "2.2.0 core" => 404
    (this only fails for the latest release, the others work fine)

The issue is that it tries to redirect to "/core-2.0" where the correct path is "/core-2.2.0"

Change of documentation paths in 2022

I can't identify the exact change that caused this, but

  • for many years, and as recent as of Jan 26, 2022, all files in doc/ folder of the Ruby repository produced paths looking like doc/syntax/methods_rdoc.html
  • as of now, they became just 3.1/syntax/methods_rdoc.html (no doc/ prefix)

I am afraid that might've broken a lot of links on the Internet. I noticed because all the links to generic language docs in my Ruby Changelog became 404.

I wonder can this change be reverted, or, alternatively, can redirects be introduced between the old and new scheme?..

en/1.8.7、en/1.9.3が403になる

https://docs.ruby-lang.org/en/ からは 1.8.7と1.9.3がリンクされてますが、クリックすると403になります。

system/rdoc-static-allが以下だからかもしれません。public以下にsymlinkはあるのですが、指してる先にファイルがなかったです。再生成してVERSIONSは今のままにするか、リンクを消すかした方がいいかもしれません。(前者?

VERSIONS = %w[
  2.2.0
  2.3.0
  2.4.0
  2.5.0
  trunk
]

docs.ruby-lang.org上のるりまサーチが重い

docs.ruby-lang.orgの方のるりまサーチが重いみたいです。

以下は確認しましたが原因はわかっていません。

  • RubyのプロセスがCPUを食ってる
  • nginxのerror.log的には気になるものはない
  • access.logが4.5Gあってrotateされてないのは気になる

最後のものについては以下を確認しましたが、今日重くなる理由には該当しにくい気もします。

  • logrotateのpostrotateに失敗している(おそらくnginx.pidがないため)
    • nginx自体は生きている
    • access.log-<最後の日付>に追記が続いているのでシグナルをその日以来受け取らずにずっと動いている?
    • logrotate.d/nginxはnotifemptyなので、それ以降はrotateもされていない
    • crondは動いおり、cronのログも残っていたのでnginxだけの問題に見える

原因としてはアクセスが多くて単に重いか上記が理由でじわじわ重くなっていたかくらいしか思いつきませんでした。どちらも判断材料がないですが...

一度サービスを再起動してみるのがいいかもしれません。

るりまサーチでja/2.8.0が出てくる

https では開発版のドキュメントも ja/master (だけ) でみえるように追加したのですが、るりまサーチのインデックス対象に 2.8.0 も入ってしまっていて、存在しない URL が検索結果として出てしまっているようです。

ja以下にtrunkディレクトリができる

deploy:symlink:linked_dirsのログを見ていたらja以下でもtrunkができてしまっているようです。

$ bundle exec cap production deploy
...
00:05 deploy:symlink:linked_dirs
    ...
      20 ln -s /var/www/docs.ruby-lang.org/shared/public/en/trunk /var/www/docs.ruby…
    ✔ 20 [email protected] 0.121s
      21 ln -s /var/www/docs.ruby-lang.org/shared/public/ja/trunk /var/www/docs.ruby…
    ✔ 21 [email protected] 0.124s
...
$ ls -l /var/www/docs.ruby-lang.org/current/public/ja/
...
lrwxrwxrwx 1 rurema rurema   51 Jan  1 14:31 latest -> /var/www/docs.ruby-lang.org/shared/public/ja/latest
lrwxrwxrwx 1 rurema rurema   50 Jan  1 14:31 trunk -> /var/www/docs.ruby-lang.org/shared/public/ja/trunk

$ ls -l /var/www/docs.ruby-lang.org/shared/public/ja/
...
lrwxrwxrwx 1 rurema rurema    5 Jan  1 14:37 latest -> 2.5.0
drwxr-xr-x 2 rurema rurema 4096 Aug 15 11:09 trunk

外からアクセスできないと思われるため、実害はなさそうです。

Guides project

We want to provide developer guides that are current and easy to contribute to.

They should separate from ruby source, and version specific api reference documentation.

Our goal is to build a jekyll site in this repository under ./guides that will house all of the important developer related documentation for CRuby.

How do we contribute docs changes?

Hi. I was running some code samples from the docs today and noticed that the output I got didn't match what the docs showed (version 3.1.2). I was going to do a quick PR to correct them but I can't find the docs contents anywhere in this repo. The README for the repo doesn't mention how to contribute to docs, and skimming over the page https://www.ruby-lang.org/en/documentation/ I also can't find any instructions there for how to contribute.

Thanks!

新VMのタイムゾーンがUTC

新VMのタイムゾーンがUTCになっててcronが指定した時間から9時間ずれて実行されてるようでした。

$ date
Tue Aug 29 13:24:22 UTC 2017 # 22:24に実行

るりまサーチのAPIの返すURLがおかしい?

るりまサーチのAPIを試していたのですが、返してくるURLがおかしいようです。

次のようにcurlとjqをつかってURLを取り出してみると、https://docs.ruby-lang.org/ja/search/の後に、本来の検索結果のURLがついてきているようにみえます。また、検索結果のURLのスキーマがhttpsではなくhttpになっているので、httpsの方がより良さそうです。

$ curl -s 'https://docs.ruby-lang.org/ja/search/api:v1/query:open/' | jq '.entries[0].documents[0].url' 
"https://docs.ruby-lang.org/ja/search/http://docs.ruby-lang.org/ja/2.3.0/library/open=2duri.html"

期待するURL: https://docs.ruby-lang.org/ja/2.3.0/library/open=2duri.html
実際のURL: https://docs.ruby-lang.org/ja/search/http://docs.ruby-lang.org/ja/2.3.0/library/open=2duri.html

From clear-code/rurema-search#29

上のIssueをclear-code/rurema-searchに開いたところ、アプリケーションコードよりもデプロイの仕方に原因がありそうとコメントをもらったのでこちらにIssueをオープンします。


上のIssueを作った後にコードを眺めていたところ、このリポジトリの次のコードの当たりでオプションを設定しているようでした。

load_searcher_option.call(:document, "document.yaml")

ここで設定したbase_urlオプションが、APIが返すURLに関わってくるので、この設定が原因で意図しない表示になっていると思います。

https://github.com/clear-code/rurema-search/blob/7d5858ab4ab0d9c9eb5e91e14c54bd67e081c73a/lib/rurema_search/groonga_searcher.rb#L334-L341

ja の Dir クラスに mktmpdir メソッドの説明文がない

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.