x_ray 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -2
- data/README.md +28 -1
- data/app/assets/stylesheets/x_ray/highlight.css +59 -0
- data/app/assets/stylesheets/x_ray/prettifier.scss +14 -11
- data/app/helpers/x_ray/helper.rb +7 -0
- data/app/views/layouts/x_ray/_scan.html.erb +4 -4
- data/lib/x_ray/version.rb +1 -1
- data/lib/x_ray.rb +2 -0
- data/x_ray.gemspec +1 -0
- metadata +16 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c2839f925cb026d35c366e76c7454b8280fd27b
|
4
|
+
data.tar.gz: 1056154f7182932f32c7bb0305ec3c6fe3fafdb0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34cc05581d2d8883090d52cdfbdaef3e3ae75ef44a066df20fa6569cef72c29a2e83e954153ff1d27a7d763676d4abe6aa527c9257e6596c7008fac0e7fd3e02
|
7
|
+
data.tar.gz: f513e47dbb8d2451e46bb37e7d1e732f4bb30bdd82a26dcf2eb7c66053867b7b7a11b1fa0b875e93008d3aab1906dde06101ca06fc414f5327ac98037356dfc7
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
|
4
|
+
x_ray (0.0.2)
|
5
|
+
highlight
|
5
6
|
rails (~> 4.0)
|
6
7
|
|
7
8
|
GEM
|
@@ -48,6 +49,7 @@ GEM
|
|
48
49
|
erubis (2.7.0)
|
49
50
|
globalid (0.3.6)
|
50
51
|
activesupport (>= 4.1.0)
|
52
|
+
highlight (2.0.0)
|
51
53
|
i18n (0.7.0)
|
52
54
|
json (1.8.3)
|
53
55
|
loofah (2.0.3)
|
@@ -107,4 +109,4 @@ PLATFORMS
|
|
107
109
|
|
108
110
|
DEPENDENCIES
|
109
111
|
sqlite3
|
110
|
-
|
112
|
+
x_ray!
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# x_ray
|
2
2
|
|
3
|
-
|
3
|
+
x_ray is a gem that helps easily display code examples. Uses https://github.com/simplabs/highlight for syntax highlighting which is supported by http://pygments.org
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -24,6 +24,8 @@ include XRay::Helper
|
|
24
24
|
|
25
25
|
## Usage
|
26
26
|
|
27
|
+
Works with plain html and embedded helper methods
|
28
|
+
|
27
29
|
```erb
|
28
30
|
<%= x_ray do %>
|
29
31
|
<div>
|
@@ -34,4 +36,29 @@ include XRay::Helper
|
|
34
36
|
</ol>
|
35
37
|
</div>
|
36
38
|
<% end %>
|
39
|
+
|
40
|
+
<%= x_ray do %>
|
41
|
+
<%= submit_tag 'Set Time Zone', class: 'button primary-button mobile-full-button' %>
|
42
|
+
<% end %>
|
43
|
+
```
|
44
|
+
|
45
|
+
<img src="http://i.imgur.com/jdxzuRw.png">
|
46
|
+
|
47
|
+
### Customization
|
48
|
+
|
49
|
+
You can customize the output by overriding the default styles.
|
50
|
+
|
51
|
+
Example:
|
52
|
+
```css
|
53
|
+
.x-ray-block {
|
54
|
+
.example {
|
55
|
+
background-color: blue;
|
56
|
+
padding: 40px;
|
57
|
+
}
|
58
|
+
|
59
|
+
.code-scan {
|
60
|
+
background-color: red;
|
61
|
+
padding: 40px;
|
62
|
+
}
|
63
|
+
}
|
37
64
|
```
|
@@ -0,0 +1,59 @@
|
|
1
|
+
.c { color: #408080; font-style: italic } /* Comment */
|
2
|
+
.err { border: 1px solid #FF0000 } /* Error */
|
3
|
+
.k { color: #008000; font-weight: bold } /* Keyword */
|
4
|
+
.o { color: #666666 } /* Operator */
|
5
|
+
.cm { color: #408080; font-style: italic } /* Comment.Multiline */
|
6
|
+
.cp { color: #BC7A00 } /* Comment.Preproc */
|
7
|
+
.c1 { color: #408080; font-style: italic } /* Comment.Single */
|
8
|
+
.cs { color: #408080; font-style: italic } /* Comment.Special */
|
9
|
+
.gd { color: #A00000 } /* Generic.Deleted */
|
10
|
+
.ge { font-style: italic } /* Generic.Emph */
|
11
|
+
.gr { color: #FF0000 } /* Generic.Error */
|
12
|
+
.gh { color: #000080; font-weight: bold } /* Generic.Heading */
|
13
|
+
.gi { color: #00A000 } /* Generic.Inserted */
|
14
|
+
.go { color: #808080 } /* Generic.Output */
|
15
|
+
.gp { color: #000080; font-weight: bold } /* Generic.Prompt */
|
16
|
+
.gs { font-weight: bold } /* Generic.Strong */
|
17
|
+
.gu { color: #800080; font-weight: bold } /* Generic.Subheading */
|
18
|
+
.gt { color: #0040D0 } /* Generic.Traceback */
|
19
|
+
.kc { color: #008000; font-weight: bold } /* Keyword.Constant */
|
20
|
+
.kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
|
21
|
+
.kp { color: #008000 } /* Keyword.Pseudo */
|
22
|
+
.kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
|
23
|
+
.kt { color: #B00040 } /* Keyword.Type */
|
24
|
+
.m { color: #666666 } /* Literal.Number */
|
25
|
+
.s { color: #BA2121 } /* Literal.String */
|
26
|
+
.na { color: #7D9029 } /* Name.Attribute */
|
27
|
+
.nb { color: #008000 } /* Name.Builtin */
|
28
|
+
.nc { color: #0000FF; font-weight: bold } /* Name.Class */
|
29
|
+
.no { color: #880000 } /* Name.Constant */
|
30
|
+
.nd { color: #AA22FF } /* Name.Decorator */
|
31
|
+
.ni { color: #999999; font-weight: bold } /* Name.Entity */
|
32
|
+
.ne { color: #D2413A; font-weight: bold } /* Name.Exception */
|
33
|
+
.nf { color: #0000FF } /* Name.Function */
|
34
|
+
.nl { color: #A0A000 } /* Name.Label */
|
35
|
+
.nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
|
36
|
+
.nt { color: #008000; font-weight: bold } /* Name.Tag */
|
37
|
+
.nv { color: #19177C } /* Name.Variable */
|
38
|
+
.ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
|
39
|
+
.w { color: #bbbbbb } /* Text.Whitespace */
|
40
|
+
.mf { color: #666666 } /* Literal.Number.Float */
|
41
|
+
.mh { color: #666666 } /* Literal.Number.Hex */
|
42
|
+
.mi { color: #666666 } /* Literal.Number.Integer */
|
43
|
+
.mo { color: #666666 } /* Literal.Number.Oct */
|
44
|
+
.sb { color: #BA2121 } /* Literal.String.Backtick */
|
45
|
+
.sc { color: #BA2121 } /* Literal.String.Char */
|
46
|
+
.sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
|
47
|
+
.s2 { color: #BA2121 } /* Literal.String.Double */
|
48
|
+
.se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
|
49
|
+
.sh { color: #BA2121 } /* Literal.String.Heredoc */
|
50
|
+
.si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
|
51
|
+
.sx { color: #008000 } /* Literal.String.Other */
|
52
|
+
.sr { color: #BB6688 } /* Literal.String.Regex */
|
53
|
+
.s1 { color: #BA2121 } /* Literal.String.Single */
|
54
|
+
.ss { color: #19177C } /* Literal.String.Symbol */
|
55
|
+
.bp { color: #008000 } /* Name.Builtin.Pseudo */
|
56
|
+
.vc { color: #19177C } /* Name.Variable.Class */
|
57
|
+
.vg { color: #19177C } /* Name.Variable.Global */
|
58
|
+
.vi { color: #19177C } /* Name.Variable.Instance */
|
59
|
+
.il { color: #666666 } /* Literal.Number.Integer.Long */
|
@@ -1,8 +1,10 @@
|
|
1
|
+
@import 'highlight';
|
2
|
+
|
1
3
|
$x-ray-bg-color: #eceff1;
|
2
4
|
$x-ray-border-color: darken($x-ray-bg-color, 30);
|
3
5
|
$x-ray-border-radius: 3px;
|
4
6
|
|
5
|
-
.
|
7
|
+
.x-ray-block {
|
6
8
|
border: 1px solid $x-ray-border-color;
|
7
9
|
border-radius: $x-ray-border-radius;
|
8
10
|
margin-bottom: 30px;
|
@@ -27,16 +29,17 @@ $x-ray-border-radius: 3px;
|
|
27
29
|
pre {
|
28
30
|
margin: 0;
|
29
31
|
}
|
30
|
-
}
|
31
32
|
|
32
|
-
.
|
33
|
-
|
34
|
-
}
|
33
|
+
.example {
|
34
|
+
padding: 15px;
|
35
|
+
}
|
35
36
|
|
36
|
-
.
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
37
|
+
.code-scan {
|
38
|
+
background-color: $x-ray-bg-color;
|
39
|
+
border-top: 1px solid $x-ray-border-color;
|
40
|
+
border-bottom-left-radius: $x-ray-border-radius;
|
41
|
+
border-bottom-right-radius: $x-ray-border-radius;
|
42
|
+
padding: 15px 15px 0px 15px;
|
43
|
+
overflow-x: auto;
|
44
|
+
}
|
42
45
|
}
|
data/app/helpers/x_ray/helper.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
<div class="
|
2
|
-
<div class="
|
1
|
+
<div class="x-ray-block">
|
2
|
+
<div class="example">
|
3
3
|
<%= yield %>
|
4
4
|
</div>
|
5
5
|
|
6
|
-
<div class="
|
6
|
+
<div class="code-scan">
|
7
7
|
<pre>
|
8
|
-
|
8
|
+
<%= x_ray_scan { yield } %>
|
9
9
|
</pre>
|
10
10
|
</div>
|
11
11
|
</div>
|
data/lib/x_ray/version.rb
CHANGED
data/lib/x_ray.rb
CHANGED
data/x_ray.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: x_ray
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tiffany Huang
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '4.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: highlight
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: sqlite3
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -50,6 +64,7 @@ files:
|
|
50
64
|
- MIT-LICENSE
|
51
65
|
- README.md
|
52
66
|
- app/assets/javascripts/x_ray/application.js
|
67
|
+
- app/assets/stylesheets/x_ray/highlight.css
|
53
68
|
- app/assets/stylesheets/x_ray/prettifier.scss
|
54
69
|
- app/helpers/x_ray/helper.rb
|
55
70
|
- app/views/layouts/x_ray/_scan.html.erb
|