xvert 0.2.0 → 0.4.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: 1f3a39e3dbf8e60d7966f13c9191eabbbc3eff872f8371bf4eb61e79d61d113c
4
- data.tar.gz: 7138515754cfbd83bb61b8ad32e6998928bc4b84a1087593b1960d6bacbbb757
3
+ metadata.gz: 9231fe692aff9177333abefe1e4897344e7fad25bc23f5a2d1ae727e426074ae
4
+ data.tar.gz: a22c41ca45fca4f9fea325d2681abbe9860b190ef4bd19ca624898428dbafdd7
5
5
  SHA512:
6
- metadata.gz: 1fdbe1355d42520c33a072350aa3cd279ee34489c8c5d20fc7a6388dc9fe0dbcb210cde1b23e9341d2d18d89bd576d0e2432524f1fa67e4110fc8b3ee389912c
7
- data.tar.gz: 9942a4f3cda3e6a9901bb70718b7b045c1bcd4899bfbb477f140659a14102a8eb68abb85818309d507c37ef23a29d3d185cdaa83d69d2993986d5e5f014a0acf
6
+ metadata.gz: dee6203944dce7aa431e2b224098cd86123e9bc6a1c1b3ea48f03827fad2d87c87d72408ad26b8d3640d4f37e36cf1a4e7c5bff8cfe6565dc5956992e2419dc4
7
+ data.tar.gz: 7dbcfbba081b4d14e29393f1360ec4bc2f12784cf07788f02c0e03104e29ff0772328dca3c42eee62d321b315b60ea1ffdc612f3f54d6ddc2f3d96cc71d7b496
data/.rubocop.yml CHANGED
@@ -18,3 +18,4 @@ Layout/LineLength:
18
18
  Metrics/MethodLength:
19
19
  Exclude:
20
20
  - 'test/**/*'
21
+ - 'tapes/**/*'
data/Gemfile.lock CHANGED
@@ -1,8 +1,11 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- xvert (0.2.0)
4
+ xvert (0.4.0)
5
+ activesupport (~> 7.0.0)
6
+ builder (~> 3.2.0)
5
7
  json (~> 2.6.0)
8
+ rouge (~> 4.1.0)
6
9
  thor (~> 1.2.0)
7
10
  toml-rb (~> 2.2.0)
8
11
  yaml (~> 0.2.0)
@@ -10,9 +13,18 @@ PATH
10
13
  GEM
11
14
  remote: https://rubygems.org/
12
15
  specs:
16
+ activesupport (7.0.4.3)
17
+ concurrent-ruby (~> 1.0, >= 1.0.2)
18
+ i18n (>= 1.6, < 2)
19
+ minitest (>= 5.1)
20
+ tzinfo (~> 2.0)
13
21
  ast (2.4.2)
22
+ builder (3.2.4)
14
23
  citrus (3.0.2)
24
+ concurrent-ruby (1.2.2)
15
25
  docile (1.4.0)
26
+ i18n (1.13.0)
27
+ concurrent-ruby (~> 1.0)
16
28
  json (2.6.3)
17
29
  minitest (5.18.0)
18
30
  parallel (1.23.0)
@@ -22,6 +34,7 @@ GEM
22
34
  rake (13.0.6)
23
35
  regexp_parser (2.8.0)
24
36
  rexml (3.2.5)
37
+ rouge (4.1.0)
25
38
  rubocop (1.50.2)
26
39
  json (~> 2.3)
27
40
  parallel (~> 1.10)
@@ -47,6 +60,8 @@ GEM
47
60
  thor (1.2.1)
48
61
  toml-rb (2.2.0)
49
62
  citrus (~> 3.0, > 3.0)
63
+ tzinfo (2.0.6)
64
+ concurrent-ruby (~> 1.0)
50
65
  unicode-display_width (2.4.2)
51
66
  yaml (0.2.1)
52
67
 
data/README.md CHANGED
@@ -19,21 +19,46 @@ $ gem install xvert
19
19
  ```console
20
20
  $ xvert help
21
21
  Commands:
22
+ xvert --version, -v # Print Xvert version
22
23
  xvert help [COMMAND] # Describe available commands or one specific command
23
24
  xvert jt # Convert JSON to TOML
25
+ xvert jx # Convert JSON to XML
24
26
  xvert jy # Convert JSON to YAML
25
27
  xvert tj # Convert TOML to JSON
28
+ xvert tx # Convert TOML to XML
26
29
  xvert ty # Convert TOML to YAML
30
+ xvert xj # Convert XML to JSON
31
+ xvert xt # Convert XML to TOML
32
+ xvert xy # Convert XML to YAML
27
33
  xvert yj # Convert YAML to JSON
28
34
  xvert yt # Convert YAML to TOML
35
+ xvert yx # Convert YAML to XML
29
36
  ```
30
37
 
38
+ - [JSON to JSON](#json-to-json)
31
39
  - [JSON to TOML](#json-to-toml)
40
+ - [JSON to XML](#json-to-xml)
32
41
  - [JSON to YAML](#json-to-yaml)
33
42
  - [TOML to JSON](#toml-to-json)
43
+ - [TOML to TOML](#toml-to-toml)
44
+ - [TOML to XML](#toml-to-xml)
34
45
  - [TOML to YAML](#toml-to-yaml)
46
+ - [XML to JSON](#xml-to-json)
47
+ - [XML to TOML](#xml-to-toml)
48
+ - [XML to XML](#xml-to-xml)
49
+ - [XML to YAML](#xml-to-yaml)
35
50
  - [YAML to JSON](#yaml-to-json)
36
51
  - [YAML to TOML](#yaml-to-toml)
52
+ - [YAML to XML](#yaml-to-xml)
53
+ - [YAML to YAML](#yaml-to-yaml)
54
+
55
+ ### JSON to JSON
56
+
57
+ ```console
58
+ $ xvert jj < foo.json
59
+ ```
60
+
61
+ ![](./assets/jj.gif)
37
62
 
38
63
  ### JSON to TOML
39
64
 
@@ -43,6 +68,14 @@ $ xvert jt < foo.json
43
68
 
44
69
  ![](./assets/jt.gif)
45
70
 
71
+ ### JSON to XML
72
+
73
+ ```console
74
+ $ xvert jx < foo.json
75
+ ```
76
+
77
+ ![](./assets/jx.gif)
78
+
46
79
  ### JSON to YAML
47
80
 
48
81
  ```console
@@ -59,6 +92,22 @@ $ xvert tj < foo.toml
59
92
 
60
93
  ![](./assets/tj.gif)
61
94
 
95
+ ### TOML to TOML
96
+
97
+ ```console
98
+ $ xvert tt < foo.toml
99
+ ```
100
+
101
+ ![](./assets/tt.gif)
102
+
103
+ ### TOML to XML
104
+
105
+ ```console
106
+ $ xvert tx < foo.toml
107
+ ```
108
+
109
+ ![](./assets/tx.gif)
110
+
62
111
  ### TOML to YAML
63
112
 
64
113
  ```console
@@ -67,6 +116,38 @@ $ xvert ty < foo.toml
67
116
 
68
117
  ![](./assets/ty.gif)
69
118
 
119
+ ### XML to JSON
120
+
121
+ ```console
122
+ $ xvert xj < foo.xml
123
+ ```
124
+
125
+ ![](./assets/xj.gif)
126
+
127
+ ### XML to TOML
128
+
129
+ ```console
130
+ $ xvert xt < foo.xml
131
+ ```
132
+
133
+ ![](./assets/xt.gif)
134
+
135
+ ### XML to XML
136
+
137
+ ```console
138
+ $ xvert xx < foo.xml
139
+ ```
140
+
141
+ ![](./assets/xx.gif)
142
+
143
+ ### XML to YAML
144
+
145
+ ```console
146
+ $ xvert xy < foo.xml
147
+ ```
148
+
149
+ ![](./assets/xy.gif)
150
+
70
151
  ### YAML to JSON
71
152
 
72
153
  ```console
@@ -83,6 +164,22 @@ $ xvert yt < foo.yaml
83
164
 
84
165
  ![](./assets/yt.gif)
85
166
 
167
+ ### YAML to XML
168
+
169
+ ```console
170
+ $ xvert yx < foo.yaml
171
+ ```
172
+
173
+ ![](./assets/yx.gif)
174
+
175
+ ### YAML to YAML
176
+
177
+ ```console
178
+ $ xvert yy < foo.yaml
179
+ ```
180
+
181
+ ![](./assets/yy.gif)
182
+
86
183
  ## License
87
184
 
88
185
  [MIT License](./LICENSE.txt)
data/assets/jj.gif ADDED
Binary file
data/assets/jt.gif CHANGED
Binary file
data/assets/jx.gif ADDED
Binary file
data/assets/jy.gif CHANGED
Binary file
data/assets/tj.gif CHANGED
Binary file
data/assets/tt.gif ADDED
Binary file
data/assets/tx.gif ADDED
Binary file
data/assets/ty.gif CHANGED
Binary file
data/assets/xj.gif ADDED
Binary file
data/assets/xt.gif ADDED
Binary file
data/assets/xx.gif ADDED
Binary file
data/assets/xy.gif ADDED
Binary file
data/assets/yj.gif CHANGED
Binary file
data/assets/yt.gif CHANGED
Binary file
data/assets/yx.gif ADDED
Binary file
data/assets/yy.gif ADDED
Binary file
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xvert
4
+ class CLI < Thor
5
+ desc "jj", "Convert JSON to JSON"
6
+ def jj
7
+ j(:json)
8
+ end
9
+
10
+ desc "jy", "Convert JSON to YAML"
11
+ def jy
12
+ j(:yaml)
13
+ end
14
+
15
+ desc "jt", "Convert JSON to TOML"
16
+ def jt
17
+ j(:toml)
18
+ end
19
+
20
+ desc "jx", "Convert JSON to XML"
21
+ def jx
22
+ j(:xml)
23
+ end
24
+
25
+ private
26
+
27
+ def j(format)
28
+ run(from: :json, to: format)
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xvert
4
+ class CLI < Thor
5
+ desc "tj", "Convert TOML to JSON"
6
+ def tj
7
+ t(:json)
8
+ end
9
+
10
+ desc "tt", "Convert TOML to TOML"
11
+ def tt
12
+ t(:toml)
13
+ end
14
+
15
+ desc "ty", "Convert TOML to YAML"
16
+ def ty
17
+ t(:yaml)
18
+ end
19
+
20
+ desc "tx", "Convert TOML to XML"
21
+ def tx
22
+ t(:xml)
23
+ end
24
+
25
+ private
26
+
27
+ def t(format)
28
+ run(from: :toml, to: format)
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xvert
4
+ class CLI < Thor
5
+ desc "xj", "Convert XML to JSON"
6
+ def xj
7
+ x(:json)
8
+ end
9
+
10
+ desc "xt", "Convert XML to TOML"
11
+ def xt
12
+ x(:toml)
13
+ end
14
+
15
+ desc "xx", "Convert XML to XML"
16
+ def xx
17
+ x(:xml)
18
+ end
19
+
20
+ desc "xy", "Convert XML to YAML"
21
+ def xy
22
+ x(:yaml)
23
+ end
24
+
25
+ private
26
+
27
+ def x(format)
28
+ run(from: :xml, to: format)
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xvert
4
+ class CLI < Thor
5
+ desc "yj", "Convert YAML to JSON"
6
+ def yj
7
+ y(:json)
8
+ end
9
+
10
+ desc "yt", "Convert YAML to TOML"
11
+ def yt
12
+ y(:toml)
13
+ end
14
+
15
+ desc "yx", "Convert YAML to XML"
16
+ def yx
17
+ y(:xml)
18
+ end
19
+
20
+ desc "yy", "Convert YAML to YAML"
21
+ def yy
22
+ y(:yaml)
23
+ end
24
+
25
+ private
26
+
27
+ def y(format)
28
+ run(from: :yaml, to: format)
29
+ end
30
+ end
31
+ end
data/lib/xvert/cli.rb CHANGED
@@ -1,6 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "rouge"
3
4
  require "thor"
5
+ require_relative "cli/json"
6
+ require_relative "cli/toml"
7
+ require_relative "cli/xml"
8
+ require_relative "cli/yaml"
4
9
 
5
10
  module Xvert
6
11
  class CLI < Thor
@@ -17,52 +22,31 @@ module Xvert
17
22
  puts ::Xvert::VERSION
18
23
  end
19
24
 
20
- #
21
- # JSON => X
22
- #
23
-
24
- desc "jy", "Convert JSON to YAML"
25
- def jy
26
- run(from: :json, to: :yaml)
27
- end
28
-
29
- desc "jt", "Convert JSON to TOML"
30
- def jt
31
- run(from: :json, to: :toml)
32
- end
33
-
34
- #
35
- # YAML => X
36
- #
37
-
38
- desc "yj", "Convert YAML to JSON"
39
- def yj
40
- run(from: :yaml, to: :json)
41
- end
25
+ private
42
26
 
43
- desc "yt", "Convert YAML to TOML"
44
- def yt
45
- run(from: :yaml, to: :toml)
27
+ def run(from:, to:)
28
+ text = ::Xvert.convert(input, from: from, to: to).chomp
29
+ puts highlight(text, to)
46
30
  end
47
31
 
48
- #
49
- # TOML => X
50
- #
32
+ def highlight(text, format)
33
+ return text unless $stdout.isatty
51
34
 
52
- desc "tj", "Convert TOML to JSON"
53
- def tj
54
- run(from: :toml, to: :json)
35
+ formatter(Rouge::Themes::Monokai.new).format(lexer(format).lex(text))
55
36
  end
56
37
 
57
- desc "ty", "Convert TOML to YAML"
58
- def ty
59
- run(from: :toml, to: :yaml)
38
+ def formatter(theme)
39
+ Rouge::Formatters::Terminal256.new(theme)
60
40
  end
61
41
 
62
- private
63
-
64
- def run(from:, to:)
65
- puts ::Xvert.convert(input, from: from, to: to)
42
+ def lexer(format)
43
+ case format
44
+ when :json then Rouge::Lexers::JSON.new
45
+ when :toml then Rouge::Lexers::TOML.new
46
+ when :yaml then Rouge::Lexers::YAML.new
47
+ when :xml then Rouge::Lexers::XML.new
48
+ else raise UnsupportedFormatError, format
49
+ end
66
50
  end
67
51
 
68
52
  def input
data/lib/xvert/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Xvert
4
- VERSION = "0.2.0"
4
+ VERSION = "0.4.0"
5
5
  end
data/lib/xvert.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "active_support"
4
+ require "active_support/core_ext/hash"
3
5
  require "json"
4
6
  require "toml-rb"
5
7
  require "yaml"
@@ -7,7 +9,11 @@ require_relative "xvert/version"
7
9
  require_relative "xvert/cli"
8
10
 
9
11
  module Xvert
10
- class UnsupportedFormatError < StandardError; end
12
+ class UnsupportedFormatError < StandardError
13
+ def initialize(format)
14
+ super("Unsupported format: #{format}")
15
+ end
16
+ end
11
17
 
12
18
  class << self
13
19
  def convert(text, from:, to:)
@@ -18,18 +24,20 @@ module Xvert
18
24
  def to_object(text, format:)
19
25
  case format
20
26
  when :json then json_to_object(text)
21
- when :yaml then yaml_to_object(text)
22
27
  when :toml then toml_to_object(text)
23
- else raise UnsupportedFormatError, "Unsupported format: #{format}"
28
+ when :yaml then yaml_to_object(text)
29
+ when :xml then xml_to_object(text)
30
+ else raise UnsupportedFormatError, format
24
31
  end
25
32
  end
26
33
 
27
34
  def to_text(object, format:)
28
35
  case format
29
36
  when :json then object_to_json(object)
30
- when :yaml then object_to_yaml(object)
31
37
  when :toml then object_to_toml(object)
32
- else raise UnsupportedFormatError, "Unsupported format: #{format}"
38
+ when :yaml then object_to_yaml(object)
39
+ when :xml then object_to_xml(object)
40
+ else raise UnsupportedFormatError, format
33
41
  end
34
42
  end
35
43
 
@@ -45,16 +53,6 @@ module Xvert
45
53
  JSON.pretty_generate(object)
46
54
  end
47
55
 
48
- # YAML
49
-
50
- def yaml_to_object(text)
51
- YAML.unsafe_load(text)
52
- end
53
-
54
- def object_to_yaml(object)
55
- YAML.dump(object)
56
- end
57
-
58
56
  # TOML
59
57
 
60
58
  def toml_to_object(text)
@@ -64,5 +62,25 @@ module Xvert
64
62
  def object_to_toml(object)
65
63
  TomlRB.dump(object)
66
64
  end
65
+
66
+ # XML
67
+
68
+ def xml_to_object(text)
69
+ Hash.from_xml(text)
70
+ end
71
+
72
+ def object_to_xml(object)
73
+ object.to_xml(root: :root)
74
+ end
75
+
76
+ # YAML
77
+
78
+ def yaml_to_object(text)
79
+ YAML.unsafe_load(text)
80
+ end
81
+
82
+ def object_to_yaml(object)
83
+ YAML.dump(object)
84
+ end
67
85
  end
68
86
  end
data/tapes/foo.json CHANGED
@@ -1 +1 @@
1
- {"message":"hello world"}
1
+ {"foo":"bar","baz":"qux"}
data/tapes/foo.toml CHANGED
@@ -1 +1,2 @@
1
- message = "hello world"
1
+ foo="bar"
2
+ baz="qux"
data/tapes/foo.xml ADDED
@@ -0,0 +1 @@
1
+ <?xml version="1.0" encoding="UTF-8"?><root><foo>bar</foo><baz>qux</baz></root>
data/tapes/foo.yaml CHANGED
@@ -1 +1,2 @@
1
- message: hello world
1
+ foo: bar
2
+ baz: qux
data/tapes/jj.tape ADDED
@@ -0,0 +1,21 @@
1
+ Output assets/jj.gif
2
+
3
+ Require xvert
4
+
5
+ Set Shell "bash"
6
+ Set FontSize 32
7
+ Set Width 1200
8
+ Set Height 600
9
+
10
+ Hide
11
+ Type "cd ./tapes" Enter
12
+ Ctrl+l
13
+ Show
14
+
15
+ Type "cat foo.json" Sleep 500ms Enter Sleep 500ms
16
+ Sleep 1s
17
+ Type "clear" Sleep 500ms Enter Sleep 500ms
18
+
19
+ Type "xvert jj < foo.json" Sleep 500ms Enter
20
+
21
+ Sleep 5s
data/tapes/jx.tape ADDED
@@ -0,0 +1,21 @@
1
+ Output assets/jx.gif
2
+
3
+ Require xvert
4
+
5
+ Set Shell "bash"
6
+ Set FontSize 32
7
+ Set Width 1200
8
+ Set Height 600
9
+
10
+ Hide
11
+ Type "cd ./tapes" Enter
12
+ Ctrl+l
13
+ Show
14
+
15
+ Type "cat foo.json" Sleep 500ms Enter Sleep 500ms
16
+ Sleep 1s
17
+ Type "clear" Sleep 500ms Enter Sleep 500ms
18
+
19
+ Type "xvert jx < foo.json" Sleep 500ms Enter
20
+
21
+ Sleep 5s
data/tapes/tt.tape ADDED
@@ -0,0 +1,21 @@
1
+ Output assets/tt.gif
2
+
3
+ Require xvert
4
+
5
+ Set Shell "bash"
6
+ Set FontSize 32
7
+ Set Width 1200
8
+ Set Height 600
9
+
10
+ Hide
11
+ Type "cd ./tapes" Enter
12
+ Ctrl+l
13
+ Show
14
+
15
+ Type "cat foo.toml" Sleep 500ms Enter Sleep 500ms
16
+ Sleep 1s
17
+ Type "clear" Sleep 500ms Enter Sleep 500ms
18
+
19
+ Type "xvert tt < foo.toml" Sleep 500ms Enter
20
+
21
+ Sleep 5s
data/tapes/tx.tape ADDED
@@ -0,0 +1,21 @@
1
+ Output assets/tx.gif
2
+
3
+ Require xvert
4
+
5
+ Set Shell "bash"
6
+ Set FontSize 32
7
+ Set Width 1200
8
+ Set Height 600
9
+
10
+ Hide
11
+ Type "cd ./tapes" Enter
12
+ Ctrl+l
13
+ Show
14
+
15
+ Type "cat foo.toml" Sleep 500ms Enter Sleep 500ms
16
+ Sleep 1s
17
+ Type "clear" Sleep 500ms Enter Sleep 500ms
18
+
19
+ Type "xvert tx < foo.toml" Sleep 500ms Enter
20
+
21
+ Sleep 5s
data/tapes/update.rb ADDED
@@ -0,0 +1,99 @@
1
+ # frozen_string_literal: true
2
+
3
+ COMMANDS = [
4
+ # JSON
5
+ "jj", "jt", "jx", "jy",
6
+ # TOML
7
+ "tj", "tt", "tx", "ty",
8
+ # XML
9
+ "xj", "xt", "xx", "xy",
10
+ # YAML
11
+ "yj", "yt", "yx", "yy"
12
+ ].sort
13
+
14
+ def update_tapes
15
+ COMMANDS.each do |command|
16
+ from_format, = extract_formats(command)
17
+ foo_filename = "foo.#{from_format}"
18
+
19
+ tape = <<~TAPE
20
+ Output assets/#{command}.gif
21
+
22
+ Require xvert
23
+
24
+ Set Shell "bash"
25
+ Set FontSize 32
26
+ Set Width 1200
27
+ Set Height 600
28
+
29
+ Hide
30
+ Type "cd ./tapes" Enter
31
+ Ctrl+l
32
+ Show
33
+
34
+ Type "cat #{foo_filename}" Sleep 500ms Enter Sleep 500ms
35
+ Sleep 1s
36
+ Type "clear" Sleep 500ms Enter Sleep 500ms
37
+
38
+ Type "xvert #{command} < #{foo_filename}" Sleep 500ms Enter
39
+
40
+ Sleep 5s
41
+ TAPE
42
+ tape_filename = "tapes/#{command}.tape"
43
+
44
+ File.write(tape_filename, tape)
45
+ `vhs < #{tape_filename}`
46
+ end
47
+ end
48
+
49
+ def print_usage
50
+ puts <<~TEXT
51
+ ## Usage
52
+
53
+ ```console
54
+ $ xvert help
55
+ #{`xvert help`.strip}
56
+ ```
57
+
58
+ #{
59
+ COMMANDS.map do |command|
60
+ from, to = extract_formats(command)
61
+ "- [#{from.upcase} to #{to.upcase}](##{from}-to-#{to})"
62
+ end.join("\n")
63
+ }
64
+
65
+ #{
66
+ COMMANDS.map do |command|
67
+ from, to = extract_formats(command)
68
+
69
+ <<~TEXT
70
+ ### #{from.upcase} to #{to.upcase}
71
+
72
+ ```console
73
+ $ xvert #{command} < foo.#{from}
74
+ ```
75
+
76
+ ![](./assets/#{command}.gif)
77
+ TEXT
78
+ end.join("\n")
79
+ }
80
+ TEXT
81
+ end
82
+
83
+ def extract_formats(command)
84
+ [extract_format(command[0]), extract_format(command[1])]
85
+ end
86
+
87
+ def extract_format(char)
88
+ {
89
+ "j" => "json",
90
+ "t" => "toml",
91
+ "y" => "yaml",
92
+ "x" => "xml"
93
+ }[char]
94
+ end
95
+
96
+ case ARGV[0]
97
+ when "tapes" then update_tapes
98
+ when "usage" then print_usage
99
+ end
data/tapes/xj.tape ADDED
@@ -0,0 +1,21 @@
1
+ Output assets/xj.gif
2
+
3
+ Require xvert
4
+
5
+ Set Shell "bash"
6
+ Set FontSize 32
7
+ Set Width 1200
8
+ Set Height 600
9
+
10
+ Hide
11
+ Type "cd ./tapes" Enter
12
+ Ctrl+l
13
+ Show
14
+
15
+ Type "cat foo.xml" Sleep 500ms Enter Sleep 500ms
16
+ Sleep 1s
17
+ Type "clear" Sleep 500ms Enter Sleep 500ms
18
+
19
+ Type "xvert xj < foo.xml" Sleep 500ms Enter
20
+
21
+ Sleep 5s
data/tapes/xt.tape ADDED
@@ -0,0 +1,21 @@
1
+ Output assets/xt.gif
2
+
3
+ Require xvert
4
+
5
+ Set Shell "bash"
6
+ Set FontSize 32
7
+ Set Width 1200
8
+ Set Height 600
9
+
10
+ Hide
11
+ Type "cd ./tapes" Enter
12
+ Ctrl+l
13
+ Show
14
+
15
+ Type "cat foo.xml" Sleep 500ms Enter Sleep 500ms
16
+ Sleep 1s
17
+ Type "clear" Sleep 500ms Enter Sleep 500ms
18
+
19
+ Type "xvert xt < foo.xml" Sleep 500ms Enter
20
+
21
+ Sleep 5s
data/tapes/xx.tape ADDED
@@ -0,0 +1,21 @@
1
+ Output assets/xx.gif
2
+
3
+ Require xvert
4
+
5
+ Set Shell "bash"
6
+ Set FontSize 32
7
+ Set Width 1200
8
+ Set Height 600
9
+
10
+ Hide
11
+ Type "cd ./tapes" Enter
12
+ Ctrl+l
13
+ Show
14
+
15
+ Type "cat foo.xml" Sleep 500ms Enter Sleep 500ms
16
+ Sleep 1s
17
+ Type "clear" Sleep 500ms Enter Sleep 500ms
18
+
19
+ Type "xvert xx < foo.xml" Sleep 500ms Enter
20
+
21
+ Sleep 5s
data/tapes/xy.tape ADDED
@@ -0,0 +1,21 @@
1
+ Output assets/xy.gif
2
+
3
+ Require xvert
4
+
5
+ Set Shell "bash"
6
+ Set FontSize 32
7
+ Set Width 1200
8
+ Set Height 600
9
+
10
+ Hide
11
+ Type "cd ./tapes" Enter
12
+ Ctrl+l
13
+ Show
14
+
15
+ Type "cat foo.xml" Sleep 500ms Enter Sleep 500ms
16
+ Sleep 1s
17
+ Type "clear" Sleep 500ms Enter Sleep 500ms
18
+
19
+ Type "xvert xy < foo.xml" Sleep 500ms Enter
20
+
21
+ Sleep 5s
data/tapes/yx.tape ADDED
@@ -0,0 +1,21 @@
1
+ Output assets/yx.gif
2
+
3
+ Require xvert
4
+
5
+ Set Shell "bash"
6
+ Set FontSize 32
7
+ Set Width 1200
8
+ Set Height 600
9
+
10
+ Hide
11
+ Type "cd ./tapes" Enter
12
+ Ctrl+l
13
+ Show
14
+
15
+ Type "cat foo.yaml" Sleep 500ms Enter Sleep 500ms
16
+ Sleep 1s
17
+ Type "clear" Sleep 500ms Enter Sleep 500ms
18
+
19
+ Type "xvert yx < foo.yaml" Sleep 500ms Enter
20
+
21
+ Sleep 5s
data/tapes/yy.tape ADDED
@@ -0,0 +1,21 @@
1
+ Output assets/yy.gif
2
+
3
+ Require xvert
4
+
5
+ Set Shell "bash"
6
+ Set FontSize 32
7
+ Set Width 1200
8
+ Set Height 600
9
+
10
+ Hide
11
+ Type "cd ./tapes" Enter
12
+ Ctrl+l
13
+ Show
14
+
15
+ Type "cat foo.yaml" Sleep 500ms Enter Sleep 500ms
16
+ Sleep 1s
17
+ Type "clear" Sleep 500ms Enter Sleep 500ms
18
+
19
+ Type "xvert yy < foo.yaml" Sleep 500ms Enter
20
+
21
+ Sleep 5s
data/xvert.gemspec CHANGED
@@ -25,7 +25,10 @@ Gem::Specification.new do |spec|
25
25
  spec.executables = spec.files.grep(%r{\Abin/}) { |f| File.basename(f) }
26
26
  spec.require_paths = ["lib"]
27
27
 
28
+ spec.add_runtime_dependency "activesupport", "~> 7.0.0"
29
+ spec.add_runtime_dependency "builder", "~> 3.2.0"
28
30
  spec.add_runtime_dependency "json", "~> 2.6.0"
31
+ spec.add_runtime_dependency "rouge", "~> 4.1.0"
29
32
  spec.add_runtime_dependency "thor", "~> 1.2.0"
30
33
  spec.add_runtime_dependency "toml-rb", "~> 2.2.0"
31
34
  spec.add_runtime_dependency "yaml", "~> 0.2.0"
metadata CHANGED
@@ -1,15 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xvert
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - koki-develop
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-07 00:00:00.000000000 Z
11
+ date: 2023-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 7.0.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 7.0.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: builder
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 3.2.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 3.2.0
13
41
  - !ruby/object:Gem::Dependency
14
42
  name: json
15
43
  requirement: !ruby/object:Gem::Requirement
@@ -24,6 +52,20 @@ dependencies:
24
52
  - - "~>"
25
53
  - !ruby/object:Gem::Version
26
54
  version: 2.6.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: rouge
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 4.1.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 4.1.0
27
69
  - !ruby/object:Gem::Dependency
28
70
  name: thor
29
71
  requirement: !ruby/object:Gem::Requirement
@@ -81,27 +123,53 @@ files:
81
123
  - LICENSE.txt
82
124
  - README.md
83
125
  - Rakefile
126
+ - assets/jj.gif
84
127
  - assets/jt.gif
128
+ - assets/jx.gif
85
129
  - assets/jy.gif
86
130
  - assets/tj.gif
131
+ - assets/tt.gif
132
+ - assets/tx.gif
87
133
  - assets/ty.gif
134
+ - assets/xj.gif
135
+ - assets/xt.gif
136
+ - assets/xx.gif
137
+ - assets/xy.gif
88
138
  - assets/yj.gif
89
139
  - assets/yt.gif
140
+ - assets/yx.gif
141
+ - assets/yy.gif
90
142
  - bin/xvert
91
143
  - lib/xvert.rb
92
144
  - lib/xvert/cli.rb
145
+ - lib/xvert/cli/json.rb
146
+ - lib/xvert/cli/toml.rb
147
+ - lib/xvert/cli/xml.rb
148
+ - lib/xvert/cli/yaml.rb
93
149
  - lib/xvert/version.rb
94
150
  - renovate.json
95
151
  - sig/xvert.rbs
96
152
  - tapes/foo.json
97
153
  - tapes/foo.toml
154
+ - tapes/foo.xml
98
155
  - tapes/foo.yaml
156
+ - tapes/jj.tape
99
157
  - tapes/jt.tape
158
+ - tapes/jx.tape
100
159
  - tapes/jy.tape
101
160
  - tapes/tj.tape
161
+ - tapes/tt.tape
162
+ - tapes/tx.tape
102
163
  - tapes/ty.tape
164
+ - tapes/update.rb
165
+ - tapes/xj.tape
166
+ - tapes/xt.tape
167
+ - tapes/xx.tape
168
+ - tapes/xy.tape
103
169
  - tapes/yj.tape
104
170
  - tapes/yt.tape
171
+ - tapes/yx.tape
172
+ - tapes/yy.tape
105
173
  - xvert.gemspec
106
174
  homepage: https://github.com/koki-develop/xvert
107
175
  licenses: