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
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/provider/splunk_deploymentclient/ini_setting.rb
Ruby
apache-2.0
45
master
225
# frozen_string_literal: true Puppet::Type.type(:splunk_deploymentclient).provide( :ini_setting, parent: Puppet::Type.type(:ini_setting).provider(:splunk), ) do def self.file_name 'deploymentclient.conf' end end
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/provider/splunk_distsearch/ini_setting.rb
Ruby
apache-2.0
45
master
213
# frozen_string_literal: true Puppet::Type.type(:splunk_distsearch).provide( :ini_setting, parent: Puppet::Type.type(:ini_setting).provider(:splunk), ) do def self.file_name 'distsearch.conf' end end
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/provider/ini_setting/splunk.rb
Ruby
apache-2.0
45
master
702
# frozen_string_literal: true Puppet::Type.type(:ini_setting).provide( :splunk, parent: Puppet::Type.type(:ini_setting).provider(:ruby), ) do confine true: false # Never automatically select this provider @file_path = nil class << self attr_writer :file_path end def self.file_path raise Puppet...
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/provider/splunk_input/ini_setting.rb
Ruby
apache-2.0
45
master
204
# frozen_string_literal: true Puppet::Type.type(:splunk_input).provide( :ini_setting, parent: Puppet::Type.type(:ini_setting).provider(:splunk), ) do def self.file_name 'inputs.conf' end end
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/provider/splunk_output/ini_setting.rb
Ruby
apache-2.0
45
master
206
# frozen_string_literal: true Puppet::Type.type(:splunk_output).provide( :ini_setting, parent: Puppet::Type.type(:ini_setting).provider(:splunk), ) do def self.file_name 'outputs.conf' end end
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/provider/splunkforwarder_transforms/ini_setting.rb
Ruby
apache-2.0
45
master
222
# frozen_string_literal: true Puppet::Type.type(:splunkforwarder_transforms).provide( :ini_setting, parent: Puppet::Type.type(:ini_setting).provider(:splunk), ) do def self.file_name 'transforms.conf' end end
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/provider/splunkforwarder_output/ini_setting.rb
Ruby
apache-2.0
45
master
215
# frozen_string_literal: true Puppet::Type.type(:splunkforwarder_output).provide( :ini_setting, parent: Puppet::Type.type(:ini_setting).provider(:splunk), ) do def self.file_name 'outputs.conf' end end
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/provider/splunk_uiprefs/ini_setting.rb
Ruby
apache-2.0
45
master
208
# frozen_string_literal: true Puppet::Type.type(:splunk_uiprefs).provide( :ini_setting, parent: Puppet::Type.type(:ini_setting).provider(:splunk), ) do def self.file_name 'ui-prefs.conf' end end
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/type/splunkforwarder_limits.rb
Ruby
apache-2.0
45
master
291
# frozen_string_literal: true require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type') Puppet::Type.newtype(:splunkforwarder_limits) do @doc = 'Manage splunkforwarder limit settings in limits.conf' PuppetX::Puppetlabs::Splunk::Type.clone_type(self) end
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/type/splunk_config.rb
Ruby
apache-2.0
45
master
6,730
# frozen_string_literal: true # Require all of our types so the class names are resolvable for purging Dir["#{File.dirname(__FILE__)}/splunk*.rb"].sort.each do |file| require file unless file == __FILE__ end Puppet::Type.newtype(:splunk_config) do newparam(:name, namevar: true) do desc 'splunk config' end ...
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/type/splunk_uiprefs.rb
Ruby
apache-2.0
45
master
277
# frozen_string_literal: true require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type') Puppet::Type.newtype(:splunk_uiprefs) do @doc = 'Manage splunk web ui settings in ui-prefs.conf' PuppetX::Puppetlabs::Splunk::Type.clone_type(self) end
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/type/splunk_authorize.rb
Ruby
apache-2.0
45
master
283
# frozen_string_literal: true require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type') Puppet::Type.newtype(:splunk_authorize) do @doc = 'Manage splunk authorize settings in authorize.conf' PuppetX::Puppetlabs::Splunk::Type.clone_type(self) end
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/type/splunk_props.rb
Ruby
apache-2.0
45
master
270
# frozen_string_literal: true require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type') Puppet::Type.newtype(:splunk_props) do @doc = 'Manage splunk prop settings in props.conf' PuppetX::Puppetlabs::Splunk::Type.clone_type(self) end
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/type/splunkforwarder_web.rb
Ruby
apache-2.0
45
master
283
# frozen_string_literal: true require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type') Puppet::Type.newtype(:splunkforwarder_web) do @doc = 'Manage splunkforwarder web settings in web.conf' PuppetX::Puppetlabs::Splunk::Type.clone_type(self) end
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/type/splunk_indexes.rb
Ruby
apache-2.0
45
master
275
# frozen_string_literal: true require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type') Puppet::Type.newtype(:splunk_indexes) do @doc = 'Manage splunk index settings in indexes.conf' PuppetX::Puppetlabs::Splunk::Type.clone_type(self) end
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/type/splunk_serverclass.rb
Ruby
apache-2.0
45
master
288
# frozen_string_literal: true require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type') Puppet::Type.newtype(:splunk_serverclass) do @doc = 'Manage splunk serverclass entries in serverclass.conf' PuppetX::Puppetlabs::Splunk::Type.clone_type(self) end
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/type/splunk_limits.rb
Ruby
apache-2.0
45
master
274
# frozen_string_literal: true require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type') Puppet::Type.newtype(:splunk_limits) do @doc = 'Manage splunk limits settings in limits.conf' PuppetX::Puppetlabs::Splunk::Type.clone_type(self) end
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/type/splunkforwarder_deploymentclient.rb
Ruby
apache-2.0
45
master
321
# frozen_string_literal: true require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type') Puppet::Type.newtype(:splunkforwarder_deploymentclient) do @doc = 'Manage splunkforwarder deploymentclient entries in deploymentclient.conf' PuppetX::Puppetlabs::Splunk::Type.clone_type(self) end
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/type/splunk_input.rb
Ruby
apache-2.0
45
master
272
# frozen_string_literal: true require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type') Puppet::Type.newtype(:splunk_input) do @doc = 'Manage splunk input settings in inputs.conf' PuppetX::Puppetlabs::Splunk::Type.clone_type(self) end
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/type/splunk_web.rb
Ruby
apache-2.0
45
master
265
# frozen_string_literal: true require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type') Puppet::Type.newtype(:splunk_web) do @doc = 'Manage splunk web settings in web.conf' PuppetX::Puppetlabs::Splunk::Type.clone_type(self) end
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/type/splunk_distsearch.rb
Ruby
apache-2.0
45
master
278
# frozen_string_literal: true require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type') Puppet::Type.newtype(:splunk_distsearch) do @doc = 'Manage distsearch entries in distsearch.conf' PuppetX::Puppetlabs::Splunk::Type.clone_type(self) end
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/type/splunk_output.rb
Ruby
apache-2.0
45
master
275
# frozen_string_literal: true require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type') Puppet::Type.newtype(:splunk_output) do @doc = 'Manage splunk output settings in outputs.conf' PuppetX::Puppetlabs::Splunk::Type.clone_type(self) end
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/type/splunkforwarder_server.rb
Ruby
apache-2.0
45
master
292
# frozen_string_literal: true require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type') Puppet::Type.newtype(:splunkforwarder_server) do @doc = 'Manage splunkforwarder server settings in server.conf' PuppetX::Puppetlabs::Splunk::Type.clone_type(self) end
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/type/splunkforwarder_props.rb
Ruby
apache-2.0
45
master
289
# frozen_string_literal: true require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type') Puppet::Type.newtype(:splunkforwarder_props) do @doc = 'Manage splunkforwarder props settings in props.conf' PuppetX::Puppetlabs::Splunk::Type.clone_type(self) end
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/type/splunkforwarder_transforms.rb
Ruby
apache-2.0
45
master
304
# frozen_string_literal: true require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type') Puppet::Type.newtype(:splunkforwarder_transforms) do @doc = 'Manage splunkforwarder transforms settings in transforms.conf' PuppetX::Puppetlabs::Splunk::Type.clone_type(self) end
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/type/splunk_alert_actions.rb
Ruby
apache-2.0
45
master
295
# frozen_string_literal: true require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type') Puppet::Type.newtype(:splunk_alert_actions) do @doc = 'Manage splunk alert_actions settings in alert_actions.conf' PuppetX::Puppetlabs::Splunk::Type.clone_type(self) end
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/type/splunk_metadata.rb
Ruby
apache-2.0
45
master
279
# frozen_string_literal: true require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type') Puppet::Type.newtype(:splunk_metadata) do @doc = 'Manage metadata entries in {default,local}.meta' PuppetX::Puppetlabs::Splunk::Type.clone_type(self) end
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/type/splunk_transforms.rb
Ruby
apache-2.0
45
master
286
# frozen_string_literal: true require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type') Puppet::Type.newtype(:splunk_transforms) do @doc = 'Manage splunk transforms settings in transforms.conf' PuppetX::Puppetlabs::Splunk::Type.clone_type(self) end
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/type/splunkforwarder_input.rb
Ruby
apache-2.0
45
master
290
# frozen_string_literal: true require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type') Puppet::Type.newtype(:splunkforwarder_input) do @doc = 'Manage splunkforwarder input settings in inputs.conf' PuppetX::Puppetlabs::Splunk::Type.clone_type(self) end
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/type/splunkforwarder_output.rb
Ruby
apache-2.0
45
master
293
# frozen_string_literal: true require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type') Puppet::Type.newtype(:splunkforwarder_output) do @doc = 'Manage splunkforwarder output settings in outputs.conf' PuppetX::Puppetlabs::Splunk::Type.clone_type(self) end
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/type/splunk_server.rb
Ruby
apache-2.0
45
master
274
# frozen_string_literal: true require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type') Puppet::Type.newtype(:splunk_server) do @doc = 'Manage splunk server settings in server.conf' PuppetX::Puppetlabs::Splunk::Type.clone_type(self) end
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/type/splunk_authentication.rb
Ruby
apache-2.0
45
master
298
# frozen_string_literal: true require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type') Puppet::Type.newtype(:splunk_authentication) do @doc = 'Manage splunk authentication settings in authentication.conf' PuppetX::Puppetlabs::Splunk::Type.clone_type(self) end
github
voxpupuli/puppet-splunk
https://github.com/voxpupuli/puppet-splunk
lib/puppet/type/splunk_deploymentclient.rb
Ruby
apache-2.0
45
master
303
# frozen_string_literal: true require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type') Puppet::Type.newtype(:splunk_deploymentclient) do @doc = 'Manage splunk deploymentclient entries in deploymentclient.conf' PuppetX::Puppetlabs::Splunk::Type.clone_type(self) end
github
bryanbraun/middleman-navtree
https://github.com/bryanbraun/middleman-navtree
middleman-navtree.gemspec
Ruby
mit
45
master
1,100
# -*- encoding: utf-8 -*- $:.push File.expand_path("../lib", __FILE__) require 'date' Gem::Specification.new do |s| s.name = "middleman-navtree" s.version = "0.1.11" s.licenses = ['MIT'] s.date = Date.today.to_s s.summary = "For building navigation trees with Middleman" s.descrip...
github
bryanbraun/middleman-navtree
https://github.com/bryanbraun/middleman-navtree
Rakefile
Ruby
mit
45
master
335
require 'bundler' Bundler::GemHelper.install_tasks require 'cucumber/rake/task' Cucumber::Rake::Task.new(:cucumber, 'Run features that should pass') do |t| t.cucumber_opts = "--color --tags ~@wip --strict --format #{ENV['CUCUMBER_FORMAT'] || 'Fivemat'}" end require 'rake/clean' task :test => ['cucumber'] task :d...
github
bryanbraun/middleman-navtree
https://github.com/bryanbraun/middleman-navtree
Gemfile
Ruby
mit
45
master
385
# If you have OpenSSL installed, we recommend updating # the following line to use "https" source 'https://rubygems.org' # Specify your gem's dependencies in middleman-navtree.gemspec gemspec group :development do gem 'rake' gem 'rdoc' gem 'yard' gem 'pry', :require => true # for debugging end group :test do...
github
bryanbraun/middleman-navtree
https://github.com/bryanbraun/middleman-navtree
features/support/env.rb
Ruby
mit
45
master
203
PROJECT_ROOT_PATH = File.dirname(File.dirname(File.dirname(__FILE__))) require 'middleman-core' require 'middleman-core/step_definitions' require File.join(PROJECT_ROOT_PATH, 'lib', 'middleman-navtree')
github
bryanbraun/middleman-navtree
https://github.com/bryanbraun/middleman-navtree
lib/middleman-navtree.rb
Ruby
mit
45
master
406
# Require core library require 'middleman-core' require 'middleman-navtree/version' # Register extensions which can be activated # Make sure we have the version of Middleman we expect # Name param may be omited, it will default to underscored # version of class name ::Middleman::Extensions.register(:navtree) do ...
github
bryanbraun/middleman-navtree
https://github.com/bryanbraun/middleman-navtree
lib/middleman-navtree/helpers.rb
Ruby
mit
45
master
6,221
module Middleman module NavTree # NavTree-related helpers that are available to the Middleman application in +config.rb+ and in templates. module Helpers # A recursive helper for converting source tree data from into HTML def tree_to_html(value, depth = Float::INFINITY, key = nil, level = 0) ...
github
bryanbraun/middleman-navtree
https://github.com/bryanbraun/middleman-navtree
lib/middleman-navtree/extension.rb
Ruby
mit
45
master
6,663
require 'middleman-navtree/helpers' module Middleman module NavTree # Extension namespace # @todo: Test the extension against a vanilla Middleman install. # @todo: Test the extension against a middleman-blog install. class NavTreeExtension < ::Middleman::Extension # All the options for this ex...
github
thumbor/ruby-thumbor
https://github.com/thumbor/ruby-thumbor
ruby-thumbor.gemspec
Ruby
mit
45
master
1,459
# frozen_string_literal: true require_relative 'lib/thumbor/version' Gem::Specification.new do |s| s.name = 'ruby-thumbor' s.version = Thumbor::VERSION s.authors = ['Bernardo Heynemann', 'Guilherme Souza'] s.description = 'ruby-thumbor is the client to the thumbor imaging service (http://github.com/thumbor/t...
github
thumbor/ruby-thumbor
https://github.com/thumbor/ruby-thumbor
Rakefile
Ruby
mit
45
master
284
# frozen_string_literal: true require 'rspec/core/rake_task' begin require 'bundler/setup' rescue LoadError puts 'You must `gem install bundler` and `bundle install` to run rake tasks' end Bundler::GemHelper.install_tasks RSpec::Core::RakeTask.new(:spec) task default: :spec
github
thumbor/ruby-thumbor
https://github.com/thumbor/ruby-thumbor
lib/thumbor/cascade.rb
Ruby
mit
45
master
1,820
# frozen_string_literal: true require 'forwardable' require 'openssl' require 'base64' require 'digest/md5' require 'cgi' module Thumbor class Cascade attr_accessor :image, :crypto, :options, :filters FILTER_REGEX = Regexp.new('^(.+)_filter$') @available_options = %i[ meta crop center orig...
github
thumbor/ruby-thumbor
https://github.com/thumbor/ruby-thumbor
lib/thumbor/crypto_url.rb
Ruby
mit
45
master
6,510
# frozen_string_literal: true require 'openssl' require 'base64' require 'digest/md5' require 'cgi' module Thumbor class CryptoURL def initialize(key = nil) @key = key end def calculate_width_and_height(url_parts, options) width = options[:width] height = options[:height] width...
github
thumbor/ruby-thumbor
https://github.com/thumbor/ruby-thumbor
spec/spec_helper.rb
Ruby
mit
45
master
582
# frozen_string_literal: true require 'simplecov' require 'simplecov-lcov' SimpleCov::Formatter::LcovFormatter.config do |config| config.report_with_single_file = true config.single_report_path = 'coverage/lcov.info' end SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new( [ SimpleCov::Formatte...
github
thumbor/ruby-thumbor
https://github.com/thumbor/ruby-thumbor
spec/thumbor/cascade_spec.rb
Ruby
mit
45
master
14,836
# frozen_string_literal: true require 'spec_helper' require 'json' require 'ruby-thumbor' describe Thumbor::Cascade do subject(:cascade_instance) { described_class.new key, image_url } let(:image_url) { 'my.domain.com/some/image/url.jpg' } let(:key) { 'my-security-key' } it 'raises an error' do expect {...
github
brightcode/fastest-csv
https://github.com/brightcode/fastest-csv
Rakefile
Ruby
mit
45
master
512
#!/usr/bin/env rake require "bundler/gem_tasks" spec = Gem::Specification.load('fastest-csv.gemspec') if RUBY_PLATFORM =~ /java/ require 'rake/javaextensiontask' Rake::JavaExtensionTask.new('csv_parser', spec) else require 'rake/extensiontask' Rake::ExtensionTask.new('csv_parser', spec) end require 'rake/tes...
github
brightcode/fastest-csv
https://github.com/brightcode/fastest-csv
fastest-csv.gemspec
Ruby
mit
45
master
973
# -*- encoding: utf-8 -*- require File.expand_path('../lib/fastest-csv/version', __FILE__) Gem::Specification.new do |gem| gem.authors = ["Maarten Oelering"] gem.email = ["maarten@brightcode.nl"] gem.description = %q{Fastest standard CSV parser for MRI Ruby and JRuby} gem.summary = %q{Fas...
github
brightcode/fastest-csv
https://github.com/brightcode/fastest-csv
ext/csv_parser/extconf.rb
Ruby
mit
45
master
262
#!/usr/bin/ruby -w require 'mkmf' extension_name = 'csv_parser' #dir_config(extension_name) if RUBY_VERSION =~ /1.8/ then $CPPFLAGS += " -DRUBY_18" end #if CONFIG["arch"] =~ /mswin32|mingw/ # $CFLAGS += " -march=i686" #end create_makefile(extension_name)
github
brightcode/fastest-csv
https://github.com/brightcode/fastest-csv
test/tc_csv_parsing.rb
Ruby
mit
45
master
5,177
# # Tests copied from faster_csv by James Edward Gray II # require 'test/unit' require 'fastest_csv' # # Following tests are my interpretation of the # {CSV RCF}[http://www.ietf.org/rfc/rfc4180.txt]. I only deviate from that # document in one place (intentionally) and that is to make the default row # separator <...
github
brightcode/fastest-csv
https://github.com/brightcode/fastest-csv
test/tc_interface.rb
Ruby
mit
45
master
3,109
# # Tests copied from faster_csv by James Edward Gray II # require 'test/unit' require 'fastest_csv' class TestFastestCSVInterface < Test::Unit::TestCase def setup @path = File.join(File.dirname(__FILE__), "temp_test_data.csv") File.open(@path, "w") do |file| file << "1,2,3\r\n" file << "4...
github
brightcode/fastest-csv
https://github.com/brightcode/fastest-csv
lib/fastest_csv.rb
Ruby
mit
45
master
2,567
# This loads either csv_parser.so, csv_parser.bundle or # csv_parser.jar, depending on your Ruby platform and OS require 'csv_parser' require 'stringio' # Fast CSV parser using native code class FastestCSV include Enumerable if RUBY_PLATFORM =~ /java/ if JRUBY_VERSION =~ /^1\.[0-6]/ require 'jruby' ...
github
fishbrain/administrate-field-belongs_to_search
https://github.com/fishbrain/administrate-field-belongs_to_search
Rakefile
Ruby
mit
45
master
357
#!/usr/bin/env rake begin require 'bundler/setup' rescue LoadError puts 'You must `gem install bundler` and `bundle install` to run rake tasks' end require 'bundler/gem_tasks' ## # Configure the test suite. ## require 'rspec/core' require 'rspec/core/rake_task' RSpec::Core::RakeTask.new ## # By default, just r...
github
fishbrain/administrate-field-belongs_to_search
https://github.com/fishbrain/administrate-field-belongs_to_search
administrate-field-belongs_to_search.gemspec
Ruby
mit
45
master
1,395
lib = File.expand_path('lib', __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) Gem::Specification.new do |gem| gem.name = 'administrate-field-belongs_to_search' gem.version = '0.10.0'.freeze gem.authors = ['Fishbrain'] gem.email = ['support@fishbrain.com'] gem.homepage = 'https://github.com/f...
github
fishbrain/administrate-field-belongs_to_search
https://github.com/fishbrain/administrate-field-belongs_to_search
spec/spec_helper.rb
Ruby
mit
45
master
2,052
# start coverage tracking require 'coveralls' require 'simplecov' SimpleCov.start # start up factory_girl require 'factory_girl' # start db and load migrations and everything require 'active_record' ActiveRecord::Base.establish_connection adapter: 'sqlite3', database: ':memory:' require_relative 'schema' require_rela...
github
fishbrain/administrate-field-belongs_to_search
https://github.com/fishbrain/administrate-field-belongs_to_search
spec/lib/administrate/field/belongs_to_search_spec.rb
Ruby
mit
45
master
1,654
require 'administrate/field/belongs_to_search' RSpec.describe Administrate::Field::BelongsToSearch do let(:page) { :edit } let(:post) { create(:post) } let(:field) { Administrate::Field::BelongsToSearch.new(:author, post.author, page) } describe '#to_partial_path' do it 'returns a partial based on the pag...
github
fishbrain/administrate-field-belongs_to_search
https://github.com/fishbrain/administrate-field-belongs_to_search
lib/administrate/field/belongs_to_search.rb
Ruby
mit
45
master
725
require 'administrate/field/belongs_to' require 'rails' module Administrate module Field class BelongsToSearch < Administrate::Field::BelongsTo class Engine < ::Rails::Engine initializer 'administrate-field-belongs_to_search.add_assets' do |app| app.config.assets.precompile << 'belongs_to...
github
ankit1910/paper_trail-globalid
https://github.com/ankit1910/paper_trail-globalid
paper_trail_globalid.gemspec
Ruby
mit
45
master
1,520
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'paper_trail_globalid/version' Gem::Specification.new do |spec| spec.name = "paper_trail-globalid" spec.version = PaperTrailGlobalid::VERSION spec.authors = ["Ankit"] ...
github
ankit1910/paper_trail-globalid
https://github.com/ankit1910/paper_trail-globalid
spec/paper_trail_globalid_spec.rb
Ruby
mit
45
master
3,623
require 'spec_helper' require_relative '../spec/support/order.rb' require_relative '../spec/support/admin.rb' describe PaperTrailGlobalid do before(:all) do ActiveRecord::Migration.verbose = false ActiveRecord::Schema.define do create_table :orders, force: true do |t| t.string :order_number ...
github
ankit1910/paper_trail-globalid
https://github.com/ankit1910/paper_trail-globalid
spec/spec_helper.rb
Ruby
mit
45
master
4,684
# This file was generated by the `rspec --init` command. Conventionally, all # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. # The generated `.rspec` file contains `--require spec_helper` which will cause # this file to always be loaded, without a need to explicitly require it in any # file...
github
ankit1910/paper_trail-globalid
https://github.com/ankit1910/paper_trail-globalid
lib/paper_trail-globalid.rb
Ruby
mit
45
master
375
require "paper_trail_globalid/paper_trail" require "paper_trail_globalid/version" require "paper_trail_globalid/version_concern" module PaperTrailGlobalid module ::PaperTrail class << self prepend ::PaperTrailGlobalid::PaperTrail end end module ::PaperTrail module VersionConcern include ...
github
ankit1910/paper_trail-globalid
https://github.com/ankit1910/paper_trail-globalid
lib/paper_trail_globalid/version_concern.rb
Ruby
mit
45
master
581
module PaperTrailGlobalid module VersionConcern def whodunnit=(value) if value.is_a? ActiveRecord::Base super(value.to_gid) else super end end # Returns an object which was responsible for a change # you need to store global_id to whodunnit field to make this method ...
github
ankit1910/paper_trail-globalid
https://github.com/ankit1910/paper_trail-globalid
lib/paper_trail_globalid/paper_trail.rb
Ruby
mit
45
master
350
module PaperTrailGlobalid module PaperTrail def whodunnit=(value) if value.is_a? ActiveRecord::Base paper_trail_store[:whodunnit] = value.to_gid else paper_trail_store[:whodunnit] = value end end def actor ::GlobalID::Locator.locate(paper_trail_store[:whodunnit]) |...
github
keepcosmos/ununiga
https://github.com/keepcosmos/ununiga
ununiga.gemspec
Ruby
mit
45
master
642
Gem::Specification.new do |s| s.name = 'ununiga' s.version = '1.1.2' s.date = '2016-01-25' s.summary = 'Support Jaso and Josa(Korean Language specific function)' s.description = '한글 자소 분리 및 적절한 조사를 찾아주어 번역해줍니다.' s.authors = ['Jaehyun Shin'] s.email = 'keepcosmos@gmail.com' ...
github
keepcosmos/ununiga
https://github.com/keepcosmos/ununiga
test/test_josa_transformer.rb
Ruby
mit
45
master
2,437
require 'minitest/autorun' require 'i18n' require 'ununiga/i18n/josa_transformer' class JosaTransformerTest < Minitest::Test def setup super I18n::Backend::Simple.send(:include, Ununiga::I18n::JosaTransformer) I18n.load_path = [File.dirname(__FILE__) + '/test.yml'] I18n.available_locales = [:en, :ko,...
github
keepcosmos/ununiga
https://github.com/keepcosmos/ununiga
test/test_josa_picker.rb
Ruby
mit
45
master
1,703
require 'minitest/autorun' require 'ununiga/josa_picker' class JosaPickerTest < Minitest::Test def test_takewell assert_equal '철수가 개발을 좋아합니다.', takewell('철수이(가) 개발을(를) 좋아합니다.') assert_equal '레일즈는 루비를 사용합니다.', takewell('레일즈은(는) 루비을(를) 사용합니다.') assert_equal '레일즈는 루비를 사용합니다.', takewell('레일즈는(은) 루비를(을) 사용합니...
github
keepcosmos/ununiga
https://github.com/keepcosmos/ununiga
test/test_jaso_splitter.rb
Ruby
mit
45
master
1,923
require 'minitest/autorun' require 'ununiga/jaso_splitter' class JamoSplitterTest < Minitest::Test def test_extract_chosung testgroup = { '가' => 'ㄱ', '낳' => 'ㄴ', '짷' => 'ㅉ', '하' => 'ㅎ' } testgroup.each do |char, chosung| splitter = U...
github
keepcosmos/ununiga
https://github.com/keepcosmos/ununiga
lib/ununiga.rb
Ruby
mit
45
master
228
require 'ununiga/version' module Ununiga autoload :JasoSplitter, 'ununiga/jaso_splitter' autoload :JosaPicker, 'ununiga/josa_picker' module I18n autoload :JosaTransformer, 'ununiga/i18n/josa_transformer' end end
github
keepcosmos/ununiga
https://github.com/keepcosmos/ununiga
lib/ununiga/josa_picker.rb
Ruby
mit
45
master
1,766
require 'ununiga/jaso_splitter' module Ununiga # 한글 조사 변경 클래스 class JosaPicker JOSAS = [%w(은 는), %w(이 가), %w(을 를), %w(과 와), %w(으로 로), %w(이의 의), %w(이), ].freeze attr_reader :korean_str, :is_html class << self ...
github
keepcosmos/ununiga
https://github.com/keepcosmos/ununiga
lib/ununiga/jaso_splitter.rb
Ruby
mit
45
master
2,040
module Ununiga # 한글 자소분리 클래스 # 1개의 한글 문자를 초성/중성/종성으로 분리한다. # # Sample: # # splitter = Ununiga::JasoSplitter.new('흯') # splitter.extract_chosung # => 'ㅎ' # splitter.extract_jungsung # => 'ㅢ' # splitter.extract_jongsung # => 'ㄳ' # splitter.split # =...
github
keepcosmos/ununiga
https://github.com/keepcosmos/ununiga
lib/ununiga/i18n/josa_transformer.rb
Ruby
mit
45
master
412
require 'ununiga/josa_picker' module Ununiga::I18n module JosaTransformer def translate(locale, key, options = {}) transform(super, key.end_with?("_html", ".html"), locale) end def transform(entry, is_html, locale=I18n.locale) if entry.is_a?(String) && locale.to_s =~ /ko|ko_KR/i retu...
github
spree-contrib/spree_affiliate
https://github.com/spree-contrib/spree_affiliate
spree_affiliate.gemspec
Ruby
bsd-3-clause
45
master
1,122
# encoding: UTF-8 Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.name = 'spree_affiliate' s.version = '2.2.1' s.authors = ['Rails Dog'] s.email = 'gems@railsdog.com' s.homepage = 'http://github.com/spree/spree_affiliate' s.summary = 'Affiliate support for ...
github
spree-contrib/spree_affiliate
https://github.com/spree-contrib/spree_affiliate
Rakefile
Ruby
bsd-3-clause
45
master
327
require 'bundler' Bundler::GemHelper.install_tasks require 'rspec/core/rake_task' require 'spree/testing_support/extension_rake' RSpec::Core::RakeTask.new task :default => [:spec] desc 'Generates a dummy app for testing' task :test_app do ENV['LIB_NAME'] = 'spree_affiliate' Rake::Task['extension:test_app'].invo...
github
spree-contrib/spree_affiliate
https://github.com/spree-contrib/spree_affiliate
Gemfile
Ruby
bsd-3-clause
45
master
233
source 'https://rubygems.org' gem 'haml-rails' gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '2-2-stable' gem 'spree_store_credits', github: 'spree/spree_store_credits', branch: '2-2-stable' gemspec
github
spree-contrib/spree_affiliate
https://github.com/spree-contrib/spree_affiliate
lib/affiliate_credits.rb
Ruby
bsd-3-clause
45
master
2,439
module AffiliateCredits private def create_affiliate_credits(sender, recipient, event, extra = {}) #check if sender should receive credit on affiliate register if sender_credit_amount = SpreeAffiliate::Config["sender_credit_on_#{event}_amount".to_sym] and sender_credit_amount.to_f > 0 credit...
github
spree-contrib/spree_affiliate
https://github.com/spree-contrib/spree_affiliate
lib/generators/spree_affiliate/install/install_generator.rb
Ruby
bsd-3-clause
45
master
1,272
module SpreeAffiliate module Generators class InstallGenerator < Rails::Generators::Base class_option :auto_run_migrations, :type => :boolean, :default => false def add_javascripts append_file 'vendor/assets/javascripts/spree/frontend/all.js', "//= require spree/frontend/spree_affiliate\n" ...
github
spree-contrib/spree_affiliate
https://github.com/spree-contrib/spree_affiliate
lib/spree_affiliate/configuration.rb
Ruby
bsd-3-clause
45
master
400
module SpreeAffiliate class Configuration < Spree::Preferences::Configuration preference :sender_credit_on_purchase_amount, :decimal, :default => 0.0 preference :sender_credit_on_register_amount, :decimal, :default => 0.0 preference :recipient_credit_on_register_amount, :decimal, :default => 0.0 prefe...
github
spree-contrib/spree_affiliate
https://github.com/spree-contrib/spree_affiliate
lib/spree_affiliate/engine.rb
Ruby
bsd-3-clause
45
master
542
module SpreeAffiliate class Engine < Rails::Engine require 'spree/core' isolate_namespace Spree engine_name 'spree_affiliate' config.autoload_paths += %W(#{config.root}/lib) # use rspec for tests config.generators do |g| g.test_framework :rspec end def self.activate Dir....
github
spree-contrib/spree_affiliate
https://github.com/spree-contrib/spree_affiliate
lib/spree_affiliate/factories.rb
Ruby
bsd-3-clause
45
master
280
FactoryGirl.define do # Define your Spree extensions Factories within this file to enable applications, and other extensions to use and override them. # # Example adding this to your spec_helper will load these Factories for use: # require 'spree_affiliate/factories' end
github
spree-contrib/spree_affiliate
https://github.com/spree-contrib/spree_affiliate
app/models/spree/affiliate.rb
Ruby
bsd-3-clause
45
master
341
class Spree::Affiliate < ActiveRecord::Base belongs_to :partner, class_name: 'Spree::User', foreign_key: :partner_id belongs_to :user, class_name: 'Spree::User' has_many :events, class_name: 'Spree::AffiliateEvent' def name I18n.t(:affiliate_program) end def ref_id partner.try(:ref...
github
spree-contrib/spree_affiliate
https://github.com/spree-contrib/spree_affiliate
app/models/spree/user_decorator.rb
Ruby
bsd-3-clause
45
master
480
Spree::User.class_eval do has_many :affiliates, class_name: 'Spree::Affiliate', foreign_key: 'partner_id' has_many :referred_users, class_name: 'Spree::User', through: :affiliates has_one :affiliate_partner, class_name:'Spree::Affiliate', foreign_key: 'user_id' def referred_by affi...
github
spree-contrib/spree_affiliate
https://github.com/spree-contrib/spree_affiliate
app/models/spree/order_decorator.rb
Ruby
bsd-3-clause
45
master
321
Spree::Order.class_eval do include AffiliateCredits alias :old_finalize! :finalize! def finalize! old_finalize! if user && user.affiliate_partner && user.orders.where(state: 'complete').count == 1 sender = user.referred_by create_affiliate_credits(sender, user, 'purchase') end end end
github
spree-contrib/spree_affiliate
https://github.com/spree-contrib/spree_affiliate
app/models/spree/affiliate_event.rb
Ruby
bsd-3-clause
45
master
209
class Spree::AffiliateEvent < ActiveRecord::Base belongs_to :affiliate, class_name: 'Spree::Affiliate' belongs_to :reward, polymorphic: true belongs_to :user, class_name: 'Spree::User' end
github
spree-contrib/spree_affiliate
https://github.com/spree-contrib/spree_affiliate
app/controllers/spree/admin/affiliate_settings_controller.rb
Ruby
bsd-3-clause
45
master
271
class Spree::Admin::AffiliateSettingsController < Spree::Admin::BaseController def update SpreeAffiliate::Config.set(params[:preferences]) respond_to do |format| format.html { redirect_to admin_affiliate_settings_path } end end end
github
spree-contrib/spree_affiliate
https://github.com/spree-contrib/spree_affiliate
app/helpers/spree/base_helper_decorator.rb
Ruby
bsd-3-clause
45
master
232
Spree::BaseHelper.class_eval do def referral_url(referrer) root_url(ref_id: referrer.ref_id) end def link_to_referral_url(referrer, options = {}) url = referral_url(referrer) link_to(url, url, options) end end
github
spree-contrib/spree_affiliate
https://github.com/spree-contrib/spree_affiliate
spec/spec_helper.rb
Ruby
bsd-3-clause
45
master
2,611
# Run Coverage report require 'simplecov' SimpleCov.start do add_group 'Controllers', 'app/controllers' add_group 'Helpers', 'app/helpers' add_group 'Mailers', 'app/mailers' add_group 'Models', 'app/models' add_group 'Views', 'app/views' add_group 'Libraries', 'lib' end # Configure Rails Environment ENV['R...
github
spree-contrib/spree_affiliate
https://github.com/spree-contrib/spree_affiliate
db/migrate/20101104145139_create_affiliate_events.rb
Ruby
bsd-3-clause
45
master
346
class CreateAffiliateEvents < ActiveRecord::Migration def self.up create_table :spree_affiliate_events do |t| t.string :name t.integer :reward_id t.string :reward_type t.references :affiliate t.references :user t.timestamps end end def self.down drop_table :spree_a...
github
spree-contrib/spree_affiliate
https://github.com/spree-contrib/spree_affiliate
db/migrate/20101022121217_create_affiliates.rb
Ruby
bsd-3-clause
45
master
251
class CreateAffiliates < ActiveRecord::Migration def self.up create_table :spree_affiliates do |t| t.integer :user_id t.integer :partner_id t.timestamps end end def self.down drop_table :spree_affiliates end end
github
tjwallace/fit
https://github.com/tjwallace/fit
fit.gemspec
Ruby
mit
45
master
1,189
# frozen_string_literal: true require 'English' lib = File.expand_path('lib', __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'fit/version' Gem::Specification.new do |spec| spec.name = 'fit-parser' spec.version = Fit::VERSION spec.authors = ['Jeff Wallace'] spec.e...
github
tjwallace/fit
https://github.com/tjwallace/fit
spec/fit_spec.rb
Ruby
mit
45
master
210
# frozen_string_literal: true require 'spec_helper' describe Fit do describe 'VERSION' do subject { Fit::VERSION } it { is_expected.to be_a(String) & match(/\d{1,2}\.\d{1,2}\.\d{1,2}/) } end end
github
tjwallace/fit
https://github.com/tjwallace/fit
spec/spec_helper.rb
Ruby
mit
45
master
398
# frozen_string_literal: true require 'simplecov' SimpleCov.add_filter '/spec/' SimpleCov.start SPEC_ROOT = File.dirname(__FILE__) $LOAD_PATH.unshift SPEC_ROOT, File.join(SPEC_ROOT, '..', 'lib') require 'rspec' require 'rspec/its' require 'fit' RSpec.configure(&:raise_errors_for_deprecations!) def example_file(fi...
github
tjwallace/fit
https://github.com/tjwallace/fit
spec/fit/file_spec.rb
Ruby
mit
45
master
609
# frozen_string_literal: true require 'spec_helper' describe Fit::File do subject(:file) { described_class.read(example_file('file/full_file_with_wrong_crc.fit')) } it 'has a header' do expect(file.header).to be_a Fit::File::Header end it 'has records' do expect(file.records).to be_a Array expec...
github
tjwallace/fit
https://github.com/tjwallace/fit
spec/fit/file/record_header_spec.rb
Ruby
mit
45
master
999
# frozen_string_literal: true require 'spec_helper' describe Fit::File::RecordHeader do context 'with a sample normal header' do subject { described_class.read example_file('record/normal_header') } it { is_expected.to have_attributes(header_type: 0, message_type: 1, message_type_specific: 0, local_m...
github
tjwallace/fit
https://github.com/tjwallace/fit
spec/fit/file/definitions_spec.rb
Ruby
mit
45
master
3,110
# frozen_string_literal: true require 'spec_helper' # we use undefined numbers for field otherwise we interfere # with already defined fields in definitions.rb and test are # not really independant of the code describe Fit::File::Definitions do describe '.add_field' do before :all do @fields = described_c...
github
tjwallace/fit
https://github.com/tjwallace/fit
spec/fit/file/type_spec.rb
Ruby
mit
45
master
2,774
# frozen_string_literal: true require 'spec_helper' describe Fit::File::Type do before :all do @types = Fit::File::Types.class_variable_get :@@types Fit::File::Types.add_type(:int_type, :sint8) Fit::File::Types.add_type(:int_type_with_val, :uint8, values: { 1 => 'one', 2 => 'two', 3 => 'three' }) end ...
github
tjwallace/fit
https://github.com/tjwallace/fit
spec/fit/file/types_spec.rb
Ruby
mit
45
master
3,271
# frozen_string_literal: true require 'spec_helper' describe Fit::File::Types do before :all do @types = described_class.class_variable_get :@@types end after :all do described_class.class_variable_set(:@@types, @types) end describe '.add_type' do before do described_class.class_variable...
github
tjwallace/fit
https://github.com/tjwallace/fit
spec/fit/file/data_spec.rb
Ruby
mit
45
master
5,854
# frozen_string_literal: true require 'spec_helper' describe Fit::File::Data do describe '.generate' do context 'standard definition' do subject { described_class.generate(definition) } let(:definition) { Fit::File::Definition.read example_file('record/message/definition') } its(:ancestors) ...
github
tjwallace/fit
https://github.com/tjwallace/fit
spec/fit/file/header_spec.rb
Ruby
mit
45
master
724
# frozen_string_literal: true require 'spec_helper' describe Fit::File::Header do context 'with a sample FIT header' do subject { described_class.read example_file('file/header') } it { is_expected.to have_attributes(header_size: 12, protocol_version: 16, profile_version: 64, data_size: 36069, ...
github
tjwallace/fit
https://github.com/tjwallace/fit
spec/fit/file/record_spec.rb
Ruby
mit
45
master
1,859
# frozen_string_literal: true require 'spec_helper' describe Fit::File::Record do before do described_class.clear_definitions! described_class.read(example_file('record/definition_record_2.fit')) end describe '.read' do subject { described_class.read(file) } context 'given a sample definition ...
github
tjwallace/fit
https://github.com/tjwallace/fit
spec/fit/file/definition_spec.rb
Ruby
mit
45
master
1,043
# frozen_string_literal: true require 'spec_helper' describe Fit::File::Definition do context 'given a sample definition message' do describe '.read' do subject do described_class.read example_file('record/message/definition') end its(:architecture) { is_expected.to eq(0) } its(...