diff --git a/.gitignore b/.gitignore index f5a4e54..04f0c97 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,7 @@ db/schema.rb tmp/restart.txt public/cache .idea/* -Gemfile.lock \ No newline at end of file +Gemfile.lock +test/dummy/.sass-cache +test/dummy/public/cache +test/dummy/tmp/cache \ No newline at end of file diff --git a/.rvmrc b/.rvmrc index 7ab7144..80af506 100644 --- a/.rvmrc +++ b/.rvmrc @@ -1 +1 @@ -rvm use 1.9.2@rails3.0 +rvm use 1.9.3@r3.2 diff --git a/Gemfile b/Gemfile index de985f4..f24ea74 100644 --- a/Gemfile +++ b/Gemfile @@ -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 diff --git a/Rakefile b/Rakefile index 54f7692..02d7493 100644 --- a/Rakefile +++ b/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 diff --git a/app/assets/images/bcms_google_mini_search/.gitkeep b/app/assets/images/bcms_google_mini_search/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/assets/javascripts/bcms_google_mini_search/application.js b/app/assets/javascripts/bcms_google_mini_search/application.js new file mode 100644 index 0000000..9097d83 --- /dev/null +++ b/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 . diff --git a/app/assets/stylesheets/bcms_google_mini_search/application.css b/app/assets/stylesheets/bcms_google_mini_search/application.css new file mode 100644 index 0000000..3b5cc66 --- /dev/null +++ b/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 . +*/ diff --git a/app/controllers/bcms_google_mini_search/application_controller.rb b/app/controllers/bcms_google_mini_search/application_controller.rb new file mode 100644 index 0000000..93bab67 --- /dev/null +++ b/app/controllers/bcms_google_mini_search/application_controller.rb @@ -0,0 +1,4 @@ +module BcmsGoogleMiniSearch + class ApplicationController < ActionController::Base + end +end diff --git a/app/helpers/bcms_google_mini_search/application_helper.rb b/app/helpers/bcms_google_mini_search/application_helper.rb new file mode 100644 index 0000000..eda76ac --- /dev/null +++ b/app/helpers/bcms_google_mini_search/application_helper.rb @@ -0,0 +1,4 @@ +module BcmsGoogleMiniSearch + module ApplicationHelper + end +end diff --git a/app/portlets/google_mini_search_engine_portlet.rb b/app/portlets/google_mini_search_engine_portlet.rb index eabfbea..12d5623 100644 --- a/app/portlets/google_mini_search_engine_portlet.rb +++ b/app/portlets/google_mini_search_engine_portlet.rb @@ -1,4 +1,4 @@ -class GoogleMiniSearchEnginePortlet < Portlet +class GoogleMiniSearchEnginePortlet < Cms::Portlet enable_template_editor true diff --git a/app/portlets/search_box_portlet.rb b/app/portlets/search_box_portlet.rb index 6c5741f..b9809a1 100644 --- a/app/portlets/search_box_portlet.rb +++ b/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) diff --git a/app/views/layouts/templates/default.html.erb.html.erb b/app/views/layouts/templates/default.html.erb.html.erb deleted file mode 100644 index 405758c..0000000 --- a/app/views/layouts/templates/default.html.erb.html.erb +++ /dev/null @@ -1,17 +0,0 @@ - - - - - <%= page_title %> - <%= yield :html_head %> - - - <%= cms_toolbar %> -
- Breadcrumbs: <%= render_breadcrumbs %> - Main Menu: <%= render_menu %> -

<%= page_title %>

- <%= container :main %> -
- - diff --git a/app/views/portlets/google_mini_search_engine/render.html.erb b/app/views/portlets/google_mini_search_engine/render.html.erb index 3cbc55a..5884a5d 100644 --- a/app/views/portlets/google_mini_search_engine/render.html.erb +++ b/app/views/portlets/google_mini_search_engine/render.html.erb @@ -24,7 +24,7 @@ For '<%= @results.query %>', found <%= @results.results_count %> results.