class Object

Public Class Methods

some_method(a, b) click to toggle source

Improved method defintions

# File data/language-specs/ruby.lang-extras/examples.rb, line 32
def self.some_method(a, b) end

Public Instance Methods

Array() click to toggle source
# File data/language-specs/ruby.lang-extras/examples.rb, line 37
def Array; end
[](arg) click to toggle source
# File data/language-specs/ruby.lang-extras/examples.rb, line 35
def [](arg) nil; end
action(what) click to toggle source

# # helper methods

# File bin/rubybuntu-gedit, line 55
def action(what)
  if what && !what.empty?
    puts Paint["x] #{what}", :yellow]
    system what
  end
end
check_existence(what, sudo = true) click to toggle source
# File bin/rubybuntu-gedit, line 62
def check_existence(what, sudo = true)
  if File.exists?(what)
    print "Q] The installer found an outdated file at \"#{what}\"\n" \
          "   It's recommended to remove it. Do you want to remove it? [Yn] "
    action("sudo rm -f #{what}") if gets.chop =~ /^y?$/i
  end
end
mime() click to toggle source

# # mime

# File bin/rubybuntu-gedit, line 91
def mime
  puts Paint["\nNow the mime types should be updated\n", :underline]
  print "Q] Do you want to install the mime types as sudo [/usr/share/mime/packages]\n" \
        "   or in your home directory [~/.local/share/gtksourceview-#@gedit.0/language-specs]? [Sh] "
  if @sudo || gets.chop =~ /^s?$/i
    action  "sudo cp #@data/mime/*.xml /usr/share/mime/packages\n" \
            "   sudo update-mime-database /usr/share/mime"
  else
    action "mkdir -p ~/.local/share/mime/packages\n" \
           "   cp #@data/mime/*.xml ~/.local/share/mime/packages\n" \
           "   update-mime-database ~/.local/share/mime"
  end

  check_existence '/usr/share/mime/rails.xml', true
  check_existence '~/.local/share/mime/rails.xml', false
end
self() click to toggle source
# File data/language-specs/ruby.lang-extras/examples.rb, line 34
def self; end
setter=(v) click to toggle source
# File data/language-specs/ruby.lang-extras/examples.rb, line 36
def setter=(v); end
snippets() click to toggle source

# # snippets

# File bin/rubybuntu-gedit, line 124
def snippets
  puts Paint["\nSorry, currently, the snippets cannot installed via this installer\n", :underline]
  puts "...\n"
end
specs() click to toggle source

# # language specs

# File bin/rubybuntu-gedit, line 72
def specs
  puts Paint["\nLet's start with copying the language specs\n", :underline]
  print "Q] Do you want to install the languages specs as sudo [/usr/share/gtksourceview-#@gedit.0/language-specs]\n" \
        "   or in your home directory [~/.local/share/gtksourceview-#@gedit.0/language-specs]? [Sh] "
  if @sudo || gets.chop =~ /^s?$/i
    action "sudo cp #@data/language-specs/*.lang /usr/share/gtksourceview-#@gedit.0/language-specs"
  else
    action "mkdir -p ~/.local/share/gtksourceview-#@gedit.0/language-specs\n" \
           "   cp #@data/language-specs/*.lang ~/.local/share/gtksourceview-#@gedit.0/language-specs"
  end

  check_existence '/usr/share/gtksourceview-#@gedit.0/language-specs/rhtml.lang', true
  check_existence '/usr/share/gtksourceview-#@gedit.0/language-specs/ruby_on_rails.lang', true
  check_existence '~/.local/share/gtksourceview-#@gedit.0/language-specs/rhtml.lang', false
  check_existence '~/.local/share/gtksourceview-#@gedit.0/language-specs/ruby_on_rails.lang', false
end
styles() click to toggle source

# # styles

# File bin/rubybuntu-gedit, line 110
def styles
  puts Paint["\nNow, some styles get copied that use the new language specs :)\n", :underline]
  print "Q] Do you want to install the styles as sudo [/usr/share/gtksourceview-#@gedit.0/styles]\n" \
        "   or in your home directory [~/.local/share/gtksourceview-#@gedit.0/styles]? [Sh] "
  if @sudo || gets.chop =~ /^s?$/i
    action "sudo cp #@data/styles/*.xml /usr/share/gtksourceview-#@gedit.0/styles"
  else
    action "mkdir -p ~/.local/share/gtksourceview-#@gedit.0/styles\n" \
           "   cp #@data/styles/*.xml ~/.local/share/gtksourceview-#@gedit.0/styles"
  end
end