Sha256: 1205dcf94b4bb83c6406b2eaf288554e207972d02ce7c38e7a47cdfd9ef79422

Contents?: true

Size: 623 Bytes

Versions: 13

Compression:

Stored size: 623 Bytes

Contents

module Lolita
  module Menu
    module Autocomplete
      class FileBuilder

        class << self
          def input_file
            File.join(Rails.root,"config","lolita-menu-urls.rb")
          end

          def output_file
            File.join(Rails.root,"public","lolita-menu-url.txt")
          end
        end

        attr_reader :file

        def initialize(mode)
          @file = File.open(self.class.output_file,mode)
        end

        def add url,label = nil
          @file.puts "#{url} #{label || url}"
        end

        def finalize!
          @file.close
        end
      end

    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
lolita-menu-0.2.2 lib/lolita-menu/autocomplete/file_builder.rb
lolita-menu-0.2.1 lib/lolita-menu/autocomplete/file_builder.rb
lolita-menu-0.2.0 lib/lolita-menu/autocomplete/file_builder.rb
lolita-menu-0.1.7 lib/lolita-menu/autocomplete/file_builder.rb
lolita-menu-0.1.6 lib/lolita-menu/autocomplete/file_builder.rb
lolita-menu-0.1.5 lib/lolita-menu/autocomplete/file_builder.rb
lolita-menu-0.1.4 lib/lolita-menu/autocomplete/file_builder.rb
lolita-menu-0.1.1 lib/lolita-menu/autocomplete/file_builder.rb
lolita-menu-0.1.0 lib/lolita-menu/autocomplete/file_builder.rb
lolita-menu-0.0.15 lib/lolita-menu/autocomplete/file_builder.rb
lolita-menu-0.0.14 lib/lolita-menu/autocomplete/file_builder.rb
lolita-menu-0.0.13 lib/lolita-menu/autocomplete/file_builder.rb
lolita-menu-0.0.12 lib/lolita-menu/autocomplete/file_builder.rb