repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/app/presenters/refinery/pages/page_part_section_presenter.rb | pages/app/presenters/refinery/pages/page_part_section_presenter.rb | module Refinery
module Pages
# A type of SectionPresenter which knows how to render a section which displays
# a PagePart model.
class PagePartSectionPresenter < SectionPresenter
def initialize(page_part)
super()
self.fallback_html = page_part.body.html_safe if page_part.body
... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/app/presenters/refinery/pages/title_section_presenter.rb | pages/app/presenters/refinery/pages/title_section_presenter.rb | module Refinery
module Pages
# A type of SectionPresenter which knows how to render a section which displays
# a title. These are much like normal sections except they are wrapped in
# a h1 tag rather than a div.
class TitleSectionPresenter < SectionPresenter
include ActionView::Helpers::Sanitiz... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/app/presenters/refinery/pages/content_page_presenter.rb | pages/app/presenters/refinery/pages/content_page_presenter.rb | module Refinery
module Pages
# A type of ContentPresenter which specifically knows how to render the html
# for a Refinery::Page object. Pass the page object into the constructor,
# and it will build sections from the page's parts. The page is not retained
# internally, so if the page changes, you nee... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/app/helpers/refinery/pages/content_pages_helper.rb | pages/app/helpers/refinery/pages/content_pages_helper.rb | module Refinery
module Pages
module ContentPagesHelper
# Build the html for a Refinery CMS page object by creating a ContentPagePresenter. This is a
# specialised type of ContentPresenter, so the object is then passed to render_content_presenter
# to get its html. The options are passed to that ... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/app/helpers/refinery/admin/pages_helper.rb | pages/app/helpers/refinery/admin/pages_helper.rb | module Refinery
module Admin
module PagesHelper
def parent_id_nested_set_options(current_page)
pages = []
nested_set_options(::Refinery::Page, current_page) { |page| pages << page}
# page.title needs the :translations association, doing something like
# nested_set_options(::R... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/app/controllers/refinery/pages_controller.rb | pages/app/controllers/refinery/pages_controller.rb | module Refinery
class PagesController < ::ApplicationController
include Pages::RenderOptions
before_action :find_page, :set_canonical
before_action :error_404, unless: :current_user_can_view_page?
# Save whole Page after delivery
after_action :write_cache?
# This action is usually accessed ... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/app/controllers/refinery/pages/admin/preview_controller.rb | pages/app/controllers/refinery/pages/admin/preview_controller.rb | module Refinery
module Pages
module Admin
class PreviewController < Refinery::PagesController
include ::Refinery::ApplicationController
helper ApplicationHelper
helper Refinery::Core::Engine.helpers
include Refinery::Admin::BaseController
include Pages::RenderOptions
... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/app/controllers/refinery/admin/pages_dialogs_controller.rb | pages/app/controllers/refinery/admin/pages_dialogs_controller.rb | module Refinery
module Admin
class PagesDialogsController < ::Refinery::Admin::DialogsController
helper :'refinery/admin/pages'
def link_to
# Get the switch_local variable to determine the locale we're currently editing
# Set up Mobility with our current locale
Mobility.local... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/app/controllers/refinery/admin/page_parts_controller.rb | pages/app/controllers/refinery/admin/page_parts_controller.rb | module Refinery
module Admin
class PagePartsController < ::Refinery::AdminController
def new
render :partial => '/refinery/admin/pages/page_part_field', :locals => {
:part => ::Refinery::PagePart.new(new_page_part_params),
:new_part => true,
:part_... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/app/controllers/refinery/admin/pages_controller.rb | pages/app/controllers/refinery/admin/pages_controller.rb | module Refinery
module Admin
class PagesController < Refinery::AdminController
prepend Pages::InstanceMethods
crudify :'refinery/page',
:include => [:translations, :children],
:paging => false
helper_method :valid_layout_templates, :valid_view_templates
def n... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/app/models/refinery/page.rb | pages/app/models/refinery/page.rb | # Encoding: utf-8
require 'friendly_id'
require 'friendly_id/mobility'
require 'refinery/core/base_model'
require 'refinery/pages/url'
require 'refinery/pages/finder'
module Refinery
class Page < Core::BaseModel
extend Mobility
translates :title, :menu_title, :custom_slug, :slug, :browser_title, :meta_descri... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/app/models/refinery/page_part.rb | pages/app/models/refinery/page_part.rb | module Refinery
class PagePart < Refinery::Core::BaseModel
belongs_to :page, :foreign_key => :refinery_page_id, :touch => true
before_validation :set_default_slug
validates :title, :presence => true
validates :slug, :presence => true, :uniqueness => {:scope => :refinery_page_id, :case_sensitive => ... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/db/seeds.rb | pages/db/seeds.rb | if Refinery::Page.where(menu_match: "^/$").empty?
home_page = Refinery::Page.create!(
title: "Home",
deletable: false,
link_url: "/",
menu_match: "^/$"
)
home_page.parts.create(
title: "Body",
body: "<p>Welcome to our site. This is just a place holder page while we gather our content.</p>"... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/db/migrate/20180316032602_add_children_count_to_refinery_pages.rb | pages/db/migrate/20180316032602_add_children_count_to_refinery_pages.rb | class AddChildrenCountToRefineryPages < ActiveRecord::Migration[5.1]
def change
add_column :refinery_pages, :children_count, :integer, null: false, default: 0
end
end
| ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/db/migrate/20150720155305_update_slug_and_title_in_refinery_page_parts.rb | pages/db/migrate/20150720155305_update_slug_and_title_in_refinery_page_parts.rb | class UpdateSlugAndTitleInRefineryPageParts < ActiveRecord::Migration[4.2]
def change
begin
::Refinery::PagePart.all.each do |pp|
pp.title ||= pp.slug
pp.slug = pp.slug.downcase.gsub(" ", "_")
pp.save!
end
rescue NameError
warn "Refinery::PagePart was not defined!"
... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/db/migrate/20170703015418_remove_translated_columns_to_refinery_pages.rb | pages/db/migrate/20170703015418_remove_translated_columns_to_refinery_pages.rb | class RemoveTranslatedColumnsToRefineryPages < ActiveRecord::Migration[5.0]
def change
remove_column :refinery_pages, :custom_slug
remove_column :refinery_pages, :slug
end
end
| ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/db/migrate/20140105190324_add_custom_slug_to_refinery_pages.rb | pages/db/migrate/20140105190324_add_custom_slug_to_refinery_pages.rb | class AddCustomSlugToRefineryPages < ActiveRecord::Migration[4.2]
def up
add_column :refinery_pages, :custom_slug, :string unless custom_slug_exists?
end
def down
remove_column :refinery_pages, :custom_slug if custom_slug_exists?
end
private
def custom_slug_exists?
column_exists?(:refinery_pa... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/db/migrate/20150130044643_add_slug_to_refinery_page_parts.rb | pages/db/migrate/20150130044643_add_slug_to_refinery_page_parts.rb | class AddSlugToRefineryPageParts < ActiveRecord::Migration[4.2]
def change
rename_column :refinery_page_parts, :title, :slug
add_column :refinery_page_parts, :title, :string
end
end
| ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/db/migrate/20151103211604_fix_slug_format_in_refinery_page_parts.rb | pages/db/migrate/20151103211604_fix_slug_format_in_refinery_page_parts.rb | class FixSlugFormatInRefineryPageParts < ActiveRecord::Migration[4.2]
def change
begin
::Refinery::PagePart.all.each do |pp|
pp.slug = pp.slug.downcase.gsub(" ", "_")
pp.save!
end
rescue NameError
warn "Refinery::PagePart was not defined!"
end
end
end
| ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/db/migrate/20100913234708_create_refinerycms_pages_schema.rb | pages/db/migrate/20100913234708_create_refinerycms_pages_schema.rb | class CreateRefinerycmsPagesSchema < ActiveRecord::Migration[4.2]
def change
create_table :refinery_page_parts do |t|
t.integer :refinery_page_id
t.string :title
t.text :body
t.integer :position
t.timestamps
end
add_index :refinery_page_parts, :id
add_index :ref... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/db/migrate/20170703020017_remove_translated_columns_to_refinery_page_parts.rb | pages/db/migrate/20170703020017_remove_translated_columns_to_refinery_page_parts.rb | class RemoveTranslatedColumnsToRefineryPageParts < ActiveRecord::Migration[5.0]
def change
remove_column :refinery_page_parts, :body
end
end
| ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/spec/system/refinery/pages_spec.rb | pages/spec/system/refinery/pages_spec.rb | # encoding: utf-8
require 'spec_helper'
module Refinery
describe 'page frontend', :type => :system do
let(:home_page) { Page.create :title => 'Home', :link_url => '/' }
let(:about_page) { Page.create :title => 'About' }
let(:draft_page) { Page.create :title => 'Draft', :draft => true }
before do
... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/spec/system/refinery/admin/pages_spec.rb | pages/spec/system/refinery/admin/pages_spec.rb | # encoding: utf-8
require "spec_helper"
def expect_window_with_content(content, window: windows.last)
page.within_window window do
expect(page).to have_content(content)
end
end
def expect_window_without_content(content, window: windows.last)
page.within_window window do
expect(page).not_to have_content(... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/spec/support/refinery/pages/caching_helpers.rb | pages/spec/support/refinery/pages/caching_helpers.rb | module CachingHelpers
def cached_directory
"spec/dummy/public/refinery/cache/pages"
end
def cached_file_path(page)
"#{cached_directory}#{refinery.page_path(page)}.html"
end
def cache_page(page)
allow_any_instance_of(Refinery::PagesController).to receive(:refinery_user?).and_return(false)
vis... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/spec/presenters/refinery/pages/section_presenter_spec.rb | pages/spec/presenters/refinery/pages/section_presenter_spec.rb | require "spec_helper"
module Refinery
module Pages
describe SectionPresenter do
it "can build a css class for when it is not present based on id" do
section = SectionPresenter.new(:fallback_html => 'foobar', :id => 'mynode')
expect(section.not_present_css_class).to eq('no_mynode')
end... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/spec/presenters/refinery/pages/content_presenter_spec.rb | pages/spec/presenters/refinery/pages/content_presenter_spec.rb | require "spec_helper"
module Refinery
module Pages
describe ContentPresenter do
let(:section1) { double(SectionPresenter, :id => 'foo', :has_content? => true) }
let(:section2) { double(SectionPresenter, :id => 'bar', :has_content? => true) }
describe "when building css classes for blank sectio... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/spec/presenters/refinery/pages/page_part_section_presenter_spec.rb | pages/spec/presenters/refinery/pages/page_part_section_presenter_spec.rb | require "spec_helper"
module Refinery
module Pages
describe PagePartSectionPresenter do
it "can be built from a page part" do
part = double(PagePart, :body => 'part_body', :slug => 'a_wonderful_page_part', :title => 'A Wonderful Page Part')
section = PagePartSectionPresenter.new(part)
... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/spec/presenters/refinery/pages/menu_presenter_spec.rb | pages/spec/presenters/refinery/pages/menu_presenter_spec.rb | require "spec_helper"
module Refinery
module Pages
describe MenuPresenter do
let!(:original_mounted_path) { Core.mounted_path }
let(:mounted_path) { "/" }
before do
allow(Core).to receive(:mounted_path).and_return(mounted_path)
Rails.application.reload_routes!
end
... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/spec/presenters/refinery/pages/content_page_presenter_spec.rb | pages/spec/presenters/refinery/pages/content_page_presenter_spec.rb | require "spec_helper"
module Refinery
module Pages
describe ContentPagePresenter do
let(:part) { double(PagePart, :body => 'part_body', :slug => 'a_wonderful_page_part', :title => 'A Wonderful Page Part') }
let(:part2) { double(PagePart, :body => 'part_body2', :slug => 'a_wonderful_page_part', :titl... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/spec/presenters/refinery/pages/title_section_presenter_spec.rb | pages/spec/presenters/refinery/pages/title_section_presenter_spec.rb | require "spec_helper"
module Refinery
module Pages
describe TitleSectionPresenter do
describe "when building html for a section" do
it "wraps a title section in a title element" do
section = TitleSectionPresenter.new(:fallback_html => 'foobar')
expect(section.has_content?(true))... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/spec/helpers/refinery/pages/content_pages_helper_spec.rb | pages/spec/helpers/refinery/pages/content_pages_helper_spec.rb | require 'spec_helper'
module Refinery
module Pages
describe ContentPagesHelper, :type => :helper do
let(:content_presenter) { double(ContentPresenter, :hide_sections => nil, :fetch_template_overrides => nil, :to_html => nil) }
describe "when rendering content presenter" do
it "asks to conten... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/spec/helpers/refinery/pages/admin/pages_helper_spec.rb | pages/spec/helpers/refinery/pages/admin/pages_helper_spec.rb | require "spec_helper"
module Refinery
module Admin
describe PagesHelper, :type => :helper do
describe "#template_options" do
context "when page layout/view template is set" do
it "returns those templates as selected" do
page = FactoryBot.create(:page)
page.view_te... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/spec/factories/page_parts.rb | pages/spec/factories/page_parts.rb | FactoryBot.define do
factory :page_part, class: Refinery::PagePart do
title { 'Body' }
slug { 'side_body' }
end
end
| ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/spec/factories/pages.rb | pages/spec/factories/pages.rb | FactoryBot.define do
factory :page, class: Refinery::Page do
sequence(:title, "a") { |n| "Test title #{n}" }
factory :page_with_page_part do
after(:create) do |page|
page.parts << FactoryBot.build(:page_part)
end
end
end
end
| ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/spec/controllers/refinery/pages_controller_spec.rb | pages/spec/controllers/refinery/pages_controller_spec.rb | require "spec_helper"
module Refinery
describe PagesController, :type => :controller do
before do
FactoryBot.create(:page, link_url: "/")
FactoryBot.create(:page, title: "testing")
FactoryBot.create(:page, link_url: "/items")
end
describe "#home" do
context "when page path set ... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/spec/controllers/refinery/admin/pages_controller_spec.rb | pages/spec/controllers/refinery/admin/pages_controller_spec.rb | require "spec_helper"
module Refinery
module Admin
describe PagesController, type: :controller do
describe "with view template" do
before { Refinery::Pages::Types.register("show") { |type| type.parts = Refinery::Pages.default_parts } }
after { Refinery::Pages::Types.registered.delete(Refi... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/spec/models/refinery/page_spec.rb | pages/spec/models/refinery/page_spec.rb | # encoding: utf-8
require 'spec_helper'
module Refinery
describe Page, :type => :model do
let(:page_title) { 'RSpec is great for testing too' }
let(:page) { subject.class.new(:title => page_title, :deletable => true)}
def page_cannot_be_destroyed
expect(page).to receive(:puts_destroy_help)
e... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/spec/models/refinery/page_menu_spec.rb | pages/spec/models/refinery/page_menu_spec.rb | # encoding: utf-8
require 'spec_helper'
module Refinery
describe Page do
let(:page_title) { 'RSpec is great for testing too' }
let(:page) { subject.class.new(:title => page_title, :deletable => true)}
describe "#to_refinery_menu_item" do
let(:page) do
Page.new(
:id => 5,
... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/spec/models/refinery/page_url_spec.rb | pages/spec/models/refinery/page_url_spec.rb | # encoding: utf-8
require 'spec_helper'
module Refinery
describe Page do
let(:page_title) { 'RSpec is great for testing too' }
let(:child_title) { 'The child page' }
# For when we do not need the page persisted.
let(:page) { subject.class.new(:title => page_title, :deletable => true)}
# For whe... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/spec/models/refinery/page_finder_spec.rb | pages/spec/models/refinery/page_finder_spec.rb | # encoding: utf-8
require 'spec_helper'
module Refinery
describe Page do
let(:page_title) { 'RSpec is great for testing too' }
let(:child_title) { 'The child page' }
let(:created_page) { subject.class.create!(:title => page_title, :deletable => true) }
let(:created_child) { created_page.children.cre... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/spec/models/refinery/page_part_spec.rb | pages/spec/models/refinery/page_part_spec.rb | # encoding: utf-8
require 'spec_helper'
module Refinery
describe Page do
let(:page_title) { 'RSpec is great for testing too' }
let(:page) { subject.class.new(:title => page_title, :deletable => true)}
before do
page.parts.new(:title => 'body', :slug => 'body', :content => "I'm the first page part ... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/spec/models/refinery/page_meta_data_spec.rb | pages/spec/models/refinery/page_meta_data_spec.rb | # encoding: utf-8
require 'spec_helper'
module Refinery
describe Page do
let(:page_title) { 'RSpec is great for testing too' }
let(:page) { subject.class.create(title: page_title, deletable: true)}
context 'responds to' do
it 'meta_description' do
page.respond_to?(:meta_description)
... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/spec/lib/pages_spec.rb | pages/spec/lib/pages_spec.rb | require "spec_helper"
module Refinery
describe Pages do
describe ".valid_templates" do
before do
File.open(File.join(subject.root, "spec", "ugisozols.html"), "w+") do
end
end
after { File.delete(File.join(subject.root, "spec", "ugisozols.html")) }
context "when pattern m... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/spec/lib/generators/refinery/pages/pages_generator_spec.rb | pages/spec/lib/generators/refinery/pages/pages_generator_spec.rb | require 'spec_helper'
require 'generator_spec/test_case'
require 'generators/refinery/pages/pages_generator'
module Refinery
describe PagesGenerator do
include GeneratorSpec::TestCase
destination File.expand_path("../../../../tmp", __FILE__)
before do
prepare_destination
run_generator %w[--s... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/spec/lib/refinery/pages/type_spec.rb | pages/spec/lib/refinery/pages/type_spec.rb | require "spec_helper"
module Refinery
module Pages
describe Type do
subject { Type.new }
describe ".parts=" do
it "returns an array of hashes unaltered" do
parts = [{title: "Body", slug: "body"}]
subject.parts = parts
expect(subject.parts).to eq parts
en... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/spec/lib/refinery/pages/tab_spec.rb | pages/spec/lib/refinery/pages/tab_spec.rb | require "spec_helper"
module Refinery
module Pages
describe ".tabs" do
after do
Refinery::Pages.instance_eval { @tabs = [] }
end
it "returns an array of registered tabs" do
rspec_tab = Refinery::Pages::Tab.register do |tab|
tab.name = "rspec"
tab.partial = ... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/spec/lib/refinery/pages/url_spec.rb | pages/spec/lib/refinery/pages/url_spec.rb | require "spec_helper"
module Refinery
module Pages
describe Url::Localised do
describe ".handle?" do
it "returns true if link_url is present" do
page = double(:page, :link_url => "/")
expect(Url::Localised.handle?(page)).to be_truthy
end
end
describe "#url" ... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/lib/refinerycms-pages.rb | pages/lib/refinerycms-pages.rb | require 'refinery/pages'
| ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/lib/generators/refinery/pages/pages_generator.rb | pages/lib/generators/refinery/pages/pages_generator.rb | module Refinery
class PagesGenerator < Rails::Generators::Base
class_option :skip_migrations, :type => :boolean, :default => false, :aliases => nil, :group => :runtime,
:desc => "Skip over installing or running migrations."
source_root File.expand_path('../templates', __FILE__)
... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/lib/refinery/pages.rb | pages/lib/refinery/pages.rb | require 'refinerycms/core'
require 'mobility'
module Refinery
autoload :PagesGenerator, 'generators/refinery/pages/pages_generator'
module Pages
require 'refinery/pages/engine'
require 'refinery/pages/tab'
require 'refinery/pages/type'
require 'refinery/pages/types'
# Load configuration last ... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/lib/refinery/pages/render_options.rb | pages/lib/refinery/pages/render_options.rb | module Refinery
module Pages
module RenderOptions
def render_options_for_template(page)
render_options = {}
if Refinery::Pages.use_layout_templates && page.layout_template.present?
render_options[:layout] = page.layout_template
end
template = page.link_url == "/" ... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/lib/refinery/pages/type.rb | pages/lib/refinery/pages/type.rb | module Refinery
module Pages
class Type
attr_accessor :name, :parts, :template
def parts=(new_parts)
@parts = if new_parts.all? { |v| v.is_a?(String) }
new_syntax = new_parts.map do |part|
{ title: part, slug: part.downcase.gsub(" ", "_") }
end
Refin... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/lib/refinery/pages/finder.rb | pages/lib/refinery/pages/finder.rb | module Refinery
module Pages
class Finder
def self.by_path(path)
FinderByPath.new(path).find
end
def self.by_path_or_id(path, id)
FinderByPathOrId.new(path, id).find
end
def self.by_title(title)
FinderByTitle.new(title).find
end
def self.by_slug... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/lib/refinery/pages/tab.rb | pages/lib/refinery/pages/tab.rb | module Refinery
module Pages
def self.tabs
@tabs ||= []
end
def self.tabs_for_template(template)
return tabs unless template
tabs.select do |tab|
tab.templates.include?('all') || tab.templates.include?(template)
end
end
class Tab
attr_accessor :name, :part... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/lib/refinery/pages/instance_methods.rb | pages/lib/refinery/pages/instance_methods.rb | # frozen_string_literal: true
module Refinery
module Pages
module InstanceMethods
def error_404(exception = nil)
if (@page = ::Refinery::Page.where(menu_match: "^/404$").includes(:parts).first).present?
# render the application's custom 404 page with layout and meta.
if self.re... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/lib/refinery/pages/url.rb | pages/lib/refinery/pages/url.rb | module Refinery
module Pages
class Url
class Localised < Url
def self.handle?(page)
page.link_url.present?
end
def url
current_url = page.link_url
# Don't mess around with absolute URLs, just accept them. Examples:
#
# * https://gi... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/lib/refinery/pages/configuration.rb | pages/lib/refinery/pages/configuration.rb | module Refinery
module Pages
include ActiveSupport::Configurable
config_accessor :pages_per_dialog, :pages_per_admin_index, :new_page_parts,
:marketable_urls, :approximate_ascii, :strip_non_ascii,
:default_parts, :use_custom_slugs, :scope_slug_by_parent,
... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/lib/refinery/pages/types.rb | pages/lib/refinery/pages/types.rb | module Refinery
module Pages
class Types < Array
def register(name, &block)
self.class.register(name, &block)
end
def find_by_name(name)
detect { |type| type.name.to_s.downcase == name.to_s.downcase}
end
class << self
def register(name, &block)
ty... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/lib/refinery/pages/engine.rb | pages/lib/refinery/pages/engine.rb | module Refinery
module Pages
class Engine < ::Rails::Engine
extend Refinery::Engine
isolate_namespace Refinery
engine_name :refinery_pages
config.autoload_paths += %W( #{config.root}/lib )
before_inclusion do
Refinery::Plugin.register do |plugin|
plugin.pathname ... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/lib/refinery/pages/admin/instance_methods.rb | pages/lib/refinery/pages/admin/instance_methods.rb | module Refinery
module Pages
module Admin
module InstanceMethods
def error_404(exception = nil)
if (@page = ::Refinery::Page.where(:menu_match => "^/404$").includes(:parts).first).present?
params[:action] = 'error_404'
# change any links in the copy to the Refinery... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/lib/refinerycms/pages.rb | pages/lib/refinerycms/pages.rb | require_relative '../refinery/pages'
| ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/config/routes.rb | pages/config/routes.rb | Refinery::Core::Engine.routes.draw do
root to: 'pages#home', via: :get
get '/pages/:id', to: 'pages#show', as: :page
namespace :pages, path: '' do
namespace :admin, path: Refinery::Core.backend_route do
scope path: :pages do
post 'preview', to: 'preview#show', as: :preview_pages
patch '... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/dragonfly/spec/support/custom_datastore_two.rb | dragonfly/spec/support/custom_datastore_two.rb | CustomDatastoreTwo = Class.new
| ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/dragonfly/spec/support/custom_datastore_one.rb | dragonfly/spec/support/custom_datastore_one.rb | CustomDatastoreOne = Class.new
| ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/dragonfly/spec/support/shared_examples/adds_dragonfly_app_to_middlewares.rb | dragonfly/spec/support/shared_examples/adds_dragonfly_app_to_middlewares.rb | shared_examples_for 'adds the dragonfly app to the middleware stack' do
let(:middleware_array){ Rails.application.config.middleware.to_a}
describe 'middleware stack:' do
it 'includes Dragonfly::Middleware' do
expect(middleware_array).to include(Dragonfly::Middleware)
end
end
end
| ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/dragonfly/spec/support/shared_examples/creates_a_dragonfly_app.rb | dragonfly/spec/support/shared_examples/creates_a_dragonfly_app.rb | require_relative '../custom_datastore_one'
require_relative '../custom_datastore_two'
shared_examples_for 'Creates a dragonfly App:' do
describe 'app creation' do
::Refinery::Dragonfly.configure!(described_class)
it 'exists' do
expect(::Dragonfly.app(described_class.dragonfly_name).name).to eq(describe... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/dragonfly/spec/lib/generators/refinery/dragonfly/dragonfly_generator_spec.rb | dragonfly/spec/lib/generators/refinery/dragonfly/dragonfly_generator_spec.rb | require 'spec_helper'
require 'generator_spec/test_case'
require 'generators/refinery/dragonfly/dragonfly_generator'
module Refinery
describe DragonflyGenerator do
include GeneratorSpec::TestCase
destination File.expand_path("../../../../tmp", __FILE__)
before do
prepare_destination
run_gene... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/dragonfly/spec/lib/refinery/dragonfly/dragonfly_spec.rb | dragonfly/spec/lib/refinery/dragonfly/dragonfly_spec.rb | require 'spec_helper'
module Refinery
describe Dragonfly do
describe 'default configuration' do
it 'defines a default secret' do
expect(Refinery::Dragonfly.secret).to_not be nil
end
it "doesn't use S3" do
expect(Refinery::Dragonfly.s3_datastore).to be false
end
it... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/dragonfly/lib/refinerycms-dragonfly.rb | dragonfly/lib/refinerycms-dragonfly.rb | require 'refinery/dragonfly'
| ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/dragonfly/lib/generators/refinery/dragonfly/dragonfly_generator.rb | dragonfly/lib/generators/refinery/dragonfly/dragonfly_generator.rb | module Refinery
class DragonflyGenerator < Rails::Generators::Base
# Dragonfly has no migrations. Make skip_migrations the default
class_option :skip_migrations, :type => :boolean, :default => true, :aliases => nil, :group => :runtime,
:desc => 'Skip over installing or running migrations.'
... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/dragonfly/lib/refinery/dragonfly.rb | dragonfly/lib/refinery/dragonfly.rb | require 'active_support/configurable'
require 'dragonfly'
module Refinery
autoload :DragonflyGenerator, 'generators/refinery/dragonfly/dragonfly_generator'
module Dragonfly
require 'refinery/dragonfly/configuration'
require 'refinery/dragonfly/dragonfly'
require 'refinery/dragonfly/engine'
class ... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/dragonfly/lib/refinery/dragonfly/configuration.rb | dragonfly/lib/refinery/dragonfly/configuration.rb | module Refinery
module Dragonfly
include ActiveSupport::Configurable
# All dragonfly options allowed
config_accessor :allow_legacy_urls, :analysers,
:before_serve,
:cache_log_level, :cache_store_root,
:custom_datastore_class, :custom_datastore_... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/dragonfly/lib/refinery/dragonfly/extension_configuration.rb | dragonfly/lib/refinery/dragonfly/extension_configuration.rb | module Refinery
module Dragonfly
module ExtensionConfiguration
include ActiveSupport::Configurable
config_accessor :dragonfly_allow_legacy_urls, :dragonfly_analysers,
:dragonfly_before_serve,
:dragonfly_cache_store_root, :dragonfly_cache_log_level,
... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/dragonfly/lib/refinery/dragonfly/engine.rb | dragonfly/lib/refinery/dragonfly/engine.rb | module Refinery
module Dragonfly
class Engine < ::Rails::Engine
include Refinery::Engine
isolate_namespace Refinery
engine_name :refinery_dragonfly
config.autoload_paths += %W( #{config.root}/lib )
before_inclusion do
Refinery::Plugin.register do |plugin|
plugin.... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/dragonfly/lib/refinery/dragonfly/dragonfly.rb | dragonfly/lib/refinery/dragonfly/dragonfly.rb | module Refinery
module Dragonfly
class << self
def configure!(extension)
::ActiveRecord::Base.extend ::Dragonfly::Model
::ActiveRecord::Base.extend ::Dragonfly::Model::Validations
::Dragonfly.app(extension.dragonfly_name).configure do
datastore :file, {root_path: extens... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/dragonfly/lib/refinerycms/dragonfly.rb | dragonfly/lib/refinerycms/dragonfly.rb | require_relative '../refinery/dragonfly'
| ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/spec/spec_helper_no_rails.rb | spec/spec_helper_no_rails.rb | ENV['RAILS_ENV'] ||= 'TEST'
require 'active_support'
EXTENSIONS = %w[core images pages resources]
Dir[File.expand_path("../{#{EXTENSIONS.join(',')}}/app/models", __FILE__)].each do |model_dir|
$:.push File.expand_path('../../app/models/', __FILE__)
end
| ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/spec/spec_helper.rb | spec/spec_helper.rb | $VERBOSE = ENV['VERBOSE'] || false
require 'rubygems'
ENGINE_RAILS_ROOT = File.join(File.dirname(__FILE__), '../') unless defined?(ENGINE_RAILS_ROOT)
# Configure Rails Environment
ENV["RAILS_ENV"] ||= 'test'
if ENV['TRAVIS']
require 'coveralls'
Coveralls.wear!
end
require File.expand_path("../dummy/config/envi... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/spec/support/refinery/html_helpers.rb | spec/support/refinery/html_helpers.rb | module HtmlHelpers
RSpec::Matchers.define :xml_eq do |expected|
match do |actual|
Hash.from_xml(expected) == Hash.from_xml(actual)
end
end
end
| ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/templates/refinery/demo.rb | templates/refinery/demo.rb | require 'rbconfig'
# We want to ensure that you have an ExecJS runtime available!
begin
require 'execjs'
::ExecJS::RuntimeUnavailable
rescue LoadError
abort <<-ERROR
\033[31m[ABORTING]\033[0m ExecJS is not installed. Please re-start the installer after running:\ngem install execjs
ERROR
end
append_file 'Gemfil... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/templates/refinery/installer.rb | templates/refinery/installer.rb | require 'rbconfig'
VERSION_BAND = '4.0'
MINOR_VERSION_BAND = '4.0.0'
# We want to ensure that you have an ExecJS runtime available!
begin
require 'execjs'
rescue LoadError
abort <<-ERROR
\033[31m[ABORTING]\033[0m ExecJS is not installed. Please re-start the installer after running:\ngem install execjs
ERROR
end
a... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/templates/refinery/edge.rb | templates/refinery/edge.rb | # We want to ensure that you have an ExecJS runtime available!
begin
require 'execjs'
begin
::ExecJS::Runtimes.autodetect
rescue
gsub_file 'Gemfile', "# gem 'therubyracer'", "gem 'therubyracer'"
end
rescue LoadError
abort <<-ERROR
\033[31m[ABORTING]\033[0m ExecJS is not installed. Please re-start the ... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/testing/lib/refinerycms-testing.rb | testing/lib/refinerycms-testing.rb | require 'refinery/testing'
| ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/testing/lib/generators/refinery/testing/testing_generator.rb | testing/lib/generators/refinery/testing/testing_generator.rb | module Refinery
class TestingGenerator < Rails::Generators::Base
source_root File.expand_path('../templates', __FILE__)
def rake_db
rake "refinery_testing:install:migrations"
end
def copy_spec_helper
directory "spec"
end
end
end
| ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/testing/lib/generators/refinery/testing/templates/spec/spec_helper.rb | testing/lib/generators/refinery/testing/templates/spec/spec_helper.rb | ENGINE_RAILS_ROOT = File.join(File.dirname(__FILE__), '../') unless defined?(ENGINE_RAILS_ROOT)
# Configure Rails Environment
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'capybara/rspec'
Rails.backtrace_cleaner.remove_silencers!
RSpec.con... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/testing/lib/refinery/testing.rb | testing/lib/refinery/testing.rb | require 'refinerycms/core'
require 'rspec-rails'
require 'factory_bot'
require 'rails-controller-testing'
module Refinery
autoload :TestingGenerator, 'generators/refinery/testing/testing_generator'
module Testing
class << self
def root
@root ||= Pathname.new(File.expand_path('../../../', __FILE_... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/testing/lib/refinery/testing/railtie.rb | testing/lib/refinery/testing/railtie.rb | module Refinery
module Testing
class Railtie < Rails::Railtie
railtie_name :refinerycms_testing
class << self
attr_reader :target_extension_path # :nodoc:
alias_method :target_engine_path, :target_extension_path
# Loads Rake tasks to assist with manipulating dummy application... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/testing/lib/refinery/testing/feature_macros.rb | testing/lib/refinery/testing/feature_macros.rb | module Refinery
module Testing
module FeatureMacros
autoload :Authentication, 'refinery/testing/feature_macros/authentication'
end
end
end
| ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/testing/lib/refinery/testing/controller_macros.rb | testing/lib/refinery/testing/controller_macros.rb | module Refinery
module Testing
module ControllerMacros
autoload :Authentication, 'refinery/testing/controller_macros/authentication'
autoload :Routes , 'refinery/testing/controller_macros/routes'
end
end
end
| ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/testing/lib/refinery/testing/controller_macros/authentication.rb | testing/lib/refinery/testing/controller_macros/authentication.rb | module Refinery
module Testing
module ControllerMacros
module Authentication
def refinery_login
let(:logged_in_user) { Refinery::Core::NilUser.new }
end
end
end
end
end
| ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/testing/lib/refinery/testing/controller_macros/routes.rb | testing/lib/refinery/testing/controller_macros/routes.rb | module Refinery
module Testing
module ControllerMacros
module Routes
extend ActiveSupport::Concern
included do
routes { ::Refinery::Core::Engine.routes }
end
end
end
end
end
| ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/testing/lib/refinery/testing/feature_macros/authentication.rb | testing/lib/refinery/testing/feature_macros/authentication.rb | module Refinery
module Testing
module FeatureMacros
module Authentication
def refinery_login
# NO-OP, Overwrite this in an extension.
end
end
end
end
end
| ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/testing/lib/refinerycms/testing.rb | testing/lib/refinerycms/testing.rb | require_relative '../refinery/testing'
| ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/lib/refinerycms.rb | lib/refinerycms.rb | require 'refinery/all'
| ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/lib/refinery/all.rb | lib/refinery/all.rb | %w(core images resources pages).each do |extension|
require "refinerycms-#{extension}"
end
| ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/core/app/presenters/refinery/base_presenter.rb | core/app/presenters/refinery/base_presenter.rb | module Refinery
class BasePresenter
DEFAULT_FIELDS = {
:title => proc { |p| (p.model.class.name.titleize if p.model.present?) },
:path => proc { |p| p.title },
:browser_title => nil,
:meta_description => nil
}
attr_reader :model
def initiali... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/core/app/presenters/refinery/translated_field_presenter.rb | core/app/presenters/refinery/translated_field_presenter.rb | module Refinery
class TranslatedFieldPresenter
def initialize(record)
@record = record
end
def call(field)
record.send(field).presence ||
record.translations.detect {|t| t.send(field).present?}.send(field)
end
private
attr_accessor :record
end
end | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/core/app/helpers/refinery/image_helper.rb | core/app/helpers/refinery/image_helper.rb | module Refinery
module ImageHelper
# replace all system images with a thumbnail version of them (handy for all images inside a page part)
# for example, <%= content_fu(@page.content_for(:body), '96x96#c') %> converts all /system/images to a 96x96 cropped thumbnail
def content_fu(content, thumbnail)
... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/core/app/helpers/refinery/meta_helper.rb | core/app/helpers/refinery/meta_helper.rb | module Refinery
module MetaHelper
# This is used to display the title of the current object (normally a page) in the browser's titlebar.
#
def browser_title(yield_title = nil)
[
yield_title,
@meta.browser_title.presence || @meta.path,
Refinery::Core.site_name
].reject(... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/core/app/helpers/refinery/pagination_helper.rb | core/app/helpers/refinery/pagination_helper.rb | module Refinery
module PaginationHelper
# Figures out the CSS classname to apply to your pagination list for animations.
def pagination_css_class
if request.xhr? and params[:from_page].present?
"frame_#{params[:from_page] > (params[:page] ? params[:page] : "1") ? 'left' : 'right'}"
else
... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.