Permalink
Browse files

- some progress

  • Loading branch information...
1 parent 076b3a8 commit d152174d3d67834569f61aec7aaed9c3eee52664 Nickolay Platonov committed Aug 30, 2010
Showing with 723 additions and 87 deletions.
  1. +3 −8 Components.JS
  2. +78 −0 README.md
  3. +16 −9 lib/JSON2.js
  4. +19 −69 lib/JSON2.mmd
  5. +482 −0 static/json2.js
  6. +60 −0 t/020_stringify.t.js
  7. +62 −0 t/030_parse.t.js
  8. +3 −1 t/index.js
View
@@ -1,13 +1,8 @@
COMPONENTS = {
// a comment
- "Core" : [
- "JSON2"
- ],
-
-
"Bundle" : [
- "jsan:Task.Joose.Core",
- "+Core"
+ "=static/json2.js",
+ "JSON2"
]
-}
+}
View
@@ -0,0 +1,78 @@
+Name
+====
+
+JSON2 - json2 / native JSON normalizer for Joose
+
+
+SYNOPSIS
+========
+
+ // bunlde will include the json2.js lib
+ <script src = "/jsan/lib/Task/JSON2/Bundle.js"></script>
+
+
+ // `use` will load it on-demand (requires JooseX.Namespace.Depended)
+ use('JSON2', function () {
+
+ var str = JSON2.stringify([])
+
+ var arr = JSON2.parse('[]')
+ })
+
+
+
+
+DESCRIPTION
+===========
+
+`JSON2` is a normalizing wrapper around the json2 library and native JSON implementation in supporting browsers.
+
+
+USAGE
+=====
+
+Since its only a thin wrapper you should only use the features intersection between json2 & native JSON. For example,
+seems the native implementation of `JSON.parse` in FF do not accept 2nd argument.
+
+
+GETTING HELP
+============
+
+This extension is supported via github issues tracker: <http://github.com/SamuraiJack/JSON2/issues>
+
+For general Joose questions you can also visit [#joose](http://webchat.freenode.net/?randomnick=1&channels=joose&prompt=1)
+on irc.freenode.org or the mailing list at: <http://groups.google.com/group/joose-js>
+
+
+
+SEE ALSO
+========
+
+[Using JSON in Firefox](https://developer.mozilla.org/en/Using_JSON_in_Firefox)
+
+BUGS
+====
+
+All complex software has bugs lurking in it, and this module is no exception.
+
+Please report any bugs through the web interface at <http://github.com/SamuraiJack/JSON2/issues>
+
+
+
+AUTHORS
+=======
+
+Nickolay Platonov <nplatonov@cpan.org>
+
+
+
+
+
+COPYRIGHT AND LICENSE
+=====================
+
+This software is Copyright (c) 2010 by Nickolay Platonov.
+
+This is free software, licensed under:
+
+ The GNU Lesser General Public License, Version 3, June 2007
View
@@ -1,16 +1,23 @@
Class('JSON2', {
- use : [ ],
-
-
- has : {
-
-
+ use : {
+ token : 'JSON2/static/json2.js',
+ presence : 'JSON'
},
+
+ my : {
- methods : {
-
+ methods : {
+
+ parse : function () {
+ return JSON.parse.apply(JSON, arguments)
+ },
+
+
+ stringify : function () {
+ return JSON.stringify.apply(JSON, arguments)
+ }
+ }
}
-
})
View
@@ -1,111 +1,61 @@
Name
====
-JSON2 - Some clever yet compact description
+JSON2 - json2 / native JSON normalizer for Joose
SYNOPSIS
========
- // declaring our class
- Class('JSON2', {
+ // bunlde will include the json2.js lib
+ <script src = "/jsan/lib/Task/JSON2/Bundle.js"></script>
+
- })
+ // `use` will load it on-demand (requires JooseX.Namespace.Depended)
+ use('JSON2', function () {
- // then instantiating it
- var instance = new JSON2({
+ var str = JSON2.stringify([])
+
+ var arr = JSON2.parse('[]')
})
-
- // and doing something totally awesome with it :D
- instance.method(param1, param2)
+
DESCRIPTION
===========
-`JSON2` is a stub for Joose-orientied JSAN modules.
-
-
-ISA
-===
-
-None.
-
-
-DOES
-====
-
-None.
-
-
-TRAITS
-======
-
-None.
-
-
-
-ATTRIBUTES
-==========
+`JSON2` is a normalizing wrapper around the json2 library and native JSON implementation in supporting browsers.
-### attributeName
-> `AttributeType attributeName`
+USAGE
+=====
-> Attribute description
-
-
-METHODS
-=======
-
-### methodName
-
-> `method signature`
-
-> Method description
-
-
-EXAMPLES
-========
-
-Our class can be used like this:
-
- // then instantiating it
- var instance = new JSON2({
- })
-
-and like that:
-
- // then instantiating it
- var instance = new JSON2({
- })
+Since its only a thin wrapper you should only use the features intersection between json2 & native JSON. For example,
+seems the native implementation of `JSON.parse` in FF do not accept 2nd argument.
GETTING HELP
============
-This extension is supported via github issues tracker: <http://github.com/SamuraiJack/Module-Stub/issues>
+This extension is supported via github issues tracker: <http://github.com/SamuraiJack/JSON2/issues>
For general Joose questions you can also visit [#joose](http://webchat.freenode.net/?randomnick=1&channels=joose&prompt=1)
-on irc.freenode.org or the forum at: <http://joose.it/forum>
+on irc.freenode.org or the mailing list at: <http://groups.google.com/group/joose-js>
SEE ALSO
========
-Web page of this module: <http://github.com/SamuraiJack/Module-Stub/>
-
-General documentation for Joose: <http://openjsan.org/go/?l=Joose>
-
+[Using JSON in Firefox](https://developer.mozilla.org/en/Using_JSON_in_Firefox)
BUGS
====
All complex software has bugs lurking in it, and this module is no exception.
-Please report any bugs through the web interface at <http://github.com/SamuraiJack/Module-Stub/issues>
+Please report any bugs through the web interface at <http://github.com/SamuraiJack/JSON2/issues>
Oops, something went wrong.

0 comments on commit d152174

Please sign in to comment.