waffle 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +3 -2
- data/lib/waffle/configuration.rb +9 -1
- data/lib/waffle/version.rb +1 -1
- data/test/test_utils.rb +16 -0
- metadata +6 -5
data/.travis.yml
CHANGED
data/lib/waffle/configuration.rb
CHANGED
@@ -1,8 +1,16 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
|
1
3
|
module Waffle
|
2
4
|
class Configuration
|
3
5
|
|
4
6
|
def initialize(custom_params = {})
|
5
|
-
@configuration = {'strategy' => 'rabbitmq', 'url' => nil}
|
7
|
+
@configuration = {'strategy' => 'rabbitmq', 'url' => nil}
|
8
|
+
|
9
|
+
if defined? Rails
|
10
|
+
@configuration.merge! YAML.load_file("#{Rails.root}/config/#{Rails.env}.waffle.yml")
|
11
|
+
end
|
12
|
+
|
13
|
+
@configuration.merge! custom_params
|
6
14
|
end
|
7
15
|
|
8
16
|
def method_missing(m, *args, &block)
|
data/lib/waffle/version.rb
CHANGED
data/test/test_utils.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'waffle/utils'
|
3
|
+
|
4
|
+
class UtilsTest < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def test_encode
|
7
|
+
encoded_msg = Waffle::Utils.encode({'a' => 1, 'b' => 2})
|
8
|
+
assert_equal('{"a":1,"b":2}', encoded_msg)
|
9
|
+
end
|
10
|
+
|
11
|
+
def test_decode
|
12
|
+
decoded_msg = Waffle::Utils.decode('{"a":1,"b":2}')
|
13
|
+
assert_equal({'a' => 1, 'b' => 2}, decoded_msg)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: waffle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-03-19 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bunny
|
16
|
-
requirement: &
|
16
|
+
requirement: &78749830 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *78749830
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: yajl-ruby
|
27
|
-
requirement: &
|
27
|
+
requirement: &78749560 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *78749560
|
36
36
|
description: Client part of Patty statistics server
|
37
37
|
email: alexander.lomakin@gmail.com
|
38
38
|
executables: []
|
@@ -51,6 +51,7 @@ files:
|
|
51
51
|
- lib/waffle/utils.rb
|
52
52
|
- lib/waffle/version.rb
|
53
53
|
- test/test_rabbitmq.rb
|
54
|
+
- test/test_utils.rb
|
54
55
|
- waffle.gemspec
|
55
56
|
homepage: ''
|
56
57
|
licenses: []
|