Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
Tatsuya Miyamae committed Jan 21, 2012
1 parent 8834359 commit 90fc23a
Show file tree
Hide file tree
Showing 6 changed files with 186 additions and 16 deletions.
16 changes: 11 additions & 5 deletions 1.9.2/css/application.css
Expand Up @@ -10,7 +10,7 @@ html, body {
}

.loading {
background: url(images/loading.gif) no-repeat center;
background: url(../images/loading.gif) no-repeat center;
height: 100px;
}

Expand All @@ -24,7 +24,7 @@ html, body {
}

#navi ul {
margin-top: 35px;
margin-top: 37px;
padding: 0;
font-size: 12px;
list-style: none;
Expand Down Expand Up @@ -61,7 +61,7 @@ html, body {
color: #000;
}

#navi li .name {
#navi li .sub {
display: block;
height: 1.5em;
font-size: 10px;
Expand All @@ -83,18 +83,24 @@ html, body {
}

#search input {
width: 250px;
width: 255px;
border: 1px solid #ccc;
height: 18px;
padding: 0 5px;
margin: 0;
margin-bottom: 4px;
border-radius: 10px;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
}

#search a:hover {
background: none;
background: #ccc;
}

#search img {
vertical-align: middle;
padding-bottom: 2px;
}

#content {
Expand Down
2 changes: 1 addition & 1 deletion 1.9.2/index.html
Expand Up @@ -17,7 +17,7 @@
<div id="navi">
<div id="search">
<input id="search-box" type="text">
<a href="../"><img src="images/home.png"></a>
<a href="http://miyamae.github.com/rubydoc-ja/" title="トップページ"><img src="images/home.png" alt="Top"></a>
</div>
<ul><li class="loading"></li></ul>
</div>
Expand Down
4 changes: 2 additions & 2 deletions 1.9.2/js/application.js
Expand Up @@ -56,12 +56,12 @@ function initPage(elem) {
}

function itemIndex(param) {
var item = $('<li><a><span class="key"></span><span class="name"></span><span class="desc"></span></a></li>');
var item = $('<li><a><span class="key"></span><span class="sub"></span><span class="desc"></span></a></li>');
item.find('li').attr('id', 'idx' + param.id);
item.find('a').attr('href', param.path);
item.find('a').attr('title', '【' + param.key + '】' + param.desc);
item.find('.key').text(param.key);
item.find('.name').text(param.name);
item.find('.sub').text(param.sub);
item.find('.desc').text(param.desc);
return item;
}
Expand Down
2 changes: 1 addition & 1 deletion 1.9.2/json/index.json

Large diffs are not rendered by default.

