xvert 0.0.2 → 0.0.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 22c66a17041bf86582f88ba2a6fdb228b3dad93b24ee23fa5e39db536eb188cd
4
- data.tar.gz: 774fa9e7f03d287dbc62044ad7b467b799073662a2224b50b91211e59aecc353
3
+ metadata.gz: 40a0b58972d6a03f7fc858e10ee824def0a16ca0e3e7289754b275706c7d13f1
4
+ data.tar.gz: a5164c3a56d0614ca7b2b4cb5a9b67f24f95a2bb7f7daf72c4a690577bd2a7b2
5
5
  SHA512:
6
- metadata.gz: ee38ee94c529812b8c4c60ef1dbcffb3ae9a16bf53802382801a67a05f91787832a74817fbdc556861e4b7007048109c2651ab5fb5e15a919c0ea4a123b6a23f
7
- data.tar.gz: 1a7686a68c6cd30e457d4d26306711bd208eb81e55b9bde2928c160c5f5a7f2f773c995dfee621b5ef57522254c296b0abda22ab69633b26a5208ab49f42e1f6
6
+ metadata.gz: d1a885beb5428edfcca27e4d0a70c584ae97e710003a2c790206fa1e10fe4bc3e96eeda27fcca5ee3e7c24927815694167a0d336ec8de8680610a987ed1735c5
7
+ data.tar.gz: ac35cb999d473a576e6c356af2a566eee0e5879b1309a2e821b28a2e6fc1d3d9af60ea7f25eaa69839c162381a70374f39c807aee2091babff8f1f5c32a0b831
data/Gemfile.lock CHANGED
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- xvert (0.0.2)
4
+ xvert (0.0.3)
5
+ thor (~> 1.2.0)
5
6
 
6
7
  GEM
7
8
  remote: https://rubygems.org/
@@ -29,6 +30,7 @@ GEM
29
30
  rubocop-ast (1.28.1)
30
31
  parser (>= 3.2.1.0)
31
32
  ruby-progressbar (1.13.0)
33
+ thor (1.2.1)
32
34
  unicode-display_width (2.4.2)
33
35
 
34
36
  PLATFORMS
data/exe/xvert CHANGED
@@ -2,6 +2,25 @@
2
2
 
3
3
  # frozen_string_literal: true
4
4
 
5
+ require "thor"
5
6
  require "xvert"
6
7
 
7
- Xvert.hello
8
+ class CLI < Thor
9
+ class << self
10
+ def exit_on_failure?
11
+ true
12
+ end
13
+ end
14
+
15
+ desc "jy", "Convert JSON to YAML"
16
+ def jy
17
+ puts Xvert.json_to_yaml($stdin.readlines.join)
18
+ end
19
+
20
+ desc "yj", "Convert YAML to JSON"
21
+ def yj
22
+ puts Xvert.yaml_to_json($stdin.readlines.join)
23
+ end
24
+ end
25
+
26
+ CLI.start(ARGV)
data/lib/xvert/json.rb ADDED
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xvert
4
+ class << self
5
+ def json_to_yaml(text)
6
+ JSON.parse(text).to_yaml
7
+ end
8
+ end
9
+ end
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.0.2"
4
+ VERSION = "0.0.3"
5
5
  end
data/lib/xvert/yaml.rb ADDED
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xvert
4
+ class << self
5
+ def yaml_to_json(text)
6
+ YAML.safe_load(text).to_json
7
+ end
8
+ end
9
+ end
data/lib/xvert.rb CHANGED
@@ -1,11 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "json"
4
+ require "yaml"
3
5
  require_relative "xvert/version"
6
+ require_relative "xvert/json"
7
+ require_relative "xvert/yaml"
4
8
 
5
9
  module Xvert
6
- class << self
7
- def hello
8
- puts "Hello World"
9
- end
10
- end
11
10
  end
data/xvert.gemspec CHANGED
@@ -25,4 +25,6 @@ Gem::Specification.new do |spec|
25
25
  spec.bindir = "exe"
26
26
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
27
27
  spec.require_paths = ["lib"]
28
+
29
+ spec.add_runtime_dependency "thor", "~> 1.2.0"
28
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xvert
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - koki-develop
@@ -9,7 +9,21 @@ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
11
  date: 2023-05-07 00:00:00.000000000 Z
12
- dependencies: []
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: thor
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 1.2.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 1.2.0
13
27
  description: Convert between CSV, JSON, YAML, and various other formats.
14
28
  email:
15
29
  - kou.pg.0131@gmail.com
@@ -27,7 +41,9 @@ files:
27
41
  - Rakefile
28
42
  - exe/xvert
29
43
  - lib/xvert.rb
44
+ - lib/xvert/json.rb
30
45
  - lib/xvert/version.rb
46
+ - lib/xvert/yaml.rb
31
47
  - sig/xvert.rbs
32
48
  - xvert.gemspec
33
49
  homepage: https://github.com/koki-develop/xvert