hyper 0.4.3 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,6 +6,8 @@ module Hyper
6
6
  class Application
7
7
  include Hyper::Helper
8
8
 
9
+ NOT_FOUND_TEMPLATE = Hyper::Utils.view_path('404')
10
+
9
11
  attr :request
10
12
 
11
13
  def call(env)
@@ -17,7 +19,7 @@ module Hyper
17
19
  if File.file?(view)
18
20
  respond_with(200, rendered_templates(layout, view))
19
21
  else
20
- respond_with(404, "404 Not Found: #{url}")
22
+ respond_with(404, not_found(layout, url))
21
23
  end
22
24
  end
23
25
 
@@ -30,6 +32,14 @@ module Hyper
30
32
  {'Content-Type' => 'text/html', 'Content-Length' => body.length.to_s}
31
33
  end
32
34
 
35
+ def not_found(layout, url)
36
+ if File.file?(NOT_FOUND_TEMPLATE)
37
+ rendered_templates(layout, NOT_FOUND_TEMPLATE)
38
+ else
39
+ "404 Not Found: #{url}"
40
+ end
41
+ end
42
+
33
43
  def rendered_templates(layout, view)
34
44
  render_erb(layout) { render_erb(view) }
35
45
  end
@@ -1,11 +1,11 @@
1
1
  module Hyper
2
2
  module Version
3
3
  MAJOR = 0
4
- MINOR = 4
5
- TINY = 3
4
+ MINOR = 6
5
+ TINY = 0
6
6
 
7
7
  def self.to_s
8
8
  [MAJOR, MINOR, TINY].join('.')
9
9
  end
10
10
  end
11
- end
11
+ end
@@ -1 +1,2 @@
1
+ source 'https://rubygems.org'
1
2
  gem 'hyper'
@@ -0,0 +1 @@
1
+ @import url(reset.css);
@@ -0,0 +1,48 @@
1
+ /* http://meyerweb.com/eric/tools/css/reset/
2
+ v2.0 | 20110126
3
+ License: none (public domain)
4
+ */
5
+
6
+ html, body, div, span, applet, object, iframe,
7
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
8
+ a, abbr, acronym, address, big, cite, code,
9
+ del, dfn, em, img, ins, kbd, q, s, samp,
10
+ small, strike, strong, sub, sup, tt, var,
11
+ b, u, i, center,
12
+ dl, dt, dd, ol, ul, li,
13
+ fieldset, form, label, legend,
14
+ table, caption, tbody, tfoot, thead, tr, th, td,
15
+ article, aside, canvas, details, embed,
16
+ figure, figcaption, footer, header, hgroup,
17
+ menu, nav, output, ruby, section, summary,
18
+ time, mark, audio, video {
19
+ margin: 0;
20
+ padding: 0;
21
+ border: 0;
22
+ font-size: 100%;
23
+ font: inherit;
24
+ vertical-align: baseline;
25
+ }
26
+ /* HTML5 display-role reset for older browsers */
27
+ article, aside, details, figcaption, figure,
28
+ footer, header, hgroup, menu, nav, section {
29
+ display: block;
30
+ }
31
+ body {
32
+ line-height: 1;
33
+ }
34
+ ol, ul {
35
+ list-style: none;
36
+ }
37
+ blockquote, q {
38
+ quotes: none;
39
+ }
40
+ blockquote:before, blockquote:after,
41
+ q:before, q:after {
42
+ content: '';
43
+ content: none;
44
+ }
45
+ table {
46
+ border-collapse: collapse;
47
+ border-spacing: 0;
48
+ }
metadata CHANGED
@@ -1,91 +1,88 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: hyper
3
- version: !ruby/object:Gem::Version
4
- hash: 9
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.6.0
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 4
9
- - 3
10
- version: 0.4.3
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - James Wilding
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-11-11 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2013-05-12 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: rack
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 27
29
- segments:
30
- - 1
31
- - 2
32
- - 2
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
33
21
  version: 1.2.2
