Module: EyeGenerator
- Defined in:
- lib/harvester/eye_generator.rb
Class Method Summary collapse
- .create_eye_config(name) ⇒ Object
- .create_parser(name, endpoint) ⇒ Object
- .create_puller(name, endpoint, timeout) ⇒ Object
- .create_pusher(name, endpoint) ⇒ Object
- .initialize(name, endpoint, timeout) ⇒ Object
Class Method Details
.create_eye_config(name) ⇒ Object
4 5 6 7 |
# File 'lib/harvester/eye_generator.rb', line 4 def self.create_eye_config name config = Default.eye_config name File.open("#{name}.d/config.eye", 'w') { |file| file.write(config)} end |
.create_parser(name, endpoint) ⇒ Object
14 15 16 17 |
# File 'lib/harvester/eye_generator.rb', line 14 def self.create_parser name, endpoint parser = Default.parser name, endpoint File.open("#{name}.d/parser.rb", 'w') { |file| file.write(parser)} end |
.create_puller(name, endpoint, timeout) ⇒ Object
9 10 11 12 |
# File 'lib/harvester/eye_generator.rb', line 9 def self.create_puller name, endpoint, timeout puller = Default.puller name, endpoint, timeout File.open("#{name}.d/puller.rb", 'w') { |file| file.write(puller)} end |
.create_pusher(name, endpoint) ⇒ Object
19 20 21 22 |
# File 'lib/harvester/eye_generator.rb', line 19 def self.create_pusher name, endpoint pusher = Default.pusher name, endpoint File.open("#{name}.d/pusher.rb", 'w') { |file| file.write(pusher)} end |
.initialize(name, endpoint, timeout) ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/harvester/eye_generator.rb', line 24 def self.initialize name, endpoint, timeout system "mkdir -p #{name}.d" system "mkdir -p #{name}.d/logs" system "mkdir -p #{name}.d/pids" create_eye_config name create_puller name, endpoint, timeout create_parser name, endpoint create_pusher name, endpoint end |