Skip to content

Commit

Permalink
Now the rake task comes from the gem!
Browse files Browse the repository at this point in the history
  • Loading branch information
netikular committed Mar 13, 2024
1 parent e90d4e0 commit e007fb5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/dato_cms_graphql/rails/cache_task.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
desc "A rake task to persist the DatoCMS data locally"
task cache_dato: :environment do
DatoCmsGraphql::Rails::Persistence.cache_data
end
3 changes: 3 additions & 0 deletions lib/dato_cms_graphql/rails/railtie.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
module DatoCmsGraphql
module Rails
class Railtie < ::Rails::Railtie
rake_tasks do
load File.join(__dir__, "cache_task.rake")
end
initializer "dato_cms_graphql_railtie.configure_rails_initialization" do |app|
DatoCmsGraphql.path_to_queries = app.root.join("app", "queries")
puts DatoCmsGraphql.path_to_queries
Expand Down
2 changes: 1 addition & 1 deletion lib/dato_cms_graphql/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module DatoCmsGraphql
VERSION = "0.2.3"
VERSION = "0.2.4"
end

0 comments on commit e007fb5

Please sign in to comment.