pluto 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/pluto/cli/runner.rb +2 -0
- data/lib/pluto/fetcher.rb +2 -0
- data/lib/pluto/formatter.rb +4 -1
- data/lib/pluto/models.rb +3 -1
- data/lib/pluto/server.rb +13 -1
- data/lib/pluto/version.rb +1 -1
- data/templates/blank.html.erb +3 -3
- data/templates/blank.top.html.erb +1 -1
- metadata +12 -12
data/lib/pluto/cli/runner.rb
CHANGED
data/lib/pluto/fetcher.rb
CHANGED
data/lib/pluto/formatter.rb
CHANGED
@@ -4,6 +4,9 @@ class Formatter
|
|
4
4
|
|
5
5
|
include LogUtils::Logging
|
6
6
|
|
7
|
+
include Models
|
8
|
+
|
9
|
+
|
7
10
|
def initialize( opts, config )
|
8
11
|
@opts = opts
|
9
12
|
@config = config
|
@@ -11,7 +14,7 @@ class Formatter
|
|
11
14
|
|
12
15
|
attr_reader :opts
|
13
16
|
|
14
|
-
def
|
17
|
+
def site
|
15
18
|
@config
|
16
19
|
end
|
17
20
|
|
data/lib/pluto/models.rb
CHANGED
data/lib/pluto/server.rb
CHANGED
@@ -30,13 +30,25 @@ class Server < Sinatra::Base
|
|
30
30
|
|
31
31
|
set :static, true # set up static file routing
|
32
32
|
|
33
|
+
|
34
|
+
set :site_config, {} # empty hash by default; use site_config
|
35
|
+
|
36
|
+
#######################
|
37
|
+
# Models
|
38
|
+
|
39
|
+
include Models # e.g. Feed, Item, etc.
|
40
|
+
|
41
|
+
|
33
42
|
##############################################
|
34
43
|
# Controllers / Routing / Request Handlers
|
35
44
|
|
36
45
|
get '/' do
|
37
|
-
erb :index
|
46
|
+
erb :index, locals: { site: settings.site_config }
|
38
47
|
end
|
39
48
|
|
49
|
+
# todo/fix: make a generic route for erb w /regex
|
50
|
+
# to auto-allow all routes not just / w/ site data
|
51
|
+
|
40
52
|
get '/d*' do
|
41
53
|
erb :debug
|
42
54
|
end
|
data/lib/pluto/version.rb
CHANGED
data/templates/blank.html.erb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
<html>
|
2
2
|
<head>
|
3
3
|
<meta charset="UTF-8">
|
4
|
-
<title><%=
|
4
|
+
<title><%= site['title'] %></title>
|
5
5
|
<meta name="generator" content="<%= Pluto.banner %>">
|
6
6
|
<style>
|
7
7
|
/* fix: use sass w/ variables */
|
@@ -61,14 +61,14 @@
|
|
61
61
|
</style>
|
62
62
|
</head>
|
63
63
|
<body>
|
64
|
-
<h1><%=
|
64
|
+
<h1><%= site['title'] %></h1>
|
65
65
|
|
66
66
|
<table>
|
67
67
|
<tr>
|
68
68
|
<td style='vertical-align:top;'><!-- first column -->
|
69
69
|
|
70
70
|
<% last_published_at = Time.local( 1999, 1, 1 )
|
71
|
-
Item.latest.each do |item| %>
|
71
|
+
Item.latest.limit(24).each do |item| %>
|
72
72
|
|
73
73
|
<% unless last_published_at.year == item.published_at.year &&
|
74
74
|
last_published_at.month == item.published_at.month &&
|
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.
|
4
|
+
version: 0.5.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-09-
|
12
|
+
date: 2013-09-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: pakman
|
16
|
-
requirement: &
|
16
|
+
requirement: &79513810 !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: *
|
24
|
+
version_requirements: *79513810
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: fetcher
|
27
|
-
requirement: &
|
27
|
+
requirement: &79512200 !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: *
|
35
|
+
version_requirements: *79512200
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: logutils
|
38
|
-
requirement: &
|
38
|
+
requirement: &79510570 !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: *
|
46
|
+
version_requirements: *79510570
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rdoc
|
49
|
-
requirement: &
|
49
|
+
requirement: &79509720 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '3.10'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *79509720
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: hoe
|
60
|
-
requirement: &
|
60
|
+
requirement: &79508820 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,7 +65,7 @@ dependencies:
|
|
65
65
|
version: '3.3'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *79508820
|
69
69
|
description: pluto - Another Planet Generator (Lets You Build Web Pages from Published
|
70
70
|
Web Feeds)
|
71
71
|
email: webslideshow@googlegroups.com
|