brainopia-assets 0.9.5 → 0.9.9
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +15 -2
- data/VERSION +1 -1
- data/assets.gemspec +2 -2
- data/lib/assets/base.rb +1 -1
- data/lib/assets/javascript.rb +2 -2
- data/lib/assets/stylesheet.rb +2 -2
- data/lib/assets.rb +4 -3
- metadata +2 -2
data/README.md
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
-
|
1
|
+
This gem was born out of frustration when I was dealing with assets in non-rails environment. I wanted an experience similar to asset_packager: you just specify all your assets and then in development you have them as they are, but in production all compressed in one file.
|
2
|
+
|
3
|
+
As a result I produced a small library in just around 100 lines to manage assets in any rack-based framework. For compression this gem uses yuicompressor (so you'll need java installed, as opposed to jsmin.rb but it doesn't require you to put semicolons after each statement).
|
4
|
+
|
5
|
+
Workflow is simple. You define a specification of your assets in *config/assets.yml*:
|
2
6
|
<code>
|
3
7
|
---
|
4
8
|
js:
|
@@ -10,4 +14,13 @@ It's really simple. You define a specification of your assets in *config/assets.
|
|
10
14
|
css:
|
11
15
|
- application
|
12
16
|
</code>
|
13
|
-
|
17
|
+
|
18
|
+
You can specify web and local assets. Local assets will be looked up in public/javascripts and public/stylesheets folders.
|
19
|
+
|
20
|
+
And then you use <code>Assets.js.bundle</code> and <code>Assets.css.bundle</code> to include assets in your view.
|
21
|
+
|
22
|
+
This gem doesn't produce compressed files on demand in production, cause such request would get slow. So instead you need to compress files when you deploy your application, just use <code>Assets.js.compress</code> and <code>Assets.css.compress</code> for this purpose.
|
23
|
+
|
24
|
+
You can easily change location of config file, javascripts and stylesheets folders, just look into code and you'll see how.
|
25
|
+
|
26
|
+
If you need help don't hesitate to ask me ;-)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.9
|
data/assets.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{assets}
|
8
|
-
s.version = "0.9.
|
8
|
+
s.version = "0.9.9"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Ravil Bayramgalin"]
|
12
|
-
s.date = %q{2009-09-
|
12
|
+
s.date = %q{2009-09-15}
|
13
13
|
s.email = %q{ravwar@gmail.com}
|
14
14
|
s.extra_rdoc_files = [
|
15
15
|
"README.md"
|
data/lib/assets/base.rb
CHANGED
data/lib/assets/javascript.rb
CHANGED
data/lib/assets/stylesheet.rb
CHANGED
data/lib/assets.rb
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
require 'yaml'
|
2
|
-
require 'assets/base'
|
3
|
-
require 'assets/javascript'
|
4
|
-
require 'assets/stylesheet'
|
5
2
|
|
6
3
|
module Assets
|
7
4
|
def self.production?
|
8
5
|
Object.const_defined?('RACK_ENV') && RACK_ENV == 'production'
|
9
6
|
end
|
10
7
|
|
8
|
+
require 'assets/base'
|
9
|
+
require 'assets/javascript'
|
10
|
+
require 'assets/stylesheet'
|
11
|
+
|
11
12
|
if production?
|
12
13
|
def self.config
|
13
14
|
@config or raise_error
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brainopia-assets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ravil Bayramgalin
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-09-
|
12
|
+
date: 2009-09-15 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|