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 | robbi5/kleineanfragen | https://github.com/robbi5/kleineanfragen | config/initializers/inflections.rb | Ruby | mit | 45 | master | 664 | # Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format. Inflections
# are locale specific, and you may define rules for as many different
# locales as you wish. All of these examples are active by default:
# ActiveSupport::Inflector.inflections(:en) do |inflec... |
github | robbi5/kleineanfragen | https://github.com/robbi5/kleineanfragen | config/initializers/searchkick.rb | Ruby | mit | 45 | master | 486 | # overriding used es client to force typhoeus.
# default: if patron and typhoeus are in the same application, patron is used
# see: elasticsearch-transport-1.0.15, client.rb#__auto_detect_adapter
Searchkick.client =
Elasticsearch::Client.new(
url: ENV.fetch('ELASTICSEARCH_URL', 'localhost:9200'),
adapter: :ty... |
github | robbi5/kleineanfragen | https://github.com/robbi5/kleineanfragen | config/initializers/assets.rb | Ruby | mit | 45 | master | 890 | # Be sure to restart your server when you modify this file.
# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = '1.0'
# Add additional assets to the asset load path.
# Rails.application.config.assets.paths << Emoji.images_path
# Add Yarn node_modules ... |
github | robbi5/kleineanfragen | https://github.com/robbi5/kleineanfragen | config/initializers/active_job.rb | Ruby | mit | 45 | master | 354 | # thanks, railties/lib/rails/application/bootstrap.rb
logfile = File.open 'log/active_job.log', 'a'
logfile.binmode
logfile.sync = true # if true make sure every write flushes
ajlogger = ActiveSupport::Logger.new(logfile)
ajlogger.formatter = Lograge.formatter # Logger::Formatter.new
ActiveJob::Base.logger = ActiveSu... |
github | robbi5/kleineanfragen | https://github.com/robbi5/kleineanfragen | config/initializers/new_framework_defaults.rb | Ruby | mit | 45 | master | 1,028 | # Be sure to restart your server when you modify this file.
#
# This file contains migration options to ease your Rails 5.0 upgrade.
#
# Once upgraded flip defaults one by one to migrate to the new default.
#
# Read the Rails 5.0 release notes for more info on each option.
# Enable per-form CSRF tokens. Previous versi... |
github | robbi5/kleineanfragen | https://github.com/robbi5/kleineanfragen | config/initializers/mime_types.rb | Ruby | mit | 45 | master | 269 | # Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
Mime::Type.register 'text/plain', :txt
# Mime::Type.register "application/pdf", :pdf # already in action_dispatch |
github | robbi5/kleineanfragen | https://github.com/robbi5/kleineanfragen | config/initializers/fog.rb | Ruby | mit | 45 | master | 1,240 | require 'fog/aws'
require 'fog/aws/models/storage/file'
module AppStorage
class << self
attr_accessor :storage, :bucket, :initialized
def initialize!
return if @initialized
fog_config = YAML.load(ERB.new(File.read("#{Rails.root}/config/fog.yml")).result)[Rails.env].to_options
bucket = fog_config.del... |
github | robbi5/kleineanfragen | https://github.com/robbi5/kleineanfragen | db/seeds.rb | Ruby | mit | 45 | master | 6,897 | # This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel... |
github | robbi5/kleineanfragen | https://github.com/robbi5/kleineanfragen | db/schema.rb | Ruby | mit | 45 | master | 8,282 | # This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# dat... |
github | robbi5/kleineanfragen | https://github.com/robbi5/kleineanfragen | db/migrate/20140903101921_create_bodies.rb | Ruby | mit | 45 | master | 294 | class CreateBodies < ActiveRecord::Migration[4.2]
def change
create_table :bodies do |t|
t.text :name
t.string :state, limit: 2
t.text :website
t.timestamps
end
add_index :bodies, :name, unique: true
add_index :bodies, :state, unique: true
end
end |
github | robbi5/kleineanfragen | https://github.com/robbi5/kleineanfragen | db/migrate/20170416160058_create_paper_redirects.rb | Ruby | mit | 45 | master | 336 | class CreatePaperRedirects < ActiveRecord::Migration[5.0]
def change
create_table :paper_redirects do |t|
t.references :body, foreign_key: true, null: false
t.integer :legislative_term
t.text :reference
t.references :paper, index: true, foreign_key: true, null: false
t.timestamps
... |
github | robbi5/kleineanfragen | https://github.com/robbi5/kleineanfragen | db/migrate/20150309155930_create_scraper_results.rb | Ruby | mit | 45 | master | 270 | class CreateScraperResults < ActiveRecord::Migration[4.2]
def change
create_table :scraper_results do |t|
t.references :body
t.timestamp :started_at
t.timestamp :stopped_at
t.string :result
t.timestamps null: false
end
end
end |
github | robbi5/kleineanfragen | https://github.com/robbi5/kleineanfragen | db/migrate/20150110181315_create_ministries.rb | Ruby | mit | 45 | master | 312 | class CreateMinistries < ActiveRecord::Migration[4.2]
def change
create_table :ministries do |t|
t.references :body, index: true
t.string :name
t.timestamps null: false
end
add_foreign_key :ministries, :bodies
add_index :ministries, [:body_id, :name], unique: true
end
end |
github | robbi5/kleineanfragen | https://github.com/robbi5/kleineanfragen | db/migrate/20160102161745_create_paper_relations.rb | Ruby | mit | 45 | master | 603 | class CreatePaperRelations < ActiveRecord::Migration[4.2]
def change
create_table :paper_relations do |t|
t.references :paper, index: true, foreign_key: true, null: false
t.integer :other_paper_id, index: true, null: false
t.string :reason
t.timestamps null: false
end
add_foreign... |
github | robbi5/kleineanfragen | https://github.com/robbi5/kleineanfragen | db/migrate/20140903144831_create_paper_originators.rb | Ruby | mit | 45 | master | 236 | class CreatePaperOriginators < ActiveRecord::Migration[4.2]
def change
create_table :paper_originators do |t|
t.references :paper, index: true
t.references :originator, polymorphic: true, index: true
end
end
end |
github | robbi5/kleineanfragen | https://github.com/robbi5/kleineanfragen | db/migrate/20140903102233_create_papers.rb | Ruby | mit | 45 | master | 457 | class CreatePapers < ActiveRecord::Migration[4.2]
def change
create_table :papers do |t|
t.references :body, index: true
t.integer :legislative_term
t.text :reference
t.text :title
t.text :contents
t.integer :page_count
t.text :url
t.date :published_at
t.datet... |
github | robbi5/kleineanfragen | https://github.com/robbi5/kleineanfragen | db/migrate/20160821113555_create_legislative_terms.rb | Ruby | mit | 45 | master | 266 | class CreateLegislativeTerms < ActiveRecord::Migration[5.0]
def change
create_table :legislative_terms do |t|
t.references :body, foreign_key: true
t.integer :term
t.date :starts_at
t.date :ends_at
t.timestamps
end
end
end |
github | robbi5/kleineanfragen | https://github.com/robbi5/kleineanfragen | db/migrate/20150417142732_add_frozen_at_to_paper.rb | Ruby | mit | 45 | master | 414 | # Sometimes the scrapers/extractors produce weird data, because
# the original source had corrupt data. In those cases we can
# "freeze" the paper and correct the data manually. The freezing
# allows to skip the paper in the jobs (see PaperJob) for the case
# the paper is accessed again.
class AddFrozenAtToPaper < Acti... |
github | robbi5/kleineanfragen | https://github.com/robbi5/kleineanfragen | db/migrate/20150209092207_update_scope_in_slug_index_of_paper.rb | Ruby | mit | 45 | master | 316 | class UpdateScopeInSlugIndexOfPaper < ActiveRecord::Migration[4.2]
def up
remove_index :papers, :slug
add_index :papers, [:body_id, :legislative_term, :slug], unique: true
end
def down
remove_index :papers, [:body_id, :legislative_term, :slug]
add_index :papers, :slug, unique: true
end
end |
github | robbi5/kleineanfragen | https://github.com/robbi5/kleineanfragen | db/migrate/20140903152041_create_organizations_people.rb | Ruby | mit | 45 | master | 342 | class CreateOrganizationsPeople < ActiveRecord::Migration[4.2]
def change
create_table :organizations_people, id: false do |t|
t.references :organization
t.references :person
end
add_index :organizations_people, [:organization_id, :person_id],
name: "organizations_people_index",
u... |
github | robbi5/kleineanfragen | https://github.com/robbi5/kleineanfragen | db/migrate/20150110181612_create_paper_answerers.rb | Ruby | mit | 45 | master | 276 | class CreatePaperAnswerers < ActiveRecord::Migration[4.2]
def change
create_table :paper_answerers do |t|
t.references :paper, index: true
t.references :answerer, polymorphic: true, index: true
end
add_foreign_key :paper_answerers, :papers
end
end |
github | robbi5/kleineanfragen | https://github.com/robbi5/kleineanfragen | db/migrate/20150209082805_update_scope_in_slug_index_of_ministry.rb | Ruby | mit | 45 | master | 297 | class UpdateScopeInSlugIndexOfMinistry < ActiveRecord::Migration[4.2]
def up
remove_index :ministries, :slug
add_index :ministries, [:body_id, :slug], unique: true
end
def down
remove_index :ministries, [:body_id, :slug]
add_index :ministries, :slug, unique: true
end
end |
github | sous-chefs/rundeck | https://github.com/sous-chefs/rundeck | metadata.rb | Ruby | apache-2.0 | 45 | main | 486 | name 'rundeck'
maintainer 'Sous Chefs'
maintainer_email 'help@sous-chefs.org'
license 'Apache-2.0'
description 'Installs and configures Rundeck 2.x'
version '8.1.11'
depends 'java'
depends 'apache2', '>= 9.0.0'
%w(ubuntu centos fedora redhat scientific oracle... |
github | sous-chefs/rundeck | https://github.com/sous-chefs/rundeck | resources/plugin.rb | Ruby | apache-2.0 | 45 | main | 1,809 | #
# Cookbook:: rundeck
# Resource:: plugin
#
# Copyright:: 2012, Peter Crossley
#
# 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... |
github | sous-chefs/rundeck | https://github.com/sous-chefs/rundeck | resources/project.rb | Ruby | apache-2.0 | 45 | main | 4,161 | #
# Cookbook:: rundeck
# Resource:: project
#
# 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 ... |
github | sous-chefs/rundeck | https://github.com/sous-chefs/rundeck | resources/cli.rb | Ruby | apache-2.0 | 45 | main | 1,527 | # frozen_string_literal: true
#
# Cookbook:: rundeck
# Resource:: cli
#
# 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... |
github | sous-chefs/rundeck | https://github.com/sous-chefs/rundeck | resources/repository.rb | Ruby | apache-2.0 | 45 | main | 1,748 | # frozen_string_literal: true
#
# Cookbook:: rundeck
# Resource:: repository
#
# 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 requ... |
github | sous-chefs/rundeck | https://github.com/sous-chefs/rundeck | resources/apache.rb | Ruby | apache-2.0 | 45 | main | 4,522 | # frozen_string_literal: true
#
# Cookbook:: rundeck
# Resource:: apache
#
# 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... |
github | sous-chefs/rundeck | https://github.com/sous-chefs/rundeck | resources/dependencies.rb | Ruby | apache-2.0 | 45 | main | 697 | # frozen_string_literal: true
#
# Cookbook:: rundeck
# Resource:: dependencies
#
# 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... |
github | sous-chefs/rundeck | https://github.com/sous-chefs/rundeck | resources/server_install.rb | Ruby | apache-2.0 | 45 | main | 13,343 | # frozen_string_literal: true
#
# Cookbook:: rundeck
# Resource:: server_install
#
# 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 ... |
github | sous-chefs/rundeck | https://github.com/sous-chefs/rundeck | spec/spec_helper.rb | Ruby | apache-2.0 | 45 | main | 238 | require 'chefspec'
require 'chefspec/berkshelf'
require_relative '../libraries/helpers'
Dir['./spec/support/**/*.rb'].sort.each { |f| require f }
RSpec.configure do |config|
config.formatter = :documentation
config.color = true
end |
github | sous-chefs/rundeck | https://github.com/sous-chefs/rundeck | spec/recipes/server_install_spec.rb | Ruby | apache-2.0 | 45 | main | 261 | require 'spec_helper'
describe 'rundeck_install' do
step_into :rundeck_install
platform 'ubuntu'
context 'install rundeck' do
recipe do
rundeck_server_install 'package'
end
# it { is_expected.to install_package('rundeck') }
end
end |
github | sous-chefs/rundeck | https://github.com/sous-chefs/rundeck | spec/resources/repository_spec.rb | Ruby | apache-2.0 | 45 | main | 617 | require 'spec_helper'
describe 'rundeck_repository - Ubuntu' do
step_into :rundeck_repository
platform 'ubuntu'
context 'install default repository' do
recipe do
rundeck_repository 'default'
end
it 'creates repository' do
is_expected.to add_apt_repository('rundeck')
end
end
end
d... |
github | sous-chefs/rundeck | https://github.com/sous-chefs/rundeck | spec/resources/server_install_spec.rb | Ruby | apache-2.0 | 45 | main | 530 | require 'spec_helper'
describe 'rundeck_server_install - RedHat' do
step_into :rundeck_server_install
platform 'redhat'
context 'installs' do
recipe do
rundeck_server_install 'default'
end
it 'creates install directory' do
is_expected.to create_directory('/var/lib/rundeck').with(
... |
github | sous-chefs/rundeck | https://github.com/sous-chefs/rundeck | spec/resources/project_spec.rb | Ruby | apache-2.0 | 45 | main | 423 | # require 'spec_helper'
# describe 'rundeck_repository - Ubuntu' do
# step_into :rundeck_project
# platform 'ubuntu'
# context 'create test project' do
# recipe do
# rundeck_project 'test' do
# admin_password 'admin'
# endpoint 'http://localhost:4440'
# end
# end
# it 'i... |
github | sous-chefs/rundeck | https://github.com/sous-chefs/rundeck | libraries/helpers.rb | Ruby | apache-2.0 | 45 | main | 1,238 | #
# Cookbook:: rundeck
# Library:: helpers
#
# 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 t... |
github | sous-chefs/rundeck | https://github.com/sous-chefs/rundeck | libraries/java_properties.rb | Ruby | apache-2.0 | 45 | main | 757 | class Hash
def to_java_properties_hash(prefix = '')
properties = {}
each do |property, value|
new_prefix = prefix.empty? ? property.to_s : prefix + '.' + property.to_s
if value.respond_to? :to_java_properties_hash
properties.merge!(value.to_java_properties_hash(new_prefix))
else
... |
github | sous-chefs/rundeck | https://github.com/sous-chefs/rundeck | test/integration/default/controls/server_spec.rb | Ruby | apache-2.0 | 45 | main | 1,791 | describe service('rundeckd') do
it { should be_installed }
it { should be_enabled }
it { should be_running }
end
case os[:family]
when 'redhat'
describe yum.repo('rundeck') do
it { should exist }
it { should be_enabled }
end
when 'debian'
describe apt('https://packages.rundeck.com/pagerduty/rundec... |
github | sous-chefs/rundeck | https://github.com/sous-chefs/rundeck | test/cookbooks/test/metadata.rb | Ruby | apache-2.0 | 45 | main | 200 | # frozen_string_literal: true
name 'test'
maintainer 'Sous Chefs'
maintainer_email 'help@sous-chefs.org'
license 'Apache-2.0'
description 'Installs/Configures test'
version '0.1.0'
depends 'rundeck' |
github | sous-chefs/rundeck | https://github.com/sous-chefs/rundeck | test/cookbooks/test/recipes/default.rb | Ruby | apache-2.0 | 45 | main | 531 | rundeck_server_install 'package' do
acl_policies node['rundeck']['acl_policies']
uuid '2f1d7b81-f8ec-4dcc-b538-bfcfa05fee9a'
action :install
end
rundeck_apache 'package' do
action :install
end
project_properties = {
'service.FileCopier.default.provider': 'jsch-scp',
}
rundeck_project 'test' do
descriptio... |
github | sous-chefs/rundeck | https://github.com/sous-chefs/rundeck | test/cookbooks/test/attributes/default.rb | Ruby | apache-2.0 | 45 | main | 1,816 | default['rundeck']['acl_policies'] = {
'admin' => [
{
description: 'Administrators, all access.',
context: {
project: '.*',
},
for: {
resource: [
{
equals: { kind: 'job' },
allow: [
'create',
],
},
... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | Guardfile | Ruby | apache-2.0 | 45 | master | 232 | # A sample Guardfile
# More info at https://github.com/guard/guard#readme
guard :rspec do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { 'spec' }
end |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | Rakefile | Ruby | apache-2.0 | 45 | master | 655 | # encoding: utf-8
require 'bundler'
require 'rspec/core/rake_task'
require 'rubocop/rake_task'
require 'bundler/gem_tasks'
require 'rdoc/task'
begin
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
$stderr.puts e.message
$stderr.puts 'Run `bundle install` to install missing gems'
exit e... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | Gemfile | Ruby | apache-2.0 | 45 | master | 268 | source 'https://rubygems.org'
# Specify your gem's dependencies in lock_jar.gemspec
gemspec
group :test do
gem 'codeclimate-test-reporter', require: nil
gem 'jarfile_gem', path: 'spec/fixtures/jarfile_gem'
end
group :development do
gem 'pry'
gem 'yard'
end |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | lock_jar.gemspec | Ruby | apache-2.0 | 45 | master | 1,196 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'lock_jar/version'
Gem::Specification.new do |s|
s.name = 'lock_jar'
s.version = LockJar::VERSION
s.authors = ['Michael Guymon']
s.date = '2014-03-06'
s.description = 'Manage Jar files ... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | lib/lock_jar.rb | Ruby | apache-2.0 | 45 | master | 7,556 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with this
# work for additional information regarding copyright ownership. The ASF
# licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use t... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | lib/lock_jar/maven.rb | Ruby | apache-2.0 | 45 | master | 3,811 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with this
# work for additional information regarding copyright ownership. The ASF
# licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use t... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | lib/lock_jar/buildr.rb | Ruby | apache-2.0 | 45 | master | 4,681 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with this
# work for additional information regarding copyright ownership. The ASF
# licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use t... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | lib/lock_jar/runtime.rb | Ruby | apache-2.0 | 45 | master | 2,925 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with this
# work for additional information regarding copyright ownership. The ASF
# licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use t... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | lib/lock_jar/bundler.rb | Ruby | apache-2.0 | 45 | master | 1,974 | require 'lock_jar'
require 'lock_jar/registry'
require 'lock_jar/domain/lockfile'
require 'lock_jar/domain/dsl'
require 'lock_jar/domain/gem_dsl'
require 'lock_jar/domain/jarfile_dsl'
require 'lock_jar/domain/dsl_merger'
module LockJar
#
class Bundler
class << self
# Create a lock file from bundled gems
... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | lib/lock_jar/class_loader.rb | Ruby | apache-2.0 | 45 | master | 2,091 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with this
# work for additional information regarding copyright ownership. The ASF
# licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use t... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | lib/lock_jar/cli.rb | Ruby | apache-2.0 | 45 | master | 2,183 | require 'rubygems'
require 'thor'
require 'lock_jar'
require 'lock_jar/logging'
module LockJar
#
class CLI < Thor
#
module ClassMethods
def generate_lockfile_option
method_option(
:lockfile,
aliases: '-l',
default: 'Jarfile.lock',
desc: 'Path to Jarfile... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | lib/lock_jar/resolver.rb | Ruby | apache-2.0 | 45 | master | 2,810 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with this
# work for additional information regarding copyright ownership. The ASF
# licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use t... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | lib/lock_jar/config.rb | Ruby | apache-2.0 | 45 | master | 923 | require 'yaml'
module LockJar
# Global configuration for LockJar
class Config
CONFIG_ENV = 'LOCKJAR_CONFIG'.freeze
DEFAULT_FILENAME = '.lockjar'.freeze
attr_reader :repositories
class << self
# Load .lockjar YAML config file from ENV['LOCKJAR_CONFIG'], current_dir, or
# home dir.
... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | lib/lock_jar/logging.rb | Ruby | apache-2.0 | 45 | master | 238 | require 'naether/java'
module LockJar
#
class Logging
def self.verbose!
Naether::Java.exec_static_method(
'com.tobedevoured.naether.LogUtil',
'setDefaultLogLevel',
['info']
)
end
end
end |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | lib/lock_jar/registry.rb | Ruby | apache-2.0 | 45 | master | 2,201 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with this
# work for additional information regarding copyright ownership. The ASF
# licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use t... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | lib/lock_jar/domain/dsl_merger.rb | Ruby | apache-2.0 | 45 | master | 2,594 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with this
# work for additional information regarding copyright ownership. The ASF
# licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use t... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | lib/lock_jar/domain/artifact.rb | Ruby | apache-2.0 | 45 | master | 2,412 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with this
# work for additional information regarding copyright ownership. The ASF
# licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use t... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | lib/lock_jar/domain/lockfile.rb | Ruby | apache-2.0 | 45 | master | 3,630 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with this
# work for additional information regarding copyright ownership. The ASF
# licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use t... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | lib/lock_jar/domain/gem_dsl.rb | Ruby | apache-2.0 | 45 | master | 1,390 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with this
# work for additional information regarding copyright ownership. The ASF
# licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use t... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | lib/lock_jar/domain/jarfile_dsl.rb | Ruby | apache-2.0 | 45 | master | 1,135 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with this
# work for additional information regarding copyright ownership. The ASF
# licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use t... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | lib/lock_jar/domain/dsl.rb | Ruby | apache-2.0 | 45 | master | 4,451 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with this
# work for additional information regarding copyright ownership. The ASF
# licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use t... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | lib/lock_jar/runtime/install.rb | Ruby | apache-2.0 | 45 | master | 805 | module LockJar
#
class Runtime
#
module Install
def install(jarfile_lock, groups = ['default'], opts = {}, &blk)
deps = list(jarfile_lock, groups, { with_locals: false }.merge(opts), &blk)
lockfile = LockJar::Domain::Lockfile.read(jarfile_lock)
if opts[:local_repo].nil? && loc... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | lib/lock_jar/runtime/list.rb | Ruby | apache-2.0 | 45 | master | 2,423 | module LockJar
#
class Runtime
#
module List
# rubocop:disable Metrics/PerceivedComplexity, MethodLength
def list(lockfile_or_path, groups = ['default'], opts = {}, &blk)
dependencies = []
maps = []
with_locals = { with_locals: true }.merge(opts).delete(:with_locals)
... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | lib/lock_jar/runtime/lock.rb | Ruby | apache-2.0 | 45 | master | 4,450 | require 'delegate'
module LockJar
#
class Runtime
#
class Lock < SimpleDelegator
attr_accessor :jarfile, :lockfile, :opts
def initialize(runtime)
super(runtime)
@lockfile = LockJar::Domain::Lockfile.new
end
def lock(jarfile_or_dsl, opts = {}, &blk)
@opts =... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | lib/lock_jar/runtime/load.rb | Ruby | apache-2.0 | 45 | master | 1,875 | module LockJar
#
class Runtime
#
module Load
# Load paths from a lockfile or block. Paths are loaded once per lockfile.
#
# @param [String] lockfile_path the lockfile
# @param [Array] groups to load into classpath
# @param [Hash] opts
# @param [Block] blk
# rubocop:... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | spec/spec_helper.rb | Ruby | apache-2.0 | 45 | master | 1,472 | $LOAD_PATH.unshift File.expand_path('.')
$LOAD_PATH.unshift File.expand_path(File.join('..', File.dirname(__FILE__)))
$LOAD_PATH.unshift File.expand_path(File.join('..', File.dirname(__FILE__), 'lib'))
require 'rspec'
require 'lock_jar'
require 'lock_jar/cli'
require 'stringio'
require 'fileutils'
require 'lock_jar/lo... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | spec/lock_jar_spec.rb | Ruby | apache-2.0 | 45 | master | 17,046 | require 'spec_helper'
require 'lib/lock_jar'
require 'lib/lock_jar/domain/dsl'
require 'naether'
describe LockJar do
include Spec::Helpers
let(:local_repo) { "#{TEMP_DIR}/test-repo" }
before do
LockJar::Runtime.instance.reset!
if File.exist?(TEMP_DIR)
remove_file("#{TEMP_DIR}/Jarfile.lock")
... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | spec/lock_jar/runtime_spec.rb | Ruby | apache-2.0 | 45 | master | 902 | require 'spec_helper'
require 'lock_jar/runtime'
describe LockJar::Runtime do
describe '#load' do
it 'should set local repo' do
LockJar::Runtime.instance.load(nil, [], resolve: true, local_repo: TEST_REPO) do
jar 'org.testng:testng:jar:6.9.10'
end
LockJar::Runtime.instance.current_reso... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | spec/lock_jar/class_loader_spec.rb | Ruby | apache-2.0 | 45 | master | 1,833 | require 'spec_helper'
require 'lock_jar/class_loader'
describe LockJar::ClassLoader, '#isolate' do
if Naether.platform != 'java'
pending 'need tests for RJB backed classloader'
else
it 'should create a SimpleEmail' do
# Generate the IsolateJarfile.lock
LockJar.lock(lockfile: "#{TEMP_DIR}/Isolat... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | spec/lock_jar/maven_spec.rb | Ruby | apache-2.0 | 45 | master | 547 | require 'spec_helper'
require 'lock_jar'
require 'lock_jar/maven'
require 'naether'
describe LockJar::Maven do
before do
# Bootstrap Naether
Naether::Bootstrap.bootstrap_local_repo
end
it 'should get pom version' do
LockJar::Maven.pom_version('spec/pom.xml').should eql('3')
end
it 'should insta... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | spec/lock_jar/cli_spec.rb | Ruby | apache-2.0 | 45 | master | 2,711 | require 'spec_helper'
describe 'lockjar' do
include Spec::Helpers
before do
install_jarfile <<-J
jar 'com.google.guava:guava:14.0.1'
J
end
after do
remove_file('Jarfile')
remove_file('Jarfile.lock')
end
context 'version' do
it 'should return correct version' do
lockjar 'version'
... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | spec/lock_jar/config_spec.rb | Ruby | apache-2.0 | 45 | master | 1,345 | require 'spec_helper'
describe LockJar::Config do
describe '.load_config_file' do
let(:test_config_file) { File.join('spec', 'fixtures', 'lock_jar_config.yml') }
let(:temp_config_file) { File.join(TEMP_DIR, described_class::DEFAULT_FILENAME) }
let(:config) { described_class.load_config_file }
let(:ex... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | spec/lock_jar/resolver_spec.rb | Ruby | apache-2.0 | 45 | master | 1,791 | require 'spec_helper'
require 'lock_jar/resolver'
require 'fileutils'
require 'naether'
describe LockJar::Resolver do
subject { described_class.new(config, local_repo: "#{TEMP_DIR}/test-repo") }
before do
FileUtils.mkdir_p("#{TEMP_DIR}/test-repo")
end
let(:config) do
LockJar::Config.new(
'repos... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | spec/lock_jar/bundler_spec.rb | Ruby | apache-2.0 | 45 | master | 791 | require 'spec_helper'
require 'lock_jar/bundler'
require 'bundler/cli'
require 'bundler/cli/install'
describe LockJar::Bundler do
include Spec::Helpers
describe '.lock!' do
let(:bundler) do
Class.new { attr_accessor :setup }.new
end
before do
remove_file('Jarfile.lock')
end
conte... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | spec/lock_jar/domain/dsl_merger_spec.rb | Ruby | apache-2.0 | 45 | master | 1,364 | require 'spec_helper'
require 'lock_jar/domain/dsl_merger'
describe LockJar::Domain::DslMerger do
it 'should merge dsl' do
block1 = LockJar::Domain::Dsl.create do
repository 'http://repository.jboss.org/nexus/content/groups/public-jboss'
jar 'org.apache.mina:mina-core:2.0.4'
pom 'spec/pom.xml... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | spec/lock_jar/domain/dsl_spec.rb | Ruby | apache-2.0 | 45 | master | 2,265 | require 'spec_helper'
require 'lock_jar/domain/artifact'
describe LockJar::Domain::Dsl do
describe '.create' do
it 'should load a Jarfile' do
jarfile = LockJar::Domain::Dsl.create('spec/fixtures/Jarfile')
jarfile.local_repository.should eql '~/.m2/repository'
expect(jarfile.artifacts['default'... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | spec/lock_jar/domain/gem_dsl_spec.rb | Ruby | apache-2.0 | 45 | master | 439 | require 'spec_helper'
require 'lock_jar/domain/gem_dsl'
describe LockJar::Domain::GemDsl do
describe '.create' do
let(:spec) do
double(:spec, gem_dir: 'spec/fixtures', name: 'test')
end
it 'should create from a block' do
jarfile = LockJar::Domain::GemDsl.create(spec, File.join(spec.gem_dir, ... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | spec/support/helper.rb | Ruby | apache-2.0 | 45 | master | 1,199 | require 'open3'
require 'pathname'
module Spec
module Helpers
def remove_file(path)
FileUtils.rm(path) if File.exist? path
end
def lockjar(cmd, _options = {})
lockjar_bin = File.expand_path('../../../bin/lockjar', __FILE__)
cmd = "ruby -I#{lib} #{lockjar_bin} #{cmd}"
sys_exec(cm... |
github | mguymon/lock_jar | https://github.com/mguymon/lock_jar | spec/support/shared_examples/lockfile.rb | Ruby | apache-2.0 | 45 | master | 1,170 | require 'spec_helper'
shared_examples 'a lockfile' do
let(:lockfile_hash) { lockfile.to_h }
it 'should have a version' do
lockfile_hash['version'].should eql LockJar::VERSION
end
it 'should have a excludes' do
if respond_to? :expected_excludes
lockfile_hash['excludes'].should eql expected_exclu... |
github | marcoroth/huh-ruby | https://github.com/marcoroth/huh-ruby | Rakefile | Ruby | mit | 45 | main | 597 | # frozen_string_literal: true
require "bundler/gem_tasks"
require "minitest/test_task"
require "rubocop/rake_task"
Minitest::TestTask.create
RuboCop::RakeTask.new
task :rbs_inline do
require "open3"
command = "bundle exec rbs-inline --opt-out --output=sig/ lib/"
_stdout, stderr, status = Open3.capture3(comma... |
github | marcoroth/huh-ruby | https://github.com/marcoroth/huh-ruby | Gemfile | Ruby | mit | 45 | main | 398 | # frozen_string_literal: true
source "https://rubygems.org"
gemspec
# gem "bubbles", path: "../bubbles-ruby"
# gem "bubbletea", path: "../bubbletea-ruby"
# gem "glamour", path: "../glamour-ruby"
# gem "harmonica", path: "../harmonica-ruby"
# gem "lipgloss", path: "../lipgloss-ruby"
gem "irb"
gem "maxitest", "~> 7.0... |
github | marcoroth/huh-ruby | https://github.com/marcoroth/huh-ruby | huh.gemspec | Ruby | mit | 45 | main | 1,154 | # frozen_string_literal: true
require_relative "lib/huh/version"
Gem::Specification.new do |spec|
spec.name = "huh"
spec.version = Huh::VERSION
spec.authors = ["Marco Roth"]
spec.email = ["marco.roth@intergga.ch"]
spec.summary = "Build Beautiful Terminal forms and prompts in Ruby."
spec.description = "A ... |
github | marcoroth/huh-ruby | https://github.com/marcoroth/huh-ruby | test/note_test.rb | Ruby | mit | 45 | main | 2,295 | # frozen_string_literal: true
require_relative "test_helper"
module Huh
module Fields
class NoteTest < Minitest::Spec
describe "builder pattern" do
it "sets title" do
note = Note.new.title("Welcome!")
note.init
assert_includes note.view, "Welcome!"
end
... |
github | marcoroth/huh-ruby | https://github.com/marcoroth/huh-ruby | test/spinner_test.rb | Ruby | mit | 45 | main | 3,942 | # frozen_string_literal: true
require_relative "test_helper"
module Huh
module Fields
class SpinnerTest < Minitest::Spec
describe "builder pattern" do
it "sets title" do
spinner = Spinner.new.title("Loading...")
assert_includes spinner.view, "Loading..."
end
i... |
github | marcoroth/huh-ruby | https://github.com/marcoroth/huh-ruby | test/group_test.rb | Ruby | mit | 45 | main | 3,601 | # frozen_string_literal: true
require_relative "test_helper"
module Huh
class GroupTest < Minitest::Spec
describe "creation" do
it "creates with fields" do
group = Group.new(
Fields::Input.new.key("name"),
Fields::Input.new.key("email")
)
assert_equal 2, group.... |
github | marcoroth/huh-ruby | https://github.com/marcoroth/huh-ruby | test/test_helper.rb | Ruby | mit | 45 | main | 1,091 | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
require "bubbletea"
require "bubbles"
require "huh"
require "maxitest/autorun"
def strip_ansi(string)
string.gsub(/\e\[[0-9;]*[A-Za-z]/, "")
end
def key_down
Bubbletea::KeyMessage.new(key_type: Bubbletea::KeyMessage::KEY_DOWN)... |
github | marcoroth/huh-ruby | https://github.com/marcoroth/huh-ruby | test/option_test.rb | Ruby | mit | 45 | main | 1,646 | # frozen_string_literal: true
require_relative "test_helper"
module Huh
class OptionTest < Minitest::Spec
describe "creation" do
it "creates with key and value" do
opt = Option.new("Display", "value")
assert_equal "Display", opt.key
assert_equal "value", opt.value
end
... |
github | marcoroth/huh-ruby | https://github.com/marcoroth/huh-ruby | test/multi_select_test.rb | Ruby | mit | 45 | main | 4,442 | # frozen_string_literal: true
require_relative "test_helper"
module Huh
module Fields
class MultiSelectTest < Minitest::Spec
describe "builder pattern" do
it "sets key" do
ms = MultiSelect.new.key("toppings")
assert_equal "toppings", ms.get_key
end
it "sets ti... |
github | marcoroth/huh-ruby | https://github.com/marcoroth/huh-ruby | test/dsl_test.rb | Ruby | mit | 45 | main | 5,269 | # frozen_string_literal: true
require_relative "test_helper"
module Huh
class DSLTest < Minitest::Spec
describe "block-based form creation" do
it "creates a form with a group and input" do
form = Form.new do |f|
f.group do |g|
g.input do |i|
i.key("name")
... |
github | marcoroth/huh-ruby | https://github.com/marcoroth/huh-ruby | test/select_test.rb | Ruby | mit | 45 | main | 5,035 | # frozen_string_literal: true
require_relative "test_helper"
module Huh
module Fields
class SelectTest < Minitest::Spec
describe "builder pattern" do
it "sets key" do
select = Select.new.key("color")
assert_equal "color", select.get_key
end
it "sets title" do
... |
github | marcoroth/huh-ruby | https://github.com/marcoroth/huh-ruby | test/huh_test.rb | Ruby | mit | 45 | main | 1,659 | # frozen_string_literal: true
require_relative "test_helper"
module Huh
class HuhTest < Minitest::Spec
it "has a version number" do
refute_nil Huh::VERSION
end
describe "convenience constructors" do
it "creates Input field" do
assert_instance_of Huh::Fields::Input, Huh.input
e... |
github | marcoroth/huh-ruby | https://github.com/marcoroth/huh-ruby | test/form_test.rb | Ruby | mit | 45 | main | 6,122 | # frozen_string_literal: true
require_relative "test_helper"
module Huh
class FormTest < Minitest::Spec
describe "creation" do
it "creates with groups" do
form = Form.new(
Group.new(Fields::Input.new.key("name"))
)
assert_equal 1, form.groups.length
end
it "... |
github | marcoroth/huh-ruby | https://github.com/marcoroth/huh-ruby | test/text_test.rb | Ruby | mit | 45 | main | 2,483 | # frozen_string_literal: true
require_relative "test_helper"
module Huh
module Fields
class TextTest < Minitest::Spec
describe "builder pattern" do
it "sets key" do
text = Text.new.key("bio")
assert_equal "bio", text.get_key
end
it "sets title" do
te... |
github | marcoroth/huh-ruby | https://github.com/marcoroth/huh-ruby | test/input_test.rb | Ruby | mit | 45 | main | 3,365 | # frozen_string_literal: true
require_relative "test_helper"
module Huh
module Fields
class InputTest < Minitest::Spec
describe "builder pattern" do
it "sets key" do
input = Input.new.key("name")
assert_equal "name", input.get_key
end
it "sets title" do
... |
github | marcoroth/huh-ruby | https://github.com/marcoroth/huh-ruby | test/validation_test.rb | Ruby | mit | 45 | main | 5,001 | # frozen_string_literal: true
require_relative "test_helper"
module Huh
class ValidationTest < Minitest::Spec
describe "not_empty" do
it "raises for nil" do
validator = Validation.not_empty
assert_raises(ValidationError) { validator.call(nil) }
end
it "raises for empty string... |
github | marcoroth/huh-ruby | https://github.com/marcoroth/huh-ruby | test/confirm_test.rb | Ruby | mit | 45 | main | 2,894 | # frozen_string_literal: true
require_relative "test_helper"
module Huh
module Fields
class ConfirmTest < Minitest::Spec
describe "builder pattern" do
it "sets key" do
confirm = Confirm.new.key("agree")
assert_equal "agree", confirm.get_key
end
it "sets title"... |
github | marcoroth/huh-ruby | https://github.com/marcoroth/huh-ruby | lib/huh.rb | Ruby | mit | 45 | main | 3,956 | # frozen_string_literal: true
# rbs_inline: enabled
require "bubbletea"
require "bubbles"
require "glamour"
require "lipgloss"
require_relative "huh/version"
require_relative "huh/form_state"
require_relative "huh/echo_mode"
require_relative "huh/accessor"
require_relative "huh/eval"
require_relative "huh/option"
re... |
github | marcoroth/huh-ruby | https://github.com/marcoroth/huh-ruby | lib/huh/validation.rb | Ruby | mit | 45 | main | 4,932 | # frozen_string_literal: true
# rbs_inline: enabled
module Huh
# ValidationError is raised when field validation fails.
#
class ValidationError < StandardError
end
# Validation provides common validator functions for form fields.
# Validators are procs that raise ValidationError on failure.
#
# @exam... |
github | marcoroth/huh-ruby | https://github.com/marcoroth/huh-ruby | lib/huh/theme.rb | Ruby | mit | 45 | main | 5,981 | # frozen_string_literal: true
# rbs_inline: enabled
module Huh
class TextInputStyles
attr_accessor :cursor, :cursor_text, :placeholder, :prompt, :text
def initialize
@cursor = nil
@cursor_text = nil
@placeholder = nil
@prompt = nil
@text = nil
end
end
class SpinnerSty... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.