stylio 0.0.4 → 0.0.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6398dc25bcf6c8c34e0d4625ab36820d7a9ae69a
4
- data.tar.gz: f37c657e96b0367e41dff4a0c6e7beb3c1e32616
3
+ metadata.gz: ed1ff6f4f1c7ba4bf9aa5bd5871dabebd8196461
4
+ data.tar.gz: 7da714d95f370bda5e37c1d7af414bb8130364e9
5
5
  SHA512:
6
- metadata.gz: c49351b4ba3797833f8567718f1b42792218f0d2499ea717bb94c474b5b2376c92204de108df23e02ed8a7ba42281250bf2868490f2b7c1cd9a2e4c243bcc8b4
7
- data.tar.gz: 28a1926a8148a61e29e1295cc90d6b99341f850b5d3993695f9b8aca76f5e24217d1fcfd663b97e42f06210714141cebfa6510cb1e92bcb05f5eefa1a9dc7ec1
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
@@ -10,6 +10,8 @@ args = ARGV.dup
10
10
  ARGV.clear
11
11
  command = args.shift.strip rescue 'help'
12
12
 
13
+ Bundler.require :default
14
+
13
15
  Stylio::App.new
14
16
  Stylio::App.set :app_path, Dir.pwd
15
17
  Stylio::App.run!
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
@@ -1,3 +1,3 @@
1
1
  module Stylio
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stylio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Substrakt