0.0.4 • Published 10 years ago

grunt-compass-wrapper v0.0.4

Weekly downloads
7
License
GPL-2.0
Repository
github
Last release
10 years ago

grunt-compass-wrapper

Build status

Build Status: Linux

Install

Install with npm

npm install grunt-compass-wrapper --save-dev

Tasks

Every options is the same for for each tasks.

compass-clean

Wrapper around the $ compass clean command.

Remove generated files and the sass cache.

Supported arguments

With the default options the

grunt compass-clean

is equivalent to

bundle exec compass clean

compass-compile

Wrapper around the $ compass compile command.

Compile Sass stylesheets to CSS.

Supported arguments

With the default options the

grunt compass-compile

is equivalent to

bundle exec compass complie

compass-validate

Wrapper around the $ compass validate command.

Validate your generated css.

Supported arguments

With the default options the

grunt compass-validate

is equivalent to

bundle exec compass validate

Options

rubyExecutable

Type: String

Default value: ''

bundleExecutable

Type: String

Default value: 'bundle'

bundleExec

Type: Boolean

Default value: true

compassExecutable

Type: String

Default value: 'compass'

arguments

Type: Object

Default value: {}

Different options than the default ones

grunt.initConfig({
  'compass-compile': {
    options: {
      rubyExecutable: '/home/foo/.rvm/rubies/ruby-2.1.3/bin/ruby',
      bundleExecutable: '/home/foo/.rvm/gems/ruby-2.1.3/bin/bundle',
      arguments: {
        boring: true
      }
    },
    'my-01': {
      files: {
        src: ['**/config.rb']
      }
    },
    'my-02': {
      options: {
        rubyExecutable: '',
        bundleExecutable: '',
        arguments: {
          boring: false,
          environment: 'production'
        }
      },
      files: {
        src: ['**/config.rb']
      }
    }
  }
});
grunt compass-compile:my-01
echo 'is equivalent to'
/home/foo/.rvm/rubies/ruby-2.1.3/bin/ruby /home/foo/.rvm/gems/ruby-2.1.3/bin/bundle exec compass compile --boring
grunt compass-compile:my-02
echo 'is equivalent to'
bundle exec compass compile --environment production 

Arguments

All argument is same as the CLI counterpart. You can check them with the $ compass {clean|compile|validate} --help command.

require

Type: Object

Default value: {}

Key-value pairs where the key is the desired library and the value is false or true.

grunt.initConfig({
  'compass-compile': {
    options: {
      arguments: {
        require: {
          'path/to/gem-01': true,
          'path/to/gem-02': true,
          'path/to/gem-03': true
        }
      }
    },
    'my-target-01': {
      options: {
        arguments: {
          require: {
            'path/to/gem-02': false
          }
        }
      }
    }
  }
});
compass-compile --require 'path/to/gem-01' --require 'path/to/gem-03'

sourceMap

Type: Boolean

Default value: null

debugInfo

Type: Boolean

Default value: null

load

Type: String

Default value: ''

loadAll

Type: String

Default value: ''

importPath

Type: String

Default value: ''

quiet

Type: Boolean

Default value: false

trace

Type: Boolean

Default value: false

boring

Type: Boolean

Default value: false

config

Type: String

Default value: ''

app

Type: String

Default value: ''

appDir

Type: String

Default value: ''

sassDir

Type: String

Default value: ''

cssDir

Type: String

Default value: ''

imagesDir

Type: String

Default value: ''

javascriptDir

Type: String

Default value: ''

fontsDir

Type: String

Default value: ''

environment

Type: String

Default value: ''

outputStyle

Type: String

Default value: ''

relativeAssets

Type: Boolean

Default value: false

noLineComments

Type: Boolean

Default value: false

httpPath

Type: String

Default value: ''

generatedImagesPath

Type: String

Default value: ''

Flags

You can modify the arguments by Flags

Flag - quiet

Override the value of quiet argument with true.

Flag - trace

Override the value of trace argument with true.

Flag - force

Override the value of force argument with true.

Flag - boring

Override the value of boring argument with true.

Flag - development

Override the value of environment argument with 'development'.

Flag - production

Override the value of environment argument with 'production'.

Flag - nested

Override the value of outputStyle argument with 'nested'.

Flag - expanded

Override the value of outputStyle argument with 'expanded'.

Flag - compact

Override the value of outputStyle argument with 'compact'.

Flag - compressed

Override the value of outputStyle argument with 'compressed'.

Flag - relative-assets

Override the value of relativeAssets argument with true.

Flag - no-line-comments

Override the value of noLineComments argument with true.

Examples

Example - Basic

require('jit-grunt')(
  grunt,
  // Mapping.
  {
    'compass-clean': 'grunt-compass-wrapper',
    'compass-compile': 'grunt-compass-wrapper',
    'compass-validate': 'grunt-compass-wrapper'
  }
);

grunt.initConfig({
  'compass-clean': {
    'my-01': {
      files: {
        src: ['./path/to/dir/config.rb']
      }
    }
  },
  'compass-compile': {
    'my-01': {
      files: {
        src: ['./path/to/dir/config.rb']
      }
    }
  },
  'compass-validate': {
    'my-01': {
      files: {
        src: ['./path/to/dir/config.rb']
      }
    }
  }
});

grunt.registerTask('scss-compile', [
  'compass-clean',
  'compass-compile',
  'compass-validate'
]);
grunt scss-compile
echo 'is equivalent to'
bundle exec compass clean
bundle exec compass compile
bundle exec compass validate

Example - Without bundle

grunt.initConfig({
  'compass-compile': {
    options: {
      bundleExec: false
    },
    'my-01': {
      files: {
        src: ['./path/to/dir/config.rb']
      }
    }
  }
});
grunt compass-compile
echo 'is equivalent to'
compass compile

Example - Arguments

grunt.initConfig({
  'compass-compile': {
    options: {
      arguments: {
        environment: 'development',
        outputStyle: 'nested'
      }
    },
    'my-01': {
      files: {
        src: ['./path/to/dir/config.rb']
      }
    }
  }
});
grunt compass-compile
echo 'is equivalent to'
bundle exec compass compile --environment 'development' --output-style 'nested'

Example - Arguments and flags

grunt.initConfig({
  'compass-compile': {
    options: {
      arguments: {
        environment: 'development',
        outputStyle: 'nested'
      }
    },
    'my-01': {
      files: {
        src: ['./path/to/dir/config.rb']
      }
    }
  }
});

grunt.registerTask('scss-compile-prod', [
  'compass-compile:my-01:production:compressed'
]);
grunt compass-compile:my-01
echo 'is equivalent to'
bundle exec compass compile --environment 'development' --output-style 'nested'
grunt compass-compile:my-01:production:compressed
echo 'is equivalent to'
grunt scss-compile-prod
echo 'is equivalent to'
bundle exec compass compile --environment 'production' --output-style 'compressed'

Author

Andor Dávid

Release History

  • v0.0.4 2015-05-24
    • Improved documentation
  • v0.0.3 2015-05-22
    • Nobody knows
  • v0.0.2 2015-05-18
    • Flag support

License

Copyright (c) 2015 Andor Dávid, contributors.


This file was generated by grunt-verb on May 24, 2015.