repo_name
stringlengths
6
97
path
stringlengths
3
341
text
stringlengths
8
1.02M
JulianNicholls/Complete-Finance-Tracker
app/models/stock.rb
# Model for stock, with several class functions class Stock < ActiveRecord::Base has_many :user_stocks has_many :users, through: :user_stocks class << self def new_from_lookup(ticker) looked_up = StockTicker.new(ticker) name = looked_up.name return nil unless name new_stock = new(t...
JulianNicholls/Complete-Finance-Tracker
app/models/user.rb
# Model for User class User < ActiveRecord::Base # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable and :omniauthable # :recoverable devise :database_authenticatable, :registerable, :rememberable, :trackable, :validatable has_many :user_stocks has_many ...
JulianNicholls/Complete-Finance-Tracker
app/controllers/welcome_controller.rb
<reponame>JulianNicholls/Complete-Finance-Tracker # Controller for home page class WelcomeController < ApplicationController def index end end
JulianNicholls/Complete-Finance-Tracker
app/models/user_stock.rb
<gh_stars>1-10 # Model for Tracked stock for User class UserStock < ActiveRecord::Base belongs_to :user belongs_to :stock end
JulianNicholls/Complete-Finance-Tracker
app/helpers/application_helper.rb
# General helpers for views module ApplicationHelper end
JulianNicholls/Complete-Finance-Tracker
app/controllers/users_controller.rb
# Controller fur users class UsersController < ApplicationController def show @user = User.find params[:id] @user_stocks = @user.stocks end def my_portfolio @user = current_user @user_stocks = @user.stocks end def my_friends @friends = current_user.friends end def sear...
danmorrisonNZ/Flash-Card-Solo
app/models/user.rb
<reponame>danmorrisonNZ/Flash-Card-Solo<filename>app/models/user.rb class User < ActiveRecord::Base has_many :decks def self.authenticate(username, password) User.find_by(user_name: username, password: password) end end
danmorrisonNZ/Flash-Card-Solo
db/migrate/20150212184802_create_cards.rb
<filename>db/migrate/20150212184802_create_cards.rb class CreateCards < ActiveRecord::Migration def change create_table :cards do |t| t.belongs_to :deck, index:true t.integer :card_number t.string :card_type t.string :question t.string :answer t.timestamps end end end
danmorrisonNZ/Flash-Card-Solo
app/controllers/index.rb
get '/' do if session[:current_user] redirect '/home' else redirect '/login' end end get '/login' do @error = session[:error] erb :login end post '/login' do @current_user = User.authenticate(params[:username],params[:password]) if @current_user session[:error] = nil session[:current_user] = @current_us...
danmorrisonNZ/Flash-Card-Solo
app/models/deck.rb
<filename>app/models/deck.rb class Deck < ActiveRecord::Base has_many :cards belongs_to :users end
danmorrisonNZ/Flash-Card-Solo
app/models/card.rb
<gh_stars>0 class Card < ActiveRecord::Base belongs_to :decks def answer?(answer) if answer == Card.answer puts "correct!" else puts "incorrect!" end end end
danmorrisonNZ/Flash-Card-Solo
db/seeds.rb
Card.destroy_all card_no = 0 lines = File.readlines("db/question_answer_database_lines.txt") total_lines = lines.length/2 until lines.empty? Card.create(deck_id: 1 ,card_number: card_no +1, card_type: "eneumerable", answer:lines.shift.chomp, question:lines.shift.chomp) card_no +=1 end Deck.create(id:1 , user...
danmorrisonNZ/Flash-Card-Solo
db/migrate/20150212184753_create_decks.rb
<filename>db/migrate/20150212184753_create_decks.rb class CreateDecks < ActiveRecord::Migration def change create_table :decks do |t| t.belongs_to :user, index:true t.string :deck_name t.integer :card_count t.timestamps end end end
danmorrisonNZ/Flash-Card-Solo
number.rb
even_numbers = [2,4,6,8,10,12,14,16,18,20] odd_numbers = [1,3,5,7,9,11,13,15,17,19] prime_numbers = [1,3,5,7,11,13,17,19]
krys2fa/members-only
test/controllers/post_controller_test.rb
<gh_stars>1-10 require 'test_helper' class PostControllerTest < ActionDispatch::IntegrationTest test 'should get create' do get post_create_url assert_response :success end test 'should get new' do get post_new_url assert_response :success end test 'should get index' do get post_index_u...
flant/dappdeps-base
omnibus/config/projects/dappdeps-base.rb
name 'dappdeps-base' maintainer '<NAME>' homepage 'https://github.com/flant/dappdeps-base' license 'MIT' license_file 'LICENSE.txt' DOCKER_IMAGE_VERSION = "0.2.2" install_dir "/.dapp/deps/base/#{DOCKER_IMAGE_VERSION}" build_version DOCKER_IMAGE_VERSION build_iteration 1 dependency "dappdeps-base"
ProofFactorLLC/zerobounce
spec/zerobounce/response_spec.rb
<reponame>ProofFactorLLC/zerobounce # frozen_string_literal: true RSpec.describe Zerobounce::Response do let(:response) { spy } let(:request) { spy } describe '#status' do before { allow(response).to receive(:body).and_return(status: 'DoNotMail') } it 'returns a symbol' do expect(described_class....
ProofFactorLLC/zerobounce
spec/zerobounce_spec.rb
<reponame>ProofFactorLLC/zerobounce<filename>spec/zerobounce_spec.rb # frozen_string_literal: true RSpec.describe Zerobounce do it 'has a version number' do expect(Zerobounce::VERSION).not_to be_nil end describe '.configure' do let(:apikey) { [*('a'..'z')].sample(32).join } it 'yields the configura...
ProofFactorLLC/zerobounce
spec/support/reset_config.rb
<gh_stars>1-10 # frozen_string_literal: true RSpec.configure do |config| config.after do Zerobounce.instance_variable_set(:@configuration, Zerobounce::Configuration.new) end end
ProofFactorLLC/zerobounce
spec/zerobounce/configuration_spec.rb
# frozen_string_literal: true RSpec.describe Zerobounce::Configuration do it 'has correct attributes' do expect(described_class.new).to have_attributes( apikey: be_nil, host: be_a(String), headers: be_a(Hash), middleware: be_a(Proc), valid_statuses: be_an(Array) ) end describe '#apikey', mock_env:...
ProofFactorLLC/zerobounce
spec/zerobounce/middleware/raise_error_spec.rb
# frozen_string_literal: true RSpec.describe Zerobounce::Middleware::RaiseError do describe '#on_complete' do context 'when response contains an error' do let(:env) { { status: 500 } } it 'raises an error' do expect { described_class.new.on_complete(env) }.to raise_error(Zerobounce::Internal...
ProofFactorLLC/zerobounce
lib/zerobounce/request/v1_request.rb
<reponame>ProofFactorLLC/zerobounce # frozen_string_literal: true module Zerobounce class Request # Request methods specific to V1 of the API. module V1Request # Valid v1 get query params VALID_GET_PARAMS = %i[apikey ipaddress email].freeze # Validate the email address. # # @pa...
ProofFactorLLC/zerobounce
spec/simplecov_env.rb
<filename>spec/simplecov_env.rb # frozen_string_literal: true require 'simplecov' module SimpleCovEnv def self.start! configure_profile SimpleCov.start end def self.configure_profile formatters = [SimpleCov::Formatter::HTMLFormatter] SimpleCov.configure do formatter SimpleCov::Formatter::...
ProofFactorLLC/zerobounce
lib/zerobounce/response/v2_response.rb
# frozen_string_literal: true module Zerobounce class Response # V2 specific methods for the API. module V2Response # Deliverability status # # @see https://www.zerobounce.net/docs/email-validation-api-quickstart/#status_codes__v2__ # # Possible values: # :valid # ...
ProofFactorLLC/zerobounce
spec/support/mock_env.rb
# frozen_string_literal: true RSpec.configure do |config| config.around(mock_env: true) do |example| original_env = ENV.to_h begin example.run ensure ENV.clear ENV.update(original_env) end end end
ProofFactorLLC/zerobounce
lib/zerobounce/response/v1_response.rb
<filename>lib/zerobounce/response/v1_response.rb<gh_stars>1-10 # frozen_string_literal: true module Zerobounce class Response # V1 specific methods for the API. module V1Response # Deliverability status # # Possible values: # :valid # :invalid # :catch_all # ...
ProofFactorLLC/zerobounce
lib/zerobounce/configuration.rb
<gh_stars>1-10 # frozen_string_literal: true require 'faraday' require 'faraday_middleware' require 'zerobounce/middleware/raise_error' module Zerobounce # Configuration object for Zerobounce. # # @author <NAME> # # @attr [String] host # The Zerobounce API host. # # @attr [Hash] headers # Header...
ProofFactorLLC/zerobounce
spec/zerobounce/request_spec.rb
# frozen_string_literal: true RSpec.describe Zerobounce::Request do describe '.new' do context 'when middleware in params' do let(:middleware) { proc {} } it 'uses the middleware' do expect(described_class.new(middleware: middleware).middleware).to be(middleware) end end conte...
ProofFactorLLC/zerobounce
lib/zerobounce/request.rb
# frozen_string_literal: true require 'faraday' require 'zerobounce/request/v1_request' require 'zerobounce/request/v2_request' module Zerobounce # Sends the HTTP request. # # @author <NAME> # # @attr_reader [String] host # The host to send the request to. # # @attr_reader [Hash] headers # The h...
ProofFactorLLC/zerobounce
lib/zerobounce/request/v2_request.rb
# frozen_string_literal: true module Zerobounce class Request # Request methods specific to V2 of the API. module V2Request # Valid v2 query params VALID_GET_PARAMS = %i[api_key ip_address email].freeze # Validate the email address. # # @param [Hash] params # @option para...
ProofFactorLLC/zerobounce
lib/zerobounce.rb
<filename>lib/zerobounce.rb # frozen_string_literal: true require 'zerobounce/error' require 'zerobounce/version' require 'zerobounce/request' require 'zerobounce/response' require 'zerobounce/configuration' # Validate an email address with Zerobounce.net module Zerobounce # @author <NAME> class << self attr_...
ProofFactorLLC/zerobounce
lib/zerobounce/middleware/raise_error.rb
<filename>lib/zerobounce/middleware/raise_error.rb<gh_stars>1-10 # frozen_string_literal: true require 'zerobounce/error' module Zerobounce # Faraday middleware. module Middleware # Raises an error if the response wasn't successful. # # @author <NAME> class RaiseError < Faraday::Response::Middlewa...
ProofFactorLLC/zerobounce
spec/zerobounce/error_spec.rb
# frozen_string_literal: true RSpec.describe Zerobounce::Error do describe '.from_response' do context 'when status is 500' do let(:env) { { status: 500 } } it 'returns InternalServerError error' do expect(described_class.from_response(env)).to be_a(Zerobounce::InternalServerError) end...
neeraji2it/sharetribe
app/models/category.rb
# == Schema Information # # Table name: categories # # id :integer not null, primary key # parent_id :integer # icon :string(255) # created_at :datetime # updated_at :datetime # community_id :integer # sort_priority :integer # url :string(255) # # Indexes # # i...
neeraji2it/sharetribe
app/models/paypal_account.rb
<filename>app/models/paypal_account.rb<gh_stars>0 # == Schema Information # # Table name: paypal_accounts # # id :integer not null, primary key # person_id :string(255) # community_id :integer # email :string(255) # payer_id :string(255) # created_at :datetime # updated_at :d...
neeraji2it/sharetribe
db/migrate/20130815075659_create_initial_payment_gateways.rb
<gh_stars>0 class CreateInitialPaymentGateways < ActiveRecord::Migration end
neeraji2it/sharetribe
db/migrate/20160428054249_add_listing_id_to_orders.rb
<filename>db/migrate/20160428054249_add_listing_id_to_orders.rb class AddListingIdToOrders < ActiveRecord::Migration def change add_column :orders, :listing_id, :integer end end
neeraji2it/sharetribe
db/migrate/20140222080916_remove_additional_transaction_types.rb
class RemoveAdditionalTransactionTypes < ActiveRecord::Migration end
neeraji2it/sharetribe
db/migrate/20160428052644_add_phone_no_to_orders.rb
class AddPhoneNoToOrders < ActiveRecord::Migration def change add_column :orders, :phone_no, :string end end
neeraji2it/sharetribe
db/migrate/20160419060328_add_details_to_orders.rb
<filename>db/migrate/20160419060328_add_details_to_orders.rb class AddDetailsToOrders < ActiveRecord::Migration def change add_column :orders, :card_expires_on, :date end end
neeraji2it/sharetribe
app/models/custom_field_option_selection.rb
# == Schema Information # # Table name: custom_field_option_selections # # id :integer not null, primary key # custom_field_value_id :integer # custom_field_option_id :integer # listing_id :integer # created_at :datetime # updated_at :datetime # # ...
neeraji2it/sharetribe
spec/models/braintree_payment_gateway_spec.rb
# == Schema Information # # Table name: payment_gateways # # id :integer not null, primary key # community_id :integer # type :string(255) # braintree_environment :string(255) # braintree_merchant_id ...
neeraji2it/sharetribe
db/migrate/20150902103231_remove_unused_listing_indecies.rb
class RemoveUnusedListingIndecies < ActiveRecord::Migration end
neeraji2it/sharetribe
spec/models/checkout_payment_spec.rb
<reponame>neeraji2it/sharetribe # == Schema Information # # Table name: payments # # id :integer not null, primary key # payer_id :string(255) # recipient_id :string(255) # organization_id :string(255) # transaction_id :integer # status...
neeraji2it/sharetribe
db/migrate/20140811133606_initialize_transaction_type_urls.rb
<filename>db/migrate/20140811133606_initialize_transaction_type_urls.rb #require File.expand_path('../../migrate_helpers/logging_helpers', __FILE__) class InitializeTransactionTypeUrls < ActiveRecord::Migration end
neeraji2it/sharetribe
app/models/paypal_process_token.rb
# == Schema Information # # Table name: paypal_process_tokens # # id :integer not null, primary key # process_token :string(64) not null # community_id :integer not null # transaction_id :integer not null # op_completed :boolean default(FALSE), not null # ...
neeraji2it/sharetribe
app/models/checkout_payment.rb
<gh_stars>0 # == Schema Information # # Table name: payments # # id :integer not null, primary key # payer_id :string(255) # recipient_id :string(255) # organization_id :string(255) # transaction_id :integer # status :...
neeraji2it/sharetribe
db/migrate/20160420055332_add_listing_id_to_order.rb
class AddListingIdToOrder < ActiveRecord::Migration def change def self.up add_column :orders, :listing_id, :string end def self.down remove_column :orders, :listing_id, :string end end end
neeraji2it/sharetribe
db/migrate/20160419055239_create_order_transactions.rb
<filename>db/migrate/20160419055239_create_order_transactions.rb class CreateOrderTransactions < ActiveRecord::Migration def change create_table :order_transactions do |t| t.integer :order_id t.string :action t.integer :amount t.boolean :success t.string :authorization t.string...
neeraji2it/sharetribe
db/migrate/20140205121010_create_community_specific_categories.rb
#require File.expand_path('../../migrate_helpers/logging_helpers', __FILE__) class CreateCommunitySpecificCategories < ActiveRecord::Migration end
neeraji2it/sharetribe
app/models/order_transaction.rb
<reponame>neeraji2it/sharetribe # == Schema Information # # Table name: order_transactions # # id :integer not null, primary key # order_id :integer # action :string(255) # amount :integer # success :boolean # authorization :string(255) # message :string(255) # ...
neeraji2it/sharetribe
spec/models/custom_field_spec.rb
<reponame>neeraji2it/sharetribe<gh_stars>0 # == Schema Information # # Table name: custom_fields # # id :integer not null, primary key # type :string(255) # sort_priority :integer # search_filter :boolean default(FALSE), not null # created_at :datetime # updated_at ...
neeraji2it/sharetribe
spec/models/numeric_field_value_spec.rb
<gh_stars>0 # == Schema Information # # Table name: custom_field_values # # id :integer not null, primary key # custom_field_id :integer # listing_id :integer # text_value :text(65535) # numeric_value :float(24) # date_value :datetime # created_at :datetime # updated_...
neeraji2it/sharetribe
db/migrate/20140415092507_rename_dropdown_to_dropdown_field.rb
<gh_stars>0 class RenameDropdownToDropdownField < ActiveRecord::Migration end
neeraji2it/sharetribe
app/models/listing.rb
# encoding: utf-8 # == Schema Information # # Table name: listings # # id :integer not null, primary key # community_id :integer not null # author_id :string(255) # category_old :string(255) # title ...
neeraji2it/sharetribe
app/models/custom_field_values/numeric_field_value.rb
# == Schema Information # # Table name: custom_field_values # # id :integer not null, primary key # custom_field_id :integer # listing_id :integer # text_value :text(65535) # numeric_value :float(24) # date_value :datetime # created_at :datetime # updated_at :dat...
neeraji2it/sharetribe
db/migrate/20140223202734_fix_price_quantity_placeholders.rb
<filename>db/migrate/20140223202734_fix_price_quantity_placeholders.rb class CommunityCategory < ActiveRecord::Base belongs_to :community belongs_to :category belongs_to :share_type end class ShareType < ActiveRecord::Base has_many :sub_share_types, :class_name => "ShareType", :foreign_key => "parent_id" ...
neeraji2it/sharetribe
app/models/payment_row.rb
<gh_stars>0 # == Schema Information # # Table name: payment_rows # # id :integer not null, primary key # payment_id :integer # vat :integer # sum_cents :integer # currency :string(255) # created_at :datetime # updated_at :datetime # title :string(255) # # Indexes # # index_payme...
neeraji2it/sharetribe
db/migrate/20130328155825_add_payment_to_community_categories.rb
<reponame>neeraji2it/sharetribe<gh_stars>0 class AddPaymentToCommunityCategories < ActiveRecord::Migration end
neeraji2it/sharetribe
db/migrate/20090225073742_add_column_last_modified_to_listing.rb
<gh_stars>0 class AddColumnLastModifiedToListing < ActiveRecord::Migration def self.up add_column :listings, :lastmodified, :datetime end def self.down remove_column :listings, :lastmodified, :datetime end end
neeraji2it/sharetribe
spec/models/order_spec.rb
<reponame>neeraji2it/sharetribe # == Schema Information # # Table name: orders # # id :integer not null, primary key # firstname :string(255) # lastname :string(255) # email :string(255) # cardtype :string(255) # cardno :string(255) # username ...
neeraji2it/sharetribe
app/controllers/orders_controller.rb
class OrdersController < ApplicationController def index @listing = Listing.find(params[:listing_id]) @orders= Order.all end def express response = EXPRESS_GATEWAY.setup_purchase(current_cart.build_order.price_in_cents, :ip => request.remote_ip, :return_url =>...
neeraji2it/sharetribe
db/migrate/20160419094945_add_person_id_to_orders.rb
<reponame>neeraji2it/sharetribe class AddPersonIdToOrders < ActiveRecord::Migration def change def self.up add_column :orders, :persons_id, :string end def self.down remove_column :orders, :persons_id, :string end end end
neeraji2it/sharetribe
db/migrate/20160418121807_create_orders.rb
class CreateOrders < ActiveRecord::Migration def change create_table :orders do |t| t.string :firstname t.string :lastname t.string :email t.string :cardtype t.string :cardno t.string :username t.timestamps null: false end end end
neeraji2it/sharetribe
db/migrate/20131112115308_migrate_organization_users.rb
<reponame>neeraji2it/sharetribe class MigrateOrganizationUsers < ActiveRecord::Migration end
neeraji2it/sharetribe
app/models/custom_fields/option_field.rb
<reponame>neeraji2it/sharetribe<gh_stars>0 # == Schema Information # # Table name: custom_fields # # id :integer not null, primary key # type :string(255) # sort_priority :integer # search_filter :boolean default(FALSE), not null # created_at :datetime # updated_at ...
neeraji2it/sharetribe
db/migrate/20131114112955_migrate_difficult_organization_users.rb
<reponame>neeraji2it/sharetribe class MigrateDifficultOrganizationUsers < ActiveRecord::Migration end
neeraji2it/sharetribe
app/models/mercury/image.rb
# == Schema Information # # Table name: mercury_images # # id :integer not null, primary key # image_file_name :string(255) # image_content_type :string(255) # image_file_size :integer # image_updated_at :datetime # created_at :datetime # updated_at :datetime # c...
neeraji2it/sharetribe
app/models/booking.rb
# == Schema Information # # Table name: bookings # # id :integer not null, primary key # transaction_id :integer # start_on :date # end_on :date # created_at :datetime # updated_at :datetime # # Indexes # # index_bookings_on_transaction_id (transaction_id) # class Boo...
neeraji2it/sharetribe
db/migrate/20140611094703_change_type_to_listing_conversation.rb
<reponame>neeraji2it/sharetribe<gh_stars>0 class ChangeTypeToListingConversation < ActiveRecord::Migration end
neeraji2it/sharetribe
app/models/paypal_payment.rb
<filename>app/models/paypal_payment.rb # == Schema Information # # Table name: paypal_payments # # id :integer not null, primary key # community_id :integer not null # transaction_id :integer not null # payer_id :string(6...
neeraji2it/sharetribe
spec/models/order_transaction_spec.rb
<reponame>neeraji2it/sharetribe # == Schema Information # # Table name: order_transactions # # id :integer not null, primary key # order_id :integer # action :string(255) # amount :integer # success :boolean # authorization :string(255) # message :string(255) # ...
neeraji2it/sharetribe
app/helpers/api/people_helper.rb
module Api::PeopleHelper end
neeraji2it/sharetribe
spec/controllers/api/people_controller_spec.rb
require 'rails_helper' RSpec.describe Api::PeopleController, type: :controller do end
boostify/bic_validation
spec/bic_validation/bic_validator_spec.rb
require 'spec_helper' module BicValidation describe BicValidator do class Model include ActiveModel::Validations attr_accessor :bic validates :bic, bic: true def initialize(bic) @bic = bic end end it 'is valid' do model = Model.new 'DEUTDEFF' model.vali...
boostify/bic_validation
lib/bic_validation/bic.rb
<reponame>boostify/bic_validation<filename>lib/bic_validation/bic.rb require 'active_support/core_ext/object/try' module BicValidation class Bic attr_accessor :code def initialize(code) @code = code.to_s.strip.upcase end def of_valid_length? [8, 11].include? @code.length end de...
boostify/bic_validation
lib/bic_validation.rb
<reponame>boostify/bic_validation require 'active_model' require 'banking_data' require 'bic_validation/bic' require 'bic_validation/bic_validator' require 'bic_validation/version' module BicValidation end ActiveModel::Validations.send(:include, BicValidation) I18n.load_path += Dir[File.expand_path(File.join(File.dir...
boostify/bic_validation
lib/bic_validation/bic_validator.rb
module BicValidation class BicValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) bic = Bic.new(value) if bic.valid? unless bic.known? record.errors.add attribute, :unknown_bic end else record.errors.add attribute, :invalid e...
boostify/bic_validation
spec/bic_validation/bic_spec.rb
<filename>spec/bic_validation/bic_spec.rb require 'spec_helper' module BicValidation describe Bic do context 'with bogus data' do it 'survives nil data' do bic = Bic.new(nil) expect(bic).to be_invalid end it 'survives integer data' do bic = Bic.new(123) expect(b...
hsupu/kaiyuanshe
src/_plugins/DirGenerator.rb
# frozen_string_literal: true module Jekyll module Generators class DirectoryVariables < Generator def generate(site) baseurl = site.config['baseurl'] site.config['assets'] = { "favicon_dir" => "#{baseurl}/assets/favicon", ...
bricooke/active_merchant
lib/active_merchant/billing/bank_account.rb
module ActiveMerchant #:nodoc: module Billing #:nodoc: # == Description # This bank account object can be used as a stand alone object. It acts just like an ActiveRecord object # but doesn't support the .save method as its not backed by a database. # # For testing purposes, use the 'bogus' bank a...
bricooke/active_merchant
test/unit/bank_acccount_test.rb
<gh_stars>1-10 require File.dirname(__FILE__) + '/../test_helper' class BankAccountTest < Test::Unit::TestCase def setup @checking = bank_account(:account_number => '123456', :routing_number => '111000025', :type => 'checking') @savings = bank_account(:account_number => '123456', :routing_number => '1110000...
ChrisCrewdson/googlio
lib/mustachio/factories.rb
<reponame>ChrisCrewdson/googlio Magickly.add_convert_factory :mustachify do |c| c.convert_args do |eye_num_param, convert| identity = convert.pre_identify width = identity[:width] height = identity[:height] # resize to smaller than 900px, because Face.com downsizes the image to this anyway # TODO ...
hyc286716320/HYCBaseViewController
HYCBaseViewController.podspec
Pod::Spec.new do |s| s.name = 'HYCBaseViewController' s.version = '1.0' s.license = { :type => "MIT", :file => "LICENSE" } s.summary = 'UIViewController父类,能快速实现UINav的一些设置,非常实用' s.homepage = 'https://github.com/hyc286716320/HYCBaseViewController' s.author = {'HuYunchao' => 'hyc286716320'} s.source = { :gi...
february29/FchKit
FchKit.podspec
<gh_stars>0 # # Be sure to run `pod lib lint FchKit.podspec' to ensure this is a # valid spec before submitting. # # Any lines starting with a # are optional, but their use is encouraged # To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| s.name = '...
nedgar/rollout-ui
spec/rollout/ui/web_spec.rb
require 'spec_helper' ENV['APP_ENV'] = 'test' RSpec.describe 'Web UIp' do include Rack::Test::Methods def app Rollout::UI::Web end it "renders index html" do get '/' expect(last_response.body.include?('Rollout UI')) expect(last_response.status == 200) end it "renders index json" do RO...
badshark/http-cage
test/spec/httpcage_spec.rb
require_relative '_init' require 'net/http' require 'uri' describe 'HTTPCage' do before do HTTPCage.timeout(connection: 1, request: 2, ssl: 3) end it 'overrides Net::HTTP timeouts' do client = Net::HTTP.new('google.com') client.open_timeout.must_equal 1 client.read_timeout.must_equal 2 clien...
ritxi/shrine-reform
test/reform_test.rb
<filename>test/reform_test.rb<gh_stars>0 require "test_helper" require "reform" require "reform/rails" describe Shrine::Plugins::Reform do before do @uploader = uploader do plugin :activerecord plugin :reform end ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:...
ritxi/shrine-reform
test/test_helper.rb
<filename>test/test_helper.rb ENV["RAILS_ENV"] = "test" require "bundler/setup" require_relative "../test/dummy/config/environment" require "minitest/autorun" require "minitest/pride" require "shrine" require "shrine/storage/memory" require "shrine/plugins/reform" require "stringio" class Minitest::Spec def uploa...
mjacobus/landing-careers-challenge
lib/api_client.rb
class ApiClient def get(uri:, params: {}) raise "Cannot connect to the internet" end end
mjacobus/landing-careers-challenge
lib/user_service.rb
class UserService def initialize(api_client:) @client = api_client end def find_by_id(id) data = @client.get('/users/1') User.new(data) end end
mjacobus/landing-careers-challenge
spec/user_service_spec.rb
<filename>spec/user_service_spec.rb require "spec_helper" RSpec.describe UserService do let(:client) { double(ApiClient) } subject { UserService.new(api_client: client) } describe '#find_user_by_id' do before do allow(client).to receive(:get).with('/users/1').and_return({ id: 1, name:...
mjacobus/landing-careers-challenge
lib/user.rb
<gh_stars>0 class User attr_reader :id, :name def initialize(attributes = {}) @id = attributes[:id] @name = attributes[:name] end end
YaoJuan/by_mega
lib/mega_loto/drawing.rb
module MegaLoto class Drawing def draw 6.times.map { single_row } end private def single_row rand(0...60) end end end
YaoJuan/by_mega
lib/mega_loto.rb
<gh_stars>0 require "mega_loto/version" require 'mega_loto/drawing' begin require "pry" rescue LoadError end module MegaLoto end
dryack/clij
clij.rb
<gh_stars>0 #! /usr/local/opt/ruby193/bin/ruby # *sigh* require 'jenkins_api_client' require 'yaml' require 'net/https' require 'cron2english' require 'gli' require './Logd' require './clij-lib' include GLI::App program_desc 'Manage Jenkins via command line' subcommand_option_handling :normal sort_help :manually con...
dryack/clij
Logd.rb
require 'logger' class Logger # Creates or opens a secondary log file. def attach(name) @logdev.attach(name) end # Closes a secondary log file. def detach(name) @logdev.detach(name) end class LogDevice # :nodoc: attr_reader :devs def attach(log) @devs ||= {} @devs[log] = op...
dryack/clij
clij-lib.rb
require 'jenkins_api_client' require 'net/https' require 'cron2english' require './Logd' class Waldo def new(*job) initialize(job) end def initialize(*job) @DUMP_FILE = ".clij-list.tmp" @HOMEDIR = File.expand_path("~") $log.debug("\nEntering Waldo::initialize") unless job.empty? || j...
markus/googlecharts
lib/gchart/aliases.rb
class Gchart alias_method :background=, :bg= alias_method :chart_bg=, :graph_bg= alias_method :chart_color=, :graph_bg= alias_method :chart_background=, :graph_bg= alias_method :bar_color=, :bar_colors= alias_method :line_colors=, :bar_colors= alias_method :line_color=, :bar_colors= alias_method :sli...
markus/googlecharts
lib/gchart/version.rb
module GchartInfo #:nodoc: VERSION = "1.6.7" end