Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using with .gemspec #11

Open
gmcinnes opened this issue Apr 15, 2015 · 0 comments
Open

Using with .gemspec #11

gmcinnes opened this issue Apr 15, 2015 · 0 comments

Comments

@gmcinnes
Copy link

Hi. I have a traditional gem project, set up like:

mygem/mycode/version.rb:

module MyGem
  module MyCode
    VERSION = '0.0.1'
  end
end

Then, in my mygem.gemspec file I have:

# -*- encoding: utf-8 -*-
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'mygem/mycode/version'

Gem::Specification.new do |gem|
  gem.version = MyGem::MyCode::VERSION
end

and in Gemfile I have

source 'https://rubygems.org'

# Specify your gem's dependencies in capistrano-postgresql.gemspec
gemspec

I can't figure out how to use SemVer to set the Version here. If I try and use SemVer inside the module code, it's not available yet. I can't specify it as a dependency in the .gemspec, because the .gemspec needs it to set the version, and I can't specify it in the Gemfile, because the Gemfile depends on the .gemspec.

It seems to be a circular dependency, but it must be solvable - I can't be the first person trying to do this, can I? Am I just missing something obvious?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant