packnga 0.9.1 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -17,12 +17,13 @@
17
17
 
18
18
  source "http://rubygems.org/"
19
19
 
20
+ gem "rake"
21
+ gem "yard"
20
22
  gem "rubyforge"
21
23
 
22
24
  group :development, :test do
23
25
  gem "test-unit"
24
26
  gem "test-unit-notify"
25
- gem "rake"
26
27
  gem "jeweler"
27
- gem "yard"
28
+ gem "RedCloth"
28
29
  end
data/Rakefile CHANGED
@@ -19,19 +19,11 @@
19
19
  require 'English'
20
20
 
21
21
  require 'pathname'
22
- require 'erb'
23
22
  require 'rubygems'
24
23
  require 'rubygems/package_task'
25
24
  require "rake/clean"
26
25
  require 'jeweler'
27
26
 
28
- if YAML.const_defined?(:ENGINE)
29
- begin
30
- YAML::ENGINE.yamler = "psych"
31
- rescue LoadError
32
- end
33
- end
34
-
35
27
  base_dir = File.join(File.dirname(__FILE__))
36
28
 
37
29
  packnga_lib_dir = File.join(base_dir, 'lib')
@@ -1,5 +1,14 @@
1
1
  h1. NEWS
2
2
 
3
+ h2. 0.9.2: 2011-08-29
4
+
5
+ h3. Improvements
6
+
7
+ * Supported doc/text/ nonexistence case.
8
+ * Supported yardoc options customize.
9
+ * Supported xml2po mode customize.
10
+ * Used only lib/**/*.rb as document target by default.
11
+
3
12
  h2. 0.9.1: 2011-08-25
4
13
 
5
14
  h3. Improvements
@@ -13,6 +22,7 @@ h3. Improvements
13
22
 
14
23
  h3. Fixes
15
24
 
25
+ * fix bug release:reference:publish stop.
16
26
  * checked group_ids before add_releasing tar.gz to rubyforge.
17
27
  * wrote only sentence for redirect to english page in .htaccess file.
