gumdrop 0.2.12 → 0.2.13
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog.md +4 -0
- data/lib/gumdrop.rb +6 -2
- data/lib/gumdrop/content.rb +2 -1
- data/lib/gumdrop/generator.rb +4 -0
- data/lib/gumdrop/template/Gemfile +2 -0
- data/lib/gumdrop/template/Rakefile +3 -5
- data/lib/gumdrop/template/config.ru +1 -0
- data/lib/gumdrop/template/{.htaccess → default.htaccess} +0 -0
- data/lib/gumdrop/template/lib/site.rb +12 -0
- data/lib/gumdrop/version.rb +1 -1
- metadata +14 -14
data/ChangeLog.md
CHANGED
data/lib/gumdrop.rb
CHANGED
@@ -27,7 +27,7 @@ module Gumdrop
|
|
27
27
|
|
28
28
|
class << self
|
29
29
|
|
30
|
-
attr_accessor :root_path, :source_path, :site, :layouts, :generators, :partials, :config, :data
|
30
|
+
attr_accessor :root_path, :source_path, :site, :layouts, :generators, :partials, :config, :data, :content_filters
|
31
31
|
|
32
32
|
def run(opts={})
|
33
33
|
# Opts
|
@@ -49,6 +49,8 @@ module Gumdrop
|
|
49
49
|
@root_path = root.split '/'
|
50
50
|
@source_path = src.split '/'
|
51
51
|
@data = Gumdrop::DeferredLoader.new()
|
52
|
+
|
53
|
+
@content_filters= []
|
52
54
|
|
53
55
|
if File.exists? "#{root}/lib/site.rb"
|
54
56
|
# In server mode, we want to reload it every time... right?
|
@@ -87,16 +89,18 @@ module Gumdrop
|
|
87
89
|
generator.execute()
|
88
90
|
end
|
89
91
|
|
92
|
+
|
90
93
|
# Render
|
91
94
|
unless opts[:dry_run]
|
92
95
|
site.keys.sort.each do |path|
|
93
96
|
node= site[path]
|
94
97
|
output_path= "output/#{node.to_s}"
|
95
98
|
FileUtils.mkdir_p File.dirname(output_path)
|
96
|
-
node.renderTo output_path
|
99
|
+
node.renderTo output_path, @content_filters
|
97
100
|
end
|
98
101
|
puts "Done."
|
99
102
|
end
|
103
|
+
|
100
104
|
end
|
101
105
|
|
102
106
|
end
|
data/lib/gumdrop/content.rb
CHANGED
@@ -43,9 +43,10 @@ module Gumdrop
|
|
43
43
|
content
|
44
44
|
end
|
45
45
|
|
46
|
-
def renderTo(output_path, opts={})
|
46
|
+
def renderTo(output_path, filters=[], opts={})
|
47
47
|
return copyTo(output_path, opts) unless useLayout?
|
48
48
|
output= render()
|
49
|
+
filters.each {|f| output= f.call(output, self) }
|
49
50
|
File.open output_path, 'w' do |f|
|
50
51
|
puts " Rendering: #{@uri}"
|
51
52
|
f.write output
|
data/lib/gumdrop/generator.rb
CHANGED
@@ -7,16 +7,14 @@ USER='user'
|
|
7
7
|
SERVER='server.com'
|
8
8
|
FOLDER="~/#{SERVER}"
|
9
9
|
|
10
|
-
|
11
10
|
desc "Build source files into output"
|
12
11
|
task :build do
|
13
|
-
|
12
|
+
system("bundle exec gumdrop -b")
|
14
13
|
end
|
15
14
|
|
16
15
|
desc "Run development server"
|
17
16
|
task :serve do
|
18
|
-
|
19
|
-
Gumdrop::Server
|
17
|
+
system("bundle exec gumdrop -s")
|
20
18
|
end
|
21
19
|
|
22
20
|
desc "Syncs with public server using rsync (if configured)"
|
@@ -33,5 +31,5 @@ task :version do
|
|
33
31
|
end
|
34
32
|
|
35
33
|
task :default do
|
36
|
-
`rake -T`
|
34
|
+
puts `rake -T`
|
37
35
|
end
|
File without changes
|
@@ -11,6 +11,18 @@ end
|
|
11
11
|
require 'slim'
|
12
12
|
Slim::Engine.set_default_options :pretty => true
|
13
13
|
|
14
|
+
# Example of using a content filter to compress CoffeeScript/JS output
|
15
|
+
# require 'jsmin'
|
16
|
+
# content_filter do |content, info|
|
17
|
+
# if info.ext == '.js'
|
18
|
+
# puts " Compress: #{info.filename}"
|
19
|
+
# JSMin.minify content
|
20
|
+
# else
|
21
|
+
# content
|
22
|
+
# end
|
23
|
+
# end
|
24
|
+
|
25
|
+
|
14
26
|
# Example site-level generator
|
15
27
|
# generate do
|
16
28
|
#
|
data/lib/gumdrop/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gumdrop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.13
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-07-22 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sinatra
|
16
|
-
requirement: &
|
16
|
+
requirement: &70247299388980 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70247299388980
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: tilt
|
27
|
-
requirement: &
|
27
|
+
requirement: &70247299388540 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70247299388540
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: active_support
|
38
|
-
requirement: &
|
38
|
+
requirement: &70247299388120 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70247299388120
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: trollop
|
49
|
-
requirement: &
|
49
|
+
requirement: &70247299387680 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70247299387680
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: haml
|
60
|
-
requirement: &
|
60
|
+
requirement: &70247299387260 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70247299387260
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: sass
|
71
|
-
requirement: &
|
71
|
+
requirement: &70247299386840 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70247299386840
|
80
80
|
description: A simple cms/prototyping tool.
|
81
81
|
email: matt@elucidata.net
|
82
82
|
executables:
|
@@ -124,11 +124,11 @@ files:
|
|
124
124
|
- lib/gumdrop/hash_object.rb
|
125
125
|
- lib/gumdrop/pager.rb
|
126
126
|
- lib/gumdrop/server.rb
|
127
|
-
- lib/gumdrop/template/.htaccess
|
128
127
|
- lib/gumdrop/template/Gemfile
|
129
128
|
- lib/gumdrop/template/Rakefile
|
130
129
|
- lib/gumdrop/template/config.ru
|
131
130
|
- lib/gumdrop/template/data/config.yml
|
131
|
+
- lib/gumdrop/template/default.htaccess
|
132
132
|
- lib/gumdrop/template/lib/site.rb
|
133
133
|
- lib/gumdrop/template/lib/view_helpers.rb
|
134
134
|
- lib/gumdrop/template/source/favicon.ico
|