whatsup_github 0.0.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,12 +1,13 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fileutils'
2
4
  require_relative 'generator'
3
- require_relative 'config-reader'
4
- require_relative 'yaml-formatter'
5
+ require_relative 'config_reader'
6
+ require_relative 'yaml_formatter'
5
7
  require_relative 'table'
6
8
 
7
9
  module WhatsupGithub
8
10
  class Runner
9
-
10
11
  def initialize(date)
11
12
  @generator = Generator.new date
12
13
  @config = Config.instance
@@ -14,13 +15,14 @@ module WhatsupGithub
14
15
  end
15
16
 
16
17
  def run
17
- format = @config.read 'output_format'
18
+ format = @config.output_format
18
19
  raise 'Cannot find "output_format" in config.yml' unless format
20
+
19
21
  table if format.include? 'markdown'
20
22
  data if format.include? 'yaml'
21
23
  end
22
24
 
23
- def write_results file, formatter
25
+ def write_results(file, formatter)
24
26
  formatted_content = @generator.run formatter, @content
25
27
  check_dir_at File.dirname file
26
28
  File.write file, formatted_content
@@ -1,9 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'row_collector'
2
4
 
3
5
  module WhatsupGithub
4
6
  # Table containing Rows
5
7
  class Table
6
-
7
8
  # def initialize(since)
8
9
  # @collector = RowCollector.new(since: since)
9
10
  # end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module WhatsupGithub
2
- VERSION = "0.0.1"
4
+ VERSION = '0.4.0'
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'yaml'
2
4
  module WhatsupGithub
3
5
  # Table containing Rows
@@ -12,9 +14,13 @@ module WhatsupGithub
12
14
  {
13
15
  'description' => object.description,
14
16
  'versions' => object.versions,
15
- 'type' => object.type,
17
+ 'type' => object.type,
16
18
  'date' => object.date,
17
- 'link' => object.link
19
+ 'link' => object.link,
20
+ 'merge_commit' => object.merge_commit,
21
+ 'contributor' => object.author,
22
+ 'membership' => object.membership,
23
+ 'labels' => object.labels
18
24
  }
19
25
  end
20
26
  output =
@@ -1,46 +1,49 @@
1
+ # frozen_string_literal: true
1
2
 
2
- lib = File.expand_path("../lib", __FILE__)
3
+ lib = File.expand_path('lib', __dir__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require "whatsup_github/version"
5
+ require 'whatsup_github/version'
5
6
 
6
7
  Gem::Specification.new do |spec|
7
- spec.name = "whatsup_github"
8
+ spec.name = 'whatsup_github'
8
9
  spec.version = WhatsupGithub::VERSION
9
- spec.authors = ["Dima Shevtsov"]
10
- spec.email = ["shevtsov@adobe.com"]
10
+ spec.authors = ['Dima Shevtsov']
11
+ spec.email = ['shevtsov@adobe.com']
11
12
 
12
- spec.summary = %q{Collect info from GitHub pull requests.}
13
- spec.homepage = "https://github.com/dshevtsov/whatsup_github"
14
- spec.license = "MIT"
13
+ spec.summary = 'Collect info from GitHub pull requests.'
14
+ spec.homepage = 'https://github.com/dshevtsov/whatsup_github'
15
+ spec.license = 'MIT'
15
16
 
16
17
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
17
18
  # to allow pushing to a single host or delete this section to allow pushing to any host.
18
19
  if spec.respond_to?(:metadata)
19
- spec.metadata["homepage_uri"] = spec.homepage
20
- spec.metadata["source_code_uri"] = "https://github.com/dshevtsov/whatsup_github"
21
- spec.metadata["changelog_uri"] = "https://github.com/dshevtsov/whatsup_github/blob/master/CHANGELOG.md"
20
+ spec.metadata['homepage_uri'] = spec.homepage
21
+ spec.metadata['source_code_uri'] = 'https://github.com/dshevtsov/whatsup_github'
22
+ spec.metadata['changelog_uri'] = 'https://github.com/dshevtsov/whatsup_github/blob/master/CHANGELOG.md'
22
23
  else
23
- raise "RubyGems 2.0 or newer is required to protect against " \
24
- "public gem pushes."
24
+ raise 'RubyGems 2.0 or newer is required to protect against ' \
25
+ 'public gem pushes.'
25
26
  end
26
27
 
27
28
  # Specify which files should be added to the gem when it is released.
28
29
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
29
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
30
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
30
31
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
31
32
  end
32
- spec.bindir = "exe"
33
+ spec.bindir = 'exe'
33
34
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
34
- spec.require_paths = ["lib"]
35
-
36
- spec.add_dependency "octokit", "~> 4.14"
37
- spec.add_dependency "thor", "~> 0.20"
38
- spec.add_dependency "netrc", "~> 0.10"
39
-
40
- spec.add_development_dependency "bundler", "~> 1.17"
41
- spec.add_development_dependency "rake", "~> 10.0"
42
- spec.add_development_dependency "rspec", "~> 3.0"
43
- spec.add_development_dependency "cucumber", "~> 3.1"
44
- spec.add_development_dependency "aruba", "~> 0.14"
45
- spec.add_development_dependency "pry", "~> 0.12"
35
+ spec.require_paths = ['lib']
36
+
37
+ spec.required_ruby_version = '>= 2.5.0'
38
+
39
+ spec.add_dependency 'netrc', '~> 0.11'
40
+ spec.add_dependency 'octokit', '~> 4.20'
41
+ spec.add_dependency 'thor', '~> 1.1'
42
+
43
+ spec.add_development_dependency 'aruba', '~> 1.0'
44
+ spec.add_development_dependency 'bundler', '~> 2.2'
45
+ spec.add_development_dependency 'cucumber', '~> 5.3'
46
+ spec.add_development_dependency 'pry', '~> 0.14'
47
+ spec.add_development_dependency 'rake', '~> 13.0'
48
+ spec.add_development_dependency 'rspec', '~> 3.10'
46
49
  end
metadata CHANGED
@@ -1,142 +1,142 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whatsup_github
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dima Shevtsov
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-16 00:00:00.000000000 Z
11
+ date: 2021-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: octokit
14
+ name: netrc
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '4.14'
19
+ version: '0.11'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '4.14'
26
+ version: '0.11'
27
27
  - !ruby/object:Gem::Dependency
28
- name: thor
28
+ name: octokit
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.20'
33
+ version: '4.20'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.20'
40
+ version: '4.20'
41
41
  - !ruby/object:Gem::Dependency
42
- name: netrc
42
+ name: thor
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0.10'
47
+ version: '1.1'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0.10'
54
+ version: '1.1'
55
55
  - !ruby/object:Gem::Dependency
56
- name: bundler
56
+ name: aruba
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.17'
61
+ version: '1.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '1.17'
68
+ version: '1.0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: rake
70
+ name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '10.0'
75
+ version: '2.2'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '10.0'
82
+ version: '2.2'
83
83
  - !ruby/object:Gem::Dependency
84
- name: rspec
84
+ name: cucumber
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '3.0'
89
+ version: '5.3'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '3.0'
96
+ version: '5.3'
97
97
  - !ruby/object:Gem::Dependency
98
- name: cucumber
98
+ name: pry
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '3.1'
103
+ version: '0.14'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '3.1'
110
+ version: '0.14'
111
111
  - !ruby/object:Gem::Dependency
112
- name: aruba
112
+ name: rake
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '0.14'
117
+ version: '13.0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '0.14'
124
+ version: '13.0'
125
125
  - !ruby/object:Gem::Dependency
126
- name: pry
126
+ name: rspec
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '0.12'
131
+ version: '3.10'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: '0.12'
139
- description:
138
+ version: '3.10'
139
+ description:
140
140
  email:
141
141
  - shevtsov@adobe.com
142
142
  executables:
@@ -146,8 +146,8 @@ extra_rdoc_files: []
146
146
  files:
147
147
  - ".gitignore"
148
148
  - ".rspec"
149
+ - ".ruby-version"
149
150
  - ".travis.yml"
150
- - ".whatsnew.yml"
151
151
  - CHANGELOG.md
152
152
  - Gemfile
153
153
  - Gemfile.lock
@@ -160,15 +160,16 @@ files:
160
160
  - lib/template/.whatsup.yml
161
161
  - lib/whatsup_github.rb
162
162
  - lib/whatsup_github/cli.rb
163
- - lib/whatsup_github/config-reader.rb
163
+ - lib/whatsup_github/config_reader.rb
164
164
  - lib/whatsup_github/generator.rb
165
+ - lib/whatsup_github/members.rb
165
166
  - lib/whatsup_github/pulls.rb
166
167
  - lib/whatsup_github/row.rb
167
168
  - lib/whatsup_github/row_collector.rb
168
169
  - lib/whatsup_github/runner.rb
169
170
  - lib/whatsup_github/table.rb
170
171
  - lib/whatsup_github/version.rb
171
- - lib/whatsup_github/yaml-formatter.rb
172
+ - lib/whatsup_github/yaml_formatter.rb
172
173
  - whatsup_github.gemspec
173
174
  homepage: https://github.com/dshevtsov/whatsup_github
174
175
  licenses:
@@ -177,7 +178,7 @@ metadata:
177
178
  homepage_uri: https://github.com/dshevtsov/whatsup_github
178
179
  source_code_uri: https://github.com/dshevtsov/whatsup_github
179
180
  changelog_uri: https://github.com/dshevtsov/whatsup_github/blob/master/CHANGELOG.md
180
- post_install_message:
181
+ post_install_message:
181
182
  rdoc_options: []
182
183
  require_paths:
183
184
  - lib
@@ -185,15 +186,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
185
186
  requirements:
186
187
  - - ">="
187
188
  - !ruby/object:Gem::Version
188
- version: '0'
189
+ version: 2.5.0
189
190
  required_rubygems_version: !ruby/object:Gem::Requirement
190
191
  requirements:
191
192
  - - ">="
192
193
  - !ruby/object:Gem::Version
193
194
  version: '0'
194
195
  requirements: []
195
- rubygems_version: 3.0.3
196
- signing_key:
196
+ rubygems_version: 3.1.4
197
+ signing_key:
197
198
  specification_version: 4
198
199
  summary: Collect info from GitHub pull requests.
199
200
  test_files: []
data/.whatsnew.yml DELETED
@@ -1,17 +0,0 @@
1
- # Name of the base branch in GitHub PRs
2
- base_branch: master
3
-
4
- # Repos for scanning
5
- repos:
6
- - magento/devdocs
7
-
8
- # Labels for filtering
9
- labels:
10
- - New doc
11
- - Major update
12
- - Technical
13
-
14
- # Output format
15
- output_format:
16
- # - markdown
17
- - yaml
@@ -1,29 +0,0 @@
1
- require 'yaml'
2
- require 'singleton'
3
-
4
- module WhatsupGithub
5
- # Creates readable objects from confirurarion files
6
- class Config
7
- attr_reader :config
8
- include Singleton
9
-
10
- def initialize
11
- @file = '.whatsup.yml'
12
- @config = {}
13
- end
14
-
15
- def read(*options)
16
- unless File.exist?(@file)
17
- dist_file = File.expand_path("../template/#{@file}", __dir__)
18
- FileUtils.cp dist_file, @file
19
- end
20
- load_from_yaml.dig options.join ','
21
- end
22
-
23
- def load_from_yaml
24
- @config = YAML.load_file @file
25
- return {} unless @config
26
- @config
27
- end
28
- end
29
- end