avocado 0.7.0 → 0.8.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: e9ec8adfbc4563b5bbcddd5d5406963b4a9fe7d5a38765e35a86c9a3d35a09a0
4
- data.tar.gz: 6db1dfa3a370661017533e44f2278a09daeece5c145267f05f0bced8943ea910
3
+ metadata.gz: '08d664f6d291a21013b089cd5828f447e400cb6d8314715b503ab2e3b1f0a174'
4
+ data.tar.gz: 302cf7c4940831925bf5e26d3dab5363995ae9aa1a3191a2fe5da2744df2a838
5
5
  SHA512:
6
- metadata.gz: 9761662e0cf44fab571f6f6003aed2c0be2ae56424afbc1cc4b3ccb2f0d856a3e4d3b7a67c8a9e82b7d408977ebb30b4f1f61d9af0fd24db17c3fcb5c944cd89
7
- data.tar.gz: a8021001d0f4864a36c981b2c5d18b71bca432f4f4b6fcde4ff6f07c38e7fc39f766dd39670041582cacb9a80526423eafd8156b5d8fc0580189679a1b67d144
6
+ metadata.gz: 97def5337c7ccaa178b3a33a40b5c7601f89ff4155d6ee0c7e0bff7025e329ae2ab6694b6ceeb5454345cf989a43431f82c2db7b7ac7cfc7abd9cb6ada7ad894
7
+ data.tar.gz: 7ddeea306e591a49a4705337d3941518a1f8e900f502e2510e397cd860ce6576c7a14cb45226646cefd87c98a77e0de5a116b00dda0d71fa85fe9523ea855a9d
data/.standard.yml CHANGED
@@ -1,4 +1,5 @@
1
1
  parallel: true
2
+ ruby_version: 3.2
2
3
  plugins:
3
4
  - standard-performance
4
5
  - standard-rails
data/Appraisals ADDED
@@ -0,0 +1,14 @@
1
+ appraise "rails_7.1" do
2
+ gem "rails", "~> 7.1.0"
3
+ gem "sqlite3", "~> 1.7"
4
+ end
5
+
6
+ appraise "rails_7.2" do
7
+ gem "rails", "~> 7.2.0"
8
+ gem "sqlite3", "~> 1.7"
9
+ end
10
+
11
+ appraise "rails_8.0" do
12
+ gem "rails", "~> 8.0.0.rc1"
13
+ gem "sqlite3", "~> 2.0"
14
+ end
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # Changelog
2
2
 
3
- ## [Unreleased]
3
+ ## [0.8.0] - 2024-10-22
4
+
5
+ ### Changed
6
+
7
+ - Minimum ruby version is now 3.2
8
+ - Allow Rails versions 7.2 and 8.0
4
9
 
5
10
  ## [0.7.0] - 2023-08-10
6
11
 
data/README.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  Authentication library for [Rails] 7.1+ applications.
4
4
 
5
+ When most people notice the trifecta of `has_secure_password`,
6
+ `authenticate_by`, and `generates_token_for` in [Rails 7.1] they think to
7
+ themselves "Sweet sassy molassey, I bet you could DIY a nice auth solution with
8
+ these dog-gone methods!" and then they slap the roof of their cars and yell
9
+ "Everyone to the coder-cycle! Let's rev this bad boy up and build us an SDK!"
10
+
11
+ But then again, maybe it's too soon for that, or maybe you're nervous about
12
+ writing authentication code in your own application and would prefer to consume
13
+ such code in scrumpulent gem form instead. The 🥑 gem is an extraction of the
14
+ authentication portion of an experimental next-generation Rails codebase built
15
+ in our research group.
16
+
5
17
  ## Installation
6
18
 
7
19
  Add to the application's Gemfile by executing:
@@ -10,7 +22,7 @@ Add to the application's Gemfile by executing:
10
22
 
11
23
  ## Usage
12
24
 
13
- Read the [documentation] for more details or the [wiki] for background.
25
+ Read the [documentation] for more details.
14
26
 
15
27
  ## Development
16
28
 
@@ -31,3 +43,4 @@ The gem is available as open source under the terms of the [MIT License].
31
43
  [MIT License]: https://opensource.org/licenses/MIT
32
44
  [Rails]: https://github.com/rails/rails
33
45
  [wiki]: https://github.com/tcuwp/avocado/wiki
46
+ [Rails 7.1]: https://guides.rubyonrails.org/7_1_release_notes.html
@@ -30,7 +30,7 @@ module Avocado
30
30
  end
31
31
 
32
32
  def destroy
33
- @session.destroy
33
+ @session.destroy!
34
34
  redirect_to sessions_path,
35
35
  notice: t(".success")
36
36
  end
data/avocado.gemspec ADDED
@@ -0,0 +1,35 @@
1
+ require_relative "lib/avocado/version"
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "avocado"
5
+ spec.version = Avocado::VERSION
6
+ spec.authors = ["Matt Jankowski"]
7
+ spec.email = ["info@tcuwp.co"]
8
+
9
+ spec.summary = "Simple authentication for Rails applications"
10
+ spec.homepage = "https://github.com/tcuwp/avocado"
11
+ spec.license = "MIT"
12
+ spec.required_ruby_version = Avocado::MINIMUM_RUBY_VERSION
13
+
14
+ spec.metadata["bug_tracker_uri"] = "https://github.com/tcuwp/avocado/issues"
15
+ spec.metadata["changelog_uri"] = "https://github.com/tcuwp/avocado/blob/main/CHANGELOG.md"
16
+ spec.metadata["documentation_uri"] = "https://github.com/tcuwp/avocado/blob/main/docs/USAGE.md"
17
+ spec.metadata["homepage_uri"] = spec.homepage
18
+ spec.metadata["source_code_uri"] = "https://github.com/tcuwp/avocado/tree/main"
19
+ spec.metadata["wiki_uri"] = "https://github.com/tcuwp/avocado/wiki"
20
+
21
+ # Specify which files should be added to the gem when it is released.
22
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
23
+ spec.files = Dir.chdir(__dir__) do
24
+ `git ls-files -z`.split("\x0").reject do |f|
25
+ (File.expand_path(f) == __FILE__) ||
26
+ f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor Gemfile])
27
+ end
28
+ end
29
+ spec.bindir = "exe"
30
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
31
+ spec.require_paths = ["lib"]
32
+
33
+ spec.add_dependency "bcrypt", "~> 3.1"
34
+ spec.add_dependency "rails", Avocado::RAILS_VERSION
35
+ end
data/docs/USAGE.md CHANGED
@@ -120,17 +120,16 @@ There is an `Avocado::Mailer` which gets called to send emails. The mailer views
120
120
  here are very basic, and should be overriden within applications. Place views
121
121
  within `app/views/avocado/mailer/` to make this happen.
122
122
 
123
- ### Before actions
123
+ ### Filters
124
124
 
125
- There is an `authenticate` method installed as default controller behavior using
126
- `before_action :authenticate`. Any actions which do not need to be authenticated
127
- should disable this with `skip_before_action :authenticate`, or inherit from a
128
- controller which performs the skip.
125
+ There are two methods added to the default `before_action` stack:
129
126
 
130
- There is also a `set_current_request_details` method installed as a default
131
- `before_action` which takes some loggable request meta information (User Agent,
132
- IP Address) and sets their values in `Current` so that they are accesible to
133
- code elsewhere in the 🥑 gem.
127
+ - The `authenticate` method defaults controller behavior to require a signed in
128
+ session. Actions can disable it with `skip_before_action :authenticate`, or
129
+ inherit from a controller which performs the skip.
130
+ - The `set_current_request_details` method makes some loggable request meta
131
+ information (User Agent, IP Address) values available in `Current` so that
132
+ they are accesible to code elsewhere in the 🥑 gem.
134
133
 
135
134
  ### Helpers
136
135
 
@@ -149,8 +148,7 @@ There is not any configuration. To override functionality:
149
148
 
150
149
  - Redefine a method created in one of the models by the included module
151
150
  - Subclass a controller and update the routing to go to the subclass
152
- - Place views in the app where avocado expects (`app/views/avocado`) them to
153
- override the defaults
151
+ - Place views in the app where 🥑 expects them (`app/views/avocado`) to override
154
152
 
155
153
  There is an `avocado:views` generator which will copy all the views as a
156
154
  starting point for further modification.
@@ -0,0 +1,20 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "appraisal"
6
+ gem "capybara"
7
+ gem "combustion"
8
+ gem "factory_bot_rails"
9
+ gem "rake"
10
+ gem "rspec-rails"
11
+ gem "rubocop-rspec"
12
+ gem "shoulda-matchers"
13
+ gem "simplecov", require: false
14
+ gem "sqlite3", "~> 1.7"
15
+ gem "standard-performance"
16
+ gem "standard-rails"
17
+ gem "standard"
18
+ gem "rails", "~> 7.1.0"
19
+
20
+ gemspec path: "../"
@@ -0,0 +1,20 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "appraisal"
6
+ gem "capybara"
7
+ gem "combustion"
8
+ gem "factory_bot_rails"
9
+ gem "rake"
10
+ gem "rspec-rails"
11
+ gem "rubocop-rspec"
12
+ gem "shoulda-matchers"
13
+ gem "simplecov", require: false
14
+ gem "sqlite3", "~> 1.7"
15
+ gem "standard-performance"
16
+ gem "standard-rails"
17
+ gem "standard"
18
+ gem "rails", "~> 7.2.0"
19
+
20
+ gemspec path: "../"
@@ -0,0 +1,20 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "appraisal"
6
+ gem "capybara"
7
+ gem "combustion"
8
+ gem "factory_bot_rails"
9
+ gem "rake"
10
+ gem "rspec-rails"
11
+ gem "rubocop-rspec"
12
+ gem "shoulda-matchers"
13
+ gem "simplecov", require: false
14
+ gem "sqlite3", "~> 2.0"
15
+ gem "standard-performance"
16
+ gem "standard-rails"
17
+ gem "standard"
18
+ gem "rails", "~> 8.0.0.rc1"
19
+
20
+ gemspec path: "../"
@@ -40,7 +40,7 @@ module Avocado
40
40
  end
41
41
 
42
42
  def session_from_token
43
- ::Session.find_by_token(cookies.signed[:session_token])
43
+ ::Session.find_by(token: cookies.signed[:session_token])
44
44
  end
45
45
 
46
46
  def set_current_request_details
@@ -1,3 +1,5 @@
1
1
  module Avocado
2
- VERSION = "0.7.0"
2
+ MINIMUM_RUBY_VERSION = ">= 3.2.0".freeze
3
+ VERSION = "0.8.0".freeze
4
+ RAILS_VERSION = ">= 7.1".freeze
3
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avocado
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Jankowski
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-10 00:00:00.000000000 Z
11
+ date: 2024-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bcrypt
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: rails
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 7.1.0.alpha
33
+ version: '7.1'
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: 7.1.0.alpha
40
+ version: '7.1'
41
41
  description:
42
42
  email:
43
43
  - info@tcuwp.co
@@ -48,6 +48,7 @@ files:
48
48
  - ".rspec"
49
49
  - ".rubocop/rspec.yml"
50
50
  - ".standard.yml"
51
+ - Appraisals
51
52
  - CHANGELOG.md
52
53
  - LICENSE.txt
53
54
  - README.md
@@ -85,10 +86,14 @@ files:
85
86
  - app/views/avocado/sessions/index.html.erb
86
87
  - app/views/avocado/sessions/new.html.erb
87
88
  - app/views/avocado/verifications/edit.html.erb
89
+ - avocado.gemspec
88
90
  - config.ru
89
91
  - config/locales/en.yml
90
92
  - config/routes/avocado.rb
91
93
  - docs/USAGE.md
94
+ - gemfiles/rails_7.1.gemfile
95
+ - gemfiles/rails_7.2.gemfile
96
+ - gemfiles/rails_8.0.gemfile
92
97
  - lib/avocado.rb
93
98
  - lib/avocado/authentication.rb
94
99
  - lib/avocado/current.rb
@@ -112,9 +117,12 @@ homepage: https://github.com/tcuwp/avocado
112
117
  licenses:
113
118
  - MIT
114
119
  metadata:
115
- homepage_uri: https://github.com/tcuwp/avocado
116
- source_code_uri: https://github.com/tcuwp/avocado
120
+ bug_tracker_uri: https://github.com/tcuwp/avocado/issues
117
121
  changelog_uri: https://github.com/tcuwp/avocado/blob/main/CHANGELOG.md
122
+ documentation_uri: https://github.com/tcuwp/avocado/blob/main/docs/USAGE.md
123
+ homepage_uri: https://github.com/tcuwp/avocado
124
+ source_code_uri: https://github.com/tcuwp/avocado/tree/main
125
+ wiki_uri: https://github.com/tcuwp/avocado/wiki
118
126
  post_install_message:
119
127
  rdoc_options: []
120
128
  require_paths:
@@ -123,15 +131,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
123
131
  requirements:
124
132
  - - ">="
125
133
  - !ruby/object:Gem::Version
126
- version: 2.6.0
134
+ version: 3.2.0
127
135
  required_rubygems_version: !ruby/object:Gem::Requirement
128
136
  requirements:
129
137
  - - ">="
130
138
  - !ruby/object:Gem::Version
131
139
  version: '0'
132
140
  requirements: []
133
- rubygems_version: 3.4.18
141
+ rubygems_version: 3.5.22
134
142
  signing_key:
135
143
  specification_version: 4
136
- summary: Simple authentication for Rails (7.1+) applications
144
+ summary: Simple authentication for Rails applications
137
145
  test_files: []