sprockets-umodule 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4a34c71c2402af977c4d275588332de7dbe530dd
4
- data.tar.gz: a3f7a0701325d4b5d8d4342de84bd4560647e674
3
+ metadata.gz: 3fac1b724d5ddcf8fd7af63a13b517783d3a8ae5
4
+ data.tar.gz: c145b7522e79a28e83037761143dd6f01833f674
5
5
  SHA512:
6
- metadata.gz: da56b89e33c79812e5c255318d7fe2347ad2f0802ded82c9e4c620fb213e6f084fe40f71e7ce7008ea5afe8caf0835cc467a05439a8d750a0ac10f68aebbbb33
7
- data.tar.gz: f881d1af7ac14dd7160bbde4060098b13e24142a00d3303e4897113fc06adb43b3ac6fff966f966067d9c6cb454320ea98b1d680afa720a90ad39e2643f1aadc
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
- Save you from the boilerplate of writing module wrapping.
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 .umodule.
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 %>
@@ -1,5 +1,5 @@
1
1
  module Sprockets
2
2
  module Umodule
3
- VERSION = '1.0.0'
3
+ VERSION = '1.1.0'
4
4
  end
5
5
  end
@@ -0,0 +1,8 @@
1
+ require 'rails/engine'
2
+
3
+ module Umodule
4
+ module Rails
5
+ class Engine < ::Rails::Engine
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,2 @@
1
+ require 'sprockets-umodule'
2
+ require 'umodule/rails'
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.0.0
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-09-30 00:00:00.000000000 Z
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