cloud-logger 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -21,7 +21,7 @@ Jeweler::Tasks.new do |gem|
21
21
  gem.description ="A simple Ruby interface to the APIs of various cloud logging services"
22
22
  gem.email = "mitchellryanj@gmail.com"
23
23
  gem.authors = ["Ryan Mitchell"]
24
- gem.version = "0.0.1"
24
+ gem.version = "0.0.2"
25
25
  # dependencies defined in Gemfile
26
26
  end
27
27
  Jeweler::RubygemsDotOrgTasks.new
data/cloud-logger.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "cloud-logger"
8
- s.version = "0.0.1"
8
+ s.version = "0.0.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ryan Mitchell"]
12
- s.date = "2011-09-21"
12
+ s.date = "2011-09-22"
13
13
  s.description = "A simple Ruby interface to the APIs of various cloud logging services"
14
14
  s.email = "mitchellryanj@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -29,6 +29,7 @@ Gem::Specification.new do |s|
29
29
  "lib/event.rb",
30
30
  "lib/loggly.rb",
31
31
  "lib/papertrail.rb",
32
+ "spec/event_spec.rb",
32
33
  "spec/loggly_spec.rb",
33
34
  "spec/papertrail_spec.rb",
34
35
  "spec/spec_helper.rb"
data/lib/event.rb CHANGED
@@ -8,7 +8,14 @@ module CloudLogger
8
8
 
9
9
  def initialize(text, timestamp)
10
10
  @text = text
11
- @timestamp = DateTime.parse(timestamp)
11
+
12
+ if timestamp.instance_of? DateTime
13
+ @timestamp = timestamp
14
+ elsif timestamp.instance_of? Fixnum
15
+ @timestamp = DateTime.new(timestamp)
16
+ else
17
+ @timestamp = DateTime.parse(timestamp.to_s)
18
+ end
12
19
  end
13
20
  end
14
21
  end
data/lib/loggly.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module CloudLogger
2
2
 
3
- class Loggly
3
+ class Loggly < Base
4
4
 
5
5
  # a json object with a data property which is an array with zero or more elements
6
6
  #ResponseMatcher = /\{\s*"data": \[\s*(\{.*?\})*\s*\]/m
data/lib/papertrail.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module CloudLogger
2
2
 
3
- class Papertrail
3
+ class Papertrail < Base
4
4
 
5
5
  def initialize(options)
6
6
  @user = options[:user]
@@ -0,0 +1,34 @@
1
+ require 'spec_helper'
2
+
3
+ describe CloudLogger::Event do
4
+
5
+ it "should construct a valid event from a DateTime instance" do
6
+ time = DateTime.now
7
+ event = CloudLogger::Event.new('test', time)
8
+ event.timestamp.should be_instance_of DateTime
9
+ end
10
+
11
+ it "should construct a valid event from a Time instance" do
12
+ time = Time.now
13
+ event = CloudLogger::Event.new('test', time)
14
+ event.timestamp.should be_instance_of DateTime
15
+ end
16
+
17
+ it "should construct a valid event from a Date instance" do
18
+ time = Date.today
19
+ event = CloudLogger::Event.new('test', time)
20
+ event.timestamp.should be_instance_of DateTime
21
+ end
22
+
23
+ it "should construct a valid event from a string representation of a date" do
24
+ time = "2011-09-21T18:48:55.151Z"
25
+ event = CloudLogger::Event.new('test', time)
26
+ event.timestamp.should be_instance_of DateTime
27
+ end
28
+
29
+ it "should construct a valid event from a Unix timestamp" do
30
+ time = 1316645975
31
+ event = CloudLogger::Event.new('test', time)
32
+ event.timestamp.should be_instance_of DateTime
33
+ end
34
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloud-logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-21 00:00:00.000000000Z
12
+ date: 2011-09-22 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
16
- requirement: &25526720 !ruby/object:Gem::Requirement
16
+ requirement: &26695120 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.6.3
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *25526720
24
+ version_requirements: *26695120
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &25526240 !ruby/object:Gem::Requirement
27
+ requirement: &26694640 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>'
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 2.3.0
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *25526240
35
+ version_requirements: *26694640
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: bundler
38
- requirement: &25525640 !ruby/object:Gem::Requirement
38
+ requirement: &26694140 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>'
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 1.0.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *25525640
46
+ version_requirements: *26694140
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: jeweler
49
- requirement: &25525140 !ruby/object:Gem::Requirement
49
+ requirement: &26693580 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.6.4
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *25525140
57
+ version_requirements: *26693580
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rcov
60
- requirement: &25524620 !ruby/object:Gem::Requirement
60
+ requirement: &26693100 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *25524620
68
+ version_requirements: *26693100
69
69
  description: A simple Ruby interface to the APIs of various cloud logging services
70
70
  email: mitchellryanj@gmail.com
71
71
  executables: []
@@ -86,6 +86,7 @@ files:
86
86
  - lib/event.rb
87
87
  - lib/loggly.rb
88
88
  - lib/papertrail.rb
89
+ - spec/event_spec.rb
89
90
  - spec/loggly_spec.rb
90
91
  - spec/papertrail_spec.rb
91
92
  - spec/spec_helper.rb
@@ -104,7 +105,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
104
105
  version: '0'
105
106
  segments:
106
107
  - 0
107
- hash: 196934442856709586
108
+ hash: -451662845447376431
108
109
  required_rubygems_version: !ruby/object:Gem::Requirement
109
110
  none: false
110
111
  requirements: