code stringlengths 1 1.73M | language stringclasses 1
value |
|---|---|
#
# is_string.rb
#
module Puppet::Parser::Functions
newfunction(:is_string, :type => :rvalue, :doc => <<-EOS
Returns true if the variable passed to this function is a string.
EOS
) do |arguments|
raise(Puppet::ParseError, "is_string(): Wrong number of arguments " +
"given (#{arguments.size} for 1)")... | Ruby |
module Puppet::Parser::Functions
newfunction(:validate_hash, :doc => <<-'ENDHEREDOC') do |args|
Validate that all passed values are hash data structures. Abort catalog
compilation if any value fails this check.
The following values will pass:
$my_hash = { 'one' => 'two' }
validate_hash(... | Ruby |
#
# keys.rb
#
module Puppet::Parser::Functions
newfunction(:keys, :type => :rvalue, :doc => <<-EOS
Returns the keys of a hash as an array.
EOS
) do |arguments|
raise(Puppet::ParseError, "keys(): Wrong number of arguments " +
"given (#{arguments.size} for 1)") if arguments.size < 1
hash = argume... | Ruby |
#
# values.rb
#
module Puppet::Parser::Functions
newfunction(:values, :type => :rvalue, :doc => <<-EOS
When given a hash this function will return the values of that hash.
*Examples:*
$hash = {
'a' => 1,
'b' => 2,
'c' => 3,
}
values($hash)
This example would return:
[1,2,3]
... | Ruby |
#
# swapcase.rb
#
module Puppet::Parser::Functions
newfunction(:swapcase, :type => :rvalue, :doc => <<-EOS
This function will swap the existing case of a string.
*Examples:*
swapcase("aBcD")
Would result in: "AbCd"
EOS
) do |arguments|
raise(Puppet::ParseError, "swapcase(): Wrong number of argumen... | Ruby |
#
# shuffle.rb
#
module Puppet::Parser::Functions
newfunction(:shuffle, :type => :rvalue, :doc => <<-EOS
Randomizes the order of a string or array elements.
EOS
) do |arguments|
raise(Puppet::ParseError, "shuffle(): Wrong number of arguments " +
"given (#{arguments.size} for 1)") if arguments.size <... | Ruby |
#
# is_mac_address.rb
#
module Puppet::Parser::Functions
newfunction(:is_mac_address, :type => :rvalue, :doc => <<-EOS
Returns true if the string passed to this function is a valid mac address.
EOS
) do |arguments|
if (arguments.size != 1) then
raise(Puppet::ParseError, "is_mac_address(): Wrong numb... | Ruby |
#
# capitalize.rb
#
module Puppet::Parser::Functions
newfunction(:capitalize, :type => :rvalue, :doc => <<-EOS
Capitalizes the first letter of a string or array of strings.
Requires either a single string or an array as an input.
EOS
) do |arguments|
raise(Puppet::ParseError, "capitalize(): Wrong... | Ruby |
#
# is_float.rb
#
module Puppet::Parser::Functions
newfunction(:is_float, :type => :rvalue, :doc => <<-EOS
Returns true if the variable passed to this function is a float.
EOS
) do |arguments|
if (arguments.size != 1) then
raise(Puppet::ParseError, "is_float(): Wrong number of arguments "+
"... | Ruby |
#
# abs.rb
#
module Puppet::Parser::Functions
newfunction(:abs, :type => :rvalue, :doc => <<-EOS
Returns the absolute value of a number, for example -34.56 becomes
34.56. Takes a single integer and float value as an argument.
EOS
) do |arguments|
raise(Puppet::ParseError, "abs(): Wrong number of ... | Ruby |
#
# str2saltedsha512.rb
#
module Puppet::Parser::Functions
newfunction(:str2saltedsha512, :type => :rvalue, :doc => <<-EOS
This converts a string to a salted-SHA512 password hash (which is used for
OS X versions >= 10.7). Given any simple string, you will get a hex version
of a salted-SHA512 password hash that can b... | Ruby |
#
# strip.rb
#
module Puppet::Parser::Functions
newfunction(:strip, :type => :rvalue, :doc => <<-EOS
This function removes leading and trailing whitespace from a string or from
every string inside an array.
*Examples:*
strip(" aaa ")
Would result in: "aaa"
EOS
) do |arguments|
raise(Puppet::P... | Ruby |
#
# num2bool.rb
#
# TODO(Krzysztof Wilczynski): We probably need to approach numeric values differently ...
module Puppet::Parser::Functions
newfunction(:num2bool, :type => :rvalue, :doc => <<-EOS
This function converts a number into a true boolean. Zero becomes false. Numbers
higher then 0 become true.
EOS
)... | Ruby |
#
# reverse.rb
#
module Puppet::Parser::Functions
newfunction(:reverse, :type => :rvalue, :doc => <<-EOS
Reverses the order of a string or array.
EOS
) do |arguments|
raise(Puppet::ParseError, "reverse(): Wrong number of arguments " +
"given (#{arguments.size} for 1)") if arguments.size < 1
val... | Ruby |
#
# values_at.rb
#
module Puppet::Parser::Functions
newfunction(:values_at, :type => :rvalue, :doc => <<-EOS
Finds value inside an array based on location.
The first argument is the array you want to analyze, and the second element can
be a combination of:
* A single numeric index
* A range in the form of 'start-s... | Ruby |
module Puppet::Parser::Functions
newfunction(:validate_string, :doc => <<-'ENDHEREDOC') do |args|
Validate that all passed values are string data structures. Abort catalog
compilation if any value fails this check.
The following values will pass:
$my_string = "one two"
validate_string($... | Ruby |
#
# lstrip.rb
#
module Puppet::Parser::Functions
newfunction(:lstrip, :type => :rvalue, :doc => <<-EOS
Strips leading spaces to the left of a string.
EOS
) do |arguments|
raise(Puppet::ParseError, "lstrip(): Wrong number of arguments " +
"given (#{arguments.size} for 1)") if arguments.size < 1
... | Ruby |
#
# sort.rb
#
module Puppet::Parser::Functions
newfunction(:sort, :type => :rvalue, :doc => <<-EOS
Sorts strings and arrays lexically.
EOS
) do |arguments|
if (arguments.size != 1) then
raise(Puppet::ParseError, "sort(): Wrong number of arguments "+
"given #{arguments.size} for 1")
end
... | Ruby |
#
# member.rb
#
# TODO(Krzysztof Wilczynski): We need to add support for regular expression ...
# TODO(Krzysztof Wilczynski): Support for strings and hashes too ...
module Puppet::Parser::Functions
newfunction(:member, :type => :rvalue, :doc => <<-EOS
This function determines if a variable is a member of an array.
... | Ruby |
#
# hash.rb
#
module Puppet::Parser::Functions
newfunction(:hash, :type => :rvalue, :doc => <<-EOS
This function converts and array into a hash.
*Examples:*
hash(['a',1,'b',2,'c',3])
Would return: {'a'=>1,'b'=>2,'c'=>3}
EOS
) do |arguments|
raise(Puppet::ParseError, "hash(): Wrong number of argumen... | Ruby |
#
# zip.rb
#
module Puppet::Parser::Functions
newfunction(:zip, :type => :rvalue, :doc => <<-EOS
Takes one element from first array and merges corresponding elements from second array. This generates a sequence of n-element arrays, where n is one more than the count of arguments.
*Example:*
zip(['1','2','3'],[... | Ruby |
#
# parsejson.rb
#
module Puppet::Parser::Functions
newfunction(:parsejson, :type => :rvalue, :doc => <<-EOS
This function accepts JSON as a string and converts into the correct Puppet
structure.
EOS
) do |arguments|
if (arguments.size != 1) then
raise(Puppet::ParseError, "parsejson(): Wrong number ... | Ruby |
#
# chomp.rb
#
module Puppet::Parser::Functions
newfunction(:chomp, :type => :rvalue, :doc => <<-'EOS'
Removes the record separator from the end of a string or an array of
strings, for example `hello\n` becomes `hello`.
Requires a single string or array as an input.
EOS
) do |arguments|
rais... | Ruby |
#
# type.rb
#
module Puppet::Parser::Functions
newfunction(:type, :type => :rvalue, :doc => <<-EOS
Returns the type when passed a variable. Type can be one of:
* string
* array
* hash
* float
* integer
* boolean
EOS
) do |arguments|
raise(Puppet::ParseError, "type(): Wrong number of arguments " +
"... | Ruby |
#
# join.rb
#
module Puppet::Parser::Functions
newfunction(:join, :type => :rvalue, :doc => <<-EOS
This function joins an array into a string using a seperator.
*Examples:*
join(['a','b','c'], ",")
Would result in: "a,b,c"
EOS
) do |arguments|
# Technically we support two arguments but only first i... | Ruby |
#
# upcase.rb
#
module Puppet::Parser::Functions
newfunction(:upcase, :type => :rvalue, :doc => <<-EOS
Converts a string or an array of strings to uppercase.
*Examples:*
upcase("abcd")
Will return:
ASDF
EOS
) do |arguments|
raise(Puppet::ParseError, "upcase(): Wrong number of arguments " +
... | Ruby |
#
# grep.rb
#
module Puppet::Parser::Functions
newfunction(:grep, :type => :rvalue, :doc => <<-EOS
This function searches through an array and returns any elements that match
the provided regular expression.
*Examples:*
grep(['aaa','bbb','ccc','aaaddd'], 'aaa')
Would return:
['aaa','aaaddd']
EOS
) ... | Ruby |
#
# is_ip_address.rb
#
module Puppet::Parser::Functions
newfunction(:is_ip_address, :type => :rvalue, :doc => <<-EOS
Returns true if the string passed to this function is a valid IP address.
EOS
) do |arguments|
require 'ipaddr'
if (arguments.size != 1) then
raise(Puppet::ParseError, "is_ip_add... | Ruby |
#
# rstrip.rb
#
module Puppet::Parser::Functions
newfunction(:rstrip, :type => :rvalue, :doc => <<-EOS
Strips leading spaces to the right of the string.
EOS
) do |arguments|
raise(Puppet::ParseError, "rstrip(): Wrong number of arguments " +
"given (#{arguments.size} for 1)") if arguments.size < 1
... | Ruby |
module Puppet::Parser::Functions
newfunction(:validate_re, :doc => <<-'ENDHEREDOC') do |args|
Perform simple validation of a string against one or more regular
expressions. The first argument of this function should be a string to
test, and the second argument should be a stringified regular expression
... | Ruby |
module Puppet::Parser::Functions
newfunction(:loadyaml, :type => :rvalue, :doc => <<-'ENDHEREDOC') do |args|
Load a YAML file containing an array, string, or hash, and return the data
in the corresponding native data type.
For example:
$myhash = loadyaml('/etc/puppet/data/myhash.yaml')
ENDH... | Ruby |
#
# chop.rb
#
module Puppet::Parser::Functions
newfunction(:chop, :type => :rvalue, :doc => <<-'EOS'
Returns a new string with the last character removed. If the string ends
with `\r\n`, both characters are removed. Applying chop to an empty
string returns an empty string. If you wish to merely remove... | Ruby |
#
# empty.rb
#
module Puppet::Parser::Functions
newfunction(:empty, :type => :rvalue, :doc => <<-EOS
Returns true if the variable is empty.
EOS
) do |arguments|
raise(Puppet::ParseError, "empty(): Wrong number of arguments " +
"given (#{arguments.size} for 1)") if arguments.size < 1
value = arg... | Ruby |
module Puppet::Parser::Functions
newfunction(:getvar, :type => :rvalue, :doc => <<-'ENDHEREDOC') do |args|
Lookup a variable in a remote namespace.
For example:
$foo = getvar('site::data::foo')
# Equivalent to $foo = $site::data::foo
This is useful if the namespace itself is stored in ... | Ruby |
#
# delete_at.rb
#
module Puppet::Parser::Functions
newfunction(:delete_at, :type => :rvalue, :doc => <<-EOS
Deletes a determined indexed value from an array.
*Examples:*
delete_at(['a','b','c'], 1)
Would return: ['a','c']
EOS
) do |arguments|
raise(Puppet::ParseError, "delete_at(): Wrong number of... | Ruby |
#
# bool2num.rb
#
module Puppet::Parser::Functions
newfunction(:bool2num, :type => :rvalue, :doc => <<-EOS
Converts a boolean to a number. Converts the values:
false, f, 0, n, and no to 0
true, t, 1, y, and yes to 1
Requires a single boolean or string as an input.
EOS
) do |arguments|
... | Ruby |
module Puppet::Parser::Functions
newfunction(:has_key, :type => :rvalue, :doc => <<-'ENDHEREDOC') do |args|
Determine if a hash has a certain key value.
Example:
$my_hash = {'key_one' => 'value_one'}
if has_key($my_hash, 'key_two') {
notice('we will not reach here')
}
... | Ruby |
module Puppet::Parser::Functions
newfunction(:validate_absolute_path, :doc => <<-'ENDHEREDOC') do |args|
Validate the string represents an absolute path in the filesystem. This function works
for windows and unix style paths.
The following values will pass:
$my_path = "C:/Program Files (x86)/Pu... | Ruby |
#
# range.rb
#
# TODO(Krzysztof Wilczynski): We probably need to approach numeric values differently ...
module Puppet::Parser::Functions
newfunction(:range, :type => :rvalue, :doc => <<-EOS
When given range in the form of (start, stop) it will extrapolate a range as
an array.
*Examples:*
range("0", "9")
Wil... | Ruby |
#
# is_integer.rb
#
module Puppet::Parser::Functions
newfunction(:is_integer, :type => :rvalue, :doc => <<-EOS
Returns true if the variable returned to this string is an integer.
EOS
) do |arguments|
if (arguments.size != 1) then
raise(Puppet::ParseError, "is_integer(): Wrong number of arguments "+
... | Ruby |
module Puppet::Parser::Functions
newfunction(:merge, :type => :rvalue, :doc => <<-'ENDHEREDOC') do |args|
Merges two or more hashes together and returns the resulting hash.
For example:
$hash1 = {'one' => 1, 'two', => 2}
$hash2 = {'two' => 'dos', 'three', => 'tres'}
$merged_hash = me... | Ruby |
#
# strftime.rb
#
module Puppet::Parser::Functions
newfunction(:strftime, :type => :rvalue, :doc => <<-EOS
This function returns formatted time.
*Examples:*
To return the time since epoch:
strftime("%s")
To return the date:
strftime("%Y-%m-%d")
*Format meaning:*
%a - The abbreviated weekday name (... | Ruby |
module Puppet::Parser::Functions
newfunction(:validate_array, :doc => <<-'ENDHEREDOC') do |args|
Validate that all passed values are array data structures. Abort catalog
compilation if any value fails this check.
The following values will pass:
$my_array = [ 'one', 'two' ]
validate_arra... | Ruby |
#
# size.rb
#
# TODO(Krzysztof Wilczynski): Support for hashes would be nice too ...
module Puppet::Parser::Functions
newfunction(:size, :type => :rvalue, :doc => <<-EOS
Returns the number of elements in a string or array.
EOS
) do |arguments|
raise(Puppet::ParseError, "size(): Wrong number of arguments ... | Ruby |
Puppet::Type.newtype(:anchor) do
desc <<-'ENDOFDESC'
A simple resource type intended to be used as an anchor in a composite class.
In Puppet 2.6, when a class declares another class, the resources in the
interior class are not contained by the exterior class. This interacts badly
with the pattern of composin... | Ruby |
Puppet::Type.newtype(:file_line) do
desc <<-EOT
Ensures that a given line is contained within a file. The implementation
matches the full line, including whitespace at the beginning and end. If
the line is not contained in the given file, Puppet will add the line to
ensure the desired state. Multi... | Ruby |
module Facter
module Util
module PuppetSettings
# This method is intended to provide a convenient way to evaluate a
# Facter code block only if Puppet is loaded. This is to account for the
# situation where the fact happens to be in the load path, but Puppet is
# not loaded for whatever r... | Ruby |
# This facter fact returns the value of the Puppet vardir setting for the node
# running puppet or puppet agent. The intent is to enable Puppet modules to
# automatically have insight into a place where they can place variable data,
# regardless of the node's platform.
#
# The value should be directly usable in a File... | Ruby |
# A facter fact to determine the root home directory.
# This varies on PE supported platforms and may be
# reconfigured by the end user.
module Facter::Util::RootHome
class << self
def get_root_home
root_ent = Facter::Util::Resolution.exec("getent passwd root")
# The home directory is the sixth element in ... | Ruby |
require 'puppetlabs_spec_helper/module_spec_helper'
| Ruby |
require 'puppetlabs_spec_helper/rake_tasks'
| Ruby |
require 'sinatra/activerecord/rake'
require './main' | Ruby |
source :gemcutter
gem 'sinatra', :require => 'sinatra/base'
gem 'thin', '~> 1.3'
gem 'pg'
gem 'sinatra-activerecord'
gem 'google-api-client', '>= 0.4.4', :require => 'google/api_client'
group :development do
gem 'rake'
gem 'sqlite3-ruby'
end
| Ruby |
class CreateUsers < ActiveRecord::Migration
def up
create_table :users do |t|
t.string :profile_id
t.string :email
t.string :refresh_token
end
add_index :users, :profile_id
end
def down
drop_table :users
end
end
| Ruby |
# Copyright (C) 2012 Google 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
#
# Unless required by applicable law or agreed to in writ... | Ruby |
require 'sinatra.rb'
# Sinatra defines #set at the top level as a way to set application configuration
set :run, false
set :env, (ENV['RACK_ENV'] ? ENV['RACK_ENV'].to_sym : :development)
require './main'
run Sinatra::Application | Ruby |
# 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 |
# 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 |
# 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 |
# 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 |
# 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 |
# Be sure to restart your server when you modify this file.
Userlogin::Application.config.session_store :cookie_store, key: '_userlogin_session'
| Ruby |
# 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 |
Userlogin::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 se... | Ruby |
Userlogin::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... | Ruby |
Userlogin::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... | Ruby |
# Load the Rails application.
require File.expand_path('../application', __FILE__)
# Initialize the Rails application.
Userlogin::Application.initialize!
| Ruby |
# 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 |
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 Userlogin
class Application < Rails::Application
# Settings in config/environments/* ta... | Ruby |
Userlogin::Application.routes.draw do
# 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 "root"
# root 'welcome#index'
# Example of regular route:
# get 'products/:id' =... | Ruby |
module ApplicationHelper
end
| Ruby |
class User < ActiveRecord::Base
before_save { self.email = email.downcase }
validates :name, presence: true, length: {maximum: 25 }
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
validates :email, presence: true, format: { with: VALID_EMAIL_REGEX }, uniqueness: {case_sensitive: false}
has_secure_passwo... | Ruby |
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 |
# 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__)
Userlogin::Application.load_tasks
| Ruby |
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Us... | Ruby |
class AddPasswordDigestToUsers < ActiveRecord::Migration
def change
add_column :users, :password_digest, :string
end
end
| Ruby |
class CreateUsers < ActiveRecord::Migration
def change
create_table :users do |t|
t.string :name
t.string :email
t.timestamps
end
end
end
| Ruby |
class AddIndexToUsersEmail < ActiveRecord::Migration
def change
end
end
| Ruby |
# 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 |
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
run Rails.application
| Ruby |
ENV["RAILS_ENV"] ||= "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
class ActiveSupport::TestCase
ActiveRecord::Migration.check_pending!
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
#
# Note: You'll currently still have to de... | Ruby |
# 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 |
# 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 |
# 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 |
# 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 |
# 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 |
# Be sure to restart your server when you modify this file.
StockUp::Application.config.session_store :cookie_store, key: '_stock_up_session'
| Ruby |
# 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 |
StockUp::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 serv... | Ruby |
StockUp::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 s... | Ruby |
StockUp::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 |
# Load the Rails application.
require File.expand_path('../application', __FILE__)
# Initialize the Rails application.
StockUp::Application.initialize!
| Ruby |
# 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 |
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 StockUp
class Application < Rails::Application
# Settings in config/environments/* take... | Ruby |
StockUp::Application.routes.draw do
root 'dash#landing_page'
match 'login', to: 'users#login', via: [:get, :post]
get 'logout' => 'users#logout', as: :logout
match 'register' => 'users#register', as: :register, via: [:get, :post]
match 'dash' => 'dash#dashboard', as: :dash, via: [:get, :post]
match 'game/ne... | Ruby |
module ApplicationHelper
end
| Ruby |
module UsersHelper
end
| Ruby |
module MatchesHelper
end
| Ruby |
module FriendsHelper
end
| Ruby |
module TransactionsHelper
end
| Ruby |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.