lambchop 0.0.2 → 0.0.3
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 +4 -4
- data/README.md +22 -1
- data/bin/lambchop +13 -1
- data/bin/lambchop-tail +11 -0
- data/lib/lambchop/client.rb +2 -0
- data/lib/lambchop/tail.rb +15 -0
- data/lib/lambchop/version.rb +1 -1
- data/lib/lambchop.rb +1 -0
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a06b5d29aea579996f3a040a11a32b5c85663e6
|
4
|
+
data.tar.gz: 7244edb14772e6eabefcbe0eb94428b4c4879adc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb3082e665fc6abbf663bf6c609d2e55253bd093c823e8eb76ccae760b45fc9730fa97797ab4e19bcea1d276ce2eea1db9a701228ebeab06687c32ced8191cc2
|
7
|
+
data.tar.gz: 38fdfb9aa45ac677d1dd0a181cb081ad914150e82b42d9f927397e1a43fda1c70f7b958c31a574fa9c02b2cb836b619f45d9ec3c77ec3963972fd60e6a7cae88
|
data/README.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
It is a tool that invoke AWS Lambda function from the local machine as a normally script.
|
4
4
|
|
5
|
+
[](http://badge.fury.io/rb/lambchop)
|
6
|
+
|
5
7
|
## Installation
|
6
8
|
|
7
9
|
Add this line to your application's Gemfile:
|
@@ -51,8 +53,9 @@ $ ./test.js
|
|
51
53
|
```sh
|
52
54
|
$ lambchop-cat
|
53
55
|
usage: lambchop-cat <function-name>
|
56
|
+
|
54
57
|
$ lambchop-cat
|
55
|
-
$ echo '{"key1":100, "key2":200, "key3":300}' |
|
58
|
+
$ echo '{"key1":100, "key2":200, "key3":300}' | lambchop-cat test
|
56
59
|
```
|
57
60
|
|
58
61
|
**Terminal 1**:
|
@@ -94,6 +97,24 @@ exports.handler = function(event, context) {
|
|
94
97
|
};
|
95
98
|
```
|
96
99
|
|
100
|
+
### Upload only
|
101
|
+
|
102
|
+
```javascript
|
103
|
+
#!/usr/bin/env lambchop -d
|
104
|
+
...
|
105
|
+
```
|
106
|
+
|
107
|
+
### Follow log only
|
108
|
+
|
109
|
+
```sh
|
110
|
+
~$ lambchop-tail
|
111
|
+
usage: lambchop-tail <function-name>
|
112
|
+
|
113
|
+
~$ lambchop-tail test
|
114
|
+
START RequestId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
115
|
+
...
|
116
|
+
```
|
117
|
+
|
97
118
|
## Demo
|
98
119
|
|
99
120
|
* https://asciinema.org/a/14158
|
data/bin/lambchop
CHANGED
@@ -2,5 +2,17 @@
|
|
2
2
|
$: << File.expand_path("#{File.dirname __FILE__}/../lib")
|
3
3
|
require 'rubygems'
|
4
4
|
require 'lambchop'
|
5
|
+
require 'optparse'
|
5
6
|
|
6
|
-
Lambchop::
|
7
|
+
Version = Lambchop::VERSION
|
8
|
+
|
9
|
+
options = {}
|
10
|
+
|
11
|
+
ARGV.options do |opt|
|
12
|
+
opt.on('-d', '--detach') { options[:detach] = true }
|
13
|
+
opt.parse!
|
14
|
+
end
|
15
|
+
|
16
|
+
open(ARGV[0]) do |f|
|
17
|
+
Lambchop::Client.start(f.read, f.path, options)
|
18
|
+
end
|
data/bin/lambchop-tail
ADDED
data/lib/lambchop/client.rb
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
class Lambchop::Tail
|
2
|
+
def self.tail(function_name, options = {})
|
3
|
+
self.new(function_name, options).tail
|
4
|
+
end
|
5
|
+
|
6
|
+
def initialize(function_name, options = {})
|
7
|
+
@function_name = function_name
|
8
|
+
@options = options
|
9
|
+
end
|
10
|
+
|
11
|
+
def tail
|
12
|
+
Lambchop::WatchDog.start(@function_name, @options)
|
13
|
+
sleep
|
14
|
+
end
|
15
|
+
end
|
data/lib/lambchop/version.rb
CHANGED
data/lib/lambchop.rb
CHANGED
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.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Genki Sugawara
|
@@ -74,6 +74,7 @@ executables:
|
|
74
74
|
- lambchop
|
75
75
|
- lambchop-cat
|
76
76
|
- lambchop-dump
|
77
|
+
- lambchop-tail
|
77
78
|
extensions: []
|
78
79
|
extra_rdoc_files: []
|
79
80
|
files:
|
@@ -85,11 +86,13 @@ files:
|
|
85
86
|
- bin/lambchop
|
86
87
|
- bin/lambchop-cat
|
87
88
|
- bin/lambchop-dump
|
89
|
+
- bin/lambchop-tail
|
88
90
|
- lambchop.gemspec
|
89
91
|
- lib/lambchop.rb
|
90
92
|
- lib/lambchop/cat.rb
|
91
93
|
- lib/lambchop/client.rb
|
92
94
|
- lib/lambchop/dump.rb
|
95
|
+
- lib/lambchop/tail.rb
|
93
96
|
- lib/lambchop/version.rb
|
94
97
|
- lib/lambchop/watch_dog.rb
|
95
98
|
homepage: https://github.com/winebarrel/lambchop
|