source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | appengine/standard-rails-hello-world/config/boot.rb | Ruby | apache-2.0 | 237 | main | 702 | # Copyright 2020 Google LLC
#
# 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 writing, s... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | appengine/standard-rails-hello-world/config/routes.rb | Ruby | apache-2.0 | 237 | main | 1,123 | # Copyright 2020 Google LLC
#
# 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 writing, s... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | appengine/standard-rails-hello-world/config/puma.rb | Ruby | apache-2.0 | 237 | main | 2,874 | # Copyright 2020 Google LLC
#
# 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 writing, s... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | appengine/standard-rails-hello-world/config/environment.rb | Ruby | apache-2.0 | 237 | main | 703 | # Copyright 2020 Google LLC
#
# 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 writing, s... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | appengine/standard-rails-hello-world/config/environments/development.rb | Ruby | apache-2.0 | 237 | main | 2,484 | # Copyright 2020 Google LLC
#
# 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 writing, s... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | appengine/standard-rails-hello-world/config/environments/test.rb | Ruby | apache-2.0 | 237 | main | 2,583 | # Copyright 2020 Google LLC
#
# 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 writing, s... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | appengine/standard-rails-hello-world/config/environments/production.rb | Ruby | apache-2.0 | 237 | main | 3,751 | # Copyright 2020 Google LLC
#
# 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 writing, s... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | appengine/standard-rails-hello-world/config/initializers/wrap_parameters.rb | Ruby | apache-2.0 | 237 | main | 913 | # Copyright 2020 Google LLC
#
# 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 writing, s... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | appengine/standard-rails-hello-world/config/initializers/backtrace_silencers.rb | Ruby | apache-2.0 | 237 | main | 979 | # Copyright 2020 Google LLC
#
# 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 writing, s... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | appengine/standard-rails-hello-world/config/initializers/application_controller_renderer.rb | Ruby | apache-2.0 | 237 | main | 737 | # Copyright 2020 Google LLC
#
# 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 writing, s... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | appengine/standard-rails-hello-world/config/initializers/assets.rb | Ruby | apache-2.0 | 237 | main | 1,077 | # Copyright 2020 Google LLC
#
# 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 writing, s... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | appengine/standard-rails-hello-world/config/initializers/cookies_serializer.rb | Ruby | apache-2.0 | 237 | main | 819 | # Copyright 2020 Google LLC
#
# 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 writing, s... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | appengine/standard-rails-hello-world/config/initializers/mime_types.rb | Ruby | apache-2.0 | 237 | main | 731 | # Copyright 2020 Google LLC
#
# 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 writing, s... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | appengine/standard-rails-hello-world/config/initializers/inflections.rb | Ruby | apache-2.0 | 237 | main | 1,222 | # Copyright 2020 Google LLC
#
# 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 writing, s... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | appengine/standard-rails-hello-world/config/initializers/filter_parameter_logging.rb | Ruby | apache-2.0 | 237 | main | 971 | # Copyright 2020 Google LLC
#
# 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 writing, s... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/sqlserver/activerecord/Gemfile | Ruby | apache-2.0 | 237 | main | 2,151 | source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem "rails", "~> 7.0"
# Use sqlserver as the database for Active Record
gem "activerecord-sqlserver-adapter"
gem "tiny_tds"
gem "sqlite3"
# Use Puma as the app... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/sqlserver/activerecord/app/controllers/votes_controller.rb | Ruby | apache-2.0 | 237 | main | 1,442 | # Copyright 2020 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 writing, ... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/sqlserver/activerecord/app/models/vote.rb | Ruby | apache-2.0 | 237 | main | 1,005 | # Copyright 2020 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 writing, ... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/sqlserver/activerecord/db/schema.rb | Ruby | apache-2.0 | 237 | main | 964 | # 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... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/sqlserver/activerecord/db/seeds.rb | Ruby | apache-2.0 | 237 | main | 454 | # 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... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/sqlserver/activerecord/db/migrate/20231006092705_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb | Ruby | apache-2.0 | 237 | main | 290 | # This migration comes from active_storage (originally 20211119233751)
class RemoveNotNullOnActiveStorageBlobsChecksum < ActiveRecord::Migration[6.0]
def change
return unless table_exists? :active_storage_blobs
change_column_null :active_storage_blobs, :checksum, true
end
end |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/sqlserver/activerecord/db/migrate/20190903195401_create_votes.rb | Ruby | apache-2.0 | 237 | main | 745 | # Copyright 2020 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 writing, ... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/sqlserver/activerecord/db/migrate/20231006092704_create_active_storage_variant_records.active_storage.rb | Ruby | apache-2.0 | 237 | main | 1,083 | # This migration comes from active_storage (originally 20191206030411)
class CreateActiveStorageVariantRecords < ActiveRecord::Migration[6.0]
def change
return unless table_exists? :active_storage_blobs
# Use Active Record's configured type for primary key
create_table :active_storage_variant_records, id... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/sqlserver/activerecord/db/migrate/20231006092703_add_service_name_to_active_storage_blobs.active_storage.rb | Ruby | apache-2.0 | 237 | main | 739 | # This migration comes from active_storage (originally 20190112182829)
class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[6.0]
def up
return unless table_exists? :active_storage_blobs
unless column_exists? :active_storage_blobs, :service_name
add_column :active_storage_blobs, :service_n... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/sqlserver/activerecord/spec/rails_helper.rb | Ruby | apache-2.0 | 237 | main | 2,774 | # This file is copied to spec/ when you run 'rails generate rspec:install'
require 'spec_helper'
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
# Prevent database truncation if the environment is production
abort("The Rails environment is running in production mode!") if Rail... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/sqlserver/activerecord/spec/controllers/votes_spec.rb | Ruby | apache-2.0 | 237 | main | 2,584 | # Copyright 2020 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 writing, ... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/sqlserver/activerecord/config/application.rb | Ruby | apache-2.0 | 237 | main | 709 | require_relative "boot"
require "rails/all"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module Activerecord
class Application < Rails::Application
# Initialize configuration defaults for originally generated Ra... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/sqlserver/activerecord/config/puma.rb | Ruby | apache-2.0 | 237 | main | 1,390 | # Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers: a minimum and maximum.
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum; this matches... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/sqlserver/activerecord/config/routes.rb | Ruby | apache-2.0 | 237 | main | 673 | # Copyright 2020 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 writing, ... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/sqlserver/activerecord/config/environments/test.rb | Ruby | apache-2.0 | 237 | main | 2,617 | require "active_support/core_ext/integer/time"
# 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 suite and is wiped
# and recreated between test runs. Don't rely on the data the... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/sqlserver/activerecord/config/environments/development.rb | Ruby | apache-2.0 | 237 | main | 2,843 | require "active_support/core_ext/integer/time"
Rails.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 any time
# it changes. This slows down response time but is perfect for developme... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/sqlserver/activerecord/config/environments/production.rb | Ruby | apache-2.0 | 237 | main | 4,041 | require "active_support/core_ext/integer/time"
Rails.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 applica... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/postgres/activerecord/Gemfile | Ruby | apache-2.0 | 237 | main | 2,098 | source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem "rails", "~> 7.0"
# Use postgres as the database for Active Record
gem "pg", "~> 1.5"
# Use Puma as the app server
gem "puma", "~> 6.4"
# Use SCSS for styles... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/postgres/activerecord/app/controllers/votes_controller.rb | Ruby | apache-2.0 | 237 | main | 1,440 | # Copyright 2020 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 writing, ... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/postgres/activerecord/db/schema.rb | Ruby | apache-2.0 | 237 | main | 1,093 | # 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.
#
# This file is the source Rails uses to define your schema when running `bin/rai... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/postgres/activerecord/spec/controllers/votes_spec.rb | Ruby | apache-2.0 | 237 | main | 2,526 | # Copyright 2020 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 writing, ... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/postgres/activerecord/config/environments/production.rb | Ruby | apache-2.0 | 237 | main | 4,391 | require "active_support/core_ext/integer/time"
Rails.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 applica... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/postgres/activerecord/config/environments/test.rb | Ruby | apache-2.0 | 237 | main | 2,852 | require "active_support/core_ext/integer/time"
# 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 suite and is wiped
# and recreated between test runs. Don't rely on the data the... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/postgres/activerecord/config/environments/development.rb | Ruby | apache-2.0 | 237 | main | 2,874 | require "active_support/core_ext/integer/time"
Rails.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 any time
# it changes. This slows down response time but is perfect for developme... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/postgres/activerecord/config/initializers/content_security_policy.rb | Ruby | apache-2.0 | 237 | main | 1,486 | # Be sure to restart your server when you modify this file.
# Define an application-wide content security policy.
# See the Securing Rails Applications Guide for more information:
# https://guides.rubyonrails.org/security.html#content-security-policy-header
# Rails.application.configure do
# config.content_security... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/mysql/activerecord/Gemfile | Ruby | apache-2.0 | 237 | main | 2,131 | source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem "rails", "~> 7.0"
# Use mysql as the database for Active Record
gem "mysql2", "~> 0.5.5"
# Use Puma as the app server
gem "puma", "~> 6.4"
# Use SCSS for sty... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/mysql/activerecord/config/routes.rb | Ruby | apache-2.0 | 237 | main | 673 | # Copyright 2019 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 writing, ... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/mysql/activerecord/config/puma.rb | Ruby | apache-2.0 | 237 | main | 1,580 | # Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers: a minimum and maximum.
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum; this matches... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/mysql/activerecord/config/application.rb | Ruby | apache-2.0 | 237 | main | 1,174 | require_relative "boot"
require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
require "active_record/railtie"
require "active_storage/engine"
require "action_controller/railtie"
require "action_mailer/railtie"
# require "action_mailbox/engine"
# require "action_tex... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/mysql/activerecord/config/environments/development.rb | Ruby | apache-2.0 | 237 | main | 3,185 | require "active_support/core_ext/integer/time"
Rails.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 any time
# it changes. This slows down response time but is perfect for developme... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/mysql/activerecord/config/environments/test.rb | Ruby | apache-2.0 | 237 | main | 2,851 | require "active_support/core_ext/integer/time"
# 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 suite and is wiped
# and recreated between test runs. Don't rely on the data the... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/mysql/activerecord/config/environments/production.rb | Ruby | apache-2.0 | 237 | main | 4,950 | require "active_support/core_ext/integer/time"
Rails.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 applica... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/mysql/activerecord/db/schema.rb | Ruby | apache-2.0 | 237 | main | 1,036 | # 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.
#
# This file is the source Rails uses to define your schema when running `bin/rai... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/mysql/activerecord/db/migrate/20190903195401_create_votes.rb | Ruby | apache-2.0 | 237 | main | 745 | # Copyright 2019 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 writing, ... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/mysql/activerecord/spec/controllers/votes_spec.rb | Ruby | apache-2.0 | 237 | main | 2,559 | # Copyright 2019 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 writing, ... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/mysql/activerecord/app/controllers/votes_controller.rb | Ruby | apache-2.0 | 237 | main | 1,434 | # Copyright 2019 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 writing, ... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | cloud-sql/mysql/activerecord/app/models/vote.rb | Ruby | apache-2.0 | 237 | main | 1,005 | # Copyright 2019 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 writing, ... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | stackdriver/sinatra_trace.rb | Ruby | apache-2.0 | 237 | main | 1,261 | # Copyright 2017 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 writing, ... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | stackdriver/sinatra_logging.rb | Ruby | apache-2.0 | 237 | main | 1,070 | # Copyright 2017 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 writing, ... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | stackdriver/rails_configuration.rb | Ruby | apache-2.0 | 237 | main | 3,125 | # Copyright 2017 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 writing, ... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | stackdriver/trace.ru | Ruby | apache-2.0 | 237 | main | 1,043 | # Copyright 2017 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 writing, ... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | stackdriver/debugger.ru | Ruby | apache-2.0 | 237 | main | 1,073 | # Copyright 2017 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 writing, ... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | stackdriver/error_reporting.ru | Ruby | apache-2.0 | 237 | main | 1,142 | # Copyright 2017 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 writing, ... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | stackdriver/sinatra_debugger.rb | Ruby | apache-2.0 | 237 | main | 1,046 | # Copyright 2017 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 writing, ... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | stackdriver/Gemfile | Ruby | apache-2.0 | 237 | main | 799 | # Copyright 2017 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 writing, ... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | stackdriver/sinatra_error_reporting.rb | Ruby | apache-2.0 | 237 | main | 1,369 | # Copyright 2017 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 writing, ... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | stackdriver/logging.ru | Ruby | apache-2.0 | 237 | main | 1,077 | # Copyright 2017 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 writing, ... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | stackdriver/shared_config.ru | Ruby | apache-2.0 | 237 | main | 505 | # [START logging_shared_configure]
require "stackdriver"
Google::Cloud.configure do |config|
# Stackdriver Shared parameters
config.project_id = "YOUR-PROJECT-ID"
config.keyfile = "/path/to/service-account.json"
end
# [END logging_shared_configure]
use Google::Cloud::Debugger::Middleware
use Google::Cloud::L... |
github | GoogleCloudPlatform/ruby-docs-samples | https://github.com/GoogleCloudPlatform/ruby-docs-samples | stackdriver/ruby_debugger.rb | Ruby | apache-2.0 | 237 | main | 937 | # Copyright 2017 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 writing, ... |
github | lpender/bummr | https://github.com/lpender/bummr | Rakefile | Ruby | mit | 237 | main | 253 | require 'rspec/core/rake_task'
require 'bundler/gem_tasks'
# Default directory to look in is `/specs`
# Run with `rake spec`
RSpec::Core::RakeTask.new(:spec) do |task|
task.rspec_opts = ['--color', '--format', 'progress']
end
task :default => :spec |
github | lpender/bummr | https://github.com/lpender/bummr | bummr.gemspec | Ruby | mit | 237 | main | 1,345 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'bummr/version'
Gem::Specification.new do |spec|
spec.name = "bummr"
spec.version = Bummr::VERSION
spec.authors = ["Lee Pender"]
spec.email = ["lpender@gmail.c... |
github | lpender/bummr | https://github.com/lpender/bummr | spec/check_spec.rb | Ruby | mit | 237 | main | 3,898 | require 'spec_helper'
describe Bummr::Check do
let(:check) { Bummr::Check.instance }
before(:each) do
allow(check)
.to receive(:check_base_branch).and_return(nil)
allow(check)
.to receive(:check_log).and_return(nil)
allow(check)
.to receive(:check_status).and_return(nil)
allow(ch... |
github | lpender/bummr | https://github.com/lpender/bummr | spec/lib/cli_spec.rb | Ruby | mit | 237 | main | 5,595 | require 'spec_helper'
describe Bummr::CLI do
# https://github.com/wireframe/gitx/blob/171da367072b0e82d5906d1e5b3f8ff38e5774e7/spec/thegarage/gitx/cli/release_command_spec.rb#L9
let(:args) { [] }
let(:options) { {} }
let(:config) { { pretend: true } }
let(:cli) { described_class.new(args, options, config) }
... |
github | lpender/bummr | https://github.com/lpender/bummr | spec/lib/outdated_spec.rb | Ruby | mit | 237 | main | 5,822 | require 'spec_helper'
describe Bummr::Outdated do
# https://github.com/wireframe/gitx/blob/8e3cdc8b5d0c2082ed3daaf2fc054654b2e7a6c8/spec/gitx/executor_spec.rb#L9
let(:stdoutput_legacy) {
output = String.new
output += " * devise (newest 4.1.1, installed 3.5.2) in group \"default\"\n"
output += " * rak... |
github | lpender/bummr | https://github.com/lpender/bummr | spec/lib/remover_spec.rb | Ruby | mit | 237 | main | 753 | require "spec_helper"
describe Bummr::Remover do
let(:remover) { Bummr::Remover.instance }
let(:git) { Bummr::Git.instance }
let(:sha) { "testsha" }
before do
allow(remover).to receive(:log)
allow(remover).to receive(:system)
allow(remover).to receive(:yes?).and_return(true)
end
describe "#re... |
github | lpender/bummr | https://github.com/lpender/bummr | spec/lib/log_spec.rb | Ruby | mit | 237 | main | 575 | require "spec_helper"
describe Bummr::Log do
let(:object) { Object.new }
let(:message) { "test message" }
before do
`mkdir -p log`
object.extend(Bummr::Log)
end
after do
`rm log/bummr.log`
end
describe "#log" do
it "puts the message" do
allow(STDOUT).to receive(:puts)
obje... |
github | lpender/bummr | https://github.com/lpender/bummr | spec/lib/updater_spec.rb | Ruby | mit | 237 | main | 4,720 | require "spec_helper"
describe Bummr::Updater do
let(:outdated_gems) {
[
{ name: "myGem", installed: "0.3.2", newest: "0.3.5" },
{ name: "otherGem", installed: "1.3.2.23", newest: "1.6.5" },
{ name: "thirdGem", installed: "4.3.4", newest: "5.6.45" },
]
}
let(:gem) { outdated_gems[0] }
... |
github | lpender/bummr | https://github.com/lpender/bummr | spec/lib/prompt_spec.rb | Ruby | mit | 237 | main | 984 | require "spec_helper"
describe Bummr::Prompt do
let(:parent_class) do
Class.new do
def yes?(message)
"called parent with #{message}"
end
end
end
let(:object_class) { Class.new(parent_class) }
let(:object) { object_class.new }
before do
object.extend(Bummr::Prompt)
end
de... |
github | lpender/bummr | https://github.com/lpender/bummr | spec/lib/git_spec.rb | Ruby | mit | 237 | main | 1,988 | require "spec_helper"
describe Bummr::Git do
describe "#add" do
it "stages specified files with git" do
git = stub_git
files = "Gemfile Gemfile.lock"
git.add(files)
expect(git).to have_received(:system).with(
"git add #{files}"
)
end
end
describe "#commit" do
... |
github | lpender/bummr | https://github.com/lpender/bummr | spec/lib/bisecter_spec.rb | Ruby | mit | 237 | main | 843 | require 'spec_helper'
describe Bummr::Bisecter do
let(:std_out_err_bad_commit) {
output = String.new
output += "mybadcommit is the first bad commit\n"
output += "bisect run success\n"
StringIO.new(output)
}
let(:bisecter) { described_class.instance }
let(:remover) { Bummr::Remover.instance }
... |
github | lpender/bummr | https://github.com/lpender/bummr | spec/black_box/bummr_update_spec.rb | Ruby | mit | 237 | main | 1,741 | require "spec_helper"
require "jet_black"
describe "bummr update command" do
let(:session) { JetBlack::Session.new(options: { clean_bundler_env: true }) }
let(:bummr_gem_path) { File.expand_path("../../", __dir__) }
it "updates outdated gems" do
session.create_file "Gemfile", <<~RUBY
source "https://r... |
github | lpender/bummr | https://github.com/lpender/bummr | lib/bummr.rb | Ruby | mit | 237 | main | 370 | # grouped by dependency order than alpha
require 'bummr/log'
require 'bummr/prompt'
require "bummr/scm"
require 'rainbow/ext/string'
require 'open3'
require 'singleton'
require 'thor'
require "bummr/bisecter"
require "bummr/check"
require "bummr/git"
require "bummr/outdated"
require "bummr/remover"
require "bummr/upda... |
github | lpender/bummr | https://github.com/lpender/bummr | lib/bummr/outdated.rb | Ruby | mit | 237 | main | 1,232 | require 'open3'
require 'singleton'
require 'bundler'
module Bummr
class Outdated
include Singleton
def outdated_gems(options = {})
results = []
bundle_options = ""
bundle_options << " --parseable" if Gem::Version.new(Bundler::VERSION) >= Gem::Version.new("2")
bundle_options << " -... |
github | lpender/bummr | https://github.com/lpender/bummr | lib/bummr/remover.rb | Ruby | mit | 237 | main | 865 | module Bummr
class Remover < Thor
include Singleton
include Log
include Scm
desc "remove_commit", "Remove a commit from the history"
def remove_commit(sha)
log "Bad commit: #{git.message(sha)}, #{sha}".color(:red)
log "Resetting..."
system("git bisect reset")
message = "\... |
github | lpender/bummr | https://github.com/lpender/bummr | lib/bummr/git.rb | Ruby | mit | 237 | main | 576 | module Bummr
class Git
include Singleton
include Log
def initialize
@git_commit = ENV.fetch("BUMMR_GIT_COMMIT") { "git commit" }
end
def add(files)
system("git add #{files}")
end
def commit(message)
log "Commit: #{message}".color(:green)
system("#{git_commit} -m ... |
github | lpender/bummr | https://github.com/lpender/bummr | lib/bummr/cli.rb | Ruby | mit | 237 | main | 3,317 | TEST_COMMAND = ENV["BUMMR_TEST"] || "bundle exec rake"
BASE_BRANCH = ENV["BASE_BRANCH"] || "main"
HEADLESS = ENV["BUMMR_HEADLESS"] || false
module Bummr
class CLI < Thor
include Bummr::Log
include Bummr::Prompt
include Bummr::Scm
desc "check", "Run automated checks to see if bummr can be run"
de... |
github | lpender/bummr | https://github.com/lpender/bummr | lib/bummr/bisecter.rb | Ruby | mit | 237 | main | 711 | module Bummr
class Bisecter
include Singleton
def bisect
puts "Bad commits found! Bisecting...".color(:red)
system("bundle")
system("git bisect start")
system("git bisect bad")
system("git bisect good #{BASE_BRANCH}")
Open3.popen2e("git bisect run #{TEST_COMMAND}") do |_... |
github | lpender/bummr | https://github.com/lpender/bummr | lib/bummr/updater.rb | Ruby | mit | 237 | main | 1,250 | module Bummr
class Updater
include Log
include Scm
def initialize(outdated_gems)
@outdated_gems = outdated_gems
end
def update_gems
puts "Updating outdated gems".color(:green)
@outdated_gems.each_with_index do |gem, index|
update_gem(gem, index)
end
end
... |
github | lpender/bummr | https://github.com/lpender/bummr | lib/bummr/check.rb | Ruby | mit | 237 | main | 1,739 | module Bummr
class Check < Thor
include Singleton
include Bummr::Prompt
desc "check", "Run automated checks to see if bummr can be run"
def check(fullcheck=true)
@errors = []
check_base_branch
check_log
check_status
if fullcheck == true
check_diff
end
... |
github | rob-murray/jekyll-twitter-plugin | https://github.com/rob-murray/jekyll-twitter-plugin | jekyll-twitter-plugin.gemspec | Ruby | mit | 237 | master | 1,043 | # frozen_string_literal: true
lib = File.expand_path("lib", __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
Gem::Specification.new do |spec|
spec.name = "jekyll-twitter-plugin"
spec.version = "2.1.0"
spec.authors = ["Rob Murray"]
spec.email = ["robmurray17@gmail.c... |
github | rob-murray/jekyll-twitter-plugin | https://github.com/rob-murray/jekyll-twitter-plugin | spec/api_request_spec.rb | Ruby | mit | 237 | master | 2,330 | # frozen_string_literal: true
RSpec.describe TwitterJekyll::ApiRequest do
subject(:api_request) { described_class.new(url, params) }
let(:url) { "https://twitter.com/twitter_user/status/12345" }
let(:params) { {} }
describe "#to_uri" do
subject(:uri) { api_request.to_uri }
it "uses correct api" do
... |
github | rob-murray/jekyll-twitter-plugin | https://github.com/rob-murray/jekyll-twitter-plugin | spec/integration_tests.rb | Ruby | mit | 237 | master | 2,249 | # frozen_string_literal: true
# Basic integration example - run code to produce html output
#
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
require_relative "./support/jekyll_template"
require "jekyll-twitter-plugin"
require "erb"
require "byebug"
OUTPUT_FILENAME = "output_test.html"
OPTIONS = [
"https:... |
github | rob-murray/jekyll-twitter-plugin | https://github.com/rob-murray/jekyll-twitter-plugin | spec/spec_helper.rb | Ruby | mit | 237 | master | 918 | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
require "webmock/rspec"
require "support/jekyll_template"
require "jekyll-twitter-plugin"
require "byebug" if RUBY_VERSION >= "2.0"
#
# The `.rspec` file also contains a few flags that are not defaults but that
# users commonly want.... |
github | rob-murray/jekyll-twitter-plugin | https://github.com/rob-murray/jekyll-twitter-plugin | spec/twitter_tag_spec.rb | Ruby | mit | 237 | master | 17,649 | # frozen_string_literal: true
RSpec.describe TwitterJekyll::TwitterTag do
let(:api_response_hash) do
{
"url" => "https://twitter.com/twitter_user/status/12345",
"author_name" => "twitter user",
"author_url" => "https://twitter.com/twitter_user",
"html" => "<p>tweet html</p>",
"width... |
github | rob-murray/jekyll-twitter-plugin | https://github.com/rob-murray/jekyll-twitter-plugin | spec/support/jekyll_template.rb | Ruby | mit | 237 | master | 214 | # frozen_string_literal: true
# Hack ...or stub Liquid classes and methods used in plugin
module Liquid
class Tag
def initialize(*_); end
end
class Template
def self.register_tag(*_); end
end
end |
github | rob-murray/jekyll-twitter-plugin | https://github.com/rob-murray/jekyll-twitter-plugin | lib/jekyll-twitter-plugin.rb | Ruby | mit | 237 | master | 8,945 | # frozen_string_literal: true
require "fileutils"
require "net/http"
require "uri"
require "ostruct"
require "json"
require "digest"
##
# A Liquid tag plugin for Jekyll that renders Tweets from Twitter API.
# https://github.com/rob-murray/jekyll-twitter-plugin
#
module TwitterJekyll
VERSION = "2.0.0".freeze
REFER... |
github | karmi/monittr | https://github.com/karmi/monittr | Rakefile | Ruby | mit | 237 | master | 230 | require 'bundler'
Bundler::GemHelper.install_tasks
task :default => :test
require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
test.libs << 'lib' << 'test'
test.pattern = 'test/**/*_test.rb'
test.verbose = true
end |
github | karmi/monittr | https://github.com/karmi/monittr | monittr.gemspec | Ruby | mit | 237 | master | 1,331 | # -*- encoding: utf-8 -*-
$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
require 'monittr/version'
Gem::Specification.new do |s|
s.name = "monittr"
s.version = Monittr::VERSION
s.platform = Gem::Platform::RUBY
s.summary = "A Ruby and web interface for Monit statistics"
s.ho... |
github | karmi/monittr | https://github.com/karmi/monittr | test/test_helper.rb | Ruby | mit | 237 | master | 767 | $LOAD_PATH.unshift File.expand_path('../..', __FILE__)
require 'rubygems'
require 'test/unit'
require 'rack/test'
require 'shoulda'
require 'mocha'
require 'fakeweb'
require 'pathname'
require 'turn' unless ENV["TM_FILEPATH"]
ENV['RACK_ENV'] = 'test'
require 'lib/monittr'
class Test::Unit::TestCase
def setup
... |
github | karmi/monittr | https://github.com/karmi/monittr | test/monittr_test.rb | Ruby | mit | 237 | master | 4,673 | require 'test_helper'
module Monittr
class MonittrTest < Test::Unit::TestCase
context "Cluster" do
should "be initialized with URLs" do
assert_nothing_raised do
cluster = Monittr::Cluster.new %w[ http://admin:monit@localhost:2812
http://admi... |
github | karmi/monittr | https://github.com/karmi/monittr | test/sinatra_helper_test.rb | Ruby | mit | 237 | master | 641 | require 'test_helper'
require 'sinatra/base'
require 'monittr/sinatra/monittr'
class ExampleApp < Sinatra::Base
register Sinatra::MonittrHTML
get "/" do
monittr.html
end
end
class SinatraHelperTest < Test::Unit::TestCase
include Rack::Test::Methods
def app
ExampleApp
end
context "Sinatra help... |
github | karmi/monittr | https://github.com/karmi/monittr | examples/application.rb | Ruby | mit | 237 | master | 2,288 | $LOAD_PATH.unshift( File.expand_path('../../lib', __FILE__) )
require 'rubygems'
require 'monittr'
require 'sinatra'
require 'fakeweb'
# --- Require the Sinatra extension -------------------------------------------
require 'monittr/sinatra/monittr'
# -------------------------------------------------------------------... |
github | karmi/monittr | https://github.com/karmi/monittr | lib/monittr.rb | Ruby | mit | 237 | master | 5,878 | require 'nokogiri'
require 'rest-client'
require 'ostruct'
require 'timeout'
module Monittr
# Represents a cluster of monitored instances.
# Pass and array of URLs to the constructor.
#
class Cluster
attr_reader :servers
def initialize(urls=[])
@servers = urls.map { |url| Server.fetch(url) }
... |
github | karmi/monittr | https://github.com/karmi/monittr | lib/monittr/sinatra/monittr.rb | Ruby | mit | 237 | master | 1,475 | require 'sinatra/base'
require 'erb'
module Sinatra
module MonittrHTML
module Helpers
def monittr
@monittr ||= HTML.new(self)
end
end
class HTML
attr_reader :app
def initialize(app)
@app = app
end
def cluster
Monittr::Cluster.new(app.sett... |
github | sporkd/html5-rails | https://github.com/sporkd/html5-rails | Gemfile | Ruby | mit | 236 | master | 659 | source 'http://rubygems.org'
gemspec
gem 'rails', '3.2.13'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rail... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.