aozora4reader 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +25 -0
- data/Gemfile +6 -0
- data/Rakefile +6 -51
- data/aozora4reader.gemspec +19 -53
- data/bin/a4r +0 -0
- data/data/gaiji2.txt +1 -0
- data/lib/aozora4reader.rb +8 -0
- data/lib/aozora4reader/version.rb +3 -0
- data/test/helper.rb +14 -1
- metadata +47 -17
- data/VERSION +0 -1
data/.gitignore
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
|
19
|
+
.DS_Store
|
20
|
+
*~
|
21
|
+
\#*
|
22
|
+
.\#*
|
23
|
+
|
24
|
+
pdf
|
25
|
+
genpaku
|
data/Gemfile
ADDED
data/Rakefile
CHANGED
@@ -1,56 +1,11 @@
|
|
1
|
-
require
|
2
|
-
require 'rake'
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'jeweler'
|
6
|
-
Jeweler::Tasks.new do |gem|
|
7
|
-
gem.name = "aozora4reader"
|
8
|
-
gem.summary = %Q{Aozora Bunko converter for Sony Reader}
|
9
|
-
gem.description = %Q{Aozora Bunko converter for Sony Reader}
|
10
|
-
gem.email = "maki@rubycolor.org"
|
11
|
-
gem.homepage = "http://github.com/takahashim/aozora4reader"
|
12
|
-
gem.authors = ["takahashim"]
|
13
|
-
gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
|
14
|
-
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
15
|
-
gem.files.include << "data/gaiji.txt"
|
16
|
-
gem.files.include << "data/gaiji2.txt"
|
17
|
-
gem.files.include << "sty/aozora4reader.sty"
|
18
|
-
end
|
19
|
-
Jeweler::GemcutterTasks.new
|
20
|
-
rescue LoadError
|
21
|
-
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
22
|
-
end
|
1
|
+
require "bundler/gem_tasks"
|
23
2
|
|
24
3
|
require 'rake/testtask'
|
25
|
-
Rake::TestTask.new(:test) do |test|
|
26
|
-
test.libs << 'lib' << 'test'
|
27
|
-
test.pattern = 'test/**/test_*.rb'
|
28
|
-
test.verbose = true
|
29
|
-
end
|
30
4
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
test.libs << 'test'
|
35
|
-
test.pattern = 'test/**/test_*.rb'
|
36
|
-
test.verbose = true
|
37
|
-
end
|
38
|
-
rescue LoadError
|
39
|
-
task :rcov do
|
40
|
-
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
41
|
-
end
|
5
|
+
Rake::TestTask.new(:test) do |test|
|
6
|
+
test.libs << 'test'
|
7
|
+
test.test_files = FileList['test/test_*.rb']
|
42
8
|
end
|
43
9
|
|
44
|
-
|
45
|
-
|
46
|
-
task :default => :test
|
47
|
-
|
48
|
-
require 'rake/rdoctask'
|
49
|
-
Rake::RDocTask.new do |rdoc|
|
50
|
-
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
51
|
-
|
52
|
-
rdoc.rdoc_dir = 'rdoc'
|
53
|
-
rdoc.title = "aozora4reader #{version}"
|
54
|
-
rdoc.rdoc_files.include('README*')
|
55
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
56
|
-
end
|
10
|
+
desc "Run Tests"
|
11
|
+
task :default => :test
|
data/aozora4reader.gemspec
CHANGED
@@ -1,57 +1,23 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'aozora4reader/version'
|
5
5
|
|
6
|
-
Gem::Specification.new do |
|
7
|
-
|
8
|
-
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "aozora4reader"
|
8
|
+
spec.version = Aozora4reader::VERSION
|
9
|
+
spec.authors = ["takahashim"]
|
10
|
+
spec.email = ["maki@rubycolor.org"]
|
11
|
+
spec.description = %q{Aozora Bunko converter for Sony Reader}
|
12
|
+
spec.summary = %q{Aozora Bunko converter for Sony Reader}
|
13
|
+
spec.homepage = "http://github.com/takahashim/aozora4reader"
|
14
|
+
spec.license = "MIT"
|
9
15
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
s.email = %q{maki@rubycolor.org}
|
15
|
-
s.executables = [%q{a4r}]
|
16
|
-
s.extra_rdoc_files = [
|
17
|
-
"ChangeLog",
|
18
|
-
"LICENSE",
|
19
|
-
"README.rdoc"
|
20
|
-
]
|
21
|
-
s.files = [
|
22
|
-
".document",
|
23
|
-
"ChangeLog",
|
24
|
-
"LICENSE",
|
25
|
-
"README.rdoc",
|
26
|
-
"Rakefile",
|
27
|
-
"VERSION",
|
28
|
-
"aozora4reader.gemspec",
|
29
|
-
"bin/a4r",
|
30
|
-
"data/gaiji.txt",
|
31
|
-
"data/gaiji2.txt",
|
32
|
-
"lib/aozora4reader.rb",
|
33
|
-
"memo.txt",
|
34
|
-
"sty/aozora.sty",
|
35
|
-
"sty/aozora4reader.sty",
|
36
|
-
"sty/aozorakindle.sty",
|
37
|
-
"test/helper.rb",
|
38
|
-
"test/test_aozora4reader.rb"
|
39
|
-
]
|
40
|
-
s.homepage = %q{http://github.com/takahashim/aozora4reader}
|
41
|
-
s.require_paths = [%q{lib}]
|
42
|
-
s.rubygems_version = %q{1.8.6}
|
43
|
-
s.summary = %q{Aozora Bunko converter for Sony Reader}
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
44
20
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
49
|
-
s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
50
|
-
else
|
51
|
-
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
52
|
-
end
|
53
|
-
else
|
54
|
-
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
55
|
-
end
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
56
23
|
end
|
57
|
-
|
data/bin/a4r
CHANGED
File without changes
|
data/data/gaiji2.txt
CHANGED
data/lib/aozora4reader.rb
CHANGED
@@ -7,6 +7,7 @@
|
|
7
7
|
# see: http://a2k.aill.org/
|
8
8
|
|
9
9
|
require 'nkf'
|
10
|
+
require "aozora4reader/version"
|
10
11
|
|
11
12
|
class Aozora4Reader
|
12
13
|
|
@@ -31,6 +32,8 @@ class Aozora4Reader
|
|
31
32
|
# UTF-8で出力
|
32
33
|
def normalize(l)
|
33
34
|
##l.gsub!(/&/, '\\\\&')
|
35
|
+
l.gsub!(/#/,'\\#')
|
36
|
+
l.gsub!(/_/,'\\textunderscore{}')
|
34
37
|
l.to_s
|
35
38
|
end
|
36
39
|
|
@@ -594,6 +597,11 @@ END_OF_POST
|
|
594
597
|
if line =~ /[#中見出し](.*?)[#中見出し終わり]/
|
595
598
|
line.gsub!(/[#中見出し](.*?)[#中見出し終わり]/){"{\\large #{$1}}"}
|
596
599
|
end
|
600
|
+
if line =~ /[#大見出し](.*?)[#大見出し終わり]/
|
601
|
+
line.gsub!(/[#大見出し](.*?)[#大見出し終わり]/){"{\\Large #{$1}}"}
|
602
|
+
end
|
603
|
+
|
604
|
+
|
597
605
|
|
598
606
|
if line =~ /[#ここから中見出し]/
|
599
607
|
line.gsub!(/[#ここから中見出し]/){"{\\large"}
|
data/test/helper.rb
CHANGED
@@ -1,10 +1,23 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'test/unit'
|
3
|
-
|
3
|
+
|
4
4
|
|
5
5
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
6
6
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
7
7
|
require 'aozora4reader'
|
8
8
|
|
9
9
|
class Test::Unit::TestCase
|
10
|
+
|
11
|
+
def self.context(name, &block)
|
12
|
+
@context = name
|
13
|
+
block.call
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.should(name, &block)
|
17
|
+
test_name = "test_#{@context.gsub(/\s+/,'_')}_#{name.gsub(/\s+/,'_')}".to_sym
|
18
|
+
defined = instance_method(test_name) rescue false
|
19
|
+
raise "#{test_name} is already defined in #{self}" if defined
|
20
|
+
define_method(test_name, &block)
|
21
|
+
end
|
22
|
+
|
10
23
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aozora4reader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,40 +9,61 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-08-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
16
|
-
requirement:
|
15
|
+
name: bundler
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '1.3'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.3'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - '>='
|
20
36
|
- !ruby/object:Gem::Version
|
21
37
|
version: '0'
|
22
38
|
type: :development
|
23
39
|
prerelease: false
|
24
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
25
46
|
description: Aozora Bunko converter for Sony Reader
|
26
|
-
email:
|
47
|
+
email:
|
48
|
+
- maki@rubycolor.org
|
27
49
|
executables:
|
28
50
|
- a4r
|
29
51
|
extensions: []
|
30
|
-
extra_rdoc_files:
|
31
|
-
- ChangeLog
|
32
|
-
- LICENSE
|
33
|
-
- README.rdoc
|
52
|
+
extra_rdoc_files: []
|
34
53
|
files:
|
35
54
|
- .document
|
55
|
+
- .gitignore
|
36
56
|
- ChangeLog
|
57
|
+
- Gemfile
|
37
58
|
- LICENSE
|
38
59
|
- README.rdoc
|
39
60
|
- Rakefile
|
40
|
-
- VERSION
|
41
61
|
- aozora4reader.gemspec
|
42
62
|
- bin/a4r
|
43
63
|
- data/gaiji.txt
|
44
64
|
- data/gaiji2.txt
|
45
65
|
- lib/aozora4reader.rb
|
66
|
+
- lib/aozora4reader/version.rb
|
46
67
|
- memo.txt
|
47
68
|
- sty/aozora.sty
|
48
69
|
- sty/aozora4reader.sty
|
@@ -50,7 +71,8 @@ files:
|
|
50
71
|
- test/helper.rb
|
51
72
|
- test/test_aozora4reader.rb
|
52
73
|
homepage: http://github.com/takahashim/aozora4reader
|
53
|
-
licenses:
|
74
|
+
licenses:
|
75
|
+
- MIT
|
54
76
|
post_install_message:
|
55
77
|
rdoc_options: []
|
56
78
|
require_paths:
|
@@ -58,19 +80,27 @@ require_paths:
|
|
58
80
|
required_ruby_version: !ruby/object:Gem::Requirement
|
59
81
|
none: false
|
60
82
|
requirements:
|
61
|
-
- -
|
83
|
+
- - '>='
|
62
84
|
- !ruby/object:Gem::Version
|
63
85
|
version: '0'
|
86
|
+
segments:
|
87
|
+
- 0
|
88
|
+
hash: -966737468059154018
|
64
89
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
90
|
none: false
|
66
91
|
requirements:
|
67
|
-
- -
|
92
|
+
- - '>='
|
68
93
|
- !ruby/object:Gem::Version
|
69
94
|
version: '0'
|
95
|
+
segments:
|
96
|
+
- 0
|
97
|
+
hash: -966737468059154018
|
70
98
|
requirements: []
|
71
99
|
rubyforge_project:
|
72
|
-
rubygems_version: 1.8.
|
100
|
+
rubygems_version: 1.8.25
|
73
101
|
signing_key:
|
74
102
|
specification_version: 3
|
75
103
|
summary: Aozora Bunko converter for Sony Reader
|
76
|
-
test_files:
|
104
|
+
test_files:
|
105
|
+
- test/helper.rb
|
106
|
+
- test/test_aozora4reader.rb
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.1.0
|