methodmissing-scrooge 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
+ :patch: 4
2
3
  :major: 1
3
4
  :minor: 0
4
- :patch: 3
@@ -8,11 +8,11 @@ module Scrooge
8
8
  # the root Rack application and as such don't provide access to the Rails
9
9
  # Routing internals from other middleware.
10
10
  #
11
- def filter( controller, &block )
11
+ def filter( controller )
12
12
  Scrooge::Base.profile.tracker.track( Thread.scrooge_resource ) do
13
13
  begin
14
14
  Scrooge::Base.profile.framework.resource( {}, controller.request )
15
- block.call
15
+ yield
16
16
  ensure
17
17
  Thread.reset_scrooge_resource!
18
18
  end
@@ -118,9 +118,9 @@ module Scrooge
118
118
  klass = klass_for_model( model )
119
119
  unless resource_scope_method?( resource, klass )
120
120
  klass.instance_eval(<<-EOS, __FILE__, __LINE__)
121
- def #{method_name}(&block)
121
+ def #{method_name}
122
122
  with_scope( { :find => { :select => '#{model.to_sql}' } }) do
123
- block.call
123
+ yield
124
124
  end
125
125
  end
126
126
  EOS
@@ -69,9 +69,9 @@ module Scrooge
69
69
  # the root Rack application and as such don't provide access to the Rails
70
70
  # Routing internals from other middleware.
71
71
  #
72
- def filter( controller, &block )
72
+ def filter( controller )
73
73
  #{model.to_s}.#{profile.orm.resource_scope_method( resource ).to_s} do
74
- block.call
74
+ yield
75
75
  end
76
76
  end
77
77
 
@@ -141,7 +141,7 @@ module Scrooge
141
141
  @attributes.map{|a| ":#{a}" }.join(', ')
142
142
  end
143
143
 
144
- def attributes_with_primary_key #:nodoc:
144
+ def attributes_with_primary_key #:nodoc:
145
145
  @attributes << primary_key
146
146
  end
147
147
 
data/lib/scrooge.rb CHANGED
@@ -30,13 +30,17 @@ module Scrooge
30
30
  # directory.
31
31
  #
32
32
  def setup!
33
- unless File.exist?( profile.framework.configuration_file )
33
+ unless configuration_file_exists?
34
34
  FileUtils.cp( configuration_template(), profile.framework.configuration_file )
35
35
  end
36
36
  end
37
37
 
38
38
  private
39
39
 
40
+ def configuration_file_exists? #:nodoc:
41
+ File.exist?( profile.framework.configuration_file )
42
+ end
43
+
40
44
  def configuration_template #:nodoc:
41
45
  File.join( File.dirname(__FILE__), '..', 'assets', 'config', 'scrooge.yml.template' )
42
46
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: methodmissing-scrooge
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Lourens Naud\xC3\xA9"
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-03-03 00:00:00 -08:00
12
+ date: 2009-03-05 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies: []
15
15