screengem 0.9.1 → 0.10.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: b6fdea9053a69b15255d54d9a1a3ae9cf34fe0973ef857dd17c12d023ba00eb4
4
- data.tar.gz: bff48e6b9db7aa91e0beaf5400002f82f797fa6246d926c769ecdcc697ab06a5
3
+ metadata.gz: 4be583b646f741befec6d480f450c93a0313ab4a17abf7743437627614398456
4
+ data.tar.gz: 90fee795ae2efcbfeeb3d9fd206a7d2d38ead7f92dd298b228b25b63e743343c
5
5
  SHA512:
6
- metadata.gz: 1477cd2253855d1ddcf5d2e820c0419f5d2726b44c464507ea77557c4c73ecf5be8229921a79d44dece85883aea1a5c14a88f16ed647737516d7cfa35127af81
7
- data.tar.gz: 7609872a5856218b3717f336d2bd9c3e92e9d087598d363eb8142def96067a4e42eb39f3aebfd30bb50e6b3fa3aff96c3d3ea143c359d64eabee1e42f4d9fbc3
6
+ metadata.gz: 005ad3ce9f9e6b657a3fd75f3fabe18d55b76767bad464ba2d6c6c0f81c744c7bf0f02fe16d4ac724f443b3a419b64aea3f0e162877a787ca72d208b24b586e1
7
+ data.tar.gz: 90497ca01f2134a764dc77e5f665459a340a66d5c7e2e130a97e5f98b36d893b0573445e34e7f2a2e6bc98706395c48dcbb7212352f78ba038a07e17ac5c3f27
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## master (unreleased)
4
4
 
5
+ ## 0.10.0 (2020-01-11)
6
+
7
+ * Remove action abstraction
8
+ * Latest development dependencies
9
+
5
10
  ## 0.9.1 (2019-10-22)
6
11
 
7
12
  * Relax the require_all dependency
data/README.md CHANGED
@@ -24,7 +24,7 @@ An Actor is able to remember and recall key-value pairs.
24
24
 
25
25
  A Question responds to answer.
26
26
 
27
- A Task responds to perform and may execute one or more actions.
27
+ A Task responds to perform.
28
28
 
29
29
  ![Core Domain Model](/images/ScreengemCore.png)
30
30
 
Binary file
data/lib/screengem.rb CHANGED
@@ -18,15 +18,12 @@ require "screengem/primitive_key"
18
18
  require "screengem/dampen_configuration"
19
19
  require "screengem/dampen_configuration_generator"
20
20
 
21
- require "screengem/concerns/actionable"
22
21
  require "screengem/concerns/configurable"
23
22
  require "screengem/concerns/dampenable"
24
23
  require "screengem/concerns/executable"
25
24
 
26
25
  require "screengem/dsl"
27
26
 
28
- require "screengem/action"
29
- require "screengem/browser_action"
30
27
  require "screengem/question"
31
28
  require "screengem/task"
32
29
 
@@ -35,9 +32,6 @@ require "screengem/actor"
35
32
 
36
33
  require "screengem/factories/factory_creation_error"
37
34
 
38
- require "screengem/factories/action_factory"
39
- require "screengem/factories/browser_action_factory"
40
- require "screengem/factories/standard_action_factory"
41
35
  require "screengem/factories/question_factory"
42
36
  require "screengem/factories/task_factory"
43
37
 
@@ -1,14 +1,14 @@
1
1
  module Screengem
2
2
  #
3
- # Mixin that allows an actor to perform tasks, ask questions, take actions, and
4
- # to remember and recall tagged values.
3
+ # Mixin that allows an actor to perform tasks, ask questions, and to remember and
4
+ # recall tagged values.
5
5
  #
6
6
  # Return self for those methods that may be chained in the step definition DSL.
7
7
  #
8
8
  # The ability to remember and recall values is used to carry state forward from one
9
9
  # step definition to another (as the preferred alternative to instance variables).
10
10
  #
11
- # Action, question, and task instances (aka primitives) are configured with:
11
+ # Question and task instances (aka primitives) are configured with:
12
12
  # (1) a reference to the actor that is interacting with the primitive
