repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
brdebr/AttndCtrl | spec/features/admin_authentication_spec.rb | require "rails_helper"
require 'ffaker'
RSpec.describe "Admin authentication" do
before(:each) do
@pass = FF<PASSWORD>::Internet.password
@admin = create :admin, password:@<PASSWORD>, password_confirmation:@pass
p 'Admin Email : ' + @admin.email
p 'Admin Password : ' + @admin.password
end
it ".... |
brdebr/AttndCtrl | app/controllers/lti_users_controller.rb | class LtiUsersController < ApplicationController
before_action :set_lti_user, only: [:show, :edit, :update, :destroy]
# GET /lti_users
# GET /lti_users.json
def index
@lti_users = LtiUser.all
end
# GET /lti_users/1
# GET /lti_users/1.json
def show
end
# GET /lti_users/new
def new
@lti_u... |
brdebr/AttndCtrl | app/models/lti_user.rb | <gh_stars>0
class LtiUser < ApplicationRecord
belongs_to :lti_role
end
|
brdebr/AttndCtrl | db/migrate/20180607195057_add_lti_id_to_lti_user.rb | <filename>db/migrate/20180607195057_add_lti_id_to_lti_user.rb
class AddLtiIdToLtiUser < ActiveRecord::Migration[5.1]
def change
add_column :lti_users, :lti_id, :integer
end
end
|
brdebr/AttndCtrl | app/models/tool_consumer.rb | <reponame>brdebr/AttndCtrl
class ToolConsumer < ApplicationRecord
belongs_to :admin
has_many :timetables, dependent: :delete_all
accepts_nested_attributes_for :timetables, allow_destroy: true, reject_if: lambda { |attr| attr['name'].blank?}
end
|
brdebr/AttndCtrl | test/system/tool_consumers_test.rb | require "application_system_test_case"
class ToolConsumersTest < ApplicationSystemTestCase
# test "visiting the index" do
# visit tool_consumers_url
#
# assert_selector "h1", text: "ToolConsumer"
# end
end
|
brdebr/AttndCtrl | config/environment.rb | # Load the Rails application.
require_relative 'application'
OAUTH_10_SUPPORT = true
# Initialize the Rails application.
Rails.application.initialize!
|
brdebr/AttndCtrl | spec/controllers/timetable_units_controller_spec.rb | <filename>spec/controllers/timetable_units_controller_spec.rb
require 'rails_helper'
RSpec.describe TimetableUnitsController, type: :controller do
end
|
brdebr/AttndCtrl | app/models/lti_role.rb | class LtiRole < ApplicationRecord
has_many :lti_users
end
|
brdebr/AttndCtrl | config/routes.rb | Rails.application.routes.draw do
resources :lti_contexts
resources :lti_users
devise_for :admins
root 'home#main'
# Admins need to create a ToolConsumer object to authenticate the launch with the generated key/secret
resources :tool_consumers do
resources :timetables, controller: 'tool_consumers/timeta... |
brdebr/AttndCtrl | app/views/tool_consumers/show.json.jbuilder | <reponame>brdebr/AttndCtrl
json.partial! "tool_consumers/tool_consumer", tool_consumer: @tool_consumer
|
brdebr/AttndCtrl | spec/factories/timetable_units.rb | <filename>spec/factories/timetable_units.rb
FactoryBot.define do
factory :timetable_unit do
name "MyString"
description "MyText"
week_day 1
start_time "2018-06-03 23:04:57"
finish_time "2018-06-03 23:04:57"
end
end
|
brdebr/AttndCtrl | spec/factories/lti_users.rb | <filename>spec/factories/lti_users.rb
FactoryBot.define do
factory :lti_user do
full_name "MyString"
given "MyString"
family "MyString"
username "MyString"
email "MyString"
end
end
|
brdebr/AttndCtrl | db/migrate/20180603210457_create_timetable_units.rb | <reponame>brdebr/AttndCtrl
class CreateTimetableUnits < ActiveRecord::Migration[5.1]
def change
create_table :timetable_units do |t|
t.string :name
t.text :description
t.integer :week_day
t.time :start_time
t.time :finish_time
t.timestamps
end
end
end
|
brdebr/AttndCtrl | db/migrate/20180608013852_add_lti_role_to_lti_user.rb | class AddLtiRoleToLtiUser < ActiveRecord::Migration[5.1]
def change
add_reference :lti_users, :lti_role, foreign_key: true
end
end
|
brdebr/AttndCtrl | spec/factories/tool_consumer_factory.rb | require 'ffaker'
FactoryBot.define do
factory :tool_consumer do
name { FFaker::Education.school }
key { FFaker::Education.school_name }
secret { FFaker::Internet.password }
end
end |
brdebr/AttndCtrl | app/views/tool_consumers/timetables/_timetable.json.jbuilder | <filename>app/views/tool_consumers/timetables/_timetable.json.jbuilder
json.extract! timetable, :id, :name, :created_at, :updated_at
json.url timetable_url(timetable, format: :json)
|
brdebr/AttndCtrl | spec/features/guest_authentication_spec.rb | require 'rails_helper'
require 'ffaker'
RSpec.describe 'Guest signs up' do
before(:each) do
@pass = <PASSWORD>
@guest = build :admin, password:@<PASSWORD>, password_confirmation:@pass
p 'Guest Email : ' + @guest.email
p 'Guest Password : ' + @guest.password
end
it '.visits the homepage' do
... |
brdebr/AttndCtrl | app/views/tool_consumers/index.json.jbuilder | json.array! @tool_consumers, partial: 'tool_consumers/tool_consumer', as: :tool_consumer
|
brdebr/AttndCtrl | app/controllers/tool_consumers/timetables_controller.rb | <filename>app/controllers/tool_consumers/timetables_controller.rb
class ToolConsumers::TimetablesController < ApplicationController
before_action :authenticate_admin!, except: :show
before_action :set_timetable, only: [:show, :edit, :update, :destroy]
before_action :set_tool_consumer, except: [:new, :create]
#... |
brdebr/AttndCtrl | spec/features/tool_consumers_timetables_spec.rb | <reponame>brdebr/AttndCtrl<gh_stars>0
require "rails_helper"
require 'ffaker'
RSpec.describe "Tool consumers management" do
before(:each) do
@pass = <PASSWORD>::Internet.password
@admin = create :admin, password:@<PASSWORD>, password_confirmation:@pass
p 'Admin - Email : ' + @admin.email
p 'Admin -... |
brdebr/AttndCtrl | app/models/timetable.rb | class Timetable < ApplicationRecord
belongs_to :tool_consumer
has_many :timetable_units
accepts_nested_attributes_for :timetable_units, allow_destroy: true, reject_if: lambda { |attr| attr['name'].blank?}
end
|
brdebr/AttndCtrl | test/system/lti_contexts_test.rb | require "application_system_test_case"
class LtiContextsTest < ApplicationSystemTestCase
# test "visiting the index" do
# visit lti_contexts_url
#
# assert_selector "h1", text: "LtiContext"
# end
end
|
brdebr/AttndCtrl | app/controllers/tool_consumers_controller.rb | class ToolConsumersController < ApplicationController
before_action :authenticate_admin!
before_action :set_tool_consumer, only: [:show, :edit, :update, :destroy]
# GET /tool_consumers
# GET /tool_consumers.json
def index
@tool_consumers = ToolConsumer.where admin:current_admin
end
# GET /tool_consu... |
brdebr/AttndCtrl | app/controllers/home_controller.rb | <reponame>brdebr/AttndCtrl
class HomeController < ApplicationController
before_action :authenticate_admin!, except: [:main]
def main
end
def dashboard
end
def test_oauth
end
end |
brdebr/AttndCtrl | test/controllers/timetables_controller_test.rb | require 'test_helper'
class TimetablesControllerTest < ActionDispatch::IntegrationTest
setup do
@timetable = timetables(:one)
end
test "should get index" do
get timetables_url
assert_response :success
end
test "should get new" do
get new_timetable_url
assert_response :success
end
t... |
brdebr/AttndCtrl | app/helpers/application_helper.rb | module ApplicationHelper
def current_active_page?(test_path)
return 'active' if request.path == test_path
''
end
end
|
brdebr/AttndCtrl | app/views/lti_users/_lti_user.json.jbuilder | json.extract! lti_user, :id, :full_name, :given, :family, :username, :email, :created_at, :updated_at
json.url lti_user_url(lti_user, format: :json)
|
brdebr/AttndCtrl | test/system/lti_users_test.rb | require "application_system_test_case"
class LtiUsersTest < ApplicationSystemTestCase
# test "visiting the index" do
# visit lti_users_url
#
# assert_selector "h1", text: "LtiUser"
# end
end
|
brdebr/AttndCtrl | app/views/lti_users/show.json.jbuilder | <gh_stars>0
json.partial! "lti_users/lti_user", lti_user: @lti_user
|
brdebr/AttndCtrl | app/controllers/timetable_units_controller.rb | class TimetableUnitsController < ApplicationController
before_action :authenticate_admin!, except: :index
# GET /timetable_us
# GET /timetable_us.json
def index
@timetable_u = TimetableUnit.where timetable_id:params['timetable_id']
respond_to do |format|
format.html
format.json { render :js... |
brdebr/AttndCtrl | app/views/lti_users/index.json.jbuilder | <gh_stars>0
json.array! @lti_users, partial: 'lti_users/lti_user', as: :lti_user
|
brdebr/AttndCtrl | app/models/timetable_unit.rb | class TimetableUnit < ApplicationRecord
belongs_to :timetable
def as_json(options = {})
{
:id => self.id,
:title => "· "+self.name.capitalize.truncate(15)+"\n"+self.description.truncate(30),
:start => self.start_time.strftime("%H:%M"),
:end => self.finish_time.strftime("%H:%M"),... |
brdebr/AttndCtrl | spec/factories/lti_contexts.rb | FactoryBot.define do
factory :lti_context do
lti_id 1
label "MyString"
title "MyString"
end
end
|
brdebr/AttndCtrl | app/models/lti_context.rb | <filename>app/models/lti_context.rb
class LtiContext < ApplicationRecord
end
|
brdebr/AttndCtrl | test/controllers/tool_consumers_controller_test.rb | require 'test_helper'
class ToolConsumersControllerTest < ActionDispatch::IntegrationTest
setup do
@tool_consumer = tool_consumers(:one)
end
test "should get index" do
get tool_consumers_url
assert_response :success
end
test "should get new" do
get new_tool_consumer_url
assert_response ... |
brdebr/AttndCtrl | app/controllers/lti_controller.rb | <filename>app/controllers/lti_controller.rb<gh_stars>0
class LtiController < ApplicationController
include LtiAuthLaunchConcern
skip_before_action :verify_authenticity_token
def launch
render :launch_error, status: 401 unless is_oauth_valid?
end
end |
brdebr/AttndCtrl | app/views/lti_contexts/index.json.jbuilder | json.array! @lti_contexts, partial: 'lti_contexts/lti_context', as: :lti_context
|
brdebr/AttndCtrl | app/views/lti_contexts/show.json.jbuilder | <reponame>brdebr/AttndCtrl<filename>app/views/lti_contexts/show.json.jbuilder
json.partial! "lti_contexts/lti_context", lti_context: @lti_context
|
brdebr/AttndCtrl | app/views/lti_contexts/_lti_context.json.jbuilder | json.extract! lti_context, :id, :lti_id, :label, :title, :created_at, :updated_at
json.url lti_context_url(lti_context, format: :json)
|
brdebr/AttndCtrl | db/migrate/20180527111236_add_admin_to_tool_consumer.rb | <filename>db/migrate/20180527111236_add_admin_to_tool_consumer.rb
class AddAdminToToolConsumer < ActiveRecord::Migration[5.1]
def change
add_reference :tool_consumers, :admin, foreign_key: true
end
end
|
brdebr/AttndCtrl | app/controllers/concerns/lti_auth_launch_concern.rb | # Required for LTI
require 'ims/lti'
# Used to validate oauth signatures
require 'oauth/request_proxy/action_controller_request'
module LtiAuthLaunchConcern
extend ActiveSupport::Concern
def is_oauth_valid?
# Search for a ToolConsumer with the param 'key' equal to :
# the result of getting the 'parameters... |
brdebr/AttndCtrl | app/controllers/lti_contexts_controller.rb | <gh_stars>0
class LtiContextsController < ApplicationController
before_action :set_lti_context, only: [:show, :edit, :update, :destroy]
# GET /lti_contexts
# GET /lti_contexts.json
def index
@lti_contexts = LtiContext.all
end
# GET /lti_contexts/1
# GET /lti_contexts/1.json
def show
end
# GET... |
brdebr/AttndCtrl | spec/factories/admin_factory.rb | <gh_stars>0
require 'ffaker'
FactoryBot.define do
factory :admin do
email { FFaker::Internet.free_email }
password "<PASSWORD>"
password_confirmation "<PASSWORD>"
end
end |
brdebr/AttndCtrl | db/schema.rb | # 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 source for your
# dat... |
brdebr/AttndCtrl | app/views/tool_consumers/_tool_consumer.json.jbuilder | json.extract! tool_consumer, :id, :name, :key, :secret, :created_at, :updated_at
json.url tool_consumer_url(tool_consumer, format: :json)
|
charlie22c/spree_shipstation | spec/spec_helper.rb | # Run Coverage report
require 'simplecov'
SimpleCov.start do
add_filter 'spec/dummy'
add_group 'Controllers', 'app/controllers'
add_group 'Helpers', 'app/helpers'
add_group 'Mailers', 'app/mailers'
add_group 'Models', 'app/models'
add_group 'Views', 'app/views'
add_group 'Libraries', 'lib'
end
# Configur... |
charlie22c/spree_shipstation | app/views/spree/shipstation/export.xml.builder | <reponame>charlie22c/spree_shipstation
date_format = "%m/%d/%Y %H:%M"
def address(xml, address, type, order)
name = "#{type.to_s.titleize}To"
xml.__send__(name) {
xml.Name trim_field(address.full_name, 100)
xml.Company trim_field(address.company, 100)
if type == :ship
xml.Address1 ... |
charlie22c/spree_shipstation | app/models/spree/shipment_decorator.rb | Spree::Shipment.class_eval do
scope :exportable, -> {
joins(:order)
.where('spree_shipments.state != ?', 'pending')
.where("#{Spree::Order.table_name}.completed_at > ?", Time.new(2020, 1, 1))
}
def self.between(from, to)
joins(:order).where('spree_orders.updated_at between ? AND ?', from, to)
end... |
charlie22c/spree_shipstation | lib/spree_shipstation.rb | require 'spree_core'
require 'spree_shipstation/engine'
require 'spree/shipment_notice'
module Spree
extend ActionView::Helpers::TagHelper
end
|
charlie22c/spree_shipstation | app/models/spree/shipment_handler_decorator.rb | Spree::ShipmentHandler.class_eval do
private
def send_shipped_email
Spree::ShipmentMailer.shipped_email(@shipment.id).deliver_later if Spree::Config.send_shipped_email
end
end
|
charlie22c/spree_shipstation | spec/models/spree/shipment_spec.rb | <gh_stars>0
require 'spec_helper'
describe Spree::Shipment do
context "between" do
before do
@active = []
@dt1 = 1.day.ago
@dt2 = 1.day.from_now
@dt_now = Time.now
Timecop.travel(@dt1) do
@shipment1 = create(:shipment, order: create(:order))
end
Timecop.travel(... |
charlie22c/spree_shipstation | spec/factories/order.rb | require 'spree/testing_support/factories'
FactoryGirl.modify do
factory :order, class: Spree::Order do
end
end |
charlie22c/spree_shipstation | spec/factories/shipment.rb | <gh_stars>0
require 'spree/testing_support/factories'
require 'timecop'
FactoryGirl.modify do
factory :shipment, class: Spree::Shipment do
association :order
end
end |
charlie22c/spree_shipstation | spec/lib/spree/shipment_notice_spec.rb | require 'spec_helper'
include Spree
describe Spree::ShipmentNotice do
let(:notice) { ShipmentNotice.new(order_number: 'S12345',
tracking_number: '1Z1231234') }
context "#apply" do
context "shipment found" do
let(:shipment) { mock_model(Shipment, :shipped? => fals... |
charlie22c/spree_shipstation | spec/support/factory_girl.rb | <gh_stars>0
# RSpec.configure do |config|
# # additional factory_girl configuration
#
# config.before(:suite) do
# begin
# DatabaseCleaner.start
# # builds each factory and subsequently calls #valid? on it (if #valid? is defined);
# # if any calls to #valid? return false, FactoryGirl::InvalidF... |
charlie22c/spree_shipstation | spec/controllers/spree/shipstation_controller_spec.rb | require 'spec_helper'
describe Spree::ShipstationController, type: :controller do
before do
# controller.stub(check_authorization: false, spree_current_user: FactoryGirl.create(:user)) # TODO: uncomment and fix it
# controller.stub(:shipnotify)
@request.accept = 'application/xml'
end
context "logg... |
charlie22c/spree_shipstation | app/controllers/spree/shipstation_controller.rb | <reponame>charlie22c/spree_shipstation<filename>app/controllers/spree/shipstation_controller.rb
include SpreeShipstation
module Spree
class ShipstationController < Spree::BaseController
#include BasicSslAuthentication
include Spree::DateParamHelper
skip_before_filter :verify_authenticity_token
befor... |
charlie22c/spree_shipstation | app/views/spree/shipstation/shipnotify.xml.builder | xml.instruct!
xml.text @text |
Talkdesk/jruby | spec/ruby/library/readline/spec_helper.rb | require File.expand_path('../../../spec_helper', __FILE__)
unless MSpec.retrieve(:features).key?(:readline)
begin
require 'readline'
rescue LoadError
else
# rb-readline behaves quite differently
if $".grep(/\brbreadline\.rb$/).empty?
MSpec.enable_feature :readline
end
end
end
|
Talkdesk/jruby | spec/ruby/language/undef_spec.rb | require File.expand_path('../../spec_helper', __FILE__)
describe "The undef keyword" do
describe "undefines a method" do
before :each do
@undef_class = Class.new do
def meth(o); o; end
end
@obj = @undef_class.new
@obj.meth(5).should == 5
end
it "with an identifier" do... |
Talkdesk/jruby | spec/mspec/lib/mspec/matchers/be_nil.rb | <reponame>Talkdesk/jruby<filename>spec/mspec/lib/mspec/matchers/be_nil.rb
class BeNilMatcher
def matches?(actual)
@actual = actual
@actual.nil?
end
def failure_message
["Expected #{@actual.inspect}", "to be nil"]
end
def negative_failure_message
["Expected #{@actual.inspect}", "not to be nil... |
Talkdesk/jruby | spec/ruby/optional/capi/spec_helper.rb | require File.expand_path('../../../spec_helper', __FILE__)
$extmk = false
require 'rbconfig'
OBJDIR ||= File.expand_path("../../../ext/#{RUBY_NAME}/#{RUBY_VERSION}", __FILE__)
mkdir_p(OBJDIR)
def extension_path
File.expand_path("../ext", __FILE__)
end
def object_path
OBJDIR
end
def compile_extension(name)
pr... |
gunyarakun/cookie-clicker-generator | app/models/cookie_clicker.rb | class CookieClicker < ActiveRecord::Base
acts_as_paranoid
belongs_to :user
has_many :images
validates_presence_of :title, :user_id
attr_accessible :title, :user_id, :published
def image_paths
paths = {}
CookieClickerGenerator::Application::CC_IMAGES.keys.each do |filename|
paths[filename] = ... |
gunyarakun/cookie-clicker-generator | test/helpers/cookie_clickers_helper_test.rb | require 'test_helper'
class CookieClickersHelperTest < ActionView::TestCase
end
|
gunyarakun/cookie-clicker-generator | lib/tasks/unicorn.rake | # coding: utf-8
# This rake task is from
# http://www.techscore.com/blog/2012/10/19/custom-unicorn-rake-tasks/
namespace :unicorn do
UNICORN_CONFIG_FILE_PATH = Rails.root.join('config', 'unicorn.rb')
UNICORN_PID_FILE_PATH = Rails.root.join('tmp', 'pids', 'unicorn.pid')
def unicorn_master_pid_string
pid_fil... |
gunyarakun/cookie-clicker-generator | config/initializers/twitter.rb | Twitter.configure do |config|
config.consumer_key = Settings.twitter.consumer_key
config.consumer_secret = Settings.twitter.consumer_secret
end
|
gunyarakun/cookie-clicker-generator | db/migrate/20130921064812_create_images.rb | <filename>db/migrate/20130921064812_create_images.rb
class CreateImages < ActiveRecord::Migration
def change
create_table :images do |t|
t.string :path
t.integer :user_id # NOTE: This is duplicated column
t.integer :cookie_clicker_id
t.string :external_source # for easy mode like '@tasukuc... |
gunyarakun/cookie-clicker-generator | app/models/user.rb | <reponame>gunyarakun/cookie-clicker-generator
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
# devise :database_authenticatable, :registerable,
# :recoverable, :rememberable, :trackable, :validatable
de... |
gunyarakun/cookie-clicker-generator | config/initializers/session_store.rb | <filename>config/initializers/session_store.rb
# Be sure to restart your server when you modify this file.
CookieClickerGenerator::Application.config.session_store :cookie_store, key: '_cookie-clicker-generator_session'
|
gunyarakun/cookie-clicker-generator | test/controllers/cookie_clickers_controller_test.rb | require 'test_helper'
class CookieClickersControllerTest < ActionController::TestCase
setup do
@cookie_clicker = cookie_clickers(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:cookie_clickers)
end
test "should get new" do
get :new
as... |
gunyarakun/cookie-clicker-generator | config/initializers/paperclip.rb | module Paperclip
module Interpolations
def user_id(attachment, style_name)
attachment.instance.user_id.to_s
end
def cookie_clicker_id(attachment, style_name)
attachment.instance.cookie_clicker_id.to_s
end
end
end
|
gunyarakun/cookie-clicker-generator | 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... |
gunyarakun/cookie-clicker-generator | app/helpers/application_helper.rb | module ApplicationHelper
def cc_image_resize(name, max_width = CookieClickerGenerator::Application::THUMBNAIL_MAX_PIXELS, max_height = CookieClickerGenerator::Application::THUMBNAIL_MAX_PIXELS)
cc_image_info = CookieClickerGenerator::Application::CC_IMAGES[name]
if cc_image_info
w_ratio = max_width * 1.... |
gunyarakun/cookie-clicker-generator | config/unicorn.rb | worker_processes 4
listen '/tmp/unicorn.sock', :backlog => 1
listen 8080, :tcp_nopush => true
stderr_path File.expand_path('../../log/unicorn/stderr.log', __FILE__)
stdout_path File.expand_path('../../log/unicorn/stdout.log', __FILE__)
pid File.expand_path('../../tmp/pids/unicorn.pid', __FILE__)
preload_app false
|
gunyarakun/cookie-clicker-generator | app/models/image.rb | <reponame>gunyarakun/cookie-clicker-generator<filename>app/models/image.rb
class Image < ActiveRecord::Base
acts_as_paranoid
belongs_to :user
belongs_to :cookie_clicker
validates_presence_of :user_id, :cookie_clicker_id, :path
# validates_attachment_presence :body
attr_accessible :path, :cookie_clicker_id, ... |
gunyarakun/cookie-clicker-generator | app/views/images/show.json.jbuilder | json.extract! @image, :path, :body
if @image.body.present?
thumb_size = cc_image_resize(@image.path)
json.set! :thumb_width, thumb_size[:width]
json.set! :thumb_height, thumb_size[:height]
end
|
gunyarakun/cookie-clicker-generator | app/controllers/root_controller.rb | class RootController < ApplicationController
def index
@cookie_clickers = CookieClicker.where(:published => true).order('created_at desc').page(params[:page])
respond_to do |format|
format.html
format.js
end
end
end
|
gunyarakun/cookie-clicker-generator | 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 CookieClickerGenerator
class Application < Rails::Application
# Settings in config/envi... |
gunyarakun/cookie-clicker-generator | db/migrate/20130921051234_create_cookie_clickers.rb | class CreateCookieClickers < ActiveRecord::Migration
def change
create_table :cookie_clickers do |t|
t.integer :user_id
t.string :title, :limit => 128
t.boolean :published
t.boolean :easy_mode
t.datetime :deleted_at # for rails4_acts_as_paranoid
t.timestamps
end
add_i... |
gunyarakun/cookie-clicker-generator | app/controllers/images_controller.rb | require 'mini_magick'
class ImagesController < ApplicationController
before_action :set_image, only: [:update, :destroy]
before_filter :authenticate_user!
# POST /images
# POST /images.json
def create
@image = Image.new(image_params)
@image.user_id = current_user.id
respond_to do |format|
... |
gunyarakun/cookie-clicker-generator | lib/renders.rb | ActionController.add_renderer :css do |template, options|
string = render_to_string template, options
self.content_type ||= Mime::CSS
self.response_body = string
end
|
gunyarakun/cookie-clicker-generator | app/controllers/cookie_clickers_controller.rb | <reponame>gunyarakun/cookie-clicker-generator<filename>app/controllers/cookie_clickers_controller.rb
class CookieClickersController < ApplicationController
before_action :set_cookie_clicker_editable, only: [:edit, :update, :destroy]
before_action :set_cookie_clicker, only: [:show, :style, :main, :lang]
before_act... |
mokos/open_uri_cache | spec/open_uri_cache_spec.rb | #!ruby -Ku
# coding: utf-8
require 'open_uri_cache'
require 'tmpdir'
require 'kconv'
RSpec.describe OpenUriCache do
it "has a version number" do
expect(OpenUriCache::VERSION).not_to be nil
end
it 'same result with cache' do
Dir.mktmpdir {|tmpdir|
url = 'https://twitter.com'
doc = OpenUriCac... |
mokos/open_uri_cache | lib/open_uri_cache.rb | require_relative 'open_uri_cache/version'
require 'fileutils'
require 'pathname'
require 'open-uri'
require 'cgi'
require 'json'
module OpenUriCache
class SuccessCheckError < StandardError; end
class CacheFile < File
private_class_method :new
def set_info(info)
@info = info
end
def method... |
pirvudoru/php-serialize | lib/php-serialize.rb | <reponame>pirvudoru/php-serialize
# Bunlder auto requires the gemname, so we redirect to the right file.
require "php_serialize"
|
whiplashmerch/omniauth-whiplash | lib/omniauth/whiplash.rb | <filename>lib/omniauth/whiplash.rb
require "omniauth-oauth2"
require "omniauth/whiplash/version"
require "omniauth/strategies/whiplash"
|
whiplashmerch/omniauth-whiplash | lib/omniauth/whiplash/version.rb | module Omniauth
module Whiplash
VERSION = "0.2.4"
end
end
|
whiplashmerch/omniauth-whiplash | lib/omniauth/strategies/whiplash.rb | <reponame>whiplashmerch/omniauth-whiplash
module OmniAuth
module Strategies
class Whiplash < OmniAuth::Strategies::OAuth2
option :name, :whiplash
option :client_options, {
site: ENV['WHIPLASH_API_URL'] || "https://www.getwhiplash.com",
authorize_url: "/oauth/authorize"
}
... |
seanmcneil/Spitfire | Spitfire.podspec | Pod::Spec.new do |s|
s.name = 'Spitfire'
s.version = '2.1.1'
s.summary = 'A fairly basic utility for taking an array of UIImages and producing a MOV video file.'
s.description = <<-DESC
Spitfire will take an array of one or more UIImages, and produce a video file from them. It provide... |
underscorgan/vanagon-test-child | configs/components/child.rb | <reponame>underscorgan/vanagon-test-child<gh_stars>0
component 'child' do |pkg, settings, platform|
pkg.version '0.0.1'
pkg.url 'http://downloads.puppet.com/puppet-gpg-signing-key.pub'
pkg.md5sum 'e6592bb040215d92f44aaa4547569881'
pkg.install do
'touch /vanagon-child'
end
end
|
underscorgan/vanagon-test-child | configs/projects/child.rb | project 'child' do |proj|
proj.version '0.0.1'
proj.component 'child'
proj.description 'this is a test project'
proj.vendor 'morgan <<EMAIL>>'
proj.license 'Apache-2.0'
proj.homepage 'http://example.com'
end
|
videlanicolas/puppet-ceph | spec/acceptance/ceph_mon_osd_spec.rb | <reponame>videlanicolas/puppet-ceph
#
# Copyright (C) 2015 <NAME>
#
# Author: <NAME> <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses... |
videlanicolas/puppet-ceph | spec/defines/ceph_rbd_mirror_spec.rb | # Copyright (C) 2016 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
videlanicolas/puppet-ceph | spec/classes/ceph_conf_spec.rb | <gh_stars>10-100
#
# Copyright (C) 2013 Cloudwatt <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... |
videlanicolas/puppet-ceph | spec/defines/ceph_pool_spec.rb | #
# Copyright (C) 2014 Catalyst IT Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... |
videlanicolas/puppet-ceph | spec/classes/ceph_profile_base_spec.rb | #
# Copyright (C) 2014 Nine Internet Solutions AG
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
videlanicolas/puppet-ceph | lib/puppet/type/ceph_config.rb | <reponame>videlanicolas/puppet-ceph<gh_stars>1-10
# Copyright (C) <NAME> <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... |
videlanicolas/puppet-ceph | spec/unit/provider/ceph_config/ini_setting_spec.rb | <reponame>videlanicolas/puppet-ceph
# Copyright (C) 2013 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unles... |
videlanicolas/puppet-ceph | spec/spec_helper.rb | # Load libraries from openstacklib here to simulate how they live together in a real puppet run (for provider unit tests)
$LOAD_PATH.push(File.join(File.dirname(__FILE__), 'fixtures', 'modules', 'openstacklib', 'lib'))
require 'puppetlabs_spec_helper/module_spec_helper'
require 'shared_examples'
require 'puppet-opensta... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.