Skip to content

Commit cf11635

Browse files
committed
Modernize the project root
* Use a Gemfile / .gemspec file for bunder; * Drop the extension of Rakefile.rb to follow current conventions; * Drop now useless tooling from the Rakefile; * Make the version of the gem available from the code. These changes are supposed to introduce no functional change, and are intended to make it easier to manage the module code.
1 parent d8a659d commit cf11635

File tree

6 files changed

+66
-40
lines changed

6 files changed

+66
-40
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
Gemfile.lock
12
pkg/
23
._*
34
*~

Gemfile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# frozen_string_literal: true
2+
3+
source 'https://rubygems.org'
4+
5+
# Specify your gem's dependencies in riemann-postgresql.gemspec
6+
gemspec

Rakefile

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
require 'riemann/tools/postgresql/version'
2+
require 'bundler/gem_tasks'
3+
require 'github_changelog_generator/task'
4+
5+
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
6+
config.user = 'riemann'
7+
config.project = 'riemann-postgresql'
8+
config.exclude_labels = ['skip-changelog']
9+
config.future_release = "v#{Riemann::Tools::Postgresql::VERSION}"
10+
end

Rakefile.rb

-40
This file was deleted.
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# frozen_string_literal: true
2+
3+
module Riemann
4+
module Tools
5+
class Postgresql
6+
VERSION = '0.1.1'
7+
end
8+
end
9+
end

riemann-postgresql.gemspec

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# frozen_string_literal: true
2+
3+
require_relative 'lib/riemann/tools/postgresql/version'
4+
5+
Gem::Specification.new do |spec|
6+
spec.name = 'riemann-postgresql'
7+
spec.version = Riemann::Tools::Postgresql::VERSION
8+
spec.authors = ['Pradeep Chhetri']
9+
spec.email = ['[email protected]']
10+
11+
spec.summary = 'PostgreSQL Riemann Client'
12+
spec.homepage = 'https://github.com/riemann/riemann-postgresql'
13+
spec.license = 'MIT'
14+
spec.required_ruby_version = Gem::Requirement.new('>= 2.6.0')
15+
16+
spec.metadata['allowed_push_host'] = 'https://rubygems.org/'
17+
18+
spec.metadata['homepage_uri'] = spec.homepage
19+
spec.metadata['source_code_uri'] = spec.homepage
20+
spec.metadata['changelog_uri'] = spec.homepage
21+
22+
# Specify which files should be added to the gem when it is released.
23+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
24+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
25+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26+
end
27+
spec.bindir = 'bin'
28+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
29+
spec.require_paths = ['lib']
30+
31+
spec.add_runtime_dependency 'pg', '>= 0.17.1'
32+
spec.add_runtime_dependency 'riemann-tools', '>= 0.2.1'
33+
34+
spec.add_development_dependency 'github_changelog_generator'
35+
spec.add_development_dependency 'rake'
36+
spec.add_development_dependency 'rspec'
37+
spec.add_development_dependency 'rubocop'
38+
spec.add_development_dependency 'rubocop-rake'
39+
spec.add_development_dependency 'rubocop-rspec'
40+
end

0 commit comments

Comments
 (0)