flazz / flazz/semver

Using with .gemspec

Open
#11 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
99
Forks
24
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.