-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFAQ
90 lines (53 loc) · 2.73 KB
/
FAQ
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Repertoire Assets FAQ
=====================
Q. If I use repertoire-assets for all of my javascript and css, none of my
html templates have <script...> or <link...>!
A. Yes, exactly.
Q. My application is not loading javascript or css files. There is nothing
about them in the log.
A. You have not installed the Rack middleware in your application's rackup
file. The middleware is automatically loaded for Rails 3.0 when you add
repertoire-assets to your Gemfile - but not for other frameworks. Consult
the README.
Q. I'm getting a Could not process '//= require <foo/bar>' error. But foo is
listed as a known library!
A. Are you also getting a "Multiple libraries for <foo>" warning? If so, the
one it's using doesn't provide the <foo/bar> sublibrary. You can fix this by
eliminating the spurious version of <foo>.
Q. My HTML looks like the following, but the middleware is not expanding
javascript require statements.
<script language='javascript'>
//- require <jquery>
//- require <widgets>
</script>
A. require and require instructions are only preprocessed in free-standing
javascript files. Instead, use:
public/javascripts/application.js:
...
//- require <jquery>
//- require <widgets>
Q. I have compress set to true, but in my deployed application
digest.js or digest.css aren't YUI compressed.
A. You are probably using an uncompressable Javascript syntax. Try compressing
by hand on the command-line and YUI compressor will give you an error
statement. This should also appear in the application's log.
[ If using Rails 3, use rake 'assets:build' to compress the files by hand. ]
Q. Why do gem assets appear mixed into the same url space? Wouldn't it be
better to namespace them by the gem's name?
A. So that gems can specify in which directory in the host application they
appear. e.g., 'foo_gem-0.0.1/public/images/foo/bar.png' is served as though it
were '<host app>/public/images/foo/bar.png'.
This way, existing image_tag and other helpers in Rails can be used
with assets pulled from gems.
Q. I want to bundle different sets of javascript and css for different pages,
or different browsers.
A. This was considered, but isn't implemented. Issue a feature request.
Q. Repertoire assets seems like sprockets or juicer. How is it different?
A. Only Repertoire assets addresses distributing javascript and css via
rubygems. Its syntax is borrowed from sprockets, but it has better css support
than sprockets, and better provisions for debugging than either since you can
develop on unbundled source files.
Q. Can I use repertoire-assets together with merb-assets?
A. Yes. It replaces merb-asset's bundling and javascript/stylesheet helpers,
but the remaining helpers can be used with assets from either the main app or
assets in gems.