Class: Aef::Linebreak::VersionCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/aef/linebreak/commands/version.rb

Instance Method Summary collapse

Instance Method Details

#executeObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/aef/linebreak/commands/version.rb', line 21

def execute
  name = 'Linebreak'
  puts "#{name} #{Aef::Linebreak::VERSION}"
  puts
  puts 'Project: https://rubyforge.org/projects/aef/'
  puts "RDoc: http://aef.rubyforge.org/#{name.downcase}/"
  puts "Github: http://github.com/aef/#{name.downcase}/"
  puts
  puts 'Copyright 2009 Alexander E. Fischer <[email protected]>'
  # Read and print licensing information from the top of this file
  if Gem::Version.new(RUBY_VERSION) <= Gem::Version.new('1.8.6')
    puts File.read(__FILE__).map{|line| line[2..-1]}[3..15]
  else
    puts File.read(__FILE__).lines.map{|line| line[2..-1]}[3..15]
  end
  exit false
end