colorcode_convert_rgb 0.1.1 → 0.1.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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +4 -4
- data/lib/colorcode_convert_rgb/cli.rb +3 -3
- data/lib/colorcode_convert_rgb/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6414938695aab236aee8b6e1d7a68b3f597965e9dbc0000f8c293348b9171edb
|
4
|
+
data.tar.gz: 3c2953800d09fe74d97a9c2535446ef12566d491ef6710ee6e12df1cc8595ee3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b55d087ac3b40adb4c8b687de775d38dfd8ed965ceb095c3111597909b080d52ad4b483f115843942c22a4317ef394b640b91ca7e71dffbbfb7ac056e085048e
|
7
|
+
data.tar.gz: 2116f55c393ba22c328694390e37f94e2031838483f307a63ed08ff77ed59a642871db4b51576f47eeec2b11a72600d962febbac26359e55fc20b10d1810d1b4
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/colorcode_convert_rgb`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
4
|
|
5
|
-
|
5
|
+
This gem has the ability to convert hexadecimal color codes to RGB.
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -22,7 +22,7 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
-
|
25
|
+
Plese execute the to_ints method with a hexadecimal argument.
|
26
26
|
|
27
27
|
## Development
|
28
28
|
|
@@ -30,9 +30,9 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
30
30
|
|
31
31
|
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).
|
32
32
|
|
33
|
-
## Contributing
|
33
|
+
<!-- ## Contributing
|
34
34
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/colorcode_convert_rgb.
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/colorcode_convert_rgb. -->
|
36
36
|
|
37
37
|
|
38
38
|
## License
|
@@ -5,10 +5,10 @@ module ColorcodeConvertRgb
|
|
5
5
|
class CLI < Thor
|
6
6
|
desc "to_ints {Hexagonal_color_code}", "Converts a hexadecimal color code to a decimal number."
|
7
7
|
def to_ints(color)
|
8
|
-
if color.match(
|
9
|
-
hex = color
|
10
|
-
elsif color.match(/[#][a-fA-F0-9]{6}/)
|
8
|
+
if color.match(/^[#][a-fA-F0-9]{6}$/)
|
11
9
|
hex = color.delete("#")
|
10
|
+
elsif color.match(/^[a-fA-F0-9]{6}$/)
|
11
|
+
hex = color
|
12
12
|
else
|
13
13
|
return puts 'Please enter the correct code.(e.g. #ffffff or ffffff )'
|
14
14
|
end
|