lcclasses 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 963f0e3024da223712b69f1617de7582820160f7
4
- data.tar.gz: f19f5674d2bd905610af34e914bdf2325d749ee3
3
+ metadata.gz: 21d2c58127f8da9ef898fd8275f38adfd604360e
4
+ data.tar.gz: 64293c868662809bacdd5c684c024abfbced8da0
5
5
  SHA512:
6
- metadata.gz: 9635f38fe6294f938197e6a752fcd327ba0a72f19a7d2d0ba33c175e6d7499a28186cdb7dcc31b0a081f8371ee899f6a1d8413bb9bf58491f4444e49580d70e3
7
- data.tar.gz: b693f6646e97a715d0c221dabd397c467a6e40d10013822fd84f598ac40169dc0559ee880df062e65f037cd1f7d89275b01be4ac4fa0e574bb81dc286be041bf
6
+ metadata.gz: 91fd6596c61564b6749541e121e181d455b21a44c018c9dc1c41e639e22470c449e856bc8e8d879b10e61247bc3b05dbeb3c67e983514a1c8e115e4b29e79b53
7
+ data.tar.gz: 5d42ba82d6669f80a8f21ad35554a6e5d6f0eb8c6510367ddeecdeec34451333691997209138d786acf6547a8aec5386d24456269c3ffbed429ed611ac5c746a
data/.gitignore CHANGED
@@ -4,4 +4,5 @@ coverage
4
4
  rdoc
5
5
  pkg
6
6
  .rvmrc
7
- .ruby-version
7
+ .ruby-version
8
+ .bundle
data/README.markdown CHANGED
@@ -5,7 +5,7 @@ A Ruby gem that provides the Library of Congress Classification system main clas
5
5
  To install:
6
6
 
7
7
  gem install lcclasses
8
-
8
+
9
9
  ## Usage
10
10
 
11
11
  To find a classification code:
@@ -30,16 +30,16 @@ The entire set of classes can be retrieved in 3 formats:
30
30
  LCClasses.flat
31
31
  => # flat array of classes and subclasses as LCClasses::LCClass objects
32
32
 
33
- The CLASS\_HASH conststant is in the following format (truncated example):
33
+ The CLASS\_HASH constant is in the following format (truncated example):
34
34
 
