sylvia 0.1.0 → 0.2.1
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/README.md +23 -13
- data/lib/sylvia/cli.rb +39 -19
- data/lib/sylvia/version.rb +1 -1
- data/sylvia.gemspec +2 -1
- metadata +20 -9
- data/Gemfile.lock +0 -91
- data/bin/setup +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3400a3b8c14a722b2319389c619bbcb5fb141c0900b53eff8ab3cb0d3dfe0e4c
|
4
|
+
data.tar.gz: 734a5c7955a4f6210d3d7d48e87727c8c9654d3c2ce2db19ce1c0f4ffd5d9807
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61a5beda98de772f434ed84d85776925105b136ab26ab3a92f38175b615d2cfaf8c9b73181d7a0cba8f3cfff775a537a5d904264be38d6c94ffe68e887c40ab2
|
7
|
+
data.tar.gz: 9e0784427701bac5cbf4b8d6ada49069cc618da76aec4c55f518a09531735d09e4175c3c89a070b6f04e6a8a9783f1344a028f33aeed3c0c18b40f274e3614ae
|
data/README.md
CHANGED
@@ -1,36 +1,46 @@
|
|
1
1
|
|
2
2
|
## Sylvia
|
3
|
+
|
4
|
+

|
5
|
+
[](https://rubygems.org/gems/sylvia)
|
6
|
+
[](https://rubygems.org/gems/sylvia)
|
7
|
+
[](https://opensource.org/licenses/MIT)
|
8
|
+
|
3
9
|
My Private Assistant Tool for ruby development (support Ruby LLM)
|
4
10
|
|
5
11
|
## Installation
|
6
12
|
|
7
|
-
|
13
|
+
```
|
14
|
+
gem install sylvia
|
15
|
+
```
|
8
16
|
|
9
|
-
|
17
|
+
## Usage
|
10
18
|
|
11
|
-
|
12
|
-
|
19
|
+
Setup Prettier
|
20
|
+
```
|
21
|
+
sylvia prettier
|
13
22
|
```
|
14
23
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
|
24
|
+
Setup LLM (with Ruby_LLM)
|
25
|
+
```
|
26
|
+
sylvia llm
|
19
27
|
```
|
20
28
|
|
21
|
-
|
29
|
+
Run AI LLM
|
30
|
+
```
|
31
|
+
sylvia ai
|
32
|
+
```
|
22
33
|
|
23
|
-
TODO: Write usage instructions here
|
24
34
|
|
25
35
|
## Development
|
26
36
|
|
27
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests.
|
37
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests.
|
28
38
|
|
29
39
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
30
40
|
|
31
41
|
## Contributing
|
32
42
|
|
33
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
43
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/whdzera/sylvia. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/whdzera/sylvia/blob/master/CODE_OF_CONDUCT.md).
|
34
44
|
|
35
45
|
## License
|
36
46
|
|
@@ -38,4 +48,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
38
48
|
|
39
49
|
## Code of Conduct
|
40
50
|
|
41
|
-
Everyone interacting in the Sylvia project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
51
|
+
Everyone interacting in the Sylvia project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/whdzera/sylvia/blob/master/CODE_OF_CONDUCT.md).
|
data/lib/sylvia/cli.rb
CHANGED
@@ -10,23 +10,24 @@ module Sylvia
|
|
10
10
|
command = args.shift
|
11
11
|
|
12
12
|
case command
|
13
|
-
when "
|
14
|
-
|
15
|
-
when "
|
16
|
-
|
13
|
+
when "llm"
|
14
|
+
setup_llm
|
15
|
+
when "ai"
|
16
|
+
run_llm
|
17
17
|
when "prettier"
|
18
18
|
setup_prettier
|
19
19
|
else
|
20
20
|
puts "Usage:"
|
21
|
-
puts " sylvia
|
22
|
-
puts " sylvia
|
21
|
+
puts " sylvia llm # Create setup file llm"
|
22
|
+
puts " sylvia ai # Run llm"
|
23
23
|
puts " sylvia prettier # Setup Prettier for Ruby"
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
def self.
|
27
|
+
def self.setup_llm
|
28
28
|
content = <<~RUBY
|
29
29
|
require 'ruby_llm'
|
30
|
+
require 'tty-markdown'
|
30
31
|
require 'dotenv'
|
31
32
|
Dotenv.load
|
32
33
|
|
@@ -36,16 +37,18 @@ module Sylvia
|
|
36
37
|
|
37
38
|
chat = RubyLLM.chat(model: 'gemini-2.0-flash')
|
38
39
|
|
39
|
-
|
40
|
-
|
41
|
-
|
40
|
+
response = chat.ask "how to improve this code", with: ["assets/example.rb", "assets/example2.rb"]
|
41
|
+
|
42
|
+
markdown = response.content.to_s
|
43
|
+
|
44
|
+
puts TTY::Markdown.parse(markdown)
|
42
45
|
RUBY
|
43
46
|
|
44
47
|
File.write(FILE_NAME, content)
|
45
48
|
puts "✅ Created #{FILE_NAME}"
|
46
49
|
end
|
47
50
|
|
48
|
-
def self.
|
51
|
+
def self.run_llm
|
49
52
|
unless File.exist?(FILE_NAME)
|
50
53
|
puts "⚠️ #{FILE_NAME} not found. Run `sylvia install` first."
|
51
54
|
return
|
@@ -61,14 +64,14 @@ module Sylvia
|
|
61
64
|
end
|
62
65
|
|
63
66
|
prettier_config = <<~JSON
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
67
|
+
{
|
68
|
+
"plugins": ["@prettier/plugin-ruby"],
|
69
|
+
"rubyStrictMode": false,
|
70
|
+
"tabWidth": 2,
|
71
|
+
"useTabs": false,
|
72
|
+
"singleQuote": true
|
73
|
+
}
|
74
|
+
JSON
|
72
75
|
|
73
76
|
File.write(PRETTIER_FILE, prettier_config)
|
74
77
|
puts "✅ Created #{PRETTIER_FILE}"
|
@@ -87,6 +90,23 @@ module Sylvia
|
|
87
90
|
|
88
91
|
puts "⚡ Running `npm install`..."
|
89
92
|
system("npm install")
|
93
|
+
|
94
|
+
gemfile = "Gemfile"
|
95
|
+
if File.exist?(gemfile)
|
96
|
+
content = File.read(gemfile)
|
97
|
+
unless content.include?('gem "syntax_tree"')
|
98
|
+
File.open(gemfile, "a") { |f| f.puts "\ngem \"syntax_tree\"" }
|
99
|
+
puts "✅ Added gem 'syntax_tree' to Gemfile"
|
100
|
+
else
|
101
|
+
puts "⚠️ Gemfile already contains syntax_tree"
|
102
|
+
end
|
103
|
+
|
104
|
+
puts "⚡ Running `bundle install`..."
|
105
|
+
system("bundle install")
|
106
|
+
else
|
107
|
+
puts "⚠️ No Gemfile found. Skipping syntax_tree installation."
|
108
|
+
end
|
109
|
+
|
90
110
|
puts "🎉 Prettier setup complete!"
|
91
111
|
end
|
92
112
|
end
|
data/lib/sylvia/version.rb
CHANGED
data/sylvia.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sylvia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- whdzera
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-08-
|
10
|
+
date: 2025-08-24 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: ruby_llm
|
@@ -37,26 +37,39 @@ dependencies:
|
|
37
37
|
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
39
|
version: '0'
|
40
|
+
- !ruby/object:Gem::Dependency
|
41
|
+
name: tty-markdown
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
type: :runtime
|
48
|
+
prerelease: false
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
40
54
|
- !ruby/object:Gem::Dependency
|
41
55
|
name: syntax_tree
|
42
56
|
requirement: !ruby/object:Gem::Requirement
|
43
57
|
requirements:
|
44
|
-
- -
|
58
|
+
- - ">="
|
45
59
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
60
|
+
version: '0'
|
47
61
|
type: :development
|
48
62
|
prerelease: false
|
49
63
|
version_requirements: !ruby/object:Gem::Requirement
|
50
64
|
requirements:
|
51
|
-
- -
|
65
|
+
- - ">="
|
52
66
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
67
|
+
version: '0'
|
54
68
|
description: Sylvia is a command-line tool that helps you create and manage Ruby projects
|
55
69
|
with ease.
|
56
70
|
email:
|
57
71
|
- whdzera@gmail.com
|
58
72
|
executables:
|
59
|
-
- setup
|
60
73
|
- sylvia
|
61
74
|
extensions: []
|
62
75
|
extra_rdoc_files: []
|
@@ -68,11 +81,9 @@ files:
|
|
68
81
|
- CHANGELOG.md
|
69
82
|
- CODE_OF_CONDUCT.md
|
70
83
|
- Gemfile
|
71
|
-
- Gemfile.lock
|
72
84
|
- LICENSE.txt
|
73
85
|
- README.md
|
74
86
|
- Rakefile
|
75
|
-
- bin/setup
|
76
87
|
- bin/sylvia
|
77
88
|
- lib/sylvia.rb
|
78
89
|
- lib/sylvia/cli.rb
|
data/Gemfile.lock
DELETED
@@ -1,91 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
sylvia (0.1.0)
|
5
|
-
dotenv
|
6
|
-
ruby_llm
|
7
|
-
|
8
|
-
GEM
|
9
|
-
remote: https://rubygems.org/
|
10
|
-
specs:
|
11
|
-
base64 (0.3.0)
|
12
|
-
date (3.4.1)
|
13
|
-
diff-lcs (1.6.2)
|
14
|
-
dotenv (3.1.8)
|
15
|
-
erb (5.0.2)
|
16
|
-
event_stream_parser (1.0.0)
|
17
|
-
faraday (2.13.4)
|
18
|
-
faraday-net_http (>= 2.0, < 3.5)
|
19
|
-
json
|
20
|
-
logger
|
21
|
-
faraday-multipart (1.1.1)
|
22
|
-
multipart-post (~> 2.0)
|
23
|
-
faraday-net_http (3.4.1)
|
24
|
-
net-http (>= 0.5.0)
|
25
|
-
faraday-retry (2.3.2)
|
26
|
-
faraday (~> 2.0)
|
27
|
-
io-console (0.8.1)
|
28
|
-
irb (1.15.2)
|
29
|
-
pp (>= 0.6.0)
|
30
|
-
rdoc (>= 4.0.0)
|
31
|
-
reline (>= 0.4.2)
|
32
|
-
json (2.13.2)
|
33
|
-
logger (1.7.0)
|
34
|
-
marcel (1.0.4)
|
35
|
-
multipart-post (2.4.1)
|
36
|
-
net-http (0.6.0)
|
37
|
-
uri
|
38
|
-
pp (0.6.2)
|
39
|
-
prettyprint
|
40
|
-
prettier_print (1.2.1)
|
41
|
-
prettyprint (0.2.0)
|
42
|
-
psych (5.2.6)
|
43
|
-
date
|
44
|
-
stringio
|
45
|
-
rake (13.3.0)
|
46
|
-
rdoc (6.14.2)
|
47
|
-
erb
|
48
|
-
psych (>= 4.0.0)
|
49
|
-
reline (0.6.2)
|
50
|
-
io-console (~> 0.5)
|
51
|
-
rspec (3.13.0)
|
52
|
-
rspec-core (~> 3.13.0)
|
53
|
-
rspec-expectations (~> 3.13.0)
|
54
|
-
rspec-mocks (~> 3.13.0)
|
55
|
-
rspec-core (3.13.4)
|
56
|
-
rspec-support (~> 3.13.0)
|
57
|
-
rspec-expectations (3.13.5)
|
58
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
59
|
-
rspec-support (~> 3.13.0)
|
60
|
-
rspec-mocks (3.13.5)
|
61
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
62
|
-
rspec-support (~> 3.13.0)
|
63
|
-
rspec-support (3.13.4)
|
64
|
-
ruby_llm (1.5.1)
|
65
|
-
base64
|
66
|
-
event_stream_parser (~> 1)
|
67
|
-
faraday (>= 1.10.0)
|
68
|
-
faraday-multipart (>= 1)
|
69
|
-
faraday-net_http (>= 1)
|
70
|
-
faraday-retry (>= 1)
|
71
|
-
marcel (~> 1.0)
|
72
|
-
zeitwerk (~> 2)
|
73
|
-
stringio (3.1.7)
|
74
|
-
syntax_tree (6.2.0)
|
75
|
-
prettier_print (>= 1.2.0)
|
76
|
-
uri (1.0.3)
|
77
|
-
zeitwerk (2.7.3)
|
78
|
-
|
79
|
-
PLATFORMS
|
80
|
-
ruby
|
81
|
-
x86_64-linux
|
82
|
-
|
83
|
-
DEPENDENCIES
|
84
|
-
irb
|
85
|
-
rake (~> 13.0)
|
86
|
-
rspec (~> 3.0)
|
87
|
-
sylvia!
|
88
|
-
syntax_tree (= 6.2.0)
|
89
|
-
|
90
|
-
BUNDLED WITH
|
91
|
-
2.6.9
|