write current version to Ox.json and patch Ox.VERSION if loaded via dev/Ox.js

This commit is contained in:
j 2012-06-05 13:59:13 +02:00
parent 01587f7348
commit 57caa45bf8
5 changed files with 12 additions and 9 deletions

View file

@ -292,7 +292,7 @@ Ox.load(function() {
/:\/\/oxjs.org\//.test(window.location.href)
? 'The latest version is'
: 'You\'re currently running version'
) + ' <code>' + app.data.version + '.</code>'
) + ' <code>' + Ox.VERSION + '.</code>'
}
]
},

View file

@ -1,5 +1,5 @@
<h1><b>Downloads</b></h1>
<p>Please note that these are a pre-release versions. {version}</p>
<p>Please note that these are pre-release versions. {version}</p>
<br>
<h2><b>Source</b></h2>
<p>Development version, including everything but the kitchen sink.</p>

View file

@ -19,7 +19,8 @@ window.Ox = {
path = getPath();
loadJSON(function(data) {
loadScripts(data, function() {
loadScripts(data.files, function() {
Ox.VERSION = data.version;
if (args.length == 1) {
callback()
} else {

View file

@ -1,5 +1,5 @@
Ox.load({Geo: {}, Image: {}, UI: {}, Unicode: {}}, function() {
Ox.getJSON('../dev/Ox/json/Ox.json', function(files) {
Ox.getJSON('../dev/Ox/json/Ox.json', function(data) {
var $body = $('body')
.css({
@ -23,7 +23,7 @@ Ox.load({Geo: {}, Image: {}, UI: {}, Unicode: {}}, function() {
setBackground($tests, true);
tests(
Ox.flatten(files).sort().map(function(file) {
Ox.flatten(data.files).sort().map(function(file) {
return '../dev/' + file;
}).concat([
'../dev/Ox.Geo/Ox.Geo.js',

View file

@ -126,7 +126,10 @@ def build_oxjs(downloads=False, geo=False):
ox_files[2].append(js_dir + filename)
js = re.sub("Ox.VERSION = '([\d\.]+)'", "Ox.VERSION = '%s'" % version, js)
write_file(build_path + 'Ox.js', ox.js.minify(js, comment))
write_file(dev_path + '/Ox/json/' + 'Ox.json', json.dumps(ox_files, indent=4))
write_file(dev_path + '/Ox/json/' + 'Ox.json', json.dumps({
'files': ox_files,
'version': version
}, indent=4))
# Ox.UI
js = ''
@ -183,8 +186,7 @@ def build_oxjs(downloads=False, geo=False):
lambda x: not re.search('^[\._]', x),
os.listdir(root_path + 'readme/html/')
)
),
'version': version
)
}
write_file(root_path + 'index.json', json.dumps(data, indent=4, sort_keys=True))