plate 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## Plate 0.5.3
2
+
3
+ * Added support for Sass @import statements.
4
+ * Partial-style assets are not included in the build by default. Partial file names start with an underscore.
5
+
1
6
  ## Plate 0.5.2
2
7
 
3
8
  * Added `platify` command line utility to set up a new site.
data/lib/plate/asset.rb CHANGED
@@ -18,13 +18,17 @@ module Plate
18
18
  "#{directory}/#{file_name}"
19
19
  end
20
20
 
21
+ def pathname
22
+ File.dirname(self.file)
23
+ end
24
+
21
25
  # Same as page, but no layout applied
22
26
  def rendered_content
23
27
  return @rendered_content if @rendered_content
24
28
 
25
29
  result = File.read(file)
26
30
 
27
- self.engines.each do |engine|
31
+ self.engines.each do |engine|
28
32
  template = engine.new() { result }
29
33
  result = template.render(self, :site => self.site)
30
34
  end
@@ -36,9 +40,8 @@ module Plate
36
40
  # in copying the file over to the destination
37
41
  def write!
38
42
  path = File.join(site.build_destination, file_path)
39
-
40
43
  FileUtils.mkdir_p(File.dirname(path))
41
-
44
+
42
45
  File.open(path, 'w') do |f|
43
46
  f.write(self.rendered_content)
44
47
  end
@@ -25,14 +25,14 @@ module Plate
25
25
  options = {
26
26
  :filename => eval_file,
27
27
  :line => line,
28
- :syntax => syntax
28
+ :syntax => syntax,
29
+ :style => :expanded,
30
+ :load_paths => [ scope.pathname ]
29
31
  }
30
32
 
31
- locals ||= {}
32
-
33
- if locals[:site] and locals[:site].cache_location
34
- options[:cache_location] = File.join(locals[:site].cache_location, 'sass-cache')
35
- end
33
+ if scope.site.cache_location
34
+ options[:cache_location] = File.join(scope.site.cache_location, 'sass-cache')
35
+ end
36
36
 
37
37
  ::Sass::Engine.new(data, options).render
38
38
  end
data/lib/plate/site.rb CHANGED
@@ -200,8 +200,12 @@ module Plate
200
200
  unless File.directory?(file)
201
201
  # Check for assets that need to be compiled. Currently only looks to see if the file
202
202
  # ends in .coffee, .scss or .sass.
203
+ #
204
+ # Assets that start with _ are assumed to be partials and are not loaded.
203
205
  if asset_engine_extensions.include?(File.extname(file))
204
- @assets << Asset.new(self, file)
206
+ unless File.basename(file).start_with?('_')
207
+ @assets << Asset.new(self, file)
208
+ end
205
209
  else
206
210
  # Check for YAML meta header. If it starts with ---, then process it as a page
207
211
  intro = File.open(file) { |f| f.read(3) }
data/lib/plate/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Plate
2
- VERSION = "0.5.2" unless defined?(::Plate::VERSION)
2
+ VERSION = "0.5.3" unless defined?(::Plate::VERSION)
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
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: 2012-03-11 00:00:00.000000000Z
12
+ date: 2012-03-12 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
16
- requirement: &70303059133800 !ruby/object:Gem::Requirement
16
+ requirement: &70129250117980 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '3.2'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70303059133800
24
+ version_requirements: *70129250117980
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: directory_watcher
27
- requirement: &70303059133420 !ruby/object:Gem::Requirement
27
+ requirement: &70129250117600 !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: *70303059133420
35
+ version_requirements: *70129250117600
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: i18n
38
- requirement: &70303059132880 !ruby/object:Gem::Requirement
38
+ requirement: &70129250117060 !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: *70303059132880
46
+ version_requirements: *70129250117060
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rake
49
- requirement: &70303059132460 !ruby/object:Gem::Requirement
49
+ requirement: &70129250116640 !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: *70303059132460
57
+ version_requirements: *70129250116640
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: redcarpet
60
- requirement: &70303059131920 !ruby/object:Gem::Requirement
60
+ requirement: &70129250116100 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '2'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70303059131920
68
+ version_requirements: *70129250116100
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: tilt
71
- requirement: &70303059131420 !ruby/object:Gem::Requirement
71
+ requirement: &70129250115600 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: '1.3'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *70303059131420
79
+ version_requirements: *70129250115600
80
80
  description: Plate is a simple, static site generator and blog engine.
81
81
  email:
82
82
  - john@johntornow.com