phenomenal 1.2.3 → 1.2.4
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.
@@ -6,8 +6,8 @@ class Phenomenal::Context
|
|
6
6
|
@@total_activations = 0
|
7
7
|
|
8
8
|
attr_accessor :activation_age, :activation_frequency, :adaptations,
|
9
|
-
:activation_count, :parent, :forgotten
|
10
|
-
attr_reader :manager,:name
|
9
|
+
:activation_count, :parent, :forgotten, :priority
|
10
|
+
attr_reader :manager,:name
|
11
11
|
# Instance methods
|
12
12
|
def initialize(name=nil, manager=nil)
|
13
13
|
@manager = manager || Phenomenal::Manager.instance
|
@@ -201,8 +201,8 @@ class Phenomenal::Context
|
|
201
201
|
end
|
202
202
|
end
|
203
203
|
|
204
|
-
def
|
205
|
-
|
204
|
+
def set_priority(p)
|
205
|
+
self.priority=p
|
206
206
|
return unless manager.shared_contexts[self]
|
207
207
|
manager.shared_contexts[self].each do |shared_context|
|
208
208
|
shared_context.priority=[priority,shared_context.priority].compact.min
|
data/lib/phenomenal/version.rb
CHANGED
@@ -171,8 +171,8 @@ describe "Conflict policies" do
|
|
171
171
|
phen_change_conflict_policy { |a,b| priority_conflict_policy(a,b) }
|
172
172
|
phone = Phone.new
|
173
173
|
call = Call.new("Alice")
|
174
|
-
context(:quiet).
|
175
|
-
context(:screening).
|
174
|
+
context(:quiet).set_priority 1
|
175
|
+
context(:screening).set_priority 2
|
176
176
|
|
177
177
|
phone.receive(call)
|
178
178
|
|
@@ -194,8 +194,8 @@ describe "Conflict policies" do
|
|
194
194
|
phen_change_conflict_policy { |a,b| priority_conflict_policy(a,b) }
|
195
195
|
phone = Phone.new
|
196
196
|
call = Call.new("Alice")
|
197
|
-
context(:quiet).
|
198
|
-
context(:screening).
|
197
|
+
context(:quiet).set_priority 2
|
198
|
+
context(:screening).set_priority 2
|
199
199
|
phone.receive(call)
|
200
200
|
|
201
201
|
phone.advertise(call).should=="ringtone"
|
@@ -217,7 +217,7 @@ describe "Conflict policies" do
|
|
217
217
|
phen_change_conflict_policy { |a,b| priority_conflict_policy(a,b) }
|
218
218
|
phone = Phone.new
|
219
219
|
call = Call.new("Alice")
|
220
|
-
context(:quiet).
|
220
|
+
context(:quiet).set_priority 1
|
221
221
|
|
222
222
|
phone.receive(call)
|
223
223
|
|
@@ -246,8 +246,8 @@ describe "Conflict policies" do
|
|
246
246
|
"combined"
|
247
247
|
end
|
248
248
|
end
|
249
|
-
context(:quiet).
|
250
|
-
context(:screening).
|
249
|
+
context(:quiet).set_priority 1
|
250
|
+
context(:screening).set_priority 2
|
251
251
|
|
252
252
|
|
253
253
|
phone.receive(call)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phenomenal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -33,52 +33,52 @@ executables: []
|
|
33
33
|
extensions: []
|
34
34
|
extra_rdoc_files: []
|
35
35
|
files:
|
36
|
-
- lib/phenomenal/context/adaptation.rb
|
37
|
-
- lib/phenomenal/context/context.rb
|
38
|
-
- lib/phenomenal/context/context_creation.rb
|
39
|
-
- lib/phenomenal/context/feature.rb
|
40
36
|
- lib/phenomenal/dsl.rb
|
41
|
-
- lib/phenomenal/error.rb
|
42
|
-
- lib/phenomenal/manager/adaptation_management.rb
|
43
|
-
- lib/phenomenal/manager/conflict_policies.rb
|
44
37
|
- lib/phenomenal/manager/context_management.rb
|
38
|
+
- lib/phenomenal/manager/conflict_policies.rb
|
45
39
|
- lib/phenomenal/manager/manager.rb
|
46
|
-
- lib/phenomenal/
|
40
|
+
- lib/phenomenal/manager/adaptation_management.rb
|
47
41
|
- lib/phenomenal/relationship/dsl.rb
|
48
|
-
- lib/phenomenal/relationship/
|
49
|
-
- lib/phenomenal/relationship/implication.rb
|
50
|
-
- lib/phenomenal/relationship/relationship.rb
|
42
|
+
- lib/phenomenal/relationship/suggestion.rb
|
51
43
|
- lib/phenomenal/relationship/relationship_manager.rb
|
52
|
-
- lib/phenomenal/relationship/relationship_store.rb
|
53
44
|
- lib/phenomenal/relationship/requirement.rb
|
54
|
-
- lib/phenomenal/relationship/
|
55
|
-
- lib/phenomenal/
|
45
|
+
- lib/phenomenal/relationship/relationship.rb
|
46
|
+
- lib/phenomenal/relationship/implication.rb
|
47
|
+
- lib/phenomenal/relationship/relationship_store.rb
|
48
|
+
- lib/phenomenal/relationship/context_relationships.rb
|
49
|
+
- lib/phenomenal/relationship/feature_relationships.rb
|
50
|
+
- lib/phenomenal/context/context.rb
|
51
|
+
- lib/phenomenal/context/adaptation.rb
|
52
|
+
- lib/phenomenal/context/feature.rb
|
53
|
+
- lib/phenomenal/context/context_creation.rb
|
56
54
|
- lib/phenomenal/viewer/dsl.rb
|
57
|
-
- lib/phenomenal/viewer/graphical.rb
|
58
55
|
- lib/phenomenal/viewer/textual.rb
|
56
|
+
- lib/phenomenal/viewer/graphical.rb
|
57
|
+
- lib/phenomenal/version.rb
|
58
|
+
- lib/phenomenal/error.rb
|
59
59
|
- lib/phenomenal.rb
|
60
60
|
- LICENSE
|
61
61
|
- Rakefile
|
62
62
|
- README.md
|
63
|
-
- spec/
|
64
|
-
- spec/context_spec.rb
|
65
|
-
- spec/dsl_spec.rb
|
66
|
-
- spec/feature_spec.rb
|
67
|
-
- spec/integration/adaptation_spec.rb
|
63
|
+
- spec/spec_helper.rb
|
68
64
|
- spec/integration/combined_contexts_spec.rb
|
69
|
-
- spec/integration/
|
65
|
+
- spec/integration/relationships_spec.rb
|
70
66
|
- spec/integration/conflict_policy_spec.rb
|
67
|
+
- spec/integration/adaptation_spec.rb
|
71
68
|
- spec/integration/open_context.rb
|
72
|
-
- spec/integration/
|
73
|
-
- spec/
|
69
|
+
- spec/integration/composition_spec.rb
|
70
|
+
- spec/test_classes.rb
|
74
71
|
- spec/relationships/context_relationships_spec.rb
|
75
|
-
- spec/relationships/dsl_spec.rb
|
76
72
|
- spec/relationships/feature_relationships_spec.rb
|
77
|
-
- spec/relationships/relationship_spec.rb
|
78
73
|
- spec/relationships/relationships_manager_spec.rb
|
74
|
+
- spec/relationships/dsl_spec.rb
|
79
75
|
- spec/relationships/relationships_store_spec.rb
|
80
|
-
- spec/
|
81
|
-
- spec/
|
76
|
+
- spec/relationships/relationship_spec.rb
|
77
|
+
- spec/manager_spec.rb
|
78
|
+
- spec/context_spec.rb
|
79
|
+
- spec/adaptation_spec.rb
|
80
|
+
- spec/dsl_spec.rb
|
81
|
+
- spec/feature_spec.rb
|
82
82
|
homepage: http://www.phenomenal-gem.com
|
83
83
|
licenses: []
|
84
84
|
post_install_message:
|
@@ -99,27 +99,27 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
99
|
version: '0'
|
100
100
|
requirements: []
|
101
101
|
rubyforge_project:
|
102
|
-
rubygems_version: 1.8.
|
102
|
+
rubygems_version: 1.8.24
|
103
103
|
signing_key:
|
104
104
|
specification_version: 3
|
105
105
|
summary: A context oriented programming framework for Ruby
|
106
106
|
test_files:
|
107
|
-
- spec/
|
108
|
-
- spec/context_spec.rb
|
109
|
-
- spec/dsl_spec.rb
|
110
|
-
- spec/feature_spec.rb
|
111
|
-
- spec/integration/adaptation_spec.rb
|
107
|
+
- spec/spec_helper.rb
|
112
108
|
- spec/integration/combined_contexts_spec.rb
|
113
|
-
- spec/integration/
|
109
|
+
- spec/integration/relationships_spec.rb
|
114
110
|
- spec/integration/conflict_policy_spec.rb
|
111
|
+
- spec/integration/adaptation_spec.rb
|
115
112
|
- spec/integration/open_context.rb
|
116
|
-
- spec/integration/
|
117
|
-
- spec/
|
113
|
+
- spec/integration/composition_spec.rb
|
114
|
+
- spec/test_classes.rb
|
118
115
|
- spec/relationships/context_relationships_spec.rb
|
119
|
-
- spec/relationships/dsl_spec.rb
|
120
116
|
- spec/relationships/feature_relationships_spec.rb
|
121
|
-
- spec/relationships/relationship_spec.rb
|
122
117
|
- spec/relationships/relationships_manager_spec.rb
|
118
|
+
- spec/relationships/dsl_spec.rb
|
123
119
|
- spec/relationships/relationships_store_spec.rb
|
124
|
-
- spec/
|
125
|
-
- spec/
|
120
|
+
- spec/relationships/relationship_spec.rb
|
121
|
+
- spec/manager_spec.rb
|
122
|
+
- spec/context_spec.rb
|
123
|
+
- spec/adaptation_spec.rb
|
124
|
+
- spec/dsl_spec.rb
|
125
|
+
- spec/feature_spec.rb
|