Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

sigma.js javascript library; highly ruby influenced, async loading, OO methods, BDD tested, experimental

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 public
Octocat-spinner-32 spec
Octocat-spinner-32 vendor
Octocat-spinner-32 README
Octocat-spinner-32 Rakefile
README
Sigma.js javascript library (somewhat experimental)
© 2010 Steven Soroka (MIT license)

http://github.com/ssoroka/sigma

Right now the most compelling feature is the ability to asynchronously load any script and execute code once it's loaded:

    Sigma.async_script_load('http://documentcloud.github.com/underscore/underscore-min.js', '_', function() {
      _([1,2,3,2,3,1]).uniq();
    });
    
Or separate loading from the dependency!

    Sigma.async_script_load('http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js');
    
    Sigma.wait_for_const_load('jQuery', function() {
      jQuery('#loaded').text('jQuery has been dynamically loaded');
    })
    
Misc other examples:

    Sigma.string('ActiveRecord::Base').underscore() // returns 'active_record/base'
    
    Sigma.array(['one', 'two', 'three']).to_sentence() // returns 'one, two, and three'
    
    Sigma.benchmark(function() {
      my_speedy_function()
    }, 1000);  // returns milliseconds to execute 1000 times
    
Installing the latest version:

    curl https://github.com/ssoroka/sigma/raw/master/public/javascripts/sigma.js > public/javascripts/sigma.js

    
See public/javascripts/sigma.js for other methods/docs

See spec/javascripts/*_spec.js for jasmine specs

Lots more pseudo-planned.  Feedback to @ssoroka

Something went wrong with that request. Please try again.