| 1 |
# -*- coding: utf-8 -*- |
| 2 |
# frozen_string_literal: true |
| 3 |
|
| 4 |
source_version = ["", "ext/stringio/"].find do |dir| |
| 5 |
begin |
| 6 |
break File.open(File.join(__dir__, "#{dir}stringio.c")) {|f| |
| 7 |
f.gets("\nSTRINGIO_VERSION ") |
| 8 |
f.gets[/\s*"(.+)"/, 1] |
| 9 |
} |
| 10 |
rescue Errno::ENOENT |
| 11 |
end |
| 12 |
end |
| 13 |
Gem::Specification.new do |s| |
| 14 |
s.name = "stringio" |
| 15 |
s.version = source_version |
| 16 |
|
| 17 |
s.require_paths = ["lib"] |
| 18 |
s.authors = ["Nobu Nakada", "Charles Oliver Nutter"] |
| 19 |
s.description = "Pseudo `IO` class from/to `String`." |
| 20 |
s.email = ["[email protected]", "[email protected]"] |
| 21 |
s.files = ["README.md"] |
| 22 |
jruby = true if Gem::Platform.new('java') =~ s.platform or RUBY_ENGINE == 'jruby' |
| 23 |
if jruby |
| 24 |
s.require_paths = "lib/java" |
| 25 |
s.files += ["lib/java/stringio.rb", "lib/java/stringio.jar"] |
| 26 |
s.platform = "java" |
| 27 |
else |
| 28 |
s.extensions = ["ext/stringio/extconf.rb"] |
| 29 |
s.files += ["ext/stringio/extconf.rb", "ext/stringio/stringio.c"] |
| 30 |
end |
| 31 |
s.homepage = "https://github.com/ruby/stringio" |
| 32 |
s.licenses = ["Ruby", "BSD-2-Clause"] |
| 33 |
s.required_ruby_version = ">= 2.7" |
| 34 |
s.summary = "Pseudo IO on String" |
| 35 |
|
| 36 |
# s.cert_chain = %w[certs/nobu.pem] |
| 37 |
# s.signing_key = File.expand_path("~/.ssh/gem-private_key.pem") if $0 =~ /gem\z/ |
| 38 |
end |