set version number in lib/rpl.rb and nowhere else

This commit is contained in:
Gwenhael Le Moine 2022-10-05 09:27:26 +02:00
parent 864a8a2b07
commit 06e43ca137
No known key found for this signature in database
GPG key ID: FDFE3669426707A7
5 changed files with 8 additions and 8 deletions

View file

@ -54,7 +54,7 @@ options = { run_REPL: ARGV.empty?,
files: [],
programs: [] }
Version = '0.10.1'
Version = Rpl::VERSION
OptionParser.new do |opts|
opts.on('-s', "--state filename", "persist state in filename (default: #{options[:persistence_filename]}) (will be created if needed)") do |filename|

View file

@ -5,6 +5,8 @@ require 'rpl/types'
require 'rpl/words'
class Rpl < Interpreter
VERSION = '0.10.2'
include Types
attr_accessor :live_persistence

View file

@ -37,8 +37,6 @@ class Interpreter
attr_accessor :precision
def initialize( stack: [], dictionary: Dictionary.new )
@version = 0.101
@dictionary = dictionary
@stack = stack

View file

@ -35,15 +35,13 @@ module RplLang
category,
'( -- n ) Pop the interpreter\'s version number',
proc do
@stack << Types.new_object( RplString, "\"#{@version}\"" )
@stack << Types.new_object( RplString, "\"#{Rpl::VERSION}\"" )
end )
@dictionary.add_word( ['uname'],
category,
'( -- s ) Pop the interpreter\'s complete indentification string',
proc do
@stack << Types.new_object( RplString, "\"Rpl Interpreter version #{@version}\"" )
end )
Types.new_object( RplProgram, '« "Rpl Interpreter version " version + »' ) )
end
end
end

View file

@ -1,8 +1,10 @@
# frozen_string_literal: true
require_relative './lib/rpl'
Gem::Specification.new do |s|
s.name = 'rpl'
s.version = '0.10.1'
s.version = Rpl::VERSION
s.summary = 'Functional Stack Language'
s.description = "A language inspired by HP's RPL and https://github.com/louisrubet/rpn/"
s.authors = ['Gwenhael Le Moine']