lambchop 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cb6e7edb6b8897dfc463c70e4e637d42cbcc1e6d
4
- data.tar.gz: 6e4914af3aebb815e215adb75b30858d14eb7826
3
+ metadata.gz: f6ecec8940739fdb7f4d45349fe9099fef8e25d0
4
+ data.tar.gz: 5819e5a2d5339f556ee4ea5acd4be81dd1d9d5a5
5
5
  SHA512:
6
- metadata.gz: cb728da0839f37876e7abc7cb855842e6aac748b2b2d4dbd712f0d2ce73787c57bbde2821bc853e13ab5f708ad3e24c52e3c521216237c99c74ec5e27ce0d4c2
7
- data.tar.gz: e3e22cfbcda1c72b42896d916f9acdd0e81b91e3e590c41a8277282b4c5b7968f087e6d8bcf83d3159d0ab818e31812d0187bb1fbad8d3c66bc90ff3cc4a1af1
6
+ metadata.gz: 6a7be580e1d0001a28098c43fcfe2cdf955c6692c446e5d611e09744531a31f128e726d64dab1789b7748b1651fd0ba3541b3b713d959d490d6a077db18c63d3
7
+ data.tar.gz: 28fcc0214ff35a589df0101e7c775ecf0f62773096db5149ac3d092b41d2992621b2050497d7801ed09778fc1fe68f0467cf59c815c77056e86d809b219ca006
@@ -20,9 +20,7 @@ class Lambchop::Client
20
20
  config['mode'] ||= 'event'
21
21
  config['runtime'] ||= 'nodejs'
22
22
 
23
- resp = upload_function(config, src)
24
- $stderr.puts('Function was uploaded:')
25
- $stderr.puts(JSON.pretty_generate(resp.to_h))
23
+ upload_function(config, src)
26
24
 
27
25
  exit if @options[:detach]
28
26
 
@@ -36,8 +34,15 @@ class Lambchop::Client
36
34
  def upload_function(config, src)
37
35
  params = {}
38
36
  config.each {|k, v| params[k.to_sym] = v }
39
- params[:function_zip] = zip_source(src).string
40
- @client.upload_function(params)
37
+ buf, node_modules = zip_source(src)
38
+ params[:function_zip] = buf.string
39
+
40
+ resp = @client.upload_function(params)
41
+
42
+ $stderr.puts('Function was uploaded:')
43
+ $stderr.puts(JSON.pretty_generate(resp.to_h))
44
+ $stderr.puts('Node modules:')
45
+ $stderr.puts(JSON.pretty_generate(node_modules))
41
46
  end
42
47
 
43
48
  def zip_source(src)
@@ -50,7 +55,7 @@ class Lambchop::Client
50
55
  end
51
56
  end
52
57
 
53
- Zip::OutputStream.write_buffer do |out|
58
+ buf = Zip::OutputStream.write_buffer do |out|
54
59
  out.put_next_entry(File.basename(@path))
55
60
  out.write(src)
56
61
 
@@ -59,5 +64,11 @@ class Lambchop::Client
59
64
  out.write(open(file, &:read))
60
65
  end
61
66
  end
67
+
68
+ node_modules = node_modules.map {|file|
69
+ file.sub(%r|\A#{src_dir}/|, '').split('/', 3)[1]
70
+ }.uniq.sort
71
+
72
+ [buf, node_modules]
62
73
  end
63
74
  end
@@ -1,3 +1,3 @@
1
1
  module Lambchop
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lambchop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara