ellen-github 0.0.7 → 0.0.8

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
  SHA1:
3
- metadata.gz: daa33cc4af6d0b4ee48e1654b756ed069319848f
4
- data.tar.gz: 88095c9bb697697f93d0d21d3b476294b94bd4ca
3
+ metadata.gz: 95f00c5f502f16cf2abb8e3d8e56834be5b3a479
4
+ data.tar.gz: 7b0a6df18d8a221d3c82460b35616244a5e92b62
5
5
  SHA512:
6
- metadata.gz: 8fc14bf331ffc7ba744022c62991ca917acac305efb1a706d5ec55bebea3112d28f1ab429c4b60080c5d26cc3f1fccc983b7af6e3a8ca0fec9c670f5d170e6cd
7
- data.tar.gz: d5a7784ffc05dfae2b6a84a07c9990c3f1ef3f66d9d4417465bbc990e3415c0446e390b293106b06fc2243e1e42fed7db60b1b329b0be20c9c11ed3682b59a6b
6
+ metadata.gz: 2d27fb505a7df3055f57153931f5c6eb3792e5969bf074779a698ece084cc59eb2c0063dabd53dddce22cec9b881c84e3350205be173ecce7aef68d4bda831d1
7
+ data.tar.gz: 22bc48412bed3748997c76c8be5d060af9676c1b511ca2ab805d880f75ea2c646b80a904ee930a10e0ead41970b8d87b278e6247436c6f3fea7490c46e2a4e98
@@ -1,3 +1,6 @@
1
+ ## 0.0.8
2
+ * Support Github Enterprise
3
+
1
4
  ## 0.0.7
2
5
  * Use Ellen::Message#from_name as user identifier
3
6
 
data/README.md CHANGED
@@ -16,5 +16,10 @@ gem "ellen-github"
16
16
  @ellen remember my github token <token> - Remember sender's GitHub access token
17
17
  ```
18
18
 
19
+ ## ENV
20
+ ```
21
+ GITHUB_HOST - Pass GitHub Host if needed (e.g. github.example.com)
22
+ ```
23
+
19
24
  ## Image
20
25
  ![](https://raw.githubusercontent.com/r7kamura/ellen-github/master/images/screenshot.png)
@@ -33,12 +33,36 @@ module Ellen
33
33
  end
34
34
 
35
35
  def client
36
- Octokit::Client.new(access_token: access_token)
36
+ Octokit::Client.new(client_options)
37
37
  end
38
38
 
39
39
  def repository
40
40
  message[:repo]
41
41
  end
42
+
43
+ def client_options
44
+ client_options_with_nil_value.reject {|key, value| value.nil? }
45
+ end
46
+
47
+ def client_options_with_nil_value
48
+ {
49
+ access_token: access_token,
50
+ api_endpoint: api_endpoint,
51
+ web_endpoint: web_endpoint,
52
+ }
53
+ end
54
+
55
+ def web_endpoint
56
+ "https://#{github_host}/" if github_host
57
+ end
58
+
59
+ def api_endpoint
60
+ "https://#{github_host}/api/v3" if github_host
61
+ end
62
+
63
+ def github_host
64
+ ENV["GITHUB_HOST"]
65
+ end
42
66
  end
43
67
  end
44
68
  end
@@ -1,5 +1,5 @@
1
1
  module Ellen
2
2
  module Github
3
- VERSION = "0.0.7"
3
+ VERSION = "0.0.8"
4
4
  end
5
5
  end
@@ -1,6 +1,8 @@
1
1
  module Ellen
2
2
  module Handlers
3
3
  class Github < Base
4
+ env :GITHUB_HOST, "Pass GitHub Host if needed (e.g. github.example.com)", optional: true
5
+
4
6
  on(
5
7
  /create issue "(?<title>.+)" on (?<repo>.+)(?:\n(?<description>[\s\S]+))?\z/,
6
8
  name: "create_issue",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ellen-github
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura