ghx 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ghx/project.rb +2 -2
- data/lib/ghx/project_item.rb +3 -3
- data/lib/ghx.rb +35 -3
- data/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 844c71686d364775951d08395893eb266f66255d9a3ad08bae723301b85fc7e9
|
4
|
+
data.tar.gz: e2ac2f47f1673a8876358ce39513193741a26a9a42a314044a35b3e6d9c553c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2034b514c2005c54a97a7cae8b5acae0eb80993d40e03504371e4b83bffc84f642513183fb5615e132b831e1e4747e3787a767ad9ca049c5e0960b968a7caa45
|
7
|
+
data.tar.gz: 9d02fac7a48c996d82a8122249fa74902b0ba8671d93de4442c56b756794a3bcb77cceeed2e9b654c480625d8efbba91ce577b15ff349ee4afa55328758a261d
|
data/lib/ghx/project.rb
CHANGED
@@ -48,7 +48,7 @@ module GHX
|
|
48
48
|
}
|
49
49
|
GQL
|
50
50
|
|
51
|
-
client =
|
51
|
+
client = GHX.graphql
|
52
52
|
res = client.query(gql_query)
|
53
53
|
|
54
54
|
data = JSON.parse(res.body)
|
@@ -177,7 +177,7 @@ module GHX
|
|
177
177
|
}
|
178
178
|
GQL
|
179
179
|
|
180
|
-
client =
|
180
|
+
client = GHX.graphql
|
181
181
|
res = client.query(gql_query)
|
182
182
|
|
183
183
|
data = JSON.parse(res.body)
|
data/lib/ghx/project_item.rb
CHANGED
@@ -87,7 +87,7 @@ module GHX
|
|
87
87
|
}
|
88
88
|
GQL
|
89
89
|
|
90
|
-
client =
|
90
|
+
client = GHX.graphql
|
91
91
|
res = client.query(gql_query)
|
92
92
|
GHX.logger.debug "Update text field result"
|
93
93
|
GHX.logger.debug res
|
@@ -111,7 +111,7 @@ module GHX
|
|
111
111
|
}
|
112
112
|
GQL
|
113
113
|
|
114
|
-
client =
|
114
|
+
client = GHX.graphql
|
115
115
|
res = client.query(gql_query)
|
116
116
|
GHX.logger.debug "Update date field result"
|
117
117
|
GHX.logger.debug res
|
@@ -141,7 +141,7 @@ module GHX
|
|
141
141
|
}
|
142
142
|
GQL
|
143
143
|
|
144
|
-
client =
|
144
|
+
client = GHX.graphql
|
145
145
|
res = client.query(gql_query)
|
146
146
|
GHX.logger.debug "Update single select field result"
|
147
147
|
GHX.logger.debug res.body
|
data/lib/ghx.rb
CHANGED
@@ -41,7 +41,7 @@ module GHX
|
|
41
41
|
# API Key defaults to ENV["GITHUB_TOKEN"]
|
42
42
|
# @return [Octokit::Client]
|
43
43
|
def self.octokit
|
44
|
-
@octokit ||= Octokit::Client.new(access_token:
|
44
|
+
@octokit ||= Octokit::Client.new(access_token: octokit_token)
|
45
45
|
end
|
46
46
|
|
47
47
|
# @param octokit [Octokit::Client]
|
@@ -50,11 +50,21 @@ module GHX
|
|
50
50
|
@octokit = octokit
|
51
51
|
end
|
52
52
|
|
53
|
+
# @return [String] the API Key for the Octokit client
|
54
|
+
def self.octokit_token
|
55
|
+
@octokit_token ||= ENV["GITHUB_TOKEN"]
|
56
|
+
end
|
57
|
+
|
58
|
+
# @param new_token [String] the API Key for the Octokit client
|
59
|
+
def self.octokit_token=(new_token)
|
60
|
+
@octokit_token = new_token
|
61
|
+
end
|
62
|
+
|
53
63
|
# Internal graphql client.
|
54
64
|
# API Key defaults to ENV["GITHUB_TOKEN"]
|
55
65
|
# @return [GHX::GraphqlClient]
|
56
66
|
def self.graphql
|
57
|
-
@graphql ||= GHX::GraphqlClient.new(
|
67
|
+
@graphql ||= GHX::GraphqlClient.new(graphql_token)
|
58
68
|
end
|
59
69
|
|
60
70
|
# @param graphql [GHX::GraphqlClient]
|
@@ -63,11 +73,22 @@ module GHX
|
|
63
73
|
@graphql = graphql
|
64
74
|
end
|
65
75
|
|
76
|
+
# @return [String] the API Key for the GraphQL client
|
77
|
+
def self.graphql_token
|
78
|
+
@graphql_token ||= ENV["GITHUB_GRAPHQL_TOKEN"]
|
79
|
+
end
|
80
|
+
|
81
|
+
# @param new_token [String] the API Key for the GraphQL client
|
82
|
+
# @return [String]
|
83
|
+
def self.graphql_token=(new_token)
|
84
|
+
@graphql_token = new_token
|
85
|
+
end
|
86
|
+
|
66
87
|
# Internal graphql client.
|
67
88
|
# API Key defaults to ENV["GITHUB_TOKEN"]
|
68
89
|
# @return [GHX::RestClient]
|
69
90
|
def self.rest_client
|
70
|
-
@rest_client ||= GHX::RestClient.new(
|
91
|
+
@rest_client ||= GHX::RestClient.new(rest_client_token)
|
71
92
|
end
|
72
93
|
|
73
94
|
# @param rest_client [GHX::RestClient]
|
@@ -75,4 +96,15 @@ module GHX
|
|
75
96
|
def self.rest_client=(rest_client)
|
76
97
|
@rest_client = rest_client
|
77
98
|
end
|
99
|
+
|
100
|
+
# @return [String] the API Key for the REST client
|
101
|
+
def self.rest_client_token
|
102
|
+
@rest_client_token ||= ENV["GITHUB_TOKEN"]
|
103
|
+
end
|
104
|
+
|
105
|
+
# @param new_token [String] the API Key for the REST client
|
106
|
+
# @return [String]
|
107
|
+
def self.rest_client_token=(new_token)
|
108
|
+
@rest_client_token = new_token
|
109
|
+
end
|
78
110
|
end
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ghx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CompanyCam
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|