161 changes: 161 additions & 0 deletions tools/default_index.yml
@@ -0,0 +1,161 @@
---
- :path: /doc/spec=2fcontrol.html?if
:key: if
:sub: 制御構造(条件分岐)
:desc: "条件式を評価した結果が真である時、then 以下の式を評価します。"
- :path: /doc/spec=2fcontrol.html?unless
:key: unless
:sub: 制御構造(条件分岐)
:desc: "unless は if と反対で、条件式が偽の時に then 以下の 式を評価します。"
- :path: /doc/spec=2fcontrol.html?case
:key: case
:sub: 制御構造(条件分岐)
:desc: "case は一つの式に対する一致判定による分岐を行います。"
- :path: /doc/spec=2fcontrol.html?while
:key: while
:sub: 制御構造(繰り返し)
:desc: "式を評価した値が真の間、本体を繰り返し実行します。"
- :path: /doc/spec=2fcontrol.html?until
:key: until
:sub: 制御構造(繰り返し)
:desc: "式を評価した値が真になるまで、本体を繰り返して実行します。"
- :path: /doc/spec=2fcontrol.html?for
:key: for
:sub: 制御構造(繰り返し)
:desc: "式を評価した結果のオブジェクトの各要素に対して本体を繰り返して実行します。"
- :path: /doc/spec=2fcontrol.html?break
:key: break
:sub: 制御構造(繰り返し)
:desc: "break はもっとも内側のループを脱出します。"
- :path: /doc/spec=2fcontrol.html?next
:key: next
:sub: 制御構造(繰り返し)
:desc: "nextはもっとも内側のループの次の繰り返しにジャンプします。 "
- :path: /doc/spec=2fcontrol.html?redo
:key: redo
:sub: 制御構造(繰り返し)
:desc: "ループ条件のチェックを行なわず、現在の繰り返しをやり直します。"
- :path: /doc/spec=2fcontrol.html?retry
:key: retry
:sub: 制御構造(繰り返し)
:desc: "retry は、ループ以外に後述の rescue 節でも使えます。"
- :path: /doc/spec=2fcontrol.html?raise
:key: raise
:sub: 制御構造(例外処理)
:desc: "例外を発生させます。"
- :path: /doc/spec=2fcontrol.html?begin
:key: begin
:sub: 制御構造(例外処理)
:desc: "本体の実行中に例外が発生した場合、rescue 節(複数指定できます)が 与えられていれば例外を捕捉できます。"
- :path: /doc/spec=2fcontrol.html?return
:key: return
:sub: 制御構造
:desc: "式の値を戻り値としてメソッドの実行を終了します。"
- :path: /doc/spec=2fcontrol.html?BEGIN
:key: BEGIN
:sub: 制御構造
:desc: "初期化ルーチンを登録します。"
- :path: /doc/spec=2fcontrol.html?END
:key: END
:sub: 制御構造
:desc: "「後始末」ルーチンを登録します。"
- :path: /doc/spec=2fvariables.html?pseudo
:key: self
:sub: 擬似変数
:desc: "現在のメソッドの実行主体"
- :path: /doc/spec=2fvariables.html?pseudo
:key: "nil"
:sub: 擬似変数
:desc: "NilClassクラスの唯一のインスタンス"
- :path: /doc/spec=2fvariables.html?pseudo
:key: "true"
:sub: 擬似変数
:desc: "TrueClassクラスの唯一のインスタンス。真の代表値"
- :path: /doc/spec=2fvariables.html?pseudo
:key: "false"
:sub: 擬似変数
:desc: "FalseClassクラスの唯一のインスタンス。nilとfalseは偽を表します。"
- :path: /doc/spec=2fvariables.html?pseudo
:key: __FILE__
:sub: 擬似変数
:desc: "現在のソースファイル名。フルパスとは限らないため、フルパスが必要な場合は File.expand_path(__FILE__) とする必要があります。"
- :path: /doc/spec=2fvariables.html?pseudo
:key: __LINE__
:sub: 擬似変数
:desc: "現在のソースファイル中の行番号"
- :path: /doc/spec=2fvariables.html?pseudo
:key: __ENCODING__
:sub: 擬似変数
:desc: "現在のソースファイルのスクリプトエンコーディング"
- :path: /doc/spec=2foperator.html?assign
:key: "="
:sub: 演算子式(代入)
:desc: "代入式は変数などに値を設定するために用いられます。"
- :path: /doc/spec=2foperator.html?and
:key: and
:sub: 演算子式
:desc: "まず、左辺を評価して、結果が真であった場合には右辺も評価します。"
- :path: /doc/spec=2foperator.html?and
:key: "&&"
:sub: 演算子式
:desc: "まず、左辺を評価して、結果が真であった場合には右辺も評価します。"
- :path: /doc/spec=2foperator.html?or
:key: or
:sub: 演算子式
:desc: "まず左辺を評価して、結果が偽であった場合には右辺も評価します。"
- :path: /doc/spec=2foperator.html?or
:key: "||"
:sub: 演算子式
:desc: "まず左辺を評価して、結果が偽であった場合には右辺も評価します。"
- :path: /doc/spec=2foperator.html?not
:key: not
:sub: 演算子式
:desc: "式の値が真である時偽を、偽である時真を返します。"
- :path: /doc/spec=2foperator.html?not
:key: "!"
:sub: 演算子式
:desc: "式の値が真である時偽を、偽である時真を返します。"
- :path: /doc/spec=2fcall.html?super
:key: super
:sub: メソッド呼び出し
:desc: "super は現在のメソッドがオーバーライドしているメソッドを呼び出します。"
- :path: /doc/spec=2fcall.html?yield
:key: yield
:sub: メソッド呼び出し
:desc: "自分で定義したブロック付きメソッドでブロックを呼び出すときに使います。"
- :path: /doc/spec=2fdef.html?class
:key: class
:sub: クラス定義
:desc: "クラスを定義します。"
- :path: /doc/spec=2fdef.html?module
:key: module
:sub: モジュール定義
:desc: "モジュールを定義します。"
- :path: /doc/spec=2fdef.html?method
:key: method
:sub: メソッド定義
:desc: "この定義のある場所にメソッドを定義します。"
- :path: /doc/spec=2fdef.html?limit
:key: public
:sub: 呼び出し制限
:desc: "public に設定されたメソッドは制限なしに呼び出せます。"
- :path: /doc/spec=2fdef.html?limit
:key: private
:sub: 呼び出し制限
:desc: "private に設定されたメソッドは関数形式でしか呼び出せません。"
- :path: /doc/spec=2fdef.html?limit
:key: protected
:sub: 呼び出し制限
:desc: "protected に設定されたメソッドは、そのメソッドを持つオブジェクト のメソッド定義式内でなければ呼び出せません。"
- :path: /doc/spec=2fdef.html?alias
:key: alias
:sub: 定義に関する操作
:desc: "メソッドあるいはグローバル変数に別名をつけます。"
- :path: /doc/spec=2fdef.html?undef
:key: undef
:sub: 定義に関する操作
:desc: "メソッドの定義を取り消します。"
- :path: /doc/spec=2fdef.html?defined
:key: defined
:sub: 定義に関する操作
:desc: "式が定義されていなければ、偽を返します。定義されていれば式の種別を表す文字列を返します。"
17 changes: 10 additions & 7 deletions tools/make_index.rb
Expand Up @@ -7,29 +7,32 @@
require 'find'
require 'cgi'
require 'json'
require 'yaml'

