jakewendt-active_record_sunspotter 4.1.0 → 4.2.0

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: 79f05bc56e701726f80ddfaae0e883a2681b9153
4
- data.tar.gz: ab3caa50a2fec615bc482630e736a38e3df24b77
3
+ metadata.gz: cb424a0065b4e4b31b3f21f39113a4860bfd4313
4
+ data.tar.gz: 32664701a4dcd277c5a55b2fe29dbbfbbc0edeb8
5
5
  SHA512:
6
- metadata.gz: f10cc1f7f4330ac4be8d6ba46fe5c2099c89ec807edaf1c095ad3c83875807dc4e0521733ac9b09af317869d8c7a94c9b3e1f44b95718aee72c6b13b2edbddbe
7
- data.tar.gz: ab600a96bd3d2d3d073825b1c01c9b845f69ecb4483c796ac8561249afad172439adc247e27c7111ba094651ccf675e3d16800bc75ffee6eca3e2f25931dfc2f
6
+ metadata.gz: d6b4cb8f58f15bc862af43f58980e8c544edbddf8dd0ece1b49957211fe96f4d376b3b926cbbf243f50bdd9fde0f6ac83c8de1431f46f69a78bd9b0e5e66ea05
7
+ data.tar.gz: a77097f426f3be45f7a603a4f530302859be84cae50cf33ba4eaea4564ba277dba00844b5df24b252141e8bf79b657eaa115a9d22e6e56882313b66be41dccd0
data/README.rdoc CHANGED
@@ -4,6 +4,82 @@
4
4
 
5
5
 
6
6
 
7
+ == Upgrade notes
8
+
9
+ Upgrading the sunspot family of gems from 2.0.0 to 2.1.0 has been a bit of a nightmare.
10
+
11
+ However
12
+
13
+ Both solr/conf/schema.xml and solr/conf/solrconfig.xml differ between the 2 versions, so update your app's.
14
+
15
+ Once updated, the mods in active_record_sunspotter.rb can be removed.
16
+ Also, remove the added require line in the Rakefile for sunspot rake tasks.
17
+
18
+ Create a solr/solr.xml to look like so ...
19
+
20
+ <?xml version="1.0" encoding="UTF-8" ?>
21
+ <solr persistent="false">
22
+ <cores adminPath="/admin/cores" host="${host:}" hostPort="${jetty.port:}">
23
+ <core name="production" instanceDir="." dataDir="data/production"/>
24
+ <core name="development" instanceDir="." dataDir="data/development"/>
25
+ <core name="test" instanceDir="." dataDir="data/test"/>
26
+ </cores>
27
+ </solr>
28
+
29
+ ... or use the new one, but reorganize the solr directory.
30
+
31
+
32
+
33
+
34
+ config/sunspot.yml needs an absolute solr_home for each environment, and a path too
35
+
36
+ solr_home: /Users/jakewendt/github_repo/jakewendt/active_record_sunspotter/solr
37
+ path: /solr/production
38
+
39
+
40
+ Apparently, solr.xml's dataDir and sunspot.yml's path must match. Or not?
41
+
42
+
43
+
44
+ Rather confused on this issue. The command (ps | grep solr) shows a solr.data.dir of /solr/data/development
45
+ even though
46
+
47
+ solr.xml ...
48
+ <core name="development" instanceDir="." dataDir="development/data"/>
49
+
50
+ sunspot.yml
51
+ path: /solr/development
52
+
53
+ Seems to use both data/development and development/data for some reason?
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+ REALLY NEED TO MAKE THIS UPGRADABLE! Not Upgrade-and-start-overable!
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+ sudo mkdir /opt/local/lib/ruby2.0/gems/2.0.0/gems/sunspot_solr-2.1.0/solr/solr-webapp
72
+ sudo chmod 777 /opt/local/lib/ruby2.0/gems/2.0.0/gems/sunspot_solr-2.1.0/solr/solr-webapp
73
+
74
+ 2014-05-02 14:26:28.072:INFO:oejd.DeploymentManager:Deployable added: /opt/local/lib/ruby2.0/gems/2.0.0/gems/sunspot_solr-2.1.0/solr/contexts/solr.xml
75
+ 2014-05-02 14:26:28.116:WARN:oejx.XmlConfiguration:Config error at <Set name="tempDirectory"><Property name="jetty.home" default="."/>/solr-webapp</Set> java.lang.reflect.InvocationTargetException
76
+
77
+ Caused by:
78
+ java.lang.IllegalArgumentException: Bad temp directory: /opt/local/lib/ruby2.0/gems/2.0.0/gems/sunspot_solr-2.1.0/solr/solr-webapp
79
+
80
+
81
+ I suppose it could be another folder, but you'd need to modify the gem's solr/contexts/solr.xml file.
82
+
7
83
 
8
84
 
9
85
 
@@ -29,6 +105,7 @@ end
29
105
 
30
106
 
31
107
 
108
+ The 2.1.0 version of this file is now included in this gem.
32
109
 
33
110
  And another mod... (I may be able to patch this one.)
34
111
 
@@ -66,6 +143,9 @@ ArgumentError: Unknown key: :include. Valid keys are: :start, :batch_size
66
143
  c ; bundle exec rake sunspot:solr:stop ; bundle exec rake sunspot:solr:stop RAILS_ENV=test ; bundle exec rake sunspot:solr:start ; bundle exec rake sunspot:solr:start RAILS_ENV=test ; bundle exec rake test
67
144
 
68
145
 
146
+ bundle exec rake sunspot:solr:stop ; bundle exec rake sunspot:solr:start
147
+
148
+ bundle exec rake sunspot:solr:stop RAILS_ENV=test ; bundle exec rake sunspot:solr:start RAILS_ENV=test ; bundle exec rake test ; bundle exec rake sunspot:solr:stop RAILS_ENV=test
69
149
 
70
150
  == Gemified with Jeweler
71
151
 
@@ -13,14 +13,14 @@ require 'active_record_sunspotter/sunspot_helper'
13
13
  # sunspot_rails_2.0.0 uses methods that are deprecated in rails 4
14
14
  # sunspot_rails_2.1.0 (or sunspot_2.1.0 or sunspot_solr_2.1.0) won't compile (java issues)
15
15
  # copied in this 1 file
16
- require 'active_record_sunspotter/sunspot_rails_2.1.0_sunspot_rails_adapters'
16
+ #require 'active_record_sunspotter/sunspot_rails_2.1.0_sunspot_rails_adapters'
17
17
 
18
18
  # for some reason, the :include key will inspire ...
19
19
  # ArgumentError: Unknown key: :include. Valid keys are: :start, :batch_size
20
20
  # Tasks: TOP => sunspot:solr:reindex => sunspot:reindex
21
21
  # Seems to have been this way for some time, but now it errors.
22
22
  # Using 2.1.0's version makes everyone happy?
23
- require 'active_record_sunspotter/sunspot_rails_2.1.0_sunspot_rails_searchable'
23
+ #require 'active_record_sunspotter/sunspot_rails_2.1.0_sunspot_rails_searchable'
24
24
  # Somehow this requires the presence of a new file solr/solr.xml
25
25
 
26
26
 
@@ -35,7 +35,7 @@ if defined?(Rails)
35
35
 
36
36
  # sunspot_solr-2.0.0 uses "Rails::VERSION::MAJOR == 3" which stops tasks from loading.
37
37
  #if defined?(Rails::Railtie)
38
- require 'sunspot/solr/railtie'
38
+ #require 'sunspot/solr/railtie'
39
39
  #end
40
40
 
41
41
  ActionController::Base.append_view_path( File.join(File.dirname(__FILE__), '../vendor/views'))
@@ -1,5 +1,8 @@
1
1
  jQuery(function(){
2
2
 
3
+ //
4
+ // perhaps make this 'div.facet_toggle *' so as to include the span triangle icon?
5
+ //
3
6
  jQuery('div.facet_toggle a').click(function(){
4
7
  // jQuery(this).parent().next().toggle(500);
5
8
  // added 'blind' so doesn't resize stuff and just slides in.
@@ -14,6 +17,9 @@ jQuery(function(){
14
17
  connectWith: ".selectable_columns"
15
18
  }).disableSelection();
16
19
 
20
+ //
21
+ // should this really be '<input>' and not just 'input'?
22
+ //
17
23
  jQuery('form').submit(function(){
18
24
  jQuery('#selected_columns li').each(function(){
19
25
  jQuery('<input>').attr({
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jakewendt-active_record_sunspotter
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0
4
+ version: 4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - George 'Jake' Wendt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-16 00:00:00.000000000 Z
11
+ date: 2014-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sunspot_rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '='
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.0.0
19
+ version: '0'
20
20
  type: :runtime
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: 2.0.0
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sunspot_solr
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '='
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
- version: 2.0.0
33
+ version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '='
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
- version: 2.0.0
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: progress_bar
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -210,7 +210,6 @@ files:
210
210
  - lib/active_record_sunspotter/sunspot_rails_server.rb
211
211
  - lib/active_record_sunspotter/sunspotability.rb
212
212
  - lib/jakewendt-active_record_sunspotter.rb
213
- - lib/tasks/application.rake
214
213
  - vendor/assets/javascripts/sunspot.js
215
214
  - vendor/assets/stylesheets/sunspot.css.scss
216
215
  - vendor/views/layouts/_footer.html.erb
@@ -1,214 +0,0 @@
1
- #namespace :app do
2
- # task :import => :environment do
3
- # f = File.open('TheKingJamesBible.txt','r')
4
- # {} until( ( line = f.gets ) =~ /^The First Book of Moses: Called Genesis\s*$/ )
5
- # puts line
6
- # f.close # File.open('TheKingJamesBible.txt','r')
7
- # end # task :import => :environment do
8
- #end # namespace :app do
9
- namespace :app do
10
- task :import => :environment do
11
- File.open('data/TheKingJamesBible.txt','r') do |f|
12
- until ( line = f.gets ).match(/^\*\*\*/)
13
- # skip
14
- end
15
- while ( line = f.gets ).match(/^\s*$/)
16
- # skip
17
- end
18
- puts line
19
- # => The Old Testament of the King James Version of the Bible
20
-
21
- chapter_num = verse_num = book = chapter = verse = nil
22
- new_line_counter = 0
23
- book_counter = 0
24
- buffer = ''
25
-
26
-
27
- # basic expectations ...
28
- #
29
- # book ends with >4 new lines but can include new lines (<=2 only)
30
- # first verse is after >2 new lines
31
-
32
- while cval = f.getc
33
- next if cval == "\r" #13
34
-
35
- if cval == "\n" #10
36
- new_line_counter += 1
37
- buffer << ' '
38
- next
39
- end
40
-
41
-
42
- if new_line_counter > 4 && book && chapter && verse && !buffer.blank?
43
- # last verse of book
44
- puts "-- CH:#{chapter_num}:V:#{verse_num}:#{buffer}"
45
- verse.body = buffer.squish
46
- verse.save
47
- buffer = ''
48
- chapter_num = verse_num = book = chapter = verse = nil
49
- end
50
-
51
- # 2 new lines isn't just for new books
52
- # some chapters are separated by 2 new lines
53
- # so need more somehow. Psalms is causing the problem with the extra new line between chapters
54
- # manually removed them
55
- if new_line_counter > 2 && !buffer.blank?
56
- puts "\n\nLooks like a new book is here:#{buffer.squish}:\n"
57
- book_counter += 1
58
- #book = buffer.squish
59
- book = Book.create(:title => buffer.squish)
60
- buffer = ''
61
- end
62
-
63
- buffer << cval #.chr
64
-
65
- if buffer.match(/^([\D]*)(\d+):(\d+)\s+/) #or ( buffer =~ /^([\D]*)End of the Project Gutenberg EBook/ )
66
- text = $1 # previous verse
67
- if chapter_num && verse_num && text
68
- puts "CH:#{chapter_num}:V:#{verse_num}:#{text}"
69
- verse.body = text.squish
70
- verse.save
71
- end
72
- #chapter = $2.squish #if $2
73
- chapter = book.chapters.find_or_create_by(:position => $2.to_i)
74
- chapter_num = $2.squish #if $2
75
- ## I guess that the verse number is just going to be the position?
76
- ## relax self! just a demo!
77
- #verse = $3.squish #if $3
78
- verse = chapter.verses.new(:position => $3.to_i) #create(:body => $3)
79
- verse_num = $3.squish #if $3
80
- buffer= ''
81
- end
82
-
83
- break if buffer =~ /End of the Project Gutenberg EBook/
84
-
85
- # reset counter (perhaps way too often)
86
- new_line_counter = 0 if cval != "\n" # 10
87
- end
88
- puts book_counter
89
- end # File
90
- end # task
91
-
92
- end # namespace
93
-
94
- __END__
95
-
96
-
97
- 40:38 For the cloud of the LORD was upon the tabernacle by day, and
98
- fire was on it by night, in the sight of all the house of Israel,
99
- throughout all their journeys.
100
-
101
-
102
-
103
-
104
- The Third Book of Moses: Called Leviticus
105
-
106
-
107
- 1:1 And the LORD called unto Moses, and spake unto him out of the
108
- tabernacle of the congregation, saying, 1:2 Speak unto the children of
109
- Israel, and say unto them, If any man of you bring an offering unto
110
- the LORD, ye shall bring your offering of the cattle, even of the
111
- herd, and of the flock.
112
-
113
-
114
-
115
- CH:40:V:37:But if the cloud were not taken up, then they journeyed not till the day that it was taken up.
116
- create new book with title:For the cloud of the LORD was upon the tabernacle by day, and fire was on it by night, in the sight of all the house of Israel, throughout all their journeys. :
117
- create new book with title: The Third Book of Moses: Called Leviticus :
118
- CH:1:V:1:And the LORD called unto Moses, and spake unto him out of the tabernacle of the congregation, saying,
119
- CH:1:V:2:Speak unto the children of Israel, and
120
-
121
-
122
- The First Book of Moses: Called Genesis
123
-
124
-
125
- 1:1 In the beginning God created the heaven and the earth.
126
-
127
- 1:2 And the earth was without form, and void; and darkness was upon
128
- the face of the deep. And the Spirit of God moved upon the face of the
129
- waters.
130
-
131
- FYI, some verses actually have multiple "paragraphs" .
132
-
133
- Also, some verses are merged on the same line?
134
-
135
- 3:1 Now the serpent was more subtil than any beast of the field which
136
- the LORD God had made. And he said unto the woman, Yea, hath God said,
137
- Ye shall not eat of every tree of the garden? 3:2 And the woman said
138
- unto the serpent, We may eat of the fruit of the trees of the garden:
139
- 3:3 But of the fruit of the tree which is in the midst of the garden,
140
- God hath said, Ye shall not eat of it, neither shall ye touch it, lest
141
- ye die.
142
-
143
-
144
-
145
-
146
- 50:26 So Joseph died, being an hundred and ten years old: and they
147
- embalmed him, and he was put in a coffin in Egypt.
148
-
149
-
150
-
151
-
152
- The Second Book of Moses: Called Exodus
153
-
154
-
155
- 1:1 Now these are the names of the children of Israel, which came
156
- into Egypt; every man and his household came with Jacob.
157
-
158
- 1:2 Reuben, Simeon, Levi, and Judah, 1:3 Issachar, Zebulun, and
159
- Benjamin, 1:4 Dan, and Naphtali, Gad, and Asher.
160
-
161
- 1:5 And all the souls that came out of the loins of Jacob were seventy
162
- souls: for Joseph was in Egypt already.
163
-
164
- 1:6 And Joseph died, and all his brethren, and all that generation.
165
-
166
- 1:7 And the children of Israel were fruitful, and increased
167
- abundantly, and multiplied, and waxed exceeding mighty; and the land
168
- was filled with them.
169
-
170
- 1:8 Now there arose up a new king over Egypt, which knew not Joseph.
171
-
172
- 1:9 And he said unto his people, Behold, the people of the children of
173
- Israel are more and mightier than we: 1:10 Come on, let us deal wisely
174
- with them; lest they multiply, and it come to pass, that, when there
175
- falleth out any war, they join also unto our enemies, and fight
176
- against us, and so get them up out of the land.
177
-
178
- 1:11 Therefore they did set over them taskmasters to afflict them with
179
- their burdens. And they built for Pharaoh treasure cities, Pithom and
180
- Raamses.
181
-
182
- 1:12 But the more they afflicted them, the more they multiplied and
183
- grew.
184
-
185
- And they were grieved because of the children of Israel.
186
-
187
-
188
-
189
-
190
-
191
-
192
- 4:5 Behold, I will send you Elijah the prophet before the coming of
193
- the great and dreadful day of the LORD: 4:6 And he shall turn the
194
- heart of the fathers to the children, and the heart of the children to
195
- their fathers, lest I come and smite the earth with a curse.
196
-
197
-
198
- ***
199
-
200
-
201
-
202
-
203
- The New Testament of the King James Bible
204
-
205
-
206
-
207
-
208
- The Gospel According to Saint Matthew
209
-
210
-
211
- 1:1 The book of the generation of Jesus Christ, the son of David, the
212
- son of Abraham.
213
-
214
-