Sha256: c4603f95f2ab43174aaa6a6c961b53f8baf0d580774fe406a5501f8fe79b338f

Contents?: true

Size: 820 Bytes

Versions: 2

Compression:

Stored size: 820 Bytes

Contents

require 'lorem-ipsum'

include LoremIpsum

spec = Gem::Specification.find_by_name('lorem-ipsum')
gem_root = spec.gem_dir
lorem_file_path = File.join(gem_root, 'data', 'lorem.txt')
lorem = Generator.new
lorem.analyze(lorem_file_path)

# puts '['
# (0...24).each do
#   value = lorem.next_sentence(4).strip
#   puts "'#{value}',"
# end
# puts ']'

# puts '{'
# (0..24).each do
#   key = lorem.next_sentence(1).strip.gsub('.', '').downcase
#   value = lorem.next_sentence(4).strip
#   puts ":#{key} => '#{value}',"
# end
# puts '}'

hash = {}
(0..24).each do
  key = lorem.next_sentence(1).strip.gsub('.', '').downcase
  value = lorem.next_sentence(4).strip
  hash.store(key, value)
end
hash.keys.each do |key|
  puts ":#{key},"
end
hash.values.each do |value|
  puts "'#{value}',"
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
minitest_lucid-1.0.0 lib/lorem.rb
minitest_lucid-0.1.0 lib/lorem.rb