iruby 0.1.9 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES +10 -0
- data/CONTRIBUTORS +3 -0
- data/Gemfile +1 -1
- data/README.md +2 -0
- data/iruby.gemspec +4 -4
- data/lib/iruby.rb +1 -0
- data/lib/iruby/backend.rb +2 -8
- data/lib/iruby/command.rb +7 -2
- data/lib/iruby/display.rb +4 -0
- data/lib/iruby/ostream.rb +5 -3
- data/lib/iruby/static/custom/custom.js +1 -1
- data/lib/iruby/version.rb +1 -1
- metadata +19 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f7cb8c6ec6b18164c82d06e8e82dde35af450ac
|
4
|
+
data.tar.gz: 2bbb33fa995c381801d319eda788622ff7cf588a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebf7533b241c7ed0586fb681079550f56b9b1e49a85ec1df3b1a38289efc0cef8bd04c1b3486c46735d627e2b27623eb67c1ec0bc8cbbbd438419feebbbcb2c0
|
7
|
+
data.tar.gz: 6f1c2ff436d7990eb99725b9c8d308763cdf9b1c068837bd17cc40d950146400e20fa35af323ff684bf868018965fe3f2268bb4d60ec0dc143bc3dacf5143367
|
data/CHANGES
CHANGED
data/CONTRIBUTORS
CHANGED
@@ -1,7 +1,10 @@
|
|
1
|
+
Carlos Agarie <carlos.agarie@gmail.com>
|
1
2
|
Damián Silvani <munshkr@gmail.com>
|
2
3
|
Daniel Mendler <mail@daniel-mendler.de>
|
3
4
|
Jan Vlnas <git@jan.vlnas.cz>
|
5
|
+
John Woods <jwoods@vt.edu>
|
4
6
|
Josh Adams <josh@isotope11.com>
|
7
|
+
Julia Evans <julia@jvns.ca>
|
5
8
|
martin sarsale <martin@properati.com>
|
6
9
|
Matthias Bussonier <bussonniermatthias@gmail.com>
|
7
10
|
Michael Hauser-Raspe <michael.hauser-raspe@cantab.net>
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -13,6 +13,8 @@ Now install the rubygem using `gem install iruby` and then run `iruby notebook`
|
|
13
13
|
|
14
14
|
Take a look at the [Example Notebook](http://nbviewer.ipython.org/urls/raw.github.com/minad/iruby/master/IRuby-Example.ipynb).
|
15
15
|
|
16
|
+
The IRuby notebook requires `ipython` >= 1.2.0. Furthermore we need `libzmq` >= 3.2 to work. Version 2.2.0 will not work. If you're using an old Debian without a new enough version of `libzmq`, you can install [Anaconda](https://store.continuum.io/), a Python distribution with newer versions.
|
17
|
+
|
16
18
|
### Authors
|
17
19
|
|
18
20
|
See the [CONTRIBUTORS](CONTRIBUTORS) file.
|
data/iruby.gemspec
CHANGED
@@ -24,8 +24,8 @@ Gem::Specification.new do |s|
|
|
24
24
|
|
25
25
|
s.add_development_dependency 'rake'
|
26
26
|
|
27
|
-
s.add_runtime_dependency 'bond'
|
28
|
-
s.add_runtime_dependency 'ffi-rzmq'
|
29
|
-
s.add_runtime_dependency 'multi_json'
|
30
|
-
s.add_runtime_dependency 'mimemagic'
|
27
|
+
s.add_runtime_dependency 'bond', '~> 0.5.0'
|
28
|
+
s.add_runtime_dependency 'ffi-rzmq', '~> 2.0'
|
29
|
+
s.add_runtime_dependency 'multi_json', '~> 1.10.0'
|
30
|
+
s.add_runtime_dependency 'mimemagic', '~> 0.2.0'
|
31
31
|
end
|
data/lib/iruby.rb
CHANGED
data/lib/iruby/backend.rb
CHANGED
@@ -16,24 +16,18 @@ module IRuby
|
|
16
16
|
class PryBackend
|
17
17
|
def initialize
|
18
18
|
require 'pry'
|
19
|
-
# Monkey patching the Pry bond completer
|
20
|
-
::Pry::BondCompleter.module_eval do
|
21
|
-
def self.call(input, options)
|
22
|
-
Pry.current[:pry] = options[:pry]
|
23
|
-
Bond.agent.call(input, input)
|
24
|
-
end
|
25
|
-
end
|
26
19
|
Pry.pager = false # Don't use the pager
|
27
20
|
Pry.print = proc {|output, value|} # No result printing
|
28
21
|
Pry.exception_handler = proc {|output, exception, _| }
|
29
22
|
@pry = Pry.new(output: $stdout, target: TOPLEVEL_BINDING)
|
30
|
-
raise 'Falling back to plain backend since your version of Pry is too old (
|
23
|
+
raise 'Falling back to plain backend since your version of Pry is too old (the Pry instance doesn\'t support #eval). You may need to install the pry gem with --pre enabled.' unless @pry.respond_to?(:eval)
|
31
24
|
end
|
32
25
|
|
33
26
|
def eval(code)
|
34
27
|
@pry.last_result = nil
|
35
28
|
@pry.eval(code)
|
36
29
|
raise @pry.last_exception if @pry.last_result_is_exception?
|
30
|
+
@pry.push_initial_binding unless @pry.current_binding
|
37
31
|
@pry.last_result
|
38
32
|
end
|
39
33
|
|
data/lib/iruby/command.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'shellwords'
|
2
|
+
require 'fileutils'
|
2
3
|
|
3
4
|
module IRuby
|
4
5
|
class Command
|
@@ -86,8 +87,12 @@ module IRuby
|
|
86
87
|
static_dir = File.join(profile_dir, 'static')
|
87
88
|
target_dir = File.join(File.dirname(__FILE__), 'static')
|
88
89
|
unless (File.readlink(static_dir) rescue nil) == target_dir
|
89
|
-
|
90
|
-
|
90
|
+
FileUtils.rm_rf(static_dir) rescue nil
|
91
|
+
begin
|
92
|
+
FileUtils.ln_sf(target_dir, static_dir)
|
93
|
+
rescue => ex
|
94
|
+
STDERR.puts "Could not create directory #{static_dir}: #{ex.message}"
|
95
|
+
end
|
91
96
|
end
|
92
97
|
end
|
93
98
|
end
|
data/lib/iruby/display.rb
CHANGED
@@ -56,6 +56,10 @@ module IRuby
|
|
56
56
|
add('text/latex', obj.dim == 2 ?
|
57
57
|
format_matrix(obj.transpose, obj.shape[1], obj.shape[0]) :
|
58
58
|
format_vector(obj.to_a))
|
59
|
+
elsif defined?(NMatrix) && NMatrix === obj
|
60
|
+
add('text/latex', obj.dim == 2 ?
|
61
|
+
format_matrix(obj, obj.shape[0], obj.shape[1]) :
|
62
|
+
format_vector(obj.to_a))
|
59
63
|
end
|
60
64
|
end
|
61
65
|
|
data/lib/iruby/ostream.rb
CHANGED
@@ -17,19 +17,21 @@ module IRuby
|
|
17
17
|
def isatty
|
18
18
|
false
|
19
19
|
end
|
20
|
-
|
20
|
+
alias_method :tty?, :isatty
|
21
21
|
|
22
22
|
def read(*args)
|
23
23
|
raise IOError, 'not opened for reading'
|
24
24
|
end
|
25
|
-
|
26
|
-
|
25
|
+
alias_method :next, :read
|
26
|
+
alias_method :readline, :read
|
27
27
|
|
28
28
|
def write(s)
|
29
29
|
raise 'I/O operation on closed file' unless @socket
|
30
30
|
@session.send(@socket, 'stream', { name: @name, data: s.to_s })
|
31
31
|
nil
|
32
32
|
end
|
33
|
+
alias_method :<<, :write
|
34
|
+
alias_method :print, :write
|
33
35
|
|
34
36
|
def puts(s)
|
35
37
|
write "#{s}\n"
|
@@ -6,7 +6,7 @@ $([IPython.events]).on('notebook_loaded.Notebook', function(){
|
|
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
|
9
|
+
console.log('Ruby mode should now be available in codemirror.');
|
10
10
|
})
|
11
11
|
IPython.CodeCell.options_default['cm_config']['mode'] = 'ruby';
|
12
12
|
IPython.CodeCell.options_default['cm_config']['indentUnit'] = 2;
|
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.11
|
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: 2014-
|
15
|
+
date: 2014-07-08 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rake
|
@@ -32,58 +32,58 @@ dependencies:
|
|
32
32
|
name: bond
|
33
33
|
requirement: !ruby/object:Gem::Requirement
|
34
34
|
requirements:
|
35
|
-
- -
|
35
|
+
- - ~>
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
37
|
+
version: 0.5.0
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
41
|
requirements:
|
42
|
-
- -
|
42
|
+
- - ~>
|
43
43
|
- !ruby/object:Gem::Version
|
44
|
-
version:
|
44
|
+
version: 0.5.0
|
45
45
|
- !ruby/object:Gem::Dependency
|
46
46
|
name: ffi-rzmq
|
47
47
|
requirement: !ruby/object:Gem::Requirement
|
48
48
|
requirements:
|
49
|
-
- -
|
49
|
+
- - ~>
|
50
50
|
- !ruby/object:Gem::Version
|
51
|
-
version: '0'
|
51
|
+
version: '2.0'
|
52
52
|
type: :runtime
|
53
53
|
prerelease: false
|
54
54
|
version_requirements: !ruby/object:Gem::Requirement
|
55
55
|
requirements:
|
56
|
-
- -
|
56
|
+
- - ~>
|
57
57
|
- !ruby/object:Gem::Version
|
58
|
-
version: '0'
|
58
|
+
version: '2.0'
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: multi_json
|
61
61
|
requirement: !ruby/object:Gem::Requirement
|
62
62
|
requirements:
|
63
|
-
- -
|
63
|
+
- - ~>
|
64
64
|
- !ruby/object:Gem::Version
|
65
|
-
version:
|
65
|
+
version: 1.10.0
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
68
|
version_requirements: !ruby/object:Gem::Requirement
|
69
69
|
requirements:
|
70
|
-
- -
|
70
|
+
- - ~>
|
71
71
|
- !ruby/object:Gem::Version
|
72
|
-
version:
|
72
|
+
version: 1.10.0
|
73
73
|
- !ruby/object:Gem::Dependency
|
74
74
|
name: mimemagic
|
75
75
|
requirement: !ruby/object:Gem::Requirement
|
76
76
|
requirements:
|
77
|
-
- -
|
77
|
+
- - ~>
|
78
78
|
- !ruby/object:Gem::Version
|
79
|
-
version:
|
79
|
+
version: 0.2.0
|
80
80
|
type: :runtime
|
81
81
|
prerelease: false
|
82
82
|
version_requirements: !ruby/object:Gem::Requirement
|
83
83
|
requirements:
|
84
|
-
- -
|
84
|
+
- - ~>
|
85
85
|
- !ruby/object:Gem::Version
|
86
|
-
version:
|
86
|
+
version: 0.2.0
|
87
87
|
description: Ruby Kernel for IPython
|
88
88
|
email:
|
89
89
|
- benjaminrk@gmail.com
|
@@ -150,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
150
|
version: '0'
|
151
151
|
requirements: []
|
152
152
|
rubyforge_project:
|
153
|
-
rubygems_version: 2.
|
153
|
+
rubygems_version: 2.1.11
|
154
154
|
signing_key:
|
155
155
|
specification_version: 4
|
156
156
|
summary: A Ruby kernel for IPython frontends (notebook console, etc.)
|