sana 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sana.rb +5 -9
  3. data/sana.gemspec +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bf098608a751008d8e2b8e9327a518ac95b665d8
4
- data.tar.gz: 3c8ad52c78ff70b0efe07dc5ef1ffe1172d22e8e
3
+ metadata.gz: 8524d0fab5fb4eaf97aca5a3bf035732283ebaa1
4
+ data.tar.gz: ebd601b88ff131e4995abd233e9846d75b561605
5
5
  SHA512:
6
- metadata.gz: 61533945b23d450c15f369ddb32d21196735dac9d81fd80f7dd34d71794fafa09069b5bb2c8e4305a6a31f81fcc96857e12dd9d558a8f1bef5b16c2854f55358
7
- data.tar.gz: 9b94df816826f20b97facf96fa2d39daf3370aae305c247eeae70f0ae0feee2f5dc20429f1288c151bf71b23ccc4786d2ca08941e662e65e8da684e1d023a478
6
+ metadata.gz: ecbca400a0ab57abba4f50bcc1548f3654f0addb8e069204e2bca03c8d17e15da9729ed9a3746a675630d8e5800f8d41dbd213081ab433c62e3bb50417368686
7
+ data.tar.gz: af241eb66695dc31ecc7094e88b6b984416ebe59027a995b8c05290455f619f5e9dad4ab16e159e12b236259b99a0dc930e23b21b64617ba8c41dff82d1b87f5
@@ -23,18 +23,12 @@ class Sana
23
23
  # @param [String] dirpath the ghost/master directory path
24
24
  def load(dirpath)
25
25
  @dirpath = dirpath
26
- begin
27
- events.public_send(:_load, dirpath)
28
- rescue NoMethodError
29
- end
26
+ events.public_send(:_load, dirpath)
30
27
  end
31
28
 
32
29
  # SHIORI unload()
33
30
  def unload
34
- begin
35
- events.public_send(:_unload)
36
- rescue NoMethodError
37
- end
31
+ events.public_send(:_unload)
38
32
  end
39
33
 
40
34
  # SHIORI request()
@@ -47,7 +41,8 @@ class Sana
47
41
  end
48
42
  begin
49
43
  response = events.public_send(request.ID, request)
50
- rescue NoMethodError
44
+ rescue => error
45
+ raise unless error.is_a?(NoMethodError) && error.name.to_s == request.ID
51
46
  end
52
47
  case response
53
48
  when OpenStruct
@@ -67,6 +62,7 @@ class Sana
67
62
  private
68
63
  def build_response(response)
69
64
  response.version ||= '3.0'
65
+ response.code ||= response.Value.to_s.empty? ? 204 : 200
70
66
  response.Charset = response.Charset || charset
71
67
  response.Sender = response.Sender || sender
72
68
  Shioruby.build_response(response)
@@ -3,7 +3,7 @@ lib = File.expand_path('../lib', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = "sana"
6
- spec.version = "0.0.3"
6
+ spec.version = "0.0.4"
7
7
  spec.authors = ["Narazaka"]
8
8
  spec.email = ["info@narazaka.net"]
9
9
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sana
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Narazaka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-13 00:00:00.000000000 Z
11
+ date: 2016-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler