georgia 0.7.2 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aca6c1088ccbab0f52eff3ed79cd151ca4820787
4
- data.tar.gz: 5276e31dc6309e9f8f26d604bf5e37b7e825b3f7
3
+ metadata.gz: cd1a27f515ca78cc69f58d4e59d1feb142d67075
4
+ data.tar.gz: 78a2a2a4ec57a76be7f9ccc0e9039894e4ccac17
5
5
  SHA512:
6
- metadata.gz: 9e9bdc07d844634e0a21b5130e7ae416dbb2c0fa9461267fa8f7b33b3ec8dd9afbf5cd1c7cd9068b66da56a343ab03cd82f4dbbc1c9b34fce9c270fab0ddd39f
7
- data.tar.gz: 67f8b0f80832d20262f96b25312eb5329baf56de508b02016f4846208ea336575114d6e69f19e2b045f12855da8c4f1975882611b0a211eb7b85faa993369496
6
+ metadata.gz: ba641378b4d8279b895669a966df089b3cf9b19ec412b1257390cfc834479bf0b92c9d7c8103c052645ab93a580ec0dcf3eb9225a6401697a4cfd2559f7f1692
7
+ data.tar.gz: 6b97374a1349361749d00cb58dfbc7cd75e51f856b64c388ee7a01995fbc2d9ca728dc4bf03590326ca23f06b2a4ddcd5469d2f1597aa8e912ec7a2cf8cd58c3
data/README.md CHANGED
@@ -1,6 +1,33 @@
1
1
  ## Georgia
2
2
 
