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: [], files: [],
programs: [] } programs: [] }
Version = '0.10.1' Version = Rpl::VERSION
OptionParser.new do |opts| OptionParser.new do |opts|
opts.on('-s', "--state filename", "persist state in filename (default: #{options[:persistence_filename]}) (will be created if needed)") do |filename| 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' require 'rpl/words'
class Rpl < Interpreter class Rpl < Interpreter
VERSION = '0.10.2'
include Types include Types
attr_accessor :live_persistence attr_accessor :live_persistence

View file

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

View file

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

View file

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