livingstyleguide 0.6.0.alpha.0 → 0.6.0.alpha.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/lib/livingstyleguide.rb +2 -5
- data/lib/livingstyleguide/importer.rb +19 -10
- data/lib/livingstyleguide/integration.rb +3 -0
- data/lib/livingstyleguide/integration/compass.rb +5 -0
- data/lib/livingstyleguide/integration/rails.rb +11 -0
- data/lib/livingstyleguide/renderer.rb +1 -1
- data/lib/livingstyleguide/tilt_template.rb +12 -9
- data/lib/livingstyleguide/version.rb +1 -1
- data/livingstyleguide.gemspec +0 -1
- data/test/fixtures/standalone/style.scss +2 -1
- data/test/fixtures/standalone/styleguide.html.lsg +4 -0
- data/test/integration/standalone_test.rb +1 -1
- metadata +8 -19
- data/test/fixtures/standalone/styleguide.html.scss.lsg +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d11d94de9e3e3effd2978cf825fa788d8b1c580
|
4
|
+
data.tar.gz: 1c229b285f7e026f7eec53f85c039d561740ee85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 995f18281ce94a1eb31f3b711025cc104d3fa4faf8fb23e01443ca57f4069bbea6a63d755315413705e06a5d204dfcec8934791c126f3fe661db8577016fa473
|
7
|
+
data.tar.gz: 95cd6a320e6055b2ef931c2d56f388fbb0f173b596fc57a59df264b3c0271f28b542c4b9bddbf66a6bd8bd6b71f29792c19254cbfaf52769aa055fe20df0dfda
|
data/CHANGELOG.md
CHANGED
data/lib/livingstyleguide.rb
CHANGED
@@ -24,11 +24,6 @@ module LivingStyleGuide
|
|
24
24
|
|
25
25
|
end
|
26
26
|
|
27
|
-
Compass.configuration.add_import_path LivingStyleGuide::VariablesImporter.new
|
28
|
-
|
29
|
-
base_directory = File.join(File.dirname(__FILE__), '..')
|
30
|
-
Compass::Frameworks.register 'livingstyleguide', :path => base_directory
|
31
|
-
|
32
27
|
class Sass::Engine
|
33
28
|
include LivingStyleGuide::Renderer
|
34
29
|
end
|
@@ -39,3 +34,5 @@ class String
|
|
39
34
|
end
|
40
35
|
end
|
41
36
|
|
37
|
+
require 'livingstyleguide/integration'
|
38
|
+
|
@@ -1,18 +1,27 @@
|
|
1
|
-
|
1
|
+
class LivingStyleGuide::Importer < Sass::Importers::Filesystem
|
2
|
+
|
3
|
+
def initialize(root)
|
4
|
+
super(root)
|
5
|
+
end
|
2
6
|
|
3
|
-
class LivingStyleGuide::Importer < Sass::Globbing::Importer
|
4
7
|
def find_relative(name, base, options, absolute = false)
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
file.sub!(/(.*)\//, '\\1/_') unless file =~ /\/_/
|
8
|
+
find_markdown(File.join(File.dirname(base), name))
|
9
|
+
super(name, base, options)
|
10
|
+
end
|
9
11
|
|
10
|
-
|
11
|
-
|
12
|
-
|
12
|
+
def find(name, options)
|
13
|
+
find_markdown(name)
|
14
|
+
super(name, options)
|
15
|
+
end
|
13
16
|
|
14
|
-
|
17
|
+
def find_markdown(sass_filename)
|
18
|
+
glob = "#{sass_filename.sub(/\.s[ac]ss$/, '')}.md"
|
19
|
+
glob.sub!(/(.*)\//, '\\1/{_,}') unless glob =~ /\/_/
|
20
|
+
glob = '{_,}' + glob unless glob =~ /\//
|
21
|
+
Dir.glob(glob) do |markdown_filename|
|
22
|
+
LivingStyleGuide.add_markdown File.read(markdown_filename)
|
15
23
|
end
|
16
24
|
end
|
25
|
+
|
17
26
|
end
|
18
27
|
|
@@ -0,0 +1,11 @@
|
|
1
|
+
if defined?(Rails) and defined?(Rails::Railtie)
|
2
|
+
|
3
|
+
require 'rails'
|
4
|
+
class LivingStyleGuideRailtie < Rails::Railtie
|
5
|
+
initializer 'living_style_guide.assets' do
|
6
|
+
Rails.application.assets.register_engine('.lsg', ::Tilt::LivingStyleGuideTemplate)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
end
|
11
|
+
|
@@ -5,7 +5,7 @@ module LivingStyleGuide::Renderer
|
|
5
5
|
def render_living_style_guide
|
6
6
|
@css = self.render
|
7
7
|
template = File.read(File.join(File.dirname(__FILE__), '..', '..', 'templates', 'layouts', 'default.html.erb'))
|
8
|
-
markdown = LivingStyleGuide.markdown
|
8
|
+
markdown = LivingStyleGuide.markdown || ""
|
9
9
|
@html = LivingStyleGuide::RedcarpetTemplate.new{ markdown }.render
|
10
10
|
LivingStyleGuide.reset
|
11
11
|
ERB.new(template).result(binding)
|
@@ -11,25 +11,28 @@ module ::Tilt
|
|
11
11
|
|
12
12
|
def evaluate(scope, locals, &block)
|
13
13
|
engine = ::Sass::Engine.new(data, sass_options)
|
14
|
-
|
14
|
+
engine.render_living_style_guide
|
15
15
|
end
|
16
16
|
|
17
17
|
private
|
18
18
|
def sass_options
|
19
19
|
options = Compass.configuration.to_sass_plugin_options
|
20
20
|
options[:template_location].each do |path, short|
|
21
|
-
options[:load_paths] << path
|
21
|
+
options[:load_paths] << ::LivingStyleGuide::Importer.new(path)
|
22
22
|
end
|
23
|
-
options[:filename]
|
24
|
-
options[:line]
|
25
|
-
options[:syntax]
|
26
|
-
options[:importer]
|
23
|
+
options[:filename] = eval_file
|
24
|
+
options[:line] = line
|
25
|
+
options[:syntax] = detect_syntax
|
26
|
+
options[:importer] = LivingStyleGuide::Importer.new('.')
|
27
27
|
options
|
28
28
|
end
|
29
|
-
end
|
30
29
|
|
31
|
-
|
32
|
-
|
30
|
+
private
|
31
|
+
def detect_syntax
|
32
|
+
data =~ %r(^//\s*@syntax\s*:\s*sass\s*$) ? :sass : :scss
|
33
|
+
end
|
33
34
|
end
|
35
|
+
|
36
|
+
register 'lsg', LivingStyleGuideTemplate
|
34
37
|
end
|
35
38
|
|
data/livingstyleguide.gemspec
CHANGED
@@ -20,7 +20,6 @@ Gem::Specification.new do |gem|
|
|
20
20
|
gem.add_dependency 'minisyntax'
|
21
21
|
gem.add_dependency 'compass'
|
22
22
|
gem.add_dependency 'sass'
|
23
|
-
gem.add_dependency 'sass-globbing'
|
24
23
|
gem.add_dependency 'redcarpet'
|
25
24
|
gem.add_dependency 'tilt'
|
26
25
|
gem.add_dependency 'activesupport'
|
@@ -1 +1,2 @@
|
|
1
|
-
@import "modules
|
1
|
+
@import "modules/buttons";
|
2
|
+
|
@@ -4,7 +4,7 @@ require 'tilt'
|
|
4
4
|
class MarkdownTest < Test::Unit::TestCase
|
5
5
|
|
6
6
|
def test_standalone_project
|
7
|
-
html = Tilt.new('test/fixtures/standalone/styleguide.html.
|
7
|
+
html = Tilt.new('test/fixtures/standalone/styleguide.html.lsg').render
|
8
8
|
assert_match %r(background: red), html
|
9
9
|
assert_match %r(<button class="button">), html
|
10
10
|
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: 0.6.0.alpha.
|
4
|
+
version: 0.6.0.alpha.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nico Hagenburger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minisyntax
|
@@ -52,20 +52,6 @@ dependencies:
|
|
52
52
|
- - '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: sass-globbing
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - '>='
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :runtime
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - '>='
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: redcarpet
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -170,6 +156,9 @@ files:
|
|
170
156
|
- lib/livingstyleguide.rb
|
171
157
|
- lib/livingstyleguide/command_line_interface.rb
|
172
158
|
- lib/livingstyleguide/importer.rb
|
159
|
+
- lib/livingstyleguide/integration.rb
|
160
|
+
- lib/livingstyleguide/integration/compass.rb
|
161
|
+
- lib/livingstyleguide/integration/rails.rb
|
173
162
|
- lib/livingstyleguide/markdown_extensions.rb
|
174
163
|
- lib/livingstyleguide/renderer.rb
|
175
164
|
- lib/livingstyleguide/sass_extensions.rb
|
@@ -201,7 +190,7 @@ files:
|
|
201
190
|
- test/fixtures/standalone/modules/_buttons.md
|
202
191
|
- test/fixtures/standalone/modules/_buttons.scss
|
203
192
|
- test/fixtures/standalone/style.scss
|
204
|
-
- test/fixtures/standalone/styleguide.html.
|
193
|
+
- test/fixtures/standalone/styleguide.html.lsg
|
205
194
|
- test/fixtures/stylesheets/variables/_more-other-colors.sass
|
206
195
|
- test/fixtures/stylesheets/variables/colors.scss
|
207
196
|
- test/fixtures/stylesheets/variables/other-colors.sass
|
@@ -229,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
229
218
|
version: 1.3.1
|
230
219
|
requirements: []
|
231
220
|
rubyforge_project:
|
232
|
-
rubygems_version: 2.
|
221
|
+
rubygems_version: 2.1.11
|
233
222
|
signing_key:
|
234
223
|
specification_version: 4
|
235
224
|
summary: Living Style Guide
|
@@ -250,7 +239,7 @@ test_files:
|
|
250
239
|
- test/fixtures/standalone/modules/_buttons.md
|
251
240
|
- test/fixtures/standalone/modules/_buttons.scss
|
252
241
|
- test/fixtures/standalone/style.scss
|
253
|
-
- test/fixtures/standalone/styleguide.html.
|
242
|
+
- test/fixtures/standalone/styleguide.html.lsg
|
254
243
|
- test/fixtures/stylesheets/variables/_more-other-colors.sass
|
255
244
|
- test/fixtures/stylesheets/variables/colors.scss
|
256
245
|
- test/fixtures/stylesheets/variables/other-colors.sass
|