Skip to content

Commit

Permalink
Reformat Ruby files for line length of 120 (#29)
Browse files Browse the repository at this point in the history
The rubocop community has decided to standardize on 120 characters for
default line length.

rubocop/rubocop#7952

Update rubocop config and reformat ruby files to embrace this
convention.
  • Loading branch information
mattbrictson committed May 23, 2020
1 parent 4310990 commit 9e453a2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
3 changes: 1 addition & 2 deletions .rubocop.yml
Expand Up @@ -19,8 +19,7 @@ Layout/HashAlignment:
- key

Layout/LineLength:
Exclude:
- "*.gemspec"
Max: 120

Layout/SpaceAroundEqualsInParameterDefault:
EnforcedStyle: no_space
Expand Down
11 changes: 3 additions & 8 deletions Rakefile
Expand Up @@ -31,12 +31,9 @@ namespace :bump do
lowest_minor = RubyVersions.lowest_supported_minor
latest = RubyVersions.latest

replace_in_file "tomo-plugin-nvm.gemspec",
/ruby_version = ">= (.*)"/ => lowest

replace_in_file "tomo-plugin-nvm.gemspec", /ruby_version = ">= (.*)"/ => lowest
replace_in_file ".rubocop.yml", /TargetRubyVersion: (.*)/ => lowest_minor
replace_in_file ".circleci/config.yml",
%r{circleci/ruby:([\d\.]+)} => latest
replace_in_file ".circleci/config.yml", %r{circleci/ruby:([\d\.]+)} => latest

travis = YAML.safe_load(open(".travis.yml"))
travis["rvm"] = RubyVersions.latest_supported_patches + ["ruby-head"]
Expand Down Expand Up @@ -87,9 +84,7 @@ module RubyVersions

def versions
@_versions ||= begin
yaml = URI.open(
"https://raw.githubusercontent.com/ruby/www.ruby-lang.org/master/_data/downloads.yml"
)
yaml = URI.open("https://raw.githubusercontent.com/ruby/www.ruby-lang.org/master/_data/downloads.yml")
YAML.safe_load(yaml, symbolize_names: true)
end
end
Expand Down
7 changes: 2 additions & 5 deletions lib/tomo/plugin/nvm/tasks.rb
Expand Up @@ -16,8 +16,7 @@ def run_installer
require_setting :nvm_version

nvm_version = settings[:nvm_version]
install_url = "https://raw.githubusercontent.com/creationix/nvm/"\
"v#{nvm_version}/install.sh"
install_url = "https://raw.githubusercontent.com/creationix/nvm/v#{nvm_version}/install.sh"
remote.run("curl -o- #{install_url.shellescape} | bash")
end

Expand All @@ -36,9 +35,7 @@ def install_node
require_setting :nvm_node_version
node_version = settings[:nvm_node_version]

unless node_installed?(node_version)
remote.run "nvm", "install", node_version
end
remote.run "nvm", "install", node_version unless node_installed?(node_version)
remote.run "nvm", "alias", "default", node_version
end

Expand Down

0 comments on commit 9e453a2

Please sign in to comment.