timespan 0.5.7 → 0.5.9
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +49 -0
- data/CHANGELOG.md +10 -1
- data/Gemfile +3 -27
- data/Gemfile.lock +19 -31
- data/README.md +10 -0
- data/Rakefile +1 -49
- data/lib/timespan.rb +6 -8
- data/lib/timespan/compare.rb +0 -2
- data/lib/timespan/extensions/time_lord.rb +81 -0
- data/lib/timespan/span.rb +0 -2
- data/lib/timespan/version.rb +3 -0
- data/spec/timespan/system_spec.rb +14 -0
- data/timespan.gemspec +32 -124
- metadata +62 -64
- data/VERSION +0 -1
data/.gitignore
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# rcov generated
|
2
|
+
coverage
|
3
|
+
coverage.data
|
4
|
+
|
5
|
+
# rdoc generated
|
6
|
+
rdoc
|
7
|
+
|
8
|
+
# yard generated
|
9
|
+
doc
|
10
|
+
.yardoc
|
11
|
+
|
12
|
+
# bundler
|
13
|
+
.bundle
|
14
|
+
|
15
|
+
# jeweler generated
|
16
|
+
pkg
|
17
|
+
|
18
|
+
# Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
|
19
|
+
#
|
20
|
+
# * Create a file at ~/.gitignore
|
21
|
+
# * Include files you want ignored
|
22
|
+
# * Run: git config --global core.excludesfile ~/.gitignore
|
23
|
+
#
|
24
|
+
# After doing this, these files will be ignored in all your git projects,
|
25
|
+
# saving you from having to 'pollute' every project you touch with them
|
26
|
+
#
|
27
|
+
# Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
|
28
|
+
#
|
29
|
+
# For MacOS:
|
30
|
+
#
|
31
|
+
.DS_Store
|
32
|
+
|
33
|
+
# For TextMate
|
34
|
+
*.tmproj
|
35
|
+
tmtags
|
36
|
+
|
37
|
+
# For emacs:
|
38
|
+
#*~
|
39
|
+
\#*
|
40
|
+
.\#*
|
41
|
+
|
42
|
+
# For vim:
|
43
|
+
*.swp
|
44
|
+
|
45
|
+
# For redcar:
|
46
|
+
.redcar
|
47
|
+
|
48
|
+
# For rubinius:
|
49
|
+
#*.rbc
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,13 @@
|
|
1
|
-
## 0.5.
|
1
|
+
## 0.5.9
|
2
|
+
|
3
|
+
* Switched from Jeweler to Bundler
|
4
|
+
|
5
|
+
## 0.5.8
|
6
|
+
|
7
|
+
* Extracted experimental time-lord integration into separate file
|
8
|
+
since time-lord seems to fuck-up date calculations provided by Rails :P
|
9
|
+
|
10
|
+
## 0.5.6 - 0.5.7
|
2
11
|
|
3
12
|
* Initial support for `time-lord` gem.
|
4
13
|
* Use `xduration` 3.0.0 gem
|
data/Gemfile
CHANGED
@@ -1,28 +1,4 @@
|
|
1
|
-
source '
|
1
|
+
source 'http://rubygems.org'
|
2
2
|
|
3
|
-
gem
|
4
|
-
|
5
|
-
gem 'activesupport', '>= 3.0.0'
|
6
|
-
gem 'spanner'
|
7
|
-
gem 'sugar-high', '>= 0.7.3' # for range intersect
|
8
|
-
|
9
|
-
gem 'xduration', '>= 3.0.0' # ruby-duration with extensions
|
10
|
-
gem 'time-lord', '>= 1.0.0'
|
11
|
-
|
12
|
-
group :test, :development do
|
13
|
-
gem "rspec", ">= 2.12.0"
|
14
|
-
gem 'rails', '>= 3.1'
|
15
|
-
# gem 'mongoid', '>= 2.4'
|
16
|
-
# gem 'bson', '>= 1.6'
|
17
|
-
|
18
|
-
gem 'mongoid', '>= 3.0'
|
19
|
-
gem 'origin-selectable_ext', '~> 0.1.1'
|
20
|
-
# gem 'i18n'
|
21
|
-
end
|
22
|
-
|
23
|
-
group :development do
|
24
|
-
# gem "rdoc", ">= 3.12"
|
25
|
-
gem "bundler", ">= 1.2.0"
|
26
|
-
gem "jeweler", ">= 1.8.4", github: 'technicalpickles/jeweler'
|
27
|
-
gem "simplecov",">= 0.7"
|
28
|
-
end
|
3
|
+
# gem's dependencies are specified in timepan.gemspec
|
4
|
+
gemspec
|
data/Gemfile.lock
CHANGED
@@ -1,15 +1,16 @@
|
|
1
|
-
|
2
|
-
remote:
|
3
|
-
revision: a6a204f974a109ef2a2ca8fe477558dabab1ead6
|
1
|
+
PATH
|
2
|
+
remote: .
|
4
3
|
specs:
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
4
|
+
timespan (0.5.9)
|
5
|
+
activesupport (>= 3.0)
|
6
|
+
chronic
|
7
|
+
chronic_duration
|
8
|
+
spanner
|
9
|
+
sugar-high (>= 0.7.3)
|
10
|
+
xduration (>= 3.0.0)
|
10
11
|
|
11
12
|
GEM
|
12
|
-
remote:
|
13
|
+
remote: http://rubygems.org/
|
13
14
|
specs:
|
14
15
|
actionmailer (3.2.12)
|
15
16
|
actionpack (= 3.2.12)
|
@@ -45,7 +46,6 @@ GEM
|
|
45
46
|
numerizer (~> 0.1.1)
|
46
47
|
diff-lcs (1.2.1)
|
47
48
|
erubis (2.7.0)
|
48
|
-
git (1.2.5)
|
49
49
|
hike (1.2.1)
|
50
50
|
i18n (0.6.4)
|
51
51
|
journey (1.0.4)
|
@@ -60,8 +60,8 @@ GEM
|
|
60
60
|
moped (~> 1.4.2)
|
61
61
|
origin (~> 1.0)
|
62
62
|
tzinfo (~> 0.3.22)
|
63
|
-
moped (1.4.
|
64
|
-
multi_json (1.
|
63
|
+
moped (1.4.5)
|
64
|
+
multi_json (1.7.2)
|
65
65
|
numerizer (0.1.1)
|
66
66
|
origin (1.0.11)
|
67
67
|
origin-selectable_ext (0.1.1)
|
@@ -89,7 +89,7 @@ GEM
|
|
89
89
|
rake (>= 0.8.7)
|
90
90
|
rdoc (~> 3.4)
|
91
91
|
thor (>= 0.14.6, < 2.0)
|
92
|
-
rake (10.0.
|
92
|
+
rake (10.0.4)
|
93
93
|
rdoc (3.12.2)
|
94
94
|
json (~> 1.4)
|
95
95
|
rspec (2.13.0)
|
@@ -100,20 +100,15 @@ GEM
|
|
100
100
|
rspec-expectations (2.13.0)
|
101
101
|
diff-lcs (>= 1.1.3, < 2.0)
|
102
102
|
rspec-mocks (2.13.0)
|
103
|
-
|
104
|
-
multi_json (~> 1.0)
|
105
|
-
simplecov-html (~> 0.7.1)
|
106
|
-
simplecov-html (0.7.1)
|
107
|
-
spanner (0.0.1)
|
103
|
+
spanner (0.0.2)
|
108
104
|
sprockets (2.2.2)
|
109
105
|
hike (~> 1.2)
|
110
106
|
multi_json (~> 1.0)
|
111
107
|
rack (~> 1.0)
|
112
108
|
tilt (~> 1.1, != 1.3.0)
|
113
109
|
sugar-high (0.7.3)
|
114
|
-
thor (0.
|
115
|
-
tilt (1.3.
|
116
|
-
time-lord (1.0.1)
|
110
|
+
thor (0.18.0)
|
111
|
+
tilt (1.3.6)
|
117
112
|
treetop (1.4.12)
|
118
113
|
polyglot
|
119
114
|
polyglot (>= 0.3.1)
|
@@ -126,17 +121,10 @@ PLATFORMS
|
|
126
121
|
ruby
|
127
122
|
|
128
123
|
DEPENDENCIES
|
129
|
-
|
130
|
-
bundler (>= 1.2.0)
|
131
|
-
chronic
|
132
|
-
chronic_duration
|
133
|
-
jeweler (>= 1.8.4)!
|
124
|
+
bundler (~> 1.3)
|
134
125
|
mongoid (>= 3.0)
|
135
126
|
origin-selectable_ext (~> 0.1.1)
|
136
127
|
rails (>= 3.1)
|
128
|
+
rake
|
137
129
|
rspec (>= 2.12.0)
|
138
|
-
|
139
|
-
spanner
|
140
|
-
sugar-high (>= 0.7.3)
|
141
|
-
time-lord (>= 1.0.0)
|
142
|
-
xduration (>= 3.0.0)
|
130
|
+
timespan!
|
data/README.md
CHANGED
@@ -262,6 +262,16 @@ This gem can be used in combination with [Time lord](https://github.com/krainbol
|
|
262
262
|
Some initial support for `time-lord` has been added, but not yet tested.
|
263
263
|
Please help out ;)
|
264
264
|
|
265
|
+
Since integration with *time-lord* is not yet complete and tested, to use the experimental features, use:
|
266
|
+
|
267
|
+
`require 'timespan/extensions/time_lord'`
|
268
|
+
|
269
|
+
There are known issues with time_lord so that:
|
270
|
+
|
271
|
+
`4.days.from_now` returns a date far into the future!
|
272
|
+
|
273
|
+
I hope this gets fixed soon!
|
274
|
+
|
265
275
|
## Chronic duration
|
266
276
|
|
267
277
|
Is used to parse duration strings if Spanner can't be handle it
|
data/Rakefile
CHANGED
@@ -1,49 +1 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
require 'bundler'
|
5
|
-
begin
|
6
|
-
Bundler.setup(:default, :development)
|
7
|
-
rescue Bundler::BundlerError => e
|
8
|
-
$stderr.puts e.message
|
9
|
-
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
-
exit e.status_code
|
11
|
-
end
|
12
|
-
require 'rake'
|
13
|
-
|
14
|
-
require 'jeweler'
|
15
|
-
Jeweler::Tasks.new do |gem|
|
16
|
-
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
-
gem.name = "timespan"
|
18
|
-
gem.homepage = "http://github.com/kristianmandrup/timespan"
|
19
|
-
gem.license = "MIT"
|
20
|
-
gem.summary = %Q{Use timespans in ruby}
|
21
|
-
gem.description = %Q{Makes it easy to calculate time distance in different units}
|
22
|
-
gem.email = "kmandrup@gmail.com"
|
23
|
-
gem.authors = ["Kristian Mandrup"]
|
24
|
-
# dependencies defined in Gemfile
|
25
|
-
end
|
26
|
-
Jeweler::RubygemsDotOrgTasks.new
|
27
|
-
|
28
|
-
require 'rspec/core'
|
29
|
-
require 'rspec/core/rake_task'
|
30
|
-
RSpec::Core::RakeTask.new(:spec) do |spec|
|
31
|
-
spec.pattern = FileList['spec/**/*_spec.rb']
|
32
|
-
end
|
33
|
-
|
34
|
-
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
35
|
-
spec.pattern = 'spec/**/*_spec.rb'
|
36
|
-
spec.rcov = true
|
37
|
-
end
|
38
|
-
|
39
|
-
task :default => :spec
|
40
|
-
|
41
|
-
# require 'rdoc/task'
|
42
|
-
# Rake::RDocTask.new do |rdoc|
|
43
|
-
# version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
44
|
-
|
45
|
-
# rdoc.rdoc_dir = 'rdoc'
|
46
|
-
# rdoc.title = "timespan #{version}"
|
47
|
-
# rdoc.rdoc_files.include('README*')
|
48
|
-
# rdoc.rdoc_files.include('lib/**/*.rb')
|
49
|
-
# end
|
1
|
+
require "bundler/gem_tasks"
|
data/lib/timespan.rb
CHANGED
@@ -2,7 +2,6 @@ require 'duration'
|
|
2
2
|
require 'chronic'
|
3
3
|
require 'chronic_duration'
|
4
4
|
require 'spanner'
|
5
|
-
require 'time-lord'
|
6
5
|
|
7
6
|
# Range intersection that works with dates!
|
8
7
|
require 'sugar-high/range'
|
@@ -57,8 +56,7 @@ class Timespan
|
|
57
56
|
|
58
57
|
options = {:duration => options} if options.kind_of? Numeric
|
59
58
|
|
60
|
-
|
61
|
-
when TimeLord::Period, ::Duration, String
|
59
|
+
if duration_classes.any?{|clazz| options.kind_of? clazz }
|
62
60
|
options = {:duration => options}
|
63
61
|
end
|
64
62
|
|
@@ -67,6 +65,10 @@ class Timespan
|
|
67
65
|
@is_new = false
|
68
66
|
end
|
69
67
|
|
68
|
+
def duration_classes
|
69
|
+
[::Duration, ::String]
|
70
|
+
end
|
71
|
+
|
70
72
|
def asap!
|
71
73
|
@asap = true
|
72
74
|
end
|
@@ -195,10 +197,6 @@ class Timespan
|
|
195
197
|
time.to_time
|
196
198
|
when Duration
|
197
199
|
(Time.now + time).to_time
|
198
|
-
when TimeLord::Period
|
199
|
-
(Time.now + time).to_time
|
200
|
-
when TimeLord::Time
|
201
|
-
(Time.now + time.moment).to_time
|
202
200
|
when Time
|
203
201
|
time
|
204
202
|
else
|
@@ -209,7 +207,7 @@ class Timespan
|
|
209
207
|
protected
|
210
208
|
|
211
209
|
def valid_time_classes
|
212
|
-
[String, Duration, Date, Time, DateTime
|
210
|
+
[String, Duration, Date, Time, DateTime]
|
213
211
|
end
|
214
212
|
|
215
213
|
attr_reader :init_options
|
data/lib/timespan/compare.rb
CHANGED
@@ -0,0 +1,81 @@
|
|
1
|
+
require 'time-lord'
|
2
|
+
|
3
|
+
class Timespan
|
4
|
+
def duration_classes
|
5
|
+
[::TimeLord::Period, ::Duration, ::String]
|
6
|
+
end
|
7
|
+
|
8
|
+
def valid_time_classes
|
9
|
+
[String, Duration, Date, Time, DateTime, TimeLord::Period, TimeLord::Time]
|
10
|
+
end
|
11
|
+
|
12
|
+
def convert_to_time time
|
13
|
+
time = Duration.new time if time.kind_of? Numeric
|
14
|
+
case time
|
15
|
+
when String
|
16
|
+
Chronic.parse(time)
|
17
|
+
when Date, DateTime
|
18
|
+
time.to_time
|
19
|
+
when Duration
|
20
|
+
(Time.now + time).to_time
|
21
|
+
when TimeLord::Period
|
22
|
+
(Time.now + time).to_time
|
23
|
+
when TimeLord::Time
|
24
|
+
(Time.now + time.moment).to_time
|
25
|
+
when Time
|
26
|
+
time
|
27
|
+
else
|
28
|
+
raise ArgumentError, "A valid time must be one of #{valid_time_classes.inspect}, was: #{time.inspect} (#{time.class})"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
module Compare
|
33
|
+
def <=> time
|
34
|
+
raise ArgumentError, "Not a valid argument for Timespan comparison, was #{time}" unless valid_compare?(time)
|
35
|
+
case time
|
36
|
+
when Timespan
|
37
|
+
seconds <=> time.seconds
|
38
|
+
when Time
|
39
|
+
seconds <=> time.to_i
|
40
|
+
when Date, DateTime
|
41
|
+
time.to_time.to_i
|
42
|
+
when Integer
|
43
|
+
seconds <=> time
|
44
|
+
when Timelord::Time
|
45
|
+
seconds <=> time.moment
|
46
|
+
when ActiveSupport::Duration
|
47
|
+
seconds <=> time.to_i
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
module Span
|
53
|
+
attr_reader :duration
|
54
|
+
|
55
|
+
def duration= duration
|
56
|
+
@duration = if duration.kind_of? Numeric
|
57
|
+
Duration.new duration
|
58
|
+
else
|
59
|
+
case duration
|
60
|
+
when Timespan
|
61
|
+
duration.duration
|
62
|
+
when Duration
|
63
|
+
duration
|
64
|
+
when TimeLord::Period
|
65
|
+
Duration.new start_date: duration.beginning, end_date: duration.ending
|
66
|
+
when Hash
|
67
|
+
Duration.new duration
|
68
|
+
when String
|
69
|
+
Duration.new parse_duration(duration)
|
70
|
+
else
|
71
|
+
raise ArgumentError, "Unsupported duration type: #{duration.inspect} of class #{duration.class}"
|
72
|
+
end
|
73
|
+
end
|
74
|
+
unless is_new?
|
75
|
+
add_dirty :duration
|
76
|
+
refresh!
|
77
|
+
calculate!
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
data/lib/timespan/span.rb
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
# To test and make sure that none of the included gems or any core extensions of this gem fuck up the
|
4
|
+
# normal date calculation/comparison etc functionality of Ruby and Rails ;)
|
5
|
+
|
6
|
+
describe 'Ensure system Time calculations still operate as the should!' do
|
7
|
+
it 'should add Time + Time normally' do
|
8
|
+
expect(1.days + 3.days).to eq 4.days
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'should add Date + Time normally' do
|
12
|
+
expect(Date.today + 3.days).to eq 3.days.from_now.to_date
|
13
|
+
end
|
14
|
+
end
|
data/timespan.gemspec
CHANGED
@@ -1,129 +1,37 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'timespan/version'
|
5
5
|
|
6
|
-
Gem::Specification.new do |
|
7
|
-
|
8
|
-
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "timespan"
|
8
|
+
spec.version = Timespan::VERSION
|
9
|
+
spec.authors = ["Kristian Mandrup"]
|
10
|
+
spec.date = "2013-03-13"
|
11
|
+
spec.summary = "Calculate and store time distance (Mongoid only)"
|
12
|
+
spec.description = "Makes it easy to store time duration, make calculations and comparions and store the duration using Mongoid"
|
13
|
+
spec.email = "kmandrup@gmail.com"
|
14
|
+
spec.license = "MIT"
|
9
15
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
s.email = "kmandrup@gmail.com"
|
15
|
-
s.extra_rdoc_files = [
|
16
|
-
"LICENSE.txt",
|
17
|
-
"README.md"
|
18
|
-
]
|
19
|
-
s.files = [
|
20
|
-
".document",
|
21
|
-
".rspec",
|
22
|
-
"CHANGELOG.md",
|
23
|
-
"Gemfile",
|
24
|
-
"Gemfile.lock",
|
25
|
-
"LICENSE.txt",
|
26
|
-
"README.md",
|
27
|
-
"Rakefile",
|
28
|
-
"VERSION",
|
29
|
-
"config/locales/timespan/da.yml",
|
30
|
-
"lib/timespan.rb",
|
31
|
-
"lib/timespan/compare.rb",
|
32
|
-
"lib/timespan/core_ext.rb",
|
33
|
-
"lib/timespan/core_ext/hash.rb",
|
34
|
-
"lib/timespan/core_ext/range.rb",
|
35
|
-
"lib/timespan/mongoid.rb",
|
36
|
-
"lib/timespan/mongoid/mongoid_2x.rb",
|
37
|
-
"lib/timespan/mongoid/mongoid_3x.rb",
|
38
|
-
"lib/timespan/mongoid/timespanned.rb",
|
39
|
-
"lib/timespan/printer.rb",
|
40
|
-
"lib/timespan/rails/engine.rb",
|
41
|
-
"lib/timespan/span.rb",
|
42
|
-
"lib/timespan/units.rb",
|
43
|
-
"spec/spec_helper.rb",
|
44
|
-
"spec/timespan/asap_spec.rb",
|
45
|
-
"spec/timespan/compare_spec.rb",
|
46
|
-
"spec/timespan/core_ext/duration_range_spec.rb",
|
47
|
-
"spec/timespan/core_ext/timespan_range_spec.rb",
|
48
|
-
"spec/timespan/duration_macros_spec.rb",
|
49
|
-
"spec/timespan/locales/duration_da.yml",
|
50
|
-
"spec/timespan/mongoid/advanced_search_spec.rb",
|
51
|
-
"spec/timespan/mongoid/models/account_2x.rb",
|
52
|
-
"spec/timespan/mongoid/models/account_3x.rb",
|
53
|
-
"spec/timespan/mongoid/models/time_period.rb",
|
54
|
-
"spec/timespan/mongoid/mongoid_asap_spec.rb",
|
55
|
-
"spec/timespan/mongoid/mongoid_duration_range_spec.rb",
|
56
|
-
"spec/timespan/mongoid/mongoid_search_spec.rb",
|
57
|
-
"spec/timespan/mongoid/mongoid_setup.rb",
|
58
|
-
"spec/timespan/mongoid/mongoid_timespan_spec.rb",
|
59
|
-
"spec/timespan/mongoid/spec_helper.rb",
|
60
|
-
"spec/timespan/mongoid/support/mongod.conf",
|
61
|
-
"spec/timespan/mongoid/support/mongoid.yml",
|
62
|
-
"spec/timespan/printer_spec.rb",
|
63
|
-
"spec/timespan/span_spec.rb",
|
64
|
-
"spec/timespan/units_spec.rb",
|
65
|
-
"spec/timespan_init_spec.rb",
|
66
|
-
"spec/timespan_spec.rb",
|
67
|
-
"timespan.gemspec",
|
68
|
-
"vendor/assets/javascripts/date_ext.js",
|
69
|
-
"vendor/assets/javascripts/moment.js",
|
70
|
-
"vendor/assets/javascripts/timespan.js"
|
71
|
-
]
|
72
|
-
s.homepage = "http://github.com/kristianmandrup/timespan"
|
73
|
-
s.licenses = ["MIT"]
|
74
|
-
s.require_paths = ["lib"]
|
75
|
-
s.rubygems_version = "1.8.25"
|
76
|
-
s.summary = "Use timespans in ruby"
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
77
20
|
|
78
|
-
|
79
|
-
|
21
|
+
spec.add_dependency 'chronic'
|
22
|
+
spec.add_dependency 'chronic_duration'
|
23
|
+
spec.add_dependency 'activesupport', '>= 3.0'
|
24
|
+
spec.add_dependency 'spanner'
|
25
|
+
spec.add_dependency 'sugar-high', '>= 0.7.3'
|
26
|
+
spec.add_dependency 'xduration', '>= 3.0.0'
|
80
27
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
s.add_runtime_dependency(%q<spanner>, [">= 0"])
|
86
|
-
s.add_runtime_dependency(%q<sugar-high>, [">= 0.7.3"])
|
87
|
-
s.add_runtime_dependency(%q<xduration>, [">= 3.0.0"])
|
88
|
-
s.add_runtime_dependency(%q<time-lord>, [">= 1.0.0"])
|
89
|
-
s.add_development_dependency(%q<rspec>, [">= 2.12.0"])
|
90
|
-
s.add_development_dependency(%q<rails>, [">= 3.1"])
|
91
|
-
s.add_development_dependency(%q<mongoid>, [">= 3.0"])
|
92
|
-
s.add_development_dependency(%q<origin-selectable_ext>, ["~> 0.1.1"])
|
93
|
-
s.add_development_dependency(%q<bundler>, [">= 1.2.0"])
|
94
|
-
s.add_development_dependency(%q<jeweler>, [">= 1.8.4"])
|
95
|
-
s.add_development_dependency(%q<simplecov>, [">= 0.7"])
|
96
|
-
else
|
97
|
-
s.add_dependency(%q<chronic>, [">= 0"])
|
98
|
-
s.add_dependency(%q<chronic_duration>, [">= 0"])
|
99
|
-
s.add_dependency(%q<activesupport>, [">= 3.0.0"])
|
100
|
-
s.add_dependency(%q<spanner>, [">= 0"])
|
101
|
-
s.add_dependency(%q<sugar-high>, [">= 0.7.3"])
|
102
|
-
s.add_dependency(%q<xduration>, [">= 3.0.0"])
|
103
|
-
s.add_dependency(%q<time-lord>, [">= 1.0.0"])
|
104
|
-
s.add_dependency(%q<rspec>, [">= 2.12.0"])
|
105
|
-
s.add_dependency(%q<rails>, [">= 3.1"])
|
106
|
-
s.add_dependency(%q<mongoid>, [">= 3.0"])
|
107
|
-
s.add_dependency(%q<origin-selectable_ext>, ["~> 0.1.1"])
|
108
|
-
s.add_dependency(%q<bundler>, [">= 1.2.0"])
|
109
|
-
s.add_dependency(%q<jeweler>, [">= 1.8.4"])
|
110
|
-
s.add_dependency(%q<simplecov>, [">= 0.7"])
|
111
|
-
end
|
112
|
-
else
|
113
|
-
s.add_dependency(%q<chronic>, [">= 0"])
|
114
|
-
s.add_dependency(%q<chronic_duration>, [">= 0"])
|
115
|
-
s.add_dependency(%q<activesupport>, [">= 3.0.0"])
|
116
|
-
s.add_dependency(%q<spanner>, [">= 0"])
|
117
|
-
s.add_dependency(%q<sugar-high>, [">= 0.7.3"])
|
118
|
-
s.add_dependency(%q<xduration>, [">= 3.0.0"])
|
119
|
-
s.add_dependency(%q<time-lord>, [">= 1.0.0"])
|
120
|
-
s.add_dependency(%q<rspec>, [">= 2.12.0"])
|
121
|
-
s.add_dependency(%q<rails>, [">= 3.1"])
|
122
|
-
s.add_dependency(%q<mongoid>, [">= 3.0"])
|
123
|
-
s.add_dependency(%q<origin-selectable_ext>, ["~> 0.1.1"])
|
124
|
-
s.add_dependency(%q<bundler>, [">= 1.2.0"])
|
125
|
-
s.add_dependency(%q<jeweler>, [">= 1.8.4"])
|
126
|
-
s.add_dependency(%q<simplecov>, [">= 0.7"])
|
127
|
-
end
|
128
|
-
end
|
28
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
29
|
+
spec.add_development_dependency "rake"
|
30
|
+
|
31
|
+
spec.add_development_dependency "rspec", ">= 2.12.0"
|
129
32
|
|
33
|
+
spec.add_development_dependency 'rails', '>= 3.1'
|
34
|
+
|
35
|
+
spec.add_development_dependency 'mongoid', '>= 3.0'
|
36
|
+
spec.add_development_dependency 'origin-selectable_ext', '~> 0.1.1'
|
37
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: timespan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - ! '>='
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 3.0
|
53
|
+
version: '3.0'
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -58,7 +58,7 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 3.0
|
61
|
+
version: '3.0'
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: spanner
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,21 +108,37 @@ dependencies:
|
|
108
108
|
- !ruby/object:Gem::Version
|
109
109
|
version: 3.0.0
|
110
110
|
- !ruby/object:Gem::Dependency
|
111
|
-
name:
|
111
|
+
name: bundler
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ~>
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '1.3'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ~>
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '1.3'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: rake
|
112
128
|
requirement: !ruby/object:Gem::Requirement
|
113
129
|
none: false
|
114
130
|
requirements:
|
115
131
|
- - ! '>='
|
116
132
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
118
|
-
type: :
|
133
|
+
version: '0'
|
134
|
+
type: :development
|
119
135
|
prerelease: false
|
120
136
|
version_requirements: !ruby/object:Gem::Requirement
|
121
137
|
none: false
|
122
138
|
requirements:
|
123
139
|
- - ! '>='
|
124
140
|
- !ruby/object:Gem::Version
|
125
|
-
version:
|
141
|
+
version: '0'
|
126
142
|
- !ruby/object:Gem::Dependency
|
127
143
|
name: rspec
|
128
144
|
requirement: !ruby/object:Gem::Requirement
|
@@ -187,63 +203,15 @@ dependencies:
|
|
187
203
|
- - ~>
|
188
204
|
- !ruby/object:Gem::Version
|
189
205
|
version: 0.1.1
|
190
|
-
|
191
|
-
|
192
|
-
requirement: !ruby/object:Gem::Requirement
|
193
|
-
none: false
|
194
|
-
requirements:
|
195
|
-
- - ! '>='
|
196
|
-
- !ruby/object:Gem::Version
|
197
|
-
version: 1.2.0
|
198
|
-
type: :development
|
199
|
-
prerelease: false
|
200
|
-
version_requirements: !ruby/object:Gem::Requirement
|
201
|
-
none: false
|
202
|
-
requirements:
|
203
|
-
- - ! '>='
|
204
|
-
- !ruby/object:Gem::Version
|
205
|
-
version: 1.2.0
|
206
|
-
- !ruby/object:Gem::Dependency
|
207
|
-
name: jeweler
|
208
|
-
requirement: !ruby/object:Gem::Requirement
|
209
|
-
none: false
|
210
|
-
requirements:
|
211
|
-
- - ! '>='
|
212
|
-
- !ruby/object:Gem::Version
|
213
|
-
version: 1.8.4
|
214
|
-
type: :development
|
215
|
-
prerelease: false
|
216
|
-
version_requirements: !ruby/object:Gem::Requirement
|
217
|
-
none: false
|
218
|
-
requirements:
|
219
|
-
- - ! '>='
|
220
|
-
- !ruby/object:Gem::Version
|
221
|
-
version: 1.8.4
|
222
|
-
- !ruby/object:Gem::Dependency
|
223
|
-
name: simplecov
|
224
|
-
requirement: !ruby/object:Gem::Requirement
|
225
|
-
none: false
|
226
|
-
requirements:
|
227
|
-
- - ! '>='
|
228
|
-
- !ruby/object:Gem::Version
|
229
|
-
version: '0.7'
|
230
|
-
type: :development
|
231
|
-
prerelease: false
|
232
|
-
version_requirements: !ruby/object:Gem::Requirement
|
233
|
-
none: false
|
234
|
-
requirements:
|
235
|
-
- - ! '>='
|
236
|
-
- !ruby/object:Gem::Version
|
237
|
-
version: '0.7'
|
238
|
-
description: Makes it easy to calculate time distance in different units
|
206
|
+
description: Makes it easy to store time duration, make calculations and comparions
|
207
|
+
and store the duration using Mongoid
|
239
208
|
email: kmandrup@gmail.com
|
240
209
|
executables: []
|
241
210
|
extensions: []
|
242
|
-
extra_rdoc_files:
|
243
|
-
- LICENSE.txt
|
244
|
-
- README.md
|
211
|
+
extra_rdoc_files: []
|
245
212
|
files:
|
246
213
|
- .document
|
214
|
+
- .gitignore
|
247
215
|
- .rspec
|
248
216
|
- CHANGELOG.md
|
249
217
|
- Gemfile
|
@@ -251,13 +219,13 @@ files:
|
|
251
219
|
- LICENSE.txt
|
252
220
|
- README.md
|
253
221
|
- Rakefile
|
254
|
-
- VERSION
|
255
222
|
- config/locales/timespan/da.yml
|
256
223
|
- lib/timespan.rb
|
257
224
|
- lib/timespan/compare.rb
|
258
225
|
- lib/timespan/core_ext.rb
|
259
226
|
- lib/timespan/core_ext/hash.rb
|
260
227
|
- lib/timespan/core_ext/range.rb
|
228
|
+
- lib/timespan/extensions/time_lord.rb
|
261
229
|
- lib/timespan/mongoid.rb
|
262
230
|
- lib/timespan/mongoid/mongoid_2x.rb
|
263
231
|
- lib/timespan/mongoid/mongoid_3x.rb
|
@@ -266,6 +234,7 @@ files:
|
|
266
234
|
- lib/timespan/rails/engine.rb
|
267
235
|
- lib/timespan/span.rb
|
268
236
|
- lib/timespan/units.rb
|
237
|
+
- lib/timespan/version.rb
|
269
238
|
- spec/spec_helper.rb
|
270
239
|
- spec/timespan/asap_spec.rb
|
271
240
|
- spec/timespan/compare_spec.rb
|
@@ -287,6 +256,7 @@ files:
|
|
287
256
|
- spec/timespan/mongoid/support/mongoid.yml
|
288
257
|
- spec/timespan/printer_spec.rb
|
289
258
|
- spec/timespan/span_spec.rb
|
259
|
+
- spec/timespan/system_spec.rb
|
290
260
|
- spec/timespan/units_spec.rb
|
291
261
|
- spec/timespan_init_spec.rb
|
292
262
|
- spec/timespan_spec.rb
|
@@ -294,7 +264,7 @@ files:
|
|
294
264
|
- vendor/assets/javascripts/date_ext.js
|
295
265
|
- vendor/assets/javascripts/moment.js
|
296
266
|
- vendor/assets/javascripts/timespan.js
|
297
|
-
homepage:
|
267
|
+
homepage:
|
298
268
|
licenses:
|
299
269
|
- MIT
|
300
270
|
post_install_message:
|
@@ -309,17 +279,45 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
309
279
|
version: '0'
|
310
280
|
segments:
|
311
281
|
- 0
|
312
|
-
hash: -
|
282
|
+
hash: -3269727965690523754
|
313
283
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
314
284
|
none: false
|
315
285
|
requirements:
|
316
286
|
- - ! '>='
|
317
287
|
- !ruby/object:Gem::Version
|
318
288
|
version: '0'
|
289
|
+
segments:
|
290
|
+
- 0
|
291
|
+
hash: -3269727965690523754
|
319
292
|
requirements: []
|
320
293
|
rubyforge_project:
|
321
294
|
rubygems_version: 1.8.25
|
322
295
|
signing_key:
|
323
296
|
specification_version: 3
|
324
|
-
summary:
|
325
|
-
test_files:
|
297
|
+
summary: Calculate and store time distance (Mongoid only)
|
298
|
+
test_files:
|
299
|
+
- spec/spec_helper.rb
|
300
|
+
- spec/timespan/asap_spec.rb
|
301
|
+
- spec/timespan/compare_spec.rb
|
302
|
+
- spec/timespan/core_ext/duration_range_spec.rb
|
303
|
+
- spec/timespan/core_ext/timespan_range_spec.rb
|
304
|
+
- spec/timespan/duration_macros_spec.rb
|
305
|
+
- spec/timespan/locales/duration_da.yml
|
306
|
+
- spec/timespan/mongoid/advanced_search_spec.rb
|
307
|
+
- spec/timespan/mongoid/models/account_2x.rb
|
308
|
+
- spec/timespan/mongoid/models/account_3x.rb
|
309
|
+
- spec/timespan/mongoid/models/time_period.rb
|
310
|
+
- spec/timespan/mongoid/mongoid_asap_spec.rb
|
311
|
+
- spec/timespan/mongoid/mongoid_duration_range_spec.rb
|
312
|
+
- spec/timespan/mongoid/mongoid_search_spec.rb
|
313
|
+
- spec/timespan/mongoid/mongoid_setup.rb
|
314
|
+
- spec/timespan/mongoid/mongoid_timespan_spec.rb
|
315
|
+
- spec/timespan/mongoid/spec_helper.rb
|
316
|
+
- spec/timespan/mongoid/support/mongod.conf
|
317
|
+
- spec/timespan/mongoid/support/mongoid.yml
|
318
|
+
- spec/timespan/printer_spec.rb
|
319
|
+
- spec/timespan/span_spec.rb
|
320
|
+
- spec/timespan/system_spec.rb
|
321
|
+
- spec/timespan/units_spec.rb
|
322
|
+
- spec/timespan_init_spec.rb
|
323
|
+
- spec/timespan_spec.rb
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.5.7
|