initials 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +6 -2
- data/.gitignore +3 -0
- data/Gemfile +2 -0
- data/README.md +2 -2
- data/demo.png +0 -0
- data/lib/initials/svg.rb +1 -1
- data/lib/initials/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2dce220e10036fd5284e737264c5ed0a4f0f4e47211d4fec4812207e28dd3cf
|
4
|
+
data.tar.gz: 3eeebc342465b151e48ebd94d01e98d2f6a1bd0194851c5a2fc50d41103553af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 660d98bbbb542bf6a706614ab725c63f5d2e991236ff23ddaf443ec35ef2e0709677b51f4e3d94ffc9bea81f647d8135cf206513e07617710820cba2b71b7253
|
7
|
+
data.tar.gz: ddeb25f094cae8ffd4d8d7b01dc022b71898a45df031a231051d2f18bfce8a1b5392b9ed4e3ae41dba4398087ab7856a3f2f0f21c74dabed382cb5151c93998d
|
data/.github/workflows/ruby.yml
CHANGED
@@ -31,5 +31,9 @@ jobs:
|
|
31
31
|
with:
|
32
32
|
ruby-version: ${{ matrix.ruby-version }}
|
33
33
|
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
34
|
-
- name: Run tests
|
35
|
-
|
34
|
+
- name: Run tests and publish code coverage
|
35
|
+
uses: paambaati/codeclimate-action@v2.7.5
|
36
|
+
env:
|
37
|
+
CC_TEST_REPORTER_ID: 9c690ab71ab481ac45785c4010ff30f93a45774e5ad6f03ec448b6e2b5bc39b4
|
38
|
+
with:
|
39
|
+
coverageCommand: bundle exec rake
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Initials
|
1
|
+
# ![demo](demo.png) Initials [![Maintainability](https://api.codeclimate.com/v1/badges/fb865ec4adcd0671dc48/maintainability)](https://codeclimate.com/github/thutterer/initials/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/fb865ec4adcd0671dc48/test_coverage)](https://codeclimate.com/github/thutterer/initials/test_coverage)
|
2
2
|
|
3
3
|
Don't want to implement user avatar uploads but still have basic avatars to distinguish users and brigthen up your app?
|
4
4
|
|
@@ -30,7 +30,7 @@ No special configuration is required to work with Ruby on Rails, but for your co
|
|
30
30
|
|
31
31
|
```ruby
|
32
32
|
def user_avatar(name, **options)
|
33
|
-
Initials.svg(name, options)
|
33
|
+
Initials.svg(name, **options)
|
34
34
|
end
|
35
35
|
```
|
36
36
|
|
data/demo.png
ADDED
Binary file
|
data/lib/initials/svg.rb
CHANGED
@@ -12,7 +12,7 @@ module Initials
|
|
12
12
|
svg = [
|
13
13
|
"<svg width='#{size}' height='#{size}'>",
|
14
14
|
"<circle cx='#{size / 2}' cy='#{size / 2}' r='#{size / 2}' fill='#{fill}' />",
|
15
|
-
"<text x='50%' y='50%' fill='white' fill-opacity='0.75' dominant-baseline='central' text-anchor='middle' style='font: bold #{font_size}px sans-serif;'>",
|
15
|
+
"<text x='50%' y='50%' fill='white' fill-opacity='0.75' dominant-baseline='central' text-anchor='middle' style='font: bold #{font_size}px sans-serif; user-select: none;'>",
|
16
16
|
"#{initials}",
|
17
17
|
"</text>",
|
18
18
|
"</svg>"
|
data/lib/initials/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: initials
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Hutterer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-06-
|
11
|
+
date: 2021-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -69,6 +69,7 @@ files:
|
|
69
69
|
- Rakefile
|
70
70
|
- bin/console
|
71
71
|
- bin/setup
|
72
|
+
- demo.png
|
72
73
|
- initials.gemspec
|
73
74
|
- lib/initials.rb
|
74
75
|
- lib/initials/svg.rb
|