cohitre-perro 0.9.1 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/assets/index.haml +1 -1
- data/lib/perro.rb +18 -9
- metadata +2 -2
data/assets/index.haml
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
%script{:src=>"/javascripts/jquery.js" , :type=>"text/javascript"}
|
|
6
6
|
%script{:src=>"/javascripts/qunit.js" , :type=>"text/javascript"}
|
|
7
7
|
%style
|
|
8
|
+
@import url("/stylesheets/reset.css");
|
|
8
9
|
@import url("/stylesheets/qunit.css");
|
|
9
|
-
@import url("/stylesheets/reset.css");
|
|
10
10
|
%body
|
|
11
11
|
%h1 My Project
|
|
12
12
|
%h2#banner
|
data/lib/perro.rb
CHANGED
|
@@ -4,7 +4,7 @@ require "haml"
|
|
|
4
4
|
require "sass"
|
|
5
5
|
|
|
6
6
|
module Perro
|
|
7
|
-
VERSION = '0.9.
|
|
7
|
+
VERSION = '0.9.2'
|
|
8
8
|
|
|
9
9
|
def use_rails_helpers
|
|
10
10
|
begin
|
|
@@ -74,13 +74,8 @@ module Perro
|
|
|
74
74
|
@port = port
|
|
75
75
|
end
|
|
76
76
|
|
|
77
|
-
def static( route , path , mime=:html)
|
|
78
|
-
|
|
79
|
-
:html => "text/html" ,
|
|
80
|
-
:javascript => "text/javascript" ,
|
|
81
|
-
:css => "text/css"
|
|
82
|
-
}
|
|
83
|
-
self.get( route , mimetypes[mime] ) do |params|
|
|
77
|
+
def static( route , path , mime=:html)
|
|
78
|
+
self.get( route , mime ) do |params|
|
|
84
79
|
if params[:file].nil?
|
|
85
80
|
open( "#{path}" ).read
|
|
86
81
|
else
|
|
@@ -111,7 +106,21 @@ module Perro
|
|
|
111
106
|
|
|
112
107
|
|
|
113
108
|
def get route , mime="text/html" , &block
|
|
114
|
-
|
|
109
|
+
mimetypes = {
|
|
110
|
+
:html => "text/html" ,
|
|
111
|
+
:js => "text/javascript",
|
|
112
|
+
:css => "text/css" ,
|
|
113
|
+
:png => "image/png" ,
|
|
114
|
+
:gif => "image/gif" ,
|
|
115
|
+
:jpg => "image/jpeg"
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if ( mime.is_a? Symbol)
|
|
119
|
+
type = mimetypes[mime]
|
|
120
|
+
else
|
|
121
|
+
type = mime
|
|
122
|
+
end
|
|
123
|
+
@global_handler.push( { :route => route , :mime=>type } , block )
|
|
115
124
|
end
|
|
116
125
|
|
|
117
126
|
def run
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cohitre-perro
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.9.
|
|
4
|
+
version: 0.9.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- carlos
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2008-12-
|
|
12
|
+
date: 2008-12-09 00:00:00 -08:00
|
|
13
13
|
default_executable: perro
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|