compass 0.10.5.pre.1 → 0.10.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/features/command_line.feature +16 -10
- data/features/step_definitions/command_line_steps.rb +1 -1
- data/lib/compass/commands.rb +1 -1
- data/lib/compass/commands/project_base.rb +5 -1
- data/lib/compass/commands/unpack_extension.rb +117 -0
- data/lib/compass/frameworks.rb +10 -7
- data/lib/compass/stats.rb +1 -1
- data/lib/compass/validator.rb +1 -1
- data/test/rails_helper.rb +12 -7
- metadata +9 -13
- data/frameworks/compass/stylesheets/compass/layout/_floated.scss +0 -111
data/VERSION.yml
CHANGED
@@ -258,16 +258,22 @@ Feature: Command Line
|
|
258
258
|
Given I am using the existing project in test/fixtures/stylesheets/compass
|
259
259
|
When I run: compass stats
|
260
260
|
Then I am told statistics for each file:
|
261
|
-
| Filename
|
262
|
-
| sass/
|
263
|
-
| sass/
|
264
|
-
| sass/
|
265
|
-
| sass/
|
266
|
-
| sass/
|
267
|
-
| sass/
|
268
|
-
| sass/
|
269
|
-
|
|
270
|
-
|
261
|
+
| Filename | Rules | Properties | Mixins Defs | Mixins Used | CSS Rules | CSS Properties |
|
262
|
+
| sass/border_radius.scss | 3 | 0 | 0 | 3 | 3 | 18 |
|
263
|
+
| sass/box.sass | 15 | 0 | 0 | 19 | 15 | 59 |
|
264
|
+
| sass/fonts.sass | 0 | 0 | 0 | 1 | 1 | 2 |
|
265
|
+
| sass/gradients.sass | 19 | 0 | 0 | 19 | 19 | 19 |
|
266
|
+
| sass/image_size.sass | 4 | 8 | 0 | 0 | 4 | 8 |
|
267
|
+
| sass/images.scss | 3 | 3 | 0 | 0 | 3 | 3 |
|
268
|
+
| sass/layout.sass | 0 | 0 | 0 | 1 | 5 | 10 |
|
269
|
+
| sass/legacy_clearfix.scss | 2 | 0 | 0 | 2 | 5 | 11 |
|
270
|
+
| sass/lists.scss | 9 | 0 | 0 | 9 | 35 | 111 |
|
271
|
+
| sass/print.sass | 0 | 0 | 0 | 2 | 61 | 61 |
|
272
|
+
| sass/reset.sass | 4 | 1 | 0 | 2 | 190 | 664 |
|
273
|
+
| sass/utilities.scss | 2 | 0 | 0 | 2 | 3 | 9 |
|
274
|
+
| ------------------------- | ----- | ---------- | -------------- | ----------- | --------- | -------------- |
|
275
|
+
| Total.* | 61 | 12 | 0 | 60 | 344 | 975 |
|
276
|
+
|
271
277
|
@listframeworks
|
272
278
|
Scenario: List frameworks registered with compass
|
273
279
|
When I run: compass frameworks
|
@@ -34,7 +34,7 @@ Given %r{^I am in the parent directory$} do
|
|
34
34
|
Dir.chdir ".."
|
35
35
|
end
|
36
36
|
|
37
|
-
Given
|
37
|
+
Given %r{^I'm in a newly created rails project: (.+)$} do |project_name|
|
38
38
|
@cleanup_directories << project_name
|
39
39
|
begin
|
40
40
|
generate_rails_app project_name
|
data/lib/compass/commands.rb
CHANGED
@@ -6,6 +6,6 @@ require 'compass/commands/registry'
|
|
6
6
|
%w(base generate_grid_background help list_frameworks project_base
|
7
7
|
update_project watch_project create_project imports installer_command
|
8
8
|
print_version project_stats stamp_pattern validate_project
|
9
|
-
write_configuration interactive).each do |lib|
|
9
|
+
write_configuration interactive unpack_extension).each do |lib|
|
10
10
|
require "compass/commands/#{lib}"
|
11
11
|
end
|
@@ -24,7 +24,7 @@ module Compass
|
|
24
24
|
def configure!
|
25
25
|
add_project_configuration
|
26
26
|
Compass.add_configuration(options, "command_line")
|
27
|
-
Compass.discover_extensions!
|
27
|
+
Compass.discover_extensions! unless skip_extension_discovery?
|
28
28
|
end
|
29
29
|
|
30
30
|
def add_project_configuration
|
@@ -88,6 +88,10 @@ module Compass
|
|
88
88
|
path.index(File::SEPARATOR) == 0
|
89
89
|
end
|
90
90
|
|
91
|
+
def skip_extension_discovery?
|
92
|
+
false
|
93
|
+
end
|
94
|
+
|
91
95
|
end
|
92
96
|
end
|
93
97
|
end
|
@@ -0,0 +1,117 @@
|
|
1
|
+
require 'compass/commands/project_base'
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
module Compass
|
5
|
+
module Commands
|
6
|
+
module ExtensionOptionsParser
|
7
|
+
def set_options(opts)
|
8
|
+
opts.banner = %Q{
|
9
|
+
Usage: compass unpack EXTENSION
|
10
|
+
|
11
|
+
Description:
|
12
|
+
Copy an extension into your extensions folder for easy access to the source code.
|
13
|
+
This makes it easier to peruse the source in unfamiliar projects. It is not recommended
|
14
|
+
that you change other extensions' source -- this makes it hard to take updates from
|
15
|
+
the original author. The following extensions are available:
|
16
|
+
|
17
|
+
FRAMEWORKS
|
18
|
+
|
19
|
+
Options:
|
20
|
+
}.strip.split("\n").map{|l| l.gsub(/^ {0,10}/,'')}.join("\n")
|
21
|
+
opts.banner.gsub!(/FRAMEWORKS/,Compass::Frameworks.pretty_print(true))
|
22
|
+
super
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
class UnpackExtension < ProjectBase
|
27
|
+
|
28
|
+
register :unpack
|
29
|
+
|
30
|
+
def initialize(working_path, options)
|
31
|
+
super
|
32
|
+
assert_project_directory_exists!
|
33
|
+
end
|
34
|
+
|
35
|
+
def perform
|
36
|
+
framework = Compass::Frameworks[options[:framework]]
|
37
|
+
files = Dir["#{framework.path}/**/*"]
|
38
|
+
extension_dir = File.join(Compass.configuration.extensions_path, framework.name)
|
39
|
+
FileUtils.rm_rf extension_dir
|
40
|
+
FileUtils.mkdir_p extension_dir
|
41
|
+
write_file File.join(extension_dir, "DO_NOT_MODIFY"), readme(framework)
|
42
|
+
files.each do |f|
|
43
|
+
next if File.directory?(f)
|
44
|
+
ending = f[(framework.path.size+1)..-1]
|
45
|
+
destination = File.join(extension_dir, ending)
|
46
|
+
FileUtils.mkdir_p(File.dirname(destination))
|
47
|
+
copy f, destination
|
48
|
+
end
|
49
|
+
puts "\nYou have unpacked \"#{framework.name}\""
|
50
|
+
puts
|
51
|
+
puts readme(framework)
|
52
|
+
end
|
53
|
+
|
54
|
+
def readme(framework)
|
55
|
+
%Q{| This is a copy of the "#{framework.name}" extension.
|
56
|
+
|
|
57
|
+
| It now overrides the original which was found here:
|
58
|
+
|
|
59
|
+
| #{framework.path}
|
60
|
+
|
|
61
|
+
| Unpacking an extension is useful when you need to easily peruse the
|
62
|
+
| extension's source. You might find yourself tempted to change the
|
63
|
+
| stylesheets here. If you do this, you'll find it harder to take
|
64
|
+
| updates from the original author. Sometimes this seems like a good
|
65
|
+
| idea at the time, but in a few months, you'll probably regret it.
|
66
|
+
|
|
67
|
+
| In the future, if you take an update of this framework, you'll need to run
|
68
|
+
|
|
69
|
+
| compass unpack #{framework.name}
|
70
|
+
|
|
71
|
+
| again or remove this unpacked extension.
|
72
|
+
|}.gsub(/^\s*\| ?/,"")
|
73
|
+
end
|
74
|
+
|
75
|
+
def skip_extension_discovery?
|
76
|
+
true
|
77
|
+
end
|
78
|
+
|
79
|
+
class << self
|
80
|
+
|
81
|
+
def option_parser(arguments)
|
82
|
+
parser = Compass::Exec::CommandOptionParser.new(arguments)
|
83
|
+
parser.extend(Compass::Exec::GlobalOptionsParser)
|
84
|
+
parser.extend(Compass::Exec::ProjectOptionsParser)
|
85
|
+
parser.extend(ExtensionOptionsParser)
|
86
|
+
end
|
87
|
+
|
88
|
+
def usage
|
89
|
+
option_parser([]).to_s
|
90
|
+
end
|
91
|
+
|
92
|
+
def description(command)
|
93
|
+
"Copy an extension into your extensions folder."
|
94
|
+
end
|
95
|
+
|
96
|
+
def parse!(arguments)
|
97
|
+
parser = option_parser(arguments)
|
98
|
+
parser.parse!
|
99
|
+
parse_arguments!(parser, arguments)
|
100
|
+
parser.options
|
101
|
+
end
|
102
|
+
|
103
|
+
def parse_arguments!(parser, arguments)
|
104
|
+
if arguments.size == 1
|
105
|
+
parser.options[:framework] = arguments.shift
|
106
|
+
elsif arguments.size == 0
|
107
|
+
raise Compass::Error, "Please specify an extension to unpack."
|
108
|
+
else
|
109
|
+
raise Compass::Error, "Too many arguments were specified."
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
end
|
114
|
+
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
data/lib/compass/frameworks.rb
CHANGED
@@ -7,10 +7,11 @@ module Compass
|
|
7
7
|
|
8
8
|
class Framework
|
9
9
|
attr_accessor :name
|
10
|
+
attr_accessor :path
|
10
11
|
attr_accessor :templates_directory, :stylesheets_directory
|
11
12
|
def initialize(name, *arguments)
|
12
13
|
options = arguments.last.is_a?(Hash) ? arguments.pop : {}
|
13
|
-
path = options[:path] || arguments.shift
|
14
|
+
self.path = path = options[:path] || arguments.shift
|
14
15
|
@name = name
|
15
16
|
@templates_directory = options[:templates_directory] || File.join(path, 'templates')
|
16
17
|
@stylesheets_directory = options[:stylesheets_directory] || File.join(path, 'stylesheets')
|
@@ -97,7 +98,7 @@ module Compass
|
|
97
98
|
end
|
98
99
|
end
|
99
100
|
|
100
|
-
def pretty_print
|
101
|
+
def pretty_print(skip_patterns = false)
|
101
102
|
result = ""
|
102
103
|
max = Compass::Frameworks::ALL.inject(0) do |gm, framework|
|
103
104
|
fm = framework.template_directories.inject(0) do |lm,pattern|
|
@@ -108,12 +109,14 @@ module Compass
|
|
108
109
|
Compass::Frameworks::ALL.each do |framework|
|
109
110
|
next if framework.name =~ /^_/
|
110
111
|
result << " * #{framework.name}\n"
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
112
|
+
unless skip_patterns
|
113
|
+
framework.template_directories.each do |pattern|
|
114
|
+
result << " - #{framework.name}/#{pattern}".ljust(max)
|
115
|
+
if description = framework.manifest(pattern).description
|
116
|
+
result << " - #{description}"
|
117
|
+
end
|
118
|
+
result << "\n"
|
115
119
|
end
|
116
|
-
result << "\n"
|
117
120
|
end
|
118
121
|
end
|
119
122
|
result
|
data/lib/compass/stats.rb
CHANGED
@@ -11,7 +11,7 @@ module Compass
|
|
11
11
|
def visit(node)
|
12
12
|
self.prop_count += 1 if node.is_a?(Sass::Tree::PropNode) && !node.children.any?
|
13
13
|
if node.is_a?(Sass::Tree::RuleNode)
|
14
|
-
self.rule_count += node.rule.map{|r| r.split(/,/)}.flatten.compact.size
|
14
|
+
self.rule_count += node.rule.reject{|r| r.is_a?(Sass::Script::Node)}.map{|r| r.split(/,/)}.flatten.compact.size
|
15
15
|
end
|
16
16
|
self.mixin_def_count += 1 if node.is_a?(Sass::Tree::MixinDefNode)
|
17
17
|
self.mixin_count += 1 if node.is_a?(Sass::Tree::MixinNode)
|
data/lib/compass/validator.rb
CHANGED
data/test/rails_helper.rb
CHANGED
@@ -19,13 +19,18 @@ module Compass
|
|
19
19
|
end
|
20
20
|
else
|
21
21
|
begin
|
22
|
-
require '
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
22
|
+
require 'action_pack/version'
|
23
|
+
if ActionPack::VERSION::MAJOR >= 3
|
24
|
+
`rails new #{name}`
|
25
|
+
else
|
26
|
+
require 'rails/version'
|
27
|
+
require 'rails_generator'
|
28
|
+
require 'rails_generator/scripts/generate'
|
29
|
+
Rails::Generator::Base.use_application_sources!
|
30
|
+
capture_output do
|
31
|
+
Rails::Generator::Base.logger = Rails::Generator::SimpleLogger.new $stdout
|
32
|
+
Rails::Generator::Scripts::Generate.new.run([name], :generator => 'app')
|
33
|
+
end
|
29
34
|
end
|
30
35
|
rescue LoadError
|
31
36
|
Kernel.exit!(2)
|
metadata
CHANGED
@@ -1,15 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: compass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 61
|
5
|
+
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 10
|
9
9
|
- 5
|
10
|
-
|
11
|
-
- 1
|
12
|
-
version: 0.10.5.pre.1
|
10
|
+
version: 0.10.5
|
13
11
|
platform: ruby
|
14
12
|
authors:
|
15
13
|
- Chris Eppstein
|
@@ -19,7 +17,7 @@ autorequire:
|
|
19
17
|
bindir: bin
|
20
18
|
cert_chain: []
|
21
19
|
|
22
|
-
date: 2010-08-
|
20
|
+
date: 2010-08-29 00:00:00 -07:00
|
23
21
|
default_executable: compass
|
24
22
|
dependencies:
|
25
23
|
- !ruby/object:Gem::Dependency
|
@@ -321,7 +319,6 @@ files:
|
|
321
319
|
- frameworks/compass/stylesheets/compass/css3/_text-shadow.scss
|
322
320
|
- frameworks/compass/stylesheets/compass/css3/_transform.scss
|
323
321
|
- frameworks/compass/stylesheets/compass/css3/_transition.scss
|
324
|
-
- frameworks/compass/stylesheets/compass/layout/_floated.scss
|
325
322
|
- frameworks/compass/stylesheets/compass/layout/_sticky-footer.scss
|
326
323
|
- frameworks/compass/stylesheets/compass/reset/_utilities.scss
|
327
324
|
- frameworks/compass/stylesheets/compass/utilities/_general.scss
|
@@ -392,6 +389,7 @@ files:
|
|
392
389
|
- lib/compass/commands/project_stats.rb
|
393
390
|
- lib/compass/commands/registry.rb
|
394
391
|
- lib/compass/commands/stamp_pattern.rb
|
392
|
+
- lib/compass/commands/unpack_extension.rb
|
395
393
|
- lib/compass/commands/update_project.rb
|
396
394
|
- lib/compass/commands/validate_project.rb
|
397
395
|
- lib/compass/commands/watch_project.rb
|
@@ -587,14 +585,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
587
585
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
588
586
|
none: false
|
589
587
|
requirements:
|
590
|
-
- - "
|
588
|
+
- - ">="
|
591
589
|
- !ruby/object:Gem::Version
|
592
|
-
hash:
|
590
|
+
hash: 3
|
593
591
|
segments:
|
594
|
-
-
|
595
|
-
|
596
|
-
- 1
|
597
|
-
version: 1.3.1
|
592
|
+
- 0
|
593
|
+
version: "0"
|
598
594
|
requirements: []
|
599
595
|
|
600
596
|
rubyforge_project:
|
@@ -1,111 +0,0 @@
|
|
1
|
-
@import "compass/utilities/general/float";
|
2
|
-
@import "compass/utilities/general/clearfix";
|
3
|
-
|
4
|
-
// Direction of the float
|
5
|
-
$compass-float-direction: left !default;
|
6
|
-
// Set to 0 to disable gutters
|
7
|
-
$compass-gutter-width: 10px !default;
|
8
|
-
$compass-left-gutter-width: ceil($compass-gutter-width / 2);
|
9
|
-
$compass-right-gutter-width: floor($compass-gutter-width / 2);
|
10
|
-
|
11
|
-
// A floated element is generally assigned a width to achieve table-less alignment
|
12
|
-
@mixin floated($side : $compass-float-direction,
|
13
|
-
$left-gutter : $compass-left-gutter-width,
|
14
|
-
$right-gutter : $compass-right-gutter-width) {
|
15
|
-
@include float($side);
|
16
|
-
@if $left-gutter > 0 {
|
17
|
-
margin-left: $left-gutter;
|
18
|
-
}
|
19
|
-
@if $right-gutter > 0 {
|
20
|
-
margin-right: $right-gutter;
|
21
|
-
}
|
22
|
-
}
|
23
|
-
|
24
|
-
// Remove the gutter for a particular side of a floated element
|
25
|
-
// pass `both` to disable the gutter on both sides.
|
26
|
-
@mixin gutterless($side) {
|
27
|
-
margin-#{$side}: 0;
|
28
|
-
@if $side == both {
|
29
|
-
margin-#{opposite-position($side)}: 0;
|
30
|
-
}
|
31
|
-
}
|
32
|
-
|
33
|
-
// provides the base structure required to make an element pushable in
|
34
|
-
// the specified direction (which defaults to `right`).
|
35
|
-
@mixin pushable($side: opposite-position($compass-float-direction)) {
|
36
|
-
@include float($side);
|
37
|
-
position: relative;
|
38
|
-
}
|
39
|
-
|
40
|
-
// provides the base structure required to make an element pullable in
|
41
|
-
// the specified direction (which defaults to `left`).
|
42
|
-
@mixin pullable($side : $compass-float-direction) {
|
43
|
-
@include float($side);
|
44
|
-
position: relative;
|
45
|
-
}
|
46
|
-
|
47
|
-
// push an element in the specified direction by the specified amount.
|
48
|
-
@mixin pushed($side, $amount) {
|
49
|
-
margin-#{$side}: -$amount;
|
50
|
-
margin-#{opposite-position($side)}: $amount;
|
51
|
-
}
|
52
|
-
|
53
|
-
// pull an element in the specified directionn by the specified amount.
|
54
|
-
@mixin pulled($side, $amount) {
|
55
|
-
margin-#{$side}: $amount;
|
56
|
-
}
|
57
|
-
|
58
|
-
// Take an element out of the float if it had been made floated already.
|
59
|
-
// This might be applied to an element to allow it to fill the remainder
|
60
|
-
// of a row, in which case you'll probably want to make that element also
|
61
|
-
// a float container.
|
62
|
-
@mixin sunken {
|
63
|
-
float: none;
|
64
|
-
width: auto;
|
65
|
-
margin-left: auto;
|
66
|
-
margin-right: auto;
|
67
|
-
}
|
68
|
-
|
69
|
-
// make an element centered within its fixed-width parent.
|
70
|
-
// Can be applied to a top level float container to create
|
71
|
-
// a centered layout within the window.
|
72
|
-
@mixin centered {
|
73
|
-
margin-left: auto;
|
74
|
-
margin-right: auto;
|
75
|
-
}
|
76
|
-
|
77
|
-
@mixin act-like-blueprint {
|
78
|
-
.clearfixed { @include pie-clearfix; }
|
79
|
-
.column { @include floated(left, 0, $compass-gutter-width); }
|
80
|
-
.last { @include gutterless(right); }
|
81
|
-
.float-container { @extend .clearfixed; }
|
82
|
-
.container { @extend .float-container; @include centered; }
|
83
|
-
.push { @include pushable; }
|
84
|
-
.pull { @include pullable; }
|
85
|
-
}
|
86
|
-
|
87
|
-
@mixin act-like-960 {
|
88
|
-
.clearfixed { @include pie-clearfix; }
|
89
|
-
.grid { @include floated(left, $compass-gutter-left-width, $compass-gutter-right-width); }
|
90
|
-
.alpha { @include gutterless(left); }
|
91
|
-
.omega { @include gutterless(right); }
|
92
|
-
.container { @extend .clearfixed; }
|
93
|
-
.grid-container { @extend .container; @include centered; }
|
94
|
-
.push { @include pushable; }
|
95
|
-
.pull { @include pullable; }
|
96
|
-
}
|
97
|
-
|
98
|
-
@mixin act-like-oocss {
|
99
|
-
.clearfixed { @include pie-clearfix; }
|
100
|
-
.line { @extend .clearfixed; }
|
101
|
-
.unit { @include floated(left, 0, 0); }
|
102
|
-
.lastUnit { @extend .clearfixed; @include sunken; }
|
103
|
-
.size1of1 { @include sunken; }
|
104
|
-
|
105
|
-
@for $divisions from 2 through 5 {
|
106
|
-
@for $segment from 1 to $divisions {
|
107
|
-
.size#{$segment}of#{$divisions} { width: percentage($segment / $divisions); }
|
108
|
-
}
|
109
|
-
}
|
110
|
-
}
|
111
|
-
|