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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: de9e1bb602a6fc3316f87c15b9bd75b2fe7ca971efd243f49759930009babfb8
4
- data.tar.gz: a6329842aad765a418db04a3d0efcdab4740909c9181a0e10f55d634d66f6f67
3
+ metadata.gz: 6414938695aab236aee8b6e1d7a68b3f597965e9dbc0000f8c293348b9171edb
4
+ data.tar.gz: 3c2953800d09fe74d97a9c2535446ef12566d491ef6710ee6e12df1cc8595ee3
5
5
  SHA512:
6
- metadata.gz: 22add2bd1f01c8121d00912738769e9e2df9c7d4d864290362a01598380eac5a2a10c3dddd3b03cee37bab942ca4d4374f9184ba6bde1802a0afb172b23791e8
7
- data.tar.gz: 7a7b4f9ec31b0e6bb6d341e74415067c4e2154af3349111c5941c04339574c2471257c994170c386c168d9926e6807d28528c4bb94cb56b3f4b4fbc93d9292f9
6
+ metadata.gz: b55d087ac3b40adb4c8b687de775d38dfd8ed965ceb095c3111597909b080d52ad4b483f115843942c22a4317ef394b640b91ca7e71dffbbfb7ac056e085048e
7
+ data.tar.gz: 2116f55c393ba22c328694390e37f94e2031838483f307a63ed08ff77ed59a642871db4b51576f47eeec2b11a72600d962febbac26359e55fc20b10d1810d1b4
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- colorcode_convert_rgb (0.1.1)
4
+ colorcode_convert_rgb (0.1.2)
5
5
  thor
6
6
 
7
7
  GEM
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
- TODO: Delete this and the text above, and describe your gem
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
- TODO: Write usage instructions here
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(/[a-fA-F0-9]{6}/)
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
@@ -1,3 +1,3 @@
1
1
  module ColorcodeConvertRgb
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: colorcode_convert_rgb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - tomohiro