pluto-tasks 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/lib/pluto/tasks/version.rb +1 -1
- data/lib/pluto/tasks.rb +28 -28
- data/test/test_fetch.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 722a8096832c7a5f54ae23aab76cbddb0744b25f
|
4
|
+
data.tar.gz: 3f63ca7694d8bf5159a14684c82f9b7b1559a5b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af6934a8aeaaa49615518143b2a9764b1e960f35634365a7784cea269c2d9ba02c48d3c63050d6b5401cc48b4e59ba9435954e843c54c610ee728285526c52d9
|
7
|
+
data.tar.gz: 00428e151fda05dd168cda73a4dab4764112d9cd234166caea8bd263055524a4d2192a203263eb4a5e6e9938bc6a182c3214a36405c3728be7677a167feaa03e
|
data/Rakefile
CHANGED
data/lib/pluto/tasks/version.rb
CHANGED
data/lib/pluto/tasks.rb
CHANGED
@@ -10,6 +10,31 @@ require 'pluto/update'
|
|
10
10
|
require 'pluto/tasks/version' # note: let version always get first
|
11
11
|
|
12
12
|
|
13
|
+
|
14
|
+
|
15
|
+
#############
|
16
|
+
### todo/fix: use/find better name? - e.g. Fetcher.read_utf8!() move out of global ns etc.
|
17
|
+
### e.g. use Fetch.read_utf8!() e.g. throws exception on error
|
18
|
+
## read_blob!()
|
19
|
+
def fixme_fetcher_read_utf8!( src )
|
20
|
+
worker = Fetcher::Worker.new
|
21
|
+
res = worker.get_response( src )
|
22
|
+
if res.code != '200'
|
23
|
+
puts "sorry; failed to fetch >#{src} - HTTP #{res.code} - #{res.message}"
|
24
|
+
exit 1
|
25
|
+
end
|
26
|
+
|
27
|
+
###
|
28
|
+
# Note: Net::HTTP will NOT set encoding UTF-8 etc.
|
29
|
+
# will be set to ASCII-8BIT == BINARY == Encoding Unknown; Raw Bytes Here
|
30
|
+
# thus, set/force encoding to utf-8
|
31
|
+
txt = res.body.to_s
|
32
|
+
txt = txt.force_encoding( Encoding::UTF_8 )
|
33
|
+
txt
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
|
13
38
|
module Pluto
|
14
39
|
|
15
40
|
def self.load_tasks
|
@@ -21,6 +46,7 @@ module Pluto
|
|
21
46
|
end
|
22
47
|
|
23
48
|
|
49
|
+
|
24
50
|
###
|
25
51
|
## todo/fix: move to pluto-update for (re)use !!!!
|
26
52
|
def self.fetch_config_for( key )
|
@@ -29,21 +55,7 @@ module Pluto
|
|
29
55
|
## move into a method for (re)use
|
30
56
|
puts "trying to fetch pluto.index.ini shortcut planet registry..."
|
31
57
|
|
32
|
-
|
33
|
-
worker = ::Fetcher::Worker.new
|
34
|
-
res = worker.get_response( 'https://raw.githubusercontent.com/feedreader/planets/master/pluto.index.ini' )
|
35
|
-
if res.code != '200'
|
36
|
-
puts "sorry; failed to fetch pluto.index - HTTP #{res.code} - #{res.message}"
|
37
|
-
exit 1
|
38
|
-
end
|
39
|
-
|
40
|
-
###
|
41
|
-
# Note: Net::HTTP will NOT set encoding UTF-8 etc.
|
42
|
-
# will be set to ASCII-8BIT == BINARY == Encoding Unknown; Raw Bytes Here
|
43
|
-
# thus, set/force encoding to utf-8
|
44
|
-
index_txt = res.body.dup.to_s
|
45
|
-
index_txt = index_txt.force_encoding( Encoding::UTF_8 )
|
46
|
-
|
58
|
+
index_txt = fixme_fetcher_read_utf8!( 'https://raw.githubusercontent.com/feedreader/planets/master/pluto.index.ini' )
|
47
59
|
shortcuts = INI.load( index_txt )
|
48
60
|
pp shortcuts
|
49
61
|
|
@@ -53,19 +65,7 @@ module Pluto
|
|
53
65
|
exit 1
|
54
66
|
end
|
55
67
|
|
56
|
-
|
57
|
-
if res.code != '200'
|
58
|
-
puts "sorry; failed to fetch planet config for >#{key}< - HTTP #{res.code} - #{res.message}"
|
59
|
-
exit 1
|
60
|
-
end
|
61
|
-
|
62
|
-
###
|
63
|
-
# Note: Net::HTTP will NOT set encoding UTF-8 etc.
|
64
|
-
# will be set to ASCII-8BIT == BINARY == Encoding Unknown; Raw Bytes Here
|
65
|
-
# thus, set/force encoding to utf-8
|
66
|
-
config_txt = res.body.dup.to_s
|
67
|
-
config_txt = config_txt.force_encoding( Encoding::UTF_8 )
|
68
|
-
|
68
|
+
config_txt = InclPreproc.from_url( shortcut['source'] ).read
|
69
69
|
config = INI.load( config_txt )
|
70
70
|
config
|
71
71
|
end # method fetch_config_for
|
data/test/test_fetch.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pluto-tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pluto-models
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.4.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
40
|
+
version: 1.4.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rdoc
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|