call_number_ranges 0.1.0 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2049e102ca3998497eb94a67a8cb6de4d0ff91e4c0cb113d7f7ae32ace9fbcdd
4
- data.tar.gz: a1fb8effe7c13cc3668525a972cc190f205531d33448c007f77ac3b6931f3440
3
+ metadata.gz: 9023472f5c2a0d3065069ffaaceaea18921519d00739e3e086402ed1c88fea8a
4
+ data.tar.gz: 397c5b5cae0ae7227a7ec50ac6cab9af22119305d3e4b2877f5e1198374484ff
5
5
  SHA512:
6
- metadata.gz: aac087b77725073f2b106a5aafa65fb54de88fffac2ad019dabf0cec7ab8b9511e6654d7b93444eb1aabca508f6d3b7950015e928ccce6d42770ff2f14a2fb82
7
- data.tar.gz: 0523bd846abb1c803751b9879015efb19def1a20ba99365fb9a4c73c7302f028b270c7d0f6c3617756913ace11f4ebee6b29fe62c29852ef86011fbd824f7a8c
6
+ metadata.gz: f05d536d3cdf5978f89221f55dc091b0962cfe94bfc5c6b54c7149711f4fbd82ed94435f2baee833755171b85c15f55849c360265db955f1ca4fcc2bdb5813d1
7
+ data.tar.gz: 85679c6b27737a8bbff52c1fed8bdae63b16d1ff03f6edde5abca9a8edb975209ac4bf85d6357e210235b8e5355090799f9903e708bea88f4f19637f1007a2b3
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # CallNumberRanges
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/call_number_ranges`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ This gem reads Library of Congress call numbers and then gives you a list of disciplines and departments that may be interested.
6
4
 
7
5
  ## Installation
8
6
 
@@ -20,9 +18,6 @@ Or install it yourself as:
20
18
 
21
19
  $ gem install call_number_ranges
22
20
 
23
- ## Usage
24
-
25
- TODO: Write usage instructions here
26
21
 
27
22
  ## Development
28
23
 
@@ -32,7 +27,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
27
 
33
28
  ## Contributing
34
29
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/call_number_ranges.
30
+ Bug reports and pull requests are welcome on GitHub at https://github.com/lbcclib/call_number_ranges.
36
31
 
37
32
 
38
33
  ## License
@@ -1,114 +1,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' => /^TL(\.|\s)/,
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
- 'Communication' => /^(GN345\.6|HM258|P8[7-9]|P9[0-6]|PN4[0-2][0-9]{2}|PN43[01][0-9]|PN432[01])(\.|\s)/,
24
- 'Computer science' => Regexp.new('^(HD69\.P75|HF5548\.[45]|'\
25
- 'Q3[3-9][0-9]|QA7[56]\.[5-9][0-9]*|QA16[4-9]|'\
26
- 'T14\.5|T36|T57|T58\.[56][0-9]*|TJ211|TJ223|TK5105)(\.|\s)'),
27
- 'Counseling' => /^(BF636|LB2343)(\.|\s)/,
28
- 'Criminal justice' => Regexp.new('^(HV[678][0-9]{3}|HV9[0-8][0-9]{2}|HV99[01][0-9]|HV9920|'\
29
- 'KF9[67][0-9]{2}|KF98[01][0-9]|KF982[0-7])'),
30
- 'Culinary arts' => Regexp.new('^(SF2[56][0-9]|SF27[0-5]|'\
31
- 'TP5[0-9]{2}|TP6[0-7][0-9]|TP68[0-4]|'\
32
- 'TX(537|545|63[1-9]|6[4-9][0-9]|[78][0-9]{2}|9[0-4][0-9]|95[0-3]))'),
33
- 'Dental assisting' => /^(RK[0-9]+|QM535)(\.|\s)/,
34
- 'Developmental studies' => /^LB2331\.2/,
35
- 'Diagnostic imaging' => /^RC78\.7/,
36
- 'Drafting and engineering graphics' => /^(T35[1-9]|T36[0-9]|T37[01]|TA174)(\.|\s)/,
37
- 'Earth sciences' => /^(Q[12]?[0-9]{,2}(\.|\s)|GE|QE|SD|SH|SK)/,
38
- 'Education and HDFS' => Regexp.new('^(GN480|GT24[6-8][0-9]|GT2490|'\
39
- 'HV699|HV[7-9][0-9]{2}|HV1[0-3][0-9]{2}|14[0-4][0-9]|'\
40
- 'HQ75\.27|HQ75\.53|HQ77[789]|HQ78[01]|HQ79[3-9]|'\
41
- 'L[ABC]?[0-9]+)(\.|\s)'),
42
- 'Engineering' => /^(T[AJK][0-9]+|TP15[56])(\.|\s)/,
43
- 'English and writing' => /^(LB2360|P[0-9EN-Z]|T11(\.|\s)|T11\.[0-5]|ZA3075)/,
44
- 'English Language Acquisition' => Regexp.new('^(LB1572|LB1576|'\
45
- 'P51|P11[89]|P12[01]|PE110[89]|PE111[0-4]|PE1128\.A2|PE113[1-9]|PE1404)'\
46
- '(\.|\s)'),
47
- 'Equine science' => /^SF3[0-9]{2}(\.|\s)/,
48
- 'Equity, diversity, and inclusion' => Regexp.new('^(BF575\.P9|'\
49
- 'E184\.A1|E185\.6|'\
50
- 'GN345\.6|GN469|GN495\.8|'\
51
- 'HF5549\.5\.A34|HF5549\.5\.M5|'\
52
- 'HM146|HM671|'\
53
- 'HN90\.(E4|M26|M84|P57|P6|S6)|'\
54
- 'HT150[1-9]|HT151[0-9]|HT152[01]|'\
55
- 'K3242|'\
56
- 'LB237[56]|'\
57
- 'LC19[1-9]|LC20[0-9]|LC21[0-3]|LC214\.[0-4]|LC214\.5[0-3]|'\
58
- 'LC1099|LC1[1-9][0-9]{2}|LC[234][0-9]{3}|LC50[0-9]{2}|LC51[0-5][0-9])'\
59
- '(\.|\s)'),
60
- 'Film studies' => /^(PN199[3-8]|TR84[5-9]|TR8[5-9][0-9]|TR9[01][0-9]|TR92[0-3])(\.|\s)/,
61
- 'Health, Human Performance, Athletics and PE' => Regexp.new('^(GV20[1-9]|GV2[1-9][0-9]|GV[3-9][0-9]{2}|'\
62
- 'GV10[0-9]{2}|GV11[0-8][0-9]|GV119[0-8]|'\
63
- 'RC12[0-3][0-9]|RC124[0-5])(\.|\s)'),
64
- 'Health informatics' => /^R85[89]|R86[0-4](\.|\s)/,
65
- 'Heavy equipment/diesel' => /^TJ(\.|\s)/,
66
- 'History' => /^([CDEF][0-9]+)(\.|\s)/,
67
- 'International admissions' => /^LB237[56]/,
68
- 'Journalism' => /^PN(4699|4[7-9][0-9]{2}|5[0-5][0-9]{2}|56[0-5][0-9])/,
69
- 'Machine tool' => /^(TJ11[89][0-9]|TJ1[012][0-9]{2}|TJ130[0-9]|TJ131[0-3])/,
70
- 'Math' => /^(HA|QA[1-6]|QA7[0-5]|QA7[89]|QA[89])/,
71
- 'Mechatronics' => /^(TJ163\.12|TK7875)/,
72
- 'Medical assisting' => Regexp.new('^(HG937[1-9]|HG93[89][0-9]|QM[0-9]+|'\
73
- 'R118|R123|R728\.8|'\
74
- 'RA[1-9]|RA[1-9][0-9]|RA[123][0-9]{2}|RA40[0-9]|RA41[0-5]|'\
75
- 'RC683.5.E5|RS[0-9]+)(\.|\s)'),
76
- 'Music' => /^(M|ML|MT)[0-9]+/,
77
- 'Non-destructive testing' => /^TA417\.[2-5]/,
78
- 'Nursing' => Regexp.new('^((GN484\.38)|'\
79
- '(QM|R[GST])[0-9]+|'\
80
- 'QP([0-9]|[123][0-9]|4[01]|91|249|267|'\
81
- '3[035][1-6]|32[1-9]|361|50[1-9]|51[0-8]|55[1-9]|5[6-9][0-9]|'\
82
- '6[0-9]{2}|7[0-4][0-9]|75[0-2])(\.|\s))'),
83
- '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)/,
84
- '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)/,
85
- 'Physical sciences' => /^(Q[12]?[0-9]{,2}(\.|\s)|Q[BCD]?[0-9]+|TX545(\.|\s))/,
86
- 'Polysomnographic technology' => /^(BF(106[89]|107[0-3])|QP42[5-7]|RA78[56]|RC54[7-9]|RC737\.5)(\.|\s)/,
87
- '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)/,
88
- 'Public safety' => /^(HV8290|LB2866|QE53[1-9]|QE54[01])(\.|\s)/,
89
- 'Religion' => Regexp.new('^(B[LMPQRSTVX][0-9]+|DS1[0-4][0-9]|KB[0-9]+|'\
90
- 'LC32[1-9]|LC3[3-9][0-9]|LC[4-8][0-9]{2}|LC9[012][0-9])(\.|\s)'),
91
- 'Small business' => /^(HD67\.2|HD2340\.[89]|HD234[0-5]|HD2346\.[0-5]|HF5679)/,
92
- 'Sociology' => /^(E184|H[MNQSTV][0-9]+)/,
93
- 'Spanish' => Regexp.new('^(PC407[3-9]|PC4[1-8][0-9]{2}|PC49[0-6][0-9]|PC497[01]|'\
94
- 'PQ603[7-9]|PQ60[4-9][0-9]|PQ6[1-7][0-9]{2}|PQ8[0-4][0-9]{2}|PQ85[01][0-9])'),
95
- 'Surgery' => /^(RD\n+|QM\n+|QR[1-9]|QR[1-6][0-9]|QR7[0-4]|R72[3-6])(\.|\s)/,
96
- 'Visual arts' => /^(N[0-9]|NA|NB|NC|ND|NE|NK|NX|TR|TT919|TT92[0-7])/,
97
- 'Visual communication' => /^(NC99[7-9]|NC100[0-3]|N7433\.8|NC915\.C65|NK15[2-4][0-9]|TK5105\.888|Z246|Z250)(\.|\s)/,
98
- 'Water, Environment and Technology' => /^TD7(4[1-9]|[5-7][0-9]|80)(\.|\s)/,
99
- 'Web technologies' => Regexp.new('(QA76\.76\s?\.H94|QA76\.73\s?\.J39|'\
100
- 'QA76\.73\s?\.P224|QA76\.73\s?\.R83|QA76\.73\s?\.S67|'\
101
- 'TK5105\.888)'),
102
- 'Welding' => /^T(S21[5-9]|S22[0-8]|T211)(\.|\s)/,
103
- "Women's studies" => /^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)/
104
- }.freeze
105
-
106
- module CallNumberRanges
107
- # Helpful if you have a call number, but want to see
108
- # what disciplines match
109
- class CallNumber
110
- def self.disciplines(call_number)
111
- DISCIPLINES.select { |_name, range| call_number.match? range }.keys
112
- end
113
- end
114
- end
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
+ 'Communication' => /^(GN345\.6|HM258|P8[7-9]|P9[0-6]|PN4[0-2][0-9]{2}|PN43[01][0-9]|PN432[01])(\.|\s)/,
24
+ 'Computer science' => Regexp.new('^(HD69\.P75|HF5548\.[45]|'\
25
+ 'Q3[3-9][0-9]|QA7[56]\.[5-9][0-9]*|QA16[4-9]|'\
26
+ 'T14\.5|T36|T57|T58\.[56][0-9]*|TJ211|TJ223|TK5105)(\.|\s)'),
27
+ 'Counseling' => /^(BF636|LB2343)(\.|\s)/,
28
+ 'Criminal justice' => Regexp.new('^(HV[678][0-9]{3}|HV9[0-8][0-9]{2}|HV99[01][0-9]|HV9920|'\
29
+ 'KF9[67][0-9]{2}|KF98[01][0-9]|KF982[0-7])'),
30
+ 'Culinary arts' => Regexp.new('^(SF2[56][0-9]|SF27[0-5]|'\
31
+ 'TP5[0-9]{2}|TP6[0-7][0-9]|TP68[0-4]|'\
32
+ 'TX(537|545|63[1-9]|6[4-9][0-9]|[78][0-9]{2}|9[0-4][0-9]|95[0-3]))'),
33
+ 'Dental assisting' => /^(RK[0-9]+|QM535)(\.|\s)/,
34
+ 'Developmental studies' => /^LB2331\.2/,
35
+ 'Diagnostic imaging' => /^RC78\.7/,
36
+ 'Drafting and engineering graphics' => /^(T35[1-9]|T36[0-9]|T37[01]|TA174)(\.|\s)/,
37
+ 'Earth sciences' => /^(Q[12]?[0-9]{,2}(\.|\s)|GE|QE|SD|SH|SK)/,
38
+ 'Education and HDFS' => Regexp.new('^(GN480|GT24[6-8][0-9]|GT2490|'\
39
+ 'HV699|HV[7-9][0-9]{2}|HV1[0-3][0-9]{2}|14[0-4][0-9]|'\
40
+ 'HQ75\.27|HQ75\.53|HQ77[789]|HQ78[01]|HQ79[3-9]|'\
41
+ 'L[ABC]?[0-9]+)(\.|\s)'),
42
+ 'Engineering' => /^(T[AJK][0-9]+|TP15[56])(\.|\s)/,
43
+ 'English and writing' => /^(LB2360|P[0-9EN-Z]|T11(\.|\s)|T11\.[0-5]|ZA3075)/,
44
+ 'English Language Acquisition' => Regexp.new('^(LB1572|LB1576|'\
45
+ 'P51|P11[89]|P12[01]|PE110[89]|PE111[0-4]|PE1128\.A2|PE113[1-9]|PE1404)'\
46
+ '(\.|\s)'),
47
+ 'Equine science' => /^SF3[0-9]{2}(\.|\s)/,
48
+ 'Equity, diversity, and inclusion' => Regexp.new('^(BF575\.P9|'\
49
+ 'E184\.A1|E185\.6|'\
50
+ 'GN345\.6|GN469|GN495\.8|'\
51
+ 'HF5549\.5\.A34|HF5549\.5\.M5|'\
52
+ 'HM146|HM671|'\
53
+ 'HN90\.(E4|M26|M84|P57|P6|S6)|'\
54
+ 'HT150[1-9]|HT151[0-9]|HT152[01]|'\
55
+ 'K3242|'\
56
+ 'LB237[56]|'\
57
+ 'LC19[1-9]|LC20[0-9]|LC21[0-3]|LC214\.[0-4]|LC214\.5[0-3]|'\
58
+ 'LC1099|LC1[1-9][0-9]{2}|LC[234][0-9]{3}|LC50[0-9]{2}|LC51[0-5][0-9])'\
59
+ '(\.|\s)'),
60
+ 'Film studies' => /^(PN199[3-8]|TR84[5-9]|TR8[5-9][0-9]|TR9[01][0-9]|TR92[0-3])(\.|\s)/,
61
+ 'Health, Human Performance, Athletics and PE' => Regexp.new('^(GV20[1-9]|GV2[1-9][0-9]|GV[3-9][0-9]{2}|'\
62
+ 'GV10[0-9]{2}|GV11[0-8][0-9]|GV119[0-8]|'\
63
+ 'RC12[0-3][0-9]|RC124[0-5])(\.|\s)'),
64
+ 'Health informatics' => /^R85[89]|R86[0-4](\.|\s)/,
65
+ 'Heavy equipment/diesel' => /^TJ(\.|\s)/,
66
+ 'History' => /^([CDEF][0-9]+)(\.|\s)/,
67
+ 'International admissions' => /^LB237[56]/,
68
+ 'Journalism' => /^PN(4699|4[7-9][0-9]{2}|5[0-5][0-9]{2}|56[0-5][0-9])/,
69
+ 'Machine tool' => /^TJ(11[89][0-9]|1[012][0-9]{2}|130[0-9]|131[0-3]|184)/,
70
+ 'Math' => /^(HA|QA[1-6]|QA7[0-5]|QA7[89]|QA[89])/,
71
+ 'Mechatronics' => /^(TJ163\.12|TK7875)/,
72
+ 'Medical assisting' => Regexp.new('^(HG937[1-9]|HG93[89][0-9]|QM[0-9]+|'\
73
+ 'R118|R123|R728\.8|'\
74
+ 'RA[1-9]|RA[1-9][0-9]|RA[123][0-9]{2}|RA40[0-9]|RA41[0-5]|'\
75
+ 'RC683.5.E5|RS[0-9]+)(\.|\s)'),
76
+ 'Music' => /^(M|ML|MT)[0-9]+/,
77
+ 'Non-destructive testing' => /^TA417\.[2-5]/,
78
+ 'Nursing' => Regexp.new('^((GN484\.38)|'\
79
+ '(QM|R[GST])[0-9]+|'\
80
+ 'QP([0-9]|[123][0-9]|4[01]|91|249|267|'\
81
+ '3[035][1-6]|32[1-9]|361|50[1-9]|51[0-8]|55[1-9]|5[6-9][0-9]|'\
82
+ '6[0-9]{2}|7[0-4][0-9]|75[0-2])(\.|\s))'),
83
+ '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)/,
84
+ '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)/,
85
+ 'Physical sciences' => /^(Q[12]?[0-9]{,2}(\.|\s)|Q[BCD]?[0-9]+|TX545(\.|\s))/,
86
+ 'Polysomnographic technology' => /^(BF(106[89]|107[0-3])|QP42[5-7]|RA78[56]|RC54[7-9]|RC737\.5)(\.|\s)/,
87
+ '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)/,
88
+ 'Public safety' => /^(HV8290|LB2866|QE53[1-9]|QE54[01])(\.|\s)/,
89
+ 'Queer studies' => /^(BF692|HQ7[5-7])/,
90
+ 'Religion' => Regexp.new('^(B[LMPQRSTVX][0-9]+|DS1[0-4][0-9]|KB[0-9]+|'\
91
+ 'LC32[1-9]|LC3[3-9][0-9]|LC[4-8][0-9]{2}|LC9[012][0-9])(\.|\s)'),
92
+ 'Small business' => /^(HD67\.2|HD2340\.[89]|HD234[0-5]|HD2346\.[0-5]|HF5679)/,
93
+ 'Sociology' => /^(E184|H[MNQSTV][0-9]+)/,
94
+ 'Spanish' => Regexp.new('^(PC407[3-9]|PC4[1-8][0-9]{2}|PC49[0-6][0-9]|PC497[01]|'\
95
+ 'PQ603[7-9]|PQ60[4-9][0-9]|PQ6[1-7][0-9]{2}|PQ8[0-4][0-9]{2}|PQ85[01][0-9])'),
96
+ 'Surgery' => /^(RD\n+|QM\n+|QR[1-9]|QR[1-6][0-9]|QR7[0-4]|R72[3-6])(\.|\s)/,
97
+ 'Visual arts' => /^(N[0-9]|NA|NB|NC|ND|NE|NK|NX|TR|TT919|TT92[0-7])/,
98
+ 'Visual communication' => /^(NC99[7-9]|NC100[0-3]|N7433\.8|NC915\.C65|NK15[2-4][0-9]|TK5105\.888|Z246|Z250)(\.|\s)/,
99
+ 'Water, Environment and Technology' => /^TD7(4[1-9]|[5-7][0-9]|80)(\.|\s)/,
100
+ 'Web technologies' => Regexp.new('(QA76\.76\s?\.H94|QA76\.73\s?\.J39|'\
101
+ 'QA76\.73\s?\.P224|QA76\.73\s?\.R83|QA76\.73\s?\.S67|'\
102
+ 'TK5105\.888)'),
103
+ 'Welding' => /^(NB1220|TH6711|TK4660|TS21[5-9]|TS22[0-8]|TS280|TT211)(\.|\s)/,
104
+ "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)/
105
+ }.freeze
106
+
107
+ module CallNumberRanges
108
+ # Helpful if you have a call number, but want to see
109
+ # what disciplines match
110
+ class CallNumber
111
+ def self.disciplines(call_number)
112
+ DISCIPLINES.select { |_name, range| call_number.match? range }.keys
113
+ end
114
+ end
115
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CallNumberRanges
4
- VERSION = '0.1.0'
4
+ VERSION = '0.2.0'
5
5
  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.1.0
4
+ version: 0.2.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-03-22 00:00:00.000000000 Z
11
+ date: 2021-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec