shuber-eigenclass 1.0.0 → 1.0.1

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/CHANGELOG CHANGED
@@ -2,4 +2,5 @@
2
2
  * Initial commit
3
3
  * Update README
4
4
  * Add gemspec
5
- * Update gemspec to force github to rebuild gem
5
+ * Update gemspec to force github to rebuild gem
6
+ * Rename cattr_* methods to eattr_* to avoid confusion and conflict with ActiveSupport's version
@@ -16,9 +16,9 @@ Usage
16
16
  This gem allows you to define class level accessors, readers, and writers
17
17
 
18
18
  class SomeClass
19
- cattr_accessor :test_accessor
20
- cattr_reader :test_reader
21
- cattr_writer :test_writer
19
+ eattr_accessor :test_accessor
20
+ eattr_reader :test_reader
21
+ eattr_writer :test_writer
22
22
  end
23
23
 
24
24
  SomeClass.test_accessor = 'testing'
@@ -6,11 +6,11 @@ module Huberry
6
6
  # Example
7
7
  #
8
8
  # class User
9
- # cattr_accessor :testing
9
+ # eattr_accessor :testing
10
10
  # end
11
11
  #
12
12
  # User.testing = true
13
- def cattr_accessor(*attrs)
13
+ def eattr_accessor(*attrs)
14
14
  eigenclass_eval { attr_accessor *attrs }
15
15
  end
16
16
 
@@ -20,12 +20,12 @@ module Huberry
20
20
  # Example
21
21
  #
22
22
  # class User
23
- # cattr_reader :testing
23
+ # eattr_reader :testing
24
24
  # @testing = true
25
25
  # end
26
26
  #
27
27
  # User.testing # returns true
28
- def cattr_reader(*attrs)
28
+ def eattr_reader(*attrs)
29
29
  eigenclass_eval { attr_reader *attrs }
30
30
  end
31
31
 
@@ -35,11 +35,11 @@ module Huberry
35
35
  # Example
36
36
  #
37
37
  # class User
38
- # cattr_writer :testing
38
+ # eattr_writer :testing
39
39
  # end
40
40
  #
41
41
  # User.testing = true
42
- def cattr_writer(*attrs)
42
+ def eattr_writer(*attrs)
43
43
  eigenclass_eval { attr_writer *attrs }
44
44
  end
45
45
 
@@ -62,7 +62,7 @@ class EigenclassTest < Test::Unit::TestCase
62
62
 
63
63
  def test_cattr_accessor
64
64
  assert !TestClass.respond_to?(:this_is_a_test)
65
- TestClass.cattr_accessor :this_is_a_test
65
+ TestClass.eattr_accessor :this_is_a_test
66
66
  assert TestClass.respond_to?(:this_is_a_test)
67
67
  assert TestClass.this_is_a_test.nil?
68
68
  TestClass.this_is_a_test = true
@@ -71,7 +71,7 @@ class EigenclassTest < Test::Unit::TestCase
71
71
 
72
72
  def test_cattr_reader
73
73
  assert !TestClass.respond_to?(:this_is_another_test)
74
- TestClass.cattr_reader :this_is_another_test
74
+ TestClass.eattr_reader :this_is_another_test
75
75
  assert TestClass.respond_to?(:this_is_another_test)
76
76
  assert TestClass.this_is_another_test.nil?
77
77
  TestClass.instance_variable_set('@this_is_another_test', true)
@@ -80,7 +80,7 @@ class EigenclassTest < Test::Unit::TestCase
80
80
 
81
81
  def test_cattr_writer
82
82
  assert !TestClass.respond_to?(:this_is_yet_another_test=)
83
- TestClass.cattr_writer :this_is_yet_another_test
83
+ TestClass.eattr_writer :this_is_yet_another_test
84
84
  assert TestClass.respond_to?(:this_is_yet_another_test=)
85
85
  assert TestClass.instance_variable_get('@this_is_yet_another_test').nil?
86
86
  TestClass.this_is_yet_another_test = true
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shuber-eigenclass
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Huber