linodians 0.0.3 → 0.0.4
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 +27 -0
- data/lib/linodians/group.rb +2 -2
- data/lib/linodians/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: 6c5351346d7a9b25ef7bb381e92baf47f73939b3
|
|
4
|
+
data.tar.gz: 9dd43246770b718e2330d3eb1d408c1fc52f43e8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 60302b7bebb1a9043b7cbf98ba8c6ea3c9891016058154eaa3fd978d9a56c97b9b255f83ca69351cf11314fa1222ec47ba22c875b9c3cb9a9f164dc7cf599735
|
|
7
|
+
data.tar.gz: 20d13529a3c62a529d444c38f91e817da21615d502b02efc0169f2e754ba02b50d665ccb351c6ffac0a907b15a468f7046dfdb76ba9076d2ef32a694d5b7c9ba
|
data/README.md
CHANGED
|
@@ -12,6 +12,21 @@ Library for viewing public Linode employee data
|
|
|
12
12
|
|
|
13
13
|
## Usage
|
|
14
14
|
|
|
15
|
+
### From the command line
|
|
16
|
+
|
|
17
|
+
A `linodians` script is provided that will output the current data:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
❯ linodians -h
|
|
21
|
+
Usage: linodians [-v] [-j]
|
|
22
|
+
-j, --json Output as json
|
|
23
|
+
-v, --version Show version
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Running just `linodians` will print a human-readable list. For consumption by other tools, `linodians -j` will output JSON.
|
|
27
|
+
|
|
28
|
+
### From Ruby code
|
|
29
|
+
|
|
15
30
|
First, create a Linodian object
|
|
16
31
|
|
|
17
32
|
```
|
|
@@ -55,6 +70,18 @@ titles = employees.map(&:title).each_with_object(Hash.new(0)) { |i, o| o[i] += 1
|
|
|
55
70
|
titles.sort_by(&:last).each { |title, count| puts "#{count} -- #{title}" }
|
|
56
71
|
```
|
|
57
72
|
|
|
73
|
+
#### Loading in existing data
|
|
74
|
+
|
|
75
|
+
If you already have a hash of data, like one created with `Linodians.new.to_json`, you can import it back in when making a new Linodians object:
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
require 'linodians'
|
|
79
|
+
require 'json'
|
|
80
|
+
|
|
81
|
+
data = File.open('data.json') { |fh| JSON.parse fh }
|
|
82
|
+
linodians = Linodians.new(data)
|
|
83
|
+
```
|
|
84
|
+
|
|
58
85
|
## Installation
|
|
59
86
|
|
|
60
87
|
gem install linodians
|
data/lib/linodians/group.rb
CHANGED
data/lib/linodians/version.rb
CHANGED