iruby 0.2.2 → 0.2.3

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: 9e75176eb73a74372f87bc0fe5ea56949267ead0
4
- data.tar.gz: aa61c28d167924e923d711991ba80e7ff56f607d
3
+ metadata.gz: 86cf2f768af130a0ef08d93105a723fabb3a176b
4
+ data.tar.gz: 6ab3321dbf19f569da29760687c538dfa64758cd
5
5
  SHA512:
6
- metadata.gz: cf1d8b66d75bd1d6d89ee0782191d8ec7eeefa0c20ff83b156a520c65384e9190690f6321cad1205e20c7ea905fc263c11396290b4466f5cef1371b71bce57df
7
- data.tar.gz: f5a2335629045e4143d9d048dda20ba7620602a8113a321335db5d6239ca9e8e9423643b6724f6183f88bc67049d5c2d9e911d38252069c2edea2e41324f46a0
6
+ metadata.gz: dc3813a234b40b1660f0dbd0c8e3398ace3535093edefe3d66092d1143a5b331a12589525481560f756ff51b1ed664ac8b8f6a56364963330a4fdabff964d950
7
+ data.tar.gz: 37fbf64dc75139d1d548550fb931a9fd41a60b6eace9c3f6d83f03faad440b37b6728142e0182bb813a609f7ac289b9e109df66ba4e458f52c40602d0a211646
data/CHANGES CHANGED
@@ -1,3 +1,8 @@
1
+ 0.2.3
2
+
3
+ * Fix notebook indentation
4
+ * Fix tab completion for multiple lines
5
+
1
6
  0.2.2
2
7
 
3
8
  * Support history variables In, Out, _, _i etc
data/README.rdoc CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  = IRuby
4
4
 
5
- This is a Ruby kernel for IPython/Jupyter and is part of SciRuby[http://sciruby.com/].
5
+ This is a Ruby kernel for IPython/Jupyter and is part of SciRuby[http://sciruby.com/]. You can try it at http://try.jupyter.org/.
6
6
 
7
7
  link:screenshot.png
8
8
 
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.description = 'Ruby Kernel for IPython'
12
- s.summary = 'A Ruby kernel for IPython frontends (notebook console, etc.)'
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
@@ -1,7 +1,6 @@
1
1
  require 'rbczmq'
2
2
  require 'mimemagic'
3
3
  require 'multi_json'
4
- require 'bond'
5
4
  require 'securerandom'
6
5
  require 'openssl'
7
6
  require 'tempfile'
@@ -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 HistoryVariables
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 HistoryVariables
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 HistoryVariables
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__, 'logo', 'logo-*.png')].each do |file|
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(msg[:content]['code']),
107
+ matches: @backend.complete(code),
102
108
  status: :ok,
103
- cursor_start: 0,
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
@@ -1,3 +1,3 @@
1
1
  module IRuby
2
- VERSION = '0.2.2'
2
+ VERSION = '0.2.3'
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.2.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-26 00:00:00.000000000 Z
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 Kernel for IPython
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: A Ruby kernel for IPython frontends (notebook console, etc.)
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