guard-sass 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  guard-sass compiles or validates your sass (and scss) files automatically when
4
4
  changed.
5
5
 
6
+
6
7
  ## Install
7
8
 
8
9
  You will need to have [guard](http://github.com/guard/guard) to continue, so
@@ -20,16 +21,18 @@ And finally add a basic setup to your Guardfile with:
20
21
 
21
22
  guard init sass
22
23
 
24
+
23
25
  ## Usage
24
26
 
25
27
  Please read the [Guard usage documentation][gdoc].
26
28
 
29
+
27
30
  ## Guardfile
28
31
 
29
32
  guard-sass can be adapted to all kind of projects. Please read the
30
33
  [Guard documentation][gdoc] for more information about the Guardfile DSL.
31
34
 
32
- ### Ruby project
35
+ ### Ruby Project
33
36
 
34
37
  In a Ruby project you want to configure your input and output directories.
35
38
 
@@ -39,7 +42,7 @@ If your output directory is the same as the input directory, you can simply skip
39
42
 
40
43
  guard 'sass', :input => 'styles'
41
44
 
42
- ### Rails app with the asset pipeline
45
+ ### Rails App With the Asset Pipeline
43
46
 
44
47
  With the introduction of the [asset pipeline][rpipe] in Rails 3.1 there is no
45
48
  need to compile your Sass stylesheets with this Guard. However, if you would
@@ -59,13 +62,22 @@ compilation message:
59
62
  :noop => true,
60
63
  :hide_success => true
61
64
 
62
- ### Rails app without the asset pipeline
65
+ ### Rails App Without the Asset Pipeline
63
66
 
64
67
  Without the asset pipeline you just define an input and output directory as in
65
68
  a normal Ruby project:
66
69
 
67
70
  guard 'sass', :input => 'app/stylesheets', :output => 'public/stylesheets'
68
71
 
72
+ ### Output Extensions
73
+
74
+ It is standard practice in Rails 3.1 to write sass/scss files with the extension
75
+ `.css.sass` to prevent these being written as `.css.sass.css` you need to set
76
+ the `:extension` option like so:
77
+
78
+ guard 'sass', :input => 'styles', :extension => ''
79
+
80
+
69
81
  ## Options
70
82
 
71
83
  The following options can be passed to guard-sass:
@@ -74,8 +86,11 @@ The following options can be passed to guard-sass:
74
86
  # A suffix `/(.+\.s[ac]ss)` will be added to this option.
75
87
  # default: nil
76
88
 
77
- :output => 'css' # Relative path to the output directory.
89
+ :output => 'stylesheets' # Relative path to the output directory.
78
90
  # default: 'css' or the :input option when supplied
91
+
92
+ :extension => '' # Extension used for written files.
93
+ # default: '.css'
79
94
 
80
95
  :hide_success => true # Disable successful compilation messages.
81
96
  # default: false
@@ -96,7 +111,7 @@ The following options can be passed to guard-sass:
96
111
  :debug_info => true # File and line number info for FireSass.
97
112
  # default: false
98
113
 
99
- ### Output short notation
114
+ ### Output Short Notation
100
115
 
101
116
  guard-sass also has a short notation like [guard-coffeescript][gcs], this lets
102
117
  you define an input folder (with an optional output folder) automatically creating
@@ -116,7 +131,7 @@ These are equivalent to
116
131
  watch %r{^stylesheets/(.+\.s[ac]ss)$}
117
132
  end
118
133
 
119
- ### Nested directories
134
+ ### Nested Directories
120
135
 
121
136
  By default the guard detects nested directories and writes files into the output
122
137
  directory with the same structure.
@@ -147,6 +162,7 @@ This behaviour can be switched off by passing the option `:shallow => true` to t
147
162
  Guard, so that all stylesheets will be compiled directly to the output directory.
148
163
  So the previous example would have compiled to `public/stylesheets/button.css`.
149
164
 
165
+
150
166
  ## Development
151
167
 
152
168
  - Source hosted at [GitHub](https://github.com/hawx/guard-sass)
@@ -157,6 +173,7 @@ Pull requests are very welcome!
157
173
  For questions please join us on our [Google group][ggroup] or
158
174
  on `#guard` (irc.freenode.net).
159
175
 
176
+
160
177
  ## Contributors
161
178
 
162
179
  Have a look at the [GitHub contributor][contrib] list to see all contributors.
@@ -164,6 +181,7 @@ Have a look at the [GitHub contributor][contrib] list to see all contributors.
164
181
  Since this Guard is very close to [guard-coffeescript][gcs], some features have been
165
182
  incorporated into guard-sass.
166
183
 
184
+
167
185
  ## License
168
186
 
169
187
  (The MIT License)
@@ -93,7 +93,7 @@ module Guard
93
93
  # @param file [String] Name of the file
94
94
  # @return [String] Path of file written
95
95
  def write_file(content, dir, file)
96
- path = File.join(dir, File.basename(file.split('.')[0])) << '.css'
96
+ path = File.join(dir, File.basename(file, '.*')) << options[:extension]
97
97
 
98
98
  unless options[:noop]
99
99
  FileUtils.mkdir_p(dir)
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  class SassVersion
3
- VERSION = '0.5.2'
3
+ VERSION = '0.5.3'
4
4
  end
5
5
  end
data/lib/guard/sass.rb CHANGED
@@ -10,6 +10,7 @@ module Guard
10
10
 
11
11
  DEFAULTS = {
12
12
  :output => 'css',
13
+ :extension => '.css',
13
14
  :style => :nested,
14
15
  :shallow => false,
15
16
  :debug_info => false,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-sass
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-12 00:00:00.000000000Z
12
+ date: 2011-10-29 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: guard
16
- requirement: &2153122600 !ruby/object:Gem::Requirement
16
+ requirement: &2152970280 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.4.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2153122600
24
+ version_requirements: *2152970280
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: sass
27
- requirement: &2153122100 !ruby/object:Gem::Requirement
27
+ requirement: &2156208240 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '3.1'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2153122100
35
+ version_requirements: *2156208240
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: bundler
38
- requirement: &2153121340 !ruby/object:Gem::Requirement
38
+ requirement: &2156348440 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 1.0.2
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *2153121340
46
+ version_requirements: *2156348440
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec
49
- requirement: &2153120460 !ruby/object:Gem::Requirement
49
+ requirement: &2156734020 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>'
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: 2.0.0.rc
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *2153120460
57
+ version_requirements: *2156734020
58
58
  description: Guard::Sass automatically rebuilds sass (like sass --watch)
59
59
  email:
60
60
  - m@hawx.me