snfoil-context 1.0.0 → 1.1.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: 865d3b34caed7991d357df2f115087b8c99b84c5e1a0050e691e9bf751149647
4
- data.tar.gz: 28c589b8f0fd88f7828c91678de7c58051d1489107ff2c96ad3c94e4c1cfba02
3
+ metadata.gz: 7668d6bc2b0b4cb145b6e68854fdcefa1189dcd22705ff653175eb6ca9f17343
4
+ data.tar.gz: 422d2f4379b13c67c724169d86bc040e0630fd152ed7cd31527b13303a147839
5
5
  SHA512:
6
- metadata.gz: 7115fd9f9bbb8de53f6008fccaa4018f41fc2ce2c13066a7a00e08192d1054589d3c0a471e3be837ac9d26d62cd32088ccc5e39700d7842d954d98d24fb9b9cc
7
- data.tar.gz: a7d880bbff1e6cb9fa1fcb39a9f865ebb171d940ec3804ae0ae05a92c97fce9007b480876dcb1b05fab188635f88d28e3e65ea2f37f39d1b8819a3f4e144aacc
6
+ metadata.gz: 94724380046a655bec5ce557847b3930945d6bbadba09f37041f48a2a494698adc851d20cf9166458944782e339adbef586d4dbb397134d0d6f31d8357462d68
7
+ data.tar.gz: 8bad4f8f72c130e25cf2c12c3123bbf2cf8b7652a2219cdc5503e422d6329c75ad864a11bbb7cf9aa8aecb3a78c9cc64fcdf8bcea180d6146a79c1494e320bca
data/Gemfile CHANGED
@@ -4,3 +4,14 @@ source 'https://rubygems.org'
4
4
 
5
5
  # Specify your gem's dependencies in snfoil-policy.gemspec
6
6
  gemspec
7
+
8
+ group :development, :test do
9
+ gem 'bundle-audit', '~> 0.1.0'
10
+ gem 'fasterer', '~> 0.10.0'
11
+ gem 'pry-byebug', '~> 3.9', platform: :mri
12
+ gem 'rake', '~> 13.0'
13
+ gem 'rspec', '~> 3.10'
14
+ gem 'rubocop', '1.33'
15
+ gem 'rubocop-performance', '1.14.3'
16
+ gem 'rubocop-rspec', '2.12.1'
17
+ end
data/README.md CHANGED
@@ -50,7 +50,7 @@ end
50
50
  When you `new` up a SnFoil Context you should provide the entity running the actions. This will usually be a user but you can pass in anything. This will be accessible from within the context as `entity`.
51
51
 
52
52
  ```ruby
53
- TokenContext.new(current_user)
53
+ TokenContext.new(entity: current_user)
54
54
  ```
55
55
 
56
56
  ### Actions
@@ -92,7 +92,7 @@ class TokenContext
92
92
  action(:expire) { |options| options[:object].update(expired_at: Time.current) }
93
93
  end
94
94
 
95
- TokenContext.new(current_user).expire(object: current_token)
95
+ TokenContext.new(entity: current_user).expire(object: current_token)
96
96
  ```
97
97
 
98
98
  If you want to reuse the primary action or just prefer methods, you can pass in the method name you would like to call, rather than providing a block. If a method name and a block are provided, the block is ignored.
@@ -335,7 +335,7 @@ end
335
335
  Just like for an action SnFoil allows you to define both hooks and a method. To run this interval you call it using the `run_interval` method.
336
336
 
337
337
  ```ruby
338
- TokenContext.new(entity).run_interval(:demo, **options)
338
+ TokenContext.new(entity: entity).run_interval(:demo, **options)
339
339
  ```
340
340
 
341
341
  ## Development
@@ -16,6 +16,6 @@
16
16
 
17
17
  module SnFoil
18
18
  module Context
19
- VERSION = '1.0.0'
19
+ VERSION = '1.1.0'
20
20
  end
21
21
  end
@@ -105,6 +105,8 @@ module SnFoil
105
105
  end
106
106
 
107
107
  def define_instance_methods(method_name)
108
+ return if method_defined? method_name
109
+
108
110
  define_method(method_name) do |**options|
109
111
  options
110
112
  end
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
  spec.description = 'An easy way to make extensible workflows and actions'
13
13
  spec.homepage = 'https://github.com/limited-effort/snfoil-context'
14
14
  spec.license = 'Apache-2.0'
15
- spec.required_ruby_version = '>= 2.7'
15
+ spec.required_ruby_version = '>= 2.6'
16
16
 
17
17
  spec.metadata['homepage_uri'] = spec.homepage
18
18
  spec.metadata['source_code_uri'] = spec.homepage
@@ -29,13 +29,4 @@ Gem::Specification.new do |spec|
29
29
  spec.require_paths = ['lib']
30
30
 
31
31
  spec.add_dependency 'activesupport', '>= 5.2.6'
32
-
33
- spec.add_development_dependency 'bundle-audit', '~> 0.1.0'
34
- spec.add_development_dependency 'fasterer', '~> 0.10.0'
35
- spec.add_development_dependency 'pry-byebug', '~> 3.9'
36
- spec.add_development_dependency 'rake', '~> 13.0'
37
- spec.add_development_dependency 'rspec', '~> 3.10'
38
- spec.add_development_dependency 'rubocop', '~> 1.29'
39
- spec.add_development_dependency 'rubocop-performance', '~> 1.11'
40
- spec.add_development_dependency 'rubocop-rspec', '~> 2.5'
41
32
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snfoil-context
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Howes
8
8
  - Cliff Campbell
9
- autorequire:
9
+ autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2022-05-11 00:00:00.000000000 Z
12
+ date: 2022-10-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -25,118 +25,6 @@ dependencies:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: 5.2.6
28
- - !ruby/object:Gem::Dependency
29
- name: bundle-audit
30
- requirement: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - "~>"
33
- - !ruby/object:Gem::Version
34
- version: 0.1.0
35
- type: :development
36
- prerelease: false
37
- version_requirements: !ruby/object:Gem::Requirement
38
- requirements:
39
- - - "~>"
40
- - !ruby/object:Gem::Version
41
- version: 0.1.0
42
- - !ruby/object:Gem::Dependency
43
- name: fasterer
44
- requirement: !ruby/object:Gem::Requirement
45
- requirements:
46
- - - "~>"
47
- - !ruby/object:Gem::Version
48
- version: 0.10.0
49
- type: :development
50
- prerelease: false
51
- version_requirements: !ruby/object:Gem::Requirement
52
- requirements:
53
- - - "~>"
54
- - !ruby/object:Gem::Version
55
- version: 0.10.0
56
- - !ruby/object:Gem::Dependency
57
- name: pry-byebug
58
- requirement: !ruby/object:Gem::Requirement
59
- requirements:
60
- - - "~>"
61
- - !ruby/object:Gem::Version
62
- version: '3.9'
63
- type: :development
64
- prerelease: false
65
- version_requirements: !ruby/object:Gem::Requirement
66
- requirements:
67
- - - "~>"
68
- - !ruby/object:Gem::Version
69
- version: '3.9'
70
- - !ruby/object:Gem::Dependency
71
- name: rake
72
- requirement: !ruby/object:Gem::Requirement
73
- requirements:
74
- - - "~>"
75
- - !ruby/object:Gem::Version
76
- version: '13.0'
77
- type: :development
78
- prerelease: false
79
- version_requirements: !ruby/object:Gem::Requirement
80
- requirements:
81
- - - "~>"
82
- - !ruby/object:Gem::Version
83
- version: '13.0'
84
- - !ruby/object:Gem::Dependency
85
- name: rspec
86
- requirement: !ruby/object:Gem::Requirement
87
- requirements:
88
- - - "~>"
89
- - !ruby/object:Gem::Version
90
- version: '3.10'
91
- type: :development
92
- prerelease: false
93
- version_requirements: !ruby/object:Gem::Requirement
94
- requirements:
95
- - - "~>"
96
- - !ruby/object:Gem::Version
97
- version: '3.10'
98
- - !ruby/object:Gem::Dependency
99
- name: rubocop
100
- requirement: !ruby/object:Gem::Requirement
101
- requirements:
102
- - - "~>"
103
- - !ruby/object:Gem::Version
104
- version: '1.29'
105
- type: :development
106
- prerelease: false
107
- version_requirements: !ruby/object:Gem::Requirement
108
- requirements:
109
- - - "~>"
110
- - !ruby/object:Gem::Version
111
- version: '1.29'
112
- - !ruby/object:Gem::Dependency
113
- name: rubocop-performance
114
- requirement: !ruby/object:Gem::Requirement
115
- requirements:
116
- - - "~>"
117
- - !ruby/object:Gem::Version
118
- version: '1.11'
119
- type: :development
120
- prerelease: false
121
- version_requirements: !ruby/object:Gem::Requirement
122
- requirements:
123
- - - "~>"
124
- - !ruby/object:Gem::Version
125
- version: '1.11'
126
- - !ruby/object:Gem::Dependency
127
- name: rubocop-rspec
128
- requirement: !ruby/object:Gem::Requirement
129
- requirements:
130
- - - "~>"
131
- - !ruby/object:Gem::Version
132
- version: '2.5'
133
- type: :development
134
- prerelease: false
135
- version_requirements: !ruby/object:Gem::Requirement
136
- requirements:
137
- - - "~>"
138
- - !ruby/object:Gem::Version
139
- version: '2.5'
140
28
  description: An easy way to make extensible workflows and actions
141
29
  email:
142
30
  - howeszy@gmail.com
@@ -164,7 +52,7 @@ metadata:
164
52
  source_code_uri: https://github.com/limited-effort/snfoil-context
165
53
  changelog_uri: https://github.com/limited-effort/snfoil-context/blob/main/CHANGELOG.md
166
54
  rubygems_mfa_required: 'true'
167
- post_install_message:
55
+ post_install_message:
168
56
  rdoc_options: []
169
57
  require_paths:
170
58
  - lib
@@ -172,15 +60,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
172
60
  requirements:
173
61
  - - ">="
174
62
  - !ruby/object:Gem::Version
175
- version: '2.7'
63
+ version: '2.6'
176
64
  required_rubygems_version: !ruby/object:Gem::Requirement
177
65
  requirements:
178
66
  - - ">="
179
67
  - !ruby/object:Gem::Version
180
68
  version: '0'
181
69
  requirements: []
182
- rubygems_version: 3.1.6
183
- signing_key:
70
+ rubygems_version: 3.3.7
71
+ signing_key:
184
72
  specification_version: 4
185
73
  summary: Setup Simple Pipelined Workflows
186
74
  test_files: []