Skip to main content

Ruby

Location: examples/ruby/

Ruby generates a version.rb module using versionator output emit:

examples/ruby/lib/mypackage.rb
require_relative "mypackage/version"

module Mypackage
def self.hello
puts "Sample Ruby Application"
puts "Version: #{Versionator::VERSION}"
end
end
examples/ruby/Makefile (excerpt)
version-file:
versionator output emit ruby --output lib/mypackage/version.rb

run: version-file
ruby -I lib -e "require 'mypackage'; Mypackage.hello"

Run it

$ cd examples/ruby && just run
Generating version.rb using versionator emit...
Version 0.0.16 written to lib/mypackage/version.rb
ruby -I lib -e "require 'mypackage'; Mypackage.hello"
Sample Ruby Application
Version: 0.0.16

Source Code