rising_dragon 0.4.0 → 0.5.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
  SHA256:
3
- metadata.gz: cb5dc5654759f81fba65dc418831a23d1ecc4ceb73db69ca8fef62f72b3c557c
4
- data.tar.gz: 7e6eeee3233eb3beb3ceee64d5c7715e79f38486d8e92cb7aea634e0149805f4
3
+ metadata.gz: 74bc8b8f49f7973d57ad8d41e6f76baddec6b0bf4932f80f176a29b9b297b7ac
4
+ data.tar.gz: 32f93f80428dafccecdde6aca601e0964ddec6f67b44dd99939e08f55af286a5
5
5
  SHA512:
6
- metadata.gz: efdfb06d72a98f0ff4199b28336af0f111d5af155e62a4250beb990226f0d05676080ec12a95e91afc579e6ecac8745011446f3458782a1545bd41cbef3db716
7
- data.tar.gz: 278d17f1fad7a5174c4f946e013bd9155e23d6a758e6c71ce146e985a97dbb94ba91a777376307b369eacd03c2459266dd327d2de61f62e27e44440839ebd81d
6
+ metadata.gz: 6ff59d15b15bb852057add629f0bd5624005724b556a8839ce91958411b90efd0884e8c224c6fc1e7346c563cd47f29144d9241b37c75cf549174b06eeaaed53
7
+ data.tar.gz: 0a599a9d04fc13c4f928e52bda1597eda0e8d3a0ca5ef0d808f424dcffa71fd6abd6a326c96e3790c9515c5210fcbda751ba2267cbed93e4015ae92dc795b5d2
@@ -1,9 +1,10 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2.7
3
+ - 2.2.9
4
4
  - 2.3.1
5
- - 2.3.4
6
- - 2.4.1
5
+ - 2.3.6
6
+ - 2.4.3
7
+ - 2.5.0
7
8
  - ruby-head
8
9
 
9
10
  sudo: false
@@ -1,12 +1,11 @@
1
1
  module RisingDragon
2
2
  class Event
3
3
  attr_reader :id, :type, :timestamp, :data
4
- def initialize(id:, type:, timestamp:, data:, sqs_msg:)
4
+ def initialize(id:, type:, timestamp:, data:)
5
5
  @id = id
6
6
  @type = type
7
7
  @timestamp = timestamp
8
8
  @data = data
9
- @sqs_msg = sqs_msg
10
9
  end
11
10
 
12
11
  def to_json(*option)
@@ -17,9 +16,5 @@ module RisingDragon
17
16
  data: @data,
18
17
  }.to_json(*option)
19
18
  end
20
-
21
- def delete!
22
- @sqs_msg.delete
23
- end
24
19
  end
25
20
  end
@@ -18,7 +18,7 @@ module RisingDragon
18
18
  private
19
19
 
20
20
  def create_event(type, data)
21
- ::RisingDragon::Event.new(id: uuid, timestamp: unixtime, type: type, data: data, sqs_msg: nil)
21
+ ::RisingDragon::Event.new(id: uuid, timestamp: unixtime, type: type, data: data)
22
22
  end
23
23
 
24
24
  def uuid
@@ -44,7 +44,7 @@ module RisingDragon
44
44
  nil
45
45
  end
46
46
 
47
- def event_from_json(sqs_msg, body)
47
+ def event_from_json(body)
48
48
  msg = JSON.parse(body['Message'])
49
49
 
50
50
  id = msg['id']
@@ -52,11 +52,11 @@ module RisingDragon
52
52
  timestamp = Time.at(msg['timestamp'] / 1000.0)
53
53
  data = msg['data']
54
54
 
55
- ::RisingDragon::Event.new(id: id, type: type, timestamp: timestamp, data: data, sqs_msg: sqs_msg)
55
+ ::RisingDragon::Event.new(id: id, type: type, timestamp: timestamp, data: data)
56
56
  end
57
57
 
58
- def emit_sqs_msg(sqs_msg, body)
59
- event = event_from_json(sqs_msg, body)
58
+ def emit_sns_msg(body)
59
+ event = event_from_json(body)
60
60
  emit_event(event)
61
61
  end
62
62
  end
@@ -37,8 +37,8 @@ module RisingDragon
37
37
  end
38
38
  end
39
39
 
40
- def perform(sqs_msg, body)
41
- self.class.emitter.emit_sqs_msg(sqs_msg, body)
40
+ def perform(_sqs_msg, body)
41
+ self.class.emitter.emit_sns_msg(body)
42
42
  rescue StandardError => e
43
43
  rescue_from(e)
44
44
  end
@@ -1,3 +1,3 @@
1
1
  module RisingDragon
2
- VERSION = '0.4.0'.freeze
2
+ VERSION = '0.5.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rising_dragon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ota42y
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-02-27 00:00:00.000000000 Z
11
+ date: 2018-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: shoryuken