live_console 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile ADDED
@@ -0,0 +1,88 @@
1
+ require 'rake/gempackagetask'
2
+ require 'rake/rdoctask'
3
+ require 'lib/live_console_config'
4
+ require 'fileutils'
5
+
6
+ $: << "#{File.dirname(__FILE__)}/lib"
7
+
8
+ spec = Gem::Specification.new { |s|
9
+ s.name = LiveConsoleConfig::PkgName
10
+ s.version = LiveConsoleConfig::Version
11
+ s.author = LiveConsoleConfig::Authors
12
+ s.email = LiveConsoleConfig::Email
13
+ s.homepage = LiveConsoleConfig::URL
14
+ s.rubyforge_project = LiveConsoleConfig::Project
15
+
16
+ s.platform = Gem::Platform::RUBY
17
+
18
+ s.files = Dir["{lib,doc,bin,ext}/**/*"].delete_if {|f|
19
+ /\/rdoc(\/|$)/i.match f
20
+ } + %w(Rakefile)
21
+ s.require_path = 'lib'
22
+ s.has_rdoc = true
23
+ s.extra_rdoc_files = Dir['doc/*'].select(&File.method(:file?))
24
+ s.extensions << 'ext/extconf.rb' if File.exist? 'ext/extconf.rb'
25
+ Dir['bin/*'].map(&File.method(:basename)).map(&s.executables.method(:<<))
26
+
27
+ s.summary = 'A library to support adding an irb console to your ' \
28
+ 'running application.'
29
+ %w().each &s.method(:add_dependency)
30
+ }
31
+
32
+ Rake::RDocTask.new(:doc) { |t|
33
+ t.main = 'doc/README'
34
+ t.rdoc_files.include 'lib/**/*.rb', 'doc/*', 'bin/*', 'ext/**/*.c',
35
+ 'ext/**/*.rb'
36
+ t.options << '-S' << '-N'
37
+ t.rdoc_dir = 'doc/rdoc'
38
+ }
39
+
40
+ Rake::GemPackageTask.new(spec) { |pkg|
41
+ pkg.need_tar_bz2 = true
42
+ }
43
+
44
+ desc "Builds and installs the gem for #{spec.name}"
45
+ task(:install => :package) {
46
+ g = "pkg/#{spec.name}-#{spec.version}.gem"
47
+ system "sudo gem install -l #{g}"
48
+ }
49
+
50
+ desc "Runs IRB, automatically require()ing #{spec.name}."
51
+ task(:irb) {
52
+ exec "irb -Ilib -r#{spec.name}"
53
+ }
54
+
55
+ desc "Cleans up the pkg directory."
56
+ task(:clean) {
57
+ FileUtils.rm_rf 'pkg'
58
+ }
59
+
60
+
61
+ desc "Generates a static gemspec file; useful for github."
62
+ task(:static_gemspec) {
63
+ # This whole thing is hacky.
64
+ spec.validate
65
+ spec_attrs = %w(
66
+ platform author email files require_path has_rdoc extra_rdoc_files
67
+ extensions executables name summary homepage
68
+ ).map { |attr|
69
+ "\ts.#{attr} = #{spec.send(attr).inspect}\n"
70
+ }.join <<
71
+ "\ts.version = #{spec.version.to_s.inspect}\n" <<
72
+ spec.dependencies.map { |dep|
73
+ "\ts.add_dependency #{dep.inspect}\n"
74
+ }.join
75
+
76
+ File.open("#{spec.name}.gemspec", 'w') { |f|
77
+ f.print <<-EOGEMSPEC
78
+ # This is a static gempsec automatically generated by rake. It's better to
79
+ # edit the Rakefile than this file. It is kept in the repository for the
80
+ # benefit of github.
81
+
82
+ spec = Gem::Specification.new { |s|
83
+ #{spec_attrs}}
84
+
85
+ Gem::Builder.new(spec).build if __FILE__ == $0
86
+ EOGEMSPEC
87
+ }
88
+ }
data/bin/udscat CHANGED
File without changes
data/doc/lc_example.rb CHANGED
File without changes
File without changes
data/lib/live_console.rb CHANGED
@@ -4,6 +4,7 @@
4
4
  # See doc/LICENSE.
5
5
 
6
6
  require 'irb'
7
+ require 'irb/frame'
7
8
  require 'socket'
8
9
  require 'live_console_config'
9
10
 
@@ -100,8 +101,8 @@ class LiveConsole
100
101
  # LiveConsole#start.
101
102
  def restart
102
103
  r = lambda { stop; start }
103
- if thread == Thread.current # An odd case.
104
- Thread.new &r
104
+ if thread == Thread.current
105
+ Thread.new &r # Leaks a thread, but works.
105
106
  else
106
107
  r.call
107
108
  end
@@ -125,6 +126,8 @@ end
125
126
  module IRB
126
127
  @inited = false
127
128
 
129
+ ARGV = []
130
+
128
131
  # Overridden a la FXIrb to accomodate our needs.
129
132
  def IRB.start_with_io(io, bind, &block)
130
133
  unless @inited
@@ -3,7 +3,7 @@ module LiveConsoleConfig
3
3
  Authors = 'Pete Elmore'
4
4
  Email = 'pete.elmore@gmail.com'
5
5
  PkgName = 'live_console'
6
- Version = '0.2.0'
6
+ Version = '0.2.1'
7
7
  URL = 'http://debu.gs/live-console'
8
8
  Project = 'live-console'
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: live_console
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pete Elmore
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-10-15 00:00:00 -07:00
12
+ date: 2009-02-18 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -20,23 +20,24 @@ executables:
20
20
  extensions: []
21
21
 
22
22
  extra_rdoc_files:
23
- - doc/lc_example.rb
24
- - doc/LICENSE
25
23
  - doc/README
26
- - doc/lc_unix_example.rb
27
- files:
28
- - bin/udscat
29
24
  - doc/lc_example.rb
30
- - doc/LICENSE
31
- - doc/README
32
25
  - doc/lc_unix_example.rb
26
+ - doc/LICENSE
27
+ files:
33
28
  - lib/live_console_config.rb
34
29
  - lib/live_console.rb
35
30
  - lib/live_console
36
31
  - lib/live_console/io_methods
37
- - lib/live_console/io_methods/socket_io.rb
38
32
  - lib/live_console/io_methods/unix_socket_io.rb
33
+ - lib/live_console/io_methods/socket_io.rb
39
34
  - lib/live_console/io_methods.rb
35
+ - doc/README
36
+ - doc/lc_example.rb
37
+ - doc/lc_unix_example.rb
38
+ - doc/LICENSE
39
+ - bin/udscat
40
+ - Rakefile
40
41
  has_rdoc: true
41
42
  homepage: http://debu.gs/live-console
42
43
  post_install_message:
@@ -59,9 +60,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
59
60
  requirements: []
60
61
 
61
62
  rubyforge_project: live-console
62
- rubygems_version: 1.3.0
63
+ rubygems_version: 1.3.1
63
64
  signing_key:
64
65
  specification_version: 2
65
- summary: A library to support adding a console to your running application.
66
+ summary: A library to support adding an irb console to your running application.
66
67
  test_files: []
67
68