initialjs-rails 0.2.0.4 → 0.2.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +41 -0
- data/Appraisals +15 -0
- data/CHANGELOG.md +5 -0
- data/README.md +2 -1
- data/Rakefile +11 -1
- data/gemfiles/.bundle/config +2 -0
- data/gemfiles/rails_3.2.gemfile +7 -0
- data/gemfiles/rails_3.2.gemfile.lock +88 -0
- data/gemfiles/rails_4.2.gemfile +7 -0
- data/gemfiles/rails_4.2.gemfile.lock +92 -0
- data/gemfiles/rails_5.0.gemfile +7 -0
- data/gemfiles/rails_5.0.gemfile.lock +91 -0
- data/gemfiles/rails_5.1.gemfile +7 -0
- data/gemfiles/rails_5.1.gemfile.lock +91 -0
- data/initialjs-rails.gemspec +2 -0
- data/lib/initialjs-rails/version.rb +1 -1
- data/lib/initialjs-rails/view_helpers.rb +10 -3
- metadata +42 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e45ef998e2d3d66cd19be051af21d319bc672c9
|
4
|
+
data.tar.gz: ef296d4d417e84fb0dd72644816bc7c56883051d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 415947ea7941bb4dc51a87888a985ddfc3ae182357c984dadc4182df57a7374f0ba9b0802004854d0d9038594d2eebe3e4ba3d18bb44ebad8758a4fdd03f39a6
|
7
|
+
data.tar.gz: '09748cb7658a07c611bc2600cb0f06bac1cfe6aa2005bfc527ff6efb10db37f5337a19ae3f9015af0c14209bf574e6f515ff1892b014873bb1989582a3537453'
|
data/.travis.yml
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
language: ruby
|
2
|
+
|
3
|
+
sudo: false
|
4
|
+
|
5
|
+
cache: bundler
|
6
|
+
|
7
|
+
script: "bundle exec rake"
|
8
|
+
|
9
|
+
rvm:
|
10
|
+
- 1.9.3
|
11
|
+
- 2.0.0
|
12
|
+
- 2.1.5
|
13
|
+
- 2.2.0
|
14
|
+
- 2.2.4
|
15
|
+
- 2.3.0
|
16
|
+
|
17
|
+
gemfile:
|
18
|
+
- gemfiles/rails_3.2.gemfile
|
19
|
+
- gemfiles/rails_4.2.gemfile
|
20
|
+
- gemfiles/rails_5.0.gemfile
|
21
|
+
- gemfiles/rails_5.1.gemfile
|
22
|
+
|
23
|
+
matrix:
|
24
|
+
fast_finish: true
|
25
|
+
exclude:
|
26
|
+
- rvm: 1.9.3
|
27
|
+
gemfile: gemfiles/rails_5.0.gemfile
|
28
|
+
- rvm: 1.9.3
|
29
|
+
gemfile: gemfiles/rails_5.1.gemfile
|
30
|
+
- rvm: 2.0.0
|
31
|
+
gemfile: gemfiles/rails_5.0.gemfile
|
32
|
+
- rvm: 2.0.0
|
33
|
+
gemfile: gemfiles/rails_5.1.gemfile
|
34
|
+
- rvm: 2.1.5
|
35
|
+
gemfile: gemfiles/rails_5.0.gemfile
|
36
|
+
- rvm: 2.1.5
|
37
|
+
gemfile: gemfiles/rails_5.1.gemfile
|
38
|
+
- rvm: 2.2.0
|
39
|
+
gemfile: gemfiles/rails_5.0.gemfile
|
40
|
+
- rvm: 2.2.0
|
41
|
+
gemfile: gemfiles/rails_5.1.gemfile
|
data/Appraisals
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
appraise "rails-3.2" do
|
2
|
+
gem 'activemodel', '~> 3.2.0'
|
3
|
+
end
|
4
|
+
|
5
|
+
appraise "rails-4.2" do
|
6
|
+
gem "activemodel", '~> 4.2.0'
|
7
|
+
end
|
8
|
+
|
9
|
+
appraise "rails-5.0" do
|
10
|
+
gem "activemodel", '~> 5.0.0'
|
11
|
+
end
|
12
|
+
|
13
|
+
appraise "rails-5.1" do
|
14
|
+
gem "activemodel", '~> 5.1.0'
|
15
|
+
end
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# initialjs-rails
|
1
|
+
# initialjs-rails [![Build Status](https://travis-ci.org/dgilperez/initialjs-rails.svg?branch=master)](https://travis-ci.org/dgilperez/initialjs-rails)
|
2
2
|
|
3
3
|
[initial.js](https://github.com/judesfernando/initial.js) is a simple jQuery plugin to make Gmail-like text avatars for profile pictures using SVG.
|
4
4
|
|
@@ -42,6 +42,7 @@ For extra simplicity, you can use this helper in your view to generate your avat
|
|
42
42
|
avatar_image(user, round_corners: false) # => disable round corners
|
43
43
|
avatar_image(user, count: 2) # => Number of characters shown in the image
|
44
44
|
avatar_image(user, color: 'black') # => Text color black. You can also provide any color in hex format: #000
|
45
|
+
avatar_image(user, src: some_path) # => Adds src of alternative image for browser does not support SVG
|
45
46
|
|
46
47
|
## Development
|
47
48
|
|
data/Rakefile
CHANGED
@@ -1 +1,11 @@
|
|
1
|
-
require
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler/gem_tasks'
|
3
|
+
require 'rspec/core/rake_task'
|
4
|
+
|
5
|
+
RSpec::Core::RakeTask.new(:spec)
|
6
|
+
task default: :spec
|
7
|
+
|
8
|
+
desc 'Open an irb session preloaded with this library'
|
9
|
+
task :console do
|
10
|
+
sh 'irb -Ilib -rvalidates_zipcode'
|
11
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ..
|
3
|
+
specs:
|
4
|
+
initialjs-rails (0.2.0.5)
|
5
|
+
railties (>= 3.1, < 6.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
actionpack (3.2.22.5)
|
11
|
+
activemodel (= 3.2.22.5)
|
12
|
+
activesupport (= 3.2.22.5)
|
13
|
+
builder (~> 3.0.0)
|
14
|
+
erubis (~> 2.7.0)
|
15
|
+
journey (~> 1.0.4)
|
16
|
+
rack (~> 1.4.5)
|
17
|
+
rack-cache (~> 1.2)
|
18
|
+
rack-test (~> 0.6.1)
|
19
|
+
sprockets (~> 2.2.1)
|
20
|
+
activemodel (3.2.22.5)
|
21
|
+
activesupport (= 3.2.22.5)
|
22
|
+
builder (~> 3.0.0)
|
23
|
+
activesupport (3.2.22.5)
|
24
|
+
i18n (~> 0.6, >= 0.6.4)
|
25
|
+
multi_json (~> 1.0)
|
26
|
+
appraisal (2.2.0)
|
27
|
+
bundler
|
28
|
+
rake
|
29
|
+
thor (>= 0.14.0)
|
30
|
+
builder (3.0.4)
|
31
|
+
diff-lcs (1.3)
|
32
|
+
erubis (2.7.0)
|
33
|
+
hike (1.2.3)
|
34
|
+
i18n (0.8.5)
|
35
|
+
journey (1.0.4)
|
36
|
+
json (1.8.6)
|
37
|
+
multi_json (1.12.1)
|
38
|
+
rack (1.4.7)
|
39
|
+
rack-cache (1.7.0)
|
40
|
+
rack (>= 0.4)
|
41
|
+
rack-ssl (1.3.4)
|
42
|
+
rack
|
43
|
+
rack-test (0.6.3)
|
44
|
+
rack (>= 1.0)
|
45
|
+
railties (3.2.22.5)
|
46
|
+
actionpack (= 3.2.22.5)
|
47
|
+
activesupport (= 3.2.22.5)
|
48
|
+
rack-ssl (~> 1.3.2)
|
49
|
+
rake (>= 0.8.7)
|
50
|
+
rdoc (~> 3.4)
|
51
|
+
thor (>= 0.14.6, < 2.0)
|
52
|
+
rake (10.5.0)
|
53
|
+
rdoc (3.12.2)
|
54
|
+
json (~> 1.4)
|
55
|
+
rspec (3.6.0)
|
56
|
+
rspec-core (~> 3.6.0)
|
57
|
+
rspec-expectations (~> 3.6.0)
|
58
|
+
rspec-mocks (~> 3.6.0)
|
59
|
+
rspec-core (3.6.0)
|
60
|
+
rspec-support (~> 3.6.0)
|
61
|
+
rspec-expectations (3.6.0)
|
62
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
63
|
+
rspec-support (~> 3.6.0)
|
64
|
+
rspec-mocks (3.6.0)
|
65
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
66
|
+
rspec-support (~> 3.6.0)
|
67
|
+
rspec-support (3.6.0)
|
68
|
+
sprockets (2.2.3)
|
69
|
+
hike (~> 1.2)
|
70
|
+
multi_json (~> 1.0)
|
71
|
+
rack (~> 1.0)
|
72
|
+
tilt (~> 1.1, != 1.3.0)
|
73
|
+
thor (0.19.4)
|
74
|
+
tilt (1.4.1)
|
75
|
+
|
76
|
+
PLATFORMS
|
77
|
+
ruby
|
78
|
+
|
79
|
+
DEPENDENCIES
|
80
|
+
activemodel (~> 3.2.0)
|
81
|
+
appraisal
|
82
|
+
bundler (~> 1.9)
|
83
|
+
initialjs-rails!
|
84
|
+
rake (~> 10.0)
|
85
|
+
rspec
|
86
|
+
|
87
|
+
BUNDLED WITH
|
88
|
+
1.14.6
|
@@ -0,0 +1,92 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ..
|
3
|
+
specs:
|
4
|
+
initialjs-rails (0.2.0.5)
|
5
|
+
railties (>= 3.1, < 6.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
actionpack (4.2.9)
|
11
|
+
actionview (= 4.2.9)
|
12
|
+
activesupport (= 4.2.9)
|
13
|
+
rack (~> 1.6)
|
14
|
+
rack-test (~> 0.6.2)
|
15
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
16
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
17
|
+
actionview (4.2.9)
|
18
|
+
activesupport (= 4.2.9)
|
19
|
+
builder (~> 3.1)
|
20
|
+
erubis (~> 2.7.0)
|
21
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
22
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
23
|
+
activemodel (4.2.9)
|
24
|
+
activesupport (= 4.2.9)
|
25
|
+
builder (~> 3.1)
|
26
|
+
activesupport (4.2.9)
|
27
|
+
i18n (~> 0.7)
|
28
|
+
minitest (~> 5.1)
|
29
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
30
|
+
tzinfo (~> 1.1)
|
31
|
+
appraisal (2.2.0)
|
32
|
+
bundler
|
33
|
+
rake
|
34
|
+
thor (>= 0.14.0)
|
35
|
+
builder (3.2.3)
|
36
|
+
diff-lcs (1.3)
|
37
|
+
erubis (2.7.0)
|
38
|
+
i18n (0.8.5)
|
39
|
+
loofah (2.0.3)
|
40
|
+
nokogiri (>= 1.5.9)
|
41
|
+
mini_portile2 (2.2.0)
|
42
|
+
minitest (5.10.2)
|
43
|
+
nokogiri (1.8.0)
|
44
|
+
mini_portile2 (~> 2.2.0)
|
45
|
+
rack (1.6.8)
|
46
|
+
rack-test (0.6.3)
|
47
|
+
rack (>= 1.0)
|
48
|
+
rails-deprecated_sanitizer (1.0.3)
|
49
|
+
activesupport (>= 4.2.0.alpha)
|
50
|
+
rails-dom-testing (1.0.8)
|
51
|
+
activesupport (>= 4.2.0.beta, < 5.0)
|
52
|
+
nokogiri (~> 1.6)
|
53
|
+
rails-deprecated_sanitizer (>= 1.0.1)
|
54
|
+
rails-html-sanitizer (1.0.3)
|
55
|
+
loofah (~> 2.0)
|
56
|
+
railties (4.2.9)
|
57
|
+
actionpack (= 4.2.9)
|
58
|
+
activesupport (= 4.2.9)
|
59
|
+
rake (>= 0.8.7)
|
60
|
+
thor (>= 0.18.1, < 2.0)
|
61
|
+
rake (10.5.0)
|
62
|
+
rspec (3.6.0)
|
63
|
+
rspec-core (~> 3.6.0)
|
64
|
+
rspec-expectations (~> 3.6.0)
|
65
|
+
rspec-mocks (~> 3.6.0)
|
66
|
+
rspec-core (3.6.0)
|
67
|
+
rspec-support (~> 3.6.0)
|
68
|
+
rspec-expectations (3.6.0)
|
69
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
70
|
+
rspec-support (~> 3.6.0)
|
71
|
+
rspec-mocks (3.6.0)
|
72
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
73
|
+
rspec-support (~> 3.6.0)
|
74
|
+
rspec-support (3.6.0)
|
75
|
+
thor (0.19.4)
|
76
|
+
thread_safe (0.3.6)
|
77
|
+
tzinfo (1.2.3)
|
78
|
+
thread_safe (~> 0.1)
|
79
|
+
|
80
|
+
PLATFORMS
|
81
|
+
ruby
|
82
|
+
|
83
|
+
DEPENDENCIES
|
84
|
+
activemodel (~> 4.2.0)
|
85
|
+
appraisal
|
86
|
+
bundler (~> 1.9)
|
87
|
+
initialjs-rails!
|
88
|
+
rake (~> 10.0)
|
89
|
+
rspec
|
90
|
+
|
91
|
+
BUNDLED WITH
|
92
|
+
1.14.6
|
@@ -0,0 +1,91 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ..
|
3
|
+
specs:
|
4
|
+
initialjs-rails (0.2.0.5)
|
5
|
+
railties (>= 3.1, < 6.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
actionpack (5.0.4)
|
11
|
+
actionview (= 5.0.4)
|
12
|
+
activesupport (= 5.0.4)
|
13
|
+
rack (~> 2.0)
|
14
|
+
rack-test (~> 0.6.3)
|
15
|
+
rails-dom-testing (~> 2.0)
|
16
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
17
|
+
actionview (5.0.4)
|
18
|
+
activesupport (= 5.0.4)
|
19
|
+
builder (~> 3.1)
|
20
|
+
erubis (~> 2.7.0)
|
21
|
+
rails-dom-testing (~> 2.0)
|
22
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
23
|
+
activemodel (5.0.4)
|
24
|
+
activesupport (= 5.0.4)
|
25
|
+
activesupport (5.0.4)
|
26
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
27
|
+
i18n (~> 0.7)
|
28
|
+
minitest (~> 5.1)
|
29
|
+
tzinfo (~> 1.1)
|
30
|
+
appraisal (2.2.0)
|
31
|
+
bundler
|
32
|
+
rake
|
33
|
+
thor (>= 0.14.0)
|
34
|
+
builder (3.2.3)
|
35
|
+
concurrent-ruby (1.0.5)
|
36
|
+
diff-lcs (1.3)
|
37
|
+
erubis (2.7.0)
|
38
|
+
i18n (0.8.5)
|
39
|
+
loofah (2.0.3)
|
40
|
+
nokogiri (>= 1.5.9)
|
41
|
+
method_source (0.8.2)
|
42
|
+
mini_portile2 (2.2.0)
|
43
|
+
minitest (5.10.2)
|
44
|
+
nokogiri (1.8.0)
|
45
|
+
mini_portile2 (~> 2.2.0)
|
46
|
+
rack (2.0.3)
|
47
|
+
rack-test (0.6.3)
|
48
|
+
rack (>= 1.0)
|
49
|
+
rails-dom-testing (2.0.3)
|
50
|
+
activesupport (>= 4.2.0)
|
51
|
+
nokogiri (>= 1.6)
|
52
|
+
rails-html-sanitizer (1.0.3)
|
53
|
+
loofah (~> 2.0)
|
54
|
+
railties (5.0.4)
|
55
|
+
actionpack (= 5.0.4)
|
56
|
+
activesupport (= 5.0.4)
|
57
|
+
method_source
|
58
|
+
rake (>= 0.8.7)
|
59
|
+
thor (>= 0.18.1, < 2.0)
|
60
|
+
rake (10.5.0)
|
61
|
+
rspec (3.6.0)
|
62
|
+
rspec-core (~> 3.6.0)
|
63
|
+
rspec-expectations (~> 3.6.0)
|
64
|
+
rspec-mocks (~> 3.6.0)
|
65
|
+
rspec-core (3.6.0)
|
66
|
+
rspec-support (~> 3.6.0)
|
67
|
+
rspec-expectations (3.6.0)
|
68
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
69
|
+
rspec-support (~> 3.6.0)
|
70
|
+
rspec-mocks (3.6.0)
|
71
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
72
|
+
rspec-support (~> 3.6.0)
|
73
|
+
rspec-support (3.6.0)
|
74
|
+
thor (0.19.4)
|
75
|
+
thread_safe (0.3.6)
|
76
|
+
tzinfo (1.2.3)
|
77
|
+
thread_safe (~> 0.1)
|
78
|
+
|
79
|
+
PLATFORMS
|
80
|
+
ruby
|
81
|
+
|
82
|
+
DEPENDENCIES
|
83
|
+
activemodel (~> 5.0.0)
|
84
|
+
appraisal
|
85
|
+
bundler (~> 1.9)
|
86
|
+
initialjs-rails!
|
87
|
+
rake (~> 10.0)
|
88
|
+
rspec
|
89
|
+
|
90
|
+
BUNDLED WITH
|
91
|
+
1.14.6
|
@@ -0,0 +1,91 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ..
|
3
|
+
specs:
|
4
|
+
initialjs-rails (0.2.0.5)
|
5
|
+
railties (>= 3.1, < 6.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
actionpack (5.1.0)
|
11
|
+
actionview (= 5.1.0)
|
12
|
+
activesupport (= 5.1.0)
|
13
|
+
rack (~> 2.0)
|
14
|
+
rack-test (~> 0.6.3)
|
15
|
+
rails-dom-testing (~> 2.0)
|
16
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
17
|
+
actionview (5.1.0)
|
18
|
+
activesupport (= 5.1.0)
|
19
|
+
builder (~> 3.1)
|
20
|
+
erubi (~> 1.4)
|
21
|
+
rails-dom-testing (~> 2.0)
|
22
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
23
|
+
activemodel (5.1.0)
|
24
|
+
activesupport (= 5.1.0)
|
25
|
+
activesupport (5.1.0)
|
26
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
27
|
+
i18n (~> 0.7)
|
28
|
+
minitest (~> 5.1)
|
29
|
+
tzinfo (~> 1.1)
|
30
|
+
appraisal (2.2.0)
|
31
|
+
bundler
|
32
|
+
rake
|
33
|
+
thor (>= 0.14.0)
|
34
|
+
builder (3.2.3)
|
35
|
+
concurrent-ruby (1.0.5)
|
36
|
+
diff-lcs (1.3)
|
37
|
+
erubi (1.6.1)
|
38
|
+
i18n (0.8.5)
|
39
|
+
loofah (2.0.3)
|
40
|
+
nokogiri (>= 1.5.9)
|
41
|
+
method_source (0.8.2)
|
42
|
+
mini_portile2 (2.2.0)
|
43
|
+
minitest (5.10.2)
|
44
|
+
nokogiri (1.8.0)
|
45
|
+
mini_portile2 (~> 2.2.0)
|
46
|
+
rack (2.0.3)
|
47
|
+
rack-test (0.6.3)
|
48
|
+
rack (>= 1.0)
|
49
|
+
rails-dom-testing (2.0.3)
|
50
|
+
activesupport (>= 4.2.0)
|
51
|
+
nokogiri (>= 1.6)
|
52
|
+
rails-html-sanitizer (1.0.3)
|
53
|
+
loofah (~> 2.0)
|
54
|
+
railties (5.1.0)
|
55
|
+
actionpack (= 5.1.0)
|
56
|
+
activesupport (= 5.1.0)
|
57
|
+
method_source
|
58
|
+
rake (>= 0.8.7)
|
59
|
+
thor (>= 0.18.1, < 2.0)
|
60
|
+
rake (10.5.0)
|
61
|
+
rspec (3.6.0)
|
62
|
+
rspec-core (~> 3.6.0)
|
63
|
+
rspec-expectations (~> 3.6.0)
|
64
|
+
rspec-mocks (~> 3.6.0)
|
65
|
+
rspec-core (3.6.0)
|
66
|
+
rspec-support (~> 3.6.0)
|
67
|
+
rspec-expectations (3.6.0)
|
68
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
69
|
+
rspec-support (~> 3.6.0)
|
70
|
+
rspec-mocks (3.6.0)
|
71
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
72
|
+
rspec-support (~> 3.6.0)
|
73
|
+
rspec-support (3.6.0)
|
74
|
+
thor (0.19.4)
|
75
|
+
thread_safe (0.3.6)
|
76
|
+
tzinfo (1.2.3)
|
77
|
+
thread_safe (~> 0.1)
|
78
|
+
|
79
|
+
PLATFORMS
|
80
|
+
ruby
|
81
|
+
|
82
|
+
DEPENDENCIES
|
83
|
+
activemodel (~> 5.1.0)
|
84
|
+
appraisal
|
85
|
+
bundler (~> 1.9)
|
86
|
+
initialjs-rails!
|
87
|
+
rake (~> 10.0)
|
88
|
+
rspec
|
89
|
+
|
90
|
+
BUNDLED WITH
|
91
|
+
1.14.6
|
data/initialjs-rails.gemspec
CHANGED
@@ -9,6 +9,7 @@ module InitialjsRails
|
|
9
9
|
seed = options.fetch(:seed) { 0 }
|
10
10
|
char_count = options.fetch(:count) { 1 }
|
11
11
|
txt_color = options.fetch(:color) { '#ffffff' }
|
12
|
+
initial_src = options.fetch(:src) { '' }
|
12
13
|
|
13
14
|
data_attributes = {
|
14
15
|
name: get_name_with_count(avatarable, char_count),
|
@@ -16,13 +17,13 @@ module InitialjsRails
|
|
16
17
|
height: size,
|
17
18
|
width: size,
|
18
19
|
'char-count': char_count,
|
19
|
-
'font-size': (size * 0.6),
|
20
|
+
'font-size': (size * 0.6).round,
|
20
21
|
'text-color': txt_color
|
21
22
|
}
|
22
23
|
|
23
24
|
data_attributes.merge!(radius: (size * 0.13).round) if round_corners
|
24
25
|
|
25
|
-
|
26
|
+
tag(:img, { alt: get_name(avatarable), class: "initialjs-avatar #{klass}".strip, data: data_attributes, src: initial_src }, true, false)
|
26
27
|
end
|
27
28
|
|
28
29
|
def get_name_with_count(avatarable, count)
|
@@ -35,7 +36,13 @@ module InitialjsRails
|
|
35
36
|
end
|
36
37
|
|
37
38
|
def get_name(avatarable)
|
38
|
-
avatarable.is_a?(String)
|
39
|
+
if avatarable.is_a?(String)
|
40
|
+
avatarable
|
41
|
+
elsif avatarable.respond_to?(:name)
|
42
|
+
avatarable.name
|
43
|
+
else
|
44
|
+
raise ArgumentError, '#avatar_image argument must be a String or respond to :name'
|
45
|
+
end
|
39
46
|
end
|
40
47
|
end
|
41
48
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: initialjs-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.0.
|
4
|
+
version: 0.2.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Gil
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -58,6 +58,34 @@ dependencies:
|
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '10.0'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: rspec
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: appraisal
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
61
89
|
description: initialjs-rails is an assets gem for initial.js
|
62
90
|
email:
|
63
91
|
- dgilperez@gmail.com
|
@@ -66,6 +94,8 @@ extensions: []
|
|
66
94
|
extra_rdoc_files: []
|
67
95
|
files:
|
68
96
|
- ".gitignore"
|
97
|
+
- ".travis.yml"
|
98
|
+
- Appraisals
|
69
99
|
- CHANGELOG.md
|
70
100
|
- CODE_OF_CONDUCT.md
|
71
101
|
- Gemfile
|
@@ -74,6 +104,15 @@ files:
|
|
74
104
|
- Rakefile
|
75
105
|
- bin/console
|
76
106
|
- bin/setup
|
107
|
+
- gemfiles/.bundle/config
|
108
|
+
- gemfiles/rails_3.2.gemfile
|
109
|
+
- gemfiles/rails_3.2.gemfile.lock
|
110
|
+
- gemfiles/rails_4.2.gemfile
|
111
|
+
- gemfiles/rails_4.2.gemfile.lock
|
112
|
+
- gemfiles/rails_5.0.gemfile
|
113
|
+
- gemfiles/rails_5.0.gemfile.lock
|
114
|
+
- gemfiles/rails_5.1.gemfile
|
115
|
+
- gemfiles/rails_5.1.gemfile.lock
|
77
116
|
- initialjs-rails.gemspec
|
78
117
|
- lib/initialjs-rails.rb
|
79
118
|
- lib/initialjs-rails/engine.rb
|
@@ -100,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
139
|
version: '0'
|
101
140
|
requirements: []
|
102
141
|
rubyforge_project:
|
103
|
-
rubygems_version: 2.
|
142
|
+
rubygems_version: 2.6.12
|
104
143
|
signing_key:
|
105
144
|
specification_version: 4
|
106
145
|
summary: initial.js for Rails
|