roman_numbers 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: 9bda07541b713948b1e92d369048d61cf19d3fe0
4
- data.tar.gz: fe2074c80f27fcc975bb94c987441437942b0fed
3
+ metadata.gz: ef894b8b04ca12f5e8c4db294b242e84403ac80f
4
+ data.tar.gz: 41b70cb81805321baa09518bbdd561ce9c6f91f5
5
5
  SHA512:
6
- metadata.gz: 8f02f887bb4d2e2e53df857dfe9c94c8c69cdbc4e211e29136ffd44f1fed99720690baca98d72f6892dff845ebae41c65db974566a9bf319100ec94060675a13
7
- data.tar.gz: 4e765195cf0b41405b5cac0f22f560090fad0da61430f6938e1cc3104f1042f01242475d2a44825c8201746da3a2418a7be6c438e6bbb2de63a57ee023a08912
6
+ metadata.gz: fce4ebb4b730a4df020ff976595e2285159e18397c0f6249346c68d24716d80e5c6328ce0a4f324398efe3cca230fd3eff71aed3d096c4e02a98e6fd2738a8af
7
+ data.tar.gz: 4f54c23dc9015dd820731022b28e3523ed3e776143ddabf63edbf2761a3394ee2d3cfe658a5e343d4f304cb9b0032a21762ef613799e3f58ff21d32924097434
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # RomanNumbers
2
2
 
3
- Conversion between Integers and Roman Numbers
3
+ Conversion between Decimals and Roman Numbers
4
4
 
5
5
  Roman numerals are based on seven symbols:
6
6
 
@@ -64,7 +64,7 @@ By explicitly using RomanNumber class:
64
64
  By directly on String and Integer objects:
65
65
 
66
66
 
67
- > 'MCMXLIV'.from_roman_to_integer
67
+ > 'MCMXLIV'.from_roman_to_decimal
68
68
 
69
69
  1944
70
70
 
@@ -74,7 +74,7 @@ By directly on String and Integer objects:
74
74
  "MCMXLIV"
75
75
 
76
76
 
77
- > 'MMMMMX'.from_roman_to_integer
77
+ > 'MMMMMX'.from_roman_to_decimal
78
78
 
79
79
  RomanNumbers::InvalidInputError
80
80
 
@@ -1,3 +1,3 @@
1
1
  module RomanNumbers
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
8
8
  spec.version = RomanNumbers::VERSION
9
9
  spec.authors = ["Munish Goyal"]
10
10
  spec.email = ["munishapc@gmail.com"]
11
- spec.summary = %q{Conversion between Integers and Roman Numbers}
12
- spec.description = %q{Conversion between Integers and Roman Numbers}
11
+ spec.summary = %q{Conversion between Decimals and Roman Numbers}
12
+ spec.description = %q{Conversion between Decimals and Roman Numbers}
13
13
  spec.homepage = "https://github.com/goyalmunish/roman_numbers"
14
14
  spec.license = "MIT"
15
15
 
@@ -1,46 +1,46 @@
1
1
  module Helpers
2
2
  def input_set_1
3
3
  [
4
- {integer: 39, roman: 'XXXIX'},
5
- {integer: 390, roman: 'CCCXC'},
4
+ {decimal: 39, roman: 'XXXIX'},
5
+ {decimal: 390, roman: 'CCCXC'},
6
6
  ]
7
7
  end
8
8
  module_function :input_set_1
9
9
  def input_set_2
10
10
  [
11
- {integer: 4, roman: 'IV'},
12
- {integer: 9, roman: 'IX'},
13
- {integer: 40, roman: 'XL'},
14
- {integer: 90, roman: 'XC'},
15
- {integer: 400, roman: 'CD'},
16
- {integer: 900, roman: 'CM'},
11
+ {decimal: 4, roman: 'IV'},
12
+ {decimal: 9, roman: 'IX'},
13
+ {decimal: 40, roman: 'XL'},
14
+ {decimal: 90, roman: 'XC'},
15
+ {decimal: 400, roman: 'CD'},
16
+ {decimal: 900, roman: 'CM'},
17
17
  ]
18
18
  end
19
19
  module_function :input_set_2
20
20
  def valid_inputs
21
21
  [
22
- {integer: 1, roman: 'I'},
23
- {integer: 5, roman: 'V'},
24
- {integer: 10, roman: 'X'},
25
- {integer: 50, roman: 'L'},
26
- {integer: 100, roman: 'C'},
27
- {integer: 500, roman: 'D'},
28
- {integer: 1000, roman: 'M'},
29
- {integer: 4, roman: 'IV'},
30
- {integer: 9, roman: 'IX'},
31
- {integer: 40, roman: 'XL'},
32
- {integer: 90, roman: 'XC'},
33
- {integer: 400, roman: 'CD'},
34
- {integer: 900, roman: 'CM'},
35
- {integer: 207, roman: 'CCVII'},
36
- {integer: 1066, roman: 'MLXVI'},
37
- {integer: 44, roman: 'XLIV'},
38
- {integer: 49, roman: 'XLIX'},
39
- {integer: 904, roman: 'CMIV'},
40
- {integer: 944, roman: 'CMXLIV'},
41
- {integer: 1904, roman: 'MCMIV'},
42
- {integer: 1944, roman: 'MCMXLIV'},
43
- {integer: 3999, roman: 'MMMCMXCIX'},
22
+ {decimal: 1, roman: 'I'},
23
+ {decimal: 5, roman: 'V'},
24
+ {decimal: 10, roman: 'X'},
25
+ {decimal: 50, roman: 'L'},
26
+ {decimal: 100, roman: 'C'},
27
+ {decimal: 500, roman: 'D'},
28
+ {decimal: 1000, roman: 'M'},
29
+ {decimal: 4, roman: 'IV'},
30
+ {decimal: 9, roman: 'IX'},
31
+ {decimal: 40, roman: 'XL'},
32
+ {decimal: 90, roman: 'XC'},
33
+ {decimal: 400, roman: 'CD'},
34
+ {decimal: 900, roman: 'CM'},
35
+ {decimal: 207, roman: 'CCVII'},
36
+ {decimal: 1066, roman: 'MLXVI'},
37
+ {decimal: 44, roman: 'XLIV'},
38
+ {decimal: 49, roman: 'XLIX'},
39
+ {decimal: 904, roman: 'CMIV'},
40
+ {decimal: 944, roman: 'CMXLIV'},
41
+ {decimal: 1904, roman: 'MCMIV'},
42
+ {decimal: 1944, roman: 'MCMXLIV'},
43
+ {decimal: 3999, roman: 'MMMCMXCIX'},
44
44
  ]
45
45
  end
46
46
  module_function :valid_inputs
@@ -13,8 +13,8 @@ module RomanNumbers
13
13
  shared_examples_for "works_with_valid_integral_input_and_roman_output_collection" do |array|
14
14
  # Note: here array is array of hashes
15
15
  array.each do |hsh|
16
- it %Q{returns #{hsh[:roman]} for #{hsh[:integer]} as input} do
17
- RomanNumber.new(hsh[:integer]).convert_decimal_to_roman.should == hsh[:roman]
16
+ it %Q{returns #{hsh[:roman]} for #{hsh[:decimal]} as input} do
17
+ RomanNumber.new(hsh[:decimal]).convert_decimal_to_roman.should == hsh[:roman]
18
18
  end
19
19
  end
20
20
  end
@@ -38,8 +38,8 @@ module RomanNumbers
38
38
  shared_examples_for "works_with_valid_roman_input_and_integral_output_collection" do |array|
39
39
  # Note: here array is array of hashes
40
40
  array.each do |hsh|
41
- it %Q{returns #{hsh[:integer]} for #{hsh[:roman]} as input} do
42
- RomanNumber.new(hsh[:roman]).convert_roman_to_decimal.should == hsh[:integer]
41
+ it %Q{returns #{hsh[:decimal]} for #{hsh[:roman]} as input} do
42
+ RomanNumber.new(hsh[:roman]).convert_roman_to_decimal.should == hsh[:decimal]
43
43
  end
44
44
  end
45
45
  end
@@ -81,8 +81,8 @@ module RomanNumbers
81
81
 
82
82
  context 'For Valid Input' do
83
83
  Helpers.valid_inputs.each do |hsh|
84
- it %Q{returns #{hsh[:roman]} for #{hsh[:integer]} as input} do
85
- RomanNumber.new(hsh[:roman]).convert_roman_to_decimal.should == hsh[:integer]
84
+ it %Q{returns #{hsh[:roman]} for #{hsh[:decimal]} as input} do
85
+ RomanNumber.new(hsh[:roman]).convert_roman_to_decimal.should == hsh[:decimal]
86
86
  end
87
87
  end
88
88
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roman_numbers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Munish Goyal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-04 00:00:00.000000000 Z
11
+ date: 2015-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -94,7 +94,7 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
- description: Conversion between Integers and Roman Numbers
97
+ description: Conversion between Decimals and Roman Numbers
98
98
  email:
99
99
  - munishapc@gmail.com
100
100
  executables: []
@@ -140,7 +140,7 @@ rubyforge_project:
140
140
  rubygems_version: 2.4.5
141
141
  signing_key:
142
142
  specification_version: 4
143
- summary: Conversion between Integers and Roman Numbers
143
+ summary: Conversion between Decimals and Roman Numbers
144
144
  test_files:
145
145
  - autotest/discover.rb
146
146
  - spec/helpers.rb