active_prompt_rails 0.1.11 → 0.1.13

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: '0592ef761bbd2c24ff22a747df8999160455443df912fe727d179863709bc012'
4
- data.tar.gz: 750a4000c0935acbe601a5ac7bf4f45a93d6b3937c0a5fb911cad634f82f3e95
3
+ metadata.gz: 8f1db637faba44dcd244dc2ea3da17178b23be8ec8d5ee8d8b7f2edc53493b26
4
+ data.tar.gz: 617603e5d44ed4f51e187a9f9f6b9b0f5cfa2ff06c73f040c01d387a26ebd533
5
5
  SHA512:
6
- metadata.gz: 6a13b69cf3d6a5ab9bb86dfea63d2f88f685eb419b2b223d0dfbdfe18a4ab25c6a8ad5e1d7b383dd84d41a7cc54413c22a56fd3a2d5663a317434d233cae8019
7
- data.tar.gz: f572a1502197a47f95d9d091b14dfd0b03ef5cf1b5249614a50bac033f8c916a80c21896ff9b0b6126414c7aae03345d0e2e0b1b881378646b252b21be47f82b
6
+ metadata.gz: 1129428b3d8128f6ccd4ace4a4320eb08fd40168b6b573b97277cada67d0093dc918eba199232bdf99520000a45dfae3c082377c3a0dcc30817378b0e933bd29
7
+ data.tar.gz: a5c1bbffeb386557fdf07f50f1588b8b93f71e418df54100b4ac35e27cd1913297111fc7cc287139663c61577e8c484950bc8cc04d9e03ea27c05d4f38316ccc
@@ -43,7 +43,7 @@ module ActivePrompt
43
43
  private
44
44
 
45
45
  def render_template(template_name)
46
- template_path = File.join("app", "prompts", self.class.name.underscore, template_name)
46
+ template_path = File.join("app", "prompts", "#{self.class.name.underscore}_prompt", template_name)
47
47
  template = File.read(template_path)
48
48
  context = # Dynamic method call to get the variable value
49
49
  self.class.variables.map do |var|
@@ -4,10 +4,6 @@ require "rails/railtie"
4
4
 
5
5
  module ActivePrompt
6
6
  class Railtie < Rails::Railtie
7
- generators do
8
- require_relative "generators/active_prompt/prompt/prompt_generator"
9
- end
10
-
11
- config.autoload_paths += Dir["#{config.root}/app/prompts/**/"]
7
+ config.autoload_paths << Dir["#{config.root}/app/prompts/**/"]
12
8
  end
13
9
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActivePrompt
4
- VERSION = "0.1.11"
4
+ VERSION = "0.1.13"
5
5
  end
data/lib/active_prompt.rb CHANGED
@@ -1,10 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "active_prompt/base"
4
- require_relative "active_prompt/errors"
5
- require_relative "active_prompt/version"
6
- require_relative "active_prompt/generators/active_prompt/prompt/prompt_generator"
7
- require_relative "active_prompt/railtie" if defined?(Rails)
3
+ require "active_prompt/railtie" if defined?(::Rails::Railtie)
4
+ require "active_prompt/base"
5
+ require "active_prompt/errors"
6
+ require "active_prompt/version"
8
7
 
9
8
  module ActivePrompt
10
9
  class Error < StandardError; end
@@ -11,9 +11,9 @@ module ActivePrompt
11
11
 
12
12
  def create_prompt_files
13
13
  empty_directory "app/prompts/#{name.underscore}"
14
- template "system.liquid", "app/prompts/#{name.underscore}/system.liquid"
15
- template "user.liquid", "app/prompts/#{name.underscore}/user.liquid"
16
- create_file "app/prompts/#{name.underscore}/prompt.rb", <<~RUBY
14
+ template "system.liquid", "app/prompts/#{name.underscore}_prompt/system.liquid"
15
+ template "user.liquid", "app/prompts/#{name.underscore}_prompt/user.liquid"
16
+ create_file "app/prompts/#{name.underscore}_prompt.rb", <<~RUBY
17
17
  # This is a generated prompt class for #{file_name}
18
18
  class #{name.camelize}Prompt < ActivePrompt::Base
19
19
  # Define your required template variables here, e.g.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_prompt_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Perreault