stasis 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +10 -0
- data/LICENSE +18 -0
- data/README.md +287 -0
- data/Rakefile +109 -0
- data/bin/stasis +30 -0
- data/config/gemsets.yml +9 -0
- data/config/gemspec.yml +17 -0
- data/lib/stasis.rb +291 -0
- data/lib/stasis/dev_mode.rb +55 -0
- data/lib/stasis/gems.rb +154 -0
- data/lib/stasis/plugin.rb +76 -0
- data/lib/stasis/plugins/before.rb +50 -0
- data/lib/stasis/plugins/helpers.rb +29 -0
- data/lib/stasis/plugins/ignore.rb +35 -0
- data/lib/stasis/plugins/instead.rb +15 -0
- data/lib/stasis/plugins/layout.rb +51 -0
- data/lib/stasis/plugins/priority.rb +41 -0
- data/lib/stasis/plugins/render.rb +71 -0
- data/lib/stasis/scope.rb +54 -0
- data/lib/stasis/scope/action.rb +25 -0
- data/lib/stasis/scope/controller.rb +62 -0
- data/lib/stasis/server.rb +90 -0
- data/site/arrow.png +0 -0
- data/site/controller.rb +72 -0
- data/site/github.png +0 -0
- data/site/index.html.haml +24 -0
- data/site/jquery-1.6.2.js +8982 -0
- data/site/stasis.css.scss +226 -0
- data/site/stasis.js.coffee +42 -0
- data/site/stasis.png +0 -0
- data/spec/fixtures/gemsets.yml +9 -0
- data/spec/fixtures/gemspec.yml +15 -0
- data/spec/fixtures/project/_partial.html.haml +1 -0
- data/spec/fixtures/project/before_render_partial.html.haml +1 -0
- data/spec/fixtures/project/before_render_text.html.haml +1 -0
- data/spec/fixtures/project/controller.rb +83 -0
- data/spec/fixtures/project/index.html.haml +16 -0
- data/spec/fixtures/project/layout.html.haml +3 -0
- data/spec/fixtures/project/layout_action.html.haml +1 -0
- data/spec/fixtures/project/layout_action_from_subdirectory.html.haml +1 -0
- data/spec/fixtures/project/layout_controller.html.haml +1 -0
- data/spec/fixtures/project/layout_controller_from_subdirectory.html.haml +1 -0
- data/spec/fixtures/project/no_controller/index.html.haml +12 -0
- data/spec/fixtures/project/not_dynamic.html +1 -0
- data/spec/fixtures/project/plugin.rb +16 -0
- data/spec/fixtures/project/subdirectory/_partial.html.haml +1 -0
- data/spec/fixtures/project/subdirectory/before_render_partial.html.haml +1 -0
- data/spec/fixtures/project/subdirectory/before_render_text.html.haml +1 -0
- data/spec/fixtures/project/subdirectory/controller.rb +66 -0
- data/spec/fixtures/project/subdirectory/ignore.html.haml +0 -0
- data/spec/fixtures/project/subdirectory/index.html.haml +14 -0
- data/spec/fixtures/project/subdirectory/layout.html.haml +3 -0
- data/spec/fixtures/project/subdirectory/layout_action.html.haml +1 -0
- data/spec/fixtures/project/subdirectory/layout_action_from_root.html.haml +1 -0
- data/spec/fixtures/project/subdirectory/layout_controller.html.haml +1 -0
- data/spec/fixtures/project/subdirectory/layout_controller_from_root.html.haml +1 -0
- data/spec/fixtures/project/time.html.haml +2 -0
- data/spec/spec_helper.rb +28 -0
- data/spec/stasis/gems_spec.rb +249 -0
- data/spec/stasis/plugins/before_spec.rb +53 -0
- data/spec/stasis/plugins/helpers_spec.rb +16 -0
- data/spec/stasis/plugins/ignore_spec.rb +17 -0
- data/spec/stasis/plugins/layout_spec.rb +22 -0
- data/spec/stasis/plugins/priority_spec.rb +22 -0
- data/spec/stasis/plugins/render_spec.rb +23 -0
- data/spec/stasis/server_spec.rb +29 -0
- data/spec/stasis_spec.rb +46 -0
- data/stasis.gemspec +32 -0
- metadata +227 -0
@@ -0,0 +1,226 @@
|
|
1
|
+
// normal: 400, semi-bold: 600, bold: 700
|
2
|
+
|
3
|
+
a {
|
4
|
+
color: #2281D1;
|
5
|
+
text-decoration: none;
|
6
|
+
}
|
7
|
+
|
8
|
+
a:hover {
|
9
|
+
text-decoration: underline;
|
10
|
+
}
|
11
|
+
|
12
|
+
body {
|
13
|
+
background-color: #333435;
|
14
|
+
color: #CCD7E1;
|
15
|
+
font-family: 'Open Sans', sans-serif;
|
16
|
+
font-weight: 400;
|
17
|
+
margin: 0 0 50px;
|
18
|
+
}
|
19
|
+
|
20
|
+
ul, #title, #tm {
|
21
|
+
min-width: 800px;
|
22
|
+
}
|
23
|
+
|
24
|
+
ul {
|
25
|
+
background-color: #CCD7E1;
|
26
|
+
font-size: 14px;
|
27
|
+
font-weight: 600;
|
28
|
+
height: 25px;
|
29
|
+
margin: 0;
|
30
|
+
padding: 0;
|
31
|
+
position: fixed;
|
32
|
+
text-align: center;
|
33
|
+
top: 0px;
|
34
|
+
width: 100%;
|
35
|
+
z-index: 10000;
|
36
|
+
|
37
|
+
li {
|
38
|
+
display: inline;
|
39
|
+
line-height: 25px;
|
40
|
+
padding: 0 6px;
|
41
|
+
|
42
|
+
a.selected {
|
43
|
+
color: #06599E;
|
44
|
+
font-weight: 700;
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
#github {
|
50
|
+
position: fixed;
|
51
|
+
height: 141px;
|
52
|
+
opacity: 0.5;
|
53
|
+
right: 0;
|
54
|
+
top: 25px;
|
55
|
+
width: 141px;
|
56
|
+
z-index: 10000;
|
57
|
+
}
|
58
|
+
|
59
|
+
#github:hover {
|
60
|
+
opacity: 1;
|
61
|
+
}
|
62
|
+
|
63
|
+
#title {
|
64
|
+
color: #3393E4;
|
65
|
+
font-family: 'Amaranth', sans-serif;
|
66
|
+
font-size: 110px;
|
67
|
+
font-weight: 400;
|
68
|
+
margin-top: 50px;
|
69
|
+
text-align: center;
|
70
|
+
text-shadow: 0px 5px 1px rgba(0,0,0,0.07);
|
71
|
+
|
72
|
+
-webkit-mask-image: -webkit-gradient(
|
73
|
+
linear,
|
74
|
+
left bottom,
|
75
|
+
left top,
|
76
|
+
color-stop(0, rgba(7,59,102,0.6)),
|
77
|
+
color-stop(0.6, rgba(255,255,255,1))
|
78
|
+
);
|
79
|
+
|
80
|
+
img {
|
81
|
+
margin: 0 10px;
|
82
|
+
}
|
83
|
+
|
84
|
+
img.reverse {
|
85
|
+
-moz-transform: scaleX(-1);
|
86
|
+
-webkit-transform: scaleX(-1);
|
87
|
+
-o-transform: scaleX(-1);
|
88
|
+
transform: scaleX(-1);
|
89
|
+
filter: fliph;
|
90
|
+
}
|
91
|
+
}
|
92
|
+
|
93
|
+
#tm {
|
94
|
+
font-size: 19.4px;
|
95
|
+
font-weight: 700;
|
96
|
+
margin-top: 35px;
|
97
|
+
text-align: center;
|
98
|
+
}
|
99
|
+
|
100
|
+
#body {
|
101
|
+
margin: 20px auto 0;
|
102
|
+
width: 800px;
|
103
|
+
|
104
|
+
a {
|
105
|
+
color: #3393E4;
|
106
|
+
}
|
107
|
+
|
108
|
+
h2 {
|
109
|
+
border-bottom: 2px solid #434445;
|
110
|
+
clear: both;
|
111
|
+
font-size: 19.4px;
|
112
|
+
padding: 20px 0 5px;
|
113
|
+
}
|
114
|
+
|
115
|
+
h3 {
|
116
|
+
font-size: 18px;
|
117
|
+
|
118
|
+
a {
|
119
|
+
color: #CDA869;
|
120
|
+
}
|
121
|
+
}
|
122
|
+
|
123
|
+
p {
|
124
|
+
font-size: 16px;
|
125
|
+
line-height: 32px;
|
126
|
+
margin: 0;
|
127
|
+
padding: 10px 0 20px;
|
128
|
+
|
129
|
+
.arrow {
|
130
|
+
padding-left: 6px;
|
131
|
+
vertical-align: -1px;
|
132
|
+
}
|
133
|
+
}
|
134
|
+
|
135
|
+
pre {
|
136
|
+
background-color: #282929;
|
137
|
+
clear: both;
|
138
|
+
float: right;
|
139
|
+
margin: 10px 0 15px 20px;
|
140
|
+
padding: 10px 15px;
|
141
|
+
width: 360px;
|
142
|
+
|
143
|
+
-webkit-box-shadow: rgba(0, 0, 0, 0.25) 0 1px 2px inset;
|
144
|
+
-webkit-border-radius: 5px;
|
145
|
+
-moz-border-radius: 5px;
|
146
|
+
border-radius: 5px;
|
147
|
+
}
|
148
|
+
|
149
|
+
.clear {
|
150
|
+
clear: both;
|
151
|
+
}
|
152
|
+
|
153
|
+
code, pre {
|
154
|
+
font-family: Consolas, Monaco,"Lucida Console";
|
155
|
+
}
|
156
|
+
|
157
|
+
code {
|
158
|
+
background-color: #282929;
|
159
|
+
font-size: 14px;
|
160
|
+
padding: 4px 4px 2px;
|
161
|
+
}
|
162
|
+
|
163
|
+
.highlight pre {
|
164
|
+
font-size: 12px;
|
165
|
+
|
166
|
+
* { font-family: Consolas, Monaco,"Lucida Console"; }
|
167
|
+
.hll { background-color: #ffffcc }
|
168
|
+
.c { color: #5F5A60; font-style: italic } /* Comment */
|
169
|
+
.err { border:#B22518; } /* Error */
|
170
|
+
.k { color: #CDA869 } /* Keyword */
|
171
|
+
.cm { color: #5F5A60; font-style: italic } /* Comment.Multiline */
|
172
|
+
.cp { color: #5F5A60 } /* Comment.Preproc */
|
173
|
+
.c1 { color: #5F5A60; font-style: italic } /* Comment.Single */
|
174
|
+
.cs { color: #5F5A60; font-style: italic } /* Comment.Special */
|
175
|
+
.gd { background: #420E09 } /* Generic.Deleted */
|
176
|
+
.ge { font-style: italic } /* Generic.Emph */
|
177
|
+
.gr { background: #B22518 } /* Generic.Error */
|
178
|
+
.gh { color: #000080; font-weight: bold } /* Generic.Heading */
|
179
|
+
.gi { background: #253B22 } /* Generic.Inserted */
|
180
|
+
.go { } /* Generic.Output */
|
181
|
+
.gp { font-weight: bold; color: #CDA869 } /* Generic.Prompt */
|
182
|
+
.gs { font-weight: bold } /* Generic.Strong */
|
183
|
+
.gu { color: #800080; font-weight: bold } /* Generic.Subheading */
|
184
|
+
.gt { } /* Generic.Traceback */
|
185
|
+
.kc { } /* Keyword.Constant */
|
186
|
+
.kd { color: #e9df8f; } /* Keyword.Declaration */
|
187
|
+
.kn { } /* Keyword.Namespace */
|
188
|
+
.kp { color: #9B703F } /* Keyword.Pseudo */
|
189
|
+
.kr { } /* Keyword.Reserved */
|
190
|
+
.kt { } /* Keyword.Type */
|
191
|
+
.m { } /* Literal.Number */
|
192
|
+
.s { } /* Literal.String */
|
193
|
+
.na { color: #F9EE98 } /* Name.Attribute */
|
194
|
+
.nb { } /* Name.Builtin */
|
195
|
+
.nc { color: #9B859D; font-weight: bold } /* Name.Class */
|
196
|
+
.no { color: #9B859D } /* Name.Constant */
|
197
|
+
.nd { color: #7587A6 } /* Name.Decorator */
|
198
|
+
.ni { color: #CF6A4C; font-weight: bold } /* Name.Entity */
|
199
|
+
.nf { color: #9B703F; font-weight: bold } /* Name.Function */
|
200
|
+
.nn { color: #9B859D; font-weight: bold } /* Name.Namespace */
|
201
|
+
.nt { color: #CDA869; font-weight: bold } /* Name.Tag */
|
202
|
+
.nv { color: #7587A6 } /* Name.Variable */
|
203
|
+
.ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
|
204
|
+
.w { color: #141414 } /* Text.Whitespace */
|
205
|
+
.mf { color: #CF6A4C } /* Literal.Number.Float */
|
206
|
+
.mh { color: #CF6A4C } /* Literal.Number.Hex */
|
207
|
+
.mi { color: #CF6A4C } /* Literal.Number.Integer */
|
208
|
+
.mo { color: #CF6A4C } /* Literal.Number.Oct */
|
209
|
+
.sb { color: #8F9D6A } /* Literal.String.Backtick */
|
210
|
+
.sc { color: #8F9D6A } /* Literal.String.Char */
|
211
|
+
.sd { color: #8F9D6A; font-style: italic; } /* Literal.String.Doc */
|
212
|
+
.s2 { color: #8F9D6A } /* Literal.String.Double */
|
213
|
+
.se { color: #F9EE98; font-weight: bold; } /* Literal.String.Escape */
|
214
|
+
.sh { color: #8F9D6A } /* Literal.String.Heredoc */
|
215
|
+
.si { color: #DAEFA3; font-weight: bold; } /* Literal.String.Interpol */
|
216
|
+
.sx { color: #8F9D6A } /* Literal.String.Other */
|
217
|
+
.sr { color: #E9C062 } /* Literal.String.Regex */
|
218
|
+
.s1 { color: #8F9D6A } /* Literal.String.Single */
|
219
|
+
.ss { color: #CF6A4C } /* Literal.String.Symbol */
|
220
|
+
.bp { color: #00aaaa } /* Name.Builtin.Pseudo */
|
221
|
+
.vc { color: #7587A6 } /* Name.Variable.Class */
|
222
|
+
.vg { color: #7587A6 } /* Name.Variable.Global */
|
223
|
+
.vi { color: #7587A6 } /* Name.Variable.Instance */
|
224
|
+
.il { color: #009999 } /* Literal.Number.Integer.Long */
|
225
|
+
}
|
226
|
+
}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
smoothScroll = ->
|
2
|
+
$('a[href*=#]').click ->
|
3
|
+
anchor = $(this).attr('href').match(/#(.*)/)[1]
|
4
|
+
target = $('a[name=' + anchor + ']')
|
5
|
+
ran = false
|
6
|
+
$('html, body').animate { scrollTop: target.offset().top - 60 }, 400, ->
|
7
|
+
unless ran
|
8
|
+
offset = this.scrollTop
|
9
|
+
location.hash = anchor
|
10
|
+
this.scrollTop = offset
|
11
|
+
ran = true
|
12
|
+
false
|
13
|
+
|
14
|
+
highlightNav = ->
|
15
|
+
anchors = $('h2 a[name]')
|
16
|
+
anchor_links = $('ul a')
|
17
|
+
positions = anchors.map (i, item) ->
|
18
|
+
$(item).offset().top
|
19
|
+
|
20
|
+
anchors = $.makeArray(anchors).reverse()
|
21
|
+
anchor_links = $.makeArray(anchor_links).reverse()
|
22
|
+
positions = $.makeArray(positions).reverse()
|
23
|
+
|
24
|
+
scrollHappened = ->
|
25
|
+
anchor_index = null
|
26
|
+
scroll_y = this.scrollY
|
27
|
+
$.each positions, (i, item) ->
|
28
|
+
if scroll_y >= item - 70
|
29
|
+
anchor_index = i
|
30
|
+
return false
|
31
|
+
if anchor_index?
|
32
|
+
$(anchor_links).removeClass 'selected'
|
33
|
+
$(anchor_links[anchor_index]).addClass 'selected'
|
34
|
+
if scroll_y < positions[positions.length - 1] - 70
|
35
|
+
$(anchor_links).removeClass 'selected'
|
36
|
+
|
37
|
+
$(window).scroll scrollHappened
|
38
|
+
scrollHappened()
|
39
|
+
|
40
|
+
$ ->
|
41
|
+
smoothScroll()
|
42
|
+
highlightNav()
|
data/site/stasis.png
ADDED
Binary file
|
@@ -0,0 +1,15 @@
|
|
1
|
+
name: name
|
2
|
+
version: 0.1.0
|
3
|
+
authors:
|
4
|
+
- Author
|
5
|
+
email: email@email.com
|
6
|
+
homepage: http://github.com/author/name
|
7
|
+
summary: Summary
|
8
|
+
description: Description
|
9
|
+
dependencies:
|
10
|
+
- rake
|
11
|
+
- default:
|
12
|
+
- mysql
|
13
|
+
- rspec2:
|
14
|
+
- mysql2
|
15
|
+
development_dependencies: null
|
@@ -0,0 +1 @@
|
|
1
|
+
root
|
@@ -0,0 +1 @@
|
|
1
|
+
fail
|
@@ -0,0 +1 @@
|
|
1
|
+
fail
|
@@ -0,0 +1,83 @@
|
|
1
|
+
# Root controller
|
2
|
+
# ---------------
|
3
|
+
|
4
|
+
require "#{File.dirname(__FILE__)}/plugin"
|
5
|
+
|
6
|
+
# Before
|
7
|
+
|
8
|
+
before 'index.html.haml' do
|
9
|
+
@before_index_literal = :root
|
10
|
+
end
|
11
|
+
|
12
|
+
before 'no_controller/index.html.haml' do
|
13
|
+
@before_index_literal = :no_controller
|
14
|
+
end
|
15
|
+
|
16
|
+
before /index\.html/ do
|
17
|
+
@before_index_regexp = :root
|
18
|
+
end
|
19
|
+
|
20
|
+
before do
|
21
|
+
@before_all = :root
|
22
|
+
end
|
23
|
+
|
24
|
+
before 'fail' do
|
25
|
+
@fail = true
|
26
|
+
end
|
27
|
+
|
28
|
+
before /fail/ do
|
29
|
+
@fail = true
|
30
|
+
end
|
31
|
+
|
32
|
+
before 'before_render_text.html.haml' do
|
33
|
+
instead render(:text => 'root')
|
34
|
+
end
|
35
|
+
|
36
|
+
before 'before_render_partial.html.haml' do
|
37
|
+
instead render(:path => '_partial.html.haml')
|
38
|
+
end
|
39
|
+
|
40
|
+
before 'before_non_existent.html' do
|
41
|
+
instead render(:path => '_partial.html.haml')
|
42
|
+
end
|
43
|
+
|
44
|
+
# Helpers
|
45
|
+
|
46
|
+
helpers do
|
47
|
+
def helper
|
48
|
+
:root
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
# Ignore
|
53
|
+
|
54
|
+
ignore /\/_.*/
|
55
|
+
|
56
|
+
# Layout
|
57
|
+
|
58
|
+
layout 'layout_controller.html.haml' => 'layout.html.haml'
|
59
|
+
layout 'layout_controller_from_subdirectory.html.haml' => 'subdirectory/layout.html.haml'
|
60
|
+
|
61
|
+
before 'layout_action.html.haml' do
|
62
|
+
layout 'layout.html.haml'
|
63
|
+
end
|
64
|
+
|
65
|
+
before 'layout_action_from_subdirectory.html.haml' do
|
66
|
+
layout 'subdirectory/layout.html.haml'
|
67
|
+
end
|
68
|
+
|
69
|
+
layout 'does_not_exist.html.haml'
|
70
|
+
layout 'index.html.haml' => 'does_not_exist.html.haml'
|
71
|
+
|
72
|
+
# Priority
|
73
|
+
|
74
|
+
priority 'subdirectory/before_render_partial.html.haml' => 1
|
75
|
+
priority 'index.html.haml' => -1
|
76
|
+
priority 'does_not_exist.html.haml' => -1
|
77
|
+
|
78
|
+
before do
|
79
|
+
$render_order ||= []
|
80
|
+
if _stasis.path
|
81
|
+
$render_order << _stasis.path
|
82
|
+
end
|
83
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
@before_index_literal
|
2
|
+
= @before_index_literal
|
3
|
+
@before_index_regexp
|
4
|
+
= @before_index_regexp
|
5
|
+
@before_all
|
6
|
+
= @before_all
|
7
|
+
@fail
|
8
|
+
= !@fail.nil?
|
9
|
+
helpers
|
10
|
+
= helper
|
11
|
+
render from root
|
12
|
+
= render '_partial.html.haml'
|
13
|
+
render from subdirectory
|
14
|
+
= render 'subdirectory/_partial.html.haml'
|
15
|
+
time
|
16
|
+
= Time.now.to_f
|
@@ -0,0 +1 @@
|
|
1
|
+
pass
|
@@ -0,0 +1 @@
|
|
1
|
+
pass
|
@@ -0,0 +1 @@
|
|
1
|
+
pass
|
@@ -0,0 +1 @@
|
|
1
|
+
pass
|
@@ -0,0 +1,12 @@
|
|
1
|
+
@before_index_literal
|
2
|
+
= @before_index_literal
|
3
|
+
@before_index_regexp
|
4
|
+
= @before_index_regexp
|
5
|
+
@before_all
|
6
|
+
= @before_all
|
7
|
+
@fail
|
8
|
+
= !@fail.nil?
|
9
|
+
render from root
|
10
|
+
= render '/_partial.html.haml'
|
11
|
+
render from subdirectory
|
12
|
+
= render '/subdirectory/_partial.html.haml'
|
@@ -0,0 +1 @@
|
|
1
|
+
pass
|