Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Hamza
jio
Commits
b94e9b36
Commit
b94e9b36
authored
Dec 27, 2012
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix test bugs on jio
parent
ad13d07c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
4 deletions
+17
-4
src/jio/commands/command.js
src/jio/commands/command.js
+6
-3
src/jio/commands/putAttachmentCommand.js
src/jio/commands/putAttachmentCommand.js
+10
-0
src/jio/jio.outro.js
src/jio/jio.outro.js
+1
-1
No files found.
src/jio/commands/command.js
View file @
b94e9b36
...
...
@@ -21,6 +21,9 @@ var command = function(spec, my) {
priv
.
tried
=
0
;
priv
.
doc
=
spec
.
doc
||
{};
if
(
typeof
priv
.
doc
!==
"
object
"
)
{
priv
.
doc
=
{
"
_id
"
:
priv
.
doc
.
toString
()};
}
priv
.
docid
=
spec
.
docid
||
priv
.
doc
.
_id
;
priv
.
option
=
spec
.
options
||
{};
priv
.
callbacks
=
spec
.
callbacks
||
{};
...
...
@@ -98,7 +101,7 @@ var command = function(spec, my) {
* @return {string} The data
*/
that
.
getAttachmentData
=
function
()
{
return
priv
.
doc
.
_data
;
return
priv
.
doc
.
_data
||
""
;
};
/**
...
...
@@ -107,7 +110,7 @@ var command = function(spec, my) {
* @return {number} The length
*/
that
.
getAttachmentLength
=
function
()
{
return
priv
.
doc
.
_data
.
length
;
return
(
priv
.
doc
.
_data
||
""
)
.
length
;
};
/**
...
...
@@ -125,7 +128,7 @@ var command = function(spec, my) {
* @return {string} The md5sum
*/
that
.
md5SumAttachmentData
=
function
()
{
return
hex_md5
(
priv
.
doc
.
_data
);
return
hex_md5
(
priv
.
doc
.
_data
||
""
);
};
/**
...
...
src/jio/commands/putAttachmentCommand.js
View file @
b94e9b36
...
...
@@ -13,6 +13,16 @@ var putAttachmentCommand = function(spec, my) {
};
that
.
validateState
=
function
()
{
if
(
!
(
typeof
that
.
getDocId
()
===
"
string
"
&&
that
.
getDocId
()
!==
""
))
{
that
.
error
({
"
status
"
:
20
,
"
statusText
"
:
"
Document Id Required
"
,
"
error
"
:
"
document_id_required
"
,
"
message
"
:
"
The document id is not provided
"
,
"
reason
"
:
"
Document id is undefined
"
});
return
false
;
}
if
(
typeof
that
.
getAttachmentId
()
!==
"
string
"
)
{
that
.
error
({
"
status
"
:
22
,
...
...
src/jio/jio.outro.js
View file @
b94e9b36
...
...
@@ -357,7 +357,7 @@
for
(
k
in
doc
)
{
doc_with_underscores
[
"
_
"
+
k
]
=
doc
[
k
];
}
console
.
log
(
doc_with_underscores
);
priv
.
addJob
(
putAttachmentCommand
,{
doc
:
doc_with_underscores
,
options
:
param
.
options
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment