pluto 1.0.1 → 1.1.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6abc1a01aefe35e7b10d572f0b30b4fb33bace31
4
+ data.tar.gz: e48200337087ae33c2184cecad91ef6d5b4bedab
5
+ SHA512:
6
+ metadata.gz: ff3d03a5848e7e27198d3541ee795a97b6b28947cdb23db36a0f45ebb5f15883f5aae530984bfa45e4c1dac278e58f0fccd7dd1ccce787bb5a5c549aa1c2413d
7
+ data.tar.gz: 68d0d2f37f6cbd2ed5da1e3f7de53db691e27d57ada9aecf0a44df6258a80ee58786926a46d9a2ab5f54d49d297fb5c6d3835089493c351d542905de6280bfc7
data/HISTORY.md CHANGED
@@ -1,3 +1,4 @@
1
- ### 0.0.1 / 2012-07-14
2
1
 
3
- * Everything is new. First release
2
+ ### 0.0.1 / 2014-12-13
3
+
4
+ * Everything is new. First release
data/Manifest.txt CHANGED
@@ -3,31 +3,7 @@ Manifest.txt
3
3
  README.md
4
4
  Rakefile
5
5
  bin/pluto
6
- config/pluto.index.yml
7
6
  lib/pluto.rb
8
- lib/pluto/activerecord.rb
9
7
  lib/pluto/cli/main.rb
10
8
  lib/pluto/cli/opts.rb
11
- lib/pluto/connecter.rb
12
- lib/pluto/fetcher.rb
13
- lib/pluto/formatter.rb
14
- lib/pluto/installer.rb
15
- lib/pluto/lister.rb
16
- lib/pluto/manifest_helpers.rb
17
- lib/pluto/models/activity.rb
18
- lib/pluto/models/feed.rb
19
- lib/pluto/models/item.rb
20
- lib/pluto/models/site.rb
21
- lib/pluto/models/subscription.rb
22
- lib/pluto/models/utils.rb
23
- lib/pluto/refresher.rb
24
- lib/pluto/schema.rb
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
30
- lib/pluto/updater.rb
31
- lib/pluto/version.rb
32
- test/helper.rb
33
- test/test_helpers.rb
9
+ lib/pluto/cli/version.rb
data/README.md CHANGED
@@ -1,39 +1,17 @@
1
- # pluto
1
+ # pluto gem - command line tool
2
2
 
3
3
  Another planet generator in ruby - lets you build web pages
4
4
  from published web feeds.
5
5
 
6
- * home :: [github.com/feedreader/pluto](https://github.com/feedreader/pluto)
7
- * bugs :: [github.com/feedreader/pluto/issues](https://github.com/feedreader/pluto/issues)
8
- * gem :: [rubygems.org/gems/pluto](https://rubygems.org/gems/pluto)
9
- * rdoc :: [rubydoc.info/gems/pluto](http://rubydoc.info/gems/pluto)
10
- * forum :: [groups.google.com/group/feedreader](http://groups.google.com/group/feedreader)
6
+ * home :: [github.com/feedreader/pluto](https://github.com/feedreader/pluto)
7
+ * bugs :: [github.com/feedreader/pluto/issues](https://github.com/feedreader/pluto/issues)
8
+ * gem :: [rubygems.org/gems/pluto](https://rubygems.org/gems/pluto)
9
+ * rdoc :: [rubydoc.info/gems/pluto](http://rubydoc.info/gems/pluto)
10
+ * templates :: [github.com/planet-templates](https://github.com/planet-templates)
11
+ * forum :: [groups.google.com/group/feedreader](http://groups.google.com/group/feedreader)
11
12
 
12
- ## Usage
13
-
14
- Use the `pluto` command line tool and pass in one or more planet configuration files.
15
- Example:
16
-
17
- pluto build ruby.ini or
18
- pluto b ruby
19
-
20
- This will
21
-
22
- 1) fetch all feeds listed in `ruby.ini` and
23
-
24
- 2) store all entries in a local database, that is, `ruby.db` in your working folder and
25
-
26
- 3) generate a planet web page, that is, `ruby.html` using the [`blank` template pack](https://github.com/feedreader/pluto.blank) in your working folder using all feed entries from the local database.
27
-
28
- Open up `ruby.html` to see your planet web page. Voila!
29
13
 
30
-
31
- Note: If you pass in no planet configuration files, the `pluto` command line tool will look
32
- for the default planet configuration files,
33
- that is, `pluto.ini`, `pluto.yml`, `planet.ini`, `planet.yml`.
34
-
35
-
36
- ### Command Line Tool
14
+ ## Usage
37
15
 
38
16
  ~~~~
39
17
  NAME
@@ -155,69 +133,6 @@ EXAMPLE
155
133
  ~~~
156
134
 
157
135
 
158
-
159
- ### Planet Configuration Sample
160
-
161
- `ruby.ini`:
162
-
163
- ```
164
- title = Planet Ruby
165
-
166
- [rubyflow]
167
- title = Ruby Flow
168
- link = http://rubyflow.com
169
- feed = http://feeds.feedburner.com/Rubyflow?format=xml
170
-
171
- [rubyonrails]
172
- title = Ruby on Rails Blog
173
- link = http://weblog.rubyonrails.org
174
- feed = http://weblog.rubyonrails.org/feed/atom.xml
175
-
176
- [viennarb]
177
- title = vienna.rb Blog
178
- link = http://vienna-rb.at
179
- feed = http://vienna-rb.at/atom.xml
180
- ```
181
-
182
- or `ruby.yml`:
183
-
184
- ```
185
- title: Planet Ruby
186
-
187
-
188
- rubyflow:
189
- title: Ruby Flow
190
- link: http://rubyflow.com
191
- feed: http://feeds.feedburner.com/Rubyflow?format=xml
192
-
193
- rubyonrails:
194
- title: Ruby on Rails Blog
195
- link: http://weblog.rubyonrails.org
196
- feed: http://weblog.rubyonrails.org/feed/atom.xml
197
-
198
- viennarb:
199
- title: vienna.rb Blog
200
- link: http://vienna-rb.at
201
- feed: http://vienna-rb.at/atom.xml
202
- ```
203
-
204
- For more samples, see [`nytimes.ini`](https://github.com/feedreader/pluto.samples/blob/master/nytimes.ini),
205
- [`js.ini`](https://github.com/feedreader/pluto.samples/blob/master/js.ini),
206
- [`dart.ini`](https://github.com/feedreader/pluto.samples/blob/master/dart.ini),
207
- [`haskell.ini`](https://github.com/feedreader/pluto.samples/blob/master/haskell.ini),
208
- [`viennarb.ini`](https://github.com/feedreader/pluto.samples/blob/master/viennarb.ini),
209
- [`beer.ini`](https://github.com/feedreader/pluto.samples/blob/master/beer.ini),
210
- [`football.ini`](https://github.com/feedreader/pluto.samples/blob/master/football.ini).
211
-
212
-
213
- ## Template Packs
214
-
215
- - Blank - default templates; [more »](https://github.com/feedreader/pluto.blank)
216
- - News - 'river of news' style templates; [more »](https://github.com/feedreader/pluto.news)
217
- - Top - Popurl-style templates; [more »](https://github.com/feedreader/pluto.top)
218
- - Classic - Planet Planet-Style templates; [more »](https://github.com/feedreader/pluto.classic)
219
-
220
-
221
136
  ## Install
222
137
 
223
138
  Just install the gem:
@@ -225,11 +140,6 @@ Just install the gem:
225
140
  $ gem install pluto
226
141
 
227
142
 
228
- ## Real World Usage
229
-
230
- [`pluto.live`](https://github.com/feedreader/pluto.live) - sample planet site; sinatra web app/starter template in ruby using the pluto gem
231
-
232
-
233
143
 
234
144
  ## Alternatives
235
145
 
data/Rakefile CHANGED
@@ -1,9 +1,9 @@
1
1
  require 'hoe'
2
- require './lib/pluto/version.rb'
2
+ require './lib/pluto/cli/version.rb'
3
3
 
4
4
  Hoe.spec 'pluto' do
5
5
 
6
- self.version = Pluto::VERSION
6
+ self.version = PlutoCli::VERSION
7
7
 
8
8
  self.summary = 'pluto - Another Planet Generator'
9
9
  self.description = 'pluto - Another Planet Generator (Lets You Build Web Pages from Published Web Feeds)'
@@ -18,22 +18,18 @@ Hoe.spec 'pluto' do
18
18
  self.history_file = 'HISTORY.md'
19
19
 
20
20
  self.extra_deps = [
21
- ['pakman', '>= 0.5'],
22
- ['fetcher', '>= 0.4.3'], # use min. 0.4.3 - added cache/conditional GET support
23
- ['logutils', '>= 0.6'],
24
- ['feedutils', '>= 0.4.0'], # use min. 0.4.0 - added rss 2.0 - content:encoded; added fix for rss.item.guid missing; no more auto-summary in atom
25
- ['props', '>= 1.0.3'], # use min. 1.0.2 - added ini support
26
- ['textutils', '>= 0.7'], # use min. 0.7; moved hy/date helpers to gem; future: add some filters (for include/exclude)
27
- ['activityutils', '>= 0.1.0' ],
28
- ['gli', '>= 2.5.6']
29
- ## ['activerecord', '~> 3.2'], # NB: soft dependency, will include activesupport,etc.
21
+ ['pluto-models', '>= 1.2.2'],
22
+ ['pluto-update', '>= 1.1.0'],
23
+ ['pluto-merge', '>= 1.1.0'],
24
+ ['pluto-tasks', '>= 1.1.0'],
25
+ ['gli', '>= 2.12.2'],
26
+ ['sqlite3'],
30
27
  ]
31
28
 
32
-
33
29
  self.licenses = ['Public Domain']
34
30
 
35
31
  self.spec_extras = {
36
- :required_ruby_version => '>= 1.9.2'
32
+ required_ruby_version: '>= 1.9.2'
37
33
  }
38
34
 
39
35
  end
data/lib/pluto.rb CHANGED
@@ -1,155 +1,28 @@
1
- ###
2
- # NB: for local testing run like:
3
- #
4
- # 1.9.x: ruby -Ilib lib/pakman.rb
1
+ # encoding: utf-8
5
2
 
6
- # core and stdlibs
7
-
8
- require 'yaml'
9
- require 'json'
10
- require 'uri'
11
- require 'pp'
12
- require 'optparse'
13
- require 'fileutils'
14
- require 'logger'
15
- require 'date'
16
- require 'digest/md5'
3
+ require 'pluto/models'
4
+ require 'pluto/update'
5
+ require 'pluto/merge'
6
+ require 'pluto/tasks'
17
7
 
18
8
 
19
9
  # 3rd party ruby gems/libs
20
10
 
21
- require 'active_record' ## todo: add sqlite3? etc.
22
-
23
- require 'logutils'
24
- require 'props' # manage settings/env
25
- require 'fetcher' # fetch (download) files
26
- require 'pakman' # template pack manager
27
- require 'feedutils'
28
- require 'textutils'
29
-
30
- require 'activityutils'
31
11
 
32
12
  # our own code
33
13
 
34
- require 'pluto/version' # let version always get first
35
- require 'pluto/schema'
36
- require 'pluto/activerecord'
37
-
38
- require 'pluto/models/activity'
39
- require 'pluto/models/feed'
40
- require 'pluto/models/item'
41
- require 'pluto/models/site'
42
- require 'pluto/models/subscription'
43
- require 'pluto/models/utils'
44
-
45
- require 'pluto/manifest_helpers'
46
- require 'pluto/connecter'
47
-
48
- require 'pluto/installer'
49
- require 'pluto/fetcher'
50
- require 'pluto/refresher'
51
- require 'pluto/subscriber'
52
- require 'pluto/updater'
53
- require 'pluto/lister'
54
- require 'pluto/formatter'
55
-
14
+ require 'pluto/cli/version' # note: let version always get first
56
15
  require 'pluto/cli/opts' ## fix: make sure fetcher/updater etc. do not depend on cli/opts
57
16
 
58
17
 
59
18
  module Pluto
60
19
 
61
- def self.banner
62
- ### todo: add RUBY_PATCHLEVEL or RUBY_PATCH_LEVEL e.g. -p124
63
- "pluto/#{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
64
- end
65
-
66
- def self.generator # convenience alias for banner (matches HTML generator meta tag)
67
- banner
68
- end
69
-
70
- def self.root
71
- "#{File.expand_path( File.dirname(File.dirname(__FILE__)) )}"
72
- end
73
-
74
- def self.connect!( config=nil ) # convenience shortcut
75
- Connecter.new.connect!( config )
76
- end
77
-
78
-
79
- # todo: add alias update_site( config ) ??
80
- def self.update_subscriptions( config )
81
- Subscriber.new.update_subscriptions( config )
82
- end
83
-
84
- def self.update_feeds
85
- Refresher.new.update_feeds
86
- end
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
-
101
20
  def self.main
102
21
  require 'pluto/cli/main'
103
22
  ## Runner.new.run(ARGV) - old code
104
23
  end
105
-
106
24
 
107
25
  end # module Pluto
108
26
 
109
27
 
110
-
111
- ######
112
- # todo - move to ext/array.rb or similar
113
-
114
- class Array
115
-
116
- ## todo: check if there's already a builtin method for this
117
- #
118
- # note:
119
- # in rails ary.in_groups(3) results in
120
- # top-to-bottom, left-to-right.
121
- # and not left-to-right first and than top-to-bottom.
122
- #
123
- # rename to in_groups_vertical(3) ???
124
-
125
- def in_columns( cols ) # alias for convenience for chunks - needed? why? why not?
126
- chunks( cols )
127
- end
128
-
129
- def chunks( number_of_chunks )
130
- ## NB: use chunks - columns might be in use by ActiveRecord!
131
- ###
132
- # e.g.
133
- # [1,2,3,4,5,6,7,8,9,10].columns(3)
134
- # becomes:
135
- # [[1,4,7,10],
136
- # [2,5,8],
137
- # [3,6,9]]
138
-
139
- ## check/todo: make a copy of the array first??
140
- # for now reference to original items get added to columns
141
- chunks = (1..number_of_chunks).collect { [] }
142
- each_with_index do |item,index|
143
- chunks[ index % number_of_chunks ] << item
144
- end
145
- chunks
146
- end
147
-
148
- end
149
-
150
-
151
- if __FILE__ == $0
152
- Pluto.main
153
- else
154
- puts Pluto.banner # say hello
155
- end
28
+ Pluto.main if __FILE__ == $0
@@ -42,8 +42,15 @@ Gems versions:
42
42
  - fetcher #{Fetcher::VERSION}
43
43
  - feedutils #{FeedUtils::VERSION}
44
44
  - textutils #{TextUtils::VERSION}
45
+ - logutils #{LogKernel::VERSION}
45
46
  - props #{Props::VERSION}
46
47
 
48
+ - pluto #{PlutoCli::VERSION}
49
+ - pluto-models #{Pluto::VERSION}
50
+ - pluto-update #{PlutoUpdate::VERSION}
51
+ - pluto-merge #{PlutoMerge::VERSION}
52
+ - pluto-tasks #{PlutoTasks::VERSION}
53
+
47
54
  Env home: #{Env.home}
48
55
  Pluto config: #{opts.config_path}
49
56
  Pluto root: #{Pluto.root}
@@ -193,10 +200,10 @@ command [:fetch, :f] do |c|
193
200
  database: "#{opts.db_path}/#{opts.db_name}"
194
201
  }
195
202
 
196
- Pluto::Connecter.new.connect!( db_config )
203
+ Pluto.connect( db_config )
197
204
 
198
205
  args.each do |arg|
199
- feed_rec = Pluto::Models::Feed.find_by_key!( arg )
206
+ feed_rec = Pluto::Model::Feed.find_by_key!( arg )
200
207
 
201
208
  puts "feed_rec:"
202
209
  pp feed_rec
@@ -258,7 +265,7 @@ command [:merge, :m] do |c|
258
265
  database: "#{opts.db_path}/#{db_name}"
259
266
  }
260
267
 
261
- Pluto::Connecter.new.connect!( db_config )
268
+ Pluto.connect( db_config )
262
269
 
263
270
  config = load_config( arg )
264
271
 
@@ -304,7 +311,9 @@ command [:update, :up, :u] do |c|
304
311
  database: "#{opts.db_path}/#{db_name}"
305
312
  }
306
313
 
307
- Pluto::Connecter.new.connect!( db_config )
314
+ # Note: use ! version w/ auto-migrate! - why? why not??
315
+ ## just use regular connect??
316
+ Pluto.connect!( db_config )
308
317
 
309
318
  config = load_config( arg )
310
319
 
@@ -356,7 +365,8 @@ command [:build, :b] do |c|
356
365
  database: "#{opts.db_path}/#{db_name}"
357
366
  }
358
367
 
359
- Pluto::Connecter.new.connect!( db_config )
368
+ # Note: use ! version w/ auto-migrate!
369
+ Pluto.connect!( db_config )
360
370
 
361
371
  config = load_config( arg )
362
372
 
@@ -452,4 +462,4 @@ on_error do |e|
452
462
  end
453
463
 
454
464
 
455
- exit run(ARGV)
465
+ exit run(ARGV)