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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 582dcdab7ea03cf05ecf37d4ead94d5a2f3cc95ad1b89db6b9e93b98d7732e67
4
- data.tar.gz: 507d329e1fc346cf7ede9892afb1d81a85a1bb1bc14d5c8f8eb6632a57936ae0
3
+ metadata.gz: 432d92521ed230f18f0aa428cba72c1b37450b1ac9c8313bd12e9d908e204d45
4
+ data.tar.gz: 48d357cfd3f24cd5ea0f264ce8ccf8eb67d562e8b2cf040270b1f81ef8391cb6
5
5
  SHA512:
6
- metadata.gz: 4d480c89f27783d171aea9fe67862080b108a8e9b2c8320e99f687119a6b5b72b189a6dede703349152c843ad5bd6a0c03fa1bc4dac3377b454b5bb3b3c2e40c
7
- data.tar.gz: b6927c1850fe7bf1e4db6b29fbd13a9105eed8c4b03d0383a15f0bc09ef6fa1691b0a8483413a09c4147aaf08dd37b6af5262d37d88a15adba4556091806d415
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, :root
4
+ attr_reader :app, :file_server, :root_paths
5
5
 
6
6
  def initialize(app)
7
7
  @app = app
8
- @root = 'public'
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
- create_file("#{project_name}/views/application/application.css")
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
@@ -2,7 +2,7 @@
2
2
  <html>
3
3
  <head>
4
4
  <title>App Title</title>
5
- <link rel="stylesheet" href="application.css">
5
+ <link rel="stylesheet" href="assets/application.css">
6
6
  </head>
7
7
  <body>
8
8
  <%= yield %>
@@ -6,7 +6,7 @@
6
6
  ">
7
7
  <h1>Welcome To Railz Lite!</h1>
8
8
 
9
- <img src="../public/winter_fox_large.jpg" />
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>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailzLite
4
- VERSION = "0.2.3"
4
+ VERSION = "0.2.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railz_lite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - bryan lynch