34
22
  type: :runtime
35
- version_requirements: *id001
36
- - !ruby/object:Gem::Dependency
37
- name: tilt
38
23
  prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
40
25
  none: false
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- hash: 21
45
- segments:
46
- - 1
47
- - 0
48
- - 1
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 1.2.2
30
+ - !ruby/object:Gem::Dependency
31
+ name: tilt
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
49
37
  version: 1.0.1
50
38
  type: :runtime
51
- version_requirements: *id002
52
- - !ruby/object:Gem::Dependency
53
- name: term-ansicolor
54
39
  prerelease: false
55
- requirement: &id003 !ruby/object:Gem::Requirement
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: 1.0.1
46
+ - !ruby/object:Gem::Dependency
47
+ name: term-ansicolor
48
+ requirement: !ruby/object:Gem::Requirement
56
49
  none: false
57
- requirements:
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- hash: 3
61
- segments:
62
- - 0
63
- version: "0"
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
64
54
  type: :runtime
65
- version_requirements: *id003
66
- - !ruby/object:Gem::Dependency
67
- name: rspec
68
55
  prerelease: false
69
- requirement: &id004 !ruby/object:Gem::Requirement
56
+ version_requirements: !ruby/object:Gem::Requirement
70
57
  none: false
71
- requirements:
72
- - - ">="
73
- - !ruby/object:Gem::Version
74
- hash: 3
75
- segments:
76
- - 0
77
- version: "0"
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: rspec
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
78
70
  type: :development
79
- version_requirements: *id004
80
- description: Hyper is a dead simple, zero-config, drop-in framework for static websites on ruby + rack
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ description: Hyper is a dead simple, zero-config, drop-in framework for static websites
79
+ on ruby + rack
81
80
  email: office@jameswilding.net
82
- executables:
81
+ executables:
83
82
  - hyper
84
83
  extensions: []
85
-
86
84
  extra_rdoc_files: []
87
-
88
- files:
85
+ files:
89
86
  - lib/hyper/application.rb
90
87
  - lib/hyper/generator.rb
91
88
  - lib/hyper/static.rb
@@ -96,42 +93,33 @@ files:
96
93
  - template/Gemfile
97
94
  - template/lib/helper.rb
98
95
  - template/public/stylesheets/default.css
96
+ - template/public/stylesheets/reset.css
99
97
  - template/templates/layout.html.erb
100
98
  - template/templates/views/index.html.erb
101
99
  - README.md
102
100
  - bin/hyper
103
101
  homepage: http://github.com/jameswilding/hyper
104
102
  licenses: []
105
-
106
103
  post_install_message:
107
104
  rdoc_options: []
108
-
109
- require_paths:
105
+ require_paths:
110
106
  - lib
111
- required_ruby_version: !ruby/object:Gem::Requirement
107
+ required_ruby_version: !ruby/object:Gem::Requirement
112
108
  none: false
113
- requirements:
114
- - - ">="
115
- - !ruby/object:Gem::Version
116
- hash: 3
117
- segments:
118
- - 0
119
- version: "0"
120
- required_rubygems_version: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ! '>='
111
+ - !ruby/object:Gem::Version
112
+ version: '0'
113
+ required_rubygems_version: !ruby/object:Gem::Requirement
121
114
  none: false
122
- requirements:
123
- - - ">="
124
- - !ruby/object:Gem::Version
125
- hash: 3
126
- segments:
127
- - 0
128
- version: "0"
115
+ requirements:
116
+ - - ! '>='
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
129
119
  requirements: []
130
-
131
120
  rubyforge_project:
132
- rubygems_version: 1.8.11
121
+ rubygems_version: 1.8.25
133
122
  signing_key:
134
123
  specification_version: 3
135
124
  summary: Zero-config framework for static websites
136
125
  test_files: []
137
-