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 +4 -4
- data/CHANGES +4 -0
- data/lib/iruby/command.rb +6 -2
- data/lib/iruby/kernel.rb +7 -3
- data/lib/iruby/session.rb +1 -1
- data/lib/iruby/static/custom/custom.js +3 -1
- data/lib/iruby/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6328c32b7e75b494cd08458788f44d248a9a489
|
4
|
+
data.tar.gz: 72025f2f1d1dd21822c428df248654e428136172
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32acad6991f90fcfdc255dbf5ca568a2777b36f553c9410f977bf03bc203a11fd0242748af86a5bf5a2cfe1f3edd37f32015ba723e6e7aed339516dc7eeb1566
|
7
|
+
data.tar.gz: 91d092d26a2f45f19b6cc6f57b4deced49afe99ca6d99dc4daf57e93adf992f0ae6abb55c5f5df522fe1eb105d81594858a4617c126f35ffb41ae7ca744bb7f2
|
data/CHANGES
CHANGED
data/lib/iruby/command.rb
CHANGED
@@ -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
|
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
|
-
|
62
|
+
`ipython profile create #{Shellwords.escape profile}`
|
59
63
|
end
|
60
64
|
|
61
65
|
kernel_cmd = []
|
data/lib/iruby/kernel.rb
CHANGED
@@ -27,9 +27,13 @@ module IRuby
|
|
27
27
|
@pub_socket.bind(connection % @config['iopub_port'])
|
28
28
|
|
29
29
|
Thread.new do
|
30
|
-
|
31
|
-
|
32
|
-
|
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)
|
data/lib/iruby/session.rb
CHANGED
@@ -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
|
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
|
-
|
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
|
});
|
data/lib/iruby/version.rb
CHANGED
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.
|
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:
|
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.
|
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:
|