segv_silencer 0.1.0 → 0.2.0

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: 9fbdf77ab42606c7bcd5c71311b74bb61dfd610b
4
- data.tar.gz: c353469322dcf51c66731c4b9c30ebd9297c56b7
3
+ metadata.gz: fc1604410a3c00c8d6d9bd12a9d5cd85a130828c
4
+ data.tar.gz: 948df8c425f452e170046c2bdf6970b00fdef7f1
5
5
  SHA512:
6
- metadata.gz: 25f10461c2f8e80f630812f274a6e8a4b951d4f7268db8eeb76a87e604ced8b74fde22e3cfa10a8a828202e91e4a591ea692e05926f43be6bab8b7a07b8124c9
7
- data.tar.gz: 1f992a9e00dc7d6fae9344034093515e2b98e22be9d6c936082cacd92f84051f834d2bc647ca31a47ac6fc7676d7aeaf9627321392d8874cc230cd668740bce8
6
+ metadata.gz: c401d46958c202967f4721d721689ec309c3668e83d3c218e697dab23cdb76e400d0eb698339e0b718d25cbcdea3c55634a26dbcffb2cd50b570bd06f33838f8
7
+ data.tar.gz: 164c8c46b5932ad5a76f00d54ddd6d219f86335d57306318668b43995bbabda9166599fee6664e49c0ad6a07f38d466ac866c2a86f2730a79f3ba81ea2f70f26
data/README.md CHANGED
@@ -1,9 +1,5 @@
1
1
  # SegvSilencer
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/segv_silencer`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
6
-
7
3
  ## Installation
8
4
 
9
5
  Add this line to your application's Gemfile:
@@ -28,6 +24,10 @@ And you can modify SEGV message by
28
24
 
29
25
  SegvSilencer.message = "[SEGV] hello :)"
30
26
 
27
+ If you want to save the dump into file:
28
+
29
+ SegvSilencer.file = "path to dump file"
30
+
31
31
  ## Development
32
32
 
33
33
  After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -36,7 +36,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
36
36
 
37
37
  ## Contributing
38
38
 
39
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/segv_silencer.
39
+ Bug reports and pull requests are welcome on GitHub at https://github.com/genki/segv_silencer.
40
40
 
41
41
 
42
42
  ## License
@@ -14,6 +14,10 @@ silent_segv_action(int signum)
14
14
  }
15
15
  fclose(stdout);
16
16
  fclose(stderr);
17
+ VALUE file = rb_iv_get(rb_mSegvSilencer, "@file");
18
+ if(file != Qnil){
19
+ stderr = fopen(StringValuePtr(file), "w");
20
+ }
17
21
  sigaction(signum, &org_segv_action, NULL);
18
22
  kill(getpid(), signum);
19
23
  }
data/lib/segv_silencer.rb CHANGED
@@ -3,6 +3,7 @@ require "segv_silencer/segv_silencer"
3
3
 
4
4
  module SegvSilencer
5
5
  @message = "[SEGV] segv_silencer"
6
- def self.message; @message end
7
- def self.message=(msg) @message = msg end
6
+ class << self
7
+ attr_accessor :message, :file
8
+ end
8
9
  end
@@ -1,3 +1,3 @@
1
1
  module SegvSilencer
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: segv_silencer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Takiuchi
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  version: '0'
94
94
  requirements: []
95
95
  rubyforge_project:
96
- rubygems_version: 2.4.8
96
+ rubygems_version: 2.5.1
97
97
  signing_key:
98
98
  specification_version: 4
99
99
  summary: ''