Change summary
.rubocop.yml | 11 ++++++++---
Gemfile | 2 ++
r2s-bwmsgsv2.rb | 3 ++-
sgx-bwmsgsv2.rb | 8 +++++---
4 files changed, 17 insertions(+), 7 deletions(-)
Detailed changes
@@ -1,8 +1,10 @@
Metrics/LineLength:
Max: 80
-Layout/Tab:
+Layout/IndentationStyle:
Enabled: false
+ EnforcedStyle: tabs
+ IndentationWidth: 2
Layout/IndentationWidth:
Width: 1 # one tab
@@ -40,10 +42,13 @@ Metrics/ParameterLists:
Metrics/PerceivedComplexity:
Max: 30
+Naming/MethodParameterName:
+ Enabled: false
+
Style/AndOr:
Enabled: false
-Layout/AlignParameters:
+Layout/ParameterAlignment:
Enabled: false
Style/BlockDelimiters:
@@ -110,7 +115,7 @@ Style/MultilineBlockChain:
Layout/SpaceAroundEqualsInParameterDefault:
EnforcedStyle: no_space
-Layout/IndentArray:
+Layout/FirstArrayElementIndentation:
EnforcedStyle: consistent
Style/SymbolArray:
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
source 'https://rubygems.org'
gem 'activesupport', '<5.0.0'
@@ -1,5 +1,6 @@
#!/usr/bin/env ruby
-#
+# frozen_string_literal: true
+
# Copyright (C) 2020 Denver Gingerich <denver@ossguy.com>
#
# This file is part of sgx-bwmsgsv2.
@@ -1,5 +1,6 @@
#!/usr/bin/env ruby
-#
+# frozen_string_literal: true
+
# Copyright (C) 2017-2020 Denver Gingerich <denver@ossguy.com>
# Copyright (C) 2017 Stephen Paul Weber <singpolyma@singpolyma.net>
#
@@ -369,6 +370,7 @@ module SGXbwmsgsv2
EMPromise.resolve(m.to.node.to_s).then { |num_dest|
if num_dest =~ /\A\+?[0-9]+(?:;.*)?\Z/
next num_dest if num_dest[0] == '+'
+
shortcode = extract_shortcode(num_dest)
next shortcode if shortcode
end
@@ -586,6 +588,7 @@ module SGXbwmsgsv2
if xn
xn.children.each_with_object({}) do |field, h|
next if field.element_name != "field"
+
val = field.children.find { |v|
v.element_name == "value"
}
@@ -968,8 +971,7 @@ class WebhookHandler < Goliath::API
end
if not msg
- msg = Blather::Stanza::Message.new(bare_jid,
- text)
+ msg = Blather::Stanza::Message.new(bare_jid, text)
end
else # per prior switch, this is: jparams['direction'] == 'out'
tag_parts = jparams['tag'].split(/ /, 2)