swot-ruby 1.0.2.20230712 → 1.0.3.20230714
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/lib/swot.rb +3 -3
- data/release.sh +5 -2
- data/swot.gemspec +1 -1
- data/test/test_swot.rb +2 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7dcadcda0c10bdf7547304dd397227c237c9577eb0ddc2a3e25e8da78ab1c1be
|
4
|
+
data.tar.gz: a318673a538d8f16dc436eb4130ba5aacd4d2b0cc9ae6885c42e16862f001c3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b8fb7e95674b5f11b450fa9f41952ab4aba2ac531b5b0abcdc258a06f5e11009c291acccfa43682d92320183fad8b67f711d1c420a465a8ea0d4b72e83f7447
|
7
|
+
data.tar.gz: e12d4c6b1ad813b2bd82b2ece1cabb7431bff88b88a0ddf7d04d7e0c5002912db049abcdf041fe9be94c4da062f6d4b139c27d67afac8d1b918c690aa0ff7ada
|
data/lib/swot.rb
CHANGED
@@ -5,12 +5,12 @@ require_relative "swot/collection_methods"
|
|
5
5
|
|
6
6
|
class Swot
|
7
7
|
|
8
|
-
VERSION = "1.0.
|
8
|
+
VERSION = "1.0.3"
|
9
9
|
|
10
10
|
# These are domains that snuck into the edu registry,
|
11
11
|
# but don't pass the education sniff test
|
12
12
|
# Note: validated domain must not end with the blacklisted string
|
13
|
-
BLACKLIST = File.readlines(File.join(__dir__, '../
|
13
|
+
BLACKLIST = File.readlines(File.join(__dir__, '../academic_data/lib/domains/stoplist.txt')).map(&:chomp).freeze
|
14
14
|
|
15
15
|
include NaughtyOrNice
|
16
16
|
extend SwotCollectionMethods
|
@@ -24,7 +24,7 @@ class Swot
|
|
24
24
|
alias_method :school_name, :get_institution_name
|
25
25
|
|
26
26
|
def domains_path
|
27
|
-
@domains_path ||= File.expand_path "../
|
27
|
+
@domains_path ||= File.expand_path "../academic_data/lib/domains", File.dirname(__FILE__)
|
28
28
|
end
|
29
29
|
|
30
30
|
# Returns a new Swot instance for the domain file at the given path.
|
data/release.sh
CHANGED
@@ -1,14 +1,17 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
git pull
|
3
3
|
git submodule update --init --recursive
|
4
|
-
|
4
|
+
rm -rf academic_data
|
5
|
+
cp -R data academic_data
|
6
|
+
rm -rf academic_data/.git
|
5
7
|
current_date=$(date +%Y%m%d)
|
6
8
|
file_path="swot.gemspec"
|
7
9
|
sed -i '' -E "s/(s\.version = \"[0-9\.]+\.)[0-9]{8}/\1$current_date/g" $file_path
|
8
10
|
|
9
11
|
version_number=$(grep -o -E "s\.version = \"[0-9\.]+$current_date\"" $file_path | grep -o -E "[0-9\.]+$current_date")
|
10
12
|
|
11
|
-
git
|
13
|
+
git add -A .
|
14
|
+
git commit -m "Updated academic list - $current_date"
|
12
15
|
git push
|
13
16
|
gem build swot.gemspec
|
14
17
|
|
data/swot.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.name = "swot-ruby"
|
4
|
-
s.version = "1.0.
|
4
|
+
s.version = "1.0.3.20230714"
|
5
5
|
|
6
6
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
7
7
|
s.authors = ["Dave Kimura", "Lee Reilly"]
|
data/test/test_swot.rb
CHANGED
@@ -20,6 +20,8 @@ describe Swot do
|
|
20
20
|
assert Swot::is_academic?('dave@lsst.ac')
|
21
21
|
assert Swot::is_academic?('dave@dcc.netpoint.com.bd')
|
22
22
|
assert Swot::is_academic?('dave@student.gatewayhs.com')
|
23
|
+
assert Swot::is_academic?('dave@politecnics.barcelona')
|
24
|
+
assert Swot::is_academic?('me@nimsuniversity.org')
|
23
25
|
|
24
26
|
|
25
27
|
assert_not Swot::is_academic?('support@driftingruby.com')
|