promptly 0.1.2 → 0.1.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 +4 -4
- data/.ruby-version +1 -0
- data/README.md +99 -19
- data/lib/generators/promptly/prompt_generator.rb +117 -0
- data/lib/promptly/cache.rb +67 -0
- data/lib/promptly/railtie.rb +5 -0
- data/lib/promptly/tasks/ai_prompts.rake +4 -4
- data/lib/promptly/version.rb +1 -1
- data/lib/promptly.rb +21 -3
- data/promptly.gemspec +5 -3
- metadata +24 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55ee620ab3faf1e3c2d2ff44db3f28fe255a7379431c360f86b6f8dd87a8a752
|
4
|
+
data.tar.gz: ddf1db22fc260b4007e374944833b4ffe08fd5bcab020a033a28956612a26bbc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f343de865b5a2bef48f3a86cd131c40b8173be6183267fbd22242b228b668891ea191c7dba2597db373a7814bb30e05b8b8e4004cf345defef1d2e84c7b9b92
|
7
|
+
data.tar.gz: 3e872512ba87aa8f387d851d75d378e7b9cba91a20bbc0c316598af80166a71d691751e3a00a1aefda20a132f88e5a9bb58414ba312760dbc02dacec590bc11e
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3.3.4
|
data/README.md
CHANGED
@@ -1,3 +1,37 @@
|
|
1
|
+
## Generators
|
2
|
+
|
3
|
+
Create prompt templates following conventions.
|
4
|
+
|
5
|
+
```bash
|
6
|
+
# ERB with multiple locales
|
7
|
+
rails g promptly:prompt user_onboarding/welcome_email --locales en es --engine erb
|
8
|
+
|
9
|
+
# Liquid with a single locale
|
10
|
+
rails g promptly:prompt ai_coaching/goal_review --locales en --engine liquid
|
11
|
+
|
12
|
+
# Fallback-only (no locale suffix)
|
13
|
+
rails g promptly:prompt content_generation/outline --no-locale
|
14
|
+
```
|
15
|
+
|
16
|
+
Options:
|
17
|
+
|
18
|
+
- `--engine` erb|liquid (default: erb)
|
19
|
+
- `--locales` space-separated list (default: I18n.available_locales if available, else `en`)
|
20
|
+
- `--no-locale` create only fallback file (e.g., `welcome_email.erb`)
|
21
|
+
- `--force` overwrite existing files
|
22
|
+
|
23
|
+
Generated files are placed under `app/prompts/` and directories are created as needed.
|
24
|
+
|
25
|
+
Examples:
|
26
|
+
|
27
|
+
- `app/prompts/user_onboarding/welcome_email.en.erb`
|
28
|
+
- `app/prompts/user_onboarding/welcome_email.es.erb`
|
29
|
+
- `app/prompts/ai_coaching/goal_review.en.liquid`
|
30
|
+
- `app/prompts/content_generation/outline.erb` (fallback-only)
|
31
|
+
|
32
|
+
The generator seeds a minimal, intention-revealing scaffold you can edit immediately.
|
33
|
+
|
34
|
+
## API Reference
|
1
35
|
# Promptly
|
2
36
|
|
3
37
|
Opinionated Rails integration for reusable AI prompt templates. Build maintainable, localized, and testable AI prompts using ERB or Liquid templates with Rails conventions.
|
@@ -7,8 +41,9 @@ Opinionated Rails integration for reusable AI prompt templates. Build maintainab
|
|
7
41
|
- **Template rendering**: ERB (via ActionView) and optional Liquid support
|
8
42
|
- **I18n integration**: Automatic locale fallback (`welcome.es.erb` → `welcome.en.erb` → `welcome.erb`)
|
9
43
|
- **Rails conventions**: Store prompts in `app/prompts/` with organized subdirectories
|
10
|
-
- **
|
44
|
+
- **Render & CLI**: Test prompts in Rails console or via rake tasks
|
11
45
|
- **Minimal setup**: Auto-loads via Railtie, zero configuration required
|
46
|
+
- **Prompt caching**: Configurable cache store, TTL, and cache-bypass options
|
12
47
|
|
13
48
|
## Install
|
14
49
|
|
@@ -82,7 +117,7 @@ Mantén el email conciso (menos de 200 palabras) y orientado a la acción.
|
|
82
117
|
|
83
118
|
```ruby
|
84
119
|
# In a controller, service, or anywhere in Rails
|
85
|
-
prompt = Promptly.
|
120
|
+
prompt = Promptly.render(
|
86
121
|
"user_onboarding/welcome_email",
|
87
122
|
locale: :es,
|
88
123
|
locals: {
|
@@ -109,8 +144,8 @@ puts ai_response.dig("choices", 0, "message", "content")
|
|
109
144
|
```ruby
|
110
145
|
rails console
|
111
146
|
|
112
|
-
#
|
113
|
-
prompt = Promptly.
|
147
|
+
# Render the prompt before sending to AI
|
148
|
+
prompt = Promptly.render(
|
114
149
|
"user_onboarding/welcome_email",
|
115
150
|
locale: :en,
|
116
151
|
locals: {
|
@@ -125,7 +160,7 @@ puts prompt
|
|
125
160
|
|
126
161
|
# Uses I18n.locale by default
|
127
162
|
I18n.locale = :es
|
128
|
-
prompt = Promptly.
|
163
|
+
prompt = Promptly.render(
|
129
164
|
"user_onboarding/welcome_email",
|
130
165
|
locals: {
|
131
166
|
name: "María García",
|
@@ -137,14 +172,14 @@ prompt = Promptly.preview(
|
|
137
172
|
)
|
138
173
|
```
|
139
174
|
|
140
|
-
### 4. CLI
|
175
|
+
### 4. CLI rendering
|
141
176
|
|
142
177
|
```bash
|
143
|
-
#
|
144
|
-
rails ai_prompts:
|
178
|
+
# Render specific locale (shows the prompt, not AI output)
|
179
|
+
rails ai_prompts:render[user_onboarding/welcome_email,es]
|
145
180
|
|
146
181
|
# Uses default locale
|
147
|
-
rails ai_prompts:
|
182
|
+
rails ai_prompts:render[user_onboarding/welcome_email]
|
148
183
|
```
|
149
184
|
|
150
185
|
## Rails App Integration
|
@@ -155,7 +190,7 @@ rails ai_prompts:preview[user_onboarding/welcome_email]
|
|
155
190
|
# app/services/ai_prompt_service.rb
|
156
191
|
class AiPromptService
|
157
192
|
def self.generate_welcome_email(user, locale: I18n.locale)
|
158
|
-
prompt = Promptly.
|
193
|
+
prompt = Promptly.render(
|
159
194
|
"user_onboarding/welcome_email",
|
160
195
|
locale: locale,
|
161
196
|
locals: {
|
@@ -219,7 +254,7 @@ class GenerateAiContentJob < ApplicationJob
|
|
219
254
|
def perform(user_id, prompt_identifier, locals = {})
|
220
255
|
user = User.find(user_id)
|
221
256
|
|
222
|
-
prompt = Promptly.
|
257
|
+
prompt = Promptly.render(
|
223
258
|
prompt_identifier,
|
224
259
|
locale: user.locale,
|
225
260
|
locals: locals.merge(
|
@@ -302,7 +337,7 @@ I18n.locale = :es
|
|
302
337
|
I18n.default_locale = :en
|
303
338
|
|
304
339
|
# Will try: welcome_email.es.erb → welcome_email.en.erb → welcome_email.erb
|
305
|
-
prompt = Promptly.
|
340
|
+
prompt = Promptly.render(
|
306
341
|
"user_onboarding/welcome_email",
|
307
342
|
locals: {
|
308
343
|
name: "María García",
|
@@ -314,7 +349,7 @@ prompt = Promptly.preview(
|
|
314
349
|
)
|
315
350
|
|
316
351
|
# Force specific locale for AI prompt generation
|
317
|
-
prompt = Promptly.
|
352
|
+
prompt = Promptly.render(
|
318
353
|
"content_generation/blog_post_outline",
|
319
354
|
locale: :fr,
|
320
355
|
locals: {
|
@@ -356,7 +391,7 @@ Format your response as a conversational coaching session, not a formal report.
|
|
356
391
|
|
357
392
|
```ruby
|
358
393
|
# Generate AI coaching content with Liquid template
|
359
|
-
prompt = Promptly.
|
394
|
+
prompt = Promptly.render(
|
360
395
|
"ai_coaching/goal_review",
|
361
396
|
locale: :en,
|
362
397
|
locals: {
|
@@ -384,29 +419,74 @@ ai_coaching_session = openai_client.chat(
|
|
384
419
|
Promptly.prompts_path = Rails.root.join("lib", "ai_prompts")
|
385
420
|
```
|
386
421
|
|
422
|
+
### Caching
|
423
|
+
|
424
|
+
Promptly supports optional caching for rendered prompts.
|
425
|
+
|
426
|
+
- Default: enabled, TTL = 3600 seconds (1 hour).
|
427
|
+
- In Rails, the Railtie auto-uses `Rails.cache` if present.
|
428
|
+
|
429
|
+
Configure globally:
|
430
|
+
|
431
|
+
```ruby
|
432
|
+
# config/initializers/promptly.rb
|
433
|
+
Promptly::Cache.configure do |c|
|
434
|
+
c.store = Rails.cache # or any ActiveSupport::Cache store
|
435
|
+
c.ttl = 3600 # default TTL in seconds
|
436
|
+
c.enabled = true # globally enable/disable caching
|
437
|
+
end
|
438
|
+
```
|
439
|
+
|
440
|
+
Per-call options:
|
441
|
+
|
442
|
+
```ruby
|
443
|
+
# Bypass cache for this render only
|
444
|
+
Promptly.render("user_onboarding/welcome_email", locals: {...}, cache: false)
|
445
|
+
|
446
|
+
# Custom TTL for this render only
|
447
|
+
Promptly.render("user_onboarding/welcome_email", locals: {...}, ttl: 5.minutes)
|
448
|
+
```
|
449
|
+
|
450
|
+
Invalidation:
|
451
|
+
|
452
|
+
```ruby
|
453
|
+
# Clear entire cache store (if supported by the store)
|
454
|
+
Promptly::Cache.clear
|
455
|
+
|
456
|
+
# Delete a specific cached entry
|
457
|
+
Promptly::Cache.delete(
|
458
|
+
identifier: "user_onboarding/welcome_email",
|
459
|
+
locale: :en,
|
460
|
+
locals: {name: "John"},
|
461
|
+
prompts_path: Promptly.prompts_path
|
462
|
+
)
|
463
|
+
```
|
464
|
+
|
387
465
|
### Direct Template Rendering
|
388
466
|
|
389
467
|
```ruby
|
390
468
|
# Render ERB directly (without file lookup)
|
391
469
|
template = "Hello <%= name %>, welcome to <%= app %>!"
|
392
|
-
output = Promptly.
|
470
|
+
output = Promptly.render_template(template, locals: {name: "John", app: "MyApp"})
|
393
471
|
|
394
472
|
# Render Liquid directly
|
395
473
|
template = "Hello {{ name }}, welcome to {{ app }}!"
|
396
|
-
output = Promptly.
|
474
|
+
output = Promptly.render_template(template, locals: {name: "John", app: "MyApp"}, engine: :liquid)
|
397
475
|
```
|
398
476
|
|
399
477
|
## API Reference
|
400
478
|
|
401
|
-
### `Promptly.
|
479
|
+
### `Promptly.render(identifier, locale: nil, locals: {}, cache: true, ttl: nil)`
|
402
480
|
|
403
|
-
Renders a template by identifier with locale fallback.
|
481
|
+
Renders a template by identifier with locale fallback and optional caching.
|
404
482
|
|
405
483
|
- **identifier**: Template path like `"user_onboarding/welcome"`
|
406
484
|
- **locale**: Specific locale (defaults to `I18n.locale`)
|
407
485
|
- **locals**: Hash of variables for template
|
486
|
+
- **cache**: Enable/disable caching for this call (defaults to `true`)
|
487
|
+
- **ttl**: Time-to-live in seconds for cache entry (overrides default TTL)
|
408
488
|
|
409
|
-
### `Promptly.
|
489
|
+
### `Promptly.render_template(template, locals: {}, engine: :erb)`
|
410
490
|
|
411
491
|
Renders template string directly.
|
412
492
|
|
@@ -0,0 +1,117 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Rails generator: promptly:prompt
|
4
|
+
# Usage:
|
5
|
+
# rails g promptly:prompt user_onboarding/welcome_email --locales en es --engine erb
|
6
|
+
# Creates prompt templates under app/prompts/ following conventions.
|
7
|
+
|
8
|
+
require "fileutils"
|
9
|
+
|
10
|
+
begin
|
11
|
+
require "rails/generators"
|
12
|
+
require "rails/generators/named_base"
|
13
|
+
rescue LoadError
|
14
|
+
# Allow gem to load without Rails present
|
15
|
+
end
|
16
|
+
|
17
|
+
module Promptly
|
18
|
+
module Generators
|
19
|
+
class PromptGenerator < (defined?(Rails::Generators::NamedBase) ? Rails::Generators::NamedBase : Object)
|
20
|
+
if defined?(Rails::Generators::NamedBase)
|
21
|
+
argument :name, type: :string, required: true, desc: "Prompt identifier, e.g., user_onboarding/welcome_email"
|
22
|
+
|
23
|
+
class_option :engine, type: :string, default: "erb", desc: "Template engine: erb or liquid"
|
24
|
+
class_option :locales, type: :array, default: [], desc: "Locales to generate (e.g., en es fr)"
|
25
|
+
class_option :no_locale, type: :boolean, default: false, desc: "Generate only fallback (no locale suffix)"
|
26
|
+
class_option :force, type: :boolean, default: false, desc: "Overwrite existing files"
|
27
|
+
|
28
|
+
def create_prompt_files
|
29
|
+
id_path = name.to_s
|
30
|
+
base_dir = File.join("app", "prompts", File.dirname(id_path))
|
31
|
+
basename = File.basename(id_path)
|
32
|
+
|
33
|
+
FileUtils.mkdir_p(base_dir)
|
34
|
+
|
35
|
+
ext = engine_extension
|
36
|
+
resolve_targets(basename, ext).each do |rel|
|
37
|
+
path = File.join(base_dir, rel)
|
38
|
+
if File.exist?(path) && !options[:force]
|
39
|
+
say_status :skip, path
|
40
|
+
next
|
41
|
+
end
|
42
|
+
create_file(path, content_for_engine(ext), force: true)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
private
|
47
|
+
|
48
|
+
def engine_extension
|
49
|
+
engine = options[:engine].to_s.downcase
|
50
|
+
case engine
|
51
|
+
when "erb" then "erb"
|
52
|
+
when "liquid" then "liquid"
|
53
|
+
else
|
54
|
+
say_status :error, "Unknown engine '#{engine}'. Use erb or liquid.", :red
|
55
|
+
exit(1)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def resolved_locales
|
60
|
+
return [] if options[:no_locale]
|
61
|
+
|
62
|
+
if options[:locales].any?
|
63
|
+
options[:locales].map(&:to_s)
|
64
|
+
elsif defined?(I18n) && I18n.respond_to?(:available_locales)
|
65
|
+
Array(I18n.available_locales).map(&:to_s)
|
66
|
+
else
|
67
|
+
["en"]
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
def resolve_targets(basename, ext)
|
72
|
+
locs = resolved_locales
|
73
|
+
if options[:no_locale] || locs.empty?
|
74
|
+
["#{basename}.#{ext}"]
|
75
|
+
else
|
76
|
+
locs.uniq.map { |loc| "#{basename}.#{loc}.#{ext}" }
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
def content_for_engine(ext)
|
81
|
+
case ext
|
82
|
+
when "erb"
|
83
|
+
<<~ERB
|
84
|
+
<!-- Prompt: generated by promptly:prompt -->
|
85
|
+
<!-- Identifier: #{name} -->
|
86
|
+
|
87
|
+
You are an AI assistant. Fill in content below using provided locals.
|
88
|
+
|
89
|
+
Context:
|
90
|
+
- Example local: <%= example || "value" %>
|
91
|
+
|
92
|
+
Task:
|
93
|
+
1. Explain the goal.
|
94
|
+
2. Provide actionable steps.
|
95
|
+
3. Keep it concise and clear.
|
96
|
+
ERB
|
97
|
+
when "liquid"
|
98
|
+
<<~LIQ
|
99
|
+
{# Prompt: generated by promptly:prompt #}
|
100
|
+
{# Identifier: #{name} #}
|
101
|
+
|
102
|
+
You are an AI assistant. Fill in content below using provided locals.
|
103
|
+
|
104
|
+
Context:
|
105
|
+
- Example local: {{ example | default: "value" }}
|
106
|
+
|
107
|
+
Task:
|
108
|
+
1. Explain the goal.
|
109
|
+
2. Provide actionable steps.
|
110
|
+
3. Keep it concise and clear.
|
111
|
+
LIQ
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "digest"
|
4
|
+
|
5
|
+
module Promptly
|
6
|
+
class Cache
|
7
|
+
class << self
|
8
|
+
attr_accessor :store, :enabled, :ttl
|
9
|
+
|
10
|
+
def configure
|
11
|
+
yield self
|
12
|
+
end
|
13
|
+
|
14
|
+
def enabled?
|
15
|
+
@enabled != false && store
|
16
|
+
end
|
17
|
+
|
18
|
+
def fetch(key, ttl: nil, &block)
|
19
|
+
return yield unless enabled?
|
20
|
+
|
21
|
+
cache_key = generate_key(key)
|
22
|
+
cached_value = store.read(cache_key)
|
23
|
+
|
24
|
+
if cached_value
|
25
|
+
cached_value
|
26
|
+
else
|
27
|
+
value = yield
|
28
|
+
store.write(cache_key, value, expires_in: ttl || self.ttl)
|
29
|
+
value
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def clear
|
34
|
+
return unless enabled? && store.respond_to?(:clear)
|
35
|
+
|
36
|
+
store.clear
|
37
|
+
end
|
38
|
+
|
39
|
+
def delete(key)
|
40
|
+
return unless enabled?
|
41
|
+
|
42
|
+
cache_key = generate_key(key)
|
43
|
+
store.delete(cache_key)
|
44
|
+
end
|
45
|
+
|
46
|
+
private
|
47
|
+
|
48
|
+
def generate_key(key_data)
|
49
|
+
case key_data
|
50
|
+
when String
|
51
|
+
"promptly:#{key_data}"
|
52
|
+
when Hash
|
53
|
+
content = key_data.sort.to_s
|
54
|
+
hash = Digest::SHA256.hexdigest(content)
|
55
|
+
"promptly:#{hash}"
|
56
|
+
else
|
57
|
+
"promptly:#{Digest::SHA256.hexdigest(key_data.to_s)}"
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
# Default configuration
|
63
|
+
self.enabled = true
|
64
|
+
self.ttl = 3600 # 1 hour default TTL
|
65
|
+
self.store = nil
|
66
|
+
end
|
67
|
+
end
|
data/lib/promptly/railtie.rb
CHANGED
@@ -6,6 +6,11 @@ module Promptly
|
|
6
6
|
# Intentionally minimal per DHH style; conventions over configuration
|
7
7
|
# Hook points will be added as features land.
|
8
8
|
Rails.logger.info("[promptly] loaded") if defined?(Rails.logger)
|
9
|
+
|
10
|
+
# Auto-configure Rails cache if available
|
11
|
+
if defined?(Rails.cache)
|
12
|
+
Promptly::Cache.store = Rails.cache
|
13
|
+
end
|
9
14
|
end
|
10
15
|
|
11
16
|
rake_tasks do
|
@@ -1,21 +1,21 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
namespace :ai_prompts do
|
4
|
-
desc "
|
5
|
-
task :
|
4
|
+
desc "Render a prompt: rake ai_prompts:render[identifier,locale]"
|
5
|
+
task :render, [:identifier, :locale] => :environment do |_, args|
|
6
6
|
identifier = args[:identifier]
|
7
7
|
locale = args[:locale]
|
8
8
|
prompts_path = ENV["PROMPTS_PATH"]
|
9
9
|
|
10
10
|
unless identifier
|
11
|
-
warn "Usage: rake ai_prompts:
|
11
|
+
warn "Usage: rake ai_prompts:render[identifier,locale]"
|
12
12
|
exit 1
|
13
13
|
end
|
14
14
|
|
15
15
|
begin
|
16
16
|
Promptly.prompts_path = prompts_path if prompts_path
|
17
17
|
|
18
|
-
output = Promptly.
|
18
|
+
output = Promptly.render(identifier, locale: locale)
|
19
19
|
puts output
|
20
20
|
rescue Promptly::Error => e
|
21
21
|
warn "Error: #{e.class}: #{e.message}"
|
data/lib/promptly/version.rb
CHANGED
data/lib/promptly.rb
CHANGED
@@ -3,11 +3,12 @@
|
|
3
3
|
require_relative "promptly/version"
|
4
4
|
require_relative "promptly/renderer"
|
5
5
|
require_relative "promptly/locator"
|
6
|
+
require_relative "promptly/cache"
|
6
7
|
|
7
8
|
module Promptly
|
8
9
|
class Error < StandardError; end
|
9
10
|
|
10
|
-
def self.
|
11
|
+
def self.render_template(template, locals: {}, engine: :erb)
|
11
12
|
Renderer.render(template, locals: locals, engine: engine)
|
12
13
|
end
|
13
14
|
|
@@ -20,10 +21,27 @@ module Promptly
|
|
20
21
|
@prompts_path = path
|
21
22
|
end
|
22
23
|
|
23
|
-
#
|
24
|
+
# Render a template by identifier using locator rules
|
24
25
|
# identifier: "user_onboarding/welcome"
|
25
26
|
# locale: defaults to I18n.locale when available
|
26
|
-
def self.
|
27
|
+
def self.render(identifier, locale: nil, locals: {}, cache: true, ttl: nil)
|
28
|
+
if cache && Cache.enabled?
|
29
|
+
cache_key = {
|
30
|
+
identifier: identifier,
|
31
|
+
locale: locale,
|
32
|
+
locals: locals,
|
33
|
+
prompts_path: prompts_path
|
34
|
+
}
|
35
|
+
|
36
|
+
Cache.fetch(cache_key, ttl: ttl) do
|
37
|
+
render_without_cache(identifier, locale: locale, locals: locals)
|
38
|
+
end
|
39
|
+
else
|
40
|
+
render_without_cache(identifier, locale: locale, locals: locals)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
private_class_method def self.render_without_cache(identifier, locale: nil, locals: {})
|
27
45
|
path = Locator.resolve(identifier, locale: locale)
|
28
46
|
raise Error, "Template not found for '#{identifier}' (locale: #{locale.inspect}) under #{prompts_path}" unless path
|
29
47
|
|
data/promptly.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.description = "Build maintainable, localized, and testable AI prompts using ERB or Liquid templates with Rails conventions"
|
13
13
|
spec.homepage = "https://github.com/wilburhimself/promptly"
|
14
14
|
spec.license = "MIT"
|
15
|
-
spec.required_ruby_version = ">= 3.
|
15
|
+
spec.required_ruby_version = ">= 3.3", "< 3.4"
|
16
16
|
|
17
17
|
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
18
18
|
|
@@ -34,11 +34,13 @@ Gem::Specification.new do |spec|
|
|
34
34
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
35
35
|
spec.require_paths = ["lib"]
|
36
36
|
|
37
|
-
# Runtime dependencies
|
38
|
-
spec.add_dependency "actionview", "~> 7.
|
37
|
+
# Runtime dependencies (single target: Rails 7.2.x)
|
38
|
+
spec.add_dependency "actionview", "~> 7.2"
|
39
39
|
|
40
40
|
# Development dependencies
|
41
41
|
spec.add_development_dependency "rspec", "~> 3.12"
|
42
42
|
spec.add_development_dependency "standard", "~> 1.37"
|
43
43
|
spec.add_development_dependency "liquid", "~> 5.5"
|
44
|
+
# Development dependencies
|
45
|
+
spec.add_development_dependency "railties", "~> 7.2"
|
44
46
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: promptly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wilbur Suero
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '7.
|
19
|
+
version: '7.2'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '7.
|
26
|
+
version: '7.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '5.5'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: railties
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '7.2'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '7.2'
|
69
83
|
description: Build maintainable, localized, and testable AI prompts using ERB or Liquid
|
70
84
|
templates with Rails conventions
|
71
85
|
email:
|
@@ -75,11 +89,14 @@ extensions: []
|
|
75
89
|
extra_rdoc_files: []
|
76
90
|
files:
|
77
91
|
- ".rspec"
|
92
|
+
- ".ruby-version"
|
78
93
|
- ".standard.yml"
|
79
94
|
- LICENSE
|
80
95
|
- README.md
|
81
96
|
- Rakefile
|
97
|
+
- lib/generators/promptly/prompt_generator.rb
|
82
98
|
- lib/promptly.rb
|
99
|
+
- lib/promptly/cache.rb
|
83
100
|
- lib/promptly/locator.rb
|
84
101
|
- lib/promptly/railtie.rb
|
85
102
|
- lib/promptly/renderer.rb
|
@@ -103,7 +120,10 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
103
120
|
requirements:
|
104
121
|
- - ">="
|
105
122
|
- !ruby/object:Gem::Version
|
106
|
-
version: 3.
|
123
|
+
version: '3.3'
|
124
|
+
- - "<"
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: '3.4'
|
107
127
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
128
|
requirements:
|
109
129
|
- - ">="
|