plate-lang 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 36267fe617deeeb78a1c868f28e0c9e46bdfa0c1
4
- data.tar.gz: 1047dcdbb4f5dcb6192553f785685de979c96ddf
3
+ metadata.gz: 60b1eef965deb6bad87abcdab08187ac7bd3ab22
4
+ data.tar.gz: c44ebe8aab2e189cc5219c2c8c52db98c50355fb
5
5
  SHA512:
6
- metadata.gz: a6b1b3f7ef715c9feab61009aad0085b63f12925a50ce51139a95e0e757c056fde4d4e1d9c0ebe3f2cc0015a4f978d1c40b5b9a68d26e410c0601f56ba277594
7
- data.tar.gz: 99dff05463c47a529e74c88caa707b0462794ec46939f8bb6a791654d31c4c351a79f1461aaf39a9561ddc12b0fe66138dea53f476a63af542397964c07333c3
6
+ metadata.gz: c270324ca8359ec21ef0538d40eae1d63c4a7ae4c2fdb8a5b8b8731545c5c9e1134f9ba0503baea9d248917186710fec69823967f6b6046a4fb534e840749926
7
+ data.tar.gz: fa130aef1350de44e036708661d9be5223250c20cf12ca71364d677b40c1bcd76cc7fcb0e00b5d0c2258e1b713e799bd9498e3856eb599eeb9f2ca5fdf7480cb
data/.gitignore CHANGED
@@ -8,6 +8,7 @@
8
8
  /spec/reports/
9
9
  /tmp/*
10
10
  !/tmp/.keep
11
+ /*.gem
11
12
 
12
13
  .DS_Store
13
14
  *~
data/lib/plate/cli.rb CHANGED
@@ -59,7 +59,7 @@ module Plate
59
59
  def build_html(output, compiler)
60
60
  body = compiler.body
61
61
  meta = compiler.meta
62
- title = meta.nil? ? '' : meta['title']
62
+ title = meta['title']
63
63
  data = JSON.dump(compiler.meta)
64
64
  head = compiler.fonts
65
65
 
@@ -74,7 +74,7 @@ module Plate
74
74
 
75
75
  def build_css(output, compiler, vendor)
76
76
  meta = compiler.meta
77
- bootstrap = (meta && meta['bootstrap']) || {}
77
+ bootstrap = meta['bootstrap'] || {}
78
78
 
79
79
  path = File.join(output, 'assets', 'css', 'app.css')
80
80
  build(path, binding)
@@ -7,6 +7,7 @@ module Plate
7
7
  def initialize
8
8
  @parser = Parser.new
9
9
  self.repeating = false
10
+ self.meta = {}
10
11
  end
11
12
 
12
13
  def compile(code)
@@ -16,7 +17,7 @@ module Plate
16
17
  end
17
18
 
18
19
  def fonts
19
- return '' if meta.nil? || meta['fonts'].nil?
20
+ return '' if meta['fonts'].nil?
20
21
  meta['fonts'].map { |font|
21
22
  "<link href=\"http://fonts.googleapis.com/css?family=#{CGI.escape(font)}\" rel=\"stylesheet\">"
22
23
  }.join("")
@@ -89,7 +90,8 @@ module Plate
89
90
  when /spin(\-\d+\.*\d*)?/
90
91
  s = value.gsub(/spin\-?/, '')
91
92
  s = 1.5 if s.empty?
92
- "style=\"animation: spin #{s}s linear infinite\""
93
+ animation = "animation: spin #{s}s linear infinite"
94
+ "style=\"-webkit-#{animation}; #{animation}\""
93
95
  when 'inherit'
94
96
  'style="color: inherit"'
95
97
  else
@@ -127,7 +129,7 @@ module Plate
127
129
  class FrontMatterNode
128
130
  def compile(compiler, parent = nil)
129
131
  meta = YAML.load(yaml)
130
- compiler.meta = meta
132
+ compiler.meta = meta || {}
131
133
  ''
132
134
  end
133
135
  end
data/lib/plate/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Plate
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/plate-lang.rb ADDED
@@ -0,0 +1 @@
1
+ require "plate"
@@ -7,6 +7,11 @@ pre.prettyprint {
7
7
  border-color: #ccc;
8
8
  }
9
9
 
10
+ @-webkit-keyframes spin {
11
+ 0% { -webkit-transform: rotate(0deg); }
12
+ 100% { -webkit-transform: rotate(359deg); }
13
+ }
14
+
10
15
  @keyframes spin {
11
16
  0% { transform: rotate(0deg); }
12
17
  100% { transform: rotate(359deg); }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plate-lang
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - tnantoka
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-08-04 00:00:00.000000000 Z
11
+ date: 2015-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -131,6 +131,7 @@ files:
131
131
  - bower.json
132
132
  - circle.yml
133
133
  - exe/plate
134
+ - lib/plate-lang.rb
134
135
  - lib/plate.rb
135
136
  - lib/plate/cli.rb
136
137
  - lib/plate/compiler.rb