gistcafe 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aac40458d551363c3a5f3d377cf14638a32067a2ec21575b1a6fe76100c7781e
4
- data.tar.gz: 63c953de00e421cd663d0cdbc7c7aeebc17de92eafd9cc859180768b6f549474
3
+ metadata.gz: 86deeef0372bded9788639a5cd4af8191e4177c6a01fe469446f4903f742455f
4
+ data.tar.gz: 615b93b73502b92885ce8152bc94a5cccf1f17b1939ed151909bc0ea6348d2b1
5
5
  SHA512:
6
- metadata.gz: 2d2b79196b54ea30e768b82927c3e01d6ee89dfa494ee3103d466eb71a12e3f9196580e04b22d101e0e01eadc36f506dc3cfedfb435b29099118c19c3c434c2b
7
- data.tar.gz: 663f760d0b28eedad86f7284a4dd81e55a47209d63fada0ca54fc56a82e251257a6e1c81230a4a59d21b062e55fb8a84ec3811dc24385e86d894ac12d1e4315f
6
+ metadata.gz: b58cbbe49741b58513218defd01cd65140254ec019de8f4051a57fb4419209497c6b733430a20ea21867546b4c58ba3a8e3382f86ab16fc4395282e93074a659
7
+ data.tar.gz: 7f44b568af2713332724f8602aab1900d0ce4f3ce2c3e2035fe577b4cdd430383395931f17f1ade7877d2f742f9497c7adc5c28be25033bd4fbd19a0f0b596b9
data/.gitignore CHANGED
@@ -10,3 +10,4 @@
10
10
 
11
11
  # rspec failure tracking
12
12
  .rspec_status
13
+ *.log
data/README.md CHANGED
@@ -21,38 +21,40 @@ Or install it yourself as:
21
21
  Simple Usage Example:
22
22
 
23
23
  ```ruby
24
+ require 'json'
25
+ require 'net/http'
26
+ require 'gistcafe'
27
+
24
28
  org_name = "ruby"
25
29
  uri = URI.parse("https://api.github.com/orgs/#{org_name}/repos")
26
30
 
27
31
  http = Net::HTTP.new(uri.host, uri.port)
28
32
  http.use_ssl = (uri.scheme == 'https')
29
- http.verify_mode = OpenSSL::SSL::VERIFY_NONE
33
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
30
34
 
31
35
  req = Net::HTTP::Get.new(uri.request_uri)
32
36
  req["User-Agent"] = "gist.cafe"
33
- req["Content-Type"] = "application/json"
34
37
 
35
38
  res = http.request(req)
36
- org_repos = JSON.parse(res.body).map {|x| {
37
- name: x['name'],
38
- description: x['description'],
39
- url: x['url'],
40
- lang: x['language'],
41
- watchers: x['watchers'],
42
- forks: x['forks']
39
+ org_repos = JSON.parse(res.body).map {|x| {
40
+ name: x['name'],
41
+ description: x['description'],
42
+ url: x['url'],
43
+ lang: x['language'],
44
+ watchers: x['watchers'],
45
+ forks: x['forks']
43
46
  } }.sort_by { |x| -x[:watchers] }
44
47
 
45
48
  puts "Top 3 #{org_name} GitHub Repos:"
46
49
  Inspect.print_dump(org_repos.take(3))
47
50
 
48
51
  puts "\nTop 10 #{org_name} GitHub Repos:"
49
- Inspect.print_dump_table(org_repos.take(10).map {|x| {
50
- name: x[:name],
51
- lang: x[:lang],
52
- watchers: x[:watchers],
53
- forks: x[:forks],
54
- }
55
- })
52
+ Inspect.print_dump_table(org_repos.take(10).map {|x| {
53
+ name: x[:name],
54
+ lang: x[:lang],
55
+ watchers: x[:watchers],
56
+ forks: x[:forks],
57
+ }})
56
58
  ```
57
59
 
58
60
  Which outputs:
@@ -99,9 +99,9 @@ module Inspect
99
99
 
100
100
  def self.align_left(str, len, pad=" ")
101
101
  return "" if len < 0
102
- a_len = len + 1 + str.length
102
+ a_len = len + 1 - str.length
103
103
  return str if a_len <= 0
104
- "#{pad}#{str}#{pad * (len + 1 - str.length)}"
104
+ "#{pad}#{str}#{pad * a_len}"
105
105
  end
106
106
 
107
107
  def self.align_center(str, len, pad=" ")
@@ -115,9 +115,9 @@ module Inspect
115
115
 
116
116
  def self.align_right(str, len, pad=" ")
117
117
  return "" if len < 0
118
- a_len = len + 1 + str.length
118
+ a_len = len + 1 - str.length
119
119
  return str if a_len <= 0
120
- "#{pad * (len + 1 - str.length)}#{str}#{pad}"
120
+ "#{pad * a_len}#{str}#{pad}"
121
121
  end
122
122
 
123
123
  def self.align_auto(obj, len, pad=" ")
@@ -1,3 +1,3 @@
1
1
  module Inspect
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gistcafe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ServiceStack, Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-26 00:00:00.000000000 Z
11
+ date: 2021-01-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: