marcspec 1.6.6 → 1.7.1

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.
data/.document CHANGED
@@ -1,5 +1,3 @@
1
- README.rdoc
2
- lib/**/*.rb
3
- bin/*
4
- features/**/*.feature
5
- LICENSE
1
+ -
2
+ ChangeLog.md
3
+ LICENSE.txt
data/.gitignore CHANGED
@@ -1,21 +1,4 @@
1
- ## MAC OS
2
- .DS_Store
3
-
4
- ## TEXTMATE
5
- *.tmproj
6
- tmtags
7
-
8
- ## EMACS
9
- *~
10
- \#*
11
- .\#*
12
-
13
- ## VIM
14
- *.swp
15
-
16
- ## PROJECT::GENERAL
17
- coverage
18
- rdoc
19
- pkg
20
-
21
- ## PROJECT::SPECIFIC
1
+ Gemfile.lock
2
+ doc/
3
+ pkg/
4
+ vendor/cache/*.gem
@@ -0,0 +1 @@
1
+ --markup markdown --title "marcspec Documentation" --protected
data/CHANGES CHANGED
@@ -1,3 +1,6 @@
1
+ 1.7.0
2
+ * Add "separator" option for variable field specs so you can dictate what
3
+ separator to use (e.g., field('245ab') {separator '--'})
1
4
  1.6.6
2
5
  * Remove references to FATAL errors, which logback (nee jlogger) doesn't support
3
6
  * Exit with code 1 (not zero) when things are, in fact, fatal (using Process.abort)
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ source :rubygems
2
+
3
+ gemspec
4
+
5
+ gem 'marc4j4r'
6
+ gem 'jlogger'
7
+ gem 'jruby_streaming_update_solr_server'
8
+
9
+ group :development do
10
+ gem 'kramdown'
11
+ gem 'rspec', '~> 2'
12
+ end
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009 BillDueber
1
+ Copyright (c) 2013 Bill Dueber
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/Rakefile CHANGED
@@ -1,68 +1,31 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'rubygems'
2
- require 'rake'
3
- gem 'ci_reporter'
4
- require 'ci/reporter/rake/rspec'
5
4
 
6
5
  begin
7
- require 'jeweler'
8
- Jeweler::Tasks.new do |gem|
9
- gem.name = "marcspec"
10
- gem.summary = %Q{Extract data from MARC records and send to Solr}
11
- gem.description = %Q{Relies on marc4j4r, based on work in solrmarc}
12
- gem.email = "bill@dueber.com"
13
- gem.homepage = "http://github.com/billdueber/marcspec"
14
- gem.authors = ["BillDueber"]
15
- gem.add_development_dependency "rspec"
16
- gem.add_development_dependency "yard", ">= 0"
17
- gem.add_development_dependency 'ci_reporter'
18
- gem.add_dependency 'marc4j4r', '>=1.2.0'
19
- gem.add_dependency 'jlogger', '>=0.0.3'
20
- gem.add_dependency 'jruby_streaming_update_solr_server', '>=0.5.3'
21
-
22
-
23
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
24
- end
25
- Jeweler::GemcutterTasks.new
26
- rescue LoadError
27
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
28
- end
29
-
30
-
31
- require 'spec/rake/spectask'
32
- desc "Run rspec specs"
33
- Spec::Rake::SpecTask.new('spec') do |t|
34
- t.spec_files = FileList['spec/**/*_spec.rb']
6
+ require 'bundler'
7
+ rescue LoadError => e
8
+ warn e.message
9
+ warn "Run `gem install bundler` to install Bundler."
10
+ exit -1
35
11
  end
36
12
 
37
- desc "Run Rspec tests with CI output in spec/reports"
38
- Spec::Rake::SpecTask.new('cispec') do |t|
39
- t.spec_files = FileList['spec/**/*_spec.rb']
13
+ begin
14
+ Bundler.setup(:development)
15
+ rescue Bundler::BundlerError => e
16
+ warn e.message
17
+ warn "Run `bundle install` to install missing gems."
18
+ exit e.status_code
40
19
  end
41
20
 
21
+ require 'rake'
42
22
 
23
+ require "bundler/gem_tasks"
43
24
 
44
- begin
45
- require 'rcov/rcovtask'
46
- Rcov::RcovTask.new do |spec|
47
- spec.libs << 'spec'
48
- spec.pattern = 'spec/**/*_spec.rb'
49
- spec.verbose = true
50
- end
51
- rescue LoadError
52
- task :rcov do
53
- abort "RCov is not available. In order to run rcov, you must: jgem install rcov-java"
54
- end
55
- end
56
-
57
- task :spec => :check_dependencies
58
- task :cispec => :"ci:setup:rspec"
59
- task :default => :spec
25
+ require 'yard'
26
+ YARD::Rake::YardocTask.new
27
+ task :doc => :yard
60
28
 
61
- begin
62
- require 'yard'
63
- YARD::Rake::YardocTask.new
64
- rescue LoadError
65
- task :yardoc do
66
- abort "YARD is not available. In order to run yardoc, you must: sudo gem install yard"
67
- end
68
- end
29
+ require 'rspec/core/rake_task'
30
+ RSpec::Core::RakeTask.new(:spec)
31
+ task :default => :spec
@@ -125,7 +125,13 @@ module MARCSpec
125
125
  def sub c
126
126
  self.codes = c
127
127
  return self
128
+ end
129
+
130
+ def separator s
131
+ self.joiner = s
132
+ return self
128
133
  end
134
+
129
135
 
130
136
  alias_method :subs, :sub
131
137
  end
@@ -0,0 +1,4 @@
1
+ module Marcspec
2
+ # marcspec version
3
+ VERSION = "1.7.1"
4
+ end
@@ -0,0 +1,23 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ require File.expand_path('../lib/marcspec/version', __FILE__)
4
+
5
+ Gem::Specification.new do |gem|
6
+ gem.name = "marcspec"
7
+ gem.version = Marcspec::VERSION
8
+ gem.summary = %Q{Extract data from MARC records and send to Solr}
9
+ gem.description = %Q{Relies on marc4j4r, based on work in solrmarc}
10
+ gem.license = "MIT"
11
+ gem.authors = ["Bill Dueber"]
12
+ gem.email = "bill@dueber.com"
13
+ gem.homepage = "https://github.com/billdueber/marcspec#readme"
14
+
15
+ gem.files = `git ls-files`.split($/)
16
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
+ gem.require_paths = ['lib']
19
+
20
+ gem.add_development_dependency 'bundler', '~> 1.0'
21
+ gem.add_development_dependency 'rake'
22
+ gem.add_development_dependency 'yard'
23
+ end
@@ -291,8 +291,17 @@ describe "DSL" do
291
291
  end
292
292
  ss.hash_from_marc(@one)['tst'].should == ['The Texas ranger', 'Sung by Beale D. Taylor.']
293
293
  end
294
-
295
294
 
295
+ it "takes a custom joiner" do
296
+ ss = MARCSpec.build do
297
+ field('tst') do
298
+ spec("245ac") {
299
+ separator "|"
300
+ }
301
+ end
302
+ end
303
+ ss.hash_from_marc(@one)['tst'].should == [['The Texas ranger', 'Sung by Beale D. Taylor.'].join("|")]
304
+ end
296
305
  end
297
306
 
298
307
  describe "SolrFieldSpec modifiers DSL" do
@@ -320,7 +329,6 @@ describe "DSL" do
320
329
  }
321
330
  end
322
331
  end
323
-
324
332
  ss.hash_from_marc(@one)['tst'].should == ['Default value']
325
333
  end
326
334
  end
@@ -154,8 +154,8 @@ describe "MVMaps" do
154
154
  it "should read a pattern solrmarc file" do
155
155
  map = MARCSpec::MultiValueMap.from_solrmarc_file "#{DIR}/data/umich/translation_maps/library_map.properties"
156
156
  map.mapname.should == 'library_map'
157
- map['UMTRI Stuff'].should == ['Transportation Research Institute Library (UMTRI)']
158
- map['HATCH DOCS'].should == ['Hatcher Graduate', 'Hatcher Graduate Documents Center']
157
+ map['UMTRI Stuff'].sort.should == ['Transportation Research Institute Library (UMTRI)']
158
+ map['HATCH DOCS'].sort.should == ['Hatcher Graduate', 'Hatcher Graduate Documents Center']
159
159
  end
160
160
 
161
161
  it "can dump/load a multivalue map via generic map interface" do
@@ -1,7 +1,5 @@
1
1
  --colour
2
- --format profile
2
+ --format specdoc
3
3
  --format specdoc:spec/spec_full_report.txt
4
4
  --format failing_examples:spec/spec_failing_examples.txt
5
5
  --format html:spec/spec_report.html
6
- --loadby mtime
7
- --reverse
@@ -1,4 +1,3 @@
1
- require 'rubygems'
2
1
  require 'marc4j4r'
3
2
  require 'tempfile'
4
3
  require 'logger'
metadata CHANGED
@@ -1,117 +1,67 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marcspec
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 1
7
- - 6
8
- - 6
9
- version: 1.6.6
4
+ prerelease:
5
+ version: 1.7.1
10
6
  platform: ruby
11
7
  authors:
12
- - BillDueber
8
+ - Bill Dueber
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
12
 
17
- date: 2010-10-18 00:00:00 -04:00
18
- default_executable:
13
+ date: 2013-02-20 00:00:00 Z
19
14
  dependencies:
20
15
  - !ruby/object:Gem::Dependency
21
- name: rspec
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- segments:
28
- - 0
29
- version: "0"
30
16
  type: :development
31
- version_requirements: *id001
32
- - !ruby/object:Gem::Dependency
33
- name: yard
34
- prerelease: false
35
- requirement: &id002 !ruby/object:Gem::Requirement
17
+ version_requirements: &id001 !ruby/object:Gem::Requirement
18
+ none: false
36
19
  requirements:
37
- - - ">="
20
+ - - ~>
38
21
  - !ruby/object:Gem::Version
39
- segments:
40
- - 0
41
- version: "0"
42
- type: :development
43
- version_requirements: *id002
44
- - !ruby/object:Gem::Dependency
45
- name: ci_reporter
22
+ version: "1.0"
23
+ requirement: *id001
24
+ name: bundler
46
25
  prerelease: false
47
- requirement: &id003 !ruby/object:Gem::Requirement
26
+ - !ruby/object:Gem::Dependency
27
+ type: :development
28
+ version_requirements: &id002 !ruby/object:Gem::Requirement
29
+ none: false
48
30
  requirements:
49
31
  - - ">="
50
32
  - !ruby/object:Gem::Version
51
- segments:
52
- - 0
53
33
  version: "0"
54
- type: :development
55
- version_requirements: *id003
56
- - !ruby/object:Gem::Dependency
57
- name: marc4j4r
34
+ requirement: *id002
35
+ name: rake
58
36
  prerelease: false
59
- requirement: &id004 !ruby/object:Gem::Requirement
60
- requirements:
61
- - - ">="
62
- - !ruby/object:Gem::Version
63
- segments:
64
- - 1
65
- - 2
66
- - 0
67
- version: 1.2.0
68
- type: :runtime
69
- version_requirements: *id004
70
37
  - !ruby/object:Gem::Dependency
71
- name: jlogger
72
- prerelease: false
73
- requirement: &id005 !ruby/object:Gem::Requirement
38
+ type: :development
39
+ version_requirements: &id003 !ruby/object:Gem::Requirement
40
+ none: false
74
41
  requirements:
75
42
  - - ">="
76
43
  - !ruby/object:Gem::Version
77
- segments:
78
- - 0
79
- - 0
80
- - 3
81
- version: 0.0.3
82
- type: :runtime
83
- version_requirements: *id005
84
- - !ruby/object:Gem::Dependency
85
- name: jruby_streaming_update_solr_server
44
+ version: "0"
45
+ requirement: *id003
46
+ name: yard
86
47
  prerelease: false
87
- requirement: &id006 !ruby/object:Gem::Requirement
88
- requirements:
89
- - - ">="
90
- - !ruby/object:Gem::Version
91
- segments:
92
- - 0
93
- - 5
94
- - 3
95
- version: 0.5.3
96
- type: :runtime
97
- version_requirements: *id006
98
48
  description: Relies on marc4j4r, based on work in solrmarc
99
49
  email: bill@dueber.com
100
50
  executables: []
101
51
 
102
52
  extensions: []
103
53
 
104
- extra_rdoc_files:
105
- - LICENSE
106
- - README.md
54
+ extra_rdoc_files: []
55
+
107
56
  files:
108
57
  - .document
109
58
  - .gitignore
59
+ - .yardopts
110
60
  - CHANGES
111
- - LICENSE
61
+ - Gemfile
62
+ - LICENSE.txt
112
63
  - README.md
113
64
  - Rakefile
114
- - VERSION
115
65
  - lib/marcspec.rb
116
66
  - lib/marcspec/constantspec.rb
117
67
  - lib/marcspec/controlfieldspec.rb
@@ -125,6 +75,8 @@ files:
125
75
  - lib/marcspec/solrfieldspec.rb
126
76
  - lib/marcspec/specset.rb
127
77
  - lib/marcspec/variablefieldspec.rb
78
+ - lib/marcspec/version.rb
79
+ - marcspec.gemspec
128
80
  - spec/cachespot_spec.rb
129
81
  - spec/controlfieldspec_spec.rb
130
82
  - spec/data/batch.dat
@@ -153,45 +105,66 @@ files:
153
105
  - spec/spec_helper.rb
154
106
  - spec/specset_spec.rb
155
107
  - spec/variablefieldspec_spec.rb
156
- has_rdoc: true
157
- homepage: http://github.com/billdueber/marcspec
158
- licenses: []
159
-
108
+ homepage: https://github.com/billdueber/marcspec#readme
109
+ licenses:
110
+ - MIT
160
111
  post_install_message:
161
- rdoc_options:
162
- - --charset=UTF-8
112
+ rdoc_options: []
113
+
163
114
  require_paths:
164
115
  - lib
165
116
  required_ruby_version: !ruby/object:Gem::Requirement
117
+ none: false
166
118
  requirements:
167
119
  - - ">="
168
120
  - !ruby/object:Gem::Version
121
+ hash: 2
169
122
  segments:
170
123
  - 0
171
124
  version: "0"
172
125
  required_rubygems_version: !ruby/object:Gem::Requirement
126
+ none: false
173
127
  requirements:
174
128
  - - ">="
175
129
  - !ruby/object:Gem::Version
130
+ hash: 2
176
131
  segments:
177
132
  - 0
178
133
  version: "0"
179
134
  requirements: []
180
135
 
181
136
  rubyforge_project:
182
- rubygems_version: 1.3.6
137
+ rubygems_version: 1.8.24
183
138
  signing_key:
184
139
  specification_version: 3
185
140
  summary: Extract data from MARC records and send to Solr
186
141
  test_files:
187
142
  - spec/cachespot_spec.rb
188
143
  - spec/controlfieldspec_spec.rb
144
+ - spec/data/batch.dat
145
+ - spec/data/one.dat
146
+ - spec/data/simplemap.rb
147
+ - spec/data/umich/translation_maps/area_map.properties
148
+ - spec/data/umich/translation_maps/availability_map_ht.properties
149
+ - spec/data/umich/translation_maps/availability_map_umich.properties
150
+ - spec/data/umich/translation_maps/callnumber_map.properties
151
+ - spec/data/umich/translation_maps/callnumber_subject_map.properties
152
+ - spec/data/umich/translation_maps/country_map.properties
153
+ - spec/data/umich/translation_maps/format_map.properties
154
+ - spec/data/umich/translation_maps/format_map_umich.properties
155
+ - spec/data/umich/translation_maps/ht_namespace_map.properties
156
+ - spec/data/umich/translation_maps/institution_map.properties
157
+ - spec/data/umich/translation_maps/language_map.properties
158
+ - spec/data/umich/translation_maps/library_map.properties
159
+ - spec/data/umich/translation_maps/location_map.properties
160
+ - spec/data/umich/umich_index.properties
189
161
  - spec/dsl_spec.rb
190
162
  - spec/leaderspec_spec.rb
191
163
  - spec/maps_spec.rb
192
164
  - spec/marcfieldspecs_spec.rb
193
165
  - spec/solrfieldspec_spec.rb
166
+ - spec/spec.opts
194
167
  - spec/spec_helper.rb
195
168
  - spec/specset_spec.rb
196
169
  - spec/variablefieldspec_spec.rb
197
- - spec/data/simplemap.rb
170
+ has_rdoc:
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 1.6.6