showterm 0.1.pre.1 → 0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/bin/showterm +6 -2
  2. data/lib/showterm.rb +7 -4
  3. data/showterm.gemspec +13 -0
  4. metadata +6 -5
data/bin/showterm CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'showterm'
3
+ require 'readline'
4
+ require File.join(__FILE__, '../../lib/showterm')
4
5
 
5
6
  if ARGV.include?('-h') || ARGV.include?('--help')
6
7
  puts <<-EOF
@@ -9,11 +10,14 @@ Usage: showterm <command to run>
9
10
  showterm will record the exact output of your session, and upload it to the
10
11
  internet where it can be replayed by anyone to whom you give the URL.
11
12
  EOF
13
+ exit
12
14
  end
13
15
 
14
16
  sf, tf = Showterm.record! *ARGV
15
17
  begin
16
- Showterm.upload! sf, tf
18
+ Showterm.upload! sf, tf, ENV['COLUMNS'] || 80
19
+ File.unlink sf
20
+ File.unlink tf
17
21
  rescue => e
18
22
  puts [e] + e.backtrace
19
23
  puts "DON'T PANIC"
data/lib/showterm.rb CHANGED
@@ -28,17 +28,20 @@ module Showterm
28
28
  raise "Could not run 'script', please check that it's installed"
29
29
  end
30
30
 
31
- puts 'Recorded'
31
+ puts 'showterm recording finished'
32
32
 
33
33
  [scriptfile.path, timingfile.path]
34
34
  end
35
35
 
36
- def upload!(scriptfile, timingfile)
36
+ def upload!(scriptfile, timingfile, cols=80)
37
+ puts 'uploading, please wait.'
37
38
  request = Net::HTTP::Post.new("/scripts")
38
39
  request.set_form_data(:scriptfile => File.read(scriptfile),
39
- :timingfile => File.read(timingfile))
40
+ :timingfile => File.read(timingfile),
41
+ :cols => cols)
40
42
 
41
43
  response = http(request)
44
+ raise response.body unless Net::HTTPSuccess === response
42
45
  puts response.body
43
46
  end
44
47
 
@@ -54,6 +57,6 @@ module Showterm
54
57
  http.request request
55
58
  end
56
59
  rescue Timeout::Error
57
- raise "Could not connect to https://api.github.com/"
60
+ raise "Could not connect to https://showterm.herokuapp.com/"
58
61
  end
59
62
  end
data/showterm.gemspec ADDED
@@ -0,0 +1,13 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = "showterm"
3
+ s.version = "0.1"
4
+ s.platform = Gem::Platform::RUBY
5
+ s.author = "Conrad Irwin"
6
+ s.email = "conrad.irwin@gmail.com"
7
+ s.homepage = "http://github.com/Conradirwin/showterm"
8
+ s.summary = "Allows you to make screen casts of your terminal really easily"
9
+ s.description = "Integrates with showterm.io for awesome sharability."
10
+ s.files = `git ls-files`.split("\n")
11
+ s.require_path = "lib"
12
+ s.executables << 'showterm'
13
+ end
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: showterm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.pre.1
5
- prerelease: 4
4
+ version: '0.1'
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Conrad Irwin
@@ -18,8 +18,9 @@ executables:
18
18
  extensions: []
19
19
  extra_rdoc_files: []
20
20
  files:
21
- - lib/showterm.rb
22
21
  - bin/showterm
22
+ - lib/showterm.rb
23
+ - showterm.gemspec
23
24
  homepage: http://github.com/Conradirwin/showterm
24
25
  licenses: []
25
26
  post_install_message:
@@ -35,9 +36,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
35
36
  required_rubygems_version: !ruby/object:Gem::Requirement
36
37
  none: false
37
38
  requirements:
38
- - - ! '>'
39
+ - - ! '>='
39
40
  - !ruby/object:Gem::Version
40
- version: 1.3.1
41
+ version: '0'
41
42
  requirements: []
42
43
  rubyforge_project:
43
44
  rubygems_version: 1.8.24