danger-yajp 1.0.1 → 1.0.3

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
  SHA256:
3
- metadata.gz: 2868f707abb91adf4aac75dbc2c882083fdee0851e7abb37fc90b939ae7c944e
4
- data.tar.gz: fce1af4f4cd6cfa8fb3b0be1f36d5d507f86b8d43a45c78203078a2120572c65
3
+ metadata.gz: be2734f0b1913daffe2d4a199f0b2e285dfced1f0fa8e9a3af1f08586e8cda32
4
+ data.tar.gz: 10a973e093f80980d4f754c1042e5c43341d2418a52b9b39d3c8188ad614dc69
5
5
  SHA512:
6
- metadata.gz: edc00b2e66a419e4408f36b3238dc57e59189a0ad63eabaf2d3a13be41f0da26041313ffc4b050118b19ab014324ef6b360f3ee4ee11f29fc5adb64870044df3
7
- data.tar.gz: 2e5273d151a6b9ced079a5b2dabbbf5e370a04a7250232f76095aeb3c2942a8d49c97b46669079d5c9019aa6cb388dc8dc22139ce620011c83e153246071e7dd
6
+ metadata.gz: c5e9cdd87fcd59815a23b45a387fa8882e3dbdfead08db06f8131508449429adb3275cc672320a3af68bf1ff2da6b39c294ed44c5e9674eadb9a7b2c1906ae22
7
+ data.tar.gz: 338712d8c31aa30f6a37fe81988fb77fc28492653b4ba9da8a7cc872b157aaa1e9651f2723faa4059719d7ecdd22ed3435fc5529d8bc44b855ac08248f5e3ebb
@@ -2,22 +2,22 @@ name: Create release
2
2
 
3
3
  on:
4
4
  push:
5
- branches: main
5
+ branches: [main]
6
6
 
7
7
  jobs:
8
8
  build:
9
9
  name: Retrieve version + create release
10
10
  runs-on: ubuntu-latest
11
-
11
+
12
12
  steps:
13
- - uses: actions/checkout@v2
13
+ - uses: actions/checkout@v5
14
14
  with:
15
15
  fetch-depth: 0
16
-
17
- - name: Set up Ruby 2.6
18
- uses: actions/setup-ruby@v1
16
+
17
+ - name: Set up Ruby
18
+ uses: ruby/setup-ruby@v1
19
19
  with:
20
- ruby-version: 2.6.x
20
+ ruby-version: '3.4'
21
21
 
22
22
  - name: Retrieve version
23
23
  id: version
@@ -25,15 +25,12 @@ jobs:
25
25
  version=$(ruby -e 'require "./lib/yajp/gem_version.rb"' -e 'puts Yajp::VERSION')
26
26
  echo "TAG_NAME=$version" >> $GITHUB_ENV
27
27
  latest_tag=$(git describe --tags --abbrev=0)
28
- echo 'VERSION_DESCRIPTION<<EOF' >> $GITHUB_ENV
29
- git log --pretty='format:%h %s' ${latest_tag}..HEAD >> $GITHUB_ENV
30
- echo $'\nEOF' >> $GITHUB_ENV
28
+ git log --pretty='format:%h %s' ${latest_tag}..HEAD > release_notes.txt
31
29
 
32
30
  - name: Create release
33
- uses: actions/create-release@v1
34
31
  env:
35
32
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36
- with:
37
- tag_name: ${{ env.TAG_NAME }}
38
- release_name: v${{ env.TAG_NAME }}
39
- body: ${{ env.VERSION_DESCRIPTION }}
33
+ run: |
34
+ gh release create "${{ env.TAG_NAME }}" \
35
+ --title "v${{ env.TAG_NAME }}" \
36
+ --notes-file release_notes.txt
@@ -2,7 +2,7 @@ name: Ruby Gem
2
2
 
3
3
  on:
4
4
  push:
5
- branches: main
5
+ branches: [main]
6
6
 
7
7
  jobs:
8
8
  build:
@@ -10,13 +10,18 @@ jobs:
10
10
  runs-on: ubuntu-latest
11
11
 
12
12
  steps:
13
- - uses: actions/checkout@v2
14
- - name: Set up Ruby 2.6
15
- uses: actions/setup-ruby@v1
13
+ - uses: actions/checkout@v5
14
+ - name: Set up Ruby
15
+ uses: ruby/setup-ruby@v1
16
16
  with:
17
- ruby-version: 2.6.x
17
+ ruby-version: '3.4'
18
+ bundler-cache: true
19
+
20
+ - name: Run tests
21
+ run: bundle exec rake spec
18
22
 
19
23
  - name: Publish to GPR
24
+ continue-on-error: true
20
25
  run: |
21
26
  mkdir -p $HOME/.gem
22
27
  touch $HOME/.gem/credentials
data/.gitignore CHANGED
@@ -68,3 +68,9 @@ yarn-debug.log*
68
68
 
69
69
  # Ignore docs file
70
70
  .yardoc
71
+
72
+ # Ignore bundler binstubs
73
+ /bin
74
+
75
+ # Claude config
76
+ /.claude
data/.rubocop.yml CHANGED
@@ -2,9 +2,14 @@
2
2
 
3
3
  # If you don't like these settings, just delete this file :)
4
4
 
5
+ plugins:
6
+ - rubocop-rake
7
+ - rubocop-rspec
8
+
5
9
  AllCops:
6
- TargetRubyVersion: 2.6
10
+ TargetRubyVersion: 3.0
7
11
  NewCops: enable
12
+ SuggestExtensions: false
8
13
 
9
14
  Style/StringLiterals:
10
15
  EnforcedStyle: single_quotes
@@ -19,14 +24,14 @@ Lint/UselessAssignment:
19
24
  Exclude:
20
25
  - '**/spec/**/*'
21
26
 
22
- # We could potentially enable the 2 below:
27
+ # Aligned hash values are used throughout the codebase for readability
23
28
  Layout/FirstHashElementIndentation:
24
29
  Enabled: false
25
30
 
26
31
  Layout/HashAlignment:
27
32
  Enabled: false
28
33
 
29
- # HoundCI doesn't like this rule
34
+ # Codebase uses trailing-dot style for multiline method chains
30
35
  Layout/DotPosition:
31
36
  Enabled: false
32
37
 
@@ -99,7 +104,7 @@ Style/RedundantSelf:
99
104
  Metrics/MethodLength:
100
105
  Max: 60
101
106
 
102
- # We're not there yet
107
+ # Public API is documented via YARD; inline class/module docs are not enforced
103
108
  Style/Documentation:
104
109
  Enabled: false
105
110
 
@@ -115,7 +120,6 @@ Style/BlockComments:
115
120
  Layout/MultilineMethodCallIndentation:
116
121
  EnforcedStyle: indented
117
122
 
118
- # FIXME: 25
119
123
  Metrics/BlockLength:
120
124
  Max: 345
121
125
  Exclude:
@@ -131,7 +135,7 @@ Layout/HeredocIndentation:
131
135
  Enabled: false
132
136
 
133
137
  Style/SpecialGlobalVars:
134
- Enabled: false
138
+ Enabled: true
135
139
 
136
140
  Style/PercentLiteralDelimiters:
137
141
  PreferredDelimiters:
@@ -147,3 +151,25 @@ Style/PercentLiteralDelimiters:
147
151
 
148
152
  Security/YAMLLoad:
149
153
  Enabled: false
154
+
155
+ # RSpec cops
156
+ # Danger's plugin API requires stubbing chained methods (e.g. github.pr_title)
157
+ RSpec/MessageChain:
158
+ Enabled: false
159
+
160
+ # JIRA::Client and JIRA::Base don't expose test-friendly interfaces
161
+ RSpec/AnyInstance:
162
+ Enabled: false
163
+
164
+ # Integration-style tests for an API plugin are inherently longer
165
+ RSpec/ExampleLength:
166
+ Max: 15
167
+
168
+ # Verifying stub + result expectation is the accepted pattern here
169
+ RSpec/MultipleExpectations:
170
+ Max: 2
171
+
172
+ # Guard output in spec_helper is intentional (exits early without a git remote)
173
+ RSpec/Output:
174
+ Exclude:
175
+ - 'spec/spec_helper.rb'
data/Gemfile.lock CHANGED
@@ -1,70 +1,90 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- danger-yajp (1.0.0)
4
+ danger-yajp (1.0.3)
5
5
  danger-plugin-api
6
6
  jira-ruby
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activesupport (6.1.3.1)
12
- concurrent-ruby (~> 1.0, >= 1.0.2)
11
+ activesupport (8.1.2)
12
+ base64
13
+ bigdecimal
14
+ concurrent-ruby (~> 1.0, >= 1.3.1)
15
+ connection_pool (>= 2.2.5)
16
+ drb
13
17
  i18n (>= 1.6, < 2)
18
+ json
19
+ logger (>= 1.4.2)
14
20
  minitest (>= 5.1)
