raf2html 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/History.rdoc +3 -0
- data/VERSION +1 -1
- data/bin/raf2html +26 -4
- data/lib/raf2html.rb +1 -1
- data/raf2html.gemspec +1 -1
- data/raf2html.yaml.sample +6 -0
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39c9f571a8f3ae82a01a027fd7f5968fdf4fe429
|
4
|
+
data.tar.gz: 117d3f6e982a75a1c8c2e8b2f251625b400e86e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a59ffb65027fb5dc0d39aa4e5e7826b93dbeacf293ceede85cf872fcf55402c0abbc4de4ae058f5a2c0a120f192d8bcb66f95989fe3d4556f6b7d09258c7dc68
|
7
|
+
data.tar.gz: b8f95eefb5697942a71703b2146e8c7a3c5baea185355ea0a4e911dd7e0a5eab1fd4597c02eab08f86b35fa3d499289288c871e3f80ce9629c1c24af2e5e0fda
|
data/Gemfile.lock
CHANGED
data/History.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.6
|
data/bin/raf2html
CHANGED
@@ -3,15 +3,34 @@
|
|
3
3
|
# Copyright (C) garin <garin54@gmail.com> 2011-2013
|
4
4
|
# See the included file COPYING for details.
|
5
5
|
$:.unshift File.join(File.dirname(__FILE__), "../lib")
|
6
|
+
require "yaml"
|
6
7
|
require "optparse"
|
7
8
|
require "raf2html"
|
8
9
|
|
10
|
+
# 設定ファイル
|
11
|
+
CONFIG_FILE="~/.raf2html.yaml"
|
12
|
+
config_file_path = File.expand_path(CONFIG_FILE)
|
13
|
+
|
14
|
+
# デフォルトの設定値
|
15
|
+
options = {:css => nil, :language => 'ja', :index => true, :quiet => false}
|
16
|
+
|
17
|
+
# 設定ファイルの読み込み
|
18
|
+
if File.exist?(config_file_path)
|
19
|
+
config = YAML.load_file( config_file_path )
|
20
|
+
if config
|
21
|
+
options.each do |key,val|
|
22
|
+
options[key.to_sym] = config[key.to_s] unless config[key.to_s].nil?
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
# 使い方
|
9
28
|
def usage(opt)
|
10
29
|
puts opt.help
|
11
30
|
exit 0
|
12
31
|
end
|
13
32
|
|
14
|
-
|
33
|
+
# コマンドラインオプション
|
15
34
|
opt = OptionParser.new do |opt|
|
16
35
|
opt.banner = "Usage: raf2html [options] file"
|
17
36
|
opt.version = Raf::Raf2Html::VERSION
|
@@ -24,6 +43,9 @@ opt = OptionParser.new do |opt|
|
|
24
43
|
end
|
25
44
|
opt.parse!(ARGV)
|
26
45
|
usage(opt) unless ARGV[0]
|
27
|
-
|
28
|
-
|
29
|
-
|
46
|
+
|
47
|
+
if __FILE__ == $0
|
48
|
+
src = File.open(ARGV[0],"r").readlines
|
49
|
+
raf = Raf::Raf2Html.new(src, options)
|
50
|
+
puts raf.to_html
|
51
|
+
end
|
data/lib/raf2html.rb
CHANGED
@@ -13,7 +13,7 @@ module Raf
|
|
13
13
|
@debug = true
|
14
14
|
|
15
15
|
# options
|
16
|
-
@css = File.open(options[:css]).readlines.to_s unless options[:css].nil?
|
16
|
+
@css = File.open(File.expand_path(options[:css])).readlines.to_s unless options[:css].nil?
|
17
17
|
@language = options[:language]
|
18
18
|
@index = options[:index]
|
19
19
|
@metadata = options[:metadata]
|
data/raf2html.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: raf2html
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- garin
|
@@ -42,16 +42,16 @@ dependencies:
|
|
42
42
|
name: raf-parser
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - '>='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.2.
|
47
|
+
version: 0.2.1
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.2.
|
54
|
+
version: 0.2.1
|
55
55
|
description: raf is simple document format
|
56
56
|
email:
|
57
57
|
- garin54@gmail.com
|
@@ -75,6 +75,7 @@ files:
|
|
75
75
|
- lib/raf2html.rb
|
76
76
|
- lib/raf2html_element.rb
|
77
77
|
- raf2html.gemspec
|
78
|
+
- raf2html.yaml.sample
|
78
79
|
homepage: ''
|
79
80
|
licenses:
|
80
81
|
- GPLv3
|