ez_attributes 0.2.1 → 0.2.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3725aa929024853d9ba191e9483c4fba92c6b1e48e9b85eeea3fdfcdc05d7273
4
- data.tar.gz: 82389ab1902d37420d0667c63f0c1c68b907f4c4e21905aac64751cd9db7c312
3
+ metadata.gz: 55d1858c632570b78182239f11dd266098839e2035ba2279b88981188db1bf09
4
+ data.tar.gz: 419e205ed30e874089e91910bc5478a592007864742a7852a0355347026efed9
5
5
  SHA512:
6
- metadata.gz: 2107ab21f2840cb891dc8a82a3bb316312f2c15729b5987fec7e455463d441dc2c34d17b9b47fc158e73e11f0827ecd5450de28f4840202b92ba58f92c193dfc
7
- data.tar.gz: 30198452e4e6e4209d0f97211c15c5b50cbde8341d198c4e087101ba8e23cb53c6716154db855f72f8f06473d7a71b3f8a2abe19ce55e7aa74014a42f8398e62
6
+ metadata.gz: 24d2131f2609b1246ec5ca12fca605f9d37e0c73159882842e164549226f90440e8c0138fb767b943d9ed8f865a5eaf64a77714675a7ecdd622dcbb55a521f0e
7
+ data.tar.gz: bc9779ed2588b57a8655003f888ebf3f055900afb719f395b578a7fa658423397a83213bac742142f0513c87358d22cd5752fbf287dd1308eff4b7c844d81e1f
data/.rubocop.yml CHANGED
@@ -18,3 +18,5 @@ Metrics/AbcSize:
18
18
  Style/DocumentationMethod:
19
19
  Enabled: true
20
20
 
21
+ RSpec/ExampleLength:
22
+ Max: 15
data/CHANGELOG.md CHANGED
@@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
  <!-- ### Changed -->
12
12
  <!-- ### Removed -->
13
13
 
14
+ ## [0.2.2] - 2021-04-30
15
+
16
+ ### Changed
17
+
18
+ - Fix shared state between class instances. (Commit 759abc7cb971e6a30448f5e9557be4542128d7cf)
19
+
14
20
  ## [0.2.1] - 2021-01-20
15
21
 
16
22
  ### Changed
@@ -39,7 +45,8 @@ end
39
45
 
40
46
  - Basic module to define class initializers with keyword args.
41
47
 
42
- [unreleased]: https://github.com/MatheusRich/ez_attributes/compare/v0.2.1...HEAD
48
+ [unreleased]: https://github.com/MatheusRich/ez_attributes/compare/v0.2.2...HEAD
49
+ [0.2.2]: https://github.com/MatheusRich/ez_attributes/releases/tag/v0.2.2
43
50
  [0.2.1]: https://github.com/MatheusRich/ez_attributes/releases/tag/v0.2.1
44
51
  [0.2.0]: https://github.com/MatheusRich/ez_attributes/releases/tag/v0.2.0
45
52
  [0.1.0]: https://github.com/MatheusRich/ez_attributes/releases/tag/v0.2.0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ez_attributes (0.2.1)
4
+ ez_attributes (0.2.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -50,11 +50,11 @@ class User
50
50
  attributes :name, :age, email: 'guest@user.com'
51
51
  end
52
52
 
53
- User.new(name: 'Matz', age: 22)
53
+ user = User.new(name: 'Matz', age: 22)
54
54
  # => #<User:0x000055bac152f130 @name="Matz", @age=22, @email="guest@user.com">
55
55
 
56
56
  # EzAttributes will add getters for all fields too.
57
- User.name
57
+ user.name
58
58
  # => "Matz"
59
59
  ```
60
60
 
data/lib/ez_attributes.rb CHANGED
@@ -15,7 +15,7 @@
15
15
  # => #<User:0x000055bac152f130 @name="Matheus", @age=22, @email="guest@user.com">
16
16
  module EzAttributes
17
17
  # Gem version
18
- VERSION = '0.2.1'
18
+ VERSION = '0.2.2'
19
19
 
20
20
  # Attributes that won't have a getter to prevent conflicts with default methods
21
21
  EXCEPTIONS = [:class].freeze
@@ -26,7 +26,7 @@ module EzAttributes
26
26
  optional_args = args_with_default.map { |name, _| "#{name}: __args_with_default[:#{name}]" }
27
27
  init_args = (required_args + optional_args).join(', ')
28
28
 
29
- define_method('__args_with_default', -> { args_with_default.dup })
29
+ define_method('__args_with_default', -> { Marshal.load(Marshal.dump(args_with_default)) })
30
30
  private :__args_with_default
31
31
 
32
32
  all_args = args + args_with_default.keys
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ez_attributes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matheus Richard
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-20 00:00:00.000000000 Z
11
+ date: 2021-04-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Easily define initializers with keyword args. It supports required and
14
14
  optional args.