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 |
|---|---|---|---|---|---|---|---|---|
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails3_2/config/initializers/wrap_parameters.rb | fixtures/rails3_2/config/initializers/wrap_parameters.rb | # Be sure to restart your server when you modify this file.
#
# This file contains settings for ActionController::ParamsWrapper which
# is enabled by default.
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do
wrap_parameters ... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails3_2/config/initializers/inflections.rb | fixtures/rails3_2/config/initializers/inflections.rb | # Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format
# (all these examples are active by default):
# ActiveSupport::Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', ... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails3_2/config/initializers/backtrace_silencers.rb | fixtures/rails3_2/config/initializers/backtrace_silencers.rb | # Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
# You can also remove all the silencers if you're trying to debug a probl... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails3_2/config/initializers/mime_types.rb | fixtures/rails3_2/config/initializers/mime_types.rb | # Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
# Mime::Type.register_alias "text/html", :iphone
Mime::Type.register 'application/vnd.rabl-test_v1+json', :rabl_test_v1
| ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails3_2/config/initializers/secret_token.rb | fixtures/rails3_2/config/initializers/secret_token.rb | # Be sure to restart your server when you modify this file.
# Your secret key for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attac... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails3_2/config/environments/test.rb | fixtures/rails3_2/config/environments/test.rb | Rails32::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test su... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails3_2/config/environments/development.rb | fixtures/rails3_2/config/environments/development.rb | Rails32::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web se... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails3_2/config/environments/production.rb | fixtures/rails3_2/config/environments/production.rb | Rails32::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.action... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails4/app/helpers/application_helper.rb | fixtures/rails4/app/helpers/application_helper.rb | module ApplicationHelper
def helper_foo
"BAR!"
end
end
| ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails4/app/controllers/posts_controller.rb | fixtures/rails4/app/controllers/posts_controller.rb | class PostsController < ApplicationController
respond_to :json, :xml, :html, :rabl_test_v1
def index
@posts = Post.order('id ASC').load
end
def show
@post = Post.find(params[:id])
end
def renderer
post = Post.find(params[:id])
render json: Rabl.render(post, 'posts/renderer', view_path: 'a... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails4/app/controllers/users_controller.rb | fixtures/rails4/app/controllers/users_controller.rb | class UsersController < ApplicationController
respond_to :json
def index
@users = User.order('username ASC').load
end
def show
@user = User.find(params[:id])
end
end
| ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails4/app/controllers/application_controller.rb | fixtures/rails4/app/controllers/application_controller.rb | class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
end
| ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails4/db/seeds.rb | fixtures/rails4/db/seeds.rb | # This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails4/db/schema.rb | fixtures/rails4/db/schema.rb | # encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative sou... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails4/test/test_helper.rb | fixtures/rails4/test/test_helper.rb | # Load Silence Functionality
require File.expand_path(File.dirname(__FILE__) + "/../../../test/silence.rb")
# Load Environment
silence_warnings do
ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
end
# Load Riot Test Environment
require File.expa... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails4/test/functional/posts_controller_test.rb | fixtures/rails4/test/functional/posts_controller_test.rb | # frozen_string_literal: true
# Lives in <rabl>/test/integration/posts_controller_test.rb
# Symlinked to fixture applications
begin # Padrino
require File.expand_path(File.dirname(__FILE__) + '/../../test_config.rb')
rescue LoadError # Rails
require File.expand_path(File.dirname(__FILE__) + '/../test_helper.rb')
... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails4/test/functional/users_controller_test.rb | fixtures/rails4/test/functional/users_controller_test.rb | # frozen_string_literal: true
# Lives in <rabl>/test/integration/users_controller_test.rb
# Symlinked to fixture applications
begin # Sinatra
require File.expand_path(File.dirname(__FILE__) + '/../../test_config.rb')
rescue LoadError # Rails
require File.expand_path(File.dirname(__FILE__) + '/../test_helper.rb')
... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails4/config/application.rb | fixtures/rails4/config/application.rb | require File.expand_path('../boot', __FILE__)
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env)
module Rails4
class Application < Rails::Application
# Settings in config/environments/* take ... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails4/config/environment.rb | fixtures/rails4/config/environment.rb | # Load the rails application.
require File.expand_path('../application', __FILE__)
# Initialize the rails application.
Rails4::Application.initialize!
| ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails4/config/routes.rb | fixtures/rails4/config/routes.rb | Rails4::Application.routes.draw do
resources :users
resources :posts do
member do
get 'renderer'
end
end
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".
# You can have the root of your site routed with "r... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails4/config/boot.rb | fixtures/rails4/config/boot.rb | # Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
| ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails4/config/initializers/filter_parameter_logging.rb | fixtures/rails4/config/initializers/filter_parameter_logging.rb | # Be sure to restart your server when you modify this file.
# Configure sensitive parameters which will be filtered from the log file.
Rails.application.config.filter_parameters += [:password]
| ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails4/config/initializers/session_store.rb | fixtures/rails4/config/initializers/session_store.rb | # Be sure to restart your server when you modify this file.
Rails4::Application.config.session_store :cookie_store, key: '_rails4_session'
| ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails4/config/initializers/wrap_parameters.rb | fixtures/rails4/config/initializers/wrap_parameters.rb | # Be sure to restart your server when you modify this file.
# This file contains settings for ActionController::ParamsWrapper which
# is enabled by default.
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do
wrap_parameters f... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails4/config/initializers/inflections.rb | fixtures/rails4/config/initializers/inflections.rb | # Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format. Inflections
# are locale specific, and you may define rules for as many different
# locales as you wish. All of these examples are active by default:
# ActiveSupport::Inflector.inflections(:en) do |inflec... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails4/config/initializers/backtrace_silencers.rb | fixtures/rails4/config/initializers/backtrace_silencers.rb | # Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
# You can also remove all the silencers if you're trying to debug a probl... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails4/config/initializers/mime_types.rb | fixtures/rails4/config/initializers/mime_types.rb | # Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
# Mime::Type.register_alias "text/html", :iphone
Mime::Type.register 'application/vnd.rabl-test_v1+json', :rabl_test_v1
| ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails4/config/initializers/secret_token.rb | fixtures/rails4/config/initializers/secret_token.rb | # Be sure to restart your server when you modify this file.
# Your secret key is used for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to diction... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails4/config/environments/test.rb | fixtures/rails4/config/environments/test.rb | Rails4::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test su... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails4/config/environments/development.rb | fixtures/rails4/config/environments/development.rb | Rails4::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web se... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails4/config/environments/production.rb | fixtures/rails4/config/environments/production.rb | Rails4::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both thread web serve... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails3/app/controllers/posts_controller.rb | fixtures/rails3/app/controllers/posts_controller.rb | class PostsController < ApplicationController
respond_to :json, :xml, :html
def index
@posts = Post.all(:order => "id ASC")
end
def show
@post = Post.find(params[:id])
end
end
| ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails3/app/controllers/users_controller.rb | fixtures/rails3/app/controllers/users_controller.rb | class UsersController < ApplicationController
respond_to :json
def index
@users = User.all(:order => "username ASC")
end
def show
@user = User.find(params[:id])
end
end
| ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails3/app/controllers/application_controller.rb | fixtures/rails3/app/controllers/application_controller.rb | class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :default_format_json
protected
def default_format_json
if(request.headers["HTTP_ACCEPT"].nil? &&
params[:format].nil?)
request.format = "json"
end
end
end
| ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails3/db/seeds.rb | fixtures/rails3/db/seeds.rb | # This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
# Mayor.create(:name =>... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails3/db/schema.rb | fixtures/rails3/db/schema.rb | # encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative sou... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails3/test/test_helper.rb | fixtures/rails3/test/test_helper.rb | # Load Silence Functionality
require File.expand_path(File.dirname(__FILE__) + "/../../../test/silence.rb")
# Load Environment
silence_warnings do
ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
end
# Load Riot Test Environment
require File.expa... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails3/test/functional/posts_controller_test.rb | fixtures/rails3/test/functional/posts_controller_test.rb | # frozen_string_literal: true
# Lives in <rabl>/test/integration/posts_controller_test.rb
# Symlinked to fixture applications
begin # Padrino
require File.expand_path(File.dirname(__FILE__) + '/../../test_config.rb')
rescue LoadError # Rails
require File.expand_path(File.dirname(__FILE__) + '/../test_helper.rb')
... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails3/test/functional/users_controller_test.rb | fixtures/rails3/test/functional/users_controller_test.rb | # frozen_string_literal: true
# Lives in <rabl>/test/integration/users_controller_test.rb
# Symlinked to fixture applications
begin # Sinatra
require File.expand_path(File.dirname(__FILE__) + '/../../test_config.rb')
rescue LoadError # Rails
require File.expand_path(File.dirname(__FILE__) + '/../test_helper.rb')
... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails3/config/application.rb | fixtures/rails3/config/application.rb | require File.expand_path('../boot', __FILE__)
require 'rails/all'
# If you have a Gemfile, require the gems listed there, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env) if defined?(Bundler)
module Rails3
class Application < Rails::Application
# ... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails3/config/environment.rb | fixtures/rails3/config/environment.rb | # Load the rails application
require File.expand_path('../application', __FILE__)
# Initialize the rails application
Rails3::Application.initialize!
| ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails3/config/routes.rb | fixtures/rails3/config/routes.rb | Rails3::Application.routes.draw do
resources :users
resources :posts
# The priority is based upon order of creation:
# first created -> highest priority.
# Sample of regular route:
# match 'products/:id' => 'catalog#view'
# Keep in mind you can assign values other than :controller and :action
# Sam... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails3/config/boot.rb | fixtures/rails3/config/boot.rb | require 'rubygems'
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
| ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails3/config/initializers/session_store.rb | fixtures/rails3/config/initializers/session_store.rb | # Be sure to restart your server when you modify this file.
Rails3::Application.config.session_store :cookie_store, :key => '_rails3_session'
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rails ... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails3/config/initializers/inflections.rb | fixtures/rails3/config/initializers/inflections.rb | # Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format
# (all these examples are active by default):
# ActiveSupport::Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', ... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails3/config/initializers/backtrace_silencers.rb | fixtures/rails3/config/initializers/backtrace_silencers.rb | # Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
# You can also remove all the silencers if you're trying to debug a probl... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails3/config/initializers/mime_types.rb | fixtures/rails3/config/initializers/mime_types.rb | # Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
# Mime::Type.register_alias "text/html", :iphone
| ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails3/config/initializers/secret_token.rb | fixtures/rails3/config/initializers/secret_token.rb | # Be sure to restart your server when you modify this file.
# Your secret key for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attac... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails3/config/environments/test.rb | fixtures/rails3/config/environments/test.rb | Rails3::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test s... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails3/config/environments/development.rb | fixtures/rails3/config/environments/development.rb | Rails3::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the webser... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/fixtures/rails3/config/environments/production.rb | fixtures/rails3/config/environments/production.rb | Rails3::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# The production environment is meant for finished, "live" apps.
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/test/renderer_test.rb | test/renderer_test.rb | # frozen_string_literal: true
require 'tmpdir'
require 'pathname'
require 'json'
require File.expand_path('../teststrap', __FILE__)
context "Rabl::Renderer" do
helper(:tmp_path) { @tmp_path ||= Pathname.new(Dir.mktmpdir) }
# context_scope 'users', [@user]
helper(:context_scope) { |name, value|
scope = Objec... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/test/template_test.rb | test/template_test.rb | # frozen_string_literal: true
require File.expand_path('../teststrap',__FILE__)
require 'rabl/template'
class Scope
end
context "RablTemplate" do
asserts "that it registers for .rabl files" do
Tilt['test.rabl']
end.equals RablTemplate
context "#render" do
setup do
RablTemplate.new { |t| "code(:l... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/test/partials_test.rb | test/partials_test.rb | # frozen_string_literal: true
require 'tmpdir'
require 'pathname'
require File.expand_path('../teststrap', __FILE__)
class TestPartial
include Rabl::Partials
end
context "Rabl::Partials" do
context "fetch_source with json" do
helper(:tmp_path) { @tmp_path ||= Pathname.new(Dir.mktmpdir) }
setup do
... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/test/teststrap.rb | test/teststrap.rb | # frozen_string_literal: true
$LOAD_PATH.unshift(File.expand_path("../../lib", __FILE__))
module Kernel
def silence_warnings
with_warnings(nil) { yield }
end
def with_warnings(flag)
old_verbose, $VERBOSE = $VERBOSE, flag
yield
ensure
$VERBOSE = old_verbose
end
end unless Kernel.respond_to? ... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/test/plist_engine_test.rb | test/plist_engine_test.rb | # frozen_string_literal: true
require File.expand_path('../teststrap', __FILE__)
require 'rabl/template'
context "Rabl::Engine" do
helper(:rabl) { |t| RablTemplate.new("code", :format => 'plist') { t } }
context "with plist defaults" do
setup do
Rabl.configure do |config|
# Comment this line ou... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/test/bson_engine_test.rb | test/bson_engine_test.rb | # frozen_string_literal: true
require File.expand_path('../teststrap', __FILE__)
require 'rabl/template'
context "Rabl::Engine" do
helper(:rabl) { |t| RablTemplate.new("code", :format => 'bson') { t } }
context "with bson defaults" do
setup do
Rabl.configure do |config|
# Comment this line out ... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/test/multi_builder_test.rb | test/multi_builder_test.rb | # frozen_string_literal: true
require 'json'
require File.expand_path('../teststrap', __FILE__)
require 'rabl/template'
require File.expand_path('../models/ormless', __FILE__)
context "Rabl::MultiBuilder" do
helper(:multi_builder) { |objects, options| Rabl::MultiBuilder.new(objects, options) }
helper(:builder) ... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/test/xml_test.rb | test/xml_test.rb | # frozen_string_literal: true
require 'active_support/core_ext/hash/conversions'
require 'active_support/time'
require File.expand_path('../teststrap', __FILE__)
require 'rabl/template'
context "Rabl::Engine" do
helper(:rabl) { |t| RablTemplate.new("code", :format => 'xml') { t } }
# TODO fix annoying warnings ... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/test/builder_test.rb | test/builder_test.rb | # frozen_string_literal: true
require File.expand_path('../teststrap', __FILE__)
context "Rabl::Builder" do
helper(:builder) { |*args| Rabl::Builder.new(*args) }
helper(:build_hash) { |*args| builder(*args).to_hash }
setup do
@users = [User.new, User.new]
@user = User.new
builder(nil, nil, {:v... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/test/configuration_test.rb | test/configuration_test.rb | # frozen_string_literal: true
require File.expand_path('../teststrap', __FILE__)
context 'Rabl::Configuration' do
context 'defaults' do
# multi_json compatibility TODO
helper(:json_engine) { ::Oj }
setup { Rabl.configuration }
asserts(:include_json_root).equals true
asserts(:include_child_root)... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/test/helpers_test.rb | test/helpers_test.rb | # frozen_string_literal: true
require 'tmpdir'
require 'pathname'
require File.expand_path('../teststrap', __FILE__)
class TestHelperMethods
include Rabl::Helpers
end
context "Rabl::Helpers" do
setup do
@helper_class = TestHelperMethods.new
@user = User.new
end
# determine_object_root(@user, :user, ... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/test/msgpack_engine_test.rb | test/msgpack_engine_test.rb | # frozen_string_literal: true
# encoding: iso-8859-1
require File.expand_path('../teststrap', __FILE__)
require 'rabl/template'
context "Rabl::Engine" do
helper(:rabl) { |t| RablTemplate.new("code", :format => 'msgpack') { t } }
context "with msgpack defaults" do
setup do
Rabl.configure do |config|
... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/test/engine_test.rb | test/engine_test.rb | # frozen_string_literal: true
require 'json'
require File.expand_path('../teststrap', __FILE__)
require 'rabl/template'
require File.expand_path('../models/ormless', __FILE__)
context "Rabl::Engine" do
helper(:rabl) { |t| RablTemplate.new { t } }
# context_scope 'users', [@user]
helper(:context_scope) { |name, ... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/test/silence.rb | test/silence.rb | # frozen_string_literal: true
module Kernel
def silence_warnings
with_warnings(nil) { yield }
end
def with_warnings(flag)
old_verbose, $VERBOSE = $VERBOSE, flag
yield
ensure
$VERBOSE = old_verbose
end
end unless Kernel.respond_to? :silence_warnings
module Kernel
def silence_stream(stream)... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/test/integration/test_init.rb | test/integration/test_init.rb | # frozen_string_literal: true
require 'rack/test'
require 'riot'
require 'riot/rr'
Riot.pretty_dots
class Riot::Situation
include Rack::Test::Methods
# Construct all the users needed for testing
def create_users!
User.delete_all; PhoneNumber.delete_all
@user1 = User.create!(:username => "billybob", :e... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/test/integration/posts_controller_test.rb | test/integration/posts_controller_test.rb | # frozen_string_literal: true
# Lives in <rabl>/test/integration/posts_controller_test.rb
# Symlinked to fixture applications
begin # Padrino
require File.expand_path(File.dirname(__FILE__) + '/../../test_config.rb')
rescue LoadError # Rails
require File.expand_path(File.dirname(__FILE__) + '/../test_helper.rb')
... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/test/integration/users_controller_test.rb | test/integration/users_controller_test.rb | # frozen_string_literal: true
# Lives in <rabl>/test/integration/users_controller_test.rb
# Symlinked to fixture applications
begin # Sinatra
require File.expand_path(File.dirname(__FILE__) + '/../../test_config.rb')
rescue LoadError # Rails
require File.expand_path(File.dirname(__FILE__) + '/../test_helper.rb')
... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/test/integration/rails5/posts_controller_test.rb | test/integration/rails5/posts_controller_test.rb | # frozen_string_literal: true
# Lives in <rabl>/test/integration/posts_controller_test.rb
# Symlinked to fixture applications
begin # Padrino
require File.expand_path(File.dirname(__FILE__) + '/../../test_config.rb')
rescue LoadError # Rails
require File.expand_path(File.dirname(__FILE__) + '/../test_helper.rb')
... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/test/integration/rails5/users_controller_test.rb | test/integration/rails5/users_controller_test.rb | # frozen_string_literal: true
# Lives in <rabl>/test/integration/users_controller_test.rb
# Symlinked to fixture applications
begin # Sinatra
require File.expand_path(File.dirname(__FILE__) + '/../../test_config.rb')
rescue LoadError # Rails
require File.expand_path(File.dirname(__FILE__) + '/../test_helper.rb')
... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/test/integration/rails6/posts_controller_test.rb | test/integration/rails6/posts_controller_test.rb | # frozen_string_literal: true
# Lives in <rabl>/test/integration/posts_controller_test.rb
# Symlinked to fixture applications
begin # Padrino
require File.expand_path(File.dirname(__FILE__) + '/../../test_config.rb')
rescue LoadError # Rails
require File.expand_path(File.dirname(__FILE__) + '/../test_helper.rb')
... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/test/integration/rails6/users_controller_test.rb | test/integration/rails6/users_controller_test.rb | # frozen_string_literal: true
# Lives in <rabl>/test/integration/users_controller_test.rb
# Symlinked to fixture applications
begin # Sinatra
require File.expand_path(File.dirname(__FILE__) + '/../../test_config.rb')
rescue LoadError # Rails
require File.expand_path(File.dirname(__FILE__) + '/../test_helper.rb')
... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/test/integration/rails3_2/posts_controller_test.rb | test/integration/rails3_2/posts_controller_test.rb | # frozen_string_literal: true
# Lives in <rabl>/test/integration/posts_controller_test.rb
# Symlinked to fixture applications
begin # Padrino
require File.expand_path(File.dirname(__FILE__) + '/../../test_config.rb')
rescue LoadError # Rails
require File.expand_path(File.dirname(__FILE__) + '/../test_helper.rb')
... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/test/integration/rails3_2/users_controller_test.rb | test/integration/rails3_2/users_controller_test.rb | # frozen_string_literal: true
# Lives in <rabl>/test/integration/users_controller_test.rb
# Symlinked to fixture applications
begin # Sinatra
require File.expand_path(File.dirname(__FILE__) + '/../../test_config.rb')
rescue LoadError # Rails
require File.expand_path(File.dirname(__FILE__) + '/../test_helper.rb')
... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/test/integration/rails4/posts_controller_test.rb | test/integration/rails4/posts_controller_test.rb | # frozen_string_literal: true
# Lives in <rabl>/test/integration/posts_controller_test.rb
# Symlinked to fixture applications
begin # Padrino
require File.expand_path(File.dirname(__FILE__) + '/../../test_config.rb')
rescue LoadError # Rails
require File.expand_path(File.dirname(__FILE__) + '/../test_helper.rb')
... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/test/integration/rails4/users_controller_test.rb | test/integration/rails4/users_controller_test.rb | # frozen_string_literal: true
# Lives in <rabl>/test/integration/users_controller_test.rb
# Symlinked to fixture applications
begin # Sinatra
require File.expand_path(File.dirname(__FILE__) + '/../../test_config.rb')
rescue LoadError # Rails
require File.expand_path(File.dirname(__FILE__) + '/../test_helper.rb')
... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/test/models/ormless.rb | test/models/ormless.rb | # frozen_string_literal: true
class Ormless
# Nothing here
end
| ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/test/models/user.rb | test/models/user.rb | # frozen_string_literal: true
unless defined?(User)
class User
attr_accessor :age, :city, :name, :first, :float, :hobbies, :twitter, :first_pets_name
DEFAULT_AGE = 24
DEFAULT_CITY = 'irvine'
DEFAULT_NAME = 'rabl'
DEFAULT_FIRST = 'bob'
DEFAULT_F... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/lib/rabl.rb | lib/rabl.rb | require 'active_support'
require 'active_support/core_ext/string/inflections'
require 'active_support/core_ext/object/blank'
require 'active_support/core_ext/hash/reverse_merge'
require 'active_support/core_ext/hash/except'
require 'active_support/core_ext/hash/slice'
require 'rabl/version'
require 'rabl/helpers'
requ... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/lib/rabl/tracker.rb | lib/rabl/tracker.rb | module Rabl
# DependencyTracker for ActionView to support cache digest
class Tracker
# Matches:
# extends "categories/show"
EXTENDS_DEPENDENCY = /
extends\s* # extends, followed by optional whitespace
\(? # start an optional parenthesis for the extends call... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/lib/rabl/multi_builder.rb | lib/rabl/multi_builder.rb | module Rabl
class MultiBuilder
include Helpers
# Constructs a new MultiBuilder given the data and options.
# The options will be re-used for all Rabl::Builders.
# Rabl::MultiBuilder.new([#<User ...>, #<User ...>, ...], { :format => 'json', :child_root => true })
def initialize(data, settin... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/lib/rabl/version.rb | lib/rabl/version.rb | module Rabl
VERSION = "0.17.0"
end
| ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/lib/rabl/sources.rb | lib/rabl/sources.rb | module Rabl
module Sources
include Helpers
# Returns source for a given relative file
# fetch_source("show", :view_path => "...") => "...contents..."
def fetch_source(file, options = {})
custom_view_path = Array(options[:view_path])
Rabl.source_cache(file, custom_view_path) do
vi... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/lib/rabl/helpers.rb | lib/rabl/helpers.rb | require 'active_support/inflector' # for the sake of pluralizing
module Rabl
module Helpers
# data_object(data) => <AR Object>
# data_object(@user => :person) => @user
# data_object(:user => :person) => @_object.send(:user)
def data_object(data)
data = data.keys.first if data.is_a?(Hash) && dat... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/lib/rabl/railtie.rb | lib/rabl/railtie.rb | module Rabl
class Railtie < Rails::Railtie
initializer "rabl.initialize" do |app|
# Force Rails to load view templates even in API mode
# Stolen shamelessly from jbuilder: https://github.com/rails/jbuilder/blob/master/lib/jbuilder/railtie.rb
if Rails::VERSION::MAJOR >= 5
module ::ActionC... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/lib/rabl/configuration.rb | lib/rabl/configuration.rb | # We load the msgpack library if it is available.
begin
require 'msgpack'
rescue LoadError
end
# We load the bson library if it is available.
begin
require 'bson'
rescue LoadError
end
# We load the plist library if it is available.
begin
require 'plist'
rescue LoadError
end
# Set default options for Oj json pa... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/lib/rabl/digestor.rb | lib/rabl/digestor.rb | require 'action_view'
module Rabl
class Digestor < ActionView::Digestor
# Override the original digest function to ignore partial which
# rabl doesn't use the Rails conventional _ symbol.
if Gem::Version.new(Rails.version) >= Gem::Version.new('5.0.0.beta1')
require 'rabl/digestor/rails5'
elsif ... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/lib/rabl/cache_engine.rb | lib/rabl/cache_engine.rb | # Defines the default cache engine for RABL when caching is invoked for a template.
# You can define your own caching engines by creating an object that responds to fetch and
# setting the configuration option:
#
# config.cache_engine = AdvancedCacheEngine.new
#
class LRU < Hash
attr_accessor :max_size
def in... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/lib/rabl/template.rb | lib/rabl/template.rb | # TILT Template
if defined?(Tilt)
class RablTemplate < Tilt::Template
def initialize_engine
return if defined?(::Rabl)
require_template_library 'rabl'
end
def prepare
#left empty so each invocation has a new hash of options and new rabl engine for thread safety
end
def evaluate... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/lib/rabl/renderer.rb | lib/rabl/renderer.rb | module Rabl
class Renderer
# Defines class method rendering in supported formats
# Rabl::Renderer.json(@post, 'posts/show')
# Rabl::Renderer.xml(@post, 'posts/show')
Rabl::Engine::FORMATS.each do |fmt|
instance_eval <<-CODE
def #{fmt}(object, source, options = {})
new(source, objec... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/lib/rabl/builder.rb | lib/rabl/builder.rb | require 'active_support/inflector' # for the sake of camelcasing keys
module Rabl
class Builder
include Helpers
include Partials
SETTING_TYPES = {
:attributes => :name,
:node => :name,
:child => :data,
:glue => :data,
:extends => :file
} unless const... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/lib/rabl/engine.rb | lib/rabl/engine.rb | module Rabl
class Engine
include Helpers
include Partials
include Helpers::Escaper
# List of supported rendering formats
FORMATS = [:json, :xml, :plist, :bson, :msgpack]
SAFE_FORMATS = FORMATS + [:mpac, :dumpable, :hash]
# Constructs a new ejs engine based on given vars, handler and decl... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/lib/rabl/partials.rb | lib/rabl/partials.rb | module Rabl
module Partials
include Helpers
include Sources
def partial_as_engine(file, options = {}, &block)
raise ArgumentError, "Must provide an :object option to render a partial" unless options.has_key?(:object)
object = options.delete(:object)
view_path = options[:view_path] |... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/lib/rabl/digestor/rails41.rb | lib/rabl/digestor/rails41.rb | require 'action_view'
module Rabl
class Digestor < ActionView::Digestor
def self.digest(options = {})
cache_key = [options[:name]] + Array.wrap(options[:dependencies])
@@cache[cache_key.join('.')] ||= begin
Digestor.new({ :name => options[:name], :finder => options[:finder] }.merge!(options))... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/lib/rabl/digestor/rails5.rb | lib/rabl/digestor/rails5.rb | require 'action_view'
module Rabl
class Digestor < ActionView::Digestor
end
end
| ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
nesquena/rabl | https://github.com/nesquena/rabl/blob/2a19185fcc63dbeeeb8e51192e6086c31aeba749/lib/rabl/digestor/rails3.rb | lib/rabl/digestor/rails3.rb | require 'action_view'
module Rabl
class Digestor < ActionView::Digestor
def self.digest(name, format, finder, options = {})
cache_key = [name, format] + Array.wrap(options[:dependencies])
@@cache[cache_key.join('.')] ||= begin
Digestor.new(name, format, finder, options).digest
end
e... | ruby | MIT | 2a19185fcc63dbeeeb8e51192e6086c31aeba749 | 2026-01-04T15:49:51.900070Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/app/presenters/refinery/page_presenter.rb | pages/app/presenters/refinery/page_presenter.rb | module Refinery
class PagePresenter < BasePresenter
def menu_title_type
@model.menu_title_type
end
end
end
| ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/app/presenters/refinery/pages/menu_presenter.rb | pages/app/presenters/refinery/pages/menu_presenter.rb | require 'active_support/core_ext/string'
require 'active_support/configurable'
require 'action_view/helpers/tag_helper'
require 'action_view/helpers/url_helper'
module Refinery
module Pages
class MenuPresenter
include ActionView::Helpers::TagHelper
include ActionView::Helpers::UrlHelper
include... | ruby | MIT | b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3 | 2026-01-04T15:48:02.394643Z | false |
refinery/refinerycms | https://github.com/refinery/refinerycms/blob/b31d093a0c1c28f33ec532dcf527b8fae1ea3ad3/pages/app/presenters/refinery/pages/section_presenter.rb | pages/app/presenters/refinery/pages/section_presenter.rb | require 'diffy'
module Refinery
module Pages
# Knows how to build the html for a section. A section is part of the visible html, that has
# content wrapped in some particular markup. Construct with the relevant options, and then
# call wrapped_html to get the resultant html.
#
# The content rende... | 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_presenter.rb | pages/app/presenters/refinery/pages/content_presenter.rb | module Refinery
module Pages
# Knows how to render a set of sections as html. This can be used in any
# Refinery view that is built from a group of sections. Pass the sections
# into the constructor or call add_section on the instance, then render by
# calling 'to_html'.
class ContentPresenter
... | 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.