sylvia 0.2.5 → 0.3.2
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 +4 -4
- data/.gitignore +2 -1
- data/README.md +6 -0
- data/lib/sylvia/bot.rb +30 -0
- data/lib/sylvia/cli.rb +11 -0
- data/lib/sylvia/jekyll.rb +31 -0
- data/lib/sylvia/llm.rb +2 -3
- data/lib/sylvia/version.rb +1 -1
- data/sylvia.gemspec +19 -18
- metadata +6 -4
- data/sig/sylvia.rbs +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 370b313843b07166e7c3a124e06d2093220512f9f2bdbb8cfd726def3912acaa
|
4
|
+
data.tar.gz: 2a16d35c503538e00e26a793d366b4bf22f9a853d27787264130a248bb4d319d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94f207c26fecea547808cb6982b6050e6c03610c708cb25be9393b8cae737a982a0a4a46552844fb53d0d87987f6416ecaf75a6a76eb194b3503094323bde98a
|
7
|
+
data.tar.gz: 7836ebb1dddf15f870f39cae0b302ec8fb5db94ba00d834ca3d615282c6a8167ecbc12ca67da41250a05e6fc813666d344c106f07fab40e618f1a97428ab7a6c
|
data/.gitignore
CHANGED
data/README.md
CHANGED
data/lib/sylvia/bot.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
module Sylvia
|
4
|
+
class Bot
|
5
|
+
def self.new_project(target = 'bot-app')
|
6
|
+
repo = 'https://github.com/spellbooks/ruby-discord-telegram-bot-boilerplate'
|
7
|
+
|
8
|
+
if git_installed?
|
9
|
+
puts '➡️ Git found, cloning repo...'
|
10
|
+
system("git clone #{repo} #{target}")
|
11
|
+
else
|
12
|
+
puts '⚠️ Git not found, using fallback template...'
|
13
|
+
copy_fallback_template(target)
|
14
|
+
end
|
15
|
+
|
16
|
+
puts "✅ Bot project created successfully in folder: #{target}"
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def self.git_installed?
|
22
|
+
system('git --version > /dev/null 2>&1')
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.copy_fallback_template(target)
|
26
|
+
source = File.expand_path('../../templates/bot', __dir__)
|
27
|
+
FileUtils.cp_r("#{source}/.", target)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/lib/sylvia/cli.rb
CHANGED
@@ -1,8 +1,11 @@
|
|
1
|
+
# lib/sylvia/cli.rb
|
1
2
|
require "json"
|
2
3
|
require_relative "version"
|
3
4
|
require_relative "llm"
|
4
5
|
require_relative "prettier"
|
5
6
|
require_relative "rubocop"
|
7
|
+
require_relative "jekyll"
|
8
|
+
require_relative "bot"
|
6
9
|
|
7
10
|
module Sylvia
|
8
11
|
class CLI
|
@@ -20,6 +23,12 @@ module Sylvia
|
|
20
23
|
RuboCop.setup
|
21
24
|
when "rubocop-todo"
|
22
25
|
RuboCop.generate_todo
|
26
|
+
when "jekyll"
|
27
|
+
target = args.shift || "jekyll-app"
|
28
|
+
Jekyll.new_project(target)
|
29
|
+
when "bot"
|
30
|
+
target = args.shift || "bot-app"
|
31
|
+
Bot.new_project(target)
|
23
32
|
when "-v", "--version"
|
24
33
|
puts "Sylvia version #{Sylvia::VERSION}"
|
25
34
|
else
|
@@ -29,6 +38,8 @@ module Sylvia
|
|
29
38
|
puts " sylvia prettier # Setup Prettier for Ruby"
|
30
39
|
puts " sylvia rubocop # Create .rubocop.yml config file"
|
31
40
|
puts " sylvia rubocop-todo # Generate .rubocop_todo.yml automatically"
|
41
|
+
puts " sylvia jekyll [name-app] # Create Jekyll boilerplate project"
|
42
|
+
puts " sylvia bot [name-app] # Create Discord & Telegram bot boilerplate project"
|
32
43
|
puts " sylvia -v, --version # Show Sylvia version"
|
33
44
|
end
|
34
45
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# lib/sylvia/jekyll.rb
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
module Sylvia
|
5
|
+
class Jekyll
|
6
|
+
def self.new_project(target = 'jekyll-app')
|
7
|
+
repo = 'https://github.com/spellbooks/jekyll-boilerplate'
|
8
|
+
|
9
|
+
if git_installed?
|
10
|
+
puts 'Git found, cloning repo...'
|
11
|
+
system("git clone #{repo} #{target}")
|
12
|
+
else
|
13
|
+
puts 'Git not found, using fallback template...'
|
14
|
+
copy_fallback_template(target)
|
15
|
+
end
|
16
|
+
|
17
|
+
puts "Project created successfully in folder: #{target}"
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def self.git_installed?
|
23
|
+
system('git --version > /dev/null 2>&1')
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.copy_fallback_template(target)
|
27
|
+
source = File.expand_path('../../templates/jekyll', __dir__)
|
28
|
+
FileUtils.cp_r("#{source}/.", target)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/sylvia/llm.rb
CHANGED
@@ -35,12 +35,11 @@ PROMPT
|
|
35
35
|
puts "Created #{FILE_NAME}"
|
36
36
|
|
37
37
|
if File.exist?(GITIGNORE_FILE)
|
38
|
-
gitignore_content = File.read(GITIGNORE_FILE)
|
39
|
-
gitignore_content += "\n" unless gitignore_content.end_with?("\n")
|
38
|
+
gitignore_content = File.read(GITIGNORE_FILE).split("\n")
|
40
39
|
if gitignore_content.include?(FILE_NAME)
|
41
40
|
puts "#{FILE_NAME} is already in #{GITIGNORE_FILE}"
|
42
41
|
else
|
43
|
-
File.open(GITIGNORE_FILE, 'a') { |f| f.puts FILE_NAME }
|
42
|
+
File.open(GITIGNORE_FILE, 'a') { |f| f.puts "\n#{FILE_NAME}" }
|
44
43
|
puts "Added #{FILE_NAME} to #{GITIGNORE_FILE}"
|
45
44
|
end
|
46
45
|
else
|
data/lib/sylvia/version.rb
CHANGED
data/sylvia.gemspec
CHANGED
@@ -1,33 +1,34 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative 'lib/sylvia/version'
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
|
-
spec.name =
|
6
|
+
spec.name = 'sylvia'
|
7
7
|
spec.version = Sylvia::VERSION
|
8
|
-
spec.authors = [
|
9
|
-
spec.email = [
|
8
|
+
spec.authors = ['whdzera']
|
9
|
+
spec.email = ['whdzera@gmail.com']
|
10
10
|
|
11
11
|
spec.summary =
|
12
|
-
|
12
|
+
'A command-line tool for generating and managing Ruby projects.'
|
13
13
|
spec.description =
|
14
|
-
|
15
|
-
spec.homepage =
|
16
|
-
spec.license =
|
17
|
-
spec.required_ruby_version =
|
14
|
+
'Sylvia is a command-line tool that helps you create and manage Ruby projects with ease.'
|
15
|
+
spec.homepage = 'https://github.com/whdzera/sylvia'
|
16
|
+
spec.license = 'MIT'
|
17
|
+
spec.required_ruby_version = '>= 3.1.0'
|
18
18
|
|
19
|
-
spec.metadata[
|
20
|
-
spec.metadata[
|
21
|
-
spec.metadata[
|
19
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
20
|
+
spec.metadata['source_code_uri'] = 'https://github.com/whdzera/sylvia'
|
21
|
+
spec.metadata['changelog_uri'] = 'https://github.com/whdzera/sylvia'
|
22
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
22
23
|
|
23
24
|
gemspec = File.basename(__FILE__)
|
24
25
|
spec.files = `git ls-files -z`.split("\x0")
|
25
|
-
spec.bindir =
|
26
|
+
spec.bindir = 'bin'
|
26
27
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
27
|
-
spec.require_paths = [
|
28
|
+
spec.require_paths = ['lib']
|
28
29
|
|
29
|
-
spec.add_dependency
|
30
|
-
spec.add_dependency
|
31
|
-
spec.add_dependency
|
32
|
-
spec.add_development_dependency
|
30
|
+
spec.add_dependency 'dotenv'
|
31
|
+
spec.add_dependency 'ruby_llm'
|
32
|
+
spec.add_dependency 'tty-markdown'
|
33
|
+
spec.add_development_dependency 'syntax_tree'
|
33
34
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sylvia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- whdzera
|
@@ -10,7 +10,7 @@ cert_chain: []
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
|
-
name:
|
13
|
+
name: dotenv
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
15
15
|
requirements:
|
16
16
|
- - ">="
|
@@ -24,7 +24,7 @@ dependencies:
|
|
24
24
|
- !ruby/object:Gem::Version
|
25
25
|
version: '0'
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
|
-
name:
|
27
|
+
name: ruby_llm
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
29
29
|
requirements:
|
30
30
|
- - ">="
|
@@ -86,12 +86,13 @@ files:
|
|
86
86
|
- Rakefile
|
87
87
|
- bin/sylvia
|
88
88
|
- lib/sylvia.rb
|
89
|
+
- lib/sylvia/bot.rb
|
89
90
|
- lib/sylvia/cli.rb
|
91
|
+
- lib/sylvia/jekyll.rb
|
90
92
|
- lib/sylvia/llm.rb
|
91
93
|
- lib/sylvia/prettier.rb
|
92
94
|
- lib/sylvia/rubocop.rb
|
93
95
|
- lib/sylvia/version.rb
|
94
|
-
- sig/sylvia.rbs
|
95
96
|
- spec/spec_helper.rb
|
96
97
|
- spec/sylvia_spec.rb
|
97
98
|
- sylvia.gemspec
|
@@ -102,6 +103,7 @@ metadata:
|
|
102
103
|
homepage_uri: https://github.com/whdzera/sylvia
|
103
104
|
source_code_uri: https://github.com/whdzera/sylvia
|
104
105
|
changelog_uri: https://github.com/whdzera/sylvia
|
106
|
+
rubygems_mfa_required: 'true'
|
105
107
|
rdoc_options: []
|
106
108
|
require_paths:
|
107
109
|
- lib
|
data/sig/sylvia.rbs
DELETED