compass-edge 0.9.5.0 → 0.10.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.markdown +0 -153
- data/README.markdown +2 -12
- data/REVISION +1 -1
- data/Rakefile +2 -37
- data/VERSION.yml +1 -1
- data/examples/blueprint_default/index.html.haml +3 -3
- data/examples/blueprint_default/parts/forms.html.haml +0 -2
- data/examples/blueprint_default/src/screen.sass +1 -1
- data/examples/blueprint_plugins/index.html.haml +6 -6
- data/examples/blueprint_plugins/src/buttons.sass +2 -2
- data/examples/blueprint_plugins/src/link_icons.sass +1 -1
- data/examples/blueprint_plugins/src/rtl_screen.sass +3 -3
- data/examples/blueprint_plugins/src/screen.sass +2 -2
- data/examples/blueprint_semantic/src/liquid.sass +4 -4
- data/examples/blueprint_semantic/src/screen.sass +3 -3
- data/examples/compass/src/utilities.sass +2 -2
- data/examples/downloader.rb +2 -2
- data/lib/compass/app_integration.rb +0 -21
- data/lib/compass/app_integration/rails.rb +0 -18
- data/lib/compass/app_integration/rails/configuration_defaults.rb +0 -16
- data/lib/compass/app_integration/rails/installer.rb +6 -6
- data/lib/compass/app_integration/stand_alone.rb +1 -20
- data/lib/compass/app_integration/stand_alone/configuration_defaults.rb +1 -5
- data/lib/compass/app_integration/stand_alone/installer.rb +17 -29
- data/lib/compass/commands.rb +2 -2
- data/lib/compass/commands/create_project.rb +1 -10
- data/lib/compass/commands/generate_grid_background.rb +1 -1
- data/lib/compass/commands/help.rb +7 -34
- data/lib/compass/commands/installer_command.rb +11 -15
- data/lib/compass/commands/project_base.rb +2 -2
- data/lib/compass/commands/update_project.rb +1 -51
- data/lib/compass/commands/validate_project.rb +3 -59
- data/lib/compass/commands/watch_project.rb +2 -4
- data/lib/compass/commands/write_configuration.rb +3 -84
- data/lib/compass/compiler.rb +4 -13
- data/lib/compass/configuration.rb +18 -23
- data/lib/compass/configuration/adapters.rb +1 -1
- data/lib/compass/configuration/data.rb +2 -5
- data/lib/compass/configuration/defaults.rb +1 -32
- data/lib/compass/configuration/helpers.rb +10 -47
- data/lib/compass/configuration/inheritance.rb +1 -1
- data/lib/compass/configuration/serialization.rb +2 -2
- data/lib/compass/errors.rb +1 -4
- data/lib/compass/exec.rb +0 -1
- data/lib/compass/exec/project_options_parser.rb +0 -4
- data/lib/compass/frameworks.rb +1 -40
- data/lib/compass/frameworks/blueprint/stylesheets/_blueprint.sass +1 -29
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_ie.sass +2 -2
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_print.sass +4 -1
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_reset.sass +2 -57
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_screen.sass +29 -2
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_buttons.sass +84 -2
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_colors.sass +33 -2
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_debug.sass +9 -2
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_fancy_type.sass +82 -2
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_form.sass +55 -2
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_grid.sass +178 -2
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_interaction.sass +58 -2
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_link_icons.sass +44 -2
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_liquid.sass +140 -2
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_reset.sass +56 -2
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_rtl.sass +122 -2
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_scaffolding.sass +47 -2
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_typography.sass +160 -2
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_utilities.sass +37 -2
- data/lib/compass/frameworks/blueprint/templates/buttons/buttons.sass +2 -2
- data/lib/compass/frameworks/blueprint/templates/buttons/manifest.rb +0 -12
- data/lib/compass/frameworks/blueprint/templates/link_icons/link_icons.sass +1 -1
- data/lib/compass/frameworks/blueprint/templates/link_icons/manifest.rb +0 -13
- data/lib/compass/frameworks/blueprint/templates/project/manifest.rb +0 -24
- data/lib/compass/frameworks/blueprint/templates/project/screen.sass +7 -1
- data/lib/compass/frameworks/blueprint/templates/project/welcome.html.haml +1 -9
- data/lib/compass/frameworks/compass/stylesheets/_compass.sass +1 -2
- data/lib/compass/frameworks/compass/stylesheets/compass/_utilities.sass +1 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/_css3.sass +6 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/{css3 → utilities/css3}/_border_radius.sass +0 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/css3/_box_shadow.sass +12 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/{css3 → utilities/css3}/_box_sizing.sass +0 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/{css3 → utilities/css3}/_columns.sass +0 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/{css3 → utilities/css3}/_inline_block.sass +0 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/{css3 → utilities/css3}/_opacity.sass +0 -0
- data/lib/compass/frameworks/compass/stylesheets/compass/utilities/general/_reset.sass +2 -2
- data/lib/compass/frameworks/compass/templates/ellipsis/manifest.rb +1 -26
- data/lib/compass/frameworks/compass/templates/extension/manifest.rb +2 -16
- data/lib/compass/frameworks/compass/templates/project/manifest.rb +0 -1
- data/lib/compass/grid_builder.rb +1 -1
- data/lib/compass/installers.rb +1 -1
- data/lib/compass/installers/base.rb +52 -13
- data/lib/compass/installers/manifest.rb +1 -33
- data/lib/compass/logger.rb +2 -28
- data/lib/compass/sass_extensions/functions.rb +1 -3
- data/lib/compass/sass_extensions/functions/enumerate.rb +2 -2
- data/lib/compass/sass_extensions/functions/inline_image.rb +1 -22
- data/lib/compass/sass_extensions/functions/urls.rb +0 -20
- data/lib/compass/sass_extensions/monkey_patches.rb +2 -2
- data/lib/compass/validator.rb +3 -2
- data/lib/vendor/fssm.rb +6 -19
- data/lib/vendor/fssm/backends/fsevents.rb +60 -19
- data/lib/vendor/fssm/backends/polling.rb +18 -20
- data/lib/vendor/fssm/ext.rb +0 -30
- data/lib/vendor/fssm/monitor.rb +6 -10
- data/lib/vendor/fssm/path.rb +21 -24
- data/lib/vendor/fssm/state.rb +29 -37
- data/lib/vendor/fssm/support.rb +7 -3
- data/test/command_line_helper.rb +4 -12
- data/test/command_line_test.rb +2 -2
- data/test/compass_test.rb +4 -14
- data/test/configuration_test.rb +5 -5
- data/test/fixtures/stylesheets/blueprint/css/typography.css +3 -5
- data/test/fixtures/stylesheets/blueprint/sass/screen.sass +1 -1
- data/test/fixtures/stylesheets/blueprint/sass/typography.sass +2 -2
- data/test/fixtures/stylesheets/compass/css/print.css +8 -2
- data/test/fixtures/stylesheets/compass/css/reset.css +1 -1
- data/test/fixtures/stylesheets/image_urls/css/screen.css +0 -2
- data/test/io_helper.rb +1 -18
- data/test/rails_integration_test.rb +41 -3
- data/test/sass_extensions_test.rb +2 -2
- data/test/test_helper.rb +0 -1
- metadata +9 -124
- data/examples/compass/bootstrap.rb +0 -3
- data/examples/compass/extensions/yui/stylesheets/_yui.sass +0 -7
- data/examples/compass/extensions/yui/stylesheets/yui/modules/_base.sass +0 -70
- data/examples/compass/extensions/yui/stylesheets/yui/modules/_fonts.sass +0 -45
- data/examples/compass/extensions/yui/stylesheets/yui/modules/_grids.sass +0 -385
- data/examples/compass/extensions/yui/stylesheets/yui/modules/_reset.sass +0 -61
- data/examples/compass/extensions/yui/templates/project/manifest.rb +0 -1
- data/examples/compass/extensions/yui/templates/project/screen.sass +0 -4
- data/examples/css3/config.rb +0 -6
- data/examples/css3/extensions/fancy-fonts/templates/project/Vtks Revolt.ttf +0 -0
- data/examples/css3/extensions/fancy-fonts/templates/project/angelina.ttf +0 -0
- data/examples/css3/extensions/fancy-fonts/templates/project/fancy-fonts.sass +0 -7
- data/examples/css3/extensions/fancy-fonts/templates/project/manifest.rb +0 -5
- data/examples/css3/images/fresh-peas.jpg +0 -0
- data/examples/css3/index.html.haml +0 -55
- data/examples/css3/src/_base.sass +0 -14
- data/examples/css3/src/fancy-fonts.sass +0 -7
- data/examples/css3/src/gradient.sass +0 -10
- data/examples/css3/src/main.sass +0 -80
- data/examples/css3/stylesheets/fonts/Vtks Revolt.ttf +0 -0
- data/examples/css3/stylesheets/fonts/angelina.ttf +0 -0
- data/examples/susy/bootstrap.rb +0 -3
- data/examples/susy/config.rb +0 -9
- data/examples/susy/extensions/susy/LICENSE.txt +0 -28
- data/examples/susy/extensions/susy/README.mkdn +0 -235
- data/examples/susy/extensions/susy/compass-susy-plugin.gemspec +0 -35
- data/examples/susy/extensions/susy/docs/tutorial/build.sh +0 -141
- data/examples/susy/extensions/susy/docs/tutorial/code/01_target/src/_defaults.sass +0 -100
- data/examples/susy/extensions/susy/docs/tutorial/code/01_target/src/screen.sass +0 -98
- data/examples/susy/extensions/susy/docs/tutorial/code/02_container/src/_defaults.sass +0 -147
- data/examples/susy/extensions/susy/docs/tutorial/code/02_container/src/screen.sass +0 -19
- data/examples/susy/extensions/susy/docs/tutorial/code/03_structure/src/_defaults.sass +0 -147
- data/examples/susy/extensions/susy/docs/tutorial/code/03_structure/src/screen.sass +0 -48
- data/examples/susy/extensions/susy/docs/tutorial/code/_common/config.rb +0 -14
- data/examples/susy/extensions/susy/docs/tutorial/code/_common/images/grid.png +0 -0
- data/examples/susy/extensions/susy/docs/tutorial/code/_common/images/susy_logo.png +0 -0
- data/examples/susy/extensions/susy/docs/tutorial/code/_common/src/_base.sass +0 -63
- data/examples/susy/extensions/susy/docs/tutorial/code/_tools/Markdown.pl +0 -1450
- data/examples/susy/extensions/susy/docs/tutorial/code/site/src/_defaults.sass +0 -100
- data/examples/susy/extensions/susy/docs/tutorial/code/site/src/screen.sass +0 -91
- data/examples/susy/extensions/susy/docs/tutorial/figures/susy_element.png +0 -0
- data/examples/susy/extensions/susy/docs/tutorial/figures/susy_grid.png +0 -0
- data/examples/susy/extensions/susy/docs/tutorial/index.mkdn +0 -301
- data/examples/susy/extensions/susy/lib/susy.rb +0 -2
- data/examples/susy/extensions/susy/lib/susy/compass_plugin.rb +0 -5
- data/examples/susy/extensions/susy/lib/susy/sass_extensions.rb +0 -79
- data/examples/susy/extensions/susy/sass/susy/_grid.sass +0 -128
- data/examples/susy/extensions/susy/sass/susy/_reset.sass +0 -7
- data/examples/susy/extensions/susy/sass/susy/_susy.sass +0 -23
- data/examples/susy/extensions/susy/sass/susy/_text.sass +0 -15
- data/examples/susy/extensions/susy/sass/susy/_utils.sass +0 -81
- data/examples/susy/extensions/susy/templates/project/_base.sass +0 -62
- data/examples/susy/extensions/susy/templates/project/_defaults.sass +0 -147
- data/examples/susy/extensions/susy/templates/project/ie.sass +0 -9
- data/examples/susy/extensions/susy/templates/project/manifest.rb +0 -5
- data/examples/susy/extensions/susy/templates/project/print.sass +0 -7
- data/examples/susy/extensions/susy/templates/project/screen.sass +0 -44
- data/examples/susy/src/_base.sass +0 -62
- data/examples/susy/src/_defaults.sass +0 -148
- data/examples/susy/src/screen.sass +0 -114
- data/features/command_line.feature +0 -226
- data/features/extensions.feature +0 -20
- data/features/step_definitions/command_line_steps.rb +0 -223
- data/features/step_definitions/extension_steps.rb +0 -13
- data/lib/compass/commands/interactive.rb +0 -61
- data/lib/compass/commands/project_stats.rb +0 -162
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_buttons.sass +0 -84
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_colors.sass +0 -33
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_debug.sass +0 -9
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_fancy_type.sass +0 -82
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_form.sass +0 -56
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_grid.sass +0 -179
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_interaction.sass +0 -58
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_link_icons.sass +0 -44
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_liquid.sass +0 -141
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_rtl.sass +0 -123
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_scaffolding.sass +0 -49
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_typography.sass +0 -162
- data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_utilities.sass +0 -37
- data/lib/compass/frameworks/compass/stylesheets/compass/_css3.sass +0 -14
- data/lib/compass/frameworks/compass/stylesheets/compass/css3/_background_clip.sass +0 -16
- data/lib/compass/frameworks/compass/stylesheets/compass/css3/_background_origin.sass +0 -18
- data/lib/compass/frameworks/compass/stylesheets/compass/css3/_background_size.sass +0 -14
- data/lib/compass/frameworks/compass/stylesheets/compass/css3/_box_shadow.sass +0 -20
- data/lib/compass/frameworks/compass/stylesheets/compass/css3/_font_face.sass +0 -31
- data/lib/compass/frameworks/compass/stylesheets/compass/css3/_gradient.sass +0 -40
- data/lib/compass/frameworks/compass/stylesheets/compass/css3/_text_shadow.sass +0 -15
- data/lib/compass/frameworks/compass/stylesheets/compass/css3/_transform.sass +0 -60
- data/lib/compass/frameworks/compass/stylesheets/compass/css3/_transition.sass +0 -57
- data/lib/compass/frameworks/compass/templates/project/USAGE.markdown +0 -32
- data/lib/compass/installers/bare_installer.rb +0 -58
- data/lib/compass/installers/manifest_installer.rb +0 -59
- data/lib/compass/sass_extensions/functions/color_stop.rb +0 -10
- data/lib/compass/sass_extensions/functions/font_files.rb +0 -11
- data/lib/compass/sass_extensions/monkey_patches/traversal.rb +0 -23
- data/lib/compass/stats.rb +0 -92
- data/lib/vendor/fssm/cache.rb +0 -193
- data/lib/vendor/fssm/fsevents.rb +0 -129
- data/lib/vendor/fssm/tree.rb +0 -176
- data/test/fixtures/stylesheets/relative/assets/images/testing.png +0 -0
- data/test/fixtures/stylesheets/relative/config.rb +0 -9
- data/test/fixtures/stylesheets/relative/css/ie.css +0 -1
- data/test/fixtures/stylesheets/relative/css/print.css +0 -1
- data/test/fixtures/stylesheets/relative/css/screen.css +0 -1
- data/test/fixtures/stylesheets/relative/sass/ie.sass +0 -6
- data/test/fixtures/stylesheets/relative/sass/print.sass +0 -6
- data/test/fixtures/stylesheets/relative/sass/screen.sass +0 -3
- data/test/rails_helper.rb +0 -40
data/features/extensions.feature
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Feature: Extensions
|
2
|
-
In order to have an open source ecosystem for stylesheets
|
3
|
-
As a compass user
|
4
|
-
I can install extensions that others have created
|
5
|
-
And I can create and publish my own extensions
|
6
|
-
|
7
|
-
Scenario: Extensions directory for stand_alone projects
|
8
|
-
Given I am using the existing project in test/fixtures/stylesheets/compass
|
9
|
-
And the "extensions" directory exists
|
10
|
-
And and I have a fake extension at extensions/testing
|
11
|
-
When I run: compass --list-frameworks
|
12
|
-
Then the list of frameworks includes "testing"
|
13
|
-
|
14
|
-
Scenario: Extensions directory for rails projects
|
15
|
-
Given I'm in a newly created rails project: my_rails_project
|
16
|
-
And the "my_rails_project/vendor/plugins/compass/extensions" directory exists
|
17
|
-
And and I have a fake extension at my_rails_project/vendor/plugins/compass/extensions/testing
|
18
|
-
When I run: compass --list-frameworks
|
19
|
-
Then the list of frameworks includes "testing"
|
20
|
-
|
@@ -1,223 +0,0 @@
|
|
1
|
-
require 'spec/expectations'
|
2
|
-
$:.unshift(File.expand_path(File.join(File.dirname(__FILE__), '../../test')))
|
3
|
-
|
4
|
-
require 'test_helper'
|
5
|
-
|
6
|
-
require 'compass/exec'
|
7
|
-
|
8
|
-
include Compass::CommandLineHelper
|
9
|
-
include Compass::IoHelper
|
10
|
-
include Compass::RailsHelper
|
11
|
-
|
12
|
-
Before do
|
13
|
-
Compass.reset_configuration!
|
14
|
-
@cleanup_directories = []
|
15
|
-
@original_working_directory = Dir.pwd
|
16
|
-
end
|
17
|
-
|
18
|
-
After do
|
19
|
-
Dir.chdir @original_working_directory
|
20
|
-
@cleanup_directories.each do |dir|
|
21
|
-
FileUtils.rm_rf dir
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
# Given Preconditions
|
26
|
-
Given %r{^I am using the existing project in ([^\s]+)$} do |project|
|
27
|
-
tmp_project = "tmp_#{File.basename(project)}"
|
28
|
-
@cleanup_directories << tmp_project
|
29
|
-
FileUtils.cp_r project, tmp_project
|
30
|
-
Dir.chdir tmp_project
|
31
|
-
end
|
32
|
-
|
33
|
-
Given %r{^I am in the parent directory$} do
|
34
|
-
Dir.chdir ".."
|
35
|
-
end
|
36
|
-
|
37
|
-
Given /^I'm in a newly created rails project: (.+)$/ do |project_name|
|
38
|
-
@cleanup_directories << project_name
|
39
|
-
begin
|
40
|
-
generate_rails_app project_name
|
41
|
-
Dir.chdir project_name
|
42
|
-
rescue LoadError
|
43
|
-
pending "Missing Ruby-on-rails gems: sudo gem install rails"
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
Given /^I should clean up the directory: (\w+)$/ do |directory|
|
48
|
-
@cleanup_directories << directory
|
49
|
-
end
|
50
|
-
|
51
|
-
# When Actions are performed
|
52
|
-
When /^I create a project using: compass create ([^\s]+) ?(.+)?$/ do |dir, args|
|
53
|
-
@cleanup_directories << dir
|
54
|
-
compass 'create', dir, *(args || '').split
|
55
|
-
end
|
56
|
-
|
57
|
-
When /^I initialize a project using: compass init ?(.+)?$/ do |args|
|
58
|
-
compass 'init', *(args || '').split
|
59
|
-
end
|
60
|
-
|
61
|
-
When /^I run: compass ([^\s]+) ?(.+)?$/ do |command, args|
|
62
|
-
compass command, *(args || '').split
|
63
|
-
end
|
64
|
-
|
65
|
-
When /^I run in a separate process: compass ([^\s]+) ?(.+)?$/ do |command, args|
|
66
|
-
unless @other_process = fork
|
67
|
-
@last_result = ''
|
68
|
-
@last_error = ''
|
69
|
-
Signal.trap("HUP") do
|
70
|
-
open('/tmp/last_result.compass_test.txt', 'w') do |file|
|
71
|
-
file.puts $stdout.string
|
72
|
-
end
|
73
|
-
open('/tmp/last_error.compass_test.txt', 'w') do |file|
|
74
|
-
file.puts @stderr.string
|
75
|
-
end
|
76
|
-
exit!
|
77
|
-
end
|
78
|
-
# this command will run forever
|
79
|
-
# we kill it with a HUP signal from the parent process.
|
80
|
-
args = (args || '').split
|
81
|
-
args << { :wait => 5 }
|
82
|
-
compass command, *args
|
83
|
-
exit!
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
|
-
When /^I shutdown the other process$/ do
|
88
|
-
Process.kill("HUP", @other_process)
|
89
|
-
Process.wait
|
90
|
-
@last_result = File.read('/tmp/last_result.compass_test.txt')
|
91
|
-
@last_error = File.read('/tmp/last_error.compass_test.txt')
|
92
|
-
end
|
93
|
-
|
94
|
-
When /^I touch ([^\s]+)$/ do |filename|
|
95
|
-
FileUtils.touch filename
|
96
|
-
end
|
97
|
-
|
98
|
-
When /^I wait ([\d.]+) seconds?$/ do |count|
|
99
|
-
sleep count.to_f
|
100
|
-
end
|
101
|
-
|
102
|
-
When /^I add some sass to ([^\s]+)$/ do |filename|
|
103
|
-
open(filename, "w+") do |file|
|
104
|
-
file.puts ".added .some .arbitrary"
|
105
|
-
file.puts " sass: code"
|
106
|
-
end
|
107
|
-
end
|
108
|
-
|
109
|
-
# Then postconditions
|
110
|
-
Then /^a directory ([^ ]+) is (not )?created$/ do |directory, negated|
|
111
|
-
File.directory?(directory).should == !negated
|
112
|
-
end
|
113
|
-
|
114
|
-
Then /an? \w+ file ([^ ]+) is (not )?created/ do |filename, negated|
|
115
|
-
File.exists?(filename).should == !negated
|
116
|
-
end
|
117
|
-
|
118
|
-
Then /an? \w+ file ([^ ]+) is reported created/ do |filename|
|
119
|
-
@last_result.should =~ /create #{Regexp.escape(filename)}/
|
120
|
-
end
|
121
|
-
|
122
|
-
Then /a \w+ file ([^ ]+) is (?:reported )?compiled/ do |filename|
|
123
|
-
@last_result.should =~ /compile #{Regexp.escape(filename)}/
|
124
|
-
end
|
125
|
-
|
126
|
-
Then /a \w+ file ([^ ]+) is reported unchanged/ do |filename|
|
127
|
-
@last_result.should =~ /unchanged #{Regexp.escape(filename)}/
|
128
|
-
end
|
129
|
-
|
130
|
-
Then /a \w+ file ([^ ]+) is reported identical/ do |filename|
|
131
|
-
@last_result.should =~ /identical #{Regexp.escape(filename)}/
|
132
|
-
end
|
133
|
-
|
134
|
-
Then /a \w+ file ([^ ]+) is reported overwritten/ do |filename|
|
135
|
-
@last_result.should =~ /overwrite #{Regexp.escape(filename)}/
|
136
|
-
end
|
137
|
-
|
138
|
-
Then /I am told how to link to ([^ ]+) for media "([^"]+)"/ do |stylesheet, media|
|
139
|
-
@last_result.should =~ %r{<link href="#{stylesheet}" media="#{media}" rel="stylesheet" type="text/css" />}
|
140
|
-
end
|
141
|
-
|
142
|
-
Then /I am told how to conditionally link "([^"]+)" to ([^ ]+) for media "([^"]+)"/ do |condition, stylesheet, media|
|
143
|
-
@last_result.should =~ %r{<!--\[if #{condition}\]>\s+<link href="#{stylesheet}" media="#{media}" rel="stylesheet" type="text/css" />\s+<!\[endif\]-->}mi
|
144
|
-
end
|
145
|
-
|
146
|
-
Then /^an error message is printed out: (.+)$/ do |error_message|
|
147
|
-
@last_error.should =~ Regexp.new(Regexp.escape(error_message))
|
148
|
-
end
|
149
|
-
|
150
|
-
Then /^the command exits with a non\-zero error code$/ do
|
151
|
-
@last_exit_code.should_not == 0
|
152
|
-
end
|
153
|
-
|
154
|
-
|
155
|
-
Then /^I am congratulated$/ do
|
156
|
-
@last_result.should =~ /Congratulations!/
|
157
|
-
end
|
158
|
-
|
159
|
-
Then /^I am told that I can place stylesheets in the ([^\s]+) subdirectory$/ do |subdir|
|
160
|
-
@last_result.should =~ /You may now add sass stylesheets to the #{subdir} subdirectory of your project./
|
161
|
-
end
|
162
|
-
|
163
|
-
Then /^I am told how to compile my sass stylesheets$/ do
|
164
|
-
@last_result.should =~ /You must compile your sass stylesheets into CSS when they change.\nThis can be done in one of the following ways:/
|
165
|
-
end
|
166
|
-
|
167
|
-
Then /^I should be shown a list of "([^"]+)" commands$/ do |kind|
|
168
|
-
@last_result.should =~ /^#{kind.capitalize} Commands:$/
|
169
|
-
@last_command_list = []
|
170
|
-
found = false
|
171
|
-
indent = nil
|
172
|
-
@last_result.split("\n").each do |line|
|
173
|
-
if line =~ /^#{kind.capitalize} Commands:$/
|
174
|
-
found = true
|
175
|
-
elsif found && line =~ /^\s+/
|
176
|
-
@last_command_list << line
|
177
|
-
elsif found && line =~ /^$|^\w/
|
178
|
-
break
|
179
|
-
end
|
180
|
-
end
|
181
|
-
|
182
|
-
end
|
183
|
-
|
184
|
-
Then /^the list of commands should describe the ([^ ]+) command$/ do |command|
|
185
|
-
@last_result.should =~ /^\s+\* #{command}\s+- [A-Z].+$/
|
186
|
-
end
|
187
|
-
|
188
|
-
Then /^the following configuration properties are set in ([^ ]+):$/ do |config_file, table|
|
189
|
-
|
190
|
-
config = Compass::Configuration::Data.new_from_file(config_file)
|
191
|
-
table.hashes.each do |hash|
|
192
|
-
config.send(hash['property']).should == hash['value']
|
193
|
-
end
|
194
|
-
end
|
195
|
-
|
196
|
-
Then /^my css is validated$/ do
|
197
|
-
if @last_error =~ /The Compass CSS Validator could not be loaded/
|
198
|
-
pending "Missing Dependency: sudo gem install chriseppstein-compass-validator"
|
199
|
-
else
|
200
|
-
@last_result.should =~ /Compass CSS Validator/
|
201
|
-
end
|
202
|
-
end
|
203
|
-
|
204
|
-
Then /^I am informed that my css is valid.$/ do
|
205
|
-
@last_result.should =~ /Your CSS files are valid\./
|
206
|
-
end
|
207
|
-
|
208
|
-
Then /^I am told statistics for each file:$/ do |table|
|
209
|
-
# table is a Cucumber::Ast::Table
|
210
|
-
table.raw.each do |row|
|
211
|
-
re = Regexp.new row.join(' *\| *')
|
212
|
-
@last_result.should =~ re
|
213
|
-
end
|
214
|
-
end
|
215
|
-
|
216
|
-
Then /^I should see the following "([^"]+)" commands:$/ do |kind, table|
|
217
|
-
|
218
|
-
|
219
|
-
Then %Q{I should be shown a list of "#{kind}" commands}
|
220
|
-
|
221
|
-
commands = @last_command_list.map{|c| c =~ /^\s+\* ([^ ]+)\s+- [A-Z].+$/; [$1]}
|
222
|
-
table.diff!(commands)
|
223
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
Given /^the "([^\"]*)" directory exists$/ do |directory|
|
2
|
-
FileUtils.mkdir_p directory
|
3
|
-
end
|
4
|
-
|
5
|
-
Given /^and I have a fake extension at (.*)$/ do |directory|
|
6
|
-
FileUtils.mkdir_p File.join(directory, 'stylesheets')
|
7
|
-
FileUtils.mkdir_p File.join(directory, 'templates/project')
|
8
|
-
end
|
9
|
-
|
10
|
-
Then /^the list of frameworks includes "([^\"]*)"$/ do |framework|
|
11
|
-
@last_result.split("\n").map{|f| f.strip}.should include(framework)
|
12
|
-
end
|
13
|
-
|
@@ -1,61 +0,0 @@
|
|
1
|
-
|
2
|
-
require 'compass/commands/project_base'
|
3
|
-
require 'compass/commands/update_project'
|
4
|
-
|
5
|
-
module Compass
|
6
|
-
module Commands
|
7
|
-
module InteractiveOptionsParser
|
8
|
-
def set_options(opts)
|
9
|
-
opts.banner = %Q{
|
10
|
-
Usage: compass interactive [path/to/project] [options]
|
11
|
-
|
12
|
-
Description:
|
13
|
-
Interactively evaluate SassScript
|
14
|
-
|
15
|
-
Options:
|
16
|
-
}.strip.split("\n").map{|l| l.gsub(/^ {0,10}/,'')}.join("\n")
|
17
|
-
|
18
|
-
super
|
19
|
-
end
|
20
|
-
end
|
21
|
-
class Interactive < ProjectBase
|
22
|
-
|
23
|
-
register :interactive
|
24
|
-
|
25
|
-
def initialize(working_path, options)
|
26
|
-
super
|
27
|
-
end
|
28
|
-
|
29
|
-
def perform
|
30
|
-
require 'sass/repl'
|
31
|
-
Sass::Repl.new.run
|
32
|
-
end
|
33
|
-
|
34
|
-
class << self
|
35
|
-
|
36
|
-
def option_parser(arguments)
|
37
|
-
parser = Compass::Exec::CommandOptionParser.new(arguments)
|
38
|
-
parser.extend(Compass::Exec::GlobalOptionsParser)
|
39
|
-
parser.extend(Compass::Exec::ProjectOptionsParser)
|
40
|
-
parser.extend(InteractiveOptionsParser)
|
41
|
-
end
|
42
|
-
|
43
|
-
def usage
|
44
|
-
option_parser([]).to_s
|
45
|
-
end
|
46
|
-
|
47
|
-
def description(command)
|
48
|
-
"Interactively evaluate SassScript"
|
49
|
-
end
|
50
|
-
|
51
|
-
def parse!(arguments)
|
52
|
-
parser = option_parser(arguments)
|
53
|
-
parser.parse!
|
54
|
-
parser.options
|
55
|
-
end
|
56
|
-
|
57
|
-
end
|
58
|
-
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
@@ -1,162 +0,0 @@
|
|
1
|
-
require 'compass/commands/project_base'
|
2
|
-
require 'compass/commands/update_project'
|
3
|
-
|
4
|
-
module Compass
|
5
|
-
module Commands
|
6
|
-
module StatsOptionsParser
|
7
|
-
def set_options(opts)
|
8
|
-
opts.banner = %Q{
|
9
|
-
Usage: compass stats [path/to/project] [options]
|
10
|
-
|
11
|
-
Description:
|
12
|
-
Compile project at the path specified (or the current
|
13
|
-
directory if not specified) and then compute statistics
|
14
|
-
for the sass and css files in the project.
|
15
|
-
|
16
|
-
Options:
|
17
|
-
}.strip.split("\n").map{|l| l.gsub(/^ {0,10}/,'')}.join("\n")
|
18
|
-
|
19
|
-
super
|
20
|
-
end
|
21
|
-
end
|
22
|
-
class ProjectStats < UpdateProject
|
23
|
-
|
24
|
-
register :stats
|
25
|
-
|
26
|
-
def initialize(working_path, options)
|
27
|
-
super
|
28
|
-
assert_project_directory_exists!
|
29
|
-
end
|
30
|
-
|
31
|
-
def perform
|
32
|
-
super
|
33
|
-
require 'compass/stats'
|
34
|
-
compiler = new_compiler_instance
|
35
|
-
sass_files = sorted_sass_files(compiler)
|
36
|
-
rows = [[ :-, :-, :-, :-, :-, :-, :- ],
|
37
|
-
[ 'Filename', 'Rules', 'Properties', 'Mixins Defs', 'Mixins Used', 'CSS Rules', 'CSS Properties' ],
|
38
|
-
[ :-, :-, :-, :-, :-, :-, :- ]]
|
39
|
-
maximums = [ 8, 5, 10, 14, 11, 9, 14 ]
|
40
|
-
alignments = [ :left, :right, :right, :right, :right, :right, :right ]
|
41
|
-
delimiters = [ ['| ', ' |'], [' ', ' |'], [' ', ' |'], [' ', ' |'], [' ', ' |'], [' ', ' |'], [' ', ' |'] ]
|
42
|
-
totals = [ "Total (#{sass_files.size} files):", 0, 0, 0, 0, 0, 0 ]
|
43
|
-
|
44
|
-
sass_files.each do |sass_file|
|
45
|
-
css_file = compiler.corresponding_css_file(sass_file) unless sass_file[0..0] == '_'
|
46
|
-
row = filename_columns(sass_file)
|
47
|
-
row += sass_columns(sass_file)
|
48
|
-
row += css_columns(css_file)
|
49
|
-
row.each_with_index do |c, i|
|
50
|
-
maximums[i] = [maximums[i].to_i, c.size].max
|
51
|
-
totals[i] = totals[i] + c.to_i if i > 0
|
52
|
-
end
|
53
|
-
rows << row
|
54
|
-
end
|
55
|
-
rows << [:-] * 7
|
56
|
-
rows << totals.map{|t| t.to_s}
|
57
|
-
rows << [:-] * 7
|
58
|
-
rows.each do |row|
|
59
|
-
row.each_with_index do |col, i|
|
60
|
-
print pad(col, maximums[i], :align => alignments[i], :left => delimiters[i].first, :right => delimiters[i].last)
|
61
|
-
end
|
62
|
-
print "\n"
|
63
|
-
end
|
64
|
-
if @missing_css_parser
|
65
|
-
puts "\nInstall css_parser to enable stats on your css files:\n\n\tgem install css_parser"
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
def pad(c, max, options = {})
|
70
|
-
options[:align] ||= :left
|
71
|
-
if c == :-
|
72
|
-
filler = '-'
|
73
|
-
c = ''
|
74
|
-
else
|
75
|
-
filler = ' '
|
76
|
-
end
|
77
|
-
spaces = max - c.size
|
78
|
-
filled = filler * [spaces,0].max
|
79
|
-
"#{options[:left]}#{filled if options[:align] == :right}#{c}#{filled if options[:align] == :left}#{options[:right]}"
|
80
|
-
end
|
81
|
-
|
82
|
-
def sorted_sass_files(compiler)
|
83
|
-
sass_files = compiler.sass_files(:exclude_partials => false)
|
84
|
-
sass_files.map! do |s|
|
85
|
-
filename = Compass.deprojectize(s, File.join(Compass.configuration.project_path, Compass.configuration.sass_dir))
|
86
|
-
[s, File.dirname(filename), File.basename(filename)]
|
87
|
-
end
|
88
|
-
sass_files = sass_files.sort_by do |s,d,f|
|
89
|
-
File.join(d, f[0] == ?_ ? f[1..-1] : f)
|
90
|
-
end
|
91
|
-
sass_files.map!{|s,d,f| s}
|
92
|
-
end
|
93
|
-
|
94
|
-
def filename_columns(sass_file)
|
95
|
-
filename = Compass.deprojectize(sass_file, working_path)
|
96
|
-
[filename]
|
97
|
-
end
|
98
|
-
|
99
|
-
def sass_columns(sass_file)
|
100
|
-
sf = Compass::Stats::SassFile.new(sass_file)
|
101
|
-
sf.analyze!
|
102
|
-
%w(rule_count prop_count mixin_def_count mixin_count).map do |t|
|
103
|
-
sf.send(t).to_s
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
107
|
-
def css_columns(css_file)
|
108
|
-
if File.exists?(css_file)
|
109
|
-
cf = Compass::Stats::CssFile.new(css_file)
|
110
|
-
cf.analyze!
|
111
|
-
%w(selector_count prop_count).map do |t|
|
112
|
-
cf.send(t).to_s
|
113
|
-
end
|
114
|
-
else
|
115
|
-
return [ '--', '--' ]
|
116
|
-
end
|
117
|
-
rescue LoadError
|
118
|
-
@missing_css_parser = true
|
119
|
-
return [ 'DISABLED', 'DISABLED' ]
|
120
|
-
end
|
121
|
-
|
122
|
-
class << self
|
123
|
-
|
124
|
-
def option_parser(arguments)
|
125
|
-
parser = Compass::Exec::CommandOptionParser.new(arguments)
|
126
|
-
parser.extend(Compass::Exec::GlobalOptionsParser)
|
127
|
-
parser.extend(Compass::Exec::ProjectOptionsParser)
|
128
|
-
parser.extend(StatsOptionsParser)
|
129
|
-
end
|
130
|
-
|
131
|
-
def usage
|
132
|
-
option_parser([]).to_s
|
133
|
-
end
|
134
|
-
|
135
|
-
def description(command)
|
136
|
-
"Report statistics about your stylesheets"
|
137
|
-
end
|
138
|
-
|
139
|
-
def primary; false; end
|
140
|
-
|
141
|
-
def parse!(arguments)
|
142
|
-
parser = option_parser(arguments)
|
143
|
-
parser.parse!
|
144
|
-
parse_arguments!(parser, arguments)
|
145
|
-
parser.options
|
146
|
-
end
|
147
|
-
|
148
|
-
def parse_arguments!(parser, arguments)
|
149
|
-
if arguments.size == 1
|
150
|
-
parser.options[:project_name] = arguments.shift
|
151
|
-
elsif arguments.size == 0
|
152
|
-
# default to the current directory.
|
153
|
-
else
|
154
|
-
raise Compass::Error, "Too many arguments were specified."
|
155
|
-
end
|
156
|
-
end
|
157
|
-
|
158
|
-
end
|
159
|
-
|
160
|
-
end
|
161
|
-
end
|
162
|
-
end
|