clock 0.1.3 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
data/lib/clock.rb
CHANGED
@@ -1,20 +1,13 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
self.now.to_date
|
4
|
-
end
|
5
|
-
end
|
1
|
+
require 'rails'
|
2
|
+
require 'clock/clock'
|
6
3
|
|
7
4
|
module Pivotal
|
8
5
|
module Clock
|
9
|
-
class Railtie < ::Rails::
|
6
|
+
class Railtie < ::Rails::Engine
|
7
|
+
config.autoload_paths << File.expand_path(File.join(File.dirname(__FILE__), 'clock'))
|
10
8
|
config.before_configuration do
|
11
|
-
|
9
|
+
::Clock.use_mock_clock? ? require("clock/mock_clock") : require('clock/real_clock')
|
12
10
|
end
|
13
11
|
end
|
14
|
-
|
15
|
-
def self.use_mock_clock?
|
16
|
-
return USE_MOCK_CLOCK if Object.const_defined?(:USE_MOCK_CLOCK)
|
17
|
-
return ::Rails.env.test?
|
18
|
-
end
|
19
12
|
end
|
20
13
|
end
|
data/lib/clock/clock.rb
ADDED
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 21
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
+
- 2
|
8
9
|
- 1
|
9
|
-
|
10
|
-
version: 0.1.3
|
10
|
+
version: 0.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Pivotal Labs
|
@@ -15,13 +15,94 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
19
|
-
default_executable:
|
18
|
+
date: 2011-12-05 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
21
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
22
|
+
none: false
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
hash: 3
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
version: "0"
|
30
|
+
version_requirements: *id001
|
31
|
+
name: clock
|
32
|
+
prerelease: false
|
33
|
+
type: :runtime
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
36
|
+
none: false
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
hash: 3
|
41
|
+
segments:
|
42
|
+
- 0
|
43
|
+
version: "0"
|
44
|
+
version_requirements: *id002
|
45
|
+
name: jeweler
|
46
|
+
prerelease: false
|
47
|
+
type: :runtime
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
hash: 3
|
55
|
+
segments:
|
56
|
+
- 0
|
57
|
+
version: "0"
|
58
|
+
version_requirements: *id003
|
59
|
+
name: rake
|
60
|
+
prerelease: false
|
61
|
+
type: :runtime
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
64
|
+
none: false
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
hash: 3
|
69
|
+
segments:
|
70
|
+
- 0
|
71
|
+
version: "0"
|
72
|
+
version_requirements: *id004
|
73
|
+
name: rspec-rails
|
74
|
+
prerelease: false
|
75
|
+
type: :runtime
|
76
|
+
- !ruby/object:Gem::Dependency
|
77
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
78
|
+
none: false
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
hash: 3
|
83
|
+
segments:
|
84
|
+
- 0
|
85
|
+
version: "0"
|
86
|
+
version_requirements: *id005
|
22
87
|
name: rails
|
23
88
|
prerelease: false
|
24
|
-
|
89
|
+
type: :runtime
|
90
|
+
- !ruby/object:Gem::Dependency
|
91
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
92
|
+
none: false
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
hash: 3
|
97
|
+
segments:
|
98
|
+
- 0
|
99
|
+
version: "0"
|
100
|
+
version_requirements: *id006
|
101
|
+
name: sqlite3
|
102
|
+
prerelease: false
|
103
|
+
type: :runtime
|
104
|
+
- !ruby/object:Gem::Dependency
|
105
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
25
106
|
none: false
|
26
107
|
requirements:
|
27
108
|
- - ~>
|
@@ -32,8 +113,10 @@ dependencies:
|
|
32
113
|
- 0
|
33
114
|
- 0
|
34
115
|
version: 3.0.0
|
116
|
+
version_requirements: *id007
|
117
|
+
name: rails
|
118
|
+
prerelease: false
|
35
119
|
type: :runtime
|
36
|
-
version_requirements: *id001
|
37
120
|
description: Works exactly like Ruby's standard Time object, but in test mode adds some nice methods for setting or manually advancing time.
|
38
121
|
email: pivotal-opensource@googlegroups.com
|
39
122
|
executables: []
|
@@ -44,17 +127,17 @@ extra_rdoc_files:
|
|
44
127
|
- README.markdown
|
45
128
|
files:
|
46
129
|
- lib/clock.rb
|
47
|
-
- lib/
|
48
|
-
- lib/
|
49
|
-
- lib/
|
130
|
+
- lib/clock/clock.rb
|
131
|
+
- lib/clock/mock_clock.rb
|
132
|
+
- lib/clock/real_clock.rb
|
133
|
+
- lib/clock/time_zone_proxy.rb
|
50
134
|
- README.markdown
|
51
|
-
has_rdoc: true
|
52
135
|
homepage: http://github.com/pivotal/clock
|
53
136
|
licenses: []
|
54
137
|
|
55
138
|
post_install_message:
|
56
|
-
rdoc_options:
|
57
|
-
|
139
|
+
rdoc_options: []
|
140
|
+
|
58
141
|
require_paths:
|
59
142
|
- lib
|
60
143
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -78,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
161
|
requirements: []
|
79
162
|
|
80
163
|
rubyforge_project:
|
81
|
-
rubygems_version: 1.
|
164
|
+
rubygems_version: 1.8.6
|
82
165
|
signing_key:
|
83
166
|
specification_version: 3
|
84
167
|
summary: A wrapper for Ruby's Time object that includes a mock for manipulating time in tests
|