abstractify 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 67ba8d4c2be1303327565c093e22518a82fd6022550273f7d072e982dc3773e2
4
- data.tar.gz: bd774084acf3d62196cdebe909f82c310facd18a209dc024f943e8f66f36b582
3
+ metadata.gz: e537b4494a1a2d2b30d9b185758130b62d7a3aca26f9a90d76549ac7ff6a892f
4
+ data.tar.gz: 48a53846ea7f6199882b53237222635aba20ec0ed8870c8dbff4a4d4fc5839bf
5
5
  SHA512:
6
- metadata.gz: 67b11a60c11a8a2c8b9e13f6dedf79e59d2b6df9560d13aa9a759f3153a22ed6029b4d2ba52d96eecaed692c4b1a2d77b4cd13cd3a54f6de667e8850bd807a59
7
- data.tar.gz: 21ab3094ffcc2bf1bfc1326ca392ad91035a686441fb1d903f048ef45d4a27b57debb39d0beadeb5afc33f81f97f9e6f55544549187e848eb82f98f3ef43a927
6
+ metadata.gz: 4912f9d1df41541aefae01fb99f5575e3e86b847253e0cdba76d6493c621d28380498e8516e00bc86e98142c09dd4bbe80cf5d19910cb39dc199da2348a5fe2e
7
+ data.tar.gz: 9cc99740305e3a26448ef17084507e9e05a48cf7068d0e4fb7e4a3219e0a5f9ca779d5853d53f8f2dec420cb15a76f24cbd059e2fed53cf1ac157df3f4f65ae6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.1.0
4
+
5
+ * Made it so a more specific error is thrown when abstract class isnt overridden (now throws AbstractClassError).
6
+
3
7
  ## 1.0.0
4
8
 
5
9
  * Initial release
data/abstractify.gemspec CHANGED
@@ -29,8 +29,6 @@ Gem::Specification.new do |spec|
29
29
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
30
30
  spec.require_paths = ['lib']
31
31
 
32
- #spec.add_dependency 'abstraction', '~> 0.0.4'
33
- #spec.add_dependency 'serialport', '~> 1.3'
34
32
  spec.add_development_dependency 'bundler', '~> 2.3'
35
33
  spec.add_development_dependency 'rake', '~> 13.0'
36
34
  spec.add_development_dependency 'rspec', '~> 3.12'
@@ -5,6 +5,12 @@ module Abstractify
5
5
  end
6
6
  end
7
7
 
8
+ class AbstractClassError < AbstractError
9
+ def initialize(msg="Can't instantiate abstract class directly")
10
+ super
11
+ end
12
+ end
13
+
8
14
  class AbstractMethodError < AbstractError
9
15
  def initialize(msg="Can't instantiate abstract class because some of its abstract methods have not been defined")
10
16
  super
@@ -35,7 +41,7 @@ module Abstractify
35
41
  end
36
42
 
37
43
  class_methods.define_method :new do |*args, **kwargs|
38
- raise AbstractError.new("Class #{self} is abstract") unless self < mod
44
+ raise AbstractClassError.new("Class #{self} is abstract") unless self < mod
39
45
 
40
46
  abstract_methods.each do |name|
41
47
  raise AbstractMethodMustExistError.new("Method #{name} must be defined") unless method_defined? name
@@ -1,3 +1,3 @@
1
1
  module Abstractify
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abstractify
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeffrey Phillips Freeman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-11 00:00:00.000000000 Z
11
+ date: 2023-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  - !ruby/object:Gem::Version
122
122
  version: '0'
123
123
  requirements: []
124
- rubygems_version: 3.4.16
124
+ rubygems_version: 3.4.17
125
125
  signing_key:
126
126
  specification_version: 4
127
127
  summary: Library for implementing true Abstract classes, throwing errors when class