file_series 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YThmYzk0YjNkNjM1ZjA1Nzk4OGQwZTMxNDc0YzhmNTBkMTllNjcxMQ==
5
+ data.tar.gz: !binary |-
6
+ Y2Q2OTllOTQ2NTEwNDE1YWM5NWMyNjJkNGFiZmQ0NGNjMGU2Njg3ZQ==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ ODgwNjIyMTEyYTAyYTY4NjMwNzllM2MzODQwMDU2NzIwMjA2NmU1MzFlZTNh
10
+ ODEyZDc3Mjk4NTc5MDc4NjM3MTcxMTFiYmJhNTlhYjY4N2NlNjZmNTViMDg1
11
+ NWFiMmRmM2Q2NDAzN2I5N2MyMWZhMTJlNTVlMjNiZjgzMDlmMDA=
12
+ data.tar.gz: !binary |-
13
+ YzM0ODUyOWNjZjM4OTFkNTRiODgyYzZmM2IwNzc4NGRmMjkwN2EyMDZkYzIw
14
+ ZGYwOWJjZWY4NmE5NWIwZjNhMzlkZmRkZThiYjZjMjUzMjNlYTk1MzE1NjE4
15
+ NWUzNmJiOTVkMmRjOTA0NzBlMDhjNTNmMzM0OGRjNDNlNjE2MTg=
data/Gemfile CHANGED
@@ -6,12 +6,9 @@ source "http://rubygems.org"
6
6
  # Add dependencies to develop your gem here.
7
7
  # Include everything needed to run rake, tests, features, etc.
8
8
  group :development do
9
- gem "autotest-standalone"
10
- gem "autotest-fsevent"
11
- gem "autotest-growl"
12
9
  gem "rspec", "~> 2.8.0"
13
10
  gem "rdoc", "~> 3.12"
14
- gem "bundler", "~> 1.0.0"
15
- gem "jeweler", "~> 1.8.4"
11
+ gem "bundler", "~> 1.6.0"
12
+ gem "jeweler"
16
13
  gem "timecop", "0.3.5"
17
14
  end
data/Gemfile.lock CHANGED
@@ -1,21 +1,50 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- autotest-fsevent (0.2.8)
5
- sys-uname
6
- autotest-growl (0.2.16)
7
- autotest-standalone (4.5.9)
4
+ addressable (2.3.6)
5
+ builder (3.2.2)
6
+ descendants_tracker (0.0.4)
7
+ thread_safe (~> 0.3, >= 0.3.1)
8
8
  diff-lcs (1.1.3)
9
- ffi (1.1.0)
10
- git (1.2.5)
11
- jeweler (1.8.4)
12
- bundler (~> 1.0)
9
+ faraday (0.9.0)
10
+ multipart-post (>= 1.2, < 3)
11
+ git (1.2.6)
12
+ github_api (0.11.3)
13
+ addressable (~> 2.3)
14
+ descendants_tracker (~> 0.0.1)
15
+ faraday (~> 0.8, < 0.10)
16
+ hashie (>= 1.2)
17
+ multi_json (>= 1.7.5, < 2.0)
18
+ nokogiri (~> 1.6.0)
19
+ oauth2
20
+ hashie (3.0.0)
21
+ highline (1.6.21)
22
+ jeweler (2.0.1)
23
+ builder
24
+ bundler (>= 1.0)
13
25
  git (>= 1.2.5)
26
+ github_api
27
+ highline (>= 1.6.15)
28
+ nokogiri (>= 1.5.10)
14
29
  rake
15
30
  rdoc
16
- json (1.7.3)
17
- rake (0.9.2.2)
18
- rdoc (3.12)
31
+ json (1.8.1)
32
+ jwt (1.0.0)
33
+ mini_portile (0.6.0)
34
+ multi_json (1.10.1)
35
+ multi_xml (0.5.5)
36
+ multipart-post (2.0.0)
37
+ nokogiri (1.6.2.1)
38
+ mini_portile (= 0.6.0)
39
+ oauth2 (0.9.4)
40
+ faraday (>= 0.8, < 0.10)
41
+ jwt (~> 1.0)
42
+ multi_json (~> 1.3)
43
+ multi_xml (~> 0.5)
44
+ rack (~> 1.2)
45
+ rack (1.5.2)
46
+ rake (10.3.2)
47
+ rdoc (3.12.2)
19
48
  json (~> 1.4)
20
49
  rspec (2.8.0)
21
50
  rspec-core (~> 2.8.0)
@@ -25,19 +54,15 @@ GEM
25
54
  rspec-expectations (2.8.0)
26
55
  diff-lcs (~> 1.1.2)
27
56
  rspec-mocks (2.8.0)
28
- sys-uname (0.9.0)
29
- ffi (>= 1.0.0)
57
+ thread_safe (0.3.4)
30
58
  timecop (0.3.5)
31
59
 
32
60
  PLATFORMS
33
61
  ruby
34
62
 
35
63
  DEPENDENCIES
36
- autotest-fsevent
37
- autotest-growl
38
- autotest-standalone
39
- bundler (~> 1.0.0)
40
- jeweler (~> 1.8.4)
64
+ bundler (~> 1.6.0)
65
+ jeweler
41
66
  rdoc (~> 3.12)
42
67
  rspec (~> 2.8.0)
43
68
  timecop (= 0.3.5)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.0
1
+ 0.5.0
data/file_series.gemspec CHANGED
@@ -2,14 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
+ # stub: file_series 0.5.0 ruby lib
5
6
 
6
7
  Gem::Specification.new do |s|
7
8
  s.name = "file_series"
8
- s.version = "0.4.0"
9
+ s.version = "0.5.0"
9
10
 
10
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
11
13
  s.authors = ["Alex Dean"]
12
- s.date = "2013-08-26"
14
+ s.date = "2014-06-05"
13
15
  s.description = "Automatically start writing to a new file every X seconds without any locking or file moving/renaming."
14
16
  s.email = "alex@crackpot.org"
15
17
  s.extra_rdoc_files = [
@@ -33,40 +35,30 @@ Gem::Specification.new do |s|
33
35
  ]
34
36
  s.homepage = "http://github.com/tedconf/file_series"
35
37
  s.licenses = ["MIT"]
36
- s.require_paths = ["lib"]
37
- s.rubygems_version = "1.8.24"
38
+ s.rubygems_version = "2.2.2"
38
39
  s.summary = "Write to a series of time-based files."
39
40
 
40
41
  if s.respond_to? :specification_version then
41
- s.specification_version = 3
42
+ s.specification_version = 4
42
43
 
43
44
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
44
- s.add_development_dependency(%q<autotest-standalone>, [">= 0"])
45
- s.add_development_dependency(%q<autotest-fsevent>, [">= 0"])
46
- s.add_development_dependency(%q<autotest-growl>, [">= 0"])
47
45
  s.add_development_dependency(%q<rspec>, ["~> 2.8.0"])
48
46
  s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
49
- s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
50
- s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
47
+ s.add_development_dependency(%q<bundler>, ["~> 1.6.0"])
48
+ s.add_development_dependency(%q<jeweler>, [">= 0"])
51
49
  s.add_development_dependency(%q<timecop>, ["= 0.3.5"])
52
50
  else
53
- s.add_dependency(%q<autotest-standalone>, [">= 0"])
54
- s.add_dependency(%q<autotest-fsevent>, [">= 0"])
55
- s.add_dependency(%q<autotest-growl>, [">= 0"])
56
51
  s.add_dependency(%q<rspec>, ["~> 2.8.0"])
57
52
  s.add_dependency(%q<rdoc>, ["~> 3.12"])
58
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
59
- s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
53
+ s.add_dependency(%q<bundler>, ["~> 1.6.0"])
54
+ s.add_dependency(%q<jeweler>, [">= 0"])
60
55
  s.add_dependency(%q<timecop>, ["= 0.3.5"])
61
56
  end
62
57
  else
63
- s.add_dependency(%q<autotest-standalone>, [">= 0"])
64
- s.add_dependency(%q<autotest-fsevent>, [">= 0"])
65
- s.add_dependency(%q<autotest-growl>, [">= 0"])
66
58
  s.add_dependency(%q<rspec>, ["~> 2.8.0"])
67
59
  s.add_dependency(%q<rdoc>, ["~> 3.12"])
68
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
69
- s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
60
+ s.add_dependency(%q<bundler>, ["~> 1.6.0"])
61
+ s.add_dependency(%q<jeweler>, [">= 0"])
70
62
  s.add_dependency(%q<timecop>, ["= 0.3.5"])
71
63
  end
72
64
  end
data/lib/file_series.rb CHANGED
@@ -80,6 +80,10 @@ class FileSeries
80
80
  File.join(@dir, "#{@filename_prefix}-#{Time.at(ts).utc.strftime('%Y%m%d-%H%M%SZ')}-#{@rotate_freq}.log")
81
81
  end
82
82
 
83
+ def path
84
+ filename
85
+ end
86
+
83
87
  # get all files which match our pattern which are not current.
84
88
  # (safe for consumption. no longer being written to.)
85
89
  def complete_files
@@ -52,17 +52,17 @@ describe "FileSeries" do
52
52
 
53
53
  describe "#new" do
54
54
  it "should set sync to false by default" do
55
- fs = FileSeries.new
55
+ fs = FileSeries.new(dir: test_dir)
56
56
  fs.write 'blah'
57
57
  fs.file.sync.should eq false
58
58
  end
59
59
 
60
60
  it "should allow control of sync behavior" do
61
- fs = FileSeries.new(:sync => true)
61
+ fs = FileSeries.new(sync: true, dir: test_dir)
62
62
  fs.write 'blah'
63
63
  fs.file.sync.should eq true
64
64
 
65
- fs = FileSeries.new(:sync => false)
65
+ fs = FileSeries.new(sync: false, dir: test_dir)
66
66
  fs.write 'blah'
67
67
  fs.file.sync.should eq false
68
68
  end
@@ -113,6 +113,14 @@ describe "FileSeries" do
113
113
  end
114
114
  end
115
115
 
116
+ describe "#path" do
117
+ it "should act like #filename with no arguments" do
118
+ fs = FileSeries.new( :dir=>'/tmp', :prefix=>'test', :rotate_every=>3600)
119
+ fs.should_receive(:this_period) { Time.parse('1970-01-01 00:20:00Z').to_i }
120
+ fs.path.should == "/tmp/test-19700101-002000Z-3600.log"
121
+ end
122
+ end
123
+
116
124
  describe "#complete_files" do
117
125
  it "should find files in our series which are not in use" do
118
126
  list = [
metadata CHANGED
@@ -1,68 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: file_series
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
5
- prerelease:
4
+ version: 0.5.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Alex Dean
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-08-26 00:00:00.000000000 Z
11
+ date: 2014-06-05 00:00:00.000000000 Z
13
12
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: autotest-standalone
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
22
- type: :development
23
- prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: '0'
30
- - !ruby/object:Gem::Dependency
31
- name: autotest-fsevent
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - ! '>='
36
- - !ruby/object:Gem::Version
37
- version: '0'
38
- type: :development
39
- prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: '0'
46
- - !ruby/object:Gem::Dependency
47
- name: autotest-growl
48
- requirement: !ruby/object:Gem::Requirement
49
- none: false
50
- requirements:
51
- - - ! '>='
52
- - !ruby/object:Gem::Version
53
- version: '0'
54
- type: :development
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
13
  - !ruby/object:Gem::Dependency
63
14
  name: rspec
64
15
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
16
  requirements:
67
17
  - - ~>
68
18
  - !ruby/object:Gem::Version
@@ -70,7 +20,6 @@ dependencies:
70
20
  type: :development
71
21
  prerelease: false
72
22
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
23
  requirements:
75
24
  - - ~>
76
25
  - !ruby/object:Gem::Version
@@ -78,7 +27,6 @@ dependencies:
78
27
  - !ruby/object:Gem::Dependency
79
28
  name: rdoc
80
29
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
30
  requirements:
83
31
  - - ~>
84
32
  - !ruby/object:Gem::Version
@@ -86,7 +34,6 @@ dependencies:
86
34
  type: :development
87
35
  prerelease: false
88
36
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
37
  requirements:
91
38
  - - ~>
92
39
  - !ruby/object:Gem::Version
@@ -94,39 +41,34 @@ dependencies:
94
41
  - !ruby/object:Gem::Dependency
95
42
  name: bundler
96
43
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
44
  requirements:
99
45
  - - ~>
100
46
  - !ruby/object:Gem::Version
101
- version: 1.0.0
47
+ version: 1.6.0
102
48
  type: :development
103
49
  prerelease: false
104
50
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
51
  requirements:
107
52
  - - ~>
108
53
  - !ruby/object:Gem::Version
109
- version: 1.0.0
54
+ version: 1.6.0
110
55
  - !ruby/object:Gem::Dependency
111
56
  name: jeweler
112
57
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
58
  requirements:
115
- - - ~>
59
+ - - ! '>='
116
60
  - !ruby/object:Gem::Version
117
- version: 1.8.4
61
+ version: '0'
118
62
  type: :development
119
63
  prerelease: false
120
64
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
65
  requirements:
123
- - - ~>
66
+ - - ! '>='
124
67
  - !ruby/object:Gem::Version
125
- version: 1.8.4
68
+ version: '0'
126
69
  - !ruby/object:Gem::Dependency
127
70
  name: timecop
128
71
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
72
  requirements:
131
73
  - - '='
132
74
  - !ruby/object:Gem::Version
@@ -134,7 +76,6 @@ dependencies:
134
76
  type: :development
135
77
  prerelease: false
136
78
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
79
  requirements:
139
80
  - - '='
140
81
  - !ruby/object:Gem::Version
@@ -164,29 +105,25 @@ files:
164
105
  homepage: http://github.com/tedconf/file_series
165
106
  licenses:
166
107
  - MIT
108
+ metadata: {}
167
109
  post_install_message:
168
110
  rdoc_options: []
169
111
  require_paths:
170
112
  - lib
171
113
  required_ruby_version: !ruby/object:Gem::Requirement
172
- none: false
173
114
  requirements:
174
115
  - - ! '>='
175
116
  - !ruby/object:Gem::Version
176
117
  version: '0'
177
- segments:
178
- - 0
179
- hash: 2297086619280588333
180
118
  required_rubygems_version: !ruby/object:Gem::Requirement
181
- none: false
182
119
  requirements:
183
120
  - - ! '>='
184
121
  - !ruby/object:Gem::Version
185
122
  version: '0'
186
123
  requirements: []
187
124
  rubyforge_project:
188
- rubygems_version: 1.8.24
125
+ rubygems_version: 2.2.2
189
126
  signing_key:
190
- specification_version: 3
127
+ specification_version: 4
191
128
  summary: Write to a series of time-based files.
192
129
  test_files: []