shelr 0.13.2 → 0.13.3

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.
data/README.md CHANGED
@@ -12,7 +12,11 @@
12
12
 
13
13
  You'll need ruby and rubygems installed.
14
14
 
15
- gem install shelr
15
+ [sudo] gem install shelr
16
+
17
+ On ubuntu older than precise you should also add following to your `.bashrc` or `.zshrc`
18
+
19
+ export PATH=/var/lib/gems/1.8/bin:$PATH
16
20
 
17
21
  See [shellcast](http://shelr.tv/records/4f49ea4ae557800001000004) for details :)
18
22
 
data/bin/shelr CHANGED
@@ -50,7 +50,7 @@ when 'list'
50
50
  Shelr::Player.list
51
51
  when 'play'
52
52
  if ARGV[1]
53
- if ARGV[1] =~ /^http:.*/ # remote file
53
+ if ARGV[1] =~ /^https?:.*/ # remote file
54
54
  Shelr::Player.play_remote(ARGV[1])
55
55
  elsif ARGV[1] =~ /.*\.json$/ # local file
56
56
  Shelr::Player.play_dump(ARGV[1])
data/lib/shelr/player.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  # encoding: utf-8
2
2
  require 'net/http'
3
+ require 'net/https'
3
4
  require 'tmpdir'
4
5
  require 'fileutils'
5
6
  require 'pathname'
@@ -13,7 +14,10 @@ module Shelr
13
14
 
14
15
  def self.play_remote(url)
15
16
  puts ".==> Fetching #{url}"
16
- resp = Net::HTTP.get(URI.parse(url))
17
+ uri = URI.parse(url)
18
+ http = Net::HTTP.new(uri.host, uri.port)
19
+ http.use_ssl = true if uri.scheme == "https"
20
+ resp = http.request_get(uri.path).body
17
21
  play_parts_hash(JSON.parse(resp))
18
22
  end
19
23
 
@@ -13,6 +13,7 @@ module Shelr
13
13
  end
14
14
 
15
15
  def record!
16
+ ensure_terminal_has_good_size
16
17
  check_record_dir
17
18
  with_lock_file do
18
19
  init_terminal
@@ -21,6 +22,7 @@ module Shelr
21
22
  STDOUT.puts "=> Your session started"
22
23
  STDOUT.puts "=> Please, do not resize your terminal while recording"
23
24
  STDOUT.puts "=> Press Ctrl+D or 'exit' to finish recording"
25
+ Shelr.terminal.puts_line
24
26
  system(recorder_cmd)
25
27
  save_as_typescript if Shelr.backend == 'ttyrec'
26
28
  Shelr.terminal.puts_line
@@ -49,6 +51,18 @@ module Shelr
49
51
 
50
52
  private
51
53
 
54
+ def ensure_terminal_has_good_size
55
+ if (Shelr.terminal.size[:height] > 43) or (Shelr.terminal.size[:width] > 132)
56
+ Shelr.terminal.puts_line
57
+ puts "=> Please, resize your terminal!"
58
+ puts "=> Sizes bigger than 132x43 are slow and will not be available to all users."
59
+ puts "=> We care about this."
60
+ puts "=> Also, do not resize your terminal while recording. It will break the record."
61
+ Shelr.terminal.puts_line
62
+ exit(0)
63
+ end
64
+ end
65
+
52
66
  def with_lock_file
53
67
  lock_path = record_file('lock')
54
68
  File.open(lock_path, 'w') do |f|
data/lib/shelr/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Shelr
2
- VERSION = '0.13.2'
2
+ VERSION = '0.13.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shelr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.2
4
+ version: 0.13.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2012-04-10 00:00:00.000000000 Z
15
+ date: 2012-04-11 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: json
@@ -87,7 +87,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
87
87
  version: '0'
88
88
  segments:
89
89
  - 0
90
- hash: 4560701163385387592
90
+ hash: -2787247765045559838
91
91
  required_rubygems_version: !ruby/object:Gem::Requirement
92
92
  none: false
93
93
  requirements:
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
96
  version: '0'
97
97
  segments:
98
98
  - 0
99
- hash: 4560701163385387592
99
+ hash: -2787247765045559838
100
100
  requirements: []
101
101
  rubyforge_project:
102
102
  rubygems_version: 1.8.21