time_seq 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3275e862a2ebbfd1aa93fc156ad0a0303f3bf5bc
4
- data.tar.gz: b4bf4c2399cee4e32a76f6c208fc3393608dab1f
3
+ metadata.gz: e4a6d9b7c6aa42b4be3fc512c9666e69ada37c70
4
+ data.tar.gz: 0e107036ca4831c4d3fc65337bc5d0e464806c94
5
5
  SHA512:
6
- metadata.gz: f4883ac38558be8bfca59033e886664969b50baf89d4157ba35d15ce05c12c14968022e3aae958ae0f2a7da21b91c2bfe85fa3b1b20394a960de0316dbf094c5
7
- data.tar.gz: 49cbd864b9e561578398499c73fee568287c34b550ebed7533380ce7488f20eab98623d3b6a413adf546766782a78a2f322bb53c9675757e1d614c6dd1f5520f
6
+ metadata.gz: fdc76e2d6d9bb72a29c8b935749556c165884ebb7047807449a8510a53945ca3b96b9aeaeda97eb81aa2dae422e3dc193863a3df5169910130053a0729d8b05d
7
+ data.tar.gz: 01e779cc198833a4d67ac8b8f8fbbfc15a1b69d14663f9edfeb9926575d20c49ecad33366204d20b046163d3e0cfcc61e1b4b49c5dc686dd6112524ab5d776b0
data/.gitignore CHANGED
@@ -1,9 +1,6 @@
1
- /.bundle/
2
- /.yardoc
1
+ *.gem
2
+ *.swp
3
+ lib/**/*.swp
4
+ test/*.swp
5
+ test/**/*.swp
3
6
  /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
@@ -1,3 +1,3 @@
1
1
  class TimeSeq
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/time_seq.rb CHANGED
@@ -1,11 +1,17 @@
1
1
  require 'active_support/core_ext/integer/time'
2
- require 'forwardable'
3
2
 
4
- class TimeSeq
3
+ class TimeSeq < DelegateClass(Enumerator::Lazy)
5
4
 
6
- def initialize(opt = {})
7
- extract opt
8
- build_enum
5
+ class << self
6
+
7
+ alias_method :init, :new
8
+
9
+ def new(opt={})
10
+ init(nil).instance_eval do
11
+ extract opt
12
+ build_enum
13
+ end
14
+ end
9
15
  end
10
16
 
11
17
  Attrs = %w{from step to}.tap do |attrs|
@@ -15,13 +21,6 @@ class TimeSeq
15
21
  end
16
22
  end
17
23
 
18
- extend Forwardable
19
- def_delegators :@e, *(
20
- Enumerator.instance_methods(false) |
21
- Enumerator::Lazy.instance_methods(false) |
22
- Enumerable.instance_methods
23
- )
24
-
25
24
  def inspect
26
25
  "#<#{self.class}:#{object_id} #{inspect_attrs}>"
27
26
  end
@@ -43,6 +42,7 @@ class TimeSeq
43
42
  break if to and time_point > to
44
43
  end
45
44
  end.lazy
45
+ __setobj__ @e
46
46
  end
47
47
 
48
48
  def inspect_attrs
@@ -53,3 +53,5 @@ class TimeSeq
53
53
  end
54
54
 
55
55
  end
56
+
57
+ require 'time_seq/version'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: time_seq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ken
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-08 00:00:00.000000000 Z
11
+ date: 2016-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -102,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
102
  version: '0'
103
103
  requirements: []
104
104
  rubyforge_project:
105
- rubygems_version: 2.4.6
105
+ rubygems_version: 2.6.7
106
106
  signing_key:
107
107
  specification_version: 4
108
108
  summary: generate a (infinite) time sequence