kasket 0.8.4 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/kasket.rb CHANGED
@@ -1,4 +1,4 @@
1
- require 'rubygems'
1
+ # -*- encoding: utf-8 -*-
2
2
  require 'active_record'
3
3
  require 'active_support'
4
4
 
@@ -13,8 +13,8 @@ module Kasket
13
13
 
14
14
  class Version
15
15
  MAJOR = 0
16
- MINOR = 8
17
- PATCH = 4
16
+ MINOR = 9
17
+ PATCH = 0
18
18
  STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
19
19
  end
20
20
 
@@ -1,3 +1,4 @@
1
+ # -*- encoding: utf-8 -*-
1
2
  module Kasket
2
3
  module FixForAssociationAccessorMethods
3
4
  def association_accessor_methods(reflection, association_proxy_class)
@@ -1,3 +1,4 @@
1
+ # -*- encoding: utf-8 -*-
1
2
  require 'active_support'
2
3
  require "digest/md5"
3
4
 
@@ -74,9 +75,9 @@ module Kasket
74
75
  @kasket_indices ||= []
75
76
  @kasket_indices << attributes unless @kasket_indices.include?(attributes)
76
77
 
77
- include WriteMixin unless instance_methods.include?('store_in_kasket')
78
- extend DirtyMixin unless methods.include?('kasket_dirty_methods')
79
- extend ReadMixin unless methods.include?('find_by_sql_with_kasket')
78
+ include WriteMixin unless include?(WriteMixin)
79
+ extend DirtyMixin unless respond_to?(:kasket_dirty_methods)
80
+ extend ReadMixin unless respond_to?(:find_by_sql_with_kasket)
80
81
  end
81
82
  end
82
83
  end
@@ -1,3 +1,4 @@
1
+ # -*- encoding: utf-8 -*-
1
2
  module Kasket
2
3
  module DirtyMixin
3
4
  def kasket_dirty_methods(*method_names)
@@ -1,3 +1,4 @@
1
+ # -*- encoding: utf-8 -*-
1
2
  module Kasket
2
3
  class QueryParser
3
4
  # Examples:
@@ -1,3 +1,4 @@
1
+ # -*- encoding: utf-8 -*-
1
2
  module Kasket
2
3
  module ReadMixin
3
4
 
@@ -1,3 +1,4 @@
1
+ # -*- encoding: utf-8 -*-
1
2
  module Kasket
2
3
  module ReloadAssociationMixin
3
4
  # TODO write tests for this
@@ -1,3 +1,4 @@
1
+ # -*- encoding: utf-8 -*-
1
2
  module Kasket
2
3
  module WriteMixin
3
4
 
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/helper'
1
+ require File.expand_path("helper", File.dirname(__FILE__))
2
2
 
3
3
  class CacheExpiryTest < ActiveSupport::TestCase
4
4
  fixtures :blogs, :posts
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/helper'
1
+ require File.expand_path("helper", File.dirname(__FILE__))
2
2
  require "digest/md5"
3
3
 
4
4
  class ConfigurationMixinTest < ActiveSupport::TestCase
data/test/dirty_test.rb CHANGED
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/helper'
1
+ require File.expand_path("helper", File.dirname(__FILE__))
2
2
 
3
3
  class DirtyTest < ActiveSupport::TestCase
4
4
  fixtures :blogs, :posts
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/helper'
1
+ require File.expand_path("helper", File.dirname(__FILE__))
2
2
 
3
3
  class FindOneTest < ActiveSupport::TestCase
4
4
  fixtures :blogs, :posts
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/helper'
1
+ require File.expand_path("helper", File.dirname(__FILE__))
2
2
 
3
3
  class FindSomeTest < ActiveSupport::TestCase
4
4
  fixtures :blogs, :posts
data/test/helper.rb CHANGED
@@ -1,10 +1,10 @@
1
1
  require 'rubygems'
2
- require 'ruby-debug'
2
+
3
+ require 'bundler'
4
+ Bundler.setup
5
+ Bundler.require(:default, :development)
6
+
3
7
  require 'test/unit'
4
- require 'mocha'
5
- require 'shoulda'
6
- require 'active_support'
7
- require 'active_record'
8
8
  require 'active_record/fixtures'
9
9
 
10
10
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
data/test/parser_test.rb CHANGED
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/helper'
1
+ require File.expand_path("helper", File.dirname(__FILE__))
2
2
  require 'kasket/query_parser'
3
3
 
4
4
  class ParserTest < ActiveSupport::TestCase
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/helper'
1
+ require File.expand_path("helper", File.dirname(__FILE__))
2
2
 
