enju_bookmark 0.1.2.pre3 → 0.1.2.pre4

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,7 +12,7 @@ module CalculateStat
12
12
  module ClassMethods
13
13
  def calculate_stat
14
14
  self.not_calculated.each do |stat|
15
- stat.aasm_calculate!
15
+ stat.calculate!
16
16
  end
17
17
  end
18
18
  end
@@ -1,3 +1,3 @@
1
1
  module EnjuBookmark
2
- VERSION = "0.1.2.pre3"
2
+ VERSION = "0.1.2.pre4"
3
3
  end
@@ -44,7 +44,7 @@ module Dummy
44
44
  end
45
45
 
46
46
  require 'enju_circulation'
47
- require 'enju_leaf'
48
47
  require 'enju_biblio'
49
48
  require 'enju_library'
50
49
  require 'enju_manifestation_viewer'
50
+ require 'mobile-fu'
Binary file
@@ -84,11 +84,14 @@
84
84
  <fieldType name="tfloat" class="solr.TrieFloatField" omitNorms="true"/>
85
85
  <!-- *** This fieldType is used by Sunspot! *** -->
86
86
  <fieldType name="tdate" class="solr.TrieDateField" omitNorms="true"/>
87
+
88
+ <!-- A specialized field for geospatial search. If indexed, this fieldType must not be multivalued. -->
89
+ <fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>
87
90
  </types>
88
91
  <fields>
89
92
  <!-- Valid attributes for fields:
90
93
  name: mandatory - the name for the field
91
- type: mandatory - the name of a previously defined type from the
94
+ type: mandatory - the name of a previously defined type from the
92
95
  <types> section
93
96
  indexed: true if this field should be indexed (searchable or sortable)
94
97
  stored: true if this field should be retrievable
@@ -223,8 +226,17 @@
223
226
  <dynamicField name="*_ets" stored="true" termVectors="true" type="tdouble" multiValued="false" indexed="true"/>
224
227
  <!-- *** This dynamicField is used by Sunspot! *** -->
225
228
  <dynamicField name="*_etms" stored="true" termVectors="true" type="tdouble" multiValued="true" indexed="true"/>
229
+
230
+ <!-- Type used to index the lat and lon components for the "location" FieldType -->
231
+ <dynamicField name="*_coordinate" type="tdouble" indexed="true" stored="false" multiValued="false"/>
232
+ <dynamicField name="*_p" type="location" indexed="true" stored="true" multiValued="false"/>
233
+
234
+ <dynamicField name="*_ll" stored="false" type="location" multiValued="false" indexed="true"/>
235
+ <dynamicField name="*_llm" stored="false" type="location" multiValued="true" indexed="true"/>
236
+ <dynamicField name="*_lls" stored="true" type="location" multiValued="false" indexed="true"/>
237
+ <dynamicField name="*_llms" stored="true" type="location" multiValued="true" indexed="true"/>
226
238
  </fields>
227
- <!-- Field to use to determine and enforce document uniqueness.
239
+ <!-- Field to use to determine and enforce document uniqueness.
228
240
  Unless this field is marked with required="false", it will be a required field
229
241
  -->
230
242
  <uniqueKey>id</uniqueKey>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enju_bookmark
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2.pre3
4
+ version: 0.1.2.pre4
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-26 00:00:00.000000000 Z
12
+ date: 2012-10-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -114,7 +114,7 @@ dependencies:
114
114
  requirements:
115
115
  - - ~>
116
116
  - !ruby/object:Gem::Version
117
- version: 0.1.0.pre6
117
+ version: 0.1.0.pre8
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
@@ -122,7 +122,7 @@ dependencies:
122
122
  requirements:
123
123
  - - ~>
124
124
  - !ruby/object:Gem::Version
125
- version: 0.1.0.pre6
125
+ version: 0.1.0.pre8
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: enju_library
128
128
  requirement: !ruby/object:Gem::Requirement
@@ -130,7 +130,7 @@ dependencies:
130
130
  requirements:
131
131
  - - ~>
132
132
  - !ruby/object:Gem::Version
133
- version: 0.1.0.pre4
133
+ version: 0.1.0.pre5
134
134
  type: :development
135
135
  prerelease: false
136
136
  version_requirements: !ruby/object:Gem::Requirement
@@ -138,7 +138,7 @@ dependencies:
138
138
  requirements:
139
139
  - - ~>
140
140
  - !ruby/object:Gem::Version
141
- version: 0.1.0.pre4
141
+ version: 0.1.0.pre5
142
142
  - !ruby/object:Gem::Dependency
143
143
  name: enju_circulation
144
144
  requirement: !ruby/object:Gem::Requirement
@@ -146,7 +146,7 @@ dependencies:
146
146
  requirements:
147
147
  - - ~>
148
148
  - !ruby/object:Gem::Version
149
- version: 0.1.0.pre4
149
+ version: 0.1.0.pre6
150
150
  type: :development
151
151
  prerelease: false
152
152
  version_requirements: !ruby/object:Gem::Requirement
@@ -154,7 +154,7 @@ dependencies:
154
154
  requirements:
155
155
  - - ~>
156
156
  - !ruby/object:Gem::Version
157
- version: 0.1.0.pre4
157
+ version: 0.1.0.pre6
158
158
  - !ruby/object:Gem::Dependency
159
159
  name: enju_manifestation_viewer
160
160
  requirement: !ruby/object:Gem::Requirement
@@ -178,7 +178,7 @@ dependencies:
178
178
  requirements:
179
179
  - - ~>
180
180
  - !ruby/object:Gem::Version
181
- version: 2.0.0.pre.120720
181
+ version: 2.0.0.pre.120925
182
182
  type: :development
183
183
  prerelease: false
184
184
  version_requirements: !ruby/object:Gem::Requirement
@@ -186,7 +186,23 @@ dependencies:
186
186
  requirements:
187
187
  - - ~>
188
188
  - !ruby/object:Gem::Version
189
- version: 2.0.0.pre.120720
189
+ version: 2.0.0.pre.120925
190
+ - !ruby/object:Gem::Dependency
191
+ name: mobile-fu
192
+ requirement: !ruby/object:Gem::Requirement
193
+ none: false
194
+ requirements:
195
+ - - ! '>='
196
+ - !ruby/object:Gem::Version
197
+ version: '0'
198
+ type: :development
199
+ prerelease: false
200
+ version_requirements: !ruby/object:Gem::Requirement
201
+ none: false
202
+ requirements:
203
+ - - ! '>='
204
+ - !ruby/object:Gem::Version
205
+ version: '0'
190
206
  description: Purchase request management for Next-L Enju
191
207
  email:
192
208
  - tanabe@mwr.mediacom.keio.ac.jp
@@ -421,11 +437,6 @@ files:
421
437
  - spec/dummy/db/migrate/20120728204337_create_series_statement_relationships.rb
422
438
  - spec/dummy/db/schema.rb
423
439
  - spec/dummy/db/test.sqlite3
424
- - spec/dummy/lib/enju_leaf/calculate_stat.rb
425
- - spec/dummy/lib/enju_leaf/expire_editable_fragment.rb
426
- - spec/dummy/lib/enju_leaf/import_file.rb
427
- - spec/dummy/lib/enju_leaf/url_validator.rb
428
- - spec/dummy/lib/enju_leaf.rb
429
440
  - spec/dummy/public/404.html
430
441
  - spec/dummy/public/422.html
431
442
  - spec/dummy/public/500.html
@@ -443,7 +454,7 @@ files:
443
454
  - spec/dummy/solr/conf/stopwords.txt
444
455
  - spec/dummy/solr/conf/synonyms.txt
445
456
  - spec/dummy/solr/data/test/index/segments.gen
446
- - spec/dummy/solr/data/test/index/segments_3c
457
+ - spec/dummy/solr/data/test/index/segments_1v
447
458
  - spec/dummy/solr/data/test/spellchecker/segments.gen
448
459
  - spec/dummy/solr/data/test/spellchecker/segments_1
449
460
  - spec/factories/bookmark.rb
@@ -482,7 +493,7 @@ files:
482
493
  - spec/spec_helper.rb
483
494
  - spec/support/controller_macros.rb
484
495
  - spec/support/devise.rb
485
- homepage: https://github.com/nabeta/enju_bookmark.git
496
+ homepage: https://github.com/nabeta/enju_bookmark
486
497
  licenses: []
487
498
  post_install_message:
488
499
  rdoc_options: []
@@ -674,11 +685,6 @@ test_files:
674
685
  - spec/dummy/db/migrate/20120728204337_create_series_statement_relationships.rb
675
686
  - spec/dummy/db/schema.rb
676
687
  - spec/dummy/db/test.sqlite3
677
- - spec/dummy/lib/enju_leaf/calculate_stat.rb
678
- - spec/dummy/lib/enju_leaf/expire_editable_fragment.rb
679
- - spec/dummy/lib/enju_leaf/import_file.rb
680
- - spec/dummy/lib/enju_leaf/url_validator.rb
681
- - spec/dummy/lib/enju_leaf.rb
682
688
  - spec/dummy/public/404.html
683
689
  - spec/dummy/public/422.html
684
690
  - spec/dummy/public/500.html
@@ -696,7 +702,7 @@ test_files:
696
702
  - spec/dummy/solr/conf/stopwords.txt
697
703
  - spec/dummy/solr/conf/synonyms.txt
698
704
  - spec/dummy/solr/data/test/index/segments.gen
699
- - spec/dummy/solr/data/test/index/segments_3c
705
+ - spec/dummy/solr/data/test/index/segments_1v
700
706
  - spec/dummy/solr/data/test/spellchecker/segments.gen
701
707
  - spec/dummy/solr/data/test/spellchecker/segments_1
