walkthrough_awanllm 0.1.17 → 0.1.18

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: d0615e28a2972336a7566368efc2c7732127052335a742318d42acfbf5bccac4
4
- data.tar.gz: c465b434f73ca37989297b1204e77203d2611ca99009812b2eb2d2d35bc2443a
3
+ metadata.gz: 0446edc0b2acf9d1e05995bd32dbc4c41fd84e34cefcc6effb76b650f85027a1
4
+ data.tar.gz: 7a8afe1355ff43f1047929b1badfb5fc2caedf439282daefac6d86191c0f863b
5
5
  SHA512:
6
- metadata.gz: 2a66e0af04d9ce9f28f63a195349990a13d1deb57821651f0eaf3fef70931d012a808916a96a66eac631c8561ae8c0fe7d1ddcbd7a6b5f9433ba59b75f934174
7
- data.tar.gz: da21f83d222c036a7d699ec78efdd4a37e1bdef91fc0e40a28b17f218c40a578c5f7b8552943ede8e06a6a8dace8ee8db9cfc8a1510866a6c4c087cb8e839121
6
+ metadata.gz: '09567b3cf0edd6e7e902f0e6f7f566c51a6ceaff197b0dfaef72b7a87f3e86b495f12c4f8d9c3817df5ee38b1cd78f55a2f28088940d05056121b7720b7a2223'
7
+ data.tar.gz: 23475f22d8c98560308d2080bbd0c8c274597bb8fd9873d1a477b3b83fe20480a8102db1b7dde363a74aa1211e1372c90241754afb5e75ddcb8ae1a527d42e10
data/README.md CHANGED
@@ -30,7 +30,7 @@ $ gem install walkthrough_awanllm
30
30
  After installing the gem, you need to configure it by running the setup script. This will prompt you for your AwanLLM API key and the model name you wish to use.
31
31
 
32
32
  ```sh
33
- $ ruby ./vendor/bundle/ruby/YOUR_VERSION/gems/walkthrough_awanllm-0.1.17/bin/setup_awanllm.rb
33
+ $ ruby ./vendor/bundle/ruby/YOUR_VERSION/gems/walkthrough_awanllm-0.1.18/bin/setup_awanllm.rb
34
34
  ```
35
35
 
36
36
  ## Usage
@@ -41,14 +41,9 @@ $ ruby ./vendor/bundle/ruby/YOUR_VERSION/gems/walkthrough_awanllm-0.1.17/bin/set
41
41
  To generate a detailed walkthrough of your project's activities:
42
42
 
43
43
  ```ruby
44
- require 'walkthrough_awanllm'
45
-
46
- # Create an instance of AwanLLM
47
- awanllm = AwanLLM.new
48
-
49
- # Generate a walkthrough
50
- awanllm.generate_walkthrough
51
-
44
+ rails console
45
+ > awanllm = WalkthroughAwanllm::AwanLLM.new
46
+ > awanllm.generate_walkthrough
52
47
  ```
53
48
 
54
49
  This will read the activity log and generate a `walkthrough.md` file in the project's root directory.
data/Rakefile CHANGED
@@ -1,4 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "bundler/gem_tasks"
4
+
5
+ # Load tasks defined in the lib/tasks directory
6
+ Dir.glob('lib/tasks/*.rake').each { |r| import r }
7
+
4
8
  task default: %i[]
@@ -1,34 +1,58 @@
1
-
2
1
  require 'rails/railtie'
3
2
  require 'fileutils'
3
+ require 'bundler'
4
+ require 'git'
5
+ require 'listen'
4
6
 
5
- module AwanLLM
7
+ module WalkthroughAwanllm
6
8
  class Railtie < Rails::Railtie
7
9
  initializer "awanllm.track_activity" do |app|
8
10
  app.config.middleware.use AwanLLM::Tracker
9
- end
10
- end
11
- end
12
-
13
- # Middleware to track activities
14
- module AwanLLM
15
- class Tracker
16
- def initialize(app)
17
- @app = app
18
- end
11
+ Bundler::Plugin.add_hook('after-install-all') do |specs|
12
+ log_gem_event('install', specs)
13
+ end
14
+ Bundler::Plugin.add_hook('before-uninstall-all') do |specs|
15
+ log_gem_event('uninstall', specs)
16
+ end
17
+ Bundler::Plugin.add_hook('before-update-all') do |specs|
18
+ log_gem_event('update', specs)
19
+ end
20
+ Bundler::Plugin.add_hook('after-exec-all') do |specs|
21
+ log_gem_event('execute', specs)
22
+ end
23
+ Bundler::Plugin.add_hook('after-update-all') do |specs|
24
+ log_gem_event('update', specs)
25
+ end
26
+ Bundler::Plugin.add_hook('after-clean-all') do |specs|
27
+ log_gem_event('clean', specs)
28
+ end
29
+ Bundler::Plugin.add_hook('after-list-all') do |specs|
30
+ log_gem_event('list', specs)
31
+ end
19
32
 
20
- def call(env)
21
- status, headers, response = @app.call(env)
22
- log_activity(env)
23
- [status, headers, response]
33
+ # Start Git repository monitoring
34
+ git = Git.open('.')
35
+ listener = Listen.to('.', only: /\.rb$/, ignore: /vendor|log/) do |modified, added, removed|
36
+ log_file_changes(modified, added, removed, git)
37
+ end
38
+ listener.start
24
39
  end
25
40
 
26
41
  private
27
42
 
28
- def log_activity(env)
43
+ def log_gem_event(action, specs)
44
+ FileUtils.mkdir_p("log")
45
+ File.open("log/awanllm_activity.log", "a") do |file|
46
+ file.puts("[#{Time.now}] Gem #{action}: #{specs.map(&:name).join(', ')}")
47
+ end
48
+ end
49
+
50
+ def log_file_changes(modified, added, removed, git)
29
51
  FileUtils.mkdir_p("log")
30
52
  File.open("log/awanllm_activity.log", "a") do |file|
31
- file.puts("[#{Time.now}] #{env['REQUEST_METHOD']} #{env['PATH_INFO']}")
53
+ modified.each { |file| file.puts("[#{Time.now}] Modified: #{file} (#{git.diff.stats[:changed]} lines changed)") }
54
+ added.each { |file| file.puts("[#{Time.now}] Added: #{file}") }
55
+ removed.each { |file| file.puts("[#{Time.now}] Removed: #{file}") }
32
56
  end
33
57
  end
34
58
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WalkthroughAwanllm
4
- VERSION = "0.1.17"
4
+ VERSION = "0.1.18"
5
5
  end
@@ -67,7 +67,7 @@ module WalkthroughAwanllm
67
67
  puts 'Walkthrough_AwanLLM gem is already configured.'
68
68
  else
69
69
  ruby_version = RUBY_VERSION.split('.').first(3).join('.')
70
- path_to_script = "./vendor/bundle/ruby/#{ruby_version}/gems/walkthrough_awanllm-0.1.17/bin/setup_awanllm.rb"
70
+ path_to_script = "./vendor/bundle/ruby/#{ruby_version}/gems/walkthrough_awanllm-0.1.18/bin/setup_awanllm.rb"
71
71
  system("ruby #{path_to_script}")
72
72
  end
73
73
  end
@@ -40,6 +40,6 @@ Gem::Specification.new do |spec|
40
40
  spec.post_install_message = <<-MESSAGE
41
41
  Thank you for installing the Walkthrough_AwanLLM gem!
42
42
  To complete the setup, please run the following command:
43
- ruby ./vendor/bundle/ruby/#{RUBY_VERSION.split('.').first(3).join('.')}/gems/walkthrough_awanllm-0.1.17/bin/setup_awanllm.rb
43
+ ruby ./vendor/bundle/ruby/#{RUBY_VERSION.split('.').first(3).join('.')}/gems/walkthrough_awanllm-0.1.18/bin/setup_awanllm.rb
44
44
  MESSAGE
45
45
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: walkthrough_awanllm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.17
4
+ version: 0.1.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mrudul John
@@ -114,7 +114,7 @@ metadata:
114
114
  post_install_message: |2
115
115
  Thank you for installing the Walkthrough_AwanLLM gem!
116
116
  To complete the setup, please run the following command:
117
- ruby ./vendor/bundle/ruby/3.3.0/gems/walkthrough_awanllm-0.1.17/bin/setup_awanllm.rb
117
+ ruby ./vendor/bundle/ruby/3.3.0/gems/walkthrough_awanllm-0.1.18/bin/setup_awanllm.rb
118
118
  rdoc_options: []
119
119
  require_paths:
120
120
  - lib