vesper 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ![Vesper Logo](http://vesperapps.com/img/vesper.png)
2
2
 
3
- Version 1.1.0
3
+ Version 1.1.1
4
4
  ======
5
5
  > The Ruby web framework designed for clarity, flexibility and effectiveness.
6
6
 
@@ -26,13 +26,20 @@ module Vesper
26
26
 
27
27
  Dir["./plugins/**/post-boot.rb"].each {|file| require file}
28
28
 
29
- error(400) { redirect '/400.html' }
30
- error(401) { redirect '/401.html' }
31
- error(403) { redirect '/403.html' }
32
- error(404) { redirect '/404.html' }
33
- error(408) { redirect '/408.html' }
34
- error(500) { redirect '/500.html' }
35
- error(502) { redirect '/502.html' }
29
+ configure :development do
30
+ get('/?') { erb :'../public/index', layout: false }
31
+ end
32
+
33
+ configure :production do
34
+ error(400) { redirect '/errors/400.html' }
35
+ error(401) { redirect '/errors/401.html' }
36
+ error(403) { redirect '/errors/403.html' }
37
+ error(404) { redirect '/errors/404.html' }
38
+ error(408) { redirect '/errors/408.html' }
39
+ error(500) { redirect '/errors/500.html' }
40
+ error(502) { redirect '/errors/502.html' }
41
+ end
42
+
36
43
  end
37
44
 
38
45
  def self.load_tasks
@@ -2,7 +2,7 @@ source 'http://rubygems.org'
2
2
 
3
3
 
4
4
  gem 'sinatra', '~> 1.3.2'
5
- gem 'vesper', '~> 1.1.0', require: false
5
+ gem 'vesper', '~> 1.1.1', require: false
6
6
 
7
7
 
8
8
  Dir["./plugins/**/Gemfile"].each {|gemfile| self.send(:eval, File.open(gemfile, 'r').read)}
@@ -1,6 +1,8 @@
1
1
  # Sinatra route
2
2
  # For more info: http://www.sinatrarb.com/
3
3
  #
4
- get '/?' do
5
- erb :hello_world
4
+
5
+ # Renders /views/hello.html
6
+ get '/hello-world/?' do
7
+ erb :hello
6
8
  end
@@ -7,6 +7,8 @@ active(path)
7
7
  ------------
8
8
  > Adds a class of 'active' to an element that matches the page url.
9
9
 
10
+ > Accepts a string or an array.
11
+
10
12
  >> <a href="#" class="<%= active '/home' %>">Home</a>
11
13
  => <a href="#" class="active">Home</a>
12
14
 
@@ -1,7 +1,10 @@
1
1
  helpers do
2
2
 
3
3
  def active path
4
- 'active' if request.path_info.include? "/#{path}"
4
+ path = Array[path] unless path.kind_of? Array
5
+ match = false
6
+ path.each {|p| match = true if request.path_info.include? p }
7
+ 'active' if match
5
8
  end
6
9
 
7
10
  def alert
@@ -1,8 +1,8 @@
1
1
  body {
2
+ color: #333;
3
+ font-family: serif;
2
4
  font-size: 16px;
3
5
  line-height: 1.5em;
4
- font-family: serif;
5
- color: #333;
6
6
  -webkit-text-size-adjust:none;
7
7
  }
8
8
 
@@ -13,8 +13,8 @@ a { color: rgb(39, 177, 245); }
13
13
  a:hover { text-decoration: none; }
14
14
 
15
15
  h1, h2, h3, h4, h5, h6 {
16
- font-family: sans-serif;
17
16
  color: black;
17
+ font-family: sans-serif;
18
18
  }
19
19
 
20
20
  h1 { font-size: 48px; }
@@ -31,6 +31,6 @@ h4 small,
31
31
  h5 small,
32
32
  h6 small {
33
33
  color: silver;
34
- font-weight: normal;
35
34
  font-size: 67%;
35
+ font-weight: normal;
36
36
  }
@@ -0,0 +1,350 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+
6
+ <meta charset="utf-8">
7
+
8
+ <title>Vesper</title>
9
+
10
+ <!-- Mobile viewport settings -->
11
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
12
+
13
+ <style type="text/css" media="screen">
14
+ @import url(http://fonts.googleapis.com/css?family=Cabin+Condensed:400);
15
+ @import url(http://fonts.googleapis.com/css?family=Lato:300,700);
16
+
17
+ html {
18
+ background-color: #eaf4f9;
19
+ border-top: 3px solid #121212;
20
+ margin: 0;
21
+ padding: 0;
22
+ }
23
+
24
+ body {
25
+ color: #121212;
26
+ font-family: 'Lato', sans-serif;
27
+ font-size: 16px;
28
+ line-height: 1.5em;
29
+ margin: auto;
30
+ padding: 33px 0 0 0;
31
+ width: 616px;
32
+ -webkit-text-size-adjust: none;
33
+ }
34
+
35
+ a, a:visited {
36
+ color: #27b1f5;
37
+ display: inline-block;
38
+ margin: 0 -3px;
39
+ padding: 0 3px;
40
+ text-decoration: underline;
41
+ -webkit-border-radius: 3px;
42
+ -moz-border-radius: 3px;
43
+ border-radius: 3px;
44
+ }
45
+
46
+ a:hover {
47
+ text-decoration: none;
48
+ }
49
+
50
+ a img {
51
+ border: none;
52
+ }
53
+
54
+ h1, h2, h3, h4, h5, h6 {
55
+ font-family: 'Cabin Condensed', sans-serif;
56
+ font-weight: normal;
57
+ }
58
+
59
+ h2.meta {
60
+ color: black;
61
+ font-size: 16px;
62
+ text-align: center;
63
+ }
64
+
65
+ h2#version {
66
+ float: right;
67
+ }
68
+
69
+ div#logo {
70
+ display: block;
71
+ margin: auto;
72
+ position: relative;
73
+ width: 309px;
74
+ }
75
+
76
+ div#logo code {
77
+ left: 86px;
78
+ position: absolute;
79
+ text-shadow: 0 1px 0 silver;
80
+ top: 140px;
81
+ }
82
+
83
+ div#menu {
84
+ margin: 33px auto;
85
+ text-align: center;
86
+ width: 309px;
87
+ }
88
+
89
+ div#menu p a {
90
+ background-color: #121212;
91
+ box-shadow: 0 0 3px #777;
92
+ color: white;
93
+ display: block;
94
+ font-family: 'Cabin Condensed', sans-serif;
95
+ margin: 11px 33px;
96
+ padding: 7px 11px;
97
+ text-decoration: none;
98
+ }
99
+
100
+ div#menu p a:hover {
101
+ box-shadow: 0 0 7px #27B1F5;
102
+ color: #27B1F5\9; /* IE hack */
103
+ text-shadow: 0 0 7px #27B1F5;
104
+ }
105
+
106
+ div#readme {
107
+ background-color: white;
108
+ border: 1px solid silver\9; /* IE hack */
109
+ border-top: 3px solid #121212;
110
+ box-shadow: 0 0 3px #777;
111
+ padding: 11px 33px 33px 33px;
112
+ width: 550px;
113
+ }
114
+
115
+ div#readme a:hover {
116
+ background-color: #121212;
117
+ color: white;
118
+ text-decoration: none;
119
+ text-shadow: 0 0 3px white;
120
+ }
121
+
122
+ div#readme h1 a:hover,
123
+ div#readme h2 a:hover,
124
+ div#readme h3 a:hover,
125
+ div#readme h4 a:hover,
126
+ div#readme h5 a:hover,
127
+ div#readme h6 a:hover {
128
+ text-shadow: none;
129
+ }
130
+
131
+ div#readme h1,
132
+ div#readme h2,
133
+ div#readme h3,
134
+ div#readme h4,
135
+ div#readme h5,
136
+ div#readme h6 {
137
+ color: #111;
138
+ text-shadow: 0 0 7px silver;
139
+ }
140
+
141
+ div#readme h1 {
142
+ background-color: lightyellow;
143
+ border: 1px solid silver\9; /* IE hack */
144
+ box-shadow: 0 0 3px #777;
145
+ color: #777;
146
+ display: inline-block;
147
+ font-size: 16px;
148
+ margin-bottom: 0.67em;
149
+ margin-left: -44px;
150
+ margin-top: 2.01em;
151
+ padding: 3px 33px;
152
+ padding-left: 44px;
153
+ width: 18%\9;
154
+ }
155
+
156
+ div#readme h2 {
157
+ font-size: 36px;
158
+ line-height: 100%;
159
+ }
160
+
161
+ div#readme h3 {
162
+ font-size: 24px;
163
+ }
164
+
165
+ div#readme h4 {
166
+ font-size: 16px;
167
+ margin-top: 27px;
168
+ text-align: center;
169
+ }
170
+
171
+ div#readme hr {
172
+ border: none;
173
+ border-top: 1px solid #ededed;
174
+ border-top-color: #fefefe\9; /* IE hack */
175
+ margin: 33px 0;
176
+ margin: 11px 0\9;
177
+ }
178
+ div#readme blockquote {
179
+ border-left: 3px solid #ededed;
180
+ color: #777;
181
+ font-size: 90%;
182
+ margin-left: 11px;
183
+ padding-left: 11px;
184
+ }
185
+
186
+ div#readme blockquote.output {
187
+ font-family: monospace;
188
+ font-size: 11px;
189
+ }
190
+
191
+ div#readme code {
192
+ background-color: #121212;
193
+ color: white;
194
+ display: block;
195
+ font-size: 11px;
196
+ line-height: 1.5em;
197
+ margin: 1em 0;
198
+ padding: 7px 11px;
199
+ -webkit-border-radius: 3px;
200
+ -moz-border-radius: 3px;
201
+ border-radius: 3px;
202
+ }
203
+
204
+ div#readme h5 {
205
+ background-color: #333;
206
+ color: white;
207
+ font-family: "Lato", sans-serif;
208
+ font-size: 11px;
209
+ margin: -11px -11px 11px -11px;
210
+ padding: 3px 11px;
211
+ text-shadow: none;
212
+ -webkit-border-top-left-radius: 3px;
213
+ -webkit-border-top-right-radius: 3px;
214
+ -moz-border-radius-topleft: 3px;
215
+ -moz-border-radius-topright: 3px;
216
+ border-top-left-radius: 3px;
217
+ border-top-right-radius: 3px;
218
+ }
219
+
220
+ div#readme code span { color: #777 }
221
+
222
+ div#readme dl dt { font-weight: bold; }
223
+
224
+ div#readme dl dd {
225
+ color: #777;
226
+ font-size: 90%;
227
+ line-height: 1.3em;
228
+ margin-bottom: 11px;
229
+ margin-left: 11px;
230
+ margin-top: 3px;
231
+ }
232
+
233
+ div#readme p#credits {
234
+ color: silver;
235
+ font-size: 80%;
236
+ text-align: center;
237
+ }
238
+
239
+ div#readme p#credits a {
240
+ margin: 0 11px;
241
+ }
242
+ </style>
243
+
244
+ <!-- Hide address bar in Safari on iPhone -->
245
+ <script src="/js/hide_addressbar.js"></script>
246
+
247
+ <!-- Use jQuery -->
248
+ <script src="/js/jquery-1.7.1.min.js"></script>
249
+ <script src="/js/jquery-ui-1.8.17.min.js"></script>
250
+
251
+ </head>
252
+
253
+ <body>
254
+
255
+ <h2 class="meta" id="version">v1.1.1</h2>
256
+
257
+ <div id="logo">
258
+ <img src="img/vesper.png" />
259
+ <code>gem install vesper</code>
260
+ </div>
261
+
262
+ <div id="menu">
263
+ <p>
264
+ <a href="http://vesperapps.com">Documentation</a>
265
+ <a href="https://github.com/vesper/framework-gem">Source Code</a>
266
+ </p>
267
+ </div>
268
+
269
+ <h2 class="meta">Welcome to Vesper</h2>
270
+
271
+ <div id="readme">
272
+
273
+ <h4>Send any questions or comments to: <a href="mailto:jarrod@vesperapps.com">jarrod@vesperapps.com</a></h4>
274
+
275
+ <hr />
276
+
277
+ <dl>
278
+ <dt>.gitignore</dt>
279
+ <dd>Tell git which files to ignore. Learn more from <a href="http://book.git-scm.com/4_ignoring_files.html">The Git Community Book</a>.</dd>
280
+
281
+ <dt>application/</dt>
282
+ <dd>Here's where you'll write the Ruby code for your app, including classes, routes and helpers. You can structure it as MVC, a collection of libraries, a single file, or any other way you see fit. Support for subdirectories is included.</dd>
283
+
284
+ <dt>config/</dt>
285
+ <dd>Add any sitewide and/or environment settings here. Separate from plugins, which have their own configuration. Again, support for subdirectories is included.</dd>
286
+
287
+ <dt>config.ru</dt>
288
+ <dd>Required by Rack servers to get things started.</dd>
289
+
290
+ <dt>data/</dt>
291
+ <dd>Created by the DataMapper plugin, this is where your SQLite databases will be created, along with scripts for seeding and transmogrifying data.</dd>
292
+
293
+ <dt>Gemfile</dt>
294
+ <dd>Used by Bundler, here's where you can specify which gems your app should use. It also handles loading gems required by plugins.</dd>
295
+
296
+ <dt>Gemfile.lock</dt>
297
+ <dd>Created by Bundler from your Gemfile, this ensures exact versioning of the required gems. Be sure to check this into version control.</dd>
298
+
299
+ <dt>plugins/</dt>
300
+ <dd>Plugins are shared, reusable, configurable mini apps that can be installed and modified to help with the legwork in creating your app. They can include their own application code, configuration, assets, tasks, hooks, and gems.</dd>
301
+
302
+ <dt>public/</dt>
303
+ <dd>Stylesheets, images, JavaScripts, and error pages. This is the only directory accessible from a browser.</dd>
304
+
305
+ <dt>Rakefile</dt>
306
+ <dd>Loads your app and your rake tasks from tasks/ into the command line.</dd>
307
+
308
+ <dt>Readme.md</dt>
309
+ <dd>Use this to give other people instructions on how to run, modify or just read your code. It uses Markdown formatting by default to make sure it renders well on GitHub.</dd>
310
+
311
+ <dt>tasks/</dt>
312
+ <dd>
313
+ Drop your own Rake tasks in here and they'll be loaded, along with your app, from the command line.
314
+ <blockquote><strong>Example:</strong> Loads the HelloWorld app into an IRB session.</blockquote>
315
+ <code><span>~/HelloWorld:</span> rake irb</code>
316
+ </dd>
317
+
318
+ <dt>tests/</dt>
319
+ <dd>
320
+ Created by the MiniTest plugin, write your tests here and they'll be automatically loaded, along with your app, when you run the MiniTest command.
321
+ <code><span>~/HelloWorld:</span> rake minitest</code>
322
+ </dd>
323
+
324
+ <dt>tmp/</dt>
325
+ <dd>
326
+ Temporary holding for uploaded files and downloaded plugins. Also includes restart.txt, which Rack can use to restart your app.
327
+ <code><span>~/HelloWorld:</span> touch tmp/restart.txt</code>
328
+ </dd>
329
+
330
+ <dt>views/</dt>
331
+ <dd>
332
+ All your views should be created here. Ruby is embedded into .html and .erb files, layout.html is the default template, and subdirectories are supported.
333
+ <blockquote><strong>Pro Tip:</strong> Check out the Mobile Request Router plugin for easy mobile designs.</blockquote>
334
+ </dd>
335
+ </dl>
336
+
337
+ <hr />
338
+
339
+ <p id="credits">
340
+ Vesper was created by:
341
+ <br />
342
+ <a href="https://twitter.com/#!/jarrodtaylor">Jarrod Taylor</a>
343
+ <a href="https://twitter.com/#!/TheKarmakazie">Richard Rissanen</a>
344
+ </p>
345
+
346
+ </div>
347
+
348
+ </body>
349
+
350
+ </html>