(rubocop) Fix Style/FrozenStringLiteralComment

This commit is contained in:
Tim Sharpe 2019-02-03 10:48:00 +11:00
parent 02e49e5c4f
commit e0cbf89b8f
21 changed files with 42 additions and 18 deletions

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
source 'https://rubygems.org'
gemspec

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rubygems'
require 'bundler/setup'
require 'rspec/core/rake_task'

View file

@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
$LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))

View file

@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'rubygems'
require 'commander'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'faraday'
require 'json'
require 'vmfloaty/http'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'yaml'
class Conf

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AuthError < StandardError
def initialize(msg='Could not authenticate to pooler')
super

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'faraday'
require 'uri'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'vmfloaty/errors'
require 'vmfloaty/http'
require 'faraday'
@ -24,15 +26,7 @@ class NonstandardPooler
conn = Http.get_conn(verbose, url)
conn.headers['X-AUTH-TOKEN'] = token if token
os_string = ''
os_type.each do |os, num|
num.times do |_i|
os_string << os + '+'
end
end
os_string = os_string.chomp('+')
os_string = os_type.map { |os, num| Array(os) * num }.flatten.join('+')
if os_string.empty?
raise MissingParamError, 'No operating systems provided to obtain.'
end

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'faraday'
require 'vmfloaty/http'
require 'json'
@ -37,15 +39,7 @@ class Pooler
conn.headers['X-AUTH-TOKEN'] = token
end
os_string = ''
os_type.each do |os,num|
num.times do |i|
os_string << os+'+'
end
end
os_string = os_string.chomp('+')
os_string = os_type.map { |os, num| Array(os) * num }.flatten.join('+')
if os_string.empty?
raise MissingParamError, 'No operating systems provided to obtain.'
end

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'commander/user_interaction'
require 'commander/command'
require 'vmfloaty/utils'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Ssh
def self.which(cmd)

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'vmfloaty/pooler'
require 'vmfloaty/nonstandard_pooler'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Vmfloaty
VERSION = '0.8.2'.freeze
end

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'vmfloaty'
require 'webmock/rspec'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
require_relative '../../lib/vmfloaty/auth'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
require 'vmfloaty/utils'
require 'vmfloaty/errors'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
require_relative '../../lib/vmfloaty/pooler'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative '../../lib/vmfloaty/service'
describe Service do

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
require 'json'
require 'commander/command'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
$LOAD_PATH.push File.expand_path('../lib', __FILE__)
require 'vmfloaty/version'