chriseppstein-compass 0.5.5 → 0.5.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. data/Manifest +17 -3
  2. data/VERSION +1 -1
  3. data/compass.gemspec +4 -4
  4. data/examples/blueprint_plugins/images/buttons/cross.png +0 -0
  5. data/examples/blueprint_plugins/images/buttons/key.png +0 -0
  6. data/examples/blueprint_plugins/images/buttons/tick.png +0 -0
  7. data/examples/blueprint_plugins/index.html +7 -0
  8. data/examples/blueprint_plugins/parts/buttons.html +59 -0
  9. data/examples/blueprint_plugins/src/buttons.sass +49 -0
  10. data/examples/compass/src/utilities.sass +34 -2
  11. data/examples/compass/utilities.html.haml +45 -1
  12. data/frameworks/blueprint/stylesheets/blueprint/_ie.sass +3 -1
  13. data/frameworks/blueprint/stylesheets/blueprint/_print.sass +2 -1
  14. data/frameworks/blueprint/stylesheets/blueprint/modules/_buttons.sass +84 -0
  15. data/frameworks/blueprint/stylesheets/blueprint/modules/_grid.sass +6 -4
  16. data/frameworks/blueprint/stylesheets/blueprint/modules/_liquid.sass +3 -3
  17. data/frameworks/blueprint/stylesheets/blueprint/modules/_typography.sass +3 -2
  18. data/frameworks/blueprint/stylesheets/blueprint/modules/_utilities.sass +1 -1
  19. data/frameworks/blueprint/templates/buttons/buttons.sass +49 -0
  20. data/frameworks/blueprint/templates/buttons/buttons/cross.png +0 -0
  21. data/frameworks/blueprint/templates/buttons/buttons/key.png +0 -0
  22. data/frameworks/blueprint/templates/buttons/buttons/tick.png +0 -0
  23. data/frameworks/blueprint/templates/buttons/manifest.rb +5 -0
  24. data/frameworks/compass/stylesheets/compass/utilities/_general.sass +2 -0
  25. data/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.sass +23 -10
  26. data/frameworks/compass/stylesheets/compass/utilities/general/_float.sass +17 -0
  27. data/frameworks/compass/stylesheets/compass/utilities/general/_hacks.sass +6 -0
  28. data/frameworks/compass/stylesheets/compass/utilities/lists/_horizontal_list.sass +2 -2
  29. data/frameworks/yui/stylesheets/yui/modules/_grids.sass +1 -1
  30. data/lib/compass/actions.rb +2 -3
  31. data/lib/compass/commands/create_project.rb +5 -26
  32. data/lib/compass/commands/generate_grid_background.rb +27 -0
  33. data/lib/compass/commands/project_base.rb +4 -0
  34. data/lib/compass/commands/stamp_pattern.rb +45 -0
  35. data/lib/compass/commands/validate_project.rb +21 -0
  36. data/lib/compass/configuration.rb +4 -0
  37. data/lib/compass/exec.rb +23 -0
  38. data/{frameworks/blueprint/lib/blueprint → lib/compass}/grid_builder.rb +26 -8
  39. data/lib/compass/installers/base.rb +20 -2
  40. data/lib/compass/installers/manifest.rb +1 -0
  41. data/lib/compass/installers/rails.rb +2 -3
  42. data/lib/compass/installers/stand_alone.rb +2 -6
  43. data/lib/compass/validator.rb +19 -22
  44. data/test/fixtures/stylesheets/blueprint/css/typography.css +2 -0
  45. data/test/fixtures/stylesheets/compass/css/utilities.css +13 -2
  46. data/test/fixtures/stylesheets/compass/sass/utilities.sass +3 -2
  47. metadata +23 -6
  48. data/frameworks/blueprint/lib/blueprint/constants.rb +0 -17
  49. data/lib/compass/validate.rb +0 -13
data/lib/compass/exec.rb CHANGED
@@ -158,6 +158,19 @@ END
158
158
  exit
