rails-nl2sql 0.2.5 → 0.2.7

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: 75187efc95612f5a371882fe896d32cb641261774e236104de19622ea772e712
4
- data.tar.gz: e71a347b902ac3579f6b242084d51a01bdc4297d57cf3c7a4938b62d01d7fc24
3
+ metadata.gz: 22b9369727b653c79f571c2f432cd2407b4de4dd1f3c021bd6026750bf4ec210
4
+ data.tar.gz: 85bd74b369d893084f5d4d6430632c0b1c223c6125abc670b9168494db9a3d33
5
5
  SHA512:
6
- metadata.gz: 404e26c6e6064d13b955e586ebfa27078b1de8c0eb5b183d13f69894a5f0fb077a8df7960ed85b51d4883a5af334c797609eca8be394404641c5821454f4b1cf
7
- data.tar.gz: 2be5c96e0b428685b520f34fe9f9eee98bc544305525381a1b7107e83d6d8c4df2d162b3c5c704198027ca200a660fdcf51b55f1c93a7425b5167c4f5eb4212a
6
+ metadata.gz: 9aa63f789ab30b9b667c29173f5d4feaece2e6a727ad19d21e4f4b35e65eb490e0038c1609ff3ed24d96047109b5f2e873dcbf99b91987df6f5e911ca6ac9622
7
+ data.tar.gz: f45be1df53454b3a663675694454e9d6974628352bb2688f2e440d25dc37870d8d1449b5b23b9878c392fa7791b7b3fce2b8e9bcba7e7d3cee5215dd700bb546
data/CHANGELOG.md CHANGED
@@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
-
10
+ ## [0.2.7] - 2025-07-18
11
+ ### Fixed
12
+ - Fix from_nl trailing semicolon
11
13
 
12
14
  ## [0.2.5] - 2025-07-18
13
15
  ### Fixed
@@ -9,6 +9,8 @@ module Rails
9
9
  class_methods do
10
10
  def from_nl(prompt, options = {})
11
11
  sql = Rails::Nl2sql::Processor.generate_query_only(prompt, options)
12
+ sql = sql.to_s.strip
13
+ sql = sql.chomp(';')
12
14
  from(Arel.sql("(#{sql}) AS #{table_name}"))
13
15
  end
14
16
  end
@@ -1,5 +1,5 @@
1
1
  module Rails
2
2
  module Nl2sql
3
- VERSION = "0.2.5"
3
+ VERSION = "0.2.7"
4
4
  end
5
5
  end
data/lib/rails/nl2sql.rb CHANGED
@@ -39,10 +39,9 @@ module Rails
39
39
  end
40
40
 
41
41
  def self.prompt_template
42
- @prompt_template ||= begin
43
- erb = ERB.new(File.read(prompt_template_path))
44
- YAML.safe_load(erb.result)
45
- end
42
+ # Load the YAML template without evaluating ERB so we can
43
+ # interpolate variables later when building prompts.
44
+ @prompt_template ||= YAML.safe_load(File.read(prompt_template_path))
46
45
  end
47
46
 
48
47
  class Processor
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-nl2sql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Russell Van Curen