cc-scripts / cc-scripts

A collection of ComputerCraft scripts
5 stars 5 forks source link

Merge `apis/betterapi` into `apis/cc_scripts` #8

Open damien opened 11 years ago

damien commented 11 years ago

Better API is nice, but most if not all the APIs we'll be loading with cc-scripts will be bundled with cc-scripts. We should consolidate these two APIs such that:

  1. We can call cc_scripts.loadAPI("installer") instead of os.loadAPI("/cc-scripts/apis/installer")
  2. betterapi's patched os.loadAPI method is scoped within the cc-script framework and doesn't clobber the expected behavior of os.loadAPI.
  3. cc_scripts.loadAPI can then support closures and metatables.

@eric-wieser: What are your thoughts on this? Any objections? I personally like the idea of not changing a global function to work differently than people are used to and this particular approach would let us use your betterapi awesomeness to write more complex APIs geared for inclusion via cc_scripts.loadAPI.

damien commented 11 years ago

Awesome stuff! I'll test these changes myself soon and merge them in once I've verified there aren't any bugs or regressions.

eric-wieser commented 11 years ago

You're about to see a huge changeset, after I finished testing - might want to wait for the pull request