Sha256: d70db3db0924e0a74981782646c0835ac81c8c166b8da3ab460c790c32ff6ebc

Contents?: true

Size: 815 Bytes

Versions: 24

Compression:

Stored size: 815 Bytes

Contents

# encoding: UTF-8

# Copyright 2012 Twitter, Inc
# http://www.apache.org/licenses/LICENSE-2.0

module TwitterCldr
  module Resources
    class UnicodeImporter

      protected

      def parse_standard_file(file)
        if block_given?
          File.open(file) do |input|
            input.each_line do |line|
              unless line.split[0] == "#"
                comment_idx = if idx = line.index("#")
                  idx - 1 # consume #
                else
                  line.size
                end

                line = line.chomp[0..comment_idx]
                if line.size > 0
                  yield line.split(';', -1).map(&:strip)
                end
              end
            end
          end
        else
          enum_for(__method__, file)
        end
      end

    end
  end
end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
twitter_cldr-4.0.0 lib/twitter_cldr/resources/unicode_importer.rb
twitter_cldr-3.6.0 lib/twitter_cldr/resources/unicode_importer.rb
twitter_cldr-3.5.0 lib/twitter_cldr/resources/unicode_importer.rb
twitter_cldr-3.4.0 lib/twitter_cldr/resources/unicode_importer.rb
twitter_cldr-3.3.0 lib/twitter_cldr/resources/unicode_importer.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/twitter_cldr-3.2.1/lib/twitter_cldr/resources/unicode_importer.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/twitter_cldr-3.2.1/lib/twitter_cldr/resources/unicode_importer.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/twitter_cldr-3.1.2/lib/twitter_cldr/resources/unicode_importer.rb
twitter_cldr-3.2.1 lib/twitter_cldr/resources/unicode_importer.rb
twitter_cldr-3.2.0 lib/twitter_cldr/resources/unicode_importer.rb
twitter_cldr-3.1.2 lib/twitter_cldr/resources/unicode_importer.rb
twitter_cldr-3.1.1 lib/twitter_cldr/resources/unicode_importer.rb
twitter_cldr-3.1.0 lib/twitter_cldr/resources/unicode_importer.rb
twitter_cldr-3.0.10 lib/twitter_cldr/resources/unicode_importer.rb
twitter_cldr-3.0.9 lib/twitter_cldr/resources/unicode_importer.rb
twitter_cldr-3.0.8 lib/twitter_cldr/resources/unicode_importer.rb
twitter_cldr-3.0.7 lib/twitter_cldr/resources/unicode_importer.rb
twitter_cldr-3.0.6 lib/twitter_cldr/resources/unicode_importer.rb
twitter_cldr-3.0.5 lib/twitter_cldr/resources/unicode_importer.rb
twitter_cldr-3.0.4 lib/twitter_cldr/resources/unicode_importer.rb