1.0.0 • Published 7 years ago

sassy v1.0.0

Weekly downloads
9
License
DBAA, see license...
Repository
github
Last release
7 years ago

Sassy

Sassy eases the pain for object-oriented programmers and makes getting around in SASS a little easier.

###Overview

Sassy provides some essential functionality and makes working with maps much easier.

It also includes a debugging utility for unit-testing (see notes at the bottom).

Methods:

  • get
  • set
  • has
  • compare
  • type
  • types
  • types-same
  • contains
  • explode
  • implode
  • thru
  • print
  • apply
  • increase
  • decrease

Method Uses:

@note All methods that use a ( map, key, ... ) signature allow for nested maps using a key list!

-

Signature:

  • get( map, key )
  • get( map, ( nested, key ) )

Supported types: map

-

Signature:

  • set( map, key, value )
  • set( map, ( nested, key ), value )

@note Remember SASS objects are immutable. Replace your map reference each time!

Supported types: map

-

Signature: has( map, key, return, default )

Optional default value IF NO KEY (otherwise returns null).

Supported types: map

-

Signature: compare( A, B )

Supported types: any

-

Signature: type( var, against )

Supported types: any

-

Signature: types ( varN... )

Supported types: any

-

Signature: types-same ( varN... )

Supported types: any

-

Signature: contains( haystack, needle )

Supported types: map, list, string

-

Signature: explode( string, delimiter='-' )

Supported types: string

-

Signature: implode( list, wrap=false, glue=', ' )

@note wrap is optional. if true, adds ( ) to string before returning

Supported types: list

-

Signature: thru( any )

Supported types: any

-

Signature: print( map )

Supported types: map

-

Signature:

  • apply( method_name, argslist... )
  • apply( method_name, ( list, of, args ) )
  • apply( method_name, argsmap )

Supported types: function

-

Signature:

  • increase( number, x=1 )
  • increase( map, key, x=1 )

Supported types: number, map with number as value to a key

-

Signature:

  • decrease( number, x=1 )
  • decrease( map, key, x=1 )

Supported types: number, map with number as value to a key

-

Signature: pluck( key, maps.. )

@note also accepts a list of maps

Supported types: map


Sassy Debugger

I put together a SASS debug utility based loosely on my much more robust JS debugger.

There are only 3 mixins you need (really only "test", but it's better to use all 3).

-

Signature: @include start(debug_name)

-

Signature:

You should always use a list of arguments instead of a result boolean.

The result boolean option is there for edge cases where comparing the result isn't so easy.

If you need to pass a single list, use an argsmap

( args: ( your, list ) )

You can add a variation string as the 4th parameter. Useful if debugging similar signatures.

-

Mixin: complete

reports a summary of pass/fail

@note fire this after all of your tests. it will tell you that all tests passed or which ones failed (and why).

--

That's all! Enjoy the software!

1.0.0

7 years ago

0.0.29

11 years ago

0.0.28

11 years ago

0.0.26

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago