file_scheduler 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. data/.gitignore +6 -0
  2. data/.rspec +2 -0
  3. data/Gemfile +9 -0
  4. data/Guardfile +8 -0
  5. data/Rakefile +10 -0
  6. data/bin/file-scheduler +19 -0
  7. data/file_scheduler.gemspec +24 -0
  8. data/lib/file_scheduler.rb +21 -0
  9. data/lib/file_scheduler/attributes_parser.rb +40 -0
  10. data/lib/file_scheduler/base.rb +62 -0
  11. data/lib/file_scheduler/content.rb +19 -0
  12. data/lib/file_scheduler/core_ext.rb +37 -0
  13. data/lib/file_scheduler/file.rb +80 -0
  14. data/lib/file_scheduler/log.rb +53 -0
  15. data/lib/file_scheduler/playlist.rb +36 -0
  16. data/lib/file_scheduler/scheduling.rb +59 -0
  17. data/lib/file_scheduler/time_chain.rb +19 -0
  18. data/lib/file_scheduler/time_interval.rb +38 -0
  19. data/lib/file_scheduler/time_mark.rb +66 -0
  20. data/lib/file_scheduler/time_parser.rb +37 -0
  21. data/lib/file_scheduler/url.rb +56 -0
  22. data/lib/file_scheduler/version.rb +3 -0
  23. data/spec/lib/file_scheduler/attributes_parser_spec.rb +33 -0
  24. data/spec/lib/file_scheduler/base_spec.rb +75 -0
  25. data/spec/lib/file_scheduler/content_shared_examples.rb +12 -0
  26. data/spec/lib/file_scheduler/file_spec.rb +104 -0
  27. data/spec/lib/file_scheduler/log_spec.rb +50 -0
  28. data/spec/lib/file_scheduler/playlist_spec.rb +17 -0
  29. data/spec/lib/file_scheduler/scheduling_spec.rb +114 -0
  30. data/spec/lib/file_scheduler/time_interval_spec.rb +46 -0
  31. data/spec/lib/file_scheduler/time_mark_spec.rb +51 -0
  32. data/spec/lib/file_scheduler/time_parser_spec.rb +33 -0
  33. data/spec/lib/file_scheduler/url_spec.rb +33 -0
  34. data/spec/lib/file_scheduler_spec.rb +117 -0
  35. data/spec/spec_helper.rb +12 -0
  36. data/spec/support/pathname.rb +23 -0
  37. data/spec/support/time.rb +19 -0
  38. data/spec/support/tmpdir.rb +1 -0
  39. metadata +118 -0
@@ -0,0 +1,12 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+
4
+ require 'rspec'
5
+
6
+ require 'file_scheduler' # and any other gems you need
7
+
8
+ Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f}
9
+
10
+ RSpec.configure do |config|
11
+ # some (optional) config here
12
+ end
@@ -0,0 +1,23 @@
1
+ class Pathname
2
+
3
+ def touch(file = nil)
4
+ if file
5
+ (self + file).touch
6
+ else
7
+ FileUtils.touch self
8
+ self
9
+ end
10
+ end
11
+
12
+ alias_method :mkpath_without_argument, :mkpath
13
+
14
+ def mkpath(name = nil)
15
+ if name
16
+ (self+name).mkpath
17
+ else
18
+ mkpath_without_argument
19
+ self
20
+ end
21
+ end
22
+
23
+ end
@@ -0,0 +1,19 @@
1
+ require 'time'
2
+
3
+ class Numeric
4
+
5
+ def minutes
6
+ self * 60
7
+ end
8
+
9
+ end
10
+
11
+ class Time
12
+ def attributes(*only)
13
+ %w{year month day hour minute week_day}.inject({}) do |attributes, name|
14
+ name = name.to_sym
15
+ attributes[name] = send(name) if only.empty? or only.include?(name)
16
+ attributes
17
+ end
18
+ end
19
+ end
@@ -0,0 +1 @@
1
+ require 'tmpdir'
metadata ADDED
@@ -0,0 +1,118 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: file_scheduler
3
+ version: !ruby/object:Gem::Version
4
+ hash: 27
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 2
10
+ version: 0.0.2
11
+ platform: ruby
12
+ authors:
13
+ - Alban Peignier
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-12-19 00:00:00 Z
19
+ dependencies: []
20
+
21
+ description: Manage a audio/video program from a simple directory
22
+ email:
23
+ - alban@tryphon.eu
24
+ executables:
25
+ - file-scheduler
26
+ extensions: []
27
+
28
+ extra_rdoc_files: []
29
+
30
+ files:
31
+ - .gitignore
32
+ - .rspec
33
+ - Gemfile
34
+ - Guardfile
35
+ - Rakefile
36
+ - bin/file-scheduler
37
+ - file_scheduler.gemspec
38
+ - lib/file_scheduler.rb
39
+ - lib/file_scheduler/attributes_parser.rb
40
+ - lib/file_scheduler/base.rb
41
+ - lib/file_scheduler/content.rb
42
+ - lib/file_scheduler/core_ext.rb
43
+ - lib/file_scheduler/file.rb
44
+ - lib/file_scheduler/log.rb
45
+ - lib/file_scheduler/playlist.rb
46
+ - lib/file_scheduler/scheduling.rb
47
+ - lib/file_scheduler/time_chain.rb
48
+ - lib/file_scheduler/time_interval.rb
49
+ - lib/file_scheduler/time_mark.rb
50
+ - lib/file_scheduler/time_parser.rb
51
+ - lib/file_scheduler/url.rb
52
+ - lib/file_scheduler/version.rb
53
+ - spec/lib/file_scheduler/attributes_parser_spec.rb
54
+ - spec/lib/file_scheduler/base_spec.rb
55
+ - spec/lib/file_scheduler/content_shared_examples.rb
56
+ - spec/lib/file_scheduler/file_spec.rb
57
+ - spec/lib/file_scheduler/log_spec.rb
58
+ - spec/lib/file_scheduler/playlist_spec.rb
59
+ - spec/lib/file_scheduler/scheduling_spec.rb
60
+ - spec/lib/file_scheduler/time_interval_spec.rb
61
+ - spec/lib/file_scheduler/time_mark_spec.rb
62
+ - spec/lib/file_scheduler/time_parser_spec.rb
63
+ - spec/lib/file_scheduler/url_spec.rb
64
+ - spec/lib/file_scheduler_spec.rb
65
+ - spec/spec_helper.rb
66
+ - spec/support/pathname.rb
67
+ - spec/support/time.rb
68
+ - spec/support/tmpdir.rb
69
+ homepage: http://projects.tryphon.eu/filescheduler
70
+ licenses: []
71
+
72
+ post_install_message:
73
+ rdoc_options: []
74
+
75
+ require_paths:
76
+ - lib
77
+ required_ruby_version: !ruby/object:Gem::Requirement
78
+ none: false
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ hash: 3
83
+ segments:
84
+ - 0
85
+ version: "0"
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ none: false
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ hash: 3
92
+ segments:
93
+ - 0
94
+ version: "0"
95
+ requirements: []
96
+
97
+ rubyforge_project: file_scheduler
98
+ rubygems_version: 1.8.10
99
+ signing_key:
100
+ specification_version: 3
101
+ summary: Schedule contents from files
102
+ test_files:
103
+ - spec/lib/file_scheduler/attributes_parser_spec.rb
104
+ - spec/lib/file_scheduler/base_spec.rb
105
+ - spec/lib/file_scheduler/content_shared_examples.rb
106
+ - spec/lib/file_scheduler/file_spec.rb
107
+ - spec/lib/file_scheduler/log_spec.rb
108
+ - spec/lib/file_scheduler/playlist_spec.rb
109
+ - spec/lib/file_scheduler/scheduling_spec.rb
110
+ - spec/lib/file_scheduler/time_interval_spec.rb
111
+ - spec/lib/file_scheduler/time_mark_spec.rb
112
+ - spec/lib/file_scheduler/time_parser_spec.rb
113
+ - spec/lib/file_scheduler/url_spec.rb
114
+ - spec/lib/file_scheduler_spec.rb
115
+ - spec/spec_helper.rb
116
+ - spec/support/pathname.rb
117
+ - spec/support/time.rb
118
+ - spec/support/tmpdir.rb