compass 0.10.3 → 0.10.4.pre.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +2 -2
- data/frameworks/compass/stylesheets/compass/utilities/text/_replacement.scss +3 -1
- data/lib/compass/commands/stamp_pattern.rb +1 -1
- data/lib/compass/installers/base.rb +1 -1
- data/lib/compass/installers/manifest.rb +54 -10
- data/lib/compass/sass_extensions/functions/urls.rb +28 -9
- data/test/fixtures/stylesheets/compass/css/fonts.css +3 -0
- data/test/fixtures/stylesheets/compass/sass/fonts.sass +3 -0
- metadata +15 -10
- data/frameworks/rails/stylesheets/_rails.scss +0 -1
- data/frameworks/rails/stylesheets/rails/_pagination.scss +0 -1
- data/frameworks/rails/stylesheets/rails/_scaffolding.scss +0 -56
data/VERSION.yml
CHANGED
@@ -26,7 +26,9 @@
|
|
26
26
|
|
27
27
|
// Hides text in an element so you can see the background.
|
28
28
|
@mixin hide-text {
|
29
|
-
|
29
|
+
$approximate_em_value: 12px / 1em;
|
30
|
+
$wider_than_any_screen: -9999em;
|
31
|
+
text-indent: $wider_than_any_screen * $approximate_em_value;
|
30
32
|
overflow: hidden;
|
31
33
|
text-align: left;
|
32
34
|
}
|
@@ -72,7 +72,7 @@ Options:
|
|
72
72
|
# all commands must implement perform
|
73
73
|
def perform
|
74
74
|
installer.init
|
75
|
-
installer.run(:skip_finalization => true)
|
75
|
+
installer.run(:skip_finalization => true, :skip_preparation => !is_project_creation?)
|
76
76
|
UpdateProject.new(working_path, options).perform if installer.compilation_required?
|
77
77
|
installer.finalize(options.merge(:create => is_project_creation?))
|
78
78
|
end
|
@@ -29,7 +29,7 @@ module Compass
|
|
29
29
|
# Every installer must conform to the installation strategy of prepare, install, and then finalize.
|
30
30
|
# A default implementation is provided for each step.
|
31
31
|
def run(run_options = {})
|
32
|
-
prepare
|
32
|
+
prepare unless run_options[:skip_preparation]
|
33
33
|
install unless options[:prepare]
|
34
34
|
finalize(options.merge(run_options)) unless options[:prepare] || run_options[:skip_finalization]
|
35
35
|
end
|
@@ -20,7 +20,19 @@ module Compass
|
|
20
20
|
parse(manifest_file) if manifest_file
|
21
21
|
end
|
22
22
|
|
23
|
-
def self.
|
23
|
+
def self.known_extensions
|
24
|
+
@known_extensions ||= {}
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.plural_types
|
28
|
+
@plural_types ||= {}
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.type(t, options = {})
|
32
|
+
Array(options[:extensions]).each do |ext|
|
33
|
+
self.known_extensions[ext] = t
|
34
|
+
end
|
35
|
+
self.plural_types[options[:plural]] = t if options[:plural]
|
24
36
|
eval <<-END
|
25
37
|
def #{t}(from, options = {})
|
26
38
|
@entries << Entry.new(:#{t}, from, options)
|
@@ -34,13 +46,35 @@ module Compass
|
|
34
46
|
END
|
35
47
|
end
|
36
48
|
|
37
|
-
type :stylesheet
|
38
|
-
type :image
|
39
|
-
type :javascript
|
40
|
-
type :font
|
41
|
-
type :
|
42
|
-
type :
|
43
|
-
type :directory
|
49
|
+
type :stylesheet, :plural => :stylesheets, :extensions => %w(scss sass)
|
50
|
+
type :image, :plural => :images, :extensions => %w(png gif jpg jpeg tiff gif)
|
51
|
+
type :javascript, :plural => :javascripts, :extensions => %w(js)
|
52
|
+
type :font, :plural => :fonts, :extensions => %w(otf woff ttf)
|
53
|
+
type :html, :plural => :html, :extensions => %w(html haml)
|
54
|
+
type :file, :plural => :files
|
55
|
+
type :directory, :plural => :directories
|
56
|
+
|
57
|
+
def discover(type)
|
58
|
+
type = self.class.plural_types[type] || type
|
59
|
+
dir = File.dirname(@manifest_file)
|
60
|
+
Dir.glob("#{dir}/**/*").each do |file|
|
61
|
+
next if /manifest\.rb/ =~ file
|
62
|
+
short_name = file[(dir.length+1)..-1]
|
63
|
+
options = {}
|
64
|
+
ext = if File.extname(short_name) == ".erb"
|
65
|
+
options[:erb] = true
|
66
|
+
File.extname(short_name[0..-5])
|
67
|
+
else
|
68
|
+
File.extname(short_name)
|
69
|
+
end[1..-1]
|
70
|
+
file_type = self.class.known_extensions[ext]
|
71
|
+
file_type = :file if file_type.nil?
|
72
|
+
file_type = :directory if File.directory?(file)
|
73
|
+
if type == :all || type == file_type
|
74
|
+
send(file_type, short_name, options)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
44
78
|
|
45
79
|
def help(value = nil)
|
46
80
|
if value
|
@@ -96,13 +130,23 @@ module Compass
|
|
96
130
|
@compile_after_generation = false
|
97
131
|
end
|
98
132
|
|
133
|
+
def with_manifest(manifest_file)
|
134
|
+
@manifest_file = manifest_file
|
135
|
+
yield
|
136
|
+
ensure
|
137
|
+
@manifest_file = nil
|
138
|
+
end
|
139
|
+
|
99
140
|
# parses a manifest file which is a ruby script
|
100
141
|
# evaluated in a Manifest instance context
|
101
142
|
def parse(manifest_file)
|
102
|
-
|
103
|
-
|
143
|
+
with_manifest(manifest_file) do
|
144
|
+
open(manifest_file) do |f|
|
145
|
+
eval(f.read, instance_binding, manifest_file)
|
146
|
+
end
|
104
147
|
end
|
105
148
|
end
|
149
|
+
|
106
150
|
def instance_binding
|
107
151
|
binding
|
108
152
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Compass::SassExtensions::Functions::Urls
|
2
2
|
|
3
|
-
def stylesheet_url(path)
|
3
|
+
def stylesheet_url(path, only_path = Sass::Script::Bool.new(false))
|
4
4
|
# Compute the path to the stylesheet, either root relative or stylesheet relative
|
5
5
|
# or nil if the http_images_path is not set in the configuration.
|
6
6
|
http_stylesheets_path = if relative?
|
@@ -11,10 +11,15 @@ module Compass::SassExtensions::Functions::Urls
|
|
11
11
|
Compass.configuration.http_root_relative(Compass.configuration.css_dir)
|
12
12
|
end
|
13
13
|
|
14
|
-
|
14
|
+
path = "#{http_stylesheets_path}/#{path}"
|
15
|
+
if only_path.to_bool
|
16
|
+
Sass::Script::String.new(clean_path(path))
|
17
|
+
else
|
18
|
+
clean_url(path)
|
19
|
+
end
|
15
20
|
end
|
16
21
|
|
17
|
-
def font_url(path)
|
22
|
+
def font_url(path, only_path = Sass::Script::Bool.new(false))
|
18
23
|
path = path.value # get to the string value of the literal.
|
19
24
|
|
20
25
|
# Short curcuit if they have provided an absolute url.
|
@@ -30,10 +35,16 @@ module Compass::SassExtensions::Functions::Urls
|
|
30
35
|
Compass.configuration.http_fonts_path
|
31
36
|
end
|
32
37
|
|
33
|
-
|
38
|
+
path = "#{http_fonts_path}/#{path}"
|
39
|
+
|
40
|
+
if only_path.to_bool
|
41
|
+
Sass::Script::String.new(clean_path(path))
|
42
|
+
else
|
43
|
+
clean_url(path)
|
44
|
+
end
|
34
45
|
end
|
35
46
|
|
36
|
-
def image_url(path)
|
47
|
+
def image_url(path, only_path = Sass::Script::Bool.new(false))
|
37
48
|
path = path.value # get to the string value of the literal.
|
38
49
|
|
39
50
|
if path =~ %r{^#{Regexp.escape(Compass.configuration.http_images_path)}/(.*)}
|
@@ -79,16 +90,24 @@ module Compass::SassExtensions::Functions::Urls
|
|
79
90
|
# prepend the asset host if there is one.
|
80
91
|
path = "#{asset_host}#{'/' unless path[0..0] == "/"}#{path}" if asset_host
|
81
92
|
|
82
|
-
|
93
|
+
if only_path.to_bool
|
94
|
+
Sass::Script::String.new(clean_path(path))
|
95
|
+
else
|
96
|
+
clean_url(path)
|
97
|
+
end
|
83
98
|
end
|
84
99
|
|
85
100
|
private
|
86
101
|
|
87
|
-
# Emits a
|
88
|
-
def
|
102
|
+
# Emits a path, taking off any leading "./"
|
103
|
+
def clean_path(url)
|
89
104
|
url = url.to_s
|
90
105
|
url = url[0..1] == "./" ? url[2..-1] : url
|
91
|
-
|
106
|
+
end
|
107
|
+
|
108
|
+
# Emits a url, taking off any leading "./"
|
109
|
+
def clean_url(url)
|
110
|
+
Sass::Script::String.new("url('#{clean_path(url)}')")
|
92
111
|
end
|
93
112
|
|
94
113
|
def relative?
|
metadata
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: compass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
4
|
+
prerelease: true
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 10
|
8
|
-
-
|
9
|
-
|
8
|
+
- 4
|
9
|
+
- pre
|
10
|
+
- 2
|
11
|
+
version: 0.10.4.pre.2
|
10
12
|
platform: ruby
|
11
13
|
authors:
|
12
14
|
- Chris Eppstein
|
@@ -16,7 +18,7 @@ autorequire:
|
|
16
18
|
bindir: bin
|
17
19
|
cert_chain: []
|
18
20
|
|
19
|
-
date: 2010-08-
|
21
|
+
date: 2010-08-05 00:00:00 -07:00
|
20
22
|
default_executable: compass
|
21
23
|
dependencies:
|
22
24
|
- !ruby/object:Gem::Dependency
|
@@ -356,9 +358,6 @@ files:
|
|
356
358
|
- frameworks/compass/templates/project/print.sass
|
357
359
|
- frameworks/compass/templates/project/screen.sass
|
358
360
|
- frameworks/compass/templates/project/USAGE.markdown
|
359
|
-
- frameworks/rails/stylesheets/_rails.scss
|
360
|
-
- frameworks/rails/stylesheets/rails/_pagination.scss
|
361
|
-
- frameworks/rails/stylesheets/rails/_scaffolding.scss
|
362
361
|
- lib/compass/actions.rb
|
363
362
|
- lib/compass/app_integration/merb/runtime.rb
|
364
363
|
- lib/compass/app_integration/merb.rb
|
@@ -511,6 +510,7 @@ files:
|
|
511
510
|
- test/fixtures/stylesheets/compass/config.rb
|
512
511
|
- test/fixtures/stylesheets/compass/css/border_radius.css
|
513
512
|
- test/fixtures/stylesheets/compass/css/box.css
|
513
|
+
- test/fixtures/stylesheets/compass/css/fonts.css
|
514
514
|
- test/fixtures/stylesheets/compass/css/gradients.css
|
515
515
|
- test/fixtures/stylesheets/compass/css/image_size.css
|
516
516
|
- test/fixtures/stylesheets/compass/css/images.css
|
@@ -527,6 +527,7 @@ files:
|
|
527
527
|
- test/fixtures/stylesheets/compass/images/4x6.png
|
528
528
|
- test/fixtures/stylesheets/compass/sass/border_radius.scss
|
529
529
|
- test/fixtures/stylesheets/compass/sass/box.sass
|
530
|
+
- test/fixtures/stylesheets/compass/sass/fonts.sass
|
530
531
|
- test/fixtures/stylesheets/compass/sass/gradients.sass
|
531
532
|
- test/fixtures/stylesheets/compass/sass/image_size.sass
|
532
533
|
- test/fixtures/stylesheets/compass/sass/images.scss
|
@@ -573,11 +574,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
573
574
|
version: "0"
|
574
575
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
575
576
|
requirements:
|
576
|
-
- - "
|
577
|
+
- - ">"
|
577
578
|
- !ruby/object:Gem::Version
|
578
579
|
segments:
|
579
|
-
-
|
580
|
-
|
580
|
+
- 1
|
581
|
+
- 3
|
582
|
+
- 1
|
583
|
+
version: 1.3.1
|
581
584
|
requirements: []
|
582
585
|
|
583
586
|
rubyforge_project:
|
@@ -645,6 +648,7 @@ test_files:
|
|
645
648
|
- test/fixtures/stylesheets/compass/config.rb
|
646
649
|
- test/fixtures/stylesheets/compass/css/border_radius.css
|
647
650
|
- test/fixtures/stylesheets/compass/css/box.css
|
651
|
+
- test/fixtures/stylesheets/compass/css/fonts.css
|
648
652
|
- test/fixtures/stylesheets/compass/css/gradients.css
|
649
653
|
- test/fixtures/stylesheets/compass/css/image_size.css
|
650
654
|
- test/fixtures/stylesheets/compass/css/images.css
|
@@ -661,6 +665,7 @@ test_files:
|
|
661
665
|
- test/fixtures/stylesheets/compass/images/4x6.png
|
662
666
|
- test/fixtures/stylesheets/compass/sass/border_radius.scss
|
663
667
|
- test/fixtures/stylesheets/compass/sass/box.sass
|
668
|
+
- test/fixtures/stylesheets/compass/sass/fonts.sass
|
664
669
|
- test/fixtures/stylesheets/compass/sass/gradients.sass
|
665
670
|
- test/fixtures/stylesheets/compass/sass/image_size.sass
|
666
671
|
- test/fixtures/stylesheets/compass/sass/images.scss
|
@@ -1 +0,0 @@
|
|
1
|
-
@import "rails/pagination";
|
@@ -1 +0,0 @@
|
|
1
|
-
// TODO
|
@@ -1,56 +0,0 @@
|
|
1
|
-
body { background-color: #fff; color: #333; }
|
2
|
-
|
3
|
-
body, p, ol, ul, td {
|
4
|
-
font-family: verdana, arial, helvetica, sans-serif;
|
5
|
-
font-size: 13px;
|
6
|
-
line-height: 18px;
|
7
|
-
}
|
8
|
-
|
9
|
-
pre {
|
10
|
-
background-color: #eee;
|
11
|
-
padding: 10px;
|
12
|
-
font-size: 11px;
|
13
|
-
}
|
14
|
-
|
15
|
-
a { color: #000; }
|
16
|
-
a:visited { color: #666; }
|
17
|
-
a:hover { color: #fff; background-color:#000; }
|
18
|
-
|
19
|
-
div.field, div.actions {
|
20
|
-
margin-bottom: 10px;
|
21
|
-
}
|
22
|
-
|
23
|
-
#notice {
|
24
|
-
color: green;
|
25
|
-
}
|
26
|
-
|
27
|
-
.field_with_errors {
|
28
|
-
padding: 2px;
|
29
|
-
background-color: red;
|
30
|
-
display: table;
|
31
|
-
}
|
32
|
-
|
33
|
-
#error_explanation {
|
34
|
-
width: 450px;
|
35
|
-
border: 2px solid red;
|
36
|
-
padding: 7px;
|
37
|
-
padding-bottom: 0;
|
38
|
-
margin-bottom: 20px;
|
39
|
-
background-color: #f0f0f0;
|
40
|
-
|
41
|
-
h2 {
|
42
|
-
text-align: left;
|
43
|
-
font-weight: bold;
|
44
|
-
padding: 5px 5px 5px 15px;
|
45
|
-
font-size: 12px;
|
46
|
-
margin: -7px;
|
47
|
-
margin-bottom: 0px;
|
48
|
-
background-color: #c00;
|
49
|
-
color: #fff;
|
50
|
-
}
|
51
|
-
|
52
|
-
ul li {
|
53
|
-
font-size: 12px;
|
54
|
-
list-style: square;
|
55
|
-
}
|
56
|
-
}
|