livingstyleguide 2.0.0.alpha.6 → 2.0.0.alpha.7
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 438f69eb3ec2f4eb23b292b249efdb90c1717626
|
4
|
+
data.tar.gz: c756e5fde9db9cca59a375b44476f75f81ca71d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: faf35f680b14f27dd18da04a9700a8bce0ff8fe3397a08f1c5cd38372b1c0a3630b4937e193b5a2eab9dfd8ca4fefd0c81728fd31e0155957438a64f814b8e92
|
7
|
+
data.tar.gz: eb1c5979afdcfd392e66bd0f220106d86911e66c2ea0e7d963b63a26434c005a84f37486682d9b752bbbe1ce86c412d7a15a6b7cc7d9e1dd962ae38221f7b177
|
@@ -8,10 +8,10 @@ class LivingStyleGuide::Document < ::Tilt::Template
|
|
8
8
|
attr_accessor :source, :type, :filters, :template, :classes, :html
|
9
9
|
attr_accessor :css, :id, :locals
|
10
10
|
attr_accessor :title
|
11
|
-
attr_accessor :
|
11
|
+
attr_accessor :syntax
|
12
12
|
attr_reader :scope
|
13
13
|
|
14
|
-
%w(scss head header footer).each do |attr|
|
14
|
+
%w(scss head header footer defaults).each do |attr|
|
15
15
|
define_method attr do
|
16
16
|
if options.has_key?(:livingstyleguide)
|
17
17
|
options[:livingstyleguide].send(attr)
|
@@ -48,8 +48,9 @@ class LivingStyleGuide::Document < ::Tilt::Template
|
|
48
48
|
if type == :plain
|
49
49
|
without_highlights
|
50
50
|
else
|
51
|
-
|
52
|
-
::
|
51
|
+
@syntax ||= type
|
52
|
+
without_highlights = ERB::Util.h(without_highlights) if @syntax == :html
|
53
|
+
::MiniSyntax.highlight(without_highlights, @syntax || type)
|
53
54
|
end
|
54
55
|
end.gsub("\n", "<br>")
|
55
56
|
end
|
@@ -95,7 +96,10 @@ class LivingStyleGuide::Document < ::Tilt::Template
|
|
95
96
|
require "tilt/#{template_name}"
|
96
97
|
rescue LoadError
|
97
98
|
end
|
98
|
-
engine.new{ remove_highlights(result) }
|
99
|
+
template = engine.new{ remove_highlights(result) }
|
100
|
+
(@locals.is_a?(Array) ? @locals : [@locals]).map do |current_locals|
|
101
|
+
template.render(@scope || Object.new, current_locals.merge(locals))
|
102
|
+
end.join("\n")
|
99
103
|
elsif @type == :escaped
|
100
104
|
ERB::Util.h(remove_highlights(result))
|
101
105
|
else
|
@@ -249,7 +253,7 @@ class LivingStyleGuide::Document < ::Tilt::Template
|
|
249
253
|
sass_options[:load_paths] << path
|
250
254
|
end
|
251
255
|
end
|
252
|
-
scss_template.new(file, sass_options){ scss }.render(@scope)
|
256
|
+
scss_template.new(file, sass_options){ scss }.render(@scope || Object.new)
|
253
257
|
end
|
254
258
|
end
|
255
259
|
|
@@ -3,9 +3,17 @@ require 'yaml'
|
|
3
3
|
|
4
4
|
LivingStyleGuide.add_filter :data do |arguments, options, data|
|
5
5
|
if options[:format] == "yaml"
|
6
|
-
|
6
|
+
data = Psych.load(data)
|
7
7
|
else
|
8
|
-
|
8
|
+
data = "{#{data}}" unless data.strip =~ /^[\[\{]/
|
9
|
+
data = JSON.parse(data)
|
10
|
+
end
|
11
|
+
if data.is_a?(Array)
|
12
|
+
document.locals = [] unless document.locals.is_a?(Array)
|
13
|
+
document.locals.push(*data)
|
14
|
+
else
|
15
|
+
document.locals = {} unless document.locals.is_a?(Hash)
|
16
|
+
document.locals.merge! data
|
9
17
|
end
|
10
18
|
nil
|
11
19
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: livingstyleguide
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.alpha.
|
4
|
+
version: 2.0.0.alpha.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nico Hagenburger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minisyntax
|
@@ -224,6 +224,7 @@ files:
|
|
224
224
|
- lib/livingstyleguide/filters/options.rb
|
225
225
|
- lib/livingstyleguide/filters/require.rb
|
226
226
|
- lib/livingstyleguide/filters/style.rb
|
227
|
+
- lib/livingstyleguide/filters/syntax.rb
|
227
228
|
- lib/livingstyleguide/filters/type.rb
|
228
229
|
- lib/livingstyleguide/integration.rb
|
229
230
|
- lib/livingstyleguide/integration/compass.rb
|
@@ -265,7 +266,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
265
266
|
version: 1.3.1
|
266
267
|
requirements: []
|
267
268
|
rubyforge_project:
|
268
|
-
rubygems_version: 2.
|
269
|
+
rubygems_version: 2.4.5
|
269
270
|
signing_key:
|
270
271
|
specification_version: 4
|
271
272
|
summary: Generate beautiful front-end style guides
|