pluto-tasks 1.5.2 → 1.5.3

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: 5d7cba3bb0c0ddfba66ac6598f29d21da93846ab
4
- data.tar.gz: c7997217d7a2e69140edccb4b2db11d1bc6a267b
3
+ metadata.gz: e41a15181694afc46c037a9ad0197020764838e3
4
+ data.tar.gz: 38ea06d45a3fa6cf8b5c7deab5174b83d3b02e5d
5
5
  SHA512:
6
- metadata.gz: 3dd9015f1cb44fd9a813b73991467ad828a90e41554f59f5ab0eb926d6efda21aa072aeb784033aa18f21d3bf74f6cb09adafe5112899179a18784a4927a988c
7
- data.tar.gz: c01f848cb80fb83fe4a8d3431665f7ffd1a13f73e6a7b029476918284320ade0e408dc30903e35530a7d0c37250bf4fcc926f639e8f73a09e03a1560dc7fbb40
6
+ metadata.gz: c8cae1dd11090ae52ee9575d710a0393d12157a5bb1599950ae1bdb9e7cef97b447697f8460c2ebe3411b14b49137950d00a7711c012930780c2f16e3775e3e0
7
+ data.tar.gz: 198c73f224a5821911287251b552123a7c74911fb6e2d4d0202ffa5b389b028f07477c37f287199a5f4aeaf836ce2ed45ee603419431e47d2304b3fdb4c3195d
@@ -49,7 +49,7 @@ module Pluto
49
49
 
50
50
  ###
51
51
  ## todo/fix: move to pluto-update for (re)use !!!!
52
- def self.fetch_config_for( key )
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
 
@@ -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
- config = Pluto.fetch_config_for( key )
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
+
@@ -4,7 +4,7 @@ module PlutoTasks
4
4
 
5
5
  MAJOR = 1
6
6
  MINOR = 5
7
- PATCH = 2
7
+ PATCH = 3
8
8
  VERSION = [MAJOR,MINOR,PATCH].join('.')
9
9
 
10
10
  def self.version
@@ -24,4 +24,4 @@ Item = Pluto::Model::Item
24
24
  Subscription = Pluto::Model::Subscription
25
25
 
26
26
 
27
- ### Pluto.setup_in_memory_db
27
+ Pluto.setup_in_memory_db
@@ -12,8 +12,7 @@ require 'helper'
12
12
  class TestFetch < MiniTest::Test
13
13
 
14
14
  def test_ruby
15
- config = Pluto.fetch_config_for( 'ruby' )
16
- pp config
15
+ Pluto.setup_planet( 'ruby' )
17
16
 
18
17
  assert true ## if we get here it should work
19
18
  end
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.2
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-01-18 00:00:00.000000000 Z
11
+ date: 2015-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pluto-models