meer 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 +4 -4
- data/README.md +6 -6
- data/lib/meer/cli.rb +5 -5
- data/lib/meer/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: bb5bbaf30530129f3d6a93e16ba7192b79d5b71c
|
4
|
+
data.tar.gz: 2bf93b8264bd66b9a3f4863aa598983efb5caf60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b923dcc36800a39ad43aada5093ded18595623d35d7712e5ef6c238698f16ae8bb5f3fd2c3969cebe40ac3685b5d746327ca820e728496c2d51a6a8b8c3e25b8
|
7
|
+
data.tar.gz: e60506b12cfde9257ceaf34304012f2f409214f20d9ca9f7c1c89078d19b1a8193f18dc3882db014138581e7b0e932638e4b0eb13ac26d769b326c1bd9856106
|
data/README.md
CHANGED
@@ -16,12 +16,12 @@ Meer pulls the base url for what datameer to hit from environment variables, so
|
|
16
16
|
$ meer help
|
17
17
|
|
18
18
|
Commands:
|
19
|
-
meer csv
|
20
|
-
meer help [COMMAND]
|
21
|
-
meer login
|
22
|
-
meer sheets
|
23
|
-
meer table
|
24
|
-
meer workbooks
|
19
|
+
meer csv [WORKBOOK-ID] [SHEET_NAME] # Outputs the CSV for a given workbook
|
20
|
+
meer help [COMMAND] # Describe available commands or one specific command
|
21
|
+
meer login # Logs into datameer for quick access
|
22
|
+
meer sheets [WORKBOOK-ID] # Lists all sheets in a workbook
|
23
|
+
meer table [WORKBOOK-ID] [SHEET_NAME] # Outputs a nicely formatted table for a given workbook
|
24
|
+
meer workbooks # Lists all workbooks
|
25
25
|
```
|
26
26
|
|
27
27
|
First thing you will want to do is login to datameer from the CLI. This will store your session id as a file in `~/.dmsession` so that you can interact with Datameer constantly typing credentials.
|
data/lib/meer/cli.rb
CHANGED
@@ -2,7 +2,7 @@ require 'meer/datameer'
|
|
2
2
|
|
3
3
|
module Meer
|
4
4
|
class CLI < ::Thor
|
5
|
-
desc "login", "
|
5
|
+
desc "login", "Logs into datameer for quick access"
|
6
6
|
def login
|
7
7
|
user = ask("username:", default: ENV['USER'])
|
8
8
|
password = ask("password:", :echo => false)
|
@@ -11,26 +11,26 @@ module Meer
|
|
11
11
|
client(user, password).login
|
12
12
|
end
|
13
13
|
|
14
|
-
desc "workbooks", "
|
14
|
+
desc "workbooks", "Lists all workbooks"
|
15
15
|
def workbooks
|
16
16
|
client.workbooks.sort_by { |w| w['path'] }.each do |workbook|
|
17
17
|
puts " - [#{workbook['id']}] #{workbook['path']}"
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
desc "sheets", "
|
21
|
+
desc "sheets [WORKBOOK-ID]", "Lists all sheets in a workbook"
|
22
22
|
def sheets(workbook_id)
|
23
23
|
client.workbook(workbook_id)['sheets'].each do |sheet|
|
24
24
|
puts " - #{sheet['name']}"
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
desc "csv", "
|
28
|
+
desc "csv [WORKBOOK-ID] [SHEET_NAME]", "Outputs the CSV for a given workbook"
|
29
29
|
def csv(workbook, sheet)
|
30
30
|
puts client.workbook_data(workbook, sheet)
|
31
31
|
end
|
32
32
|
|
33
|
-
desc "table", "
|
33
|
+
desc "table [WORKBOOK-ID] [SHEET_NAME]", "Outputs a nicely formatted table for a given workbook"
|
34
34
|
def table(workbook, sheet)
|
35
35
|
data = client.workbook_data(workbook, sheet)
|
36
36
|
rows = CSV.parse(data, :headers => true).to_a
|
data/lib/meer/version.rb
CHANGED