text stringlengths 10 2.61M |
|---|
Pod::Spec.new do |s|
s.platform = :ios
s.name = "PBTutorialManager"
s.version = "1.0.4"
s.summary = "An easy way to manipulate view targets to create tutorial in your app."
s.description = <<-DESC
This library has been created to create a tutorial in-app for your app. It uses targets vie... |
# To change this template, choose Tools | Templates
# and open the template in the editor.
module MyConstants
########################
#与topic模型相关的常量定义
########################
#status常量
TOPIC_STATUS_CLOSE = 0 #关闭状态
TOPIC_STATUS_OPEN = 1 #正常状态
TOPIC_STATUS_DELETED = 2 #删除状态
#if_verify_info常量... |
#!/usr/bin/env ruby
#
# Copyright 2015 Apcera Inc. All rights reserved.
require_relative File.join('.', 'vagrant_helper.rb')
helper = VagrantHelper.new
Vagrant::configure('2') do |config|
config.vm.network :public_network
config.vm.box = "apcera/continuum_trial"
config.vm.define :default do |default|
helper.... |
require "minitest/autorun"
require_relative '../lib/telemetry'
require 'byebug'
class TelemetryDiagnosticsTest < Minitest::Test
TRANSMISSION_RESPONSE = "
LAST TX rate................ 100 MBPS\r\n
HIGHEST TX rate............. 100 MBPS\r\n
LAST RX rate................ 100 MBPS\r\n
HIGHEST RX rate............. 100 MBPS\... |
module Smite
class Item < Smite::Object
def initialize(data)
super(data)
effects = @data.delete('item_description')
@data['passive'] = effects['SecondaryDescription']
@data['description'] = effects['Description']
@data['active_effects'] = effects['Menuitems... |
module ScorchedEarth
module Subscribers
module Delta
def setup
super
event_runner.subscribe(Events::GameUpdate) do |event|
@objects = objects.map { |object| object.update event.delta }.compact
end
end
end
end
end
|
FactoryGirl.define do
factory :base_page_redirect, :class => Refinery::BasePageRedirects::BasePageRedirect do
sequence(:Homepage_Headline) { |n| "refinery#{n}" }
end
end
|
class BasesController < ApplicationController
def create
@base = Base.new(base_params)
if @base.save
flash[:notice] = "Your base was added!"
redirect_to buses_path
end
end
def index
@bases = Base.all
end
def show
@base = Base.find_by(id: params[:id])
@bases = Base.all
... |
require "rails_helper"
RSpec.describe GridSquare, :type => :model do
it 'has one drawing' do
assc = described_class.reflect_on_association(:drawing)
expect(assc.macro).to eq :has_one
end
it 'has one color' do
assc = described_class.reflect_on_association(:color)
expect(assc.macro).to eq :has_on... |
source 'https://rubygems.org'
# Specify your gem's dependencies in cloudformation-ruby-dsl.gemspec
# gemspec
# Do not upgrade until github.com/bazaarvoice/cloudformation-ruby-dsl/issues/110 is fixed
# In addition, another bug was discovered that prevents the AWS error message from being returned
# Hence we are sticki... |
class DonationsController < ApplicationController
def index
end
def new
@donation = Donation.new
end
def credit
@donation = Donation.where(user_id: current_user.id)
end
def create
@restaurant = Restaurant.find(params[:restaurant_id])
@donation = @restaurant.donations.new(donation_params)
@do... |
# frozen_string_literal: true
require "sentry/transport"
module Sentry
class Client
include LoggingHelper
# The Transport object that'll send events for the client.
# @return [Transport]
attr_reader :transport
# @!macro configuration
attr_reader :configuration
# @deprecated Use Sentry... |
class AddProjectCategoryIdToForum < ActiveRecord::Migration
def change
add_column :forums, :project_category_id, :integer
add_index :forums, :project_category_id
end
end
|
class StaffMembersController < ApplicationController
before_filter :authenticate_user!, :except => [:index]
respond_to :html
def index
respond_with @staff_members = StaffMember.all
end
def admin
respond_with @staff_members = StaffMember.all
end
def new
@staff_member = StaffMember.new
@s... |
class Change1ColNullsLnparams < ActiveRecord::Migration[5.0]
def change
change_column_null :lnparams, :l, true
change_column_null :lnparams, :r, true
change_column_null :lnparams, :ro, true
change_column_null :lnparams, :k_scr, true
change_column_null :lnparam... |
class Unit < ApplicationRecord
belongs_to :hex
belongs_to :user
end
|
class AddSkillPostRequirmentIdToActivities < ActiveRecord::Migration
def change
add_column :activities, :skill_post_requirement_id, :integer
end
end
|
require 'rails_helper'
feature 'as a User' do
it 'shows me my house members' do
visit '/'
select 'Slytherin', from: 'house'
click_on 'Get Students'
expect(current_path).to eq('/search')
expect(current_url).to include('house=slytherin')
expect(page).to have_content('22 Students')
ex... |
from = ENV["EMAIL_FROM"]
if Rails.env.development? or Rails.env.test?
from ||= "noreply@masasx.heroku.com"
end
raise "You must set an email from address in ENV['EMAIL_FROM']" if from.blank?
ActionMailer::Base.default(from: from)
|
require 'rack_mailer'
module ContactForms
class Engine < Rails::Engine
config.after_initialize do
Mail.defaults do
method = Rails.application.config.action_mailer.delivery_method
options = Rails.application.config.action_mailer.send("#{method}_settings".to_sym) || {}
delivery_method... |
require 'utilidades'
class AdministracionesController < ApplicationController
before_filter :only => [:index, :salida_csv, :salida_rb, :entrada_rb, :limpia_bd] do |controller|
controller.usuario_es?(:administrador)
end
before_filter :only => [:restaura_modelo_barra] do |controller|
controller.usuari... |
module RubyKong
class << self
attr_accessor :url
def paths
{
:node => {
:info => '/',
:status => '/status'
},
:api => {
:create => '/apis',
:list => '/apis',
:retrieve => '/apis/',
:update => '/apis/'... |
class ALog < ActiveRecord::Base
self.table_name = "a_logs"
self.primary_key = :id
validates_presence_of :ip_client, :user_id, :uniq_secure_session
end
|
class Question < ApplicationRecord
has_one_attached :image, dependent: :destroy
extend ActiveHash::Associations::ActiveRecordExtensions
belongs_to :allocation
belongs_to :user
has_many :choices, dependent: :destroy
has_many :exam_questions, dependent: :destroy
has_many :exams, through: :exam_questions
... |
include DataMagic
Then(/^all date filters should display correct message$/) do
on(TransactionsDetailsPage) do |page|
page.wait_for_td_page_load
page.date_filter('Last 90 Days')
page.set_date('02/15/2016')
errors = page.data_for(:td_errors)
page.date_filter('Last 15 Days')
page.no_posted_filt... |
require 'spec_helper'
describe "audio_mp3s/show" do
before(:each) do
@audio_mp3 = assign(:audio_mp3, stub_model(AudioMp3,
:audio_mp3_file_name => "Audio Mp3 File Name",
:audio_mp3_content_type => "Audio Mp3 Content Type",
:audio_Mp3_file_size => 1,
:audio_content_id => 2,
:audio_tit... |
require 'fileutils'
desc 'Compile all CoffeeScript files'
task :compile do
puts 'Compiling all CoffeeScript files...'
system('coffee -o tmp -c lib spec') || fail
puts 'Done.'
end
desc 'Run package specs'
task :spec do
puts 'Running package specs...'
system('apm test') || fail
end
desc 'Run CoffeeLint'
tas... |
require_relative '../test_helper'
class TiplineNewsletterDeliveryTest < ActiveSupport::TestCase
def setup
@delivery = TiplineNewsletterDelivery.new(
recipients_count: 100,
content: 'Test',
started_sending_at: Time.now.ago(1.minute),
finished_sending_at: Time.now,
tipline_newsletter:... |
# あと回し
# FactoryBot.define do
# factory :item_detail do
# size_id { 1 }
# condition_id { 1 }
# item
# end
# end |
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
begin
require 'rspec/core/rake_task'
desc 'Run API specs test in spec/controllers'
RSpec::Core... |
require 'test_helper'
class JobsControllerTest < ActionDispatch::IntegrationTest
setup do
@job = jobs(:one)
end
test "should get index" do
get jobs_url
assert_response :success
end
test "should get new" do
get new_job_url
assert_response :success
end
test "should create job" do
... |
class CreateSources < ActiveRecord::Migration
def self.up
create_table :sources do |t|
t.string :name
t.string :website
t.string :contact_person
t.string :contact_email
t.string :contact_phone
t.integer :antibodies_count, :default => 0
t.integer :source_targets_count, :de... |
class ReferralTypesController < ApplicationController
respond_to :json
before_filter :authorize
before_action :find_company , :only =>[:index , :create , :new ]
before_action :find_referral_type , :only => [:edit , :update , :destroy]
skip_before_filter :verify_authenticity_token, :unless => Proc.new { |c| ... |
#encoding: utf-8
require 'bio'
require 'bio-samtools'
require_relative 'update_chr_seq'
if ARGV.empty?
puts "Please provide a vcf file, a fasta file and an short phrase to include in new filename as arguments in that order"
puts "usage: ruby fasta_var_udpate.rb vcf fasta sample"
exit
else
in_vcf = File.exp... |
class StandardSolution < ActiveRecord::Base
acts_as :material
validates :concentration, presence: true
validate :concentration_unit
def concentration_unit
if self.concentration
begin
Unit.new(self.concentration).convert_to('mg/l')
rescue
errors.add(:concentration, 'deve ser um... |
class AddUniqToNameApplication < ActiveRecord::Migration[5.1]
def change
add_index :applications, :name, unique: true
end
end
|
# -*- coding: utf-8 -*-
require_relative "../test_helper"
require "s7n/entry_collection"
module S7n
class EntryCollectionTest < Test::Unit::TestCase
setup do
@entry_collection = EntryCollection.new
end
10個の機密情報を登録済み = lambda {
@entries = (1..10).map { |i|
Entry.new(id: i, name: "no#... |
require 'bolt/transport/base'
require 'bolt/transport/sudoable'
require 'bolt/transport/ssh/connection'
require 'shellwords'
class BoltSSH < Bolt::Transport::SSH::Connection
# Adapted from Bolt::Transport::SSH::Connection.execute with output copied to
# $stdout/$stderr. Returns an exit code instead of Bolt::Result... |
class RenameRecurrenceFields < ActiveRecord::Migration
def change
rename_column :recurrences, :next, :next_at
rename_column :recurrences, :starting, :starting_at
rename_column :recurrences, :until, :until_at
end
end
|
require "spec_helper"
describe Web::MessagesController do
describe "routing" do
it "routes to #index" do
get("/web/messages").should route_to("web/messages#index")
end
it "routes to #new" do
get("/web/messages/new").should route_to("web/messages#new")
end
it "routes to #show" do
... |
task :setup do
puts "Setting up..."
$engines.each do |engine|
engine.setup
end
end
|
class Comment
attr_accessor :user_name, :comment_text
def initialize(user_name, comment_text)
@user_name = user_name
@comment_text = comment_text
end
def to_s
"User: #{@user_name} Comment: #{@comment_text}"
end
end |
module Cohort
class Senior
attr_reader :retro_months, :current_month, :min_age
def initialize(retro_months: 4, current_month:)
@retro_months = retro_months
@current_month = current_month
end
def file_id
'9075'
end
def dataset
HSP::DB[:sm1sg1].
with(:sm1, HS... |
class ChangeJoinTableName < ActiveRecord::Migration
def change
rename_table :plans_users, :plan_users
end
end
|
#!/usr/bin/ruby
require 'rubygems'
#require 'activesupport'
require 'mail'
require 'optparse'
def sendMail(m_subject,m_from,m_to,body_file,type)
m = Mail.new do
from from m_from
to m_to
subject m_subject
html_part do
content_type 'text/html; charset=UTF-8'
body File.read(body_file)
end... |
class UsersController < ApplicationController
def index
@users = User.all
end
def show
@user = User.find_by_id(params[:id])
return unless @user
flash[:notice] = 'User not found.'
redirect_to users_path
end
def profile
unless current_user
flash[:notice] = 'Please log in to edit ... |
class PropertiesController < ApplicationController
before_filter :action_path
def action_path; @action = params[:action].dup.prepend("can_").concat("?").to_sym end
def authorized?(resource) error_redirect unless resource.send(@action,current_member,@team.id) end
before_filter :read_path
def read_path
@te... |
Rails.application.routes.draw do
root 'invites#new'
resources :invites
devise_for :users
resources :users
resources :ads, only: [:create, :update, :edit, :destroy]
get 'authorize' => 'auth#gettoken'
get 'authorize_session' => 'auth#getsession'
get 'google_authorize' => 'auth#google_authorize'
post ... |
class AddSpaceIdToDescriptions < ActiveRecord::Migration[5.0]
def change
add_reference :descriptions, :space, index: true
end
end
|
# Definition
#
# Extend the definition class to have three different methods:
# 1. add_word(word, definition), should store a word and definition
# 2. lookup(word), should return a definition
# 3. total_words, should return the total number of words
#
# Example:
# definition = Definition.new
# definition.add... |
require "libxml"
require File.dirname(__FILE__) + '/../test_helper'
class MatchesTest < ActiveSupport::TestCase
context "An instance of Match" do
setup do
@match = Factory(:match)
end
should "know the winning movie" do
movie_1, movie_2 = [Factory(:movie), Factory(:movie)]
option_1 = ... |
# 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 rails db:seed command (or created alongside the database with db:setup).
#
# Examples:
#
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
# Ch... |
class Like
attr_reader :drinker, :beer
def initialize drinker, beer
@drinker = drinker
@beer = beer
end
def add_to_db
# puts ("INSERT INTO `likes` VALUES('#{@drinker}', '#{@beer})")
$client.query("INSERT INTO `likes` VALUES('#{@drinker}', '#{@beer.gsub("'","''")}')")
end
def self.add_ze_l... |
module Kuhsaft
class BrickTypeFilter < SimpleDelegator
def empty?
!(respond_to?(:user_can_add_childs?) && user_can_add_childs? && !allowed.empty?)
end
def allowed
if Kuhsaft::BrickType.enabled.count.zero?
[]
elsif allowed_brick_types.empty?
Kuhsaft::BrickType.enabled
... |
class PostsController < ApplicationController
before_action :login_required
PER = 10
def index
@posts = Post.page(params[:page]).per(PER).order(created_at: :desc)
end
def new
@post = current_user.posts.new(user_id: @current_user.id)
end
def create
@post = current_user.posts.new(post_params)
if @post.sav... |
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64"
config.vm.provider :vmware_fusion do |v|
v.vmx['memsize'] = 256
end
sc... |
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
factory :song do
title "Hello!"
author "EastNewSound"
sequence(:plug_id) { |n| "1:coolid#{n}" }
duration 233
end
end
|
require_relative 'bike'
class DockingStation
attr_reader :bikes
def initialize
@bikes = []
end
def release_bike
while true
bike = Bike.new
return bike if bike.working?
end
end
def dock(bike)
@bikes << bike
end
def examine_bikes(selection)
# puts "There are #{@bikes.l... |
class User < ApplicationRecord
# Userインスタンスのレコードを保存する前に小文字に変換
before_save { self.email.downcase! }
# 空を許可しない presence: true
# 長さは50文字 length: { maximum: 50 }
validates :name, presence: true, length: { maximum: 50 }
# 重複を許さない uniqueness:
# 大文字と小文字を区別しない case_sensitive: false
# 正規表現 format: ..
val... |
class CreatePages < ActiveRecord::Migration
def self.up
create_table :pages do |t|
t.column :title, :string
t.column :body, :text
t.column :section_id, :integer
t.column :name, :string
t.timestamps
end
end
def self.down
drop_table :pages
... |
module Wunderlist
class List
ATTRIBUTES = [
:id,
:deleted,
:inbox,
:name,
:online_id,
:position,
:shared,
:user_id,
:version,
]
attr_accessor *ATTRIBUTES
alias :deleted? :deleted
alias :inbox? :inbox
alias :shared? :shared
def onlin... |
require 'net/http'
require 'json'
class Identity < ActiveRecord::Base
belongs_to :user
validates_presence_of :uid, :provider
validates_uniqueness_of :uid, :scope => :provider
scope :by_google_account, ->(account_id) {
joins(:user)
.where('users.account_id' => account_id)
.where(provider: 'google_o... |
class CreateUserGroups < ActiveRecord::Migration[5.1]
def change
create_table :user_groups, mysql_options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
t.integer :user_id, default: 0
t.integer :group_id, default: 0
t.integer :user_admin_group_id, default: 0
t.timestamps
end
end
end
|
# frozen_string_literal: true
require_relative "game_terminal_ui"
# rubocop:disable Metrics/MethodLength
# rubocop:disable Metrics/AbcSize
module MainTerminalUI
MENU_OPTIONS = {
1 => "NEW GAME",
2 => "OPTIONS",
3 => "CREDITS",
4 => "EXIT"
}.freeze
class << self
def show_menu
puts
... |
require "spec_helper"
RSpec.describe ExchangeRateJt do
let(:pstore_connection_string) { double('PStore connection string') }
it 'has a version number' do
expect(ExchangeRateJt::VERSION).not_to be nil
end
describe '.configure' do
before do
setup_config
end
it 'allows the gem to be confi... |
FactoryBot.define do
factory :history_buy do
postal_code {'123-4567'}
delivery_area_id{6}
municipality{'さいたま市'}
address{'宮区3-3-3'}
building{'都キャメル'}
phone_number{'11122223333'}
token {"tok_abcdefghijk00000000000000000"}
end
end
|
ActiveAdmin.register Artist do
permit_params :artistName
index do
column :artistName
column "Creation Date", :created_at
column "Last Update", :updated_at
actions
end
# See permitted parameters documentation:
# https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.... |
FactoryBot.define do
factory :invoice do
customer_id { Customer.order('RANDOM()').first.id }
merchant_id { Merchant.order('RANDOM()').first.id }
status { rand(0...3) }
end
end |
require_relative '../lib/bike'
class DockingStation
attr_accessor :bikes
# Challenge 16 passed
DEFAULT_CAPACITY = 20
def initialize(capacity = DEFAULT_CAPACITY)
@bikes = []
@capacity = capacity
end
def release_bike(bike)
# check if bike is broken or not, don't release if broken
@bikes.re... |
json.array!(@calendars) do |calendar|
json.extract! calendar, :id, :name, :slug
json.url calendar_url(calendar, format: :json)
end
|
require 'rails_helper'
feature 'User goes to task list' do
include Warden::Test::Helpers
Warden.test_mode!
before do
@user = create(:user)
login_as(@user, scope: :user)
end
scenario 'sees task description' do
create(:task, description: 'task description', user: @user)
visit tasks_path
... |
class AddSlugToAssociations < ActiveRecord::Migration
def change
add_column :associations, :slug, :string
add_index :associations, :slug
Association.find_each(&:save)
end
end
|
class Liquider::Parser < Liquider::GeneratedParser
attr_reader :tags, :scanner
def initialize(tags, scanner)
@tags, @scanner = tags, scanner
@injected_tokens = []
@yydebug = true
end
def parse
yyparse self, :tokens
end
private
attr_reader :injected_tokens
def inject_token(token)
... |
module RSpec
module Matchers
class Match
include BaseMatcher
def matches?(actual)
super(actual).match(expected)
end
end
# Given a Regexp or String, passes if actual.match(pattern)
#
# @example
#
# email.should match(/^([^\s]+)((?:[-a-z0-9]+\.)+[a-z]{2,})$/i)
... |
class AddCourseIdToStudents < ActiveRecord::Migration
def change
add_column :students,:course_id,:integer
end
end
|
require 'spec_helper'
describe "en.wikipedia.org" do
before(:all) do
Capybara.app_host = 'http://en.wikipedia.org/'
end
before(:each) do
visit 'wiki/Main_Page'
end
it "has a random article link" do
page.should have_link("Random article")
end
it "should have a search field" do
page.sho... |
require 'spec_helper'
require 'capybara/rspec'
Capybara.app = Application
feature 'User Registration and Login' do
scenario 'User registers and logs in' do
visit '/'
expect(page).to have_content 'Login to Check Order Status'
click_link('Register')
fill_in('email', with: "joe@example.com")
fill_... |
require 'bcrypt'
class User
include DataMapper::Resource
property :id, Serial
property :email, String, :unique => true, :message => "This email is already taken"
property :password_digest, Text
property :password_confirmation, Text
property :password_token, Text
property :token_time_stamp, String
attr_read... |
=begin
input: one or two numbers of descending value
output: beers on the wall one number then one number minus 1
if zero get more bottles
1. def a create_verse method that accepts an integer
2. if integer == 0, put get more bottles
3. else return a string with the bottles on the wall
=end
class BeerSong
... |
require_relative 'application_controller'
require_relative '../model/evaluate_retrieve.rb'
class EvaluateController < ApplicationController
#Displays 10 messages for classifier by default using the evaluate view
get '/evaluate' do
count = 10
retriever = EvaluateRetrieve.new()
@messages = retriever.RetrieveCla... |
class EmoticonSerializer < ActiveModel::Serializer
attributes :object_type, :id, :name, :image_url
end
|
require "spec_helper"
require "BankAccount"
describe BankAccount do
describe "#check_balance" do
it "deposite behavior" do
account = BankAccount.new(10000)
totalBalance = account.deposite(5000)
expect(totalBalance).to eq(15000)
end
it "withdraw behavior" do
account = B... |
#!/usr/bin/env ruby
require 'time'
require 'optparse'
# Runs a block of code without warnings.
def silence_warnings(&block)
warn_level = $VERBOSE
$VERBOSE = nil
result = block.call
$VERBOSE = warn_level
result
end
def synch(auto=true, full=false, verbose=false)
exchanger = Exchanger.new
google_calendar... |
FactoryGirl.define do
sequence(:page_id) {|n| "FB_Page#{n}"}
factory :provider_facebook_page do
fb_page_id {generate(:page_id)}
end
end
|
class RelationshipsController < ApplicationController
before_action :authorize_signed_in!
def create
@followed_user = User.find(params[:followed_id])
@relationship = current_user.follow(@followed_user)
send_notification
render json: {}
end
def destroy
@relationship = Relationship.find(par... |
# This is a service object that will create a player and add that player
# to a room based on a URL slug of the room. The URL slug is just a
# URL frindly version of the game room name.
class CreatePlayerService
FAILURE_HASH = { success: false, errors: ['Game room not found'] }.freeze
class << self
def creat... |
module GeoFoo
module ActiveRecord
def self.included(base)
base.extend ClassMethods
base.send(:include, InstanceMethods)
end
end
module ClassMethods
def add_geo_foo
self.class_eval do
def self.within_radius lat, lon, radius
scoped(
:conditions => [
... |
require 'yt/models/base'
module Yt
module Models
# Provides methods to interact with YouTube ContentID assetSnippets.
# @see https://developers.google.com/youtube/partner/docs/v1/assetSearch
class AssetSnippet < Base
attr_reader :auth
def initialize(options = {})
@data = options.fetc... |
require 'kintone/command'
require 'kintone/api'
class Kintone::Command::Record
PATH = "record"
def initialize(api)
@api = api
@url = @api.get_url(PATH)
end
def get(app, id)
@api.get(@url, {:app => app, :id => id})
end
def create(app, record)
@api.post(@url, {:app => app, :record => recor... |
# frozen_string_literal: true
require 'stannum'
module Spec
class FormatConstraint < Stannum::Constraint
NEGATED_TYPE = 'spec.constraints.right_format'
TYPE = 'spec.constraints.wrong_format'
def initialize(expected)
super(
negated_type: NEGATED_TYPE,
type: TYPE
) { ... |
require 'sinatra'
# before do
# content_type :txt
# end
# get '/' do
# # Inform consumers that the content should be cached for one hour
# headers "Cache-Control" => "public, must-revalidate, max-age=3600",
# "Expires" => Time.at(Time.now.to_i + (60 * 60)).to_s
# # (Refreshing the page won't update the time... |
require 'jekyll'
module Guard
class JekyllPlus < Plugin
class Config
EXTS = %w(md mkd mkdn markdown textile html haml slim xml yml sass scss)
def initialize(options)
@options = {
extensions: [],
config: ['_config.yml'],
serve: false,
rack_config: nil,
... |
# frozen_string_literal: true
module <%= ROCKET_CLASS_NAME %>
# <%= MODULE_CLASS_NAME %> Model
class <%= MODULE_CLASS_NAME %> < ApplicationRecord
include ActivityHistory
include CloneRecord
include Uploadable
include Downloadable
include Sortable
include Searchable
<%- ATTRIBUTES.each d... |
#Write a method that takes a positive integer or zero, and converts it to a string representation.
DIGITS = {
0 => '0',
1 => '1',
2 => '2',
3 => '3',
4 => '4',
5 => '5',
6 => '6',
7 => '7',
8 => '8',
9 => '9',
}
def integer_to_string(integer)
string_integer = ""
loop do
integer, remainder ... |
# rubocop:disable Metrics/BlockLength
FactoryBot.define do
factory :project do
start_date { Date.today }
end_date { Date.today + 1 }
city { build(:low_cost_city) }
trait :low_cost do
city { build(:low_cost_city) }
end
trait :high_cost do
city { build(:high_cost_city) }
end
... |
require 'binary_struct'
require 'disk/DiskProbe'
class MiqDisk
attr_accessor :diskType, :dInfo, :blockSize, :pvObj, :fs
attr_reader :lbaStart, :lbaEnd, :startByteAddr, :endByteAddr, :partType, :partNum, :size, :hwId, :logName
def self.getDisk(dInfo, probes = nil)
$log.debug "MiqDisk::getDisk: baseOnly = #... |
require 'spec_helper'
describe Circuit::Storage do
include SpecHelpers::StoresCleaner
context "undefined site store" do
it do
expect { Circuit.site_store }.
to raise_error(Circuit::Storage::InstanceUndefinedError, "Storage instance is undefined.")
end
end
context "undefined node store" ... |
class BlogsController < ApplicationController
before_action :set_blog, only: [:show]
# before_action :base_data, only: [:show]
# GET /blogs
# GET /blogs.json
def index
if params[:category_id].present?
# @blogs = Blog.submitted.where(category_id: params[:category_id]).page(params[:page])
@blog... |
module ApplicationHelper
def user_name
begin
user = User.find(session[:user_id])
if user.nickname
return user.nickname
elsif user.email
return user.email
else
return "#{user.provider} user #{user.uid}"
end
rescue ActiveRecord::RecordNotFound
return "... |
class AddScoreToHexaCycles < ActiveRecord::Migration
def change
add_column :hexa_cycles, :log, :text
add_column :hexa_cycles, :intents, :integer
add_column :hexa_cycles, :fails, :integer
end
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.