timeframe 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -19,3 +19,4 @@ rdoc
19
19
  pkg
20
20
 
21
21
  ## PROJECT::SPECIFIC
22
+ Gemfile.lock
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in timeframe.gemspec
4
+ gemspec
data/Rakefile CHANGED
@@ -1,23 +1,11 @@
1
- require 'rubygems'
2
- require 'rake'
3
-
4
- begin
5
- require 'jeweler'
6
- Jeweler::Tasks.new do |gem|
7
- gem.name = "timeframe"
8
- gem.summary = %Q{Date intervals}
9
- gem.description = %Q{A Ruby class for describing and interacting with timeframes.}
10
- gem.email = "andy@rossmeissl.net"
11
- gem.homepage = "http://github.com/rossmeissl/timeframe"
12
- gem.authors = ["Andy Rossmeissl", "Seamus Abshere", "Derek Kastner"]
13
- gem.add_development_dependency "rspec", ">= 1.2.9"
14
- gem.add_dependency 'activesupport', '>=2.3.5'
15
- end
16
- Jeweler::GemcutterTasks.new
17
- rescue LoadError
18
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
1
+ # must be included before rubygems or bundler
2
+ if ENV['TIMEFRAME_HOME_RUN'] == 'true'
3
+ require 'home_run'
19
4
  end
20
5
 
6
+ require 'bundler'
7
+ Bundler::GemHelper.install_tasks
8
+
21
9
  require 'spec/rake/spectask'
22
10
  Spec::Rake::SpecTask.new(:spec) do |spec|
23
11
  spec.libs << 'lib' << 'spec'
@@ -30,8 +18,6 @@ Spec::Rake::SpecTask.new(:rcov) do |spec|
30
18
  spec.rcov = true
31
19
  end
32
20
 
33
- task :spec => :check_dependencies
34
-
35
21
  task :default => :spec
36
22
 
37
23
  require 'rake/rdoctask'
@@ -0,0 +1,3 @@
1
+ class Timeframe
2
+ VERSION = '0.0.9'
3
+ end
data/lib/timeframe.rb CHANGED
@@ -1,4 +1,4 @@
1
- require 'rubygems'
1
+ require 'date'
2
2
  require 'active_support/version'
3
3
  %w{
4
4
  active_support/core_ext/array/extract_options
@@ -9,7 +9,6 @@ require 'active_support/version'
9
9
  }.each do |active_support_3_requirement|
10
10
  require active_support_3_requirement
11
11
  end if ActiveSupport::VERSION::MAJOR == 3
12
- require 'timeframe/ykk'
13
12
 
14
13
  # Encapsulates a timeframe between two dates. The dates provided to the class are always until the last date. That means
15
14
  # that the last date is excluded.
@@ -229,7 +228,10 @@ class Timeframe
229
228
 
230
229
  timeframes.sort! { |x, y| x.from <=> y.from }
231
230
 
232
- timeframes.collect(&:to).unshift(from).extend(Ykk).ykk(timeframes.collect(&:from).push(to)) do |gap|
231
+ a = [ from ] + timeframes.collect(&:to)
232
+ b = timeframes.collect(&:from) + [ to ]
233
+
234
+ a.zip(b).map do |gap|
233
235
  Timeframe.new(*gap) if gap[1] > gap[0]
234
236
  end.compact
235
237
  end
data/spec/spec_helper.rb CHANGED
@@ -1,9 +1,11 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ Bundler.setup
4
+ require 'spec'
5
+ require 'spec/autorun'
1
6
  $LOAD_PATH.unshift(File.dirname(__FILE__))
2
7
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
8
  require 'timeframe'
4
- require 'spec'
5
- require 'spec/autorun'
6
- require 'date'
7
9
 
8
10
  Spec::Runner.configure do |config|
9
11
 
@@ -1,5 +1,4 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
- require 'date'
3
2
 
4
3
  describe Timeframe do
5
4
  describe 'initialization' do
data/timeframe.gemspec CHANGED
@@ -1,59 +1,26 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
1
  # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "timeframe/version"
5
4
 
6
5
  Gem::Specification.new do |s|
