-
Notifications
You must be signed in to change notification settings - Fork 50
/
tracking_number.gemspec
63 lines (52 loc) · 2.53 KB
/
tracking_number.gemspec
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# frozen_string_literal: true
lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'tracking_number/version'
Gem::Specification.new do |s|
s.name = 'tracking_number'
s.version = TrackingNumber::VERSION
s.platform = Gem::Platform::RUBY
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
s.required_ruby_version = Gem::Requirement.new('>= 3.0.0')
s.authors = ['Jeff Keen']
s.description = "This gem identifies valid tracking numbers and the service they're associated with. It can also tell you a little bit about the package purely from the number—there's quite a bit of info tucked away into those numbers, it turns out."
s.email = '[email protected]'
s.extra_rdoc_files = [
'LICENSE.txt'
]
s.files = `git ls-files`.split("\n")
gem_dir = "#{File.expand_path(File.join(__FILE__, '..'))}/"
`git submodule --quiet foreach pwd`.split($OUTPUT_RECORD_SEPARATOR).each do |submodule_path|
Dir.chdir(submodule_path.chomp) do
submodule_relative_path = submodule_path.sub gem_dir, ''
# issue git ls-files in submodule's directory
submodule_files = `git ls-files -- couriers/*`.split($OUTPUT_RECORD_SEPARATOR)
# prepend the submodule path to create absolute file paths
submodule_files_fullpaths = submodule_files.map do |filename|
"#{submodule_path}/#{filename}"
end
# remove leading path parts to get paths relative to the gem's root dir
# (this assumes, that the gemspec resides in the gem's root dir)
submodule_files_paths = submodule_files_fullpaths.map do |filename|
filename.gsub gem_dir, ''
end
# add relative paths to gem.files
s.files += submodule_files_paths
end
end
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
s.require_paths = ['lib']
s.homepage = 'http://github.com/jkeen/tracking_number'
s.licenses = ['MIT']
s.summary = 'Identifies valid tracking numbers'
s.add_runtime_dependency('activesupport', '>= 4.2.5')
s.add_runtime_dependency('json', '>= 1.8.3')
s.add_development_dependency('activemodel', '> 4.2.5.1')
s.add_development_dependency('minitest', '~> 5.5')
s.add_development_dependency('minitest-reporters', '~> 1.1')
s.add_development_dependency('rake', '~> 13.0')
s.add_development_dependency('shoulda')
s.add_development_dependency('simplecov')
s.add_development_dependency('terminal-table')
end