html_dir = '../1.9.2'
#html_dir = '../1.9.2/method'
#html_dir = '../1.9.2/library'
#html_dir = '../1.9.2/class'
#html_dir = '../1.9.2/doc'

id = 1
recs = []
items = []
items = YAML.load_file('default_index.yml')

Find.find(html_dir) do |file|

if FileTest.file?(file) && File.extname(file) == '.html'
html = File.read(file)
item = {:id=>id, :path=>file.gsub(/^\.\.\/1\.9\.2/, ''), :key=>''}
item = {:path=>file.gsub(/^\.\.\/1\.9\.2/, ''), :key=>''}
id += 1

# method
if html =~ %r{<dt class="method-heading"><code>(.*?)</code>}
item[:name] = CGI.unescapeHTML($1)
end
if html =~ %r{<title>(.*? method|module function|constant) (.*?)</title>}
if html =~ %r{<title>(.*? method|module function|constant|variable) (.*?)</title>}
item[:key] = CGI.unescapeHTML($2)
end
if html =~ %r{<dt class="method-heading"><code>(.*?)</code>}
item[:sub] = CGI.unescapeHTML($1)
end
if html =~ %r{<dd class="method-description">.*?<p>(.*?)</p>}m
item[:desc] = CGI.unescapeHTML($1.gsub(/<.*?>|"/, '').gsub(/\n/, ' '))
end
Expand All @@ -39,7 +42,7 @@
item[:key] = CGI.unescapeHTML($2)
end
if html =~ %r{<p>.*?クラスの継承リスト:.*?(&lt;.*?)</a>}m
item[:name] = CGI.unescapeHTML($1.gsub(/<.*?>|"/, ''))
item[:sub] = CGI.unescapeHTML($1.gsub(/<.*?>|"/, ''))
end
if html =~ %r{<h2>要約</h2>.*?<p>(.*?)</p>}m
item[:desc] = CGI.unescapeHTML($1.gsub(/<.*?>|"/, '').gsub(/\n/, ' '))
Expand Down

0 comments on commit 90fc23a

Please sign in to comment.