abstractify 1.0.0 → 1.1.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.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +8 -0
- data/README.md +6 -0
- data/abstractify.gemspec +0 -3
- data/lib/abstractify/abstract.rb +7 -1
- data/lib/abstractify/app_info.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5768f68ee52c9bf85364c1dcb7fd2f6cd221ce4e02581cd4b32ed8e0f3264901
|
4
|
+
data.tar.gz: 5c869fe2bdfccabe7c40342038c015c0d4d723cedac7798e04345480a84c5369
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ecd4967d40eba1f1bf64e5e046ba0d63d0673ebd7668afe9a12ae175c94d6dc80f0e58a0ceeb620307974b034025c43f1beec8c691d0ab341d18e0684800e3e
|
7
|
+
data.tar.gz: e0b9f2e947260f3bb292b2c1fde9c92951c6d408f30958b85123bfe00e026385da602c0b97052446c5d18cd4e5e7a3d136de68d1b63b6b4a715ffc0097772808
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -24,6 +24,12 @@ TODO: Write usage instructions here
|
|
24
24
|
|
25
25
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
26
26
|
|
27
|
+
In order to run the tests issue the following command.
|
28
|
+
|
29
|
+
```bash
|
30
|
+
bundle exec rspec
|
31
|
+
```
|
32
|
+
|
27
33
|
## Contributing
|
28
34
|
|
29
35
|
Bug reports and pull requests are welcome on GitHub at https://git.qoto.org/abstractify/abstractify
|
data/abstractify.gemspec
CHANGED
@@ -25,12 +25,9 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
26
26
|
f.match(%r{^(test|spec|features)/})
|
27
27
|
end
|
28
|
-
spec.bindir = 'exe'
|
29
28
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
30
29
|
spec.require_paths = ['lib']
|
31
30
|
|
32
|
-
#spec.add_dependency 'abstraction', '~> 0.0.4'
|
33
|
-
#spec.add_dependency 'serialport', '~> 1.3'
|
34
31
|
spec.add_development_dependency 'bundler', '~> 2.3'
|
35
32
|
spec.add_development_dependency 'rake', '~> 13.0'
|
36
33
|
spec.add_development_dependency 'rspec', '~> 3.12'
|
data/lib/abstractify/abstract.rb
CHANGED
@@ -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
|
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
|
data/lib/abstractify/app_info.rb
CHANGED
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.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeffrey Phillips Freeman
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-13 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.
|
124
|
+
rubygems_version: 3.4.19
|
125
125
|
signing_key:
|
126
126
|
specification_version: 4
|
127
127
|
summary: Library for implementing true Abstract classes, throwing errors when class
|