will_filter 3.0.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -3,30 +3,4 @@ source 'http://rubygems.org'
3
3
  gem 'rails', '~> 3.0.0'
4
4
  gem "will_paginate", "~> 3.0.pre2"
5
5
 
6
- # Bundle edge Rails instead:
7
- # gem 'rails', :git => 'git://github.com/rails/rails.git'
8
-
9
6
  # gem 'sqlite3'
10
-
11
- # Use unicorn as the web server
12
- # gem 'unicorn'
13
-
14
- # Deploy with Capistrano
15
- # gem 'capistrano'
16
-
17
- # To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
18
- # gem 'ruby-debug'
19
- # gem 'ruby-debug19', :require => 'ruby-debug'
20
-
21
- # Bundle the extra gems:
22
- # gem 'bj'
23
- # gem 'nokogiri'
24
- # gem 'sqlite3-ruby', :require => 'sqlite3'
25
- # gem 'aws-s3', :require => 'aws/s3'
26
-
27
- # Bundle gems for the local environment. Make sure to
28
- # put test-only gems in this group so their generators
29
- # and rake tasks are available in development mode:
30
- # group :development, :test do
31
- # gem 'webrat'
32
- # end
data/Gemfile.lock CHANGED
@@ -59,6 +59,7 @@ GEM
59
59
  rake (>= 0.8.7)
60
60
  thor (~> 0.14.4)
61
61
  rake (0.9.1)
62
+ sqlite3 (1.3.3)
62
63
  thor (0.14.6)
63
64
  treetop (1.4.9)
64
65
  polyglot (>= 0.3.1)
@@ -69,5 +70,6 @@ PLATFORMS
69
70
  ruby
70
71
 
71
72
  DEPENDENCIES
72
- rails (= 3.0.7)
73
+ rails (~> 3.0.0)
74
+ sqlite3
73
75
  will_paginate (~> 3.0.pre2)
data/README.rdoc CHANGED
@@ -17,7 +17,7 @@ http://github.com/berk/will_filter_examples
17
17
  Add the following gems to your Gemfile:
18
18
 
19
19
  gem "will_paginate", "~> 3.0.pre2"
20
- gem 'will_filter', "0.1.1"
20
+ gem 'will_filter', "~> 3.0.0"
21
21
 
22
22
  And run:
23
23
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.0.0
1
+ 3.0.1
@@ -57,10 +57,11 @@
57
57
  <% results.each_with_index do |obj, index| %>
58
58
  <tr class='data_row <%=(index % 2 == 0) ? "wf_row_even" : "wf_row_odd"%>'>
59
59
  <% opts[:columns].each_with_index do |column, column_index| %>
60
- <%
60
+ <%
61
61
  style = 'padding:3px;'
62
62
  if column.is_a?(Array)
63
63
  key = column.first
64
+
64
65
  if column.second.is_a?(Proc)
65
66
  value = column.second.call(obj)
66
67
  else
@@ -1,13 +1,15 @@
1
1
  # Load the rails application
2
2
  require File.expand_path('../application', __FILE__)
3
3
 
4
- ["../lib/core_ext/**",
5
- "../lib/will_filter",
6
- "../lib/will_filter/containers"].each do |dir|
7
- Dir[File.expand_path("#{File.dirname(__FILE__)}/#{dir}/*.rb")].sort.each do |file|
8
- require file
9
- end
4
+ Rails.configuration.after_initialize do
5
+ ["../lib",
6
+ "../lib/core_ext/**",
7
+ "../lib/will_filter",
8
+ "../lib/will_filter/containers"].each do |dir|
9
+ Dir[File.expand_path("#{File.dirname(__FILE__)}/#{dir}/*.rb")].sort.each do |file|
10
+ require_or_load file
11
+ end
12
+ end
10
13
  end
11
14
 
12
- # Initialize the rails application
13
15
  WillFilter::Application.initialize!
@@ -24,8 +24,8 @@
24
24
  module WillFilter
25
25
  class Calendar
26
26
 
27
- MONTHS = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
28
- DAYS = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat']
27
+ MONTHS = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] unless defined?(MONTHS)
28
+ DAYS = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] unless defined?(DAYS)
29
29
 
30
30
  def initialize(selected_date = nil, start_date = nil, show_time = false, mode = 'month')
31
31
  if selected_date.blank?
@@ -24,7 +24,7 @@
24
24
  module WillFilter
25
25
  module Containers
26
26
  class NumericDelimited < WillFilter::FilterContainer
27
- NUMERIC_DELIMITER = ","
27
+ NUMERIC_DELIMITER = "," unless defined?(NUMERIC_DELIMITER)
28
28
 
29
29
  def self.operators
30
30
  [:is_in]
@@ -24,7 +24,7 @@
24
24
  module WillFilter
25
25
  module Containers
26
26
  class TextDelimited < WillFilter::FilterContainer
27
- TEXT_DELIMITER = ","
27
+ TEXT_DELIMITER = "," unless defined?(TEXT_DELIMITER)
28
28
 
29
29
  def self.operators
30
30
  [:is_in, :is_not_in]
@@ -3,6 +3,22 @@ require "rails"
3
3
 
4
4
  module WillFilter
5
5
  class Engine < Rails::Engine
6
+ config.autoload_paths << File.expand_path("../../lib", __FILE__)
7
+ config.autoload_paths << File.expand_path("../../lib/core_ext/**", __FILE__)
8
+ config.autoload_paths << File.expand_path("../../lib/will_filter", __FILE__)
9
+ config.autoload_paths << File.expand_path("../../lib/will_filter/containers", __FILE__)
10
+
11
+ [
12
+ "../../lib",
13
+ "../../lib/core_ext/**",
14
+ "../../lib/will_filter",
15
+ "../../lib/will_filter/containers"
16
+ ].each do |dir|
17
+ Dir[File.expand_path("#{File.dirname(__FILE__)}/#{dir}/*.rb")].sort.each do |file|
18
+ require(file)
19
+ end
20
+ end
21
+
6
22
  initializer "static assets" do |app|
7
23
  # app.middleware.use ActionDispatch::Static, "#{root}/public" # Old way, does not work in production
8
24
  app.middleware.insert_after ActionDispatch::Static, ActionDispatch::Static, "#{root}/public"
data/lib/will_filter.rb CHANGED
@@ -1,15 +1,3 @@
1
1
  module WillFilter
2
- [
3
- "core_ext/**",
4
- "will_filter",
5
- "will_filter/containers",
6
- "../app/models/will_filter"
7
- ].each do |dir|
8
- Dir[File.expand_path("#{File.dirname(__FILE__)}/#{dir}/*.rb")].sort.each do |file|
9
- require(file)
10
- end
11
- end
12
-
13
- require 'application_helper'
14
-
2
+ require 'will_filter/engine' if defined?(Rails) && Rails::VERSION::MAJOR == 3
15
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: will_filter
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease:
6
6
  segments:
7
7
  - 3
8
8
  - 0
9
- - 0
10
- version: 3.0.0
9
+ - 1
10
+ version: 3.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michael Berkovich
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-06-14 00:00:00 -07:00
18
+ date: 2011-06-22 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency