call_number_ranges 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +28 -0
- data/.rubocop.yml +2 -0
- data/call_number_ranges.gemspec +1 -1
- data/lib/call_number_ranges/version.rb +1 -1
- data/lib/call_number_ranges.rb +119 -115
- metadata +5 -4
- data/.travis.yml +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2293fbddc8018a27222be7e201f47b82d0d4b01db05cbcbf2f3422ed7f1bda39
|
4
|
+
data.tar.gz: 5b83c23d0fd9226e57fff0109f17786df233bb716bd5ab06ebe08ee4184bc222
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85aa09f68974274801661fd2994434b3e4c503d58bb8ef19bbc596391f7cfecd5e28bdb64a18a36fc465897d26c491412beddf9a0835c4a54502c20103167b62
|
7
|
+
data.tar.gz: 28179469a17495c2a44e00ddc9dc5b39cb840e72c1b2aae1da2c8ba2626eca4bec465492e02dd17947a1006ae9337920a0ed49c18fc786e11b6f4f3960b830f2
|
@@ -0,0 +1,28 @@
|
|
1
|
+
|
2
|
+
name: Ruby CI
|
3
|
+
|
4
|
+
on:
|
5
|
+
push:
|
6
|
+
branches: [ main ]
|
7
|
+
pull_request:
|
8
|
+
branches: [ main ]
|
9
|
+
|
10
|
+
jobs:
|
11
|
+
test:
|
12
|
+
|
13
|
+
runs-on: ubuntu-latest
|
14
|
+
|
15
|
+
strategy:
|
16
|
+
matrix:
|
17
|
+
ruby-version: [3.0.2, 2.7.4, 2.6.8, 2.5.9]
|
18
|
+
|
19
|
+
steps:
|
20
|
+
- uses: actions/checkout@v2
|
21
|
+
- name: Set up Ruby ${{ matrix.ruby-version }}
|
22
|
+
uses: ruby/setup-ruby@v1
|
23
|
+
with:
|
24
|
+
ruby-version: ${{ matrix.ruby-version }}
|
25
|
+
- name: Install dependencies
|
26
|
+
run: bundle install
|
27
|
+
- name: Run tests
|
28
|
+
run: bundle exec rspec
|
data/.rubocop.yml
ADDED
data/call_number_ranges.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
|
|
16
16
|
END_DESCRIPTION
|
17
17
|
spec.homepage = 'https://github.com/lbcclib/call_number_ranges'
|
18
18
|
spec.license = 'MIT'
|
19
|
-
spec.required_ruby_version = Gem::Requirement.new('>= 2.
|
19
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 2.5.0')
|
20
20
|
|
21
21
|
spec.metadata['homepage_uri'] = spec.homepage
|
22
22
|
spec.metadata['source_code_uri'] = 'https://github.com/lbcclib/call_number_ranges'
|
data/lib/call_number_ranges.rb
CHANGED
@@ -1,115 +1,119 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'call_number_ranges/version'
|
4
|
-
|
5
|
-
DISCIPLINES = {
|
6
|
-
'Accessibility' => Regexp.new('^(HV155[3-9]|HV15[6-9][0-9]|HV1[6-9][0-9]{2}|HV2[0-9]{3}|HV300[0-4]|'\
|
7
|
-
'KF480|LC481[2-9]|LC48[2-9][0-9]|LC49[01][0-9]|LC492[0-8]|'\
|
8
|
-
'NA2547|'\
|
9
|
-
'RA440|RC553.A88|RC569\.[7-9]|RC57[0-4])'),
|
10
|
-
'Accounting' => /^HF(56[0-9]{2})(\.|\s)/,
|
11
|
-
'Agriculture' => Regexp.new('^(HD140[1-9]|HD14[1-9][0-9]|HD1[5-9][0-9]{2}|HD2[01][0-9]{2}|HD220[0-9]|HD2210|'\
|
12
|
-
'S[0-9]+|SF1?[0-9]{,2}|SF2[0-48-9][0-9]|SF27[6-9]|'\
|
13
|
-
'TJ148[0-9]|TJ149[0-6])'),
|
14
|
-
'Anthropology' => /^(CC|GN|GR|GT|E[5-9][0-9](\.|\s)|PM[0-9]{1,3}(\.|\s)|PM[1-7][0-9]{3}(\.|\s))/,
|
15
|
-
'Automotive technology' => /^(TP359\s?\.B46|TL)/,
|
16
|
-
'Aviation science' => /^(TL[56][0-9]{2}|7[0-7][0-9]|78[0-5])(\.|\s)/,
|
17
|
-
'Biology' => Regexp.new('^(GE[0-9]|'\
|
18
|
-
'Q[12]?[0-9]{,2}(\.|\s)|QH[0-9]|QK[0-9]|QL[0-9]|QM[0-9]|QP[0-9]|QR[0-9]|'\
|
19
|
-
'S59[0-9]|S6[0-5][0-9]|S66[0-7]|SB|SD|SH|'\
|
20
|
-
'TP248\.1[3-9]|TP248\.[2-5]|TP248\.6[0-5])'),
|
21
|
-
'Business' => /^(HB[0-9]|HC[0-9]|HD[0-9]|HE[0-9]|HF[0-9]|HG[0-9]|HJ[0-9])/,
|
22
|
-
'Ceramics' => /^(NK3[7-9][0-9]{2}|NK4[0-5][0-9]{2}|NK46[0-8][0-9]|NK469[0-4]|TT919|TT92[0-7])(\.|\s)/,
|
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
|
-
'
|
64
|
-
'
|
65
|
-
'
|
66
|
-
|
67
|
-
|
68
|
-
'
|
69
|
-
'
|
70
|
-
'
|
71
|
-
'
|
72
|
-
'
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
'
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
'
|
88
|
-
'
|
89
|
-
'
|
90
|
-
'
|
91
|
-
|
92
|
-
'
|
93
|
-
'
|
94
|
-
'
|
95
|
-
|
96
|
-
'
|
97
|
-
'
|
98
|
-
'
|
99
|
-
|
100
|
-
'
|
101
|
-
|
102
|
-
|
103
|
-
'
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'call_number_ranges/version'
|
4
|
+
|
5
|
+
DISCIPLINES = {
|
6
|
+
'Accessibility' => Regexp.new('^(HV155[3-9]|HV15[6-9][0-9]|HV1[6-9][0-9]{2}|HV2[0-9]{3}|HV300[0-4]|'\
|
7
|
+
'KF480|LC481[2-9]|LC48[2-9][0-9]|LC49[01][0-9]|LC492[0-8]|'\
|
8
|
+
'NA2547|'\
|
9
|
+
'RA440|RC553.A88|RC569\.[7-9]|RC57[0-4])'),
|
10
|
+
'Accounting' => /^HF(56[0-9]{2})(\.|\s)/,
|
11
|
+
'Agriculture' => Regexp.new('^(HD140[1-9]|HD14[1-9][0-9]|HD1[5-9][0-9]{2}|HD2[01][0-9]{2}|HD220[0-9]|HD2210|'\
|
12
|
+
'S[0-9]+|SF1?[0-9]{,2}|SF2[0-48-9][0-9]|SF27[6-9]|'\
|
13
|
+
'TJ148[0-9]|TJ149[0-6])'),
|
14
|
+
'Anthropology' => /^(CC|GN|GR|GT|E[5-9][0-9](\.|\s)|PM[0-9]{1,3}(\.|\s)|PM[1-7][0-9]{3}(\.|\s))/,
|
15
|
+
'Automotive technology' => /^(TP359\s?\.B46|TL)/,
|
16
|
+
'Aviation science' => /^(TL[56][0-9]{2}|7[0-7][0-9]|78[0-5])(\.|\s)/,
|
17
|
+
'Biology' => Regexp.new('^(GE[0-9]|'\
|
18
|
+
'Q[12]?[0-9]{,2}(\.|\s)|QH[0-9]|QK[0-9]|QL[0-9]|QM[0-9]|QP[0-9]|QR[0-9]|'\
|
19
|
+
'S59[0-9]|S6[0-5][0-9]|S66[0-7]|SB|SD|SH|'\
|
20
|
+
'TP248\.1[3-9]|TP248\.[2-5]|TP248\.6[0-5])'),
|
21
|
+
'Business' => /^(HB[0-9]|HC[0-9]|HD[0-9]|HE[0-9]|HF[0-9]|HG[0-9]|HJ[0-9])/,
|
22
|
+
'Ceramics' => /^(NK3[7-9][0-9]{2}|NK4[0-5][0-9]{2}|NK46[0-8][0-9]|NK469[0-4]|TT919|TT92[0-7])(\.|\s)/,
|
23
|
+
'College administration' => /^LB(2328|2341)/,
|
24
|
+
'Communication' => /^(GN345\.6|HM258|P8[7-9]|P9[0-6]|PN4[0-2][0-9]{2}|PN43[01][0-9]|PN432[01])(\.|\s)/,
|
25
|
+
'Computer science' => Regexp.new('^(HD69\.P75|HF5548\.[45]|'\
|
26
|
+
'Q3[3-9][0-9]|QA7[56]\.[5-9][0-9]*|QA16[4-9]|'\
|
27
|
+
'T14\.5|T36|T57|T58\.[56][0-9]*|TJ211|TJ223|TK5105)(\.|\s)'),
|
28
|
+
'Counseling' => /^(BF636|LB2343)(\.|\s)/,
|
29
|
+
'Criminal justice' => Regexp.new('^(HV[678][0-9]{3}|HV9[0-8][0-9]{2}|HV99[01][0-9]|HV9920|'\
|
30
|
+
'KF9[67][0-9]{2}|KF98[01][0-9]|KF982[0-7])'),
|
31
|
+
'Culinary arts' => Regexp.new('^(SF2[56][0-9]|SF27[0-5]|'\
|
32
|
+
'TP371|'\
|
33
|
+
'TP5[0-9]{2}|TP6[0-7][0-9]|TP68[0-4]|'\
|
34
|
+
'TX(537|545|63[1-9]|6[4-9][0-9]|[78][0-9]{2}|9[0-4][0-9]|95[0-3]))'),
|
35
|
+
'Dental assisting' => /^(RK[0-9]+|QM535)(\.|\s)/,
|
36
|
+
'Developmental studies' => /^LB2331\.2/,
|
37
|
+
'Diagnostic imaging' => /^RC78\.7/,
|
38
|
+
'Drafting and engineering graphics' => /^(T35[1-9]|T36[0-9]|T37[01]|TA174)(\.|\s)/,
|
39
|
+
'Earth sciences' => /^(Q[12]?[0-9]{,2}(\.|\s)|GE|QE|SD|SH|SK)/,
|
40
|
+
'Education and HDFS' => Regexp.new('^(GN480|GT24[6-8][0-9]|GT2490|'\
|
41
|
+
'HV699|HV[7-9][0-9]{2}|HV1[0-3][0-9]{2}|14[0-4][0-9]|'\
|
42
|
+
'HQ75\.27|HQ75\.53|HQ77[789]|HQ78[01]|HQ79[3-9]|'\
|
43
|
+
'L[ABC]?[0-9]+)(\.|\s)'),
|
44
|
+
'Electrician' => /^(QC5\d{2}|QC7[01]\d|QC721|TK1\d{2})/,
|
45
|
+
'Engineering' => /^(T[AJK][0-9]+|TP15[56])(\.|\s)/,
|
46
|
+
'English and writing' => /^(LB2360|P[0-9EN-Z]|T11(\.|\s)|T11\.[0-5]|ZA3075)/,
|
47
|
+
'English Language Acquisition' => Regexp.new('^(LB1572|LB1576|'\
|
48
|
+
'P51|P11[89]|P12[01]|PE110[89]|PE111[0-4]|PE1128\.A2|PE113[1-9]|PE1404)'\
|
49
|
+
'(\.|\s)'),
|
50
|
+
'Equine science' => /^SF3[0-9]{2}(\.|\s)/,
|
51
|
+
'Equity, diversity, and inclusion' => Regexp.new('^(BF575\.P9|'\
|
52
|
+
'E184\.A1|E185\.6|'\
|
53
|
+
'GN345\.6|GN469|GN495\.8|'\
|
54
|
+
'HF5549\.5\.A34|HF5549\.5\.M5|'\
|
55
|
+
'HM146|HM671|'\
|
56
|
+
'HN90\.(E4|M26|M84|P57|P6|S6)|'\
|
57
|
+
'HT150[1-9]|HT151[0-9]|HT152[01]|'\
|
58
|
+
'K3242|'\
|
59
|
+
'LB237[56]|'\
|
60
|
+
'LC19[1-9]|LC20[0-9]|LC21[0-3]|LC214\.[0-4]|LC214\.5[0-3]|'\
|
61
|
+
'LC1099|LC1[1-9][0-9]{2}|LC[234][0-9]{3}|'\
|
62
|
+
'LC50[0-9]{2}|LC51[0-5][0-9])'\
|
63
|
+
'(\.|\s)'),
|
64
|
+
'Film studies' => /^(PN199[3-8]|TR84[5-9]|TR8[5-9][0-9]|TR9[01][0-9]|TR92[0-3])(\.|\s)/,
|
65
|
+
'Health, Human Performance, Athletics and PE' => Regexp.new('^(GV20[1-9]|GV2[1-9][0-9]|GV[3-9][0-9]{2}|'\
|
66
|
+
'GV10[0-9]{2}|GV11[0-8][0-9]|GV119[0-8]|'\
|
67
|
+
'RC12[0-3][0-9]|RC124[0-5])(\.|\s)'),
|
68
|
+
'Health informatics' => /^R85[89]|R86[0-4](\.|\s)/,
|
69
|
+
'Heavy equipment/diesel' => /^TJ(\.|\s)/,
|
70
|
+
'History' => /^([CDEF][0-9]+)(\.|\s)/,
|
71
|
+
'International admissions' => /^LB237[56]/,
|
72
|
+
'Journalism' => /^PN(4699|4[7-9][0-9]{2}|5[0-5][0-9]{2}|56[0-5][0-9])/,
|
73
|
+
'Machine tool' => /^TJ(11[89][0-9]|1[012][0-9]{2}|130[0-9]|131[0-3]|184)/,
|
74
|
+
'Math' => /^(HA|QA[1-6]|QA7[0-5]|QA7[89]|QA[89])/,
|
75
|
+
'Mechatronics' => /^(TJ163\.12|TK7875)/,
|
76
|
+
'Medical assisting' => Regexp.new('^(HG937[1-9]|HG93[89][0-9]|QM[0-9]+|'\
|
77
|
+
'R118|R123|R728\.8|'\
|
78
|
+
'RA[1-9]|RA[1-9][0-9]|RA[123][0-9]{2}|RA40[0-9]|RA41[0-5]|'\
|
79
|
+
'RC683.5.E5|RS[0-9]+)(\.|\s)'),
|
80
|
+
'Music' => /^((M|ML|MT)[0-9]+|QP306)/,
|
81
|
+
'Non-destructive testing' => /^TA417\.[2-5]/,
|
82
|
+
'Nursing' => Regexp.new('^((GN484\.38)|'\
|
83
|
+
'(QM|R[GST])[0-9]+|'\
|
84
|
+
'QP([0-9]|[123][0-9]|4[01]|91|249|267|'\
|
85
|
+
'3[035][1-6]|32[1-9]|361|50[1-9]|51[0-8]|55[1-9]|5[6-9][0-9]|'\
|
86
|
+
'6[0-9]{2}|7[0-4][0-9]|75[0-2])(\.|\s))'),
|
87
|
+
'Occupational therapy' => /^(BF71[2-9]|BF72[1-3]|BF724|QM[0-9]+|RM69[5-9]|RM[78][0-9]{2}|RM9[0-4][0-9]|RM950)(\.|\s)/,
|
88
|
+
'Philosophy' => /^(B[0-9]+|BJ[1-9]|BJ[1-9][0-9]{1,2}|BJ1[0-5][0-9]{2}|BJ16[0-8][0-9]|BJ169[0-7])(\.|\s)/,
|
89
|
+
'Physical sciences' => /^(Q[12]?[0-9]{,2}(\.|\s)|Q[BCD]?[0-9]+|TX545(\.|\s))/,
|
90
|
+
'Polysomnographic technology' => /^(BF(106[89]|107[0-3])|QP42[5-7]|RA78[56]|RC54[7-9]|RC737\.5)(\.|\s)/,
|
91
|
+
'Psychology' => /^(BF[0-9]+|R726\.[5-8]|RA785|RC32[1-9]|RC3[3-9][0-9]|RC4[0-9]{2}|RC5[0-6][0-9]|RC57[01])(\.|\s)/,
|
92
|
+
'Public safety' => /^(HV8290|LB2866|QE53[1-9]|QE54[01])(\.|\s)/,
|
93
|
+
'Queer studies' => /^(BF692|HQ7[5-7])/,
|
94
|
+
'Religion' => Regexp.new('^(B[LMPQRSTVX][0-9]+|DS1[0-4][0-9]|KB[0-9]+|'\
|
95
|
+
'LC32[1-9]|LC3[3-9][0-9]|LC[4-8][0-9]{2}|LC9[012][0-9])(\.|\s)'),
|
96
|
+
'Small business' => /^(HD67\.2|HD2340\.[89]|HD234[0-5]|HD2346\.[0-5]|HF5679)/,
|
97
|
+
'Sociology' => /^(E184|H[MNQSTV][0-9]+)/,
|
98
|
+
'Spanish' => Regexp.new('^(PC407[3-9]|PC4[1-8][0-9]{2}|PC49[0-6][0-9]|PC497[01]|'\
|
99
|
+
'PQ603[7-9]|PQ60[4-9][0-9]|PQ6[1-7][0-9]{2}|PQ8[0-4][0-9]{2}|PQ85[01][0-9])'),
|
100
|
+
'Surgery' => /^(RD\n+|QM\n+|QR[1-9]|QR[1-6][0-9]|QR7[0-4]|R72[3-6])(\.|\s)/,
|
101
|
+
'Visual arts' => /^(N[0-9]|NA|NB|NC|ND|NE|NK|NX|TR|TT919|TT92[0-7])/,
|
102
|
+
'Visual communication' => /^(NC99[7-9]|NC100[0-3]|N7433\.8|NC915\.C65|NK15[2-4][0-9]|TK5105\.888|Z246|Z250)(\.|\s)/,
|
103
|
+
'Water, Environment and Technology' => /^TD7(4[1-9]|[5-7][0-9]|80)(\.|\s)/,
|
104
|
+
'Web technologies' => Regexp.new('(QA76\.76\s?\.H94|QA76\.73\s?\.J39|'\
|
105
|
+
'QA76\.73\s?\.P224|QA76\.73\s?\.R83|QA76\.73\s?\.S67|'\
|
106
|
+
'TK5105\.888)'),
|
107
|
+
'Welding' => /^(NB1220|TH6711|TK4660|TS21[5-9]|TS22[0-8]|TS280|TT211)(\.|\s)/,
|
108
|
+
"Women's studies" => /^BF692|HQ(11[1-9]|1[2-9][0-9]|[2-9][0-9]{2}|10[0-57-9][0-9]{2}|1[1-9][0-9]{2})(\.|\s)/
|
109
|
+
}.freeze
|
110
|
+
|
111
|
+
module CallNumberRanges
|
112
|
+
# Helpful if you have a call number, but want to see
|
113
|
+
# what disciplines match
|
114
|
+
class CallNumber
|
115
|
+
def self.disciplines(call_number)
|
116
|
+
DISCIPLINES.select { |_name, range| call_number.match? range }.keys
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: call_number_ranges
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jane Sandberg
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -48,9 +48,10 @@ executables: []
|
|
48
48
|
extensions: []
|
49
49
|
extra_rdoc_files: []
|
50
50
|
files:
|
51
|
+
- ".github/workflows/test.yml"
|
51
52
|
- ".gitignore"
|
52
53
|
- ".rspec"
|
53
|
-
- ".
|
54
|
+
- ".rubocop.yml"
|
54
55
|
- Gemfile
|
55
56
|
- LICENSE.txt
|
56
57
|
- README.md
|
@@ -74,7 +75,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
74
75
|
requirements:
|
75
76
|
- - ">="
|
76
77
|
- !ruby/object:Gem::Version
|
77
|
-
version: 2.
|
78
|
+
version: 2.5.0
|
78
79
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
79
80
|
requirements:
|
80
81
|
- - ">="
|