middleman-vendor_bower 0.0.1
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 +7 -0
- data/.editorconfig +16 -0
- data/.gitignore +18 -0
- data/Gemfile +19 -0
- data/LICENSE +22 -0
- data/README.md +62 -0
- data/lib/middleman-vendor_bower.rb +7 -0
- data/lib/middleman-vendor_bower/extension.rb +33 -0
- data/lib/middleman-vendor_bower/version.rb +5 -0
- data/lib/middleman_extension.rb +1 -0
- data/middleman-vendor_bower.gemspec +22 -0
- metadata +71 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: bbbcf1ecfeb180f4bc3194dc736e9f6e105b0cdb
|
4
|
+
data.tar.gz: 52a46105798518b88e48ec700f7a1eeb913714ee
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f5cc89c327f5edbc95fb089f42b81f26a4e455262228037ca34b5811814979b808a1d5f13261e970a6353053233af1eb5f7503263df3a4f5d54d903f8c9a81c8
|
7
|
+
data.tar.gz: a5d4a79205e7e2527829421e7ae89e326b5c1566d66f77cd9684ba65a9f977dc04895a1f65fc59237309114f5daf16d5205e462c2771d696f9f729fa2611c26b
|
data/.editorconfig
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# This file is for unifying the coding style for different editors and IDEs.
|
2
|
+
# More information at http://EditorConfig.org
|
3
|
+
|
4
|
+
# No .editorconfig files above the root directory
|
5
|
+
root = true
|
6
|
+
|
7
|
+
[*]
|
8
|
+
indent_style = space
|
9
|
+
indent_size = 2
|
10
|
+
end_of_line = lf
|
11
|
+
charset = utf-8
|
12
|
+
trim_trailing_whitespace = true
|
13
|
+
insert_final_newline = true
|
14
|
+
|
15
|
+
[*.md]
|
16
|
+
indent_size = 4
|
data/.gitignore
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# If you do not have OpenSSL installed, update
|
2
|
+
# the following line to use "http://" instead
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
|
5
|
+
# Specify your gem's dependencies in middleman-vendor_bower.gemspec
|
6
|
+
gemspec
|
7
|
+
|
8
|
+
group :development do
|
9
|
+
gem 'rake'
|
10
|
+
gem 'rdoc'
|
11
|
+
gem 'yard'
|
12
|
+
end
|
13
|
+
|
14
|
+
group :test do
|
15
|
+
gem 'cucumber'
|
16
|
+
gem 'fivemat'
|
17
|
+
gem 'aruba'
|
18
|
+
gem 'rspec'
|
19
|
+
end
|
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2015 Mariano Cavallo
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
# middleman-vendor_bower
|
2
|
+
|
3
|
+
Adds the bower directory to the sprockets path so that you can require bower components. Relies on the `.bowerrc` on the root of the project to locate the right directory.
|
4
|
+
|
5
|
+
See [Bower config] for more information.
|
6
|
+
|
7
|
+
## Dependencies
|
8
|
+
|
9
|
+
* middleman-core (3.3+)
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
Add to your `Gemfile` and then run `bundle install`:
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
gem 'middleman-vendor_bower'
|
16
|
+
```
|
17
|
+
|
18
|
+
Then activate the extension in your `config.rb` file:
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
activate :vendor_bower
|
22
|
+
```
|
23
|
+
|
24
|
+
Make sure to specify the **directory** option in your `.bowerrc` file:
|
25
|
+
|
26
|
+
```json
|
27
|
+
{
|
28
|
+
"directory": "vendor/assets/bower/"
|
29
|
+
}
|
30
|
+
```
|
31
|
+
|
32
|
+
## Usage
|
33
|
+
|
34
|
+
Reference your components by using a relative path from your bower directory.
|
35
|
+
|
36
|
+
### CSS
|
37
|
+
|
38
|
+
```css
|
39
|
+
/*
|
40
|
+
*= require normalize-css/normalize
|
41
|
+
*/
|
42
|
+
```
|
43
|
+
|
44
|
+
### SASS
|
45
|
+
|
46
|
+
```scss
|
47
|
+
@import 'normalize-css/normalize';
|
48
|
+
```
|
49
|
+
|
50
|
+
### Javascript
|
51
|
+
|
52
|
+
```js
|
53
|
+
//= require angular/angular
|
54
|
+
```
|
55
|
+
|
56
|
+
## License
|
57
|
+
|
58
|
+
Copyright (c) 2015 Mariano Cavallo. MIT Licensed, see [LICENSE] for details.
|
59
|
+
|
60
|
+
[middleman]: http://middlemanapp.com
|
61
|
+
[Bower config]: http://bower.io/docs/config/
|
62
|
+
[LICENSE]: https://github.com/mcavallo/middleman-vendor_bower/blob/master/LICENSE
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Middleman
|
2
|
+
class VendorBowerExtension < Extension
|
3
|
+
def initialize(app, options_hash={}, &block)
|
4
|
+
super
|
5
|
+
end
|
6
|
+
|
7
|
+
def after_configuration
|
8
|
+
sprockets.append_path File.join(app.root, bower_directory)
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def read_bower_config
|
14
|
+
JSON.parse(File.read(File.join(app.root, '.bowerrc')))
|
15
|
+
rescue JSON::ParserError => e
|
16
|
+
puts 'Bower stuff skipped. There\'s something wrong with your `.bowerrc` file.'
|
17
|
+
rescue Errno::ENOENT => e
|
18
|
+
puts 'Bower stuff skipped. Missing `.bowerrc` file.'
|
19
|
+
end
|
20
|
+
|
21
|
+
def bower_directory
|
22
|
+
@bower_config = read_bower_config
|
23
|
+
raise unless @bower_config['directory'] && Dir.exist?(@bower_config['directory'])
|
24
|
+
@bower_config['directory']
|
25
|
+
rescue => e
|
26
|
+
puts 'Bower stuff skipped. Could not determine a valid directory from your `.bowerrc` file.'
|
27
|
+
end
|
28
|
+
|
29
|
+
def sprockets
|
30
|
+
app.extensions[:sprockets].environment
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'middleman-vendor_bower'
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require 'middleman-vendor_bower/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = 'middleman-vendor_bower'
|
7
|
+
s.version = Middleman::VendorBower::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Mariano Cavallo"]
|
10
|
+
s.email = ["mariano.cavallo@gmail.com"]
|
11
|
+
s.homepage = "https://github.com/mcavallo/middleman-vendor_bower"
|
12
|
+
s.summary = %q{Adds the bower directory to the sprockets path so that you can require bower components.}
|
13
|
+
s.description = %q{Adds the bower directory to the sprockets path so that you can require bower components. Relies on the .bowerrc on the root of the project to locate the right directory.}
|
14
|
+
s.license = "MIT"
|
15
|
+
|
16
|
+
s.rubyforge_project = "middleman-vendor_bower"
|
17
|
+
s.files = `git ls-files -z`.split("\0")
|
18
|
+
s.require_paths = ["lib"]
|
19
|
+
s.required_ruby_version = '>= 1.9.3'
|
20
|
+
|
21
|
+
s.add_dependency("middleman-core", ["~> 3.3"])
|
22
|
+
end
|
metadata
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: middleman-vendor_bower
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Mariano Cavallo
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-10-22 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: middleman-core
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.3'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.3'
|
27
|
+
description: Adds the bower directory to the sprockets path so that you can require
|
28
|
+
bower components. Relies on the .bowerrc on the root of the project to locate the
|
29
|
+
right directory.
|
30
|
+
email:
|
31
|
+
- mariano.cavallo@gmail.com
|
32
|
+
executables: []
|
33
|
+
extensions: []
|
34
|
+
extra_rdoc_files: []
|
35
|
+
files:
|
36
|
+
- ".editorconfig"
|
37
|
+
- ".gitignore"
|
38
|
+
- Gemfile
|
39
|
+
- LICENSE
|
40
|
+
- README.md
|
41
|
+
- lib/middleman-vendor_bower.rb
|
42
|
+
- lib/middleman-vendor_bower/extension.rb
|
43
|
+
- lib/middleman-vendor_bower/version.rb
|
44
|
+
- lib/middleman_extension.rb
|
45
|
+
- middleman-vendor_bower.gemspec
|
46
|
+
homepage: https://github.com/mcavallo/middleman-vendor_bower
|
47
|
+
licenses:
|
48
|
+
- MIT
|
49
|
+
metadata: {}
|
50
|
+
post_install_message:
|
51
|
+
rdoc_options: []
|
52
|
+
require_paths:
|
53
|
+
- lib
|
54
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: 1.9.3
|
59
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0'
|
64
|
+
requirements: []
|
65
|
+
rubyforge_project: middleman-vendor_bower
|
66
|
+
rubygems_version: 2.4.5
|
67
|
+
signing_key:
|
68
|
+
specification_version: 4
|
69
|
+
summary: Adds the bower directory to the sprockets path so that you can require bower
|
70
|
+
components.
|
71
|
+
test_files: []
|