tracking_number 1.3.2 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/release.yml +12 -3
- data/.github/workflows/ruby.yml +4 -2
- data/CHANGELOG.md +15 -0
- data/README.md +48 -0
- data/bin/console +14 -0
- data/lib/data/couriers/amazon.json +45 -0
- data/lib/data/couriers/canadapost.json +31 -0
- data/lib/data/couriers/dhl.json +51 -0
- data/lib/data/couriers/dpd.json +341 -0
- data/lib/data/couriers/fedex.json +303 -0
- data/lib/data/couriers/landmark.json +26 -0
- data/lib/data/couriers/lasership.json +84 -0
- data/lib/data/couriers/ontrac.json +70 -0
- data/lib/data/couriers/s10.json +1435 -0
- data/lib/data/couriers/ups.json +193 -0
- data/lib/data/couriers/usps.json +175 -0
- data/lib/tracking_number/base.rb +166 -85
- data/lib/tracking_number/loader.rb +23 -22
- data/lib/tracking_number/partnership.rb +7 -0
- data/lib/tracking_number/version.rb +1 -1
- data/lib/tracking_number.rb +32 -9
- data/test/test_helper.rb +0 -2
- data/test/tracking_number_meta_test.rb +1 -1
- data/test/tracking_number_test.rb +68 -0
- data/tracking_number.gemspec +15 -6
- data/yarn.lock +448 -448
- metadata +18 -5
data/tracking_number.gemspec
CHANGED
@@ -17,19 +17,28 @@ Gem::Specification.new do |s|
|
|
17
17
|
]
|
18
18
|
|
19
19
|
s.files = `git ls-files`.split("\n")
|
20
|
-
gem_dir = "#{File.expand_path(File.join(__FILE__, '..'))}/"
|
21
20
|
|
21
|
+
gem_dir = "#{File.expand_path(File.join(__FILE__, '..'))}/"
|
22
22
|
`git submodule --quiet foreach pwd`.split($OUTPUT_RECORD_SEPARATOR).each do |submodule_path|
|
23
23
|
Dir.chdir(submodule_path.chomp) do
|
24
24
|
submodule_relative_path = submodule_path.sub gem_dir, ''
|
25
|
-
|
25
|
+
|
26
|
+
# issue git ls-files in submodule's directory
|
27
|
+
submodule_files = `git ls-files -- couriers/*`.split($OUTPUT_RECORD_SEPARATOR)
|
28
|
+
|
26
29
|
# prepend the submodule path to create absolute file paths
|
30
|
+
submodule_files_fullpaths = submodule_files.map do |filename|
|
31
|
+
"#{submodule_path}/#{filename}"
|
32
|
+
end
|
27
33
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
34
|
+
# remove leading path parts to get paths relative to the gem's root dir
|
35
|
+
# (this assumes, that the gemspec resides in the gem's root dir)
|
36
|
+
submodule_files_paths = submodule_files_fullpaths.map do |filename|
|
37
|
+
filename.gsub gem_dir, ''
|
32
38
|
end
|
39
|
+
|
40
|
+
# add relative paths to gem.files
|
41
|
+
s.files += submodule_files_paths
|
33
42
|
end
|
34
43
|
end
|
35
44
|
|