Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

Sweetchuck/grunt-compass-wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Configuration

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.

Configuration

With the default options the

grunt compass-compile

is equivalent to

bundle exec compass compile

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

Configuration

options.rubyExecutable

Type: String

Default value: ''

options.bundleExecutable

Type: String

Default value: 'bundle'

options.bundleExec

Type: Boolean

Default value: true

options.compassExecutable

Type: String

Default value: 'compass'

options.args

Type: Object

Default value: {}

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

options.args.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: {
      args: {
        require: {
          'path/to/gem-01': true,
          'path/to/gem-02': true,
          'path/to/gem-03': true
        }
      }
    },
    'my-target-01': {
      options: {
        args: {
          require: {
            'path/to/gem-02': false
          }
        }
      }
    }
  }
});
compass-compile --require 'path/to/gem-01' --require 'path/to/gem-03'

options.args.sourceMap

Type: Boolean

Default value: null

options.args.debugInfo

Type: Boolean

Default value: null

options.args.load

Type: String

Default value: ''

options.args.loadAll

Type: String

Default value: ''

options.args.importPath

Type: String

Default value: ''

options.args.quiet

Type: Boolean

Default value: false

options.args.trace

Type: Boolean

Default value: false

options.args.boring

Type: Boolean

Default value: false

options.args.config

Type: String

Default value: ''

options.args.app

Type: String

Default value: ''

options.args.appDir

Type: String

Default value: ''

options.args.sassDir

Type: String

Default value: ''

options.args.cssDir

Type: String

Default value: ''

options.args.imagesDir

Type: String

Default value: ''

options.args.javascriptDir

Type: String

Default value: ''

options.args.fontsDir

Type: String

Default value: ''

options.args.environment

Type: String

Default value: ''

options.args.outputStyle

Type: String

Default value: ''

options.args.relativeAssets

Type: Boolean

Default value: false

options.args.noLineComments

Type: Boolean

Default value: false

options.args.httpPath

Type: String

Default value: ''

options.args.generatedImagesPath

Type: String

Default value: ''

files

For more information see the Grunt documentation Configuring tasks/files

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

Flags

You can modify the arguments by Flags

Flag quiet

Override the value of options.args.quiet argument with true.

Flag trace

Override the value of options.args.trace argument with true.

Flag force

Override the value of options.args.force argument with true.

Flag boring

Override the value of options.args.boring argument with true.

Flag development

Override the value of options.args.environment argument with 'development'.

Flag production

Override the value of options.args.environment argument with 'production'.

Flag nested

Override the value of options.args.outputStyle argument with 'nested'.

Flag expanded

Override the value of options.args.outputStyle argument with 'expanded'.

Flag compact

Override the value of options.args.outputStyle argument with 'compact'.

Flag compressed

Override the value of options.args.outputStyle argument with 'compressed'.

Flag relative-assets

Override the value of options.args.relativeAssets argument with true.

Flag no-line-comments

Override the value of options.args.noLineComments argument with true.

Examples

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

Options, args and files

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',
      args: {
        boring: true
      }
    },
    'my-01': {
      files: {
        src: ['**/config.rb']
      }
    },
    'my-02': {
      options: {
        rubyExecutable: '',
        bundleExecutable: '',
        args: {
          boring: false,
          environment: 'production'
        }
      },
      files: {
        src: ['**/config.rb']
      }
    }
  }
});

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

Custom args

grunt.initConfig({
  'compass-compile': {
    options: {
      args: {
        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'

Args and flags

grunt.initConfig({
  'compass-compile': {
    options: {
      args: {
        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.5 - 2015-05-24
    • Rename a "options.arguments" to "options.args".
  • 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 27, 2015.

About

Grunt plugin to run compass related CLI commands.

Resources

Stars

Watchers

Forks

Packages

No packages published