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.
@@ -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, Sprockets
24
+ extend Runtime
26
25
  class << self
27
26
  @@compress = false
28
27
  @@debug = false
@@ -1,4 +1,6 @@
1
1
  require 'stylus'
2
+ require 'stylus/sprockets'
3
+
2
4
  module Stylus
3
5
  # Internal: The Railtie responsible for integrate the Stylus library with
4
6
  # a Rails 3.2 (or 3.1) application.
@@ -1,8 +1,6 @@
1
- if defined?(::Tilt)
2
- require 'stylus/tilt'
3
- require 'stylus/import_processor'
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
- module Sprockets
18
- # Public: Configure a Sprockets environment with Stylus Tilt engine
19
- # and the ImportProcessor. It also accept a configuration Hash to
20
- # setup the load path and flags of the Stylus module.
21
- #
22
- # environment - A instance of Sprockets::Environment.
23
- # options - The configuration Hash (default: {})
24
- # :paths - An Array of paths to use the '@import' directive, defaults
25
- # to the `paths` attribute on the environment object.
26
- # :debug - The Boolean value for the debug flag.
27
- # :compress - The Boolean value for the debug compress.
28
- #
29
- # Example
30
- #
31
- # assets = Sprockets::Environment.new
32
- # Stylus.setup(assets, :compress => settings.production?)
33
- #
34
- # Returns nothing.
35
- def setup(environment, options = {})
36
- paths = options[:paths] || environment.paths
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
- Stylus.paths.concat(directories)
36
+ Stylus.paths.concat(directories)
40
37
 
41
- Stylus.debug = options.fetch(:debug, Stylus.debug)
42
- Stylus.compress = options.fetch(:compress, Stylus.compress)
38
+ Stylus.debug = options.fetch(:debug, Stylus.debug)
39
+ Stylus.compress = options.fetch(:compress, Stylus.compress)
43
40
 
44
- environment.register_engine('.styl', Tilt::StylusTemplate)
45
- environment.register_preprocessor('text/css', Stylus::ImportProcessor)
46
- end
41
+ environment.register_engine('.styl', Tilt::StylusTemplate)
42
+ environment.register_preprocessor('text/css', Stylus::ImportProcessor)
47
43
  end
48
44
  end
@@ -1,3 +1,3 @@
1
1
  module Stylus
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
3
3
  end
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.0
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-01-27 00:00:00.000000000 Z
12
+ date: 2013-02-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: execjs