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 | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/radio_spec.rb | Ruby | bsd-3-clause | 46 | master | 11,759 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "Radio" do
before :each do
browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
end
# Exists method
describe "#exists?" do
it "returns true if the radio button exists" do
browser.radio(:id, "new_user_ne... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/dts_spec.rb | Ruby | bsd-3-clause | 46 | master | 805 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "Dts" do
before :each do
browser.goto(WatirSpec.files + "/definition_lists.html")
end
describe "#length" do
it "returns the number of dts" do
browser.dts.length.should == 11
end
end
describe "#[]" do
it "... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/table_cells_spec.rb | Ruby | bsd-3-clause | 46 | master | 1,975 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "TableCells" do
before :each do
browser.goto(WatirSpec.files + "/tables.html")
end
# describe "#length" do
# it "returns the number of cells" do
# browser.table(:id, 'outer').cells.length.should == 6
# browser.table... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/pre_spec.rb | Ruby | bsd-3-clause | 46 | master | 4,769 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "Pre" do
before :each do
browser.goto(WatirSpec.files + "/non_control_elements.html")
end
# Exists method
describe "#exist?" do
it "returns true if the 'p' exists" do
browser.pre(:id, "rspec").should exist
bro... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/table_spec.rb | Ruby | bsd-3-clause | 46 | master | 6,030 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "Table" do
before :each do
browser.goto(WatirSpec.files + "/tables.html")
end
# Exists
describe "#exists?" do
it "returns true if the table exists" do
browser.table(:id, 'axis_example').should exist
browser.ta... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/button_spec.rb | Ruby | bsd-3-clause | 46 | master | 9,898 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "Button" do
before :each do
browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
end
# Exists method
describe "#exists?" do
it "returns true if the button exists" do
browser.button(:id, "new_user_submit"... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/ps_spec.rb | Ruby | bsd-3-clause | 46 | master | 782 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "Ps" do
before :each do
browser.goto(WatirSpec.files + "/non_control_elements.html")
end
describe "#length" do
it "returns the number of ps" do
browser.ps.length.should == 5
end
end
describe "#[]" do
it "... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/table_footers_spec.rb | Ruby | bsd-3-clause | 46 | master | 1,583 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
bug "WTR-358", :watir do
describe "TableFooters" do
before :each do
browser.goto(WatirSpec.files + "/tables.html")
end
describe "#length" do
it "returns the correct number of table tfoots (page context)" do
brows... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/divs_spec.rb | Ruby | bsd-3-clause | 46 | master | 824 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "Divs" do
before :each do
browser.goto(WatirSpec.files + "/non_control_elements.html")
end
describe "#length" do
it "returns the number of divs" do
browser.divs.length.should == 12
end
end
describe "#[]" do
... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/text_fields_spec.rb | Ruby | bsd-3-clause | 46 | master | 1,018 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "TextFields" do
before :each do
browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
end
describe "#length" do
it "returns the number of text fields" do
browser.text_fields.length.should == 9
end
en... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/frames_spec.rb | Ruby | bsd-3-clause | 46 | master | 1,724 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
not_compliant_on :watir do
describe "<frame> Frames" do
before :each do
browser.goto(WatirSpec.files + "/frames.html")
end
describe "#length" do
it "returns the correct number of frames" do
browser.frames.length.... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/table_row_spec.rb | Ruby | bsd-3-clause | 46 | master | 3,716 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "TableRow" do
before :each do
browser.goto(WatirSpec.files + "/tables.html")
end
describe "#exists?" do
it "returns true if the table row exists" do
browser.row(:id, "outer_first").should exist
browser.row(:id, ... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/p_spec.rb | Ruby | bsd-3-clause | 46 | master | 6,344 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "P" do
before :each do
browser.goto(WatirSpec.files + "/non_control_elements.html")
end
# Exists method
describe "#exist?" do
it "returns true if the 'p' exists" do
browser.p(:id, "lead").should exist
browser.... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/watirspec_helper.rb | Ruby | bsd-3-clause | 46 | master | 911 | # encoding: utf-8
$LOAD_PATH.unshift File.dirname(__FILE__)
$LOAD_PATH.unshift File.expand_path('../../../lib', __FILE__)
require 'rspec'
require 'guards'
require 'server'
require 'operawatir/helper'
RSpec.configure do |config|
config.mock_with :rr
end
module WatirSpec
extend self
attr_accessor :args, :guard... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/map_spec.rb | Ruby | bsd-3-clause | 46 | master | 3,413 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "Map" do
before :each do
browser.goto(WatirSpec.files + "/images.html")
end
# Exists method
describe "#exist?" do
it "returns true if the 'map' exists" do
browser.map(:id, "triangle_map").should exist
browser.... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/strong_spec.rb | Ruby | bsd-3-clause | 46 | master | 3,556 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "Strong" do
before :each do
browser.goto(WatirSpec.files + "/non_control_elements.html")
end
# Exists method
describe "#exist?" do
it "returns true if the element exists" do
browser.strong(:id, "descartes").should e... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/hn_spec.rb | Ruby | bsd-3-clause | 46 | master | 3,438 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "H1", "H2", "H3", "H4", "H5", "H6" do
before :each do
browser.goto(WatirSpec.files + "/non_control_elements.html")
end
# Exists method
describe "#exist?" do
it "returns true if the element exists" do
browser.h1(:id,... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/ols_spec.rb | Ruby | bsd-3-clause | 46 | master | 810 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "Ols" do
before :each do
browser.goto(WatirSpec.files + "/non_control_elements.html")
end
describe "#length" do
it "returns the number of ols" do
browser.ols.length.should == 2
end
end
describe "#[]" do
i... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/pres_spec.rb | Ruby | bsd-3-clause | 46 | master | 803 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "Pres" do
before :each do
browser.goto(WatirSpec.files + "/non_control_elements.html")
end
describe "#length" do
it "returns the number of pres" do
browser.pres.length.should == 7
end
end
describe "#[]" do
... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/radios_spec.rb | Ruby | bsd-3-clause | 46 | master | 859 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "Radios" do
before :each do
browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
end
describe "#length" do
it "returns the number of radios" do
browser.radios.length.should == 5
end
end
describe ... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/ems_spec.rb | Ruby | bsd-3-clause | 46 | master | 810 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "Ems" do
before :each do
browser.goto(WatirSpec.files + "/non_control_elements.html")
end
describe "#length" do
it "returns the number of ems" do
browser.ems.length.should == 1
end
end
describe "#[]" do
i... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/checkboxes_spec.rb | Ruby | bsd-3-clause | 46 | master | 883 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "CheckBoxes" do
before :each do
browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
end
describe "#length" do
it "returns the number of checkboxes" do
browser.checkboxes.length.should == 7
end
end
... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/span_spec.rb | Ruby | bsd-3-clause | 46 | master | 7,115 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "Span" do
before :each do
browser.goto(WatirSpec.files + "/non_control_elements.html")
end
# Exists method
describe "#exist?" do
it "returns true if the 'span' exists" do
browser.span(:id, "lead").should exist
... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/option_spec.rb | Ruby | bsd-3-clause | 46 | master | 8,683 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "Option" do
before :each do
browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
end
describe "#exists?" do
bug "WTR-367", :watir do
it "returns true if the element exists (page context)" do
bug "... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/em_spec.rb | Ruby | bsd-3-clause | 46 | master | 4,318 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "Em" do
before :each do
browser.goto(WatirSpec.files + "/non_control_elements.html")
end
# Exists method
describe "#exists?" do
it "returns true if the element exists" do
browser.em(:id, "important-id").should exist... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/buttons_spec.rb | Ruby | bsd-3-clause | 46 | master | 1,260 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "Buttons" do
before :each do
browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
end
describe "#length" do
bug "WTR-349", :watir do
it "returns the number of buttons" do
browser.buttons.length.sh... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/maps_spec.rb | Ruby | bsd-3-clause | 46 | master | 794 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "Maps" do
before :each do
browser.goto(WatirSpec.files + "/images.html")
end
describe "#length" do
it "returns the number of maps" do
browser.maps.length.should == 2
end
end
describe "#[]" do
it "returns ... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/form_spec.rb | Ruby | bsd-3-clause | 46 | master | 2,379 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "Form" do
before :each do
browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
end
describe "#exists?" do
it "returns true if the form exists" do
browser.form(:id, 'new_user').should exist
browser.fo... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/li_spec.rb | Ruby | bsd-3-clause | 46 | master | 4,898 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "Li" do
before :each do
browser.goto(WatirSpec.files + "/non_control_elements.html")
end
# Exists method
describe "#exist?" do
it "returns true if the 'li' exists" do
browser.li(:id, "non_link_1").should exist
... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/inses_spec.rb | Ruby | bsd-3-clause | 46 | master | 2,129 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "Inses" do
before :each do
browser.goto(WatirSpec.files + "/non_control_elements.html")
end
describe "#length" do
it "returns the number of inses" do
browser.inses.length.should == 5
end
end
describe "#[]" do... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/dds_spec.rb | Ruby | bsd-3-clause | 46 | master | 807 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "Dds" do
before :each do
browser.goto(WatirSpec.files + "/definition_lists.html")
end
describe "#length" do
it "returns the number of dds" do
browser.dds.length.should == 11
end
end
describe "#[]" do
it "... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/areas_spec.rb | Ruby | bsd-3-clause | 46 | master | 797 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "Areas" do
before :each do
browser.goto(WatirSpec.files + "/images.html")
end
describe "#length" do
it "returns the number of areas" do
browser.areas.length.should == 3
end
end
describe "#[]" do
it "retur... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/select_list_spec.rb | Ruby | bsd-3-clause | 46 | master | 13,803 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "SelectList" do
before :each do
browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
end
# Exists method
describe "#exists?" do
it "returns true if the select list exists" do
browser.select_list(:id, 'n... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/links_spec.rb | Ruby | bsd-3-clause | 46 | master | 931 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "Links" do
before :each do
browser.goto(WatirSpec.files + "/non_control_elements.html")
end
describe "#length" do
it "returns the number of links" do
browser.links.length.should == 4
end
end
describe "#[]" do... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/dls_spec.rb | Ruby | bsd-3-clause | 46 | master | 809 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "Dls" do
before :each do
browser.goto(WatirSpec.files + "/definition_lists.html")
end
describe "#length" do
it "returns the number of dls" do
browser.dls.length.should == 3
end
end
describe "#[]" do
it "r... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/table_bodies_spec.rb | Ruby | bsd-3-clause | 46 | master | 1,605 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "TableBodies" do
before :each do
browser.goto(WatirSpec.files + "/tables.html")
end
describe "#length" do
it "returns the correct number of table bodies (page context)" do
browser.bodies.length.should == 5
end
... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/tables_spec.rb | Ruby | bsd-3-clause | 46 | master | 902 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "Tables" do
before :each do
browser.goto(WatirSpec.files + "/tables.html")
end
describe "#length" do
it "returns the number of tables" do
browser.tables.length.should == 4
end
end
describe "#[]" do
it "re... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/select_lists_spec.rb | Ruby | bsd-3-clause | 46 | master | 1,147 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "SelectLists" do
before :each do
browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
end
describe "#length" do
it "returns the correct number of select lists on the page" do
browser.select_lists.length.s... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/label_spec.rb | Ruby | bsd-3-clause | 46 | master | 2,714 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
describe "Label" do
before :each do
browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
end
# Exists method
describe "#exists?" do
it "returns true if the element exists" do
browser.label(:id, 'first_label').sh... |
github | operasoftware/operawatir | https://github.com/operasoftware/operawatir | spec/watir2/meta_spec.rb | Ruby | bsd-3-clause | 46 | master | 682 | # encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)
bug "WTR-334", :watir do
describe "Meta" do
before :each do
browser.goto(WatirSpec.files + "/forms_with_input_elements.html")
end
describe "#exist?" do
it "returns true if the meta tag exists" do
browser.meta('htt... |
github | teohm/natives | https://github.com/teohm/natives | Gemfile | Ruby | mit | 46 | master | 341 | source "http://rubygems.org"
# Add dependencies required to use your gem here.
gem "ohai"
gem "thor"
gem "bundler"
# Add dependencies to develop your gem here.
# Include everything needed to run rake, tests, features, etc.
group :development do
gem "rspec"
gem "yard"
gem "rdoc"
gem "jeweler"
gem "debugger"
... |
github | teohm/natives | https://github.com/teohm/natives | natives.gemspec | Ruby | mit | 46 | master | 4,755 | # Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-
# stub: natives 0.6.2 ruby lib
Gem::Specification.new do |s|
s.name = "natives"
s.version = "0.6.2"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s... |
github | teohm/natives | https://github.com/teohm/natives | Vagrantfile | Ruby | mit | 46 | master | 4,297 | # -*- mode: ruby -*-
# vi: set ft=ruby :
BOX_NAME = ENV['BOX_NAME'] || "ubuntu"
BOX_URI = ENV['BOX_URI'] || "http://files.vagrantup.com/precise64.box"
VF_BOX_URI = ENV['BOX_URI'] || "http://files.vagrantup.com/precise64_vmware_fusion.box"
AWS_REGION = ENV['AWS_REGION'] || "us-east-1"
AWS_AMI = ENV['AWS_AMI'] || ... |
github | teohm/natives | https://github.com/teohm/natives | Rakefile | Ruby | mit | 46 | master | 1,092 | # encoding: utf-8
require 'rubygems'
require 'bundler'
begin
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
$stderr.puts e.message
$stderr.puts "Run `bundle install` to install missing gems"
exit e.status_code
end
require 'rake'
require 'jeweler'
Jeweler::Tasks.new do |gem|
# gem is... |
github | teohm/natives | https://github.com/teohm/natives | lib/natives/catalog.rb | Ruby | mit | 46 | master | 1,403 | require 'natives/catalog/loader'
require 'natives/catalog/selector'
module Natives
class Catalog
CATALOG_PATH_IN_GEM = File.absolute_path(File.join(
File.dirname(__FILE__), '..', '..', 'catalogs'))
WORKING_DIR_CATALOG_DIRNAME = 'natives-catalogs'
attr_reader :platform, :pla... |
github | teohm/natives | https://github.com/teohm/natives | lib/natives/cli.rb | Ruby | mit | 46 | master | 1,146 | require 'thor'
require 'natives/apps'
module Natives
class Cli < Thor
desc 'list [ENTRY1 ENTRY2 ..]',
'list native packages required by the catalog entries'
method_option :catalog, default: 'rubygems', aliases: '-c',
desc: 'use this catalog'
method_option :gemfile, default: 'Gemfile',
... |
github | teohm/natives | https://github.com/teohm/natives | lib/natives/host_detection.rb | Ruby | mit | 46 | master | 557 | require 'natives/host_detection/platform'
require 'natives/host_detection/package_provider'
module Natives
class HostDetection
def initialize(opts={})
@detect_platform = opts.fetch(:detect_platform) { Platform.new }
@detect_package_provider = opts.fetch(:detect_package_provider) {
PackagePro... |
github | teohm/natives | https://github.com/teohm/natives | lib/natives/gemfile_viewer.rb | Ruby | mit | 46 | master | 348 | require 'bundler'
module Natives
class GemfileViewer
def initialize(gemfile_path)
@gemfile_path = File.expand_path(gemfile_path)
@lockfile_path = "#{@gemfile_path}.lock"
end
def gem_names
lockfile = Bundler::LockfileParser.new(Bundler.read_file(@lockfile_path))
lockfile.specs.map... |
github | teohm/natives | https://github.com/teohm/natives | lib/natives/host_detection/platform.rb | Ruby | mit | 46 | master | 482 | require 'ohai'
module Natives
class HostDetection
class Platform
def initialize
@ohai = build_ohai
end
def name
ohai_hash[:platform]
end
def version
ohai_hash[:platform_version]
end
def ohai_hash
@ohai
end
protected
... |
github | teohm/natives | https://github.com/teohm/natives | lib/natives/host_detection/package_provider.rb | Ruby | mit | 46 | master | 2,059 | module Natives
class HostDetection
class PackageProvider
COMMANDS = {
'aix' => 'installp',
'yum' => 'yum',
'packman' => 'packman',
'apt' => 'apt-get',
'feebsd' => 'pkg_add',
'portage' => 'emerge',
'homebrew' => 'brew',
'macports' => 'port',
... |
github | teohm/natives | https://github.com/teohm/natives | lib/natives/apps/list.rb | Ruby | mit | 46 | master | 1,158 | require 'natives/host_detection'
require 'natives/catalog'
require 'natives/gemfile_viewer'
module Natives
module Apps
class List
def natives_for(catalog_name, entry_names)
host = new_host_detection
catalog = new_catalog(catalog_name,
host.platform, host.platf... |
github | teohm/natives | https://github.com/teohm/natives | lib/natives/apps/detect.rb | Ruby | mit | 46 | master | 424 | require 'natives/host_detection'
module Natives
module Apps
class Detect
def detection_info
host = new_host_detection
return [
"platform: #{host.platform}",
"platform_version: #{host.platform_version}",
"package_provider: #{host.package_provider}",
].j... |
github | teohm/natives | https://github.com/teohm/natives | lib/natives/catalog/merger.rb | Ruby | mit | 46 | master | 641 | require 'natives/catalog/validator'
module Natives
class Catalog
class Merger
def initialize(opts={})
@validator = opts.fetch(:validator, Validator.new)
end
def merge_catalog!(master_hash, hash_to_merge)
@validator.ensure_valid_catalog_groups(master_hash)
@validator.ens... |
github | teohm/natives | https://github.com/teohm/natives | lib/natives/catalog/validator.rb | Ruby | mit | 46 | master | 516 | module Natives
class Catalog
class Validator
def ensure_valid_catalog_groups(hash)
unless hash.kind_of? Hash
raise ArgumentError, 'catalog should be a Hash'
end
invalid_groups = hash.select {|key, value| !value.kind_of?(Hash) }
unless invalid_groups.empty?
... |
github | teohm/natives | https://github.com/teohm/natives | lib/natives/catalog/normalizer.rb | Ruby | mit | 46 | master | 1,988 | require 'natives/errors'
module Natives
class Catalog
class Normalizer
def normalize(hash)
normalize_package_provider_hash(hash)
end
protected
def default?(str)
'default' == str
end
def convert_to_hash(hash)
return hash.to_h if hash.respond_to?(:... |
github | teohm/natives | https://github.com/teohm/natives | lib/natives/catalog/loader.rb | Ruby | mit | 46 | master | 672 | require 'natives/catalog/merger'
require 'psych'
require 'yaml'
module Natives
class Catalog
class Loader
def initialize(opts={})
@merger = opts.fetch(:merger, Merger.new)
end
def load_from_paths(paths)
master_hash = {}
Array(paths).each do |path|
yaml_files_i... |
github | teohm/natives | https://github.com/teohm/natives | lib/natives/catalog/selector.rb | Ruby | mit | 46 | master | 1,227 | require 'natives/catalog/normalizer'
module Natives
class Catalog
class Selector
def initialize(hash)
@values = normalize(hash)
end
def values_for(package_provider, platform, platform_version)
package_provider = package_provider.to_s
platform = platform.to_s
pla... |
github | teohm/natives | https://github.com/teohm/natives | spec/spec_helper.rb | Ruby | mit | 46 | master | 665 | $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'rspec'
if ENV['COVERAGE']
require 'simplecov'
SimpleCov.start
end
# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir["#{File.dirname(__F... |
github | teohm/natives | https://github.com/teohm/natives | spec/natives/host_detection_spec.rb | Ruby | mit | 46 | master | 1,314 | require 'spec_helper'
require 'natives/host_detection'
describe Natives::HostDetection do
it "detects host's platform" do
detect_platform = double()
detect_platform.stub(:name).and_return('foobar')
detect = Natives::HostDetection.new(
detect_package_provider: nil,
detect_platform: detect_plat... |
github | teohm/natives | https://github.com/teohm/natives | spec/natives/gemfile_viewer_spec.rb | Ruby | mit | 46 | master | 854 | require 'spec_helper'
require 'natives/gemfile_viewer'
describe Natives::GemfileViewer do
describe "#packages" do
it "list all gems specified in gemfile" do
gemfile_path = File.join(fixture_path, "Gemfile.with_lockfile")
gemfile = Natives::GemfileViewer.new(gemfile_path)
expect(gemfile.gem_name... |
github | teohm/natives | https://github.com/teohm/natives | spec/natives/catalog_spec.rb | Ruby | mit | 46 | master | 4,375 | require 'spec_helper'
require 'natives/catalog'
describe Natives::Catalog do
describe "#new" do
it "loads catalogs" do
Natives::Catalog.any_instance.should_receive(:reload)
Natives::Catalog.new('rubygems', 'mac_os_x', '10.7.5', 'homebrew')
end
it "requires caller to provide platform and pac... |
github | teohm/natives | https://github.com/teohm/natives | spec/natives/catalog/selector_spec.rb | Ruby | mit | 46 | master | 3,402 | require 'spec_helper'
require 'natives/catalog/selector'
describe Natives::Catalog::Selector do
describe "#value_for" do
let(:selector) do
Natives::Catalog::Selector.new({
apt: {
default: 'apt-default',
ubuntu: {
'12.10' => 'ubuntu-12.10',
%w(10.10 10.10... |
github | teohm/natives | https://github.com/teohm/natives | spec/natives/catalog/merger_spec.rb | Ruby | mit | 46 | master | 1,888 | require 'spec_helper'
require 'natives/catalog/merger'
describe Natives::Catalog::Merger do
describe "#merge_catalog!" do
let(:merger) { Natives::Catalog::Merger.new }
it "validates both master_hash and hash_to_merge" do
master_hash = {}
hash_to_merge = {"rubygems" => {}}
validator = doub... |
github | teohm/natives | https://github.com/teohm/natives | spec/natives/catalog/validator_spec.rb | Ruby | mit | 46 | master | 1,208 | require 'spec_helper'
require 'natives/catalog/validator'
describe Natives::Catalog::Validator do
describe "#ensure_valid_catalog_groups" do
let(:validator) { Natives::Catalog::Validator.new }
it "ensures catalog groups is a hash" do
expect {
validator.ensure_valid_catalog_groups({"rubygems" ... |
github | teohm/natives | https://github.com/teohm/natives | spec/natives/catalog/normalizer_spec.rb | Ruby | mit | 46 | master | 2,775 | require 'spec_helper'
require 'natives/catalog/normalizer'
describe "Catalog Normalizer" do
let(:normalizer) { Natives::Catalog::Normalizer.new }
context "Given valid hash input" do
it "converts package provider, platform, platform version to string" do
hash = normalizer.normalize({
:macports =>... |
github | teohm/natives | https://github.com/teohm/natives | spec/natives/catalog/loader_spec.rb | Ruby | mit | 46 | master | 3,574 | require 'spec_helper'
require 'natives/catalog/loader'
describe Natives::Catalog::Loader do
describe "#load_from_paths" do
let(:loader) { Natives::Catalog::Loader.new }
it "loads files in catalog paths, in the order of given paths and sorted filenames" do
files = {
'/to/path1' => ['/to/path1/f... |
github | teohm/natives | https://github.com/teohm/natives | spec/natives/host_detection/package_provider_spec.rb | Ruby | mit | 46 | master | 1,087 | require 'spec_helper'
require 'natives/host_detection/package_provider'
describe Natives::HostDetection::PackageProvider do
it "detects host's package provider name" do
platform = double()
platform.should_receive(:name).and_return('ubuntu')
package_provider = Natives::HostDetection::PackageProvider.new(... |
github | teohm/natives | https://github.com/teohm/natives | spec/natives/host_detection/platform_spec.rb | Ruby | mit | 46 | master | 578 | require 'spec_helper'
require 'natives/host_detection/platform'
describe Natives::HostDetection::Platform do
let(:platform) { Natives::HostDetection::Platform.new }
it "detects platform name" do
platform.should_receive(:ohai_hash).and_return({platform: 'ubuntu'})
expect(platform.name).to eq('ubuntu')
en... |
github | teohm/natives | https://github.com/teohm/natives | spec/natives/apps/detect_spec.rb | Ruby | mit | 46 | master | 739 | require 'spec_helper'
require 'natives/apps/detect'
describe Natives::Apps::Detect do
it "detects host's platform and package provider info" do
app = Natives::Apps::Detect.new
host_detection = double()
host_detection.stub(platform: 'ubuntu')
host_detection.stub(platform_version: '12.3.2')
host_d... |
github | teohm/natives | https://github.com/teohm/natives | spec/natives/apps/list_spec.rb | Ruby | mit | 46 | master | 1,706 | require 'spec_helper'
require 'natives/apps/list'
describe Natives::Apps::List do
context "given catalog entry names" do
it "lists native packages" do
catalog_name = 'rubygems'
entry_names = %w(sqlite3 capybara-webkit nokogiri curb)
catalog = double()
catalog.should_receive(:native_packa... |
github | syro/satz | https://github.com/syro/satz | satz.gemspec | Ruby | mit | 46 | master | 588 | Gem::Specification.new do |s|
s.name = "satz"
s.version = "0.1.0"
s.summary = "Framework for JSON microservices"
s.description = "Framework for JSON microservices"
s.authors = ["Michel Martens"]
s.email = ["michel@soveran.com"]
s.homepage ... |
github | syro/satz | https://github.com/syro/satz | lib/satz.rb | Ruby | mit | 46 | master | 2,946 | # encoding: UTF-8
#
# Copyright (c) 2015 Michel Martens
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, ... |
github | syro/satz | https://github.com/syro/satz | test/all.rb | Ruby | mit | 46 | master | 1,527 | A1 = Satz.define do
get do
reply("null")
end
post do
reply(read)
end
on "protected" do
@user = auth do |user, pass|
user == "foo" && pass == "bar"
end
on @user.nil? do
res.status = 401
reply(error: "Unauthorized")
end
get do
reply(true)
end
end
end... |
github | rosenfeld/sequel_tools | https://github.com/rosenfeld/sequel_tools | sequel_tools.gemspec | Ruby | mit | 46 | master | 1,832 | # frozen-string-literal: true
lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'sequel_tools/version'
Gem::Specification.new do |spec|
spec.name = 'sequel_tools'
spec.version = SequelTools::VERSION
spec.authors = ['Rodrigo Rosenfeld Rosa... |
github | rosenfeld/sequel_tools | https://github.com/rosenfeld/sequel_tools | lib/sequel_tools.rb | Ruby | mit | 46 | master | 1,885 | # frozen-string-literal: true
require 'sequel_tools/version'
module SequelTools
DEFAULT_CONFIG = {
project_root: Dir.pwd,
pg_dump: 'pg_dump', # command used to run pg_dump
psql: 'psql', # command used to run psql
maintenancedb: :default, # DB to connect to for creating/dropping databases
migrati... |
github | rosenfeld/sequel_tools | https://github.com/rosenfeld/sequel_tools | lib/sequel_tools/pg_helper.rb | Ruby | mit | 46 | master | 787 | # frozen-string-literal: true
class PgHelper
def self.run_pg_command(config, cmd, connect_database: nil)
require 'open3'
require 'tempfile'
Tempfile.open 'pgpass' do |file|
c = config
file.chmod 0600
host = c[:dbhost] || 'localhost'
port = c[:dbport] || '5432'
file.write "#{... |
github | rosenfeld/sequel_tools | https://github.com/rosenfeld/sequel_tools | lib/sequel_tools/migration_utils.rb | Ruby | mit | 46 | master | 2,112 | # frozen-string-literal: true
require_relative 'actions_manager'
require 'sequel'
class MigrationUtils
def self.apply_migration(context, version, direction)
( puts 'migration version is missing - aborting.'; exit 1 ) if version.nil?
filename = "#{File.basename version, '.rb'}.rb"
migrator = find_migrato... |
github | rosenfeld/sequel_tools | https://github.com/rosenfeld/sequel_tools | lib/sequel_tools/all_actions.rb | Ruby | mit | 46 | master | 702 | # frozen-string-literal: true
require_relative 'actions/connect_db'
require_relative 'actions/create_db'
require_relative 'actions/drop_db'
require_relative 'actions/schema_dump'
require_relative 'actions/schema_load'
require_relative 'actions/new_migration'
require_relative 'actions/migrate'
require_relative 'actions... |
github | rosenfeld/sequel_tools | https://github.com/rosenfeld/sequel_tools | lib/sequel_tools/sequel_tools_logger.rb | Ruby | mit | 46 | master | 564 | # frozen-string-literal: true
require 'logger'
module SequelTools
class SequelToolsLogger < Logger
def initialize(logdev, level)
super logdev
self.level = level
self.formatter = proc do |severity, datetime, progname, msg|
"[#{severity}] #{msg}\n"
end
end
def add(severity... |
github | rosenfeld/sequel_tools | https://github.com/rosenfeld/sequel_tools | lib/sequel_tools/actions_manager.rb | Ruby | mit | 46 | master | 2,775 | # frozen-string-literal: true
module SequelTools
class ActionsManager
attr_reader :actions, :context
URI_BUILDER = ->(config, dbname = config[:dbname]) do
c = config
uri_parts = []
uri_parts << 'jdbc:' if RUBY_PLATFORM == 'java'
uri_parts << "#{c[:jdbc_adapter] || c[:dbadapter]}://"
... |
github | rosenfeld/sequel_tools | https://github.com/rosenfeld/sequel_tools | lib/sequel_tools/actions/irb.rb | Ruby | mit | 46 | master | 620 | # frozen-string-literal: true
require_relative '../actions_manager'
class SequelTools::ActionsManager
description = "Opens an IRB session started as 'sequel uri_to_database' (DB is available to irb)"
Action.register :irb, description do |args, context|
# This code does the job, but for some reason the test wi... |
github | rosenfeld/sequel_tools | https://github.com/rosenfeld/sequel_tools | lib/sequel_tools/actions/schema_load.rb | Ruby | mit | 46 | master | 699 | # frozen-string-literal: true
require_relative '../actions_manager'
class SequelTools::ActionsManager
description = 'Populates an empty database with previously dumped schema'
Action.register :schema_load, description do |args, context|
begin
Action[:connect_db].run({}, context)
rescue
puts '... |
github | rosenfeld/sequel_tools | https://github.com/rosenfeld/sequel_tools | lib/sequel_tools/actions/down.rb | Ruby | mit | 46 | master | 460 | # frozen-string-literal: true
require 'sequel'
require_relative '../actions_manager'
require_relative '../migration_utils'
class SequelTools::ActionsManager
desc = 'Run specified migration down if not already applied'
Action.register :down, desc, arg_names: [ :version ] do |args, context|
MigrationUtils.apply... |
github | rosenfeld/sequel_tools | https://github.com/rosenfeld/sequel_tools | lib/sequel_tools/actions/shell_postgres.rb | Ruby | mit | 46 | master | 451 | # frozen-string-literal: true
require_relative '../actions_manager'
class SequelTools::ActionsManager
Action.register :shell_postgres, nil do |args, context|
c = context[:config]
psql = c[:psql]
env = {
'PGDATABASE' => c[:dbname],
'PGHOST' => c[:dbhost] || 'localhost',
'PGPORT' => (c[:... |
github | rosenfeld/sequel_tools | https://github.com/rosenfeld/sequel_tools | lib/sequel_tools/actions/create_db.rb | Ruby | mit | 46 | master | 610 | # frozen-string-literal: true
require 'sequel'
require_relative '../actions_manager'
class SequelTools::ActionsManager
Action.register :create, 'Create database' do |args, context|
begin
Action[:connect_db].run({}, context)
rescue
c = context[:config]
db = Sequel.connect context[:uri_build... |
github | rosenfeld/sequel_tools | https://github.com/rosenfeld/sequel_tools | lib/sequel_tools/actions/reset.rb | Ruby | mit | 46 | master | 463 | # frozen-string-literal: true
require_relative '../actions_manager'
class SequelTools::ActionsManager
desc = 'Recreate database from scratch by running all migrations and seeds in a new database'
Action.register :reset, desc, arg_names: [ :version ] do |args, context|
begin
Action[:drop].run({}, context... |
github | rosenfeld/sequel_tools | https://github.com/rosenfeld/sequel_tools | lib/sequel_tools/actions/seed.rb | Ruby | mit | 46 | master | 468 | # frozen-string-literal: true
require_relative '../actions_manager'
class SequelTools::ActionsManager
Action.register :seed, 'Load seeds from seeds.rb' do |args, context|
begin
Action[:connect_db].run({}, context)
rescue
puts 'Database does not exist - aborting.'
exit 1
else
if F... |
github | rosenfeld/sequel_tools | https://github.com/rosenfeld/sequel_tools | lib/sequel_tools/actions/drop_db.rb | Ruby | mit | 46 | master | 603 | # frozen-string-literal: true
require 'sequel'
require_relative '../actions_manager'
class SequelTools::ActionsManager
Action.register :drop, 'Drop database' do |args, context|
begin
Action[:connect_db].run({}, context)
rescue
puts 'Database does not exist - aborting.'
exit 1
else
... |
github | rosenfeld/sequel_tools | https://github.com/rosenfeld/sequel_tools | lib/sequel_tools/actions/shell.rb | Ruby | mit | 46 | master | 900 | # frozen-string-literal: true
require_relative '../actions_manager'
class SequelTools::ActionsManager
Action.register :shell, 'Open an interactive shell to the database' do |args, context|
begin
Action[:connect_db].run({}, context)
rescue
puts 'Database does not exist - aborting.'
exit 1
... |
github | rosenfeld/sequel_tools | https://github.com/rosenfeld/sequel_tools | lib/sequel_tools/actions/migrate.rb | Ruby | mit | 46 | master | 728 | # frozen-string-literal: true
require 'sequel'
require_relative '../actions_manager'
class SequelTools::ActionsManager
desc = 'Migrate to specified version (last by default)'
Action.register :migrate, desc, arg_names: [ :version ] do |args, context|
Action[:connect_db].run({}, context)
db = context[:db]
... |
github | rosenfeld/sequel_tools | https://github.com/rosenfeld/sequel_tools | lib/sequel_tools/actions/rollback.rb | Ruby | mit | 46 | master | 577 | # frozen-string-literal: true
require 'sequel'
require_relative '../actions_manager'
require_relative '../migration_utils'
class SequelTools::ActionsManager
Action.register :rollback, 'Rollback last applied migration' do |args, context|
unless last_found_migration = MigrationUtils.last_found_migration(context)
... |
github | rosenfeld/sequel_tools | https://github.com/rosenfeld/sequel_tools | lib/sequel_tools/actions/connect_db.rb | Ruby | mit | 46 | master | 605 | # frozen-string-literal: true
require 'sequel'
require_relative '../actions_manager'
require_relative '../sequel_tools_logger'
SequelTools::ActionsManager::Action.register :connect_db, nil do |args, context|
next if context[:db]
config = context[:config]
context[:db] = db = SequelTools.suppress_java_output do
... |
github | rosenfeld/sequel_tools | https://github.com/rosenfeld/sequel_tools | lib/sequel_tools/actions/before_task.rb | Ruby | mit | 46 | master | 589 | # frozen-string-literal: true
require_relative '../actions_manager'
SequelTools::ActionsManager::Action.register :before_task, nil do |args, context|
config = context[:config]
adapter = config[:dbadapter]
action = context[:current_action]
hooks = [:before_any, :"before_#{action.name}", :"before_any_#{adapter}... |
github | rosenfeld/sequel_tools | https://github.com/rosenfeld/sequel_tools | lib/sequel_tools/actions/schema_dump.rb | Ruby | mit | 46 | master | 574 | # frozen-string-literal: true
require_relative '../actions_manager'
class SequelTools::ActionsManager
Action.register :schema_dump, 'Store current db schema' do |args, context|
begin
Action[:connect_db].run({}, context)
rescue
puts 'Database does not exist - aborting.'
exit 1
else
... |
github | rosenfeld/sequel_tools | https://github.com/rosenfeld/sequel_tools | lib/sequel_tools/actions/postgresql_support.rb | Ruby | mit | 46 | master | 479 | # frozen-string-literal: true
require_relative '../actions_manager'
require_relative 'schema_dump_postgres'
require_relative 'shell_postgres'
class SequelTools::ActionsManager
Action.register :before_any_postgres, nil do |args, context|
next if context[:before_any_postgres_processed]
config = context[:confi... |
github | rosenfeld/sequel_tools | https://github.com/rosenfeld/sequel_tools | lib/sequel_tools/actions/up.rb | Ruby | mit | 46 | master | 454 | # frozen-string-literal: true
require 'sequel'
require_relative '../actions_manager'
require_relative '../migration_utils'
class SequelTools::ActionsManager
desc = 'Run specified migration up if not already applied'
Action.register :up, desc, arg_names: [ :version ] do |args, context|
MigrationUtils.apply_mig... |
github | rosenfeld/sequel_tools | https://github.com/rosenfeld/sequel_tools | lib/sequel_tools/actions/status.rb | Ruby | mit | 46 | master | 875 | # frozen-string-literal: true
require 'sequel'
require_relative '../actions_manager'
require_relative '../migration_utils'
class SequelTools::ActionsManager
description = 'Show migrations status (applied and missing in migrations path vs unapplied)'
Action.register :status, description do |args, context|
unap... |
github | rosenfeld/sequel_tools | https://github.com/rosenfeld/sequel_tools | lib/sequel_tools/actions/redo.rb | Ruby | mit | 46 | master | 419 | # frozen-string-literal: true
require 'sequel'
require_relative '../actions_manager'
class SequelTools::ActionsManager
desc = 'Run specified migration down and up (redo)'
Action.register :redo, desc, arg_names: [ :version ] do |args, context|
Action[:down].run(args, context)
Action[:up].run(args, context)... |
github | rosenfeld/sequel_tools | https://github.com/rosenfeld/sequel_tools | lib/sequel_tools/actions/version.rb | Ruby | mit | 46 | master | 321 | # frozen-string-literal: true
require 'sequel'
require_relative '../actions_manager'
require_relative '../migration_utils'
class SequelTools::ActionsManager
Action.register :version, 'Displays current version' do |args, context|
puts MigrationUtils.current_version(context) || 'No migrations applied'
end
end |
github | rosenfeld/sequel_tools | https://github.com/rosenfeld/sequel_tools | lib/sequel_tools/actions/schema_dump_postgres.rb | Ruby | mit | 46 | master | 1,267 | # frozen-string-literal: true
require_relative '../actions_manager'
require_relative '../pg_helper'
class SequelTools::ActionsManager
Action.register :schema_dump_postgres, nil do |args, context|
c = context[:config]
pg_dump = c[:pg_dump]
schema_location = c[:schema_location]
stdout, stderr, succes... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.