ft_42 0.3.3 → 0.4.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/ft_42.rb +18 -2
- 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: 051de4f40afc1f66babddd02b0ff57edfc089974
|
4
|
+
data.tar.gz: c9d8ae2c26a384c2ed40f02fe61d8fd953c39162
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c660b6ebb7179f9e5cfc5c5f6ec84d56ca949025016c4f28ca161047f990862fd6547731ef3f4aac8146ea8440dd96b4ebed58482aee6dd8d18bf02b49c8b30e
|
7
|
+
data.tar.gz: '084398ae0a05c678759216d35ebb293752c4cc2700a94c1ea7b2a6879213296eddefbafed1c58927d33338d9dc26a9d436e152ca1893ee659276fe0f33ffdf47'
|
data/lib/ft_42.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "active_support/all"
|
2
|
+
require "date"
|
2
3
|
require "action_view"
|
3
4
|
require "pastel"
|
4
5
|
require "oauth2"
|
@@ -19,7 +20,14 @@ class FT_42
|
|
19
20
|
if (args.size > 2)
|
20
21
|
if (args.first == "project")
|
21
22
|
puts "This is a big request, it may take a minute or two."
|
22
|
-
|
23
|
+
if (args.include?("after"))
|
24
|
+
date = args.pop(3).join(" ")
|
25
|
+
date = DateTime.parse(date)
|
26
|
+
args.pop
|
27
|
+
ft_42 = Client.new(args.second, args.last, date)
|
28
|
+
else
|
29
|
+
ft_42 = Client.new(args.second, args.last)
|
30
|
+
end
|
23
31
|
else
|
24
32
|
ft_42 = Client.new(args.first, args.third)
|
25
33
|
end
|
@@ -89,7 +97,11 @@ class Client
|
|
89
97
|
loop do
|
90
98
|
begin
|
91
99
|
tries ||= 3
|
92
|
-
|
100
|
+
if input_3
|
101
|
+
response = token.get("/v2/projects_users?filter[campus]=#{campus['id']}&filter[project_id]=#{project['id']}&range[created_at]=#{after},#{right_now}", params: { page: i, per_page: 100 }).parsed
|
102
|
+
else
|
103
|
+
response = token.get("/v2/projects_users?filter[campus]=#{campus['id']}&filter[project_id]=#{project['id']}", params: { page: i, per_page: 100 }).parsed
|
104
|
+
end
|
93
105
|
rescue
|
94
106
|
puts "Something went wrong..."
|
95
107
|
puts "REFRESHING API TOKEN... wait 8 sec"
|
@@ -109,6 +121,10 @@ class Client
|
|
109
121
|
|
110
122
|
private
|
111
123
|
|
124
|
+
def after
|
125
|
+
input_3.to_time.to_s.split(" ")[0...-1].join("T")
|
126
|
+
end
|
127
|
+
|
112
128
|
def time_ago
|
113
129
|
if input_2
|
114
130
|
time = Time.current - (input_2.to_i * 7).days
|