malachite 0.1.0 → 0.1.1
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/README.md +7 -1
- data/lib/malachite/compiler.rb +4 -1
- data/lib/malachite/version.rb +1 -1
- data/malachite.gemspec +2 -2
- metadata +4 -5
- data/PROFILING.md +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0d4faf7414b1425c42837576a75715dfca7a4aa
|
4
|
+
data.tar.gz: e7bb2a59c491e964db73a1dd53729ef5934a6b8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a769d603d81d78202515ba33efd0d84e13620af4da47928b26fc973c2200233b247039dc3812e80772d4ec39ffd91723c7a279458be07137cefaa652141b7cff
|
7
|
+
data.tar.gz: e0d51bcb92b24efcd2d72d8b915b0f27f6ade99f7284400399673f377b691d5cffe095f7686e3c05500adb3bb6d2de494495f2a58927bd4a688444cdbd59c6e8
|
data/README.md
CHANGED
@@ -16,7 +16,7 @@ Make a subdirectory of "app" called "go".
|
|
16
16
|
|
17
17
|
### Write Some Go Functions
|
18
18
|
|
19
|
-
Everything in ```app/go```will get compiled into one library, so to get it to work with
|
19
|
+
Everything in ```app/go``` will get compiled into one library, so to get it to work with
|
20
20
|
Malachite, you need to:
|
21
21
|
|
22
22
|
* name the methods you want exported like: ```HandleFoo```
|
@@ -64,6 +64,12 @@ One part code generation, another part pure evil.
|
|
64
64
|
|
65
65
|
Because of the JSON step, you'll only see real performance gains on computationally difficult tasks. Ruby's JSON conversion is a large tax.
|
66
66
|
|
67
|
+
Note: You can also request precompilation. In an initializer:
|
68
|
+
|
69
|
+
```ruby
|
70
|
+
Malachite.precompile
|
71
|
+
```
|
72
|
+
|
67
73
|
### Ruby 2.2.4+
|
68
74
|
|
69
75
|
It's strongly recommended to use the [newest release of Ruby](https://www.ruby-lang.org/en/news/2015/12/16/unsafe-tainted-string-usage-in-fiddle-and-dl-cve-2015-7551/) as there was a security issue with older versions of Fiddle.
|
data/lib/malachite/compiler.rb
CHANGED
@@ -13,8 +13,11 @@ module Malachite
|
|
13
13
|
|
14
14
|
def compile!
|
15
15
|
modify_source_files_in_tmp
|
16
|
+
if modified_go_files == []
|
17
|
+
fail Malachite::BuildError, 'Nothing to build, there are no Go files in tmp'
|
18
|
+
end
|
16
19
|
unless system('go', 'build', '-buildmode=c-shared', '-o', @compiled_file, *modified_go_files)
|
17
|
-
fail Malachite::BuildError, 'Unable to Build Shared Library, is
|
20
|
+
fail Malachite::BuildError, 'Unable to Build Shared Library, is Go 1.5+ installed?'
|
18
21
|
end
|
19
22
|
path_to_compiled_file
|
20
23
|
end
|
data/lib/malachite/version.rb
CHANGED
data/malachite.gemspec
CHANGED
@@ -4,8 +4,8 @@ require File.expand_path('../lib/malachite/version', __FILE__)
|
|
4
4
|
Gem::Specification.new do |spec|
|
5
5
|
spec.authors = ['Zack Hubert']
|
6
6
|
spec.email = ['zhubert@gmail.com']
|
7
|
-
spec.summary = 'A RubyGem which enables calling Go code from
|
8
|
-
spec.description = 'A RubyGem which enables calling Go code from
|
7
|
+
spec.summary = 'A RubyGem which enables calling Go code from Rails'
|
8
|
+
spec.description = 'A RubyGem which enables calling Go code from Rails.'
|
9
9
|
spec.homepage = 'http://www.zhubert.com'
|
10
10
|
spec.license = 'MIT'
|
11
11
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: malachite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zack Hubert
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '10.0'
|
55
|
-
description: A RubyGem which enables calling Go code from
|
55
|
+
description: A RubyGem which enables calling Go code from Rails.
|
56
56
|
email:
|
57
57
|
- zhubert@gmail.com
|
58
58
|
executables: []
|
@@ -61,7 +61,6 @@ extra_rdoc_files: []
|
|
61
61
|
files:
|
62
62
|
- ".gitignore"
|
63
63
|
- Gemfile
|
64
|
-
- PROFILING.md
|
65
64
|
- README.md
|
66
65
|
- Rakefile
|
67
66
|
- lib/malachite.rb
|
@@ -102,5 +101,5 @@ rubyforge_project:
|
|
102
101
|
rubygems_version: 2.4.5.1
|
103
102
|
signing_key:
|
104
103
|
specification_version: 4
|
105
|
-
summary: A RubyGem which enables calling Go code from
|
104
|
+
summary: A RubyGem which enables calling Go code from Rails
|
106
105
|
test_files: []
|
data/PROFILING.md
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
### Profiling Malachite
|
2
|
-
|
3
|
-
0.0263 Serializing arguments
|
4
|
-
0.0641 Fiddle dlopen
|
5
|
-
0.0245 Fiddle function new
|
6
|
-
0.0978 Fiddle call + to_s
|
7
|
-
0.0131 De-serializing response
|
8
|
-
0.1000 UNKNOWN
|
9
|
-
------
|
10
|
-
0.3831 Actual total
|
11
|
-
|
12
|
-
### After Function Cache
|
13
|
-
|
14
|
-
Total < 0.200
|