style-guide 0.7.2 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE
CHANGED
@@ -1,7 +1,21 @@
|
|
1
|
-
|
1
|
+
The MIT License
|
2
2
|
|
3
|
-
|
3
|
+
Copyright (c) 2012 Pivotal Labs
|
4
4
|
|
5
|
-
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
6
11
|
|
7
|
-
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
@@ -1,3 +1,5 @@
|
|
1
|
+
<% content = render(:file => partial.path) %>
|
2
|
+
|
1
3
|
<div class="style-guide-partial" id="<%= partial.id %>">
|
2
4
|
<div class="style-guide-partial-title">
|
3
5
|
<%= partial.title %>
|
@@ -10,7 +12,7 @@
|
|
10
12
|
<% end %>
|
11
13
|
|
12
14
|
<div class="style-guide-partial-rendered">
|
13
|
-
<%=
|
15
|
+
<%= content %>
|
14
16
|
</div>
|
15
17
|
|
16
18
|
<% if partial.identifiers.any? %>
|
@@ -23,7 +25,7 @@
|
|
23
25
|
|
24
26
|
<input id="style-guide-toggle-<%= partial.id %>" type="checkbox" />
|
25
27
|
<label for="style-guide-toggle-<%= partial.id %>">
|
26
|
-
<pre class="style-guide-partial-source prettyprint linenums"><%=
|
28
|
+
<pre class="style-guide-partial-source prettyprint linenums"><%= escape_for_display(content) %></pre>
|
27
29
|
<div class="style-guide-toggle show">Show source code</div>
|
28
30
|
<div class="style-guide-toggle hide">Hide source code</div>
|
29
31
|
</label>
|
data/lib/style_guide/partial.rb
CHANGED
@@ -19,10 +19,6 @@ module StyleGuide
|
|
19
19
|
@title ||= File.basename(path, File.extname(path)).titleize.strip
|
20
20
|
end
|
21
21
|
|
22
|
-
def content
|
23
|
-
rendered.gsub(/\</, "<").gsub(/\>/, ">").html_safe
|
24
|
-
end
|
25
|
-
|
26
22
|
def description
|
27
23
|
@description ||= GitHub::Markdown.render_gfm(translated_description)
|
28
24
|
end
|
@@ -49,10 +45,6 @@ module StyleGuide
|
|
49
45
|
|
50
46
|
private
|
51
47
|
|
52
|
-
def rendered
|
53
|
-
@rendered ||= Tilt.new(path).render
|
54
|
-
end
|
55
|
-
|
56
48
|
def style_guide_scope
|
57
49
|
[:style_guide, section.id.to_sym]
|
58
50
|
end
|
@@ -66,5 +58,9 @@ module StyleGuide
|
|
66
58
|
def parsed
|
67
59
|
@parsed ||= Nokogiri::HTML.parse(rendered)
|
68
60
|
end
|
61
|
+
|
62
|
+
def rendered
|
63
|
+
@rendered ||= Tilt.new(path).render
|
64
|
+
end
|
69
65
|
end
|
70
66
|
end
|
data/lib/style_guide/version.rb
CHANGED
@@ -45,15 +45,6 @@ describe StyleGuide::Partial do
|
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
|
-
describe "#content" do
|
49
|
-
let(:tilt) { double(:tilt, :render => "reading is for chumps") }
|
50
|
-
before { Tilt.stub(:new => tilt) }
|
51
|
-
|
52
|
-
subject { partial.content }
|
53
|
-
|
54
|
-
it { should == "reading is for chumps" }
|
55
|
-
end
|
56
|
-
|
57
48
|
describe "#description" do
|
58
49
|
subject { partial.description }
|
59
50
|
|
data/style-guide.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: style-guide
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -426,7 +426,8 @@ files:
|
|
426
426
|
- spec/spec_helper.rb
|
427
427
|
- style-guide.gemspec
|
428
428
|
homepage: https://github.com/pivotal/style-guide
|
429
|
-
licenses:
|
429
|
+
licenses:
|
430
|
+
- MIT
|
430
431
|
post_install_message:
|
431
432
|
rdoc_options: []
|
432
433
|
require_paths:
|