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 +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +1 -1
- data/README.md +6 -5
- data/lib/idecon/version.rb +1 -1
- data/lib/idecon.rb +1 -0
- 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: 1e198c12ffff3f2fa94e8799a43c4b995dcd7a2e07d1cf7959636cc19772d714
|
4
|
+
data.tar.gz: 922d2e430a4993e6e8362fcd45764f48eb4f6dc77c37fbbf4443d947ea56dddb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0eb01091b30fae43c07a4f983483f5aab04d2a354e50bf13ae9c761e13b272aec30dd79db52f3a8fa5c1eb19a764b7bfb054911512128f2bf865d09204df71c5
|
7
|
+
data.tar.gz: c48bf374e3d3ae6a83981d7bc371a9031d1a77edc939d68c447eabf00e7375f253ad1e1c6941d3cb2f00d4d3ef1cee51a5163721a02f23b74da655e5daea3644
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# Idecon
|
2
2
|
|
3
|
-
|
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
|
-
|
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/
|
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
|
|
data/lib/idecon/version.rb
CHANGED
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
|