jupyternb 0.1.1 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: ebfbba6b7604c84fa2c6ae94f613cfff2858668a
4
- data.tar.gz: 9e7b56500cce2959b712c5773e95e89f145d9687
2
+ SHA256:
3
+ metadata.gz: cb4826d93bcb011c995f68b85fbd0d647bba6d895a6f385b35acc4f35a442d82
4
+ data.tar.gz: 04fa57501aaa6560725c5d2fd340d8de728008d890a6445506e7c65a9feedfa1
5
5
  SHA512:
6
- metadata.gz: fa0e4011c768c38be623ebd3f2d9415761fcd724b056f3c213c124d623f841e2ea6a8bf3102e21139c55ac975dd7a4f6438b5732ac5aa16b834fb37585f0a1f0
7
- data.tar.gz: 6886f076a095aa598e29fe9e73de2f15cf415e494db5a5af8f5f56ab8c16f7a13d8a25e91052bba527f71f8a9b93c58a4a9d3ee8e4b9406254b5ac6c473f2e90
6
+ metadata.gz: 036f855e2413f61f2bb8013ac77692aa6eb93a2400ac24c858e21deaabd3240348d32645af7b84a7f0aaac34bebbce36ba0dc132c119ccce7c173c33935bbbbc
7
+ data.tar.gz: f9f2bfbf34391af9d20ff87859e9049e6ea72303e6dc95af5d7968643afe2c460baf078c22aa9bfb91e6736066b7c1647eb05458b1ce342c5e91f739868e069d
data/README.md CHANGED
@@ -27,7 +27,7 @@ A simple example is given in the following:
27
27
  module JupyterNB
28
28
 
29
29
  # Create a Jupyter Notebook Generator
30
- # The parameter defines the kernel used. Present options are :ruby or :python3.
30
+ # The parameter defines the kernel used. Present options are :ruby, :julia or :python3.
31
31
  gen = Generator.new(:ruby)
32
32
 
33
33
  # Add some content cells (either multi-line strings or arrays of strings)
@@ -40,6 +40,21 @@ puts gen.generate
40
40
  end
41
41
  ```
42
42
 
43
+ ## Version History
44
+ ### 0.1.2
45
+ Suppport for Julia
46
+
47
+ ### 0.1.1
48
+ Detecting python3 executable3 before calling it
49
+
50
+ ### 0.1.0
51
+ Add capability to generate notebooks with different kernels
52
+ Support for Ruby and Python3
53
+
54
+ ### 0.0.1
55
+ Initial commit
56
+
57
+
43
58
  ## Feedback & Contributions
44
59
 
45
60
  1. Fork it ( http://github.com/hermanndetz/middleman-gnuplot/fork )
@@ -55,10 +55,11 @@ module JupyterNB
55
55
  result << close_group
56
56
 
57
57
  result << open_array("source")
58
+
58
59
  @source.each do |l|
59
60
  result << add_string(l)
60
61
 
61
- (l == @source.last) ? result << "\n" : result << ",\n"
62
+ (l.equal? @source.last) ? result << "\n" : result << ",\n"
62
63
  end
63
64
  result << close_array(true)
64
65
  result << close_group(last)
@@ -22,7 +22,7 @@ module JupyterNB
22
22
  def initialize(lang)
23
23
  @cells = Array.new
24
24
 
25
- if ((lang == :ruby) or (lang == :python3))
25
+ if ((lang == :ruby) or (lang == :python3) or (lang == :julia))
26
26
  @metadata = Metadata.new(lang)
27
27
  end
28
28
  end
@@ -19,6 +19,7 @@ module JupyterNB
19
19
  case lang
20
20
  when :ruby then initialize_ruby
21
21
  when :python3 then initialize_python3
22
+ when :julia then initialize_julia
22
23
  end
23
24
  end
24
25
 
@@ -58,7 +59,7 @@ module JupyterNB
58
59
  @langinfo[:name] = "ruby"
59
60
  @langinfo[:fileext] = ".rb"
60
61
  @langinfo[:mime] = "application/x-ruby"
61
- @langinfo[:version] = RUBY_VErSION
62
+ @langinfo[:version] = RUBY_VERSION
62
63
  end
63
64
 
64
65
  # Initialize metadata for Python 3 kernel
@@ -81,6 +82,29 @@ module JupyterNB
81
82
  end
82
83
  end
83
84
 
85
+ # Initialize metadata for Julia kernel
86
+ def initialize_julia
87
+ @kernel[:language] = "julia"
88
+
89
+ `which julia`
90
+ if $?.success?
91
+ # returns the first two version numbers e.g. 1.0,
92
+ # also works for multiple digit version numbers
93
+ @langinfo[:version] = `julia -v`.split(' ').last
94
+
95
+ else
96
+ @langinfo[:version] = '1.0'
97
+ end
98
+
99
+ @kernel[:language] = "julia"
100
+ @kernel[:name] = "julia-#{@langinfo[:version][0..@langinfo[:version].rindex('.')-1]}"
101
+ @kernel[:displayname] = "Julia #{@langinfo[:version]}"
102
+
103
+ @langinfo[:name] = "julia"
104
+ @langinfo[:fileext] = ".jl"
105
+ @langinfo[:mime] = "application/julia"
106
+ end
107
+
84
108
  end
85
109
  end
86
110
 
@@ -4,7 +4,18 @@
4
4
  # of the MIT license. See the LICENSE file for details.
5
5
 
6
6
  module JupyterNB
7
- VERSION = "0.1.1"
7
+ VERSION = "0.1.2"
8
+ # Suppport for Julia
9
+
10
+ # VERSION = "0.1.1"
11
+ # Detecting python3 executable3 before calling it
12
+
13
+ # VERSION = "0.1.0"
14
+ # Add capability to generate notebooks with different kernels
15
+ # Support for Ruby and Python3
16
+
17
+ # VERSION = "0.0.1"
18
+ # Initial commit
8
19
  end
9
20
 
10
21
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jupyternb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hermann Detz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-29 00:00:00.000000000 Z
11
+ date: 2018-11-03 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: " This gem provides useful functions to work with\n\t\t\t\t\t\t\t\t\t\t\t
14
14
  Jupyter Notebook files.\n"
@@ -48,7 +48,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
48
48
  version: '0'
49
49
  requirements: []
50
50
  rubyforge_project:
51
- rubygems_version: 2.5.2.1
51
+ rubygems_version: 2.7.6
52
52
  signing_key:
53
53
  specification_version: 4
54
54
  summary: Jupyter Notebook Tools