barometer-support 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9019e9fb137a0da5519db2edb39f5f6325929ecb
4
- data.tar.gz: bc8fe5727854a5f10665fd464195bb7db89407fe
3
+ metadata.gz: a7fd5ebec1f822d8d909cfef44c3fed4a943175e
4
+ data.tar.gz: 4ab7ec7c4ddf5a10f45c96d048aba2da45feac34
5
5
  SHA512:
6
- metadata.gz: dfe5b3f5be7c3d899205ec3695045590859e93e73b99579c7659ac5d35fefa62cc647f9baba648eaa04583b70457b70e637ecbf97367cd15df1d745197975c68
7
- data.tar.gz: 014350546a00b62319ed317f01ffe949852f9d4f4f6f9850bfe01e7f273775ae4be305776bd651a8c5057ac04d0a1a0dc2b4b00e7b604cfda5d10330ba65ba97
6
+ metadata.gz: 6f7cf5449c00fffdc10ba3a1d266931e8bcb4d5b5e6d12116a70d63aef67fe385b539da29818c634b6557bcc27c909edceb4832ebdd02f01c9b1d4358e43a353
7
+ data.tar.gz: c6b4ac2cdb938740fd8b0ff42974391dbc5544d96ca2af84f4f9014e6fc9fd73598a25753a8742954d9a4fee545957ee99d40ee990c40300cc5760fa44a59836
@@ -42,9 +42,13 @@ module Barometer
42
42
  if type_is_time?
43
43
  set_value "2013-01-01 10:15:30 am"
44
44
  elsif type_is_sun?
45
- rise = Time.utc(2013,1,1,10,15,30)
46
- set = Time.utc(2013,1,1,18,14,56)
47
- set_value Data::Sun.new(rise: rise, set: set)
45
+ rise = ::Time.utc(2013,1,1,10,15,30)
46
+ set = ::Time.utc(2013,1,1,18,14,56)
47
+ set_value @type.new(rise: rise, set: set)
48
+ elsif type_is_symbol?
49
+ set_value 'foo'
50
+ elsif type_is_hash?
51
+ set_value(foo: 'bar')
48
52
  else
49
53
  set_value 10
50
54
  end
@@ -54,12 +58,18 @@ module Barometer
54
58
  def sets_value?
55
59
  if type_is_time?
56
60
  set_value "10 15 30 2013 01 01 am", "%H %M %S %Y %m %d %p"
57
- assert value.to_i == Time.utc(2013,01,01,10,15,30).to_i, "expected value of '2013-01-01 10:15:30 am', got '#{print_value}'"
61
+ assert value.to_i == ::Time.utc(2013,01,01,10,15,30).to_i, "expected value of '2013-01-01 10:15:30 am', got '#{print_value}'"
58
62
  elsif type_is_sun?
59
- rise = Time.utc(2013,1,1,10,15,30)
60
- set = Time.utc(2013,1,1,18,14,56)
61
- set_value Data::Sun.new(rise: rise, set: set)
63
+ rise = ::Time.utc(2013,1,1,10,15,30)
64
+ set = ::Time.utc(2013,1,1,18,14,56)
65
+ set_value @type.new(rise: rise, set: set)
62
66
  assert print_value == "rise: 10:15, set: 18:14", "expected value of 'rise: 10:15, set: 18:14'', got '#{print_value}'"
67
+ elsif type_is_symbol?
68
+ set_value 'foo'
69
+ assert value == :foo, "expected value of ':foo', got '#{value}'"
70
+ elsif type_is_hash?
71
+ set_value(foo: 'bar')
72
+ assert value == {foo: 'bar'}, "expected value of '{foo: 'bar'}', got '#{value}'"
63
73
  else
64
74
  set_value 10
65
75
  assert value.to_i == 10, "expected value of '10', got '#{value.to_i}'"
@@ -109,11 +119,19 @@ module Barometer
109
119
  end
110
120
 
111
121
  def type_is_time?
112
- @type == Time
122
+ @type == ::Time
113
123
  end
114
124
 
115
125
  def type_is_sun?
116
- @type == Data::Sun
126
+ @type.to_s.end_with? 'Data::Sun'
127
+ end
128
+
129
+ def type_is_symbol?
130
+ @type == ::Symbol
131
+ end
132
+
133
+ def type_is_hash?
134
+ @type == ::Hash
117
135
  end
118
136
 
119
137
  def assert(test, failure_message)
@@ -1,5 +1,5 @@
1
1
  module Barometer
2
2
  module Support
3
- VERSION = '0.0.4'
3
+ VERSION = '0.0.5'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: barometer-support
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Gangl
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-20 00:00:00.000000000 Z
11
+ date: 2014-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -72,3 +72,4 @@ signing_key:
72
72
  specification_version: 4
73
73
  summary: Barometer support files
74
74
  test_files: []
75
+ has_rdoc: