gepub 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,26 +1,45 @@
1
- require 'rubygems'
2
- gem 'hoe', '>= 2.1.0'
3
- require 'hoe'
4
- require 'fileutils'
5
- require './lib/gepub'
6
-
7
- Hoe.plugin :newgem
8
- # Hoe.plugin :website
9
- # Hoe.plugin :cucumberfeatures
10
-
11
- # Generate all the Rake tasks
12
- # Run 'rake -T' to see list of generated tasks (from gem root directory)
13
- $hoe = Hoe.spec 'gepub' do
14
- self.developer 'KOJIMA Satoshi', 'skoji@skoji.jp'
15
- # self.post_install_message = 'PostInstall.txt'
16
- # self.rubyforge_name = self.name # TODO this is default value
17
- # self.extra_deps = [['activesupport','>= 2.0.2']]
18
-
19
- end
20
-
21
- require 'newgem/tasks'
22
- Dir['tasks/**/*.rake'].each { |t| load t }
23
-
24
- # TODO - want other tests/tasks run by default? Add them to the list
25
- # remove_task :default
26
- # task :default => [:spec, :features]
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "gepub"
8
+ gem.summary = %Q{a good-enough EPUB generator.}
9
+ gem.description = %Q{an easy-to-use (and easy-to-implement) EPUB generator.}
10
+ gem.email = "skoji@skoji.jp"
11
+ gem.homepage = "http://github.com/skoji/gepub"
12
+ gem.authors = ["KOJIMA Satoshi"]
13
+ gem.add_development_dependency "rspec", ">= 1.2.9"
14
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
15
+ end
16
+ Jeweler::GemcutterTasks.new
17
+ rescue LoadError
18
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
19
+ end
20
+
21
+ require 'spec/rake/spectask'
22
+ Spec::Rake::SpecTask.new(:spec) do |spec|
23
+ spec.libs << 'lib' << 'spec'
24
+ spec.spec_files = FileList['spec/**/*_spec.rb']
25
+ end
26
+
27
+ Spec::Rake::SpecTask.new(:rcov) do |spec|
28
+ spec.libs << 'lib' << 'spec'
29
+ spec.pattern = 'spec/**/*_spec.rb'
30
+ spec.rcov = true
31
+ end
32
+
33
+ task :spec => :check_dependencies
34
+
35
+ task :default => :spec
36
+
37
+ require 'rake/rdoctask'
38
+ Rake::RDocTask.new do |rdoc|
39
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
40
+
41
+ rdoc.rdoc_dir = 'rdoc'
42
+ rdoc.title = "gepub #{version}"
43
+ rdoc.rdoc_files.include('README*')
44
+ rdoc.rdoc_files.include('lib/**/*.rb')
45
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.3
@@ -0,0 +1,55 @@
1
+ # -*- coding: utf-8 -*-
2
+ require 'rubygems'
3
+ require 'gepub'
4
+ require 'fileutils'
5
+
6
+ epubdir = "testepub"
7
+ title = "samplepub"
8
+ FileUtils.rm_rf(epubdir)
9
+ FileUtils.mkdir(epubdir)
10
+
11
+ epub = GEPUB::Generator.new(title)
12
+ epub.author="the author"
13
+ epub.publisher="the publisher"
14
+ epub.date = "2010-05-03"
15
+ epub.identifier = "http://www.skoji.jp/testepub/2010-05-03"
16
+
17
+ # create test contents files
18
+
19
+ [ 'coverpage', 'chapter1', 'chapter2' ].each {
20
+ |name|
21
+ File.open(epubdir + "/#{name}.html", 'w') {
22
+ |file|
23
+ file << <<EOF
24
+ <?xml version="1.0" encoding="UTF-8"?>
25
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja">
26
+ <head>
27
+ <title>sample #{name} </title>
28
+ </head>
29
+ <body>
30
+ <h1>#{name}</h1>
31
+ <p>here comes the contents for #{name}</p>
32
+ </body>
33
+ </html>
34
+ EOF
35
+ }
36
+ }
37
+
38
+ # coverpage won't appear on toc, so do not call addNav
39
+ epub.addManifest('cover', "coverpage.html", 'application/xhtml+xml')
40
+ epub.spine.push('cover')
41
+
42
+
43
+ epub.addManifest('chap1', "chapter1.html", 'application/xhtml+xml')
44
+ epub.spine.push('chap1')
45
+ epub.addNav('chap1', 'Chapter 1', "chapter1.html")
46
+
47
+ epub.addManifest('chap2', "chapter2.html", 'application/xhtml+xml')
48
+ epub.spine.push('chap2')
49
+ epub.addNav('chap1', 'Chapter 2', "chapter2.html")
50
+
51
+
52
+ epub.create(epubdir)
53
+ epub.create_epub(epubdir, ".")
54
+
55
+
data/lib/gepub.rb CHANGED
@@ -1,8 +1,2 @@
1
- $:.unshift(File.dirname(__FILE__)) unless
2
- $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
-
4
1
  require 'gepub/generator'
5
2
 
