rake-xpi 0.0.6 → 0.0.7
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 +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +1 -1
- data/lib/rake/xpi.rb +6 -3
- data/lib/rake/xpi/github.rb +8 -4
- data/rake-xpi.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31379f61ff042eb9ab89212a8de7144ab1430511
|
4
|
+
data.tar.gz: b37f74ad3dcbedd3920e15d3b85b6a4b4b14d766
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c71f05fb95eac19dd0463f7f7a25c956003b669859113e30a8cdb55fc990660127939457573e5b3d699cf1408009372008ef11d35844779ae38ff7fa0acc9483
|
7
|
+
data.tar.gz: a6022bd8b44504e1e2cf625b132af25a8118841be8197c060843969da3ac0705aea994479cacf44b8a70a424764ff920caf49a4b7734be30a8fb0c1f1f12714c
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/lib/rake/xpi.rb
CHANGED
@@ -68,10 +68,11 @@ module Rake
|
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
|
-
def update_rdf
|
71
|
+
def update_rdf
|
72
72
|
_id = self.id
|
73
73
|
_release = self.release
|
74
74
|
_changelog = self.changelog
|
75
|
+
_link = self.xpi_url
|
75
76
|
|
76
77
|
update = Nokogiri::XML::Builder.new { |xml|
|
77
78
|
xml.RDF('xmlns:RDF'=>'http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'xmlns:em' =>
|
@@ -90,7 +91,7 @@ module Rake
|
|
90
91
|
xml['em'].id { xml.text target.at('./em:id').inner_text }
|
91
92
|
xml['em'].minVersion { xml.text target.at('./em:minVersion').inner_text }
|
92
93
|
xml['em'].maxVersion { xml.text target.at('./em:maxVersion').inner_text }
|
93
|
-
xml['em'].updateLink { xml.text
|
94
|
+
xml['em'].updateLink { xml.text _link }
|
94
95
|
xml['em'].updateInfoURL { xml.text _changelog }
|
95
96
|
}
|
96
97
|
}
|
@@ -324,6 +325,7 @@ file XPI.xpi => XPI.files do |t|
|
|
324
325
|
when 'install.rdf'
|
325
326
|
install_rdf = Nokogiri::XML(File.open(src))
|
326
327
|
install_rdf.at('//em:version').content = XPI.version
|
328
|
+
install_rdf.at('//em:updateURL').content = XPI.update_url
|
327
329
|
zipfile.get_output_stream(src){|f| install_rdf.write_xml_to f }
|
328
330
|
else
|
329
331
|
zipfile.add(src, src)
|
@@ -365,6 +367,7 @@ end
|
|
365
367
|
task :publish => XPI.xpi do
|
366
368
|
if !XPI.pull_request
|
367
369
|
STDERR.puts "Publishing #{XPI.release_build? ? 'release' : 'debug'} build #{XPI.versioned_xpi}"
|
368
|
-
|
370
|
+
XPI.publish
|
371
|
+
STDERR.puts "Published to #{XPI.xpi_url}"
|
369
372
|
end
|
370
373
|
end
|
data/lib/rake/xpi/github.rb
CHANGED
@@ -32,6 +32,13 @@ module Rake
|
|
32
32
|
})
|
33
33
|
end
|
34
34
|
|
35
|
+
def update_url
|
36
|
+
return "https://github.com/#{@config.github.user}/#{@config.github.repo}/releases/download/update.rdf/update.rdf"
|
37
|
+
end
|
38
|
+
def xpi_url
|
39
|
+
return "https://github.com/#{@config.github.user}/#{@config.github.repo}/releases/download/#{release.name}/#{self.versioned_xpi}"
|
40
|
+
end
|
41
|
+
|
35
42
|
def publish
|
36
43
|
raise "Github publishing not configured" unless @config.github && @config.github.user && @config.github.token
|
37
44
|
token = ENV[@config.github.token]
|
@@ -57,7 +64,6 @@ module Rake
|
|
57
64
|
content_type: 'application/x-xpinstall'
|
58
65
|
})
|
59
66
|
|
60
|
-
download = "https://github.com/#{@config.github.user}/#{@config.github.repo}/releases/download/#{release.name}/#{self.versioned_xpi}"
|
61
67
|
if release_build?
|
62
68
|
release = get_stable_release('update.rdf', false)
|
63
69
|
# Remove any existing assets
|
@@ -65,15 +71,13 @@ module Rake
|
|
65
71
|
@github.repos.releases.assets.delete(@config.github.user, @config.github.repo, asset.id)
|
66
72
|
}
|
67
73
|
|
68
|
-
update_rdf
|
74
|
+
update_rdf{|update|
|
69
75
|
@releases.assets.upload(@config.github.user, @config.github.repo, release.id, update, {
|
70
76
|
name: 'update.rdf',
|
71
77
|
content_type: 'application/rdf+xml'
|
72
78
|
})
|
73
79
|
}
|
74
80
|
end
|
75
|
-
|
76
|
-
return download
|
77
81
|
end
|
78
82
|
end
|
79
83
|
end
|
data/rake-xpi.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "rake-xpi"
|
7
|
-
spec.version = '0.0.
|
7
|
+
spec.version = '0.0.7'
|
8
8
|
spec.authors = ["Emiliano Heyns"]
|
9
9
|
spec.email = ["Emiliano.Heyns@iris-advies.com"]
|
10
10
|
spec.description = %q{rake helper to build XPI files}
|