sprockets-umodule 1.0.0 → 1.1.0
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 +4 -4
- data/README.mdown +24 -2
- data/lib/assets/javascripts/umodule.js.erb +1 -0
- data/lib/sprockets/umodule/version.rb +1 -1
- data/lib/umodule/rails.rb +8 -0
- data/lib/umodule-rails.rb +2 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fac1b724d5ddcf8fd7af63a13b517783d3a8ae5
|
4
|
+
data.tar.gz: c145b7522e79a28e83037761143dd6f01833f674
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 127119840a092b45c59cfb3d6a94809ca4646d3177c169a6bdb0f02da1410ad1725b218a8e5f045761ac3063deef3dbd48224096cb4c39017f7dd78fce43a873
|
7
|
+
data.tar.gz: 43bd520fe7cffc318f652a60df78f3a175568e482a72eb959a3430cad3a8eee4384781e386cccf6d71dbf14c6b93388e49f8813fe9087cbd7eee350dca6ee9fc
|
data/README.mdown
CHANGED
@@ -4,8 +4,30 @@
|
|
4
4
|
|
5
5
|
## Goal
|
6
6
|
|
7
|
-
|
7
|
+
`sprockets-umodule` saves you from the chore of writing CommonJS umodule
|
8
|
+
wrapping boilerplate. The module name will automatically be set from its
|
9
|
+
logical path (relative path to its asset root).
|
8
10
|
|
9
11
|
## Usage
|
10
12
|
|
11
|
-
Add sprockets-umodule to your Gemfile. Name your module files with
|
13
|
+
Add `gem 'sprockets-umodule'` to your Gemfile. Name your module files with
|
14
|
+
`.js.umodule` or `.js.umodule.coffee`, matching your poison of choice.
|
15
|
+
|
16
|
+
If you're using Sprockets, load umodule.js by any way you see fit. For convenience,
|
17
|
+
its source is included and can be obtained with `Umodule::Source.contents`, so
|
18
|
+
it's merely a `umodule.js.erb` away:
|
19
|
+
|
20
|
+
<%= Umodule::Source.contents %>
|
21
|
+
|
22
|
+
Alternatively, you can add `File.dirname(Umodule::Source.bundled_path)` to the
|
23
|
+
asset load path.
|
24
|
+
|
25
|
+
If you're using Rails, add `gem 'sprockets-umodule, require: umodule-rails`
|
26
|
+
instead, which will make it an engine and set up all of this for you, so you
|
27
|
+
just have to add `//= require
|
28
|
+
umodule` to `application.js`.
|
29
|
+
|
30
|
+
Important note: due to some technical complications, you must also
|
31
|
+
`//= require` your umodule assets in `application.js`, and possibly manage
|
32
|
+
dependency ordering manually. In any case, they should be loaded after
|
33
|
+
`umodule.js`.
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= Umodule::Source.contents %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sprockets-umodule
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Loic Nageleisen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: umodule-source
|
@@ -105,11 +105,14 @@ files:
|
|
105
105
|
- Gemfile
|
106
106
|
- LICENSE
|
107
107
|
- README.mdown
|
108
|
+
- lib/assets/javascripts/umodule.js.erb
|
108
109
|
- lib/sprockets-umodule.rb
|
109
110
|
- lib/sprockets/umodule.rb
|
110
111
|
- lib/sprockets/umodule/umodule.js.erb
|
111
112
|
- lib/sprockets/umodule/version.rb
|
112
113
|
- lib/sprockets/umodule/wrapper.rb
|
114
|
+
- lib/umodule-rails.rb
|
115
|
+
- lib/umodule/rails.rb
|
113
116
|
- spec/spec_helper.rb
|
114
117
|
- spec/sprockets-umodule_spec.rb
|
115
118
|
- sprockets-umodule.gemspec
|