bower-vendor 0.0.2 → 0.0.3

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.
data/README.md CHANGED
@@ -37,7 +37,7 @@ Currently supported file extensions are:
37
37
  * `javascripts`: `.js` `.coffee`
38
38
  * `stylesheets`: `.css` `.scss` `.sass` `.less`
39
39
  * `images`: `.gif` `.png` `.jpg` `.svg`
40
- * `media`: `.\*` (everything else)
40
+ * `media`: `.*` (everything else)
41
41
 
42
42
  The following generators are available:
43
43
 
@@ -1,3 +1,3 @@
1
1
  module BowerVendor
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -35,13 +35,28 @@ class BowerVendor::InstallGenerator < Rails::Generators::Base
35
35
  when String
36
36
  vendor_asset(package, paths)
37
37
  else
38
- raise ArgumentError, "Paths must be either Hash, Array or String, received: #{paths.class}"
38
+ raise Thor::Error, set_color("Paths must be either Hash, Array or String, received: #{paths.class}", :red, :bold)
39
39
  end
40
40
  end
41
41
  end
42
42
 
43
43
  private
44
44
  def vendor_asset(package, source, dest=nil)
45
+ if source == File.join(BowerVendor::BOWER_ROOT, package)
46
+ err = <<-eos
47
+ The '#{package}' package has a missing 'main' attribute, and cannot be handled automatically.
48
+ Please encourage the maintainer to fix the package, and in the mean time, try overriding the
49
+ sources in your 'bower.json'.
50
+ eos
51
+ raise Thor::Error, set_color(err, :red, :bold)
52
+ elsif File.directory? source
53
+ err = <<-eos
54
+ The '#{package}' package has a broken 'main' attribute that specifies a directory (#{source}).
55
+ Please encourage the maintainer to fix the package, and in the mean time, try overriding the
56
+ sources in your 'bower.json'.
57
+ eos
58
+ raise Thor::Error, set_color(err, :red, :bold)
59
+ end
45
60
  file_ext = File.extname(source)
46
61
  case file_ext
47
62
  when '.js', '.coffee'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bower-vendor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -85,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
85
  version: '0'
86
86
  segments:
87
87
  - 0
88
- hash: -1882033727586731293
88
+ hash: 1780034188194126920
89
89
  requirements: []
90
90
  rubyforge_project:
91
91
  rubygems_version: 1.8.25