702
708
  - spec/factories/bookmark.rb
@@ -1,30 +0,0 @@
1
- module CalculateStat
2
-
3
- def self.included(base)
4
- base.extend ClassMethods
5
- base.send :include, InstanceMethods
6
- base.class_eval do
7
- validates_presence_of :start_date, :end_date
8
- validate :check_date
9
- end
10
- end
11
-
12
- module ClassMethods
13
- def calculate_stat
14
- self.not_calculated.each do |stat|
15
- stat.aasm_calculate!
16
- end
17
- end
18
- end
19
-
20
- module InstanceMethods
21
- def check_date
22
- if self.start_date and self.end_date
23
- if self.start_date >= self.end_date
24
- errors.add(:start_date)
25
- errors.add(:end_date)
26
- end
27
- end
28
- end
29
- end
30
- end
@@ -1,62 +0,0 @@
1
- module ExpireEditableFragment
2
- def expire_editable_fragment(record, fragments = [], formats = [])
3
- fragments.uniq!
4
- fragments = ['detail'] if fragments.empty?
5
- if record
6
- if record.is_a?(Manifestation)
7
- expire_manifestation_cache(record, fragments, formats)
8
- else
9
- I18n.available_locales.each do |locale|
10
- Role.all_cache.each do |role|
11
- fragments.each do |fragment|
12
- expire_fragment(:controller => record.class.to_s.pluralize.downcase, :action => :show, :id => record.id, :page => fragment, :role => role.name, :locale => locale)
13
- end
14
- end
15
- end
16
- end
17
- end
18
- end
19
-
20
- def expire_manifestation_cache(manifestation, fragments = [], formats = [])
21
- fragments = %w[detail pickup title show_list show_index sru] if fragments.size == 1 and fragments.first == 'detail'
22
- expire_fragment(:controller => :manifestations, :action => :index, :page => 'numdocs')
23
- fragments.uniq.each do |fragment|
24
- expire_manifestation_fragment(manifestation, fragment, formats)
25
- end
26
- if defined?(EnjuBookmark)
27
- manifestation.bookmarks.each do |bookmark|
28
- expire_tag_cloud(bookmark)
29
- end
30
- end
31
- end
32
-
33
- def expire_manifestation_fragment(manifestation, fragment, formats = [])
34
- formats = ['atom', 'csv', 'html', 'mods', 'mobile', 'oai_list_identifiers', 'oai_list_records', 'rdf', 'rss'] if formats.empty?
35
- if manifestation
36
- I18n.available_locales.each do |locale|
37
- if fragment == 'holding'
38
- expire_fragment(:controller => :manifestations, :action => :show, :id => manifestation.id, :page => fragment, :locale => locale, :manifestation_id => nil)
39
- formats.each do |format|
40
- expire_fragment(:controller => :manifestations, :action => :show, :id => manifestation.id, :page => fragment, :locale => locale, :format => format, :manifestation_id => nil)
41
- end
42
- else
43
- Role.all_cache.each do |role|
44
- expire_fragment(:controller => :manifestations, :action => :show, :id => manifestation.id, :page => fragment, :role => role.name, :locale => locale, :manifestation_id => nil)
45
- formats.each do |format|
46
- expire_fragment(:controller => :manifestations, :action => :show, :id => manifestation.id, :page => fragment, :role => role.name, :locale => locale, :format => format, :manifestation_id => nil)
47
- end
48
- end
49
- end
50
- end
51
- end
52
- end
53
-
54
- def expire_tag_cloud(bookmark)
55
- I18n.available_locales.each do |locale|
56
- Role.all_cache.each do |role|
57
- expire_fragment(:controller => :tags, :action => :index, :page => 'user_tag_cloud', :user_id => bookmark.user.username, :locale => locale, :role => role.name, :user_id => nil)
58
- expire_fragment(:controller => :tags, :action => :index, :page => 'public_tag_cloud', :locale => locale, :role => role.name, :user_id => nil)
59
- end
60
- end
61
- end
62
- end
@@ -1,13 +0,0 @@
1
- module ImportFile
2
- def self.included(base)
3
- base.extend ClassMethods
4
- end
5
-
6
- module ClassMethods
7
- def expire
8
- self.stucked.find_each do |file|
9
- file.destroy
10
- end
11
- end
12
- end
13
- end
@@ -1,10 +0,0 @@
1
- class UrlValidator < ActiveModel::EachValidator
2
- def validate_each(record, attribute, value)
3
- url = ::Addressable::URI.parse(value)
4
- if url
5
- unless ['http', 'https'].include?(url.scheme)
6
- record.errors.add(attribute.to_sym)
7
- end
8
- end
9
- end
10
- end
@@ -1,4 +0,0 @@
1
- require 'enju_leaf/calculate_stat'
2
- require 'enju_leaf/expire_editable_fragment'
3
- require 'enju_leaf/import_file'
4
- require 'enju_leaf/url_validator'