interage-helpers 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: f3455439b3028ea71d4787cf5980e81278b657cbd745a873395640ea97d73828
4
- data.tar.gz: 136445f50323d97692cbf14c9cb9f3d7d65d88f1f128763be81a583608d8637a
3
+ metadata.gz: 075f6eb9f131805a01bf51bcab93f6b1c75b4ade2c35701874fd14b3ebdf63b9
4
+ data.tar.gz: 7363304d60dc30e39934dbebee7821f706ca3950eb126f88d634975c9740b0c1
5
5
  SHA512:
6
- metadata.gz: b6890cf216e33f18e29830293b1aef583cfa83c9c41d28ceb2df51862e1af3841a0b1e7a274c992a89aa55a4b2936e79042af1a26bd1142592b76d6d103f191f
7
- data.tar.gz: c285b899191c1d088201290c619a53b82de6fe304aa6c8c268d3fd27a5f6806e9870775f2270f2429b7bb7b5280a994e2b64543ca0540bd52d2a3a10e4ed9879
6
+ metadata.gz: 36581527efc648bebd0ef2ad2d60c1e3f9ccb9bae516cbf98e8fcbd298e5f57114c2f97b05faadbef72aa98b54779c057b09638fdda3430e71a8af39830de4e8
7
+ data.tar.gz: e7066c3ebf7bc1246070f4ad7c753e06b3b2885d4661c595579d34f55bb873be5bd3c2885a4c568259820f3fde6fdf306550404cdce436510501924ca8c43227
data/.rubocop.yml CHANGED
@@ -1,8 +1,9 @@
1
1
  require:
2
2
  - rubocop-rspec
3
3
  - rubocop-performance
4
+ - rubocop-rake
4
5
 
5
- Documentation:
6
+ Style/Documentation:
6
7
  Enabled: false
7
8
 
8
9
  Style/EmptyMethod:
@@ -20,7 +21,8 @@ Metrics/BlockLength:
20
21
  - interage-helpers.gemspec
21
22
 
22
23
  AllCops:
23
- TargetRubyVersion: 2.6
24
+ TargetRubyVersion: 2.7
25
+ NewCops: enable
24
26
  Exclude:
25
27
  - bin/**/*
26
28
  - vendor/**/*
data/CHANGES CHANGED
@@ -1,3 +1,6 @@
1
+ Version 0.1.1:
2
+ - Gera versão 0.1.1
3
+
1
4
  Version 0.1.0:
2
5
  - Adiciona alguns helper metodos
3
6
  - Ajusta nome da class principal da gem
data/Gemfile CHANGED
@@ -6,17 +6,19 @@ gemspec
6
6
 
7
7
  group :development, :test do
8
8
  # https://github.com/rubocop-hq/rubocop#quickstart
9
- gem 'rubocop', '~> 0.67.2'
9
+ gem 'rubocop', '~> 1.14'
10
10
  # https://github.com/backus/rubocop-rspec
11
- gem 'rubocop-rspec', '~> 1.32'
11
+ gem 'rubocop-rspec', '~> 2.3'
12
12
  # https://github.com/rubocop-hq/rubocop-performance/#usage
13
- gem 'rubocop-performance', '~> 1.1'
13
+ gem 'rubocop-performance', '~> 1.11', '>= 1.11.3'
14
+ # https://github.com/rubocop/rubocop-rake#usage
15
+ gem 'rubocop-rake', '~> 0.5.1'
14
16
  # https://github.com/rspec/rspec#install
15
- gem 'rspec', '~> 3.8'
17
+ gem 'rspec', '~> 3.10'
16
18
  # https://github.com/pry/pry#installation
17
- gem 'pry', '~> 0.12.2'
19
+ gem 'pry', '~> 0.14.1'
18
20
  # https://github.com/presidentbeef/brakeman
19
- gem 'brakeman', '~> 4.3', '>= 4.3.1', require: false
21
+ gem 'brakeman', '~> 5.0', '>= 5.0.1', require: false
20
22
  # https://github.com/rails/rails/tree/master/activesupport#download-and-installation
21
- gem 'activesupport', '~> 5.2', '>= 5.2.3'
23
+ gem 'activesupport', '~> 6.1'
22
24
  end
data/Gemfile.lock CHANGED
@@ -1,80 +1,89 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- interage-helpers (0.1.0)
4
+ interage-helpers (0.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- activesupport (5.2.4.2)
9
+ activesupport (6.1.3.2)
10
10
  concurrent-ruby (~> 1.0, >= 1.0.2)
11
- i18n (>= 0.7, < 2)
12
- minitest (~> 5.1)
13
- tzinfo (~> 1.1)
14
- ast (2.4.0)
15
- brakeman (4.8.1)
16
- coderay (1.1.2)
17
- concurrent-ruby (1.1.6)
18
- diff-lcs (1.3)
19
- i18n (1.8.2)
11
+ i18n (>= 1.6, < 2)
12
+ minitest (>= 5.1)
13
+ tzinfo (~> 2.0)
14
+ zeitwerk (~> 2.3)
15
+ ast (2.4.2)
16
+ brakeman (5.0.1)
17
+ coderay (1.1.3)
18
+ concurrent-ruby (1.1.8)
19
+ diff-lcs (1.4.4)
20
+ i18n (1.8.10)
20
21
  concurrent-ruby (~> 1.0)
21
- jaro_winkler (1.5.4)
22
- method_source (0.9.2)
23
- minitest (5.14.0)
24
- parallel (1.19.1)
25
- parser (2.7.1.0)
26
- ast (~> 2.4.0)
27
- pry (0.12.2)
28
- coderay (~> 1.1.0)
29
- method_source (~> 0.9.0)
30
- psych (3.1.0)
22
+ method_source (1.0.0)
23
+ minitest (5.14.4)
24
+ parallel (1.20.1)
25
+ parser (3.0.1.1)
26
+ ast (~> 2.4.1)
27
+ pry (0.14.1)
28
+ coderay (~> 1.1)
29
+ method_source (~> 1.0)
31
30
  rainbow (3.0.0)
32
- rake (13.0.1)
33
- rspec (3.9.0)
34
- rspec-core (~> 3.9.0)
35
- rspec-expectations (~> 3.9.0)
36
- rspec-mocks (~> 3.9.0)
37
- rspec-core (3.9.1)
38
- rspec-support (~> 3.9.1)
39
- rspec-expectations (3.9.1)
31
+ rake (13.0.3)
32
+ regexp_parser (2.1.1)
33
+ rexml (3.2.5)
34
+ rspec (3.10.0)
35
+ rspec-core (~> 3.10.0)
36
+ rspec-expectations (~> 3.10.0)
37
+ rspec-mocks (~> 3.10.0)
38
+ rspec-core (3.10.1)
39
+ rspec-support (~> 3.10.0)
40
+ rspec-expectations (3.10.1)
40
41
  diff-lcs (>= 1.2.0, < 2.0)
41
- rspec-support (~> 3.9.0)
42
- rspec-mocks (3.9.1)
42
+ rspec-support (~> 3.10.0)
43
+ rspec-mocks (3.10.2)
43
44
  diff-lcs (>= 1.2.0, < 2.0)
44
- rspec-support (~> 3.9.0)
45
- rspec-support (3.9.2)
46
- rubocop (0.67.2)
47
- jaro_winkler (~> 1.5.1)
45
+ rspec-support (~> 3.10.0)
46
+ rspec-support (3.10.2)
47
+ rubocop (1.14.0)
48
48
  parallel (~> 1.10)
49
- parser (>= 2.5, != 2.5.1.1)
50
- psych (>= 3.1.0)
49
+ parser (>= 3.0.0.0)
51
50
  rainbow (>= 2.2.2, < 4.0)
51
+ regexp_parser (>= 1.8, < 3.0)
52
+ rexml
53
+ rubocop-ast (>= 1.5.0, < 2.0)
52
54
  ruby-progressbar (~> 1.7)
53
- unicode-display_width (>= 1.4.0, < 1.6)
54
- rubocop-performance (1.1.0)
55
- rubocop (>= 0.67.0)
56
- rubocop-rspec (1.35.0)
57
- rubocop (>= 0.60.0)
58
- ruby-progressbar (1.10.1)
59
- thread_safe (0.3.6)
60
- tzinfo (1.2.7)
61
- thread_safe (~> 0.1)
62
- unicode-display_width (1.5.0)
55
+ unicode-display_width (>= 1.4.0, < 3.0)
56
+ rubocop-ast (1.5.0)
57
+ parser (>= 3.0.1.1)
58
+ rubocop-performance (1.11.3)
59
+ rubocop (>= 1.7.0, < 2.0)
60
+ rubocop-ast (>= 0.4.0)
61
+ rubocop-rake (0.5.1)
62
+ rubocop
63
+ rubocop-rspec (2.3.0)
64
+ rubocop (~> 1.0)
65
+ rubocop-ast (>= 1.1.0)
66
+ ruby-progressbar (1.11.0)
67
+ tzinfo (2.0.4)
68
+ concurrent-ruby (~> 1.0)
69
+ unicode-display_width (2.0.0)
70
+ zeitwerk (2.4.2)
63
71
 
64
72
  PLATFORMS
65
- ruby
73
+ x86_64-linux
66
74
 
67
75
  DEPENDENCIES
68
- activesupport (~> 5.2, >= 5.2.3)
69
- brakeman (~> 4.3, >= 4.3.1)
70
- bundler (~> 2.0)
76
+ activesupport (~> 6.1)
77
+ brakeman (~> 5.0, >= 5.0.1)
78
+ bundler (~> 2.2)
71
79
  interage-helpers!
72
- pry (~> 0.12.2)
80
+ pry (~> 0.14.1)
73
81
  rake (~> 13.0)
74
- rspec (~> 3.8)
75
- rubocop (~> 0.67.2)
76
- rubocop-performance (~> 1.1)
77
- rubocop-rspec (~> 1.32)
82
+ rspec (~> 3.10)
83
+ rubocop (~> 1.14)
84
+ rubocop-performance (~> 1.11, >= 1.11.3)
85
+ rubocop-rake (~> 0.5.1)
86
+ rubocop-rspec (~> 2.3)
78
87
 
79
88
  BUNDLED WITH
80
- 2.1.4
89
+ 2.2.14
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -15,6 +15,8 @@ Gem::Specification.new do |spec|
15
15
  spec.homepage = 'https://github.com/InterageASH/application-helpers'
16
16
  spec.licenses = ['MIT']
17
17
 
18
+ spec.required_ruby_version = '>= 2.7'
19
+
18
20
  if spec.respond_to?(:metadata)
19
21
  spec.metadata['allowed_push_host'] = 'https://rubygems.org'
20
22
 
@@ -35,7 +37,6 @@ Gem::Specification.new do |spec|
35
37
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
36
38
  spec.require_paths = ['lib']
37
39
 
38
- spec.add_development_dependency 'bundler', '~> 2.0'
40
+ spec.add_development_dependency 'bundler', '~> 2.2'
39
41
  spec.add_development_dependency 'rake', '~> 13.0'
40
- spec.add_development_dependency 'rspec', '~> 3.0'
41
42
  end
@@ -14,7 +14,7 @@ module Interage
14
14
  end
15
15
 
16
16
  def app_icon_classes(icon, prefix, separator, options = {})
17
- icon_classes = icon.to_s.split(' ').uniq.join(" #{separator}-")
17
+ icon_classes = icon.to_s.split.uniq.join(" #{separator}-")
18
18
 
19
19
  "#{prefix} #{separator}-#{icon_classes} #{options[:class]}".strip
20
20
  end
@@ -3,12 +3,12 @@
3
3
  module Interage
4
4
  module BootstrapAlertHelper
5
5
  def bootstrap_alert(type, message)
6
- icon = t("bootstrap.alert.icons.#{type}", default: type)
6
+ icon = t("bootstrap.alert.icons.#{type}", default: type.to_s)
7
7
  subtitles = t("bootstrap.alert.subtitles.#{type}", default: '')
8
8
 
9
- content_tag :div, class: "no-margin alert alert-#{type}" do
9
+ tag.div class: "alert alert-#{type} m-0" do
10
10
  concat app_icon(icon)
11
- concat content_tag(:b, " #{subtitles}: ") if subtitles.present?
11
+ concat tag.b(" #{subtitles}: ") if subtitles.present?
12
12
  concat message
13
13
  end
14
14
  end
@@ -40,40 +40,40 @@ module Interage
40
40
  alias bs_alert_danger bootstrap_alert_danger
41
41
 
42
42
  def bootstrap_alert_not_found(gender, model)
43
- bs_alert_info(text_404(gender, model))
43
+ bs_alert_info(text404(gender, model))
44
44
  end
45
- alias bs_text_404 bootstrap_alert_not_found
45
+ alias bs_text404 bootstrap_alert_not_found
46
46
 
47
47
  def bootstrap_alert_not_found_male(model)
48
- bs_text_404(:male, model)
48
+ bs_text404(:male, model)
49
49
  end
50
- alias bs_male_404 bootstrap_alert_not_found_male
50
+ alias bs_male404 bootstrap_alert_not_found_male
51
51
 
52
52
  def bootstrap_alert_not_found_female(model)
53
- bs_text_404(:female, model)
53
+ bs_text404(:female, model)
54
54
  end
55
- alias bs_female_404 bootstrap_alert_not_found_female
55
+ alias bs_female404 bootstrap_alert_not_found_female
56
56
 
57
57
  def text_not_found(gender, model)
58
- attributes = { model: tm(model).downcase, default: default_404 }
58
+ attributes = { model: tm(model).downcase, default: default404 }
59
59
 
60
- t("bootstrap.alert.#{gender}.not_found", attributes)
60
+ t("bootstrap.alert.#{gender}.not_found", **attributes)
61
61
  end
62
- alias text_404 text_not_found
62
+ alias text404 text_not_found
63
63
 
64
64
  def default_not_found
65
65
  t('bootstrap.alert.not_found', default: '')
66
66
  end
67
- alias default_404 default_not_found
67
+ alias default404 default_not_found
68
68
 
69
69
  def text_not_found_male(model)
70
- text_404(:male, model)
70
+ text404(:male, model)
71
71
  end
72
- alias male_404 text_not_found_male
72
+ alias male404 text_not_found_male
73
73
 
74
74
  def text_not_found_female(model)
75
- text_404(:female, model)
75
+ text404(:female, model)
76
76
  end
77
- alias female_404 text_not_found_female
77
+ alias female404 text_not_found_female
78
78
  end
79
79
  end
@@ -9,7 +9,9 @@ module Interage
9
9
  end
10
10
 
11
11
  def fa_icon(icon, options = {})
12
- content_tag :i, nil, options.merge(class: fa_classes(icon, options))
12
+ icon_html_options = options.merge(class: fa_classes(icon, options))
13
+
14
+ content_tag(:i, nil, icon_html_options)
13
15
  end
14
16
 
15
17
  def fa_fw_icon(icon, options = {})
@@ -24,7 +26,7 @@ module Interage
24
26
  end
25
27
 
26
28
  def fa_classes(icon, options = {})
27
- icon_classes = icon.to_s.split(' ').uniq.join(' fa-')
29
+ icon_classes = icon.to_s.split.uniq.join(' fa-')
28
30
 
29
31
  "fa fa-#{icon_classes} #{options[:class]}".strip
30
32
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Interage
4
4
  module Helpers
5
- VERSION = '0.1.1'
5
+ VERSION = '0.1.2'
6
6
  end
7
7
  end
@@ -5,7 +5,7 @@ module Interage
5
5
  MD_ICON_TEXT_CLASS = 'text'
6
6
 
7
7
  def md_icon(icon, options = {})
8
- icon_classes = icon.to_s.split(' ')
8
+ icon_classes = icon.to_s.split
9
9
  icon = icon_classes.shift
10
10
 
11
11
  content_tag :i, class: md_classes(icon, options) do
@@ -15,7 +15,7 @@ module Interage
15
15
  end
16
16
 
17
17
  def perform
18
- "#{digits[-8..-4]}-#{digits[-3..-1]}" if cep.positive?
18
+ "#{digits[-8..-4]}-#{digits[-3..]}" if cep.positive?
19
19
  end
20
20
 
21
21
  private
@@ -27,7 +27,7 @@ module Interage
27
27
  end
28
28
 
29
29
  def sufix_cnpj
30
- [digits[-6..-3], digits[-2..-1]].join('-')
30
+ [digits[-6..-3], digits[-2..]].join('-')
31
31
  end
32
32
 
33
33
  def digits
@@ -27,7 +27,7 @@ module Interage
27
27
  end
28
28
 
29
29
  def sufix_cpf
30
- digits[-2..-1]
30
+ digits[-2..]
31
31
  end
32
32
 
33
33
  def digits
@@ -39,7 +39,7 @@ module Interage
39
39
  end
40
40
 
41
41
  def sufix_phone
42
- phone[-4..-1]
42
+ phone[-4..]
43
43
  end
44
44
 
45
45
  def valid?
@@ -18,7 +18,7 @@ module Interage
18
18
  #
19
19
  # Returns translated model.
20
20
  def translate_model_name(model, count = 1)
21
- count.to_i > 1 ? model.model_name.human.pluralize : model.model_name.human
21
+ model.model_name.human(count: count)
22
22
  end
23
23
  alias tm translate_model_name
24
24
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: interage-helpers
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
  - Walmir Neto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-19 00:00:00.000000000 Z
11
+ date: 2021-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.0'
19
+ version: '2.2'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.0'
26
+ version: '2.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '13.0'
41
- - !ruby/object:Gem::Dependency
42
- name: rspec
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '3.0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '3.0'
55
41
  description: Classes to encapsulate helpers
56
42
  email:
57
43
  - owalmirneto@gmail.com
@@ -129,14 +115,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
129
115
  requirements:
130
116
  - - ">="
131
117
  - !ruby/object:Gem::Version
132
- version: '0'
118
+ version: '2.7'
133
119
  required_rubygems_version: !ruby/object:Gem::Requirement
134
120
  requirements:
135
121
  - - ">="
136
122
  - !ruby/object:Gem::Version
137
123
  version: '0'
138
124
  requirements: []
139
- rubygems_version: 3.0.6
125
+ rubygems_version: 3.2.3
140
126
  signing_key:
141
127
  specification_version: 4
142
128
  summary: Application Helpers for Interage