claiss 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/claiss +5 -0
- data/lib/claiss.rb +102 -2
- data/lib/tasks/claiss.rake +25 -0
- metadata +20 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 822e313e62f6cd1b44213f3e0866029483bbc9ceb53a66cf5b301c7ce72eda09
|
4
|
+
data.tar.gz: 7c643047e23d3eb349ab7bd11e91691d4d8da2492604e3867ffde8e0583882f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f472733e691a0b78bfec39f8e028fa214b5f71f8a0a3c63bd60a53561fde2a3a7258219e10d52399c3c5b0841d7d21e3bd76d764e5c163816210c285c194439
|
7
|
+
data.tar.gz: da7fd61df1f134e57246f7d5c5fb9207729a5d134daf4cd62da605552c8899221b4ab6fdf19faaa7158258b7aa7939fd922b94c5c4d4e35c7087fa8d1dd78d5b
|
data/bin/claiss
ADDED
data/lib/claiss.rb
CHANGED
@@ -1,5 +1,105 @@
|
|
1
1
|
module Claiss
|
2
|
-
def self.
|
3
|
-
|
2
|
+
# def self.version
|
3
|
+
# spec = Gem::Specification::load("claiss.gemspec")
|
4
|
+
# puts "#{spec.summary}"
|
5
|
+
# puts "Version: #{spec.version}"
|
6
|
+
# end
|
7
|
+
module Commands
|
8
|
+
extend Dry::CLI::Registry
|
9
|
+
|
10
|
+
class Version < Dry::CLI::Command
|
11
|
+
desc "Print version"
|
12
|
+
|
13
|
+
def call(*)
|
14
|
+
puts "1.0.0"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
class Echo < Dry::CLI::Command
|
19
|
+
desc "Print input"
|
20
|
+
|
21
|
+
argument :input, desc: "Input to print"
|
22
|
+
|
23
|
+
example [
|
24
|
+
" # Prints 'wuh?'",
|
25
|
+
"hello, folks # Prints 'hello, folks'"
|
26
|
+
]
|
27
|
+
|
28
|
+
def call(input: nil, **)
|
29
|
+
if input.nil?
|
30
|
+
puts "wuh?"
|
31
|
+
else
|
32
|
+
puts input
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
class Start < Dry::CLI::Command
|
38
|
+
desc "Start Foo machinery"
|
39
|
+
|
40
|
+
argument :root, required: true, desc: "Root directory"
|
41
|
+
|
42
|
+
example [
|
43
|
+
"path/to/root # Start Foo at root directory"
|
44
|
+
]
|
45
|
+
|
46
|
+
def call(root:, **)
|
47
|
+
puts "started - root: #{root}"
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
class Stop < Dry::CLI::Command
|
52
|
+
desc "Stop Foo machinery"
|
53
|
+
|
54
|
+
option :graceful, type: :boolean, default: true, desc: "Graceful stop"
|
55
|
+
|
56
|
+
def call(**options)
|
57
|
+
puts "stopped - graceful: #{options.fetch(:graceful)}"
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
class Exec < Dry::CLI::Command
|
62
|
+
desc "Execute a task"
|
63
|
+
|
64
|
+
argument :task, type: :string, required: true, desc: "Task to be executed"
|
65
|
+
argument :dirs, type: :array, required: false, desc: "Optional directories"
|
66
|
+
|
67
|
+
def call(task:, dirs: [], **)
|
68
|
+
puts "exec - task: #{task}, dirs: #{dirs.inspect}"
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
module Generate
|
73
|
+
class Configuration < Dry::CLI::Command
|
74
|
+
desc "Generate configuration"
|
75
|
+
|
76
|
+
option :apps, type: :array, default: [], desc: "Generate configuration for specific apps"
|
77
|
+
|
78
|
+
def call(apps:, **)
|
79
|
+
puts "generated configuration for apps: #{apps.inspect}"
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
class Test < Dry::CLI::Command
|
84
|
+
desc "Generate tests"
|
85
|
+
|
86
|
+
option :framework, default: "minitest", values: %w[minitest rspec]
|
87
|
+
|
88
|
+
def call(framework:, **)
|
89
|
+
puts "generated tests - framework: #{framework}"
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
register "version", Version, aliases: ["v", "-v", "--version"]
|
95
|
+
register "echo", Echo
|
96
|
+
register "start", Start
|
97
|
+
register "stop", Stop
|
98
|
+
register "exec", Exec
|
99
|
+
|
100
|
+
register "generate", aliases: ["g"] do |prefix|
|
101
|
+
prefix.register "config", Generate::Configuration
|
102
|
+
prefix.register "test", Generate::Test
|
103
|
+
end
|
4
104
|
end
|
5
105
|
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.
|
4
|
+
version: 1.0.1
|
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
|