repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
videlanicolas/puppet-ceph | lib/puppet/provider/ceph_config/ini_setting.rb | # Copyright (C) <NAME> <<EMAIL>>
#
# 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... |
videlanicolas/puppet-ceph | spec/defines/ceph_osd_spec.rb | #
# Copyright (C) 2014 Cloudwatt <<EMAIL>>
#
# 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... |
BenMorganIO/astrometry | lib/astrometry.rb | %w(version image).each do |file|
require "astrometry/#{file}"
end
module Astrometry
end
|
BenMorganIO/astrometry | lib/astrometry/image.rb | module Astrometry
class Image
# @param input [String] The input is the file that is to be parsed by astrometry.
attr_accessor :input
# @param file [String] The file that is to be parsed.
# @return [String]
def initialize(file)
@input = file
end
# Executes the astrometry `solve-fiel... |
BenMorganIO/astrometry | lib/astrometry/version.rb | <gh_stars>0
module Astrometry
# @return [String]
VERSION = '0.0.1'
end
|
MortenGregersen/ios-smoke-test-app | CalSmokeApp/features/step_definitions/screenshot_steps.rb | <gh_stars>10-100
module CalSmokeApp
module Screenshots
require 'fileutils'
# SCREENSHOT_PATH for this project is set in the config/cucumber.yml
#
# The value is ./screenshots
#
# If the ./screenshots directory does not exist, the erb in the
# config/cucumber.yml will create it.
#
... |
MortenGregersen/ios-smoke-test-app | CalSmokeApp/features/step_definitions/shared_steps.rb | Given(/^I see the (controls|gestures|scrolls|special|date picker) tab$/) do |tab|
wait_for_element_exists("tabBarButton")
case tab
when 'controls'
index = 0
when 'gestures'
index = 1
when 'scrolls'
index = 2
when 'special'
index = 3
when 'date picker'
index = 4
end
touch("tabBarBut... |
MortenGregersen/ios-smoke-test-app | CalSmokeApp/features/support/env.rb | # Do not use Calabash pre-defined steps.
require 'calabash-cucumber/wait_helpers'
require 'calabash-cucumber/operations'
World(Calabash::Cucumber::Operations)
require 'rspec'
require 'chronic'
# Pry is not allowed on the Xamarin Test Cloud. This will force a validation
# error if you mistakenly submit a binding.pry ... |
MortenGregersen/ios-smoke-test-app | CalSmokeApp/features/support/dylib.rb | module CalSmoke
module Dylib
@@dylib = nil
def self.dylib
@@dylib ||= lambda {
git_path = File.expand_path('~/git/calabash/calabash-ios-server/calabash-dylibs/libCalabashDynSim.dylib')
if File.exist? git_path
git_path
else
File.expand_path(File.join(File.dir... |
MortenGregersen/ios-smoke-test-app | CalSmokeApp/features/support/list_tags.rb | <gh_stars>10-100
=begin
Copyright (c) 2012, <NAME>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and ... |
MortenGregersen/ios-smoke-test-app | CalSmokeApp/features/step_definitions/flash_steps.rb | <gh_stars>10-100
Then(/^I can flash the buttons$/) do
views = flash('UIButton')
expect(views.length).to be == 3
end
And(/^I can flash the labels in the tab bar$/) do
views = flash("UITabBar descendant UITabBarButton descendant label")
expect(views.length).to be == 5
end
When(/^the flash query matches no view... |
MortenGregersen/ios-smoke-test-app | CalSmokeApp/features/step_definitions/sheets_steps.rb | module CalSmoke
module Sheets
def sheet_query
if ios7?
'UIActionSheet'
else
"view:'_UIAlertControllerView'"
end
end
def sheet_exists?(sheet_title=nil)
if sheet_title.nil?
!query(sheet_query).empty?
else
!query("#{sheet_query} descendant label... |
MortenGregersen/ios-smoke-test-app | CalSmokeApp/features/step_definitions/keyboard_steps.rb | <filename>CalSmokeApp/features/step_definitions/keyboard_steps.rb
module CalSmokeApp
module Keyboard
end
end
World(CalSmokeApp::Keyboard)
|
MortenGregersen/ios-smoke-test-app | CalSmokeApp/features/step_definitions/selector_steps.rb | <filename>CalSmokeApp/features/step_definitions/selector_steps.rb
module CalSmoke
module Selectors
def call_selector(array_or_symbol)
query("view marked:'controls page'", array_or_symbol)
end
def returned_from_selector(array_or_symbol)
result = call_selector(array_or_symbol)
if result.... |
MortenGregersen/ios-smoke-test-app | CalSmokeApp/features/step_definitions/server_log_level_steps.rb | <filename>CalSmokeApp/features/step_definitions/server_log_level_steps.rb
Then(/^I can ask the server for its log level$/) do
expect(server_log_level).to be == 'info'
end
And(/^I set the server log level to debug$/) do
expect(set_server_log_level('debug')).to be == 'debug'
end
Then(/^the server log level should ... |
MortenGregersen/ios-smoke-test-app | CalSmokeApp/features/step_definitions/issue_246_screenshot_steps.rb | <reponame>MortenGregersen/ios-smoke-test-app
module CalSmokeApp
module ScreenshotEmbed
def screenshot_count
screenshot_dir = ENV["SCREENSHOT_PATH"]
if !screenshot_dir
screenshot_dir = "./screenshots"
end
unless File.exist?(screenshot_dir)
FileUtils.mkdir_p(screenshot_dir)... |
MortenGregersen/ios-smoke-test-app | CalSmokeApp/spec/support/ideviceinstaller/unit/installer_spec.rb | describe 'Calabash IDeviceInstaller' do
let(:ipa_path) {
ipa_path = File.expand_path('./xtc-staging/CalSmoke-cal.ipa')
unless File.exist?(ipa_path)
system('make', 'ipa-cal')
end
ipa_path
}
let(:udid) { 'device udid' }
let(:device) { RunLoop::Device.new('denis', '8.3', udid) }
let(:fa... |
MortenGregersen/ios-smoke-test-app | CalSmokeApp/features/step_definitions/slider_steps.rb |
Then(/^I can get the min and max values of the slider$/) do
query = "UISlider marked:'slider'"
options = wait_options(query)
wait_for_elements_exist(query, options)
max = query(query, :maximumValue).first
min = query(query, :minimumValue).first
expect(max).to be == 10
expect(min).to be == -10
end
And(... |
MortenGregersen/ios-smoke-test-app | CalSmokeApp/features/support/wait_options.rb | require 'calabash-cucumber/wait_helpers'
module CalSmokeApp
module WaitOpts
include Calabash::Cucumber::WaitHelpers
# A convenience function for passing wait options to a wait_for* function
# @return [Hash] default wait options
#
# Pass this to your wait_for_* functions
#
# @param [Stri... |
MortenGregersen/ios-smoke-test-app | CalSmokeApp/spec/support/ideviceinstaller/integration/ideviceinstaller_spec.rb | module IDeviceId
def self.binary
binary = `which idevice_id`.strip
if binary.nil? || binary.empty?
nil
else
binary
end
end
def self.idevice_id_bin_path
self.binary || '/usr/local/bin/idevice_id'
end
def self.idevice_id_available?
File.exist?(self.idevice_id_bin_path)
... |
MortenGregersen/ios-smoke-test-app | CalSmokeApp/features/step_definitions/drag_and_drop_steps.rb | <gh_stars>10-100
module CalSmokeApp
module DragAndDrop
class Color
attr_reader :red, :green, :blue
def initialize(red, green, blue)
@red = red
@green = green
@blue = blue
end
def to_s
"#<Color #{red}, #{green}, #{blue}>"
end
def inspect
... |
MortenGregersen/ios-smoke-test-app | CalSmokeApp/features/step_definitions/user_defaults_steps.rb | module Calabash
module IOS
module ResetBetweenScenarioSteps
def qstr_for_switch
"view marked:'controls page' switch marked:'switch'"
end
def switch_state
qstr = qstr_for_switch
res = nil
wait_for do
res = query(qstr, :isOn).first
not res.nil?
... |
MortenGregersen/ios-smoke-test-app | CalSmokeApp/features/support/dry_run.rb | require "calabash-cucumber"
|
MortenGregersen/ios-smoke-test-app | CalSmokeApp/features/step_definitions/keychain_steps.rb | <filename>CalSmokeApp/features/step_definitions/keychain_steps.rb
module Calabash
module IOS
module KeychainSteps
def keychain_service_name
'calabash.smoke.test.app.service'
end
end
end
end
World(Calabash::IOS::KeychainSteps)
When(/^I clear the keychain$/) do
keychain_clear_accounts_... |
MortenGregersen/ios-smoke-test-app | CalSmokeApp/features/support/ideviceinstaller.rb | require "tmpdir"
require "fileutils"
require "run_loop"
require "csv"
module Calabash
# A model of the an .ipa - a application binary for iOS devices.
class IPA
# The path to this .ipa.
# @!attribute [r] path
# @return [String] A path to this .ipa.
attr_reader :path
# The bundle identifier ... |
MortenGregersen/ios-smoke-test-app | CalSmokeApp/spec/support/ideviceinstaller/unit/ipa_spec.rb | describe 'Calabash IPA' do
let(:ipa_path) {
ipa_path = File.expand_path('./xtc-staging/CalSmoke-cal.ipa')
unless File.exist?(ipa_path)
system('make', 'ipa-cal')
end
ipa_path
}
let(:ipa) { Calabash::IPA.new(ipa_path) }
describe '.new' do
describe 'raises an exception' do
it 'wh... |
MortenGregersen/ios-smoke-test-app | CalSmokeApp/features/pages/pom.rb | module POM
require "calabash-cucumber/ibase"
class HomePage < Calabash::IBase
def my_buggy_method
screenshot_and_raise 'Hey!'
end
end
end
|
MortenGregersen/ios-smoke-test-app | CalSmokeApp/features/step_definitions/german_steps.rb |
Then(/^I see localized text "([^"]*)"$/) do |text|
query = "* marked:'localized label'"
wait_for do
!query(query).empty?
end
actual = query(query).first["text"]
unless actual == text
fail(%Q[Expected text to be localized, but found:
actual: #{actual}
expected: #{text}
])
end
end
|
MortenGregersen/ios-smoke-test-app | CalSmokeApp/features/step_definitions/pan_steps.rb | When(/^I pan left on the screen$/) do
top_view = query('*').first
rect = top_view['rect']
from_x = 0
from_y = rect['height'] * 0.5
from_offset = {x: from_x, y: from_y}
to_x = rect['width'] * 0.75
to_y = from_y
to_offset = {x: to_x, y: to_y}
pan_coordinates(from_offset, to_offset, {duration: 0.5})
... |
MortenGregersen/ios-smoke-test-app | CalSmokeApp/features/pages/not_pom.rb | <filename>CalSmokeApp/features/pages/not_pom.rb
module NotPOM
class HomePage
include Calabash::Cucumber::Operations
def my_buggy_method
screenshot_and_raise 'Hey!'
end
end
end
|
MortenGregersen/ios-smoke-test-app | CalSmokeApp/config/xtc-other-gems.rb | <reponame>MortenGregersen/ios-smoke-test-app<gh_stars>0
gem 'retriable', '~> 2.0'
gem "cucumber", "~> 2.0"
gem "xamarin-test-cloud", "~> 2.0"
gem 'rake', '~> 10.3'
gem 'bundler', '~> 1.6'
gem 'xcpretty', '~> 0.1'
gem 'rspec', '~> 3.0'
gem 'pry'
gem 'pry-nav'
gem 'luffa', '~> 1.0', '>= 1.0.2'
gem 'chronic', '>= 0.10.2',... |
MortenGregersen/ios-smoke-test-app | CalSmokeApp/features/step_definitions/scroll_steps.rb |
Then(/^I see the scrolling views table$/) do
query = "UITableView marked:'table'"
options = wait_options('Scrolling views table')
wait_for_element_exists(query, options)
end
When(/^I touch the (collection|table|scroll) views row$/) do |row_name|
query = "UITableViewCell marked:'#{row_name} views row'"
opti... |
MortenGregersen/ios-smoke-test-app | CalSmokeApp/features/step_definitions/animations_steps.rb |
Then(/^I wait for all animations to stop$/) do
timeout = 4
message = "Waited #{timeout} seconds for all animations to stop"
options = {timeout: timeout, timeout_message: message}
# Test for: https://github.com/calabash/calabash-ios-server/pull/142
# When checking for no animation, ignore animations with tr... |
MortenGregersen/ios-smoke-test-app | CalSmokeApp/bin/make/install-test-binaries.rb | #!/usr/bin/env ruby
require 'fileutils'
cal_app = File.expand_path('Products/app/CalSmoke-cal/CalSmoke-cal.app')
cal_ipa = File.expand_path('Products/ipa/CalSmoke-cal/CalSmoke-cal.ipa')
app = File.expand_path('Products/app/CalSmoke/no-calabash/CalSmoke.app')
ipa = File.expand_path('Products/ipa/CalSmoke/no-calabash/C... |
smartwaivercom/ruby-sdk | lib/smartwaiver-sdk/user_client.rb | <filename>lib/smartwaiver-sdk/user_client.rb
#
# Copyright 2018 Smartwaiver
#
# 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 requi... |
smartwaivercom/ruby-sdk | spec/smartwaiver-sdk/dynamic_template_spec.rb | dir = File.dirname(__FILE__)
require "#{dir}/../spec_helper"
require "#{dir}/../../lib/smartwaiver-sdk/dynamic_template"
describe SmartwaiverDynamicTemplate do
before do
FakeWeb.allow_net_connect = false
end
describe "dynamic templates" do
it "#initialize" do
dt = SmartwaiverDynamicTemplate.new
... |
smartwaivercom/ruby-sdk | examples/search/search_params.rb | <filename>examples/search/search_params.rb
#
# Copyright 2018 Smartwaiver
#
# 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 require... |
smartwaivercom/ruby-sdk | spec/smartwaiver-sdk/user_client_spec.rb | <gh_stars>1-10
dir = File.dirname(__FILE__)
require "#{dir}/../spec_helper"
require "#{dir}/../../lib/smartwaiver-sdk/user_client"
describe SmartwaiverUserClient do
attr_reader :client, :api_key
before do
FakeWeb.allow_net_connect = false
@api_key = "apikey"
@client = SmartwaiverUserClient.new(@api_ke... |
smartwaivercom/ruby-sdk | lib/smartwaiver-sdk/dynamic_template_data.rb | #
# Copyright 2018 Smartwaiver
#
# 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... |
smartwaivercom/ruby-sdk | spec/smartwaiver-sdk/base_spec.rb |
dir = File.dirname(__FILE__)
require "#{dir}/../spec_helper"
require "#{dir}/../../lib/smartwaiver-sdk/smartwaiver_base"
class SmartwaiverTest < SmartwaiverSDK::SmartwaiverBase
def get_test(path)
make_api_request(path, HTTP_GET)
end
def post_test(path, data)
make_api_request(path, HTTP_POST, data)
en... |
smartwaivercom/ruby-sdk | lib/smartwaiver-sdk/dynamic_template.rb | #
# Copyright 2018 Smartwaiver
#
# 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... |
smartwaivercom/ruby-sdk | examples/templates/retrieve_single_template.rb | <filename>examples/templates/retrieve_single_template.rb
#
# Copyright 2018 Smartwaiver
#
# 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
#
# ... |
smartwaivercom/ruby-sdk | spec/smartwaiver-sdk/webhook_queues_client_spec.rb | dir = File.dirname(__FILE__)
require "#{dir}/../spec_helper"
require "#{dir}/../../lib/smartwaiver-sdk/webhook_queues_client"
describe SmartwaiverWebhookQueuesClient do
attr_reader :client, :api_key
before do
FakeWeb.allow_net_connect = false
@api_key = "apikey"
@client = SmartwaiverWebhookQueuesClien... |
smartwaivercom/ruby-sdk | spec/smartwaiver-sdk/search_client_spec.rb | <reponame>smartwaivercom/ruby-sdk
dir = File.dirname(__FILE__)
require "#{dir}/../spec_helper"
require "#{dir}/../../lib/smartwaiver-sdk/search_client"
describe SmartwaiverSearchClient do
attr_reader :client, :api_key
before do
FakeWeb.allow_net_connect = false
@api_key = "apikey"
@client = Smartwaive... |
smartwaivercom/ruby-sdk | lib/smartwaiver-sdk/search_client.rb | <reponame>smartwaivercom/ruby-sdk
#
# Copyright 2018 Smartwaiver
#
# 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 appl... |
smartwaivercom/ruby-sdk | spec/smartwaiver-sdk/webhook_client_spec.rb | dir = File.dirname(__FILE__)
require "#{dir}/../spec_helper"
require "#{dir}/../../lib/smartwaiver-sdk/webhook_client"
describe SmartwaiverWebhookClient do
attr_reader :client, :api_key
before do
FakeWeb.allow_net_connect = false
@api_key = "apikey"
@client = SmartwaiverWebhookClient.new(@api_key)
e... |
smartwaivercom/ruby-sdk | examples/queues/retrieve_account_message.rb | #
# Copyright 2018 Smartwaiver
#
# 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... |
smartwaivercom/ruby-sdk | lib/smartwaiver-sdk/template_client.rb | <filename>lib/smartwaiver-sdk/template_client.rb
#
# Copyright 2018 Smartwaiver
#
# 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 r... |
smartwaivercom/ruby-sdk | lib/smartwaiver-sdk/dynamic_template_client.rb | #
# Copyright 2018 Smartwaiver
#
# 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... |
smartwaivercom/ruby-sdk | examples/queues/retrieve_webhook_queues.rb | <reponame>smartwaivercom/ruby-sdk
#
# Copyright 2018 Smartwaiver
#
# 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 appl... |
smartwaivercom/ruby-sdk | lib/smartwaiver-sdk/webhook_client.rb | <reponame>smartwaivercom/ruby-sdk<gh_stars>1-10
#
# Copyright 2018 Smartwaiver
#
# 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 re... |
smartwaivercom/ruby-sdk | lib/smartwaiver-sdk.rb | <gh_stars>1-10
dir = File.dirname(__FILE__)
require 'net/https'
require 'uri'
require 'cgi'
require "#{dir}/smartwaiver-sdk/smartwaiver_errors"
require "#{dir}/smartwaiver-sdk/smartwaiver_base"
require "#{dir}/smartwaiver-sdk/smartwaiver_version"
|
smartwaivercom/ruby-sdk | lib/smartwaiver-sdk/smartwaiver_errors.rb | #
# Copyright 2018 Smartwaiver
#
# 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... |
smartwaivercom/ruby-sdk | spec/smartwaiver-sdk/dynamic_template_data_spec.rb | <reponame>smartwaivercom/ruby-sdk
dir = File.dirname(__FILE__)
require "#{dir}/../spec_helper"
require "#{dir}/../../lib/smartwaiver-sdk/dynamic_template_data"
describe SmartwaiverDynamicTemplateData do
before do
FakeWeb.allow_net_connect = false
end
describe "dynamic template data" do
it "#initialize"... |
smartwaivercom/ruby-sdk | examples/webhooks/set_webhooks.rb | <filename>examples/webhooks/set_webhooks.rb
#
# Copyright 2018 Smartwaiver
#
# 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 requir... |
smartwaivercom/ruby-sdk | examples/waivers/list_all_waivers.rb | <reponame>smartwaivercom/ruby-sdk<gh_stars>1-10
#
# Copyright 2018 Smartwaiver
#
# 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 re... |
smartwaivercom/ruby-sdk | examples/waivers/waiver_properties.rb | <reponame>smartwaivercom/ruby-sdk
#
# Copyright 2018 Smartwaiver
#
# 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 appl... |
smartwaivercom/ruby-sdk | spec/smartwaiver-sdk/waiver_client_spec.rb | <filename>spec/smartwaiver-sdk/waiver_client_spec.rb
dir = File.dirname(__FILE__)
require "#{dir}/../spec_helper"
require "#{dir}/../../lib/smartwaiver-sdk/waiver_client"
describe SmartwaiverWaiverClient do
attr_reader :client, :api_key
before do
FakeWeb.allow_net_connect = false
@api_key = "apikey"
@... |
smartwaivercom/ruby-sdk | spec/smartwaiver-sdk/keys_client_spec.rb | dir = File.dirname(__FILE__)
require "#{dir}/../spec_helper"
require "#{dir}/../../lib/smartwaiver-sdk/keys_client"
describe SmartwaiverKeysClient do
attr_reader :client, :api_key
before do
FakeWeb.allow_net_connect = false
@api_key = "apikey"
@client = SmartwaiverKeysClient.new(@api_key)
end
des... |
smartwaivercom/ruby-sdk | examples/dynamic-templates/create_dynamic_template.rb | <gh_stars>1-10
#
# Copyright 2018 Smartwaiver
#
# 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 agree... |
smartwaivercom/ruby-sdk | examples/search/basic_search.rb | #
# Copyright 2018 Smartwaiver
#
# 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... |
smartwaivercom/ruby-sdk | examples/dynamic-templates/process_dynamic_template.rb | #
# Copyright 2018 Smartwaiver
#
# 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... |
smartwaivercom/ruby-sdk | lib/smartwaiver-sdk/smartwaiver_version.rb | <filename>lib/smartwaiver-sdk/smartwaiver_version.rb
#
# Copyright 2018 Smartwaiver
#
# 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
#
# Unle... |
smartwaivercom/ruby-sdk | examples/dynamic-templates/create_dynamic_template_advanced.rb | #
# Copyright 2018 Smartwaiver
#
# 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... |
smartwaivercom/ruby-sdk | examples/waivers/waiver_summary_properties.rb | <filename>examples/waivers/waiver_summary_properties.rb
#
# Copyright 2018 Smartwaiver
#
# 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
#
# U... |
smartwaivercom/ruby-sdk | lib/smartwaiver-sdk/smartwaiver_base.rb | #
# Copyright 2018 Smartwaiver
#
# 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... |
smartwaivercom/ruby-sdk | spec/spec_helper.rb | dir = File.dirname(__FILE__)
require 'rubygems'
require 'fakeweb'
require 'rr'
require 'json'
$LOAD_PATH << "#{dir}/../lib/smartwaiver-sdk"
require 'smartwaiver_base'
require 'smartwaiver_errors'
API_URL = 'https://api.smartwaiver.com'
def json_parse(data)
JSON.parse(data, :symbolize_names => true)
end
def json_... |
smartwaivercom/ruby-sdk | examples/waivers/retrieve_single_waiver.rb | #
# Copyright 2018 Smartwaiver
#
# 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... |
smartwaivercom/ruby-sdk | examples/waivers/retrieve_waiver_photos.rb | <filename>examples/waivers/retrieve_waiver_photos.rb
#
# Copyright 2018 Smartwaiver
#
# 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
#
# Unle... |
smartwaivercom/ruby-sdk | spec/smartwaiver-sdk/template_client_spec.rb | <reponame>smartwaivercom/ruby-sdk
dir = File.dirname(__FILE__)
require "#{dir}/../spec_helper"
require "#{dir}/../../lib/smartwaiver-sdk/template_client"
describe SmartwaiverTemplateClient do
attr_reader :client, :api_key
before do
FakeWeb.allow_net_connect = false
@api_key = "apikey"
@client = Smartw... |
junara/kindle_stocker | lib/kindle_stocker/config.rb | # frozen_string_literal: true
require 'yaml'
require 'active_support/all'
module KindleStocker
class Config
extend Forwardable
attr_reader :yaml
def initialize(lang = 'ja')
common_hash = HashWithIndifferentAccess.new(YAML.load_file(File.join(__dir__, 'config', common_filename)))
custom_has... |
junara/kindle_stocker | lib/kindle_stocker/base.rb | <reponame>junara/kindle_stocker
# frozen_string_literal: true
require 'forwardable'
module KindleStocker
class Base
extend Forwardable
delegate %i[sign_in sign_out] => :sign_in_browser
attr_reader :browser, :sign_in_browser, :lang
def initialize(browser_path: nil, system: :mac, lang: :ja)
@bro... |
junara/kindle_stocker | lib/kindle_stocker/browser.rb | # frozen_string_literal: true
require 'forwardable'
require 'ferrum'
require_relative 'sign_in'
module KindleStocker
class Browser
extend Forwardable
delegate %i[goto at_css screenshot cookies css] => :browser
attr_reader :browser
def initialize(browser_path: nil, system: :mac)
config_path =... |
junara/kindle_stocker | lib/kindle_stocker/books.rb | # frozen_string_literal: true
module KindleStocker
class Books
attr_reader :browser, :base_url, :collection
def initialize
@collection = []
end
def load(browser, lang)
@collection = []
config = KindleStocker::Config.new(lang)
browser.goto(config.books[:url])
sleep(1)
... |
junara/kindle_stocker | lib/kindle_stocker/sign_in.rb | # frozen_string_literal: true
module KindleStocker
class SignIn
attr_reader :browser, :email_input_css, :password_input_css, :url, :sign_in_submit_css, :config
def initialize(browser, lang)
@config = KindleStocker::Config.new(lang)
@browser = browser
@url = config.sign_in[:url]
@emai... |
junara/kindle_stocker | lib/kindle_stocker/highlight.rb | # frozen_string_literal: true
module KindleStocker
class Highlight
attr_accessor :id, :location, :note, :highlight
def initialize(id:, location: nil, note: nil, highlight: nil)
@id = id
@location = location
@note = note
@highlight = highlight
end
end
end
|
junara/kindle_stocker | lib/kindle_stocker/book.rb | # frozen_string_literal: true
module KindleStocker
class Book
attr_accessor :asin, :img_src, :title, :authors, :last_accessed_date, :highlights
def initialize
@highlights = []
end
def assign_params(asin:, img_src: nil, title: nil, authors: nil, last_accessed_date: nil)
@asin = asin
... |
junara/kindle_stocker | lib/kindle_stocker.rb | # frozen_string_literal: true
require_relative 'kindle_stocker/version'
require_relative 'kindle_stocker/sign_in'
require_relative 'kindle_stocker/browser'
require_relative 'kindle_stocker/config'
require_relative 'kindle_stocker/base'
require_relative 'kindle_stocker/books'
require_relative 'kindle_stocker/book'
requ... |
pre/apila | spec/species_spec.rb | <reponame>pre/apila<filename>spec/species_spec.rb
require "#{File.dirname(__FILE__)}/spec_helper"
describe 'Species' do
before(:each) do
end
specify 'should have translated names' do
species = Factory.create(:species)
species.names.first(:language => 'S').should_not be_blank
end
specify 'should ret... |
pre/apila | spec/application_spec.rb | require "#{File.dirname(__FILE__)}/spec_helper"
describe 'Application' do
include Rack::Test::Methods
def app
Sinatra::Application.new
end
specify 'should show the default index page' do
get '/'
last_response.should be_ok
end
describe 'API XML responses' do
specify 'should return 404 wh... |
pre/apila | lib/lexicon.rb | class Lexicon
include DataMapper::Resource
storage_names[:default] = 'sanasto'
property :category, Integer, :field => 'satunnus', :required => true, :key => true
property :language, String, :field => 'sakieli', :required => true, :key => true
property :code, String, :field =>... |
pre/apila | lib/ringer.rb | <filename>lib/ringer.rb
class Ringer
include DataMapper::Resource
storage_names[:default] = 'rengastaja'
property :id, Serial, :field => 'renro'
property :email, String, :field => 'reemail'
property :first_name, String, :field => 'reetunimi'
property :last_name, String, :field => 'resukun... |
pre/apila | lib/species.rb | class Species
include DataMapper::Resource
storage_names[:default] = 'laji'
property :id, String, :field => 'lanro', :key => true
property :code, String, :field => 'lalyh', :required => true
has n, :names, 'Lexicon', :parent_key => :id, :child_key => :code, :category => 8
de... |
pre/apila | config.ru | require 'application'
set :run, false
set :environment, ENV['RACK_ENV'].to_sym
FileUtils.mkdir_p AppConfig.log.directory unless File.exists?(AppConfig.log.directory)
log = File.new(File.join(AppConfig.log.directory, AppConfig.log.filename), "a+")
$stdout.reopen(log)
$stderr.reopen(log)
run Sinatra::Application
|
pre/apila | lib/environment_centre.rb | <reponame>pre/apila<filename>lib/environment_centre.rb
class EnvironmentCentre
include DataMapper::Resource
storage_names[:default] = 'ympkesk'
property :id, Serial, :field => 'ympk_numero', :required => true, :key => true
property :name, String, :field => 'ympk_nimi', :required =... |
pre/apila | lib/municipality.rb | class Municipality
include DataMapper::Resource
storage_names[:default] = 'kunta'
property :id, Serial, :field => 'kunro', :key => true
property :code, String, :field => 'kulyh', :required => true
property :name, String, :field => 'kunimi'
property :latitude, ... |
pre/apila | spec/ringer_spec.rb | <filename>spec/ringer_spec.rb
require "#{File.dirname(__FILE__)}/spec_helper"
describe 'Ringer' do
before(:each) do
@ringer = Ringer.new(:id => "10000", :first_name => 'Pekka', :last_name => 'Sormisuu', :email => "<EMAIL>")
end
specify 'should have a name composed of first and last name' do
@ringer.na... |
pre/apila | spec/z_factories.rb | require 'factory_girl'
Factory.sequence :email do |n|
"<EMAIL>"
end
Factory.define :ringer do |f|
f.first_name "Jouni"
f.last_name "Kemppainen"
f.email Factory.next(:email)
f.sequence(:id) { |n| "#{n}" }
end
Factory.define :municipality do |f|
f.code "AHLAIN"
f.name "AHLAINEN"
f.longitude 21.6666698
... |
pre/apila | environment.rb | <reponame>pre/apila
require 'rubygems'
require 'dm-core'
require 'app_config'
require 'json'
require 'nokogiri'
require 'dm-migrations'
require 'dm-serializer'
require 'sinatra' unless defined?(Sinatra)
configure do
# load models
$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/lib")
Dir.glob("#{File.dirname(__F... |
pre/apila | spec/municipality_spec.rb | require "#{File.dirname(__FILE__)}/spec_helper"
describe Municipality do
specify 'should return a filtered array of municipalities' do
code = "AABB"
valid = []
["#{code}AA", code, "#{code}CC", "#{code}1"].each do |matched_code|
valid << Factory.create(:municipality, :code => matched_code)
end... |
pre/apila | application.rb | require 'rubygems'
require 'sinatra'
require 'environment'
configure do
set :views, "#{File.dirname(__FILE__)}/views"
end
error do
e = request.env['sinatra.error']
Kernel.puts e.backtrace.join("\n")
'Application error'
end
helpers do
end
not_found do
content_type :text
"404 Not Found"
end
before do
c... |
arthurdandrea/sequel-activemodel | lib/sequel-activemodel.rb | <reponame>arthurdandrea/sequel-activemodel
require 'sequel/activemodel'
|
arthurdandrea/sequel-activemodel | lib/sequel/plugins/active_model_callbacks.rb | require 'active_model'
module Sequel
module Plugins
module ActiveModelCallbacks
def self.apply(model, *args)
model.plugin :active_model
model.extend ::ActiveModel::Callbacks
model.define_model_callbacks(:save, :create, :update, :destroy)
model.define_callbacks(:validation,
... |
arthurdandrea/sequel-activemodel | spec/spec_helper.rb | $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'sequel'
require 'sequel/activemodel'
require 'sequel/plugins/active_model' # preload
require 'sequel/plugins/active_model_callbacks'
require 'sequel/plugins/active_model_translations'
require 'sequel/plugins/active_model_validations'
|
arthurdandrea/sequel-activemodel | sequel-activemodel.gemspec | <reponame>arthurdandrea/sequel-activemodel<filename>sequel-activemodel.gemspec
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'sequel/activemodel/version'
Gem::Specification.new do |spec|
spec.name = 'sequel-activemodel'
spec.vers... |
arthurdandrea/sequel-activemodel | lib/sequel/plugins/active_model_validations.rb | require 'active_model'
module Sequel::Validations
def self.const_missing(name)
begin
const = ActiveModel::Validations.const_get(name)
rescue NameError
const = super
end
const_set(name, const)
const
end
class UniquenessValidator < ActiveModel::EachValidator
def initialize(opti... |
arthurdandrea/sequel-activemodel | spec/sequel/plugins/active_model_callbacks_spec.rb | <reponame>arthurdandrea/sequel-activemodel
require 'spec_helper'
describe Sequel::Plugins::ActiveModelCallbacks do
let(:db) do
db = Sequel.sqlite
db.execute "CREATE TABLE tablename(a,b);"
db
end
let(:model) do
model = Class.new(Sequel.Model(db[:tablename]))
model.plugin :active_model_callbac... |
arthurdandrea/sequel-activemodel | lib/sequel/plugins/active_model_translations.rb | require 'active_model'
module Sequel
module Plugins
module ActiveModelTranslations
def self.apply(model)
model.plugin :active_model
end
module ClassMethods
include ::ActiveModel::Translation
# Set the i18n scope to overwrite ActiveModel.
def i18n_scope #:nodoc:... |
arthurdandrea/sequel-activemodel | lib/sequel/activemodel/version.rb | module Sequel
module ActiveModel
VERSION = '0.1.0'
end
end
|
arthurdandrea/sequel-activemodel | spec/sequel/plugins/active_model_translations_spec.rb | <gh_stars>1-10
require 'spec_helper'
describe Sequel::Plugins::ActiveModelTranslations do
let(:model) do
model = Class.new(Sequel::Model)
model.plugin :active_model_translations
model
end
# filter out the Sequel::Model from the plugins Array
# it is causing trouble with rspec beautiful error gener... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.