pluto-tasks 1.5.2 → 1.5.3
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 +4 -4
- data/lib/pluto/tasks.rb +42 -1
- data/lib/pluto/tasks/setup.rake +8 -7
- data/lib/pluto/tasks/version.rb +1 -1
- data/test/helper.rb +1 -1
- data/test/test_fetch.rb +1 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e41a15181694afc46c037a9ad0197020764838e3
|
4
|
+
data.tar.gz: 38ea06d45a3fa6cf8b5c7deab5174b83d3b02e5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8cae1dd11090ae52ee9575d710a0393d12157a5bb1599950ae1bdb9e7cef97b447697f8460c2ebe3411b14b49137950d00a7711c012930780c2f16e3775e3e0
|
7
|
+
data.tar.gz: 198c73f224a5821911287251b552123a7c74911fb6e2d4d0202ffa5b389b028f07477c37f287199a5f4aeaf836ce2ed45ee603419431e47d2304b3fdb4c3195d
|
data/lib/pluto/tasks.rb
CHANGED
@@ -49,7 +49,7 @@ module Pluto
|
|
49
49
|
|
50
50
|
###
|
51
51
|
## todo/fix: move to pluto-update for (re)use !!!!
|
52
|
-
def self.
|
52
|
+
def self.no_longer_used__fetch_config_for__delete_why_why_not( key )
|
53
53
|
###
|
54
54
|
## todo:
|
55
55
|
## move into a method for (re)use
|
@@ -71,6 +71,47 @@ module Pluto
|
|
71
71
|
end # method fetch_config_for
|
72
72
|
|
73
73
|
|
74
|
+
## todo: use a better name? setup_planet_for ?? other name??
|
75
|
+
def self.setup_planet( key )
|
76
|
+
puts "trying to fetch pluto.index.ini shortcut planet registry..."
|
77
|
+
|
78
|
+
index_txt = fixme_fetcher_read_utf8!( 'https://raw.githubusercontent.com/feedreader/planets/master/planets.ini' )
|
79
|
+
shortcuts = INI.load( index_txt )
|
80
|
+
pp shortcuts
|
81
|
+
|
82
|
+
shortcut = shortcuts[key]
|
83
|
+
if shortcut.nil?
|
84
|
+
puts "sorry; no planet shortcut found for key >#{key}<"
|
85
|
+
exit 1
|
86
|
+
end
|
87
|
+
|
88
|
+
i=1
|
89
|
+
loop do
|
90
|
+
config_url = shortcut[ "source#{i}" ]
|
91
|
+
break if config_url.nil?
|
92
|
+
|
93
|
+
## "calc" key from url
|
94
|
+
# https://raw.github.com/feedreader/planet-ruby/gh-pages/ruby-news.ini
|
95
|
+
# get last entry e.g. ruby-news.ini
|
96
|
+
## remove -_ chars
|
97
|
+
## e.g. jekyll-meta becomes jekyllmeta etc.
|
98
|
+
|
99
|
+
config_key = config_url[ (config_url.rindex('/')+1)..-1 ]
|
100
|
+
config_key = config_key.sub( '.ini', '' ) # remove .ini extension
|
101
|
+
config_key = config_key.gsub( /[\-_]/, '' ) # remove -_ chars
|
102
|
+
|
103
|
+
config_txt = InclPreproc.from_url( config_url ).read
|
104
|
+
config = INI.load( config_txt )
|
105
|
+
|
106
|
+
puts "dump planet setup settings:"
|
107
|
+
pp config
|
108
|
+
# note: allow multiple planets (sites) for a single install
|
109
|
+
Pluto::Model::Site.deep_create_or_update_from_hash!( config_key, config )
|
110
|
+
|
111
|
+
i+=1
|
112
|
+
end
|
113
|
+
end # method setup_planet
|
114
|
+
|
74
115
|
end # module Pluto
|
75
116
|
|
76
117
|
|
data/lib/pluto/tasks/setup.rake
CHANGED
@@ -25,15 +25,16 @@ task :setup => :environment do
|
|
25
25
|
config_path = "./#{key}.ini"
|
26
26
|
if File.exists?( config_path )
|
27
27
|
config = INI.load_file( config_path )
|
28
|
+
|
29
|
+
puts "dump planet setup settings:"
|
30
|
+
pp config
|
31
|
+
# note: allow multiple planets (sites) for a single install
|
32
|
+
Pluto::Model::Site.deep_create_or_update_from_hash!( key, config )
|
33
|
+
|
28
34
|
else ## try download shortcut index list and fetch planet config
|
29
|
-
|
35
|
+
Pluto.setup_planet( key )
|
30
36
|
end
|
31
37
|
|
32
|
-
puts "dump planet setup settings:"
|
33
|
-
pp config
|
34
|
-
|
35
|
-
# note: allow multiple planets (sites) for a single install
|
36
|
-
Pluto::Model::Site.deep_create_or_update_from_hash!( key, config )
|
37
|
-
|
38
38
|
puts 'Done.'
|
39
39
|
end
|
40
|
+
|
data/lib/pluto/tasks/version.rb
CHANGED
data/test/helper.rb
CHANGED
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.5.
|
4
|
+
version: 1.5.3
|
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-
|
11
|
+
date: 2015-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pluto-models
|