13
13
  # (2) a reference to the screen instance that hosts accessors to the screen elements.
14
14
  #
@@ -66,19 +66,6 @@ module Screengem
66
66
  self
67
67
  end
68
68
 
69
- #
70
- # Used by an actor to take one or more actions.
71
- #
72
- # Used to implement tasks. Actions do not appear in step definitions.
73
- #
74
- def takes_action(*actions)
75
- actions.each do |action|
76
- action.configure(self, screen)
77
-
78
- action.execute
79
- end
80
- end
81
-
82
69
  private
83
70
 
84
71
  def incorrect_answer(question)
@@ -25,12 +25,6 @@ module Screengem
25
25
  # A boolean that specifies that dampening is to be applied.
26
26
  attr_accessor :apply_dampening
27
27
 
28
- # A boolean that specifies that browser actions are created (used by the ActionFactory).
29
- attr_accessor :browser_actions
30
-
31
- # A string that namespaces action classes (used by the ActionFactory).
32
- attr_accessor :action_scope
33
-
34
28
  # A string that namespaces questions classes (used by the QuestionFactory).
35
29
  attr_accessor :question_scope
36
30
 
@@ -39,11 +33,9 @@ module Screengem
39
33
 
40
34
  def initialize
41
35
  self.apply_dampening = false
42
- self.browser_actions = false
43
36
 
44
37
  self.dampen_configuration_root = "default"
45
38
 
46
- self.action_scope = "Actions"
47
39
  self.question_scope = "Questions"
48
40
  self.task_scope = "Tasks"
49
41
  end
@@ -52,10 +44,6 @@ module Screengem
52
44
  apply_dampening
53
45
  end
54
46
 
55
- def browser_actions?
56
- browser_actions
57
- end
58
-
59
47
  def dampen_configuration_sample_filename
60
48
  "#{dampen_configuration_filename}.sample"
61
49
  end
@@ -5,7 +5,6 @@ module Screengem
5
5
  class Task
6
6
  include RSpec::Matchers
7
7
 
8
- include Screengem::Actionable
9
8
  include Screengem::Configurable
10
9
  include Screengem::Dampenable
11
10
  include Screengem::Executable
@@ -1,3 +1,3 @@
1
1
  module Screengem
2
- VERSION = "0.9.1"
2
+ VERSION = "0.10.0"
3
3
  end
data/screengem.gemspec CHANGED
@@ -27,16 +27,18 @@ Gem::Specification.new do |spec|
27
27
  spec.bindir = "exe"
28
28
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
29
  spec.require_paths = ["lib"]
30
+ spec.required_ruby_version = "~> 2.5"
30
31
 
31
32
  spec.add_runtime_dependency "activesupport", ">= 4.2", "< 6.1"
32
33
  spec.add_runtime_dependency "capybara", ">= 2.18", "< 4.0"
33
34
  spec.add_runtime_dependency "require_all", ">= 2.0", "< 4.0"
34
35
  spec.add_runtime_dependency "rspec-expectations", "~> 3.8"
35
- spec.add_runtime_dependency "thor", "~> 0.20"
36
+ spec.add_runtime_dependency "thor", "~> 1.0"
36
37
 
37
38
  spec.add_development_dependency "rake", "~> 13.0"
38
- spec.add_development_dependency "rspec", "~> 3.8"
39
- spec.add_development_dependency "rubocop", "~> 0.75"
40
- spec.add_development_dependency "rubocop-rspec", "~> 1.36"
39
+ spec.add_development_dependency "rspec", "~> 3.9"
40
+ spec.add_development_dependency "rubocop", "~> 0.79"
41
+ spec.add_development_dependency "rubocop-performance", "~> 1.5"
42
+ spec.add_development_dependency "rubocop-rspec", "~> 1.37"
41
43
  spec.add_development_dependency "simplecov", "~> 0.17"
42
44
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: screengem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alistair McKinnell
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-22 00:00:00.000000000 Z
11
+ date: 2020-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -90,14 +90,14 @@ dependencies:
90
90
  requirements:
