sunspot_padrino 0.1.0 → 0.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9afd03f8cd7b011bfe02a63f39779fa082ad253d
4
- data.tar.gz: 8aec5a2fc5925f7e28f55a672b9809eb2223b5a5
3
+ metadata.gz: 5619c6bf801dffdfe2d404c93c808531971ccd00
4
+ data.tar.gz: 0357049bc3f1676cf04b7075057ee4eac23b8a01
5
5
  SHA512:
6
- metadata.gz: db929029d01de3f2f157509be0f55f2d7f906552ae1fad450045416587c65f157001cfced346a49e0fe08ad10ab9b224d48782a0fc40cdf54d42e23ec8423370
7
- data.tar.gz: 31632484fe9f8c858d68b5da3d0bc0bd6b869fc80d56df895e395b790f4e42f0351f2545d4c1199537df04f1e3929485db2ead3aa1b9af7b82ff7d08c26f0c8a
6
+ metadata.gz: 9b53351a0776a78418f226b4a92500e0706799951f82fa02edadb32f263ed442191bb0b4de801a6a1fea5fe42500d06ab3a0dd5f0961ec09b268b02caacf0325
7
+ data.tar.gz: 05b43bf0b9ebab34da5b68ef7df22e46c12dfe50b6c09d925b4dcee4e6162a7c8ae5aea487cda65bd8e8876b4c5f1fa039af03c00c3798614d0bf80eaa936bb5
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -6,8 +6,8 @@ require File.join(File.dirname(__FILE__), 'padrino', 'searchable')
6
6
 
7
7
  module Sunspot #:nodoc:
8
8
  module Padrino #:nodoc:
9
- autoload :SolrInstrumentation, File.join(File.dirname(__FILE__), 'padrino', 'solr_instrumentation')
10
9
  autoload :StubSessionProxy, File.join(File.dirname(__FILE__), 'padrino', 'stub_session_proxy')
10
+
11
11
  begin
12
12
  require 'sunspot_solr'
13
13
  autoload :Server, File.join(File.dirname(__FILE__), 'padrino', 'server')
@@ -1,6 +1,10 @@
1
- require 'padrino-core/tasks'
2
- require 'padrino-gen/command'
3
- require 'padrino-core/cli/rake'
1
+ begin
2
+ require 'padrino-core/tasks'
3
+ require 'padrino-gen/command'
4
+ require 'padrino-core/cli/rake'
5
+ rescue LoadError
6
+ # Totally okay if these can't load.
7
+ end
4
8
 
5
9
  Sunspot.session = Sunspot::Padrino.build_session
6
10
  Sunspot::Adapters::InstanceAdapter.register(Sunspot::Padrino::Adapters::ActiveRecordInstanceAdapter, ActiveRecord::Base)
@@ -7,8 +7,7 @@ end
7
7
  require 'sunspot/padrino'
8
8
  require 'sunspot/padrino/init'
9
9
 
10
- # Add our generators to Padrino::Generators.
11
- Padrino::Generators.load_paths << Dir[File.dirname(__FILE__) + '/../generators/*.rb']
12
-
13
- # Add our tasks to padrino-core.
14
- Padrino::Tasks.files << File.dirname(__FILE__) + '/sunspot/padrino/tasks.rb'
10
+ if defined? Padrino::Tasks
11
+ # Add our tasks to padrino-core.
12
+ Padrino::Tasks.files << File.dirname(__FILE__) + '/sunspot/padrino/cli/tasks.rb'
13
+ end
@@ -0,0 +1,74 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "sunspot_padrino"
8
+ s.version = "0.1.1"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Jordan Yaker", "Supportify, Inc."]
12
+ s.date = "2015-05-08"
13
+ s.description = " Sunspot::Padrino is a derived plugin that provides drop-in integration of the\n Sunspot Solr search library with Padrino. It is based on the original Sunspot\n ::Rails library located at https://github.com/sunspot/sunspot.\n"
14
+ s.email = "help@supportify.io"
15
+ s.extra_rdoc_files = [
16
+ "LICENSE.txt",
17
+ "README.md"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ ".rspec",
22
+ "Gemfile",
23
+ "Gemfile.lock",
24
+ "LICENSE.txt",
25
+ "README.md",
26
+ "Rakefile",
27
+ "VERSION",
28
+ "generators/sunspot.rb",
29
+ "generators/templates/sunspot.yml",
30
+ "lib/sunspot/padrino.rb",
31
+ "lib/sunspot/padrino/adapters.rb",
32
+ "lib/sunspot/padrino/cli/tasks.rb",
33
+ "lib/sunspot/padrino/configuration.rb",
34
+ "lib/sunspot/padrino/init.rb",
35
+ "lib/sunspot/padrino/rspec/spec_helper.rb",
36
+ "lib/sunspot/padrino/searchable.rb",
37
+ "lib/sunspot/padrino/server.rb",
38
+ "lib/sunspot/padrino/stub_session_proxy.rb",
39
+ "lib/sunspot_padrino.rb",
40
+ "spec/spec_helper.rb",
41
+ "spec/sunspot_padrino_spec.rb",
42
+ "sunspot_padrino.gemspec"
43
+ ]
44
+ s.homepage = "http://github.com/supportify/sunspot_padrino"
45
+ s.licenses = ["BSD"]
46
+ s.require_paths = ["lib"]
47
+ s.rubygems_version = "2.0.6"
48
+ s.summary = "Padrino integration for the Sunspot Solr search library"
49
+
50
+ if s.respond_to? :specification_version then
51
+ s.specification_version = 4
52
+
53
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
54
+ s.add_development_dependency(%q<rspec>, ["~> 2.8.0"])
55
+ s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
56
+ s.add_development_dependency(%q<bundler>, ["~> 1.0"])
57
+ s.add_development_dependency(%q<jeweler>, ["~> 2.0.1"])
58
+ s.add_development_dependency(%q<simplecov>, [">= 0"])
59
+ else
60
+ s.add_dependency(%q<rspec>, ["~> 2.8.0"])
61
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
62
+ s.add_dependency(%q<bundler>, ["~> 1.0"])
63
+ s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
64
+ s.add_dependency(%q<simplecov>, [">= 0"])
65
+ end
66
+ else
67
+ s.add_dependency(%q<rspec>, ["~> 2.8.0"])
68
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
69
+ s.add_dependency(%q<bundler>, ["~> 1.0"])
70
+ s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
71
+ s.add_dependency(%q<simplecov>, [">= 0"])
72
+ end
73
+ end
74
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sunspot_padrino
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan Yaker
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-05-19 00:00:00.000000000 Z
12
+ date: 2015-05-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -104,18 +104,17 @@ files:
104
104
  - generators/templates/sunspot.yml
105
105
  - lib/sunspot/padrino.rb
106
106
  - lib/sunspot/padrino/adapters.rb
107
+ - lib/sunspot/padrino/cli/tasks.rb
107
108
  - lib/sunspot/padrino/configuration.rb
108
109
  - lib/sunspot/padrino/init.rb
109
- - lib/sunspot/padrino/request_lifecycle.rb
110
+ - lib/sunspot/padrino/rspec/spec_helper.rb
110
111
  - lib/sunspot/padrino/searchable.rb
111
112
  - lib/sunspot/padrino/server.rb
112
- - lib/sunspot/padrino/solr_instrumentation.rb
113
- - lib/sunspot/padrino/spec_helper.rb
114
113
  - lib/sunspot/padrino/stub_session_proxy.rb
115
- - lib/sunspot/padrino/tasks.rb
116
114
  - lib/sunspot_padrino.rb
117
115
  - spec/spec_helper.rb
118
116
  - spec/sunspot_padrino_spec.rb
117
+ - sunspot_padrino.gemspec
119
118
  homepage: http://github.com/supportify/sunspot_padrino
120
119
  licenses:
121
120
  - BSD
@@ -1,36 +0,0 @@
1
- module Sunspot #:nodoc:
2
- module Padrino #:nodoc:
3
- #
4
- # This module adds an after_filter to ActionController::Base that commits
5
- # the Sunspot session if any documents have been added, changed, or removed
6
- # in the course of the request.
7
- #
8
- module RequestLifecycle
9
- class <<self
10
- def included(base) #:nodoc:
11
- subclasses = base.subclasses.map do |subclass|
12
- begin
13
- subclass.constantize
14
- rescue NameError
15
- end
16
- end.compact
17
- loaded_controllers = [base].concat(subclasses)
18
- # Depending on how Sunspot::Padrino is loaded, there may already be
19
- # controllers loaded into memory that subclass this controller. In
20
- # this case, since after_filter uses the inheritable_attribute
21
- # structure, the already-loaded subclasses don't get the filters. So,
22
- # the below ensures that all loaded controllers have the filter.
23
- loaded_controllers.each do |controller|
24
- controller.after do
25
- if Sunspot::Padrino.configuration.auto_commit_after_request?
26
- Sunspot.commit_if_dirty
27
- elsif Sunspot::Padrino.configuration.auto_commit_after_delete_request?
28
- Sunspot.commit_if_delete_dirty
29
- end
30
- end
31
- end
32
- end
33
- end
34
- end
35
- end
36
- end
@@ -1,21 +0,0 @@
1
- module Sunspot
2
- module Padrino
3
- module SolrInstrumentation
4
- extend ActiveSupport::Concern
5
-
6
- included do
7
- alias_method_chain :send_and_receive, :as_instrumentation
8
- end
9
-
10
-
11
- def send_and_receive_with_as_instrumentation(path, opts)
12
- parameters = (opts[:params] || {})
13
- parameters.merge!(opts[:data]) if opts[:data].is_a? Hash
14
- payload = {:path => path, :parameters => parameters}
15
- ActiveSupport::Notifications.instrument("request.rsolr", payload) do
16
- send_and_receive_without_as_instrumentation(path, opts)
17
- end
18
- end
19
- end
20
- end
21
- end