flashover 0.0.1 → 0.0.2
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/Gemfile.lock +11 -1
- data/flashover.gemspec +2 -1
- data/lib/flashover.rb +12 -3
- data/spec/flashover_spec.rb +2 -2
- data/spec/spec_helper.rb +1 -4
- metadata +18 -2
data/Gemfile.lock
CHANGED
@@ -1,14 +1,23 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
flashover (0.0.
|
4
|
+
flashover (0.0.2)
|
5
5
|
redis (>= 3.0.2)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: http://rubygems.org/
|
9
9
|
specs:
|
10
|
+
diff-lcs (1.1.3)
|
10
11
|
rake (10.0.3)
|
11
12
|
redis (3.0.2)
|
13
|
+
rspec (2.12.0)
|
14
|
+
rspec-core (~> 2.12.0)
|
15
|
+
rspec-expectations (~> 2.12.0)
|
16
|
+
rspec-mocks (~> 2.12.0)
|
17
|
+
rspec-core (2.12.2)
|
18
|
+
rspec-expectations (2.12.1)
|
19
|
+
diff-lcs (~> 1.1.3)
|
20
|
+
rspec-mocks (2.12.2)
|
12
21
|
|
13
22
|
PLATFORMS
|
14
23
|
ruby
|
@@ -16,3 +25,4 @@ PLATFORMS
|
|
16
25
|
DEPENDENCIES
|
17
26
|
flashover!
|
18
27
|
rake (>= 10.0.0)
|
28
|
+
rspec
|
data/flashover.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
|
|
7
7
|
## If your rubyforge_project name is different, then edit it and comment out
|
8
8
|
## the sub! line in the Rakefile
|
9
9
|
s.name = 'flashover'
|
10
|
-
s.version = '0.0.
|
10
|
+
s.version = '0.0.2'
|
11
11
|
s.date = '2013-02-06'
|
12
12
|
# s.rubyforge_project = 'flashover'
|
13
13
|
|
@@ -37,6 +37,7 @@ Gem::Specification.new do |s|
|
|
37
37
|
s.add_dependency('redis', [">= 3.0.2"])
|
38
38
|
|
39
39
|
s.add_development_dependency('rake', [">= 10.0.0"])
|
40
|
+
s.add_development_dependency('rspec')
|
40
41
|
|
41
42
|
## Leave this section as-is. It will be automatically generated from the
|
42
43
|
## contents of your Git repository via the gemspec task. DO NOT REMOVE
|
data/lib/flashover.rb
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
require "json"
|
2
2
|
require "redis"
|
3
|
+
require "openssl"
|
3
4
|
|
4
5
|
class Flashover
|
5
6
|
|
6
|
-
VERSION = "0.0.
|
7
|
+
VERSION = "0.0.2"
|
7
8
|
|
8
9
|
MESSAGE_TYPES = [
|
9
10
|
:sms,
|
@@ -34,11 +35,11 @@ class Flashover
|
|
34
35
|
true
|
35
36
|
rescue Errno::ETIMEDOUT => ex
|
36
37
|
Airbrake.notify(ex)
|
37
|
-
|
38
|
+
logger "Flashover TIMEOUT @ #{Time.now.ctime}"
|
38
39
|
false
|
39
40
|
rescue => ex
|
40
41
|
Airbrake.notify(ex)
|
41
|
-
|
42
|
+
logger "BANG @ Flashover#event => #{ex.class} -> '#{ex.message}'"
|
42
43
|
false
|
43
44
|
end
|
44
45
|
end
|
@@ -99,6 +100,14 @@ class Flashover
|
|
99
100
|
@environment || ENV["FLASHOVER_ENV"] || ENV["RAILS_ENV"] || "development"
|
100
101
|
end
|
101
102
|
|
103
|
+
def logger(message)
|
104
|
+
if defined? Rails
|
105
|
+
Rails.logger.error message
|
106
|
+
else
|
107
|
+
$stderr.puts message
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
102
111
|
class Crypto
|
103
112
|
|
104
113
|
def initialize(passphrase, salt)
|
data/spec/flashover_spec.rb
CHANGED
@@ -6,7 +6,7 @@ describe Flashover do
|
|
6
6
|
redis = Object.new
|
7
7
|
redis.should_receive(:publish).with("flashover:pubsub:test:sms", anything) { true }
|
8
8
|
|
9
|
-
flashover = Flashover.new redis, "password"
|
9
|
+
flashover = Flashover.new redis, "password", "saltsalt"
|
10
10
|
flashover.sms "hello" => "world"
|
11
11
|
end
|
12
12
|
|
@@ -16,7 +16,7 @@ describe Flashover do
|
|
16
16
|
redis = Object.new
|
17
17
|
redis.should_receive(:publish).with("flashover:pubsub:test:sms", anything) { true }
|
18
18
|
|
19
|
-
flashover = Flashover.new redis, "password"
|
19
|
+
flashover = Flashover.new redis, "password", "saltsalt"
|
20
20
|
flashover.sms "hello" => "world"
|
21
21
|
end
|
22
22
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -4,7 +4,7 @@ class Airbrake
|
|
4
4
|
class << self
|
5
5
|
|
6
6
|
@@exceptions = []
|
7
|
-
|
7
|
+
|
8
8
|
def notify exception
|
9
9
|
@@exceptions << exception
|
10
10
|
end
|
@@ -12,8 +12,5 @@ class Airbrake
|
|
12
12
|
end
|
13
13
|
|
14
14
|
require "json"
|
15
|
-
require "rails"
|
16
|
-
|
17
|
-
Rails.logger = Logger.new "/dev/null"
|
18
15
|
|
19
16
|
ENV["RAILS_ENV"] = "test"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flashover
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -43,6 +43,22 @@ dependencies:
|
|
43
43
|
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: 10.0.0
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rspec
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
46
62
|
description: Fires events down a hose towards the Great Unknown.
|
47
63
|
email: x@rubynerd.net
|
48
64
|
executables: []
|
@@ -76,7 +92,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
76
92
|
version: '0'
|
77
93
|
segments:
|
78
94
|
- 0
|
79
|
-
hash:
|
95
|
+
hash: 635554720703059146
|
80
96
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
81
97
|
none: false
|
82
98
|
requirements:
|