summon 1.1.9 → 1.1.12

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/History.txt CHANGED
@@ -1,5 +1,20 @@
1
- === 1.1.9 2010-05-03
1
+ === 1.1.12 2010-10-19
2
+ * 1 minor enhancement
3
+ * added lib_guide_tabs to document schema
4
+
5
+ === 1.1.11 2010-09-03
2
6
  * 1 minor enhancement
7
+ * added dbid field accessor to the document schema
8
+
9
+ === 1.1.10 2010-05-06
10
+ * 4 minor enhancements
11
+ * updated "en" and "xx" locales
12
+ * Added additional translation stubs
13
+ * Added full on translations
14
+ # Added Edition to document schema
15
+
16
+ === 1.1.9 2010-05-03
17
+ * 2 minor enhancement
3
18
  * fix japanese translation for Publication Date
4
19
  * Added publication_place to document schema
5
20
 
data/Manifest.txt CHANGED
@@ -7,11 +7,24 @@ bin/summon
7
7
  bin/summonh
8
8
  ispec/integration_spec.rb
9
9
  lib/summon.rb
10
+ lib/summon/benchmark.rb
10
11
  lib/summon/cli.rb
12
+ lib/summon/locales/dadk.rb
13
+ lib/summon/locales/dede.rb
11
14
  lib/summon/locales/en.rb
15
+ lib/summon/locales/eses.rb
16
+ lib/summon/locales/fifi.rb
12
17
  lib/summon/locales/fr.rb
18
+ lib/summon/locales/frfr.rb
19
+ lib/summon/locales/isis.rb
20
+ lib/summon/locales/itit.rb
13
21
  lib/summon/locales/jp.rb
14
- lib/summon/locales/xx.rb
22
+ lib/summon/locales/nlnl.rb
23
+ lib/summon/locales/nono.rb
24
+ lib/summon/locales/ptpt.rb
25
+ lib/summon/locales/svse.rb
26
+ lib/summon/locales/zacn.rb
27
+ lib/summon/locales/zhcn.rb
15
28
  lib/summon/log.rb
16
29
  lib/summon/schema.rb
17
30
  lib/summon/schema/availability.rb
data/README.rdoc CHANGED
@@ -55,7 +55,7 @@ Ruby language bindings for Serials Solutions Summon Unified Discovery Service
55
55
 
56
56
  (The MIT License)
57
57
 
58
- Copyright (c) 2009 Serials Solutions LLC
58
+ Copyright (c) 2009-2010 Serials Solutions LLC
59
59
 
60
60
  Permission is hereby granted, free of charge, to any person obtaining
61
61
  a copy of this software and associated documentation files (the
data/lib/summon.rb CHANGED
@@ -6,11 +6,13 @@ require 'cgi'
6
6
  require 'json'
7
7
 
8
8
  module Summon
9
- VERSION = "1.1.9"
9
+ VERSION = "1.1.12"
10
10
  DEFAULT_LOCALE = 'en'
11
- require 'summon/locales/en'
12
- require 'summon/locales/fr'
13
- require 'summon/locales/jp'
11
+
12
+ locale_dir = File.dirname(__FILE__) + '/summon/locales'
13
+ Dir["#{locale_dir}/*.rb"].each { |file|
14
+ require file
15
+ }
14
16
 
15
17
  require 'summon/log'
16
18
  require 'summon/service'
@@ -0,0 +1,22 @@
1
+
2
+ require 'benchmark'
3
+
4
+ module Summon
5
+ class Benchmark
6
+ def initialize
7
+ @timings = []
8
+ end
9
+ def report(name, &block)
10
+ result = nil
11
+ @timings << ::Benchmark.measure(name) do
12
+ result = block.call
13
+ end
14
+ result
15
+ end
16
+
17
+ def output(to = $stdout)
18
+ to.printf("%20s %s\n", "","real time")
19
+ to.puts(@timings.map {|t| t.format("%-20n: %r")})
20
+ end
21
+ end
22
+ end
data/lib/summon/cli.rb CHANGED
@@ -25,6 +25,7 @@ module Summon
25
25
  "s.role" => "none"
26
26
  }
27
27
  raw = nil
28
+ do_benchmarks = false
28
29
 
29
30
  mandatory_options = %w( )
30
31
 
@@ -66,7 +67,8 @@ module Summon
66
67
  opts.on("-k", "--secret-key=KEY", String, "Summon API Secret Key", "Default: ~/.summonrc[secret_key]") {|key| options[:secret_key] = key}
67
68
  opts.on("-c --sersol-client-id=CLIENT_HASH", String, "Specific Serials Solutions Client ID to use when making this query",
68
69
  "Only useful when your access id is authorized to query multiple accounts") {|id| options[:client_key] = config.client_key(id)}
69
-
70
+
71
+ opts.on("--benchmark", "Benchmark the the query") { do_benchmarks = true}
70
72
  opts.on("-g", "--get=URL", "Takes a raw summon url, and queries the api without first performing any encoding.") {|url| raw = url}
71
73
  opts.on("--verbose", "output more request information") {options[:log].merge! :level => :info }
72
74
  opts.on("--debug", "output very detailed information") {options[:log].merge! :level => :debug }
@@ -86,12 +88,19 @@ module Summon
86
88
  end
87
89
  end
88
90
  begin
89
- service = Summon::Service.new(config.options.merge options)
90
- puts JSON.pretty_generate(raw ? service.transport.urlget(raw) : service.transport.get("/search", params))
91
+ if do_benchmarks
92
+ require 'summon/benchmark'
93
+ b = Summon::Benchmark.new
94
+ service = Summon::Service.new(config.options.merge(options).merge(:benchmark => b))
95
+ raw ? service.transport.urlget(raw) : service.transport.get("/search", params)
96
+ b.output
97
+ else
98
+ service = Summon::Service.new(config.options.merge(options))
99
+ puts JSON.pretty_generate(raw ? service.transport.urlget(raw) : service.transport.get("/search", params))
100
+ end
91
101
  rescue Summon::Transport::TransportError => e
92
102
  puts e.message
93
103
  end
94
-
95
104
  end
96
105
 
97
106
 
@@ -135,4 +144,4 @@ module Summon
135
144
  end
136
145
  end
137
146
  end
138
- end
147
+ end
@@ -0,0 +1,175 @@
1
+ module Summon
2
+ module Locale
3
+ module DADK
4
+ TRANSLATIONS = {
5
+ "Afrikaans" => "Afrikaans",
6
+ "Albanian" => "Albansk",
7
+ "Album" => "Album",
8
+ "Amharic" => "Amharisk",
9
+ "Arabic" => "Arabisk",
10
+ "Aragonese" => "Aragonesisk",
11
+ "Architectural Drawing" => "Arkitekttegning",
12
+ "Archival Material" => "Arkiveret materiale",
13
+ "Armenian" => "Armensk",
14
+ "Art" => "Kunst",
15
+ "Artifact" => "Artefakt",
16
+ "Audio Recording" => "Lydoptagelse",
17
+ "Aymara" => "Aymara",
18
+ "Azerbaijani" => "Aserbajdsjansk",
19
+ "Bambara" => "Bambara",
20
+ "Basque" => "Baskisk",
21
+ "Belarusian" => "Hviderussisk",
22
+ "Bengali" => "Bengali",
23
+ "Blueprint" => "Blåtryk",
24
+ "Blueprints" => "Blåtryk",
25
+ "Book" => "Bog",
26
+ "Book Chapter" => "Kapitel i bog",
27
+ "Book Review" => "Boganmeldelse",
28
+ "Bosnian" => "Bosnisk",
29
+ "Breton" => "Bretonsk",
30
+ "Bulgarian" => "Bulgarsk",
31
+ "Burmese" => "Burmesisk",
32
+ "Catalan" => "Catalansk",
33
+ "Catalog" => "Katalog",
34
+ "Ceremonial Object" => "Ceremoniel genstand",
35
+ "Chechen" => "Chechensk",
36
+ "Chinese" => "Kinesisk",
37
+ "Church Slavic" => "Kirkeslavisk",
38
+ "Clothing" => "Tøj",
39
+ "Computer File" => "Computerfil",
40
+ "Conference Proceeding" => "Mødenotater",
41
+ "ContentType" => "Indhold Type",
42
+ "Cree" => "Cree",
43
+ "Croatian" => "Kroatisk",
44
+ "Czech" => "Tjekkisk",
45
+ "Danish" => "Dansk",
46
+ "Dissertation" => "Disputats",
47
+ "Drawing" => "Tegning",
48
+ "Dutch" => "Hollandsk",
49
+ "English" => "Engelsk",
50
+ "Equipment" => "Udstyr",
51
+ "Esperanto" => "Esperanto",
52
+ "Estonian" => "Estisk",
53
+ "Fijian" => "Fijisk",
54
+ "Finnish" => "Finsk",
55
+ "French" => "Fransk",
56
+ "Fulah" => "Fulah",
57
+ "Furnishing" => "Indretning",
58
+ "Galician" => "Galisisk",
59
+ "Ganda" => "Ganda",
60
+ "Georgian" => "Georgisk",
61
+ "German" => "Tysk",
62
+ "Government Document" => "Regeringsdokument",
63
+ "Graphic Arts" => "Grafisk kunst",
64
+ "Greek" => "Græsk",
65
+ "Haitian" => "Haitisk",
66
+ "Hebrew" => "Hebraisk",
67
+ "Hindi" => "Hindi",
68
+ "Houseware" => "Husholdningsartikel",
69
+ "Hungarian" => "Ungarsk",
70
+ "Icelandic" => "Islandsk",
71
+ "Image" => "Billede",
72
+ "Implements" => "Implementeringer",
73
+ "Indonesian" => "Indonesisk",
74
+ "Inuktitut" => "Inuktitut",
75
+ "Irish" => "Irsk",
76
+ "IsScholarly" => "IsScholarly ",
77
+ "Italian" => "Italiensk",
78
+ "Japanese" => "Japansk",
79
+ "Javanese" => "Javanesisk",
80
+ "Journal" => "Journal",
81
+ "Journal Article" => "Artikel i journal",
82
+ "Kit" => "Sæt",
83
+ "Korean" => "Koreansk",
84
+ "Kurdish" => "Kurdisk",
85
+ "Language" => "Language",
86
+ "Lao" => "Lao",
87
+ "Latin" => "Latin",
88
+ "Latvian" => "Lettisk",
89
+ "Library" => "Bibliotek",
90
+ "Lithuanian" => "Litauisk",
91
+ "Macedonian" => "Makedonsk",
92
+ "Malay" => "Malajisk",
93
+ "Maltese" => "Maltesisk",
94
+ "Manuscript" => "Manuskript",
95
+ "Maori" => "Maorisk",
96
+ "Map" => "Kort",
97
+ "Marathi" => "Marathi",
98
+ "Microfilm" => "Mikrofilm",
99
+ "Microform" => "Mikroform",
100
+ "Model" => "Model",
101
+ "Mongolian" => "Mongolsk",
102
+ "Music Recording" => "Musikoptagelse",
103
+ "Music Score" => "Partitur",
104
+ "Musical Instrument" => "Musikinstrument",
105
+ "Navajo" => "Navajo",
106
+ "Ndonga" => "Ndonga",
107
+ "Nepali" => "Nepali",
108
+ "Newsletter" => "Nyhedsbrev",
109
+ "Newspaper" => "Avis",
110
+ "Newspaper Article" => "Avisartikel",
111
+ "Norwegian" => "Norsk",
112
+ "Ojibwa" => "Ojibwa",
113
+ "Painting" => "Malerkunst",
114
+ "Pali" => "Pali",
115
+ "Pamphlet" => "Brochure",
116
+ "Panjabi" => "Punjabisk",
117
+ "Paper" => "Papir",
118
+ "Patent" => "Patent",
119
+ "Persian" => "Persisk",
120
+ "Photograph" => "Fotografi",
121
+ "Play" => "Afspil",
122
+ "Poem" => "Digt",
123
+ "Polish" => "Polsk",
124
+ "Portuguese" => "Portugisisk",
125
+ "Postcard" => "Postkort",
126
+ "Poster" => "Plakat",
127
+ "Presentation" => "Fremstilling",
128
+ "Publication" => "Udgivelse",
129
+ "Publication Article" => "Udgivelsesartikel",
130
+ "PublicationDate" => "Udgivelsesdato",
131
+ "Pushto" => "Pashto",
132
+ "Quechua" => "Quechua",
133
+ "Realia" => "Realia",
134
+ "Report" => "Rapport",
135
+ "Romanian" => "Rumænsk",
136
+ "Russian" => "Russisk",
137
+ "Sanskrit" => "Sanskrit",
138
+ "Serbian" => "Serbisk",
139
+ "Slovak" => "Slovakisk",
140
+ "Slovenian" => "Slovensk",
141
+ "Spanish" => "Spansk",
142
+ "Special Collection" => "Særlig samling",
143
+ "Spoken Word Recording" => "Indspilning af lydbog",
144
+ "Standard" => "Standard",
145
+ "SubjectTerms" => "Emneudtryk",
146
+ "Sundanese" => "Sundanese",
147
+ "Swahili" => "Swahili",
148
+ "Swedish" => "Svensk",
149
+ "Tagalog" => "Tagalog",
150
+ "Tamil" => "Tamilsk",
151
+ "Telugu" => "Telugu",
152
+ "Thai" => "Thai",
153
+ "Tibetan" => "Tibetansk",
154
+ "Tool" => "Værktøj",
155
+ "Trade Publication Article" => "Faglig udgivelsesartikel",
156
+ "Transcript" => "Afskrift",
157
+ "Tswana" => "Tswana",
158
+ "Turkish" => "Tyrkisk",
159
+ "Ukrainian" => "Ukrainsk",
160
+ "Urdu" => "Urdu",
161
+ "Video Recording" => "Videooptagelse",
162
+ "Vietnamese" => "Vietnamesisk",
163
+ "Web Resource" => "Webressource",
164
+ "Welsh" => "Walisisk",
165
+ "Western Frisian" => "Frisisk",
166
+ "Wolof" => "Wolof",
167
+ "Yiddish" => "Jiddish",
168
+ "Yoruba" => "Yoruba",
169
+ "Zulu" => "Zulu",
170
+ "eBook" => "e-bog"
171
+ }
172
+ end
173
+ end
174
+ end
175
+
@@ -0,0 +1,178 @@
1
+ module Summon
2
+ module Locale
3
+ module DEDE
4
+ TRANSLATIONS = {
5
+ "Afrikaans" => "Afrikaans",
6
+ "Albanian" => "Albanisch",
7
+ "Album" => "Album",
8
+ "Amharic" => "Amharisch",
9
+ "Arabic" => "Arabisch",
10
+ "Aragonese" => "Aragonesisch",
11
+ "Architectural Drawing" => "Architekturzeichnung",
12
+ "Archival Material" => "Archivmaterial",
13
+ "Armenian" => "Armenisch",
14
+ "Art" => "Kunst",
15
+ "Artifact" => "Artefakt",
16
+ "Audio Recording" => "Tonaufnahme",
17
+ "Aymara" => "Aymara",
18
+ "Azerbaijani" => "Aserbaidschanisch",
19
+ "Bambara" => "Bambara",
20
+ "Basque" => "Baskisch",
21
+ "Belarusian" => "Weißrussisch",
22
+ "Bengali" => "Bengalisch",
23
+ "Blueprint" => "Entwurf",
24
+ "Blueprints" => "Entwürfe",
25
+ "Book" => "Buch",
26
+ "Book Chapter" => "Buchkapitel",
27
+ "Book Review" => "Buchbesprechung",
28
+ "Bosnian" => "Bosnisch",
29
+ "Breton" => "Bretonisch",
30
+ "Bulgarian" => "Bulgarisch",
31
+ "Burmese" => "Birmanisch",
32
+ "Catalan" => "Katalanisch",
33
+ "Catalog" => "Katalog",
34
+ "Ceremonial Object" => "Zeremonielles Objekt",
35
+ "Chechen" => "Tschetschenisch",
36
+ "Chinese" => "Chinesisch",
37
+ "Church Slavic" => "Kirchenslawisch",
38
+ "Clothing" => "Kleidung",
39
+ "Computer File" => "Computerdatei",
40
+ "Conference Proceeding" => "Konferenzbericht",
41
+ "ContentType" => "Materialarten",
42
+ "Cree" => "Cree",
43
+ "Croatian" => "Kroatisch",
44
+ "Czech" => "Tschechisch",
45
+ "Danish" => "Dänisch",
46
+ "Dissertation" => "Vortrag",
47
+ "Drawing" => "Zeichnung",
48
+ "Dutch" => "Niederländisch",
49
+ "eBook" => "eBook",
50
+ "English" => "Englisch",
51
+ "Equipment" => "Gerät",
52
+ "Esperanto" => "Esperanto",
53
+ "Estonian" => "Estnisch",
54
+ "Fijian" => "Fidschianisch",
55
+ "Finnish" => "Finnisch",
56
+ "French" => "Französisch",
57
+ "Fulah" => "Ful",
58
+ "Furnishing" => "Einrichtung",
59
+ "Galician" => "Galizisch",
60
+ "Ganda" => "Ganda",
61
+ "Georgian" => "Georgisch",
62
+ "German" => "Deutsch",
63
+ "Government Document" => "Regierungsdokument",
64
+ "Graphic Arts" => "Grafische Künste",
65
+ "Greek" => "Griechisch",
66
+ "Haitian" => "Haitianisch",
67
+ "Hebrew" => "Hebräisch",
68
+ "Hindi" => "Hindi",
69
+ "Houseware" => "Haushaltware",
70
+ "Hungarian" => "Ungarisch",
71
+ "Icelandic" => "Isländisch",
72
+ "Image" => "Bild",
73
+ "Implements" => "Utensilien",
74
+ "Indonesian" => "Indonesisch",
75
+ "Inuktitut" => "Inuktitut",
76
+ "inupiaq" => "Inupiaq",
77
+ "Irish" => "Irisch",
78
+ "Italian" => "Italienisch",
79
+ "Japanese" => "Japanisch",
80
+ "Javanese" => "Javanisch",
81
+ "Journal" => "Zeitschrift",
82
+ "Journal Article" => "Zeitschriftenartikel",
83
+ "Kit" => "Kit",
84
+ "Korean" => "Koreanisch",
85
+ "Kurdish" => "Kurdisch",
86
+ "Language" => "Sprache",
87
+ "Lao" => "Laotisch",
88
+ "Latin" => "Lateinisch",
89
+ "Latvian" => "Lettisch",
90
+ "Library" => "Bibliothek",
91
+ "Lithuanian" => "Litauisch",
92
+ "Macedonian" => "Mazedonisch",
93
+ "Malay" => "Malaiisch",
94
+ "Maltese" => "Maltesisch",
95
+ "Manuscript" => "Manuskript",
96
+ "Maori" => "Maori",
97
+ "Map" => "Karte",
98
+ "Marathi" => "Marathi",
99
+ "Microfilm" => "Mikrofilm",
100
+ "Microform" => "Mikrobildspeicher",
101
+ "Model" => "Modell",
102
+ "Mongolian" => "Mongolisch",
103
+ "Music Recording" => "Musikaufnahme",
104
+ "Music Score" => "Partitur",
105
+ "Musical Instrument" => "Musikinstrument",
106
+ "Navajo" => "Navajo",
107
+ "Ndonga" => "Ndonga",
108
+ "Nepali" => "Nepalesisch",
109
+ "Newsletter" => "Newsletter",
110
+ "Newspaper" => "Zeitung",
111
+ "Newspaper Article" => "Zeitungsartikel",
112
+ "Norwegian" => "Norwegisch",
113
+ "Ojibwa" => "Ojibwa",
114
+ "Painting" => "Gemälde",
115
+ "Pali" => "Pali",
116
+ "Pamphlet" => "Pamphlet",
117
+ "Panjabi" => "Punjabi",
118
+ "Paper" => "Papier",
119
+ "Patent" => "Patent",
120
+ "Persian" => "Persisch",
121
+ "Persian" => "Persönlicher Artikel",
122
+ "Personal Article" => "Fotografie",
123
+ "Play" => "Theaterstück",
124
+ "Poem" => "Gedicht",
125
+ "Polish" => "Polnisch",
126
+ "Portuguese" => "Portugiesisch",
127
+ "Postcard" => "Postkarte",
128
+ "Poster" => "Poster",
129
+ "Presentation" => "Präsentation",
130
+ "Publication" => "Publikation",
131
+ "Publication Article" => "Publikationsartikel",
132
+ "PublicationDate" => "Publikationsdatum",
133
+ "Pushto" => "Pashto",
134
+ "Quechua" => "Quechua",
135
+ "Realia" => "Realia",
136
+ "Report" => "Bericht",
137
+ "Romanian" => "Rumänisch",
138
+ "Russian" => "Russisch",
139
+ "Sanskrit" => "Sanskrit",
140
+ "Serbian" => "Serbisch",
141
+ "Simplified Chinese" => "Vereinfachtes Chinesisch",
142
+ "Slovak" => "Slowaaks",
143
+ "Slovenian" => "Sloveens",
144
+ "Spanish" => "Spaans",
145
+ "Special Collection" => "Speciale verzameling",
146
+ "Spoken Word Recording" => "Opname van gesproken woord",
147
+ "Standard" => "Standaard",
148
+ "SubjectTerms" => "Thema",
149
+ "Sundanese" => "Sudanesisch",
150
+ "Swahili" => "Swahili",
151
+ "Swedish" => "Schwedisch",
152
+ "Tagalog" => "Tagalog",
153
+ "Tamil" => "Tamilisch",
154
+ "Telugu" => "Telugu",
155
+ "Thai" => "Thailändisch",
156
+ "Tibetan" => "Tibetanisch",
157
+ "Tool" => "Werkzeug",
158
+ "Trade Publication Article" => "Publikationsartikel abgeben",
159
+ "Traditional Chinese" => "Traditionelles Chinesisch",
160
+ "Transcript" => "Abschrift",
161
+ "Tswana" => "Tswana",
162
+ "Turkish" => "Türkisch",
163
+ "Ukrainian" => "Ukrainisch",
164
+ "Urdu" => "Urdu",
165
+ "Video Recording" => "Videoaufnahme",
166
+ "Vietnamese" => "Vietnamesisch",
167
+ "Web Resource" => "Web-Ressource",
168
+ "Welsh" => "Walisisch",
169
+ "Western Frisian" => "Westfriesisch",
170
+ "Wolof" => "Wolof",
171
+ "Yiddish" => "Jiddisch",
172
+ "Yoruba" => "Yoruba",
173
+ "Zulu" => "Zoeloe"
174
+ }
175
+ end
176
+ end
177
+ end
178
+