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 | datafolklabs/ruby-parseconfig | https://github.com/datafolklabs/ruby-parseconfig | tests/files/demo.rb | Ruby | mit | 99 | master | 327 | $result = {
"admin_email" => "root@localhost",
"listen_ip" => "127.0.0.1",
"listen_port" => "87345",
"group1" => {
"user_name" => "johnny",
"group_name" => "daemons"
},
"group2" => {
"user_name" => "rita",
"group_name" => "daemons"
},
"no_value_option" => ... |
github | datafolklabs/ruby-parseconfig | https://github.com/datafolklabs/ruby-parseconfig | lib/parseconfig.rb | Ruby | mit | 99 | master | 6,031 | #
# Author:: BJ Dierkes <derks@datafolklabs.com>
# Copyright:: Copyright (c) 2006,2016 Data Folk Labs, LLC
# License:: MIT
# URL:: https://github.com/datafolklabs/ruby-parseconfig
#
# This class was written to simplify the parsing of configuration
# files in the format of "param = value". Please re... |
github | oldpatricka/vagrant-xhyve | https://github.com/oldpatricka/vagrant-xhyve | vagrant-xhyve.gemspec | Ruby | mit | 99 | master | 2,473 | $:.unshift File.expand_path("../lib", __FILE__)
require "vagrant-xhyve/version"
Gem::Specification.new do |s|
s.name = "vagrant-xhyve"
s.version = VagrantPlugins::XHYVE::VERSION
s.platform = Gem::Platform::RUBY
s.license = "MIT"
s.authors = "Patrick Armstrong"
s.email ... |
github | oldpatricka/vagrant-xhyve | https://github.com/oldpatricka/vagrant-xhyve | Gemfile | Ruby | mit | 99 | master | 394 | source "https://rubygems.org"
group :plugins do
gemspec
gem "xhyve-ruby", :path => "vendor/xhyve-ruby"
end
group :development do
# We depend on Vagrant for development, but we don't add it as a
# gem dependency because we expect to be installed within the
# Vagrant environment itself using `vagrant plugin`.... |
github | oldpatricka/vagrant-xhyve | https://github.com/oldpatricka/vagrant-xhyve | Rakefile | Ruby | mit | 99 | master | 598 | require 'rubygems'
require 'bundler/setup'
require 'rspec/core/rake_task'
# Immediately sync all stdout so that tools like buildbot can
# immediately load in the output.
$stdout.sync = true
$stderr.sync = true
# Change to the directory of this file.
Dir.chdir(File.expand_path("../", __FILE__))
# This installs the ta... |
github | oldpatricka/vagrant-xhyve | https://github.com/oldpatricka/vagrant-xhyve | lib/vagrant-xhyve.rb | Ruby | mit | 99 | master | 676 | require "pathname"
require "vagrant-xhyve/plugin"
module VagrantPlugins
module XHYVE
lib_path = Pathname.new(File.expand_path("../vagrant-xhyve", __FILE__))
autoload :Action, lib_path.join("action")
autoload :Errors, lib_path.join("errors")
# Put vagrant-xhyve-x.y.z/vendor/xhyve-ruby/lib on the LOA... |
github | oldpatricka/vagrant-xhyve | https://github.com/oldpatricka/vagrant-xhyve | lib/vagrant-xhyve/plugin.rb | Ruby | mit | 99 | master | 2,054 | begin
require "vagrant"
rescue LoadError
raise "The Vagrant XHYVE plugin must be run within Vagrant."
end
# This is a sanity check to make sure no one is attempting to install
# this into an early Vagrant version.
if Vagrant::VERSION < "1.2.0"
raise "The Vagrant XHYVE plugin is only compatible with Vagrant 1.2+"... |
github | oldpatricka/vagrant-xhyve | https://github.com/oldpatricka/vagrant-xhyve | lib/vagrant-xhyve/errors.rb | Ruby | mit | 99 | master | 384 | require "vagrant"
module VagrantPlugins
module XHYVE
module Errors
class VagrantXHYVEError < Vagrant::Errors::VagrantError
error_namespace("vagrant_xhyve.errors")
end
class RsyncError < VagrantXYHVEError
error_key(:rsync_error)
end
class MkdirError < VagrantXHYVEEr... |
github | oldpatricka/vagrant-xhyve | https://github.com/oldpatricka/vagrant-xhyve | lib/vagrant-xhyve/action.rb | Ruby | mit | 99 | master | 5,972 | require "pathname"
require "vagrant/action/builder"
module VagrantPlugins
module XHYVE
module Action
# Include the built-in modules so we can use them as top-level things.
include Vagrant::Action::Builtin
def self.action_package
Vagrant::Action::Builder.new.tap do |b|
b.use ... |
github | oldpatricka/vagrant-xhyve | https://github.com/oldpatricka/vagrant-xhyve | lib/vagrant-xhyve/provider.rb | Ruby | mit | 99 | master | 1,497 | require "log4r"
require "vagrant"
module VagrantPlugins
module XHYVE
class Provider < Vagrant.plugin("2", :provider)
def initialize(machine)
@machine = machine
end
def action(name)
# Attempt to get the action method from the Action class if it
# exists, otherwise return... |
github | oldpatricka/vagrant-xhyve | https://github.com/oldpatricka/vagrant-xhyve | lib/vagrant-xhyve/config.rb | Ruby | mit | 99 | master | 2,363 | require "vagrant"
require "iniparse"
module VagrantPlugins
module XHYVE
class Config < Vagrant.plugin("2", :config)
# The number of CPUs to give the VM
#
# @return [Fixnum]
attr_accessor :cpus
# The amount of memory to give the VM
#
# This can just be a simple integer... |
github | oldpatricka/vagrant-xhyve | https://github.com/oldpatricka/vagrant-xhyve | lib/vagrant-xhyve/action/read_ssh_info.rb | Ruby | mit | 99 | master | 705 | require "log4r"
require 'vagrant-xhyve/util/vagrant-xhyve'
module VagrantPlugins
module XHYVE
module Action
# This action reads the SSH info for the machine and puts it into the
# `:machine_ssh_info` key in the environment.
class ReadSSHInfo
def initialize(app, env)
@app = ... |
github | oldpatricka/vagrant-xhyve | https://github.com/oldpatricka/vagrant-xhyve | lib/vagrant-xhyve/action/is_stopped.rb | Ruby | mit | 99 | master | 410 | module VagrantPlugins
module XHYVE
module Action
# This can be used with "Call" built-in to check if the machine
# is stopped and branch in the middleware.
class IsStopped
def initialize(app, env)
@app = app
end
def call(env)
env[:result] = env[:machi... |
github | oldpatricka/vagrant-xhyve | https://github.com/oldpatricka/vagrant-xhyve | lib/vagrant-xhyve/action/read_state.rb | Ruby | mit | 99 | master | 1,391 | require "log4r"
module VagrantPlugins
module XHYVE
module Action
# This action reads the state of the machine and puts it in the
# `:machine_state_id` key in the environment.
class ReadState
def initialize(app, env)
@app = app
@env = env
@logger = Log4r::Lo... |
github | oldpatricka/vagrant-xhyve | https://github.com/oldpatricka/vagrant-xhyve | lib/vagrant-xhyve/action/message_will_not_destroy.rb | Ruby | mit | 99 | master | 335 | module VagrantPlugins
module XHYVE
module Action
class MessageWillNotDestroy
def initialize(app, env)
@app = app
end
def call(env)
env[:ui].info(I18n.t("vagrant_xhyve.will_not_destroy", name: env[:machine].name))
@app.call(env)
end
end
... |
github | oldpatricka/vagrant-xhyve | https://github.com/oldpatricka/vagrant-xhyve | lib/vagrant-xhyve/action/boot.rb | Ruby | mit | 99 | master | 5,017 | require "log4r"
require 'json'
require 'securerandom'
require 'vagrant/util/retryable'
require 'vagrant-xhyve/util/timer'
require 'vagrant-xhyve/util/vagrant-xhyve'
module VagrantPlugins
module XHYVE
module Action
# This runs the configured instance.
class Boot
include Vagrant::Util::Retrya... |
github | oldpatricka/vagrant-xhyve | https://github.com/oldpatricka/vagrant-xhyve | lib/vagrant-xhyve/action/import.rb | Ruby | mit | 99 | master | 1,768 | require "log4r"
require "json"
require "fileutils"
module VagrantPlugins
module XHYVE
module Action
# This terminates the running instance.
class Import
def initialize(app, env)
@app = app
end
def call(env)
#TODO: Progress bar
env[:ui].info("Imp... |
github | oldpatricka/vagrant-xhyve | https://github.com/oldpatricka/vagrant-xhyve | lib/vagrant-xhyve/action/wait_for_state.rb | Ruby | mit | 99 | master | 1,238 | require "log4r"
require "timeout"
module VagrantPlugins
module XHYVE
module Action
# This action will wait for a machine to reach a specific state or quit by timeout
class WaitForState
# env[:result] will be false in case of timeout.
# @param [Symbol] state Target machine state.
... |
github | oldpatricka/vagrant-xhyve | https://github.com/oldpatricka/vagrant-xhyve | lib/vagrant-xhyve/action/terminate_instance.rb | Ruby | mit | 99 | master | 736 | require "log4r"
require "json"
require "fileutils"
module VagrantPlugins
module XHYVE
module Action
# This terminates the running instance.
class TerminateInstance
def initialize(app, env)
@app = app
@logger = Log4r::Logger.new("vagrant_xhyve::action::terminate_instance... |
github | oldpatricka/vagrant-xhyve | https://github.com/oldpatricka/vagrant-xhyve | lib/vagrant-xhyve/action/message_not_created.rb | Ruby | mit | 99 | master | 300 | module VagrantPlugins
module XHYVE
module Action
class MessageNotCreated
def initialize(app, env)
@app = app
end
def call(env)
env[:ui].info(I18n.t("vagrant_xhyve.not_created"))
@app.call(env)
end
end
end
end
end |
github | oldpatricka/vagrant-xhyve | https://github.com/oldpatricka/vagrant-xhyve | lib/vagrant-xhyve/action/stop_instance.rb | Ruby | mit | 99 | master | 1,264 | require "log4r"
module VagrantPlugins
module XHYVE
module Action
# This stops the running instance.
class StopInstance
def initialize(app, env)
@app = app
@logger = Log4r::Logger.new("vagrant_xhyve::action::stop_instance")
end
def call(env)
if... |
github | oldpatricka/vagrant-xhyve | https://github.com/oldpatricka/vagrant-xhyve | lib/vagrant-xhyve/action/is_created.rb | Ruby | mit | 99 | master | 399 | module VagrantPlugins
module XHYVE
module Action
# This can be used with "Call" built-in to check if the machine
# is created and branch in the middleware.
class IsCreated
def initialize(app, env)
@app = app
end
def call(env)
env[:result] = env[:machi... |
github | oldpatricka/vagrant-xhyve | https://github.com/oldpatricka/vagrant-xhyve | lib/vagrant-xhyve/action/timed_provision.rb | Ruby | mit | 99 | master | 550 | require "vagrant-xhyve/util/timer"
module VagrantPlugins
module XHYVE
module Action
# This is the same as the builtin provision except it times the
# provisioner runs.
class TimedProvision < Vagrant::Action::Builtin::Provision
def run_provisioner(env, name, p)
timer = Util::Ti... |
github | oldpatricka/vagrant-xhyve | https://github.com/oldpatricka/vagrant-xhyve | lib/vagrant-xhyve/action/message_already_created.rb | Ruby | mit | 99 | master | 329 | module VagrantPlugins
module XHYVE
module Action
class MessageAlreadyCreated
def initialize(app, env)
@app = app
end
def call(env)
env[:ui].info(I18n.t("vagrant_xhyve.already_status", :status => "created"))
@app.call(env)
end
end
end
... |
github | oldpatricka/vagrant-xhyve | https://github.com/oldpatricka/vagrant-xhyve | lib/vagrant-xhyve/util/timer.rb | Ruby | mit | 99 | master | 357 | module VagrantPlugins
module XHYVE
module Util
class Timer
# A basic utility method that times the execution of the given
# block and returns it.
def self.time
start_time = Time.now.to_f
yield
end_time = Time.now.to_f
end_time - start_time
... |
github | oldpatricka/vagrant-xhyve | https://github.com/oldpatricka/vagrant-xhyve | lib/vagrant-xhyve/util/vagrant-xhyve.rb | Ruby | mit | 99 | master | 1,932 | require 'xhyve'
module VagrantPlugins
module XHYVE
module Util
# TODO: send all this upstream
class XhyveGuest < Xhyve::Guest
def initialize(**opts)
super.tap do |s|
@pid = opts.fetch(:pid, nil)
@mac = opts[:mac] unless opts[:mac].nil?
end
... |
github | oldpatricka/vagrant-xhyve | https://github.com/oldpatricka/vagrant-xhyve | spec/vagrant-xhyve/config_spec.rb | Ruby | mit | 99 | master | 665 | require "vagrant-xhyve/config"
require 'rspec/its'
# remove deprecation warnings
# (until someone decides to update the whole spec file to rspec 3.4)
RSpec.configure do |config|
# ...
config.mock_with :rspec do |c|
c.syntax = [:should, :expect]
end
config.expect_with :rspec do |c|
c.syntax = [:should, ... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | config.ru | Ruby | mit | 99 | master | 919 | require './config/environment'
require 'omniauth'
# TODO: call `letsencrypt_heroku` when we switch to Hobby heroku plan
use LetsencryptRack::Middleware
if Hanami.env?(:production)
require 'newrelic_rpm'
require 'newrelic-hanami'
NewRelic::Agent.manual_start
end
use SecureHeaders::Middleware
use Rack::Session::... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | Gemfile | Ruby | mit | 99 | master | 1,817 | source 'https://rubygems.org'
ruby '2.5.0'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
gem 'rake'
gem 'hanami', '1.3.1'
gem 'hanami-model', '1.3.1'
gem 'puma'
gem 'letsencrypt_rack'
gem 'letsencrypt_hero... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | Dangerfile | Ruby | mit | 99 | master | 1,604 | # rubocop:disable all
# Sometimes it's a README fix, or something like that - which isn't relevant for
# including in a project's CHANGELOG for example
declared_trivial = github.pr_title.include?("#trivial")
# Make it more obvious that a PR is a work in progress and shouldn't be merged yet
if github.pr_title.include?(... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/spec_helper.rb | Ruby | mit | 99 | master | 4,762 | # Require this file for unit tests
ENV['HANAMI_ENV'] ||= 'test'
require 'simplecov'
require 'simplecov-json'
require "support/database_cleaner"
SimpleCov.formatters = [
SimpleCov::Formatter::HTMLFormatter,
SimpleCov::Formatter::JSONFormatter
]
SimpleCov.start do
add_filter "/spec/"
add_filter "/config/"
ad... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/features_helper.rb | Ruby | mit | 99 | master | 1,157 | # Require this file for feature tests
require_relative './spec_helper'
require 'capybara'
require 'capybara/rspec'
require_relative './support/capybara'
require 'capybara/poltergeist'
Capybara.register_driver :poltergeist do |app|
Capybara::Poltergeist::Driver.new(app, js_errors: false)
Capybara::Poltergeist::Dr... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/fabricators/user_fabricator.rb | Ruby | mit | 99 | master | 244 | Fabricator(:user) do
name { Faker::Name.name }
uuid { Faker::Number.number(6) }
login { Faker::Internet.user_name }
email { Faker::Internet.email }
avatar_url { Faker::Avatar.image }
admin false
end |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/fabricators/task_fabricator.rb | Ruby | mit | 99 | master | 482 | Fabricator(:task) do
title { Faker::Lorem.word }
repository_name { Faker::Lorem.word }
body { Faker::Lorem.paragraph }
link { Faker::Internet.url }
md_body { Faker::Lorem.paragraph }
issue_url { Faker::Internet.url('github.com', "/davydovanton/ossboard/issues/#{... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/web/controllers/task_status/update_spec.rb | Ruby | mit | 99 | master | 3,196 | require_relative '../../../../apps/web/controllers/task_status/update'
RSpec.describe Web::Controllers::TaskStatus::Update, type: :action do
let(:action) { described_class.new }
let(:repo) { TaskRepository.new }
let(:task) { Fabricate.create(:task, title: 'old', status: 'in progress', user_id: user.id) }
let(... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/web/controllers/users/show_spec.rb | Ruby | mit | 99 | master | 749 | require_relative '../../../../apps/web/controllers/users/show'
RSpec.describe Web::Controllers::Users::Show, type: :action do
let(:action) { described_class.new }
let(:user) { Fabricate.create(:user, name: 'Anton', login: 'davydovanton') }
let(:params) { { id: user.login } }
it { expect(action.call(params)).... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/web/controllers/users/settings_spec.rb | Ruby | mit | 99 | master | 1,287 | require_relative '../../../../apps/web/controllers/users/settings'
RSpec.describe Web::Controllers::Users::Settings, type: :action do
let(:action) { described_class.new }
let(:session) { { current_user: User.new } }
let(:user) { Fabricate.create(:user, name: 'Anton', login: 'davydovanton') }
let(:params) ... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/web/controllers/static/about_spec.rb | Ruby | mit | 99 | master | 252 | require_relative '../../../../apps/web/controllers/static/about'
RSpec.describe Web::Controllers::Static::About, type: :action do
let(:action) { described_class.new }
let(:params) { Hash[] }
it { expect(action.call(params)).to be_success }
end |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/web/controllers/static/help_spec.rb | Ruby | mit | 99 | master | 250 | require_relative '../../../../apps/web/controllers/static/help'
RSpec.describe Web::Controllers::Static::Help, type: :action do
let(:action) { described_class.new }
let(:params) { Hash[] }
it { expect(action.call(params)).to be_success }
end |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/web/controllers/tasks/edit_spec.rb | Ruby | mit | 99 | master | 2,375 | require_relative '../../../../apps/web/controllers/tasks/edit'
RSpec.describe Web::Controllers::Tasks::Edit, type: :action do
let(:action) { described_class.new }
let(:user) { Fabricate.create(:user, name: 'anton') }
let(:session) { { current_user: User.new } }
let(:repo) { TaskRepository.new }
let(:t... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/web/controllers/tasks/index_spec.rb | Ruby | mit | 99 | master | 5,778 | require_relative '../../../../apps/web/controllers/tasks/index'
RSpec.describe Web::Controllers::Tasks::Index, type: :action do
let(:action) { described_class.new }
let(:params) { Hash[] }
let(:repo) { TaskRepository.new }
it { expect(action.call(params)).to be_success }
describe 'expose' do
describe '... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/web/controllers/tasks/new_spec.rb | Ruby | mit | 99 | master | 594 | require_relative '../../../../apps/web/controllers/tasks/new'
RSpec.describe Web::Controllers::Tasks::New, type: :action do
let(:action) { described_class.new }
let(:params) { Hash[] }
it { expect(action.call(params)).to be_success }
describe 'expose' do
context '#task' do
it 'returns task by id' d... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/web/controllers/tasks/show_spec.rb | Ruby | mit | 99 | master | 1,042 | require_relative '../../../../apps/web/controllers/tasks/show'
RSpec.describe Web::Controllers::Tasks::Show, type: :action do
let(:action) { described_class.new }
let(:task) { Fabricate.create(:task, title: 'test') }
let(:params) { { id: task.id } }
it { expect(action.call(params)).to be_success }
describe... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/web/controllers/tasks/create_spec.rb | Ruby | mit | 99 | master | 4,188 | require_relative '../../../../apps/web/controllers/tasks/create'
RSpec.describe Web::Controllers::Tasks::Create, type: :action do
let(:action) { described_class.new }
let(:repo) { TaskRepository.new }
let(:session) { { current_user: User.new(id: 1, login: 'test') } }
describe 'when user in not authenticated' ... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/web/controllers/tasks/update_spec.rb | Ruby | mit | 99 | master | 5,269 | require_relative '../../../../apps/web/controllers/tasks/update'
RSpec.describe Web::Controllers::Tasks::Update, type: :action do
let(:repo) { TaskRepository.new }
let(:task) { Fabricate.create(:task, title: 'title')}
let(:user) { User.new(login: 'test') }
let(:session) { { current_user: user } }
let(:action... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/web/controllers/main/index_spec.rb | Ruby | mit | 99 | master | 829 | require_relative '../../../../apps/web/controllers/main/index'
RSpec.describe Web::Controllers::Main::Index, type: :action do
let(:action) { described_class.new }
let(:params) { Hash[] }
it { expect(action.call(params)).to be_success }
describe 'with last modified cache' do
let(:task) { Fabricate.create(... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/web/controllers/leaderboards/index_spec.rb | Ruby | mit | 99 | master | 526 | require_relative '../../../../apps/web/controllers/leaderboards/index'
RSpec.describe Web::Controllers::Leaderboards::Index, type: :action do
let(:action) { described_class.new }
let(:params) { Hash[] }
it { expect(action.call(params)).to be_success }
describe 'exposes' do
describe '#users' do
befo... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/web/features/tasks_spec.rb | Ruby | mit | 99 | master | 6,213 | require_relative '../../features_helper'
module TasksPageHelper
def fill_md_text
page.find('.task-body__write > #task-md-body').set md_text
end
def expect_write
expect(page).to have_css('button.btn.btn-default.pure-menu-link', text: 'Preview')
expect(page).not_to have_css('button.btn.btn-default.pu... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/web/features/index_spec.rb | Ruby | mit | 99 | master | 1,608 | require_relative '../../features_helper'
module IndexPageSwitcher
def expect_i_want_to_contribute
expect(page).to have_css('.whatisthis-choice-item__link_active', text: 'I want to contribute')
expect(page).to have_css('.whatisthis-choice-item__link', text: "I'm a maintainer")
expect_headers('Help Commun... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/web/views/static/help_spec.rb | Ruby | mit | 99 | master | 504 | require_relative '../../../../apps/web/views/static/help'
RSpec.describe Web::Views::Static::Help, type: :view do
let(:exposures) { Hash[foo: 'bar'] }
let(:template) { Hanami::View::Template.new('apps/web/templates/static/help.html.slim') }
let(:view) { described_class.new(template, exposures) }
let(:ren... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/web/views/static/about_spec.rb | Ruby | mit | 99 | master | 507 | require_relative '../../../../apps/web/views/static/about'
RSpec.describe Web::Views::Static::About, type: :view do
let(:exposures) { Hash[foo: 'bar'] }
let(:template) { Hanami::View::Template.new('apps/web/templates/static/about.html.slim') }
let(:view) { described_class.new(template, exposures) }
let(:... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/web/views/tasks/index_spec.rb | Ruby | mit | 99 | master | 8,905 | require_relative '../../../../apps/web/views/tasks/index'
RSpec.describe Web::Views::Tasks::Index, type: :view do
let(:exposures) { Hash[foo: 'bar'] }
let(:template) { Hanami::View::Template.new('apps/web/templates/tasks/index.html.slim') }
let(:view) { described_class.new(template, exposures) }
let(:ren... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/web/views/tasks/edit_spec.rb | Ruby | mit | 99 | master | 681 | require_relative '../../../../apps/web/views/tasks/edit'
RSpec.describe Web::Views::Tasks::Edit, type: :view do
let(:exposures) { Hash[params: {}, task: Task.new(id: 1)] }
let(:template) { Hanami::View::Template.new('apps/web/templates/tasks/edit.html.slim') }
let(:view) { described_class.new(template, exp... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/web/views/tasks/show_spec.rb | Ruby | mit | 99 | master | 7,047 | require_relative '../../../../apps/web/views/tasks/show'
RSpec.describe Web::Views::Tasks::Show, type: :view do
let(:exposures) { { current_user: current_user, author: user, task: task } }
let(:template) { Hanami::View::Template.new('apps/web/templates/tasks/show.html.slim') }
let(:view) { described_class.... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/web/views/tasks/new_spec.rb | Ruby | mit | 99 | master | 1,007 | require_relative '../../../../apps/web/views/tasks/new'
RSpec.describe Web::Views::Tasks::New, type: :view do
let(:exposures) { Hash[params: { current_user: User.new }] }
let(:template) { Hanami::View::Template.new('apps/web/templates/tasks/new.html.slim') }
let(:view) { described_class.new(template, expos... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/web/views/users/show_spec.rb | Ruby | mit | 99 | master | 2,135 | require_relative '../../../../apps/web/views/users/show'
RSpec.describe Web::Views::Users::Show, type: :view do
let(:user) { User.new(id: 1, login: 'anton') }
let(:exposures) { Hash[user: user] }
let(:template) { Hanami::View::Template.new('apps/web/templates/users/show.html.slim') }
let(:view) { de... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/web/views/users/settings_spec.rb | Ruby | mit | 99 | master | 347 | require_relative '../../../../apps/web/views/users/settings'
RSpec.describe Web::Views::Users::Settings, type: :view do
let(:exposures) { Hash[] }
let(:template) { Hanami::View::Template.new('apps/web/templates/users/settings.html.slim') }
let(:view) { described_class.new(template, exposures) }
let(:rend... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/web/views/main/index_spec.rb | Ruby | mit | 99 | master | 1,252 | require_relative '../../../../apps/web/views/main/index'
RSpec.describe Web::Views::Main::Index, type: :view do
let(:exposures) { Hash[foo: 'bar'] }
let(:template) { Hanami::View::Template.new('apps/web/templates/main/index.html.slim') }
let(:view) { described_class.new(template, exposures) }
let(:render... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/web/views/leaderboards/index_spec.rb | Ruby | mit | 99 | master | 955 | require_relative '../../../../apps/web/views/leaderboards/index'
RSpec.describe Web::Views::Leaderboards::Index, type: :view do
let(:exposures) { Hash[foo: 'bar'] }
let(:template) { Hanami::View::Template.new('apps/web/templates/leaderboards/index.html.slim') }
let(:user) { User.new(id: 1, admin: false, lo... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/api/controllers/users/show_spec.rb | Ruby | mit | 99 | master | 898 | require_relative '../../../../apps/api/controllers/users/show'
RSpec.describe Api::Controllers::Users::Show, type: :action do
let(:action) { described_class.new }
let(:params) { Hash[id: user.login] }
let(:user) { Fabricate.create(:user, name: 'Anton', login: 'davydovanton') }
subject { action.call(params) }
... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/api/controllers/analytics/index_spec.rb | Ruby | mit | 99 | master | 457 | require_relative '../../../../apps/api/controllers/analytics/index'
RSpec.describe Api::Controllers::Analytics::Index, type: :action do
let(:action) { described_class.new }
let(:params) { Hash[] }
it { expect(action.call(params)).to be_success }
it { expect(action.call(params)).to match_in_body(/"labels":/) }... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/api/controllers/issue/show_spec.rb | Ruby | mit | 99 | master | 2,617 | require_relative '../../../../apps/api/controllers/issue/show'
RSpec.describe Api::Controllers::Issue::Show, :vcr, type: :action do
include Dry::Monads::Result::Mixin
let(:action) { described_class.new(operation: operation) }
let(:params) { {} }
subject { action.call(params) }
context 'when operation retu... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/api/controllers/user_repos/show_spec.rb | Ruby | mit | 99 | master | 508 | require_relative '../../../../apps/api/controllers/user_repos/show'
RSpec.describe Api::Controllers::UserRepos::Show, type: :action do
let(:action) { described_class.new }
let(:params) { Hash[login: 'davydovanton'] }
subject do
VCR.use_cassette("user_github_repos") { action.call(params) }
end
context '... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/api/controllers/md_preview/create_spec.rb | Ruby | mit | 99 | master | 2,471 | require_relative '../../../../apps/api/controllers/md_preview/create'
RSpec.describe Api::Controllers::MdPreview::Create, type: :action do
let(:action) { described_class.new }
let(:params) { {} }
it { expect(action.call(params)).to be_success }
it { expect(action.call(params).last).to eq ['{"text":""}'] }
... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/tasks/matchers/git_host_matcher_spec.rb | Ruby | mit | 99 | master | 1,307 | RSpec.describe Tasks::Matchers::GitHost::Matcher do
subject do
Tasks::Matchers::GitHost::Matcher.(issue_url) do |m|
m.success(:github){ |params| params }
m.success(:gitlab){ |params| params }
m.failure { |params| params }
end
end
context 'when string is github issue' do
let(:issue_u... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/tasks/operations/issue_information_spec.rb | Ruby | mit | 99 | master | 1,189 | # frozen_string_literal: true
RSpec.describe Tasks::Operations::IssueInformation do
let(:operation) do
described_class.new(
github_issue_requester: github_issue_requester,
gitlab_issue_requester: gitlab_issue_requester
)
end
let(:github_issue_requester) { double('Tasks::Services::GithubIssue... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/tasks/operations/update_spec.rb | Ruby | mit | 99 | master | 2,184 | # frozen_string_literal: true
RSpec.describe Tasks::Operations::Update, type: :operation do
let(:operation) { described_class.new(task_repo: task_repo, markdown_parser: markdown_parser) }
let(:markdown_parser) { ->(body) { body } }
let(:task_repo) { double('TaskRepository', find: Task.new, update: Task.new) }
... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/tasks/operations/create_spec.rb | Ruby | mit | 99 | master | 1,774 | # frozen_string_literal: true
RSpec.describe Tasks::Operations::Create, type: :operation do
require 'sidekiq/testing'
Sidekiq::Testing.fake! # fake is the default mode
let(:operation) { described_class.new(task_repo: task_repo, markdown_parser: markdown_parser) }
let(:markdown_parser) { ->(body) { body } }
... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/tasks/operations/show_spec.rb | Ruby | mit | 99 | master | 854 | # frozen_string_literal: true
RSpec.describe Tasks::Operations::Show, type: :operation do
let(:operation) { described_class.new(task_repo: task_repo) }
subject { operation.call(id: 1) }
context 'when task exists in the system' do
let(:task_repo) { double('TaskRepository', find: Task.new) }
it { expect... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/tasks/services/github_issue_requester_spec.rb | Ruby | mit | 99 | master | 1,745 | RSpec.describe Tasks::Services::GithubIssueRequester, :vcr do
let(:params) { {} }
let(:service) { described_class.new }
context 'when data is valid' do
let(:params) { { org: 'ossboard-org', repo: 'ossboard', issue: '69' } }
it 'returns github issue data' do
VCR.use_cassette("github_success_issue")... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/tasks/services/gitlab_issue_requester_spec.rb | Ruby | mit | 99 | master | 1,834 | RSpec.describe Tasks::Services::GitlabIssueRequester, :vcr do
let(:params) { { org: 'gitlab-org', repo: 'gitlab-ce', issue: '28059' } }
let(:service) { described_class.new }
context 'when data is valid' do
it 'returns gitlab issue data' do
VCR.use_cassette('gitlab_success_issue') do
data = serv... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/tasks/interactors/update_spec.rb | Ruby | mit | 99 | master | 1,676 | # frozen_string_literal: true
RSpec.describe Tasks::Interactors::Update do
let(:params_valid) { true }
let(:current_user) { Fabricate.create(:user, login: 'davydovanton') }
let(:task) { Fabricate.create(:task, user_id: current_user.id, status: 'in progress') }
let(:params) do
{ id: task.id, task: { title: ... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/tasks/interactors/update_status_spec.rb | Ruby | mit | 99 | master | 1,112 | # frozen_string_literal: true
RSpec.describe Tasks::Interactors::UpdateStatus do
let(:current_user) { Fabricate.create(:user, login: 'davydovanton') }
let(:task) { Fabricate.create(:task, user_id: current_user.id, status: 'in progress') }
let(:params) { { id: task.id, status: 'closed' } }
let(:interactor) { de... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/tasks/interactors/create_spec.rb | Ruby | mit | 99 | master | 1,094 | # frozen_string_literal: true
RSpec.describe Tasks::Interactors::Create do
let(:is_valid) { true }
let(:params) { { task: { status: 'in_progress', md_body: Faker::Hipster.sentence, title: 'test_task_title' } } }
let(:interactor) { described_class }
describe '#initialize' do
it 'instantiates class with 2 a... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/ossboard/services/points_calculator_spec.rb | Ruby | mit | 99 | master | 3,490 | RSpec.describe Services::PointsCalculator do
let(:user) { Fabricate.create(:user, login: 'davydovanton') }
let(:service) { Services::PointsCalculator.new }
subject { service.call(UserRepository.new.all_with_points_and_tasks.last) }
describe '#perform' do
context 'when user does not have tasks' do
it ... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/ossboard/services/task_twitter_spec.rb | Ruby | mit | 99 | master | 794 | RSpec.describe Services::TaskTwitter do
let(:task) { Fabricate.create(:task, user_id: Fabricate.create(:user).id) }
subject { Services::TaskTwitter.new.call(task) }
describe '#call' do
context 'with correct text' do
let(:task) { Fabricate.create(:task, user_id: Fabricate.create(:user).id) }
it ... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/ossboard/services/url_shortener_spec.rb | Ruby | mit | 99 | master | 568 | RSpec.describe Services::UrlShortener do
subject { Services::UrlShortener.new.call(url) }
describe '#shorten_url' do
context 'when link valid' do
let(:url) { 'https://example.com' }
it 'shortens url' do
VCR.use_cassette("isgd_shortener_success") { expect(subject).to eq 'https://is.gd/jGamH... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/ossboard/services/analytic_reporter_spec.rb | Ruby | mit | 99 | master | 2,366 | RSpec.describe Services::AnalyticReporter do
subject { Services::AnalyticReporter.new.call }
context 'labels information' do
it 'returns array of days for chart labels' do
labels = subject[:labels]
expect(labels).to be_a(Array)
expect(labels.count).to eq 31
expect(labels).to all(be_a(St... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/ossboard/mailers/new_task_spec.rb | Ruby | mit | 99 | master | 451 | require 'spec_helper'
describe Mailers::NewTask do
let(:user) { User.new(email: 'anton@ossboard.org') }
let(:task) { Task.new(id: 1) }
it 'delivers email' do
Mailers::NewTask.deliver(user: user, task: task)
mail = Hanami::Mailer.deliveries.last
expect(mail.to).to eq [user.email]
expect(mail.sub... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/ossboard/mailers/task_approved_spec.rb | Ruby | mit | 99 | master | 470 | require 'spec_helper'
describe Mailers::TaskApproved do
let(:user) { User.new(email: 'anton@ossboard.org') }
let(:task) { Task.new(id: 1) }
it 'delivers email' do
Mailers::TaskApproved.deliver(user: user, task: task)
mail = Hanami::Mailer.deliveries.last
expect(mail.to).to eq [user.email]
expec... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/ossboard/core/http_request_spec.rb | Ruby | mit | 99 | master | 926 | RSpec.describe Core::HttpRequest do
let(:action) { described_class.new }
describe '.get' do
context 'when resource found' do
let(:url) { 'https://www.ossboard.org' }
it 'return status code 200' do
VCR.use_cassette('ossboard_get_success') do
expect(action.get(url).code).to eq '200'... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/ossboard/core/markdown_parser_spec.rb | Ruby | mit | 99 | master | 2,067 | RSpec.describe Core::MarkdownParser do
let(:markdown){ described_class.new }
subject { markdown.call(text) }
describe '#parse' do
context 'when text contain heading' do
let(:text){ '# title' }
it { expect(subject).to eq %{<h1 id="title">title</h1>\n} }
end
context 'when text contain cod... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/ossboard/entities/user_spec.rb | Ruby | mit | 99 | master | 1,583 | RSpec.describe User do
describe '#registred?' do
context 'when user is anonymous' do
let(:user) { User.new }
it { expect(user.registred?).to be false }
end
context 'when user is anonymous' do
let(:user) { User.new(id: 1) }
it { expect(user.registred?).to be true }
end
end
... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/ossboard/entities/task_spec.rb | Ruby | mit | 99 | master | 700 | RSpec.describe Task do
let(:user) { Fabricate.create(:user, login: 'testtest') }
describe "#author" do
context 'when no author is assigned to task' do
let(:task) { Task.new(id: 2) }
it { expect(task.author).to eq(nil) }
end
context 'when author is present' do
let(:task) { Fabricate.... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/ossboard/entities/account_spec.rb | Ruby | mit | 99 | master | 500 | RSpec.describe Account do
describe '#registred?' do
context 'when user is anonymous' do
let(:account) { Account.new }
it { expect(account.registred?).to be false }
end
context 'when user is anonymous' do
let(:account) { Account.new(id: 1) }
it { expect(account.registred?).to be tr... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/ossboard/repositories/bloked_user_repository_spec.rb | Ruby | mit | 99 | master | 1,428 | RSpec.describe BlokedUserRepository do
before { Container[:redis].with(&:flushdb) }
let(:repo) { BlokedUserRepository.new }
describe '#all' do
context 'when blocked users not exist' do
it { expect(repo.all).to eq [] }
end
context 'when blocked users exist' do
before do
repo.crea... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/ossboard/repositories/user_repository_spec.rb | Ruby | mit | 99 | master | 3,230 | RSpec.describe UserRepository do
let(:repo) { UserRepository.new }
describe '#find_by_login' do
context 'when user exist with uuid' do
before { Fabricate.create(:user, login: 'test') }
it { expect(repo.find_by_login('test')).to be_a User }
it { expect(repo.find_by_login('test').login).to eq ... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/ossboard/repositories/account_repository_spec.rb | Ruby | mit | 99 | master | 450 | RSpec.describe AccountRepository do
describe '#find_by_uid' do
let(:repo) { AccountRepository.new }
context 'when user exist with uuid' do
before { repo.create(uid: 'test') }
it { expect(repo.find_by_uid('test')).to be_a Account }
it { expect(repo.find_by_uid('test').uid).to eq 'test' }
... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/ossboard/repositories/task_repository_spec.rb | Ruby | mit | 99 | master | 6,241 | RSpec.describe TaskRepository do
let(:repo) { TaskRepository.new }
describe '#find_by' do
before do
Fabricate.create(:task, title: 'in progress', approved: true, status: 'in progress', lang: 'ruby')
Fabricate.create(:task, title: 'closed', approved: true, status: 'closed', lang: 'haskell')
Fa... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/ossboard/workers/calculate_points_worker_spec.rb | Ruby | mit | 99 | master | 3,404 | RSpec.describe CalculatePointsWorker do
let(:user) { Fabricate.create(:user, login: 'davydovanton') }
subject { CalculatePointsWorker.new.perform }
describe '#perform' do
context 'when user does not have tasks' do
it 'does nothing' do
user and subject
point = PointRepository.new.points.... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/ossboard/workers/approve_task_worker_spec.rb | Ruby | mit | 99 | master | 385 | RSpec.describe ApproveTaskWorker do
let(:task) { Fabricate.create(:task, user_id: Fabricate.create(:user).id) }
subject { ApproveTaskWorker.new }
describe '#perform' do
it 'sends email to all admins' do
VCR.use_cassette("approve_task_worker") do
expect{ subject.perform(task.id) }.to change { Ha... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/ossboard/workers/new_task_notification_worker_spec.rb | Ruby | mit | 99 | master | 368 | RSpec.describe NewTaskNotificationWorker do
let(:task) { Fabricate.create(:task) }
subject { NewTaskNotificationWorker.new }
describe '#perform' do
before { 3.times { Fabricate.create(:user, admin: true) } }
it 'sends email to all admins' do
expect{ subject.perform(task.id) }.to change { Hanami::M... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/auth/views/sessions/create_spec.rb | Ruby | mit | 99 | master | 442 | require_relative '../../../../apps/auth/views/sessions/create'
RSpec.describe Auth::Views::Sessions::Create, type: :view do
let(:exposures) { Hash[foo: 'bar'] }
let(:template) { Hanami::View::Template.new('apps/auth/templates/sessions/create.html.slim') }
let(:view) { described_class.new(template, exposure... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/auth/views/sessions/failure_spec.rb | Ruby | mit | 99 | master | 445 | require_relative '../../../../apps/auth/views/sessions/failure'
RSpec.describe Auth::Views::Sessions::Failure, type: :view do
let(:exposures) { Hash[foo: 'bar'] }
let(:template) { Hanami::View::Template.new('apps/auth/templates/sessions/failure.html.slim') }
let(:view) { described_class.new(template, expos... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/auth/controllers/sessions/create_spec.rb | Ruby | mit | 99 | master | 7,001 | require_relative '../../../../apps/auth/controllers/sessions/create'
RSpec.describe Auth::Controllers::Sessions::Create, type: :action do
let(:action) { described_class.new }
let(:params) { Hash[ 'omniauth.auth' => onmiauth_hash ] }
let(:uuid) { '1147484' }
let(:repo) { UserRepository.new }
let(:account_repo... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/auth/controllers/sessions/failure_spec.rb | Ruby | mit | 99 | master | 268 | require_relative '../../../../apps/auth/controllers/sessions/failure'
RSpec.describe Auth::Controllers::Sessions::Failure, type: :action do
let(:action) { described_class.new }
let(:params) { Hash[] }
it { expect(action.call(params)).to redirect_to('/') }
end |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/auth/controllers/sessions/destroy_spec.rb | Ruby | mit | 99 | master | 1,119 | require_relative '../../../../apps/auth/controllers/sessions/destroy'
RSpec.describe Auth::Controllers::Sessions::Destroy, type: :action do
let(:action) { described_class.new }
let(:params) { { 'rack.session' => session } }
context 'when session is empty' do
let(:session) { { current_user: nil, account: ni... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/admin/views/moderation/index_spec.rb | Ruby | mit | 99 | master | 1,542 | require_relative '../../../../apps/admin/views/moderation/index'
RSpec.describe Admin::Views::Moderation::Index, type: :view do
let(:exposures) { Hash[foo: 'bar'] }
let(:template) { Hanami::View::Template.new('apps/admin/templates/moderation/index.html.slim') }
let(:view) { described_class.new(template, ex... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/admin/views/dashboard/index_spec.rb | Ruby | mit | 99 | master | 692 | require_relative '../../../../apps/admin/views/dashboard/index'
RSpec.describe Admin::Views::Dashboard::Index, type: :view do
let(:exposures) { Hash[foo: 'bar'] }
let(:template) { Hanami::View::Template.new('apps/admin/templates/dashboard/index.html.slim') }
let(:view) { described_class.new(template, expos... |
github | ossboard-org/ossboard | https://github.com/ossboard-org/ossboard | spec/admin/views/users/index_spec.rb | Ruby | mit | 99 | master | 2,585 | require_relative '../../../../apps/admin/views/users/index'
RSpec.describe Admin::Views::Users::Index, type: :view do
let(:exposures) { Hash[foo: 'bar'] }
let(:template) { Hanami::View::Template.new('apps/admin/templates/users/index.html.slim') }
let(:view) { described_class.new(template, exposures) }
le... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.