acts_as_duration 0.0.4 → 0.0.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: c33854a951a6729e60c31761c2d55c32f73c6890
4
- data.tar.gz: b23eaf3eb1c0c39ef0224cb9837755ae61923570
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: 02857a45ee42f2947d4afbba377edcf1ab155c1a
4
+ data.tar.gz: 9ef65706fded9328b9791ba19abd987216f5d595
5
5
  SHA512:
6
- metadata.gz: 7175d89e8f0309963eca7c0bca22f564347b01481191a490c1e2cb61744efe7683dee9df480b3952534db334828c0b161d4b72521e1c3588e27e86672db3fc18
7
- data.tar.gz: 275a9b2196c305a45f64c3948e7eeabd847ac693ab8017d84b3d03645d4d219f40ba1a8c918aef73e44a4b777e1d9ca04f71b3be742623618ffafda27940f02f
6
+ metadata.gz: cc12def1314c0b27e76b8767629a2344baf102e8039daf7ea5493ebf746de1bb3190740c05b56740dbb6fc7cebd9ac5e72988f6cec845c8c5dce0c7db867e177
7
+ data.tar.gz: 4779bcded8c12c72bb4b74e7b24698e0c1870a546a02838904cee5d2a83f52a9fd840e372669764074887c0d0e9127265e00ad50f971566728c8a56895b3f866
@@ -1,3 +1,3 @@
1
1
  module ActsAsDuration
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -17,17 +17,17 @@ class ActsAsDurationTest < ActiveSupport::TestCase
17
17
  foo = Foobar.new(test_seconds: 5400)
18
18
  assert_equal 1.5, foo.test_hours
19
19
  assert_equal 90, foo.test_minutes
20
- assert_equal "01:30", foo.test_hhmmss
20
+ assert_equal "01:30:00", foo.test_hhmmss
21
21
 
22
22
  foo.test_hours = 2
23
23
  assert_equal 7200, foo.test_seconds
24
24
  assert_equal 120, foo.test_minutes
25
- assert_equal "02:00", foo.test_hhmmss
25
+ assert_equal "02:00:00", foo.test_hhmmss
26
26
 
27
27
  foo.test_minutes = 123
28
28
  assert_equal 7380, foo.test_seconds
29
29
  assert_equal 2.05, foo.test_hours
30
- assert_equal "02:03", foo.test_hhmmss
30
+ assert_equal "02:03:00", foo.test_hhmmss
31
31
 
32
32
 
33
33
  foo.test_hhmmss = "02:12:34"
@@ -52,7 +52,7 @@ class ActsAsDurationTest < ActiveSupport::TestCase
52
52
  assert_equal 1800, foo.test_seconds
53
53
  assert_equal 30, foo.test_minutes
54
54
  assert_equal 0.5, foo.test_hours
55
- assert_equal "00:30", foo.test_hhmmss
55
+ assert_equal "00:30:00", foo.test_hhmmss
56
56
  end
57
57
 
58
58
 
@@ -61,17 +61,17 @@ class ActsAsDurationTest < ActiveSupport::TestCase
61
61
  foo = Foobar.new(barfoo_minutes: 90)
62
62
  assert_equal 1.5, foo.barfoo_hours
63
63
  assert_equal 5400, foo.barfoo_seconds
64
- assert_equal "01:30", foo.barfoo_hhmmss
64
+ assert_equal "01:30:00", foo.barfoo_hhmmss
65
65
 
66
66
  foo.barfoo_hours = 2
67
67
  assert_equal 7200, foo.barfoo_seconds
68
68
  assert_equal 120, foo.barfoo_minutes
69
- assert_equal "02:00", foo.barfoo_hhmmss
69
+ assert_equal "02:00:00", foo.barfoo_hhmmss
70
70
 
71
71
  foo.barfoo_seconds = 7320
72
72
  assert_equal 122, foo.barfoo_minutes
73
73
  assert_equal 2.03, foo.barfoo_hours
