stylus 0.7.0 → 0.7.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.
- data/lib/stylus.rb +1 -2
- data/lib/stylus/railtie.rb +2 -0
- data/lib/stylus/sprockets.rb +28 -32
- data/lib/stylus/version.rb +1 -1
- metadata +2 -2
data/lib/stylus.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'stylus/runtime'
|
2
2
|
require 'stylus/source'
|
3
|
-
require 'stylus/sprockets'
|
4
3
|
require 'stylus/version'
|
5
4
|
require 'stylus/railtie' if defined?(::Rails)
|
6
5
|
## Stylus
|
@@ -22,7 +21,7 @@ require 'stylus/railtie' if defined?(::Rails)
|
|
22
21
|
# `Stylus.compile(File.read('application.styl'), :compress => true)`
|
23
22
|
#
|
24
23
|
module Stylus
|
25
|
-
extend Runtime
|
24
|
+
extend Runtime
|
26
25
|
class << self
|
27
26
|
@@compress = false
|
28
27
|
@@debug = false
|
data/lib/stylus/railtie.rb
CHANGED
data/lib/stylus/sprockets.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
end
|
5
|
-
|
1
|
+
require 'stylus'
|
2
|
+
require 'stylus/tilt'
|
3
|
+
require 'stylus/import_processor'
|
6
4
|
# Public: The setup logic to configure both Stylus and Sprockets on any
|
7
5
|
# kind of application - Rails, Sinatra or Rack.
|
8
6
|
#
|
@@ -14,35 +12,33 @@ end
|
|
14
12
|
# Stylus.setup(assets)
|
15
13
|
# run assets.index
|
16
14
|
module Stylus
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
directories = paths.select { |dir| dir.to_s =~ /stylesheets$/ }
|
15
|
+
# Public: Configure a Sprockets environment with Stylus Tilt engine
|
16
|
+
# and the ImportProcessor. It also accept a configuration Hash to
|
17
|
+
# setup the load path and flags of the Stylus module.
|
18
|
+
#
|
19
|
+
# environment - A instance of Sprockets::Environment.
|
20
|
+
# options - The configuration Hash (default: {})
|
21
|
+
# :paths - An Array of paths to use the '@import' directive, defaults
|
22
|
+
# to the `paths` attribute on the environment object.
|
23
|
+
# :debug - The Boolean value for the debug flag.
|
24
|
+
# :compress - The Boolean value for the debug compress.
|
25
|
+
#
|
26
|
+
# Example
|
27
|
+
#
|
28
|
+
# assets = Sprockets::Environment.new
|
29
|
+
# Stylus.setup(assets, :compress => settings.production?)
|
30
|
+
#
|
31
|
+
# Returns nothing.
|
32
|
+
def self.setup(environment, options = {})
|
33
|
+
paths = options[:paths] || environment.paths
|
34
|
+
directories = paths.select { |dir| dir.to_s =~ /stylesheets$/ }
|
38
35
|
|
39
|
-
|
36
|
+
Stylus.paths.concat(directories)
|
40
37
|
|
41
|
-
|
42
|
-
|
38
|
+
Stylus.debug = options.fetch(:debug, Stylus.debug)
|
39
|
+
Stylus.compress = options.fetch(:compress, Stylus.compress)
|
43
40
|
|
44
|
-
|
45
|
-
|
46
|
-
end
|
41
|
+
environment.register_engine('.styl', Tilt::StylusTemplate)
|
42
|
+
environment.register_preprocessor('text/css', Stylus::ImportProcessor)
|
47
43
|
end
|
48
44
|
end
|
data/lib/stylus/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stylus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-02-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: execjs
|