compass-edge 0.9.3 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. data/VERSION.yml +1 -1
  2. data/features/command_line.feature +18 -11
  3. data/features/extensions.feature +20 -0
  4. data/features/step_definitions/command_line_steps.rb +26 -2
  5. data/features/step_definitions/extension_steps.rb +13 -0
  6. data/lib/compass/app_integration.rb +21 -0
  7. data/lib/compass/app_integration/rails.rb +18 -0
  8. data/lib/compass/app_integration/rails/configuration_defaults.rb +8 -0
  9. data/lib/compass/app_integration/rails/installer.rb +3 -5
  10. data/lib/compass/app_integration/stand_alone.rb +20 -1
  11. data/lib/compass/app_integration/stand_alone/configuration_defaults.rb +5 -1
  12. data/lib/compass/app_integration/stand_alone/installer.rb +0 -4
  13. data/lib/compass/commands.rb +1 -1
  14. data/lib/compass/commands/create_project.rb +2 -0
  15. data/lib/compass/commands/generate_grid_background.rb +1 -1
  16. data/lib/compass/commands/help.rb +20 -8
  17. data/lib/compass/commands/installer_command.rb +14 -14
  18. data/lib/compass/commands/interactive.rb +61 -0
  19. data/lib/compass/commands/project_base.rb +2 -2
  20. data/lib/compass/commands/project_stats.rb +2 -0
  21. data/lib/compass/commands/update_project.rb +2 -0
  22. data/lib/compass/commands/write_configuration.rb +9 -1
  23. data/lib/compass/configuration/data.rb +5 -2
  24. data/lib/compass/configuration/defaults.rb +2 -1
  25. data/lib/compass/configuration/helpers.rb +38 -10
  26. data/lib/compass/configuration/serialization.rb +2 -2
  27. data/lib/compass/exec/project_options_parser.rb +4 -0
  28. data/lib/compass/frameworks.rb +5 -1
  29. data/lib/compass/frameworks/blueprint/templates/project/welcome.html.haml +6 -1
  30. data/lib/compass/installers/bare_installer.rb +0 -4
  31. data/lib/compass/installers/base.rb +1 -0
  32. metadata +5 -18
  33. data/examples/ninesixty/extensions/ninesixty/README.mkdn +0 -56
  34. data/examples/ninesixty/extensions/ninesixty/compass-960-plugin.gemspec +0 -36
  35. data/examples/ninesixty/extensions/ninesixty/lib/ninesixty.rb +0 -1
  36. data/examples/ninesixty/extensions/ninesixty/lib/ninesixty/compass_plugin.rb +0 -5
  37. data/examples/ninesixty/extensions/ninesixty/sass/960/_grid.sass +0 -64
  38. data/examples/ninesixty/extensions/ninesixty/sass/960/_text.sass +0 -59
  39. data/examples/ninesixty/extensions/ninesixty/templates/project/grid.sass +0 -34
  40. data/examples/ninesixty/extensions/ninesixty/templates/project/manifest.rb +0 -2
  41. data/examples/ninesixty/extensions/ninesixty/templates/project/text.sass +0 -10
  42. data/examples/yui/extensions/yui/stylesheets/_yui.sass +0 -7
  43. data/examples/yui/extensions/yui/stylesheets/yui/modules/_base.sass +0 -70
  44. data/examples/yui/extensions/yui/stylesheets/yui/modules/_fonts.sass +0 -45
  45. data/examples/yui/extensions/yui/stylesheets/yui/modules/_grids.sass +0 -385
  46. data/examples/yui/extensions/yui/stylesheets/yui/modules/_reset.sass +0 -61
  47. data/examples/yui/extensions/yui/templates/project/manifest.rb +0 -1
  48. data/examples/yui/extensions/yui/templates/project/screen.sass +0 -4
@@ -11,7 +11,7 @@ module Compass
11
11
  def initialize(working_path, options = {})
12
12
  super(working_path, options)
13
13
  self.project_name = determine_project_name(working_path, options)
14
- Compass.configuration.project_path = determine_project_directory(working_path, options)
14
+ Compass.add_configuration({:project_path => determine_project_directory(working_path, options)}, "implied")
15
15
  configure!
16
16
  end
17
17
 
@@ -89,4 +89,4 @@ module Compass
89
89
 
90
90
  end
91
91
  end
92
- end
92
+ end
@@ -136,6 +136,8 @@ module Compass
136
136
  "Report statistics about your stylesheets"
137
137
  end
138
138
 
139
+ def primary; false; end
140
+
139
141
  def parse!(arguments)
140
142
  parser = option_parser(arguments)