6
- module GEPUB
7
- VERSION = '0.0.2'
8
- end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 2
9
- version: 0.0.2
8
+ - 3
9
+ version: 0.0.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - KOJIMA Satoshi
@@ -14,69 +14,48 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-05-07 00:00:00 +09:00
17
+ date: 2010-05-08 00:00:00 +09:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- name: rubyforge
21
+ name: rspec
22
22
  prerelease: false
23
23
  requirement: &id001 !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  segments:
28
+ - 1
28
29
  - 2
29
- - 0
30
- - 4
31
- version: 2.0.4
30
+ - 9
31
+ version: 1.2.9
32
32
  type: :development
33
33
  version_requirements: *id001
34
- - !ruby/object:Gem::Dependency
35
- name: hoe
36
- prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
38
- requirements:
39
- - - ">="
40
- - !ruby/object:Gem::Version
41
- segments:
42
- - 2
43
- - 6
44
- - 0
45
- version: 2.6.0
46
- type: :development
47
- version_requirements: *id002
48
- description: a good-enough EPUB generator library.
49
- email:
50
- - skoji@skoji.jp
34
+ description: an easy-to-use (and easy-to-implement) EPUB generator.
35
+ email: skoji@skoji.jp
51
36
  executables: []
52
37
 
53
38
  extensions: []
54
39
 
55
40
  extra_rdoc_files:
56
- - History.txt
57
- - Manifest.txt
41
+ - README.rdoc
58
42
  files:
59
- - History.txt
60
- - Manifest.txt
61
43
  - README.rdoc
62
44
  - Rakefile
45
+ - VERSION
46
+ - examples/example.rb
63
47
  - lib/gepub.rb
64
48
  - lib/gepub/generator.rb
65
- - script/console
66
- - script/destroy
67
- - script/generate
68
49
  - spec/gepub_spec.rb
69
50
  - spec/spec.opts
70
51
  - spec/spec_helper.rb
71
- - tasks/rspec.rake
72
52
  has_rdoc: true
73
53
  homepage: http://github.com/skoji/gepub
74
54
  licenses: []
75
55
 
76
56
  post_install_message:
77
57
  rdoc_options:
78
- - --main
79
- - README.rdoc
58
+ - --charset=UTF-8
80
59
  require_paths:
81
60
  - lib
82
61
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -95,10 +74,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
74
  version: "0"
96
75
  requirements: []
97
76
 
98
- rubyforge_project: gepub
77
+ rubyforge_project:
99
78
  rubygems_version: 1.3.6
100
79
  signing_key:
101
80
  specification_version: 3
102
- summary: a good-enough EPUB generator library.
103
- test_files: []
104
-
81
+ summary: a good-enough EPUB generator.
82
+ test_files:
83
+ - spec/gepub_spec.rb
84
+ - spec/spec_helper.rb
85
+ - examples/example.rb
data/History.txt DELETED
@@ -1,4 +0,0 @@
1
- === 0.0.2-05-065
2
-
3
- * 1 major enhancement:
4
- * Initial release
data/Manifest.txt DELETED
@@ -1,13 +0,0 @@
1
- History.txt
2
- Manifest.txt
3
- README.rdoc
4
- Rakefile
5
- lib/gepub.rb
6
- lib/gepub/generator.rb
7
- script/console
8
- script/destroy
9
- script/generate
10
- spec/gepub_spec.rb
11
- spec/spec.opts
12
- spec/spec_helper.rb
13
- tasks/rspec.rake
data/script/console DELETED
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # File: script/console
3
- irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
4
-
5
- libs = " -r irb/completion"
6
- # Perhaps use a console_lib to store any extra methods I may want available in the cosole
7
- # libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
8
- libs << " -r #{File.dirname(__FILE__) + '/../lib/gepub.rb'}"
9
- puts "Loading gepub gem"
10
- exec "#{irb} #{libs} --simple-prompt"
data/script/destroy DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
3
-
4
- begin
5
- require 'rubigen'
6
- rescue LoadError
7
- require 'rubygems'
8
- require 'rubigen'
9
- end
10
- require 'rubigen/scripts/destroy'
11
-
12
- ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
- RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
14
- RubiGen::Scripts::Destroy.new.run(ARGV)
data/script/generate DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
3
-
4
- begin
5
- require 'rubigen'
6
- rescue LoadError
7
- require 'rubygems'
8
- require 'rubigen'
9
- end
10
- require 'rubigen/scripts/generate'
11
-
12
- ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
- RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
14
- RubiGen::Scripts::Generate.new.run(ARGV)
data/tasks/rspec.rake DELETED
@@ -1,21 +0,0 @@
1
- begin
2
- require 'spec'
3
- rescue LoadError
4
- require 'rubygems' unless ENV['NO_RUBYGEMS']
5
- require 'spec'
6
- end
7
- begin
8
- require 'spec/rake/spectask'
9
- rescue LoadError
10
- puts <<-EOS
11
- To use rspec for testing you must install rspec gem:
12
- gem install rspec
13
- EOS
14
- exit(0)
15
- end
16
-
17
- desc "Run the specs under spec/models"
18
- Spec::Rake::SpecTask.new do |t|
19
- t.spec_opts = ['--options', "spec/spec.opts"]
20
- t.spec_files = FileList['spec/**/*_spec.rb']
21
- end