lambchop 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0a06b5d29aea579996f3a040a11a32b5c85663e6
4
- data.tar.gz: 7244edb14772e6eabefcbe0eb94428b4c4879adc
3
+ metadata.gz: dea62c77a6ac1568c61714754f3f6b1f43b875d4
4
+ data.tar.gz: 7a2be55dbe9adbbe746c3cc53dbe9418cd8a1609
5
5
  SHA512:
6
- metadata.gz: bb3082e665fc6abbf663bf6c609d2e55253bd093c823e8eb76ccae760b45fc9730fa97797ab4e19bcea1d276ce2eea1db9a701228ebeab06687c32ced8191cc2
7
- data.tar.gz: 38fdfb9aa45ac677d1dd0a181cb081ad914150e82b42d9f927397e1a43fda1c70f7b958c31a574fa9c02b2cb836b619f45d9ec3c77ec3963972fd60e6a7cae88
6
+ metadata.gz: 464363eb0712671e815688fb67853102cdee49a4615c2c9a52607b4636463f8267b47a88316ad8e341bffb3ce49eddd66cdfcc0427c03dbd5c47f8199a33b505
7
+ data.tar.gz: 6d912182b4202f0bc7fa1720f36403eb84b7170f16e33a94d5e01e6db6dd09e1b6b33eb0df1baae728a7d1f07f3aa5b832871cec301bb0af2272686f10e131c6
data/.gitignore CHANGED
@@ -14,3 +14,4 @@
14
14
  mkmf.log
15
15
  test.rb
16
16
  test.js
17
+ node_modules/
data/README.md CHANGED
@@ -69,7 +69,7 @@ END RequestId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
69
69
  REPORT RequestId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Duration: 117.54 ms Billed Duration: 200 ms Memory Size: 128 MB Max Memory Used: 9 MB
70
70
  ```
71
71
 
72
- ### Dump function
72
+ ## Dump function
73
73
 
74
74
  ```sh
75
75
  $ lambchop-dump
@@ -97,14 +97,14 @@ exports.handler = function(event, context) {
97
97
  };
98
98
  ```
99
99
 
100
- ### Upload only
100
+ ## Upload only
101
101
 
102
102
  ```javascript
103
103
  #!/usr/bin/env lambchop -d
104
104
  ...
105
105
  ```
106
106
 
107
- ### Follow log only
107
+ ## Follow log only
108
108
 
109
109
  ```sh
110
110
  ~$ lambchop-tail
@@ -115,6 +115,13 @@ START RequestId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
115
115
  ...
116
116
  ```
117
117
 
118
+ # node module path
119
+ ```
120
+ .
121
+ ├── lambda-script.js
122
+ └── node_modules/
123
+ ```
124
+
118
125
  ## Demo
119
126
 
120
127
  * https://asciinema.org/a/14158
@@ -41,9 +41,23 @@ class Lambchop::Client
41
41
  end
42
42
 
43
43
  def zip_source(src)
44
+ src_dir = File.dirname(@path)
45
+ node_modules = []
46
+
47
+ Dir.glob("#{src_dir}/node_modules/**/*") do |file|
48
+ if File.file?(file)
49
+ node_modules << file
50
+ end
51
+ end
52
+
44
53
  Zip::OutputStream.write_buffer do |out|
45
54
  out.put_next_entry(File.basename(@path))
46
55
  out.write(src)
56
+
57
+ node_modules.each do |file|
58
+ out.put_next_entry(file.sub(%r|\A#{src_dir}/|, ''))
59
+ out.write(open(file, &:read))
60
+ end
47
61
  end
48
62
  end
49
63
 
@@ -1,3 +1,3 @@
1
1
  module Lambchop
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
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.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara