Skip to content
This repository has been archived by the owner on Nov 22, 2018. It is now read-only.

Commit

Permalink
Merge pull request #26 from growcss/develop
Browse files Browse the repository at this point in the history
Release v2.0.7
  • Loading branch information
prisis committed Jul 27, 2015
2 parents cc07c29 + 0c1b862 commit e173821
Show file tree
Hide file tree
Showing 18 changed files with 90 additions and 55 deletions.
28 changes: 1 addition & 27 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,13 @@ module.exports = function(grunt) {
// measures the time each task takes
require('time-grunt')(grunt);

require('jit-grunt')(grunt, {
scsslint: 'grunt-scss-lint',
mochacli: 'grunt-mocha-cli'
});

// load grunt config
require('load-grunt-config')(grunt, {

// path to task.js files, defaults to grunt dir
configPath: [
path.join(process.cwd(), 'tasks'),
],

// There are certain scenarios where you might have a base config for your team,
// and you want to be able to override some of the config based on your personal setup.
//overridePath: [],
configPath: path.join(process.cwd(), 'tasks'),

// auto grunt.initConfig
init: true,

// data passed into config. Can use with <%= test %>
//data: {},

// can optionally pass options to load-grunt-tasks.
// If you set to false, it will disable auto loading tasks.
jitGrunt: {
customTasksDir: 'tasks'
},

//can post process config object before it gets passed to grunt
//postProcess: function() {},

//allows to manipulate the config object before it gets merged with the data object
//preMerge: function() {}
});
};
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# sass-config-manager

[![Author](http://img.shields.io/badge/author-@@anolilab-blue.svg?style=flat-square)](https://twitter.com/@anolilab)
[![Author](http://img.shields.io/badge/author-@anolilab-blue.svg?style=flat-square)](https://twitter.com/anolilab)
[![devDependency Status](https://david-dm.org/growcss/sass-config-manager/dev-status.svg?style=flat-square)](https://david-dm.org/growcss/sass-config-manager#info=devDependencies)
[![npm](https://img.shields.io/npm/v/growcss-sass-config-manager.svg?style=flat-square)](https://www.npmjs.com/package/growcss-sass-config-manager)
[![Bower](https://img.shields.io/bower/v/sass-config-manager.svg?style=flat-square)](https://github.com/growcss/sass-config-manager)
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "growcss-sass-config-manager",
"version": "2.0.6",
"version": "2.0.7",
"homepage": "http://growcss.com/",
"authors": [
"Daniel Bannert <d.bannert@anolilab.de>"
Expand Down
9 changes: 3 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "growcss-sass-config-manager",
"version": "2.0.6",
"version": "2.0.7",
"description": "A dot-syntax configuration (Map) library for Sass (mixin / function).",
"author": {
"name": "Daniel Bannert",
Expand Down Expand Up @@ -35,14 +35,11 @@
"grunt-newer": "^1.1.1",
"grunt-sass-import": "^0.1.0",
"grunt-scss-lint": "^0.3.6",
"jit-grunt": "^0.9.1",
"load-grunt-config": "^0.17.1",
"load-grunt-config": "^0.17.2",
"load-grunt-tasks": "^3.2.0",
"sass-true": "^2.0.2",
"time-grunt": "^1.2.1"
},
"peerDependencies": {
"grunt": ">=0.4.5"
},
"keywords": [
"grunt",
"bower",
Expand Down
7 changes: 7 additions & 0 deletions src/scss/config-manager.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
@charset "UTF-8";

// sass-config-manager by Anolilab
// http://growcss.com
// Licensed under MIT Open Source
//
// Here are all the functions, helpers, mixins and variables.
// - - - - - - - - - - - - - - - - - - - - - - - - -
@import "utils/variables";

@import "helpers/helpers";
Expand Down
2 changes: 2 additions & 0 deletions src/scss/functions/_config-get.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@charset "UTF-8";

// Gets a value to/from a configuration path
//
// @function config-get
Expand Down
2 changes: 2 additions & 0 deletions src/scss/functions/_config-has.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@charset "UTF-8";

// Returns whether a configuration path exists
//
// @function config-has
Expand Down
25 changes: 25 additions & 0 deletions src/scss/functions/_config-reset.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@charset "UTF-8";

// Remove settings
//
// @function config-reset
//
// @param $settings {string} Configuration path
// @param $default {bool} Whether the configuration is default
//
// @return {bool} True if the configuration path is removed.
@function config-reset($settings, $default: false) {
@if length($settings) == 1 {
$settings: nth($settings, 1);
}

@each $setting in $settings {
@if ($default) {
$config-default: map-remove($config-default, $setting) !global;
} @else {
$config-attr: map-remove($config-attr, $setting) !global;
}
}

@return true;
}
2 changes: 2 additions & 0 deletions src/scss/functions/_config-set.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@charset "UTF-8";

// Sets a value to/from a configuration path
//
// @function config
Expand Down
5 changes: 5 additions & 0 deletions src/scss/functions/_functions.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
@charset "UTF-8";

// Here are all the functions.
// - - - - - - - - - - - - - - - - - - - - - - - - -
@import "config-set";
@import "config-get";
@import "config-has";
@import "config-reset";
4 changes: 4 additions & 0 deletions src/scss/helpers/_helpers.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
@charset "UTF-8";

// Here are all the helpers.
// - - - - - - - - - - - - - - - - - - - - - - - - -
@import "list";
@import "str";
@import "map";
2 changes: 2 additions & 0 deletions src/scss/helpers/_list.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@charset "UTF-8";

// Return list-map from `$list` and ensure input list-map is list-of-lists
//
// @function list-map-check
Expand Down
2 changes: 2 additions & 0 deletions src/scss/helpers/_map.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@charset "UTF-8";

// Sets a value to a Map by the map path
//
// @function config-map-set
Expand Down
2 changes: 2 additions & 0 deletions src/scss/helpers/_str.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@charset "UTF-8";

// Joins list elements with a string
//
// @function str-join
Expand Down
16 changes: 15 additions & 1 deletion src/scss/utils/_mixins.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
@charset "UTF-8";

// Sass Mixins
// - - - - - - - - - - - - - - - - - - - - - - - - -

// Sets a value to a configuration path
//
// @mixin config-set
//
// @param $key {string} The configuration key
// @param $key {string} The configuration key
// @param $value {*|null} The value to set
// @param $default {bool} Whether the configuration is default
@mixin config-set($key, $value, $default: false) {
$config: config-set($key, $value, $default);
}

// Remove settings
//
// @mixin config-reset
//
// @param $settings {string} Configuration path
// @param $default {bool} Whether the configuration is default
//
// @return {bool} True if the configuration path is removed.
@mixin config-reset($settings, $default:false) {
$config-reset: config-reset($settings);
}
2 changes: 2 additions & 0 deletions src/scss/utils/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@charset "UTF-8";

// Sass Variables
// - - - - - - - - - - - - - - - - - - - - - - - - -

Expand Down
16 changes: 0 additions & 16 deletions tasks/sass_import.js

This file was deleted.

17 changes: 14 additions & 3 deletions tests/specs/scss/functions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@
$expect: ("bar": "foo", "color": #000);

@include assert-equal($get, $expect, "Returns test map.");

$config-attr: ();
}

// Testing get functions
Expand All @@ -96,6 +94,19 @@
$get: config-has("test-not-found");
$expect: false;

@include assert-equal($get, $expect, "Returns true.");
@include assert-equal($get, $expect, "Returns false.");
}

// Testing set functions
@include test("config-reset [function] Remove config map.") {
@include config-set("remove.bar", "foo");
@include config-set("remove.color", #fff);

@include config-reset("remove");

$expect: null;
$get: config-get("remove");

@include assert-equal($get, $expect, "Check if config map is removed.");
}
}

0 comments on commit e173821

Please sign in to comment.