Browse files

Version 1.0.0: Added new ChangeLog and VERSION files for tracking cha…

…nges between versions. Also added get_version() subroutine for reading version number from VERSION.
  • Loading branch information...
1 parent 209ef8e commit 004b3a14b0bee43a5b27d2dec21795c0d0e0a7b3 @soh-cah-toa soh-cah-toa committed Oct 18, 2011
Showing with 39 additions and 1 deletion.
  1. +9 −0 ChangeLog
  2. +1 −0 VERSION
  3. +29 −1 src/plumage.nqp
View
9 ChangeLog
@@ -0,0 +1,9 @@
+2011-10-18 Kevin Polulak <kpolulak@gmail.com>
+ * Version 1.0.0
+ - New interactive command-line interface
+ - Improved documentation
+ - Various code cleanups
+
+2009-04-23 Geoffrey Broadwell <geoff@broadwell.org>
+ * Version 0.0.0
+ - Initial commit
View
1 VERSION
@@ -0,0 +1 @@
+1.0.0
View
30 src/plumage.nqp
@@ -160,6 +160,34 @@ our %OPTIONS; # Command-line switches
my %*CONF; # Configuration options
my %*BIN; # System binaries
+sub get_version() {
+ my $file := 'VERSION';
+ my $version;
+
+ # Read string from 'VERSION' and store it in $version
+ Q:PIR {
+ $P0 = find_lex '$file'
+ $S0 = $P0
+
+ load_bytecode 'String/Utils.pbc'
+
+ $P1 = new 'FileHandle'
+ $S1 = $P1.'readall'($S0)
+ $P1.'close'()
+
+ .local pmc chomp
+ chomp = get_global ['String';'Utils'], 'chomp'
+
+ $S1 = chomp($S1)
+ $P2 = new 'String'
+ $P2 = $S1
+
+ store_lex '$version', $P2
+ };
+
+ return $version;
+}
+
sub load_libraries() {
# Object-oriented interface
pir::load_bytecode('P6object.pbc');
@@ -431,7 +459,7 @@ sub command_version() {
}
sub version_info() {
- my $version := '0';
+ my $version := get_version();
return
"This is Plumage, version $version.

0 comments on commit 004b3a1

Please sign in to comment.