faucet_pipeline_rails 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -5
- data/lib/faucet_pipeline_rails/manifest.rb +1 -1
- data/lib/faucet_pipeline_rails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa546fe3ef7bf6aac77523e1cc0303a5be5f42b8
|
4
|
+
data.tar.gz: aceb6e978667b31b021f0192bf268dbde9a04b60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7850f94b90e1de832d9a110df0da6c2ffcd442b85e9f36b7add465c5b89521606a126b2b52a2f03de5a13bceee7a5d6bb5ed916353ca924d14ee32f5c3509c2a
|
7
|
+
data.tar.gz: f78c317c2a1325e7fc802d03c1a2c8f71a99389488f76a12db2fee0d7ae5b6ef3a26a4e0b33ddb18458a8119b3954f81167e0f0a611a556c3a89818261c96984
|
data/README.md
CHANGED
@@ -4,6 +4,9 @@ Instead of using the built-in asset pipeline of Rails, use
|
|
4
4
|
[`faucet-pipeline`](https://github.com/faucet-pipeline/faucet-pipeline). This
|
5
5
|
gem enables the required integration with Rails.
|
6
6
|
|
7
|
+
[You can find an example app
|
8
|
+
here](https://github.com/faucet-pipeline/faucet_pipeline_rails_example).
|
9
|
+
|
7
10
|
Why is an integration like that required? `faucet-pipeline` modifies the names
|
8
11
|
of the generated files depending on their content (by adding a hash of the file
|
9
12
|
to the name), Rails will not be able to find the files on its own. You still
|
@@ -15,11 +18,12 @@ So let's say you have a JavaScript file called `application.js` (for example in
|
|
15
18
|
`app/assets/javascripts`) and `faucet-pipeline` generates a file called
|
16
19
|
`application-03118e77692b637cfc0f55bb27fef087.js` (for example in
|
17
20
|
`public/assets/javascripts`) from that file. When you use `stylesheet_link_tag
|
18
|
-
'application'`, you expect that the resulting HTML
|
19
|
-
containing the hash in its filename. To do that,
|
20
|
-
manifest files for each type of asset. In this
|
21
|
-
file called `javascript.json` in
|
22
|
-
the Configuration section). The
|
21
|
+
'public/assets/javascripts/application.js'`, you expect that the resulting HTML
|
22
|
+
points to the file containing the hash in its filename. To do that,
|
23
|
+
`faucet-pipeline` generates a manifest files for each type of asset. In this
|
24
|
+
case, it needs to generate a file called `javascript.json` in
|
25
|
+
`public/assets/manifests` (to change this, see the Configuration section). The
|
26
|
+
file should look like this:
|
23
27
|
|
24
28
|
```json
|
25
29
|
{
|
@@ -115,6 +119,13 @@ module.exports = {
|
|
115
119
|
};
|
116
120
|
```
|
117
121
|
|
122
|
+
In this case, your `application.html.erb` would contain lines like these:
|
123
|
+
|
124
|
+
```erb
|
125
|
+
<%= stylesheet_link_tag 'public/assets/stylesheets/application.css', media: 'all', 'data-turbolinks-track': 'reload' %>
|
126
|
+
<%= javascript_include_tag 'public/assets/javascripts/application.js', 'data-turbolinks-track': 'reload' %>
|
127
|
+
```
|
128
|
+
|
118
129
|
You can change the path to the manifest fiels that with the following
|
119
130
|
configuration:
|
120
131
|
|
@@ -8,7 +8,7 @@ module FaucetPipelineRails
|
|
8
8
|
def fetch(asset_name)
|
9
9
|
parsed_manifest.fetch(asset_name)
|
10
10
|
rescue KeyError
|
11
|
-
raise "The asset '#{asset_name}'
|
11
|
+
raise "The asset '#{asset_name}' was not in the manifest"
|
12
12
|
end
|
13
13
|
|
14
14
|
private
|