in_our_time 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/in_our_time.gemspec +1 -1
  4. data/lib/iot/iot.rb +15 -10
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 95c440df705ea2afb85d4c4ea6caa5fa03b67732
4
- data.tar.gz: c61b39babdf2dbd70ea44df6656cfb108b829d42
3
+ metadata.gz: de87e4265e1b9d635849b956423654b7757c1909
4
+ data.tar.gz: a030c2d3ad061950dab3163fe6b7875a9436538d
5
5
  SHA512:
6
- metadata.gz: aff9aa5de8973ea63ed168df39bf1e540dd7de222e7fcc4bf4c90551659eb74a17432893ad89aaf8ec6f9b7defcdc79ce5b059e1981d89134ab3d0489ee3f05c
7
- data.tar.gz: 94d19d14be5efafcdb409b82f5765cc263308aac43052804812ca3df7cce1ce3f97a55caae14d0ca35139c89da2d5c09e576179a24ee8e6dfd41bc06d8f481fd
6
+ metadata.gz: 7f91d8ae75f12e7ea71448b45f451063b865ad1799e3f38cb60a3bb36654d4018696056ca07ed3fc592c35be447935a2c9bd3b98f1b85df0d0070fc593ac1564
7
+ data.tar.gz: 4f9d01aa37e96d6416b16b37f7e5a11f4e281aee87a55646f6a4e5722d028cb9d738de4b704535fab8b673e261896f7150307a934d92d97d11cfd451cb21c345
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
data/in_our_time.gemspec CHANGED
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'in_our_time'
7
7
  spec.version = File.read('VERSION')
8
- spec.date = '2016-09-26'
8
+ spec.date = '2016-09-28'
9
9
  spec.authors = ["Martyn Jago"]
10
10
  spec.email = ["martyn.jago@btinternet.com"]
11
11
  spec.description = "In Our Time Player"
data/lib/iot/iot.rb CHANGED
@@ -457,10 +457,11 @@ class InOurTime
457
457
  end
458
458
 
459
459
  def justify info
460
- collect, top, bottom = [], 0, @config[:page_width]
460
+ pages = [[],[]]
461
+ page, top, bottom = 0, 0, @config[:page_width]
461
462
  loop do
462
463
  if(bottom >= info.length)
463
- collect << info[top..-1].strip
464
+ pages[page] << info[top..-1].strip
464
465
  break
465
466
  end
466
467
  loop do
@@ -469,26 +470,25 @@ class InOurTime
469
470
  end
470
471
  loop do
471
472
  if idx = info[top..bottom].index("\n")
472
- collect << info[top..top + idx]
473
- bottom, top = top + idx + @config[:page_width] + 1, top + idx + 1
473
+ pages[page] << info[top..top + idx]
474
+ page,bottom,top = 1,top + idx + @config[:page_width] + 1, top + idx + 1
474
475
  next
475
476
  else
476
477
  break if (info[bottom] == ' ')
477
478
  bottom -= 1
478
479
  end
479
480
  end
480
- collect << info[top..bottom]
481
+ pages[page] << info[top..bottom]
481
482
  bottom, top = bottom + @config[:page_width], bottom
482
483
  end
483
- collect
484
+ pages
484
485
  end
485
486
 
486
487
  def info
487
488
  if @info.nil?
488
489
  prg = select_program @sorted_titles[@selected]
489
490
  system 'clear'
490
- iot_puts ''
491
- justify(prg[:subtitle].gsub(/\s+/, ' ')).map{|x| iot_puts x}
491
+ justify(prg[:subtitle].gsub(/\s+/, ' '))[0].map{|x| iot_puts x}
492
492
  iot_puts ''
493
493
  iot_puts "Date Broadcast: #{prg[:date]}"
494
494
  iot_puts "Duration: #{prg[:duration].to_i/60} mins"
@@ -499,8 +499,13 @@ class InOurTime
499
499
  prg = select_program @sorted_titles[@selected]
500
500
  info = prg[:summary].gsub(/\s+/, ' ')
501
501
  system 'clear'
502
- iot_puts ''
503
- justify(reformat(info)).map{|x| iot_puts x}
502
+ justify(reformat(info))[0].map{|x| iot_puts x}
503
+ @info = 2
504
+ elsif @info == 2
505
+ prg = select_program @sorted_titles[@selected]
506
+ info = prg[:summary].gsub(/\s+/, ' ')
507
+ system 'clear'
508
+ justify(reformat(info))[1].map{|x| iot_puts x}
504
509
  @info = -1
505
510
  else
506
511
  display_list :same_page
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: in_our_time
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martyn Jago
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-26 00:00:00.000000000 Z
11
+ date: 2016-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri