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
deployku/deployku
https://github.com/deployku/deployku
lib/deployku.rb
Ruby
mit
18
master
575
dir = File.expand_path(File.dirname(__FILE__)) $:.unshift(dir) unless $:.include?(dir) require 'deployku/config' require 'deployku/helpers' require 'deployku/configurable' require 'deployku/containerable' require 'deployku/plugins' require 'deployku/engine' # load core plugins require 'deployku/plugins/access' requir...
github
deployku/deployku
https://github.com/deployku/deployku
lib/deployku/containerable.rb
Ruby
mit
18
master
2,007
module Deployku::Containerable def start(app_name) Deployku::Config.load(config_path(app_name)) app_name = Deployku.sanitize_app_name(app_name) app_hash = Deployku::Engine.start(app_name, dir(app_name)) exit 1 if $?.nil? || $?.exitstatus != 0 set_container_id(app_name, app_hash) puts "Containe...
github
deployku/deployku
https://github.com/deployku/deployku
lib/deployku/configurable.rb
Ruby
mit
18
master
1,751
require 'fileutils' require 'yaml' module Deployku::Configurable attr_reader :config def config_show(app_name) app_config_path = config_path(app_name) puts File.read(app_config_path) if File.exists?(app_config_path) end def config_set(app_name, var, value) config_load(app_name) @config['env']...
github
deployku/deployku
https://github.com/deployku/deployku
lib/deployku/plugins.rb
Ruby
mit
18
master
3,052
module Deployku class Plugin @plugins = [] class NoMethod < NoMethodError end class << self attr_reader :plugins end def self.<<(plugin) @plugins << plugin end def self.find_plugin(name) plugin_name = "Deployku::#{name.capitalize}Plugin" @plugins.each do |p...
github
deployku/deployku
https://github.com/deployku/deployku
lib/deployku/config.rb
Ruby
mit
18
master
2,053
require 'yaml' module Deployku class Config # TODO: read variables from config file @config = nil HOME = File::expand_path('~deployku') FROM = 'pejuko/rvm-base' PACKAGES = ['git'] DEFAULT_ENGINE = 'docker' DEFAULT_PORT = 80 class << self def home HOME end ...
github
deployku/deployku
https://github.com/deployku/deployku
lib/deployku/engine.rb
Ruby
mit
18
master
1,107
module Deployku::Engine class MissingException < Exception end def self.find_engine(name) plugin_name = "Deployku::#{name.capitalize}Engine" Deployku::Plugin.plugins.each do |plugin| return plugin if plugin.name == plugin_name end nil end def self.engines engs = [] Deployku::Pl...
github
deployku/deployku
https://github.com/deployku/deployku
lib/deployku/helpers.rb
Ruby
mit
18
master
263
module Deployku class << self def sanitize_app_name(app_name) app_name.gsub(%r{^\.+}, '').gsub(%r{\.+$}, '').gsub(%r{\.\./}, '').gsub(%r{^/+}, '').gsub(%r{/+$}, '').gsub(%r{/+}, '-').gsub(%r{\s+}, '_').gsub(%r{[^a-zA-Z0-9_\-\.]}, '') end end end
github
deployku/deployku
https://github.com/deployku/deployku
lib/deployku/plugins/access.rb
Ruby
mit
18
master
5,192
require 'yaml' module Deployku class AccessPlugin < Deployku::Plugin describe :add, '<USER>', 'adds ssh key for user from STDIN' def add(user_name) allow = check_system_rights(:admin) if !allow && get_users.count > 0 # allow add first user without privileges puts "No rights." ...
github
deployku/deployku
https://github.com/deployku/deployku
lib/deployku/plugins/app.rb
Ruby
mit
18
master
7,360
module Deployku class AppPlugin < Deployku::Plugin include Deployku::Configurable include Deployku::Containerable def initialize @config = { 'env' => {}, 'links' => [] } end describe :create, '<APP>', 'creates new application', acl_sys: :admin def create(app_name)...
github
deployku/deployku
https://github.com/deployku/deployku
lib/deployku/plugins/git.rb
Ruby
mit
18
master
1,583
require 'tmpdir' module Deployku class GitPlugin < Deployku::Plugin # describe :receive_pack, '<APP>', 'receives new commit' def receive_pack app_name unless app_name exit 1 end app_name = app_name.gsub(%r{'([^']+)'}, '\1') app_dir = Deployku::AppPlugin.instance.create(app_nam...
github
deployku/deployku
https://github.com/deployku/deployku
lib/deployku/plugins/redis.rb
Ruby
mit
18
master
3,346
require 'fileutils' require 'securerandom' module Deployku class RedisPlugin < Deployku::Plugin include Deployku::Configurable include Deployku::Containerable def initialize @config = { 'from' => 'redis', 'env' => {} } end describe :create, '<NAME>', 'creates new Red...
github
deployku/deployku
https://github.com/deployku/deployku
lib/deployku/plugins/rails.rb
Ruby
mit
18
master
2,643
require 'fileutils' module Deployku class RailsPlugin < Deployku::Plugin PACKAGES = ['nodejs'] def volumes ['/public/'] end def port 3000 end def build_start_script(path) app_path = File.join(path, 'app') start_path = File.join(path, 'start') custom_start_path...
github
deployku/deployku
https://github.com/deployku/deployku
lib/deployku/plugins/nginx.rb
Ruby
mit
18
master
4,617
require 'securerandom' require 'net/http' module Deployku class NginxPlugin < Deployku::Plugin describe :enable, '<APP>', 'enable nginx for application', acl_app: { 0 => :admin } def enable(app_name) app_plug = Deployku::AppPlugin.new app_plug.config_load(app_name) app_plug.config['nginx'] ...
github
deployku/deployku
https://github.com/deployku/deployku
lib/deployku/plugins/docker.rb
Ruby
mit
18
master
2,118
require 'json' module Deployku class DockerEngine < Deployku::Plugin include Deployku::Engine def start(app_name, app_dir=nil, name=nil) args = build_args(app_name, app_dir, name) hash = `docker run -d -P #{args.join(' ')} #{app_name}:latest`.chomp if $?.exitstatus != 0 && name has...
github
deployku/deployku
https://github.com/deployku/deployku
lib/deployku/plugins/postgres.rb
Ruby
mit
18
master
7,942
require 'fileutils' require 'securerandom' module Deployku class PostgresPlugin < Deployku::Plugin include Deployku::Configurable include Deployku::Containerable def initialize @config = { 'from' => 'postgres', 'env' => {} } end describe :create, '<NAME>', 'creates n...
github
tomstuart/tradfri
https://github.com/tomstuart/tradfri
tradfri.gemspec
Ruby
mit
18
master
684
lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'tradfri/version' Gem::Specification.new do |spec| spec.name = 'tradfri' spec.version = Tradfri::VERSION spec.author = 'Tom Stuart' spec.email = 'tom@codon.com' spec.summar...
github
tomstuart/tradfri
https://github.com/tomstuart/tradfri
lib/tradfri/client.rb
Ruby
mit
18
master
890
require 'open3' require 'tempfile' require 'tradfri/gateway' require 'tradfri/service' module Tradfri class Client < Struct.new(:coap_client_path) METHOD_GET = 'get' METHOD_PUT = 'put' def discover_gateways(keys) Service.discover.map do |service| connect_to service.host, service.port, keys...
github
tomstuart/tradfri
https://github.com/tomstuart/tradfri
lib/tradfri/service.rb
Ruby
mit
18
master
1,261
require 'dnssd' module Tradfri class Service < Struct.new(:name, :host, :port) SERVICE_TYPE = '_coap' TRANSPORT_PROTOCOL = '_udp' INTERNET_PROTOCOL = DNSSD::Service::IPv4 REGISTRATION_TYPE = [SERVICE_TYPE, TRANSPORT_PROTOCOL].join('.') def mac_address name.slice %r{(?:\h{2}-){5}\h{2}} || ...
github
tomstuart/tradfri
https://github.com/tomstuart/tradfri
lib/tradfri/gateway.rb
Ruby
mit
18
master
771
require 'tradfri/device' require 'uri' module Tradfri class Gateway < Struct.new(:client, :host, :port, :key) SCHEME = 'coaps' DISCOVERY_PATH = '/.well-known/core' def devices client.get(key, discovery_uri).split(','). map { |link| %r{\A</(?<uri>[^>]+)>}.match(link) }. compact. ...
github
tomstuart/tradfri
https://github.com/tomstuart/tradfri
lib/tradfri/device.rb
Ruby
mit
18
master
1,303
require 'json' module Tradfri class Device < Struct.new(:gateway, :uri) # https://github.com/IPSO-Alliance/pub/blob/master/reg/xml/3311.xml LIGHT_CONTROL = 3311 ON_OFF = 5850 OFF = 0 ON = 1 DIMMER = 5851 DIMMER_MIN = 0 DIMMER_MAX = 255 COLOUR = 5706 COLOUR_COLD = 'f5faf6' ...
github
cardinalblue/ardis
https://github.com/cardinalblue/ardis
ardis.gemspec
Ruby
mit
18
master
1,765
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'ardis/version' Gem::Specification.new do |spec| spec.name = "ardis" spec.version = Ardis::VERSION spec.authors = ["Jaime Cham"] spec.email = ["jaime.cham@card...
github
cardinalblue/ardis
https://github.com/cardinalblue/ardis
lib/ardis.rb
Ruby
mit
18
master
396
require_relative 'ardis/version' require_relative 'ardis/attr_strategy' require_relative 'ardis/container_proxy' require_relative 'ardis/base_series' require_relative 'ardis/redis_adapter' require_relative 'ardis/dsl' module Ardis include DSL def self.included(klass) klass.extend ListDSL klass.extend So...
github
cardinalblue/ardis
https://github.com/cardinalblue/ardis
lib/ardis/attr_strategy.rb
Ruby
mit
18
master
860
module Ardis module AttrStrategy class BaseAttrStrategy # Public interface public def calculate_attr(target) raise NotImplementedError end def report_attr(target, score) raise NotImplementedError end end class NamedAttrStrategy < BaseAttrStrategy attr_accessor :attr_name def initialize(attr...
github
cardinalblue/ardis
https://github.com/cardinalblue/ardis
lib/ardis/base_series.rb
Ruby
mit
18
master
14,484
# Include this way, otherwise will get a warning about the absence of a Framework, # see https://github.com/amatsuda/kaminari/issues/518. # require 'kaminari/config' require 'kaminari/helpers/action_view_extension' require 'kaminari/helpers/paginator' require 'kaminari/models/page_scope_methods' require 'kaminari/model...
github
cardinalblue/ardis
https://github.com/cardinalblue/ardis
lib/ardis/dsl.rb
Ruby
mit
18
master
2,613
module Ardis module DSL # Usage: # # series_list :friend_feed, global: true, relation: Collage, key: lambda{|class| } # series_list :friend_feed, relation: Collage, key: lambda{|user| } # series_sorted_set :liked_collages, relation: Collage, key: lambda{|user| }, attr_score: :created_at # ...
github
cardinalblue/ardis
https://github.com/cardinalblue/ardis
lib/ardis/autocompacter.rb
Ruby
mit
18
master
913
module Ardis module Autocompacter # Implements an autocompacting algorithm. # The required block must receive an offset and limit, and return `nil` once # there are no more items that can be read. Otherwise, should return an array # of compacted items. # Negative offsets are allowed. # # Usage: # a =...
github
cardinalblue/ardis
https://github.com/cardinalblue/ardis
lib/ardis/container_proxy.rb
Ruby
mit
18
master
221
module Ardis class ContainerProxy attr_accessor :klass, :id def initialize klass, id self.klass = klass self.id = id end def proxy_for? klass klass.ancestors.include?(self.klass) end end end
github
cardinalblue/ardis
https://github.com/cardinalblue/ardis
lib/ardis/redis_adapter.rb
Ruby
mit
18
master
18,913
require 'active_support' require 'redis' require 'redis-objects' require 'draper' # ----------------------------------------------------- # Patches redis-object class Redis::Set # Patch Redis::Set to support (in a half-assed manner) the same methods # as a List. # def push(*values) add(values) end de...
github
cardinalblue/ardis
https://github.com/cardinalblue/ardis
test/test_varying.rb
Ruby
mit
18
master
1,563
require 'active_support' module TestVarying extend ActiveSupport::Concern def test_varying_logger if defined?(logger) logger elsif defined?(Rails) Rails.logger else Logger.new($stdout) end end module ClassMethods # The following will generate 4 tests # # test_...
github
cardinalblue/ardis
https://github.com/cardinalblue/ardis
test/series_base_test.rb
Ruby
mit
18
master
2,620
require_relative 'test_helper' require_relative 'series_test_fixture' class SeriesBaseTest < ActiveSupport::TestCase include Ardis include Ardis::RedisAdapter include Ardis::SeriesTestFixture # --------------------------------------------------------------------------- def t_list_g @t_list_g ||...
github
cardinalblue/ardis
https://github.com/cardinalblue/ardis
test/test_helper.rb
Ruby
mit
18
master
2,396
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) require 'active_support' require 'ardis' # --------------------------------------------------------------- require 'minitest/autorun' require 'rr' # --------------------------------------------------------------- ActiveSupport.test_order = :random # -------...
github
cardinalblue/ardis
https://github.com/cardinalblue/ardis
test/ardis_test.rb
Ruby
mit
18
master
206
require_relative 'test_helper' class ArdisTest < Minitest::Test def test_that_it_has_a_version_number refute_nil ::Ardis::VERSION end def test_it_does_something_useful assert true end end
github
cardinalblue/ardis
https://github.com/cardinalblue/ardis
test/autocompacter_test.rb
Ruby
mit
18
master
2,148
require_relative 'test_helper' require 'ardis/autocompacter' module Ardis class AutocompacterTest < ActiveSupport::TestCase test 'simple' do a = [ nil, 1, nil, 2, 3, nil, 4, nil, 5 ] actual = Autocompacter.autocompact 3, 5 do |offset, limit| cur = a[offset, limit] cur.present? && cu...
github
cardinalblue/ardis
https://github.com/cardinalblue/ardis
test/series_test.rb
Ruby
mit
18
master
39,775
require_relative 'test_helper' require_relative 'series_base_test' class SeriesTest < SeriesBaseTest # ------------------------------------------------------------------------- # all test_varying 'list-like runthrough', klass: [ ListSeries, ArraySeries ] do |var| series = var.klass.new name: :feed_entries...
github
cardinalblue/ardis
https://github.com/cardinalblue/ardis
test/series_test_fixture.rb
Ruby
mit
18
master
4,180
require 'active_record' module Ardis module SeriesTestFixture class FeedEntry < ActiveRecord::Base include Ardis attr_accessor :my_accessor self.table_name = 'test_feed_entries' after_initialize do self.key ||= rand(1_000_000_000_000) self.created_at ||= rand(100).days.ago end belongs_to :use...
github
devsecops/radar
https://github.com/devsecops/radar
source/cicd_yaml_auditor.rb
Ruby
apache-2.0
18
master
2,163
require 'yaml' require 'optparse' def check_options (opts) options_okay = true if opts[:bucket_name].nil? puts "S3 Bucket Name is required!" options_okay = false elsif opts[:object_key].nil? puts "Object Key is required!" options_okay = false elsif opts[:file_name].nil? puts "Deploy YAML F...
github
devsecops/radar
https://github.com/devsecops/radar
source/securitychecker.rb
Ruby
apache-2.0
18
master
2,056
#!/usr/bin/env ruby # securitychecker # Description: Validate security of CloudFormation templates require 'optparse' require 'ostruct' require 'json' require 'hashdiff' version = '0.3 (Ruby)' USAGE = %(Usage: securitychecker --template <CF-Template> --baseline <CF-Template> Options: -v, --version ...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
metadata.rb
Ruby
apache-2.0
18
master
9,824
# encoding: UTF-8 name 'system' version '0.12.0' maintainer 'Xhost Australia' maintainer_email 'cookbooks@xhost.com.au' license 'Apache-2.0' description 'Installs/Configures system elements such as the hostname and timezone.' long_description IO.read(File.join(File.dirname(__FI...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
Guardfile
Ruby
apache-2.0
18
master
688
# More info at https://github.com/guard/guard#readme # waiting for guard-foodcritic updates # https://github.com/cgriego/guard-foodcritic/issues/7 group :style do guard 'foodcritic', cookbook_paths: '.', all_on_start: false do watch(%r{attributes\/.+\.rb$}) watch(%r{providers\/.+\.rb$}) watch(%r{recipes\...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
Rakefile
Ruby
apache-2.0
18
master
2,002
# encoding: UTF-8 namespace :prepare do desc 'Install ChefDK' task :chefdk do begin gem 'chef-dk', '0.2.1' rescue Gem::LoadError puts 'ChefDK not found. Installing it for you...' sh %(wget -O /tmp/meez_chefdk.deb https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chefd...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
Gemfile
Ruby
apache-2.0
18
master
1,234
# encoding: UTF-8 # -*- mode: ruby -*- # vi: set ft=ruby : # let's be bleeding and not specify andy versions until v1.0.0 source 'https://rubygems.org' chef_version = ENV.key?('CHEF_VERSION') ? ENV['CHEF_VERSION'] : nil gem 'activesupport' gem 'buff-extensions' group :development do gem 'berkshelf' gem 'chef'...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
Thorfile
Ruby
apache-2.0
18
master
241
# encoding: UTF-8 require 'bundler' require 'bundler/setup' require 'berkshelf/thor' begin require 'kitchen/thor_tasks' Kitchen::ThorTasks.new rescue LoadError puts '>>>>> Kitchen gem not loaded, omitting tasks' unless ENV['CI'] end
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
Vagrantfile
Ruby
apache-2.0
18
master
739
# -*- mode: ruby -*- # vi: set ft=ruby : Vagrant.configure('2') do |config| config.vm.hostname = 'system' config.vm.box = 'ubuntu-14.04' config.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_#{config.vm.box}_chef-provisionerless.box" config.omnibus.chef_version = 'latest' c...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
resources/hostname.rb
Ruby
apache-2.0
18
master
1,238
# encoding: UTF-8 # Cookbook Name:: system # Resource:: hostname # # Copyright 2012-2016, Chris Fordham # # 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...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
resources/profile.rb
Ruby
apache-2.0
18
master
1,164
# encoding: UTF-8 # Cookbook Name:: system # Resource:: profile # # Copyright 2012-2016, Chris Fordham # # 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/...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
resources/timezone.rb
Ruby
apache-2.0
18
master
1,190
# encoding: UTF-8 # Cookbook Name:: system # Resource:: timezone # # Copyright 2012-2016, Chris Fordham # # 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...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
resources/environment.rb
Ruby
apache-2.0
18
master
880
# encoding: UTF-8 # Cookbook Name:: system # Resource:: environment # # Copyright 2012-2016, Chris Fordham # # 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/licen...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
resources/packages.rb
Ruby
apache-2.0
18
master
862
# encoding: UTF-8 # Cookbook Name:: system # Resource:: packages # # Copyright 2012-2016, Chris Fordham # # 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...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
attributes/default.rb
Ruby
apache-2.0
18
master
2,736
# encoding: UTF-8 # Cookbook Name:: system # Attributes:: system # # Copyright 2012-2014, Chris Fordham # # 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...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
attributes/profile.rb
Ruby
apache-2.0
18
master
2,832
# encoding: UTF-8 # Cookbook Name:: system # Attributes:: system/profile # # Copyright 2012-2014, Chris Fordham # # 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/...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
providers/timezone.rb
Ruby
apache-2.0
18
master
3,558
# encoding: UTF-8 # Cookbook Name:: system # Provider:: timezone # # Copyright 2012-2016, Chris Fordham # # 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...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
providers/hostname.rb
Ruby
apache-2.0
18
master
14,758
# encoding: UTF-8 # Cookbook Name:: system # Provider:: hostname # # Copyright 2012-2016, Chris Fordham # # 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...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
providers/profile.rb
Ruby
apache-2.0
18
master
1,184
# encoding: UTF-8 # Cookbook Name:: system # Provider:: profile # # Copyright 2012-2016, Chris Fordham # # 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/...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
providers/packages.rb
Ruby
apache-2.0
18
master
2,375
# encoding: UTF-8 # Cookbook Name:: system # Provider:: packages # # Copyright 2012-2016, Chris Fordham # # 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...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
providers/environment.rb
Ruby
apache-2.0
18
master
797
# encoding: UTF-8 # Cookbook Name:: system # Provider:: environment # # Copyright 2012-2016, Chris Fordham # # 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/licen...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
recipes/default.rb
Ruby
apache-2.0
18
master
762
# encoding: UTF-8 # Cookbook Name:: system # Recipe:: default # # Copyright 2012-2016, Chris Fordham # # 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/LI...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
recipes/reboot.rb
Ruby
apache-2.0
18
master
728
# encoding: UTF-8 # Cookbook Name:: system # Recipe:: reboot # # Copyright 2012-2016, Chris Fordham # # 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/LIC...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
recipes/install_packages.rb
Ruby
apache-2.0
18
master
942
# encoding: UTF-8 # Cookbook Name:: system # Recipe:: install_packages # # Copyright 2012-2016, Chris Fordham # # 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/li...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
recipes/shutdown.rb
Ruby
apache-2.0
18
master
741
# encoding: UTF-8 # Cookbook Name:: system # Recipe:: shutdown # # Copyright 2015-2016, Chris Fordham # # 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/L...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
recipes/upgrade_packages.rb
Ruby
apache-2.0
18
master
1,584
# encoding: UTF-8 # Cookbook Name:: system # Recipe:: upgrade_packages # # Copyright 2012-2016, Chris Fordham # # 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/li...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
recipes/uninstall_packages.rb
Ruby
apache-2.0
18
master
992
# encoding: UTF-8 # Cookbook Name:: system # Recipe:: uninstall_packages # # Copyright 2012-2016, Chris Fordham # # 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/...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
recipes/profile.rb
Ruby
apache-2.0
18
master
763
# encoding: UTF-8 # Cookbook Name:: system # Recipe:: profile # # Copyright 2015-2016, Chris Fordham # # 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/LI...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
recipes/environment.rb
Ruby
apache-2.0
18
master
745
# encoding: UTF-8 # Cookbook Name:: system # Recipe:: environment # # Copyright 2015-2016, Chris Fordham # # 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/license...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
recipes/hostname.rb
Ruby
apache-2.0
18
master
1,265
# encoding: UTF-8 # Cookbook Name:: system # Recipe:: hostname # # Copyright 2012-2016, Chris Fordham # # 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/L...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
recipes/update_package_list.rb
Ruby
apache-2.0
18
master
984
# encoding: UTF-8 # Cookbook Name:: system # Recipe:: update_package_list # # Copyright 2012-2016, Chris Fordham # # 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...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
recipes/test_fqdn_set.rb
Ruby
apache-2.0
18
master
851
# encoding: UTF-8 # Cookbook Name:: system # Recipe:: test_fqdn_template # # Copyright 2012-2016, Chris Fordham # # 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/...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
recipes/timezone.rb
Ruby
apache-2.0
18
master
693
# encoding: UTF-8 # Cookbook Name:: system # Recipe:: timezone # # Copyright 2012-2016, Chris Fordham # # 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/L...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
libraries/host_info.rb
Ruby
apache-2.0
18
master
1,516
# encoding: UTF-8 # Cookbook Name:: system # Library:: host_info # # Copyright 2012-2014, Chris Fordham # # 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...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
libraries/matchers.rb
Ruby
apache-2.0
18
master
1,124
# rubocop:disable Style/AccessorMethodName if defined?(ChefSpec) ChefSpec.define_matcher :system_timezone def set_system_timezone(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:system_timezone, :set, resource_name) end ChefSpec.define_matcher :system_environment def configure_system_environmen...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
libraries/url_package.rb
Ruby
apache-2.0
18
master
1,277
# encoding: UTF-8 # Cookbook Name:: system # Library:: url_package # # Copyright 2012-2014, Chris Fordham # # 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/licens...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
test/integration/default/serverspec/default_spec.rb
Ruby
apache-2.0
18
master
4,190
# encoding: UTF-8 require_relative 'spec_helper' # http://linux.die.net/man/1/hostname # hostname -s command should return the short hostname describe command('hostname -s') do its(:stdout) do should contain('test') end end # nsswitch on redhat-based expects the FQDN to be physically resolvable by DNS unles...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
test/unit/spec/spec_helper.rb
Ruby
apache-2.0
18
master
400
# encoding: UTF-8 require 'codeclimate-test-reporter' CodeClimate::TestReporter.start require 'chefspec' require 'chefspec/berkshelf' require 'chef/application' ::LOG_LEVEL = :fatal ::UBUNTU_OPTS = { platform: 'ubuntu', version: '12.04', log_level: ::LOG_LEVEL, }.freeze ::CHEFSPEC_OPTS = { log_level: ::LOG_L...
github
xhost-cookbooks/system
https://github.com/xhost-cookbooks/system
test/unit/spec/default_spec.rb
Ruby
apache-2.0
18
master
585
# encoding: UTF-8 require_relative 'spec_helper' describe 'system::default' do let(:chef_run) do ChefSpec::SoloRunner.new do |_node| stub_command('ls /.dockerinit').and_return(false) end.converge(described_recipe) end it 'includes the `update_package_list` recipe' do expect(chef_run).to inclu...
github
glaszig/compass-fontcustom
https://github.com/glaszig/compass-fontcustom
Gemfile
Ruby
mit
18
master
231
source 'https://rubygems.org' # Specify your gem's dependencies in compass-fontcustom.gemspec gemspec gem 'coveralls', :require => false group :development do gem 'autotest-standalone' gem 'autotest-fsevent' gem 'travis' end
github
glaszig/compass-fontcustom
https://github.com/glaszig/compass-fontcustom
Rakefile
Ruby
mit
18
master
224
require "bundler/gem_tasks" require 'rake/testtask' Rake::TestTask.new do |t| t.libs << 'test' t.test_files = FileList['test/**/*_test.rb'] t.verbose = true t.warning = false end desc "Run tests" task :default => :test
github
glaszig/compass-fontcustom
https://github.com/glaszig/compass-fontcustom
compass-fontcustom.gemspec
Ruby
mit
18
master
1,103
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'compass/fontcustom/version' Gem::Specification.new do |spec| spec.name = "compass-fontcustom" spec.version = Compass::Fontcustom::VERSION spec.authors = ["glaszig"] s...
github
glaszig/compass-fontcustom
https://github.com/glaszig/compass-fontcustom
demo/config.rb
Ruby
mit
18
master
911
# Require any additional compass plugins here. $LOAD_PATH << '../lib' require 'compass/fontcustom' # Set this to the root of your project when deployed: http_path = "/" css_dir = "stylesheets" sass_dir = "sass" images_dir = "images" javascripts_dir = "javascripts" # You can select your preferred output style here (ca...
github
glaszig/compass-fontcustom
https://github.com/glaszig/compass-fontcustom
lib/compass/fontcustom.rb
Ruby
mit
18
master
1,446
require "compass" require "compass/fontcustom/version" require "compass/fontcustom/util" require "compass/fontcustom/compass" require "compass/fontcustom/sass_extensions" require "compass/fontcustom/glyph_map" require "compass/fontcustom/font_importer" require "compass/fontcustom/patches" require "compass/fontcustom/de...
github
glaszig/compass-fontcustom
https://github.com/glaszig/compass-fontcustom
lib/compass/fontcustom/configurable.rb
Ruby
mit
18
master
683
module Compass module Fontcustom # A simple configuration store like the one known from ActiveSupport. module Configurable def self.included(base) base.extend ClassMethods end module ClassMethods def configure(&block) yield config end def config ...
github
glaszig/compass-fontcustom
https://github.com/glaszig/compass-fontcustom
lib/compass/fontcustom/glyph_map.rb
Ruby
mit
18
master
2,152
require 'fontcustom' require 'compass/fontcustom/configurable' require 'thor' module Compass module Fontcustom class GlyphMap < Sass::Script::Literal include Configurable attr_reader :name, :path # @param context [Object] usually an instance of FontImporter def self.from_uri(uri, contex...
github
glaszig/compass-fontcustom
https://github.com/glaszig/compass-fontcustom
lib/compass/fontcustom/compass.rb
Ruby
mit
18
master
225
require 'compass/configuration' # https://github.com/Compass/compass/issues/802 module Compass module Configuration def self.strip_trailing_separator(*args) Data.strip_trailing_separator(*args) end end end
github
glaszig/compass-fontcustom
https://github.com/glaszig/compass-fontcustom
lib/compass/fontcustom/font_importer.rb
Ruby
mit
18
master
5,853
require 'erb' require 'tempfile' require 'fontcustom/error' require 'fontcustom/options' require 'fontcustom/utility' require 'fontcustom/generator/font' module Compass module Fontcustom # Just an `OpenStruct` to contain template variables. # @see FontImporter#content_for_font class TemplateData < OpenS...
github
glaszig/compass-fontcustom
https://github.com/glaszig/compass-fontcustom
lib/compass/fontcustom/util.rb
Ruby
mit
18
master
272
module Compass module Fontcustom module Util class << self def sanitize_symbol name name.to_s.gsub(/^"|"$/, '') \ .gsub(/[.+{};]+/, ' ') \ .gsub(/[ ]+/, '-') end end end end end
github
glaszig/compass-fontcustom
https://github.com/glaszig/compass-fontcustom
lib/compass/fontcustom/deprecations.rb
Ruby
mit
18
master
384
module Compass module Fontcustom module Deprecations def fontcustom_fonts_path= value warn "WARNING: fontcustom_fonts_path is deprecated. Prefer to use Compass' fonts_path." super end [ Compass::Configuration::FileData, Compass::Configuration::Data ].each do |m| ...
github
glaszig/compass-fontcustom
https://github.com/glaszig/compass-fontcustom
lib/compass/fontcustom/sass_extensions.rb
Ruby
mit
18
master
3,362
module Compass module Fontcustom # Declares extensions for the Sass interpreter module SassExtensions # Sass function extensions module Functions # Font type format mappings used in css font-face declarations. # @see #glyph_font_sources FONT_TYPE_OPTIONS = { eot...
github
glaszig/compass-fontcustom
https://github.com/glaszig/compass-fontcustom
test/unit/glyph_map_test.rb
Ruby
mit
18
master
432
require 'test_helper' class GlyphMapTest < Test::Unit::TestCase def setup font_path = File.expand_path('../../fixtures/myfont', __FILE__) + '/*.svg' @glyph_map = Compass::Fontcustom::GlyphMap.from_uri font_path, nil end def test_glyph_map map = @glyph_map.instance_variable_get(:@glyphs) assert ...
github
glaszig/compass-fontcustom
https://github.com/glaszig/compass-fontcustom
test/unit/font_importer_test.rb
Ruby
mit
18
master
3,162
require 'test_helper' require 'stringio' require 'fileutils' class FontImporterTest < Test::Unit::TestCase def setup Compass.reset_configuration! @project_path = File.expand_path('../../', __FILE__) @output_path = File.join(@project_path, '.output') @fonts_path = File.join(@output_path, 'fonts') ...
github
agperson/zabbix-hipchat-alerts
https://github.com/agperson/zabbix-hipchat-alerts
hipchat.rb
Ruby
bsd-3-clause
18
master
953
#!/usr/bin/env ruby require 'rubygems' require 'yaml' alert_script = File.dirname(__FILE__) + "/notify.rb" # Load configuration config = YAML.load_file(File.join(File.dirname(__FILE__), 'config.yaml')) url = config['zabbix_url'] YAML.load(ARGV[2]).each { |k, v| instance_variable_set("@" + k, v) } if @status == "PR...
github
agperson/zabbix-hipchat-alerts
https://github.com/agperson/zabbix-hipchat-alerts
notify.rb
Ruby
bsd-3-clause
18
master
1,419
#!/usr/bin/env ruby require 'rubygems' require 'micro-optparse' require 'net/https' require 'uri' require 'json' require 'yaml' # Load configuration config = YAML.load_file(File.join(File.dirname(__FILE__), 'config.yaml')) endpoint = config['endpoint'] || 'api.hipchat.com' room = config['room'] token = config...
github
xwmx/rbst
https://github.com/xwmx/rbst
Gemfile
Ruby
mit
18
master
1,389
# frozen_string_literal: true source 'http://rubygems.org' # Add dependencies required to use your gem here. # Example: # gem "activesupport", ">= 2.3.5" # Add dependencies to develop your gem here. # Include everything needed to run rake, tests, features, etc. group :development, :test do # minitest # # mini...
github
xwmx/rbst
https://github.com/xwmx/rbst
RbST.gemspec
Ruby
mit
18
master
1,287
# frozen_string_literal: true Gem::Specification.new do |s| s.name = 'RbST' s.version = '0.6.5' s.licenses = ['MIT'] s.summary = "A Ruby gem for processing reStructuredText via Python's Docutils." s.description = "A Ruby gem for processing reStructuredText via Python's Docutils." s.authors = ['William Melo...
github
xwmx/rbst
https://github.com/xwmx/rbst
Rakefile
Ruby
mit
18
master
689
# frozen_string_literal: true require 'rubygems' require 'bundler' begin Bundler.setup(:default, :development) rescue Bundler::BundlerError => e warn e.message warn 'Run `bundle install` to install missing gems' exit e.status_code end require 'rake' require 'rake/testtask' Rake::TestTask.new(:test) do |test| ...
github
xwmx/rbst
https://github.com/xwmx/rbst
test/test_rbst.rb
Ruby
mit
18
master
5,533
# frozen_string_literal: true require 'helper' describe RbST do def setup [:rst, :html, :latex].each do |f| instance_variable_set( :"@#{f}_file_path", File.join(File.dirname(__FILE__), 'files', "test.#{f}") ) end @rst2parts_path = File.expand_path( File.join(File.dirnam...
github
xwmx/rbst
https://github.com/xwmx/rbst
test/helper.rb
Ruby
mit
18
master
447
# frozen_string_literal: true require 'rubygems' require 'bundler' begin Bundler.setup(:default, :development) rescue Bundler::BundlerError => e warn e.message warn 'Run `bundle install` to install missing gems' exit e.status_code end require 'minitest/autorun' require 'minitest/pride' require 'mocha/minitest'...
github
xwmx/rbst
https://github.com/xwmx/rbst
lib/rbst.rb
Ruby
mit
18
master
4,069
# frozen_string_literal: true class RbST @@python_path = 'python' @@executable_path = File.expand_path( File.join(File.dirname(__FILE__), 'rst2parts') ) @@executables = { html: File.join(@@executable_path, 'rst2html.py'), latex: File.join(@@executable_path, 'rst2latex.py') } # Takes a string ...
github
JunichiIto/osrb03-hotwire-sandbox
https://github.com/JunichiIto/osrb03-hotwire-sandbox
Gemfile
Ruby
mit
18
main
2,388
source "https://rubygems.org" git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby "3.2.2" # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" gem "rails", "~> 7.0.7" # The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] gem "sprockets-rails" ...
github
JunichiIto/osrb03-hotwire-sandbox
https://github.com/JunichiIto/osrb03-hotwire-sandbox
app/controllers/blogs_controller.rb
Ruby
mit
18
main
1,325
class BlogsController < ApplicationController before_action :set_blog, only: %i[ edit update destroy ] # GET /blogs def index @blogs = Blog.order(id: :desc) end # GET /blogs/new def new @blog = Blog.new end # GET /blogs/1/edit def edit end # POST /blogs def create @blog = Blog.ne...
github
JunichiIto/osrb03-hotwire-sandbox
https://github.com/JunichiIto/osrb03-hotwire-sandbox
app/helpers/application_helper.rb
Ruby
mit
18
main
208
module ApplicationHelper def icon_with_text(icon_name, text) tag.span(icon(icon_name), class: "me-2") + tag.span(text) end def icon(icon_name) tag.i(class: ["bi", "bi-#{icon_name}"]) end end
github
JunichiIto/osrb03-hotwire-sandbox
https://github.com/JunichiIto/osrb03-hotwire-sandbox
db/schema.rb
Ruby
mit
18
main
2,664
# 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. # # This file is the source Rails uses to define your schema when running `bin/rai...
github
JunichiIto/osrb03-hotwire-sandbox
https://github.com/JunichiIto/osrb03-hotwire-sandbox
db/migrate/20230819080221_create_action_text_tables.action_text.rb
Ruby
mit
18
main
980
# This migration comes from action_text (originally 20180528164100) class CreateActionTextTables < ActiveRecord::Migration[6.0] def change # Use Active Record's configured type for primary and foreign keys primary_key_type, foreign_key_type = primary_and_foreign_key_types create_table :action_text_rich_t...