Class: Lambchop::Client
- Inherits:
-
Object
- Object
- Lambchop::Client
- Defined in:
- lib/lambchop/client.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(source, path, options = {}) ⇒ Client
constructor
A new instance of Client.
- #start ⇒ Object
Constructor Details
#initialize(source, path, options = {}) ⇒ Client
Returns a new instance of Client.
6 7 8 9 10 11 |
# File 'lib/lambchop/client.rb', line 6 def initialize(source, path, = {}) @source = source @path = path @client = [:client] || Aws::Lambda::Client.new = end |
Class Method Details
.start(source, path, options = {}) ⇒ Object
2 3 4 |
# File 'lib/lambchop/client.rb', line 2 def self.start(source, path, = {}) self.new(source, path, ).start end |
Instance Method Details
#start ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/lambchop/client.rb', line 13 def start src = Lambchop::Utils.remove_shebang(@source) config, src = Lambchop::Utils.parse_magic_comment(src) config['function_name'] ||= File.basename(@path, '.js') function_name = config['function_name'] config['mode'] ||= 'event' config['runtime'] ||= 'nodejs' upload_function(config, src) exit if [:detach] Lambchop::WatchDog.start(function_name, [:watch_dog] || {}) sleep end |