sprockets-commoner 0.5.0 → 0.5.1

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: 0f24331ebf173f8083c0c49307c5b4ff3421a5f9
4
- data.tar.gz: 7462509ec68a31116ce04f7977a607557b66d3c7
3
+ metadata.gz: 8c966579c74d914919277d60a4d2dc6f3738e4dc
4
+ data.tar.gz: e9121bab180fabdc0ba4336149f58a91847bcde5
5
5
  SHA512:
6
- metadata.gz: 00df5b32888954876a2f0f8ad15bbda01728d84780af38787426863238074d1f367107dcb9c5272bb60ed3c1cd563c4c52883ec593a2bcaed9ff3bef215c264f
7
- data.tar.gz: 15ffc7f2426585ef5ad78f89cb3f4cc30ec48acd99bde3ab5639226883c66928fc2a749d8fb68650bdc61f42c7408e5459fcc39da1d46f09a26b6b1a88562788
6
+ metadata.gz: 94ed97e08219884f90f18bbf8829ce061c9cc51d47adbeb21e3b3cf91209dc55b6307348f5e631a3d17f63658f07b369cae7420f5cf81d80185a0f7ef6b9baba
7
+ data.tar.gz: 2bedd0b57bfcbaa99e8ddb6e52f876d344619ad6212e8e010dd434cb8665407621fed4ddc95829c4b4142a69f9e482b4f95ed855692196e4aca8c3921a20f7bb
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.5.1
4
+
5
+ * Make sure we error out if an identifier is requested from a CoffeeScript file and there is none present.
6
+
3
7
  ## v0.5.0
4
8
 
5
9
  * Added (currently undocumented) `transform_options` argument to `Processor`.
@@ -56,7 +56,7 @@ module.exports = function (context) {
56
56
  * If we're requiring a CoffeeScript file, we're going to be assuming that we're assigning to the global namespace in that file.
57
57
  * so, use a RegExp to find out that variable definition. (yep)
58
58
  */
59
- function findDeclarationInCoffeeFile(path) {
59
+ function findDeclarationInCoffeeFile(path, ensureIdentifierIsPresent) {
60
60
  var contents = fs.readFileSync(path);
61
61
  var identifiers = [];
62
62
 
@@ -65,6 +65,9 @@ module.exports = function (context) {
65
65
  }
66
66
 
67
67
  if (identifiers.length === 0) {
68
+ if (ensureIdentifierIsPresent) {
69
+ throw new Error('No identifier found in ' + path);
70
+ }
68
71
  return false;
69
72
  } else if (identifiers.length > 1) {
70
73
  throw new Error('Multiple identifiers found in ' + path);
@@ -136,7 +139,7 @@ module.exports = function (context) {
136
139
 
137
140
  if (/\.coffee$/.test(resolvedPath)) {
138
141
  // If it's a coffee script file, look for global variable assignments.
139
- return findDeclarationInCoffeeFile(resolvedPath);
142
+ return findDeclarationInCoffeeFile(resolvedPath, ensureTargetIsProcessed);
140
143
  } else {
141
144
  if (ensureTargetIsProcessed) {
142
145
  file.metadata.targetsToProcess.push(resolvedPath);
@@ -1,5 +1,5 @@
1
1
  module Sprockets
2
2
  module Commoner
3
- VERSION = '0.5.0'
3
+ VERSION = '0.5.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprockets-commoner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bouke van der Bijl
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-07-05 00:00:00.000000000 Z
11
+ date: 2016-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sprockets
@@ -181,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
181
  version: '0'
182
182
  requirements: []
183
183
  rubyforge_project:
184
- rubygems_version: 2.4.5.1
184
+ rubygems_version: 2.5.1
185
185
  signing_key:
186
186
  specification_version: 4
187
187
  summary: Use Babel in Sprockets to compile modules for the browser