-
Notifications
You must be signed in to change notification settings - Fork 4
/
gemstub.rb
42 lines (34 loc) · 1.01 KB
/
gemstub.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!ruby
unless File.read("README.md", mode: "rt") =~ /^\s*\*\s*version: (\d+(?:\.\w+)+)/i
raise "version number is not found in ``README.md''"
end
ver = $1
GEMSTUB = Gem::Specification.new do |s|
s.name = "crc"
s.version = ver
s.summary = "generic CRC calculator"
s.description = <<EOS
Pure ruby implemented generic CRC (Cyclic Redundancy Check) calculator.
Customization is posible for 1 to 64 bit width, any polynomials, and with/without bit reflection input/output.
If you need more speed, please use crc-turbo.
EOS
s.homepage = "https://github.com/dearblue/ruby-crc"
s.licenses = ["BSD-2-Clause", "Zlib", "CC0-1.0"]
s.author = "dearblue"
s.email = "[email protected]"
s.required_ruby_version = ">= 2.2"
s.add_development_dependency "rake", ">= 12"
end
verfile = "lib/crc/version.rb"
task "version" => verfile
file verfile => "README.md" do
File.write(verfile, <<-"EOS", mode: "wb")
#!ruby
class CRC
VERSION = "#{ver}"
end
EOS
end
LIB << verfile
LIB.uniq!
EXTRA << "benchmark.rb"