7
- s.name = %q{timeframe}
8
- s.version = "0.0.8"
6
+ s.name = "timeframe"
7
+ s.version = Timeframe::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Andy Rossmeissl", "Seamus Abshere", "Derek Kastner"]
10
+ s.email = ["andy@rossmeissl.net"]
11
+ s.homepage = "http://github.com/rossmeissl/timeframe"
12
+ s.summary = %Q{Date intervals}
13
+ s.description = %Q{A Ruby class for describing and interacting with timeframes.}
9
14
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Andy Rossmeissl", "Seamus Abshere", "Derek Kastner"]
12
- s.date = %q{2010-07-21}
13
- s.description = %q{A Ruby class for describing and interacting with timeframes.}
14
- s.email = %q{andy@rossmeissl.net}
15
- s.extra_rdoc_files = [
16
- "LICENSE",
17
- "README.rdoc"
18
- ]
19
- s.files = [
20
- ".document",
21
- ".gitignore",
22
- "LICENSE",
23
- "README.rdoc",
24
- "Rakefile",
25
- "VERSION",
26
- "lib/timeframe.rb",
27
- "lib/timeframe/ykk.rb",
28
- "spec/spec.opts",
29
- "spec/spec_helper.rb",
30
- "spec/timeframe_spec.rb",
31
- "timeframe.gemspec"
32
- ]
33
- s.homepage = %q{http://github.com/rossmeissl/timeframe}
34
- s.rdoc_options = ["--charset=UTF-8"]
35
- s.require_paths = ["lib"]
36
- s.rubygems_version = %q{1.3.7}
37
- s.summary = %q{Date intervals}
38
- s.test_files = [
39
- "spec/spec_helper.rb",
40
- "spec/timeframe_spec.rb"
41
- ]
42
-
43
- if s.respond_to? :specification_version then
44
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
45
- s.specification_version = 3
15
+ s.rubyforge_project = "timeframe"
46
16
 
47
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
48
- s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
49
- s.add_runtime_dependency(%q<activesupport>, [">= 2.3.5"])
50
- else
51
- s.add_dependency(%q<rspec>, [">= 1.2.9"])
52
- s.add_dependency(%q<activesupport>, [">= 2.3.5"])
53
- end
54
- else
55
- s.add_dependency(%q<rspec>, [">= 1.2.9"])
56
- s.add_dependency(%q<activesupport>, [">= 2.3.5"])
57
- end
17
+ s.files = `git ls-files`.split("\n")
18
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
+ s.require_paths = ["lib"]
21
+
22
+ s.add_development_dependency "rspec", "~> 1"
23
+ s.add_development_dependency 'home_run'
24
+ s.add_dependency 'activesupport', '>=2.3.5'
25
+ s.add_dependency 'i18n'
58
26
  end
59
-
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: timeframe
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
5
- prerelease: false
4
+ hash: 13
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 8
10
- version: 0.0.8
9
+ - 9
10
+ version: 0.0.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andy Rossmeissl
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2010-07-21 00:00:00 -05:00
20
+ date: 2011-04-13 00:00:00 -05:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
@@ -26,20 +26,32 @@ dependencies:
26
26
  requirement: &id001 !ruby/object:Gem::Requirement
27
27
  none: false
28
28
  requirements:
29
- - - ">="
29
+ - - ~>
30
30
  - !ruby/object:Gem::Version
31
- hash: 13
31
+ hash: 1
32
32
  segments:
33
33
  - 1
34
- - 2
35
- - 9
36
- version: 1.2.9
34
+ version: "1"
37
35
  type: :development
38
36
  version_requirements: *id001
39
37
  - !ruby/object:Gem::Dependency
40
- name: activesupport
38
+ name: home_run
41
39
  prerelease: false
42
40
  requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ hash: 3
46
+ segments:
47
+ - 0
48
+ version: "0"
49
+ type: :development
50
+ version_requirements: *id002
51
+ - !ruby/object:Gem::Dependency
52
+ name: activesupport
53
+ prerelease: false
54
+ requirement: &id003 !ruby/object:Gem::Requirement
43
55
  none: false
44
56
  requirements:
45
57
  - - ">="
@@ -51,25 +63,39 @@ dependencies:
51
63
  - 5
52
64
  version: 2.3.5
53
65
  type: :runtime
54
- version_requirements: *id002
66
+ version_requirements: *id003
67
+ - !ruby/object:Gem::Dependency
68
+ name: i18n
69
+ prerelease: false
70
+ requirement: &id004 !ruby/object:Gem::Requirement
71
+ none: false
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ hash: 3
76
+ segments:
77
+ - 0
78
+ version: "0"
79
+ type: :runtime
80
+ version_requirements: *id004
55
81
  description: A Ruby class for describing and interacting with timeframes.
56
- email: andy@rossmeissl.net
82
+ email:
83
+ - andy@rossmeissl.net
57
84
  executables: []
58
85
 
59
86
  extensions: []
60
87
 
61
- extra_rdoc_files:
62
- - LICENSE
63
- - README.rdoc
88
+ extra_rdoc_files: []
89
+
64
90
  files:
65
91
  - .document
66
92
  - .gitignore
93
+ - Gemfile
67
94
  - LICENSE
68
95
  - README.rdoc
69
96
  - Rakefile
70
- - VERSION
71
97
  - lib/timeframe.rb
72
- - lib/timeframe/ykk.rb
98
+ - lib/timeframe/version.rb
73
99
  - spec/spec.opts
74
100
  - spec/spec_helper.rb
75
101
  - spec/timeframe_spec.rb
@@ -79,8 +105,8 @@ homepage: http://github.com/rossmeissl/timeframe
79
105
  licenses: []
80
106
 
81
107
  post_install_message:
82
- rdoc_options:
83
- - --charset=UTF-8
108
+ rdoc_options: []
109
+
84
110
  require_paths:
85
111
  - lib
86
112
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -103,11 +129,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
129
  version: "0"
104
130
  requirements: []
105
131
 
106
- rubyforge_project:
107
- rubygems_version: 1.3.7
132
+ rubyforge_project: timeframe
133
+ rubygems_version: 1.6.2
108
134
  signing_key:
109
135
  specification_version: 3
110
136
  summary: Date intervals
111
137
  test_files:
138
+ - spec/spec.opts
112
139
  - spec/spec_helper.rb
113
140
  - spec/timeframe_spec.rb
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.0.8
data/lib/timeframe/ykk.rb DELETED
@@ -1,6 +0,0 @@
1
- module Ykk # :nodoc: all
2
- def ykk(*arys, &blk) # YKK: a better zipper
3
- return zip(*arys) unless block_given?
4
- zip(*arys).collect { |a| yield a }
5
- end
6
- end