This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Lib | |
# this loads our class methods when called by "include" | |
def self.included(base) | |
base.extend(ClassMethods) | |
# code here will run when lib is imported, in Lib module context | |
puts "Lib context: #{self.to_s}" | |
# this calls the lib_init method to run any class set up code | |
base.send(:lib_init) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.HashMap; | |
public class CodeRunner { | |
TestClass testClass = new TestClass(); | |
String answer_format = "Test1: %s\nTest2: %s"; | |
static String default_output_template = "Correct answers:\nTest1=%s\nTest2=%s\n"; | |
public static void main(String[] args) { | |
CodeRunner code = new CodeRunner(); | |
HashMap answers = code.tests(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
require 'net/http' | |
# adds resumption token to URL if needed | |
def slice_url(options ={}) | |
resume = options[:resume] | |
url = "http://node01.public.learningregistry.net/slice?any_tags=lrmi" | |
if resume | |
url = "http://node01.public.learningregistry.net/slice?any_tags=lrmi&resumption_token=#{resume}" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Scans a CouchApp folder for changes, and on detection auto pushes to Couch | |
# this allows you to simply save your JS files and test them from CLI without re-loading manually every time | |
# (c) Steve Midgley 2011 | |
# Released under Apache 2.0 license | |
# (http://www.apache.org/licenses/LICENSE-2.0.html) | |
require 'rake' | |
def running_windows? | |
!(RUBY_PLATFORM =~ /win32/).nil? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// (c) Steve Midgley 2011 | |
// Released under Apache 2.0 license | |
// (http://www.apache.org/licenses/LICENSE-2.0.html) | |
// Use: This file validates an incoming CouchDB JSON document for compatibility | |
// with Learning Registry specification (currently 0.15.0) | |
// Install: For use with CouchDB/CouchApp. This file goes in the root | |
// of a CouchApp, and should be pushed along with the rest of the app: | |
// E.g., "couchapp push" |
NewerOlder