Permalink
Browse files

added version file

  • Loading branch information...
1 parent 084bd0b commit 4dedd6e7520d4d3100c4c867c75e00c2b904ea83 @lwe committed Aug 12, 2009
Showing with 15 additions and 3 deletions.
  1. +11 −3 Rakefile
  2. +4 −0 VERSION.yml
View
14 Rakefile
@@ -1,4 +1,5 @@
require 'rake'
+require 'yaml'
desc 'Default: minify and combine javascripts'
task :default => :build
@@ -19,11 +20,13 @@ task :build do
# combine
out = File.open('build/chronic.min.js', 'w');
- out.puts COPYRIGHT
puts "combining to chronic.min.js"
- Dir['build/locales/en.min.js', 'build/*.tmp.js'].each do |f|
+ out.puts COPYRIGHT
+ out.puts "if(!Date.Locale){#{File.open('build/locales/en.min.js').read}};"
+ Dir['build/*.tmp.js'].each do |f|
puts "\tadding #{f}"
FileUtils.copy_stream(File.open(f), out)
+ FileUtils.rm_rf f
end
out.close
end
@@ -34,9 +37,14 @@ task :clean do
FileUtils.rm_rf "pkg"
end
+# version as hash and string
+VERSION_HASH = YAML.load(File.open('VERSION.yml'));
+VERSION = "#{VERSION_HASH[:major]}.#{VERSION_HASH[:minor]}.#{VERSION_HASH[:patch]}" unless Object.const_defined?('VERSION')
+
+# simple copyright notice
COPYRIGHT = <<-EOT
/*
- * chronic.js java script date library
+ * chronic.js java script date library (v#{VERSION})
* http://github.com/lwe/chronic_js
*
* Copyright (c) #{Time.now.year} Lukas Westermann
View
4 VERSION.yml
@@ -0,0 +1,4 @@
+---
+:major: 0
+:minor: 0
+:patch: 1

0 comments on commit 4dedd6e

Please sign in to comment.