livingstyleguide 2.0.0.alpha.7 → 2.0.0.alpha.8

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: 438f69eb3ec2f4eb23b292b249efdb90c1717626
4
- data.tar.gz: c756e5fde9db9cca59a375b44476f75f81ca71d3
3
+ metadata.gz: 5e3b015481d2b291fe4ba908445a84a459d76419
4
+ data.tar.gz: 116a75025030319420a75c8fa6a74110a81252fa
5
5
  SHA512:
6
- metadata.gz: faf35f680b14f27dd18da04a9700a8bce0ff8fe3397a08f1c5cd38372b1c0a3630b4937e193b5a2eab9dfd8ca4fefd0c81728fd31e0155957438a64f814b8e92
7
- data.tar.gz: eb1c5979afdcfd392e66bd0f220106d86911e66c2ea0e7d963b63a26434c005a84f37486682d9b752bbbe1ce86c412d7a15a6b7cc7d9e1dd962ae38221f7b177
6
+ metadata.gz: 1eaa5240a3bf3afb259c544b76207a060ae9fcadb0da48edeb52af8d31d314a036741e59043fb1a78fa7628866a951d1e0fd2a17ec918cf058d50824592a5956
7
+ data.tar.gz: 7d06db6a008fea6c480440f241c9497baadf0a3fab357cacaf06f62c8048f410a1aacded48de4e300c1c09c36a05654e532e8a4c0955f4dbfbaca6b059f6b3e3
@@ -38,9 +38,6 @@ class LivingStyleGuide::Document < ::Tilt::Template
38
38
  @css = ''
39
39
  @locals = {}
40
40
  @defaults = { global: {} }
41
- @head = ""
42
- @header = ""
43
- @footer = ""
44
41
  end
45
42
 
46
43
  def highlighted_source
@@ -64,6 +61,16 @@ class LivingStyleGuide::Document < ::Tilt::Template
64
61
  @id ||= generate_id
65
62
  end
66
63
 
64
+ def path
65
+ if file
66
+ File.dirname(file)
67
+ elsif options.has_key?(:livingstyleguide)
68
+ options[:livingstyleguide].path
69
+ else
70
+ "."
71
+ end
72
+ end
73
+
67
74
  def erb
68
75
  @erb ||= parse_filters do |name, arguments, options, block|
69
76
  options = %Q(document.defaults[:global].merge(document.defaults[:@#{name}] || {}).merge(#{options.inspect}))
@@ -72,6 +79,9 @@ class LivingStyleGuide::Document < ::Tilt::Template
72
79
  end
73
80
 
74
81
  def evaluate(scope, locals, &block)
82
+ @head = ""
83
+ @header = ""
84
+ @footer = ""
75
85
  @scope = scope
76
86
  result = ERB.new(erb).result(@filters.get_binding)
77
87
  @source = result
@@ -247,8 +257,9 @@ class LivingStyleGuide::Document < ::Tilt::Template
247
257
  private
248
258
  def render_scss(scss)
249
259
  sass_options = options.merge(custom: { sprockets_context: @scope })
260
+ sass_options[:load_paths] ||= []
261
+ sass_options[:load_paths] << Dir.pwd
250
262
  if defined?(Compass)
251
- sass_options[:load_paths] ||= []
252
263
  Compass.sass_engine_options[:load_paths].each do |path|
253
264
  sass_options[:load_paths] << path
254
265
  end
@@ -3,9 +3,7 @@ require 'tilt'
3
3
  def map_files(glob, &block)
4
4
  glob << '.lsg' unless glob =~ /\.(\w+|\*)$/
5
5
  glob.gsub!(/[^\/]+$/, '{_,}\\0')
6
- if document.file
7
- glob = File.join(File.dirname(document.file), glob)
8
- end
6
+ glob = File.join(document.path, glob)
9
7
 
10
8
  Dir.glob(glob).map do |file|
11
9
  document.depend_on file
@@ -1,3 +1,3 @@
1
1
  module LivingStyleGuide
2
- VERSION = '2.0.0.alpha.7'
2
+ VERSION = '2.0.0.alpha.8'
3
3
  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.7
4
+ version: 2.0.0.alpha.8
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-04 00:00:00.000000000 Z
11
+ date: 2015-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minisyntax
@@ -266,7 +266,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
266
266
  version: 1.3.1
267
267
  requirements: []
268
268
  rubyforge_project:
269
- rubygems_version: 2.4.5
269
+ rubygems_version: 2.2.2
270
270
  signing_key:
271
271
  specification_version: 4
272
272
  summary: Generate beautiful front-end style guides