91
91
  - - "~>"
92
92
  - !ruby/object:Gem::Version
93
- version: '0.20'
93
+ version: '1.0'
94
94
  type: :runtime
95
95
  prerelease: false
96
96
  version_requirements: !ruby/object:Gem::Requirement
97
97
  requirements:
98
98
  - - "~>"
99
99
  - !ruby/object:Gem::Version
100
- version: '0.20'
100
+ version: '1.0'
101
101
  - !ruby/object:Gem::Dependency
102
102
  name: rake
103
103
  requirement: !ruby/object:Gem::Requirement
@@ -118,42 +118,56 @@ dependencies:
118
118
  requirements:
119
119
  - - "~>"
120
120
  - !ruby/object:Gem::Version
121
- version: '3.8'
121
+ version: '3.9'
122
122
  type: :development
123
123
  prerelease: false
124
124
  version_requirements: !ruby/object:Gem::Requirement
125
125
  requirements:
126
126
  - - "~>"
127
127
  - !ruby/object:Gem::Version
128
- version: '3.8'
128
+ version: '3.9'
129
129
  - !ruby/object:Gem::Dependency
130
130
  name: rubocop
131
131
  requirement: !ruby/object:Gem::Requirement
132
132
  requirements:
133
133
  - - "~>"
134
134
  - !ruby/object:Gem::Version
135
- version: '0.75'
135
+ version: '0.79'
136
136
  type: :development
137
137
  prerelease: false
138
138
  version_requirements: !ruby/object:Gem::Requirement
139
139
  requirements:
140
140
  - - "~>"
141
141
  - !ruby/object:Gem::Version
142
- version: '0.75'
142
+ version: '0.79'
143
+ - !ruby/object:Gem::Dependency
144
+ name: rubocop-performance
145
+ requirement: !ruby/object:Gem::Requirement
146
+ requirements:
147
+ - - "~>"
148
+ - !ruby/object:Gem::Version
149
+ version: '1.5'
150
+ type: :development
151
+ prerelease: false
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ requirements:
154
+ - - "~>"
155
+ - !ruby/object:Gem::Version
156
+ version: '1.5'
143
157
  - !ruby/object:Gem::Dependency
144
158
  name: rubocop-rspec
145
159
  requirement: !ruby/object:Gem::Requirement
146
160
  requirements:
147
161
  - - "~>"
148
162
  - !ruby/object:Gem::Version
149
- version: '1.36'
163
+ version: '1.37'
150
164
  type: :development
151
165
  prerelease: false
152
166
  version_requirements: !ruby/object:Gem::Requirement
153
167
  requirements:
154
168
  - - "~>"
155
169
  - !ruby/object:Gem::Version
156
- version: '1.36'
170
+ version: '1.37'
157
171
  - !ruby/object:Gem::Dependency
158
172
  name: simplecov
159
173
  requirement: !ruby/object:Gem::Requirement
@@ -193,13 +207,10 @@ files:
193
207
  - exe/screengem
194
208
  - images/ScreengemCore.png
195
209
  - lib/screengem.rb
196
- - lib/screengem/action.rb
197
210
  - lib/screengem/actor.rb
198
211
  - lib/screengem/actor_memory.rb
199
212
  - lib/screengem/automatic_visit.rb
200
- - lib/screengem/browser_action.rb
201
213
  - lib/screengem/cli.rb
202
- - lib/screengem/concerns/actionable.rb
203
214
  - lib/screengem/concerns/configurable.rb
204
215
  - lib/screengem/concerns/dampenable.rb
205
216
  - lib/screengem/concerns/executable.rb
@@ -207,11 +218,8 @@ files:
207
218
  - lib/screengem/dampen_configuration.rb
208
219
  - lib/screengem/dampen_configuration_generator.rb
209
220
  - lib/screengem/dsl.rb
210
- - lib/screengem/factories/action_factory.rb
211
- - lib/screengem/factories/browser_action_factory.rb
212
221
  - lib/screengem/factories/factory_creation_error.rb
