stitches 3.8.0 → 3.8.1

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: f22af42820e6175c739a77f2f6945dd3d6aea8f94b43509303ed27874e315ca4
4
- data.tar.gz: fee8fce193a17741483531c884cd20638ad92e1b5ce423a0673d85ee467aa5f3
3
+ metadata.gz: ac1389298b9ccff356bb73c3e925501265eddb4d68932ac7bc6e41ab35535353
4
+ data.tar.gz: c800e4a091a67181e065cb0d42c45a7a730b710ce4a83fb513b6606ea7e6e47d
5
5
  SHA512:
6
- metadata.gz: 24c0456e68046e5a7a3d9cd045f35fe3095659a25da0e77b5d623ff64c759893a5c46a9367c898d58287312a29b85a186613cdaeda09558036ffa698d2e68fd1
7
- data.tar.gz: e019d85dd736bf28b5e751ffef132cae093019877f6c5aa743e0a39f4b51e1d7da37051aa8ee9ad799db13d27fd24d8cfb1df7b8472ba2491c198ac8cdc0f27c
6
+ metadata.gz: 439faf8691f51448dad6b45b35c77a63e5b31075181a55e6fe03ec1381bfe91841cc2a73172390d6e32b5f1f38f7fd3ea069b15c98d8086f4fd21b1c0842b241
7
+ data.tar.gz: 8c435dc519da97c5cc3aec267dffcb0ffb96e2479b98c14ac44217b5dd4de50afdd818c18063f7d126e7cb56a97f197bd592235591fe9e982243f12314b633d0
data/.circleci/config.yml CHANGED
@@ -5,7 +5,7 @@ version: 2
5
5
  jobs:
6
6
  release:
7
7
  docker:
8
- - image: circleci/ruby:2.6.3
8
+ - image: circleci/ruby:2.6.4
9
9
  steps:
10
10
  - checkout
11
11
  - run: bundle config stitchfix01.jfrog.io $ARTIFACTORY_USER:$ARTIFACTORY_TOKEN
@@ -17,11 +17,11 @@ jobs:
17
17
  - run:
18
18
  name: Build/release gem to artifactory
19
19
  command: bundle exec rake push_artifactory
20
- ruby-2.6.3-rails-5.2:
20
+ ruby-2.6.4-rails-6.0:
21
21
  docker:
22
- - image: circleci/ruby:2.6.3
22
+ - image: circleci/ruby:2.6.4
23
23
  environment:
24
- BUNDLE_GEMFILE: Gemfile.rails-5.2
24
+ BUNDLE_GEMFILE: Gemfile.rails-6.0
25
25
  working_directory: "~/stitches"
26
26
  steps:
27
27
  - checkout
@@ -35,15 +35,15 @@ jobs:
35
35
  fi
36
36
  - run:
37
37
  name: Notify Pager Duty
38
- command: bundle exec y-notify "#eng-platform"
38
+ command: bundle exec y-notify "#eng-platform-alerts"
39
39
  when: on_fail
40
40
  - store_test_results:
41
41
  path: "/tmp/test-results"
42
- ruby-2.5.5-rails-5.2:
42
+ ruby-2.5.6-rails-6.0:
43
43
  docker:
44
- - image: circleci/ruby:2.5.5
44
+ - image: circleci/ruby:2.5.6
45
45
  environment:
46
- BUNDLE_GEMFILE: Gemfile.rails-5.2
46
+ BUNDLE_GEMFILE: Gemfile.rails-6.0
47
47
  working_directory: "~/stitches"
48
48
  steps:
49
49
  - checkout
@@ -57,15 +57,15 @@ jobs:
57
57
  fi
58
58
  - run:
59
59
  name: Notify Pager Duty
60
- command: bundle exec y-notify "#eng-platform"
60
+ command: bundle exec y-notify "#eng-platform-alerts"
61
61
  when: on_fail
62
62
  - store_test_results:
63
63
  path: "/tmp/test-results"
64
- ruby-2.6.3-rails-5.1:
64
+ ruby-2.6.4-rails-5.2:
65
65
  docker:
66
- - image: circleci/ruby:2.6.3
66
+ - image: circleci/ruby:2.6.4
67
67
  environment:
