iruby 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 55b3e1540c63f4babaac469dccb8464a796aab47
4
- data.tar.gz: 4c7a5d28d0198daed5aa744b5cda162042ef815a
3
+ metadata.gz: c6328c32b7e75b494cd08458788f44d248a9a489
4
+ data.tar.gz: 72025f2f1d1dd21822c428df248654e428136172
5
5
  SHA512:
6
- metadata.gz: 0838fe2c36cae89acf23d9a892f428a488d1e85694f20105475767771f791c68b5cd2bcf1d595562076c39afd3b8f902fe815d995937c8f397d007d86d00e741
7
- data.tar.gz: 4707a0911e64fd68bde7e75a406224425c7219fcc8877c72646249a6d6d279977219b8d2d0c0f8b5935af187a64e4fd6a3bb2b85634399ae60fa38212ac9d53e
6
+ metadata.gz: 32acad6991f90fcfdc255dbf5ca568a2777b36f553c9410f977bf03bc203a11fd0242748af86a5bf5a2cfe1f3edd37f32015ba723e6e7aed339516dc7eeb1566
7
+ data.tar.gz: 91d092d26a2f45f19b6cc6f57b4deced49afe99ca6d99dc4daf57e93adf992f0ae6abb55c5f5df522fe1eb105d81594858a4617c126f35ffb41ae7ca744bb7f2
data/CHANGES CHANGED
@@ -1,3 +1,7 @@
1
+ 0.1.7/0.1.8
2
+
3
+ * Bugfixes #11, #12, #13
4
+
1
5
  0.1.6
2
6
 
3
7
  * Print Matrix and GSL::Matrix as LaTeX
@@ -21,11 +21,15 @@ module IRuby
21
21
  private
22
22
 
23
23
  def run_kernel
24
+ raise(ArgumentError, 'Not enough arguments to the kernel') if @args.size < 2 || @args.size > 4
24
25
  config_file, boot_file, working_dir = @args[1..-1]
25
26
  Dir.chdir(working_dir) if working_dir
26
27
  require boot_file if boot_file
27
28
  require 'iruby'
28
29
  Kernel.new(config_file).run
30
+ rescue Exception => ex
31
+ STDERR.puts "Kernel died: #{ex.message}\n#{ex.backtrace.join("\n")}"
32
+ raise
29
33
  end
30
34
 
31
35
  def run_ipython
@@ -46,7 +50,7 @@ module IRuby
46
50
  create_profile(dir, profile)
47
51
 
48
52
  # We must use the console to launch the whole 0MQ-client-server stack
49
- @args << 'console' << '--no-banner' if @args.empty?
53
+ @args = %w(console --no-banner) + @args if @args.first.to_s !~ /\A\w+\Z/
50
54
 
51
55
  Kernel.exec('ipython', *@args)
52
56
  end
@@ -55,7 +59,7 @@ module IRuby
55
59
  profile_dir = File.join(dir, "profile_#{profile}")
56
60
  unless File.directory?(profile_dir)
57
61
  puts "Creating profile directory #{profile_dir}"
58
- system("ipython profile create #{Shellwords.escape profile}")
62
+ `ipython profile create #{Shellwords.escape profile}`
59
63
  end
60
64
 
61
65
  kernel_cmd = []
@@ -27,9 +27,13 @@ module IRuby
27
27
  @pub_socket.bind(connection % @config['iopub_port'])
28
28
 
29
29
  Thread.new do
30
- hb_socket = c.socket(ZMQ::REP)
31
- hb_socket.bind(connection % @config['hb_port'])
32
- ZMQ::Device.new(ZMQ::FORWARDER, hb_socket, hb_socket)
30
+ begin
31
+ hb_socket = c.socket(ZMQ::REP)
32
+ hb_socket.bind(connection % @config['hb_port'])
33
+ ZMQ::Device.new(hb_socket, hb_socket)
34
+ rescue Exception => ex
35
+ STDERR.puts "Kernel heartbeat died: #{ex.message}\n"#{ex.backtrace.join("\n")}"
36
+ end
33
37
  end
34
38
 
35
39
  @session = Session.new('kernel', @config)
@@ -8,7 +8,7 @@ module IRuby
8
8
  @msg_id = 0
9
9
  if config['key'] && config['signature_scheme']
10
10
  raise 'Unknown signature scheme' unless config['signature_scheme'] =~ /\Ahmac-(.*)\Z/
11
- @hmac = OpenSSL::HMAC.new(config['key'], OpenSSL::Digest::Digest.new($1))
11
+ @hmac = OpenSSL::HMAC.new(config['key'], OpenSSL::Digest.new($1))
12
12
  end
13
13
  end
14
14
 
@@ -5,7 +5,9 @@ $([IPython.events]).on('notebook_loaded.Notebook', function(){
5
5
 
6
6
  $([IPython.events]).on('app_initialized.NotebookApp', function(){
7
7
  // add here logic that shoudl be run once per **page load**
8
- $.getScript('/static/components/codemirror/mode/ruby/ruby.js');
8
+ CodeMirror.requireMode('ruby', function(){
9
+ console.log('Ruby mode should now be availlable in codemirror.');
10
+ })
9
11
  IPython.CodeCell.options_default['cm_config']['mode'] = 'ruby';
10
12
  IPython.CodeCell.options_default['cm_config']['indentUnit'] = 2;
11
13
  });
@@ -1,3 +1,3 @@
1
1
  module IRuby
2
- VERSION = '0.1.7'
2
+ VERSION = '0.1.8'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damián Silvani
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-10-14 00:00:00.000000000 Z
15
+ date: 2014-02-28 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rake
@@ -150,8 +150,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
150
  version: '0'
151
151
  requirements: []
152
152
  rubyforge_project:
153
- rubygems_version: 2.0.3
153
+ rubygems_version: 2.0.0
154
154
  signing_key:
155
155
  specification_version: 4
156
156
  summary: A Ruby kernel for IPython frontends (notebook console, etc.)
157
157
  test_files: []
158
+ has_rdoc: