claiss 1.0.0 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/bin/claiss +5 -0
  3. data/lib/claiss.rb +100 -4
  4. data/lib/tasks/claiss.rake +25 -0
  5. metadata +20 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a75eb2f02fe104ba720fa91b2c8e28bb1deb17593fee645fa42dd2bed7aea9ef
4
- data.tar.gz: 54f436cf4cbfc5b7245402773ad70b8a944511fb543a2545a1908eb1eb0acf2b
3
+ metadata.gz: 1c63da7e95c5a0ddfc09b89b90a8e2507b820e0c0c19464c0513f9bfc1e55428
4
+ data.tar.gz: 40da12484896e5e1dd0556613c96a32255950329cae0cf9dfffd49e523f611e1
5
5
  SHA512:
6
- metadata.gz: 2b3fcfd5ac72663b59b7c06028d2a18c62034559bb03a67a460010e05ed26baf19b0d5dc5c13933c9ff6d37b5f417b16b6043bc46db558a7ef698e4c0b0f2a2d
7
- data.tar.gz: 75a0b51d04da65de7833cb58dabfe30693e001248b6f6e799423bd3743bc1d75d4221c512d86fad8e574b6123b0d35c4374c1aa1a70d29fc978a56669abb41f2
6
+ metadata.gz: 558065cc351485ab4f19ef37c973bdc60491f59ec880b47ea6972da080f20571d7563e80e4f1c124f804e18a7770cb22f8c8e39dc3b40db1036484de6edb76fc
7
+ data.tar.gz: 93768179fe2355a7d03b30eacd2239c7ef3b5a4b41b366d9a2a27451bfc3f86565d9a131b65a2ecc70ac14a0ea9733e18135eaf620ab51528b108942cb65a946
data/bin/claiss ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "dry/cli"
4
+ require 'claiss'
5
+ Dry::CLI.new(Claiss).call
data/lib/claiss.rb CHANGED
@@ -1,5 +1,101 @@
1
+ require "bundler/setup"
2
+ require "dry/cli"
3
+
1
4
  module Claiss
2
- def self.hello_world
3
- "Good morning world and all who inhabit it!"
4
- end
5
- end
5
+ extend Dry::CLI::Registry
6
+
7
+ class Version < Dry::CLI::Command
8
+ desc "Print version"
9
+
10
+ def call(*)
11
+ puts "1.0.2"
12
+ end
13
+ end
14
+
15
+ class Echo < Dry::CLI::Command
16
+ desc "Print input"
17
+
18
+ argument :input, desc: "Input to print"
19
+
20
+ example [
21
+ " # Prints 'wuh?'",
22
+ "hello, folks # Prints 'hello, folks'"
23
+ ]
24
+
25
+ def call(input: nil, **)
26
+ if input.nil?
27
+ puts "wuh?"
28
+ else
29
+ puts input
30
+ end
31
+ end
32
+ end
33
+
34
+ class Start < Dry::CLI::Command
35
+ desc "Start Foo machinery"
36
+
37
+ argument :root, required: true, desc: "Root directory"
38
+
39
+ example [
40
+ "path/to/root # Start Foo at root directory"
41
+ ]
42
+
43
+ def call(root:, **)
44
+ puts "started - root: #{root}"
45
+ end
46
+ end
47
+
48
+ class Stop < Dry::CLI::Command
49
+ desc "Stop Foo machinery"
50
+
51
+ option :graceful, type: :boolean, default: true, desc: "Graceful stop"
52
+
53
+ def call(**options)
54
+ puts "stopped - graceful: #{options.fetch(:graceful)}"
55
+ end
56
+ end
57
+
58
+ class Exec < Dry::CLI::Command
59
+ desc "Execute a task"
60
+
61
+ argument :task, type: :string, required: true, desc: "Task to be executed"
62
+ argument :dirs, type: :array, required: false, desc: "Optional directories"
63
+
64
+ def call(task:, dirs: [], **)
65
+ puts "exec - task: #{task}, dirs: #{dirs.inspect}"
66
+ end
67
+ end
68
+
69
+ module Generate
70
+ class Configuration < Dry::CLI::Command
71
+ desc "Generate configuration"
72
+
73
+ option :apps, type: :array, default: [], desc: "Generate configuration for specific apps"
74
+
75
+ def call(apps:, **)
76
+ puts "generated configuration for apps: #{apps.inspect}"
77
+ end
78
+ end
79
+
80
+ class Test < Dry::CLI::Command
81
+ desc "Generate tests"
82
+
83
+ option :framework, default: "minitest", values: %w[minitest rspec]
84
+
85
+ def call(framework:, **)
86
+ puts "generated tests - framework: #{framework}"
87
+ end
88
+ end
89
+ end
90
+
91
+ register "version", Version, aliases: ["v", "-v", "--version"]
92
+ register "echo", Echo
93
+ register "start", Start
94
+ register "stop", Stop
95
+ register "exec", Exec
96
+
97
+ register "generate", aliases: ["g"] do |prefix|
98
+ prefix.register "config", Generate::Configuration
99
+ prefix.register "test", Generate::Test
100
+ end
101
+ end
@@ -0,0 +1,25 @@
1
+ GEM_NAME = "claiss"
2
+ GEM_VERSION = "1.0.0"
3
+
4
+ namespace :claiss do
5
+ path = "/home/rails/jumpstart/lib/claiss/"
6
+
7
+ task :default => :build
8
+
9
+ task :build do
10
+ system "gem build " + path + GEM_NAME + ".gemspec"
11
+ end
12
+
13
+ task :install => :build do
14
+ system "gem install " + path + GEM_NAME + "-" + GEM_VERSION + ".gem"
15
+ end
16
+
17
+ task :publish => :build do
18
+ system 'gem push ' + path + GEM_NAME + "-" + GEM_VERSION + ".gem"
19
+ end
20
+
21
+ task :clean do
22
+ system "rm " + path + "*.gem"
23
+ end
24
+
25
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: claiss
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Júlio Papel
@@ -9,16 +9,33 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2023-07-01 00:00:00.000000000 Z
12
- dependencies: []
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: dry-cli
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  description: CLI application Toolbox to manage Laiss AI applications and deployments.
14
28
  Some thing may not work on your environment. Use with caution!
15
29
  email:
16
30
  - julio.papel@gmail.com
17
- executables: []
31
+ executables:
32
+ - claiss
18
33
  extensions: []
19
34
  extra_rdoc_files: []
20
35
  files:
36
+ - bin/claiss
21
37
  - lib/claiss.rb
38
+ - lib/tasks/claiss.rake
22
39
  homepage: http://rubygems.org/gems/claiss
23
40
  licenses:
24
41
  - MIT