README.md in ld-0.1.6 vs README.md in ld-0.1.7

- old
+ new

@@ -1,9 +1,12 @@ # Ld -提供开发基础功能,旨在提高日常工作的开发效率 -主要有以下类: +Practical small tools +For the sake of efficiency +The Module is my name abbreviations LD +Basically has the following Class + ```ruby module Ld class excel end class file @@ -31,24 +34,38 @@ $ gem install ld ## Usage +First , into the console: + + $ rails c + +Then, can do this: + ```ruby - Ld::Table.p User.all, 'id ,name , created_at' - Ld::Excel.open('/Users/liudong/Desktop/abss.xls').read('sh1?a1:c5') - Ld::Excel.create '/Users/liudong/Desktop/abss.xls' do |excel| - ['sh1','sh2','发有3'].each do |sheet_name| - excel.write_sheet sheet_name do |sheet| - sheet.set_format({color: :red, font_size: 22, font: '宋体'}) - sheet.set_headings ['a','b'] - sheet.set_point 'c5' - (5..22).to_a.each do |i| - sheet.add_row i.times.map{|j| '村腰里 是'} - end - end +# Print model, Need to change the User model to exist, to run again +Ld::Table.p User.all, 'id , created_at' + +# Create xls, Need to change the file path to your own, and then run +Ld::Excel.create '/Users/liudong/Desktop/excel_test.xls' do |excel| + ['sheet1','sheet2','sheet3'].each do |sheet_name| + excel.write_sheet sheet_name do |sheet| + sheet.set_format({color: :red, font_size: 22, font: '宋体'}) + sheet.set_headings (1..10).times.map{|i| "header-#{i}"} + sheet.set_point 'b2' + (1..10).to_a.each do |i| + sheet.add_row i.times.map{|j| "#{sheet_name}-#{i}"} end end + end +end + +# Read xls +Ld::Excel.open('/Users/liudong/Desktop/excel_test.xls').read('sheet1?a1:e10') + +# Read Dir +Ld::File.open_dir('dir_path').children.each{|f| puts f.path} ``` ## Development After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment. \ No newline at end of file