gumdrop 0.3.6 → 0.3.7
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 +13 -6
- data/lib/gumdrop/build.rb +1 -0
- data/lib/gumdrop/content.rb +1 -1
- data/lib/gumdrop/generator.rb +1 -1
- data/lib/gumdrop/server.rb +2 -1
- data/lib/gumdrop/template/backbone/lib/site.rb +3 -0
- data/lib/gumdrop/template/default/lib/site.rb +4 -1
- data/lib/gumdrop/version.rb +1 -1
- metadata +17 -17
data/ChangeLog.md
CHANGED
data/lib/gumdrop.rb
CHANGED
@@ -12,6 +12,8 @@ DEFAULT_OPTIONS= {
|
|
12
12
|
root: ".",
|
13
13
|
log_level: :info,
|
14
14
|
output_dir: "./output",
|
15
|
+
lib_dir: "./lib",
|
16
|
+
source_dir: "./source",
|
15
17
|
log: 'logs/build.log'
|
16
18
|
}
|
17
19
|
|
@@ -58,11 +60,12 @@ module Gumdrop
|
|
58
60
|
Gumdrop.config.merge! opts
|
59
61
|
|
60
62
|
root= File.expand_path Gumdrop.config.root
|
61
|
-
src= File.join root, 'source'
|
62
|
-
|
63
|
-
|
63
|
+
src= File.expand_path Gumdrop.config.source_dir #File.join root, 'source'
|
64
|
+
lib_path= File.expand_path Gumdrop.config.lib_dir
|
65
|
+
$: << lib_path # "#{root}/lib"
|
66
|
+
if File.exists? File.join(lib_path,"view_helpers.rb")
|
64
67
|
# In server mode, we want to reload it every time... right?
|
65
|
-
load "
|
68
|
+
load File.join(lib_path,"view_helpers.rb")
|
66
69
|
end
|
67
70
|
|
68
71
|
@site = Hash.new {|h,k| h[k]= nil }
|
@@ -86,10 +89,14 @@ module Gumdrop
|
|
86
89
|
@content_filters= []
|
87
90
|
@blacklist = []
|
88
91
|
|
89
|
-
if File.exists? "#{root}/lib/site.rb"
|
92
|
+
if File.exists? File.join(lib_path, "site.rb") # "#{root}/lib/site.rb"
|
90
93
|
# In server mode, we want to reload it every time... right?
|
91
|
-
source= IO.readlines("
|
94
|
+
source= IO.readlines( File.join(lib_path,"site.rb") ).join('')
|
92
95
|
DSL.class_eval source
|
96
|
+
# TODO: Find a good place to define where source folder should be defined.
|
97
|
+
# In case the source folder has changed.
|
98
|
+
src= File.expand_path Gumdrop.config.source_dir #File.join root, 'source'
|
99
|
+
@source_path= src.split '/'
|
93
100
|
end
|
94
101
|
|
95
102
|
Build.run root, src, opts
|
data/lib/gumdrop/build.rb
CHANGED
@@ -65,6 +65,7 @@ module Gumdrop
|
|
65
65
|
def render
|
66
66
|
unless opts[:dry_run]
|
67
67
|
output_base_path= File.expand_path(Gumdrop.config.output_dir)
|
68
|
+
Gumdrop.report "[Compiling to #{output_base_path}]", :info
|
68
69
|
Gumdrop.site.keys.sort.each do |path|
|
69
70
|
node= Gumdrop.site[path]
|
70
71
|
output_path= File.join(output_base_path, node.to_s)
|
data/lib/gumdrop/content.rb
CHANGED
@@ -11,7 +11,7 @@ module Gumdrop
|
|
11
11
|
@level= (@path.split('/').length - 2)
|
12
12
|
@source_filename= File.basename path
|
13
13
|
filename_parts= @source_filename.split('.')
|
14
|
-
@filename= filename_parts[0..1].join('.')
|
14
|
+
@filename= filename_parts[0..1].join('.') # TODO: Fix this! breaks on files like jquery-1.7.1.min.js ... becomes jquery-1
|
15
15
|
path_parts= @path.split('/')
|
16
16
|
path_parts.shift
|
17
17
|
path_parts.pop
|
data/lib/gumdrop/generator.rb
CHANGED
@@ -65,7 +65,7 @@ module Gumdrop
|
|
65
65
|
end
|
66
66
|
end
|
67
67
|
if opts[:prune] and opts[:root]
|
68
|
-
sp = File.expand_path(
|
68
|
+
sp = File.expand_path( Gumdrop.config.source_dir )
|
69
69
|
rp = File.expand_path(opts[:root])
|
70
70
|
relative_root = rp.gsub(sp, '')[1..-1]
|
71
71
|
rrlen= relative_root.length - 1
|
data/lib/gumdrop/server.rb
CHANGED
@@ -46,7 +46,8 @@ module Gumdrop
|
|
46
46
|
content.render
|
47
47
|
else
|
48
48
|
Gumdrop.log.info "[#{$$}] *Static: #{file_path}"
|
49
|
-
|
49
|
+
source_base_path= File.expand_path(Gumdrop.config.source_dir)
|
50
|
+
send_file File.join( source_base_path, file_path)
|
50
51
|
end
|
51
52
|
else
|
52
53
|
Gumdrop.log.error "[#{$$}] *Missing: #{file_path}"
|
@@ -46,6 +46,9 @@ generate do
|
|
46
46
|
|
47
47
|
end
|
48
48
|
|
49
|
+
# Example of skipping a source file from compilation (stitch ignores this setting)
|
50
|
+
# skip 'file-to-ignore.html'
|
51
|
+
|
49
52
|
# Example of using a content filter to compress CoffeeScript/JS output
|
50
53
|
# require 'jsmin'
|
51
54
|
# content_filter do |content, info|
|
@@ -36,7 +36,7 @@ Slim::Engine.set_default_options pretty:true
|
|
36
36
|
# """
|
37
37
|
# end
|
38
38
|
#
|
39
|
-
# stitch 'app.js', :paths=>['source/app_src'], :root=>'source/app_src', :compress=>true, :prune=>true # Prune will remove the source files from the output tree -- you can add :dependencies=>['dir'] too
|
39
|
+
# stitch 'app.js', :identifier=>'app', :paths=>['source/app_src'], :root=>'source/app_src', :compress=>true, :prune=>true # Prune will remove the source files from the output tree -- you can add :dependencies=>['dir'] too
|
40
40
|
#
|
41
41
|
# # Maybe for a tumblr-like pager
|
42
42
|
# pager= Gumdrop.data.pager_for :posts, base_path:'posts/page', page_size:5
|
@@ -45,3 +45,6 @@ Slim::Engine.set_default_options pretty:true
|
|
45
45
|
# end
|
46
46
|
#
|
47
47
|
# end
|
48
|
+
|
49
|
+
# Example of skipping a source file from compilation (stitch ignores this setting)
|
50
|
+
# skip 'file-to-ignore.html'
|
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.3.
|
4
|
+
version: 0.3.7
|
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: &70326608344860 !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: *70326608344860
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: tilt
|
27
|
-
requirement: &
|
27
|
+
requirement: &70326608344040 !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: *70326608344040
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: active_support
|
38
|
-
requirement: &
|
38
|
+
requirement: &70326608342600 !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: *70326608342600
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: trollop
|
49
|
-
requirement: &
|
49
|
+
requirement: &70326608341700 !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: *70326608341700
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: haml
|
60
|
-
requirement: &
|
60
|
+
requirement: &70326608340560 !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: *70326608340560
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: sass
|
71
|
-
requirement: &
|
71
|
+
requirement: &70326608339560 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70326608339560
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: i18n
|
82
|
-
requirement: &
|
82
|
+
requirement: &70326608338420 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :runtime
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70326608338420
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: bundle
|
93
|
-
requirement: &
|
93
|
+
requirement: &70326608336800 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,7 +98,7 @@ dependencies:
|
|
98
98
|
version: '0'
|
99
99
|
type: :runtime
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *70326608336800
|
102
102
|
description: A simple cms/prototyping tool.
|
103
103
|
email: matt@elucidata.net
|
104
104
|
executables:
|