idecon 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: 2136d3af5a3e166dc3166ab129ffcca28aad3dc2bab6b97580e22beed289ed3c
4
- data.tar.gz: 94f9f6015043f7bb238e482cce1aff07e608aa5e1a5d559a6e3450b43a1df0da
3
+ metadata.gz: 1e198c12ffff3f2fa94e8799a43c4b995dcd7a2e07d1cf7959636cc19772d714
4
+ data.tar.gz: 922d2e430a4993e6e8362fcd45764f48eb4f6dc77c37fbbf4443d947ea56dddb
5
5
  SHA512:
6
- metadata.gz: 9108cc160dbc639bbb4f1af69f5ec6171e97a954296faf34a4f374f501f3fd7242c70d7fb5d0cb2c5b774519f1ab383a7ab337c3cdfc2e1fe196b0e555d2311a
7
- data.tar.gz: 000a7ea2c7946f89d47cb6bd5fe5e667159834bb38cb068157efdee2c7533d3bf4b65a39aae54719e990908871e7065dad85ea280ebff448d0ea3ad4eb0eaf2d
6
+ metadata.gz: 0eb01091b30fae43c07a4f983483f5aab04d2a354e50bf13ae9c761e13b272aec30dd79db52f3a8fa5c1eb19a764b7bfb054911512128f2bf865d09204df71c5
7
+ data.tar.gz: c48bf374e3d3ae6a83981d7bc371a9031d1a77edc939d68c447eabf00e7375f253ad1e1c6941d3cb2f00d4d3ef1cee51a5163721a02f23b74da655e5daea3644
data/.gitignore CHANGED
@@ -6,6 +6,7 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ /tmp.png
9
10
 
10
11
  # rspec failure tracking
11
12
  .rspec_status
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- idecon (0.1.0)
4
+ idecon (0.1.1)
5
5
  chunky_png
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # Idecon
2
2
 
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/idecon`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ This gem convert a string to an Identicon image (like it is on GitHub)
6
4
 
7
5
  ## Installation
8
6
 
@@ -22,7 +20,10 @@ Or install it yourself as:
22
20
 
23
21
  ## Usage
24
22
 
25
- TODO: Write usage instructions here
23
+ ```ruby
24
+ identicon = Idecon::Identicon.new(user_name, path)
25
+ identicon.generate
26
+ ```
26
27
 
27
28
  ## Development
28
29
 
@@ -32,7 +33,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
33
 
33
34
  ## Contributing
34
35
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/idecon. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
+ Bug reports and pull requests are welcome on GitHub at https://github.com/brshpl/idecon. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
37
 
37
38
  ## License
38
39
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Idecon
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  end
data/lib/idecon.rb CHANGED
@@ -39,6 +39,7 @@ module Idecon
39
39
  def color
40
40
  @color = @hash[23..32].scan(/([\w\d])([\w\d])([\w\d])/).map do |arr|
41
41
  color = 0
42
+ # Convert every character to a two-digit number, then get second digit
42
43
  arr.each_with_index do |c, i|
43
44
  color += 10**i * (c.to_i(36) + 10).to_s[1].to_i
44
45
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: idecon
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
  - Igor