lib/habluhablu.rb in habluhablu-0.2.2 vs lib/habluhablu.rb in habluhablu-0.2.3

- old
+ new

@@ -19,11 +19,11 @@ def initialize super("Install I18n gem!") end end - def self.hablu(language) + def self.hablu(language, lorem = false) # Check if I18n gem is included # if not, raise the custom error if Dir.exist?("./config/locales").eql?(false) raise GemI18nError.new end @@ -31,9 +31,13 @@ # Check if specified symbol's language does exist # if not, raise the custom error language_class = Languages.new(language) if language_class.include_language? == false raise WrongSymbolError.new(language) + end + + if lorem.eql?(true) + language_class.include_lorem(lorem) end # Create a file of specified language File.open("./config/locales/#{language}.yml", "w") do |f| f.write(language_class.render)