mizuho 0.9.14 → 0.9.15

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.asc CHANGED
@@ -2,11 +2,11 @@
2
2
  Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
3
3
  Comment: GPGTools - http://gpgtools.org
4
4
 
5
- iQEcBAABAgAGBQJRPZdzAAoJECrHRaUKISqM/QQH/jSjn8Fxk2QkNP6S+yAHFph4
6
- Z0OoJ7WqzieWdWIdou+XK6enUNRjmePBw+QfBVQBxUQdLWL5s88ddTnco6pLF67U
7
- F5nI5zeKxPzCOJ37nl7FVvk81DC9Uxr2gQfrE0HDnD0gWHhukJxzy7I7+cJhJQ14
8
- aP/br60bkILq/+ybppUW0fvQmyGtPnB587XMU9BacBQxQUbBf4cDn4P57py+SMko
9
- Lgiytug+Sv+knFba71yMIRK4ROmrlP5DJZjtLTNQpKP4kcT+i2Q32Ms+JGk0I8lS
10
- OwEJuGydtBJw86icR9N083ejv1VQeqI4KTikXFPoVGRAvF+jvDHw2bpm8mMj3pE=
11
- =vkMH
5
+ iQEcBAABAgAGBQJRe61BAAoJECrHRaUKISqMk18H/1cQqhWFg3Xsg54HXDj3ZMg3
6
+ Viaq7IDhPH/XU3Xk2VQ7sJzKfur3vypJymAeq/1qtAWwCJVcQCeYOORYA50jfSM5
7
+ VmFQH/rH3id9f7UPTKTw5GaSvaPxWOQwt8i58GtFxoVIn/Iq7a6eiUkOIgiv8cCg
8
+ WTMjOm9dqXwNLZUIBdaPT1kDV8BZjZSj4zj69RzNxJ0362fxe0O05rPD1UAGIjwA
9
+ 2lSshBvJ4QnaY7X9u9PrioXETClftCJcoHbG2nIu0LjgEUNEkn8tO0VO1/MMpIuM
10
+ n407QxD1P2w0We2uDRypnWTNMGcIc/NvAOBKMPDFTgIVF9iRHNpcbN0hcRj7HaE=
11
+ =r3I8
12
12
  -----END PGP SIGNATURE-----
@@ -1,4 +1,4 @@
1
- Copyright (c) 2008-2012 Hongli Lai
1
+ Copyright (c) 2008-2013 Hongli Lai
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
@@ -17,4 +17,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
17
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
18
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
19
  THE SOFTWARE.
20
-
@@ -34,6 +34,10 @@ Run the following command as root:
34
34
 
35
35
  gem install mizuho
36
36
 
37
+ This gem is signed using PGP with the [Phusion Software Signing key](http://www.phusion.nl/about/gpg). That key in turn is signed by [the rubygems-openpgp Certificate Authority](http://www.rubygems-openpgp-ca.org/).
38
+
39
+ You can verify the authenticity of the gem by following [The Complete Guide to Verifying Gems with rubygems-openpgp](http://www.rubygems-openpgp-ca.org/blog/the-complete-guide-to-verifying-gems-with-rubygems-openpgp.html).
40
+
37
41
  ## Usage
38
42
 
39
43
  First, read [the Asciidoc manual](http://www.methods.co.nz/asciidoc/userguide.html)
data/Rakefile CHANGED
@@ -1,6 +1,57 @@
1
1
  $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/lib"))
2
2
  require 'mizuho'
3
3
 
4
+ def string_option(name, default_value = nil)
5
+ value = ENV[name]
6
+ if value.nil? || value.empty?
7
+ return default_value
8
+ else
9
+ return value
10
+ end
11
+ end
12
+
13
+ def boolean_option(name, default_value = false)
14
+ value = ENV[name]
15
+ if value.nil? || value.empty?
16
+ return default_value
17
+ else
18
+ return value == "yes" || value == "on" || value == "true" || value == "1"
19
+ end
20
+ end
21
+
22
+ def recursive_copy_files(files, destination_dir)
23
+ require 'fileutils' if !defined?(FileUtils)
24
+ files.each_with_index do |filename, i|
25
+ dir = File.dirname(filename)
26
+ if !File.exist?("#{destination_dir}/#{dir}")
27
+ FileUtils.mkdir_p("#{destination_dir}/#{dir}")
28
+ end
29
+ if !File.directory?(filename)
30
+ FileUtils.install(filename, "#{destination_dir}/#{filename}")
31
+ end
32
+ printf "\r[%5d/%5d] [%3.0f%%] Copying files...", i + 1, files.size, i * 100.0 / files.size
33
+ STDOUT.flush
34
+ end
35
+ printf "\r[%5d/%5d] [%3.0f%%] Copying files...\n", files.size, files.size, 100
36
+ end
37
+
38
+ def create_debian_package_dir
39
+ require 'mizuho/packaging'
40
+
41
+ basename = "mizuho_#{Mizuho::VERSION_STRING}"
42
+ pkg_dir = string_option('PKG_DIR', "pkg")
43
+ sh "rm -rf #{pkg_dir}/#{basename}"
44
+ sh "mkdir -p #{pkg_dir}/#{basename}"
45
+
46
+ recursive_copy_files(Dir[*MIZUHO_FILES] - Dir[*MIZUHO_DEBIAN_EXCLUDE_FILES],
47
+ "#{pkg_dir}/#{basename}")
48
+ sh "cd #{pkg_dir} && tar -c #{basename} | gzip --best > #{basename}.orig.tar.gz"
49
+
50
+ recursive_copy_files(Dir["debian/**/*"], "#{pkg_dir}/#{basename}")
51
+
52
+ return [basename, pkg_dir]
53
+ end
54
+
4
55
  desc "Run unit tests"
5
56
  task :test do
6
57
  ruby "-S spec -f s -c test/*_spec.rb"
@@ -18,3 +69,15 @@ task 'package:release' do
18
69
  puts "Did not upload the gem."
19
70
  end
20
71
  end
72
+
73
+ task 'package:debian_dir' do
74
+ create_debian_package_dir
75
+ end
76
+
77
+ desc "Build Debian package"
78
+ task 'package:debian' do
79
+ sh "dpkg-checkbuilddeps"
80
+ basename, pkg_dir = create_debian_package_dir
81
+ sign_options = boolean_option('SIGN') ? "-us -uc" : "-k0x0A212A8C"
82
+ sh "cd #{pkg_dir}/#{basename} && debuild #{sign_options}"
83
+ end
data/bin/mizuho CHANGED
@@ -18,9 +18,13 @@
18
18
  # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
19
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
20
  # THE SOFTWARE.
21
- require File.expand_path(File.dirname(__FILE__) + "/../lib/mizuho")
21
+ $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/../lib"))
22
22
  require 'optparse'
23
- require 'rubygems'
23
+ begin
24
+ require 'rubygems'
25
+ rescue LoadError
26
+ end
27
+ require 'mizuho'
24
28
  require 'mizuho/generator'
25
29
 
26
30
  $KCODE = 'UTF-8' if RUBY_VERSION < '1.9'
@@ -0,0 +1,5 @@
1
+ mizuho (0.9.15-1) precise; urgency=low
2
+
3
+ * Initial packaging
4
+
5
+ -- Hongli Lai <hongli@phusion.nl> Fri, 26 Apr 2013 16:39:20 +0200
@@ -0,0 +1 @@
1
+ 7
@@ -0,0 +1,18 @@
1
+ Source: mizuho
2
+ Section: text
3
+ Priority: optional
4
+ Maintainer: Hongli Lai <hongli@phusion.nl>
5
+ Build-Depends: debhelper (>= 7.0.50~), gem2deb (>= 0.2.0~), sed (>= 1.0.0)
6
+ Standards-Version: 3.9.3
7
+ Homepage: https://github.com/FooBarWidget/mizuho
8
+ Vcs-Git: git://github.com/FooBarWidget/mizuho.git
9
+ Vcs-Browser: https://github.com/FooBarWidget/mizuho
10
+ XS-Ruby-Versions: all
11
+
12
+ Package: mizuho
13
+ Architecture: all
14
+ XB-Ruby-Versions: ${ruby:Versions}
15
+ Depends: ${shlibs:Depends}, ${misc:Depends}, ruby | ruby-interpreter, ruby-nokogiri (>= 1.5.0), source-highlight, asciidoc
16
+ Description: Documentation formatting tool
17
+ Converts Asciidoc input files into nicely
18
+ outputted HTML, possibly one file per chapter.
@@ -0,0 +1,24 @@
1
+ Format: http://dep.debian.net/deps/dep5
2
+ Upstream-Name: mizuho
3
+ Source: https://github.com/FooBarWidget/mizuho
4
+
5
+ Files: *
6
+ Copyright: 2008-2013 Hongli Lai
7
+ License: MIT
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ of this software and associated documentation files (the "Software"), to deal
10
+ in the Software without restriction, including without limitation the rights
11
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ copies of the Software, and to permit persons to whom the Software is
13
+ furnished to do so, subject to the following conditions:
14
+ .
15
+ The above copyright notice and this permission notice shall be included in
16
+ all copies or substantial portions of the Software.
17
+ .
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ THE SOFTWARE.
@@ -0,0 +1 @@
1
+ templates/* usr/share/mizuho/templates
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/make -f
2
+ export DH_VERBOSE=1
3
+
4
+ %:
5
+ dh $@ --buildsystem=ruby
6
+
7
+ override_dh_install:
8
+ dh_install
9
+ sed -i 's/NATIVELY_PACKAGED = .*/NATIVELY_PACKAGED = true/' debian/mizuho/usr/lib/ruby/vendor_ruby/mizuho.rb
@@ -0,0 +1 @@
1
+ 3.0 (quilt)
@@ -19,15 +19,22 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Mizuho
22
- SOURCE_ROOT = File.expand_path(File.dirname(__FILE__) + "/..")
23
- LIBDIR = "#{SOURCE_ROOT}/lib"
24
- TEMPLATES_DIR = "#{SOURCE_ROOT}/templates"
25
- ASCIIDOC = "#{SOURCE_ROOT}/asciidoc/asciidoc.py"
26
-
27
- VERSION_STRING = "0.9.14"
28
-
29
- if $LOAD_PATH.first != LIBDIR
30
- $LOAD_PATH.unshift(LIBDIR)
31
- $LOAD_PATH.uniq!
22
+ VERSION_STRING = "0.9.15"
23
+ NATIVELY_PACKAGED = false
24
+
25
+ if NATIVELY_PACKAGED
26
+ TEMPLATES_DIR = "/usr/share/mizuho/templates"
27
+ ASCIIDOC = "asciidoc"
28
+ else
29
+ SOURCE_ROOT = File.expand_path(File.dirname(__FILE__) + "/..")
30
+ LIBDIR = "#{SOURCE_ROOT}/lib"
31
+
32
+ TEMPLATES_DIR = "#{SOURCE_ROOT}/templates"
33
+ ASCIIDOC = ["python", "#{SOURCE_ROOT}/asciidoc/asciidoc.py"]
34
+
35
+ if $LOAD_PATH.first != LIBDIR
36
+ $LOAD_PATH.unshift(LIBDIR)
37
+ $LOAD_PATH.uniq!
38
+ end
32
39
  end
33
- end if !defined?(Mizuho::SOURCE_ROOT)
40
+ end if !defined?(Mizuho::VERSION_STRING)
@@ -76,12 +76,12 @@ class Generator
76
76
 
77
77
  def self.run_asciidoc(input, output, icons_dir = nil, conf_file = nil, attributes = [])
78
78
  args = [
79
- "python", ASCIIDOC,
79
+ ASCIIDOC,
80
80
  "-b", "html5",
81
81
  "-a", "theme=flask",
82
82
  "-a", "icons",
83
83
  "-n"
84
- ]
84
+ ].flatten
85
85
  if icons_dir
86
86
  args << "-a"
87
87
  args << "iconsdir=#{icons_dir}"
@@ -139,6 +139,9 @@ private
139
139
  headers = (doc / "#content" / "h1, h2, h3, h4")
140
140
 
141
141
  head.add_child(stylesheet_tag)
142
+
143
+ # Remove footer with generation timestamp.
144
+ (doc / "#footer-text").remove
142
145
 
143
146
  # Add commenting balloons.
144
147
  if @commenting_system
@@ -0,0 +1,17 @@
1
+ MIZUHO_FILES = [
2
+ "README.markdown", "LICENSE.txt", "Rakefile",
3
+ "bin/*",
4
+ "lib/**/*",
5
+ "debian/**/*",
6
+ "test/*",
7
+ "templates/*",
8
+ "asciidoc/**/*",
9
+ "source-highlight/**/*"
10
+ ]
11
+
12
+ MIZUHO_DEBIAN_EXCLUDE_FILES = [
13
+ "bin/mizuho-asciidoc",
14
+ "debian/**/*",
15
+ "asciidoc/**/*",
16
+ "source-highlight/**/*",
17
+ ]
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2008-2012 Hongli Lai
1
+ # Copyright (c) 2008-2013 Hongli Lai
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  # of this software and associated documentation files (the "Software"), to deal
@@ -19,4 +19,7 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  require 'mizuho'
22
- ENV['PATH'] += ":" + File.join(Mizuho::SOURCE_ROOT, "source-highlight")
22
+
23
+ if !Mizuho::NATIVELY_PACKAGED
24
+ ENV['PATH'] += ":" + File.join(Mizuho::SOURCE_ROOT, "source-highlight")
25
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mizuho
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.14
4
+ version: 0.9.15
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-11 00:00:00.000000000 Z
12
+ date: 2013-04-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: '0'
21
+ version: 1.5.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
- version: '0'
29
+ version: 1.5.0
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: sqlite3
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -61,9 +61,17 @@ files:
61
61
  - lib/mizuho/fuzzystringmatch.rb
62
62
  - lib/mizuho/generator.rb
63
63
  - lib/mizuho/id_map.rb
64
+ - lib/mizuho/packaging.rb
64
65
  - lib/mizuho/source_highlight.rb
65
66
  - lib/mizuho/utils.rb
66
67
  - lib/mizuho.rb
68
+ - debian/changelog
69
+ - debian/compat
70
+ - debian/control
71
+ - debian/copyright
72
+ - debian/mizuho.install
73
+ - debian/rules
74
+ - debian/source/format
67
75
  - test/generator_spec.rb
68
76
  - test/id_map_spec.rb
69
77
  - test/parser_spec.rb
metadata.gz.asc CHANGED
@@ -2,11 +2,11 @@
2
2
  Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
3
3
  Comment: GPGTools - http://gpgtools.org
4
4
 
5
- iQEcBAABAgAGBQJRPZdzAAoJECrHRaUKISqMorEH/jd444Ot4OY52HvMQ5OAhoFe
6
- vBRAs0mEFYHX8LNGJVky32q97LNCBoZVKFGdlqft7qnDyMiBVtLl8eFD+BPmT8R7
7
- t8rp+ekbRrn8m8AigWsxBN6iILtKHgNokHKf1QGnKv8/uiIO7ljmDhCyx8dXl5Bs
8
- qA0FEwAQrEUlEo6ov9COYIQOAAelDY2L+f3ZnxnheguuYdDx25V8PGRugqALxX7G
9
- g/jiA/EP7OJ4pq8QsMF9liEKSmyO5PW5f2NZVt2bk4lG7clgxrNY+I05BJMqOBzF
10
- JCmQOZ3QQIDn93oI5gkO5D/u3333fGt0N1TDF/qixfGCgK35ZWcLRIAKDJXbVF0=
11
- =y9pm
5
+ iQEcBAABAgAGBQJRe61BAAoJECrHRaUKISqMViAH/Agslk77P6Du4Y/rpABgfraz
6
+ 8pddWAOVZFk4YbpN7RqypVgqXwTVE6rlZOftcrPdGN3Me2ZXJoWsMO9UDnai6oVY
7
+ cw1oWaRrPBRs9ezQQmwHsIfQ/+OclhlBSq0fF53bMP0hf7Uxlxh2Nw6S+wu4FMzB
8
+ PI0fFI8UBa5tfgoVnFtJJCqZNyB9m22JfMkvr9R2x28ER1ccTV4KX5HzkA5WWitS
9
+ ku8ugQnYwLgC2ucE9uSMiqfTqa23SC6rm6+FLe3dSTOmesPnXMgXAaZCqmLm4ynt
10
+ jY/8qN57bv6HEhnOjTx1R+YfbA1OfMF+UA5BeTFO2uabMEX6ic24iBECwpN3Uvg=
11
+ =Rwbn
12
12
  -----END PGP SIGNATURE-----