35
- { "A" => {
35
+ { "A" => {
36
36
  :name => "General Works",
37
37
  :subclasses => {
38
38
  "AC" => { :name => "Collections; Series; Collected works" }
39
39
  }
40
40
  }
41
41
  }
42
-
42
+
43
43
  Classes are returned as specialized LCClasses::Class arrays in the format `[code, name]`. In the case of nested LCClasses:LCClass objects, they are in the format `[main_class_code, main_class_name, [[subclass_code, subclass_name]]]`. These objects are normal arrays with the following methods added:
44
44
 
45
45
  @class = LCClasses.find_main_class_by_code("M")
@@ -51,7 +51,7 @@ Classes are returned as specialized LCClasses::Class arrays in the format `[code
51
51
  => [["M", "Music"], ["ML", "Literature on music"], ["MT", "Instruction and study"]]
52
52
 
53
53
  ## Note on Patches/Pull Requests
54
-
54
+
55
55
  * Fork the project.
56
56
  * Make your feature addition or bug fix.
57
57
  * Add tests for it. This is important so I don't break it in a
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ begin
6
6
  Bundler.setup(:default, :development)
7
7
  rescue Bundler::BundlerError => e
8
8
  $stderr.puts e.message
9
- $stderr.puts "Run `bundle install` to install missing gems"
9
+ $stderr.puts 'Run `bundle install` to install missing gems'
10
10
  exit e.status_code
11
11
  end
12
12
  require 'rake'
@@ -22,7 +22,7 @@ task :default => :test
22
22
 
23
23
  require 'rdoc/task'
24
24
  Rake::RDocTask.new do |rdoc|
25
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
25
+ version = File.exist?('VERSION') ? File.read('VERSION') : ''
26
26
 
27
27
  rdoc.rdoc_dir = 'rdoc'
28
28
  rdoc.title = "lcclasses #{version}"
data/lcclasses.gemspec CHANGED
@@ -5,54 +5,51 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{lcclasses}
8
- s.version = "0.1.0"
8
+ s.version = '0.1.1'
9
9
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["William Melody"]
12
- s.date = %q{2014-01-12}
10
+ s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
11
+ s.authors = ['William Melody']
12
+ s.date = %q{2016-05-09}
13
13
  s.description = %q{Library of Congress Classification classes and subclasses}
14
14
  s.email = %q{hi@williammelody.com}
15
15
  s.extra_rdoc_files = [
16
- "LICENSE",
17
- "README.markdown"
16
+ 'LICENSE',
17
+ 'README.markdown'
18
18
  ]
19
19
  s.files = [
20
- ".document",
21
- ".gitignore",
22
- "LICENSE",
23
- "README.markdown",
24
- "Rakefile",
25
- "lcclasses.gemspec",
26
- "lib/lcclasses.rb",
27
- "test/helper.rb",
28
- "test/test_lcclasses.rb"
20
+ '.document',
21
+ '.gitignore',
22
+ 'LICENSE',
23
+ 'README.markdown',
24
+ 'Rakefile',
25
+ 'lcclasses.gemspec',
26
+ 'lib/lcclasses.rb',
27
+ 'test/helper.rb',
28
+ 'test/test_lcclasses.rb'
29
29
  ]
30
30
  s.homepage = %q{http://github.com/alphabetum/lcclasses}
31
- s.licenses = ["MIT"]
32
- s.rdoc_options = ["--charset=UTF-8"]
33
- s.require_paths = ["lib"]
31
+ s.licenses = ['MIT']
32
+ s.rdoc_options = ['--charset=UTF-8']
33
+ s.require_paths = ['lib']
34
34
  s.rubygems_version = %q{1.8.24}
35
35
  s.summary = %q{Library of Congress Classification classes and subclasses}
36
36
  s.test_files = [
37
- "test/helper.rb",
38
- "test/test_lcclasses.rb"
37
+ 'test/helper.rb',
38
+ 'test/test_lcclasses.rb'
39
39
  ]
40
40
 
41
41
  if s.respond_to? :specification_version then
42
42
  s.specification_version = 3
43
43
 
44
44
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
45
- s.add_development_dependency(%q<minitest>, ["~> 4.7.5"])
46
- s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
47
- s.add_development_dependency(%q<shoulda>, [">= 0"])
45
+ s.add_development_dependency(%q<minitest>, ['>= 0'])
46
+ s.add_development_dependency(%q<rdoc>, ['>= 0'])
48
47
  else
49
- s.add_dependency(%q<minitest>, ["~> 4.7.5"])
50
- s.add_dependency(%q<rdoc>, ["~> 3.12"])
51
- s.add_dependency(%q<shoulda>, [">= 0"])
48
+ s.add_dependency(%q<minitest>, ['>= 0'])
49
+ s.add_dependency(%q<rdoc>, ['>= 0'])
52
50
  end
53
51
  else
54
- s.add_dependency(%q<minitest>, ["~> 4.7.5"])
55
- s.add_dependency(%q<rdoc>, ["~> 3.12"])
56
- s.add_dependency(%q<shoulda>, [">= 0"])
52
+ s.add_dependency(%q<minitest>, ['>= 0'])
53
+ s.add_dependency(%q<rdoc>, ['>= 0'])
57
54
  end
58
- end
55
+ end
data/lib/lcclasses.rb CHANGED
@@ -1,408 +1,412 @@
1
1
  module LCClasses
2
2
  class LCClass < Array
3
-
4
3
  # Convert nested LCClasses::CLASS_HASH to nested array.
5
4
  def self.nest(hash)
6
5
  return self[] if hash.nil?
7
- hash.sort { |a,b| a[0] <=> b[0] }.inject(self[]) do |result, klass|
6
+ hash.sort { |a, b| a[0] <=> b[0] }.inject(self[]) do |result, klass|
8
7
  if klass[1][:subclasses]
9
- result << self[klass[0],klass[1][:name], self.nest(klass[1][:subclasses])]
8
+ result << self[klass[0], klass[1][:name], self.nest(klass[1][:subclasses])]
10
9
  else
11
- result << self[klass[0],klass[1][:name]]
10
+ result << self[klass[0], klass[1][:name]]
12
11
  end
13
12
  end
14
13
  end
15
-
14
+
16
15
  # Convert nested LCClasses::CLASS_HASH to flat array.
17
16
  def self.flatten(hash)
18
17
  return self[] if hash.nil?
19
- hash.sort { |a,b| a[0] <=> b[0] }.inject(self[]) do |result, klass|
20
- result << self[klass[0],klass[1][:name]]
18
+ hash.sort { |a, b| a[0] <=> b[0] }.inject(self[]) do |result, klass|
19
+ result << self[klass[0], klass[1][:name]]
21
20
  result += self.flatten(klass[1][:subclasses])
22
21
  end
23
22
  end
24
-
23
+
25
24
  # Return the subclasses of this class, if any.
26
25
  def subclasses
27
26
  return unless i = LCClasses::CLASS_HASH[self[0]]
28
27
  LCClasses::LCClass.nest(i[:subclasses])
29
28
  end
30
-
29
+
31
30
  # The class code.
32
- def code; self[0] end
31
+ def code
32
+ self[0]
33
+ end
34
+
33
35
  # THe class name.
34
- def name; self[1] end
36
+ def name
37
+ self[1]
38
+ end
35
39
  end
36
-
40
+
37
41
  # Library of Congress Main Classes and Subclasses
38
42
  CLASS_HASH = {
39
- "A" => {
40
- :name => "General Works",
43
+ 'A' => {
44
+ :name => 'General Works',
41
45
  :subclasses => {
42
- "AC" => { :name => "Collections; Series; Collected works" },
43
- "AE" => { :name => "Encyclopedias" },
44
- "AG" => { :name => "Dictionaries and other general reference works" },
45
- "AI" => { :name => "Indexes" },
46
- "AM" => { :name => "Museums. Collectors and collecting" },
47
- "AN" => { :name => "Newspapers" },
48
- "AP" => { :name => "Periodicals" },
49
- "AS" => { :name => "Academies and learned societies" },
50
- "AY" => { :name => "Yearbooks. Almanacs. Directories" },
51
- "AZ" => { :name => "History of scholarship and learning. The humanities" },
46
+ 'AC' => { :name => 'Collections; Series; Collected works' },
47
+ 'AE' => { :name => 'Encyclopedias' },
48
+ 'AG' => { :name => 'Dictionaries and other general reference works' },
49
+ 'AI' => { :name => 'Indexes' },
50
+ 'AM' => { :name => 'Museums. Collectors and collecting' },
51
+ 'AN' => { :name => 'Newspapers' },
52
+ 'AP' => { :name => 'Periodicals' },
53
+ 'AS' => { :name => 'Academies and learned societies' },
54
+ 'AY' => { :name => 'Yearbooks. Almanacs. Directories' },
55
+ 'AZ' => { :name => 'History of scholarship and learning. The humanities' }
52
56
  }
53
57
  },
54
- "B" => {
55
- :name => "Philosophy, Psychology, Religion",
58
+ 'B' => {
59
+ :name => 'Philosophy, Psychology, Religion',
56
60
  :subclasses => {
57
- "B" => { :name => "Philosophy (General)" },
58
- "BC" => { :name => "Logic" },
59
- "BD" => { :name => "Speculative philosophy" },
60
- "BF" => { :name => "Psychology" },
61
- "BH" => { :name => "Aesthetics" },
62
- "BJ" => { :name => "Ethics" },
63
- "BL" => { :name => "Religions; Mythology; Rationalism" },
64
- "BM" => { :name => "Judaism" },
65
- "BP" => { :name => "Islam; Bahaism; Theosophy, etc." },
66
- "BQ" => { :name => "Buddhism" },
67
- "BR" => { :name => "Christianity" },
68
- "BS" => { :name => "The Bible" },
69
- "BT" => { :name => "Doctrinal Theology" },
70
- "BV" => { :name => "Practical Theology" },
71
- "BX" => { :name => "Christian Denominations" },
61
+ 'B' => { :name => 'Philosophy (General)' },
62
+ 'BC' => { :name => 'Logic' },
63
+ 'BD' => { :name => 'Speculative philosophy' },
64
+ 'BF' => { :name => 'Psychology' },
65
+ 'BH' => { :name => 'Aesthetics' },
66
+ 'BJ' => { :name => 'Ethics' },
67
+ 'BL' => { :name => 'Religions; Mythology; Rationalism' },
68
+ 'BM' => { :name => 'Judaism' },
69
+ 'BP' => { :name => 'Islam; Bahaism; Theosophy, etc.' },
70
+ 'BQ' => { :name => 'Buddhism' },
71
+ 'BR' => { :name => 'Christianity' },
72
+ 'BS' => { :name => 'The Bible' },
73
+ 'BT' => { :name => 'Doctrinal Theology' },
74
+ 'BV' => { :name => 'Practical Theology' },
75
+ 'BX' => { :name => 'Christian Denominations' }
72
76
  }
73
77
  },
74
- "C" => {
75
- :name => "Auxiliary Sciences of History (General)",
78
+ 'C' => {
79
+ :name => 'Auxiliary Sciences of History (General)',
76
80
  :subclasses => {
77
- "CB" => { :name => "History of Civilization" },
78
- "CC" => { :name => "Archaeology" },
79
- "CD" => { :name => "Diplomatics. Archives. Seals" },
80
- "CE" => { :name => "Technical Chronology. Calendar" },
81
- "CJ" => { :name => "Numismatics" },
82
- "CN" => { :name => "Inscriptions. Epigraphy" },
83
- "CR" => { :name => "Heraldry" },
84
- "CS" => { :name => "Genealogy" },
85
- "CT" => { :name => "Biography" },
81
+ 'CB' => { :name => 'History of Civilization' },
82
+ 'CC' => { :name => 'Archaeology' },
83
+ 'CD' => { :name => 'Diplomatics. Archives. Seals' },
84
+ 'CE' => { :name => 'Technical Chronology. Calendar' },
85
+ 'CJ' => { :name => 'Numismatics' },
86
+ 'CN' => { :name => 'Inscriptions. Epigraphy' },
87
+ 'CR' => { :name => 'Heraldry' },
88
+ 'CS' => { :name => 'Genealogy' },
89
+ 'CT' => { :name => 'Biography' }
86
90
  }
87
91
  },
88
- "D" => {
89
- :name => "World History and History of Europe, Asia, Africa, Australia, New Zealand, etc.",
92
+ 'D' => {
93
+ :name => 'World History and History of Europe, Asia, Africa, Australia, New Zealand, etc.',
90
94
  :subclasses => {
91
- "D" => { :name => "History (General)" },
92
- "DA" => { :name => "Great Britain" },
93
- "DAW" => { :name => "Central Europe" },
94
- "DB" => { :name => "Austria - Liechtenstein - Hungary - Czechoslovakia" },
95
- "DC" => { :name => "France - Andorra - Monaco" },
96
- "DD" => { :name => "Germany" },
97
- "DE" => { :name => "Greco-Roman World" },
98
- "DF" => { :name => "Greece" },
99
- "DG" => { :name => "Italy - Malta" },
100
- "DH" => { :name => "Low Countries - Benelux Countries" },
101
- "DJ" => { :name => "Netherlands (Holland)" },
102
- "DJK" => { :name => "Eastern Europe (General)" },
103
- "DK" => { :name => "Russia. Soviet Union. Former Soviet Republics - Poland" },
104
- "DL" => { :name => "Northern Europe. Scandinavia" },
105
- "DP" => { :name => "Spain - Portugal" },
106
- "DQ" => { :name => "Switzerland" },
107
- "DR" => { :name => "Balkan Peninsula" },
108
- "DS" => { :name => "Asia" },
109
- "DT" => { :name => "Africa" },
110
- "DU" => { :name => "Oceania (South Seas)" },
111
- "DX" => { :name => "Gypsies" },
95
+ 'D' => { :name => 'History (General)' },
96
+ 'DA' => { :name => 'Great Britain' },
97
+ 'DAW' => { :name => 'Central Europe' },
98
+ 'DB' => { :name => 'Austria - Liechtenstein - Hungary - Czechoslovakia' },
99
+ 'DC' => { :name => 'France - Andorra - Monaco' },
100
+ 'DD' => { :name => 'Germany' },
101
+ 'DE' => { :name => 'Greco-Roman World' },
102
+ 'DF' => { :name => 'Greece' },
103
+ 'DG' => { :name => 'Italy - Malta' },
104
+ 'DH' => { :name => 'Low Countries - Benelux Countries' },
105
+ 'DJ' => { :name => 'Netherlands (Holland)' },
106
+ 'DJK' => { :name => 'Eastern Europe (General)' },
107
+ 'DK' => { :name => 'Russia. Soviet Union. Former Soviet Republics - Poland' },
108
+ 'DL' => { :name => 'Northern Europe. Scandinavia' },
109
+ 'DP' => { :name => 'Spain - Portugal' },
110
+ 'DQ' => { :name => 'Switzerland' },
111
+ 'DR' => { :name => 'Balkan Peninsula' },
112
+ 'DS' => { :name => 'Asia' },
113
+ 'DT' => { :name => 'Africa' },
114
+ 'DU' => { :name => 'Oceania (South Seas)' },
115
+ 'DX' => { :name => 'Gypsies' }
112
116
  }
113
117
  },
114
- "E" => {
115
- :name => "History of America, United States",
118
+ 'E' => {
119
+ :name => 'History of America, United States'
116
120
  },
117
- "F" => {
118
- :name => "Local History of the United States and British, Dutch, French, and Latin America",
121
+ 'F' => {
122
+ :name => 'Local History of the United States and British, Dutch, French, and Latin America'
119
123
  },
120
- "G" => {
121
- :name => "Geography, Anthropology, Recreation",
124
+ 'G' => {
125
+ :name => 'Geography, Anthropology, Recreation',
122
126
  :subclasses => {
123
- "G" => { :name => "Geography (General). Atlases. Maps" },
124
- "GA" => { :name => "Mathematical geography. Cartography" },
125
- "GB" => { :name => "Physical geography" },
126
- "GC" => { :name => "Oceanography" },
127
- "GE" => { :name => "Environmental Sciences" },
128
- "GF" => { :name => "Human ecology. Anthropogeography" },
129
- "GN" => { :name => "Anthropology" },
130
- "GR" => { :name => "Folklore" },
131
- "GT" => { :name => "Manners and customs (General)" },
132
- "GV" => { :name => "Recreation. Leisure" },
127
+ 'G' => { :name => 'Geography (General). Atlases. Maps' },
128
+ 'GA' => { :name => 'Mathematical geography. Cartography' },
129
+ 'GB' => { :name => 'Physical geography' },
130
+ 'GC' => { :name => 'Oceanography' },
131
+ 'GE' => { :name => 'Environmental Sciences' },
132
+ 'GF' => { :name => 'Human ecology. Anthropogeography' },
133
+ 'GN' => { :name => 'Anthropology' },
134
+ 'GR' => { :name => 'Folklore' },
135
+ 'GT' => { :name => 'Manners and customs (General)' },
136
+ 'GV' => { :name => 'Recreation. Leisure' }
133
137
  }
134
138
  },
135
- "H" => {
136
- :name => "Social Sciences",
139
+ 'H' => {
140
+ :name => 'Social Sciences',
137
141
  :subclasses => {
138
- "H" => { :name => "Social sciences (General)" },
139
- "HA" => { :name => "Statistics" },
140
- "HB" => { :name => "Economic theory. Demography" },
141
- "HC" => { :name => "Economic history and conditions" },
142
- "HD" => { :name => "Industries. Land use. Labor" },
143
- "HE" => { :name => "Transportation and communications" },
144
- "HF" => { :name => "Commerce" },
145
- "HG" => { :name => "Finance" },
146
- "HJ" => { :name => "Public finance" },
147
- "HM" => { :name => "Sociology (General)" },
148
- "HN" => { :name => "Social history and conditions. Social problems. Social reform" },
149
- "HQ" => { :name => "The family. Marriage. Women" },
150
- "HS" => { :name => "Societies: secret, benevolent, etc." },
151
- "HT" => { :name => "Communities. Classes. Races" },
152
- "HV" => { :name => "Social pathology. Social and public welfare. Criminology" },
153
- "HX" => { :name => "Socialism. Communism. Anarchism" },
142
+ 'H' => { :name => 'Social sciences (General)' },
143
+ 'HA' => { :name => 'Statistics' },
144
+ 'HB' => { :name => 'Economic theory. Demography' },
145
+ 'HC' => { :name => 'Economic history and conditions' },
146
+ 'HD' => { :name => 'Industries. Land use. Labor' },
147
+ 'HE' => { :name => 'Transportation and communications' },
148
+ 'HF' => { :name => 'Commerce' },
149
+ 'HG' => { :name => 'Finance' },
150
+ 'HJ' => { :name => 'Public finance' },
151
+ 'HM' => { :name => 'Sociology (General)' },
152
+ 'HN' => { :name => 'Social history and conditions. Social problems. Social reform' },
153
+ 'HQ' => { :name => 'The family. Marriage. Women' },
154
+ 'HS' => { :name => 'Societies: secret, benevolent, etc.' },
155
+ 'HT' => { :name => 'Communities. Classes. Races' },
156
+ 'HV' => { :name => 'Social pathology. Social and public welfare. Criminology' },
157
+ 'HX' => { :name => 'Socialism. Communism. Anarchism' }
154
158
  }
155
159
  },
156
- "J" => {
157
- :name => "Political Sciences",
160
+ 'J' => {
161
+ :name => 'Political Sciences',
158
162
  :subclasses => {
159
- "J" => { :name => "General legislative and executive papers" },
160
- "JA" => { :name => "Political science (General)" },
161
- "JC" => { :name => "Political theory" },
162
- "JF" => { :name => "Political institutions and public administration" },
163
- "JJ" => { :name => "Political institutions and public administration (North America)" },
164
- "JK" => { :name => "Political institutions and public administration (United States)" },
165
- "JL" => { :name => "Political institutions and public administration (Canada, Latin America, etc.)" },
166
- "JN" => { :name => "Political institutions and public administration (Europe)" },
167
- "JQ" => { :name => "Political institutions and public administration (Asia, Africa, Australia, Pacific Area, etc.)" },
168
- "JS" => { :name => "Local government. Municipal government" },
169
- "JV" => { :name => "Colonies and colonization. Emigration and immigration. International migration" },
170
- "JX" => { :name => "International law, see JZ and KZ (obsolete)" },
171
- "JZ" => { :name => "International relations" },
163
+ 'J' => { :name => 'General legislative and executive papers' },
164
+ 'JA' => { :name => 'Political science (General)' },
165
+ 'JC' => { :name => 'Political theory' },
166
+ 'JF' => { :name => 'Political institutions and public administration' },
167
+ 'JJ' => { :name => 'Political institutions and public administration (North America)' },
168
+ 'JK' => { :name => 'Political institutions and public administration (United States)' },
169
+ 'JL' => { :name => 'Political institutions and public administration (Canada, Latin America, etc.)' },
170
+ 'JN' => { :name => 'Political institutions and public administration (Europe)' },
171
+ 'JQ' => { :name => 'Political institutions and public administration (Asia, Africa, Australia, Pacific Area, etc.)' },
172
+ 'JS' => { :name => 'Local government. Municipal government' },
173
+ 'JV' => { :name => 'Colonies and colonization. Emigration and immigration. International migration' },
174
+ 'JX' => { :name => 'International law, see JZ and KZ (obsolete)' },
175
+ 'JZ' => { :name => 'International relations' }
172
176
  }
173
177
  },
174
- "K" => {
175
- :name => "Law",
178
+ 'K' => {
179
+ :name => 'Law',
176
180
  :subclasses => {
177
- "K" => { :name => "Law in general. Comparative and uniform law. Jurisprudence" },
178
- "KB" => { :name => "Religious law in general. Comparative religious law. Jurisprudence" },
179
- "KBM" => { :name => "Jewish law" },
180
- "KBP" => { :name => "Islamic law" },
181
- "KBR" => { :name => "History of canon law" },
182
- "KBU" => { :name => "Law of the Roman Catholic Church. The Holy See" },
183
- "KD-KDK" => { :name => "United Kingdom and Ireland" },
184
- "KDZ" => { :name => "America. North America" },
185
- "KE" => { :name => "Canada" },
186
- "KF" => { :name => "United States" },
187
- "KG" => { :name => "Latin America - Mexico and Central America - West Indies. Caribbean area" },
188
- "KH" => { :name => "South America" },
189
- "KJ-KKZ" => { :name => "Europe" },
190
- "KL-KWX" => { :name => "Asia and Eurasia, Africa, Pacific Area, and Antarctica" },
191
- "KZ" => { :name => "Law of nations" },
181
+ 'K' => { :name => 'Law in general. Comparative and uniform law. Jurisprudence' },
182
+ 'KB' => { :name => 'Religious law in general. Comparative religious law. Jurisprudence' },
183
+ 'KBM' => { :name => 'Jewish law' },
184
+ 'KBP' => { :name => 'Islamic law' },
185
+ 'KBR' => { :name => 'History of canon law' },
186
+ 'KBU' => { :name => 'Law of the Roman Catholic Church. The Holy See' },
187
+ 'KD-KDK' => { :name => 'United Kingdom and Ireland' },
188
+ 'KDZ' => { :name => 'America. North America' },
189
+ 'KE' => { :name => 'Canada' },
190
+ 'KF' => { :name => 'United States' },
191
+ 'KG' => { :name => 'Latin America - Mexico and Central America - West Indies. Caribbean area' },
192
+ 'KH' => { :name => 'South America' },
193
+ 'KJ-KKZ' => { :name => 'Europe' },
194
+ 'KL-KWX' => { :name => 'Asia and Eurasia, Africa, Pacific Area, and Antarctica' },
195
+ 'KZ' => { :name => 'Law of nations' }
192
196
  }
193
197
  },
194
- "L" => {
195
- :name => "Education",
198
+ 'L' => {
199
+ :name => 'Education',
196
200
  :subclasses => {
197
- "L" => { :name => "Education (General)" },
198
- "LA" => { :name => "History of education" },
199
- "LB" => { :name => "Theory and practice of education" },
200
- "LC" => { :name => "Special aspects of education" },
201
- "LD" => { :name => "Individual institutions - United States" },
202
- "LE" => { :name => "Individual institutions - America (except United States)" },
203
- "LF" => { :name => "Individual institutions - Europe" },
204
- "LG" => { :name => "Individual institutions - Asia, Africa, Indian Ocean islands, Australia, New Zealand, Pacific islands" },
205
- "LH" => { :name => "College and school magazines and papers" },
206
- "LJ" => { :name => "Student fraternities and societies, United States" },
207
- "LT" => { :name => "Textbooks" },
201
+ 'L' => { :name => 'Education (General)' },
202
+ 'LA' => { :name => 'History of education' },
203
+ 'LB' => { :name => 'Theory and practice of education' },
204
+ 'LC' => { :name => 'Special aspects of education' },
205
+ 'LD' => { :name => 'Individual institutions - United States' },
206
+ 'LE' => { :name => 'Individual institutions - America (except United States)' },
207
+ 'LF' => { :name => 'Individual institutions - Europe' },
208
+ 'LG' => { :name => 'Individual institutions - Asia, Africa, Indian Ocean islands, Australia, New Zealand, Pacific islands' },
209
+ 'LH' => { :name => 'College and school magazines and papers' },
210
+ 'LJ' => { :name => 'Student fraternities and societies, United States' },
211
+ 'LT' => { :name => 'Textbooks' }
208
212
  }
209
213
  },
210
- "M" => {
211
- :name => "Music",
214
+ 'M' => {
215
+ :name => 'Music',
212
216
  :subclasses => {
213
- "M" => { :name => "Music" },
214
- "ML" => { :name => "Literature on music" },
215
- "MT" => { :name => "Instruction and study" },
217
+ 'M' => { :name => 'Music' },
218
+ 'ML' => { :name => 'Literature on music' },
219
+ 'MT' => { :name => 'Instruction and study' }
216
220
  }
217
221
  },
218
- "N" => {
219
- :name => "Fine Arts",
222
+ 'N' => {
223
+ :name => 'Fine Arts',
220
224
  :subclasses => {
221
- "N" => { :name => "Visual arts" },
222
- "NA" => { :name => "Architecture" },
223
- "NB" => { :name => "Sculpture" },
224
- "NC" => { :name => "Drawing. Design. Illustration" },
225
- "ND" => { :name => "Painting" },
226
- "NE" => { :name => "Print media" },
227
- "NK" => { :name => "Decorative arts" },
228
- "NX" => { :name => "Arts in general" },
225
+ 'N' => { :name => 'Visual arts' },
226
+ 'NA' => { :name => 'Architecture' },
227
+ 'NB' => { :name => 'Sculpture' },
228
+ 'NC' => { :name => 'Drawing. Design. Illustration' },
229
+ 'ND' => { :name => 'Painting' },
230
+ 'NE' => { :name => 'Print media' },
231
+ 'NK' => { :name => 'Decorative arts' },
232
+ 'NX' => { :name => 'Arts in general' }
229
233
  }
230
234
  },
231
- "P" => {
232
- :name => "Language and Literature",
235
+ 'P' => {
236
+ :name => 'Language and Literature',
233
237
  :subclasses => {
234
- "P" => { :name => "Philology. Linguistics" },
235
- "PA" => { :name => "Greek language and literature. Latin language and literature" },
236
- "PB" => { :name => "Modern languages. Celtic languages" },
237
- "PC" => { :name => "Romanic languages" },
238
- "PD" => { :name => "Germanic languages. Scandinavian languages" },
239
- "PE" => { :name => "English language" },
240
- "PF" => { :name => "West Germanic languages" },
241
- "PG" => { :name => "Slavic languages and literatures. Baltic languages. Albanian language" },
242
- "PH" => { :name => "Uralic languages. Basque language" },
243
- "PJ" => { :name => "Oriental languages and literatures" },
244
- "PK" => { :name => "Indo-Iranian languages and literatures" },
245
- "PL" => { :name => "Languages and literatures of Eastern Asia, Africa, Oceania" },
246
- "PM" => { :name => "Hyperborean, Indian, and artificial languages" },
247
- "PN" => { :name => "Literature (General)" },
248
- "PQ" => { :name => "French literature - Italian literature - Spanish literature - Portuguese literature" },
249
- "PR" => { :name => "English literature" },
250
- "PS" => { :name => "American literature" },
251
- "PT" => { :name => "Germanic, Scandinavian, and Icelandic literatures" },
252
- "PZ" => { :name => "Fiction and juvenile belles lettres" },
238
+ 'P' => { :name => 'Philology. Linguistics' },
239
+ 'PA' => { :name => 'Greek language and literature. Latin language and literature' },
240
+ 'PB' => { :name => 'Modern languages. Celtic languages' },
241
+ 'PC' => { :name => 'Romanic languages' },
242
+ 'PD' => { :name => 'Germanic languages. Scandinavian languages' },
243
+ 'PE' => { :name => 'English language' },
244
+ 'PF' => { :name => 'West Germanic languages' },
245
+ 'PG' => { :name => 'Slavic languages and literatures. Baltic languages. Albanian language' },
246
+ 'PH' => { :name => 'Uralic languages. Basque language' },
247
+ 'PJ' => { :name => 'Oriental languages and literatures' },
248
+ 'PK' => { :name => 'Indo-Iranian languages and literatures' },
249
+ 'PL' => { :name => 'Languages and literatures of Eastern Asia, Africa, Oceania' },
250
+ 'PM' => { :name => 'Hyperborean, Indian, and artificial languages' },
251
+ 'PN' => { :name => 'Literature (General)' },
252
+ 'PQ' => { :name => 'French literature - Italian literature - Spanish literature - Portuguese literature' },
253
+ 'PR' => { :name => 'English literature' },
254
+ 'PS' => { :name => 'American literature' },
255
+ 'PT' => { :name => 'Germanic, Scandinavian, and Icelandic literatures' },
256
+ 'PZ' => { :name => 'Fiction and juvenile belles lettres' }
253
257
  }
254
258
  },
255
- "Q" => {
256
- :name => "Science",
259
+ 'Q' => {
260
+ :name => 'Science',
257
261
  :subclasses => {
258
- "Q" => { :name => "Science (General)" },
259
- "QA" => { :name => "Mathematics" },
260
- "QB" => { :name => "Astronomy" },
261
- "QC" => { :name => "Physics" },
262
- "QD" => { :name => "Chemistry" },
263
- "QE" => { :name => "Geology" },
264
- "QH" => { :name => "Natural history - Biology" },
265
- "QK" => { :name => "Botany" },
266
- "QL" => { :name => "Zoology" },
267
- "QM" => { :name => "Human anatomy" },
268
- "QP" => { :name => "Physiology" },
269
- "QR" => { :name => "Microbiology" },
262
+ 'Q' => { :name => 'Science (General)' },
263
+ 'QA' => { :name => 'Mathematics' },
264
+ 'QB' => { :name => 'Astronomy' },
265
+ 'QC' => { :name => 'Physics' },
266
+ 'QD' => { :name => 'Chemistry' },
267
+ 'QE' => { :name => 'Geology' },
268
+ 'QH' => { :name => 'Natural history - Biology' },
269
+ 'QK' => { :name => 'Botany' },
270
+ 'QL' => { :name => 'Zoology' },
271
+ 'QM' => { :name => 'Human anatomy' },
272
+ 'QP' => { :name => 'Physiology' },
273
+ 'QR' => { :name => 'Microbiology' }
270
274
  }
271
275
  },
272
- "R" => {
273
- :name => "Medicine",
276
+ 'R' => {
277
+ :name => 'Medicine',
274
278
  :subclasses => {
275
- "R" => { :name => "Medicine (General)" },
276
- "RA" => { :name => "Public aspects of medicine" },
277
- "RB" => { :name => "Pathology" },
278
- "RC" => { :name => "Internal medicine" },
279
- "RD" => { :name => "Surgery" },
280
- "RE" => { :name => "Ophthalmology" },
281
- "RF" => { :name => "Otorhinolaryngology" },
282
- "RG" => { :name => "Gynecology and obstetrics" },
283
- "RJ" => { :name => "Pediatrics" },
284
- "RK" => { :name => "Dentistry" },
285
- "RL" => { :name => "Dermatology" },
286
- "RM" => { :name => "Therapeutics. Pharmacology" },
287
- "RS" => { :name => "Pharmacy and materia medica" },
288
- "RT" => { :name => "Nursing" },
289
- "RV" => { :name => "Botanic, Thomsonian, and eclectic medicine" },
290
- "RX" => { :name => "Homeopathy" },
291
- "RZ" => { :name => "Other systems of medicine" },
279
+ 'R' => { :name => 'Medicine (General)' },
280
+ 'RA' => { :name => 'Public aspects of medicine' },
281
+ 'RB' => { :name => 'Pathology' },
282
+ 'RC' => { :name => 'Internal medicine' },
283
+ 'RD' => { :name => 'Surgery' },
284
+ 'RE' => { :name => 'Ophthalmology' },
285
+ 'RF' => { :name => 'Otorhinolaryngology' },
286
+ 'RG' => { :name => 'Gynecology and obstetrics' },
287
+ 'RJ' => { :name => 'Pediatrics' },
288
+ 'RK' => { :name => 'Dentistry' },
289
+ 'RL' => { :name => 'Dermatology' },
290
+ 'RM' => { :name => 'Therapeutics. Pharmacology' },
291
+ 'RS' => { :name => 'Pharmacy and materia medica' },
292
+ 'RT' => { :name => 'Nursing' },
293
+ 'RV' => { :name => 'Botanic, Thomsonian, and eclectic medicine' },
294
+ 'RX' => { :name => 'Homeopathy' },
295
+ 'RZ' => { :name => 'Other systems of medicine' }
292
296
  }
293
297
  },
294
- "S" => {
295
- :name => "Agriculture",
298
+ 'S' => {
299
+ :name => 'Agriculture',
296
300
  :subclasses => {
297
- "S" => { :name => "Agriculture (General)" },
298
- "SB" => { :name => "Plant culture" },
299
- "SD" => { :name => "Forestry" },
300
- "SF" => { :name => "Animal culture" },
301
- "SH" => { :name => "Aquaculture. Fisheries. Angling" },
302
- "SK" => { :name => "Hunting sports" },
301
+ 'S' => { :name => 'Agriculture (General)' },
302
+ 'SB' => { :name => 'Plant culture' },
303
+ 'SD' => { :name => 'Forestry' },
304
+ 'SF' => { :name => 'Animal culture' },
305
+ 'SH' => { :name => 'Aquaculture. Fisheries. Angling' },
306
+ 'SK' => { :name => 'Hunting sports' }
303
307
  }
304
308
  },
305
- "T" => {
306
- :name => "Technology",
309
+ 'T' => {
310
+ :name => 'Technology',
307
311
  :subclasses => {
308
- "T" => { :name => "Technology (General)" },
309
- "TA" => { :name => "Engineering (General). Civil engineering" },
310
- "TC" => { :name => "Hydraulic engineering. Ocean engineering" },
311
- "TD" => { :name => "Environmental technology. Sanitary engineering" },
312
- "TE" => { :name => "Highway engineering. Roads and pavements" },
313
- "TF" => { :name => "Railroad engineering and operation" },
314
- "TG" => { :name => "Bridge engineering" },
315
- "TH" => { :name => "Building construction" },
316
- "TJ" => { :name => "Mechanical engineering and machinery" },
317
- "TK" => { :name => "Electrical engineering. Electronics. Nuclear engineering" },
318
- "TL" => { :name => "Motor vehicles. Aeronautics. Astronautics" },
319
- "TN" => { :name => "Mining engineering. Metallurgy" },
320
- "TP" => { :name => "Chemical technology" },
321
- "TR" => { :name => "Photography" },
322
- "TS" => { :name => "Manufactures" },
323
- "TT" => { :name => "Handicrafts. Arts and crafts" },
324
- "TX" => { :name => "Home economics" },
312
+ 'T' => { :name => 'Technology (General)' },
313
+ 'TA' => { :name => 'Engineering (General). Civil engineering' },
314
+ 'TC' => { :name => 'Hydraulic engineering. Ocean engineering' },
315
+ 'TD' => { :name => 'Environmental technology. Sanitary engineering' },
316
+ 'TE' => { :name => 'Highway engineering. Roads and pavements' },
317
+ 'TF' => { :name => 'Railroad engineering and operation' },
318
+ 'TG' => { :name => 'Bridge engineering' },
319
+ 'TH' => { :name => 'Building construction' },
320
+ 'TJ' => { :name => 'Mechanical engineering and machinery' },
321
+ 'TK' => { :name => 'Electrical engineering. Electronics. Nuclear engineering' },
322
+ 'TL' => { :name => 'Motor vehicles. Aeronautics. Astronautics' },
323
+ 'TN' => { :name => 'Mining engineering. Metallurgy' },
324
+ 'TP' => { :name => 'Chemical technology' },
325
+ 'TR' => { :name => 'Photography' },
326
+ 'TS' => { :name => 'Manufactures' },
327
+ 'TT' => { :name => 'Handicrafts. Arts and crafts' },
328
+ 'TX' => { :name => 'Home economics' }
325
329
  }
326
330
  },
327
- "U" => {
328
- :name => "Military Science",
331
+ 'U' => {
332
+ :name => 'Military Science',
329
333
  :subclasses => {
330
- "U" => { :name => "Military science (General)" },
331
- "UA" => { :name => "Armies: Organization, distribution, military situation" },
332
- "UB" => { :name => "Military administration" },
333
- "UC" => { :name => "Maintenance and transportation" },
334
- "UD" => { :name => "Infantry" },
335
- "UE" => { :name => "Cavalry. Armor" },
336
- "UF" => { :name => "Artillery" },
337
- "UG" => { :name => "Military engineering. Air forces" },
338
- "UH" => { :name => "Other services" },
334
+ 'U' => { :name => 'Military science (General)' },
335
+ 'UA' => { :name => 'Armies: Organization, distribution, military situation' },
336
+ 'UB' => { :name => 'Military administration' },
337
+ 'UC' => { :name => 'Maintenance and transportation' },
338
+ 'UD' => { :name => 'Infantry' },
339
+ 'UE' => { :name => 'Cavalry. Armor' },
340
+ 'UF' => { :name => 'Artillery' },
341
+ 'UG' => { :name => 'Military engineering. Air forces' },
342
+ 'UH' => { :name => 'Other services' }
339
343
  }
340
344
  },
341
- "V" => {
342
- :name => "Naval Science",
345
+ 'V' => {
346
+ :name => 'Naval Science',
343
347
  :subclasses => {
344
- "V" => { :name => "Naval science (General)" },
345
- "VA" => { :name => "Navies: Organization, distribution, naval situation" },
346
- "VB" => { :name => "Naval administration" },
347
- "VC" => { :name => "Naval maintenance" },
348
- "VD" => { :name => "Naval seamen" },
349
- "VE" => { :name => "Marines" },
350
- "VF" => { :name => "Naval ordnance" },
351
- "VG" => { :name => "Minor services of navies" },
352
- "VK" => { :name => "Navigation. Merchant marine" },
353
- "VM" => { :name => "Naval architecture. Shipbuilding. Marine engineering" },
348
+ 'V' => { :name => 'Naval science (General)' },
349
+ 'VA' => { :name => 'Navies: Organization, distribution, naval situation' },
350
+ 'VB' => { :name => 'Naval administration' },
351
+ 'VC' => { :name => 'Naval maintenance' },
352
+ 'VD' => { :name => 'Naval seamen' },
353
+ 'VE' => { :name => 'Marines' },
354
+ 'VF' => { :name => 'Naval ordnance' },
355
+ 'VG' => { :name => 'Minor services of navies' },
356
+ 'VK' => { :name => 'Navigation. Merchant marine' },
357
+ 'VM' => { :name => 'Naval architecture. Shipbuilding. Marine engineering' }
354
358
  }
355
359
  },
356
- "Z" => {
357
- :name => "Bibliography, Library Science",
360
+ 'Z' => {
361
+ :name => 'Bibliography, Library Science',
358
362
  :subclasses => {
359
- "Z" => { :name => "Books (General). Writing. Paleography. Book industries and trade. Libraries. Bibliography" },
360
- "ZA" => { :name => "Information resources (General)" },
363
+ 'Z' => { :name => 'Books (General). Writing. Paleography. Book industries and trade. Libraries. Bibliography' },
364
+ 'ZA' => { :name => 'Information resources (General)' }
361
365
  }
362
366
  }
363
367
  }
364
-
368
+
365
369
  # An array of main LC Classes.
366
370
  def self.main_classes
367
- CLASS_HASH.map do |k,v|
368
- LCClasses::LCClass[k,v[:name]]
371
+ CLASS_HASH.map do |k, v|
372
+ LCClasses::LCClass[k, v[:name]]
369
373
  end.sort
370
374
  end
371
-
375
+
372
376
  # An array of all LC Subclasses.
373
377
  def self.subclasses
374
378
  self.main_classes.inject([]) do |result, main_class|
375
379
  result += main_class.subclasses
376
380
  end
377
381
  end
378
-
382
+
379
383
  # A nested array of main classes and subclasses.
380
384
  def self.nested
381
385
  LCClasses::LCClass.nest(LCClasses::CLASS_HASH)
382
386
  end
383
-
387
+
384
388
  # All main classes and subclasses in a flat array.
385
389
  def self.flat
386
390
  LCClasses::LCClass.flatten(LCClasses::CLASS_HASH)
387
391
  end
388
-
392
+
389
393
  def self.find_by_code(code)
390
394
  LCClasses.flat.detect { |i| i[0] == code.to_s }
391
395
  end
392
-
396
+
393
397
  # Find an main classe by code.
394
398
  def self.find_main_class_by_code(code)
395
399
  LCClasses.main_classes.detect { |i| i[0] == code.to_s }
396
400
  end
397
-
401
+
398
402
  # Find a subclass by code.
399
403
  def self.find_subclass_by_code(code)
400
404
  LCClasses.subclasses.detect { |i| i[0] == code.to_s }
401
405
  end
402
-
406
+
403
407
  # Find all main classes and subclass that match or start with a code or character.
404
408
  def self.find_all_by_code(code)
405
409
  LCClasses.flat.select { |i| i[0] if (i[0] =~ /^#{code}[A-Z]?[A-Z]?/) }
406
410
  end
407
-
408
- end
411
+
412
+ end
data/test/helper.rb CHANGED
@@ -4,15 +4,12 @@ begin
4
4
  Bundler.setup(:default, :development)
5
5
  rescue Bundler::BundlerError => e
6
6
  $stderr.puts e.message
7
- $stderr.puts "Run `bundle install` to install missing gems"
7
+ $stderr.puts 'Run `bundle install` to install missing gems'
8
8
  exit e.status_code
9
9
  end
10
- require 'test/unit'
11
- require 'shoulda'
10
+ require 'minitest/autorun'
11
+ require 'minitest/pride'
12
12
 
13
13
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
14
14
  $LOAD_PATH.unshift(File.dirname(__FILE__))
15
15
  require 'lcclasses'
16
-
17
- class Test::Unit::TestCase
18
- end
@@ -1,77 +1,77 @@
1
1
  require 'helper'
2
2
 
3
- class TestLCClasses < Test::Unit::TestCase
4
-
5
- should "return main classes" do
3
+ describe LCClasses do
4
+
5
+ it 'should return main classes' do
6
6
  assert_equal 21, LCClasses.main_classes.length
7
7
  end
8
-
9
- should "return subclasses" do
8
+
9
+ it 'should return subclasses' do
10
10
  assert_equal 223, LCClasses.subclasses.length
11
11
  end
12
-
13
- should "should return flat" do
12
+
13
+ it 'should should return flat' do
14
14
  assert_equal 244, LCClasses.flat.length
15
15
  end
16
-
17
- should "should return nested" do
16
+
17
+ it 'should should return nested' do
18
18
  assert_equal 21, LCClasses.nested.length
19
19
  assert_equal 223, LCClasses.nested.inject([]) { |r, m| r += m.subclasses }.length
20
20
  end
21
-
22
- should "find main class or subclass by code" do
23
- assert_equal ["T", "Technology"], LCClasses.find_by_code("T")
24
- assert_equal ["AM", "Museums. Collectors and collecting"], LCClasses.find_by_code("AM")
21
+
22
+ it 'should find main class or subclass by code' do
23
+ assert_equal ['T', 'Technology'], LCClasses.find_by_code('T')
24
+ assert_equal ['AM', 'Museums. Collectors and collecting'], LCClasses.find_by_code('AM')
25
25
  end
26
-
27
- should "find main class by code" do
28
- assert_equal ["T", "Technology"], LCClasses.find_main_class_by_code("T")
26
+
27
+ it 'should find main class by code' do
28
+ assert_equal ['T', 'Technology'], LCClasses.find_main_class_by_code('T')
29
29
  end
30
-
31
- should "find subclass by code" do
32
- assert_equal ["AM", "Museums. Collectors and collecting"], LCClasses.find_subclass_by_code("AM")
30
+
31
+ it 'should find subclass by code' do
32
+ assert_equal ['AM', 'Museums. Collectors and collecting'], LCClasses.find_subclass_by_code('AM')
33
33
  end
34
-
35
- should "find all by code" do
36
- assert_equal [["E", "History of America, United States"]], LCClasses.find_all_by_code("E")
37
- assert_equal 11, LCClasses.find_all_by_code("A").length
34
+
35
+ it 'should find all by code' do
36
+ assert_equal [['E', 'History of America, United States']], LCClasses.find_all_by_code('E')
37
+ assert_equal 11, LCClasses.find_all_by_code('A').length
38
38
  end
39
-
40
- context "LCCLass" do
41
-
42
- setup {
43
- @hash = {
44
- "A" => {
45
- :name => "General Works",
39
+
40
+ describe LCClasses::LCClass do
41
+
42
+ def setup
43
+ @hash = {
44
+ 'A' => {
45
+ :name => 'General Works',
46
46
  :subclasses => {
47
- "AC" => { :name => "Collections; Series; Collected works" }
47
+ 'AC' => { :name => 'Collections; Series; Collected works' }
48
48
  }
49
49
  }
50
50
  }
51
- }
52
-
53
- should "flatten code hash" do
51
+ end
52
+
53
+ it 'should flatten code hash' do
54
54
  assert_equal(
55
- [["A", "General Works"], ["AC", "Collections; Series; Collected works"]],
55
+ [['A', 'General Works'], ['AC', 'Collections; Series; Collected works']],
56
56
  LCClasses::LCClass.flatten(@hash)
57
57
  )
58
58
  end
59
-
60
- should "nest code hash" do
59
+
60
+ it 'should nest code hash' do
61
61
  assert_equal(
62
- [["A", "General Works", [["AC", "Collections; Series; Collected works"]]]],
62
+ [['A', 'General Works', [['AC', 'Collections; Series; Collected works']]]],
63
63
  LCClasses::LCClass.nest(@hash)
64
64
  )
65
65
  end
66
-
67
- should "return subclasses" do
68
- assert_equal 3, LCClasses.find_main_class_by_code("M").subclasses.length
69
- assert_equal 0, LCClasses.find_main_class_by_code("E").subclasses.length
66
+
67
+ it 'should return subclasses' do
68
+ assert_equal 3, LCClasses.find_main_class_by_code('M').subclasses.length
69
+ assert_equal 0, LCClasses.find_main_class_by_code('E').subclasses.length
70
70
  end
71
-
72
- should "respond to code and name" do
73
- assert_equal "A", LCClasses::LCClass["A", "General Works"].code
74
- assert_equal "General Works", LCClasses::LCClass["A", "General Works"].name
71
+
72
+ it 'should respond to code and name' do
73
+ assert_equal 'A', LCClasses::LCClass['A', 'General Works'].code
74
+ assert_equal 'General Works', LCClasses::LCClass['A', 'General Works'].name
75
75
  end
76
76
  end
77
77
  end
metadata CHANGED
@@ -1,55 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lcclasses
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Melody
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-12 00:00:00.000000000 Z
11
+ date: 2016-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 4.7.5
19
+ version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 4.7.5
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rdoc
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
32
- - !ruby/object:Gem::Version
33
- version: '3.12'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ~>
39
- - !ruby/object:Gem::Version
40
- version: '3.12'
41
- - !ruby/object:Gem::Dependency
42
- name: shoulda
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - '>='
31
+ - - ">="
46
32
  - !ruby/object:Gem::Version
47
33
  version: '0'
48
34
  type: :development
49
35
  prerelease: false
50
36
  version_requirements: !ruby/object:Gem::Requirement
51
37
  requirements:
52
- - - '>='
38
+ - - ">="
53
39
  - !ruby/object:Gem::Version
54
40
  version: '0'
55
41
  description: Library of Congress Classification classes and subclasses
@@ -60,8 +46,8 @@ extra_rdoc_files:
60
46
  - LICENSE
61
47
  - README.markdown
62
48
  files:
63
- - .document
64
- - .gitignore
49
+ - ".document"
50
+ - ".gitignore"
65
51
  - LICENSE
66
52
  - README.markdown
67
53
  - Rakefile
@@ -75,25 +61,26 @@ licenses:
75
61
  metadata: {}
76
62
  post_install_message:
77
63
  rdoc_options:
78
- - --charset=UTF-8
64
+ - "--charset=UTF-8"
79
65
  require_paths:
80
66
  - lib
81
67
  required_ruby_version: !ruby/object:Gem::Requirement
82
68
  requirements:
83
- - - '>='
69
+ - - ">="
84
70
  - !ruby/object:Gem::Version
85
71
  version: '0'
86
72
  required_rubygems_version: !ruby/object:Gem::Requirement
87
73
  requirements:
88
- - - '>='
74
+ - - ">="
89
75
  - !ruby/object:Gem::Version
90
76
  version: '0'
91
77
  requirements: []
92
78
  rubyforge_project:
93
- rubygems_version: 2.1.10
79
+ rubygems_version: 2.5.1
94
80
  signing_key:
95
81
  specification_version: 3
96
82
  summary: Library of Congress Classification classes and subclasses
97
83
  test_files:
98
84
  - test/helper.rb
99
85
  - test/test_lcclasses.rb
86
+ has_rdoc: