romanic 0.0.1 → 0.0.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 +7 -0
- data/README.md +0 -1
- data/lib/romanic/romanic_integers.rb +2 -2
- data/lib/romanic/version.rb +1 -1
- metadata +11 -14
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: fd3f6720b03ce5e3b177b5ff71ff4874b560aa673cf2a5d6dedad26f7c58c0e3
|
4
|
+
data.tar.gz: 87ac521867002778ef46bbe3bd480173573b66a4bcdb4ec0ae1f6b01cf7f1d04
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 508c37b7d6a3c0443c75384285380dff29c2c45223e6d9f2b587e9f43671d6f5963c60a1a720f4d36d05730edbd9b4b6d9f2b25948067b5b85b93759fec1d99c
|
7
|
+
data.tar.gz: 11417985e7699b16fa3555cf435dee96a3f5b4ea8ec900864d0fe548d20bc9798eec155421ccd58d02b6aaebc25e084ff878e423e453765f5e507e2153775e7c
|
data/README.md
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
# Romanic
|
2
|
-
==========
|
3
2
|
This is a simple gem written as a class demonstration that converts integers to roman numerals and roman numerals to integers. It adds methods to the Integer and String classes that allow a user to send a 'roman' message to either of these types of objects and get an appropriate response. More details on how to use the gem can be found below.
|
4
3
|
|
5
4
|
|
@@ -3,7 +3,7 @@ module Romanic
|
|
3
3
|
# Convert integers to roman numerals
|
4
4
|
def to_roman
|
5
5
|
number = self
|
6
|
-
return nil unless number.class ==
|
6
|
+
return nil unless number.class == Integer
|
7
7
|
return nil unless number > 0 and number < 5000
|
8
8
|
ROMAN_LOOKUP.inject("") do |result, (roman, arabic)|
|
9
9
|
# divmod() returns array of quotient and modulus
|
@@ -16,4 +16,4 @@ module Romanic
|
|
16
16
|
end
|
17
17
|
|
18
18
|
# Add methods to the Integer class
|
19
|
-
Integer.send :include, Romanic::RomanicIntegers
|
19
|
+
Integer.send :include, Romanic::RomanicIntegers
|
data/lib/romanic/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: romanic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Klingon Code Warrior
|
9
|
-
autorequire:
|
8
|
+
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2022-02-02 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
13
|
description: Converts strings and integers to and from roman numerals
|
15
14
|
email:
|
@@ -18,7 +17,7 @@ executables: []
|
|
18
17
|
extensions: []
|
19
18
|
extra_rdoc_files: []
|
20
19
|
files:
|
21
|
-
- .gitignore
|
20
|
+
- ".gitignore"
|
22
21
|
- Gemfile
|
23
22
|
- LICENSE
|
24
23
|
- README.md
|
@@ -32,27 +31,25 @@ files:
|
|
32
31
|
- tests/romanic_tests.rb
|
33
32
|
homepage: https://github.com/profh/romanic
|
34
33
|
licenses: []
|
35
|
-
|
34
|
+
metadata: {}
|
35
|
+
post_install_message:
|
36
36
|
rdoc_options: []
|
37
37
|
require_paths:
|
38
38
|
- lib
|
39
39
|
required_ruby_version: !ruby/object:Gem::Requirement
|
40
|
-
none: false
|
41
40
|
requirements:
|
42
|
-
- -
|
41
|
+
- - ">="
|
43
42
|
- !ruby/object:Gem::Version
|
44
43
|
version: '0'
|
45
44
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
46
|
-
none: false
|
47
45
|
requirements:
|
48
|
-
- -
|
46
|
+
- - ">="
|
49
47
|
- !ruby/object:Gem::Version
|
50
48
|
version: '0'
|
51
49
|
requirements: []
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
specification_version: 3
|
50
|
+
rubygems_version: 3.0.9
|
51
|
+
signing_key:
|
52
|
+
specification_version: 4
|
56
53
|
summary: This gem adds a method to the Integer class called to_roman, which converts
|
57
54
|
an integer between 1 and 5000 to roman numerals. It also adds a method to String
|
58
55
|
called from_roman which converts roman numerals to integers.
|