packnga 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 848b1be64a579122d8a4eeccd48c61a90e4db116
4
- data.tar.gz: ed45b3a765ae346c8fb0f75546c419d0559620d6
3
+ metadata.gz: 18ab7c644f549e9dedfee3d2f81c0b418a7faff6
4
+ data.tar.gz: 3c271fd6c95afe4e92c7940e4884c37dee55eade
5
5
  SHA512:
6
- metadata.gz: f880d086539780e2e37b2e3bc6387d52b4577ab24a247b05dbfa52d2e5fc9e905d5bce12f5504538f9937c01d57e643342c80bf6ee27ec200f879ffd83f53c47
7
- data.tar.gz: d0094013b6f63b583d0131d86cc39f79bfcafc623712aad58634d08bde367d199a30a2ad9dfa1bd35bd4fcdbaa074818b3c5c6c0c1e1d5b1a1d3a7c0fc17e3f0
6
+ metadata.gz: 65ee4f4adc778abe45c30d77d3e20005f93cfb066ee6105984cbc3d3333648f88bc3c7a80f340114efcbb6779cb6cc08c0b7f9dd956378b03ea49774f45f3559
7
+ data.tar.gz: 696170d7064ea4890b7dd113892c0b2cb301dc1a698c3d9b9cf13fc4297daf987e802f22360bfca13cea7657ed666d24b67b1e60e02019c47dcdb7267b1b9469
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8; mode: ruby -*-
2
2
  #
3
3
  # Copyright (C) 2011-2013 Haruka Yoshihara <yoshihara@clear-code.com>
4
- # Copyright (C) 2011 Kouhei Sutou <kou@clear-code.com>
4
+ # Copyright (C) 2011-2016 Kouhei Sutou <kou@clear-code.com>
5
5
  #
6
6
  # This library is free software; you can redistribute it and/or
7
7
  # modify it under the terms of the GNU Lesser General Public
@@ -38,11 +38,6 @@ def helper.version_tag
38
38
  end
39
39
 
40
40
  spec = helper.gemspec
41
- Rake::Task["release"].prerequisites.clear
42
-
43
- Gem::PackageTask.new(spec) do |pkg|
44
- pkg.need_tar_gz = true
45
- end
46
41
 
47
42
  Packnga::DocumentTask.new(spec) do |task|
48
43
  task.original_language = "en"
@@ -1,5 +1,11 @@
1
1
  h1. NEWS
2
2
 
3
+ h2(#1-0-2). 1.0.2: 2016-01-22
4
+
5
+ h3. Improvements
6
+
7
+ * Stopped to require template files.
8
+
3
9
  h2(#1-0-1). 1.0.1: 2014-10-19
4
10
 
5
11
  h3. Improvements
@@ -308,17 +308,28 @@ module Packnga
308
308
  content = content.gsub(/lang="en"/, "lang=\"#{language}\"")
309
309
 
310
310
  title = nil
311
- content = content.gsub(/<title>(.+?)<\/title>/m) do
311
+ content = content.gsub(/<title>(.+?)<\/title>/m) do |matched_text|
312
312
  title = $1
313
- templates[:head].result(binding)
313
+ head_template = templates[:head]
314
+ if head_template
315
+ head_template.result(binding)
316
+ else
317
+ matched_text
318
+ end
314
319
  end
315
320
 
316
- content = content.gsub(/<body(?:.*?)>/) do |body_start|
317
- "#{body_start}\n#{templates[:header].result(binding)}\n"
321
+ header_template = templates[:header]
322
+ if header_template
323
+ content = content.gsub(/<body(?:.*?)>/) do |body_start|
324
+ "#{body_start}\n#{header_template.result(binding)}\n"
325
+ end
318
326
  end
319
327
 
320
- content = content.gsub(/<\/body/) do |body_end|
321
- "\n#{templates[:footer].result(binding)}\n#{body_end}"
328
+ footer_template = templates[:footer]
329
+ if footer_template
330
+ content = content.gsub(/<\/body/) do |body_end|
331
+ "\n#{footer_template.result(binding)}\n#{body_end}"
332
+ end
322
333
  end
323
334
 
324
335
  content
@@ -326,6 +337,7 @@ module Packnga
326
337
 
327
338
  def erb_template(name)
328
339
  file = File.join("doc/templates", "#{name}.html.erb")
340
+ return nil unless File.exist?(file)
329
341
  template = File.read(file)
330
342
  erb = ERB.new(template, nil, "-")
331
343
  erb.filename = file
@@ -2,6 +2,7 @@
2
2
  #
3
3
  # Copyright (C) 2011 Haruka Yoshihara <yoshihara@clear-code.com>
4
4
  # Copyright (C) 2011-2014 Kouhei Sutou <kou@clear-code.com>
5
+ # Copyright (C) 2014 Masafumi Yokoyama <myokoym@gmail.com>
5
6
  #
6
7
  # This library is free software; you can redistribute it and/or
7
8
  # modify it under the terms of the GNU Lesser General Public
@@ -18,5 +19,5 @@
18
19
 
19
20
  module Packnga
20
21
  # Packnga version.
21
- VERSION = "1.0.1"
22
+ VERSION = "1.0.2"
22
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: packnga
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Haruka Yoshihara
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-10-19 00:00:00.000000000 Z
12
+ date: 2016-01-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -172,13 +172,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
172
172
  version: '0'
173
173
  requirements: []
174
174
  rubyforge_project:
175
- rubygems_version: 2.2.2
175
+ rubygems_version: 2.4.5.1
176
176
  signing_key:
177
177
  specification_version: 4
178
178
  summary: An utility library to package i18n-ed library.
179
179
  test_files:
180
- - test/test-reference-task.rb
181
- - test/test-release-task.rb
182
- - test/test-document-task.rb
183
180
  - test/run-test.rb
181
+ - test/test-document-task.rb
182
+ - test/test-release-task.rb
183
+ - test/test-reference-task.rb
184
184
  has_rdoc: