brainopia-assets 0.9.4 → 0.9.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.
- data/README.md +13 -0
- data/VERSION +1 -1
- data/assets.gemspec +6 -2
- data/lib/assets/base.rb +1 -1
- data/lib/assets.rb +25 -7
- metadata +7 -5
data/README.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
It's really simple. You define a specification of your assets in *config/assets.yml* (you can set a different location via <code>Assets.config</code>):
|
2
|
+
<code>
|
3
|
+
---
|
4
|
+
js:
|
5
|
+
- http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js
|
6
|
+
- jquery.tools
|
7
|
+
- jquery.autocomplete
|
8
|
+
- jquery.address
|
9
|
+
- application
|
10
|
+
css:
|
11
|
+
- application
|
12
|
+
</code>
|
13
|
+
And then you can use <code>Assets.js.bundle</code> and <code>Assets.css.bundle</code> to include these files in your view. Also there is a method <code>compress</code> which can be used to compress assets, eg, <code>Assets.js.compress</code>.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.5
|
data/assets.gemspec
CHANGED
@@ -5,14 +5,18 @@
|
|
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.5"
|
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-14}
|
13
13
|
s.email = %q{ravwar@gmail.com}
|
14
|
+
s.extra_rdoc_files = [
|
15
|
+
"README.md"
|
16
|
+
]
|
14
17
|
s.files = [
|
15
18
|
".gitignore",
|
19
|
+
"README.md",
|
16
20
|
"Rakefile",
|
17
21
|
"VERSION",
|
18
22
|
"assets.gemspec",
|
data/lib/assets/base.rb
CHANGED
data/lib/assets.rb
CHANGED
@@ -4,16 +4,34 @@ require 'assets/javascript'
|
|
4
4
|
require 'assets/stylesheet'
|
5
5
|
|
6
6
|
module Assets
|
7
|
-
def self.
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
def self.production?
|
8
|
+
Object.const_defined?('RACK_ENV') && RACK_ENV == 'production'
|
9
|
+
end
|
10
|
+
|
11
|
+
if production?
|
12
|
+
def self.config
|
13
|
+
@config or raise_error
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.config=(file)
|
17
|
+
@config = YAML.load_file file
|
18
|
+
end
|
19
|
+
else
|
20
|
+
def self.config
|
21
|
+
@config_file ? YAML.load_file(@config_file) : raise_error
|
12
22
|
end
|
23
|
+
|
24
|
+
def self.config=(file)
|
25
|
+
@config_file = file
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
if File.exists? default_path = 'config/assets.yml'
|
30
|
+
self.config = default_path
|
13
31
|
end
|
14
32
|
|
15
|
-
def self.
|
16
|
-
|
33
|
+
def self.raise_error
|
34
|
+
raise 'You need to set a path for assets config or create one in default location (config/assets.yml)'
|
17
35
|
end
|
18
36
|
|
19
37
|
def self.js
|
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.5
|
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-14 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -19,10 +19,11 @@ executables: []
|
|
19
19
|
|
20
20
|
extensions: []
|
21
21
|
|
22
|
-
extra_rdoc_files:
|
23
|
-
|
22
|
+
extra_rdoc_files:
|
23
|
+
- README.md
|
24
24
|
files:
|
25
25
|
- .gitignore
|
26
|
+
- README.md
|
26
27
|
- Rakefile
|
27
28
|
- VERSION
|
28
29
|
- assets.gemspec
|
@@ -33,6 +34,7 @@ files:
|
|
33
34
|
- lib/assets/stylesheet.rb
|
34
35
|
has_rdoc: false
|
35
36
|
homepage: http://github.com/brainopia/assets
|
37
|
+
licenses:
|
36
38
|
post_install_message:
|
37
39
|
rdoc_options:
|
38
40
|
- --charset=UTF-8
|
@@ -53,7 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
55
|
requirements: []
|
54
56
|
|
55
57
|
rubyforge_project:
|
56
|
-
rubygems_version: 1.
|
58
|
+
rubygems_version: 1.3.5
|
57
59
|
signing_key:
|
58
60
|
specification_version: 3
|
59
61
|
summary: Library to manage css and js assets in any rack-based framework
|