iruby 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES +5 -0
- data/README.rdoc +1 -1
- data/iruby.gemspec +2 -2
- data/lib/iruby.rb +0 -1
- data/lib/iruby/assets/kernel.css +1 -0
- data/lib/iruby/assets/kernel.js +14 -0
- data/lib/iruby/{logo → assets}/logo-32x32.png +0 -0
- data/lib/iruby/{logo → assets}/logo-64x64.png +0 -0
- data/lib/iruby/backend.rb +4 -3
- data/lib/iruby/command.rb +1 -1
- data/lib/iruby/kernel.rb +8 -2
- data/lib/iruby/version.rb +1 -1
- metadata +9 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86cf2f768af130a0ef08d93105a723fabb3a176b
|
4
|
+
data.tar.gz: 6ab3321dbf19f569da29760687c538dfa64758cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc3813a234b40b1660f0dbd0c8e3398ace3535093edefe3d66092d1143a5b331a12589525481560f756ff51b1ed664ac8b8f6a56364963330a4fdabff964d950
|
7
|
+
data.tar.gz: 37fbf64dc75139d1d548550fb931a9fd41a60b6eace9c3f6d83f03faad440b37b6728142e0182bb813a609f7ac289b9e109df66ba4e458f52c40602d0a211646
|
data/CHANGES
CHANGED
data/README.rdoc
CHANGED
data/iruby.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.version = IRuby::VERSION
|
9
9
|
s.authors = ['Daniel Mendler', 'The SciRuby developers']
|
10
10
|
s.email = ['mail@daniel-mendler.de']
|
11
|
-
s.
|
12
|
-
s.
|
11
|
+
s.summary = 'Ruby Kernel for Jupyter/IPython'
|
12
|
+
s.description = 'A Ruby kernel for Jupyter/IPython frontends (e.g. notebook). Try it at try.jupyter.org.'
|
13
13
|
s.homepage = 'https://github.com/SciRuby/iruby'
|
14
14
|
s.license = 'MIT'
|
15
15
|
|
data/lib/iruby.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
/* Placeholder for Ruby kernel.css */
|
@@ -0,0 +1,14 @@
|
|
1
|
+
// Ruby kernel.js
|
2
|
+
|
3
|
+
define(['base/js/namespace'], function(IPython) {
|
4
|
+
var onload = function() {
|
5
|
+
IPython.CodeCell.options_default['cm_config']['indentUnit'] = 2;
|
6
|
+
var cells = IPython.notebook.get_cells();
|
7
|
+
for (var i in cells){
|
8
|
+
var c = cells[i];
|
9
|
+
if (c.cell_type === 'code')
|
10
|
+
c.code_mirror.setOption('indentUnit', 2);
|
11
|
+
}
|
12
|
+
}
|
13
|
+
return {onload:onload};
|
14
|
+
});
|
File without changes
|
File without changes
|
data/lib/iruby/backend.rb
CHANGED
@@ -2,7 +2,7 @@ module IRuby
|
|
2
2
|
In, Out = [nil], [nil]
|
3
3
|
::In, ::Out = In, Out
|
4
4
|
|
5
|
-
module
|
5
|
+
module History
|
6
6
|
def eval(code, store_history)
|
7
7
|
b = TOPLEVEL_BINDING
|
8
8
|
|
@@ -33,9 +33,10 @@ module IRuby
|
|
33
33
|
end
|
34
34
|
|
35
35
|
class PlainBackend
|
36
|
-
prepend
|
36
|
+
prepend History
|
37
37
|
|
38
38
|
def initialize
|
39
|
+
require 'bond'
|
39
40
|
Bond.start(debug: true)
|
40
41
|
end
|
41
42
|
|
@@ -49,7 +50,7 @@ module IRuby
|
|
49
50
|
end
|
50
51
|
|
51
52
|
class PryBackend
|
52
|
-
prepend
|
53
|
+
prepend History
|
53
54
|
|
54
55
|
def initialize
|
55
56
|
require 'pry'
|
data/lib/iruby/command.rb
CHANGED
@@ -107,7 +107,7 @@ Try `ipython help` for more information.
|
|
107
107
|
"language": "ruby"
|
108
108
|
}
|
109
109
|
})
|
110
|
-
Dir[File.join(__dir__, '
|
110
|
+
Dir[File.join(__dir__, 'assets', '*')].each do |file|
|
111
111
|
FileUtils.copy(File.expand_path(file), File.join(@kernel_dir, File.basename(file))) rescue nil
|
112
112
|
end
|
113
113
|
end
|
data/lib/iruby/kernel.rb
CHANGED
@@ -97,10 +97,16 @@ module IRuby
|
|
97
97
|
end
|
98
98
|
|
99
99
|
def complete_request(msg)
|
100
|
+
# HACK for #26, only complete last line
|
101
|
+
code = msg[:content]['code']
|
102
|
+
if start = code.rindex("\n")
|
103
|
+
code = code[start+1..-1]
|
104
|
+
start += 1
|
105
|
+
end
|
100
106
|
@session.send(:reply, :complete_reply,
|
101
|
-
matches: @backend.complete(
|
107
|
+
matches: @backend.complete(code),
|
102
108
|
status: :ok,
|
103
|
-
cursor_start:
|
109
|
+
cursor_start: start.to_i,
|
104
110
|
cursor_end: msg[:content]['cursor_pos'])
|
105
111
|
end
|
106
112
|
|
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.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Mendler
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-05-
|
12
|
+
date: 2015-05-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -95,7 +95,8 @@ dependencies:
|
|
95
95
|
- - "~>"
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0.3'
|
98
|
-
description: Ruby
|
98
|
+
description: A Ruby kernel for Jupyter/IPython frontends (e.g. notebook). Try it at
|
99
|
+
try.jupyter.org.
|
99
100
|
email:
|
100
101
|
- mail@daniel-mendler.de
|
101
102
|
executables:
|
@@ -119,6 +120,10 @@ files:
|
|
119
120
|
- examples/table.ipynb
|
120
121
|
- iruby.gemspec
|
121
122
|
- lib/iruby.rb
|
123
|
+
- lib/iruby/assets/kernel.css
|
124
|
+
- lib/iruby/assets/kernel.js
|
125
|
+
- lib/iruby/assets/logo-32x32.png
|
126
|
+
- lib/iruby/assets/logo-64x64.png
|
122
127
|
- lib/iruby/backend.rb
|
123
128
|
- lib/iruby/comm.rb
|
124
129
|
- lib/iruby/command.rb
|
@@ -126,8 +131,6 @@ files:
|
|
126
131
|
- lib/iruby/formatter.rb
|
127
132
|
- lib/iruby/kernel.rb
|
128
133
|
- lib/iruby/logger.rb
|
129
|
-
- lib/iruby/logo/logo-32x32.png
|
130
|
-
- lib/iruby/logo/logo-64x64.png
|
131
134
|
- lib/iruby/ostream.rb
|
132
135
|
- lib/iruby/session.rb
|
133
136
|
- lib/iruby/utils.rb
|
@@ -173,7 +176,7 @@ rubyforge_project:
|
|
173
176
|
rubygems_version: 2.2.2
|
174
177
|
signing_key:
|
175
178
|
specification_version: 4
|
176
|
-
summary:
|
179
|
+
summary: Ruby Kernel for Jupyter/IPython
|
177
180
|
test_files:
|
178
181
|
- test/integration_test.rb
|
179
182
|
- test/iruby/multi_logger_test.rb
|