Skip to content

Commit

Permalink
CMS v3.5.x compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
peakpg committed May 22, 2012
1 parent a5da4fd commit 603c469
Show file tree
Hide file tree
Showing 68 changed files with 18,082 additions and 308 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Expand Up @@ -9,4 +9,7 @@ db/schema.rb
tmp/restart.txt
public/cache
.idea/*
Gemfile.lock
Gemfile.lock
test/dummy/.sass-cache
test/dummy/public/cache
test/dummy/tmp/cache
2 changes: 1 addition & 1 deletion .rvmrc
@@ -1 +1 @@
rvm use 1.9.2@rails3.0
rvm use 1.9.3@r3.2
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -2,6 +2,6 @@ source 'http://rubygems.org'

gemspec

gem "mysql2", '0.2.18'
gem "mysql2"
gem "mocha", '0.9.12', :group => :test, :require=>false

42 changes: 36 additions & 6 deletions Rakefile
@@ -1,10 +1,40 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
#!/usr/bin/env rake
begin
require 'bundler/setup'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end
begin
require 'rdoc/task'
rescue LoadError
require 'rdoc/rdoc'
require 'rake/rdoctask'
RDoc::Task = Rake::RDocTask
end

RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'BcmsGoogleMiniSearch'
rdoc.options << '--line-numbers'
rdoc.rdoc_files.include('README.rdoc')
rdoc.rdoc_files.include('lib/**/*.rb')
end

APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
load 'rails/tasks/engine.rake'

require File.expand_path('../config/application', __FILE__)
require 'rake'

BcmsGoogleMiniSearch::Application.load_tasks

require 'bundler'
Bundler::GemHelper.install_tasks

require 'rake/testtask'

Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.libs << 'test'
t.pattern = 'test/**/*_test.rb'
t.verbose = false
end


task :default => :test
Empty file.
15 changes: 15 additions & 0 deletions app/assets/javascripts/bcms_google_mini_search/application.js
@@ -0,0 +1,15 @@
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
//= require jquery
//= require jquery_ujs
//= require_tree .
13 changes: 13 additions & 0 deletions app/assets/stylesheets/bcms_google_mini_search/application.css
@@ -0,0 +1,13 @@
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*= require_self
*= require_tree .
*/
@@ -0,0 +1,4 @@
module BcmsGoogleMiniSearch
class ApplicationController < ActionController::Base
end
end
4 changes: 4 additions & 0 deletions app/helpers/bcms_google_mini_search/application_helper.rb
@@ -0,0 +1,4 @@
module BcmsGoogleMiniSearch
module ApplicationHelper
end
end
2 changes: 1 addition & 1 deletion app/portlets/google_mini_search_engine_portlet.rb
@@ -1,4 +1,4 @@
class GoogleMiniSearchEnginePortlet < Portlet
class GoogleMiniSearchEnginePortlet < Cms::Portlet

enable_template_editor true

Expand Down
2 changes: 1 addition & 1 deletion app/portlets/search_box_portlet.rb
@@ -1,4 +1,4 @@
class SearchBoxPortlet < Portlet
class SearchBoxPortlet < Cms::Portlet

def render
@search_engine = GoogleMiniSearchEnginePortlet.find_by_name(@portlet.search_engine_name)
Expand Down
17 changes: 0 additions & 17 deletions app/views/layouts/templates/default.html.erb.html.erb

This file was deleted.

Expand Up @@ -24,7 +24,7 @@ For '<%= @results.query %>', found <%= @results.results_count %> results. <br/>
<ul class="search_results">
<% @results.each do |result|%>
<li>
<%= result.number %> <%= link_to result.title, result.url, :class=>"search_result_title" %><br />
<%= result.number %> <%= link_to result.title.try(:html_safe), result.url, :class=>"search_result_title" %><br />
<span class="search_result_description"><%= result.description.try(:html_safe) %></span> <br />
<span class="search_result_url"><%= result.url %></span> -
<span class="search_result_size"><%= result.size %></span>
Expand Down
2 changes: 1 addition & 1 deletion app/views/portlets/search_box/render.html.erb
@@ -1,4 +1,4 @@
<% form_tag @search_engine.path, :method=>'GET' do %>
<%= form_tag @search_engine.path, :method=>'GET' do %>
<%= text_field_tag 'query', params[:query] %>
<%= submit_tag 'Go' %>
<% end %>
21 changes: 10 additions & 11 deletions bcms_google_mini_search.gemspec
Expand Up @@ -14,20 +14,19 @@ Gem::Specification.new do |s|
"README.markdown"
]
s.rdoc_options = ["--charset=UTF-8"]
s.rubyforge_project = "bcms_google_mini_search"
s.rubyforge_project = s.name

s.files = `git ls-files`.split("\n")
# Exclude files required for the 'dummy' Rails app
s.files -= Dir['config/**/*', 'public/**/*', 'config.ru', 'db/**/*', 'script/**/*',
'app/controllers/application_controller.rb',
'app/helpers/application_helper.rb',
'app/layouts/templates/**/*'
s.files = Dir["{app,config,db,lib}/**/*"]
s.files += Dir["app/**/*"]
s.files += Dir["config/**/*"]
s.files += Dir["db/**/*"]
s.files += Dir["lib/**/*"]
s.files += Dir["Gemfile", "LICENSE.txt", "COPYRIGHT.txt", "GPL.txt", "release_notes.txt" ]

]
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.test_files += Dir["test/**/*"]
s.test_files -= Dir['test/dummy/**/*']
s.require_paths = ["lib"]
s.add_dependency(%q<browsercms>, ["~> 3.3.0"])
s.add_dependency("browsercms", "< 3.6.0", ">= 3.5.0.rc2")
end


14 changes: 0 additions & 14 deletions config/boot.rb

This file was deleted.

62 changes: 1 addition & 61 deletions config/routes.rb
@@ -1,62 +1,2 @@
BcmsGoogleMiniSearch::Application.routes.draw do
routes_for_bcms_google_mini_search

routes_for_browser_cms

# The priority is based upon order of creation:
# first created -> highest priority.

# Sample of regular route:
# match 'products/:id' => 'catalog#view'
# Keep in mind you can assign values other than :controller and :action

# Sample of named route:
# match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
# This route can be invoked with purchase_url(:id => product.id)

# Sample resource route (maps HTTP verbs to controller actions automatically):
# resources :products

# Sample resource route with options:
# resources :products do
# member do
# get 'short'
# post 'toggle'
# end
#
# collection do
# get 'sold'
# end
# end

# Sample resource route with sub-resources:
# resources :products do
# resources :comments, :sales
# resource :seller
# end

# Sample resource route with more complex sub-resources
# resources :products do
# resources :comments
# resources :sales do
# get 'recent', :on => :collection
# end
# end

# Sample resource route within a namespace:
# namespace :admin do
# # Directs /admin/products/* to Admin::ProductsController
# # (app/controllers/admin/products_controller.rb)
# resources :products
# end

# You can have the root of your site routed with "root"
# just remember to delete public/index.html.
# root :to => "welcome#index"

# See how all your routes lay out with "rake routes"

# This is a legacy wild controller route that's not recommended for RESTful applications.
# Note: This route will make all actions in every controller accessible via GET requests.
# match ':controller(/:action(/:id(.:format)))'
BcmsGoogleMiniSearch::Engine.routes.draw do
end
9 changes: 0 additions & 9 deletions db/migrate/20091109175123_browsercms_3_0_5.rb

This file was deleted.

4 changes: 4 additions & 0 deletions lib/tasks/bcms_google_mini_search_tasks.rake
@@ -0,0 +1,4 @@
# desc "Explaining what the task does"
# task :bcms_google_mini_search do
# # Task goes here
# end
5 changes: 5 additions & 0 deletions release_notes.txt
@@ -1,3 +1,8 @@
v1.4.0
======

* Make compatible with CMS v3.5.x

v1.3.1
======

Expand Down
8 changes: 5 additions & 3 deletions script/rails
@@ -1,6 +1,8 @@
#!/usr/bin/env ruby
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.

APP_PATH = File.expand_path('../../config/application', __FILE__)
require File.expand_path('../../config/boot', __FILE__)
require 'rails/commands'
ENGINE_ROOT = File.expand_path('../..', __FILE__)
ENGINE_PATH = File.expand_path('../../lib/bcms_google_mini_search/engine', __FILE__)

require 'rails/all'
require 'rails/engine/commands'
7 changes: 7 additions & 0 deletions test/bcms_google_mini_search_test.rb
@@ -0,0 +1,7 @@
require 'test_helper'

class BcmsGoogleMiniSearchTest < ActiveSupport::TestCase
test "truth" do
assert_kind_of Module, BcmsGoogleMiniSearch
end
end

0 comments on commit 603c469

Please sign in to comment.