aubi 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 13c7fb0f5b95a55e9346fc67f7d32c08c173f1f8ae5e34aba28f38eee2e41a0c
4
+ data.tar.gz: e6072cb2845a3fe0db394c7543c0c622eaadf8fe078c127e6b67e0865b0a9f24
5
+ SHA512:
6
+ metadata.gz: 39d3153594d9eca626eb2ca727c78367517be3972de93c0ec0016db0f91f41ec5da713facd3f1c95e08fce0237d872ea05b472f40a9e3c87d6d1d79e3e1bf0ca
7
+ data.tar.gz: 2657431522f545d62e3c8999bfe7a7bd0ce41dfd62fb245ec18e30bbc76e2a6ed2c761c0c7bb52980685128e6397c76e01ef86afd73eef909d7ea478d1b1d900
data/bin/aubi ADDED
@@ -0,0 +1,4 @@
1
+ #!usr/bin/env ruby
2
+ require 'aubi'
3
+ require 'aubi/aura'
4
+ Aubi::Aura.start
data/lib/aubi.rb ADDED
@@ -0,0 +1,8 @@
1
+ module Aubi
2
+ def self.create(options)
3
+ case options[:app]
4
+ when "rails"
5
+ system("rails new #{options[:name]}")
6
+ end
7
+ end
8
+ end
data/lib/aubi/aura.rb ADDED
@@ -0,0 +1,31 @@
1
+ require 'aubi/options'
2
+
3
+ module Aubi
4
+ class Aura
5
+ class << self
6
+ def start
7
+ options = Aubi::Options.parse(ARGV)
8
+ process(options)
9
+ end
10
+
11
+ private
12
+
13
+ def process(options)
14
+ display_information(options)
15
+ build_app(options)
16
+ end
17
+
18
+ def display_information(options)
19
+ if options[:display_version]
20
+ require 'aubi/version'
21
+ puts "aubi #{Aubi::VERSION}"
22
+ exit 0
23
+ end
24
+ end
25
+
26
+ def build_app(options)
27
+ Aubi.create(options)
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,51 @@
1
+ require 'optparse'
2
+
3
+ module Aubi
4
+ class Options
5
+ class << self
6
+ def parse(args)
7
+ validate_arguments(args)
8
+
9
+ options = { name: args[0] }
10
+
11
+ OptionParser.new do |opts|
12
+ opts.banner = "Usage: aubi [options]"
13
+
14
+ opts.on("-a APP", "--app APP", "Application to generate. Ruby on Rails (default)") do |v|
15
+ options[:app] = v.downcase
16
+ end
17
+
18
+ opts.on("-v", "--version", "Display version") do
19
+ options[:display_version] = true
20
+ end
21
+ end.parse!
22
+
23
+ apply_defaults!(options)
24
+
25
+ validate_options(options)
26
+
27
+ options
28
+ end
29
+
30
+ private
31
+
32
+ def validate_arguments(args)
33
+ if args.length.zero?
34
+ puts "Pass a project name"
35
+ exit 1
36
+ end
37
+ end
38
+
39
+ def apply_defaults!(options)
40
+ options[:app] ||= "rails"
41
+ end
42
+
43
+ def validate_options(options)
44
+ if options[:app] != "rails"
45
+ puts "Invalid option to app"
46
+ exit 1
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,3 @@
1
+ module Aubi
2
+ VERSION = "0.0.0"
3
+ end
metadata ADDED
@@ -0,0 +1,48 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: aubi
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Kaíque Kandy Koga
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-08-20 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Ruby Generic Template Builder
14
+ email:
15
+ executables:
16
+ - aubi
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - bin/aubi
21
+ - lib/aubi.rb
22
+ - lib/aubi/aura.rb
23
+ - lib/aubi/options.rb
24
+ - lib/aubi/version.rb
25
+ homepage:
26
+ licenses:
27
+ - MIT
28
+ metadata: {}
29
+ post_install_message:
30
+ rdoc_options: []
31
+ require_paths:
32
+ - lib
33
+ required_ruby_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ required_rubygems_version: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
43
+ requirements: []
44
+ rubygems_version: 3.2.26
45
+ signing_key:
46
+ specification_version: 4
47
+ summary: aubi
48
+ test_files: []