213
222
  - lib/screengem/factories/question_factory.rb
214
- - lib/screengem/factories/standard_action_factory.rb
215
223
  - lib/screengem/factories/task_factory.rb
216
224
  - lib/screengem/incorrect_answer.rb
217
225
  - lib/screengem/primitive_key.rb
@@ -237,16 +245,16 @@ require_paths:
237
245
  - lib
238
246
  required_ruby_version: !ruby/object:Gem::Requirement
239
247
  requirements:
240
- - - ">="
248
+ - - "~>"
241
249
  - !ruby/object:Gem::Version
242
- version: '0'
250
+ version: '2.5'
243
251
  required_rubygems_version: !ruby/object:Gem::Requirement
244
252
  requirements:
245
253
  - - ">="
246
254
  - !ruby/object:Gem::Version
247
255
  version: '0'
248
256
  requirements: []
249
- rubygems_version: 3.0.6
257
+ rubygems_version: 3.1.2
250
258
  signing_key:
251
259
  specification_version: 4
252
260
  summary: Ruby implementation of the Screengem Pattern.
@@ -1,11 +0,0 @@
1
- module Screengem
2
- #
3
- # Base class for all actions.
4
- #
5
- class Action
6
- include RSpec::Matchers
7
-
8
- include Screengem::Configurable
9
- include Screengem::Executable
10
- end
11
- end
@@ -1,7 +0,0 @@
1
- module Screengem
2
- #
3
- # Base class for all browser actions.
4
- #
5
- class BrowserAction < Screengem::Action
6
- end
7
- end
@@ -1,29 +0,0 @@
1
- module Screengem
2
- #
3
- # Concern that adds the ability to create actions.
4
- #
5
- module Actionable
6
- extend ActiveSupport::Concern
7
-
8
- def action
9
- @action ||= action_factory
10
- end
11
-
12
- private
13
-
14
- #
15
- # Choose the specified action factory. Default to the standard action factory.
16
- #
17
- def action_factory
18
- if browser_factory?
19
- Screengem::Factories::BrowserActionFactory.instance
20
- else
21
- Screengem::Factories::StandardActionFactory.instance
22
- end
23
- end
24
-
25
- def browser_factory?
26
- Screengem.configuration.browser_actions?
27
- end
28
- end
29
- end
@@ -1,34 +0,0 @@
1
- module Screengem
2
- module Factories
3
- #
4
- # Makes actions available to tasks.
5
- #
6
- class ActionFactory < BasicObject
7
- def method_missing(action_name, *args) # rubocop:disable Style/MethodMissingSuper
8
- action_class_name = raw_action_class_name(action_name).camelize
9
- action_class = "#{action_scope}::#{action_class_name}".constantize
10
-
11
- action_class.new(*args)
12
- rescue => e
13
- ActionError.new(<<~MSG)
14
- Unable to create action: '#{action_class_name}'.
15
- Details: #{e.message}
16
- MSG
17
- end
18
-
19
- def respond_to_missing?(_action_name, *)
20
- true
21
- end
22
-
23
- class ActionError < ::Screengem::Action
24
- include FactoryCreationError
25
- end
26
-
27
- private
28
-
29
- def action_scope
30
- @action_scope ||= ::Screengem.configuration.action_scope
31
- end
32
- end
33
- end
34
- end
@@ -1,14 +0,0 @@
1
- module Screengem
2
- module Factories
3
- #
4
- # Makes browser actions available.
5
- #
6
- class BrowserActionFactory < Screengem::Factories::ActionFactory
7
- include ::Singleton
8
-
9
- def raw_action_class_name(action_name)
10
- "#{action_name}_action_browser"
11
- end
12
- end
13
- end
14
- end
@@ -1,14 +0,0 @@
1
- module Screengem
2
- module Factories
3
- #
4
- # Makes standard actions available.
5
- #
6
- class StandardActionFactory < Screengem::Factories::ActionFactory
7
- include ::Singleton
8
-
9
- def raw_action_class_name(action_name)
10
- "#{action_name}_action"
11
- end
12
- end
13
- end
14
- end