Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
30c45923
...
30c4592385307e954b751dee8fcba2a5e5bc1388
authored
2012-02-13 15:08:37 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
version number is now centralized to package.json
1 parent
09cedfce
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
16 deletions
CHANGELOG.md
bin/bootstrap.js
docs
CHANGELOG.md
View file @
30c4592
CasperJS Changelog
==================
XXXX-XX-XX, v0.6.5
------------------
-
fixed 0.6.4 version number in
`bootstrap.js`
-
centralized version number to package.json
2012-02-09, v0.6.4
------------------
...
...
bin/bootstrap.js
View file @
30c4592
...
...
@@ -29,21 +29,6 @@
*/
phantom
.
loadCasper
=
function
()
{
// see http://semver.org/
phantom
.
casperVersion
=
{
major
:
0
,
minor
:
6
,
patch
:
3
,
ident
:
undefined
,
toString
:
function
()
{
var
version
=
[
this
.
major
,
this
.
minor
,
this
.
patch
].
join
(
'.'
);
if
(
this
.
ident
)
{
version
=
[
version
,
this
.
ident
].
join
(
'-'
);
}
return
version
;
}
};
// Patching fs
// TODO: watch for these methods being implemented in official fs module
var
fs
=
(
function
(
fs
)
{
...
...
@@ -140,6 +125,39 @@ phantom.loadCasper = function() {
});
}
// CasperJS version, extracted from package.json - see http://semver.org/
phantom
.
casperVersion
=
(
function
getVersion
(
path
)
{
var
parts
,
patchPart
,
pkg
,
pkgFile
;
var
fs
=
require
(
'fs'
);
pkgFile
=
fs
.
absolute
(
fs
.
pathJoin
(
path
,
'package.json'
));
if
(
!
fs
.
exists
(
pkgFile
))
{
throw
new
Error
(
'Cannot find package.json at '
+
pkgFile
);
}
try
{
pkg
=
JSON
.
parse
(
require
(
'fs'
).
read
(
pkgFile
));
}
catch
(
e
)
{
throw
new
Error
(
'Cannot read package file contents: '
+
e
);
}
parts
=
pkg
.
version
.
trim
().
split
(
"."
);
if
(
parts
<
3
)
{
throw
new
Error
(
"Invalid version number"
);
}
patchPart
=
parts
[
2
].
split
(
'-'
);
return
{
major
:
~~
parts
[
0
]
||
0
,
minor
:
~~
parts
[
1
]
||
0
,
patch
:
~~
patchPart
[
0
]
||
0
,
ident
:
patchPart
[
1
]
||
""
,
toString
:
function
()
{
var
version
=
[
this
.
major
,
this
.
minor
,
this
.
patch
].
join
(
'.'
);
if
(
this
.
ident
)
{
version
=
[
version
,
this
.
ident
].
join
(
'-'
);
}
return
version
;
}
};
})(
phantom
.
casperPath
);
/**
* Retrieves the javascript source code from a given .js or .coffee file.
*
...
...
docs
@
e46d6689
Subproject commit
0f3b4b30a0f87a9dca740f887cb4e60a6a96e409
Subproject commit
e46d6689f5cee8d66cd6f2952f8f41d8635f0ea0
...
...
Please
register
or
sign in
to post a comment