summaryrefslogtreecommitdiff
path: root/ext/io/console/io-console.gemspec
diff options
context:
space:
mode:
Diffstat (limited to 'ext/io/console/io-console.gemspec')
-rw-r--r--ext/io/console/io-console.gemspec49
1 files changed, 39 insertions, 10 deletions
diff --git a/ext/io/console/io-console.gemspec b/ext/io/console/io-console.gemspec
index 1256162468..0a19992734 100644
--- a/ext/io/console/io-console.gemspec
+++ b/ext/io/console/io-console.gemspec
@@ -1,24 +1,53 @@
# -*- ruby -*-
-_VERSION = "0.4.6"
-date = %w$Date:: $[1]
+_VERSION = ["", "ext/io/console/"].find do |dir|
+ begin
+ break File.open(File.join(__dir__, "#{dir}console.c")) {|f|
+ f.gets("\nIO_CONSOLE_VERSION ")
+ f.gets[/"(.+)"/, 1]
+ }
+ rescue Errno::ENOENT
+ end
+end
Gem::Specification.new do |s|
s.name = "io-console"
s.version = _VERSION
- s.date = date
s.summary = "Console interface"
s.email = "nobu@ruby-lang.org"
s.description = "add console capabilities to IO instances."
- s.required_ruby_version = ">= 2.0.0"
+ s.required_ruby_version = ">= 2.6.0"
s.homepage = "https://github.com/ruby/io-console"
+ s.metadata["source_code_url"] = s.homepage
+ s.metadata["changelog_uri"] = s.homepage + "/releases"
s.authors = ["Nobu Nakada"]
s.require_path = %[lib]
- s.files = %w[ext/io/console/console.c ext/io/console/extconf.rb lib/console/size.rb ext/io/console/win32_vk.inc]
+ s.files = %w[
+ .document
+ BSDL
+ COPYING
+ README.md
+ ext/io/console/console.c
+ ext/io/console/extconf.rb
+ ext/io/console/win32_vk.inc
+ lib/io/console/size.rb
+ ]
s.extensions = %w[ext/io/console/extconf.rb]
- s.license = "BSD-2-Clause"
- s.cert_chain = %w[certs/nobu.pem]
- s.signing_key = File.expand_path("~/.ssh/gem-private_key.pem") if $0 =~ /gem\z/
- s.add_development_dependency 'rake-compiler'
- s.add_development_dependency 'rake-compiler-dock', ">= 0.6.1"
+ if Gem::Platform === s.platform and s.platform =~ 'java'
+ s.files.delete_if {|f| f.start_with?("ext/")}
+ s.extensions.clear
+ s.require_paths.unshift('lib/ffi')
+ s.files.concat(%w[
+ lib/ffi/io/console.rb
+ lib/ffi/io/console/bsd_console.rb
+ lib/ffi/io/console/common.rb
+ lib/ffi/io/console/linux_console.rb
+ lib/ffi/io/console/native_console.rb
+ lib/ffi/io/console/stty_console.rb
+ lib/ffi/io/console/stub_console.rb
+ lib/ffi/io/console/version.rb
+ ])
+ end
+
+ s.licenses = ["Ruby", "BSD-2-Clause"]
end