laydown 0.2.0 → 0.3.0

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.3.0
data/laydown.gemspec CHANGED
@@ -1,37 +1,34 @@
1
1
  # Generated by jeweler
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{laydown}
8
- s.version = "0.2.0"
8
+ s.version = "0.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["jbe"]
12
- s.date = %q{2011-01-15}
12
+ s.date = %q{2011-02-01}
13
13
  s.description = %q{Provides a simple Ruby DSL for defining HTML5 layouts for web apps. For those of us who has written basically the same html head 200 times and feels like minimalism.}
14
14
  s.email = %q{post@jostein.be}
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE",
17
- "README"
17
+ "README"
18
18
  ]
19
19
  s.files = [
20
20
  ".document",
21
- ".gitignore",
22
- "LICENSE",
23
- "README",
24
- "Rakefile",
25
- "VERSION",
26
- "laydown.gemspec",
27
- "lib/laydown.rb",
28
- "lib/templates/default_layout.rb",
29
- "nothing",
30
- "templates/default_layout.tenjin.html",
31
- "test/rough.rb"
21
+ "LICENSE",
22
+ "README",
23
+ "Rakefile",
24
+ "VERSION",
25
+ "laydown.gemspec",
26
+ "lib/laydown.rb",
27
+ "lib/templates/default_layout.rb",
28
+ "templates/default_layout.tenjin.html",
29
+ "test/rough.rb"
32
30
  ]
33
31
  s.homepage = %q{http://github.com/jbe/laydown}
34
- s.rdoc_options = ["--charset=UTF-8"]
35
32
  s.require_paths = ["lib"]
36
33
  s.rubygems_version = %q{1.3.7}
37
34
  s.summary = %q{Pure Ruby HTML5 layout DSL for microframeworks.}
data/lib/laydown.rb CHANGED
@@ -3,7 +3,7 @@ require 'instant_dsl'
3
3
 
4
4
  module Laydown
5
5
 
6
- DSL_WORDS = [:title, :description, :favicon, :keywords, :css, :js, :body]
6
+ DSL_WORDS = [:title, :description, :favicon, :keywords, :css, :js, :head, :body]
7
7
  DSL = InstantDSL[*DSL_WORDS]
8
8
 
9
9
  class NoScope < Object; end
@@ -16,6 +16,7 @@ module Laydown
16
16
  @keywords = v[:keywords].join(', ')
17
17
  @stylesheets = v[:css].compact
18
18
  @javascripts = v[:js].compact
19
+ @head = v[:head].join("\n")
19
20
  @body = v[:body].join("\n")
20
21
  end
21
22
  end
@@ -48,7 +49,3 @@ end
48
49
 
49
50
 
50
51
 
51
-
52
-
53
-
54
-
@@ -2,9 +2,13 @@ _buf = ''; _buf << %Q`<!DOCTYPE html>
2
2
  <html>
3
3
  <head>
4
4
  <meta charset="utf-8">
5
- <title>#{@title}</title>
6
- <meta name="description" content="#{@description}">
7
- <meta name="keywords" content="#{@keywords}">\n`
5
+ <title>#{@title}</title>\n`
6
+ if @description
7
+ _buf << %Q` <meta name="description" content="#{@description}">\n`
8
+ end
9
+ if @keywords
10
+ _buf << %Q` <meta name="keywords" content="#{@keywords}">\n`
11
+ end
8
12
  if @favicon
9
13
  _buf << %Q` <link rel="shortcun icon" href="#{@favicon}">\n`
10
14
  end
@@ -16,7 +20,8 @@ _buf = ''; _buf << %Q`<!DOCTYPE html>
16
20
  @javascripts.each do |script|
17
21
  _buf << %Q` <script src="#{script}" ></script>\n`
18
22
  end
19
- _buf << %Q` </head>
23
+ _buf << %Q` #{ @head }
24
+ </head>
20
25
 
21
26
  <body>
22
27
  #{ @body }
@@ -3,8 +3,12 @@
3
3
  <head>
4
4
  <meta charset="utf-8">
5
5
  <title>#{@title}</title>
6
+ <?rb if @description ?>
6
7
  <meta name="description" content="#{@description}">
8
+ <?rb end ?>
9
+ <?rb if @keywords ?>
7
10
  <meta name="keywords" content="#{@keywords}">
11
+ <?rb end ?>
8
12
  <?rb if @favicon ?>
9
13
  <link rel="shortcun icon" href="#{@favicon}">
10
14
  <?rb end ?>
@@ -16,6 +20,7 @@
16
20
  <?rb @javascripts.each do |script| ?>
17
21
  <script src="#{script}" ></script>
18
22
  <?rb end ?>
23
+ #{ @head }
19
24
  </head>
20
25
 
21
26
  <body>
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 2
7
+ - 3
8
8
  - 0
9
- version: 0.2.0
9
+ version: 0.3.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - jbe
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-01-15 00:00:00 +01:00
17
+ date: 2011-02-01 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -54,7 +54,6 @@ extra_rdoc_files:
54
54
  - README
55
55
  files:
56
56
  - .document
57
- - .gitignore
58
57
  - LICENSE
59
58
  - README
60
59
  - Rakefile
@@ -62,7 +61,6 @@ files:
62
61
  - laydown.gemspec
63
62
  - lib/laydown.rb
64
63
  - lib/templates/default_layout.rb
65
- - nothing
66
64
  - templates/default_layout.tenjin.html
67
65
  - test/rough.rb
68
66
  has_rdoc: true
@@ -70,8 +68,8 @@ homepage: http://github.com/jbe/laydown
70
68
  licenses: []
71
69
 
72
70
  post_install_message:
73
- rdoc_options:
74
- - --charset=UTF-8
71
+ rdoc_options: []
72
+
75
73
  require_paths:
76
74
  - lib
77
75
  required_ruby_version: !ruby/object:Gem::Requirement
data/.gitignore DELETED
@@ -1,21 +0,0 @@
1
- ## MAC OS
2
- .DS_Store
3
-
4
- ## TEXTMATE
5
- *.tmproj
6
- tmtags
7
-
8
- ## EMACS
9
- *~
10
- \#*
11
- .\#*
12
-
13
- ## VIM
14
- *.swp
15
-
16
- ## PROJECT::GENERAL
17
- coverage
18
- rdoc
19
- pkg
20
-
21
- ## PROJECT::SPECIFIC
data/nothing DELETED
File without changes