active_prompt_rails 0.1.12 → 0.1.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b6f33ae20b1d80118ce6616297eccff17755e1fc74b719026eb3c65662861ea6
4
- data.tar.gz: 876e8703497ee0402a25185a052951b6269769cf5cdd165fa15a1b699bc5146b
3
+ metadata.gz: a873c6d8dc089798c08a5f056a8260fd2976bc834212c2b1f93bae52a030d68e
4
+ data.tar.gz: 93f5d4323c87e266ad8508b3322ab3e82b3b92a422547e03949a8b292c61d400
5
5
  SHA512:
6
- metadata.gz: aaea2125194efc9c22e9c7349910ee933363fccc03fc0d97c9ae46e245d77dc2bbd1fbc1b2c4f939ae1e3d2408416d45e44c66a783438eb1d9043650abd50fb2
7
- data.tar.gz: c430c2b2ac87d9b8a4302a72d739679a74267f1372e80a5f2be1edcbc953c44a70f1f5518d16ac5993ef0822db29a0b509a1e2c20651f21dfefaabe1eb27ce69
6
+ metadata.gz: 6a118d8c1771793370da74122aaa63a7072104dab3da16098a3cc8f3d512f6f73ce838cffa2e258fef20876f29083505125f536c93ec0b49a53dd9dcc782b42d
7
+ data.tar.gz: 2b328dbe56276178d6c6084ebbff68cbaaeea0c403990941622d04ac87bbd79804db7339edddb7f90f6143f077d62580dde88f42662ab767f0eb69f72f1e812f
@@ -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,6 +4,6 @@ require "rails/railtie"
4
4
 
5
5
  module ActivePrompt
6
6
  class Railtie < Rails::Railtie
7
- config.autoload_paths += Dir["#{config.root}/app/prompts/**/"]
7
+ eager_load_namespaces << ActivePrompt
8
8
  end
9
9
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActivePrompt
4
- VERSION = "0.1.12"
4
+ VERSION = "0.1.14"
5
5
  end
data/lib/active_prompt.rb CHANGED
@@ -1,9 +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/railtie" if defined?(::Rails::Railtie)
3
+ require "active_prompt/railtie" if defined?(::Rails::Railtie)
4
+ require "active_prompt/base"
5
+ require "active_prompt/errors"
6
+ require "active_prompt/version"
7
7
 
8
8
  module ActivePrompt
9
9
  class Error < StandardError; end
@@ -11,8 +11,8 @@ 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"
14
+ template "system.liquid", "app/prompts/#{name.underscore}_prompt/system.liquid"
15
+ template "user.liquid", "app/prompts/#{name.underscore}_prompt/user.liquid"
16
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
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.12
4
+ version: 0.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Perreault