compass 0.10.1 → 0.10.2

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.
Files changed (41) hide show
  1. data/VERSION.yml +1 -1
  2. data/features/command_line.feature +35 -11
  3. data/features/extensions.feature +4 -2
  4. data/features/step_definitions/command_line_steps.rb +3 -0
  5. data/features/step_definitions/extension_steps.rb +10 -1
  6. data/frameworks/blueprint/stylesheets/blueprint/_utilities.scss +1 -1
  7. data/frameworks/blueprint/templates/basic/manifest.rb +1 -1
  8. data/frameworks/blueprint/templates/basic/screen.sass +1 -0
  9. data/frameworks/blueprint/templates/project/ie.sass +1 -1
  10. data/frameworks/blueprint/templates/project/print.sass +1 -1
  11. data/frameworks/blueprint/templates/project/screen.sass +6 -3
  12. data/frameworks/blueprint/templates/semantic/manifest.rb +1 -1
  13. data/frameworks/blueprint/templates/semantic/print.sass +0 -3
  14. data/frameworks/compass/stylesheets/compass/css3/_gradient.scss +9 -6
  15. data/frameworks/compass/stylesheets/compass/css3/_transition.scss +3 -1
  16. data/lib/compass/app_integration/rails.rb +8 -0
  17. data/lib/compass/app_integration/rails/installer.rb +1 -1
  18. data/lib/compass/commands/help.rb +1 -11
  19. data/lib/compass/commands/installer_command.rb +1 -5
  20. data/lib/compass/commands/list_frameworks.rb +19 -2
  21. data/lib/compass/commands/project_base.rb +4 -2
  22. data/lib/compass/commands/update_project.rb +7 -3
  23. data/lib/compass/configuration/helpers.rb +2 -2
  24. data/lib/compass/frameworks.rb +21 -0
  25. data/lib/compass/sass_extensions/functions/image_size.rb +2 -2
  26. data/lib/compass/stats.rb +3 -1
  27. data/test/command_line_test.rb +0 -5
  28. data/test/compass_test.rb +21 -8
  29. data/test/fixtures/stylesheets/blueprint/css/ie.css +60 -0
  30. data/test/fixtures/stylesheets/blueprint/css/print.css +56 -0
  31. data/test/fixtures/stylesheets/blueprint/css/screen.css +804 -0
  32. data/test/fixtures/stylesheets/blueprint/css/single-imports/utilities.css +37 -0
  33. data/test/fixtures/stylesheets/blueprint/sass/single-imports/utilities.sass +3 -0
  34. data/test/fixtures/stylesheets/compass/css/print.css +1 -2
  35. data/test/fixtures/stylesheets/compass/sass/utilities.scss +9 -0
  36. data/test/fixtures/stylesheets/image_urls/css/screen.css +0 -2
  37. data/test/fixtures/stylesheets/image_urls/sass/screen.sass +2 -2
  38. data/test/fixtures/stylesheets/relative/css/ie.css +1 -1
  39. data/test/rails_integration_test.rb +2 -2
  40. metadata +15 -5
  41. data/test/fixtures/stylesheets/compass/sass/utilities.sass +0 -7
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 10
4
- :patch: 1
4
+ :patch: 2
@@ -91,7 +91,7 @@ Feature: Command Line
91
91
  And a sass file sass/layout.sass is reported compiled
92
92
  And a sass file sass/print.sass is reported compiled
93
93
  And a sass file sass/reset.sass is reported compiled
94
- And a sass file sass/utilities.sass is reported compiled
94
+ And a sass file sass/utilities.scss is reported compiled
95
95
  And a css file tmp/layout.css is created
96
96
  And a css file tmp/print.css is created
97
97
  And a css file tmp/reset.css is created
@@ -105,12 +105,29 @@ Feature: Command Line
105
105
  And a sass file tmp_compass/sass/layout.sass is reported compiled
106
106
  And a sass file tmp_compass/sass/print.sass is reported compiled
107
107
  And a sass file tmp_compass/sass/reset.sass is reported compiled
108
- And a sass file tmp_compass/sass/utilities.sass is reported compiled
108
+ And a sass file tmp_compass/sass/utilities.scss is reported compiled
109
109
  And a css file tmp_compass/tmp/layout.css is created
110
110
  And a css file tmp_compass/tmp/print.css is created
111
111
  And a css file tmp_compass/tmp/reset.css is created
112
112
  And a css file tmp_compass/tmp/utilities.css is created
113
113
 
114
+ Scenario: Dry Run of Compiling an existing project.
115
+ Given I am using the existing project in test/fixtures/stylesheets/compass
116
+ When I run: compass compile --dry-run
117
+ Then a directory tmp/ is not created
118
+ And a sass file sass/layout.sass is reported compiled
119
+ And a sass file sass/print.sass is reported compiled
120
+ And a sass file sass/reset.sass is reported compiled
121
+ And a sass file sass/utilities.scss is reported compiled
122
+ And a css file tmp/layout.css is not created
123
+ And a css file tmp/print.css is not created
124
+ And a css file tmp/reset.css is not created
125
+ And a css file tmp/utilities.css is not created
126
+ And a css file tmp/layout.css is reported created
127
+ And a css file tmp/print.css is reported created
128
+ And a css file tmp/reset.css is reported created
129
+ And a css file tmp/utilities.css is reported created
130
+
114
131
  Scenario: Recompiling a project with no changes
115
132
  Given I am using the existing project in test/fixtures/stylesheets/compass
116
133
  When I run: compass compile
@@ -118,26 +135,26 @@ Feature: Command Line
118
135
  Then a sass file sass/layout.sass is reported unchanged
119
136
  And a sass file sass/print.sass is reported unchanged
120
137
  And a sass file sass/reset.sass is reported unchanged
121
- And a sass file sass/utilities.sass is reported unchanged
138
+ And a sass file sass/utilities.scss is reported unchanged
122
139
 
123
140
  Scenario: compiling a specific file in a project
124
141
  Given I am using the existing project in test/fixtures/stylesheets/compass
125
- And I run: compass compile sass/utilities.sass
142
+ And I run: compass compile sass/utilities.scss
126
143
  Then a sass file sass/layout.sass is not mentioned
127
144
  And a sass file sass/print.sass is not mentioned
128
145
  And a sass file sass/reset.sass is not mentioned
129
- And a sass file sass/utilities.sass is reported compiled
146
+ And a sass file sass/utilities.scss is reported compiled
130
147
  And a css file tmp/utilities.css is reported created
131
148
  And a css file tmp/utilities.css is created
132
149
 
133
150
  Scenario: Re-compiling a specific file in a project with no changes
134
151
  Given I am using the existing project in test/fixtures/stylesheets/compass
135
152
  When I run: compass compile
136
- And I run: compass compile sass/utilities.sass
153
+ And I run: compass compile sass/utilities.scss
137
154
  Then a sass file sass/layout.sass is not mentioned
138
155
  And a sass file sass/print.sass is not mentioned
139
156
  And a sass file sass/reset.sass is not mentioned
140
- And a sass file sass/utilities.sass is reported compiled
157
+ And a sass file sass/utilities.scss is reported compiled
141
158
  And a css file tmp/utilities.css is reported identical
142
159
 
143
160
  Scenario: Installing a pattern into a project
@@ -178,7 +195,7 @@ Feature: Command Line
178
195
  Then a css file tmp/layout.css is reported identical
179
196
  And a sass file sass/print.sass is reported unchanged
180
197
  And a sass file sass/reset.sass is reported unchanged
181
- And a sass file sass/utilities.sass is reported unchanged
198
+ And a sass file sass/utilities.scss is reported unchanged
182
199
 
183
200
  Scenario: Recompiling a project with changes
184
201
  Given I am using the existing project in test/fixtures/stylesheets/compass
@@ -190,7 +207,7 @@ Feature: Command Line
190
207
  And a css file tmp/layout.css is reported overwritten
191
208
  And a sass file sass/print.sass is reported unchanged
192
209
  And a sass file sass/reset.sass is reported unchanged
193
- And a sass file sass/utilities.sass is reported unchanged
210
+ And a sass file sass/utilities.scss is reported unchanged
194
211
 
195
212
  Scenario: Watching a project for changes
196
213
  Given I am using the existing project in test/fixtures/stylesheets/compass
@@ -236,7 +253,7 @@ Feature: Command Line
236
253
  Then my css is validated
237
254
  And I am informed that my css is valid.
238
255
 
239
- @broken
256
+ @stats
240
257
  Scenario: Get stats for my project
241
258
  Given I am using the existing project in test/fixtures/stylesheets/compass
242
259
  When I run: compass stats
@@ -248,6 +265,13 @@ Feature: Command Line
248
265
  | sass/layout.sass | 0 | 0 | 0 | 1 | 5 | 10 |
249
266
  | sass/print.sass | 0 | 0 | 0 | 2 | 61 | 61 |
250
267
  | sass/reset.sass | 4 | 1 | 0 | 2 | 190 | 664 |
251
- | sass/utilities.sass | 2 | 0 | 0 | 2 | 5 | 11 |
268
+ | sass/utilities.scss | 2 | 0 | 0 | 2 | 5 | 11 |
252
269
  | Total.* | 44 | 9 | 0 | 45 | 299 | 832 |
253
270
 
271
+ @listframeworks
272
+ Scenario: List frameworks registered with compass
273
+ When I run: compass frameworks
274
+ Then I should see the following lines of output:
275
+ | blueprint |
276
+ | compass |
277
+
@@ -4,17 +4,19 @@ Feature: Extensions
4
4
  I can install extensions that others have created
5
5
  And I can create and publish my own extensions
6
6
 
7
+ @listframeworks
7
8
  Scenario: Extensions directory for stand_alone projects
8
9
  Given I am using the existing project in test/fixtures/stylesheets/compass
9
10
  And the "extensions" directory exists
10
11
  And and I have a fake extension at extensions/testing
11
- When I run: compass --list-frameworks
12
+ When I run: compass frameworks
12
13
  Then the list of frameworks includes "testing"
13
14
 
15
+ @listframeworks
14
16
  Scenario: Extensions directory for rails projects
15
17
  Given I'm in a newly created rails project: my_rails_project
16
18
  And the "my_rails_project/vendor/plugins/compass/extensions" directory exists
17
19
  And and I have a fake extension at my_rails_project/vendor/plugins/compass/extensions/testing
18
- When I run: compass --list-frameworks
20
+ When I run: compass frameworks
19
21
  Then the list of frameworks includes "testing"
20
22
 
@@ -232,3 +232,6 @@ Then /^the image ([^ ]+) has a size of (\d+)x(\d+)$/ do |file, width, height|
232
232
  IO.read(file)[0x10..0x18].unpack('NN').should == [width.to_i, height.to_i]
233
233
  end
234
234
 
235
+ Then /^I should see the following lines of output:$/ do |table|
236
+ table.diff!([['blueprint'],['compass']])
237
+ end
@@ -5,9 +5,18 @@ end
5
5
  Given /^and I have a fake extension at (.*)$/ do |directory|
6
6
  FileUtils.mkdir_p File.join(directory, 'stylesheets')
7
7
  FileUtils.mkdir_p File.join(directory, 'templates/project')
8
+ open(File.join(directory, 'templates/project/manifest.rb'),"w") do |f|
9
+ f.puts %Q{
10
+ description "This is a fake extension"
11
+
12
+ help "this is the fake help"
13
+
14
+ welcome_message "this is a fake welcome"
15
+ }
16
+ end
8
17
  end
9
18
 
10
19
  Then /^the list of frameworks includes "([^\"]*)"$/ do |framework|
11
- @last_result.split("\n").map{|f| f.strip}.should include(framework)
20
+ @last_result.split("\n").map{|f| f.gsub(/(^\s+[*-]\s+)|(\s+$)/,'')}.should include(framework)
12
21
  end
13
22
 
@@ -1,5 +1,5 @@
1
1
  @import "compass/utilities/text/nowrap";
2
- @import "compass/utilities/general/float";
2
+ @import "compass/utilities/general/clearfix";
3
3
 
4
4
  // Most of these utility classes are not "semantic". If you use them,
5
5
  // you are mixing your content and presentation. For shame!
@@ -1,4 +1,4 @@
1
- description "The blueprint framework."
1
+ description "A basic blueprint install that mimics the actual blueprint css."
2
2
 
3
3
  stylesheet 'screen.sass', :media => 'screen, projection'
4
4
  stylesheet 'partials/_base.sass'
@@ -9,3 +9,4 @@
9
9
 
10
10
  // Generate the blueprint framework according to your configuration:
11
11
  +blueprint
12
+ +blueprint-scaffolding
@@ -1,7 +1,7 @@
1
1
  @import blueprint
2
2
 
3
3
  // To generate css equivalent to the blueprint css but with your configuration applied, uncomment:
4
- // +blueprint-ie
4
+ // @include blueprint-ie
5
5
 
6
6
  //Recommended Blueprint configuration with scoping and semantic layout:
7
7
  body.bp
@@ -1,7 +1,7 @@
1
1
  @import blueprint
2
2
 
3
3
  // To generate css equivalent to the blueprint css but with your configuration applied, uncomment:
4
- // +blueprint-print
4
+ // @include blueprint-print
5
5
 
6
6
  //Recommended Blueprint configuration with scoping and semantic layout:
7
7
  body.bp
@@ -7,10 +7,13 @@
7
7
  // Import the non-default scaffolding module.
8
8
  @import blueprint/scaffolding
9
9
 
10
- // To generate css equivalent to the blueprint css but with your configuration applied, uncomment:
11
- // +blueprint
10
+ // To generate css equivalent to the blueprint css but with your
11
+ // configuration applied, uncomment:
12
+ // @include blueprint
12
13
 
13
- //Recommended Blueprint configuration with scoping and semantic layout:
14
+ // But Compass recommends that you scope your blueprint styles
15
+ // So that you can better control what pages use blueprint
16
+ // when stylesheets are concatenated together.
14
17
  +blueprint-scaffolding("body.bp")
15
18
  body.bp
16
19
  +blueprint-typography(true)
@@ -1,4 +1,4 @@
1
- description "The blueprint framework."
1
+ description "The blueprint framework for use with semantic markup."
2
2
 
3
3
  stylesheet 'screen.sass', :media => 'screen, projection'
4
4
  stylesheet 'partials/_base.sass'
@@ -1,8 +1,5 @@
1
1
  @import blueprint
2
2
 
3
- // To generate css equivalent to the blueprint css but with your configuration applied, uncomment:
4
- // +blueprint-print
5
-
6
3
  //Recommended Blueprint configuration with scoping and semantic layout:
7
4
  body.bp
8
5
  +blueprint-print(true)
@@ -6,11 +6,11 @@
6
6
  //
7
7
  // This yields a linear gradient spanning from bottom to top
8
8
  //
9
- // +linear-gradient(color-stops(white, black), "bottom")
9
+ // +linear-gradient(color-stops(white, black), bottom)
10
10
  //
11
11
  // This yields a linear gradient spanning from left to right
12
12
  //
13
- // +linear-gradient(color-stops(white, black), "left")
13
+ // +linear-gradient(color-stops(white, black), left)
14
14
  //
15
15
  // This yields a linear gradient starting at white passing
16
16
  // thru blue at 33% down and then to black
@@ -24,7 +24,7 @@
24
24
  //
25
25
  // This yields a linear gradient on top of a background image
26
26
  //
27
- // +linear-gradient(color_stops(white,black), "top", image-url('noise.png'))
27
+ // +linear-gradient(color_stops(white,black), top, image-url('noise.png'))
28
28
  // Browsers Supported:
29
29
  //
30
30
  // - Chrome
@@ -36,6 +36,7 @@
36
36
  // Webkit's gradient api sucks -- hence these backflips:
37
37
  $background: unquote("");
38
38
  @if $image { $background : $image + unquote(", "); }
39
+ $start: unquote($start);
39
40
  $end: grad-opposite-position($start);
40
41
  @if $experimental-support-for-webkit {
41
42
  background-image: #{$background}-webkit-gradient(linear, grad-point($start), grad-point($end), grad-color-stops($color-stops));
@@ -53,11 +54,12 @@
53
54
  // // Defaults to a centered, 100px radius gradient
54
55
  // +radial-gradient(color-stops(#c00, #00c))
55
56
  // // 100px radius gradient in the top left corner
56
- // +radial-gradient(color-stops(#c00, #00c), "top left")
57
+ // +radial-gradient(color-stops(#c00, #00c), top left)
57
58
  // // Three colors, ending at 50px and passing thru #fff at 25px
58
59
  // +radial-gradient(color-stops(#c00, #fff, #00c 50px))
59
- // // gradient on top of a background image
60
- // +radial-gradient(color_stops(#c00, #fff), "top left", image-url("noise.png")))
60
+ // // a background image on top of the gradient
61
+ // // Requires an image with an alpha-layer.
62
+ // +radial-gradient(color_stops(#c00, #fff), top left, image-url("noise.png")))
61
63
  // Browsers Supported:
62
64
  //
63
65
  // - Chrome
@@ -65,6 +67,7 @@
65
67
  // - Firefox 3.6
66
68
 
67
69
  @mixin radial-gradient($color-stops, $center-position: center center, $image: false) {
70
+ $center-position: unquote($center-position);
68
71
  $end-pos: grad-end-position($color-stops, true);
69
72
  $background: unquote("");
70
73
  @if $image { $background: $image + unquote(", "); }
@@ -40,6 +40,7 @@ $default-transition-delay: false !default;
40
40
  // * these durations will affect the properties in the same list position
41
41
 
42
42
  @mixin transition-duration($duration: $default-transition-duration) {
43
+ @if type-of($duration) == string { $duration: unquote($duration); }
43
44
  @include experimental(transition-duration, $duration,
44
45
  -moz, -webkit, -o, not -ms, not -khtml, official
45
46
  );
@@ -52,7 +53,7 @@ $default-transition-delay: false !default;
52
53
  // * These functions will effect the properties in the same list position
53
54
 
54
55
  @mixin transition-timing-function($function: $default-transition-function) {
55
- @include experimental(transition-timing-function, $function,
56
+ @include experimental(transition-timing-function, unquote($function),
56
57
  -moz, -webkit, -o, not -ms, not -khtml, official
57
58
  );
58
59
  }
@@ -63,6 +64,7 @@ $default-transition-delay: false !default;
63
64
  // * these delays will effect the properties in the same list position
64
65
 
65
66
  @mixin transition-delay($delay: $default-transition-delay) {
67
+ @if type-of($delay) == string { $delay: unquote($delay); }
66
68
  @include experimental(transition-delay, $delay,
67
69
  -moz, -webkit, -o, not -ms, not -khtml, official
68
70
  );
@@ -26,6 +26,14 @@ module Compass
26
26
  end
27
27
  end
28
28
 
29
+ def root
30
+ if defined?(::Rails)
31
+ ::Rails.root
32
+ elsif defined?(RAILS_ROOT)
33
+ RAILS_ROOT
34
+ end
35
+ end
36
+
29
37
  end
30
38
  end
31
39
  end
@@ -94,7 +94,7 @@ NEXTSTEPS
94
94
  "# This configuration file works with both the Compass command line tool and within Rails.\n" +
95
95
  Compass.configuration.serialize do |prop, value|
96
96
  if prop == :project_path
97
- "project_path = RAILS_ROOT if defined?(RAILS_ROOT)\n"
97
+ "project_path = Compass::AppIntegration::Rails.root\n"
98
98
  elsif prop == :environment
99
99
  "environment = Compass::AppIntegration::Rails.env\n"
100
100
  elsif prop == :output_style
@@ -23,17 +23,7 @@ To get help on a particular command please specify the command.
23
23
  banner << command_list("Other Commands:", other_commands)
24
24
 
25
25
  banner << "\nAvailable Frameworks & Patterns:\n\n"
26
- Compass::Frameworks::ALL.each do |framework|
27
- next if framework.name =~ /^_/
28
- banner << " * #{framework.name}\n"
29
- framework.template_directories.each do |pattern|
30
- banner << " - #{framework.name}/#{pattern}"
31
- if description = framework.manifest(pattern).description
32
- banner << "\t- #{description}"
33
- end
34
- banner << "\n"
35
- end
36
- end
26
+ banner << Compass::Frameworks.pretty_print
37
27
  banner << "\nGlobal Options:\n"
38
28
  opts.banner = banner
39
29
 
@@ -6,11 +6,7 @@ module Compass
6
6
  include Compass::Installers
7
7
 
8
8
  def configure!
9
- if respond_to?(:is_project_creation?) && is_project_creation?
10
- Compass.add_configuration(options.delete(:project_type) || :stand_alone)
11
- else
12
- Compass.add_project_configuration(:project_type => options.delete(:project_type))
13
- end
9
+ add_project_configuration
14
10
  Compass.add_configuration(options, 'command_line')
15
11
  Compass.discover_extensions!
16
12
  Compass.add_configuration(installer.completed_configuration, 'installer')
@@ -8,14 +8,31 @@ module Compass
8
8
  end
9
9
 
10
10
  def execute
11
- Compass::Frameworks::ALL.each do |framework|
12
- puts framework.name unless framework.name =~ /^_/
11
+ if options[:quiet]
12
+ Compass::Frameworks::ALL.each do |framework|
13
+ puts framework.name unless framework.name =~ /^_/
14
+ end
15
+ else
16
+ puts "Available Frameworks & Patterns:\n\n"
17
+ puts Compass::Frameworks.pretty_print
13
18
  end
14
19
  end
15
20
  class << self
21
+ def option_parser(arguments)
22
+ parser = Compass::Exec::CommandOptionParser.new(arguments)
23
+ parser.extend(Compass::Exec::GlobalOptionsParser)
24
+ end
25
+ def usage
26
+ option_parser([]).to_s
27
+ end
16
28
  def description(command)
17
29
  "List the available frameworks"
18
30
  end
31
+ def parse!(arguments)
32
+ parser = option_parser(arguments)
33
+ parser.parse!
34
+ parser.options
35
+ end
19
36
  end
20
37
  end
21
38
  end
@@ -23,12 +23,14 @@ module Compass
23
23
 
24
24
  def configure!
25
25
  add_project_configuration
26
- Compass.add_configuration(options, "cli")
26
+ Compass.add_configuration(options, "command_line")
27
27
  Compass.discover_extensions!
28
28
  end
29
29
 
30
30
  def add_project_configuration
31
- Compass.add_project_configuration(options[:configuration_file])
31
+ Compass.add_project_configuration(options[:configuration_file]) do
32
+ options[:project_type]
33
+ end
32
34
  end
33
35
 
34
36
  def projectize(path)
@@ -46,12 +46,16 @@ module Compass
46
46
  end
47
47
 
48
48
  def new_compiler_instance(additional_options = {})
49
+ compiler_opts = Compass.sass_engine_options
50
+ compiler_opts.merge!(:quiet => options[:quiet],
51
+ :force => options[:force],
52
+ :sass_files => explicit_sass_files,
53
+ :dry_run => options[:dry_run])
54
+ compiler_opts.merge!(additional_options)
49
55
  Compass::Compiler.new(working_path,
50
56
  projectize(Compass.configuration.sass_dir),
51
57
  projectize(Compass.configuration.css_dir),
52
- Compass.sass_engine_options.merge(:quiet => options[:quiet],
53
- :force => options[:force],
54
- :sass_files => explicit_sass_files).merge(additional_options))
58
+ compiler_opts)
55
59
  end
56
60
 
57
61
  def explicit_sass_files