refinerycms-search 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -1
- data/.travis.yml +4 -5
- data/Gemfile +25 -39
- data/Rakefile +2 -0
- data/app/helpers/refinery/search_helper.rb +5 -1
- data/app/views/refinery/search/show.html.erb +1 -1
- data/config/locales/ja.yml +10 -0
- data/lib/refinery/search.rb +1 -0
- data/lib/refinery/search/engine.rb +0 -1
- data/readme.md +14 -2
- data/refinerycms-search.gemspec +6 -4
- data/spec/spec_helper.rb +20 -45
- metadata +25 -15
- data/Guardfile +0 -20
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2dcb6db86cef21a0525029b1369d7ea9688031b1
|
4
|
+
data.tar.gz: 170dea540b44c912704494c5eab92366f69cbb7c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0bb126636386508a6a8b8fb018bd22b81204d9a188778daf8e39578e3510168eca20f4f9c5c5e3c321eebaf7af456cf1fa395b1a78c7f7a501fe4f691242609a
|
7
|
+
data.tar.gz: 05a516165cf4144536d7ced096522b9a4719d24e6b1ff674cc658b3a18f726a5b6c0418545e7832309f6bcae72323ab15e232979178425e5118bc7084242246b
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
language: ruby
|
2
|
+
cache: bundler
|
2
3
|
before_install:
|
3
4
|
- 'if [[ "$TRAVIS_RUBY_VERSION" =~ "jruby" ]] ; then gem update --system ; fi'
|
5
|
+
- gem install bundler
|
6
|
+
install:
|
7
|
+
- bundle install --without development
|
4
8
|
before_script:
|
5
9
|
- "bundle exec rake refinery:testing:dummy_app > /dev/null"
|
6
10
|
script:
|
@@ -22,15 +26,10 @@ env:
|
|
22
26
|
- DB=mysql
|
23
27
|
matrix:
|
24
28
|
allow_failures:
|
25
|
-
- rvm: rbx-18mode
|
26
29
|
- rvm: rbx-19mode
|
27
30
|
- rvm: jruby-19mode
|
28
|
-
- rvm: jruby-18mode
|
29
31
|
rvm:
|
30
32
|
- 2.0
|
31
33
|
- 1.9.3
|
32
|
-
- 1.8.7
|
33
34
|
- rbx-19mode
|
34
35
|
- jruby-19mode
|
35
|
-
- rbx-18mode
|
36
|
-
- jruby-18mode
|
data/Gemfile
CHANGED
@@ -1,12 +1,13 @@
|
|
1
|
-
source '
|
1
|
+
source 'https://rubygems.org'
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
gem 'refinerycms', '~> 2.
|
5
|
+
gem 'refinerycms', '~> 2.1.0'
|
6
|
+
gem 'refinerycms-acts-as-indexed', '~> 1.0.0'
|
6
7
|
|
7
8
|
group :development, :test do
|
8
|
-
gem 'refinerycms-testing', '~> 2.
|
9
|
-
gem '
|
9
|
+
gem 'refinerycms-testing', '~> 2.1.0'
|
10
|
+
gem 'poltergeist'
|
10
11
|
|
11
12
|
platforms :jruby do
|
12
13
|
gem 'activerecord-jdbcsqlite3-adapter'
|
@@ -20,45 +21,27 @@ group :development, :test do
|
|
20
21
|
gem 'mysql2'
|
21
22
|
gem 'pg'
|
22
23
|
end
|
24
|
+
end
|
23
25
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
platforms :ruby do
|
31
|
-
gem 'spork', '~> 0.9.0.rc'
|
32
|
-
gem 'guard-spork'
|
26
|
+
# Database Configuration
|
27
|
+
unless ENV['TRAVIS']
|
28
|
+
gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
|
29
|
+
gem 'sqlite3', :platform => :ruby
|
30
|
+
end
|
33
31
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
end
|
40
|
-
if RbConfig::CONFIG['target_os'] =~ /linux/i
|
41
|
-
gem 'rb-inotify', '>= 0.5.1'
|
42
|
-
gem 'libnotify', '~> 0.1.3'
|
43
|
-
gem 'therubyracer', '~> 0.9.9'
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
32
|
+
if !ENV['TRAVIS'] || ENV['DB'] == 'mysql'
|
33
|
+
gem 'activerecord-jdbcmysql-adapter', :platform => :jruby
|
34
|
+
gem 'jdbc-mysql', '= 5.1.13', :platform => :jruby
|
35
|
+
gem 'mysql2', :platform => :ruby
|
36
|
+
end
|
47
37
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
if RbConfig::CONFIG['target_os'] =~ /darwin/i
|
52
|
-
gem 'ruby_gntp'
|
53
|
-
end
|
54
|
-
if RbConfig::CONFIG['target_os'] =~ /linux/i
|
55
|
-
gem 'rb-inotify', '>= 0.5.1'
|
56
|
-
gem 'libnotify', '~> 0.1.3'
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
38
|
+
if !ENV['TRAVIS'] || ENV['DB'] == 'postgresql'
|
39
|
+
gem 'activerecord-jdbcpostgresql-adapter', :platform => :jruby
|
40
|
+
gem 'pg', :platform => :ruby
|
60
41
|
end
|
61
42
|
|
43
|
+
gem 'jruby-openssl', :platform => :jruby
|
44
|
+
|
62
45
|
# Refinery/rails should pull in the proper versions of these
|
63
46
|
group :assets do
|
64
47
|
gem 'sass-rails'
|
@@ -66,4 +49,7 @@ group :assets do
|
|
66
49
|
gem 'uglifier'
|
67
50
|
end
|
68
51
|
|
69
|
-
|
52
|
+
# Load local gems according to Refinery developer preference.
|
53
|
+
if File.exist? local_gemfile = File.expand_path('../.gemfile', __FILE__)
|
54
|
+
eval File.read(local_gemfile)
|
55
|
+
end
|
data/Rakefile
CHANGED
@@ -6,7 +6,11 @@ module Refinery
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def result_type(result)
|
9
|
-
result.class.
|
9
|
+
if result.class.method_defined?(:friendly_search_name)
|
10
|
+
result.friendly_search_name
|
11
|
+
else
|
12
|
+
result.class.to_s.titleize.split("/").last
|
13
|
+
end
|
10
14
|
end
|
11
15
|
|
12
16
|
# this is where you register your result URLs based on the
|
data/lib/refinery/search.rb
CHANGED
data/readme.md
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
# Search plugin for [Refinery CMS](http://www.refinerycms.com)
|
2
2
|
|
3
|
-
Powered by: [acts_as_indexed](
|
3
|
+
Powered by: [acts_as_indexed](https://github.com/dougal/acts_as_indexed) and [refinerycms-acts-as-indexed](https://github.com/refinery/refinerycms-acts-as-indexed) -
|
4
|
+
Check his readme and documentation for more info on how it works.
|
4
5
|
|
5
6
|
## Installation
|
6
7
|
|
7
8
|
Simply use this by adding the following to your `Gemfile`:
|
8
9
|
|
9
10
|
```ruby
|
10
|
-
gem 'refinerycms-search', '~> 2.
|
11
|
+
gem 'refinerycms-search', '~> 2.1.0'
|
11
12
|
```
|
12
13
|
|
13
14
|
Now, run ``bundle install``
|
@@ -77,3 +78,14 @@ end
|
|
77
78
|
You will need to replace the indexed fields with those appropriate for your model.
|
78
79
|
|
79
80
|
If you wish to override the url used in the search results just add a `url` method to your model and the result of this method will be used instead.
|
81
|
+
|
82
|
+
## Displaying a friendlier name for your model
|
83
|
+
|
84
|
+
Just define the method `friendly_search_name` to override what is displayed
|
85
|
+
for each search result for your model as per [the implementing pull request](https://github.com/refinery/refinerycms-search/pull/38).
|
86
|
+
|
87
|
+
```ruby
|
88
|
+
def friendly_search_name
|
89
|
+
"Document"
|
90
|
+
end
|
91
|
+
```
|
data/refinerycms-search.gemspec
CHANGED
@@ -1,17 +1,19 @@
|
|
1
|
+
# Encoding: UTF-8
|
2
|
+
|
1
3
|
Gem::Specification.new do |s|
|
2
4
|
s.name = %q{refinerycms-search}
|
3
|
-
s.version = %q{2.
|
4
|
-
s.date = "#{Date.today.strftime("%Y-%m-%d")}"
|
5
|
+
s.version = %q{2.1.0}
|
5
6
|
s.summary = %q{Extra search handling for Refinery CMS}
|
6
7
|
s.description = %q{Provides extra functionality for searching your frontend website using Refinery CMS.}
|
7
8
|
s.homepage = %q{http://refinerycms.com}
|
8
9
|
s.email = %q{info@refinerycms.com}
|
9
|
-
s.authors = ["
|
10
|
+
s.authors = ["Philip Arndt", "Uģis Ozols", "Joe Sak"]
|
10
11
|
s.require_paths = %w(lib)
|
11
12
|
s.license = %q{MIT}
|
12
13
|
|
13
14
|
s.files = `git ls-files`.split("\n")
|
14
15
|
s.test_files = `git ls-files -- spec/*`.split("\n")
|
15
16
|
|
16
|
-
s.add_dependency 'refinerycms-core', '~> 2.0
|
17
|
+
s.add_dependency 'refinerycms-core', '~> 2.1.0'
|
18
|
+
s.add_dependency 'refinerycms-acts-as-indexed', '~> 1.0.0'
|
17
19
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -4,56 +4,31 @@ require 'rubygems'
|
|
4
4
|
|
5
5
|
ENGINE_RAILS_ROOT = File.join(File.dirname(__FILE__), '../') unless defined?(ENGINE_RAILS_ROOT)
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
ENV["RAILS_ENV"] ||= 'test'
|
7
|
+
# Configure Rails Environment
|
8
|
+
ENV["RAILS_ENV"] ||= 'test'
|
10
9
|
|
11
|
-
|
10
|
+
require File.expand_path("../dummy/config/environment", __FILE__)
|
12
11
|
|
13
|
-
|
14
|
-
|
12
|
+
require 'rspec/rails'
|
13
|
+
require 'capybara/rspec'
|
15
14
|
|
16
|
-
|
15
|
+
Rails.backtrace_cleaner.remove_silencers!
|
17
16
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
end
|
24
|
-
|
25
|
-
# Set javascript driver for capybara
|
26
|
-
Capybara.javascript_driver = :selenium
|
17
|
+
RSpec.configure do |config|
|
18
|
+
config.mock_with :rspec
|
19
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
20
|
+
config.filter_run :focus => true
|
21
|
+
config.run_all_when_everything_filtered = true
|
27
22
|
end
|
28
23
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
FactoryGirl.reload
|
33
|
-
|
34
|
-
# Requires supporting files with custom matchers and macros, etc,
|
35
|
-
# in ./support/ and its subdirectories including factories.
|
36
|
-
([ENGINE_RAILS_ROOT, Rails.root.to_s].uniq | Refinery::Plugins.registered.pathnames).map{|p|
|
37
|
-
Dir[File.join(p, 'spec', 'support', '**', '*.rb').to_s]
|
38
|
-
}.flatten.sort.each do |support_file|
|
39
|
-
require support_file
|
40
|
-
end
|
41
|
-
end
|
24
|
+
# Set javascript driver for capybara
|
25
|
+
require 'capybara/poltergeist'
|
26
|
+
Capybara.javascript_driver = :poltergeist
|
42
27
|
|
43
|
-
#
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
setup_environment
|
50
|
-
end
|
51
|
-
|
52
|
-
Spork.each_run do
|
53
|
-
# This code will be run each time you run your specs.
|
54
|
-
each_run
|
55
|
-
end
|
56
|
-
else
|
57
|
-
setup_environment
|
58
|
-
each_run
|
28
|
+
# Requires supporting files with custom matchers and macros, etc,
|
29
|
+
# in ./support/ and its subdirectories including factories.
|
30
|
+
([ENGINE_RAILS_ROOT, Rails.root.to_s].uniq | Refinery::Plugins.registered.pathnames).map{|p|
|
31
|
+
Dir[File.join(p, 'spec', 'support', '**', '*.rb').to_s]
|
32
|
+
}.flatten.sort.each do |support_file|
|
33
|
+
require support_file
|
59
34
|
end
|
metadata
CHANGED
@@ -1,34 +1,45 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: refinerycms-search
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
5
|
-
prerelease:
|
4
|
+
version: 2.1.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
7
|
+
- Philip Arndt
|
8
8
|
- Uģis Ozols
|
9
9
|
- Joe Sak
|
10
|
-
- Philip Arndt
|
11
10
|
autorequire:
|
12
11
|
bindir: bin
|
13
12
|
cert_chain: []
|
14
|
-
date:
|
13
|
+
date: 2013-10-22 00:00:00.000000000 Z
|
15
14
|
dependencies:
|
16
15
|
- !ruby/object:Gem::Dependency
|
17
16
|
name: refinerycms-core
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 2.1.0
|
22
|
+
type: :runtime
|
18
23
|
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
26
|
+
- - ~>
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
version: 2.1.0
|
29
|
+
- !ruby/object:Gem::Dependency
|
30
|
+
name: refinerycms-acts-as-indexed
|
19
31
|
requirement: !ruby/object:Gem::Requirement
|
20
32
|
requirements:
|
21
33
|
- - ~>
|
22
34
|
- !ruby/object:Gem::Version
|
23
|
-
version:
|
24
|
-
none: false
|
35
|
+
version: 1.0.0
|
25
36
|
type: :runtime
|
37
|
+
prerelease: false
|
26
38
|
version_requirements: !ruby/object:Gem::Requirement
|
27
39
|
requirements:
|
28
40
|
- - ~>
|
29
41
|
- !ruby/object:Gem::Version
|
30
|
-
version:
|
31
|
-
none: false
|
42
|
+
version: 1.0.0
|
32
43
|
description: Provides extra functionality for searching your frontend website using
|
33
44
|
Refinery CMS.
|
34
45
|
email: info@refinerycms.com
|
@@ -39,7 +50,6 @@ files:
|
|
39
50
|
- .gitignore
|
40
51
|
- .travis.yml
|
41
52
|
- Gemfile
|
42
|
-
- Guardfile
|
43
53
|
- Rakefile
|
44
54
|
- app/controllers/refinery/search_controller.rb
|
45
55
|
- app/helpers/refinery/search_helper.rb
|
@@ -48,6 +58,7 @@ files:
|
|
48
58
|
- app/views/refinery/shared/_search.html.erb
|
49
59
|
- config/locales/bg.yml
|
50
60
|
- config/locales/en.yml
|
61
|
+
- config/locales/ja.yml
|
51
62
|
- config/locales/sk.yml
|
52
63
|
- config/routes.rb
|
53
64
|
- db/migrate/01_create_search_page.rb
|
@@ -64,27 +75,26 @@ files:
|
|
64
75
|
homepage: http://refinerycms.com
|
65
76
|
licenses:
|
66
77
|
- MIT
|
78
|
+
metadata: {}
|
67
79
|
post_install_message:
|
68
80
|
rdoc_options: []
|
69
81
|
require_paths:
|
70
82
|
- lib
|
71
83
|
required_ruby_version: !ruby/object:Gem::Requirement
|
72
84
|
requirements:
|
73
|
-
- -
|
85
|
+
- - '>='
|
74
86
|
- !ruby/object:Gem::Version
|
75
87
|
version: '0'
|
76
|
-
none: false
|
77
88
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
89
|
requirements:
|
79
|
-
- -
|
90
|
+
- - '>='
|
80
91
|
- !ruby/object:Gem::Version
|
81
92
|
version: '0'
|
82
|
-
none: false
|
83
93
|
requirements: []
|
84
94
|
rubyforge_project:
|
85
|
-
rubygems_version: 1.
|
95
|
+
rubygems_version: 2.1.0
|
86
96
|
signing_key:
|
87
|
-
specification_version:
|
97
|
+
specification_version: 4
|
88
98
|
summary: Extra search handling for Refinery CMS
|
89
99
|
test_files:
|
90
100
|
- spec/models/refinery/search_engine_spec.rb
|
data/Guardfile
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
guard 'rspec', :version => 2, :cli => "--color" do
|
2
|
-
watch(%r{^spec/.+_spec\.rb$})
|
3
|
-
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
4
|
-
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
5
|
-
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/controllers/#{m[1]}_#{m[2]}_spec.rb", "spec/requests/#{m[1]}_spec.rb"] }
|
6
|
-
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
|
7
|
-
watch('spec/spec_helper.rb') { "spec" }
|
8
|
-
watch('config/routes.rb') { "spec/routing" }
|
9
|
-
watch('app/controllers/application_controller.rb') { "spec/controllers" }
|
10
|
-
# Capybara request specs
|
11
|
-
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
|
12
|
-
end
|
13
|
-
|
14
|
-
guard 'spork', :wait => 60, :cucumber => false, :rspec_env => { 'RAILS_ENV' => 'test' } do
|
15
|
-
watch('config/application.rb')
|
16
|
-
watch('config/environment.rb')
|
17
|
-
watch(%r{^config/environments/.+\.rb$})
|
18
|
-
watch(%r{^config/initializers/.+\.rb$})
|
19
|
-
watch('spec/spec_helper.rb')
|
20
|
-
end
|