3
- This project rocks and uses MIT-LICENSE.
3
+ [![Gem Version](https://badge.fury.io/rb/georgia.png)](http://badge.fury.io/rb/georgia)
4
+ [![Build Status](https://travis-ci.org/georgia-cms/georgia.png?branch=master)](https://travis-ci.org/georgia-cms/georgia)
5
+ [![Code Climate](https://codeclimate.com/github/georgia-cms/georgia.png)](https://codeclimate.com/github/georgia-cms/georgia)
6
+
7
+ Rails. Engine. CMS. Plug-and-play content management system for Ruby on Rails. Have a peak at the [demo](http://sorrynodemoyet.com/i-promise-it-s-on-its-way).
8
+
9
+ ### Features
10
+
11
+ * Media library on the cloud
12
+ * Spam filter on emails
13
+ * Multilingual from the get-go
14
+ * Review & Preview before publishing
15
+ * Rollback to previous revisions
16
+ * Great UI, nice search, gravatars
17
+ * Editable menus
18
+ * Extendable
19
+ * Widgets
20
+ * Slides
21
+ * Permission levels
22
+
23
+ ### Why? aka Comparison with refinerycms
24
+
25
+ * Because diversity is good.
26
+ * Because Georgia is a Rails Engine. You can add to an existing application.
27
+ * Because it's prettier.
28
+ * Because the guys on refinerycms did a great job and you should check them out.
29
+ * Because it's easy to start a website and push to Heroku.
30
+ * Rails 4 compatible.. almost.
4
31
 
5
32
  ### Getting started
6
33
 
@@ -16,7 +43,7 @@ Then run the generator to mount routes, run migrations & setup initial instances
16
43
 
17
44
  Start your server (`rails server`) and go to [http://localhost:3000/admin](http://localhost:3000/admin) to get started.
18
45
 
19
- #### Heroku
46
+ ### Heroku
20
47
 
21
48
  You will need certain addons to make it work. I suggest going with this list matching Georgia's default tools:
22
49
 
@@ -35,9 +62,6 @@ Finally, create your indices with these commands:
35
62
 
36
63
  For more information, you can also follow these [instructions](https://gist.github.com/nz/2041121) to setup bonsai.io. More [here](https://devcenter.heroku.com/articles/bonsai) on heroku.com
37
64
 
38
- ### Testing
65
+ ### Spam filtering
39
66
 
40
- #### Run rspec
41
-
42
- cd spec/dummy
43
- rspec spec
67
+ TODO
data/Rakefile CHANGED
@@ -20,8 +20,6 @@ RDoc::Task.new(:rdoc) do |rdoc|
20
20
  rdoc.rdoc_files.include('lib/**/*.rb')
21
21
  end
22
22
 
23
-
24
-
25
-
26
23
  Bundler::GemHelper.install_tasks
27
-
24
+ APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
25
+ load 'rails/tasks/engine.rake'
@@ -1,3 +1,4 @@
1
+ # TODO: Move to Georgia::Indexer
1
2
  module Georgia
2
3
  module Api
3
4
  class TagsController < Georgia::ApplicationController
@@ -11,17 +11,8 @@ module Georgia
11
11
 
12
12
  def search
13
13
  @asset = Ckeditor::Asset.new
14
- session[:search_params] = params
15
- @search = Ckeditor::Asset.search do
16
- fulltext params[:query] do
17
- fields(:filename, :tags)
18
- end
19
- with(:extension, params[:e]) unless params[:e].blank?
20
- with(:tags).any_of(params[:tg]) unless params[:tg].blank?
21
- order_by (params[:o] || :updated_at), (params[:dir] || :desc)
22
- paginate(page: params[:page], per_page: (params[:per] || 8))
23
- end
24
- @assets = Ckeditor::AssetDecorator.decorate_collection(@search.results)
14
+ @results = Georgia::Indexer.adapter.search(Ckeditor::Asset, params)
15
+ @assets = Ckeditor::AssetDecorator.decorate_collection(@results)
25
16
  end
26
17
 
27
18
  def create
@@ -18,5 +18,5 @@
18
18
  </header>
19
19
 
20
20
  <%= content_for :footer do %>
21
- <%= render 'georgia/shared/modals/page' %>
21
+ <%= render 'georgia/shared/modals/page' if can?(:create, model) %>
22
22
  <% end -%>
@@ -10,12 +10,4 @@ ActsAsTaggableOn.remove_unused_tags = true
10
10
  # ActsAsTaggableOn.force_parameterize = true
11
11
 
12
12
  # If you would like tags to be case-sensitive and not use LIKE queries for creation:
13
- # ActsAsTaggableOn.strict_case_match = true
14
-
15
- if defined?(Sunspot)
16
- ActsAsTaggableOn::Tag.class_eval do
17
- searchable do
18
- text :name
19
- end
20
- end
21
- end
13
+ # ActsAsTaggableOn.strict_case_match = true
@@ -0,0 +1,17 @@
1
+ module Georgia
2
+ module Indexer
3
+ module Solr
4
+ module ActsAsTaggableOn
5
+ module Tag
6
+ def self.extended(base)
7
+ base.class_eval do
8
+ searchable do
9
+ text :name
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -21,10 +21,23 @@ module Georgia
21
21
  size / 1024 # gives size in KB
22
22
  end
23
23
  end
24
+
25
+ def self.search_index model, params
26
+ @search = model.search do
27
+ fulltext params[:query] do
28
+ fields(:filename, :tags)
29
+ end
30
+ with(:extension, params[:e]) unless params[:e].blank?
31
+ with(:tags).any_of(params[:tg]) unless params[:tg].blank?
32
+ order_by (params[:o] || :updated_at), (params[:dir] || :desc)
33
+ paginate(page: params[:page], per_page: (params[:per] || 8))
34
+ end
35
+ end
24
36
  end
25
37
  end
26
38
  end
27
39
  end
28
40
  end
29
41
  end
30
- end
42
+ end
43
+
@@ -1,8 +1,23 @@
1
+ require 'sunspot_rails'
1
2
  require 'georgia/indexer/solr/georgia/page'
2
3
  require 'georgia/indexer/solr/georgia/message'
3
4
  require 'georgia/indexer/solr/ckeditor/asset'
5
+ require 'georgia/indexer/solr/acts_as_taggable_on/tag'
4
6
 
5
7
  module Georgia::Indexer
6
8
  class SolrAdapter < Adapter
9
+
10
+ def initialize
11
+ extend_models
12
+ end
13
+
14
+ private
15
+
16
+ def extend_models
17
+ ::Georgia::Page.send(:extend, Georgia::Indexer::Solr::Georgia::Page)
18
+ ::Georgia::Message.send(:extend, Georgia::Indexer::Solr::Georgia::Message)
19
+ ::Ckeditor::Asset.send(:extend, Georgia::Indexer::Solr::Ckeditor::Asset)
20
+ ::ActsAsTaggableOn::Tag.send(:extend, Georgia::Indexer::Solr::ActsAsTaggableOn::Tag)
21
+ end
7
22
  end
8
23
  end
@@ -17,8 +17,17 @@ module Georgia
17
17
  indexes :updated_at, :type => 'date'
18
18
  end
19
19
 
20
- def self.search_index model, params
21
- model.search(params[:query], page: (params[:page] || 1))
20
+ def self.search model, params
21
+ model.tire.search(page: (params[:page] || 1), per_page: (params[:per] || 8)) do
22
+ if params[:query].present?
23
+ query do
24
+ boolean do
25
+ must { string params[:query], default_operator: "AND" }
26
+ end
27
+ end
28
+ sort { by (params[:o] || :updated_at), (params[:dir] || :desc) }
29
+ end
30
+ end.results
22
31
  end
23
32
  end
24
33
  end
@@ -1,3 +1,4 @@
1
+ require 'tire'
1
2
  require 'georgia/indexer/tire/georgia/page'
2
3
  require 'georgia/indexer/tire/georgia/message'
3
4
  require 'georgia/indexer/tire/ckeditor/asset'
@@ -1,3 +1,3 @@
1
1
  module Georgia
2
- VERSION = "0.7.2"
2
+ VERSION = "0.7.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: georgia
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mathieu Gagné
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-24 00:00:00.000000000 Z
11
+ date: 2014-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -810,6 +810,7 @@ files:
810
810
  - lib/georgia/indexer/tire/ckeditor/asset.rb
811
811
  - lib/georgia/indexer/solr/georgia/page.rb
812
812
  - lib/georgia/indexer/solr/georgia/message.rb
813
+ - lib/georgia/indexer/solr/acts_as_taggable_on/tag.rb
813
814
  - lib/georgia/indexer/solr/ckeditor/asset.rb
814
815
  - lib/georgia/indexer/adapter.rb
815
816
  - MIT-LICENSE