xpcomcore-rubygem 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -16,6 +16,8 @@ begin
16
16
  gem.files = (gem.files + FileList["xpcomcore/**/*"]).uniq
17
17
  gem.post_install_message = %Q[
18
18
 
19
+ Welcome to XPCOMCore.
20
+
19
21
  STEP 1. OBTAIN A PIG. THIS ONE WILL DO:
20
22
 
21
23
  _____
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.2
1
+ 0.5.3
@@ -6,6 +6,7 @@ module XPCOMCore
6
6
  class GenerateCommand
7
7
 
8
8
  class ApplicationCommand < JewelerBuilderCommand
9
+ BuilderTaskCode = "require 'xpcomcore-rubygem/tasks/application_task.rb'\nXPCOMCore::Tasks::ApplicationTask.new"
9
10
 
10
11
  def initialize
11
12
  super('application', false) # Doesn't take subcommands
@@ -19,10 +20,15 @@ module XPCOMCore
19
20
  with_rakefile_in(project_path) do |rakefile|
20
21
  add_jsdoc_toolkit_doc_task(rakefile, :task_name => "doc:app", :doc_dir => "xpcomcore/app/doc", :doc_paths => %w[xpcomcore/app/chrome xpcomcore/app/components])
21
22
  add_xultestrunner_test_task(rakefile, :task_name => "test:app", :test_libs => %w[xpcomcore/app/chrome], :test_pattern => "xpcomcore/app/test/**/*_test.js")
23
+ add_xpcomcore_application_build_task(rakefile)
22
24
  end
23
25
  copy_template_application(gem_name, project_path)
24
26
  end
25
27
 
28
+ def add_xpcomcore_application_build_task(rakefile)
29
+ append_to(rakefile, BuilderTaskCode)
30
+ end
31
+
26
32
  def copy_template_application(gem_name, project_path)
27
33
  template_vars = {'application.ini' => default_application_ini_values(gem_name),
28
34
  'chrome.manifest' => default_chrome_manifest_values(gem_name),
@@ -0,0 +1,48 @@
1
+ require 'rake'
2
+ require 'xpcomcore-rubygem'
3
+ require 'uuidtools'
4
+
5
+ module XPCOMCore
6
+ module Tasks
7
+ class ApplicationTask
8
+ IniLocation = "xpcomcore/app/application.ini"
9
+
10
+ def initialize(task_name = "xpcomcore:update_xul_application")
11
+ desc("Updates the embedded XUL application's application.ini file for release.")
12
+ task(task_name) { self.invoke }
13
+ # Adds this as a dependency to gemspec so it updates along with it.
14
+ task(:gemspec => task_name)
15
+ end
16
+
17
+ def invoke
18
+ @ini_file = Pathname(IniLocation)
19
+ raise("The ini file at '#{ini_file}' doesn't exist or is not writable.") unless @ini_file.exist? && @ini_file.writable?
20
+ @ini_file.open('r+') do |f|
21
+ write_build_id(f)
22
+ write_version(f)
23
+ end
24
+ end
25
+
26
+ private
27
+
28
+ def write_build_id(file)
29
+ file.rewind
30
+ contents = file.read
31
+ file.truncate(0)
32
+ build_id = UUIDTools::UUID.random_create
33
+ file.seek(0)
34
+ file.write(contents.sub(/^BuildID=.*$/, "BuildID=#{build_id}"))
35
+ end
36
+
37
+ def write_version(file)
38
+ file.rewind
39
+ contents = file.read
40
+ file.truncate(0)
41
+ version = File.read('VERSION').strip
42
+ file.seek(0)
43
+ file.write(contents.sub(/^Version=.*$/, "Version=#{version}"))
44
+ end
45
+
46
+ end # ApplicationTask
47
+ end # Tasks
48
+ end # XPCOMCore
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{xpcomcore-rubygem}
8
- s.version = "0.5.2"
8
+ s.version = "0.5.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["ggironda"]
12
- s.date = %q{2009-10-11}
12
+ s.date = %q{2009-10-12}
13
13
  s.default_executable = %q{xpcomcore}
14
14
  s.description = %q{Gem to allow for using XPCOMCore via RubyGems}
15
15
  s.email = %q{gabriel.gironda@gmail.com}
@@ -35,6 +35,7 @@ Gem::Specification.new do |s|
35
35
  "lib/xpcomcore-rubygem/commands/generate/library.rb",
36
36
  "lib/xpcomcore-rubygem/commands/generate/template_helpers.rb",
37
37
  "lib/xpcomcore-rubygem/commands/launch.rb",
38
+ "lib/xpcomcore-rubygem/tasks/application_task.rb",
38
39
  "templates/application/application.ini.erb",
39
40
  "templates/application/chrome/chrome.manifest.erb",
40
41
  "templates/application/chrome/content/xul/main_window.xul.erb",
@@ -84,6 +85,8 @@ Gem::Specification.new do |s|
84
85
  s.homepage = %q{http://github.com/gabrielg/xpcomcore-rubygem}
85
86
  s.post_install_message = %q{
86
87
 
88
+ Welcome to XPCOMCore.
89
+
87
90
  STEP 1. OBTAIN A PIG. THIS ONE WILL DO:
88
91
 
89
92
  _____
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xpcomcore-rubygem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ggironda
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-11 00:00:00 -05:00
12
+ date: 2009-10-12 00:00:00 -05:00
13
13
  default_executable: xpcomcore
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -88,6 +88,7 @@ files:
88
88
  - lib/xpcomcore-rubygem/commands/generate/library.rb
89
89
  - lib/xpcomcore-rubygem/commands/generate/template_helpers.rb
90
90
  - lib/xpcomcore-rubygem/commands/launch.rb
91
+ - lib/xpcomcore-rubygem/tasks/application_task.rb
91
92
  - templates/application/application.ini.erb
92
93
  - templates/application/chrome/chrome.manifest.erb
93
94
  - templates/application/chrome/content/xul/main_window.xul.erb
@@ -137,7 +138,7 @@ has_rdoc: true
137
138
  homepage: http://github.com/gabrielg/xpcomcore-rubygem
138
139
  licenses: []
139
140
 
140
- post_install_message: "\e[1m\e[31m\e[44m \n \n STEP 1. OBTAIN A PIG. THIS ONE WILL DO: \n \n _____ \n ^..^ \\9 \n (oo)_____/ \n WW WW Pig \n \e[0m\e[0m"
141
+ post_install_message: "\e[1m\e[31m\e[44m \n \n Welcome to XPCOMCore. \n \n STEP 1. OBTAIN A PIG. THIS ONE WILL DO: \n \n _____ \n ^..^ \\9 \n (oo)_____/ \n WW WW Pig \n \e[0m\e[0m"
141
142
  rdoc_options:
142
143
  - --charset=UTF-8
143
144
  require_paths: