in_our_time 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/in_our_time.gemspec +1 -1
- data/lib/iot/iot.rb +15 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de87e4265e1b9d635849b956423654b7757c1909
|
4
|
+
data.tar.gz: a030c2d3ad061950dab3163fe6b7875a9436538d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f91d8ae75f12e7ea71448b45f451063b865ad1799e3f38cb60a3bb36654d4018696056ca07ed3fc592c35be447935a2c9bd3b98f1b85df0d0070fc593ac1564
|
7
|
+
data.tar.gz: 4f9d01aa37e96d6416b16b37f7e5a11f4e281aee87a55646f6a4e5722d028cb9d738de4b704535fab8b673e261896f7150307a934d92d97d11cfd451cb21c345
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
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-
|
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
|
-
|
460
|
+
pages = [[],[]]
|
461
|
+
page, top, bottom = 0, 0, @config[:page_width]
|
461
462
|
loop do
|
462
463
|
if(bottom >= info.length)
|
463
|
-
|
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
|
-
|
473
|
-
bottom,
|
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
|
-
|
481
|
+
pages[page] << info[top..bottom]
|
481
482
|
bottom, top = bottom + @config[:page_width], bottom
|
482
483
|
end
|
483
|
-
|
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
|
-
|
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
|
-
|
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.
|
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-
|
11
|
+
date: 2016-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|