(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' source 'https://rubygems.org'
gemspec gemspec

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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