repltalk 0.5.1 → 1.0.0
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/lib/queries.rb +21 -0
- data/lib/repltalk.rb +32 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32b5dc0fff67f57f37db1a77079dc65ebb3c16321e12f8b894e37c50ae1efc96
|
4
|
+
data.tar.gz: fec0faaa7eede228e816c570d27e27d3beb74a35d74333e123ac724cece8bf43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b09dc1d9d86ce9f596f3efce8a4bf613fdaf1704faaa9c9c0bc8b4a9c20f3a1d0ce6fa97a35e50345d94a930153c0bd01fc37e7cae19189b1c29c2b262169205
|
7
|
+
data.tar.gz: 4337fc27b260cf4f4a0ef545e105af092aa77d84740a12044bdda57a4a935641065a3fe159555aad1009ed5d681634245b9d233098b15c5d13294125da10391b
|
data/lib/queries.rb
CHANGED
@@ -9,6 +9,18 @@ class Queries
|
|
9
9
|
@@organization = "
|
10
10
|
id
|
11
11
|
name
|
12
|
+
country
|
13
|
+
postalCode
|
14
|
+
state
|
15
|
+
city
|
16
|
+
timeCreated
|
17
|
+
"
|
18
|
+
|
19
|
+
@@subscription = "
|
20
|
+
id
|
21
|
+
planId
|
22
|
+
quantity
|
23
|
+
timeCreated
|
12
24
|
"
|
13
25
|
|
14
26
|
@@language = "
|
@@ -17,12 +29,14 @@ class Queries
|
|
17
29
|
displayName
|
18
30
|
tagline
|
19
31
|
icon
|
32
|
+
category
|
20
33
|
"
|
21
34
|
|
22
35
|
@@board = "
|
23
36
|
id
|
24
37
|
name
|
25
38
|
color
|
39
|
+
description
|
26
40
|
"
|
27
41
|
|
28
42
|
@@user = "
|
@@ -40,6 +54,9 @@ class Queries
|
|
40
54
|
organization {
|
41
55
|
#{@@organization}
|
42
56
|
}
|
57
|
+
subscription {
|
58
|
+
#{@@subscription}
|
59
|
+
}
|
43
60
|
languages {
|
44
61
|
#{@@language}
|
45
62
|
}
|
@@ -50,6 +67,7 @@ class Queries
|
|
50
67
|
url
|
51
68
|
title
|
52
69
|
description
|
70
|
+
size
|
53
71
|
imageUrl
|
54
72
|
isPrivate
|
55
73
|
isAlwaysOn
|
@@ -59,6 +77,9 @@ class Queries
|
|
59
77
|
user {
|
60
78
|
#{@@user}
|
61
79
|
}
|
80
|
+
origin {
|
81
|
+
url
|
82
|
+
}
|
62
83
|
"
|
63
84
|
|
64
85
|
@@comment = "
|
data/lib/repltalk.rb
CHANGED
@@ -21,11 +21,16 @@ end
|
|
21
21
|
|
22
22
|
|
23
23
|
class Organization
|
24
|
-
attr_reader :id, :name
|
24
|
+
attr_reader :id, :name, :country, :postal_code, :state, :city, :timestamp
|
25
25
|
|
26
26
|
def initialize(organization)
|
27
27
|
@id = organization["id"]
|
28
28
|
@name = organization["name"]
|
29
|
+
@country = organization["country"]
|
30
|
+
@postal_code = organization["postalCode"]
|
31
|
+
@state = organization["state"]
|
32
|
+
@city = organization["city"]
|
33
|
+
@timestamp = organization["timeCreated"]
|
29
34
|
end
|
30
35
|
|
31
36
|
def to_s
|
@@ -35,8 +40,25 @@ end
|
|
35
40
|
|
36
41
|
|
37
42
|
|
43
|
+
class Subscription
|
44
|
+
attr_reader :id, :plan_id, :quantity, :timestamp
|
45
|
+
|
46
|
+
def initialize(subscription)
|
47
|
+
@id = subscription["id"]
|
48
|
+
@plan_id = subscription["planId"]
|
49
|
+
@quantity = subscription["quantity"]
|
50
|
+
@timestamp = subscription["timeCreated"]
|
51
|
+
end
|
52
|
+
|
53
|
+
def to_s
|
54
|
+
@plan_id
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
|
59
|
+
|
38
60
|
class Language
|
39
|
-
attr_reader :id, :key, :name, :tagline, :icon
|
61
|
+
attr_reader :id, :key, :name, :tagline, :icon, :category
|
40
62
|
|
41
63
|
def initialize(lang)
|
42
64
|
@id = lang["id"]
|
@@ -44,6 +66,7 @@ class Language
|
|
44
66
|
@name = lang["displayName"]
|
45
67
|
@tagline = lang["tagline"]
|
46
68
|
@icon = lang["icon"]
|
69
|
+
@category = lang["category"]
|
47
70
|
end
|
48
71
|
|
49
72
|
def to_s
|
@@ -74,7 +97,7 @@ end
|
|
74
97
|
|
75
98
|
|
76
99
|
class Repl
|
77
|
-
attr_reader :id, :url, :title, :author, :description, :language, :img_url, :is_private, :is_always_on
|
100
|
+
attr_reader :id, :url, :title, :author, :description, :size, :language, :img_url, :origin_url, :is_private, :is_always_on
|
78
101
|
|
79
102
|
def initialize(client, repl)
|
80
103
|
@client = client
|
@@ -84,8 +107,10 @@ class Repl
|
|
84
107
|
@title = repl["title"]
|
85
108
|
@author = User.new(@client, repl["user"])
|
86
109
|
@description = repl["description"]
|
110
|
+
@size = repl["size"]
|
87
111
|
@language = Language.new(repl["lang"])
|
88
112
|
@image_url = repl["imageUrl"]
|
113
|
+
@origin_url = repl["origin"] == nil ? nil : $BASE_URL + repl["origin"]["url"]
|
89
114
|
|
90
115
|
@is_private = repl["isPrivate"]
|
91
116
|
@is_always_on = repl["isAlwaysOn"]
|
@@ -121,12 +146,13 @@ end
|
|
121
146
|
|
122
147
|
|
123
148
|
class Board
|
124
|
-
attr_reader :id, :name, :color
|
149
|
+
attr_reader :id, :name, :color, :description
|
125
150
|
|
126
151
|
def initialize(board)
|
127
152
|
@id = board["id"]
|
128
153
|
@name = board["name"]
|
129
154
|
@color = board["color"]
|
155
|
+
@description = board["description"]
|
130
156
|
end
|
131
157
|
|
132
158
|
def to_s
|
@@ -252,7 +278,7 @@ end
|
|
252
278
|
|
253
279
|
|
254
280
|
class User
|
255
|
-
attr_reader :id, :username, :name, :pfp, :bio, :cycles, :is_hacker, :timestamp, :roles, :organization, :languages
|
281
|
+
attr_reader :id, :username, :name, :pfp, :bio, :cycles, :is_hacker, :timestamp, :subscription, :roles, :organization, :languages
|
256
282
|
|
257
283
|
def initialize(client, user)
|
258
284
|
@client = client
|
@@ -265,6 +291,7 @@ class User
|
|
265
291
|
@cycles = user["karma"]
|
266
292
|
@is_hacker = user["isHacker"]
|
267
293
|
@timestamp = user["timeCreated"]
|
294
|
+
@subscription = user["subscription"] == nil ? nil : Subscription.new(user["subscription"])
|
268
295
|
@roles = user["roles"].map { |role| Role.new(role) }
|
269
296
|
@organization = user["organization"] == nil ? nil : Organization.new(user["organization"])
|
270
297
|
@languages = user["languages"].map { |lang| Language.new(lang) }
|