141
143
  parser.parse!
@@ -62,6 +62,8 @@ module Compass
62
62
  option_parser([]).to_s
63
63
  end
64
64
 
65
+ def primary; true; end
66
+
65
67
  def description(command)
66
68
  "Compile Sass stylesheets to CSS"
67
69
  end
@@ -41,6 +41,14 @@ module Compass
41
41
 
42
42
  def perform
43
43
  if options[:debug]
44
+ puts "Configuration sources:"
45
+ c = Compass.configuration
46
+ while c
47
+ print c.name
48
+ c = c.inherited_data
49
+ print ", " if c
50
+ end
51
+ print "\n"
44
52
  Compass.configuration.debug.each do |prop, values|
45
53
  if options[:debug].is_a?(Symbol)
46
54
  next unless prop == options[:debug]
@@ -51,7 +59,7 @@ module Compass
51
59
  end
52
60
  end
53
61
  else
54
- directory projectize(File.dirname(options[:configuration_file]))
62
+ directory File.dirname(options[:configuration_file])
55
63
  installer.write_configuration_files(options[:configuration_file])
56
64
  end
57
65
  end
@@ -18,6 +18,7 @@ module Compass
18
18
  class Data
19
19
 
20
20
  attr_accessor :required_libraries
21
+ attr_reader :name
21
22
 
22
23
  include Compass::Configuration::Inheritance
23
24
  include Compass::Configuration::Serialization
@@ -25,7 +26,9 @@ module Compass
25
26
 
26
27
  inherited_accessor *ATTRIBUTES
27
28
 
28
- def initialize(attr_hash = nil)
29
+ def initialize(name, attr_hash = nil)
30
+ raise "I need a name!" unless name
31
+ @name = name
29
32
  self.required_libraries = []
30
33
  set_all(attr_hash) if attr_hash
31
34
  self.top_level = self
@@ -100,4 +103,4 @@ module Compass
100
103
 
101
104
  end
102
105
  end
103
- end
106
+ end
@@ -85,6 +85,7 @@ module Compass
85
85
 
86
86
  def http_join(*segments)
87
87
  segments.map do |segment|
88
+ next unless segment
88
89
  segment = http_pathify(segment)
89
90
  segment[-1..-1] == "/" ? segment[0..-2] : segment
90
91
  end.join("/")
@@ -104,4 +105,4 @@ module Compass
104
105
 
105
106
  end
106
107
  end
107
- end
108
+ end
@@ -11,25 +11,36 @@ module Compass
11
11
  end
12
12
 
13
13
  def default_configuration
14
- Data.new.extend(Defaults).extend(Comments)
14
+ Data.new('defaults').extend(Defaults).extend(Comments)
15
15
  end
16
16
 
17
17
  def add_configuration(config, filename = nil)
18
18
  return if config.nil?
19
- data = if config.is_a?(Compass::Configuration::Data)
19
+
20
+
21
+ data = configuration_for(config, filename)
22
+
23
+ # puts "New configuration: #{data.name}"
24
+ # puts caller.join("\n")
25
+ data.inherit_from!(configuration)
26
+ data.on_top!
27
+ @configuration = data
28
+ end
29
+
30
+ def configuration_for(config, filename = nil)
31
+ if config.is_a?(Compass::Configuration::Data)
20
32
  config
21
33
  elsif config.respond_to?(:read)
22
34
  Compass::Configuration::Data.new_from_string(config.read, filename)
23
35
  elsif config.is_a?(Hash)
24
- Compass::Configuration::Data.new(config)
36
+ Compass::Configuration::Data.new(filename, config)
25
37
  elsif config.is_a?(String)
26
38
  Compass::Configuration::Data.new_from_file(config)
39
+ elsif config.is_a?(Symbol)
40
+ Compass::AppIntegration.lookup(config).configuration
27
41
  else
28
42
  raise "I don't know what to do with: #{config.inspect}"
29
43
  end
30
- data.inherit_from!(configuration)
31
- data.on_top!
32
- @configuration = data
33
44
  end
34
45
 
35
46
  # Support for testing.
@@ -55,9 +66,26 @@ module Compass
55
66
  end
56
67
 
57
68
  # Read the configuration file for this project
