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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 40c6fa8bfc508ba077015ecabd24ed84585edd2a
4
- data.tar.gz: b2de7d731cdc5a4e845cc7768bc10fd32e1facb2
3
+ metadata.gz: 722a8096832c7a5f54ae23aab76cbddb0744b25f
4
+ data.tar.gz: 3f63ca7694d8bf5159a14684c82f9b7b1559a5b7
5
5
  SHA512:
6
- metadata.gz: f48824619f36a1c9874d5cc6353200db9981b69f687a61749385a4fa54d1b7edf24056728da3b5bd07d03eac3ddbf4c5c2ba061f2c94f31ed0c94d6485e7dee4
7
- data.tar.gz: fd0a505d4bb2ff870bc874e3c69783e0290b1280682695bf59df917e019305b4593f5b70aa07db37655353b38d91bbbde57ecec7f09f1bb56acf7583ab52ef05
6
+ metadata.gz: af6934a8aeaaa49615518143b2a9764b1e960f35634365a7784cea269c2d9ba02c48d3c63050d6b5401cc48b4e59ba9435954e843c54c610ee728285526c52d9
7
+ data.tar.gz: 00428e151fda05dd168cda73a4dab4764112d9cd234166caea8bd263055524a4d2192a203263eb4a5e6e9938bc6a182c3214a36405c3728be7677a167feaa03e
data/Rakefile CHANGED
@@ -19,7 +19,7 @@ Hoe.spec 'pluto-tasks' do
19
19
 
20
20
  self.extra_deps = [
21
21
  ['pluto-models', '>= 1.3.2'],
22
- ['pluto-update', '>= 1.3.0'],
22
+ ['pluto-update', '>= 1.4.0'],
23
23
  ]
24
24
 
25
25
  self.licenses = ['Public Domain']
@@ -3,7 +3,7 @@
3
3
  module PlutoTasks
4
4
 
5
5
  MAJOR = 1
6
- MINOR = 3
6
+ MINOR = 4
7
7
  PATCH = 0
8
8
  VERSION = [MAJOR,MINOR,PATCH].join('.')
9
9
 
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
- ## Note: Pluto includes its own Fetcher, thus, use ::Fetcher!!
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
- res = worker.get_response( shortcut['source'] )
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
@@ -12,7 +12,7 @@ require 'helper'
12
12
  class TestFetch < MiniTest::Test
13
13
 
14
14
  def test_ruby
15
- config = Pluto.fetch_config_for( 'ruby')
15
+ config = Pluto.fetch_config_for( 'ruby' )
16
16
  pp config
17
17
 
18
18
  assert true ## if we get here it should work
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.3.0
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-01 00:00:00.000000000 Z
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.3.0
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.3.0
40
+ version: 1.4.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rdoc
43
43
  requirement: !ruby/object:Gem::Requirement