convertable 0.1.2 → 0.1.3
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/Changelog.md +8 -0
- data/Gemfile.lock +1 -1
- data/lib/convertable/units.rb +3 -2
- data/lib/convertable/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e11686ab016b40f947f12493d03ab88e246f798a1e1cb26da5bc5d03c3ea818c
|
|
4
|
+
data.tar.gz: 0050566a7bd22e3b6159b934af14aca926f2948589663234e7a56c6843ab66d1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 357dae83bf62702ec78f0ce805cf7191eec6e71f05e0a811f0c10048677c8536b335e6598c6a37e51fce58ab17db393bf9a6ba7703bd711be8e80cee9f20ee9b
|
|
7
|
+
data.tar.gz: 02d184e4671b6f9e5dc4833fb7455de70f56e3c349a1f6feb1e5296d647f3f9cc5db845384374c8949ae1670072b632a9ccf7948427fb0e6eb795f17b587375c
|
data/Changelog.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## 0.1.3
|
|
2
|
+
|
|
3
|
+
* Convertable::Units#find can find unit given a string in multiple cases. e.g. snake-case, camel-case, upper-case, lower-case, etc.
|
|
4
|
+
|
|
5
|
+
## 0.1.2
|
|
6
|
+
|
|
7
|
+
* Add support for all currencies in https://github.com/RubyMoney/money
|
|
8
|
+
|
|
1
9
|
## 0.1.1
|
|
2
10
|
|
|
3
11
|
* Add Money measure
|
data/Gemfile.lock
CHANGED
data/lib/convertable/units.rb
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
module Convertable
|
|
2
2
|
module Units
|
|
3
3
|
def self.find(unit)
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
class_name = unit.underscore.downcase.camelize
|
|
5
|
+
if const_defined?(class_name)
|
|
6
|
+
const_get(class_name)
|
|
6
7
|
else
|
|
7
8
|
raise UnsupportedUnit.new(unit.camelize)
|
|
8
9
|
end
|
data/lib/convertable/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: convertable
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alex Wheeler
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-03-
|
|
11
|
+
date: 2019-03-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|