vivus 1.0.5 → 1.0.6
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/MIT-LICENSE +1 -1
- data/app/controllers/vivus/styles_controller.rb +5 -1
- data/app/models/stylesheet.rb +0 -1
- data/app/views/vivus/styles/index.html.erb +13 -20
- data/lib/vivus/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13980c33f9caddae4de3d035348884f27c3f23c2
|
4
|
+
data.tar.gz: cc900d231364964155a39df81819c8a83e0aa17c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 418bc84b3972d05a4ac4ad1775986898ccd4d90eda741a6402ef4a26d077f98335251330079d66414afa0421a4661cea7335fd29a63083c0463d5a10e404d567
|
7
|
+
data.tar.gz: 4a782a7a5e5cdfb12d27dd70b2cdbc6e17295a944bdb94e5f181660e590315f05b5f2214f051912fb116a4f74190a419bdac6497cd2aa914363402b4a65f86a8
|
data/MIT-LICENSE
CHANGED
@@ -8,7 +8,11 @@ class Vivus::StylesController < Vivus::ApplicationController
|
|
8
8
|
item.is_a?(String) && item[-4,4] == ".css"
|
9
9
|
}
|
10
10
|
|
11
|
-
@stylesheets = @css_paths
|
11
|
+
@stylesheets = @css_paths
|
12
|
+
.map{|file_path| Stylesheet.new(css: sprockets[file_path].body)}
|
13
|
+
.map{|stylesheet| stylesheet.parse}
|
14
|
+
.reject{|stylesheet| stylesheet.empty?}
|
15
|
+
.inject({}){ |a,b| a.merge(b) }
|
12
16
|
end
|
13
17
|
|
14
18
|
private
|
data/app/models/stylesheet.rb
CHANGED
@@ -6,28 +6,21 @@
|
|
6
6
|
</div>
|
7
7
|
<div id="vivus-body">
|
8
8
|
<ul class="vivus-sections">
|
9
|
-
<% @stylesheets.each do |
|
10
|
-
|
11
|
-
|
12
|
-
<
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
</ul>
|
17
|
-
</li>
|
18
|
-
<% end %>
|
9
|
+
<% @stylesheets.each do |title, components| %>
|
10
|
+
<li class="vivus-section">
|
11
|
+
<h1 class="vivus-section-title"><%= title %></h1>
|
12
|
+
<ul class="vivus-components">
|
13
|
+
<%= render partial: "component", collection: components %>
|
14
|
+
</ul>
|
15
|
+
</li>
|
19
16
|
<% end %>
|
20
17
|
|
21
|
-
<% if @stylesheets.
|
22
|
-
<li>
|
23
|
-
<h2
|
24
|
-
<
|
25
|
-
<p>
|
26
|
-
<
|
27
|
-
<li><code>// Description</code> indicates this is a Vivus comment, and will be parsed accord
|
28
|
-
<li><code>// Example</code> marks the start and end of the HTML example code that
|
29
|
-
</ul>
|
30
|
-
<br />
|
18
|
+
<% if @stylesheets.flatten.blank? %>
|
19
|
+
<li class="vivus-section">
|
20
|
+
<h2></h2>
|
21
|
+
<h1 class="vivus-section-title">Let's begin!</h1>
|
22
|
+
<p>Above each block of code in your CSS, start documenting your styleguide by writing comments.
|
23
|
+
<p>Use the below example as a starting point.</p>
|
31
24
|
<pre>
|
32
25
|
/*
|
33
26
|
[Name] The name of the component (e.g. Success Buttons)
|
data/lib/vivus/version.rb
CHANGED