pluto 0.9.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/Manifest.txt CHANGED
@@ -23,6 +23,10 @@ lib/pluto/models/utils.rb
23
23
  lib/pluto/refresher.rb
24
24
  lib/pluto/schema.rb
25
25
  lib/pluto/subscriber.rb
26
+ lib/pluto/tasks/env.rake
27
+ lib/pluto/tasks/setup.rake
28
+ lib/pluto/tasks/stats.rake
29
+ lib/pluto/tasks/update.rake
26
30
  lib/pluto/updater.rb
27
31
  lib/pluto/version.rb
28
32
  test/helper.rb
@@ -22,6 +22,9 @@ class Feed < ActiveRecord::Base
22
22
 
23
23
  ##################################
24
24
  # attribute reader aliases
25
+ #
26
+ # todo: check if we can use alias_method :name, :title - works for non-existing/on-demand-generated method too??
27
+
25
28
  def name() title; end # alias for title
26
29
  def description() summary; end # alias for summary -- also add descr shortcut??
27
30
  def link() url; end # alias for url
data/lib/pluto/schema.rb CHANGED
@@ -65,6 +65,18 @@ class CreateDb < ActiveRecord::Migration
65
65
  t.datetime :built # from feed lastBuiltDate(rss)
66
66
  t.datetime :touched # from feed updated(atom)
67
67
 
68
+ ### extras (move to array for custom fields or similar??)
69
+ t.string :github # github handle (optional)
70
+ t.string :twitter # twitter handle (optional)
71
+ t.string :avatar # gravator or hackergotchi handle (optional)
72
+
73
+ ### add class/kind field e.g.
74
+ # - personal feed/blog/site, that is, individual author
75
+ # - team blog/site
76
+ # - org (anization) or com(pany blog/site)
77
+ # - newsfeed (composite)
78
+ # - other (link blog?, podcast?) - why? why not??
79
+
68
80
  ############
69
81
  # filters
70
82
  t.string :includes # regex
@@ -91,10 +103,15 @@ class CreateDb < ActiveRecord::Migration
91
103
  t.timestamps # created_at, updated_at
92
104
  end
93
105
 
106
+
94
107
  create_table :items do |t|
95
- t.string :title # todo: add some :null => false ??
96
108
  t.string :guid
97
109
  t.string :url
110
+
111
+ ## note: title may contain more than 255 chars!! use text for sure!
112
+ ## e.g. Rails Girls blog has massive titles in feed
113
+
114
+ t.text :title # todo: add some :null => false ??
98
115
  t.text :summary # e.g. description (rss), summary (atom)
99
116
  t.text :content
100
117
 
@@ -0,0 +1,25 @@
1
+
2
+
3
+ task :env do
4
+ LogUtils::Logger.root.level = :debug
5
+
6
+ Pluto.connect!
7
+ end
8
+
9
+
10
+ #########
11
+ # for debugging
12
+
13
+ desc 'pluto - debug site setup'
14
+ task :site => :env do
15
+ site = Pluto::Models::Site.first # FIX: for now assume one planet per DB (fix later; allow planet key or similar)
16
+ if site.present?
17
+ puts "site found:"
18
+ pp site
19
+ else
20
+ puts "no site found"
21
+ end
22
+ end
23
+
24
+ ### todo: add new task :sites
25
+
@@ -0,0 +1,40 @@
1
+
2
+
3
+ desc 'pluto -=- setup/update feed subscriptions'
4
+ task :setup => :env do
5
+
6
+ ## check if PLANET key passed in
7
+ if ENV['PLANET'].present?
8
+ key = ENV['PLANET']
9
+ puts "setup planet for key >#{key}<"
10
+ else
11
+ puts 'no PLANET=key passed along; try defaults'
12
+ # try pluto.yml or planet.yml if exist
13
+
14
+ if File.exists?( './pluto.ini' ) || File.exists?( './pluto.yml' ) # check if pluto.yml exists, if yes add/use it
15
+ key ='pluto'
16
+ elsif File.exists?( './planet.ini' ) || File.exists?( './planet.yml' ) # check if planet.yml exists, if yes add/use it
17
+ key = 'planet'
18
+ else
19
+ puts '*** note: no arg passed in; no pluto.ini|yml or planet.ini|yml found in working folder'
20
+ end
21
+ end
22
+
23
+
24
+ config_path = "./#{key}.ini"
25
+ if File.exists?( config_path )
26
+ config = INI.load_file( config_path )
27
+ else ## assume .yml
28
+ config_path = "./#{key}.yml"
29
+ config = YAML.load_file( config_path )
30
+ end
31
+
32
+
33
+ puts "dump planet setup settings >#{config_path}<:"
34
+ pp config
35
+
36
+ # note: allow multiple planets (sites) for a single install
37
+ Pluto::Subscriber.new.update_subscriptions_for( key, config )
38
+
39
+ puts 'Done.'
40
+ end
@@ -0,0 +1,10 @@
1
+
2
+
3
+ desc 'pluto - show planet (feed) stats'
4
+ task :stats => :env do
5
+ puts "stats:"
6
+ puts " Feeds: #{Pluto::Models::Feed.count}"
7
+ puts " Items: #{Pluto::Models::Item.count}"
8
+ puts " Sites: #{Pluto::Models::Site.count}"
9
+ puts " Subscriptions: #{Pluto::Models::Subscription.count}"
10
+ end
@@ -0,0 +1,24 @@
1
+
2
+
3
+ desc 'pluto -=- update planet (site configs)'
4
+ task :update_sites => :env do
5
+
6
+ Pluto.update_sites # update all site configs if source (url) present/specified
7
+
8
+ puts 'Done (Update Sites).'
9
+ end
10
+
11
+
12
+ desc 'pluto -=- update planet (feeds)'
13
+ task :update_feeds => :env do
14
+
15
+ Pluto.update_feeds
16
+
17
+ puts 'Done (Update Feeds).'
18
+ end
19
+
20
+
21
+ desc 'pluto -=- update planet (site configs + feeds)'
22
+ task :update => [:update_sites, :update_feeds] do
23
+ puts 'Done.'
24
+ end
data/lib/pluto/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
 
2
2
  module Pluto
3
- VERSION = '0.9.2'
3
+ VERSION = '1.0.0'
4
4
  end
data/lib/pluto.rb CHANGED
@@ -75,6 +75,8 @@ module Pluto
75
75
  Connecter.new.connect!( config )
76
76
  end
77
77
 
78
+
79
+ # todo: add alias update_site( config ) ??
78
80
  def self.update_subscriptions( config )
79
81
  Subscriber.new.update_subscriptions( config )
80
82
  end
@@ -83,6 +85,19 @@ module Pluto
83
85
  Refresher.new.update_feeds
84
86
  end
85
87
 
88
+ def self.update_sites
89
+ Refresher.new.update_sites
90
+ end
91
+
92
+ def self.load_tasks
93
+ # load all builtin Rake tasks (from tasks/*rake)
94
+ load 'pluto/tasks/env.rake'
95
+ load 'pluto/tasks/setup.rake'
96
+ load 'pluto/tasks/stats.rake'
97
+ load 'pluto/tasks/update.rake'
98
+ end
99
+
100
+
86
101
  def self.main
87
102
  require 'pluto/cli/main'
88
103
  ## Runner.new.run(ARGV) - old code
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pluto
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 1.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-09 00:00:00.000000000 Z
12
+ date: 2013-11-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pakman
16
- requirement: &75633210 !ruby/object:Gem::Requirement
16
+ requirement: &75262180 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0.5'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *75633210
24
+ version_requirements: *75262180
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: fetcher
27
- requirement: &75632900 !ruby/object:Gem::Requirement
27
+ requirement: &75261920 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.4.1
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *75632900
35
+ version_requirements: *75261920
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: logutils
38
- requirement: &75632580 !ruby/object:Gem::Requirement
38
+ requirement: &75261630 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0.6'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *75632580
46
+ version_requirements: *75261630
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: feedutils
49
- requirement: &75632320 !ruby/object:Gem::Requirement
49
+ requirement: &75261390 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 0.4.0
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *75632320
57
+ version_requirements: *75261390
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: props
60
- requirement: &75632050 !ruby/object:Gem::Requirement
60
+ requirement: &75261170 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 1.0.3
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *75632050
68
+ version_requirements: *75261170
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: textutils
71
- requirement: &75631720 !ruby/object:Gem::Requirement
71
+ requirement: &75260850 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0.7'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *75631720
79
+ version_requirements: *75260850
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: activityutils
82
- requirement: &75631420 !ruby/object:Gem::Requirement
82
+ requirement: &75260620 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: 0.1.0
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *75631420
90
+ version_requirements: *75260620
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: gli
93
- requirement: &75631140 !ruby/object:Gem::Requirement
93
+ requirement: &75260380 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: 2.5.6
99
99
  type: :runtime
100
100
  prerelease: false
101
- version_requirements: *75631140
101
+ version_requirements: *75260380
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: rdoc
104
- requirement: &75653690 !ruby/object:Gem::Requirement
104
+ requirement: &75260140 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ~>
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: '3.10'
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *75653690
112
+ version_requirements: *75260140
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: hoe
115
- requirement: &75653420 !ruby/object:Gem::Requirement
115
+ requirement: &75259910 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ~>
@@ -120,7 +120,7 @@ dependencies:
120
120
  version: '3.3'
121
121
  type: :development
122
122
  prerelease: false
123
- version_requirements: *75653420
123
+ version_requirements: *75259910
124
124
  description: pluto - Another Planet Generator (Lets You Build Web Pages from Published
125
125
  Web Feeds)
126
126
  email: feedreader@googlegroups.com
@@ -155,6 +155,10 @@ files:
155
155
  - lib/pluto/refresher.rb
156
156
  - lib/pluto/schema.rb
157
157
  - lib/pluto/subscriber.rb
158
+ - lib/pluto/tasks/env.rake
159
+ - lib/pluto/tasks/setup.rake
160
+ - lib/pluto/tasks/stats.rake
161
+ - lib/pluto/tasks/update.rake
158
162
  - lib/pluto/updater.rb
159
163
  - lib/pluto/version.rb
160
164
  - test/helper.rb