active_prompt_rails 0.1.3 → 0.1.5

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: 44c2a50ad57792c07274a4bc79e3b5cd17f2a0c5a169bba942bd294a1185e5aa
4
- data.tar.gz: 7f89ab3df2a3074326b72e3e0422e9a6b8d070397e2f056297216e9367f75d57
3
+ metadata.gz: 2f3c16e98361421bbf21eddde763a91d3ef4c1f7c21350355142cb99a50fd692
4
+ data.tar.gz: c8e606ff0a351234ab3dca34ea3fd4126934bd3aedf386145a31b3deb3f20ac7
5
5
  SHA512:
6
- metadata.gz: d8894e59a6cdc77537de645eb0fa3f0c5b2542f2d6d8d853d9fbf2029557ac7950632516073869d93c0b1b2f9a88306891df793775e91b72cc1f5d18d29d7684
7
- data.tar.gz: 4cc010d3b0eb0fb511ed1597701a7381d8a875c71af5879aaae680a35172f7225526daad90074a47de6d66ab63e4109e836ca2a77427953c1726850cdcd9f35d
6
+ metadata.gz: 86c5003dfb4e551bbccdc09bdb3ca58697020199c7946adcea73622928e74f9f3d735d0c1c16ad57f6996b23662c0dc07c12d90463158edc2b4c55eee9e15a83
7
+ data.tar.gz: '038af868e63fa87bb915b20b9b2beca8430ecb48a558f68403ae7edeb87d6cc6532902c97ed1aacb2fdeac62faf96bcc93ae71c40470a263011c27b170dbcf41'
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'rails/generators'
4
+
3
5
  module ActivePrompt
4
6
  module Generators
5
7
  # This generator creates a new prompt in the app/prompts directory
@@ -7,6 +9,7 @@ module ActivePrompt
7
9
  source_root File.expand_path("templates", __dir__)
8
10
 
9
11
  def create_prompt_files
12
+ empty_directory "app/prompts/#{file_name}"
10
13
  create_file "app/prompts/#{file_name}/system.liquid"
11
14
  create_file "app/prompts/#{file_name}/user.liquid"
12
15
  create_file "app/prompts/#{file_name}/prompt.rb", <<~RUBY
@@ -0,0 +1,9 @@
1
+ require 'rails/railtie'
2
+
3
+ module ActivePrompt
4
+ class Railtie < Rails::Railtie
5
+ config.app_generators do |g|
6
+ g.templates.unshift File.expand_path('../generators/active_prompt', __dir__)
7
+ end
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActivePrompt
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.5"
5
5
  end
data/lib/active_prompt.rb CHANGED
@@ -4,8 +4,9 @@ require_relative "active_prompt/base"
4
4
  require_relative "active_prompt/errors"
5
5
  require_relative "active_prompt/version"
6
6
  require_relative "active_prompt/generators/active_prompt/prompt/prompt_generator"
7
+ require_relative "active_prompt/railtie" if defined?(Rails)
8
+
7
9
 
8
10
  module ActivePrompt
9
11
  class Error < StandardError; end
10
- # Your code goes here...
11
12
  end
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.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Perreault
@@ -71,6 +71,7 @@ files:
71
71
  - lib/active_prompt/generators/active_prompt/prompt/prompt_generator.rb
72
72
  - lib/active_prompt/generators/active_prompt/prompt/templates/system.liquid
73
73
  - lib/active_prompt/generators/active_prompt/prompt/templates/user.liquid
74
+ - lib/active_prompt/railtie.rb
74
75
  - lib/active_prompt/version.rb
75
76
  - sig/active_prompt.rbs
76
77
  homepage: https://www.github.com/Shaneprrlt/active_prompt