Skip to content
sigma.js javascript library; highly ruby influenced, async loading, OO methods, BDD tested, experimental
JavaScript Ruby
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
public/javascripts
spec/javascripts
vendor/jasmine-1.0.1.1
README
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.