Skip to content

Commit d89aa5f

Browse files
committed
merge
2 parents f947824 + 4e50d8f commit d89aa5f

12 files changed

Lines changed: 25 additions & 22 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,5 @@ build-iPhoneSimulator/
5555

5656
dummy
5757
temp
58+
TODO
59+
*.gch

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ env:
2828
- MRUBY_VERSION=1.2.0
2929
- MRUBY_VERSION=head
3030

31+
matrix:
32+
allow_failures:
33+
- env: MRUBY_VERSION=1.2.0
34+
3135
script:
3236
- rake compile
3337
- rake test

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ Implementation of the Ruby 2.4.1 Core Library _Process_ for [mruby][mruby].
55
All listed methods have been tested with Ubuntu, MacOS and Windows. Cross compilation works as well.
66

77
```ruby
8-
pid = spawn('ls', '-la')
8+
system { VAR: 'var' }, 'echo $VAR', out: pipe
99
```
1010

11-
Include [process.h][process_h] to use the native methods within your own project:
11+
Include [mruby/ext/process.h][process_h] to use the native methods within your own project:
1212

1313
```c
1414
// To use kill, waitpid, fork, spawn, ... on Unix and Win32
1515

1616
#ifdef HAVE_MRB_PROCESS_H
17-
# include 'process.h'
17+
# include "mruby/ext/process.h"
1818
#endif
1919

2020
static pid_t
@@ -205,9 +205,9 @@ DEALINGS IN THE SOFTWARE.
205205

206206

207207
[mruby]: https://github.com/mruby/mruby
208+
[process_h]: https://github.com/appPlant/mruby-process/blob/windows/include/mruby/ext/process.h
208209
[mruby-process-ext]: https://github.com/ksss/mruby-process-ext
209210
[mruby-process-sys]: https://github.com/haconiwa/mruby-process-sys
210211
[mruby-sleep]: https://github.com/matsumotory/mruby-sleep
211212
[mruby-io]: https://github.com/iij/mruby-io
212213
[mruby-signal]: https://github.com/ksss/mruby-signal
213-
[process_h]: https://github.com/appPlant/mruby-process/blob/windows/include/process.h

include/process.h.gch

-9.38 KB
Binary file not shown.

mrbgem.rake

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,23 @@
1919
# SOFTWARE.
2020

2121
def target_win32?
22-
return true if ENV['OS'] == 'Windows_NT'
22+
return true if RUBY_PLATFORM =~ /mingw|mswin/
2323
build.is_a?(MRuby::CrossBuild) && build.host_target.to_s =~ /mingw/
2424
end
2525

2626
MRuby::Gem::Specification.new('mruby-process') do |spec|
2727
spec.license = 'MIT'
2828
spec.authors = 'mruby developers'
2929

30-
spec.add_test_dependency 'mruby-print', core: 'mruby-print'
31-
spec.add_test_dependency 'mruby-env', mgem: 'mruby-env'
32-
spec.add_test_dependency 'mruby-os', mgem: 'mruby-os'
30+
spec.add_test_dependency 'mruby-print', core: 'mruby-print'
31+
spec.add_test_dependency 'mruby-env', mgem: 'mruby-env'
32+
spec.add_test_dependency 'mruby-os', mgem: 'mruby-os'
3333

34-
spec.cc.defines << 'HAVE_MRB_PROCESS_H'
34+
spec.mruby.cc.defines << 'HAVE_MRB_PROCESS_H'
35+
36+
[spec.cc, spec.mruby.cc].each do |cc|
37+
cc.include_paths << "#{spec.dir}/include/mruby/ext"
38+
end
3539

3640
ENV['RAND'] = Time.now.to_i.to_s if build.test_enabled?
3741

src/internal.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,15 @@
1919
* SOFTWARE.
2020
*/
2121

22-
#include <stdlib.h>
23-
#include <string.h>
24-
2522
#include "mruby.h"
2623
#include "mruby/class.h"
2724
#include "mruby/hash.h"
2825
#include "mruby/array.h"
2926
#include "mruby/string.h"
3027
#include "dln.c"
3128

32-
29+
#include <stdlib.h>
30+
#include <string.h>
3331

3432
typedef struct mrb_execarg {
3533
struct {

src/posix.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
#include <stdlib.h>
2626
#include <string.h>
2727
#include <stdio.h>
28-
29-
3028
#include <sys/stat.h>
3129
#include <fcntl.h>
3230

src/process.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,11 @@
1919
* SOFTWARE.
2020
*/
2121

22-
#include "process.h"
23-
2422
#include "mruby.h"
2523
#include "mruby/variable.h"
2624
#include "mruby/array.h"
2725
#include "mruby/error.h"
26+
#include "mruby/ext/process.h"
2827

2928
#include "internal.c"
3029

src/status.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121

2222
#include "mruby.h"
2323
#include "mruby/variable.h"
24-
25-
#include "process.h"
24+
#include "mruby/ext/process.h"
2625

2726
static mrb_value
2827
mrb_pst_new(mrb_state *mrb, pid_t pid, mrb_int status)

0 commit comments

Comments
 (0)