classy_assets 0.0.1 → 0.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: df19c92e2b72ac24e8112df433293fc9cd45e400
4
- data.tar.gz: 58f776a528fcdf55c082922c55a60756c519e3e9
3
+ metadata.gz: ccdf4e3653be4abe6a48d37433a1ceb0257fc836
4
+ data.tar.gz: a15342332f9786b22fe93f1f74abdc94660bd58d
5
5
  SHA512:
6
- metadata.gz: e50ac6b61d5862e6694996233828c46f923b3b62e7d0f6ea3b7319da05dceb727d2ac75ae1b6732166c8fc3c5187aa8eb339cc126c8c3255123f064192d936be
7
- data.tar.gz: 73a4fbf3728b9a4707c98d4edaddf422a0edd858c39a4c8c84be6b0ae1f47bcca770f41fc79d540066e57549124aa0cd086e0a28e0f684613ff035183c38318d
6
+ metadata.gz: 227652b02943447bc6a8aab0c7a2d3172b82a70719d69b9ca750ea15a1e3cf107e13b7198a1773dd6e6abac88107c5a8339c6c85fbcd81f7b2f0c79fbddf96bf
7
+ data.tar.gz: 8a87a9f9a425851f882d57e16ceb2cca6656d8cbc018cf63568cbe7db11bb38a8be27769d982e192285e2f859ad7522c3927fc12bb05fe95b4337f72da5dffe3
data/README.md CHANGED
@@ -1,24 +1,68 @@
1
1
  # ClassyAssets
2
2
 
3
- TODO: Write a gem description
3
+ Classy Assets (powered by Sprockets) for Sinatra and Rack apps
4
4
 
5
5
  ## Installation
6
6
 
7
7
  Add this line to your application's Gemfile:
8
8
 
9
- gem 'classy_assets'
9
+ gem 'classy_assets', require: 'false'
10
10
 
11
11
  And then execute:
12
12
 
13
13
  $ bundle
14
14
 
15
- Or install it yourself as:
15
+ ## Usage
16
16
 
17
- $ gem install classy_assets
17
+ ClassyAssets is available as Rack Middleware or a Sintra Extension. The Sinatra Extension version integrates the [sprockets-helpers](https://github.com/petebrowne/sprockets-helpers) to provide helper methods for generating asset paths.
18
18
 
19
- ## Usage
19
+ Use the Rack Middleware directly:
20
+
21
+ ````ruby
22
+ require 'rack/classy_assets'
23
+ class ClassyApp < Sinatra::Base
24
+ use Rack::ClassyAssets, root: 'path/to/your/app/root/directory'
25
+ end
26
+ ````
27
+
28
+ Use the Sinatra Extension:
29
+
30
+ ````ruby
31
+ require 'sinatra/classy_assets'
32
+ class ClassyApp < Sinatra::Base
33
+ register Sinatra::ClassyAssets
34
+ end
35
+ ````
36
+
37
+ Both the middleware and extension assume your assets are stored in the `root` directory, in the following layout:
38
+
39
+ /assets
40
+ |_ images
41
+ |_ stylesheets
42
+ |_ javascripts
43
+
44
+ Sass and CoffeeScript are fully supported.
45
+
46
+ Available Options:
47
+
48
+ Pass these in via the options hash if you're using the rack middleware.
49
+ If you're using the sinatra extension, then configure your app's `settings` after the `register Sintra::ClassyAssets` statement to override the defaults
50
+
51
+ ````ruby
52
+ :root # => path to root of the application. set by default in Sinatra apps, but must be explictly passed to the rack middleware, if used directly
53
+ :public_folder # => path to public folder for the application. (default: File.join(root, 'public') )
54
+ :assets_prefix # => currently does nothing useful (default: 'assets')
55
+ :asset_host # => used by Sprockets::Helpers to return asset path prefixed by asset_host uri (default: nil)
56
+ :digest_assets # => enable digest version of assets? true or false (default: false)
57
+ :css_compressor # => instance of a sprokets compatible css compressor class (default: ::YUI::CssCompressor.new)
58
+ :js_compressor # => instance of a sprokets compatible js compressor class (default: ::Uglifier.new)
59
+ :sprockets # => instance of Sprockets::Environment. Should almost never need to be set manually. (default: Sprockets::Environment.new(root) )
60
+ ````
61
+ ## Project Status
20
62
 
21
- TODO: Write usage instructions here
63
+ - Build: [![Build Status](https://secure.travis-ci.org/styleseek/classy_assets.png?branch=master)](https://travis-ci.org/styleseek/classy_assets)
64
+ - Code Quality: [![Code Climate](https://codeclimate.com/github/styleseek/classy_assets.png)](https://codeclimate.com/github/styleseek/classy_assets)
65
+ - Dependencies: [![Dependency Status](https://gemnasium.com/styleseek/classy_assets.png)](https://gemnasium.com/styleseek/classy_assets)
22
66
 
23
67
  ## Contributing
24
68
 
@@ -1,3 +1,3 @@
1
1
  module ClassyAssets
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -6,9 +6,7 @@ require 'rack/classy_assets'
6
6
  class MiddlewareApp < Sinatra::Base
7
7
  set :root, File.expand_path('../../support', __FILE__)
8
8
  set :public_folder, File.join(settings.root, 'public')
9
- set :sprockets, Sprockets::Environment.new(settings.root)
10
- use Rack::ClassyAssets, root: settings.root,
11
- sprockets: settings.sprockets
9
+ use Rack::ClassyAssets, root: settings.root
12
10
  end
13
11
 
14
12
  describe Rack::ClassyAssets do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: classy_assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - StyleSeek Engineering