summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/syslog/syslog.gemspec12
1 files changed, 3 insertions, 9 deletions
diff --git a/ext/syslog/syslog.gemspec b/ext/syslog/syslog.gemspec
index 1964e422a0..10a6d1f25c 100644
--- a/ext/syslog/syslog.gemspec
+++ b/ext/syslog/syslog.gemspec
@@ -1,12 +1,6 @@
-
-source_version = ["", "ext/syslog/"].find do |dir|
- begin
- break File.open(File.join(__dir__, "#{dir}syslog.c")) {|f|
- f.gets("\n#define SYSLOG_VERSION ")
- f.gets[/\s*"(.+)"/, 1]
- }
- rescue Errno::ENOENT
- end
+source_version = %w[. ext/syslog].find do |dir|
+ break $1 if File.foreach(File.join(__dir__, dir, "syslog.c")).any?(/^#define\s+SYSLOG_VERSION\s+"(.+)"/)
+rescue Errno::ENOENT
end
Gem::Specification.new do |spec|