bushido 0.0.13 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/bushido/event.rb CHANGED
@@ -7,26 +7,34 @@ module Bushido
7
7
  # Data will hold the arbitrary data for the type of event signalled
8
8
  class Event
9
9
  begin
10
- @@events = YAML.load(ENV["BUSHIDO_EVENTS"]) #:nodoc:
10
+ @@events = JSON.parse(ENV["BUSHIDO_EVENTS"]) #:nodoc:
11
11
  rescue
12
12
  @@events = []
13
13
  end
14
14
 
15
+ attr_reader :category, :name, :data
16
+
15
17
  class << self
16
18
  # Lists all events
17
19
  def all
18
- @@events
20
+ @@events.collect{ |e| Event.new(e) }
19
21
  end
20
22
 
21
23
  # Lists the first (oldest) event
22
24
  def first
23
- @@events.first
25
+ Event.new(@@events.first)
24
26
  end
25
27
 
26
28
  # Lists the last (newest) event
27
29
  def last
28
- @@events.last
30
+ Event.new(@@events.last)
29
31
  end
30
32
  end
33
+
34
+ def initialize(options={})
35
+ @category = options["category"]
36
+ @name = options["name"]
37
+ @data = options["data"]
38
+ end
31
39
  end
32
40
  end
@@ -1,4 +1,4 @@
1
1
  module Bushido
2
2
  # Current version of the Bushido gem
3
- VERSION = "0.0.13"
3
+ VERSION = "0.0.14"
4
4
  end
data/lib/bushido.rb CHANGED
@@ -1,15 +1,13 @@
1
1
  module Bushido #:nodoc:
2
- require 'rubygems'
3
2
  require 'optparse'
4
3
  require 'rest-client'
5
4
  require 'json'
6
5
  require 'highline/import'
7
- require 'yaml'
8
6
 
9
7
  require "bushido/platform"
10
8
  require "bushido/utils"
11
9
  require "bushido/command"
12
10
  require "bushido/app"
13
11
  require "bushido/user"
14
- require "bushido/events"
12
+ require "bushido/event"
15
13
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: bushido
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.13
5
+ version: 0.0.14
6
6
  platform: ruby
7
7
  authors:
8
8
  - Sean Grove