repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
thamilton2014/chef-repo | cookbooks/phpcs/recipes/pear.rb | #
# Cookbook Name:: phpcs
# Recipe:: pear
#
# Copyright 2013-2014, Escape Studios
#
include_recipe "php"
#PHP Extension and Application Repository PEAR channel
pearhub_chan = php_pear_channel "pear.php.net" do
action :update
end
#upgrade PEAR
php_pear "PEAR" do
channel pearhub_chan.channel_name
action :upgrade
e... |
thamilton2014/chef-repo | roles/selenium.rb | name 'selenium'
description 'This role applies selenium hub recipes to a server'
hub_env = [
'recipe[start-hub]'
]
node_env = [
'recipe[start-node]'
]
default_env = [
]
env_run_lists(
'_default' => default_env,
'hub' => hub_env,
'node' => node_env
) |
thamilton2014/chef-repo | cookbooks/start-node/recipes/default.rb | #
# Cookbook Name:: start-node
# Recipe:: default
#
# Copyright 2015, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
version = '2.44'
selenium = "selenium-server-standalone-#{version}.0.jar"
server = 'http://10.44.73.64:4444/grid/register'
mac_chrome_driver = 'chromedriver'
mac_safari_driver = '/A... |
thamilton2014/chef-repo | cookbooks/phpcs/attributes/composer.rb | #
# Cookbook Name:: phpcs
# Attributes:: composer
#
# Copyright 2013-2014, Escape Studios
#
default['phpcs']['prefix'] = "/usr/bin" |
thamilton2014/chef-repo | cookbooks/composer/attributes/default.rb | #
# Cookbook Name:: composer
# Attributes:: default
#
# Copyright 2012-2014, Escape Studios
#
include_attribute 'php'
if node['platform'] == 'windows'
default['composer']['url'] = 'https://getcomposer.org/Composer-Setup.exe'
default['composer']['install_dir'] = 'C:\\ProgramData\\ComposerSetup'
default['composer... |
thamilton2014/chef-repo | cookbooks/myairwatch/recipes/default.rb | <filename>cookbooks/myairwatch/recipes/default.rb
#
# Cookbook Name:: myairwatch
# Recipe:: default
#
# Copyright 2015, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
file = 'sharedlibs-unit_tests-lastest.tar'
repo = "http://10.44.72.81:8081/artifactory/sharedlibs/#{file}"
folder = '/opt/myairwatch/... |
thamilton2014/chef-repo | cookbooks/pdepend/recipes/composer.rb | <filename>cookbooks/pdepend/recipes/composer.rb
#
# Cookbook Name:: pdepend
# Recipe:: composer
#
# Copyright 2013, Escape Studios
#
include_recipe "composer"
pdepend_dir = "#{Chef::Config[:file_cache_path]}/pdepend"
directory "#{pdepend_dir}" do
owner "root"
group "root"
mode "0755"
action :create
e... |
thamilton2014/chef-repo | cookbooks/pdepend/recipes/phar.rb | #
# Cookbook Name:: pdepend
# Recipe:: phar
#
# Copyright 2013, Escape Studios
#
if node[:pdepend][:install_dir] != ""
pdepend_dir = node[:pdepend][:install_dir]
else
pdepend_dir = "#{Chef::Config[:file_cache_path]}/pdepend"
end
directory "#{pdepend_dir}" do
owner "root"
group "root"
... |
thamilton2014/chef-repo | cookbooks/phpmd/attributes/default.rb | #
# Cookbook Name:: phpmd
# Attributes:: default
#
# Copyright 2013, Escape Studios
#
default[:phpmd][:install_method] = "pear"
default[:phpmd][:version] = "latest" |
thamilton2014/chef-repo | environments/hub.rb | <gh_stars>0
name "hub"
description "The selenium hub environment" |
thamilton2014/chef-repo | cookbooks/myairwatch-install-user/recipes/default.rb | #
# Cookbook Name:: myairwatch-install-user
# Recipe:: default
#
# Copyright 2015, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
users = {
:thamilton => '<NAME>'
}
users.each do |username, fullname|
execute 'Installing users' do
command "adduser #{username}"
not_if "cat /etc/passwd ... |
thamilton2014/chef-repo | cookbooks/phpmd/recipes/default.rb | <reponame>thamilton2014/chef-repo
#
# Cookbook Name:: phpmd
# Recipe:: default
#
# Copyright 2013, Escape Studios
#
case node[:phpmd][:install_method]
when "pear"
include_recipe "phpmd::pear"
when "composer"
include_recipe "phpmd::composer"
when "phar"
include_recipe "phpmd::phar"
e... |
thamilton2014/chef-repo | cookbooks/pdepend/metadata.rb | <reponame>thamilton2014/chef-repo<filename>cookbooks/pdepend/metadata.rb
name "pdepend"
maintainer "Escape Studios"
maintainer_email "<EMAIL>"
license "MIT"
description "Installs/Configures pdepend"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version ... |
thamilton2014/chef-repo | cookbooks/phpmd/attributes/phar.rb | <reponame>thamilton2014/chef-repo
#
# Cookbook Name:: phpmd
# Attributes:: phar
#
# Copyright 2013, Escape Studios
#
default[:phpmd][:phar_url] = "http://static.phpmd.org/php/latest/phpmd.phar"
default[:phpmd][:install_dir] = "" |
thamilton2014/chef-repo | cookbooks/phpmd/metadata.rb | <gh_stars>0
name "phpmd"
maintainer "Escape Studios"
maintainer_email "<EMAIL>"
license "MIT"
description "Installs/Configures phpmd"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.0.5"
%w{ debian ubuntu redhat centos fedora scientific amazo... |
thamilton2014/chef-repo | cookbooks/start-hub/recipes/default.rb | <filename>cookbooks/start-hub/recipes/default.rb
#
# Cookbook Name:: start-hub
# Recipe:: default
#
# Copyright 2015, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
version = '2.44'
selenium = "selenium-server-standalone-#{version}.0.jar"
selenium_dir = '/opt/selenium'
directory selenium_dir do
a... |
thamilton2014/chef-repo | environments/dev.rb | <reponame>thamilton2014/chef-repo
name "dev"
description "The development environment" |
thamilton2014/chef-repo | cookbooks/phpcs/recipes/default.rb | <filename>cookbooks/phpcs/recipes/default.rb
#
# Cookbook Name:: phpcs
# Recipe:: default
#
# Copyright 2013-2014, Escape Studios
#
case node['phpcs']['install_method']
when "pear"
include_recipe "phpcs::pear"
when "composer"
include_recipe "phpcs::composer"
end
include_recipe "phpcs::coding-standard" |
thamilton2014/chef-repo | cookbooks/phpmd/recipes/phar.rb | <reponame>thamilton2014/chef-repo
#
# Cookbook Name:: phpmd
# Recipe:: phar
#
# Copyright 2013, Escape Studios
#
include_recipe "pdepend::phar"
if node[:phpmd][:install_dir] != ""
phpmd_dir = node[:phpmd][:install_dir]
else
phpmd_dir = "#{Chef::Config[:file_cache_path]}/phpmd"
end
directory "#... |
thamilton2014/chef-repo | cookbooks/phpmd/recipes/pear.rb | #
# Cookbook Name:: phpmd
# Recipe:: pear
#
# Copyright 2013, Escape Studios
#
include_recipe "php"
include_recipe "pdepend::pear"
#PHP Extension and Application Repository PEAR channel
pearhub_chan = php_pear_channel "pear.php.net" do
action :update
end
#upgrade PEAR
php_pear "PEAR" do
channel pearhub_chan.ch... |
thamilton2014/chef-repo | cookbooks/phpcs/attributes/coding-standard.rb | <reponame>thamilton2014/chef-repo
#
# Cookbook Name:: phpcs
# Attributes:: coding-standard
#
# Copyright 2013-2014, Escape Studios
#
default['phpcs']['coding_standards'] = {} |
thamilton2014/chef-repo | cookbooks/pdepend/recipes/pear.rb | #
# Cookbook Name:: pdepend
# Recipe:: pear
#
# Copyright 2013, Escape Studios
#
include_recipe "php"
#PHP Extension and Application Repository PEAR channel
php_pear_channel "pear.php.net" do
action :update
end
#upgrade PEAR
php_pear "PEAR" do
action :upgrade
end
#pdepend PEAR channel
pearhub_chan = php_pear_... |
thamilton2014/chef-repo | roles/base.rb | name "base"
description 'Base role applied to all nodes'
run_list(
'recipe[git]',
'recipe[build-essential]',
'recipe[myairwatch-install-user]'
)
|
thamilton2014/chef-repo | cookbooks/phpmd/attributes/composer.rb | #
# Cookbook Name:: phpmd
# Attributes:: composer
#
# Copyright 2013, Escape Studios
#
default[:phpmd][:prefix] = "/usr/bin" |
thamilton2014/chef-repo | cookbooks/myairwatch/metadata.rb | name 'myairwatch'
maintainer 'YOUR_COMPANY_NAME'
maintainer_email 'YOUR_EMAIL'
license 'All rights reserved'
description 'Installs/Configures myairwatch'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.1.0'
|
thamilton2014/chef-repo | cookbooks/phpmd/recipes/composer.rb | #
# Cookbook Name:: phpmd
# Recipe:: composer
#
# Copyright 2013, Escape Studios
#
include_recipe "composer"
include_recipe "pdepend::composer"
phpmd_dir = "#{Chef::Config[:file_cache_path]}/phpmd"
directory "#{phpmd_dir}" do
owner "root"
group "root"
mode "0755"
action :create
end
#figure out what ... |
jonpearse/simple_ar_localization | lib/simple_ar_localizer.rb | require 'simple_ar_localizer/version'
require 'simple_ar_localizer/map'
require 'simple_ar_localizer/localizer'
module SimpleARLocalizer
# Convenience accessort to SimpleARLocalizer::Localizer::transform()
def self.transform( model_name, language, l10n_data )
Localizer.transform( model_name, language, l10n_d... |
jonpearse/simple_ar_localization | lib/simple_ar_localizer/version.rb | module SimpleARLocalizer
VERSION = '1.0.1'
end
|
jonpearse/simple_ar_localization | lib/simple_ar_localizer/localizer.rb | <filename>lib/simple_ar_localizer/localizer.rb
require 'singleton'
module SimpleARLocalizer
# Localizer provides a slightly easier way of hooking into the depths of Rails’ Internationalization functionality.
#
# By default, it allows you to specify the human name (with plurality), human attribute names, and any... |
jonpearse/simple_ar_localization | lib/simple_ar_localizer/map.rb | module SimpleARLocalizer
# Default mapping from inbound localisation data to I18n keys. These can be supplemented/overridden via the
# <tt>Rails.application.config.ar_localization_rules</tt> configuration variable.
DEFAULT_MAP = {
# per-model stuff
'name': 'activerecord.models.%{model}',
'n... |
jonpearse/simple_ar_localization | simple_ar_localizer.gemspec | <filename>simple_ar_localizer.gemspec<gh_stars>0
# encoding: UTF-8
require File.expand_path('../lib/simple_ar_localizer/version', __FILE__)
Gem::Specification.new do |gem|
gem.name = 'simple_ar_localizer'
gem.summary = 'Easier localisation for ActiveRecord models.'
gem.description = 'Provides a... |
espen/zoom_rb | lib/zoom/actions/sip_audio.rb | # frozen_string_literal: true
module Zoom
module Actions
module SipAudio
def sip_trunks_get(*args)
params = Zoom::Params.new(Utils.extract_options!(args))
params.require(:account_id)
Utils.parse_response self.class.get("/accounts/#{params[:account_id]}/sip_trunk/trunks", headers: re... |
espen/zoom_rb | lib/zoom/actions/webinar.rb | <reponame>espen/zoom_rb
# frozen_string_literal: true
module Zoom
module Actions
module Webinar
RECURRENCE_KEYS = %i[type repeat_interval weekly_days monthly_day monthly_week
monthly_week_day end_times end_date_time].freeze
SETTINGS_KEYS = %i[host_video panelists_video prac... |
espen/zoom_rb | lib/zoom/actions/recording.rb | <gh_stars>10-100
# frozen_string_literal: true
module Zoom
module Actions
module Recording
RECORDING_SETTINGS_KEYS = %i[share_recording recording_authentication
authentication_option authentication_domains viewer_download password
on_dem... |
espen/zoom_rb | lib/zoom/actions/user.rb | <filename>lib/zoom/actions/user.rb
# frozen_string_literal: true
module Zoom
module Actions
module User
def user_list(*args)
params = Zoom::Params.new(Utils.extract_options!(args))
params.permit(%i[status page_size role_id page_number include_fields next_page_token])
response = self... |
espen/zoom_rb | lib/zoom/actions/groups.rb | <gh_stars>10-100
# frozen_string_literal: true
module Zoom
module Actions
module Groups
def groups_list(*_args)
Utils.parse_response self.class.get('/groups', headers: request_headers)
end
def groups_get(*args)
params = Zoom::Params.new(Utils.extract_options!(args))
par... |
espen/zoom_rb | lib/zoom/version.rb | <reponame>espen/zoom_rb<gh_stars>10-100
# frozen_string_literal: true
module Zoom
VERSION = '0.11.0'
end
|
notonthehighstreet/swagger-docs | spec/spec_helper.rb | require "swagger/docs"
require "ostruct"
require "json"
require 'pathname'
DEFAULT_VER = Swagger::Docs::Generator::DEFAULT_VER
RSpec.configure do |config|
config.expect_with :rspec do |c|
c.syntax = :expect
end
config.color = true
config.before(:each) do
Swagger::Docs::Config.base_api_controller = ni... |
net-engine/mimemagic | test/mimemagic_test.rb | require 'minitest/autorun'
require 'mimemagic'
require 'stringio'
require 'forwardable'
class TestMimeMagic < Minitest::Test
# Do deep copy for constants of initial state.
INIT_EXTENSIONS = Marshal.load(Marshal.dump(MimeMagic::EXTENSIONS))
INIT_TYPES = Marshal.load(Marshal.dump(MimeMagic::TYPES))
INIT_MAGIC = ... |
geekq/locale_selector | generators/gettext_hacks/templates/gettext_hacks.rb | module GetText
# Modification of the original gettext.
#
# By default all the translated texts from the po files are also html escaped
# so translators can not break the application by introducing less-than
# and ampersand characters or by trying to incorporate the <blink> tag ;-)
#
# It is possible thoug... |
geekq/locale_selector | test/TestApp/test/integration/active_record_gathering_test.rb | <filename>test/TestApp/test/integration/active_record_gathering_test.rb
require 'test_helper'
require 'fileutils'
require 'locale_selector'
class ActiveRecordGatheringTest < Test::Unit::TestCase
def self.po_name()
# puts "po_name: #{File.expand_path(File.join(Dir.pwd, "po/default.pot"))}"
File.expand_path(Fi... |
geekq/locale_selector | test/TestApp/config/initializers/include_plugin_initializer.rb | <filename>test/TestApp/config/initializers/include_plugin_initializer.rb
require File.join(File.dirname(__FILE__), '../../../../generators/gettext_hacks/templates/gettext_hacks.rb')
|
geekq/locale_selector | test/TestApp/app/models/human_resources/employee.rb | class HumanResources::Employee < ActiveRecord::Base
end
|
geekq/locale_selector | lib/locale_selector/gettext_tasks.rb | require File.join(File.dirname(__FILE__), '../locale_selector.rb')
require 'gettext'
require 'gettext/utils'
require 'activesupport'
require 'activerecord'
puts "Loading active_record parsing hacks in gettext_tasks.rb"
require 'gettext/rgettext'
require 'gettext/parser/active_record'
include GetText
def log(msg)
pu... |
geekq/locale_selector | lib/locale_selector.rb | <gh_stars>1-10
require 'uri'
=begin rdoc
= Usage
== Controller
In your controllers or in the application controller
require 'locale_selector'
and use ControllerClassMethods#offer_locales:
offer_locales :en_UK, :en_ZA, :de, :ru
You can use different text domains in different parts of your application,
if your... |
geekq/locale_selector | test/TestApp/test/unit/accept_language_parser_test.rb | <reponame>geekq/locale_selector
require 'test_helper'
require 'locale_selector'
class AcceptLanguageParserTest < Test::Unit::TestCase
include LocaleSelector::ControllerInstanceMethods
def test_parse
assert_equal [['de-de', 1], ['en-us', 0.8], ['en', 0.5], ['ru', 0.3]],
parse_accept_language('de-de,en-us... |
geekq/locale_selector | test/TestApp/config/routes.rb | <reponame>geekq/locale_selector
ActionController::Routing::Routes.draw do |map|
# The priority is based upon order of creation: first created -> highest priority.
map.root :controller => "hello"
# Install the default routes as the lowest priority.
# Note: These default routes make all actions in every control... |
geekq/locale_selector | locale_selector.gemspec | SPEC = Gem::Specification.new do |s|
s.name = 'locale_selector'
s.version = '1.93.1'
s.summary = 'Wraps and improves ruby-gettext, provides UI for locale selection, maintains user preferences.'
s.description = s.summary
s.author = '<NAME>'
s.email = '<EMAIL>'
s.homepage = 'http://github.com/geekq/locale_s... |
geekq/locale_selector | test/TestApp/test/functional/inheritance_test.rb | <gh_stars>1-10
require File.dirname(__FILE__) + '/../test_helper'
# BTW: MyController = Class.new(ActionController::Base) {}
# does not work. Because of some Rails changes on the Class class?
class MyController < ActionController::Base
offer_locales :fi, :ru, :domain => 'default'
end
class MySpecialController < MyC... |
geekq/locale_selector | generators/gettext_hacks/gettext_hacks_generator.rb | class GettextHacksGenerator < Rails::Generator::Base
def initialize(*runtime_args)
super(*runtime_args)
end
def manifest
record do |m|
m.directory File.join('config/initializers')
m.template 'gettext_hacks.rb', File.join('config/initializers', "gettext_hacks.rb")
end
end
end |
geekq/locale_selector | init.rb | <filename>init.rb
require 'locale_selector'
|
sboagibm/fluent-plugin-amqp | fluent-plugin-amqp.gemspec | # Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = "fluent-plugin-amqp"
s.version = File.read("VERSION")
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respon... |
sboagibm/fluent-plugin-amqp | test/plugin/test_out_plugin-headers.rb | # encoding: utf-8
require_relative '../helper'
require 'fluent/test'
require 'fluent/test/driver/output'
require 'fluent/plugin/out_amqp'
require 'bunny-mock'
class AMPQOutputTestForHeaders < Test::Unit::TestCase
attr_reader :driver
def setup
Fluent::Test.setup
BunnyMock.use_bunny_queue_pop_api = true
... |
lengarvey/webpack-rails | lib/webpack/rails/environment.rb | <reponame>lengarvey/webpack-rails<gh_stars>10-100
module Webpack
module Rails
class Environment < Rack::File
def call(env)
`webpack --config config/webpack.development.js`
super(env)
end
end
end
end
|
lengarvey/webpack-rails | lib/webpack/rails.rb | require 'webpack/rails/version'
if defined? Rails::Railtie
require 'webpack/railtie'
end
|
lengarvey/webpack-rails | lib/webpack/rails/helper.rb | require 'action_view'
module Webpack
module Rails
module Helper
include ActionView::Helpers::AssetUrlHelper
include ActionView::Helpers::AssetTagHelper
def stylesheet_link_tag(*sources)
options = sources.extract_options!.stringify_keys
if options['debug'] != false
so... |
lengarvey/webpack-rails | lib/webpack/railtie.rb | require 'rails'
require 'rails/railtie'
require 'webpack/rails/helper'
require 'webpack/rails/environment'
module Webpack
class Railtie < ::Rails::Railtie
config.after_initialize do |app|
ActiveSupport.on_load(:action_view) do
include Webpack::Rails::Helper
end
app.routes.prepend do
... |
MediaGeniX/Eddy | app/controllers/hr/reports_controller.rb | class Hr::ReportsController < ApplicationController
before_action :authenticate_user!
def new
authorize [:hr, :report]
end
def create
authorize [:hr, :report]
params = report_params
start_date = params[:start_date] || Date.new(1900)
end_date = params[:end_date] || Date.new(2100)
re... |
MediaGeniX/Eddy | app/controllers/welcome_controller.rb | class WelcomeController < ApplicationController
def index
season = Season.default
@yellow_jersey = Trip.where(trip_date: season.start_date..season.end_date).group(:user).order('sum_distance_in_meter DESC').sum(:distance_in_meter)
end
def letsencrypt
render text: "<KEY>"
end
end
|
MediaGeniX/Eddy | app/policies/user_policy.rb | <reponame>MediaGeniX/Eddy
class UserPolicy < ApplicationPolicy
def create?
show?
end
def recent?
show?
end
def index?
show?
end
def show?
user.id == record.id
end
def update?
show?
end
def edit?
show?
end
end
|
MediaGeniX/Eddy | db/migrate/20160315193922_create_trips.rb | class CreateTrips < ActiveRecord::Migration[4.2]
def change
create_table :trips do |t|
t.date :trip_date, null: false
t.references :route
t.references :user, null: false
t.string :alias, null: false
t.integer :distance_in_meter, null: false
... |
MediaGeniX/Eddy | db/seeds.rb | <filename>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... |
MediaGeniX/Eddy | app/helpers/trips_helper.rb | # == Schema Information
#
# Table name: trips
#
# id :integer not null, primary key
# trip_date :date not null
# route_id :integer
# user_id :integer not null
# alias :string not null
# distance_in_meter :integer ... |
MediaGeniX/Eddy | app/helpers/application_helper.rb | <gh_stars>0
module ApplicationHelper
def form_errors(object)
render partial: 'form_errors', locals: { object: object }
end
def meter_to_kilometer(meter)
meter / 1000.0
end
def pretty_number(number)
number_with_delimiter(number)
end
def pretty_date(date)
date.strftime("%d-%m-%Y")
end
e... |
MediaGeniX/Eddy | app/policies/hr/report_policy.rb | <filename>app/policies/hr/report_policy.rb
class Hr::ReportPolicy < ApplicationPolicy
def can?
user.admin
end
def new?
can?
end
def create?
can?
end
end |
MediaGeniX/Eddy | app/models/season.rb | <reponame>MediaGeniX/Eddy<filename>app/models/season.rb
# == Schema Information
#
# Table name: seasons
#
# id :integer not null, primary key
# start_date :date
# end_date :date
# default :boolean default(FALSE), not null
# name :string ... |
MediaGeniX/Eddy | db/migrate/20160313193311_create_users.rb | <filename>db/migrate/20160313193311_create_users.rb
class CreateUsers < ActiveRecord::Migration[4.2]
def change
create_table :users do |t|
t.string :name, null: false
t.date :birthdate, null: false
t.integer :location, null: false, default: 0
t.integer :sex, null: false, defaul... |
MediaGeniX/Eddy | app/models/route.rb | <filename>app/models/route.rb<gh_stars>0
# == Schema Information
#
# Table name: routes
#
# id :integer not null, primary key
# user_id :integer not null
# alias :string not null
# distance_in_meter :integer not null
# created_at :dat... |
MediaGeniX/Eddy | app/controllers/routes_controller.rb | # == Schema Information
#
# Table name: routes
#
# id :integer not null, primary key
# user_id :integer not null
# alias :string not null
# distance_in_meter :integer not null
# created_at :datetime not null
# updated_at ... |
MediaGeniX/Eddy | app/models/trip.rb | <gh_stars>0
# == Schema Information
#
# Table name: trips
#
# id :integer not null, primary key
# trip_date :date not null
# route_id :integer
# user_id :integer not null
# alias :string not null
# distance_in_meter :int... |
MediaGeniX/Eddy | app/helpers/scoreboard_helper.rb | module ScoreboardHelper
def yellow_jersey_card(jersey_data, limit = nil)
if limit.nil?
data = jersey_data
else
data = jersey_data.first(limit)
end
jersey_card data: data,
title: "Yellow Jersey",
sub_title: "Most total distance",
table_header: "Distance",
color_val... |
MediaGeniX/Eddy | db/migrate/20180322193859_confirm_all_users.rb | <filename>db/migrate/20180322193859_confirm_all_users.rb
class ConfirmAllUsers < ActiveRecord::Migration[5.1]
def change
User.all.update_all confirmed_at: DateTime.now
end
end
|
MediaGeniX/Eddy | test/system/scoreboards_test.rb | <gh_stars>0
require 'application_system_test_case'
class ScoreboardsTest < ApplicationSystemTestCase
test "scoreboard" do
visit '/scoreboard'
assert_text "Scoreboard"
assert_text "User 1"
assert_text "0.001"
end
end
|
MediaGeniX/Eddy | app/helpers/routes_helper.rb | <filename>app/helpers/routes_helper.rb<gh_stars>0
# == Schema Information
#
# Table name: routes
#
# id :integer not null, primary key
# user_id :integer not null
# alias :string not null
# distance_in_meter :integer not null
# created_at ... |
MediaGeniX/Eddy | app/controllers/concerns/filtering_for_user_progress.rb | <gh_stars>0
module FilteringForUserProgress
extend ActiveSupport::Concern
included do
before_action :set_user
before_action :set_season
before_action :set_dates
before_action :set_current_meters
before_action :set_days_cycled
before_action :set_largest_distance_in_one_day
end
def set_u... |
MediaGeniX/Eddy | app/helpers/hr/trips_helper.rb | <gh_stars>0
module Hr::TripsHelper
end
|
MediaGeniX/Eddy | app/policies/hr/user_policy.rb | class Hr::UserPolicy < ApplicationPolicy
def index?
show?
end
def show?
user.admin
end
def edit?
show?
end
def update?
show?
end
end |
MediaGeniX/Eddy | test/controllers/scoreboard_controller_test.rb | <reponame>MediaGeniX/Eddy
require 'test_helper'
class ScoreboardControllerTest < ActionController::TestCase
include Devise::Test::ControllerHelpers
test "should assign yellow jersey" do
get :index
assert assigns(:yellow_jersey)
end
test "should assign polka dot jersey" do
get :index
assert a... |
MediaGeniX/Eddy | app/controllers/hr/users_controller.rb | <gh_stars>0
class Hr::UsersController < ApplicationController
before_action :authenticate_user!
before_action :get_user, only: [:edit, :update]
def index
@users = User.by_name
authorize [:hr, @users]
end
def edit
authorize [:hr, @user]
end
def update
@user.update user_params
autho... |
MediaGeniX/Eddy | app/controllers/application_controller.rb | class ApplicationController < ActionController::Base
include Pundit
protect_from_forgery with: :exception
after_action :verify_authorized, except: [:index, :letsencrypt], unless: :devise_controller?
before_action :configure_permitted_parameters, if: :devise_controller?
rescue_from Pundit::NotAuthorizedErro... |
MediaGeniX/Eddy | app/models/movement.rb | <reponame>MediaGeniX/Eddy
class Movement < ActiveRecord::Base
self.abstract_class = true
belongs_to :user
validates :alias, presence: true
validates :distance_in_meter, presence: true, numericality: { greater_than: 0 }
attr_accessor :distance_in_kilometer
def distance_in_kilometer
(read_attribute(:d... |
MediaGeniX/Eddy | db/migrate/20180528125739_add_distance_to_season.rb | <reponame>MediaGeniX/Eddy<filename>db/migrate/20180528125739_add_distance_to_season.rb
class AddDistanceToSeason < ActiveRecord::Migration[5.2]
def change
add_column :seasons, :distance_in_meter, :integer, default: 25000000
end
end
|
MediaGeniX/Eddy | app/models/user.rb | # == Schema Information
#
# Table name: users
#
# id :integer not null, primary key
# name :string not null
# birthdate :date not null
# location :integer default("belgium"), not null
# sex :... |
MediaGeniX/Eddy | app/helpers/devise_helper.rb | <reponame>MediaGeniX/Eddy<filename>app/helpers/devise_helper.rb
module DeviseHelper
def devise_error_messages!
flash_alerts = []
error_key = 'errors.messages.not_saved'
if !flash.empty?
flash_alerts.push(flash[:error]) if flash[:error]
flash_alerts.push(flash[:alert]) if flash[:alert]
e... |
MediaGeniX/Eddy | test/controllers/routes_controller_test.rb | <gh_stars>0
# == Schema Information
#
# Table name: routes
#
# id :integer not null, primary key
# user_id :integer not null
# alias :string not null
# distance_in_meter :integer not null
# created_at :datetime not null
# upd... |
MediaGeniX/Eddy | app/controllers/trips_controller.rb | <reponame>MediaGeniX/Eddy
# == Schema Information
#
# Table name: trips
#
# id :integer not null, primary key
# trip_date :date not null
# route_id :integer
# user_id :integer not null
# alias :string not null
# distance... |
MediaGeniX/Eddy | config/deploy/production.rb | server 'eddy.toonwillems.be', user: 'deploy', roles: %w{web app db},
ssh_options: {
forward_agent: true,
auth_methods: ['publickey'],
port: 22
}
|
MediaGeniX/Eddy | app/controllers/concerns/filtering_for_scoreboard.rb | module FilteringForScoreboard
extend ActiveSupport::Concern
included do
before_action :set_season
before_action :set_dates
before_action :set_current_meters
before_action :set_jerseys
end
def set_season
@selected_season = (params[:season] && Season.find_by_name(params[:season])) \
||... |
MediaGeniX/Eddy | app/helpers/hr/users_helper.rb | module Hr::UsersHelper
end
|
MediaGeniX/Eddy | config/routes.rb | Rails.application.routes.draw do
root 'welcome#index'
devise_for :users
get 'scoreboard', to: 'scoreboard#index'
get 'trips', to: 'trips#recent'
get '/.well-known/acme-challenge/:id' => 'welcome#letsencrypt'
resources :users do
member do
get 'progress', to: 'progress#index'
end
resour... |
MediaGeniX/Eddy | app/controllers/scoreboard_controller.rb | class ScoreboardController < ApplicationController
include FilteringForScoreboard
def index
@seasons = Season.all
end
end
|
MediaGeniX/Eddy | db/migrate/20160315220019_create_routes.rb | class CreateRoutes < ActiveRecord::Migration[4.2]
def change
create_table :routes do |t|
t.references :user, null: false
t.string :alias, null: false
t.integer :distance_in_meter, null: false
t.timestamps null: false
end
end
end
|
jehoffmann/homebrew-cask | Casks/signal.rb | cask 'signal' do
version '1.18.1'
sha256 'e467abdb5f4b5b550778a5120ac3a540ef273967fede0628acceb5deba7cbc9f'
url "https://updates.signal.org/desktop/signal-desktop-mac-#{version}.zip"
appcast 'https://github.com/signalapp/Signal-Desktop/releases.atom'
name 'Signal'
homepage 'https://signal.org/'
auto_upd... |
mongodb-ansible-roles/ansible-role-saslauthd | molecule/default/tests/test_default.rb | # frozen_string_literal: true
describe command('saslauthd -v') do
# rubocop:disable LineLength
its('stderr') { should eq "saslauthd 2.1.27\nauthentication mechanisms: sasldb getpwent kerberos5 pam rimap shadow ldap\n\n" }
# rubocop:enable LineLength
end
|
STRd6/jqueryui-source | lib/jqueryui-source/version.rb | module Jqueryui
module Source
VERSION = "1.8.23"
end
end
|
STRd6/jqueryui-source | lib/jqueryui-source.rb | require "jqueryui-source/version"
# Check for Rails or Sprockets
if defined? ::Rails::Engine
require "jqueryui-source/rails"
elsif defined? ::Sprockets
require "jqueryui-source/sprockets"
end
module Jqueryui
module Source
end
end
|
STRd6/jqueryui-source | lib/jqueryui-source/rails.rb | <reponame>STRd6/jqueryui-source<filename>lib/jqueryui-source/rails.rb<gh_stars>1-10
module Jqueryui
module Source
class Rails < ::Rails::Engine
# auto wire assets
end
end
end
|
jarmo/spork | spec/spork/run_strategy/magazine_spec.rb | require 'spec_helper'
describe Spork::RunStrategy::Magazine do
before { ENV["SPORK_SLAVES_COUNT"] = nil }
after { ENV["SPORK_SLAVES_COUNT"] = nil }
it "uses 2 slaves by default" do
Spork::RunStrategy::Magazine::Slave_Id_Range.should == (1..2)
end
it "allows to override max slaves count via environmen... |
innerpeacez/rio | vagrant/lib/vagrant-host-shell/provisioner.rb | module VagrantPlugins::HostShell
class Provisioner < Vagrant.plugin('2', :provisioner)
# This handles outputting the communication data back to the UI
def handle_comm(type, data)
if [:stderr, :stdout].include?(type)
# Output the data with the proper color based on the stream.
color = ty... |
innerpeacez/rio | vagrant/lib/vagrant-host-shell.rb | <reponame>innerpeacez/rio
# https://github.com/LLParse/vagrant-host-shell
module VagrantPlugins
module HostShell
lib_path = Pathname.new(File.expand_path("../vagrant-host-shell", __FILE__))
autoload :Errors, lib_path.join("errors")
end
end
require 'vagrant-host-shell/plugin'
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.