railz_lite 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/railz_lite/controllers/static.rb +6 -4
- data/lib/railz_lite/generators/project.rb +4 -1
- data/lib/railz_lite/generators/templates/application.html.erb +1 -1
- data/lib/railz_lite/generators/templates/welcome_view.index.html.erb +1 -1
- data/lib/railz_lite/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 432d92521ed230f18f0aa428cba72c1b37450b1ac9c8313bd12e9d908e204d45
|
4
|
+
data.tar.gz: 48d357cfd3f24cd5ea0f264ce8ccf8eb67d562e8b2cf040270b1f81ef8391cb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2f65cd17bbe02aa69cb5a27414c4d8e00ead1cc21a77266947f3d7ffb36387fc2f0728957eea01f433a624d8d74eb9ae9d5c90a12b9545b71fb5e1821ab649d
|
7
|
+
data.tar.gz: 3a3e3ce5b8a38e77f5aaff03c978b7ca38fe16019f0653e495c844dc03c74e28205a276da3629a31f3c25aa92ca073a3387d00c038324b8e9a349c700eee6452
|
@@ -1,11 +1,11 @@
|
|
1
1
|
require 'rack'
|
2
2
|
|
3
3
|
class Static
|
4
|
-
attr_reader :app, :file_server, :
|
4
|
+
attr_reader :app, :file_server, :root_paths
|
5
5
|
|
6
6
|
def initialize(app)
|
7
7
|
@app = app
|
8
|
-
@
|
8
|
+
@root_paths = ['public', 'assets']
|
9
9
|
@file_server = FileServer.new
|
10
10
|
end
|
11
11
|
|
@@ -23,7 +23,7 @@ class Static
|
|
23
23
|
private
|
24
24
|
|
25
25
|
def can_match?(path)
|
26
|
-
path.index("/#{root}")
|
26
|
+
root_paths.any? { |root| path.index("/#{root}") }
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
@@ -32,7 +32,9 @@ class FileServer
|
|
32
32
|
MIME_TYPES = {
|
33
33
|
'.txt' => 'text/plain',
|
34
34
|
'.jpg' => 'image/jpeg',
|
35
|
-
'.zip' => 'application/zip'
|
35
|
+
'.zip' => 'application/zip',
|
36
|
+
'.css' => 'text/css',
|
37
|
+
'.js' => 'text/javascript'
|
36
38
|
}
|
37
39
|
|
38
40
|
def call(env)
|
@@ -29,7 +29,10 @@ module RailzLite
|
|
29
29
|
def setup_views
|
30
30
|
template('welcome_view.index.html.erb', "#{project_name}/views/welcome/index.html.erb")
|
31
31
|
template('application.html.erb', "#{project_name}/views/application/application.html.erb")
|
32
|
-
|
32
|
+
end
|
33
|
+
|
34
|
+
def add_assets
|
35
|
+
create_file("#{project_name}/assets/application.css")
|
33
36
|
end
|
34
37
|
|
35
38
|
def add_public
|
@@ -6,7 +6,7 @@
|
|
6
6
|
">
|
7
7
|
<h1>Welcome To Railz Lite!</h1>
|
8
8
|
|
9
|
-
<img src="
|
9
|
+
<img src="public/winter_fox_large.jpg" />
|
10
10
|
|
11
11
|
<h3>For guidelines on how to build an app with this framework see <a href="https://github.com/bryanqb07/railz_lite">here</a>.</h3>
|
12
12
|
</div>
|
data/lib/railz_lite/version.rb
CHANGED