18
28
  (don't write sentence for redirect tutorial page.)
@@ -15,6 +15,8 @@
15
15
  # License along with this library; if not, write to the Free Software
16
16
  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
17
 
18
+ require "erb"
19
+
18
20
  module Packnga
19
21
  # This class creates reference tasks.
20
22
  # They generate, translate and prepare to publish references.
@@ -23,13 +25,18 @@ module Packnga
23
25
  class ReferenceTask
24
26
  include Rake::DSL
25
27
  include ERB::Util
26
- # This attribute is path of base directory of document.
27
- # @param [String] path of base directory of document
28
+
29
+ # @return [String] path of base directory of document
28
30
  attr_writer :base_dir
31
+
32
+ # @return [String] mode used in xml2po. The default is "docbook".
33
+ attr_writer :mode
34
+
29
35
  # @private
30
36
  def initialize(spec)
31
37
  @spec = spec
32
38
  @base_dir = nil
39
+ @mode = nil
33
40
  @translate_languages = nil
34
41
  @supported_languages = nil
35
42
  @html_files = nil
@@ -56,6 +63,7 @@ module Packnga
56
63
  private
57
64
  def set_default_values
58
65
  @base_dir ||= Pathname.new("doc")
66
+ @mode ||= "docbook"
59
67
  @translate_languages ||= [:ja]
60
68
  @supported_languages = [:en, *@translate_languages]
61
69
  @html_files = FileList[(doc_en_dir + "**/*.html").to_s].to_a
@@ -95,6 +103,7 @@ module Packnga
95
103
  file @pot_file => [@po_dir, *@html_files] do |t|
96
104
  sh("xml2po",
97
105
  "--keep-entities",
106
+ "--mode", @mode,
98
107
  "--output", t.name,
99
108
  *@html_files)
100
109
  end
@@ -115,6 +124,7 @@ module Packnga
115
124
  file po_file => @html_files do |t|
116
125
  sh("xml2po",
117
126
  "--keep-entities",
127
+ "--mode", @mode,
118
128
  "--update", t.name,
119
129
  *@html_files)
120
130
  end
@@ -159,9 +169,13 @@ module Packnga
159
169
  end
160
170
  case path.extname
161
171
  when ".html"
162
- sh("xml2po --keep-entities " +
163
- "--po-file #{po_file} --language #{language} " +
164
- "#{path} > #{translated_path}")
172
+ sh("xml2po",
173
+ "--keep-entities",
174
+ "--mode", @mode,
175
+ "--po-file", po_file.to_s,
176
+ "--language", language.to_s,
177
+ "--output", translated_path.to_s,
178
+ path.to_s)
165
179
  else
166
180
  cp(path.to_s, translated_path, :preserve => true)
167
181
  end
@@ -37,7 +37,7 @@ module Packnga
37
37
  # @param [String] message
38
38
  attr_writer :tag_message
39
39
  # This attribute is options for uploading rubyforge by rsync.
40
- # @param [hash] options for uploading.
40
+ # @param [Hash] options for uploading.
41
41
  attr_writer :publish_options
42
42
  # Defines task for preparing to release.
43
43
  # Defined tasks update version and release-date in index files
@@ -1,6 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  #
3
3
  # Copyright (C) 2011 yoshihara haruka <yoshihara@clear-code.com>
4
+ # Copyright (C) 2011 Kouhei Sutou <kou@clear-code.com>
4
5
  #
5
6
  # This library is free software; you can redistribute it and/or
6
7
  # modify it under the terms of the GNU Lesser General Public
@@ -17,5 +18,5 @@
17
18
 
18
19
  module Packnga
19
20
  # Packnga version.
20
- VERSION = "0.9.1"
21
+ VERSION = "0.9.2"
21
22
  end
@@ -27,9 +27,16 @@ module Packnga
27
27
  include Rake::DSL
28
28
 
29
29
  attr_writer :readme
30
- # This attribute is path of base directory of document.
30
+
31
+ # @return [String] path of base directory of document.
31
32
  attr_accessor :base_dir
32
33
 
34
+ # @return [Array<String>] document target files.
35
+ attr_accessor :files
36
+
37
+ # @return [Array<String>] custom yardoc command line options.
38
+ attr_accessor :options
39
+
33
40
  # @private
34
41
  def initialize(spec)
35
42
  @spec = spec
@@ -37,8 +44,9 @@ module Packnga
37
44
  @readme = nil
38
45
  @text_files = nil
39
46
  @base_dir = nil
47
+ @options = []
40
48
  @files = spec.files.find_all do |file|
41
- /\.rb\z/ =~ file
49
+ /\Alib\// =~ file and /\.rb\z/ =~ file
42
50
  end
43
51
  if block_given?
44
52
  yield(self)
@@ -73,8 +81,9 @@ module Packnga
73
81
  @base_dir ||= "doc"
74
82
  @base_dir = Pathname.new(@base_dir)
75
83
  if @text_files.nil?
84
+ @text_files = []
76
85
  text_dir = @base_dir + "text"
77
- @text_files = [(text_dir + "**/*").to_s] if text_dir.directory?
86
+ @text_files << (text_dir + "**/*").to_s if text_dir.directory?
78
87
  end
79
88
  end
80
89
 
@@ -101,6 +110,7 @@ module Packnga
101
110
  yardoc_task.options += ["--output-dir", reference_en_dir.to_s]
102
111
  yardoc_task.options += ["--charset", "utf-8"]
103
112
  yardoc_task.options += ["--no-private"]
113
+ yardoc_task.options += @options
104
114
  yardoc_task.files += @files
105
115
  @hooks.each do |hook|
106
116
  hook.call(yardoc_task)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: packnga
3
3
  version: !ruby/object:Gem::Version
4
- hash: 57
5
- prerelease: false
4
+ hash: 63
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 1
10
- version: 0.9.1
9
+ - 2
10
+ version: 0.9.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Haruka Yoshihara
@@ -16,13 +16,9 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-08-25 00:00:00 +09:00
20
- default_executable:
19
+ date: 2011-08-28 00:00:00 Z
21
20
  dependencies:
22
21
  - !ruby/object:Gem::Dependency
23
- type: :runtime
24
- prerelease: false
25
- name: rubyforge
26
22
  version_requirements: &id001 !ruby/object:Gem::Requirement
27
23
  none: false
28
24
  requirements:
@@ -32,11 +28,11 @@ dependencies:
32
28
  segments:
33
29
  - 0
34
30
  version: "0"
31
+ name: rake
32
+ prerelease: false
33
+ type: :runtime
35
34
  requirement: *id001
36
35
  - !ruby/object:Gem::Dependency
37
- type: :development
38
- prerelease: false
39
- name: test-unit
40
36
  version_requirements: &id002 !ruby/object:Gem::Requirement
41
37
  none: false
42
38
  requirements:
@@ -46,11 +42,11 @@ dependencies:
46
42
  segments:
47
43
  - 0
48
44
  version: "0"
45
+ name: yard
46
+ prerelease: false
47
+ type: :runtime
49
48
  requirement: *id002
50
49
  - !ruby/object:Gem::Dependency
51
- type: :development
52
- prerelease: false
53
- name: test-unit-notify
54
50
  version_requirements: &id003 !ruby/object:Gem::Requirement
55
51
  none: false
56
52
  requirements:
@@ -60,11 +56,11 @@ dependencies:
60
56
  segments:
61
57
  - 0
62
58
  version: "0"
59
+ name: rubyforge
60
+ prerelease: false
61
+ type: :runtime
63
62
  requirement: *id003
64
63
  - !ruby/object:Gem::Dependency
65
- type: :development
66
- prerelease: false
67
- name: rake
68
64
  version_requirements: &id004 !ruby/object:Gem::Requirement
69
65
  none: false
70
66
  requirements:
@@ -74,11 +70,11 @@ dependencies:
74
70
  segments:
75
71
  - 0
76
72
  version: "0"
73
+ name: test-unit
74
+ prerelease: false
75
+ type: :development
77
76
  requirement: *id004
78
77
  - !ruby/object:Gem::Dependency
79
- type: :development
80
- prerelease: false
81
- name: jeweler
82
78
  version_requirements: &id005 !ruby/object:Gem::Requirement
83
79
  none: false
84
80
  requirements:
@@ -88,11 +84,11 @@ dependencies:
88
84
  segments:
89
85
  - 0
90
86
  version: "0"
87
+ name: test-unit-notify
88
+ prerelease: false
89
+ type: :development
91
90
  requirement: *id005
92
91
  - !ruby/object:Gem::Dependency
93
- type: :development
94
- prerelease: false
95
- name: yard
96
92
  version_requirements: &id006 !ruby/object:Gem::Requirement
97
93
  none: false
98
94
  requirements:
@@ -102,7 +98,24 @@ dependencies:
102
98
  segments:
103
99
  - 0
104
100
  version: "0"
101
+ name: jeweler
102
+ prerelease: false
103
+ type: :development
105
104
  requirement: *id006
105
+ - !ruby/object:Gem::Dependency
106
+ version_requirements: &id007 !ruby/object:Gem::Requirement
107
+ none: false
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ hash: 3
112
+ segments:
113
+ - 0
114
+ version: "0"
115
+ name: RedCloth
116
+ prerelease: false
117
+ type: :development
118
+ requirement: *id007
106
119
  description: |
107
120
  Packnga is an library to translate to many languages by YARD.
108
121
 
@@ -128,7 +141,6 @@ files:
128
141
  - lib/packnga/release-task.rb
129
142
  - lib/packnga/version.rb
130
143
  - lib/packnga/yard-task.rb
131
- has_rdoc: true
132
144
  homepage: http://groonga.rubyforge.org/
133
145
  licenses:
134
146
  - LGPLv2
@@ -158,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
170
  requirements: []
159
171
 
160
172
  rubyforge_project: groonga
161
- rubygems_version: 1.3.7
173
+ rubygems_version: 1.7.2
162
174
  signing_key:
163
175
  specification_version: 3
164
176
  summary: An utility library to package i18n-ed library.