sylvia 0.1.0 → 0.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3dc29718344e9ceb4009585dbf01c72d9ec31616a1a5b32c55503f8e4bd7fdad
4
- data.tar.gz: 8b46080dd799481657ab1fad3eb738f605e59b7e5f7e74dfaa72b66935b4bb27
3
+ metadata.gz: 9b8978c0ecc04473178bdb9f292fe98b9ff9c5e372f113c1b2ab5d6744af898a
4
+ data.tar.gz: 7107124883c71fac147fd040e701edd8611145d600e080199cc49d3804154c47
5
5
  SHA512:
6
- metadata.gz: 751dbabdce77a8dc61f6a6f3e0ba77f71954de39187cae38f2a83df7f608e7d3b4b1b2e1be7ebff6bcf49ac080fb25107a8937a8c7ae9d32a23c401ca1bca729
7
- data.tar.gz: 151882ff4746c1bde500e350c9f5b8882ac5394135cbd4fe1c4f473cec282b9f5df38df8c76b9523281e131cbf4f27c5ee49efbe511c0a6dd25afb73fcde6c5a
6
+ metadata.gz: 2a0cf7b995688cce91807b351665928e102a79d752f6a1af898fbddddd692d23b0bd6216cd873e463cf4bf4b4bd3867f6d7a746c3e39c6b1c6d6d65e93222859
7
+ data.tar.gz: 6c03f33b96fe5434ff8d02b5aa85d6fb7464e40e015dd4df0f0d70496461663d0c6b392d867421e7d12c83a841c477ab86187e70d6fdcf4f8dfebb2d25ed10f7
data/README.md CHANGED
@@ -1,36 +1,46 @@
1
1
 
2
2
  ## Sylvia
3
+
4
+ ![Lang](https://img.shields.io/badge/language-ruby-red)
5
+ [![Gem Version](https://img.shields.io/gem/v/sylvia.svg)](https://rubygems.org/gems/sylvia)
6
+ [![Gem Downloads](https://img.shields.io/gem/dt/sylvia.svg)](https://rubygems.org/gems/sylvia)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](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
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
13
+ ```
14
+ gem install sylvia
15
+ ```
8
16
 
9
- Install the gem and add to the application's Gemfile by executing:
17
+ ## Usage
10
18
 
11
- ```bash
12
- bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
19
+ Setup Prettier
20
+ ```
21
+ sylvia prettier
13
22
  ```
14
23
 
15
- If bundler is not being used to manage dependencies, install the gem by executing:
16
-
17
- ```bash
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
- ## Usage
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. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
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/[USERNAME]/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/[USERNAME]/sylvia/blob/master/CODE_OF_CONDUCT.md).
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/[USERNAME]/sylvia/blob/master/CODE_OF_CONDUCT.md).
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,21 +10,21 @@ module Sylvia
10
10
  command = args.shift
11
11
 
12
12
  case command
13
- when "install"
14
- create_file
15
- when "run"
16
- run_file
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 install # Create sylvia.rb"
22
- puts " sylvia run # Run sylvia.rb"
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.create_file
27
+ def self.setup_llm
28
28
  content = <<~RUBY
29
29
  require 'ruby_llm'
30
30
  require 'dotenv'
@@ -36,8 +36,8 @@ module Sylvia
36
36
 
37
37
  chat = RubyLLM.chat(model: 'gemini-2.0-flash')
38
38
 
39
- # Just ask questions
40
- response = chat.ask "Siapa prabowo Subianto?"
39
+ response = chat.ask "how to improve this code", with: ["assets/example.rb", "assets/example2.rb"]
40
+
41
41
  puts response.content
42
42
  RUBY
43
43
 
@@ -45,7 +45,7 @@ module Sylvia
45
45
  puts "✅ Created #{FILE_NAME}"
46
46
  end
47
47
 
48
- def self.run_file
48
+ def self.run_llm
49
49
  unless File.exist?(FILE_NAME)
50
50
  puts "⚠️ #{FILE_NAME} not found. Run `sylvia install` first."
51
51
  return
@@ -61,14 +61,14 @@ module Sylvia
61
61
  end
62
62
 
63
63
  prettier_config = <<~JSON
64
- {
65
- "plugins": ["@prettier/plugin-ruby"],
66
- "rubyStrictMode": false,
67
- "tabWidth": 2,
68
- "useTabs": false,
69
- "singleQuote": true
70
- }
71
- JSON
64
+ {
65
+ "plugins": ["@prettier/plugin-ruby"],
66
+ "rubyStrictMode": false,
67
+ "tabWidth": 2,
68
+ "useTabs": false,
69
+ "singleQuote": true
70
+ }
71
+ JSON
72
72
 
73
73
  File.write(PRETTIER_FILE, prettier_config)
74
74
  puts "✅ Created #{PRETTIER_FILE}"
@@ -87,6 +87,23 @@ module Sylvia
87
87
 
88
88
  puts "⚡ Running `npm install`..."
89
89
  system("npm install")
90
+
91
+ gemfile = "Gemfile"
92
+ if File.exist?(gemfile)
93
+ content = File.read(gemfile)
94
+ unless content.include?('gem "syntax_tree"')
95
+ File.open(gemfile, "a") { |f| f.puts "\ngem \"syntax_tree\"" }
96
+ puts "✅ Added gem 'syntax_tree' to Gemfile"
97
+ else
98
+ puts "⚠️ Gemfile already contains syntax_tree"
99
+ end
100
+
101
+ puts "⚡ Running `bundle install`..."
102
+ system("bundle install")
103
+ else
104
+ puts "⚠️ No Gemfile found. Skipping syntax_tree installation."
105
+ end
106
+
90
107
  puts "🎉 Prettier setup complete!"
91
108
  end
92
109
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sylvia
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
data/sylvia.gemspec CHANGED
@@ -28,5 +28,5 @@ Gem::Specification.new do |spec|
28
28
 
29
29
  spec.add_dependency "ruby_llm"
30
30
  spec.add_dependency "dotenv"
31
- spec.add_development_dependency "syntax_tree", "6.2.0"
31
+ spec.add_development_dependency "syntax_tree"
32
32
  end
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.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - whdzera
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-08-23 00:00:00.000000000 Z
10
+ date: 2025-08-24 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: ruby_llm
@@ -41,22 +41,21 @@ dependencies:
41
41
  name: syntax_tree
42
42
  requirement: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - '='
44
+ - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 6.2.0
46
+ version: '0'
47
47
  type: :development
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - '='
51
+ - - ">="
52
52
  - !ruby/object:Gem::Version
53
- version: 6.2.0
53
+ version: '0'
54
54
  description: Sylvia is a command-line tool that helps you create and manage Ruby projects
55
55
  with ease.
56
56
  email:
57
57
  - whdzera@gmail.com
58
58
  executables:
59
- - setup
60
59
  - sylvia
61
60
  extensions: []
62
61
  extra_rdoc_files: []
@@ -72,7 +71,6 @@ files:
72
71
  - LICENSE.txt
73
72
  - README.md
74
73
  - Rakefile
75
- - bin/setup
76
74
  - bin/sylvia
77
75
  - lib/sylvia.rb
78
76
  - lib/sylvia/cli.rb
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here