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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7b09b1cf29e3f33b4b7a7f79773e4c2f07581bbe
4
- data.tar.gz: 6d09db553a2b1b2b13912d9f29f9c4613e7fda22
3
+ metadata.gz: 9f7cb8c6ec6b18164c82d06e8e82dde35af450ac
4
+ data.tar.gz: 2bbb33fa995c381801d319eda788622ff7cf588a
5
5
  SHA512:
6
- metadata.gz: b7cd57569f47ea87f8da1ba1a7109b67f2f50cb5f9d9e7f302e3390b89e0136b45113751784f215601376aed561bc284ca3ebed86f2800ca133fb3eb85b2a1a0
7
- data.tar.gz: 527bc7b8990342e5236e1b9e92ee414865cb45c4d30ae3cc7f22ceffffb4a55d404829960f5219e78acc4dd2221f8d5f57e88753a3bcfcdc5f4b0d6aa71ae6f0
6
+ metadata.gz: ebf7533b241c7ed0586fb681079550f56b9b1e49a85ec1df3b1a38289efc0cef8bd04c1b3486c46735d627e2b27623eb67c1ec0bc8cbbbd438419feebbbcb2c0
7
+ data.tar.gz: 6f1c2ff436d7990eb99725b9c8d308763cdf9b1c068837bd17cc40d950146400e20fa35af323ff684bf868018965fe3f2268bb4d60ec0dc143bc3dacf5143367
data/CHANGES CHANGED
@@ -1,3 +1,13 @@
1
+ 0.1.11
2
+
3
+ * Push binding if pry binding stack is empty
4
+
5
+ 0.1.10
6
+
7
+ * Fix #19 (pp)
8
+ * Handle exception when symlink cannot be created
9
+ * Fix dependencies and Pry backend
10
+
1
11
  0.1.9
2
12
 
3
13
  * Check IPython version
@@ -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
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
2
2
  gemspec
3
3
 
4
4
  group :pry do
5
- gem 'pry', '>=1.0.0.pre1'
5
+ gem 'pry'
6
6
  gem 'pry-doc'
7
7
  gem 'pry-theme'
8
8
  gem 'pry-syntax-hacks'
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.
@@ -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
@@ -5,6 +5,7 @@ require 'bond'
5
5
  require 'securerandom'
6
6
  require 'openssl'
7
7
  require 'tempfile'
8
+ require 'set'
8
9
  require 'iruby/version'
9
10
  require 'iruby/kernel'
10
11
  require 'iruby/backend'
@@ -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 (The Pry instance doesn\'t support #eval).' unless @pry.respond_to?(:eval)
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
 
@@ -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
- File.unlink(static_dir) rescue nil
90
- File.symlink(target_dir, static_dir)
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
@@ -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
 
@@ -17,19 +17,21 @@ module IRuby
17
17
  def isatty
18
18
  false
19
19
  end
20
- alias tty? isatty
20
+ alias_method :tty?, :isatty
21
21
 
22
22
  def read(*args)
23
23
  raise IOError, 'not opened for reading'
24
24
  end
25
- alias next read
26
- alias readline read
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 availlable in codemirror.');
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;
@@ -1,3 +1,3 @@
1
1
  module IRuby
2
- VERSION = '0.1.9'
2
+ VERSION = '0.1.11'
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.9
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-02-28 00:00:00.000000000 Z
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: '0'
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: '0'
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: '0'
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: '0'
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: '0'
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: '0'
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.0.0
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.)