zoneless_time 0.3.2 → 1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/MIT-LICENSE +20 -0
- data/README.md +29 -0
- data/Rakefile +3 -0
- data/init.rb +1 -0
- data/install.rb +1 -0
- data/lib/zoneless_time.rb +1 -0
- data/lib/zoneless_time/quoting.rb +8 -0
- data/lib/zoneless_time/railtie.rb +1 -0
- data/lib/zoneless_time/time_without_zone.rb +8 -0
- data/lib/zoneless_time/version.rb +3 -0
- data/uninstall.rb +1 -0
- data/zoneless_time.gemspec +17 -0
- metadata +23 -11
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Shaun Mangelsdorf
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Shaun Mangelsdorf
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# ZonelessTime
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'zoneless_time'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install zoneless_time
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
data/init.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# Include hook code here
|
data/install.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# Install hook code here
|
data/lib/zoneless_time.rb
CHANGED
@@ -5,6 +5,7 @@ require 'active_record/zoneless_time_support'
|
|
5
5
|
require 'zoneless_time/time_without_zone'
|
6
6
|
require 'zoneless_time/time_extension'
|
7
7
|
require 'zoneless_time/date_extension'
|
8
|
+
require 'zoneless_time/quoting'
|
8
9
|
|
9
10
|
Time.send :include, ZonelessTime::TimeExtension::InstanceMethods
|
10
11
|
Date.send :include, ZonelessTime::DateExtension::InstanceMethods
|
@@ -6,6 +6,7 @@ module ZonelessTime
|
|
6
6
|
initializer 'zoneless_time.configure_rails_initialization' do
|
7
7
|
ActiveSupport::TimeWithZone.send :include, ZonelessTime::TimeExtension::InstanceMethods
|
8
8
|
ActiveRecord::Base.send :extend, ActiveRecord::ZonelessTimeSupport
|
9
|
+
ActiveRecord::Base.connection.class.send :include, ZonelessTime::Quoting
|
9
10
|
|
10
11
|
if config.active_record.time_zone_aware_attributes
|
11
12
|
require 'zoneless_time/warning'
|
@@ -17,10 +17,18 @@ module ZonelessTime
|
|
17
17
|
to_i > other.to_time.to_i
|
18
18
|
end
|
19
19
|
|
20
|
+
def >=(other)
|
21
|
+
to_i >= other.to_time.to_i
|
22
|
+
end
|
23
|
+
|
20
24
|
def <(other)
|
21
25
|
to_i < other.to_time.to_i
|
22
26
|
end
|
23
27
|
|
28
|
+
def <=(other)
|
29
|
+
to_i <= other.to_time.to_i
|
30
|
+
end
|
31
|
+
|
24
32
|
def +(amount)
|
25
33
|
(to_time + amount).without_zone
|
26
34
|
end
|
data/uninstall.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# Uninstall hook code here
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/zoneless_time/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Shaun Mangelsdorf"]
|
6
|
+
gem.email = ["s.mangelsdorf@gmail.com"]
|
7
|
+
gem.description = %q{TimeWithoutZone support for ActiveRecord}
|
8
|
+
gem.summary = %q{TimeWithoutZone support for ActiveRecord}
|
9
|
+
gem.homepage = "https://github.com/smangelsdorf/zoneless_time"
|
10
|
+
|
11
|
+
gem.files = `git ls-files`.split($\)
|
12
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
13
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
|
+
gem.name = "zoneless_time"
|
15
|
+
gem.require_paths = ["lib"]
|
16
|
+
gem.version = ZonelessTime::VERSION
|
17
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zoneless_time
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
|
+
- 1
|
7
8
|
- 0
|
8
|
-
|
9
|
-
- 2
|
10
|
-
version: 0.3.2
|
9
|
+
version: "1.0"
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Shaun Mangelsdorf
|
@@ -15,27 +14,40 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date:
|
17
|
+
date: 2013-01-16 00:00:00 Z
|
19
18
|
dependencies: []
|
20
19
|
|
21
|
-
description:
|
20
|
+
description: TimeWithoutZone support for ActiveRecord
|
22
21
|
email:
|
22
|
+
- s.mangelsdorf@gmail.com
|
23
23
|
executables: []
|
24
24
|
|
25
25
|
extensions: []
|
26
26
|
|
27
|
-
extra_rdoc_files:
|
28
|
-
|
27
|
+
extra_rdoc_files: []
|
28
|
+
|
29
29
|
files:
|
30
|
+
- .gitignore
|
31
|
+
- Gemfile
|
32
|
+
- LICENSE
|
33
|
+
- MIT-LICENSE
|
34
|
+
- README
|
35
|
+
- README.md
|
36
|
+
- Rakefile
|
37
|
+
- init.rb
|
38
|
+
- install.rb
|
30
39
|
- lib/active_record/zoneless_time_support.rb
|
31
40
|
- lib/zoneless_time.rb
|
32
41
|
- lib/zoneless_time/date_extension.rb
|
42
|
+
- lib/zoneless_time/quoting.rb
|
33
43
|
- lib/zoneless_time/railtie.rb
|
34
44
|
- lib/zoneless_time/time_extension.rb
|
35
45
|
- lib/zoneless_time/time_without_zone.rb
|
46
|
+
- lib/zoneless_time/version.rb
|
36
47
|
- lib/zoneless_time/warning.rb
|
37
|
-
-
|
38
|
-
|
48
|
+
- uninstall.rb
|
49
|
+
- zoneless_time.gemspec
|
50
|
+
homepage: https://github.com/smangelsdorf/zoneless_time
|
39
51
|
licenses: []
|
40
52
|
|
41
53
|
post_install_message:
|
@@ -64,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
76
|
requirements: []
|
65
77
|
|
66
78
|
rubyforge_project:
|
67
|
-
rubygems_version: 1.8.
|
79
|
+
rubygems_version: 1.8.24
|
68
80
|
signing_key:
|
69
81
|
specification_version: 3
|
70
82
|
summary: TimeWithoutZone support for ActiveRecord
|