chronicle-github 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 810f7ec8bdae2b41566f3a49b524fa0532bfe3663f9e0185135503439ec31f61
4
- data.tar.gz: '09ecce50199d63d55c106a08c7d4350a46b2d36db84d7417020e2d2cd4466a07'
3
+ metadata.gz: dd7803ca5b352a64eb72a11f91e8e8cf3ec3ef97937f2121d1c4125fc8e63fab
4
+ data.tar.gz: 522bf8ca8434cf452f1f5e257f0810f634a81911755b2413fa57e97c9668b337
5
5
  SHA512:
6
- metadata.gz: d28c2f2f6fbdd6f10b5c2ad52c5b5eed0f82fd4f302f04c4da72d2a046e3e1be066499990343781994f7e41eae3715c44f1048c618fffb23864457454728afc6
7
- data.tar.gz: 1d47fa00f114802005103ede182b2daf3c4ce1e19609642fa7f1cf623d7b4e4aedf853985a1bb5137ee3002e0db6dee547e45dcd52d3e3172c1fd76e667e47de
6
+ metadata.gz: 883b14384930d4d77fa5bae14e9df3b2b83a84511b35bb37e5cb4e0345b22725c27c22967c4c1b62eafec405bfb5f99b3ffcac0054a6778a1d036aa2d90a21fd
7
+ data.tar.gz: f0056d86f268d915c24308e78db60ceb15ec591baf3596b4eccb11c1d4d658914518e54a0dac6614b7636642e0bad63142a0e7721bf799372d1ad965f40840dc
data/.rubocop.yml ADDED
@@ -0,0 +1,2 @@
1
+ inherit_gem:
2
+ chronicle-core: .rubocop-plugin.yml
data/README.md CHANGED
@@ -22,4 +22,8 @@ $ chronicle-etl secrets:set github access_token FOO123
22
22
 
23
23
  # Extract github events from the last 10 days
24
24
  $ chronicle-etl --extractor github:activity --since 10d
25
+
26
+ # Get all repos starred in the last month
27
+ $ chronicle-etl --extractor github:activity --loader json --since 1mo \
28
+ | jq -r 'select(.type == "WatchEvent") | .repo.name'
25
29
  ```
@@ -1,24 +1,24 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "lib/chronicle/github/version"
3
+ require_relative 'lib/chronicle/github/version'
4
4
 
5
5
  Gem::Specification.new do |spec|
6
- spec.name = "chronicle-github"
6
+ spec.name = 'chronicle-github'
7
7
  spec.version = Chronicle::Github::VERSION
8
- spec.authors = ["Andrew Louis"]
9
- spec.email = ["andrew@hyfen.net"]
8
+ spec.authors = ['Andrew Louis']
9
+ spec.email = ['andrew@hyfen.net']
10
10
 
11
- spec.summary = "Github connectors for Chronicle-ETL"
12
- spec.description = "Extract github user event stream, repository events, and more"
13
- spec.homepage = "https://github.com/chronicle-app/chronicle-github"
14
- spec.required_ruby_version = ">= 2.7.0"
15
- spec.license = "MIT"
11
+ spec.summary = 'Github connectors for Chronicle-ETL'
12
+ spec.description = 'Extract github user event stream, repository events, and more'
13
+ spec.homepage = 'https://github.com/chronicle-app/chronicle-github'
14
+ spec.required_ruby_version = '>= 3.1'
15
+ spec.license = 'MIT'
16
16
 
17
- spec.metadata['allowed_push_host'] = "https://rubygems.org"
17
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
18
18
 
19
- spec.metadata["homepage_uri"] = spec.homepage
20
- spec.metadata["source_code_uri"] = "https://github.com/chronicle-app/chronicle-github"
21
- spec.metadata["changelog_uri"] = "https://github.com/chronicle-app/chronicle-github/releases"
19
+ spec.metadata['homepage_uri'] = spec.homepage
20
+ spec.metadata['source_code_uri'] = 'https://github.com/chronicle-app/chronicle-github'
21
+ spec.metadata['changelog_uri'] = 'https://github.com/chronicle-app/chronicle-github/releases'
22
22
 
23
23
  # Specify which files should be added to the gem when it is released.
24
24
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -27,10 +27,18 @@ Gem::Specification.new do |spec|
27
27
  (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
28
28
  end
29
29
  end
30
- spec.bindir = "exe"
30
+ spec.bindir = 'exe'
31
31
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
32
- spec.require_paths = ["lib"]
32
+ spec.require_paths = ['lib']
33
+ spec.metadata['rubygems_mfa_required'] = 'true'
33
34
 
34
- spec.add_dependency "chronicle-etl", "~> 0.5"
35
- spec.add_dependency "octokit", "~> 4.0"
35
+ spec.add_dependency 'chronicle-core', '~> 0.3'
36
+ spec.add_dependency 'chronicle-etl', '~> 0.6'
37
+ spec.add_dependency 'faraday-retry', '~> 2'
38
+ spec.add_dependency 'octokit', '~> 8.1'
39
+
40
+ spec.add_development_dependency 'bundler', '~> 2.3'
41
+ spec.add_development_dependency 'pry-byebug', '~> 3.10'
42
+ spec.add_development_dependency 'rake', '~> 13.0'
43
+ spec.add_development_dependency 'rubocop', '~> 1.63'
36
44
  end
@@ -5,9 +5,10 @@ module Chronicle
5
5
  module Github
6
6
  class ActivityExtractor < Chronicle::ETL::Extractor
7
7
  register_connector do |r|
8
- r.provider = 'github'
9
- r.description = 'user activity'
10
- r.identifier = 'activity'
8
+ r.source = :github
9
+ r.type = :activity
10
+ r.strategy = :api
11
+ r.description = 'github activity'
11
12
  end
12
13
 
13
14
  setting :access_token, required: true
@@ -18,9 +19,6 @@ module Chronicle
18
19
  @access_token_owner = @client.user
19
20
  end
20
21
 
21
- def results_count
22
- end
23
-
24
22
  def extract
25
23
  events = @client.user_events(username)
26
24
  has_more = events.any?
@@ -34,7 +32,7 @@ module Chronicle
34
32
 
35
33
  events.each do |event|
36
34
  count += 1
37
- yield Chronicle::ETL::Extraction.new(data: event, meta: { user: @user})
35
+ yield build_extraction(data: event, meta: { user: @user })
38
36
  end
39
37
 
40
38
  break unless @client.last_response.rels[:next]
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Chronicle
4
4
  module Github
5
- VERSION = "0.1.0"
5
+ VERSION = '0.2.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,43 +1,127 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chronicle-github
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Louis
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-27 00:00:00.000000000 Z
11
+ date: 2024-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: chronicle-core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.3'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.3'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: chronicle-etl
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
31
  - - "~>"
18
32
  - !ruby/object:Gem::Version
19
- version: '0.5'
33
+ version: '0.6'
20
34
  type: :runtime
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
38
  - - "~>"
25
39
  - !ruby/object:Gem::Version
26
- version: '0.5'
40
+ version: '0.6'
41
+ - !ruby/object:Gem::Dependency
42
+ name: faraday-retry
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '2'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2'
27
55
  - !ruby/object:Gem::Dependency
28
56
  name: octokit
29
57
  requirement: !ruby/object:Gem::Requirement
30
58
  requirements:
31
59
  - - "~>"
32
60
  - !ruby/object:Gem::Version
33
- version: '4.0'
61
+ version: '8.1'
34
62
  type: :runtime
35
63
  prerelease: false
36
64
  version_requirements: !ruby/object:Gem::Requirement
37
65
  requirements:
38
66
  - - "~>"
39
67
  - !ruby/object:Gem::Version
40
- version: '4.0'
68
+ version: '8.1'
69
+ - !ruby/object:Gem::Dependency
70
+ name: bundler
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '2.3'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '2.3'
83
+ - !ruby/object:Gem::Dependency
84
+ name: pry-byebug
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.10'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.10'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rake
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '13.0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '13.0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '1.63'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '1.63'
41
125
  description: Extract github user event stream, repository events, and more
42
126
  email:
43
127
  - andrew@hyfen.net
@@ -45,6 +129,7 @@ executables: []
45
129
  extensions: []
46
130
  extra_rdoc_files: []
47
131
  files:
132
+ - ".rubocop.yml"
48
133
  - CODE_OF_CONDUCT.md
49
134
  - Gemfile
50
135
  - README.md
@@ -61,6 +146,7 @@ metadata:
61
146
  homepage_uri: https://github.com/chronicle-app/chronicle-github
62
147
  source_code_uri: https://github.com/chronicle-app/chronicle-github
63
148
  changelog_uri: https://github.com/chronicle-app/chronicle-github/releases
149
+ rubygems_mfa_required: 'true'
64
150
  post_install_message:
65
151
  rdoc_options: []
66
152
  require_paths:
@@ -69,14 +155,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
69
155
  requirements:
70
156
  - - ">="
71
157
  - !ruby/object:Gem::Version
72
- version: 2.7.0
158
+ version: '3.1'
73
159
  required_rubygems_version: !ruby/object:Gem::Requirement
74
160
  requirements:
75
161
  - - ">="
76
162
  - !ruby/object:Gem::Version
77
163
  version: '0'
78
164
  requirements: []
79
- rubygems_version: 3.3.3
165
+ rubygems_version: 3.4.10
80
166
  signing_key:
81
167
  specification_version: 4
82
168
  summary: Github connectors for Chronicle-ETL