3
3
  class ReadMixinTest < ActiveSupport::TestCase
4
4
 
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/helper'
1
+ require File.expand_path("helper", File.dirname(__FILE__))
2
2
 
3
3
  class TransactionTest < ActiveSupport::TestCase
4
4
  context "Transactions" do
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kasket
3
3
  version: !ruby/object:Gem::Version
4
- hash: 55
5
4
  prerelease: false
6
5
  segments:
7
6
  - 0
8
- - 8
9
- - 4
10
- version: 0.8.4
7
+ - 9
8
+ - 0
9
+ version: 0.9.0
11
10
  platform: ruby
12
11
  authors:
13
12
  - Mick Staugaard
@@ -16,7 +15,7 @@ autorequire:
16
15
  bindir: bin
17
16
  cert_chain: []
18
17
 
19
- date: 2010-11-04 00:00:00 -07:00
18
+ date: 2010-12-23 00:00:00 -08:00
20
19
  default_executable:
21
20
  dependencies:
22
21
  - !ruby/object:Gem::Dependency
@@ -27,7 +26,6 @@ dependencies:
27
26
  requirements:
28
27
  - - ~>
29
28
  - !ruby/object:Gem::Version
30
- hash: 11
31
29
  segments:
32
30
  - 2
33
31
  - 3
@@ -36,80 +34,96 @@ dependencies:
36
34
  type: :runtime
37
35
  version_requirements: *id001
38
36
  - !ruby/object:Gem::Dependency
39
- name: activesupport
37
+ name: rake
40
38
  prerelease: false
41
39
  requirement: &id002 !ruby/object:Gem::Requirement
42
40
  none: false
43
41
  requirements:
44
- - - ~>
42
+ - - ">="
45
43
  - !ruby/object:Gem::Version
46
- hash: 11
47
44
  segments:
48
- - 2
49
- - 3
50
- - 4
51
- version: 2.3.4
52
- type: :runtime
45
+ - 0
46
+ version: "0"
47
+ type: :development
53
48
  version_requirements: *id002
54
49
  - !ruby/object:Gem::Dependency
55
- name: shoulda
50
+ name: bundler
56
51
  prerelease: false
57
52
  requirement: &id003 !ruby/object:Gem::Requirement
58
53
  none: false
59
54
  requirements:
60
55
  - - ">="
61
56
  - !ruby/object:Gem::Version
62
- hash: 3
63
57
  segments:
64
58
  - 0
65
59
  version: "0"
66
60
  type: :development
67
61
  version_requirements: *id003
68
62
  - !ruby/object:Gem::Dependency
69
- name: mocha
63
+ name: shoulda
70
64
  prerelease: false
71
65
  requirement: &id004 !ruby/object:Gem::Requirement
72
66
  none: false
73
67
  requirements:
74
68
  - - ">="
75
69
  - !ruby/object:Gem::Version
76
- hash: 3
77
70
  segments:
78
71
  - 0
79
72
  version: "0"
80
73
  type: :development
81
74
  version_requirements: *id004
82
75
  - !ruby/object:Gem::Dependency
83
- name: temping
76
+ name: mocha
84
77
  prerelease: false
85
78
  requirement: &id005 !ruby/object:Gem::Requirement
86
79
  none: false
87
80
  requirements:
88
81
  - - ">="
89
82
  - !ruby/object:Gem::Version
90
- hash: 27
83
+ segments:
84
+ - 0
85
+ version: "0"
86
+ type: :development
87
+ version_requirements: *id005
88
+ - !ruby/object:Gem::Dependency
89
+ name: temping
90
+ prerelease: false
91
+ requirement: &id006 !ruby/object:Gem::Requirement
92
+ none: false
93
+ requirements:
94
+ - - ~>
95
+ - !ruby/object:Gem::Version
91
96
  segments:
92
97
  - 1
93
98
  - 3
94
99
  - 0
95
100
  version: 1.3.0
96
101
  type: :development
97
- version_requirements: *id005
102
+ version_requirements: *id006
103
+ - !ruby/object:Gem::Dependency
104
+ name: sqlite3-ruby
105
+ prerelease: false
106
+ requirement: &id007 !ruby/object:Gem::Requirement
107
+ none: false
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ segments:
112
+ - 0
113
+ version: "0"
114
+ type: :development
115
+ version_requirements: *id007
98
116
  description: puts a cap on your queries
99
- email: mick@staugaard.com
117
+ email:
118
+ - mick@zendesk.com
119
+ - eac@zendesk.com
100
120
  executables: []
101
121
 
102
122
  extensions: []
103
123
 
104
- extra_rdoc_files:
105
- - README.rdoc
124
+ extra_rdoc_files: []
125
+
106
126
  files:
107
- - .document
108
- - .gitignore
109
- - README.rdoc
110
- - Rakefile
111
- - kasket.gemspec
112
- - lib/kasket.rb
113
127
  - lib/kasket/active_record_patches.rb
114
128
  - lib/kasket/configuration_mixin.rb
115
129
  - lib/kasket/dirty_mixin.rb
@@ -117,6 +131,8 @@ files:
117
131
  - lib/kasket/read_mixin.rb
118
132
  - lib/kasket/reload_association_mixin.rb
119
133
  - lib/kasket/write_mixin.rb
134
+ - lib/kasket.rb
135
+ - README.rdoc
120
136
  - test/cache_expiry_test.rb
121
137
  - test/configuration_mixin_test.rb
122
138
  - test/database.yml
@@ -136,8 +152,8 @@ homepage: http://github.com/staugaard/kasket
136
152
  licenses: []
137
153
 
138
154
  post_install_message:
139
- rdoc_options:
140
- - --charset=UTF-8
155
+ rdoc_options: []
156
+
141
157
  require_paths:
142
158
  - lib
143
159
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -145,7 +161,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
145
161
  requirements:
146
162
  - - ">="
147
163
  - !ruby/object:Gem::Version
148
- hash: 3
149
164
  segments:
150
165
  - 0
151
166
  version: "0"
@@ -154,7 +169,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
169
  requirements:
155
170
  - - ">="
156
171
  - !ruby/object:Gem::Version
157
- hash: 3
158
172
  segments:
159
173
  - 0
160
174
  version: "0"
@@ -168,9 +182,13 @@ summary: A write back caching layer on active record
168
182
  test_files:
169
183
  - test/cache_expiry_test.rb
170
184
  - test/configuration_mixin_test.rb
185
+ - test/database.yml
171
186
  - test/dirty_test.rb
172
187
  - test/find_one_test.rb
173
188
  - test/find_some_test.rb
189
+ - test/fixtures/blogs.yml
190
+ - test/fixtures/comments.yml
191
+ - test/fixtures/posts.yml
174
192
  - test/helper.rb
175
193
  - test/parser_test.rb
176
194
  - test/read_mixin_test.rb
data/.document DELETED
@@ -1,5 +0,0 @@
1
- README.rdoc
2
- lib/**/*.rb
3
- bin/*
4
- features/**/*.feature
5
- LICENSE
data/.gitignore DELETED
@@ -1,23 +0,0 @@
1
- ## MAC OS
2
- .DS_Store
3
-
4
- ## TEXTMATE
5
- *.tmproj
6
- tmtags
7
-
8
- ## EMACS
9
- *~
10
- \#*
11
- .\#*
12
-
13
- ## VIM
14
- *.swp
15
-
16
- ## PROJECT::GENERAL
17
- coverage
18
- rdoc
19
- pkg
20
- .rvmrc
21
-
22
- ## PROJECT::SPECIFIC
23
- test/debug.log
data/Rakefile DELETED
@@ -1,62 +0,0 @@
1
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'lib'))
2
-
3
- require 'rubygems'
4
- require 'rake'
5
- require 'lib/kasket'
6
-
7
- begin
8
- require 'jeweler'
9
- Jeweler::Tasks.new do |gem|
10
- gem.name = "kasket"
11
- gem.version = Kasket::Version::STRING
12
- gem.summary = %Q{A write back caching layer on active record}
13
- gem.description = %Q{puts a cap on your queries}
14
- gem.email = "mick@staugaard.com"
15
- gem.homepage = "http://github.com/staugaard/kasket"
16
- gem.authors = ["Mick Staugaard", "Eric Chapweske"]
17
- gem.add_dependency('activerecord', '~> 2.3.4')
18
- gem.add_dependency('activesupport', '~> 2.3.4')
19
- gem.add_development_dependency "shoulda", ">= 0"
20
- gem.add_development_dependency "mocha", ">= 0"
21
- gem.add_development_dependency "temping", ">= 1.3.0"
22
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
23
- end
24
- Jeweler::GemcutterTasks.new
25
- rescue LoadError
26
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
27
- end
28
-
29
- require 'rake/testtask'
30
- Rake::TestTask.new(:test) do |test|
31
- test.libs << 'lib' << 'test'
32
- test.pattern = 'test/**/*_test.rb'
33
- test.verbose = true
34
- end
35
-
36
- begin
37
- require 'rcov/rcovtask'
38
- Rcov::RcovTask.new do |test|
39
- test.libs << 'test'
40
- test.pattern = 'test/**/*_test.rb'
41
- test.rcov_opts << "--exclude \"test/*,gems/*,/Library/Ruby/*,config/*\" --rails"
42
- test.verbose = true
43
- end
44
- rescue LoadError
45
- task :rcov do
46
- abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
47
- end
48
- end
49
-
50
- task :test => :check_dependencies
51
-
52
- task :default => :test
53
-
54
- require 'rake/rdoctask'
55
- Rake::RDocTask.new do |rdoc|
56
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
57
-
58
- rdoc.rdoc_dir = 'rdoc'
59
- rdoc.title = "kasket #{version}"
60
- rdoc.rdoc_files.include('README*')
61
- rdoc.rdoc_files.include('lib/**/*.rb')
62
- end
data/kasket.gemspec DELETED
@@ -1,90 +0,0 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
- # -*- encoding: utf-8 -*-
5
-
6
- Gem::Specification.new do |s|
7
- s.name = %q{kasket}
8
- s.version = "0.8.4"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Mick Staugaard", "Eric Chapweske"]
12
- s.date = %q{2010-11-04}
13
- s.description = %q{puts a cap on your queries}
14
- s.email = %q{mick@staugaard.com}
15
- s.extra_rdoc_files = [
16
- "README.rdoc"
17
- ]
18
- s.files = [
19
- ".document",
20
- ".gitignore",
21
- "README.rdoc",
22
- "Rakefile",
23
- "kasket.gemspec",
24
- "lib/kasket.rb",
25
- "lib/kasket/active_record_patches.rb",
26
- "lib/kasket/configuration_mixin.rb",
27
- "lib/kasket/dirty_mixin.rb",
28
- "lib/kasket/query_parser.rb",
29
- "lib/kasket/read_mixin.rb",
30
- "lib/kasket/reload_association_mixin.rb",
31
- "lib/kasket/write_mixin.rb",
32
- "test/cache_expiry_test.rb",
33
- "test/configuration_mixin_test.rb",
34
- "test/database.yml",
35
- "test/dirty_test.rb",
36
- "test/find_one_test.rb",
37
- "test/find_some_test.rb",
38
- "test/fixtures/blogs.yml",
39
- "test/fixtures/comments.yml",
40
- "test/fixtures/posts.yml",
41
- "test/helper.rb",
42
- "test/parser_test.rb",
43
- "test/read_mixin_test.rb",
44
- "test/test_models.rb",
45
- "test/transaction_test.rb"
46
- ]
47
- s.homepage = %q{http://github.com/staugaard/kasket}
48
- s.rdoc_options = ["--charset=UTF-8"]
49
- s.require_paths = ["lib"]
50
- s.rubygems_version = %q{1.3.7}
51
- s.summary = %q{A write back caching layer on active record}
52
- s.test_files = [
53
- "test/cache_expiry_test.rb",
54
- "test/configuration_mixin_test.rb",
55
- "test/dirty_test.rb",
56
- "test/find_one_test.rb",
57
- "test/find_some_test.rb",
58
- "test/helper.rb",
59
- "test/parser_test.rb",
60
- "test/read_mixin_test.rb",
61
- "test/test_models.rb",
62
- "test/transaction_test.rb"
63
- ]
64
-
65
- if s.respond_to? :specification_version then
66
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
67
- s.specification_version = 3
68
-
69
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
70
- s.add_runtime_dependency(%q<activerecord>, ["~> 2.3.4"])
71
- s.add_runtime_dependency(%q<activesupport>, ["~> 2.3.4"])
72
- s.add_development_dependency(%q<shoulda>, [">= 0"])
73
- s.add_development_dependency(%q<mocha>, [">= 0"])
74
- s.add_development_dependency(%q<temping>, [">= 1.3.0"])
75
- else
76
- s.add_dependency(%q<activerecord>, ["~> 2.3.4"])
77
- s.add_dependency(%q<activesupport>, ["~> 2.3.4"])
78
- s.add_dependency(%q<shoulda>, [">= 0"])
79
- s.add_dependency(%q<mocha>, [">= 0"])
80
- s.add_dependency(%q<temping>, [">= 1.3.0"])
81
- end
82
- else
83
- s.add_dependency(%q<activerecord>, ["~> 2.3.4"])
84
- s.add_dependency(%q<activesupport>, ["~> 2.3.4"])
85
- s.add_dependency(%q<shoulda>, [">= 0"])
86
- s.add_dependency(%q<mocha>, [">= 0"])
87
- s.add_dependency(%q<temping>, [">= 1.3.0"])
88
- end
89
- end
90
-