pluto 0.8.7 → 0.8.8

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -72,10 +72,14 @@ SYNOPSIS
72
72
  COMMAND OPTIONS
73
73
  -o, --output=PATH - Output Path (default: .)
74
74
  -t, --template=MANIFEST - Template Manifest (default: blank)
75
-
75
+ -d, --dbpath=PATH - Database path (default: .)
76
+ -n, --dbname=NAME - Database name (default: <PLANET>.db e.g. ruby.db)
77
+
76
78
  EXAMPLE
77
79
  pluto build ruby.yml
80
+ pluto build ruby.yml --template news
78
81
  pluto b ruby
82
+ pluto b ruby -t news
79
83
  pluto b # will use pluto.ini|pluto.yml|planet.ini|planet.yml if present
80
84
  ~~~
81
85
 
@@ -115,6 +119,10 @@ EXAMPLE
115
119
  NAME
116
120
  update - Update planet feeds
117
121
 
122
+ COMMAND OPTIONS
123
+ -d, --dbpath=PATH - Database path (default: .)
124
+ -n, --dbname=NAME - Database name (default: <PLANET>.db e.g. ruby.db)
125
+
118
126
  SYNOPSIS
119
127
  pluto [global options] update FILE
120
128
 
@@ -136,10 +144,14 @@ SYNOPSIS
136
144
  COMMAND OPTIONS
137
145
  -o, --output=PATH - Output Path (default: .)
138
146
  -t, --template=MANIFEST - Template Manifest (default: blank)
147
+ -d, --dbpath=PATH - Database path (default: .)
148
+ -n, --dbname=NAME - Database name (default: <PLANET>.db e.g. ruby.db)
139
149
 
140
150
  EXAMPLE
141
151
  pluto merge ruby.yml
152
+ pluto merge ruby.yml --template news
142
153
  pluto m ruby
154
+ pluto m ruby -t news
143
155
  ~~~
144
156
 
145
157
 
@@ -231,7 +243,7 @@ Planet Mars by Sam Ruby [(Site)](https://github.com/rubys/mars) - first draft o
231
243
 
232
244
  ### Python
233
245
 
234
- Planet Planet by Scott James Remnant ann Jeff Waugh [(Site)](http://www.planetplanet.org) - uses Mark Pilgrim's universal feed parser (RDF, RSS and Atom) and Tomas Styblo's templating engine; last release version 2.0 in 2006
246
+ Planet Planet by Scott James Remnant and Jeff Waugh [(Site)](http://www.planetplanet.org) - uses Mark Pilgrim's universal feed parser (RDF, RSS and Atom) and Tomas Styblo's templating engine; last release version 2.0 in 2006
235
247
 
236
248
  Planet Venus by Sam Ruby [(Site)](https://github.com/rubys/venus) - cleaned up Planet Planet code; last change in 2010
237
249
 
@@ -187,7 +187,7 @@ command [:fetch, :f] do |c|
187
187
  #####
188
188
  # todo: add into method for reuse for build/merge/fetch
189
189
  # all use the same code
190
-
190
+
191
191
  db_config = {
192
192
  adapter: 'sqlite3',
193
193
  database: "#{opts.db_path}/#{opts.db_name}"
@@ -229,6 +229,16 @@ command [:merge, :m] do |c|
229
229
  c.default_value opts.manifest
230
230
  c.flag [:t, :template]
231
231
 
232
+ c.desc 'Database path'
233
+ c.arg_name 'PATH'
234
+ c.default_value opts.db_path
235
+ c.flag [:d, :dbpath]
236
+
237
+ c.desc 'Database name'
238
+ c.arg_name 'NAME'
239
+ c.default_value '<PLANET>.db e.g. ruby.db'
240
+ c.flag [:n, :dbname]
241
+
232
242
 
233
243
  c.action do |g,o,args|
234
244
  logger.debug 'hello from merge command'
@@ -241,10 +251,12 @@ command [:merge, :m] do |c|
241
251
  #####
242
252
  # todo: add into method for reuse for build/merge/fetch
243
253
  # all use the same code
254
+
255
+ db_name = opts.db_name? ? opts.db_name : "#{name}.db"
244
256
 
245
257
  db_config = {
246
258
  adapter: 'sqlite3',
247
- database: "#{opts.output_path}/#{name}.db"
259
+ database: "#{opts.db_path}/#{db_name}"
248
260
  }
249
261
 
250
262
  Pluto::Connecter.new.connect!( db_config )
@@ -264,6 +276,17 @@ desc 'Update planet feeds'
264
276
  arg_name 'FILE', multiple: true ## todo/fix: check multiple will not print typeo???
265
277
  command [:update, :up, :u] do |c|
266
278
 
279
+ c.desc 'Database path'
280
+ c.arg_name 'PATH'
281
+ c.default_value opts.db_path
282
+ c.flag [:d, :dbpath]
283
+
284
+ c.desc 'Database name'
285
+ c.arg_name 'NAME'
286
+ c.default_value '<PLANET>.db e.g. ruby.db'
287
+ c.flag [:n, :dbname]
288
+
289
+
267
290
  c.action do |g,o,args|
268
291
  logger.debug 'hello from update command'
269
292
 
@@ -275,10 +298,12 @@ command [:update, :up, :u] do |c|
275
298
  #####
276
299
  # todo: add into method for reuse for build/merge/fetch
277
300
  # all use the same code
301
+
302
+ db_name = opts.db_name? ? opts.db_name : "#{name}.db"
278
303
 
279
304
  db_config = {
280
305
  adapter: 'sqlite3',
281
- database: "#{opts.output_path}/#{name}.db"
306
+ database: "#{opts.db_path}/#{db_name}"
282
307
  }
283
308
 
284
309
  Pluto::Connecter.new.connect!( db_config )
@@ -308,6 +333,16 @@ command [:build, :b] do |c|
308
333
  c.default_value opts.manifest
309
334
  c.flag [:t, :template]
310
335
 
336
+ c.desc 'Database path'
337
+ c.arg_name 'PATH'
338
+ c.default_value opts.db_path
339
+ c.flag [:d, :dbpath]
340
+
341
+ c.desc 'Database name'
342
+ c.arg_name 'NAME'
343
+ c.default_value '<PLANET>.db e.g. ruby.db'
344
+ c.flag [:n, :dbname]
345
+
311
346
 
312
347
  c.action do |g,o,args|
313
348
  logger.debug 'hello from build command'
@@ -317,9 +352,11 @@ command [:build, :b] do |c|
317
352
  args.each do |arg|
318
353
  name = File.basename( arg, '.*' )
319
354
 
355
+ db_name = opts.db_name? ? opts.db_name : "#{name}.db"
356
+
320
357
  db_config = {
321
358
  adapter: 'sqlite3',
322
- database: "#{opts.output_path}/#{name}.db"
359
+ database: "#{opts.db_path}/#{db_name}"
323
360
  }
324
361
 
325
362
  Pluto::Connecter.new.connect!( db_config )
@@ -19,22 +19,16 @@ class Opts
19
19
  @manifest = options[:template] if options[:template].present?
20
20
  end
21
21
 
22
- def db_path
23
- @db_path || '.'
24
- end
25
22
 
26
- def db_name
27
- @db_name || 'pluto.db'
28
- end
23
+ # lets us check if user passed in db settings
24
+ def db_name?() @db_name.present? ; end
29
25
 
26
+ def db_path() @db_path || '.' ; end
27
+ def db_name() @db_name || 'pluto.db' ; end
30
28
 
31
- def manifest=(value)
32
- @manifest = value
33
- end
34
-
35
- def manifest
36
- @manifest || 'blank'
37
- end
29
+
30
+ def manifest=(value) @manifest = value; end
31
+ def manifest() @manifest || 'blank' ; end
38
32
 
39
33
  def verbose=(value)
40
34
  @verbose = true # note: always assumes true for now; default is false
data/lib/pluto/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
 
2
2
  module Pluto
3
- VERSION = '0.8.7'
3
+ VERSION = '0.8.8'
4
4
  end
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.8.7
4
+ version: 0.8.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2013-10-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pakman
16
- requirement: &79324440 !ruby/object:Gem::Requirement
16
+ requirement: &82398980 !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: *79324440
24
+ version_requirements: *82398980
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: fetcher
27
- requirement: &79324160 !ruby/object:Gem::Requirement
27
+ requirement: &82398670 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0.3'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *79324160
35
+ version_requirements: *82398670
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: logutils
38
- requirement: &79323870 !ruby/object:Gem::Requirement
38
+ requirement: &82398350 !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: *79323870
46
+ version_requirements: *82398350
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: feedutils
49
- requirement: &79323600 !ruby/object:Gem::Requirement
49
+ requirement: &82398090 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 0.3.2
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *79323600
57
+ version_requirements: *82398090
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: props
60
- requirement: &79323280 !ruby/object:Gem::Requirement
60
+ requirement: &82397860 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 1.0.2
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *79323280
68
+ version_requirements: *82397860
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: textutils
71
- requirement: &79323050 !ruby/object:Gem::Requirement
71
+ requirement: &82397520 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 0.6.8
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *79323050
79
+ version_requirements: *82397520
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: gli
82
- requirement: &79322720 !ruby/object:Gem::Requirement
82
+ requirement: &82397240 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: 2.5.6
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *79322720
90
+ version_requirements: *82397240
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: rdoc
93
- requirement: &79322460 !ruby/object:Gem::Requirement
93
+ requirement: &82396970 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ~>
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '3.10'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *79322460
101
+ version_requirements: *82396970
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: hoe
104
- requirement: &79322170 !ruby/object:Gem::Requirement
104
+ requirement: &82396660 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ~>
@@ -109,7 +109,7 @@ dependencies:
109
109
  version: '3.3'
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *79322170
112
+ version_requirements: *82396660
113
113
  description: pluto - Another Planet Generator (Lets You Build Web Pages from Published
114
114
  Web Feeds)
115
115
  email: feedreader@googlegroups.com