card-mod-monkey 0.14.2 → 0.15.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: 52babc2698f65e82a25926dd29ec4ee06d945a900129e2f7827b1c286ce967ae
4
- data.tar.gz: 4f52f6ae6eb503d336ea916326342640a724d54c1ed07a13c2c951f7387a77e0
3
+ metadata.gz: 8b827cb59e817a2477d3b84446e25ef6b6eec1379dde01dbd0881357a1c50f5a
4
+ data.tar.gz: 28f757fff91f07dfd1b915b820ac9b5e98585633dbe87d5c6b85d0cbaa2b13f9
5
5
  SHA512:
6
- metadata.gz: fdca44cd624f36fdfaa7ce16c41a00861632e1a035c699bd224ef2f92fda74eaf06dbb66ea41326fb429624a50698c9549514b0416513784cb53677a33a617b0
7
- data.tar.gz: fc449ba49df6202c7cd410257bfb0a703a6888e174e9d5b6ba52697a5f1ba29f8b3cf2cbe3d17b76611e9fbdc14577fc140c19fb2dd6b04b0b6aaf1ed0377bc8
6
+ metadata.gz: 05175de7c3eb406f623ab01e094742020f49f7875664b9c3feaefc30ea3dc468886abe5d08ce222eb036bdf7ac3133cd92217818a15709141892250df94a2a81
7
+ data.tar.gz: a92ba92b8f5ae1931bbfd576f7b59b511f2bf4caf3c0ec13bd983ba55a5c593702c324acb6e7f0b2ab6c687b2746acfc41f6405c198eca3745c16eaaf29f83e2
@@ -2,9 +2,9 @@
2
2
 
3
3
  class AddDeveloperCards < Cardio::Migration
4
4
  def up
5
- ensure_card name: "*debug",
5
+ Card.ensure name: "*debug",
6
6
  codename: "debug"
7
- ensure_card name: "*debug+*right+*read",
7
+ Card.ensure name: "*debug+*right+*read",
8
8
  type_id: Card::PointerID,
9
9
  content: "[[Administrator]]"
10
10
  end
@@ -18,7 +18,7 @@ module Cardio
18
18
  alias_command "hg", "hist -T 20 -G", desc: "Up to 20 commands matching expression"
19
19
  alias_command "hG", "hist -G", desc: "Commands matching expression ever used"
20
20
  alias_command "hr", "hist -r", desc: "hist -r <command number> to run a command"
21
- alias_command "clear", "break --delete-all", desc: "remove all break points"
21
+ # alias_command "clear", "break --delete-all", desc: "remove all break points"
22
22
 
23
23
  # Hit Enter to repeat last command
24
24
  ::Pry::Commands.command(/^$/, "repeat last command") do
@@ -1,14 +1,14 @@
1
- def virtual?
2
- new?
3
- end
4
-
5
1
  format :html do
6
- view :core do
7
- core_section_config(card.left).map do |item|
2
+ view :debug, perms: :always_ok? do
3
+ core_section_config(card).map do |item|
8
4
  section(*item)
9
5
  end
10
6
  end
11
7
 
8
+ def always_ok?
9
+ Card::Auth.always_ok?
10
+ end
11
+
12
12
  def core_section_config subject
13
13
  [["Sets", tabs("set modules" => set_modules_accordion(subject),
14
14
  "all modules" => singleton_modules_list(subject),
@@ -22,12 +22,20 @@ format :html do
22
22
  end
23
23
 
24
24
  def set_modules_accordion subject
25
- sets = subject.set_modules.each_with_object({}) do |sm, hash|
25
+ accordion do
26
+ set_module_ancestor_hash(subject).each_with_object([]) do |(setmod, anc), array|
27
+ context = setmod.to_name.key
28
+ array << accordion_item(setmod, body: list_group(anc), context: context)
29
+ end
30
+ end
31
+ end
32
+
33
+ def set_module_ancestor_hash subject
34
+ subject.set_modules.each_with_object({}) do |sm, hash|
26
35
  ans = sm.ancestors
27
36
  ans.shift
28
- hash[sm.to_s] = ans
37
+ hash[sm.to_s] = ans if ans.present?
29
38
  end
30
- accordion_group sets
31
39
  end
32
40
 
33
41
  def set_patterns_breadcrumb subject
@@ -63,25 +71,25 @@ format :html do
63
71
  )
64
72
  end
65
73
 
66
- def class_locations klass
67
- methods = defined_methods(klass)
68
- file_groups = methods.group_by { |sl| sl[0] }
69
- file_counts = file_groups.map do |file, sls|
70
- lines = sls.map { |sl| sl[1] }
71
- count = lines.size
72
- line = lines.min
73
- { file: file, count: count, line: line }
74
- end
75
- file_counts.sort_by! { |fc| fc[:count] }
76
- file_counts.map { |fc| [fc[:file], fc[:line]] }
77
- end
78
-
79
- def defined_methods klass
80
- methods =
81
- klass.methods(false).map { |m| klass.method(m) } +
82
- klass.instance_methods(false).map { |m| klass.instance_method(m) }
83
- methods.map!(&:source_location)
84
- methods.compact!
85
- methods
86
- end
74
+ # def class_locations klass
75
+ # methods = defined_methods(klass)
76
+ # file_groups = methods.group_by { |sl| sl[0] }
77
+ # file_counts = file_groups.map do |file, sls|
78
+ # lines = sls.map { |sl| sl[1] }
79
+ # count = lines.size
80
+ # line = lines.min
81
+ # { file: file, count: count, line: line }
82
+ # end
83
+ # file_counts.sort_by! { |fc| fc[:count] }
84
+ # file_counts.map { |fc| [fc[:file], fc[:line]] }
85
+ # end
86
+ #
87
+ # def defined_methods klass
88
+ # methods =
89
+ # klass.methods(false).map { |m| klass.method(m) } +
90
+ # klass.instance_methods(false).map { |m| klass.instance_method(m) }
91
+ # methods.map!(&:source_location)
92
+ # methods.compact!
93
+ # methods
94
+ # end
87
95
  end
data/set/all/event_viz.rb CHANGED
@@ -13,7 +13,7 @@
13
13
  # prevent events from showing up in the tree.
14
14
  def events action
15
15
  @action = action
16
- events = Director::Stages::STAGES.map { |stage| events_tree "#{stage}_stage" }
16
+ events = Director::Stages::SYMBOLS.map { |stage| events_tree "#{stage}_stage" }
17
17
  @action = nil
18
18
  print_events events
19
19
  end
data/set/all/view_viz.rb CHANGED
@@ -1,19 +1,11 @@
1
1
  format :html do
2
2
  view :views_by_format do
3
- format_views =
4
- self.class.ancestors.each_with_object({}) do |format_class, hash|
5
- views =
6
- format_class.instance_methods.map do |method|
7
- next unless method.to_s =~ /^_view_(.+)$/
8
-
9
- Regexp.last_match(1)
10
- end.compact
11
- next unless views.present?
12
-
13
- format_class.name =~ /^Card(::Set)?::(.+?)$/ #::(\w+Format)
14
- hash[Regexp.last_match(2)] = views
3
+ accordion do
4
+ views_by_format_hash.each_with_object([]) do |(format, views), array|
5
+ context = format.to_name.key
6
+ array << accordion_item(format, body: list_group(views), context: context)
15
7
  end
16
- accordion_group format_views
8
+ end
17
9
  end
18
10
 
19
11
  view :views_by_name do
@@ -22,4 +14,23 @@ format :html do
22
14
  end.compact.sort
23
15
  list_group views
24
16
  end
17
+
18
+ private
19
+
20
+ def views_by_format_hash
21
+ self.class.ancestors.each_with_object({}) do |format_class, hash|
22
+ next unless (views = views_for_format_class format_class).present?
23
+
24
+ format_class.name =~ /^Card(::Set)?::(.+?)$/ #::(\w+Format)
25
+ hash[Regexp.last_match(2)] = views
26
+ end
27
+ end
28
+
29
+ def views_for_format_class format_class
30
+ format_class.instance_methods.map do |method|
31
+ next unless method.to_s =~ /^_view_(.+)$/
32
+
33
+ Regexp.last_match(1)
34
+ end.compact
35
+ end
25
36
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card-mod-monkey
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.2
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-01-08 00:00:00.000000000 Z
13
+ date: 2023-01-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: card
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.104.2
21
+ version: 1.105.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 1.104.2
28
+ version: 1.105.0
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: html2haml
31
31
  requirement: !ruby/object:Gem::Requirement
@@ -137,9 +137,9 @@ files:
137
137
  - lib/cardio/pry.rb
138
138
  - lib/cardio/pry/commands.rb
139
139
  - lib/cardio/pry/intro.txt
140
+ - set/all/debug.rb
140
141
  - set/all/event_viz.rb
141
142
  - set/all/view_viz.rb
142
- - set/right/debug.rb
143
143
  homepage: https://decko.org
144
144
  licenses:
145
145
  - GPL-3.0
@@ -150,6 +150,7 @@ metadata:
150
150
  wiki_uri: https://decko.org
151
151
  documentation_url: http://docs.decko.org/
152
152
  card-mod: monkey
153
+ card-mod-group: gem-defaults
153
154
  post_install_message:
154
155
  rdoc_options: []
155
156
  require_paths:
@@ -165,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
165
166
  - !ruby/object:Gem::Version
166
167
  version: '0'
167
168
  requirements: []
168
- rubygems_version: 3.2.15
169
+ rubygems_version: 3.3.11
169
170
  signing_key:
170
171
  specification_version: 4
171
172
  summary: dev support for mod developers (monkeys)