dusen 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. data/.travis.yml +9 -0
  2. data/README.md +1 -0
  3. data/Rakefile +4 -2
  4. data/lib/dusen/active_record_ext.rb +2 -0
  5. data/lib/dusen/description.rb +2 -0
  6. data/lib/dusen/parser.rb +2 -0
  7. data/lib/dusen/query.rb +2 -0
  8. data/lib/dusen/syntax.rb +2 -0
  9. data/lib/dusen/token.rb +2 -0
  10. data/lib/dusen/util.rb +3 -1
  11. data/lib/dusen/version.rb +3 -1
  12. data/lib/dusen.rb +2 -0
  13. data/spec/rails-2.3/Gemfile +2 -1
  14. data/spec/rails-2.3/app_root/config/boot.rb +2 -0
  15. data/spec/rails-2.3/app_root/config/environment.rb +2 -0
  16. data/spec/rails-2.3/app_root/config/initializers/fix_missing_source_file.rb +1 -0
  17. data/spec/rails-2.3/app_root/config/preinitializer.rb +2 -0
  18. data/spec/rails-2.3/app_root/config/routes.rb +2 -0
  19. data/spec/rails-2.3/{spec_helper.rb → spec/spec_helper.rb} +5 -3
  20. data/spec/rails-3.0/Gemfile +1 -1
  21. data/spec/rails-3.0/app_root/config/application.rb +2 -0
  22. data/spec/rails-3.0/app_root/config/boot.rb +2 -0
  23. data/spec/rails-3.0/app_root/config/environment.rb +2 -0
  24. data/spec/rails-3.0/app_root/config/environments/test.rb +2 -0
  25. data/spec/rails-3.0/app_root/config/initializers/backtrace_silencers.rb +2 -0
  26. data/spec/rails-3.0/app_root/config/initializers/inflections.rb +2 -0
  27. data/spec/rails-3.0/app_root/config/initializers/mime_types.rb +2 -0
  28. data/spec/rails-3.0/app_root/config/initializers/secret_token.rb +2 -0
  29. data/spec/rails-3.0/app_root/config/initializers/session_store.rb +2 -0
  30. data/spec/rails-3.0/app_root/config/routes.rb +2 -0
  31. data/spec/rails-3.0/{spec_helper.rb → spec/spec_helper.rb} +5 -3
  32. data/spec/rails-3.2/Gemfile +1 -1
  33. data/spec/rails-3.2/app_root/config/application.rb +2 -0
  34. data/spec/rails-3.2/app_root/config/boot.rb +2 -0
  35. data/spec/rails-3.2/app_root/config/environment.rb +2 -0
  36. data/spec/rails-3.2/app_root/config/environments/test.rb +2 -0
  37. data/spec/rails-3.2/app_root/config/initializers/backtrace_silencers.rb +2 -0
  38. data/spec/rails-3.2/app_root/config/initializers/inflections.rb +2 -0
  39. data/spec/rails-3.2/app_root/config/initializers/mime_types.rb +2 -0
  40. data/spec/rails-3.2/app_root/config/initializers/secret_token.rb +2 -0
  41. data/spec/rails-3.2/app_root/config/initializers/session_store.rb +2 -0
  42. data/spec/rails-3.2/app_root/config/routes.rb +2 -0
  43. data/spec/rails-3.2/{spec_helper.rb → spec/spec_helper.rb} +5 -3
  44. data/spec/shared/app_root/app/controllers/application_controller.rb +2 -0
  45. data/spec/shared/app_root/app/models/user.rb +2 -0
  46. data/spec/shared/app_root/db/migrate/001_create_users.rb +2 -0
  47. data/spec/shared/dusen/active_record_spec.rb +2 -0
  48. metadata +42 -56
data/.travis.yml ADDED
@@ -0,0 +1,9 @@
1
+ language: ruby
2
+ rvm:
3
+ - "1.8.7"
4
+ - "1.9.3"
5
+ - ree
6
+ script: rake all:bundle all:spec
7
+ notifications:
8
+ email:
9
+ - fail@makandra.de
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  Dusen - Maps Google-like queries to ActiveRecord scopes
2
2
  =======================================================
3
3
 
4
+ [![Build Status](https://secure.travis-ci.org/makandra/dusen.png?branch=master)](https://travis-ci.org/makandra/dusen)
4
5
 
5
6
  Dusen gives your ActiveRecord models a DSL to process Google-like queries like:
6
7
 
data/Rakefile CHANGED
@@ -8,16 +8,18 @@ namespace :all do
8
8
 
9
9
  desc "Run specs on all spec apps"
10
10
  task :spec do
11
+ success = true
11
12
  for_each_directory_of('spec/**/Rakefile') do |directory|
12
13
  env = "SPEC=../../#{ENV['SPEC']} " if ENV['SPEC']
13
- system("cd #{directory} && #{env} bundle exec rake spec")
14
+ success &= system("cd #{directory} && #{env} bundle exec rake spec")
14
15
  end
16
+ fail "Tests failed" unless success
15
17
  end
16
18
 
17
19
  desc "Bundle all spec apps"
18
20
  task :bundle do
19
21
  for_each_directory_of('spec/**/Gemfile') do |directory|
20
- system("cd #{directory} && bundle install")
22
+ system("cd #{directory} && rm -f Gemfile.lock && bundle install")
21
23
  end
22
24
  end
23
25
 
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  module Dusen
2
4
  module ActiveRecord
3
5
 
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  module Dusen
2
4
  class Description
3
5
 
data/lib/dusen/parser.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  module Dusen
2
4
  class Parser
3
5
 
data/lib/dusen/query.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  module Dusen
2
4
  class Query
3
5
 
data/lib/dusen/syntax.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  module Dusen
2
4
  class Syntax
3
5
 
data/lib/dusen/token.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  module Dusen
2
4
  class Token
3
5
 
data/lib/dusen/util.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  module Dusen
2
4
  module Util
3
5
  extend self
@@ -31,4 +33,4 @@ module Dusen
31
33
  end
32
34
 
33
35
  end
34
- end
36
+ end
data/lib/dusen/version.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  module Dusen
2
- VERSION = '0.2.1'
4
+ VERSION = '0.2.2'
3
5
  end
data/lib/dusen.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'dusen/util'
2
4
  require 'dusen/token'
3
5
  require 'dusen/description'
@@ -4,6 +4,7 @@ gem 'rails', '~>2.3'
4
4
  gem 'rspec', '~>1.3'
5
5
  gem 'rspec-rails', '~>1.3'
6
6
  gem 'sqlite3'
7
- gem 'ruby-debug'
7
+ gem 'ruby-debug', :platforms => :ruby_18
8
+ gem 'test-unit', '~>1.2', :platforms => :ruby_19
8
9
 
9
10
  gem 'dusen', :path => '../..'
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  # Allow customization of the rails framework path
2
4
  RAILS_FRAMEWORK_ROOT = (ENV['RAILS_FRAMEWORK_ROOT'] || "#{File.dirname(__FILE__)}/../../../../../../vendor/rails") unless defined?(RAILS_FRAMEWORK_ROOT)
3
5
 
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require File.join(File.dirname(__FILE__), 'boot')
2
4
 
3
5
  Rails::Initializer.run do |config|
@@ -0,0 +1 @@
1
+ MissingSourceFile::REGEXPS.push([/^cannot load such file -- (.+)$/i, 1])
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  begin
2
4
  require "rubygems"
3
5
  require "bundler"
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  ActionController::Routing::Routes.draw do |map|
2
4
 
3
5
  map.resource :dashboard, :member => { :error => :post }
@@ -1,10 +1,12 @@
1
- $: << File.join(File.dirname(__FILE__), "/../lib" )
1
+ # encoding: utf-8
2
+
3
+ $: << File.join(File.dirname(__FILE__), "/../../lib" )
2
4
 
3
5
  # Set the default environment to sqlite3's in_memory database
4
- ENV['RAILS_ENV'] ||= 'in_memory'
6
+ ENV['RAILS_ENV'] = 'in_memory'
5
7
 
6
8
  # Load the Rails environment and testing framework
7
- require "#{File.dirname(__FILE__)}/app_root/config/environment"
9
+ require "#{File.dirname(__FILE__)}/../app_root/config/environment"
8
10
  require 'spec/rails'
9
11
 
10
12
  # Undo changes to RAILS_ENV
@@ -4,6 +4,6 @@ gem 'rails', '~>3.0.17'
4
4
  gem 'rspec'
5
5
  gem 'rspec-rails'
6
6
  gem 'sqlite3'
7
- gem 'ruby-debug'
7
+ gem 'ruby-debug', :platforms => :ruby_18
8
8
 
9
9
  gem 'dusen', :path => '../..'
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require File.expand_path('../boot', __FILE__)
2
4
 
3
5
  require 'rails/all'
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'rubygems'
2
4
 
3
5
  # Set up gems listed in the Gemfile.
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  # Load the rails application
2
4
  require File.expand_path('../application', __FILE__)
3
5
 
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  SpecApp::Application.configure do
2
4
  # Settings specified here will take precedence over those in config/application.rb
3
5
 
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  # Be sure to restart your server when you modify this file.
2
4
 
3
5
  # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  # Be sure to restart your server when you modify this file.
2
4
 
3
5
  # Add new inflection rules using the following format
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  # Be sure to restart your server when you modify this file.
2
4
 
3
5
  # Add new mime types for use in respond_to blocks:
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  # Be sure to restart your server when you modify this file.
2
4
 
3
5
  # Your secret key for verifying the integrity of signed cookies.
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  # Be sure to restart your server when you modify this file.
2
4
 
3
5
  SpecApp::Application.config.session_store :cookie_store, :key => '_app_root_session'
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  SpecApp::Application.routes.draw do
2
4
  match ':controller(/:action(/:id(.:format)))'
3
5
  end
@@ -1,11 +1,13 @@
1
- $: << File.join(File.dirname(__FILE__), "/../lib" )
1
+ # encoding: utf-8
2
+
3
+ $: << File.join(File.dirname(__FILE__), "/../../lib" )
2
4
 
3
5
  # Set the default environment to sqlite3's in_memory database
4
- ENV['RAILS_ENV'] ||= 'test'
6
+ ENV['RAILS_ENV'] = 'test'
5
7
  ENV['RAILS_ROOT'] = 'app_root'
6
8
 
7
9
  # Load the Rails environment and testing framework
8
- require "#{File.dirname(__FILE__)}/app_root/config/environment"
10
+ require "#{File.dirname(__FILE__)}/../app_root/config/environment"
9
11
  require 'rspec/rails'
10
12
 
11
13
  FileUtils.rm(Dir.glob("#{Rails.root}/db/*.db"), :force => true)
@@ -5,7 +5,7 @@ gem 'rspec'
5
5
  gem 'rspec-rails'
6
6
  gem 'sqlite3'
7
7
  gem 'rspec_candy'
8
- gem 'ruby-debug'
8
+ gem 'ruby-debug', :platforms => :ruby_18
9
9
  gem 'database_cleaner'
10
10
 
11
11
  gem 'dusen', :path => '../..'
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require File.expand_path('../boot', __FILE__)
2
4
 
3
5
  require 'rails/all'
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'rubygems'
2
4
 
3
5
  # Set up gems listed in the Gemfile.
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  # Load the rails application
2
4
  require File.expand_path('../application', __FILE__)
3
5
 
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  SpecApp::Application.configure do
2
4
  # Settings specified here will take precedence over those in config/application.rb
3
5
 
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  # Be sure to restart your server when you modify this file.
2
4
 
3
5
  # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  # Be sure to restart your server when you modify this file.
2
4
 
3
5
  # Add new inflection rules using the following format
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  # Be sure to restart your server when you modify this file.
2
4
 
3
5
  # Add new mime types for use in respond_to blocks:
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  # Be sure to restart your server when you modify this file.
2
4
 
3
5
  # Your secret key for verifying the integrity of signed cookies.
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  # Be sure to restart your server when you modify this file.
2
4
 
3
5
  SpecApp::Application.config.session_store :cookie_store, :key => '_app_root_session'
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  SpecApp::Application.routes.draw do
2
4
  match ':controller(/:action(/:id(.:format)))'
3
5
  end
@@ -1,12 +1,14 @@
1
- $: << File.join(File.dirname(__FILE__), "/../lib" )
1
+ # encoding: utf-8
2
2
 
3
- ENV['RAILS_ENV'] ||= 'test'
3
+ $: << File.join(File.dirname(__FILE__), "/../../lib" )
4
+
5
+ ENV['RAILS_ENV'] = 'test'
4
6
  ENV['RAILS_ROOT'] = 'app_root'
5
7
 
6
8
  FileUtils.rm(Dir.glob("#{ENV['RAILS_ROOT']}/db/*.db"), :force => true)
7
9
 
8
10
  # Load the Rails environment and testing framework
9
- require "#{File.dirname(__FILE__)}/app_root/config/environment"
11
+ require "#{File.dirname(__FILE__)}/../app_root/config/environment"
10
12
  require 'rspec/rails'
11
13
  require 'database_cleaner'
12
14
 
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  class ApplicationController < ActionController::Base
2
4
 
3
5
  end
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  class User < ActiveRecord::Base
2
4
 
3
5
  search_syntax do
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  class CreateUsers < ActiveRecord::Migration
2
4
 
3
5
  def self.up
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Dusen::ActiveRecord do
metadata CHANGED
@@ -1,47 +1,41 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: dusen
3
- version: !ruby/object:Gem::Version
4
- hash: 21
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.2
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 2
9
- - 1
10
- version: 0.2.1
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Henning Koch
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-11-23 00:00:00 +01:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2012-11-23 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: rails
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
25
17
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 3
30
- segments:
31
- - 0
32
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
33
22
  type: :runtime
34
- version_requirements: *id001
35
- description: Maps Google-like queries (words, "phrases", qualified:fields) to ActiveRecord scope chains
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ description: Maps Google-like queries (words, "phrases", qualified:fields) to ActiveRecord
31
+ scope chains
36
32
  email: henning.koch@makandra.de
37
33
  executables: []
38
-
39
34
  extensions: []
40
-
41
35
  extra_rdoc_files: []
42
-
43
- files:
36
+ files:
44
37
  - .gitignore
38
+ - .travis.yml
45
39
  - README.md
46
40
  - Rakefile
47
41
  - dusen.gemspec
@@ -64,12 +58,13 @@ files:
64
58
  - spec/rails-2.3/app_root/config/environments/postgresql.rb
65
59
  - spec/rails-2.3/app_root/config/environments/sqlite.rb
66
60
  - spec/rails-2.3/app_root/config/environments/sqlite3.rb
61
+ - spec/rails-2.3/app_root/config/initializers/fix_missing_source_file.rb
67
62
  - spec/rails-2.3/app_root/config/preinitializer.rb
68
63
  - spec/rails-2.3/app_root/config/routes.rb
69
64
  - spec/rails-2.3/app_root/log/.gitignore
70
65
  - spec/rails-2.3/rcov.opts
71
66
  - spec/rails-2.3/spec.opts
72
- - spec/rails-2.3/spec_helper.rb
67
+ - spec/rails-2.3/spec/spec_helper.rb
73
68
  - spec/rails-3.0/.rspec
74
69
  - spec/rails-3.0/Gemfile
75
70
  - spec/rails-3.0/Rakefile
@@ -89,7 +84,7 @@ files:
89
84
  - spec/rails-3.0/app_root/log/.gitkeep
90
85
  - spec/rails-3.0/app_root/script/rails
91
86
  - spec/rails-3.0/rcov.opts
92
- - spec/rails-3.0/spec_helper.rb
87
+ - spec/rails-3.0/spec/spec_helper.rb
93
88
  - spec/rails-3.2/.rspec
94
89
  - spec/rails-3.2/Gemfile
95
90
  - spec/rails-3.2/Rakefile
@@ -107,44 +102,35 @@ files:
107
102
  - spec/rails-3.2/app_root/config/routes.rb
108
103
  - spec/rails-3.2/app_root/log/.gitignore
109
104
  - spec/rails-3.2/rcov.opts
110
- - spec/rails-3.2/spec_helper.rb
105
+ - spec/rails-3.2/spec/spec_helper.rb
111
106
  - spec/shared/app_root/app/controllers/application_controller.rb
112
107
  - spec/shared/app_root/app/models/user.rb
113
108
  - spec/shared/app_root/db/migrate/001_create_users.rb
114
109
  - spec/shared/dusen/active_record_spec.rb
115
- has_rdoc: true
116
110
  homepage: https://github.com/makandra/dusen
117
111
  licenses: []
118
-
119
112
  post_install_message:
120
113
  rdoc_options: []
121
-
122
- require_paths:
114
+ require_paths:
123
115
  - lib
124
- required_ruby_version: !ruby/object:Gem::Requirement
116
+ required_ruby_version: !ruby/object:Gem::Requirement
125
117
  none: false
126
- requirements:
127
- - - ">="
128
- - !ruby/object:Gem::Version
129
- hash: 3
130
- segments:
131
- - 0
132
- version: "0"
133
- required_rubygems_version: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - ! '>='
120
+ - !ruby/object:Gem::Version
121
+ version: '0'
122
+ required_rubygems_version: !ruby/object:Gem::Requirement
134
123
  none: false
135
- requirements:
136
- - - ">="
137
- - !ruby/object:Gem::Version
138
- hash: 3
139
- segments:
140
- - 0
141
- version: "0"
124
+ requirements:
125
+ - - ! '>='
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
142
128
  requirements: []
143
-
144
129
  rubyforge_project:
145
- rubygems_version: 1.3.9.4
130
+ rubygems_version: 1.8.24
146
131
  signing_key:
147
132
  specification_version: 3
148
- summary: Maps Google-like queries (words, "phrases", qualified:fields) to ActiveRecord scope chains
133
+ summary: Maps Google-like queries (words, "phrases", qualified:fields) to ActiveRecord
134
+ scope chains
149
135
  test_files: []
150
-
136
+ has_rdoc: