has_defaults 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/has_defaults.gemspec CHANGED
@@ -5,6 +5,7 @@ Gem::Specification.new do |s|
5
5
  s.name = 'has_defaults'
6
6
  s.version = HasDefaults::VERSION
7
7
  s.authors = ["Henning Koch"]
8
+ s.licenses = ["MIT"]
8
9
  s.email = 'henning.koch@makandra.de'
9
10
  s.homepage = 'https://github.com/makandra/has_defaults'
10
11
  s.summary = 'Default values for ActiveRecord models.'
@@ -63,7 +63,7 @@ module HasDefaults
63
63
  def evaluate_raw_default_value(raw_value)
64
64
  value = raw_value
65
65
  if value.respond_to?(:call)
66
- value = instance_eval(&value)
66
+ value = instance_exec(&value)
67
67
  end
68
68
  value
69
69
  end
@@ -1,5 +1,5 @@
1
1
  module HasDefaults
2
2
 
3
- VERSION = '0.4.1'
3
+ VERSION = '0.4.2'
4
4
 
5
5
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- has_defaults (0.4.0)
4
+ has_defaults (0.4.1)
5
5
  activerecord
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- has_defaults (0.4.0)
4
+ has_defaults (0.4.1)
5
5
  activerecord
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- has_defaults (0.4.0)
4
+ has_defaults (0.4.1)
5
5
  activerecord
6
6
 
7
7
  GEM
@@ -1,9 +1,9 @@
1
1
  class Donut < Pastry
2
2
 
3
3
  has_defaults :flavor => "cream", :name => "Cream"
4
- has_defaults :maker => proc { "Dunkin Donuts" }
5
- has_defaults :weight => proc { weigh }
6
- has_defaults :health_benefits => proc { self.class.global_health_benefits }
4
+ has_defaults :maker => lambda { "Dunkin Donuts" }
5
+ has_defaults :weight => lambda { weigh }
6
+ has_defaults :health_benefits => lambda { self.class.global_health_benefits }
7
7
 
8
8
  def flavor
9
9
  @flavor_getter_called = true
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has_defaults
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 1
10
- version: 0.4.1
9
+ - 2
10
+ version: 0.4.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Henning Koch
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-05-03 00:00:00 +02:00
18
+ date: 2015-05-08 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -119,8 +119,8 @@ files:
119
119
  - spec/shared/has_defaults/active_record_ext_spec.rb
120
120
  has_rdoc: true
121
121
  homepage: https://github.com/makandra/has_defaults
122
- licenses: []
123
-
122
+ licenses:
123
+ - MIT
124
124
  post_install_message:
125
125
  rdoc_options: []
126
126