sprockets-glob 0.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 +7 -0
- data/.gitignore +10 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/README.md +24 -0
- data/Rakefile +10 -0
- data/lib/sprockets/glob.rb +3 -0
- data/lib/sprockets/glob/directive_processor.rb +22 -0
- data/lib/sprockets/glob/version.rb +5 -0
- data/sprockets-glob.gemspec +24 -0
- metadata +81 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1e6ebe5ea5b445393d37b306e03d64557d41e358
|
4
|
+
data.tar.gz: a27442941003bbb78f9c3d524c657599638a1c2b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 89da059440c6b11fe05d6ead895bba478fca94fe23710a5952c48cf00dea739c62d315607b47fbd4cfd8832baf8bc69f95fc24f342f9b8d4aaefae609ac2f230
|
7
|
+
data.tar.gz: c14eb26216c2f34fe633e17d8f75213969b828f49c66d342ce6ae5ea7cc3dd16592231941d73cc6b51ea5e2b58815404707f421baa10e14a1829e54da4d20ea8
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# Sprockets::Glob
|
2
|
+
|
3
|
+
adds `require_glob` and `stub_glob` directives to Sprockets
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
```rb
|
8
|
+
gem 'sprockets-glob'
|
9
|
+
```
|
10
|
+
|
11
|
+
## Usage
|
12
|
+
|
13
|
+
First you need to register the `Sprockets::Glob::DirectiveProcessor` with the correct MIME types.
|
14
|
+
Then you can use it in your normal Sprockets pipeline. Here's an example using javascript:
|
15
|
+
|
16
|
+
```rb
|
17
|
+
# config/initializers/sprockets.rb
|
18
|
+
require 'sprockets-glob'
|
19
|
+
Rails.application.assets.register_processor('application/javascript', Sprockets::Glob::DirectiveProcessor)
|
20
|
+
|
21
|
+
# application.js
|
22
|
+
//= require_glob app/features/**/*.js
|
23
|
+
//= stub_glob app/features/**/*test.js
|
24
|
+
```
|
data/Rakefile
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# Add "require_glob" and "stub_glob" directives to Sprockets
|
2
|
+
# See comments in Sprockets::DirectiveProcessor if you don't know what's going on here
|
3
|
+
module Sprockets
|
4
|
+
module Glob
|
5
|
+
class DirectiveProcessor < Sprockets::DirectiveProcessor
|
6
|
+
def process_require_glob_directive(glob)
|
7
|
+
each_file(glob) {|fn| process_require_directive(fn)}
|
8
|
+
end
|
9
|
+
|
10
|
+
def process_stub_glob_directive(glob)
|
11
|
+
each_file(glob) {|fn| process_stub_directive(fn)}
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def each_file(glob)
|
17
|
+
Dir["#{pathname.dirname}/#{glob}"].sort.each(&Proc.new)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'sprockets/glob/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "sprockets-glob"
|
8
|
+
spec.version = Sprockets::Glob::VERSION
|
9
|
+
spec.authors = ["Josh Bodah"]
|
10
|
+
spec.email = ["jb3689@yahoo.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{adds `require_glob` and `stub_glob` directives to Sprockets}
|
13
|
+
spec.description = %q{really adds `require_glob` and `stub_glob` directives to Sprockets}
|
14
|
+
spec.homepage = "https://github.com/backupify/sprockets-glob"
|
15
|
+
|
16
|
+
spec.license = 'MIT'
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.bindir = "exe"
|
19
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
spec.add_development_dependency "bundler", "~> 1.10"
|
23
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
24
|
+
end
|
metadata
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sprockets-glob
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Josh Bodah
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-11-19 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.10'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.10'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
description: really adds `require_glob` and `stub_glob` directives to Sprockets
|
42
|
+
email:
|
43
|
+
- jb3689@yahoo.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- ".gitignore"
|
49
|
+
- ".travis.yml"
|
50
|
+
- Gemfile
|
51
|
+
- README.md
|
52
|
+
- Rakefile
|
53
|
+
- lib/sprockets/glob.rb
|
54
|
+
- lib/sprockets/glob/directive_processor.rb
|
55
|
+
- lib/sprockets/glob/version.rb
|
56
|
+
- sprockets-glob.gemspec
|
57
|
+
homepage: https://github.com/backupify/sprockets-glob
|
58
|
+
licenses:
|
59
|
+
- MIT
|
60
|
+
metadata: {}
|
61
|
+
post_install_message:
|
62
|
+
rdoc_options: []
|
63
|
+
require_paths:
|
64
|
+
- lib
|
65
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
requirements: []
|
76
|
+
rubyforge_project:
|
77
|
+
rubygems_version: 2.4.8
|
78
|
+
signing_key:
|
79
|
+
specification_version: 4
|
80
|
+
summary: adds `require_glob` and `stub_glob` directives to Sprockets
|
81
|
+
test_files: []
|