rb2so 0.0.1 → 0.0.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.
Files changed (5) hide show
  1. data/Manifest.txt +1 -0
  2. data/bin/rb2so +12 -9
  3. data/hello.rb +1 -0
  4. data/lib/rb2so.rb +2 -2
  5. metadata +2 -1
data/Manifest.txt CHANGED
@@ -1,3 +1,4 @@
1
+ hello.rb
1
2
  README.rdoc
2
3
  History.txt
3
4
  Manifest.txt
data/bin/rb2so CHANGED
@@ -23,7 +23,7 @@ def text2c(filename=$*[0])
23
23
  end
24
24
  rs<<char
25
25
  end
26
- rs<<"\\n\"\n"
26
+ rs<<"\\n\""
27
27
  end
28
28
  rs
29
29
  end
@@ -36,14 +36,17 @@ Init_#{name}(){
36
36
  }
37
37
 
38
38
  }
39
- open("#{name}.c","w"){|f|f<<c}
40
- system "ruby -rmkmf -e 'create_makefile(\"#{name}\")'"
41
-
42
39
  #$stdout.reopen("/dev/null")
40
+ tmp_rb2so_dir="/tmp/rb2so"
41
+ so_name="#{name}.so"
42
+
43
+ system "mkdir -p #{tmp_rb2so_dir}"
44
+ Dir.chdir(tmp_rb2so_dir) do
45
+ open("#{name}.c","w"){|f|f<<c}
46
+ system "ruby -rmkmf -e 'create_makefile(\"#{name}\")'"
47
+ system "make"
48
+ end
49
+ system "mv #{tmp_rb2so_dir}/#{so_name} ."
43
50
 
44
- system "make"
45
-
46
- system "rm #{name}.c #{name}.o"
47
51
  puts '--success--'
48
- puts `ls #{name}*`
49
- #system "rm Makefile"
52
+ puts `ls #{so_name}`
data/hello.rb ADDED
@@ -0,0 +1 @@
1
+ puts "hello world" #just run: rb2so hello.rb
data/lib/rb2so.rb CHANGED
@@ -2,5 +2,5 @@ $:.unshift(File.dirname(__FILE__)) unless
2
2
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
3
 
4
4
  module Rb2so
5
- VERSION = '0.0.1'
6
- end
5
+ VERSION = '0.0.2'
6
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rb2so
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - axgle
@@ -34,6 +34,7 @@ extra_rdoc_files:
34
34
  - Manifest.txt
35
35
  - PostInstall.txt
36
36
  files:
37
+ - hello.rb
37
38
  - README.rdoc
38
39
  - History.txt
39
40
  - Manifest.txt