Module: Rrm

Defined in:
lib/rrm.rb,
lib/rrm/updater.rb,
lib/rrm/version.rb,
lib/rrm/repository.rb,
lib/rrm/filehandlers/travis.rb,
lib/rrm/filehandlers/gemfile.rb,
lib/rrm/filehandlers/rubocop.rb,
lib/rrm/filehandlers/gitlab-ci.rb,
lib/rrm/filehandlers/dockerfile.rb,
lib/rrm/filehandlers/gemfile_lock.rb

Defined Under Namespace

Classes: Dockerfile, Error, Gemfile, GemfileLock, GitlabCi, Repository, Rubocop, Travis, Updater

Constant Summary collapse

VERSION =
'0.2.3'

Class Method Summary collapse

Class Method Details

.all_ruby_versionsObject



21
22
23
# File 'lib/rrm.rb', line 21

def self.all_ruby_versions
  @all_ruby_versions ||= fetch_all_ruby_versions
end

.fetch_all_ruby_versionsObject



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/rrm.rb', line 25

def self.fetch_all_ruby_versions
  versions = []
  html = open('https://www.ruby-lang.org/en/downloads/releases/')
  doc = Nokogiri::HTML(html)
  rows = doc.search('tr')
  rows.each do |row|
    ver = row.search('td').first.text
    next if ver.include?('preview')
    next if ver.include?('rc')
    next if ver.include?('-p')
    versions << ver.split(' ').last
  rescue
    next
  end
  versions.compact.sort
end

.loggerObject



17
18
19
# File 'lib/rrm.rb', line 17

def self.logger
 @logger ||= Logger.new('/tmp/rrm/rrm.log')
end