zotplus-rakehelper 0.0.18 → 0.0.19

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: c65ab8621660299971f02621d43bdd8965ed12da
4
- data.tar.gz: 4bbdaf05e9a21c64b3c0d1c7fcf7c88e4de48ea1
3
+ metadata.gz: 16ee29247bf70af8b543a1d6182a2d9b8f52a2b7
4
+ data.tar.gz: b775d2876b3f9fe7c27b4a263766501baee93a6f
5
5
  SHA512:
6
- metadata.gz: aed7dce7e600fb46d67a99bf52fc4281f42753681a3cf016a88e84158aeedea8de636e63ac34b043f5707eecffc1a7107e6aca48aca1d825d371b762061475d4
7
- data.tar.gz: 5ab90061fcb229e81111b529cacae883e2ecc6c72c5a44ef4c373c4c8c3de1c818b35841608239005ec68d611902d2dee67cd8ca9cfb563fc4e8bd817cb13744
6
+ metadata.gz: bc61e44a411575945f32d1c9e1dcd74344cf59073ecd3a622bcd818a8d6ab5c35823294099c02c6a6be0639aea4325b433f6c66290fbed6f21fcad9cf3a37947
7
+ data.tar.gz: 8b20d22b06d5317b5bcb310316816984ddd989b6fea088e63c1a345ffb1838b358f4426e13c793673b38902a49e8b9952135ba8e38207fdc5b69c83e9b0fef1e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- zotplus-rakehelper (0.0.18)
4
+ zotplus-rakehelper (0.0.19)
5
5
  nokogiri
6
6
  rake
7
7
  rubyzip (>= 1.0.0)
@@ -4,7 +4,6 @@ require 'zip'
4
4
  require 'rake'
5
5
 
6
6
  SOURCES ||= []
7
- ZIPFILES ||= []
8
7
 
9
8
  %w{chrome test/import test/export resource defaults chrome.manifest install.rdf bootstrap.js}
10
9
  .collect{|f| File.directory?(f) ? Dir["#{f}/**/*"] : f}.flatten
@@ -18,29 +17,6 @@ EXTENSION = ID.gsub(/@.*/, '')
18
17
  RELEASE = Nokogiri::XML(File.open('install.rdf')).at('//em:version').inner_text
19
18
  XPI = "zotero-#{EXTENSION}-#{RELEASE}.xpi"
20
19
 
21
- def geturl(url)
22
- response = Typhoeus.get(url, {followlocation: true})
23
- raise "Request failed" unless response.success?
24
- return response.body
25
- end
26
-
27
- def download(url, file)
28
- puts "Downloading #{url} to #{file}"
29
- target = File.open(file, 'wb')
30
- request = Typhoeus::Request.new(url, {followlocation: true})
31
- request.on_headers do |response|
32
- raise "Request failed: #{response.code.to_s}" unless response.code == 200 # response.success?
33
- end
34
- request.on_body do |chunk|
35
- target.write(chunk)
36
- end
37
- request.on_complete do |response|
38
- target.close
39
- throw "download failed" unless response.success?
40
- end
41
- request.run
42
- end
43
-
44
20
  task 'README.md' => ['install.rdf', "www/#{EXTENSION}/index.md"] do |t|
45
21
  puts "Updating #{t.name}"
46
22
 
@@ -57,6 +33,9 @@ task 'README.md' => ['install.rdf', "www/#{EXTENSION}/index.md"] do |t|
57
33
  open(t.name, 'w'){|f| f.write(md) }
58
34
  end
59
35
 
36
+ task :default => XPI do
37
+ end
38
+
60
39
  task 'update.rdf' => 'install.rdf' do
61
40
  rdf = Nokogiri::XML(File.open(t.name))
62
41
  rdf.at('//em:version').content = RELEASE
@@ -123,3 +102,26 @@ task :publish => XPI
123
102
  system "git push"
124
103
  system "cd www; rake publish"
125
104
  end
105
+
106
+ def geturl(url)
107
+ response = Typhoeus.get(url, {followlocation: true})
108
+ raise "Request failed" unless response.success?
109
+ return response.body
110
+ end
111
+
112
+ def download(url, file)
113
+ puts "Downloading #{url} to #{file}"
114
+ target = File.open(file, 'wb')
115
+ request = Typhoeus::Request.new(url, {followlocation: true})
116
+ request.on_headers do |response|
117
+ raise "Request failed: #{response.code.to_s}" unless response.code == 200 # response.success?
118
+ end
119
+ request.on_body do |chunk|
120
+ target.write(chunk)
121
+ end
122
+ request.on_complete do |response|
123
+ target.close
124
+ throw "download failed" unless response.success?
125
+ end
126
+ request.run
127
+ end
@@ -1,5 +1,5 @@
1
1
  module ZotPlus
2
2
  class RakeHelper
3
- VERSION = "0.0.18"
3
+ VERSION = "0.0.19"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zotplus-rakehelper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.18
4
+ version: 0.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emiliano Heyns