Skip to content

Commit ff86135

Browse files
committed
Cleans up some require/abort lines
1 parent 69f0c0f commit ff86135

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

lib/csscss/cli.rb

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,13 @@ def deprecate(message)
141141
end
142142

143143
def enable_compass(config = nil)
144-
require "compass"
144+
abort 'Must install the "compass" gem before enabling its extensions' unless gem_installed?("compass")
145145

146146
if config
147147
Compass.add_configuration(config)
148148
else
149149
Compass.add_configuration("config.rb") if File.exist?("config.rb")
150150
end
151-
rescue LoadError
152-
abort "Must install compass gem before enabling its extensions"
153151
end
154152

155153
def windows_1_9
@@ -166,9 +164,7 @@ def gem_installed?(gem_name)
166164
end
167165

168166
def load_sass_file(filename)
169-
if !gem_installed?("sass") then
170-
abort 'Must install the "sass" gem before parsing sass/scss files'
171-
end
167+
abort 'Must install the "sass" gem before parsing sass/scss files' unless gem_installed?("sass")
172168

173169
sass_options = {cache:false}
174170
sass_options[:load_paths] = Compass.configuration.sass_load_paths if @compass
@@ -185,10 +181,7 @@ def load_sass_file(filename)
185181
end
186182

187183
def load_less_file(filename)
188-
if !gem_installed?("less") then
189-
abort 'Must install the "less" gem before parsing less files'
190-
end
191-
184+
abort 'Must install the "less" gem before parsing less files' unless gem_installed?("less")
192185
contents = load_css_file(filename)
193186
Less::Parser.new.parse(contents).to_css
194187
end

0 commit comments

Comments
 (0)