Skip to content

Commit 5b8c46e

Browse files
committed
Update VERSION handling and other gem boilerplate to mirror other ruby-rdf gems.
1 parent 2c209c1 commit 5b8c46e

5 files changed

Lines changed: 26 additions & 8 deletions

File tree

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
source "http://rubygems.org"
1+
source "https://rubygems.org"
22

33
# Specify your gem's dependencies in rdf-virtuoso.gemspec
44
gemspec

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.1.7

lib/rdf/virtuoso.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
require 'rdf'
2+
13
module RDF
24
module Virtuoso
35
autoload :Repository, 'rdf/virtuoso/repository'
46
autoload :Query, 'rdf/virtuoso/query'
57
autoload :Prefixes, 'rdf/virtuoso/prefixes'
68
autoload :Parser, 'rdf/virtuoso/parser'
9+
autoload :VERSION, 'rdf/virtuoso/version'
710
end
811
end

lib/rdf/virtuoso/version.rb

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
1-
module RDF
2-
module Virtuoso
3-
VERSION = "0.1.6"
4-
end
1+
module RDF::Virtuoso::VERSION
2+
VERSION_FILE = File.join(File.expand_path(File.dirname(__FILE__)), "..", "..", "..", "VERSION")
3+
MAJOR, MINOR, TINY, EXTRA = File.read(VERSION_FILE).chop.split(".")
4+
5+
STRING = [MAJOR, MINOR, TINY, EXTRA].compact.join('.')
6+
7+
##
8+
# @return [String]
9+
def self.to_s() STRING end
10+
11+
##
12+
# @return [String]
13+
def self.to_str() STRING end
14+
15+
##
16+
# @return [Array(Integer, Integer, Integer)]
17+
def self.to_a() STRING.split(".") end
518
end

rdf-virtuoso.gemspec

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# -*- encoding: utf-8 -*-
22
$:.push File.expand_path('../lib', __FILE__)
3-
require 'rdf/virtuoso/version'
3+
require 'rdf/virtuoso'
44

55
Gem::Specification.new do |s|
66
s.name = 'rdf-virtuoso'
7-
s.version = RDF::Virtuoso::VERSION
7+
s.version = File.read('VERSION').chomp
88
s.platform = Gem::Platform::RUBY
9+
s.date = File.mtime('VERSION').strftime('%Y-%m-%d')
910
s.authors = ['Benjamin Rokseth', 'Peter Kordel']
1011
s.email = ['benjamin.rokseth@kul.oslo.kommune.no']
1112
s.homepage = 'https://github.com/digibib/rdf-virtuoso'
@@ -19,7 +20,7 @@ Gem::Specification.new do |s|
1920
s.files += Dir['spec/**/*.rb'] + Dir['doc/**/**/*.rb']
2021
s.require_paths = ['lib']
2122

22-
s.add_runtime_dependency 'rdf', '>= 3.1'
23+
s.add_runtime_dependency 'rdf', '~> 3.1'
2324
s.add_runtime_dependency 'httparty', '~> 0.18.1'
2425
s.add_runtime_dependency 'api_smith', '~> 1.3.0'
2526

0 commit comments

Comments
 (0)