159
159
  end
160
160
 
161
+ opts.on('--validate', :NONE, 'Validate your project\'s compiled css') do
162
+ self.options[:command] = :validate_project
163
+ end
164
+
165
+ opts.on('-p', '--pattern PATTERN', 'Stamp out a pattern into the current project. Must be used in combination with -f.') do |pattern|
166
+ self.options[:command] = :stamp_pattern
167
+ self.options[:pattern] = pattern
168
+ end
169
+
170
+ opts.on('-n', '--pattern-name NAME', 'The name to use when stamping a pattern. Must be used in combination with -p.') do |name|
171
+ self.options[:pattern_name] = name
172
+ end
173
+
161
174
  opts.on_tail("-?", "-h", "--help", "Show this message") do
162
175
  puts opts
163
176
  exit
@@ -166,6 +179,16 @@ END
166
179
  opts.on_tail("-v", "--version", "Print version") do
167
180
  self.options[:command] = :print_version
168
181
  end
182
+
183
+ opts.on('--grid-img [DIMENSIONS]', 'Generate a background image to test grid alignment. Dimension is given as <column_width>+<gutter_width>. Defaults to 30+10.') do |dimensions|
184
+ self.options[:grid_dimensions] = dimensions || "30+10"
185
+ unless self.options[:grid_dimensions] =~ /^\d+\+\d+$/
186
+ puts "Please enter your dimensions as <column_width>+<gutter_width>. E.g. 20+5 or 30+10."
187
+ exit
188
+ end
189
+ self.options[:command] = :generate_grid_background
190
+ end
191
+
169
192
  end
170
193
 
171
194
  def do_command(command)
@@ -1,3 +1,4 @@
1
+ # This file came from the Blueprint Project
1
2
  begin
2
3
  require 'rubygems'
3
4
  gem 'rmagick'
@@ -5,15 +6,17 @@ begin
5
6
  rescue Exception => e
6
7
  end
7
8
 
8
- module Blueprint
9
+ module Compass
9
10
  # Uses ImageMagick and RMagick to generate grid.png file
10
11
  class GridBuilder
12
+ include Actions
13
+
11
14
  begin
12
15
  include Magick
13
16
  rescue Exception => e
14
17
  end
15
18
 
16
- attr_reader :column_width, :gutter_width, :output_path, :able_to_generate
19
+ attr_reader :column_width, :gutter_width, :output_path, :able_to_generate, :options
17
20
 
18
21
  # ==== Options
19
22
  # * <tt>options</tt>
@@ -23,9 +26,14 @@ module Blueprint
23
26
  def initialize(options={})
24
27
  @able_to_generate = Magick::Long_version rescue false
25
28
  return unless @able_to_generate
26
- @column_width = options[:column_width] || Blueprint::COLUMN_WIDTH
27
- @gutter_width = options[:gutter_width] || Blueprint::GUTTER_WIDTH
28
- @output_path = options[:output_path] || Blueprint::SOURCE_PATH
29
+ @column_width = options[:column_width]
30
+ @gutter_width = options[:gutter_width]
31
+ @output_path = options[:output_path]
32
+ @options = options
33
+ end
34
+
35
+ def working_path
36
+ options[:working_path]
29
37
  end
30
38
 
31
39
  # generates (overwriting if necessary) grid.png image to be tiled in background
@@ -46,9 +54,19 @@ module Blueprint
46
54
  baseline.line(0, (height - 1), total_width, (height- 1)).styles(:fill => "#e9e9e9")
47
55
  end
48
56
  end
49
-
50
- FileUtils.mkdir self.output_path unless File.exists? self.output_path
51
- rvg.draw.write(File.join(self.output_path, "grid.png"))
57
+
58
+ filename = File.join(self.output_path, "grid.png")
59
+ if File.exists?(filename)
60
+ if options[:force]
61
+ overwrite = true
62
+ else
63
+ msg = "#{filename} already exists. Overwrite with --force."
64
+ raise Compass::FilesystemConflict.new(msg)
65
+ end
66
+ end
67
+ directory self.output_path
68
+ logger.record((overwrite ? :overwrite : :create), basename(filename))
69
+ rvg.draw.write(filename)
52
70
  end
53
71
  end
54
72
  end
@@ -26,6 +26,18 @@ module Compass
26
26
 
27
27
  # Initializes the project to work with compass
28
28
  def init
29
+ dirs = manifest.map do |entry|
30
+ File.dirname(send("install_location_for_#{entry.type}", entry.to))
31
+ end
32
+
33
+ if manifest.has_stylesheet?
34
+ dirs << sass_dir
35
+ dirs << css_dir
36
+ end
37
+
38
+ dirs.uniq.sort.each do |dir|
39
+ directory targetize(dir)
40
+ end
29
41
  end
30
42
 
31
43
  # Runs the installer.
@@ -81,6 +93,10 @@ module Compass
81
93
  false
82
94
  end
83
95
 
96
+ def pattern_name_as_dir
97
+ "#{options[:pattern_name]}/" if options[:pattern_name]
98
+ end
99
+
84
100
  def self.installer(type, &locator)
85
101
  locator ||= lambda{|to| to}
86
102
  loc_method = "install_location_for_#{type}".to_sym
@@ -91,7 +107,7 @@ module Compass
91
107
  end
92
108
 
93
109
  installer :stylesheet do |to|
94
- "#{sass_dir}/#{to}"
110
+ "#{sass_dir}/#{pattern_name_as_dir}#{to}"
95
111
  end
96
112
 
97
113
  installer :image do |to|
@@ -102,7 +118,9 @@ module Compass
102
118
  "#{javascripts_dir}/#{to}"
103
119
  end
104
120
 
105
- installer :file
121
+ installer :file do |to|
122
+ "#{pattern_name_as_dir}#{to}"
123
+ end
106
124
 
107
125
  # returns an absolute path given a path relative to the current installation target.
108
126
  # Paths can use unix style "/" and will be corrected for the current platform.
@@ -2,6 +2,7 @@ module Compass
2
2
  module Installers
3
3
 
4
4
  class Manifest
5
+ include Enumerable
5
6
 
6
7
  # A Manifest entry
7
8
  class Entry < Struct.new(:type, :from, :options)
@@ -16,12 +16,11 @@ module Compass
16
16
  def init
17
17
  set_sass_dir unless sass_dir
18
18
  set_css_dir unless css_dir
19
- directory targetize(css_dir)
20
- directory targetize(sass_dir)
21
- write_file targetize('config/initializers/compass.rb'), initializer_contents
19
+ super
22
20
  end
23
21
 
24
22
  def prepare
23
+ write_file targetize('config/initializers/compass.rb'), initializer_contents
25
24
  end
26
25
 
27
26
  def finalize(options = {})
@@ -14,13 +14,10 @@ module Compass
14
14
 
15
15
  def init
16
16
  directory targetize("")
17
- directory targetize(css_dir)
18
- directory targetize(sass_dir)
17
+ super
19
18
  end
20
19
 
21
20
  def prepare
22
- directory targetize(images_dir) if manifest.has_image?
23
- directory targetize(javascripts_dir) if manifest.has_javascript?
24
21
  end
25
22
 
26
23
  def default_css_dir
@@ -61,10 +58,9 @@ This can be done in one of the following ways:
61
58
  compass -u path/to/project
62
59
  3. To monitor your project for changes and automatically recompile:
63
60
  compass --watch [path/to/project]
64
-
65
61
  NEXTSTEPS
66
62
  end
67
- puts "To import your new stylesheets add the following lines of HTML (or equivalent) to your webpage:"
63
+ puts "\nTo import your new stylesheets add the following lines of HTML (or equivalent) to your webpage:"
68
64
  puts stylesheet_links
