Class: GollumRails::Generators::LanguageGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/gollum_rails/language/language_generator.rb

Overview

Generates additional language files

Instance Method Summary collapse

Instance Method Details

#install_languagesObject

installs languages


15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/generators/gollum_rails/language/language_generator.rb', line 15

def install_languages
  case language
  when "ascii"
    puts <<-EOT
    \n Installation instructures for ASCIIDoc:\n
    \n\n Ubuntu/Debian Linux:
    \n (sudo) apt-get install asciidoc
    \n\n Mac with homebrew:
    \n brew install asciidoc 
    \n
    EOT
  when "markdown"
    run "gem install redcarpet"
    puts <<-EOT
    \n Parser for type "markdown" was installed
    \n
    EOT
  when "better-markdown"
    run "gem install github-markdown"
    puts <<-EOT
    \n Parser for type "github-markdown" was installed
    \n
    EOT
  when "textile"
    run "gem install RedCloth"
    puts <<-EOT
    \n Parser for type "textile" was installed
    \n
    EOT
  when "wiki"
    run "gem install wikicloth"
    puts <<-EOT
    \n Parser for type "wiki" was installed
    \n
    EOT
  when "org"
    run "gem install org-ruby"
    puts <<-EOT
    \n Parser for type "org-ruby" was installed
    \n
    EOT
  when "creole"
    run "gem install creole"
    puts <<-EOT
    \n Parser for type "creole" was installed
    \n
    EOT
  when "pod"
    puts <<-EOT
    \nPOT must be installed through CPAN (perl)
    \nSee http://search.cpan.org/dist/perl/pod/perlpod.pod for further information
    \n
    EOT
  when "rst"
    puts <<-EOT
    \nInstall through 'easy_install'
    \nSee http://docutils.sourceforge.net/rst.html for further information
    EOT
  else
    puts "UNKNOWN LANGUAGE"
    exit 1
  end
end