traject 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -14,10 +14,11 @@ Based on both the successes and failures of previous MARC indexing attempts -- i
14
14
  Traject aims to:
15
15
 
16
16
  * Be simple and straightforward for simple use cases, hopefully being accessible even to non-rubyists, although it's in ruby
17
- * Be composed of modular and re-composible elements, to provide flexibility for non-common use cases. You should be able to
17
+ * Be composed of modular and re-composible elements, to provide flexibility for non-common use cases. You should be able to
18
18
  do your own thing wherever you want, without having to give up
19
- the already implemented parts you still do want, mixing and matching at all.
20
- * Have a parsimonious or 'elegant' internal architecture, only a few architectural concepts to understand that everything else is built on, to hopefully make the internals easy to work with and maintain.
19
+ the already implemented parts you still do want, mixing and matching at will.
20
+ * Easily support re-use and sharing of mapping rules, within an installation and between organizations.
21
+ * Have a parsimonious or 'elegant' internal architecture, only a few architectural concepts to understand that everything else is built on, to hopefully make the internals easy to work with and maintain.
21
22
 
22
23
 
23
24
  ## Installation
@@ -330,7 +331,7 @@ and/or extra files in ./docs -- as appropriate for what needs to be docs.
330
331
  * Reading Marc8. It can't do it yet. Easiest way would be using Marc4j to read, or using it as a transcoder anyway. Don't really want to write marc8 transcoder in ruby.
331
332
 
332
333
  * We need something like `to_field`, but without actually being
333
- for mapping to a specific output field. For generic pre or post-processing, or multi-output-field logic. `before_record do &block`, `after_record do &block` , `on_each_record do &block`, one or more of those.
334
+ for mapping to a specific output field. For generic pre or post-processing, or multi-output-field logic. `before_record do &block`, `after_record do &block` , `on_each_record do &block`, one or more of those.
334
335
 
335
336
  * Unicode normalization. Has to normalize to NFKC on way out to index. Except for serialized marc field and other exceptions? Except maybe don't have to, rely on solr analyzer to do it?
336
337
 
@@ -5,6 +5,9 @@ require 'traject/qualified_const_get'
5
5
  require 'traject/marc_reader'
6
6
  require 'traject/json_writer'
7
7
  require 'traject/solrj_writer'
8
+
9
+ require 'traject/macros/marc21'
10
+ require 'traject/macros/basic'
8
11
  #
9
12
  # == Readers and Writers
10
13
  #
@@ -44,6 +47,14 @@ class Traject::Indexer
44
47
 
45
48
  attr_writer :reader_class, :writer_class
46
49
 
50
+ # For now we hard-code these basic macro's included
51
+ # TODO, make these added with extend per-indexer,
52
+ # added by default but easily turned off (or have other
53
+ # default macro modules provided)
54
+ include Traject::Macros::Marc21
55
+ include Traject::Macros::Basic
56
+
57
+
47
58
  def initialize
48
59
  @settings = Settings.new(self.class.default_settings)
49
60
  @index_steps = []
@@ -1,3 +1,3 @@
1
1
  module Traject
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -14,7 +14,6 @@ describe "Traject::Macros::Marc21" do
14
14
 
15
15
  before do
16
16
  @indexer = Traject::Indexer.new
17
- @indexer.extend Traject::Macros::Marc21
18
17
  @record = MARC::Reader.new(support_file_path "manufacturing_consent.marc").to_a.first
19
18
  end
20
19
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: traject
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.1
5
+ version: 0.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jonathan Rochkind