flammarion-utils 0.2.1 → 0.3.0

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.
@@ -1,12 +1,12 @@
1
- #!/usr/bin/env ruby
2
- require 'flammarion'
3
-
4
- f = Flammarion::Engraving.new(ARGV[0])
5
-
6
- begin
7
- f.live_reload_layout(ARGV[0])
8
- rescue Exception
9
- f.replace "#{$!}\n#{$!.backtrance.join("\n")}"
10
- sleep(1)
11
- retry
12
- end
1
+ #!/usr/bin/env ruby
2
+ require 'flammarion'
3
+
4
+ f = Flammarion::Engraving.new(ARGV[0])
5
+
6
+ begin
7
+ f.live_reload_layout(ARGV[0])
8
+ rescue Exception
9
+ f.replace "#{$!}\n#{$!.backtrance.join("\n")}"
10
+ sleep(1)
11
+ retry
12
+ end
@@ -1,66 +1,66 @@
1
- #!/usr/bin/env ruby
2
- require 'flammarion'
3
- require 'oga'
4
-
5
- x = Oga.parse_xml(ARGF)
6
-
7
- $f = Flammarion::Engraving.new
8
- def f; $f; end;
9
-
10
- def node_window; f.pane("nodewindow", weight: 0.85); end
11
-
12
- def history_window; f.pane("history", weight: 0.15);end
13
-
14
- history_window
15
- node_window
16
-
17
- f.orientation = :horizontal
18
-
19
- f.pane("default").hide
20
-
21
- module Oga
22
- module XML
23
- module Traversal
24
- def element_children
25
- children.select{|c| c.is_a? Element}
26
- end
27
- end
28
- class Document
29
- def parent; self; end
30
- def attributes; []; end
31
- def name; "Document"; end
32
- end
33
- end
34
- end
35
-
36
- def add_history(node)
37
- history = [node]
38
- history << history.last.parent until history.last.parent.is_a? Oga::XML::Document
39
- history_window.clear
40
- history.reverse.each do |n|
41
- history_window.button("#{n.name} #{n.attributes.map(&:to_xml).join(" ")}") do
42
- display(n)
43
- end
44
- end
45
- end
46
-
47
- def add_button(n)
48
- node_window.subpane("buttons").button("#{n.name} #{n.attributes.map(&:to_xml).join(" ")}") do |c|
49
- display(n)
50
- end
51
- end
52
-
53
- def display(node)
54
- add_history(node)
55
- node_window.clear
56
- node_window.markdown("# #{node.name}")
57
- node_window.table node.attributes.map{|a| [a.name.to_s.light_magenta, a.value]}
58
- node_window.input("CSS", history:true) do |m|
59
- node_window.subpane("buttons").clear
60
- node.css(m['text']).each {|n| add_button(n) }
61
- end
62
- node.element_children.each {|n| add_button(n) }
63
- end
64
-
65
- display(x.root_node.element_children.first)
66
- f.wait_until_closed
1
+ #!/usr/bin/env ruby
2
+ require 'flammarion'
3
+ require 'oga'
4
+
5
+ x = Oga.parse_xml(ARGF)
6
+
7
+ $f = Flammarion::Engraving.new
8
+ def f; $f; end;
9
+
10
+ def node_window; f.pane("nodewindow", weight: 0.85); end
11
+
12
+ def history_window; f.pane("history", weight: 0.15);end
13
+
14
+ history_window
15
+ node_window
16
+
17
+ f.orientation = :horizontal
18
+
19
+ f.pane("default").hide
20
+
21
+ module Oga
22
+ module XML
23
+ module Traversal
24
+ def element_children
25
+ children.select{|c| c.is_a? Element}
26
+ end
27
+ end
28
+ class Document
29
+ def parent; self; end
30
+ def attributes; []; end
31
+ def name; "Document"; end
32
+ end
33
+ end
34
+ end
35
+
36
+ def add_history(node)
37
+ history = [node]
38
+ history << history.last.parent until history.last.parent.is_a? Oga::XML::Document
39
+ history_window.clear
40
+ history.reverse.each do |n|
41
+ history_window.button("#{n.name} #{n.attributes.map(&:to_xml).join(" ")}") do
42
+ display(n)
43
+ end
44
+ end
45
+ end
46
+
47
+ def add_button(n)
48
+ node_window.subpane("buttons").button("#{n.name} #{n.attributes.map(&:to_xml).join(" ")}") do |c|
49
+ display(n)
50
+ end
51
+ end
52
+
53
+ def display(node)
54
+ add_history(node)
55
+ node_window.clear
56
+ node_window.markdown("# #{node.name}")
57
+ node_window.table node.attributes.map{|a| [a.name.to_s.light_magenta, a.value]}
58
+ node_window.input("CSS", history:true) do |m|
59
+ node_window.subpane("buttons").clear
60
+ node.css(m['text']).each {|n| add_button(n) }
61
+ end
62
+ node.element_children.each {|n| add_button(n) }
63
+ end
64
+
65
+ display(x.root_node.element_children.first)
66
+ f.wait_until_closed
metadata CHANGED
@@ -1,98 +1,95 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flammarion-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
5
- prerelease:
4
+ version: 0.3.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Zach Capalbo
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2017-02-18 00:00:00.000000000 Z
11
+ date: 2018-07-14 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: flammarion
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - '='
20
18
  - !ruby/object:Gem::Version
21
- version: 0.2.1
19
+ version: 0.3.0
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - '='
28
25
  - !ruby/object:Gem::Version
29
- version: 0.2.1
26
+ version: 0.3.0
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: oga
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  description: Extra tools using the Flammarion toolkit.
47
42
  email: zach.geek@gmail.com
48
43
  executables:
49
- - fwrap
50
- - slim-engrave
44
+ - emoji-keyboard
45
+ - engrave
51
46
  - flammarion-repl
52
- - xml-explorer
53
47
  - flammarion-services
54
48
  - frake
49
+ - fwrap
55
50
  - markdown-browser
56
- - engrave
57
- - emoji-keyboard
51
+ - repl
52
+ - services
53
+ - slim-engrave
54
+ - xml-explorer
58
55
  extensions: []
59
56
  extra_rdoc_files: []
60
57
  files:
61
58
  - LICENSE
62
59
  - Readme.md
63
- - bin/fwrap
64
- - bin/slim-engrave
60
+ - bin/emoji-keyboard
61
+ - bin/engrave
65
62
  - bin/flammarion-repl
66
- - bin/xml-explorer
67
63
  - bin/flammarion-services
68
64
  - bin/frake
65
+ - bin/fwrap
69
66
  - bin/markdown-browser
70
- - bin/engrave
71
- - bin/emoji-keyboard
67
+ - bin/repl
68
+ - bin/services
69
+ - bin/slim-engrave
70
+ - bin/xml-explorer
72
71
  homepage: https://github.com/zach-capalbo/flammarion
73
72
  licenses:
74
73
  - MIT
74
+ metadata: {}
75
75
  post_install_message:
76
76
  rdoc_options: []
77
77
  require_paths:
78
78
  - lib
79
79
  required_ruby_version: !ruby/object:Gem::Requirement
80
- none: false
81
80
  requirements:
82
- - - ! '>='
81
+ - - ">="
83
82
  - !ruby/object:Gem::Version
84
83
  version: '0'
85
84
  required_rubygems_version: !ruby/object:Gem::Requirement
86
- none: false
87
85
  requirements:
88
- - - ! '>='
86
+ - - ">="
89
87
  - !ruby/object:Gem::Version
90
88
  version: '0'
91
89
  requirements: []
92
90
  rubyforge_project:
93
- rubygems_version: 1.8.23
91
+ rubygems_version: 2.7.7
94
92
  signing_key:
95
- specification_version: 3
93
+ specification_version: 4
96
94
  summary: Tools from the Flammarion GUI Toolkit
97
95
  test_files: []
98
- has_rdoc: