Skip to content

Commit 780b2f5

Browse files
authored
Merge pull request #24 from stomar/fileutils-version
Use FileUtils::VERSION in gemspec
2 parents 25414cc + e6c5b65 commit 780b2f5

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

fileutils.gemspec

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
# frozen_string_literal: true
22

3+
begin
4+
require_relative "lib/fileutils/version"
5+
rescue LoadError
6+
# for Ruby core repository
7+
require_relative "version"
8+
end
9+
310
Gem::Specification.new do |s|
411
s.name = "fileutils"
5-
s.version = '1.1.0'
12+
s.version = FileUtils::VERSION
613
s.summary = "Several file utility methods for copying, moving, removing, etc."
714
s.description = "Several file utility methods for copying, moving, removing, etc."
815

916
s.require_path = %w{lib}
10-
s.files = [".gitignore", ".travis.yml", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "bin/console", "bin/setup", "fileutils.gemspec", "lib/fileutils.rb"]
17+
s.files = [".gitignore", ".travis.yml", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "bin/console", "bin/setup", "fileutils.gemspec", "lib/fileutils.rb", "lib/fileutils/version.rb"]
1118
s.required_ruby_version = ">= 2.3.0"
1219

1320
s.authors = ["Minero Aoki"]

lib/fileutils.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@
9191
# for make mjit-headers
9292
end
9393

94-
module FileUtils
94+
require "fileutils/version"
9595

96-
VERSION = "1.1.0"
96+
module FileUtils
9797

9898
def self.private_module_function(name) #:nodoc:
9999
module_function name

lib/fileutils/version.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# frozen_string_literal: true
2+
3+
module FileUtils
4+
VERSION = "1.1.0"
5+
end

0 commit comments

Comments
 (0)