• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

joker1007 / octogate / 44
95%
master: 95%

Build:
Build:
LAST BUILD BRANCH: v0.3.0
DEFAULT BRANCH: master
Ran 09 Mar 2014 10:25AM UTC
Jobs 2
Files 33
Run time –
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
44

push

travis-ci

joker1007
[from now] 2014/03/09 19:23:27

diff --git a/lib/octogate.rb b/lib/octogate.rb
index af82d29..cd38b23 100644
--- a/lib/octogate.rb
+++ b/lib/octogate.rb
@@ -28,15 +28,13 @@ module Octogate
     end

     def add_sent(target)
-      @sent ||= []
-      @sent.pop if @sent.length > REC_LIMIT
-      @sent.unshift target
+      sent.pop if sent.length > REC_LIMIT
+      sent.unshift target
     end

     def add_received(event)
-      @received ||= []
-      @received.pop if @received.length > REC_LIMIT
-      @received.unshift event
+      received.pop if received.length > REC_LIMIT
+      received.unshift event
     end
   end
 end
@@ -47,4 +45,5 @@ require "octogate/config_loader"
 require "octogate/target"
 require "octogate/target_builder"
 require "octogate/events"
+require "octogate/sent_event"
 require "octogate/gh"
diff --git a/lib/octogate/client.rb b/lib/octogate/client.rb
index 8cf1354..6afacf0 100644
--- a/lib/octogate/client.rb
+++ b/lib/octogate/client.rb
@@ -38,8 +38,8 @@ class Octogate::Client
         .do_request(url: uri.path, params: params, parameter_type: target.parameter_type)
     end

-    target.sent_at = Time.now
-    Octogate.add_sent(target)
+    sent_event = Octogate::SentEvent.build(event, target, params)
+    Octogate.add_sent(sent_event)
   end

   private
diff --git a/lib/octogate/events/base.rb b/lib/octogate/events/base.rb
index 73fba26..6a7e8d1 100644
--- a/lib/octogate/events/base.rb
+++ b/lib/octogate/events/base.rb
@@ -1,3 +1,5 @@
+require "oj"
+
 module Octogate
   class Event::Base < Octogate::Model
     class << self
@@ -9,6 +11,12 @@ module Octogate
           end
         end
       end
+
+      def parse(delivery_id, json)
+        payload = Oj.load(json).deep_symbolize_keys
+
+        new(payload.merge(delivery_id: delivery_id))
+      end
     end

     def default_condition
diff --git a/lib/octogate/events/issue.rb b/lib/octogate/events/issue.rb
index 7b4609f..d943fcb 100644
--- a/lib/octogate/events/issue.r... (continued)

382 of 400 relevant lines covered (95.5%)

6.44 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
1
100.0
lib/octogate.rb
2
100.0
lib/octogate/events/base.rb
Jobs
ID Job ID Ran Files Coverage
1 44.1 (2.1.1) 09 Mar 2014 10:26AM UTC 0
95.5
Travis Job 44.1
2 44.2 (2.0.0) 09 Mar 2014 10:25AM UTC 0
95.5
Travis Job 44.2
Source Files on build 44
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #44
  • e3ea590c on github
  • Prev Build on logging_and_viewer (#43)
  • Next Build on logging_and_viewer (#45)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc