walkthrough_awanllm 0.1.17 → 0.1.19

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: f957d25ebc64531eaff0a8ab958786a1cf60050da46acd3e2bbf46e933851757
4
+ data.tar.gz: a1565db338ee2ff506cde37b81e018cdc456411df8f6232fabdb595206c44c5e
5
5
  SHA512:
6
- metadata.gz: 2a66e0af04d9ce9f28f63a195349990a13d1deb57821651f0eaf3fef70931d012a808916a96a66eac631c8561ae8c0fe7d1ddcbd7a6b5f9433ba59b75f934174
7
- data.tar.gz: da21f83d222c036a7d699ec78efdd4a37e1bdef91fc0e40a28b17f218c40a578c5f7b8552943ede8e06a6a8dace8ee8db9cfc8a1510866a6c4c087cb8e839121
6
+ metadata.gz: bfcfb787bed01d33be4705d6cda37f1fea6697143304dabbddb0ceaf5045fbe932f76ab380e636bd5106e3b5b5f265e9be5e2f7ff09a3a420e49197c030f1a7f
7
+ data.tar.gz: d531677e4ba38b3d7913b60f2c41ff87f6cec91020fd44ccd2458de7fc3547d36e9524566f8c766591dbd4f781ca1b1c8a10a0d27d4aa1d15093de8e52fa2651
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.19/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,3 +1,4 @@
1
+ # lib/awanllm/railtie.rb
1
2
 
2
3
  require 'rails/railtie'
3
4
  require 'fileutils'
@@ -6,6 +7,27 @@ module AwanLLM
6
7
  class Railtie < Rails::Railtie
7
8
  initializer "awanllm.track_activity" do |app|
8
9
  app.config.middleware.use AwanLLM::Tracker
10
+
11
+ setup_git_hook
12
+ end
13
+
14
+ private
15
+
16
+ def setup_git_hook
17
+ git_hook_script_path = Rails.root.join('.git', 'hooks', 'post-commit')
18
+ git_hook_script_content = <<-SCRIPT
19
+ #!/bin/bash
20
+ RAILS_ROOT="#{Rails.root}"
21
+ cd $RAILS_ROOT
22
+ bundle exec rails runner "AwanLLM::Tracker.new.update_activity_log"
23
+ SCRIPT
24
+
25
+ # Write the Git hook script
26
+ File.open(git_hook_script_path, "w") { |f| f.write(git_hook_script_content) }
27
+ FileUtils.chmod(0755, git_hook_script_path)
28
+
29
+ # Inform the user about the setup
30
+ puts "Git hook for tracking activity log updates has been set up: #{git_hook_script_path}"
9
31
  end
10
32
  end
11
33
  end
@@ -13,22 +35,31 @@ end
13
35
  # Middleware to track activities
14
36
  module AwanLLM
15
37
  class Tracker
16
- def initialize(app)
38
+ def initialize(app = nil)
17
39
  @app = app
18
40
  end
19
41
 
20
42
  def call(env)
21
43
  status, headers, response = @app.call(env)
22
- log_activity(env)
23
44
  [status, headers, response]
24
45
  end
25
46
 
26
- private
47
+ def update_activity_log
48
+ log_file_path = Rails.root.join('log', 'awanllm_activity.log')
49
+ FileUtils.mkdir_p(File.dirname(log_file_path))
50
+
51
+ # Get the latest commit details
52
+ commit_details = `git log -1 --pretty=format:"%H %an %ad %s" --date=iso`
53
+ file_changes = `git diff-tree --no-commit-id --name-status -r HEAD`
27
54
 
28
- def log_activity(env)
29
- FileUtils.mkdir_p("log")
30
- File.open("log/awanllm_activity.log", "a") do |file|
31
- file.puts("[#{Time.now}] #{env['REQUEST_METHOD']} #{env['PATH_INFO']}")
55
+ File.open(log_file_path, "a") do |file|
56
+ file.puts("### [#{Time.now}] Activity Log")
57
+ file.puts("#### Commit Details: #{commit_details.strip}")
58
+ file.puts("#### File Changes:")
59
+ file_changes.each_line do |line|
60
+ file.puts("- #{line.strip}")
61
+ end
62
+ file.puts("\n")
32
63
  end
33
64
  end
34
65
  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.19"
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.19/bin/setup_awanllm.rb"
71
71
  system("ruby #{path_to_script}")
72
72
  end
73
73
  end
@@ -3,24 +3,25 @@
3
3
  require_relative "lib/walkthrough_awanllm/version"
4
4
 
5
5
  Gem::Specification.new do |spec|
6
- spec.name = "walkthrough_awanllm"
7
- spec.version = WalkthroughAwanllm::VERSION
8
- spec.authors = ["Mrudul John"]
9
- spec.email = ["mrudulmathews@gmail.com"]
6
+ spec.name = "walkthrough_awanllm"
7
+ spec.version = WalkthroughAwanllm::VERSION
8
+ spec.authors = ["Mrudul John"]
9
+ spec.email = ["mrudulmathews@gmail.com"]
10
10
 
11
- spec.summary = "A Ruby gem to Generate Project Development Walkthrough with the AwanLLM API."
12
- spec.description = "{UNDER DEVELOPMENT NOT FOR USE YET}A Ruby gem to generate a walkthrough the project lifecycle with the AwanLLM API for generating and retrieving content."
13
- spec.homepage = "https://github.com/mruduljohn/Walkthrough_awanllm_gem"
14
- spec.license = "MIT"
11
+ spec.summary = "A Ruby gem to Generate Project Development Walkthrough with the AwanLLM API."
12
+ spec.description = "{UNDER DEVELOPMENT NOT FOR USE YET}A Ruby gem to generate a walkthrough the project lifecycle with the AwanLLM API for generating and retrieving content."
13
+ spec.homepage = "https://github.com/mruduljohn/Walkthrough_awanllm_gem"
14
+ spec.license = "MIT"
15
15
  spec.required_ruby_version = ">= 3.0.0"
16
16
 
17
17
  spec.metadata["homepage_uri"] = spec.homepage
18
18
 
19
19
  # Specify which files should be added to the gem when it is released.
20
20
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
21
- spec.files = IO.popen(%w[git ls-files -z], chdir: __dir__, err: IO::NULL) do |ls|
22
- ls.readlines("\x0", chomp: true).reject do |f|
23
- f.start_with?(*%w[bin/ test/ spec/ features/ .git appveyor Gemfile])
21
+ spec.files = Dir.chdir(__dir__) do
22
+ `git ls-files -z`.split("\x0").reject do |f|
23
+ f.start_with?(*%w[bin/ test/ spec/ features/ .git appveyor Gemfile]) ||
24
+ f.match(/walkthrough_awanllm-\d+\.\d+\.\d+\.gem/)
24
25
  end
25
26
  end + [
26
27
  "lib/walkthrough_awanllm.rb",
@@ -40,6 +41,6 @@ Gem::Specification.new do |spec|
40
41
  spec.post_install_message = <<-MESSAGE
41
42
  Thank you for installing the Walkthrough_AwanLLM gem!
42
43
  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
44
+ ruby ./vendor/bundle/ruby/#{RUBY_VERSION.split('.').first(3).join('.')}/gems/walkthrough_awanllm-#{spec.version}/bin/setup_awanllm.rb
44
45
  MESSAGE
45
46
  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.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mrudul John
@@ -100,11 +100,6 @@ files:
100
100
  - lib/walkthrough_awanllm/railtie.rb
101
101
  - lib/walkthrough_awanllm/version.rb
102
102
  - sig/walkthrough_awanllm.rbs
103
- - walkthrough_awanllm-0.1.11.gem
104
- - walkthrough_awanllm-0.1.13.gem
105
- - walkthrough_awanllm-0.1.14.gem
106
- - walkthrough_awanllm-0.1.15.gem
107
- - walkthrough_awanllm-0.1.16.gem
108
103
  - walkthrough_awanllm.gemspec
109
104
  homepage: https://github.com/mruduljohn/Walkthrough_awanllm_gem
110
105
  licenses:
@@ -114,7 +109,7 @@ metadata:
114
109
  post_install_message: |2
115
110
  Thank you for installing the Walkthrough_AwanLLM gem!
116
111
  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
112
+ ruby ./vendor/bundle/ruby/3.3.0/gems/walkthrough_awanllm-0.1.19/bin/setup_awanllm.rb
118
113
  rdoc_options: []
119
114
  require_paths:
120
115
  - lib
Binary file
Binary file
Binary file
Binary file
Binary file