packnga 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -25,6 +25,13 @@ require 'rubygems/package_task'
25
25
  require "rake/clean"
26
26
  require 'jeweler'
27
27
 
28
+ if YAML.const_defined?(:ENGINE)
29
+ begin
30
+ YAML::ENGINE.yamler = "psych"
31
+ rescue LoadError
32
+ end
33
+ end
34
+
28
35
  base_dir = File.join(File.dirname(__FILE__))
29
36
 
30
37
  packnga_lib_dir = File.join(base_dir, 'lib')
@@ -1,5 +1,22 @@
1
1
  h1. NEWS
2
2
 
3
+ h2. 0.9.1: 2011-08-25
4
+
5
+ h3. Improvements
6
+
7
+ * created package in rubyforge if package isn't created.
8
+ * added Packnga::ReleaseTask#tag_message.
9
+ * added Packnga::ReleaseTask#publish_options.
10
+ * added attribute in DocumentTask for getting .htaccess file path.
11
+ * added reference:publicaton:generate.
12
+ (This task is run after prepareing to publish references.)
13
+
14
+ h3. Fixes
15
+
16
+ * checked group_ids before add_releasing tar.gz to rubyforge.
17
+ * wrote only sentence for redirect to english page in .htaccess file.
18
+ (don't write sentence for redirect tutorial page.)
19
+
3
20
  h2. 0.9.0: 2011-08-19
4
21
 
5
22
  The first release!
@@ -65,6 +65,10 @@ module Packnga
65
65
  yield(@reference_task)
66
66
  end
67
67
 
68
+ def htaccess
69
+ @reference_task.htaccess
70
+ end
71
+
68
72
  private
69
73
  def set_default_values
70
74
  end
@@ -33,6 +33,7 @@ module Packnga
33
33
  @translate_languages = nil
34
34
  @supported_languages = nil
35
35
  @html_files = nil
36
+ @htaccess = nil
36
37
  @po_dir = nil
37
38
  @pot_file = nil
38
39
  if block_given?
@@ -47,16 +48,19 @@ module Packnga
47
48
  define_tasks
48
49
  end
49
50
 
51
+ # path of .htaccess.
52
+ def htaccess
53
+ html_reference_dir + ".htaccess"
54
+ end
55
+
50
56
  private
51
57
  def set_default_values
52
58
  @base_dir ||= Pathname.new("doc")
53
59
  @translate_languages ||= [:ja]
54
60
  @supported_languages = [:en, *@translate_languages]
55
61
  @html_files = FileList[(doc_en_dir + "**/*.html").to_s].to_a
56
-
57
62
  @po_dir = "doc/po"
58
63
  @pot_file = "#{@po_dir}/#{@spec.name}.pot"
59
-
60
64
  end
61
65
 
62
66
  def reference_base_dir
@@ -89,7 +93,10 @@ module Packnga
89
93
  namespace :pot do
90
94
  directory @po_dir
91
95
  file @pot_file => [@po_dir, *@html_files] do |t|
92
- sh("xml2po", "--keep-entities", "--output", t.name, *@html_files)
96
+ sh("xml2po",
97
+ "--keep-entities",
98
+ "--output", t.name,
99
+ *@html_files)
93
100
  end
94
101
 
95
102
  desc "Generates pot file."
@@ -106,7 +113,10 @@ module Packnga
106
113
 
107
114
  if File.exist?(po_file)
108
115
  file po_file => @html_files do |t|
109
- sh("xml2po", "--keep-entities", "--update", t.name, *@html_files)
116
+ sh("xml2po",
117
+ "--keep-entities",
118
+ "--update", t.name,
119
+ *@html_files)
110
120
  end
111
121
  else
112
122
  file po_file => @pot_file do |t|
@@ -222,13 +232,13 @@ module Packnga
222
232
  end
223
233
  end
224
234
  end
225
- File.open("#{html_reference_dir}/.htaccess", "w") do |file|
226
- file.puts("Redirect permanent /#{@spec.name}/text/TUTORIAL_ja_rdoc.html " +
227
- "#{@spec.homepage}#{@spec.name}/ja/file.tutorial.html")
235
+ File.open(htaccess, "w") do |file|
228
236
  file.puts("RedirectMatch permanent ^/#{@spec.name}/$ " +
229
237
  "#{@spec.homepage}#{@spec.name}/en/")
230
238
  end
231
239
  end
240
+
241
+ task :generate => ["reference:generate", "reference:publication:prepare"]
232
242
  end
233
243
  end
234
244
 
@@ -33,6 +33,12 @@ module Packnga
33
33
  # This attribute is path of base directory of document.
34
34
  # @param [String] path of base directory of document
35
35
  attr_writer :base_dir
36
+ # This attribute is message when tagging in release.
37
+ # @param [String] message
38
+ attr_writer :tag_message
39
+ # This attribute is options for uploading rubyforge by rsync.
40
+ # @param [hash] options for uploading.
41
+ attr_writer :publish_options
36
42
  # Defines task for preparing to release.
37
43
  # Defined tasks update version and release-date in index files
38
44
  # and tag in git.
@@ -43,6 +49,8 @@ module Packnga
43
49
  @spec = spec
44
50
  @index_html_dir = nil
45
51
  @rubyforge = nil
52
+ @tag_messsage = nil
53
+ @publish_options = nil
46
54
  yield(self) if block_given?
47
55
  set_default_values
48
56
  define_tasks
@@ -60,6 +68,8 @@ module Packnga
60
68
  def set_default_values
61
69
  @index_html_dir ||= "doc/html"
62
70
  @base_dir ||= Pathname.new("doc")
71
+ @tag_message ||= 'release #{version}!!!'
72
+ @publish_options ||= {}
63
73
  end
64
74
 
65
75
  def define_tasks
@@ -115,7 +125,7 @@ module Packnga
115
125
  desc "Tag the current revision."
116
126
  task :tag do
117
127
  version = @spec.version
118
- sh("git tag -a #{version} -m 'release #{version}!!!'")
128
+ sh("git tag -a #{version} -m '#{@tag_message}'")
119
129
  end
120
130
  end
121
131
 
@@ -132,8 +142,8 @@ module Packnga
132
142
  def define_reference_task
133
143
  namespace :reference do
134
144
  desc "Upload document to rubyforge."
135
- task :publish => [:generate, "reference:publication:prepare"] do
136
- rsync_to_rubyforge(@spec, "#{html_reference_dir}/", @spec.name)
145
+ task :publish => "reference:publication:generate" do
146
+ rsync_to_rubyforge(@spec, "#{html_reference_dir}/", @spec.name, @publish_options)
137
147
  end
138
148
  end
139
149
  end
@@ -142,7 +152,7 @@ module Packnga
142
152
  namespace :html do
143
153
  desc "Publish HTML to Web site."
144
154
  task :publish do
145
- rsync_to_rubyforge(@spec, "#{html_base_dir}/", "")
155
+ rsync_to_rubyforge(@spec, "#{html_base_dir}/", "", @publish_options)
146
156
  end
147
157
  end
148
158
  end
@@ -160,6 +170,13 @@ module Packnga
160
170
  system("stty -echo")
161
171
  @rubyforge.userconfig["password"] = STDIN.gets.chomp
162
172
  system("stty echo")
173
+ if @rubyforge.autoconfig["group_ids"][@spec.rubyforge_project].nil?
174
+ @rubyforge.scrape_config
175
+ @rubyforge.save_autoconfig
176
+ end
177
+ if @rubyforge.autoconfig["package_ids"][@spec.name].nil?
178
+ @rubyforge.create_package(@rubyforge.autoconfig["group_ids"][@spec.rubyforge_project], @spec.name)
179
+ end
163
180
  @rubyforge.add_release(@spec.rubyforge_project,
164
181
  @spec.name,
165
182
  @spec.version.to_s,
@@ -173,8 +190,10 @@ module Packnga
173
190
  def rsync_to_rubyforge(spec, source, destination, options={})
174
191
  host = "#{@rubyforge.userconfig["username"]}@rubyforge.org"
175
192
 
176
- rsync_args = "-av --dry-run --exclude '*.erb' --chmod=ug+w"
193
+ rsync_args = "-av --exclude '*.erb' --chmod=ug+w"
194
+ rsync_args << " --group=#{spec.rubyforge_project}"
177
195
  rsync_args << " --delete" if options[:delete]
196
+ rsync_args << " --dry-run" if options[:dryrun]
178
197
  remote_dir = "/var/www/gforge-projects/#{spec.rubyforge_project}/"
179
198
  sh("rsync #{rsync_args} #{source} #{host}:#{remote_dir}#{destination}")
180
199
  end
@@ -17,5 +17,5 @@
17
17
 
18
18
  module Packnga
19
19
  # Packnga version.
20
- VERSION = "0.9.0"
20
+ VERSION = "0.9.1"
21
21
  end
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: 59
4
+ hash: 57
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 0
10
- version: 0.9.0
9
+ - 1
10
+ version: 0.9.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Haruka Yoshihara
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-08-19 00:00:00 +09:00
19
+ date: 2011-08-25 00:00:00 +09:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency