initialjs-rails 0.2.0.6 → 0.2.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3f3f860c3a9506f09afdc0b01e52607b2c5afbed
4
- data.tar.gz: 0173152c1ada1a82dd737de4ef4926b59c3cc7db
3
+ metadata.gz: 31a560fb28d92f9633e4acb0119e0481cfeb1b8e
4
+ data.tar.gz: 2e5d7d518e587df5026d129d2db7975bf260311c
5
5
  SHA512:
6
- metadata.gz: bcc1304e3045e5702d17c0a3b360bae7ffb4301fb4f87a4ba72af85f18dd96877502ffe8220ccee082e6c84810a77e35bb914d72c9ae5bcb7da2aca870bb845a
7
- data.tar.gz: d2348055b7a081f3672ffb30375dd0c0f91428fc503fae9c2c5f3f6613aefe141768a286ec6f034f2cf5c521474f8ad88335b1718b360ca3fc1819ee6c9d3bbc
6
+ metadata.gz: 8c125815de5bafc14a2410a52347cce33156c22ce0f1852cdd587918382c89dd445461b904f3b90002d88f5cd0eaefc5924229d83c79837bcd6144e14d982fee
7
+ data.tar.gz: b31b1fa76623427b81fbf582a4911e958c49c9b686b1c156839a0849d1a429a5e0c4e0891fd071dbda724821232b8f1d51fa1192020a1ccb765ea68418e9fa67
data/.travis.yml CHANGED
@@ -9,16 +9,17 @@ script: "bundle exec rake"
9
9
  rvm:
10
10
  - 1.9.3
11
11
  - 2.0.0
12
- - 2.1.5
13
- - 2.2.0
14
12
  - 2.2.4
15
13
  - 2.3.0
14
+ - 2.4.0
15
+ - 2.5.1
16
16
 
17
17
  gemfile:
18
18
  - gemfiles/rails_3.2.gemfile
19
19
  - gemfiles/rails_4.2.gemfile
20
20
  - gemfiles/rails_5.0.gemfile
21
21
  - gemfiles/rails_5.1.gemfile
22
+ - gemfiles/rails_5.2.gemfile
22
23
 
23
24
  matrix:
24
25
  fast_finish: true
@@ -27,15 +28,11 @@ matrix:
27
28
  gemfile: gemfiles/rails_5.0.gemfile
28
29
  - rvm: 1.9.3
29
30
  gemfile: gemfiles/rails_5.1.gemfile
31
+ - rvm: 1.9.3
32
+ gemfile: gemfiles/rails_5.2.gemfile
30
33
  - rvm: 2.0.0
31
34
  gemfile: gemfiles/rails_5.0.gemfile
32
35
  - rvm: 2.0.0
33
36
  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
37
+ - rvm: 2.0.0
38
+ gemfile: gemfiles/rails_5.2.gemfile
data/Appraisals CHANGED
@@ -1,5 +1,6 @@
1
1
  appraise "rails-3.2" do
2
2
  gem 'activemodel', '~> 3.2.0'
3
+ gem 'nokogiri', '< 1.8.1'
3
4
  end
4
5
 
5
6
  appraise "rails-4.2" do
@@ -13,3 +14,7 @@ end
13
14
  appraise "rails-5.1" do
14
15
  gem "activemodel", '~> 5.1.0'
15
16
  end
17
+
18
+ appraise "rails-5.2" do
19
+ gem "activemodel", '~> 5.2.0'
20
+ end
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 0.2.0.7
2
+
3
+ * `name` and `alt` can be passed as attributes to the helper ~ @dgilperez
4
+ * (Potentially breaking) `get_name_with_count` and `get_name` are private now ~ @dgilperez
5
+ * Fix issues with initialjs-blank.png not found @shah743 and @PierreMesure
6
+ * Adds Rails 5.2 / Ruby 2.4/2.5 to Appraisal, drops some older Ruby versions ~ @dgilperez
7
+
1
8
  ## 0.2.0.6
2
9
 
3
10
  * Updates initial.js to master - Adds background_color option. ~ @atd
@@ -3,5 +3,6 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "activemodel", "~> 3.2.0"
6
+ gem "nokogiri", "< 1.8.1"
6
7
 
7
8
  gemspec path: "../"
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- initialjs-rails (0.2.0.6)
4
+ initialjs-rails (0.2.0.7)
5
5
  railties (>= 3.1, < 6.0)
6
6
 
7
7
  GEM
@@ -34,7 +34,10 @@ GEM
34
34
  i18n (0.8.5)
35
35
  journey (1.0.4)
36
36
  json (1.8.6)
37
+ mini_portile2 (2.2.0)
37
38
  multi_json (1.12.1)
39
+ nokogiri (1.8.0)
40
+ mini_portile2 (~> 2.2.0)
38
41
  rack (1.4.7)
39
42
  rack-cache (1.7.1)
40
43
  rack (>= 0.4)
@@ -81,6 +84,7 @@ DEPENDENCIES
81
84
  appraisal
82
85
  bundler (~> 1.9)
83
86
  initialjs-rails!
87
+ nokogiri (< 1.8.1)
84
88
  rake (~> 10.0)
85
89
  rspec
86
90
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- initialjs-rails (0.2.0.6)
4
+ initialjs-rails (0.2.0.7)
5
5
  railties (>= 3.1, < 6.0)
6
6
 
7
7
  GEM
@@ -33,16 +33,16 @@ GEM
33
33
  rake
34
34
  thor (>= 0.14.0)
35
35
  builder (3.2.3)
36
- crass (1.0.3)
36
+ crass (1.0.4)
37
37
  diff-lcs (1.3)
38
38
  erubis (2.7.0)
39
39
  i18n (0.8.5)
40
- loofah (2.1.1)
40
+ loofah (2.2.2)
41
41
  crass (~> 1.0.2)
42
42
  nokogiri (>= 1.5.9)
43
43
  mini_portile2 (2.3.0)
44
44
  minitest (5.10.2)
45
- nokogiri (1.8.1)
45
+ nokogiri (1.8.4)
46
46
  mini_portile2 (~> 2.3.0)
47
47
  rack (1.6.8)
48
48
  rack-test (0.6.3)
@@ -53,8 +53,8 @@ GEM
53
53
  activesupport (>= 4.2.0, < 5.0)
54
54
  nokogiri (~> 1.6)
55
55
  rails-deprecated_sanitizer (>= 1.0.1)
56
- rails-html-sanitizer (1.0.3)
57
- loofah (~> 2.0)
56
+ rails-html-sanitizer (1.0.4)
57
+ loofah (~> 2.2, >= 2.2.2)
58
58
  railties (4.2.9)
59
59
  actionpack (= 4.2.9)
60
60
  activesupport (= 4.2.9)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- initialjs-rails (0.2.0.6)
4
+ initialjs-rails (0.2.0.7)
5
5
  railties (>= 3.1, < 6.0)
6
6
 
7
7
  GEM
@@ -33,26 +33,26 @@ GEM
33
33
  thor (>= 0.14.0)
34
34
  builder (3.2.3)
35
35
  concurrent-ruby (1.0.5)
36
- crass (1.0.3)
36
+ crass (1.0.4)
37
37
  diff-lcs (1.3)
38
38
  erubis (2.7.0)
39
39
  i18n (0.8.5)
40
- loofah (2.1.1)
40
+ loofah (2.2.2)
41
41
  crass (~> 1.0.2)
42
42
  nokogiri (>= 1.5.9)
43
43
  method_source (0.9.0)
44
44
  mini_portile2 (2.3.0)
45
45
  minitest (5.10.2)
46
- nokogiri (1.8.1)
46
+ nokogiri (1.8.4)
47
47
  mini_portile2 (~> 2.3.0)
48
- rack (2.0.3)
48
+ rack (2.0.5)
49
49
  rack-test (0.6.3)
50
50
  rack (>= 1.0)
51
51
  rails-dom-testing (2.0.3)
52
52
  activesupport (>= 4.2.0)
53
53
  nokogiri (>= 1.6)
54
- rails-html-sanitizer (1.0.3)
55
- loofah (~> 2.0)
54
+ rails-html-sanitizer (1.0.4)
55
+ loofah (~> 2.2, >= 2.2.2)
56
56
  railties (5.0.4)
57
57
  actionpack (= 5.0.4)
58
58
  activesupport (= 5.0.4)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- initialjs-rails (0.2.0.6)
4
+ initialjs-rails (0.2.0.7)
5
5
  railties (>= 3.1, < 6.0)
6
6
 
7
7
  GEM
@@ -33,26 +33,26 @@ GEM
33
33
  thor (>= 0.14.0)
34
34
  builder (3.2.3)
35
35
  concurrent-ruby (1.0.5)
36
- crass (1.0.3)
36
+ crass (1.0.4)
37
37
  diff-lcs (1.3)
38
- erubi (1.7.0)
38
+ erubi (1.7.1)
39
39
  i18n (0.8.5)
40
- loofah (2.1.1)
40
+ loofah (2.2.2)
41
41
  crass (~> 1.0.2)
42
42
  nokogiri (>= 1.5.9)
43
43
  method_source (0.9.0)
44
44
  mini_portile2 (2.3.0)
45
45
  minitest (5.10.2)
46
- nokogiri (1.8.1)
46
+ nokogiri (1.8.4)
47
47
  mini_portile2 (~> 2.3.0)
48
- rack (2.0.3)
48
+ rack (2.0.5)
49
49
  rack-test (0.6.3)
50
50
  rack (>= 1.0)
51
51
  rails-dom-testing (2.0.3)
52
52
  activesupport (>= 4.2.0)
53
53
  nokogiri (>= 1.6)
54
- rails-html-sanitizer (1.0.3)
55
- loofah (~> 2.0)
54
+ rails-html-sanitizer (1.0.4)
55
+ loofah (~> 2.2, >= 2.2.2)
56
56
  railties (5.1.0)
57
57
  actionpack (= 5.1.0)
58
58
  activesupport (= 5.1.0)
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activemodel", "~> 5.2.0"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,94 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ initialjs-rails (0.2.0.7)
5
+ railties (>= 3.1, < 6.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actionpack (5.2.0)
11
+ actionview (= 5.2.0)
12
+ activesupport (= 5.2.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.2.0)
18
+ activesupport (= 5.2.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.2.0)
24
+ activesupport (= 5.2.0)
25
+ activesupport (5.2.0)
26
+ concurrent-ruby (~> 1.0, >= 1.0.2)
27
+ i18n (>= 0.7, < 2)
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
+ crass (1.0.4)
37
+ diff-lcs (1.3)
38
+ erubi (1.7.1)
39
+ i18n (1.0.1)
40
+ concurrent-ruby (~> 1.0)
41
+ loofah (2.2.2)
42
+ crass (~> 1.0.2)
43
+ nokogiri (>= 1.5.9)
44
+ method_source (0.9.0)
45
+ mini_portile2 (2.3.0)
46
+ minitest (5.11.3)
47
+ nokogiri (1.8.4)
48
+ mini_portile2 (~> 2.3.0)
49
+ rack (2.0.5)
50
+ rack-test (1.1.0)
51
+ rack (>= 1.0, < 3)
52
+ rails-dom-testing (2.0.3)
53
+ activesupport (>= 4.2.0)
54
+ nokogiri (>= 1.6)
55
+ rails-html-sanitizer (1.0.4)
56
+ loofah (~> 2.2, >= 2.2.2)
57
+ railties (5.2.0)
58
+ actionpack (= 5.2.0)
59
+ activesupport (= 5.2.0)
60
+ method_source
61
+ rake (>= 0.8.7)
62
+ thor (>= 0.18.1, < 2.0)
63
+ rake (10.5.0)
64
+ rspec (3.7.0)
65
+ rspec-core (~> 3.7.0)
66
+ rspec-expectations (~> 3.7.0)
67
+ rspec-mocks (~> 3.7.0)
68
+ rspec-core (3.7.1)
69
+ rspec-support (~> 3.7.0)
70
+ rspec-expectations (3.7.0)
71
+ diff-lcs (>= 1.2.0, < 2.0)
72
+ rspec-support (~> 3.7.0)
73
+ rspec-mocks (3.7.0)
74
+ diff-lcs (>= 1.2.0, < 2.0)
75
+ rspec-support (~> 3.7.0)
76
+ rspec-support (3.7.1)
77
+ thor (0.20.0)
78
+ thread_safe (0.3.6)
79
+ tzinfo (1.2.5)
80
+ thread_safe (~> 0.1)
81
+
82
+ PLATFORMS
83
+ ruby
84
+
85
+ DEPENDENCIES
86
+ activemodel (~> 5.2.0)
87
+ appraisal
88
+ bundler (~> 1.9)
89
+ initialjs-rails!
90
+ rake (~> 10.0)
91
+ rspec
92
+
93
+ BUNDLED WITH
94
+ 1.14.6
@@ -1,3 +1,3 @@
1
1
  module InitialjsRails
2
- VERSION = '0.2.0.6'
2
+ VERSION = '0.2.0.7'
3
3
  end
@@ -3,14 +3,16 @@ require 'json'
3
3
  module InitialjsRails
4
4
  module ViewHelpers
5
5
  def avatar_image(avatarable, options = {})
6
- size = options.fetch(:size) { 100 }
7
- klass = options.fetch(:class) { '' }
8
- round_corners = options.fetch(:round_corners) { true }
9
- seed = options.fetch(:seed) { 0 }
10
- char_count = options.fetch(:count) { 1 }
11
- txt_color = options.fetch(:color) { '#ffffff' }
12
- bg_color = options.fetch(:background_color) { nil }
13
- initial_src = options.fetch(:src) { '/images/initialjs-blank.png' }
6
+ size = options.fetch(:size, 100)
7
+ klass = options.fetch(:class, '')
8
+ round_corners = options.fetch(:round_corners, true)
9
+ seed = options.fetch(:seed, 0)
10
+ char_count = options.fetch(:count, 1)
11
+ txt_color = options.fetch(:color, '#ffffff')
12
+ bg_color = options.fetch(:background_color, nil)
13
+ initial_src = options.fetch(:src, '/assets/initialjs-blank.png')
14
+ name = options.fetch(:name, get_name_with_count(avatarable, char_count))
15
+ alt = options.fetch(:alt, get_name(avatarable))
14
16
  radius = (size * 0.13).round if round_corners
15
17
  font_size = (size * 0.6).round
16
18
 
@@ -19,16 +21,18 @@ module InitialjsRails
19
21
  color: bg_color,
20
22
  'font-size' => font_size,
21
23
  height: size,
22
- name: get_name_with_count(avatarable, char_count),
24
+ name: name,
23
25
  radius: radius,
24
26
  seed: seed,
25
27
  'text-color' => txt_color,
26
28
  width: size
27
29
  }.reject { |_, v| v.blank? }
28
30
 
29
- tag(:img, { alt: get_name(avatarable), class: "initialjs-avatar #{klass}".strip, data: data_attributes, src: initial_src }, true, false)
31
+ tag(:img, { alt: alt, class: "initialjs-avatar #{klass}".strip, data: data_attributes, src: initial_src }, true, false)
30
32
  end
31
33
 
34
+ private
35
+
32
36
  def get_name_with_count(avatarable, count)
33
37
  name = get_name(avatarable)
34
38
  if count == 2
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.6
4
+ version: 0.2.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Gil
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-11 00:00:00.000000000 Z
11
+ date: 2018-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -113,6 +113,8 @@ files:
113
113
  - gemfiles/rails_5.0.gemfile.lock
114
114
  - gemfiles/rails_5.1.gemfile
115
115
  - gemfiles/rails_5.1.gemfile.lock
116
+ - gemfiles/rails_5.2.gemfile
117
+ - gemfiles/rails_5.2.gemfile.lock
116
118
  - initialjs-rails.gemspec
117
119
  - lib/initialjs-rails.rb
118
120
  - lib/initialjs-rails/engine.rb
@@ -140,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
142
  version: '0'
141
143
  requirements: []
142
144
  rubyforge_project:
143
- rubygems_version: 2.4.8
145
+ rubygems_version: 2.6.12
144
146
  signing_key:
145
147
  specification_version: 4
146
148
  summary: initial.js for Rails