stylio 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/bin/stylio +2 -0
- data/lib/stylio/app.rb +10 -1
- data/lib/stylio/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed1ff6f4f1c7ba4bf9aa5bd5871dabebd8196461
|
4
|
+
data.tar.gz: 7da714d95f370bda5e37c1d7af414bb8130364e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00a50e2096e1857f75193c7ba8b55063dde8b80ed93cfdde35f05e421cf3f58a99b2ad122534b30b4d97a721891c510b10176cb9a9889b8f53195084ff5ddba6
|
7
|
+
data.tar.gz: 9068d6a2f5dd04238502e634f6e5a9e9dd55c787975e6b5ed0040412b4d6978f24e15ee60a822953ec4c5dd3fda68bc43d89b7fe7211376f9c90fef23842cb0b
|
data/README.md
CHANGED
@@ -53,6 +53,10 @@ No parameters can be referenced on this page except for `<%= yield %>`.
|
|
53
53
|
|
54
54
|
See (stylio-example)[http://github.com/substrakt/stylio-example] to see an example setup.
|
55
55
|
|
56
|
+
## Adding Javascripts
|
57
|
+
|
58
|
+
You can use sprockets as normal. You should create an `application.js` file in the `assets` folder. This can use `require` directives as per sprockets. You may use CoffeeScript or JavaScript.
|
59
|
+
|
56
60
|
## Adding examples
|
57
61
|
|
58
62
|
`mkdir examples/EXAMPLE_NAME` and then add a file in this folder:
|
data/bin/stylio
CHANGED
data/lib/stylio/app.rb
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
require 'sinatra'
|
2
2
|
require 'yaml'
|
3
|
+
require 'sprockets'
|
4
|
+
require 'uglifier'
|
3
5
|
|
4
6
|
module Stylio
|
5
7
|
class App < Sinatra::Base
|
6
8
|
enable :run
|
7
9
|
register Sinatra::Assets
|
8
|
-
Bundler.require :default
|
9
10
|
|
10
11
|
set :root, File.realpath(File.dirname(__FILE__))
|
11
12
|
set :app_path, ''
|
@@ -14,11 +15,19 @@ module Stylio
|
|
14
15
|
set :components, File.join(settings.app_path, 'components')
|
15
16
|
set :layouts, File.join(settings.app_path, 'layouts')
|
16
17
|
set :styles, File.join(settings.app_path, 'assets', 'stylesheets')
|
18
|
+
set :javascripts, Sprockets::Environment.new
|
19
|
+
settings.javascripts.append_path 'assets/javascripts'
|
20
|
+
settings.javascripts.js_compressor = :uglify
|
17
21
|
|
18
22
|
get '/' do
|
19
23
|
erb :elements, layout: :styleguide
|
20
24
|
end
|
21
25
|
|
26
|
+
get "/assets/application.js" do
|
27
|
+
content_type "application/javascript"
|
28
|
+
settings.javascripts["application.js"]
|
29
|
+
end
|
30
|
+
|
22
31
|
get '/elements' do
|
23
32
|
erb :elements, layout: :styleguide
|
24
33
|
end
|
data/lib/stylio/version.rb
CHANGED