58
- def add_project_configuration(configuration_file_path = nil)
59
- configuration_file_path ||= detect_configuration_file
60
- Compass.add_configuration(configuration_file_path) if configuration_file_path
69
+ def add_project_configuration(*args)
70
+ options = args.last.is_a?(Hash) ? args.pop : {}
71
+ configuration_file_path = args.shift || detect_configuration_file
72
+ raise ArgumentError, "Too many arguments" if args.any?
73
+ if configuration_file_path
74
+
75
+ data = configuration_for(configuration_file_path)
76
+
77
+ if data.raw_project_type
78
+ add_configuration(data.raw_project_type.to_sym)
79
+ elsif options[:project_type]
80
+ add_configuration(options[:project_type])
81
+ else
82
+ add_configuration(:stand_alone)
83
+ end
84
+
85
+ add_configuration(data)
86
+ else
87
+ add_configuration(options[:project_type] || configuration.project_type || :stand_alone)
88
+ end
61
89
  end
62
90
 
63
91
  # Returns a full path to the relative path to the project directory
@@ -76,7 +104,7 @@ module Compass
76
104
  end
77
105
 
78
106
  # TODO: Deprecate the src/config.rb location.
79
- KNOWN_CONFIG_LOCATIONS = [".compass/config.rb", "config/compass.config", "config.rb", "src/config.rb"]
107
+ KNOWN_CONFIG_LOCATIONS = ['config/compass.rb', ".compass/config.rb", "config/compass.config", "config.rb", "src/config.rb"]
80
108
 
81
109
  # Finds the configuration file, if it exists in a known location.
82
110
  def detect_configuration_file(project_path = nil)
@@ -9,13 +9,13 @@ module Compass
9
9
 
10
10
  module ClassMethods
11
11
  def new_from_file(config_file)
12
- data = Data.new
12
+ data = Data.new(config_file)
13
13
  data.parse(config_file)
14
14
  data
15
15
  end
16
16
 
17
17
  def new_from_string(contents, filename)
18
- data = Data.new
18
+ data = Data.new(filename)
19
19
  data.parse_string(contents, filename)
20
20
  data
21
21
  end
@@ -8,6 +8,10 @@ module Compass::Exec::ProjectOptionsParser
8
8
  self.options[:configuration_file] = configuration_file
9
9
  end
10
10
 
11
+ opts.on('--app APP', 'Tell compass what kind of application it is integrating with. E.g. rails') do |project_type|
12
+ self.options[:project_type] = project_type.to_sym
13
+ end
14
+
11
15
  opts.on('--sass-dir SRC_DIR', "The source directory where you keep your sass stylesheets.") do |sass_dir|
12
16
  self.options[:sass_dir] = sass_dir
13
17
  end
@@ -28,7 +28,11 @@ module Compass
28
28
  end
29
29
 
30
30
  def register(name, *arguments)
31
- ALL << Framework.new(name, *arguments)
31
+ if idx = ALL.index{|f| f.name.to_s == name.to_s}
32
+ ALL[idx] = Framework.new(name, *arguments)
33
+ else
34
+ ALL << Framework.new(name, *arguments)
35
+ end
32
36
  end
33
37
 
34
38
  def [](name)
@@ -7,7 +7,12 @@
7
7
  %link(href="<%= http_stylesheets_path %>/print.css" media="print" rel="stylesheet" type="text/css")
8
8
  /[if lt IE 8]
9
9
  %link(href="<%= http_stylesheets_path %>/ie.css" media="screen, projection" rel="stylesheet" type="text/css")
10
+ %style(type="text/css")
11
+ :sass
12
+ @import blueprint.sass
13
+ .foo
14
+ +column(8)
10
15
  %body#welcome.bp
11
16
  #container
12
17
  %h1 Welcome to Compass!
13
- %p This is <%= "ERB" %>
18
+ %p This is <%= "ERB" %>
@@ -2,10 +2,6 @@ module Compass
2
2
  module Installers
3
3
 
4
4
  class BareInstaller < Base
5
- def default_configuration
6
- Compass::Configuration::Data.new.extend(Compass::AppIntegration::StandAlone::ConfigurationDefaults)
7
- end
8
-
9
5
  def completed_configuration
10
6
  nil
11
7
  end
@@ -112,6 +112,7 @@ module Compass
112
112
  ctx = TemplateContext.ctx(:to => to, :options => options)
113
113
  contents = process_erb(contents, ctx)
114
114
  end
115
+ Compass.configure_sass_plugin!
115
116
  html = Haml::Engine.new(contents, :filename => templatize(from)).render
116
117
  write_file(targetize(to), html, options)
117
118
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: compass-edge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.9.4
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-11-01 00:00:00 -07:00
12
+ date: 2009-11-19 00:00:00 -08:00
13
13
  default_executable: compass
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -119,26 +119,10 @@ files:
119
119
  - examples/logo/src/screen.sass
120
120
  - examples/ninesixty/bootstrap.rb