68
- BUNDLE_GEMFILE: Gemfile.rails-5.1
68
+ BUNDLE_GEMFILE: Gemfile.rails-5.2
69
69
  working_directory: "~/stitches"
70
70
  steps:
71
71
  - checkout
@@ -79,15 +79,15 @@ jobs:
79
79
  fi
80
80
  - run:
81
81
  name: Notify Pager Duty
82
- command: bundle exec y-notify "#eng-platform"
82
+ command: bundle exec y-notify "#eng-platform-alerts"
83
83
  when: on_fail
84
84
  - store_test_results:
85
85
  path: "/tmp/test-results"
86
- ruby-2.5.5-rails-5.1:
86
+ ruby-2.5.6-rails-5.2:
87
87
  docker:
88
- - image: circleci/ruby:2.5.5
88
+ - image: circleci/ruby:2.5.6
89
89
  environment:
90
- BUNDLE_GEMFILE: Gemfile.rails-5.1
90
+ BUNDLE_GEMFILE: Gemfile.rails-5.2
91
91
  working_directory: "~/stitches"
92
92
  steps:
93
93
  - checkout
@@ -101,7 +101,7 @@ jobs:
101
101
  fi
102
102
  - run:
103
103
  name: Notify Pager Duty
104
- command: bundle exec y-notify "#eng-platform"
104
+ command: bundle exec y-notify "#eng-platform-alerts"
105
105
  when: on_fail
106
106
  - store_test_results:
107
107
  path: "/tmp/test-results"
@@ -112,31 +112,31 @@ workflows:
112
112
  - release:
113
113
  context: org-global
114
114
  requires:
115
- - ruby-2.6.3-rails-5.2
116
- - ruby-2.5.5-rails-5.2
117
- - ruby-2.6.3-rails-5.1
118
- - ruby-2.5.5-rails-5.1
115
+ - ruby-2.6.4-rails-6.0
116
+ - ruby-2.5.6-rails-6.0
117
+ - ruby-2.6.4-rails-5.2
118
+ - ruby-2.5.6-rails-5.2
119
119
  filters:
120
120
  tags:
121
- only: /^[0-9]+\.[0-9]+\.[0-9](\.RC\d*)?$/
121
+ only: /^[0-9]+\.[0-9]+\.[0-9]+(\.?RC[-\.]?\d*)?$/
122
122
  branches:
123
123
  ignore: /.*/
124
- - ruby-2.6.3-rails-5.2:
124
+ - ruby-2.6.4-rails-6.0:
125
125
  context: org-global
126
126
  filters:
127
127
  tags:
128
128
  only: &1 /.*/
129
- - ruby-2.5.5-rails-5.2:
129
+ - ruby-2.5.6-rails-6.0:
130
130
  context: org-global
131
131
  filters:
132
132
  tags:
133
133
  only: *1
134
- - ruby-2.6.3-rails-5.1:
134
+ - ruby-2.6.4-rails-5.2:
135
135
  context: org-global
136
136
  filters:
137
137
  tags:
138
138
  only: *1
139
- - ruby-2.5.5-rails-5.1:
139
+ - ruby-2.5.6-rails-5.2:
140
140
  context: org-global
141
141
  filters:
142
142
  tags:
@@ -150,11 +150,11 @@ workflows:
150
150
  only:
151
151
  - master
152
152
  jobs:
153
- - ruby-2.6.3-rails-5.2:
153
+ - ruby-2.6.4-rails-6.0:
154
154
  context: org-global
155
- - ruby-2.5.5-rails-5.2:
155
+ - ruby-2.5.6-rails-6.0:
156
156
  context: org-global
157
- - ruby-2.6.3-rails-5.1:
157
+ - ruby-2.6.4-rails-5.2:
158
158
  context: org-global
159
- - ruby-2.5.5-rails-5.1:
159
+ - ruby-2.5.6-rails-5.2:
160
160
  context: org-global
data/Gemfile.rails-5.1 CHANGED
@@ -1,7 +1,6 @@
1
1
  # DO NOT MODIFY - this is managed by Git Reduce in goro
2
2
  #
3
- source 'https://gem.fury.io/me/'
4
- source 'https://www.rubygems.org'
3
+ source 'https://stitchfix01.jfrog.io/stitchfix01/api/gems/eng-gems/'
5
4
 
6
5
  gemspec
7
6
 
data/Gemfile.rails-5.2 CHANGED
@@ -1,7 +1,6 @@
1
1
  # DO NOT MODIFY - this is managed by Git Reduce in goro
2
2
  #
3
- source 'https://gem.fury.io/me/'
4
- source 'https://www.rubygems.org'
3
+ source 'https://stitchfix01.jfrog.io/stitchfix01/api/gems/eng-gems/'
5
4
 
6
5
  gemspec
7
6
 
data/Gemfile.rails-6.0 ADDED
@@ -0,0 +1,7 @@
1
+ # DO NOT MODIFY - this is managed by Git Reduce in goro
2
+ #
3
+ source 'https://stitchfix01.jfrog.io/stitchfix01/api/gems/eng-gems/'
4
+
5
+ gemspec
6
+
7
+ gem 'rails', '~> 6.0.0'
@@ -22,7 +22,7 @@ module Stitches
22
22
 
23
23
  def initialize(app,options = {})
24
24
  super(app,options)
25
- @realm = Rails.application.class.parent.to_s
25
+ @realm = rails_app_module
26
26
  end
27
27
 
28
28
  protected
@@ -57,6 +57,17 @@ module Stitches
57
57
 
58
58
  private
59
59
 
60
+ # TODO: (jdlubrano)
61
+ # Once Rails 5 support is no longer necessary, we can simply call
62
+ # Rails.application.class.module_parent. The module_parent method
63
+ # does not exist in Rails <= 5, though, so we need to gracefully fallback
64
+ # Rails.application.class.parent for Rails versions predating Rails 6.0.0.
65
+ def rails_app_module
66
+ application_class = Rails.application.class
67
+ parent = application_class.try(:module_parent) || application_class.parent
68
+ parent.to_s
69
+ end
70
+
60
71
  class UnauthorizedResponse < Rack::Response
61
72
  def initialize(reason,realm,custom_http_auth_scheme)
62
73
  super("Unauthorized - #{reason}", 401, { "WWW-Authenticate" => "#{custom_http_auth_scheme} realm=#{realm}" })
@@ -123,14 +123,22 @@ feature "general API stuff" do
123
123
  failure_message do
124
124
  correct_code,_ = evaluate_response(response)
125
125
  if correct_code
126
- "Expected WWW-Authenticate header to be 'CustomKeyAuth realm=#{Rails.application.class.parent.to_s}', but was #{response['WWW-Authenticate']}"
126
+ "Expected WWW-Authenticate header to be 'CustomKeyAuth realm=#{realm}', but was #{response['WWW-Authenticate']}"
127
127
  else
128
128
  "Expected response to be 401, but was #{response.response_code}"
129
129
  end
130
130
  end
131
131
 
132
+ def realm
133
+ <% if ::Rails::VERSION::MAJOR >= 6 -%>
134
+ Rails.application.class.module_parent.to_s
135
+ <% else %>
136
+ Rails.application.class.parent.to_s
137
+ <% end %>
138
+ end
139
+
132
140
  def evaluate_response(response)
133
- [response.response_code == 401, response.headers["WWW-Authenticate"] == "CustomKeyAuth realm=#{Rails.application.class.parent.to_s}" ]
141
+ [response.response_code == 401, response.headers["WWW-Authenticate"] == "CustomKeyAuth realm=#{realm}"]
134
142
  end
135
143
  end
136
144
  end
@@ -1,3 +1,3 @@
1
1
  module Stitches
2
- VERSION = '3.8.0'
2
+ VERSION = '3.8.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stitches
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.8.0
4
+ version: 3.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stitch Fix Engineering
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2019-08-07 00:00:00.000000000 Z
14
+ date: 2019-09-10 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
@@ -107,6 +107,7 @@ files:
107
107
  - Gemfile.rails-5.0
108
108
  - Gemfile.rails-5.1
109
109
  - Gemfile.rails-5.2
110
+ - Gemfile.rails-6.0
110
111
  - LICENSE.txt
111
112
  - PULL_REQUEST_TEMPLATE.md
112
113
  - README.md