repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/parsing/until_context.rb | lib/simplabs/excellent/parsing/until_context.rb | module Simplabs
module Excellent
module Parsing
class UntilContext < SexpContext #:nodoc:
def initialize(exp, parent)
super
@contains_assignment = has_assignment?
end
def tests_assignment?
@contains_assignment
end
end
end
end
... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/parsing/class_context.rb | lib/simplabs/excellent/parsing/class_context.rb | require 'simplabs/excellent/parsing/scopeable'
module Simplabs
module Excellent
module Parsing
class ClassContext < SexpContext #:nodoc:
include FlogMeasure
include Scopeable
VALIDATIONS = %w(
validate
validates
validates!
validates_each
... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/parsing/module_context.rb | lib/simplabs/excellent/parsing/module_context.rb | require 'simplabs/excellent/parsing/scopeable'
module Simplabs
module Excellent
module Parsing
class ModuleContext < SexpContext #:nodoc:
include Scopeable
attr_reader :methods
attr_reader :line_count
def initialize(exp, parent)
super
@name, @full_n... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/parsing/gasgn_context.rb | lib/simplabs/excellent/parsing/gasgn_context.rb | module Simplabs
module Excellent
module Parsing
class GasgnContext < SexpContext #:nodoc:
def initialize(exp, parent)
super
@name = exp[1].to_s.sub(/^\$/, '')
@full_name = @name
end
end
end
end
end
| ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/parsing/case_context.rb | lib/simplabs/excellent/parsing/case_context.rb | require 'simplabs/excellent/parsing/conditional_context'
module Simplabs
module Excellent
module Parsing
class CaseContext < ConditionalContext #:nodoc:
def initialize(exp, parent)
super
@has_else_clause = exp.last
@tests_parameter = contains_parameter?
end... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/parsing/code_processor.rb | lib/simplabs/excellent/parsing/code_processor.rb | require 'sexp_processor'
require 'simplabs/excellent/extensions/sexp'
require 'simplabs/excellent/parsing/if_context'
require 'simplabs/excellent/parsing/method_context'
require 'simplabs/excellent/parsing/singleton_method_context'
require 'simplabs/excellent/parsing/case_context'
require 'simplabs/excellent/parsing/bl... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/parsing/sexp_context.rb | lib/simplabs/excellent/parsing/sexp_context.rb | module Simplabs
module Excellent
module Parsing
# For most nodes the Excellent processor processes, it will create the corresponding context that contains meta information of the processed
# node. This is the base class for all these contexts.
#
# === Example
#
# For a metho... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/parsing/parser.rb | lib/simplabs/excellent/parsing/parser.rb | require 'rubygems'
require 'ruby_parser'
require 'erb'
module Simplabs
module Excellent
module Parsing
class Parser #:nodoc:
def parse(content, filename)
return silent_parse(content, filename)
rescue Exception
#continue on errors
end
private
... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/parsing/while_context.rb | lib/simplabs/excellent/parsing/while_context.rb | module Simplabs
module Excellent
module Parsing
class WhileContext < SexpContext #:nodoc:
def initialize(exp, parent)
super
@contains_assignment = has_assignment?
end
def tests_assignment?
@contains_assignment
end
end
end
end
... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/parsing/ivar_context.rb | lib/simplabs/excellent/parsing/ivar_context.rb | module Simplabs
module Excellent
module Parsing
class IvarContext < SexpContext #:nodoc:
def initialize(exp, parent)
super
@name = exp[1].to_s.sub(/^@+/, '')
end
def full_name
return @name if @parent.nil?
full_name = @name
parent... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/parsing/call_context.rb | lib/simplabs/excellent/parsing/call_context.rb | module Simplabs
module Excellent
module Parsing
class CallContext < SexpContext #:nodoc:
include Comparable
attr_reader :receiver
attr_reader :method
def initialize(exp, parent)
super
@receiver = if exp[1].is_a?(Sexp) && exp[1].node_type == :colon2
... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/parsing/method_context.rb | lib/simplabs/excellent/parsing/method_context.rb | require 'simplabs/excellent/parsing/cyclomatic_complexity_measure'
require 'simplabs/excellent/parsing/abc_measure'
require 'simplabs/excellent/parsing/flog_measure'
module Simplabs
module Excellent
module Parsing
class MethodContext < SexpContext #:nodoc:
include CyclomaticComplexityMeasure
... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/parsing/scopeable.rb | lib/simplabs/excellent/parsing/scopeable.rb | module Simplabs
module Excellent
module Parsing
module Scopeable #:nodoc:
private
def get_names
if @exp[1].is_a?(Sexp)
name = @exp[1].pop.to_s.strip
[name, "#{extract_prefixes}#{name}"]
else
[@exp[1].to_s, nil]
... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/parsing/conditional_context.rb | lib/simplabs/excellent/parsing/conditional_context.rb | require 'simplabs/excellent/parsing/sexp_context'
module Simplabs
module Excellent
module Parsing
class ConditionalContext < SexpContext #:nodoc:
protected
def contains_parameter?
return false unless @parent.is_a?(MethodContext)
return @exp[1][1] if !!@exp[1] ... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/parsing/cyclomatic_complexity_measure.rb | lib/simplabs/excellent/parsing/cyclomatic_complexity_measure.rb | module Simplabs
module Excellent
module Parsing
module CyclomaticComplexityMeasure #:nodoc:
COMPLEXITY_NODE_TYPES = [:if, :while, :until, :for, :rescue, :case, :when, :and, :or]
def process_if(exp)
add_complexity_score(1)
super
end
def process_while(... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/parsing/singleton_method_context.rb | lib/simplabs/excellent/parsing/singleton_method_context.rb | require 'simplabs/excellent/parsing/cyclomatic_complexity_measure'
require 'simplabs/excellent/parsing/abc_measure'
module Simplabs
module Excellent
module Parsing
class SingletonMethodContext < MethodContext #:nodoc:
include CyclomaticComplexityMeasure
include AbcMeasure
attr_... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/parsing/loc_parser.rb | lib/simplabs/excellent/parsing/loc_parser.rb | module Simplabs
module Excellent
module Parsing
# Parser that counts the different types of lines for the given set of files.
#
class LOCParser
# The files to count the lines for
#
attr_accessor :files
def initialize(files) #:nodoc:
@files = collec... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/parsing/for_loop_context.rb | lib/simplabs/excellent/parsing/for_loop_context.rb | module Simplabs
module Excellent
module Parsing
class ForLoopContext < SexpContext #:nodoc:
end
end
end
end
| ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/parsing/gvar_context.rb | lib/simplabs/excellent/parsing/gvar_context.rb | module Simplabs
module Excellent
module Parsing
class GvarContext < SexpContext #:nodoc:
def initialize(exp, parent)
super
@name = exp[1].to_s.sub(/^\$/, '')
@full_name = @name
end
end
end
end
end
| ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/parsing/flog_measure.rb | lib/simplabs/excellent/parsing/flog_measure.rb | module Simplabs
module Excellent
module Parsing
module FlogMeasure #:nodoc:
SCORES = Hash.new(1)
SCORES.merge!(
:define_method => 5,
:eval => 5,
:module_eval => 5,
:class_eval => 5,
... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/extensions/sexp.rb | lib/simplabs/excellent/extensions/sexp.rb | module Simplabs
module Excellent
module Extensions #:nodoc:
::Sexp.class_eval do
def children
sexp_body.select { |child| child.is_a?(Sexp) }
rescue
[]
end
end
end
end
end
| ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/rake/excellent_task.rb | lib/simplabs/excellent/rake/excellent_task.rb | require 'rake'
require 'simplabs/excellent'
module Simplabs
module Excellent
module Rake #:nodoc:
# A special rake task for Excellent.
class ExcellentTask < ::Rake::TaskLib
# The Name of the task, defaults to <tt>:excellent</tt>.
attr_accessor :name
# Specifies whether to... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/formatters/text.rb | lib/simplabs/excellent/formatters/text.rb | require 'simplabs/excellent/formatters/base'
module Simplabs
module Excellent
module Formatters
class Text < Base #:nodoc:
def initialize(stream = $stdout)
super
@total_warnings = 0
end
def start
@stream.puts "\n Excellent result:\n"
end
... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/formatters/base.rb | lib/simplabs/excellent/formatters/base.rb | module Simplabs
module Excellent
module Formatters
# The base class for all formatters.
class Base
# Initializes the formatter.
#
# Always call +super+ in custom formatters!
def initialize(stream)
@stream = stream
end
# Called when the Sim... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/formatters/html.rb | lib/simplabs/excellent/formatters/html.rb | require 'simplabs/excellent/formatters/base'
require 'rubygems'
module Simplabs
module Excellent
module Formatters
class Html < Base #:nodoc:
def initialize(stream = $stdout)
super
end
def start
@stream.write(HEADER_TEMPLATE)
end
def file(fi... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/module_line_count_check.rb | lib/simplabs/excellent/checks/module_line_count_check.rb | require 'simplabs/excellent/checks/line_count_check'
module Simplabs
module Excellent
module Checks
# This check reports modules which have more lines than the threshold. Modules with a large number of lines are hard to read and understand
# and often an indicator for badly designed code as well.
... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/rails.rb | lib/simplabs/excellent/checks/rails.rb | module Simplabs
module Excellent
module Checks
module Rails #:nodoc:
end
end
end
end
require 'simplabs/excellent/checks/rails/attr_accessible_check'
require 'simplabs/excellent/checks/rails/attr_protected_check'
require 'simplabs/excellent/checks/rails/instance_var_in_partial_check'
requi... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/module_name_check.rb | lib/simplabs/excellent/checks/module_name_check.rb | require 'simplabs/excellent/checks/base'
module Simplabs
module Excellent
module Checks
# This check reports modules with bad names. Badly named modules make reading and understanding the code much harder. Module names regarded as bad
# are for example:
#
# * names that are not Pascal ... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/abc_metric_method_check.rb | lib/simplabs/excellent/checks/abc_metric_method_check.rb | require 'simplabs/excellent/checks/base'
module Simplabs
module Excellent
module Checks
# This check reports methods with an ABC metric score that is higher than the threshold. The ABC metric is basically a measure for complexity
# and is calculated as:
#
# a = number of assignments
... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/name_check.rb | lib/simplabs/excellent/checks/name_check.rb | require 'simplabs/excellent/checks/base'
module Simplabs
module Excellent
module Checks
class NameCheck < Base #:nodoc:
def initialize(interesting_contexts, options = {}) #:nodoc:
super(options)
@interesting_contexts = interesting_contexts
@pattern = R... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/flog_class_check.rb | lib/simplabs/excellent/checks/flog_class_check.rb | require 'simplabs/excellent/checks/flog_check'
module Simplabs
module Excellent
module Checks
# This check reports classes with a Flog metric score that is higher than the threshold. The Flog metric is very similar to the cyclomatic complexity
# measure but also takes Ruby specific statements into... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/cyclomatic_complexity_method_check.rb | lib/simplabs/excellent/checks/cyclomatic_complexity_method_check.rb | require 'simplabs/excellent/checks/cyclomatic_complexity_check'
module Simplabs
module Excellent
module Checks
# This check reports methods with a cyclomatic complexity metric score that is higher than the threshold. The cyclomatic complexity metric counts
# the number of linearly independent path... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/cyclomatic_complexity_check.rb | lib/simplabs/excellent/checks/cyclomatic_complexity_check.rb | require 'simplabs/excellent/checks/base'
module Simplabs
module Excellent
module Checks
class CyclomaticComplexityCheck < Base #:nodoc:
def initialize(interesting_contexts, options = {}) #:nodoc:
super(options)
@interesting_contexts = interesting_contexts
@threshol... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/empty_rescue_body_check.rb | lib/simplabs/excellent/checks/empty_rescue_body_check.rb | require 'simplabs/excellent/checks/base'
module Simplabs
module Excellent
module Checks
# This check reports empty +rescue+ blocks. Empty +rescue+ blocks suppress all errors which is usually not a good technique.
#
# ==== Applies to
#
# * +rescue+ blocks
class EmptyRescueBo... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/global_variable_check.rb | lib/simplabs/excellent/checks/global_variable_check.rb | require 'simplabs/excellent/checks/base'
module Simplabs
module Excellent
module Checks
# This check reports global variables. Global variables introduce strong dependencies between otherwise unrelated parts of code and their use is
# usually considered extremely bad style.
#
# ==== Ap... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/line_count_check.rb | lib/simplabs/excellent/checks/line_count_check.rb | require 'simplabs/excellent/checks/base'
module Simplabs
module Excellent
module Checks
class LineCountCheck < Base #:nodoc:
def initialize(interesting_contexts, options = {}) #:nodoc:
super(options)
@interesting_contexts = interesting_contexts
@threshold ... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/class_name_check.rb | lib/simplabs/excellent/checks/class_name_check.rb | require 'simplabs/excellent/checks/name_check'
module Simplabs
module Excellent
module Checks
# This check reports classes with bad names. Badly named classes make reading and understanding the code much harder. Class names regarded as bad
# are for example:
#
# * names that are not Pa... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/base.rb | lib/simplabs/excellent/checks/base.rb | require 'simplabs/excellent/warning'
module Simplabs
module Excellent
module Checks
# This is the base class for all code checks. All checks must specify +interesting_contexts+. When one of these contexts is processed by Excellent, it
# will invoke the +evaluate_context+ method of all checks that ... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/assignment_in_conditional_check.rb | lib/simplabs/excellent/checks/assignment_in_conditional_check.rb | require 'simplabs/excellent/checks/base'
module Simplabs
module Excellent
module Checks
# This check reports conditionals that test an assignment as in
#
# something(var) if var = method()
#
# Assignments in conditions are often typos.
#
# ==== Applies to
#
... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/cyclomatic_complexity_block_check.rb | lib/simplabs/excellent/checks/cyclomatic_complexity_block_check.rb | require 'simplabs/excellent/checks/cyclomatic_complexity_check'
module Simplabs
module Excellent
module Checks
# This check reports blocks with a cyclomatic complexity metric score that is higher than the threshold. The cyclomatic complexity metric counts
# the number of linearly independent paths... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/class_variable_check.rb | lib/simplabs/excellent/checks/class_variable_check.rb | require 'simplabs/excellent/checks/base'
module Simplabs
module Excellent
module Checks
# This check reports class variables. Class variables in Ruby have a very complicated inheritance policy that often leads to errors. Usually class
# variables can be replaced with another construct which will a... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/for_loop_check.rb | lib/simplabs/excellent/checks/for_loop_check.rb | require 'simplabs/excellent/checks/base'
module Simplabs
module Excellent
module Checks
# This check reports code that uses +for+ loops as in:
#
# for user in @users
# do_something(user)
# end
#
# The use of for loops in Ruby is contrary to the language's basic c... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/method_name_check.rb | lib/simplabs/excellent/checks/method_name_check.rb | require 'simplabs/excellent/checks/base'
module Simplabs
module Excellent
module Checks
# This check reports methods with bad names. Badly named methods make reading and understanding the code much harder. Method names regarded as bad
# are for example:
#
# * names that are camel cased... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/nested_iterators_check.rb | lib/simplabs/excellent/checks/nested_iterators_check.rb | require 'simplabs/excellent/checks/base'
module Simplabs
module Excellent
module Checks
# This check reports nested iterators. Nested iterators may introduce performance issues.
#
# ==== Applies to
#
# * blocks
class NestedIteratorsCheck < Base
def initialize(optio... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/flog_method_check.rb | lib/simplabs/excellent/checks/flog_method_check.rb | require 'simplabs/excellent/checks/flog_check'
module Simplabs
module Excellent
module Checks
# This check reports methods with a Flog metric score that is higher than the threshold. The Flog metric is very similar to the cyclomatic complexity
# measure but also takes Ruby specific statements into... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/control_coupling_check.rb | lib/simplabs/excellent/checks/control_coupling_check.rb | require 'simplabs/excellent/checks/base'
module Simplabs
module Excellent
module Checks
# This check reports methods that check the value of a parameter to decide which execution path to take. Control Coupling introduces a
# dependency between the caller and the callee. Any changes to the possible... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/method_line_count_check.rb | lib/simplabs/excellent/checks/method_line_count_check.rb | require 'simplabs/excellent/checks/line_count_check'
module Simplabs
module Excellent
module Checks
# This check reports methods which have more lines than the threshold. Methods with a large number of lines are hard to read and understand
# and often an indicator for badly designed code as well.
... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/flog_block_check.rb | lib/simplabs/excellent/checks/flog_block_check.rb | require 'simplabs/excellent/checks/flog_check'
module Simplabs
module Excellent
module Checks
# This check reports blocks with a Flog metric score that is higher than the threshold. The Flog metric is very similar to the cyclomatic complexity
# measure but also takes Ruby specific statements into ... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/parameter_number_check.rb | lib/simplabs/excellent/checks/parameter_number_check.rb | require 'simplabs/excellent/checks/base'
module Simplabs
module Excellent
module Checks
# This check reports method and blocks that have more parameters than the threshold. Methods with long parameter lists are harder to understand
# and often an indicator for bad design as well.
#
# =... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/flog_check.rb | lib/simplabs/excellent/checks/flog_check.rb | require 'simplabs/excellent/checks/base'
module Simplabs
module Excellent
module Checks
class FlogCheck < Base #:nodoc:
def initialize(interesting_contexts, options = {}) #:nodoc:
super(options)
@interesting_contexts = interesting_contexts
@threshold = o... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/case_missing_else_check.rb | lib/simplabs/excellent/checks/case_missing_else_check.rb | require 'simplabs/excellent/checks/base'
module Simplabs
module Excellent
module Checks
# This check reports +case+ statements that don't have an +else+ clause that would be executed when no case matches. If the tested value will never
# adopt any other values than the ones tested for in the cases... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/class_line_count_check.rb | lib/simplabs/excellent/checks/class_line_count_check.rb | require 'simplabs/excellent/checks/line_count_check'
module Simplabs
module Excellent
module Checks
# This check reports classes which have more lines than the threshold. Classes with a large number of lines are hard to read and understand and
# often an indicator for badly designed code as well.
... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/rails/custom_initialize_method_check.rb | lib/simplabs/excellent/checks/rails/custom_initialize_method_check.rb | require 'simplabs/excellent/checks/base'
module Simplabs
module Excellent
module Checks
module Rails
# This check reports +ActiveRecord+ models that define a custom +initialize+ method. Since +ActiveRecord+ does not always call +new+ to
# create instances, these custom +initialize+ meth... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/rails/validations_check.rb | lib/simplabs/excellent/checks/rails/validations_check.rb | require 'simplabs/excellent/checks/base'
module Simplabs
module Excellent
module Checks
module Rails
# This check reports +ActiveRecord+ models that do not validate anything. Not validating anything in the model is usually not intended and has
# most likely just been forgotten. For more... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/rails/instance_var_in_partial_check.rb | lib/simplabs/excellent/checks/rails/instance_var_in_partial_check.rb | require 'simplabs/excellent/checks/base'
module Simplabs
module Excellent
module Checks
module Rails
# This check reports partials that use instance variables. Using instance variables in partials couples the partial to the controller action or
# template that includes the partial and t... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/rails/attr_protected_check.rb | lib/simplabs/excellent/checks/rails/attr_protected_check.rb | require 'simplabs/excellent/checks/base'
module Simplabs
module Excellent
module Checks
module Rails
# This check reports +ActiveRecord+ models that specify +attr_protected+. Like +attr_accessible+, +attr_protected+ is a helper to secure
# +ActiveRecord+ models against mass assignment a... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/rails/session_hash_in_view_check.rb | lib/simplabs/excellent/checks/rails/session_hash_in_view_check.rb | require 'simplabs/excellent/checks/base'
module Simplabs
module Excellent
module Checks
module Rails
# This check reports views (and partials) that access the +session+ hash. Accessing the +session+ hash directly in views can result in security
# problems if the value is printed to the ... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/rails/attr_accessible_check.rb | lib/simplabs/excellent/checks/rails/attr_accessible_check.rb | require 'simplabs/excellent/checks/base'
module Simplabs
module Excellent
module Checks
module Rails
# This check reports +ActiveRecord+ models that do not specify +attr_accessible+. Specifying +attr_accessible+ is viable to protect models from
# mass assignment attacks (see http://guid... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
mainmatter/excellent | https://github.com/mainmatter/excellent/blob/6097becb3090986b1aa2defe48d994f8c70f531d/lib/simplabs/excellent/checks/rails/params_hash_in_view_check.rb | lib/simplabs/excellent/checks/rails/params_hash_in_view_check.rb | require 'simplabs/excellent/checks/base'
module Simplabs
module Excellent
module Checks
module Rails
# This check reports views (and partials) that access the +params+ hash. Accessing the +params+ hash directly in views can result in security
# problems if the value is printed to the HT... | ruby | MIT | 6097becb3090986b1aa2defe48d994f8c70f531d | 2026-01-04T17:32:22.850230Z | false |
Shopify/active_fulfillment | https://github.com/Shopify/active_fulfillment/blob/2ceefcd98d4a8c67549a0739964c1e3385e50a96/test/test_helper.rb | test/test_helper.rb | require 'bundler/setup'
require 'active_fulfillment'
require 'minitest/autorun'
require 'mocha/minitest'
require 'timecop'
require 'pry'
require 'logger'
ActiveFulfillment::Service.logger = Logger.new(nil)
# This makes sure that Minitest::Test exists when an older version of Minitest
# (i.e. 4.x) is required by Act... | ruby | MIT | 2ceefcd98d4a8c67549a0739964c1e3385e50a96 | 2026-01-04T17:32:19.388409Z | false |
Shopify/active_fulfillment | https://github.com/Shopify/active_fulfillment/blob/2ceefcd98d4a8c67549a0739964c1e3385e50a96/test/remote/shipwire_test.rb | test/remote/shipwire_test.rb | require 'test_helper'
class RemoteShipwireTest < Minitest::Test
include ActiveFulfillment::Test::Fixtures
def setup
ActiveFulfillment::Base.mode = :test
@shipwire = ActiveFulfillment::ShipwireService.new(fixtures(:shipwire))
@options = {
:warehouse => 'LAX',
:shipping_method => 'UPS Grou... | ruby | MIT | 2ceefcd98d4a8c67549a0739964c1e3385e50a96 | 2026-01-04T17:32:19.388409Z | false |
Shopify/active_fulfillment | https://github.com/Shopify/active_fulfillment/blob/2ceefcd98d4a8c67549a0739964c1e3385e50a96/test/remote/amazon_mws_test.rb | test/remote/amazon_mws_test.rb | require 'test_helper'
class RemoteAmazonMarketplaceWebservicesTest < Minitest::Test
include ActiveFulfillment::Test::Fixtures
def setup
@service = ActiveFulfillment::AmazonMarketplaceWebService.new(fixtures(:amazon_mws))
@options = {
:shipping_method => 'Standard',
:order_date => Time.now.utc... | ruby | MIT | 2ceefcd98d4a8c67549a0739964c1e3385e50a96 | 2026-01-04T17:32:19.388409Z | false |
Shopify/active_fulfillment | https://github.com/Shopify/active_fulfillment/blob/2ceefcd98d4a8c67549a0739964c1e3385e50a96/test/remote/webgistix_test.rb | test/remote/webgistix_test.rb | require 'test_helper'
class RemoteWebgistixTest < Minitest::Test
include ActiveFulfillment::Test::Fixtures
def setup
ActiveFulfillment::Base.mode = :test
@service = ActiveFulfillment::WebgistixService.new(fixtures(:webgistix))
@options = {
:shipping_method => 'Ground',
:email => 'buye... | ruby | MIT | 2ceefcd98d4a8c67549a0739964c1e3385e50a96 | 2026-01-04T17:32:19.388409Z | false |
Shopify/active_fulfillment | https://github.com/Shopify/active_fulfillment/blob/2ceefcd98d4a8c67549a0739964c1e3385e50a96/test/remote/james_and_james_test.rb | test/remote/james_and_james_test.rb | require 'test_helper'
class RemoteJamesAndJamesTest < Minitest::Test
include ActiveFulfillment::Test::Fixtures
def setup
ActiveFulfillment::Base.mode = :test
@service = ActiveFulfillment::JamesAndJamesService.new(fixtures(:james_and_james))
@options = {
shipping_method: 'Ground',
email: ... | ruby | MIT | 2ceefcd98d4a8c67549a0739964c1e3385e50a96 | 2026-01-04T17:32:19.388409Z | false |
Shopify/active_fulfillment | https://github.com/Shopify/active_fulfillment/blob/2ceefcd98d4a8c67549a0739964c1e3385e50a96/test/unit/base_test.rb | test/unit/base_test.rb | require 'test_helper'
class BaseTest < Minitest::Test
include ActiveFulfillment
def test_get_shipwire_by_string
assert_equal ShipwireService, Base.service('shipwire')
end
def test_get_shipwire_by_name
assert_equal ShipwireService, Base.service(:shipwire)
end
def test_get_unknown_service
asse... | ruby | MIT | 2ceefcd98d4a8c67549a0739964c1e3385e50a96 | 2026-01-04T17:32:19.388409Z | false |
Shopify/active_fulfillment | https://github.com/Shopify/active_fulfillment/blob/2ceefcd98d4a8c67549a0739964c1e3385e50a96/test/unit/services/shipwire_test.rb | test/unit/services/shipwire_test.rb | require 'test_helper'
class ShipwireTest < Minitest::Test
include ActiveFulfillment::Test::Fixtures
PASSWORD = 'test_password'
def setup
ActiveFulfillment::Base.mode = :test
@shipwire = ActiveFulfillment::ShipwireService.new(
:login => 'cody@example.com',
:password ... | ruby | MIT | 2ceefcd98d4a8c67549a0739964c1e3385e50a96 | 2026-01-04T17:32:19.388409Z | false |
Shopify/active_fulfillment | https://github.com/Shopify/active_fulfillment/blob/2ceefcd98d4a8c67549a0739964c1e3385e50a96/test/unit/services/shopify_api_test.rb | test/unit/services/shopify_api_test.rb | require 'test_helper'
class ShopifyAPITest < Minitest::Test
def setup
@service = build_service()
end
def test_request_uri_is_correct_when_no_sku_passed
Timecop.freeze do
timestamp = Time.now.utc.to_i
uri = @service.send(:request_uri, 'fetch_stock', {timestamp: timestamp, shop: 'www.snowdevi... | ruby | MIT | 2ceefcd98d4a8c67549a0739964c1e3385e50a96 | 2026-01-04T17:32:19.388409Z | false |
Shopify/active_fulfillment | https://github.com/Shopify/active_fulfillment/blob/2ceefcd98d4a8c67549a0739964c1e3385e50a96/test/unit/services/amazon_mws_test.rb | test/unit/services/amazon_mws_test.rb | require 'test_helper'
class AmazonMarketplaceWebServiceTest < Minitest::Test
include ActiveFulfillment::Test::Fixtures
def setup
@service = ActiveFulfillment::AmazonMarketplaceWebService.new(
:login => 'login',
:pass... | ruby | MIT | 2ceefcd98d4a8c67549a0739964c1e3385e50a96 | 2026-01-04T17:32:19.388409Z | false |
Shopify/active_fulfillment | https://github.com/Shopify/active_fulfillment/blob/2ceefcd98d4a8c67549a0739964c1e3385e50a96/test/unit/services/webgistix_test.rb | test/unit/services/webgistix_test.rb | require 'test_helper'
class WebgistixTest < Minitest::Test
include ActiveFulfillment::Test::Fixtures
def setup
ActiveFulfillment::Base.mode = :test
@service = ActiveFulfillment::WebgistixService.new(
:login => 'cody@example.com',
:password => 'test'
... | ruby | MIT | 2ceefcd98d4a8c67549a0739964c1e3385e50a96 | 2026-01-04T17:32:19.388409Z | false |
Shopify/active_fulfillment | https://github.com/Shopify/active_fulfillment/blob/2ceefcd98d4a8c67549a0739964c1e3385e50a96/test/unit/services/james_and_james_test.rb | test/unit/services/james_and_james_test.rb | require 'test_helper'
class JamesAndJamesTest < Minitest::Test
def setup
ActiveFulfillment::Base.mode = :test
@service = ActiveFulfillment::JamesAndJamesService.new(subdomain: "client", key: "secret")
@options = {
:shipping_method => 'UPS Ground'
}
@address = { :name => 'Fred Brooks',
... | ruby | MIT | 2ceefcd98d4a8c67549a0739964c1e3385e50a96 | 2026-01-04T17:32:19.388409Z | false |
Shopify/active_fulfillment | https://github.com/Shopify/active_fulfillment/blob/2ceefcd98d4a8c67549a0739964c1e3385e50a96/lib/active_fulfillment.rb | lib/active_fulfillment.rb | # Copyright (c) 2017 Shopify Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# dist... | ruby | MIT | 2ceefcd98d4a8c67549a0739964c1e3385e50a96 | 2026-01-04T17:32:19.388409Z | false |
Shopify/active_fulfillment | https://github.com/Shopify/active_fulfillment/blob/2ceefcd98d4a8c67549a0739964c1e3385e50a96/lib/active_fulfillment/version.rb | lib/active_fulfillment/version.rb | # encoding: utf-8
module ActiveFulfillment
VERSION = "3.2.11"
end
| ruby | MIT | 2ceefcd98d4a8c67549a0739964c1e3385e50a96 | 2026-01-04T17:32:19.388409Z | false |
Shopify/active_fulfillment | https://github.com/Shopify/active_fulfillment/blob/2ceefcd98d4a8c67549a0739964c1e3385e50a96/lib/active_fulfillment/response.rb | lib/active_fulfillment/response.rb | module ActiveFulfillment
class Response
attr_reader :params
attr_reader :message
attr_reader :test
def success?
@success
end
def test?
@test
end
def initialize(success, message, params = {}, options = {})
@success, @message, @params = success, message, params.strin... | ruby | MIT | 2ceefcd98d4a8c67549a0739964c1e3385e50a96 | 2026-01-04T17:32:19.388409Z | false |
Shopify/active_fulfillment | https://github.com/Shopify/active_fulfillment/blob/2ceefcd98d4a8c67549a0739964c1e3385e50a96/lib/active_fulfillment/base.rb | lib/active_fulfillment/base.rb | module ActiveFulfillment
module Base
mattr_accessor :mode
self.mode = :production
def self.service(name)
ActiveFulfillment.const_get("#{name.to_s.downcase}_service".camelize)
end
end
end
| ruby | MIT | 2ceefcd98d4a8c67549a0739964c1e3385e50a96 | 2026-01-04T17:32:19.388409Z | false |
Shopify/active_fulfillment | https://github.com/Shopify/active_fulfillment/blob/2ceefcd98d4a8c67549a0739964c1e3385e50a96/lib/active_fulfillment/parsing.rb | lib/active_fulfillment/parsing.rb | module ActiveFulfillment
module Parsing
module_function
def with_xml_document(xml, response = {})
begin
document = Nokogiri::XML(xml)
rescue Nokogiri::XML::SyntaxError
return response
end
yield document, response
end
end
end
| ruby | MIT | 2ceefcd98d4a8c67549a0739964c1e3385e50a96 | 2026-01-04T17:32:19.388409Z | false |
Shopify/active_fulfillment | https://github.com/Shopify/active_fulfillment/blob/2ceefcd98d4a8c67549a0739964c1e3385e50a96/lib/active_fulfillment/service.rb | lib/active_fulfillment/service.rb | module ActiveFulfillment
class Service
include ActiveUtils::RequiresParameters
include ActiveUtils::PostsData
class_attribute :logger
def initialize(options = {})
check_test_mode(options)
@options = {}
@options.update(options)
end
def test_mode?
false
end
... | ruby | MIT | 2ceefcd98d4a8c67549a0739964c1e3385e50a96 | 2026-01-04T17:32:19.388409Z | false |
Shopify/active_fulfillment | https://github.com/Shopify/active_fulfillment/blob/2ceefcd98d4a8c67549a0739964c1e3385e50a96/lib/active_fulfillment/services.rb | lib/active_fulfillment/services.rb | require 'active_fulfillment/services/shopify_api'
require 'active_fulfillment/services/shipwire'
require 'active_fulfillment/services/webgistix'
require 'active_fulfillment/services/amazon_mws'
require 'active_fulfillment/services/james_and_james'
| ruby | MIT | 2ceefcd98d4a8c67549a0739964c1e3385e50a96 | 2026-01-04T17:32:19.388409Z | false |
Shopify/active_fulfillment | https://github.com/Shopify/active_fulfillment/blob/2ceefcd98d4a8c67549a0739964c1e3385e50a96/lib/active_fulfillment/services/webgistix.rb | lib/active_fulfillment/services/webgistix.rb | module ActiveFulfillment
class WebgistixService < Service
SERVICE_URLS = {
:fulfillment => 'https://www.webgistix.com/XML/CreateOrder.asp',
:inventory => 'https://www.webgistix.com/XML/GetInventory.asp',
:tracking => 'https://www.webgistix.com/XML/GetTracking.asp'
}.freeze
T... | ruby | MIT | 2ceefcd98d4a8c67549a0739964c1e3385e50a96 | 2026-01-04T17:32:19.388409Z | false |
Shopify/active_fulfillment | https://github.com/Shopify/active_fulfillment/blob/2ceefcd98d4a8c67549a0739964c1e3385e50a96/lib/active_fulfillment/services/shopify_api.rb | lib/active_fulfillment/services/shopify_api.rb | require 'active_support/core_ext/object/to_query'
require 'resolv'
module ActiveFulfillment
class ShopifyAPIService < Service
OrderIdCutoffDate = Date.iso8601('2015-03-01').freeze
MAX_LOGGED_RESPONSE_LENGTH = 70
RESCUABLE_CONNECTION_ERRORS = [
Net::ReadTimeout,
Net::OpenTimeout,
Errn... | ruby | MIT | 2ceefcd98d4a8c67549a0739964c1e3385e50a96 | 2026-01-04T17:32:19.388409Z | false |
Shopify/active_fulfillment | https://github.com/Shopify/active_fulfillment/blob/2ceefcd98d4a8c67549a0739964c1e3385e50a96/lib/active_fulfillment/services/amazon_mws.rb | lib/active_fulfillment/services/amazon_mws.rb | require 'base64'
require 'time'
require 'cgi'
require 'active_support/core_ext/hash/except'
module ActiveFulfillment
class AmazonMarketplaceWebService < Service
APPLICATION_IDENTIFIER = 'active_merchant_mws/0.01 (Language=ruby)'.freeze
REGISTRATION_URI = URI.parse('https://sellercentral.amazon.com/gp/mws/r... | ruby | MIT | 2ceefcd98d4a8c67549a0739964c1e3385e50a96 | 2026-01-04T17:32:19.388409Z | false |
Shopify/active_fulfillment | https://github.com/Shopify/active_fulfillment/blob/2ceefcd98d4a8c67549a0739964c1e3385e50a96/lib/active_fulfillment/services/james_and_james.rb | lib/active_fulfillment/services/james_and_james.rb | require 'json'
module ActiveFulfillment
class JamesAndJamesService < Service
SERVICE_URLS = {
fulfillment: 'https://%{subdomain}.sixworks.co.uk/api/1/',
inventory: 'https://%{subdomain}.sixworks.co.uk/api/1/stock'
}.freeze
def initialize(options = {})
requires!(options, :subdomain, :k... | ruby | MIT | 2ceefcd98d4a8c67549a0739964c1e3385e50a96 | 2026-01-04T17:32:19.388409Z | false |
Shopify/active_fulfillment | https://github.com/Shopify/active_fulfillment/blob/2ceefcd98d4a8c67549a0739964c1e3385e50a96/lib/active_fulfillment/services/shipwire.rb | lib/active_fulfillment/services/shipwire.rb | require 'cgi'
module ActiveFulfillment
class ShipwireService < Service
SERVICE_URLS = { :fulfillment => 'https://api.shipwire.com/exec/FulfillmentServices.php',
:inventory => 'https://api.shipwire.com/exec/InventoryServices.php',
:tracking => 'https://api.shipwi... | ruby | MIT | 2ceefcd98d4a8c67549a0739964c1e3385e50a96 | 2026-01-04T17:32:19.388409Z | false |
facebook/grocery-delivery | https://github.com/facebook/grocery-delivery/blob/7ec5407ccfc4db7a102e04ea31d5f6210bfafb1e/test/knife.rb | test/knife.rb | # Copyright 2013-present Facebook
#
# 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 to in writ... | ruby | Apache-2.0 | 7ec5407ccfc4db7a102e04ea31d5f6210bfafb1e | 2026-01-04T17:32:15.247790Z | false |
facebook/grocery-delivery | https://github.com/facebook/grocery-delivery/blob/7ec5407ccfc4db7a102e04ea31d5f6210bfafb1e/test/gd-svn.rb | test/gd-svn.rb | # Copyright 2013-present Facebook
#
# 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 to in writ... | ruby | Apache-2.0 | 7ec5407ccfc4db7a102e04ea31d5f6210bfafb1e | 2026-01-04T17:32:15.247790Z | false |
facebook/grocery-delivery | https://github.com/facebook/grocery-delivery/blob/7ec5407ccfc4db7a102e04ea31d5f6210bfafb1e/test/gd-git.rb | test/gd-git.rb | # Copyright 2013-present Facebook
#
# 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 to in writ... | ruby | Apache-2.0 | 7ec5407ccfc4db7a102e04ea31d5f6210bfafb1e | 2026-01-04T17:32:15.247790Z | false |
facebook/grocery-delivery | https://github.com/facebook/grocery-delivery/blob/7ec5407ccfc4db7a102e04ea31d5f6210bfafb1e/lib/grocery_delivery/hooks.rb | lib/grocery_delivery/hooks.rb | # vim: syntax=ruby:expandtab:shiftwidth=2:softtabstop=2:tabstop=2
# Copyright 2013-present Facebook
#
# 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... | ruby | Apache-2.0 | 7ec5407ccfc4db7a102e04ea31d5f6210bfafb1e | 2026-01-04T17:32:15.247790Z | false |
facebook/grocery-delivery | https://github.com/facebook/grocery-delivery/blob/7ec5407ccfc4db7a102e04ea31d5f6210bfafb1e/lib/grocery_delivery/logging.rb | lib/grocery_delivery/logging.rb | # vim: syntax=ruby:expandtab:shiftwidth=2:softtabstop=2:tabstop=2
# Copyright 2013-present Facebook
#
# 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... | ruby | Apache-2.0 | 7ec5407ccfc4db7a102e04ea31d5f6210bfafb1e | 2026-01-04T17:32:15.247790Z | false |
facebook/grocery-delivery | https://github.com/facebook/grocery-delivery/blob/7ec5407ccfc4db7a102e04ea31d5f6210bfafb1e/lib/grocery_delivery/config.rb | lib/grocery_delivery/config.rb | # vim: syntax=ruby:expandtab:shiftwidth=2:softtabstop=2:tabstop=2
# Copyright 2013-present Facebook
#
# 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... | ruby | Apache-2.0 | 7ec5407ccfc4db7a102e04ea31d5f6210bfafb1e | 2026-01-04T17:32:15.247790Z | false |
mame/_ | https://github.com/mame/_/blob/b5b2d8beda79e1ae644eba85294831984c694856/lib/_.rb | lib/_.rb | def __script__(src)
code = []
src = src.unpack("C*").map {|c| c.ord.to_s(6).rjust(3, "0").chars.to_a }
src.flatten(1).map {|n| n.to_i(6) + 1 }.each do |n|
code.empty? || code.last.size + n + 1 >= 60 ? code << "" : code.last << " "
code.last << "_" * n
end
([%q(require "_")] + code).join("\n")
end
$co... | ruby | MIT | b5b2d8beda79e1ae644eba85294831984c694856 | 2026-01-04T17:32:22.819213Z | false |
allourideas/allourideas.org | https://github.com/allourideas/allourideas.org/blob/3b586bd3fe23b6a341554bc72ef8a39e2f21a672/config.rb | config.rb | # Require any additional compass plugins here.
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "public/stylesheets"
sass_dir = "public/stylesheets/sass"
images_dir = "public/images"
javascripts_dir = "public/javascripts"
# You can select your preferred output style here (can be overrid... | ruby | BSD-3-Clause | 3b586bd3fe23b6a341554bc72ef8a39e2f21a672 | 2026-01-04T17:27:38.355655Z | false |
allourideas/allourideas.org | https://github.com/allourideas/allourideas.org/blob/3b586bd3fe23b6a341554bc72ef8a39e2f21a672/app/helpers/vote_helper.rb | app/helpers/vote_helper.rb | module VoteHelper
def vote_params
{ :prompt_id => @prompt_id, :id => @question_id, :name => @name }
end
def loc_based_style(link, loc)
@current_page == loc ? "<strong>#{link}</strong>" : link
end
end
| ruby | BSD-3-Clause | 3b586bd3fe23b6a341554bc72ef8a39e2f21a672 | 2026-01-04T17:27:38.355655Z | false |
allourideas/allourideas.org | https://github.com/allourideas/allourideas.org/blob/3b586bd3fe23b6a341554bc72ef8a39e2f21a672/app/helpers/application_helper.rb | app/helpers/application_helper.rb | module ApplicationHelper
def body_class
"#{controller.controller_name} #{controller.controller_name}-#{controller.action_name}"
end
def logged_in?
signed_in?
end
def percentage(num, denom)
@controller.percentage(num, denom)
end
def google_maps_key
if @controller.request.env['SERVER_NA... | ruby | BSD-3-Clause | 3b586bd3fe23b6a341554bc72ef8a39e2f21a672 | 2026-01-04T17:27:38.355655Z | false |
allourideas/allourideas.org | https://github.com/allourideas/allourideas.org/blob/3b586bd3fe23b6a341554bc72ef8a39e2f21a672/app/helpers/questions_helper.rb | app/helpers/questions_helper.rb | module QuestionsHelper
end
| ruby | BSD-3-Clause | 3b586bd3fe23b6a341554bc72ef8a39e2f21a672 | 2026-01-04T17:27:38.355655Z | false |
allourideas/allourideas.org | https://github.com/allourideas/allourideas.org/blob/3b586bd3fe23b6a341554bc72ef8a39e2f21a672/app/controllers/questions_controller.rb | app/controllers/questions_controller.rb | class QuestionsController < ApplicationController
include ActionView::Helpers::TextHelper
require 'geokit'
before_filter :authenticate, :only => [:admin, :toggle, :toggle_autoactivate, :update, :delete_logo, :export, :add_photos, :update_name]
before_filter :admin_only, :only => [:index, :admin_stats]
#caches... | ruby | BSD-3-Clause | 3b586bd3fe23b6a341554bc72ef8a39e2f21a672 | 2026-01-04T17:27:38.355655Z | true |
allourideas/allourideas.org | https://github.com/allourideas/allourideas.org/blob/3b586bd3fe23b6a341554bc72ef8a39e2f21a672/app/controllers/clicks_controller.rb | app/controllers/clicks_controller.rb | class ClicksController < InheritedResources::Base
def export
@clicks = Click.find(:all, :include => :session_info)
outfile = "clicks_" + Time.now.strftime("%m-%d-%Y") + ".csv"
headers = ['Click ID', 'Session ID', 'User ID', 'Ip Addr', 'Controller', 'Action',
'URL', 'Referrer', 'User Agent',... | ruby | BSD-3-Clause | 3b586bd3fe23b6a341554bc72ef8a39e2f21a672 | 2026-01-04T17:27:38.355655Z | false |
allourideas/allourideas.org | https://github.com/allourideas/allourideas.org/blob/3b586bd3fe23b6a341554bc72ef8a39e2f21a672/app/controllers/home_controller.rb | app/controllers/home_controller.rb | class HomeController < ApplicationController
include ActionView::Helpers::TextHelper
#caches_page :about, :tour, :privacy
before_filter :authenticate, :only => [:admin]
before_filter :admin_only, :only => [:no_google_tracking]
skip_before_filter :initialize_session, :set_session_timestamp, :record_action, :v... | ruby | BSD-3-Clause | 3b586bd3fe23b6a341554bc72ef8a39e2f21a672 | 2026-01-04T17:27:38.355655Z | false |
allourideas/allourideas.org | https://github.com/allourideas/allourideas.org/blob/3b586bd3fe23b6a341554bc72ef8a39e2f21a672/app/controllers/users_controller.rb | app/controllers/users_controller.rb | class UsersController < Clearance::UsersController
end | ruby | BSD-3-Clause | 3b586bd3fe23b6a341554bc72ef8a39e2f21a672 | 2026-01-04T17:27:38.355655Z | false |
allourideas/allourideas.org | https://github.com/allourideas/allourideas.org/blob/3b586bd3fe23b6a341554bc72ef8a39e2f21a672/app/controllers/prompts_controller.rb | app/controllers/prompts_controller.rb | # encoding: utf-8
class PromptsController < ApplicationController
include ActionView::Helpers::TextHelper
def vote
voted_prompt = Prompt.new
voted_prompt.id = params[:id]
voted_prompt.prefix_options = {:question_id => params[:question_id]}
session[:has_voted] = true
@earl = Earl.find_by_questi... | ruby | BSD-3-Clause | 3b586bd3fe23b6a341554bc72ef8a39e2f21a672 | 2026-01-04T17:27:38.355655Z | false |
allourideas/allourideas.org | https://github.com/allourideas/allourideas.org/blob/3b586bd3fe23b6a341554bc72ef8a39e2f21a672/app/controllers/choices_controller.rb | app/controllers/choices_controller.rb | class ChoicesController < ApplicationController
include ActionView::Helpers::TextHelper
before_filter :authenticate, :only => [:toggle]
before_filter :earl_owner_or_admin_only, :only => [:activate, :deactivate, :rotate]
def show
@earl = Earl.find params[:question_id]
@question = Question.find(@earl.que... | ruby | BSD-3-Clause | 3b586bd3fe23b6a341554bc72ef8a39e2f21a672 | 2026-01-04T17:27:38.355655Z | false |
allourideas/allourideas.org | https://github.com/allourideas/allourideas.org/blob/3b586bd3fe23b6a341554bc72ef8a39e2f21a672/app/controllers/abingo_dashboard_controller.rb | app/controllers/abingo_dashboard_controller.rb | class AbingoDashboardController < ApplicationController
before_filter :admin_only
caches_action :show_set, :layout => false
def index
if params[:all]
@experiments = Abingo::Experiment.all
else
@experiments = Abingo::Experiment.paginate :page => params[:page], :order => 'created_at DESC'
... | ruby | BSD-3-Clause | 3b586bd3fe23b6a341554bc72ef8a39e2f21a672 | 2026-01-04T17:27:38.355655Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.