15
- tzinfo (~> 2.0)
16
- zeitwerk (~> 2.3)
17
- addressable (2.7.0)
18
- public_suffix (>= 2.0.2, < 5.0)
19
- ast (2.4.2)
20
- atlassian-jwt (0.2.0)
21
- jwt (~> 2.1.0)
22
- claide (1.0.3)
21
+ securerandom (>= 0.3)
22
+ tzinfo (~> 2.0, >= 2.0.5)
23
+ uri (>= 0.13.1)
24
+ addressable (2.8.9)
25
+ public_suffix (>= 2.0.2, < 8.0)
26
+ ast (2.4.3)
27
+ atlassian-jwt (0.2.1)
28
+ jwt (~> 2.1)
29
+ base64 (0.3.0)
30
+ bigdecimal (4.0.1)
31
+ cgi (0.5.1)
32
+ claide (1.1.0)
23
33
  claide-plugins (0.9.2)
24
34
  cork
25
35
  nap
26
36
  open4 (~> 1.3)
27
37
  coderay (1.1.3)
28
38
  colored2 (3.1.2)
29
- concurrent-ruby (1.1.8)
39
+ concurrent-ruby (1.3.6)
40
+ connection_pool (3.0.2)
30
41
  cork (0.3.0)
31
42
  colored2 (~> 3.1)
32
- crack (0.4.5)
43
+ crack (1.0.1)
44
+ bigdecimal
33
45
  rexml
34
- danger (8.2.3)
46
+ danger (9.5.3)
47
+ base64 (~> 0.2)
35
48
  claide (~> 1.0)
36
49
  claide-plugins (>= 0.9.2)
37
- colored2 (~> 3.1)
50
+ colored2 (>= 3.1, < 5)
38
51
  cork (~> 0.1)
39
- faraday (>= 0.9.0, < 2.0)
52
+ faraday (>= 0.9.0, < 3.0)
40
53
  faraday-http-cache (~> 2.0)
41
- git (~> 1.7)
42
- kramdown (~> 2.3)
54
+ git (>= 1.13, < 3.0)
55
+ kramdown (>= 2.5.1, < 3.0)
43
56
  kramdown-parser-gfm (~> 1.0)
44
- no_proxy_fix
45
- octokit (~> 4.7)
46
- terminal-table (>= 1, < 4)
57
+ octokit (>= 4.0)
58
+ pstore (~> 0.1)
59
+ terminal-table (>= 1, < 5)
47
60
  danger-plugin-api (1.0.0)
48
61
  danger (> 2.0)
49
- diff-lcs (1.4.4)
50
- faraday (1.3.0)
51
- faraday-net_http (~> 1.0)
52
- multipart-post (>= 1.2, < 3)
53
- ruby2_keywords
54
- faraday-http-cache (2.2.0)
62
+ diff-lcs (1.6.2)
63
+ drb (2.2.3)
64
+ faraday (2.14.1)
65
+ faraday-net_http (>= 2.0, < 3.5)
66
+ json
67
+ logger
68
+ faraday-http-cache (2.6.1)
55
69
  faraday (>= 0.8)
56
- faraday-net_http (1.0.1)
57
- ffi (1.15.0-x64-mingw32)
58
- formatador (0.2.5)
59
- git (1.8.1)
70
+ faraday-net_http (3.4.2)
71
+ net-http (~> 0.5)
72
+ ffi (1.17.3)
73
+ formatador (1.2.3)
74
+ reline
75
+ git (2.3.3)
76
+ activesupport (>= 5.0)
77
+ addressable (~> 2.8)
78
+ process_executer (~> 1.1)
60
79
  rchardet (~> 1.8)
61
- guard (2.16.2)
80
+ guard (2.20.1)
62
81
  formatador (>= 0.2.4)
63
82
  listen (>= 2.7, < 4.0)
83
+ logger (~> 1.6)
64
84
  lumberjack (>= 1.0.12, < 2.0)
65
85
  nenv (~> 0.1)
66
86
  notiffany (~> 0.0)
67
- pry (>= 0.9.12)
87
+ pry (>= 0.13.0)
68
88
  shellany (~> 0.0)
69
89
  thor (>= 0.18.1)
70
90
  guard-compat (1.2.1)
@@ -72,96 +92,146 @@ GEM
72
92
  guard (~> 2.1)
73
93
  guard-compat (~> 1.1)
74
94
  rspec (>= 2.99.0, < 4.0)
75
- hashdiff (1.0.1)
76
- i18n (1.8.10)
95
+ hashdiff (1.2.1)
96
+ hashie (5.1.0)
97
+ logger
98
+ i18n (1.14.8)
77
99
  concurrent-ruby (~> 1.0)
78
- jira-ruby (2.1.5)
100
+ io-console (0.8.2)
101
+ jira-ruby (3.1.0)
79
102
  activesupport
80
103
  atlassian-jwt
104
+ cgi
81
105
  multipart-post
82
- oauth (~> 0.5, >= 0.5.0)
83
- jwt (2.1.0)
84
- kramdown (2.3.1)
85
- rexml
106
+ oauth (~> 1.0)
107
+ json (2.19.1)
108
+ json-schema (6.2.0)
109
+ addressable (~> 2.8)
110
+ bigdecimal (>= 3.1, < 5)
111
+ jwt (2.10.2)
112
+ base64
113
+ kramdown (2.5.2)
114
+ rexml (>= 3.4.4)
86
115
  kramdown-parser-gfm (1.1.0)
87
116
  kramdown (~> 2.0)
88
- listen (3.5.1)
117
+ language_server-protocol (3.17.0.5)
118
+ lint_roller (1.1.0)
119
+ listen (3.10.0)
120
+ logger
89
121
  rb-fsevent (~> 0.10, >= 0.10.3)
90
122
  rb-inotify (~> 0.9, >= 0.9.10)
91
- lumberjack (1.2.8)
92
- method_source (1.0.0)
93
- minitest (5.14.4)
94
- multipart-post (2.1.1)
123
+ logger (1.7.0)
124
+ lumberjack (1.4.2)
125
+ mcp (0.8.0)
126
+ json-schema (>= 4.1)
127
+ method_source (1.1.0)
128
+ minitest (6.0.2)
129
+ drb (~> 2.0)
130
+ prism (~> 1.5)
131
+ multipart-post (2.4.1)
95
132
  nap (1.1.0)
96
133
  nenv (0.3.0)
97
- no_proxy_fix (0.1.2)
134
+ net-http (0.9.1)
135
+ uri (>= 0.11.1)
98
136
  notiffany (0.1.3)
99
137
  nenv (~> 0.1)
100
138
  shellany (~> 0.0)
101
- oauth (0.5.6)
102
- octokit (4.20.0)
103
- faraday (>= 0.9)
104
- sawyer (~> 0.8.0, >= 0.5.3)
139
+ oauth (1.1.3)
140
+ base64 (~> 0.1)
141
+ oauth-tty (~> 1.0, >= 1.0.6)
142
+ snaky_hash (~> 2.0)
143
+ version_gem (~> 1.1, >= 1.1.9)
144
+ oauth-tty (1.0.6)
145
+ version_gem (~> 1.1, >= 1.1.9)
146
+ octokit (10.0.0)
147
+ faraday (>= 1, < 3)
148
+ sawyer (~> 0.9)
105
149
  open4 (1.3.4)
106
- parallel (1.20.1)
107
- parser (3.0.1.0)
150
+ parallel (1.27.0)
151
+ parser (3.3.10.2)
108
152
  ast (~> 2.4.1)
109
- pry (0.14.0)
153
+ racc
154
+ prism (1.9.0)
155
+ process_executer (1.3.0)
156
+ pry (0.16.0)
110
157
  coderay (~> 1.1)
111
158
  method_source (~> 1.0)
112
- public_suffix (4.0.6)
113
- rainbow (3.0.0)
114
- rake (13.0.3)
115
- rb-fsevent (0.10.4)
116
- rb-inotify (0.10.1)
159
+ reline (>= 0.6.0)
160
+ pstore (0.2.1)
161
+ public_suffix (7.0.5)
162
+ racc (1.8.1)
163
+ rainbow (3.1.1)
164
+ rake (13.3.1)
165
+ rb-fsevent (0.11.2)
166
+ rb-inotify (0.11.1)
117
167
  ffi (~> 1.0)
118
- rchardet (1.8.0)
119
- regexp_parser (2.1.1)
120
- rexml (3.2.5)
121
- rspec (3.10.0)
122
- rspec-core (~> 3.10.0)
123
- rspec-expectations (~> 3.10.0)
124
- rspec-mocks (~> 3.10.0)
125
- rspec-core (3.10.1)
126
- rspec-support (~> 3.10.0)
127
- rspec-expectations (3.10.1)
168
+ rchardet (1.10.0)
169
+ regexp_parser (2.11.3)
170
+ reline (0.6.3)
171
+ io-console (~> 0.5)
172
+ rexml (3.4.4)
173
+ rspec (3.13.2)
174
+ rspec-core (~> 3.13.0)
175
+ rspec-expectations (~> 3.13.0)
176
+ rspec-mocks (~> 3.13.0)
177
+ rspec-core (3.13.6)
178
+ rspec-support (~> 3.13.0)
179
+ rspec-expectations (3.13.5)
128
180
  diff-lcs (>= 1.2.0, < 2.0)
129
- rspec-support (~> 3.10.0)
130
- rspec-mocks (3.10.2)
181
+ rspec-support (~> 3.13.0)
182
+ rspec-mocks (3.13.8)
131
183
  diff-lcs (>= 1.2.0, < 2.0)
132
- rspec-support (~> 3.10.0)
133
- rspec-support (3.10.2)
134
- rubocop (1.12.1)
184
+ rspec-support (~> 3.13.0)
185
+ rspec-support (3.13.7)
186
+ rubocop (1.85.1)
187
+ json (~> 2.3)
188
+ language_server-protocol (~> 3.17.0.2)
189
+ lint_roller (~> 1.1.0)
190
+ mcp (~> 0.6)
135
191
  parallel (~> 1.10)
136
- parser (>= 3.0.0.0)
192
+ parser (>= 3.3.0.2)
137
193
  rainbow (>= 2.2.2, < 4.0)
138
- regexp_parser (>= 1.8, < 3.0)
139
- rexml
140
- rubocop-ast (>= 1.2.0, < 2.0)
194
+ regexp_parser (>= 2.9.3, < 3.0)
195
+ rubocop-ast (>= 1.49.0, < 2.0)
141
196
  ruby-progressbar (~> 1.7)
142
- unicode-display_width (>= 1.4.0, < 3.0)
143
- rubocop-ast (1.4.1)
144
- parser (>= 2.7.1.5)
145
- ruby-progressbar (1.11.0)
146
- ruby2_keywords (0.0.4)
147
- sawyer (0.8.2)
197
+ unicode-display_width (>= 2.4.0, < 4.0)
198
+ rubocop-ast (1.49.1)
199
+ parser (>= 3.3.7.2)
200
+ prism (~> 1.7)
201
+ rubocop-rake (0.7.1)
202
+ lint_roller (~> 1.1)
203
+ rubocop (>= 1.72.1)
204
+ rubocop-rspec (3.9.0)
205
+ lint_roller (~> 1.1)
206
+ rubocop (~> 1.81)
207
+ ruby-progressbar (1.13.0)
208
+ sawyer (0.9.3)
148
209
  addressable (>= 2.3.5)
149
- faraday (> 0.8, < 2.0)
210
+ faraday (>= 0.17.3, < 3)
211
+ securerandom (0.4.1)
150
212
  shellany (0.0.1)
151
- terminal-table (1.6.0)
152
- thor (1.1.0)
153
- tzinfo (2.0.4)
213
+ snaky_hash (2.0.3)
214
+ hashie (>= 0.1.0, < 6)
215
+ version_gem (>= 1.1.8, < 3)
216
+ terminal-table (4.0.0)
217
+ unicode-display_width (>= 1.1.1, < 4)
218
+ thor (1.5.0)
219
+ tzinfo (2.0.6)
154
220
  concurrent-ruby (~> 1.0)
155
- unicode-display_width (2.0.0)
156
- webmock (3.12.2)
157
- addressable (>= 2.3.6)
221
+ unicode-display_width (3.2.0)
222
+ unicode-emoji (~> 4.1)
223
+ unicode-emoji (4.2.0)
224
+ uri (1.1.1)
225
+ version_gem (1.1.9)
226
+ webmock (3.26.1)
227
+ addressable (>= 2.8.0)
158
228
  crack (>= 0.3.2)
159
229
  hashdiff (>= 0.4.0, < 2.0.0)
160
- yard (0.9.26)
161
- zeitwerk (2.4.2)
230
+ yard (0.9.38)
162
231
 
163
232
  PLATFORMS
164
- x64-mingw32
233
+ x64-mingw-ucrt
234
+ x86_64-linux
165
235
 
166
236
  DEPENDENCIES
167
237
  bundler
@@ -172,8 +242,10 @@ DEPENDENCIES
172
242
  rake (~> 13.0)
173
243
  rspec (~> 3)
174
244
  rubocop (~> 1)
245
+ rubocop-rake (~> 0)
246
+ rubocop-rspec (~> 3)
175
247
  webmock (~> 3)
176
248
  yard (~> 0.9)
177
249
 
178
250
  BUNDLED WITH
179
- 2.2.3
251
+ 4.0.8
data/Rakefile CHANGED
@@ -21,5 +21,5 @@ end
21
21
 
22
22
  desc 'Ensure that the plugin passes `danger plugins lint`'
23
23
  task :spec_docs do
24
- sh 'bundle exec danger plugins lint'
24
+ sh RbConfig.ruby, Gem.bin_path('danger', 'danger'), 'plugins', 'lint'
25
25
  end
data/danger-yajp.gemspec CHANGED
@@ -1,8 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path('lib', __dir__)
4
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require 'yajp/gem_version'
3
+ require_relative 'lib/yajp/gem_version'
6
4
 
7
5
  Gem::Specification.new do |spec|
8
6
  spec.name = 'danger-yajp'
@@ -14,12 +12,16 @@ Gem::Specification.new do |spec|
14
12
  spec.homepage = 'https://github.com/juliendms/danger-yajp'
15
13
  spec.license = 'MIT'
16
14
 
17
- spec.files = `git ls-files`.split($/)
18
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
15
+ spec.metadata = {
16
+ 'homepage_uri' => spec.homepage,
17
+ 'source_code_uri' => spec.homepage,
18
+ 'rubygems_mfa_required' => 'true'
19
+ }
20
+
21
+ spec.files = `git ls-files`.split("\n")
20
22
  spec.require_paths = ['lib']
21
23
 
22
- spec.required_ruby_version = '>= 2.6.0'
24
+ spec.required_ruby_version = '>= 3.0.0'
23
25
 
24
26
  spec.add_runtime_dependency 'danger-plugin-api'
25
27
  spec.add_runtime_dependency 'jira-ruby'
@@ -34,6 +36,8 @@ Gem::Specification.new do |spec|
34
36
 
35
37
  # Linting code and docs
36
38
  spec.add_development_dependency 'rubocop', '~> 1'
39
+ spec.add_development_dependency 'rubocop-rake', '~> 0'
40
+ spec.add_development_dependency 'rubocop-rspec', '~> 3'
37
41
  spec.add_development_dependency 'yard', '~> 0.9'
38
42
 
39
43
  # Makes testing easy via `bundle exec guard`
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Yajp
4
- VERSION = '1.0.1'
4
+ VERSION = '1.0.3'
5
5
  end
data/lib/yajp/issue.rb CHANGED
@@ -11,7 +11,7 @@ module Danger
11
11
  # @return [String] the URL of the issue
12
12
  #
13
13
  def link
14
- "#{ENV['DANGER_JIRA_URL']}/browse/#{key}"
14
+ "#{ENV.fetch('DANGER_JIRA_URL', nil)}/browse/#{key}"
15
15
  end
16
16
 
17
17
  # Update the issue.
data/lib/yajp/plugin.rb CHANGED
@@ -45,12 +45,12 @@ module Danger
45
45
  def initialize(dangerfile)
46
46
  throw Error('The environment variable DANGER_JIRA_URL is required') if ENV['DANGER_JIRA_URL'].nil?
47
47
 
48
- super(dangerfile)
49
- url_parser = %r{(?<site>https?://[^/]+)(?<context_path>/.+)}.match(ENV['DANGER_JIRA_URL'])
48
+ super
49
+ url_parser = %r{(?<site>https?://[^/]+)(?<context_path>/.+)}.match(ENV.fetch('DANGER_JIRA_URL', nil))
50
50
 
51
51
  options = {
52
- username: ENV['DANGER_JIRA_USER'],
53
- password: ENV['DANGER_JIRA_API_TOKEN'],
52
+ username: ENV.fetch('DANGER_JIRA_USER', nil),
53
+ password: ENV.fetch('DANGER_JIRA_API_TOKEN', nil),
54
54
  site: url_parser[:site],
55
55
  context_path: url_parser[:context_path],
56
56
  auth_type: :basic
data/spec/spec_helper.rb CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  require 'pathname'
4
4
  ROOT = Pathname.new(File.expand_path('..', __dir__))
5
- $:.unshift("#{ROOT}lib".to_s)
6
- $:.unshift("#{ROOT}spec".to_s)
5
+ $LOAD_PATH.unshift("#{ROOT}lib")
6
+ $LOAD_PATH.unshift("#{ROOT}spec")
7
7
 
8
8
  require 'bundler/setup'
9
9
  require 'pry'
@@ -34,7 +34,6 @@ require 'danger_plugin'
34
34
  # it comes with an extra function `.string` which will
35
35
  # strip all ANSI colours from the string.
36
36
 
37
- # rubocop:disable Lint/NestedMethodDefinition
38
37
  def testing_ui
39
38
  @output = StringIO.new
40
39
  def @output.winsize
@@ -47,7 +46,6 @@ def testing_ui
47
46
  end
48
47
  cork
49
48
  end
50
- # rubocop:enable Lint/NestedMethodDefinition
51
49
 
52
50
  # Example environment (ENV) that would come from
53
51
  # running a PR on TravisCI
data/spec/yajp_spec.rb CHANGED
@@ -11,8 +11,8 @@ module Danger
11
11
  ENV['DANGER_JIRA_PASSWORD'] = 'password'
12
12
  end
13
13
 
14
- it 'should be a plugin' do
15
- expect(Danger::DangerYajp.new(nil)).to be_a Danger::Plugin
14
+ it 'is a plugin' do
15
+ expect(described_class.new(nil)).to be_a Danger::Plugin
16
16
  end
17
17
 
18
18
  describe 'with Dangerfile' do
@@ -20,10 +20,10 @@ module Danger
20
20
  let(:plugin) { dangerfile.jira }
21
21
 
22
22
  before do
23
- DangerYajp.send(:public, *DangerYajp.private_instance_methods)
23
+ described_class.send(:public, *described_class.private_instance_methods)
24
24
  end
25
25
 
26
- it 'should return a JIRA::Client instance' do
26
+ it 'returns a JIRA::Client instance' do
27
27
  expect(plugin.api).to be_a(JIRA::Client)
28
28
  end
29
29
 
@@ -77,14 +77,14 @@ module Danger
77
77
  # rubocop:disable Naming/VariableNumber
78
78
  it 'can split transition field from other fields' do
79
79
  json = File.read("#{File.dirname(__FILE__)}/support/transitions.all.json")
80
- url = "#{ENV['DANGER_JIRA_URL']}/rest/api/2/issue/WEB-130/transitions"
80
+ url = "#{ENV.fetch('DANGER_JIRA_URL', nil)}/rest/api/2/issue/WEB-130/transitions"
81
81
  transition_data = { assignee: { name: 'username' }, summary: 'new_summary' }
82
82
  fields = { colour: 'red', customfield_11005: 'example' }
83
83
 
84
84
  allow_any_instance_of(JIRA::Base).to receive(:self).and_return(url)
85
85
  stub = stub_request(:get, "#{url}/transitions?expand=transitions.fields").
86
86
  to_return(body: json)
87
- result = plugin.split_transition_fields(plugin.api.Issue.build, 2, **transition_data.merge(fields))
87
+ result = plugin.split_transition_fields(plugin.api.Issue.build, 2, **transition_data, **fields)
88
88
 
89
89
  expect(stub).to have_been_requested.once
90
90
  expect(result).to eq({ transition_fields: transition_data, other_fields: fields })
@@ -93,7 +93,7 @@ module Danger
93
93
  it 'can transition an issue' do
94
94
  expected_json = '{"transition":{"id":"2"},"fields":{"assignee":{"name":"username"},"customfield_11005":"example"}}'
95
95
  issue_id = Random.rand(1000)
96
- url = "#{ENV['DANGER_JIRA_URL']}/rest/api/2/issue/#{issue_id}/transitions"
96
+ url = "#{ENV.fetch('DANGER_JIRA_URL', nil)}/rest/api/2/issue/#{issue_id}/transitions"
97
97
  issue = plugin.api.Issue.build({ 'id' => issue_id, 'key' => 'WEB-131' })
98
98
  transition_1 = issue.transitions.build({ 'id' => '2', 'name' => 'TEST' })
99
99
  transition_2 = issue.transitions.build({ 'id' => '3', 'name' => 'FAKE' })
@@ -109,9 +109,9 @@ module Danger
109
109
 
110
110
  it 'can update issues' do
111
111
  expected_json = '{"fields":{"assignee":{"name":"username"},"customfield_11005":"example"}}'
112
- uri_template = Addressable::Template.new "#{ENV['DANGER_JIRA_URL']}/rest/api/2/issue/{issue}"
113
- issue1 = plugin.api.Issue.build({ 'id' => Random.rand(1000), 'self' => "#{ENV['DANGER_JIRA_URL']}/rest/api/2/issue/WEB-132", 'key' => 'WEB-132' })
114
- issue2 = plugin.api.Issue.build({ 'id' => Random.rand(1000), 'self' => "#{ENV['DANGER_JIRA_URL']}/rest/api/2/issue/WEB-133", 'key' => 'WEB-133' })
112
+ uri_template = Addressable::Template.new "#{ENV.fetch('DANGER_JIRA_URL', nil)}/rest/api/2/issue/{issue}"
113
+ issue1 = plugin.api.Issue.build({ 'id' => Random.rand(1000), 'self' => "#{ENV.fetch('DANGER_JIRA_URL', nil)}/rest/api/2/issue/WEB-132", 'key' => 'WEB-132' })
114
+ issue2 = plugin.api.Issue.build({ 'id' => Random.rand(1000), 'self' => "#{ENV.fetch('DANGER_JIRA_URL', nil)}/rest/api/2/issue/WEB-133", 'key' => 'WEB-133' })
115
115
 
116
116
  stub = stub_request(:put, uri_template).
117
117
  with(body: expected_json)
@@ -125,13 +125,12 @@ module Danger
125
125
  it 'can add remote link' do
126
126
  pr_title = 'PR Title'
127
127
  pr_json = { 'html_url' => 'https://github.com/test/pull/1234' }
128
- url = "#{ENV['DANGER_JIRA_URL']}/rest/api/2/issue/WEB-134/remotelink"
128
+ url = "#{ENV.fetch('DANGER_JIRA_URL', nil)}/rest/api/2/issue/WEB-134/remotelink"
129
129
  json = File.read("#{File.dirname(__FILE__)}/support/remotelink.json")
130
130
  issue = plugin.api.Issue.build
131
131
 
132
132
  allow(issue).to receive(:key_value).and_return('WEB-134')
133
- allow(dangerfile.github).to receive(:pr_json).and_return(pr_json)
134
- allow(dangerfile.github).to receive(:pr_title).and_return(pr_title)
133
+ allow(dangerfile.github).to receive_messages(pr_json: pr_json, pr_title: pr_title)
135
134
 
136
135
  stub = stub_request(:post, url).
137
136
  with(body: json)
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-yajp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - juliendms
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2021-04-09 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: danger-plugin-api
@@ -108,6 +107,34 @@ dependencies:
108
107
  - - "~>"
109
108
  - !ruby/object:Gem::Version
110
109
  version: '1'
110
+ - !ruby/object:Gem::Dependency
111
+ name: rubocop-rake
112
+ requirement: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "~>"
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ type: :development
118
+ prerelease: false
119
+ version_requirements: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - "~>"
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
124
+ - !ruby/object:Gem::Dependency
125
+ name: rubocop-rspec
126
+ requirement: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - "~>"
129
+ - !ruby/object:Gem::Version
130
+ version: '3'
131
+ type: :development
132
+ prerelease: false
133
+ version_requirements: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - "~>"
136
+ - !ruby/object:Gem::Version
137
+ version: '3'
111
138
  - !ruby/object:Gem::Dependency
112
139
  name: yard
113
140
  requirement: !ruby/object:Gem::Requirement
@@ -195,8 +222,10 @@ files:
195
222
  homepage: https://github.com/juliendms/danger-yajp
196
223
  licenses:
197
224
  - MIT
198
- metadata: {}
199
- post_install_message:
225
+ metadata:
226
+ homepage_uri: https://github.com/juliendms/danger-yajp
227
+ source_code_uri: https://github.com/juliendms/danger-yajp
228
+ rubygems_mfa_required: 'true'
200
229
  rdoc_options: []
201
230
  require_paths:
202
231
  - lib
@@ -204,20 +233,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
204
233
  requirements:
205
234
  - - ">="
206
235
  - !ruby/object:Gem::Version
207
- version: 2.6.0
236
+ version: 3.0.0
208
237
  required_rubygems_version: !ruby/object:Gem::Requirement
209
238
  requirements:
210
239
  - - ">="
211
240
  - !ruby/object:Gem::Version
212
241
  version: '0'
213
242
  requirements: []
214
- rubygems_version: 3.0.3
215
- signing_key:
243
+ rubygems_version: 3.6.9
216
244
  specification_version: 4
217
245
  summary: Yet Another Jira Plugin is a danger plugin to find issues, access their parameters
218
246
  and perform operations on them.
219
- test_files:
220
- - spec/spec_helper.rb
221
- - spec/support/remotelink.json
222
- - spec/support/transitions.all.json
223
- - spec/yajp_spec.rb
247
+ test_files: []