69
65
  end
70
66
 
@@ -1,13 +1,14 @@
1
1
  require File.join(File.dirname(__FILE__), 'core_ext')
2
- require File.join(File.dirname(__FILE__), 'constants')
3
2
 
4
3
  module Compass
5
4
  # Validates generated CSS against the W3 using Java
6
5
  class Validator
7
6
  VALIDATOR_FILE = File.join(File.dirname(__FILE__), 'validate', 'css-validator.jar')
8
7
  attr_reader :error_count
8
+ attr_reader :css_directory
9
9
 
10
- def initialize
10
+ def initialize(css_directory)
11
+ @css_directory = css_directory
11
12
  @error_count = 0
12
13
  end
13
14
 
@@ -18,12 +19,8 @@ module Compass
18
19
 
19
20
  output_header
20
21
 
21
- Dir.new(Compass::Constants::BLUEPRINT_ROOT_PATH).each do |file_name|
22
- puts "#{file_name}"
23
- if file_name =~ /\.css$/
24
- css_file = File.join(Compass::Constants::BLUEPRINT_ROOT_PATH, file_name)
25
- @error_count += 1 if !validate_css_file(java_path, css_file)
26
- end
22
+ Dir.glob(File.join(css_directory, "**", "*.css")).each do |file_name|
23
+ @error_count += 1 if !validate_css_file(java_path, file_name)
27
24
  end
28
25
 
29
26
  output_footer
@@ -31,29 +28,29 @@ module Compass
31
28
 
32
29
  private
33
30
  def validate_css_file(java_path, css_file)
34
- puts "\n\n Testing #{css_file}"
35
- puts " Output ============================================================\n\n"
31
+ puts "\n\nTesting #{css_file}"
32
+ puts "Output ============================================================\n\n"
36
33
  system("#{java_path} -jar '#{VALIDATOR_FILE}' -e '#{css_file}'")
37
34
  end
38
35
 
39
36
  def output_header
40
37
  puts "\n\n"
41
- puts " ************************************************************"
42
- puts " **"
43
- puts " ** Compass CSS Validator"
44
- puts " ** Validates output CSS files"
45
- puts " **"
46
- puts " ************************************************************"
38
+ puts "************************************************************"
39
+ puts "**"
40
+ puts "** Compass CSS Validator"
41
+ puts "** Validates output CSS files"
42
+ puts "**"
43
+ puts "************************************************************"
47
44
  end
48
45
 
49
46
  def output_footer
50
47
  puts "\n\n"
51
- puts " ************************************************************"
52
- puts " **"
53
- puts " ** Done!"
54
- puts " ** Your CSS files are#{" not" if error_count > 0} valid.#{" You had #{error_count} error(s) within your files" if error_count > 0}"
55
- puts " **"
56
- puts " ************************************************************"
48
+ puts "************************************************************"
49
+ puts "**"
50
+ puts "** Done!"
51
+ puts "** Your CSS files are#{" not" if error_count > 0} valid.#{" You had #{error_count} error(s) within your files" if error_count > 0}"
52
+ puts "**"
53
+ puts "************************************************************"
57
54
  end
58
55
  end
59
56
  end
@@ -53,10 +53,12 @@ h2 img, h3 img, h4 img, h5 img, h6 img {
53
53
  p {
54
54
  margin: 0 0 1.5em; }
55
55
  p img {
56
+ display: inline;
56
57
  float: left;
57
58
  margin: 1.5em 1.5em 1.5em 0;
58
59
  padding: 0; }
59
60
  p img.right {
61
+ display: inline;
60
62
  float: right;
61
63
  margin: 1.5em 0 1.5em 1.5em; }
62
64
 
@@ -1,6 +1,17 @@
1
1
  .clearfix {
2
- overflow: auto;
3
- overflow: -moz-scrollbars-none;
2
+ overflow: hidden;
4
3
  display: inline-block; }
5
4
  .clearfix {
6
5
  display: block; }
6
+
7
+ .pie-clearfix {
8
+ display: inline-block; }
9
+ .pie-clearfix:after {
10
+ content: " ";
11
+ display: block;
12
+ height: 0;
13
+ clear: both;
14
+ overflow: hidden;
15
+ visibility: hidden; }
16
+ .pie-clearfix {
17
+ display: block; }
@@ -1,5 +1,6 @@
1
1
  @import compass/utilities.sass
2
2
 
3
-
4
3
  .clearfix
5
- +clearfix
4
+ +clearfix
5
+ .pie-clearfix
6
+ +pie-clearfix
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chriseppstein-compass
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Eppstein
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-01 00:00:00 -07:00
12
+ date: 2009-04-03 00:00:00 -07:00
13
13
  default_executable: compass
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -43,10 +43,13 @@ extra_rdoc_files:
43
43
  - lib/compass/actions.rb
44
44
  - lib/compass/commands/base.rb
45
45
  - lib/compass/commands/create_project.rb
46
+ - lib/compass/commands/generate_grid_background.rb
46
47
  - lib/compass/commands/list_frameworks.rb
47
48
  - lib/compass/commands/print_version.rb
48
49
  - lib/compass/commands/project_base.rb
50
+ - lib/compass/commands/stamp_pattern.rb
49
51
  - lib/compass/commands/update_project.rb
52
+ - lib/compass/commands/validate_project.rb
50
53
  - lib/compass/commands/watch_project.rb
51
54
  - lib/compass/commands/write_configuration.rb
52
55
  - lib/compass/compiler.rb
@@ -55,6 +58,7 @@ extra_rdoc_files:
55
58
  - lib/compass/errors.rb
56
59
  - lib/compass/exec.rb
57
60
  - lib/compass/frameworks.rb
61
+ - lib/compass/grid_builder.rb
58
62
  - lib/compass/installers/base.rb
59
63
  - lib/compass/installers/manifest.rb
60
64
  - lib/compass/installers/rails.rb
@@ -71,7 +75,6 @@ extra_rdoc_files:
71
75
  - lib/compass/validate/README.html
72
76
  - lib/compass/validate/xerces.jar
73
77
  - lib/compass/validate/XERCES_COPYING.txt
74
- - lib/compass/validate.rb
75
78
  - lib/compass/validator.rb
76
79
  - lib/compass/version.rb
77
80
  - lib/compass.rb
@@ -91,11 +94,16 @@ files:
91
94
  - examples/blueprint_default/src/images/grid.png
92
95
  - examples/blueprint_default/src/print.sass
93
96
  - examples/blueprint_default/src/screen.sass
97
+ - examples/blueprint_plugins/images/buttons/cross.png
98
+ - examples/blueprint_plugins/images/buttons/key.png
99
+ - examples/blueprint_plugins/images/buttons/tick.png
94
100
  - examples/blueprint_plugins/index.html
101
+ - examples/blueprint_plugins/parts/buttons.html
95
102
  - examples/blueprint_plugins/parts/fancy_type.html
96
103
  - examples/blueprint_plugins/parts/test-small.jpg
97
104
  - examples/blueprint_plugins/parts/test.jpg
98
105
  - examples/blueprint_plugins/parts/valid.png
106
+ - examples/blueprint_plugins/src/buttons.sass
99
107
  - examples/blueprint_plugins/src/ie.sass
100
108
  - examples/blueprint_plugins/src/images/grid.png
101
109
  - examples/blueprint_plugins/src/print.sass
@@ -135,12 +143,11 @@ files:
135
143
  - examples/yui/templates.html.haml
136
144
  - examples/yui/test.jpg
137
145
  - examples/yui/typography.html.haml
138
- - frameworks/blueprint/lib/blueprint/constants.rb
139
- - frameworks/blueprint/lib/blueprint/grid_builder.rb
140
146
  - frameworks/blueprint/stylesheets/_blueprint.sass
141
147
  - frameworks/blueprint/stylesheets/blueprint/_ie.sass
142
148
  - frameworks/blueprint/stylesheets/blueprint/_print.sass
143
149
  - frameworks/blueprint/stylesheets/blueprint/_screen.sass
150
+ - frameworks/blueprint/stylesheets/blueprint/modules/_buttons.sass
144
151
  - frameworks/blueprint/stylesheets/blueprint/modules/_colors.sass
145
152
  - frameworks/blueprint/stylesheets/blueprint/modules/_debug.sass
146
153
  - frameworks/blueprint/stylesheets/blueprint/modules/_fancy_type.sass
@@ -151,6 +158,11 @@ files:
151
158
  - frameworks/blueprint/stylesheets/blueprint/modules/_scaffolding.sass
152
159
  - frameworks/blueprint/stylesheets/blueprint/modules/_typography.sass
153
160
  - frameworks/blueprint/stylesheets/blueprint/modules/_utilities.sass
161
+ - frameworks/blueprint/templates/buttons/buttons/cross.png
162
+ - frameworks/blueprint/templates/buttons/buttons/key.png
163
+ - frameworks/blueprint/templates/buttons/buttons/tick.png
164
+ - frameworks/blueprint/templates/buttons/buttons.sass
165
+ - frameworks/blueprint/templates/buttons/manifest.rb
154
166
  - frameworks/blueprint/templates/project/grid.png
155
167
  - frameworks/blueprint/templates/project/ie.sass
156
168
  - frameworks/blueprint/templates/project/manifest.rb
@@ -170,6 +182,8 @@ files:
170
182
  - frameworks/compass/stylesheets/compass/utilities/_tables.sass
171
183
  - frameworks/compass/stylesheets/compass/utilities/_text.sass
172
184
  - frameworks/compass/stylesheets/compass/utilities/general/_clearfix.sass
185
+ - frameworks/compass/stylesheets/compass/utilities/general/_float.sass
186
+ - frameworks/compass/stylesheets/compass/utilities/general/_hacks.sass
173
187
  - frameworks/compass/stylesheets/compass/utilities/general/_inline_block.sass
174
188
  - frameworks/compass/stylesheets/compass/utilities/general/_reset.sass
175
189
  - frameworks/compass/stylesheets/compass/utilities/general/_tabs.sass
@@ -201,10 +215,13 @@ files:
201
215
  - lib/compass/actions.rb
202
216
  - lib/compass/commands/base.rb
203
217
  - lib/compass/commands/create_project.rb
218
+ - lib/compass/commands/generate_grid_background.rb
204
219
  - lib/compass/commands/list_frameworks.rb
205
220
  - lib/compass/commands/print_version.rb
206
221
  - lib/compass/commands/project_base.rb
222
+ - lib/compass/commands/stamp_pattern.rb
207
223
  - lib/compass/commands/update_project.rb
224
+ - lib/compass/commands/validate_project.rb
208
225
  - lib/compass/commands/watch_project.rb
209
226
  - lib/compass/commands/write_configuration.rb
210
227
  - lib/compass/compiler.rb
@@ -213,6 +230,7 @@ files:
213
230
  - lib/compass/errors.rb
214
231
  - lib/compass/exec.rb
215
232
  - lib/compass/frameworks.rb
233
+ - lib/compass/grid_builder.rb
216
234
  - lib/compass/installers/base.rb
217
235
  - lib/compass/installers/manifest.rb
218
236
  - lib/compass/installers/rails.rb
@@ -229,7 +247,6 @@ files:
229
247
  - lib/compass/validate/README.html
230
248
  - lib/compass/validate/xerces.jar
231
249
  - lib/compass/validate/XERCES_COPYING.txt
232
- - lib/compass/validate.rb
233
250
  - lib/compass/validator.rb
234
251
  - lib/compass/version.rb
235
252
  - lib/compass.rb