codus 0.0.1.3 → 0.0.1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitmodules +3 -0
- data/app/assets/javascript/yojs.js +1 -70
- data/lib/codus/version.rb +1 -1
- metadata +3 -2
data/.gitmodules
ADDED
@@ -1,70 +1 @@
|
|
1
|
-
|
2
|
-
// Version: 0.0.1
|
3
|
-
|
4
|
-
if(!Array.prototype.last) {
|
5
|
-
Array.prototype.last = function() {
|
6
|
-
return this[this.length - 1];
|
7
|
-
}
|
8
|
-
}
|
9
|
-
|
10
|
-
var yojs = (function(){
|
11
|
-
var nameFunctionHash = {};
|
12
|
-
var parentsNamespaces = [];
|
13
|
-
|
14
|
-
var getNameSpaceResult = function(namespace, arguments) {
|
15
|
-
if (typeof(nameFunctionHash[namespace]) == 'function') {
|
16
|
-
return nameFunctionHash[namespace].apply(this, arguments);
|
17
|
-
} else {
|
18
|
-
return nameFunctionHash[namespace];
|
19
|
-
}
|
20
|
-
}
|
21
|
-
return {
|
22
|
-
define: function(namespace, value) {
|
23
|
-
if (this.isDefined(namespace)) {
|
24
|
-
var errorMessage = "Error: trying to define namespace '" + namespace + "'' twice";
|
25
|
-
throw errorMessage;
|
26
|
-
} else {
|
27
|
-
nameFunctionHash[namespace] = value;
|
28
|
-
}
|
29
|
-
return;
|
30
|
-
},
|
31
|
-
|
32
|
-
set: function(namespace, value) {
|
33
|
-
this.define(namespace, value);
|
34
|
-
},
|
35
|
-
|
36
|
-
call: function(namespace){
|
37
|
-
var parentNamespaceArray = namespace.split(".");
|
38
|
-
var lastNameCalled = parentNamespaceArray.pop();
|
39
|
-
var currentParentNamespace = parentNamespaceArray.join(".");
|
40
|
-
var returnValue = null;
|
41
|
-
var lastParentNamespace = parentsNamespaces.last();
|
42
|
-
var functionWithLastParentClassNamespace = lastParentNamespace + "." + lastNameCalled;
|
43
|
-
var errorMessage = "";
|
44
|
-
var calledFunctionArguments = Array.prototype.slice.apply(arguments, [1]);
|
45
|
-
|
46
|
-
parentsNamespaces.push(currentParentNamespace);
|
47
|
-
|
48
|
-
if (this.isDefined(namespace)) {
|
49
|
-
returnValue = getNameSpaceResult(namespace, calledFunctionArguments);
|
50
|
-
} else if (this.isDefined(functionWithLastParentClassNamespace)) {
|
51
|
-
returnValue = getNameSpaceResult(functionWithLastParentClassNamespace, calledFunctionArguments);
|
52
|
-
} else {
|
53
|
-
var errorMessage = "Error: called namespace '" + namespace + "'. But it doesn't exist.";
|
54
|
-
throw errorMessage;
|
55
|
-
}
|
56
|
-
|
57
|
-
parentsNamespaces.pop();
|
58
|
-
|
59
|
-
return returnValue;
|
60
|
-
},
|
61
|
-
|
62
|
-
get: function(namespace) {
|
63
|
-
return this.call(namespace);
|
64
|
-
},
|
65
|
-
|
66
|
-
isDefined: function(namespace) {
|
67
|
-
return nameFunctionHash.hasOwnProperty(namespace);
|
68
|
-
}
|
69
|
-
}
|
70
|
-
}());
|
1
|
+
//= require ./yojs/yojs
|
data/lib/codus/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1.
|
4
|
+
version: 0.0.1.5.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-07-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -51,6 +51,7 @@ extensions: []
|
|
51
51
|
extra_rdoc_files: []
|
52
52
|
files:
|
53
53
|
- .gitignore
|
54
|
+
- .gitmodules
|
54
55
|
- Gemfile
|
55
56
|
- LICENSE.txt
|
56
57
|
- README.md
|