rake-xpi 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d60a684cce8c1c3c3b07d86dc84d5999e3deef03
4
- data.tar.gz: ffe2f1f3b458222908d9150a8faf1a2cbf840ab8
3
+ metadata.gz: 31379f61ff042eb9ab89212a8de7144ab1430511
4
+ data.tar.gz: b37f74ad3dcbedd3920e15d3b85b6a4b4b14d766
5
5
  SHA512:
6
- metadata.gz: 3b49f20dc385004ca62d5f375af31f0620de1e77b75d7931f3934acfa3e306261b348af05057f93f860270910370854230e32093613ebe92eabd999b7305091f
7
- data.tar.gz: c3620afe3546bb7f3d7baa02c9c5d47c7e5763e50c60284e929b019b4a1db4c338fe9f9e0283c479f209c8dc6463bb687262c4f92e832406a878e92ce86501f6
6
+ metadata.gz: c71f05fb95eac19dd0463f7f7a25c956003b669859113e30a8cdb55fc990660127939457573e5b3d699cf1408009372008ef11d35844779ae38ff7fa0acc9483
7
+ data.tar.gz: a6022bd8b44504e1e2cf625b132af25a8118841be8197c060843969da3ac0705aea994479cacf44b8a70a424764ff920caf49a4b7734be30a8fb0c1f1f12714c
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
1
  pkg
2
2
  test.*
3
3
  install.rdf
4
+ xpi.yml
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rake-xpi (0.0.6)
4
+ rake-xpi (0.0.7)
5
5
  aws-sdk
6
6
  github_api
7
7
  jwt
@@ -68,10 +68,11 @@ module Rake
68
68
  end
69
69
  end
70
70
 
71
- def update_rdf(link)
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 link }
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
- STDERR.puts "Published to " + XPI.publish
370
+ XPI.publish
371
+ STDERR.puts "Published to #{XPI.xpi_url}"
369
372
  end
370
373
  end
@@ -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(download){|update|
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
@@ -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.6'
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}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake-xpi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emiliano Heyns