sprock-assets 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/.rspec +2 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +36 -0
- data/Rakefile +4 -0
- data/lib/sprock_assets/version.rb +3 -0
- data/lib/sprock_assets.rb +23 -0
- data/readme.md +15 -0
- data/spec/rack_assets_spec.rb +5 -0
- data/spec/spec_helper.rb +7 -0
- data/sprock_assets.gemspec +22 -0
- metadata +110 -0
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rack-assets-*.gem
|
data/.rspec
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
sprock-assets (0.0.1)
|
5
|
+
sprockets
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: http://rubygems.org/
|
9
|
+
specs:
|
10
|
+
diff-lcs (1.1.3)
|
11
|
+
hike (1.2.1)
|
12
|
+
multi_json (1.3.6)
|
13
|
+
rack (1.4.1)
|
14
|
+
rake (0.9.2.2)
|
15
|
+
rspec (2.11.0)
|
16
|
+
rspec-core (~> 2.11.0)
|
17
|
+
rspec-expectations (~> 2.11.0)
|
18
|
+
rspec-mocks (~> 2.11.0)
|
19
|
+
rspec-core (2.11.1)
|
20
|
+
rspec-expectations (2.11.3)
|
21
|
+
diff-lcs (~> 1.1.3)
|
22
|
+
rspec-mocks (2.11.3)
|
23
|
+
sprockets (2.6.0)
|
24
|
+
hike (~> 1.2)
|
25
|
+
multi_json (~> 1.0)
|
26
|
+
rack (~> 1.0)
|
27
|
+
tilt (~> 1.1, != 1.3.0)
|
28
|
+
tilt (1.3.3)
|
29
|
+
|
30
|
+
PLATFORMS
|
31
|
+
ruby
|
32
|
+
|
33
|
+
DEPENDENCIES
|
34
|
+
rake
|
35
|
+
rspec
|
36
|
+
sprock-assets!
|
data/Rakefile
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'sprock_assets/version'
|
2
|
+
require 'sprockets'
|
3
|
+
|
4
|
+
class SprockAssets
|
5
|
+
def initialize app
|
6
|
+
puts ">> Asset compiler enabled"
|
7
|
+
@app = app
|
8
|
+
@env = Sprockets::Environment.new(Dir.pwd) do |env|
|
9
|
+
env.logger = Logger.new(STDOUT)
|
10
|
+
end
|
11
|
+
@env.append_path 'app'
|
12
|
+
@env.append_path 'app/assets/stylesheets'
|
13
|
+
@env.append_path 'app/assets/javascripts'
|
14
|
+
end
|
15
|
+
|
16
|
+
def call env
|
17
|
+
if env['PATH_INFO'][/^\/assets/].present?
|
18
|
+
@env.call env
|
19
|
+
else
|
20
|
+
@app.call env
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/readme.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# SprockAssets
|
2
|
+
SprockAssets is a Rack Middleware you can include in your application for compiling your assets on the fly with Sprockets.
|
3
|
+
|
4
|
+
# How To Use
|
5
|
+
|
6
|
+
Install the gem by adding it to your `Gemfile` and doing a bundle install.
|
7
|
+
|
8
|
+
gem 'sprock-assets', require 'sprock_assets'
|
9
|
+
|
10
|
+
Add a use to your `config.ru`
|
11
|
+
|
12
|
+
use SprockAssets
|
13
|
+
|
14
|
+
### License
|
15
|
+
WTFPL © 2012 Nick Barth
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
lib = File.expand_path('../lib', __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require 'sprock_assets/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |gem|
|
6
|
+
gem.name = 'sprock-assets'
|
7
|
+
gem.date = '2012-09-24'
|
8
|
+
gem.version = SprockAssets::VERSION
|
9
|
+
gem.authors = ['Nick Barth']
|
10
|
+
gem.email = ['nick@nickbarth.ca']
|
11
|
+
gem.summary = 'A Ruby Gem for compiling assets through Sprock.'
|
12
|
+
gem.description = 'SprockAssets is a Rack Middleware you can include in your application for compiling your assets on the fly with Sprockets.'
|
13
|
+
gem.homepage = 'https://github.com/nickbarth/SprockAssets'
|
14
|
+
|
15
|
+
gem.add_dependency('sprockets')
|
16
|
+
gem.add_development_dependency('rake')
|
17
|
+
gem.add_development_dependency('rspec')
|
18
|
+
|
19
|
+
gem.files = `git ls-files`.split($/)
|
20
|
+
gem.test_files = gem.files.grep /spec/
|
21
|
+
gem.require_paths = ['lib']
|
22
|
+
end
|
metadata
ADDED
@@ -0,0 +1,110 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sprock-assets
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Nick Barth
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-09-24 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: sprockets
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rspec
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
description: SprockAssets is a Rack Middleware you can include in your application
|
63
|
+
for compiling your assets on the fly with Sprockets.
|
64
|
+
email:
|
65
|
+
- nick@nickbarth.ca
|
66
|
+
executables: []
|
67
|
+
extensions: []
|
68
|
+
extra_rdoc_files: []
|
69
|
+
files:
|
70
|
+
- .gitignore
|
71
|
+
- .rspec
|
72
|
+
- Gemfile
|
73
|
+
- Gemfile.lock
|
74
|
+
- Rakefile
|
75
|
+
- lib/sprock_assets.rb
|
76
|
+
- lib/sprock_assets/version.rb
|
77
|
+
- readme.md
|
78
|
+
- spec/rack_assets_spec.rb
|
79
|
+
- spec/spec_helper.rb
|
80
|
+
- sprock-assets-0.0.1.gem
|
81
|
+
- sprock_assets.gemspec
|
82
|
+
homepage: https://github.com/nickbarth/SprockAssets
|
83
|
+
licenses: []
|
84
|
+
post_install_message:
|
85
|
+
rdoc_options: []
|
86
|
+
require_paths:
|
87
|
+
- lib
|
88
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
|
+
none: false
|
96
|
+
requirements:
|
97
|
+
- - ! '>='
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
requirements: []
|
101
|
+
rubyforge_project:
|
102
|
+
rubygems_version: 1.8.24
|
103
|
+
signing_key:
|
104
|
+
specification_version: 3
|
105
|
+
summary: A Ruby Gem for compiling assets through Sprock.
|
106
|
+
test_files:
|
107
|
+
- .rspec
|
108
|
+
- spec/rack_assets_spec.rb
|
109
|
+
- spec/spec_helper.rb
|
110
|
+
- sprock_assets.gemspec
|