Get_Set 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module Get_Set
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
data/lib/Get_Set.rb CHANGED
@@ -20,6 +20,7 @@ module Get_Set
20
20
  names.each { |n|
21
21
  class_eval %~
22
22
  def #{n} *args
23
+ instance_variable_set( :@#{n}, nil ) unless instance_variable_defined?(:@#{n})
23
24
  Get_Set! :@#{n}, *args
24
25
  end
25
26
  ~, __FILE__, __LINE__
data/spec/main.rb CHANGED
@@ -6,7 +6,7 @@ require 'Bacon_Colored'
6
6
  Klass = Class.new {
7
7
 
8
8
  include Get_Set::DSL
9
- attr_get_set :name
9
+ attr_get_set :name, :location
10
10
 
11
11
  def initialize
12
12
  @name = 'Ultra Force'
data/spec/tests/DSL.rb CHANGED
@@ -53,4 +53,8 @@ describe ":attr_get_set :name" do
53
53
  @klass.name.should == :Ultra
54
54
  end
55
55
 
56
+ it 'initializes variable to nil if not defined' do
57
+ @klass.location.should == nil
58
+ end
59
+
56
60
  end # === describe :attr_get_set :name
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Get_Set
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-29 00:00:00.000000000 Z
12
+ date: 2012-01-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bacon
16
- requirement: &17488100 !ruby/object:Gem::Requirement
16
+ requirement: &8273900 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *17488100
24
+ version_requirements: *8273900
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake
27
- requirement: &17487380 !ruby/object:Gem::Requirement
27
+ requirement: &8273320 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *17487380
35
+ version_requirements: *8273320
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: Bacon_Colored
38
- requirement: &17485840 !ruby/object:Gem::Requirement
38
+ requirement: &8272780 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *17485840
46
+ version_requirements: *8272780
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: Checked
49
- requirement: &17400580 !ruby/object:Gem::Requirement
49
+ requirement: &8272120 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *17400580
57
+ version_requirements: *8272120
58
58
  description: ! "\n Creates instance method that can both get or set an instance
59
59
  variable. \n It's like squeezing :attr_writer into :attr_reader.\n "
60
60
  email: