intfiction.org

The Interactive Fiction Community Forum
It is currently Thu Dec 14, 2017 10:12 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 13 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Tue Oct 24, 2017 4:17 am 
Offline

Joined: Fri Oct 20, 2017 9:34 am
Posts: 4
Yep, manually storing it in the code is one option: but since I only refer to it in one place in the code, it seemed like an unnecessary extra level of indirection. The fundamental problem is that i have to mention it once for the packager and once for the program. That seems wrong, but obviously I should be seeking advice about this on a Ruby board, not an IF one!


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Oct 24, 2017 8:07 am 
Offline

Joined: Sun Mar 16, 2014 2:45 pm
Posts: 84
MikeTaylor wrote:
Yep, manually storing it in the code is one option: but since I only refer to it in one place in the code, it seemed like an unnecessary extra level of indirection. The fundamental problem is that i have to mention it once for the packager and once for the program. That seems wrong, but obviously I should be seeking advice about this on a Ruby board, not an IF one!


I generally resolve that by referencing the constant in the gemspec itself, e.g.:

Code:
# scottkit.gemspec

$LOAD_PATH.unshift File.dirname(__FILE__) + '/lib'
require 'scottkit/version'

Gem::Specification.new do |spec|
  spec.version = ScottKit::VERSION
  # rest of spec
end


The skeleton created by the "bundle gem" command does more or less the same thing.

If you're using Jeweler to generate the gemspec, you probably need to specify the version in the rake task instead. That's what the README seems to indicate, anyway.

_________________
Gamefic: a Ruby framework for interactive fiction


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Oct 24, 2017 8:12 am 
Offline

Joined: Fri Oct 20, 2017 9:34 am
Posts: 4
Thank you, I will think on this.

(I chose jeweler seven years ago when I first wrote this code, and it maybe that it would be a stupid choice in 2017 -- or that the way it works now is completely different. Perhaps simply abandoning jeweler would be the best thing now. I don't know.)


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ]  Go to page Previous  1, 2

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group