121
121
  - examples/ninesixty/config.rb
122
- - examples/ninesixty/extensions/ninesixty/README.mkdn
123
- - examples/ninesixty/extensions/ninesixty/compass-960-plugin.gemspec
124
- - examples/ninesixty/extensions/ninesixty/lib/ninesixty.rb
125
- - examples/ninesixty/extensions/ninesixty/lib/ninesixty/compass_plugin.rb
126
- - examples/ninesixty/extensions/ninesixty/sass/960/_grid.sass
127
- - examples/ninesixty/extensions/ninesixty/sass/960/_text.sass
128
- - examples/ninesixty/extensions/ninesixty/templates/project/grid.sass
129
- - examples/ninesixty/extensions/ninesixty/templates/project/manifest.rb
130
- - examples/ninesixty/extensions/ninesixty/templates/project/text.sass
131
122
  - examples/ninesixty/src/grid.sass
132
123
  - examples/ninesixty/src/text.sass
133
124
  - examples/yui/bootstrap.rb
134
125
  - examples/yui/divisions.html.haml
135
- - examples/yui/extensions/yui/stylesheets/_yui.sass
136
- - examples/yui/extensions/yui/stylesheets/yui/modules/_base.sass
137
- - examples/yui/extensions/yui/stylesheets/yui/modules/_fonts.sass
138
- - examples/yui/extensions/yui/stylesheets/yui/modules/_grids.sass
139
- - examples/yui/extensions/yui/stylesheets/yui/modules/_reset.sass
140
- - examples/yui/extensions/yui/templates/project/manifest.rb
141
- - examples/yui/extensions/yui/templates/project/screen.sass
142
126
  - examples/yui/index.html.haml
143
127
  - examples/yui/src/screen.sass
144
128
  - examples/yui/sub_divisions.html.haml
@@ -167,6 +151,7 @@ files:
167
151
  - lib/compass/commands/generate_grid_background.rb
168
152
  - lib/compass/commands/help.rb
169
153
  - lib/compass/commands/installer_command.rb
154
+ - lib/compass/commands/interactive.rb
170
155
  - lib/compass/commands/list_frameworks.rb
171
156
  - lib/compass/commands/print_version.rb
172
157
  - lib/compass/commands/project_base.rb
@@ -411,4 +396,6 @@ test_files:
411
396
  - test/test_helper.rb
412
397
  - test/test_rails_helper.rb
413
398
  - features/command_line.feature
399
+ - features/extensions.feature
414
400
  - features/step_definitions/command_line_steps.rb
401
+ - features/step_definitions/extension_steps.rb
@@ -1,56 +0,0 @@
1
- 960 Grid System - Compass Plugin
2
- ================================
3
-
4
- * Port of Version 1.0
5
- * 2008-03-24
6
-
7
- Created by Nathan Smith. See the official site for more info: <http://960.gs/>
8
-
9
- ---------
10
-
11
- This plugin adds the 960 Grid System framework to [Compass](http://compass-style.org/).
12
-
13
- Install
14
- =======
15
-
16
- sudo gem install chriseppstein-compass
17
- sudo gem install chriseppstein-compass-960-plugin
18
-
19
- Create a 960-based Compass Project
20
- ==================================
21
-
22
- compass -r ninesixty -f 960 <project name>
23
-
24
- Then edit your `grid.sass` and `text.sass` files accordingly. A reset is added into grid.sass automatically.
25
-
26
- Customizing your Grid System
27
- ============================
28
-
29
- To create a grid system with other number of columns use the `+grid-system` mixin to generate
30
- the corresponding classes.
31
-
32
- Example:
33
-
34
- #wrap
35
- +grid-system(24)
36
-
37
- Making Semantic Grids
38
- =====================
39
-
40
- * Use the `+grid-container` mixin to declare your container element.
41
- * Use the `+grid` mixin to declare a grid element.
42
- * Use the `+alpha` and `+omega` mixins to declare the first and last grid elements for a row.
43
- * User the `+grid-prefix` and `+grid-suffix` mixins to add grid columns before or after a grid element.
44
-
45
- Example:
46
-
47
- #wrap
48
- +grid-container
49
- #left-nav
50
- +alpha
51
- +grid(5,16)
52
- #main-content
53
- +grid-prefix(1,16)
54
- +grid(10, 16)
55
- +omega
56
-
@@ -1,36 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
- Gem::Specification.new do |s|
4
- s.name = %q{compass-960-plugin}
5
- s.version = "0.9.10"
6
-
7
- s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
- s.authors = ["Chris Eppstein"]
9
- s.date = %q{2009-09-27}
10
- s.description = %q{The 960 Grid System is an effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. http://960.gs/}
11
- s.email = %q{chris@eppsteins.net}
12
- s.extra_rdoc_files = ["lib/ninesixty/compass_plugin.rb", "lib/ninesixty.rb", "README.mkdn"]
13
- s.files = ["compass-960-plugin.gemspec", "lib/ninesixty/compass_plugin.rb", "lib/ninesixty.rb", "Manifest", "Rakefile", "README.mkdn", "sass/960/_grid.sass", "sass/960/_text.sass", "templates/project/grid.sass", "templates/project/manifest.rb", "templates/project/text.sass", "VERSION"]
14
- s.homepage = %q{http://github.com/chriseppstein/compass-960-plugin}
15
- s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Compass-960-plugin", "--main", "README.mkdn"]
16
- s.require_paths = ["lib"]
17
- s.rubyforge_project = %q{compass-960-plugin}
18
- s.rubygems_version = %q{1.3.3}
19
- s.summary = %q{Compass compatible Sass port of 960.gs.}
20
-
21
- if s.respond_to? :specification_version then
22
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
23
- s.specification_version = 3
24
-
25
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
26
- s.add_runtime_dependency(%q<chriseppstein-compass>, [">= 0"])
27
- s.add_development_dependency(%q<echoe>, [">= 0"])
28
- else
29
- s.add_dependency(%q<chriseppstein-compass>, [">= 0"])
30
- s.add_dependency(%q<echoe>, [">= 0"])
31
- end
32
- else
33
- s.add_dependency(%q<chriseppstein-compass>, [">= 0"])
34
- s.add_dependency(%q<echoe>, [">= 0"])
35
- end
36
- end
@@ -1 +0,0 @@
1
- require File.join(File.dirname(__FILE__), 'ninesixty', 'compass_plugin')
@@ -1,5 +0,0 @@
1
- options = Hash.new
2
- options[:stylesheets_directory] = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'sass'))
3
- options[:templates_directory] = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'templates'))
4
-
5
- Compass::Frameworks.register('960', options)
@@ -1,64 +0,0 @@
1
- !ninesixty_gutter_width ||= 20px
2
- !ninesixty_grid_width ||= 960px
3
- !ninesixty_columns ||= 12
4
-
5
- =grid-container
6
- :margin-left auto
7
- :margin-right auto
8
- :width= !ninesixty_grid_width
9
-
10
- =grid-width(!n, !cols = !ninesixty_columns, !gutter_width = !ninesixty_gutter_width)
11
- :width= (!ninesixty_grid_width / !cols) * !n - !gutter_width
12
-
13
- =grid-unit-base(!gutter_width = !ninesixty_gutter_width)
14
- :display inline
15
- :float left
16
- :margin
17
- :left= !gutter_width / 2
18
- :right= !gutter_width / 2
19
-
20
- =grid(!n, !cols = !ninesixty_columns, !gutter_width = !ninesixty_gutter_width)
21
- +grid-unit-base(!gutter_width)
22
- +grid-width(!n, !cols, !gutter_width)
23
-
24
- =alpha
25
- :margin-left 0
26
-
27
- =omega
28
- :margin-right 0
29
-
30
- =grids(!cols = !ninesixty_columns, !gutter_width = !ninesixty_gutter_width)
31
- #{enumerate(".grid",1,!cols,"_")}
32
- +grid-unit-base
33
- @for !n from 1 through !cols
34
- .grid_#{!n}
35
- +grid-width(!n, !cols, !gutter_width)
36
-
37
- =grid-prefix(!n, !cols = !ninesixty_columns)
38
- :padding-left= (!ninesixty_grid_width / !cols) * !n
39
-
40
- =grid-prefixes(!cols = !ninesixty_columns)
41
- @for !n from 1 through !cols - 1
42
- .prefix_#{!n}
43
- +grid-prefix(!n, !cols)
44
-
45
- =grid-suffix(!n, !cols = !ninesixty_columns)
46
- :padding-right= (!ninesixty_grid_width / !cols) * !n
47
-
48
- =grid-suffixes(!cols = !ninesixty_columns)
49
- @for !n from 1 through !cols - 1
50
- .suffix_#{!n}
51
- +grid-suffix(!n, !cols)
52
-
53
- =grid-children
54
- .alpha
55
- +alpha
56
- .omega
57
- +omega
58
-
59
- =grid-system(!cols = !ninesixty_columns)
60
- +grid-container
61
- +grids(!cols)
62
- +grid-prefixes(!cols)
63
- +grid-suffixes(!cols)
64
- +grid-children