74
- assert_equal "02:02", foo.barfoo_hhmmss
74
+ assert_equal "02:02:00", foo.barfoo_hhmmss
75
75
 
76
76
  foo.barfoo_hhmmss = "02:12:34"
77
77
  assert_equal 7954, foo.barfoo_seconds
@@ -89,12 +89,12 @@ class ActsAsDurationTest < ActiveSupport::TestCase
89
89
  foo.barfoo_hours = 2
90
90
  assert_equal 7200, foo.barfoo_seconds
91
91
  assert_equal 120, foo.barfoo_minutes
92
- assert_equal "02:00", foo.barfoo_hhmmss
92
+ assert_equal "02:00:00", foo.barfoo_hhmmss
93
93
 
94
94
  foo.barfoo_seconds = 7320
95
95
  assert_equal 122, foo.barfoo_minutes
96
96
  assert_equal 2.03, foo.barfoo_hours
97
- assert_equal "02:02", foo.barfoo_hhmmss
97
+ assert_equal "02:02:00", foo.barfoo_hhmmss
98
98
 
99
99
  foo.barfoo_minutes = 132.57
100
100
  assert_equal 7954, foo.barfoo_seconds
@@ -12,3 +12,6 @@ Migrating to CreateFoobars (20140424102459)
12
12
   (1.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
13
13
   (0.2ms) SELECT version FROM "schema_migrations"
14
14
   (1.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20140424102459')
15
+  (0.3ms) begin transaction
16
+ SQL (41.9ms) INSERT INTO "foobars" ("created_at", "updated_at") VALUES (?, ?) [["created_at", Tue, 20 May 2014 08:48:40 UTC +00:00], ["updated_at", Tue, 20 May 2014 08:48:40 UTC +00:00]]
17
+  (6.4ms) commit transaction
@@ -2145,3 +2145,131 @@ ActsAsDurationTest: test_converts_from_seconds_to_minutes,_hours,_and_string,_an
2145
2145
   (0.1ms) RELEASE SAVEPOINT active_record_1
2146
2146
  Foobar Load (0.1ms) SELECT "foobars".* FROM "foobars" WHERE "foobars"."id" = ? LIMIT 1 [["id", 1]]
2147
2147
   (0.5ms) rollback transaction
2148
+  (0.5ms) begin transaction
2149
+ -----------------------------------------------------------------------------
2150
+ ActsAsDurationTest: test_accepts_multiple_attributs_as_well_as_hash_arguments
2151
+ -----------------------------------------------------------------------------
2152
+  (0.1ms) rollback transaction
2153
+  (0.1ms) begin transaction
2154
+ --------------------------------------------------------------------
2155
+ ActsAsDurationTest: test_adds_additional_conversion_methods_to_model
2156
+ --------------------------------------------------------------------
2157
+  (0.1ms) rollback transaction
2158
+  (0.1ms) begin transaction
2159
+ ---------------------------------------------------------
2160
+ ActsAsDurationTest: test_adds_conversion_methods_to_model
2161
+ ---------------------------------------------------------
2162
+  (0.1ms) rollback transaction
2163
+  (0.0ms) begin transaction
2164
+ ----------------------------------------------------------------------------
2165
+ ActsAsDurationTest: test_converts_from_hhmmss_to_minutes,_seconds,_and_hours
2166
+ ----------------------------------------------------------------------------
2167
+  (0.8ms) rollback transaction
2168
+  (0.1ms) begin transaction
2169
+ ----------------------------------------------------------------------------
2170
+ ActsAsDurationTest: test_converts_from_minutes_to_seconds,_hours,_and_hhmmss
2171
+ ----------------------------------------------------------------------------
2172
+  (0.1ms) rollback transaction
2173
+  (0.1ms) begin transaction
2174
+ ---------------------------------------------------------------------------------------
2175
+ ActsAsDurationTest: test_converts_from_seconds_to_minutes,_hours,_and_string,_and_saves
2176
+ ---------------------------------------------------------------------------------------
2177
+  (0.1ms) rollback transaction
2178
+  (0.3ms) begin transaction
2179
+ -----------------------------------------------------------------------------
2180
+ ActsAsDurationTest: test_accepts_multiple_attributs_as_well_as_hash_arguments
2181
+ -----------------------------------------------------------------------------
2182
+  (0.1ms) rollback transaction
2183
+  (0.1ms) begin transaction
2184
+ --------------------------------------------------------------------
2185
+ ActsAsDurationTest: test_adds_additional_conversion_methods_to_model
2186
+ --------------------------------------------------------------------
2187
+  (0.1ms) rollback transaction
2188
+  (0.1ms) begin transaction
2189
+ ---------------------------------------------------------
2190
+ ActsAsDurationTest: test_adds_conversion_methods_to_model
2191
+ ---------------------------------------------------------
2192
+  (0.1ms) rollback transaction
2193
+  (0.1ms) begin transaction
2194
+ ----------------------------------------------------------------------------
2195
+ ActsAsDurationTest: test_converts_from_hhmmss_to_minutes,_seconds,_and_hours
2196
+ ----------------------------------------------------------------------------
2197
+  (0.1ms) rollback transaction
2198
+  (0.1ms) begin transaction
2199
+ ----------------------------------------------------------------------------
2200
+ ActsAsDurationTest: test_converts_from_minutes_to_seconds,_hours,_and_hhmmss
2201
+ ----------------------------------------------------------------------------
2202
+  (0.1ms) rollback transaction
2203
+  (0.1ms) begin transaction
2204
+ ---------------------------------------------------------------------------------------
2205
+ ActsAsDurationTest: test_converts_from_seconds_to_minutes,_hours,_and_string,_and_saves
2206
+ ---------------------------------------------------------------------------------------
2207
+  (0.1ms) rollback transaction
2208
+  (0.3ms) begin transaction
2209
+ -----------------------------------------------------------------------------
2210
+ ActsAsDurationTest: test_accepts_multiple_attributs_as_well_as_hash_arguments
2211
+ -----------------------------------------------------------------------------
2212
+  (0.1ms) rollback transaction
2213
+  (0.0ms) begin transaction
2214
+ --------------------------------------------------------------------
2215
+ ActsAsDurationTest: test_adds_additional_conversion_methods_to_model
2216
+ --------------------------------------------------------------------
2217
+  (0.0ms) rollback transaction
2218
+  (0.0ms) begin transaction
2219
+ ---------------------------------------------------------
2220
+ ActsAsDurationTest: test_adds_conversion_methods_to_model
2221
+ ---------------------------------------------------------
2222
+  (0.0ms) rollback transaction
2223
+  (0.0ms) begin transaction
2224
+ ----------------------------------------------------------------------------
2225
+ ActsAsDurationTest: test_converts_from_hhmmss_to_minutes,_seconds,_and_hours
2226
+ ----------------------------------------------------------------------------
2227
+  (0.1ms) rollback transaction
2228
+  (0.1ms) begin transaction
2229
+ ----------------------------------------------------------------------------
2230
+ ActsAsDurationTest: test_converts_from_minutes_to_seconds,_hours,_and_hhmmss
2231
+ ----------------------------------------------------------------------------
2232
+  (0.1ms) rollback transaction
2233
+  (0.1ms) begin transaction
2234
+ ---------------------------------------------------------------------------------------
2235
+ ActsAsDurationTest: test_converts_from_seconds_to_minutes,_hours,_and_string,_and_saves
2236
+ ---------------------------------------------------------------------------------------
2237
+  (0.1ms) SAVEPOINT active_record_1
2238
+ SQL (2.6ms) INSERT INTO "foobars" ("created_at", "test_seconds", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 20 May 2014 09:10:00 UTC +00:00], ["test_seconds", 1800], ["updated_at", Tue, 20 May 2014 09:10:00 UTC +00:00]]
2239
+  (7.2ms) RELEASE SAVEPOINT active_record_1
2240
+ Foobar Load (0.1ms) SELECT "foobars".* FROM "foobars" WHERE "foobars"."id" = ? LIMIT 1 [["id", 1]]
2241
+  (14.8ms) rollback transaction
2242
+  (0.3ms) begin transaction
2243
+ -----------------------------------------------------------------------------
2244
+ ActsAsDurationTest: test_accepts_multiple_attributs_as_well_as_hash_arguments
2245
+ -----------------------------------------------------------------------------
2246
+  (0.1ms) rollback transaction
2247
+  (0.1ms) begin transaction
2248
+ --------------------------------------------------------------------
2249
+ ActsAsDurationTest: test_adds_additional_conversion_methods_to_model
2250
+ --------------------------------------------------------------------
2251
+  (0.1ms) rollback transaction
2252
+  (0.1ms) begin transaction
2253
+ ---------------------------------------------------------
2254
+ ActsAsDurationTest: test_adds_conversion_methods_to_model
2255
+ ---------------------------------------------------------
2256
+  (0.1ms) rollback transaction
2257
+  (0.0ms) begin transaction
2258
+ ----------------------------------------------------------------------------
2259
+ ActsAsDurationTest: test_converts_from_hhmmss_to_minutes,_seconds,_and_hours
2260
+ ----------------------------------------------------------------------------
2261
+  (0.1ms) rollback transaction
2262
+  (0.1ms) begin transaction
2263
+ ----------------------------------------------------------------------------
2264
+ ActsAsDurationTest: test_converts_from_minutes_to_seconds,_hours,_and_hhmmss
2265
+ ----------------------------------------------------------------------------
2266
+  (0.0ms) rollback transaction
2267
+  (0.1ms) begin transaction
2268
+ ---------------------------------------------------------------------------------------
2269
+ ActsAsDurationTest: test_converts_from_seconds_to_minutes,_hours,_and_string,_and_saves
2270
+ ---------------------------------------------------------------------------------------
2271
+  (0.1ms) SAVEPOINT active_record_1
2272
+ SQL (17.4ms) INSERT INTO "foobars" ("created_at", "test_seconds", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 20 May 2014 10:30:06 UTC +00:00], ["test_seconds", 1800], ["updated_at", Tue, 20 May 2014 10:30:06 UTC +00:00]]
2273
+  (7.4ms) RELEASE SAVEPOINT active_record_1
2274
+ Foobar Load (0.1ms) SELECT "foobars".* FROM "foobars" WHERE "foobars"."id" = ? LIMIT 1 [["id", 1]]
2275
+  (1.2ms) rollback transaction
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_duration
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
  - Yonah Forst
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-30 00:00:00.000000000 Z
11
+ date: 2014-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: 4.0.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: 4.0.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sqlite3
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - ! '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - ! '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  description: adds getter and setters for an existing attribute to covnert between
@@ -47,7 +47,6 @@ extensions: []
47
47
  extra_rdoc_files: []
48
48
  files:
49
49
  - MIT-LICENSE
50
- - README.rdoc
51
50
  - Rakefile
52
51
  - lib/acts_as_duration.rb
53
52
  - lib/acts_as_duration/base.rb
@@ -105,12 +104,12 @@ require_paths:
105
104
  - lib
106
105
  required_ruby_version: !ruby/object:Gem::Requirement
107
106
  requirements:
108
- - - ">="
107
+ - - ! '>='
109
108
  - !ruby/object:Gem::Version
110
109
  version: '0'
111
110
  required_rubygems_version: !ruby/object:Gem::Requirement
112
111
  requirements:
113
- - - ">="
112
+ - - ! '>='
114
113
  - !ruby/object:Gem::Version
115
114
  version: '0'
116
115
  requirements: []
@@ -1,3 +0,0 @@
1
- = ActsAsDuration
2
-
3
- This project rocks and uses MIT-LICENSE.