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.
@@ -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
@@ -1,3 +1,3 @@
1
- .DS_Store
1
+ .DS_Store
2
2
  Gemfile.lock
3
3
  spec/dummy
@@ -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 'http://rubygems.org'
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- gem 'refinerycms', '~> 2.0.0'
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.0.0'
9
- gem 'guard-rspec', '~> 0.6.0'
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
- platforms :mswin, :mingw do
25
- gem 'win32console'
26
- gem 'rb-fchange', '~> 0.0.5'
27
- gem 'rb-notifu', '~> 0.0.4'
28
- end
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
- unless ENV['TRAVIS']
35
- require 'rbconfig'
36
- if RbConfig::CONFIG['target_os'] =~ /darwin/i
37
- gem 'rb-fsevent', '>= 0.3.9'
38
- gem 'ruby_gntp'
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
- platforms :jruby do
49
- unless ENV['TRAVIS']
50
- require 'rbconfig'
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
- gem 'jquery-rails'
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
@@ -17,3 +17,5 @@ Refinery::Testing::Railtie.load_tasks
17
17
  Refinery::Testing::Railtie.load_dummy_tasks(ENGINE_PATH)
18
18
 
19
19
  load File.expand_path('../tasks/rspec.rake', __FILE__)
20
+
21
+ task :default => :spec
@@ -6,7 +6,11 @@ module Refinery
6
6
  end
7
7
 
8
8
  def result_type(result)
9
- result.class.to_s.titleize.gsub('Refinery/', '').gsub '/', '::'
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
@@ -19,4 +19,4 @@
19
19
  </ul>
20
20
  <% end %>
21
21
 
22
- <%= render :partial => "/refinery/content_page" %>
22
+ <%= render "/refinery/content_page" %>
@@ -0,0 +1,10 @@
1
+ ja:
2
+ refinery:
3
+ plugins:
4
+ refinerycms_search:
5
+ title: '検索'
6
+ description: 'Refinery CMS の検索プラグイン'
7
+ search:
8
+ show:
9
+ search_results_for: '"%{what}"の検索結果'
10
+ no_results_for: '"%{what}"に一致するものが見付かりませんでした。'
@@ -1,4 +1,5 @@
1
1
  require "refinerycms-core"
2
+ require 'refinerycms-acts-as-indexed'
2
3
 
3
4
  module Refinery
4
5
  autoload :SearchGenerator, 'generators/refinery/search_generator'
@@ -9,7 +9,6 @@ module Refinery
9
9
  initializer "register refinery_search plugin" do
10
10
  Refinery::Plugin.register do |plugin|
11
11
  plugin.name = 'refinery_search'
12
- plugin.version = 2.0
13
12
  plugin.hide_from_menu = true
14
13
  end
15
14
  end
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](http://github.com/dougal/acts_as_indexed) - Check his readme and documentation for more info on how it works.
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.0.0'
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
+ ```
@@ -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.0.0}
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 = ["Uģis Ozols", "Joe Sak", "Philip Arndt"]
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.4'
17
+ s.add_dependency 'refinerycms-core', '~> 2.1.0'
18
+ s.add_dependency 'refinerycms-acts-as-indexed', '~> 1.0.0'
17
19
  end
@@ -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
- def setup_environment
8
- # Configure Rails Environment
9
- ENV["RAILS_ENV"] ||= 'test'
7
+ # Configure Rails Environment
8
+ ENV["RAILS_ENV"] ||= 'test'
10
9
 
11
- require File.expand_path("../dummy/config/environment", __FILE__)
10
+ require File.expand_path("../dummy/config/environment", __FILE__)
12
11
 
13
- require 'rspec/rails'
14
- require 'capybara/rspec'
12
+ require 'rspec/rails'
13
+ require 'capybara/rspec'
15
14
 
16
- Rails.backtrace_cleaner.remove_silencers!
15
+ Rails.backtrace_cleaner.remove_silencers!
17
16
 
18
- RSpec.configure do |config|
19
- config.mock_with :rspec
20
- config.treat_symbols_as_metadata_keys_with_true_values = true
21
- config.filter_run :focus => true
22
- config.run_all_when_everything_filtered = true
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
- def each_run
30
- Rails.cache.clear
31
- ActiveSupport::Dependencies.clear
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
- # If spork is available in the Gemfile it'll be used but we don't force it.
44
- unless (begin; require 'spork'; rescue LoadError; nil end).nil?
45
- Spork.prefork do
46
- # Loading more in this block will cause your tests to run faster. However,
47
- # if you change any configuration or code from libraries loaded here, you'll
48
- # need to restart spork for it take effect.
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.0.0
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: 2012-12-03 00:00:00.000000000 Z
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: 2.0.4
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: 2.0.4
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.8.24
95
+ rubygems_version: 2.1.0
86
96
  signing_key:
87
- specification_version: 3
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