gumdrop 0.3.6 → 0.3.7

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.
@@ -1,3 +1,7 @@
1
+ # v0.3.7
2
+ - Added lib_dir and source_dir to config for more customization possibilities
3
+ - Added blacklisting example to templates
4
+
1
5
  # v0.3.6
2
6
  - Correctly added deps to gemspec for i18n and bundle. *ahem*
3
7
  - Version bump
@@ -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
- $: << "#{root}/lib"
63
- if File.exists? "#{root}/lib/view_helpers.rb"
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 "#{root}/lib/view_helpers.rb"
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("#{root}/lib/site.rb").join('')
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
@@ -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)
@@ -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
@@ -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('./source')
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
@@ -46,7 +46,8 @@ module Gumdrop
46
46
  content.render
47
47
  else
48
48
  Gumdrop.log.info "[#{$$}] *Static: #{file_path}"
49
- send_file "source/#{file_path}"
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'
@@ -1,5 +1,5 @@
1
1
  module Gumdrop
2
2
 
3
- VERSION = "0.3.6" unless defined?(::Gumdrop::VERSION)
3
+ VERSION = "0.3.7" unless defined?(::Gumdrop::VERSION)
4
4
 
5
5
  end
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.6
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: &70270329173780 !ruby/object:Gem::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: *70270329173780
24
+ version_requirements: *70326608344860
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: tilt
27
- requirement: &70270329172920 !ruby/object:Gem::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: *70270329172920
35
+ version_requirements: *70326608344040
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: active_support
38
- requirement: &70270329171720 !ruby/object:Gem::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: *70270329171720
46
+ version_requirements: *70326608342600
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: trollop
49
- requirement: &70270329170680 !ruby/object:Gem::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: *70270329170680
57
+ version_requirements: *70326608341700
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: haml
60
- requirement: &70270329169640 !ruby/object:Gem::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: *70270329169640
68
+ version_requirements: *70326608340560
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: sass
71
- requirement: &70270329168420 !ruby/object:Gem::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: *70270329168420
79
+ version_requirements: *70326608339560
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: i18n
82
- requirement: &70270329167340 !ruby/object:Gem::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: *70270329167340
90
+ version_requirements: *70326608338420
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: bundle
93
- requirement: &70270329165840 !ruby/object:Gem::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: *70270329165840
101
+ version_requirements: *70326608336800
102
102
  description: A simple cms/prototyping tool.
103
103
  email: matt@elucidata.net
104
104
  executables: