echo_cli 0.6.22 → 0.6.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -0
- data/lib/echo_cli/cli.rb +18 -0
- data/lib/echo_cli/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fbd07ab0c4ea7bab915e1c40cbcdb8404e5b895
|
4
|
+
data.tar.gz: a8df4959fdcd32362fdc46777f744f1e6d26d5b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7780c84587c12a3db91ebab183ea7107be797ab721213176959b56ddd39c1c6a7a4d7a434a03ddd7196f614835b7efa68d6c3145139445f63de352b92753e50
|
7
|
+
data.tar.gz: e3b12589d4ce0a17f43e26db795b17feabc264d3b2c691cc2f4eb7d49fea2900ac90d91df15d8afa7fbc350df836ba0c82fc2d7c056ee2897013e1006aef3c45
|
data/README.md
CHANGED
@@ -141,6 +141,17 @@ Example:
|
|
141
141
|
$ echo_cli help post
|
142
142
|
```
|
143
143
|
|
144
|
+
#### now
|
145
|
+
```bash
|
146
|
+
$ echo_cli now
|
147
|
+
```
|
148
|
+
Prints the current date/time in two formats: Epoch and human-readable.
|
149
|
+
|
150
|
+
Example:
|
151
|
+
```bash
|
152
|
+
$ echo_cli now
|
153
|
+
```
|
154
|
+
|
144
155
|
#### post
|
145
156
|
```bash
|
146
157
|
$ echo_cli post '<metric>' {number} {-q}
|
data/lib/echo_cli/cli.rb
CHANGED
@@ -376,6 +376,24 @@ module Echo_cli
|
|
376
376
|
puts "\nConverted timstamp: ".green + time.yellow
|
377
377
|
return time
|
378
378
|
end
|
379
|
+
|
380
|
+
desc "now", "The current time, in epoch and human-readable formats. Use \"echo_cli now\""
|
381
|
+
|
382
|
+
long_desc <<-LONGDESC
|
383
|
+
`echo_cli now` will present the current timestamp (based on your computer's local time) to more easily utilize the rest of the Echo CLI commands.
|
384
|
+
|
385
|
+
Epoch timestamp example: 1492186214
|
386
|
+
|
387
|
+
Human-readable date/time timestamp example: 2011-10-18T21:01:52-07:00
|
388
|
+
|
389
|
+
> $ echo_cli now
|
390
|
+
|
391
|
+
LONGDESC
|
392
|
+
|
393
|
+
def now
|
394
|
+
timestamp = Time.new.to_i.to_s
|
395
|
+
puts "\nCurrent Epoch time: ".green + timestamp.to_s.yellow + "\nCurrent time: ".green + Time.at(timestamp.to_i).to_datetime.to_s.yellow
|
396
|
+
end
|
379
397
|
end
|
380
398
|
|
381
399
|
class Helper
|
data/lib/echo_cli/version.rb
CHANGED