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 |
|---|---|---|---|---|---|---|---|---|
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/gems/gems/erubis-2.6.0/test/data/users-guide/printenabled-example.rb | gems/gems/erubis-2.6.0/test/data/users-guide/printenabled-example.rb | require 'erubis'
class PrintEnabledEruby < Erubis::Eruby
include Erubis::PrintEnabledEnhancer
end
input = File.read('printenabled-example.eruby')
eruby = PrintEnabledEruby.new(input)
list = ['aaa', 'bbb', 'ccc']
print eruby.evaluate(:list=>list)
| ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/gems/gems/erubis-2.6.0/test/data/users-guide/main_program2.rb | gems/gems/erubis-2.6.0/test/data/users-guide/main_program2.rb | require 'erubis'
eruby = Erubis::Eruby.new(File.read('template2.rhtml'))
items = ['foo', 'bar', 'baz']
x = 1
## only 'items' are passed to template
print eruby.evaluate(:items=>items)
## local variable 'x' is not changed!
puts "** debug: x=#{x.inspect}" #=> 1
| ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/gems/gems/erubis-2.6.0/test/data/users-guide/main_program1.rb | gems/gems/erubis-2.6.0/test/data/users-guide/main_program1.rb | require 'erubis'
eruby = Erubis::Eruby.new(File.read('template1.rhtml'))
items = ['foo', 'bar', 'baz']
x = 1
## local variable 'x' and 'eruby' are passed to template as well as 'items'!
print eruby.result(binding())
## local variable 'x' is changed unintendedly because it is changed in template!
puts "** debug: x=#... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/gems/gems/erubis-2.6.0/test/data/users-guide/example2.rb | gems/gems/erubis-2.6.0/test/data/users-guide/example2.rb | require 'erubis'
input = File.read('example2.eruby')
eruby = Erubis::Eruby.new(input, :trim=>false)
puts "----- script source ---"
puts eruby.src # print script source
puts "----- result ----------"
list = ['aaa', 'bbb', 'ccc']
puts eruby.result(binding()) # get result
| ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/gems/gems/erubis-2.6.0/test/data/users-guide/def_method.rb | gems/gems/erubis-2.6.0/test/data/users-guide/def_method.rb | require 'erubis'
s = "hello <%= name %>"
eruby = Erubis::Eruby.new(s)
filename = 'hello.rhtml'
## define instance method to Dummy class (or module)
class Dummy; end
eruby.def_method(Dummy, 'render(name)', filename) # filename is optional
p Dummy.new.render('world') #=> "hello world"
## define singleton method to ... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/gems/gems/erubis-2.6.0/test/data/users-guide/context.rb | gems/gems/erubis-2.6.0/test/data/users-guide/context.rb | @title = 'Users List'
@users = [
{ 'name'=>'foo', 'mail'=>'foo@mail.com' },
{ 'name'=>'bar', 'mail'=>'bar@mail.net' },
{ 'name'=>'baz', 'mail'=>'baz@mail.org' },
]
| ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/gems/gems/erubis-2.6.0/test/data/users-guide/example6.rb | gems/gems/erubis-2.6.0/test/data/users-guide/example6.rb | class MyData
attr_accessor :val, :list
end
## any object can be a context object
mydata = MyData.new
mydata.val = 'Erubis Example'
mydata.list = ['aaa', 'bbb', 'ccc']
require 'erubis'
eruby = Erubis::Eruby.new(File.read('example5.eruby'))
puts eruby.evaluate(mydata)
| ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/gems/gems/erubis-2.6.0/lib/erubis.rb | gems/gems/erubis-2.6.0/lib/erubis.rb | ##
## $Rev: 99 $
## $Release: 2.6.0 $
## copyright(c) 2006-2008 kuwata-lab.com all rights reserved.
##
##
## an implementation of eRuby
##
## ex.
## input = <<'END'
## <ul>
## <% for item in @list %>
## <li><%= item %>
## <%== item %></li>
## <% end %>
## </ul>
## END
## list = ['<aaa... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/gems/gems/erubis-2.6.0/lib/erubis/main.rb | gems/gems/erubis-2.6.0/lib/erubis/main.rb | ###
### $Rev: 91 $
### $Release: 2.6.0 $
### copyright(c) 2006-2008 kuwata-lab.com all rights reserved.
###
require 'yaml'
require 'erubis'
require 'erubis/tiny'
require 'erubis/engine/enhanced'
require 'erubis/engine/optimized'
require 'erubis/engine/eruby'
require 'erubis/engine/ephp'
require 'erubis/engine/ec'
requ... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/gems/gems/erubis-2.6.0/lib/erubis/converter.rb | gems/gems/erubis-2.6.0/lib/erubis/converter.rb | ##
## $Rev: 104 $
## $Release: 2.6.0 $
## copyright(c) 2006-2008 kuwata-lab.com all rights reserved.
##
require 'abstract'
module Erubis
##
## convert
##
module Converter
attr_accessor :preamble, :postamble, :escape
def self.supported_properties # :nodoc:
return [
[:preamble... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/gems/gems/erubis-2.6.0/lib/erubis/enhancer.rb | gems/gems/erubis-2.6.0/lib/erubis/enhancer.rb | ##
## $Rev: 103 $
## $Release: 2.6.0 $
## copyright(c) 2006-2008 kuwata-lab.com all rights reserved.
##
module Erubis
##
## switch '<%= ... %>' to escaped and '<%== ... %>' to unescaped
##
## ex.
## class XmlEruby < Eruby
## include EscapeEnhancer
## end
##
## this is language-indenedent.
... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/gems/gems/erubis-2.6.0/lib/erubis/preprocessing.rb | gems/gems/erubis-2.6.0/lib/erubis/preprocessing.rb | ###
### $Rev: 102 $
### $Release: 2.6.0 $
### copyright(c) 2006-2008 kuwata-lab.com all rights reserved.
###
require 'cgi'
module Erubis
##
## for preprocessing
##
class PreprocessingEruby < Erubis::Eruby
def initialize(input, params={})
params = params.dup
params[:pattern] ||= '\[% %\]' ... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/gems/gems/erubis-2.6.0/lib/erubis/local-setting.rb | gems/gems/erubis-2.6.0/lib/erubis/local-setting.rb | ##
## $Rev: 77 $
## $Release: 2.6.0 $
## copyright(c) 2006-2008 kuwata-lab.com all rights reserved.
##
##
## you can add site-local settings here.
## this files is required by erubis.rb
##
| ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/gems/gems/erubis-2.6.0/lib/erubis/generator.rb | gems/gems/erubis-2.6.0/lib/erubis/generator.rb | ##
## $Rev: 77 $
## $Release: 2.6.0 $
## copyright(c) 2006-2008 kuwata-lab.com all rights reserved.
##
require 'abstract'
module Erubis
##
## code generator, called by Converter module
##
module Generator
def self.supported_properties() # :nodoc:
return [
[:escapefunc, nil, "... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/gems/gems/erubis-2.6.0/lib/erubis/tiny.rb | gems/gems/erubis-2.6.0/lib/erubis/tiny.rb | ##
## $Rev: 77 $
## $Release: 2.6.0 $
## copyright(c) 2006-2008 kuwata-lab.com all rights reserved.
##
module Erubis
##
## tiny and the simplest implementation of eRuby
##
## ex.
## eruby = TinyEruby.new(File.read('example.rhtml'))
## print eruby.src # print ruby code
## print erub... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/gems/gems/erubis-2.6.0/lib/erubis/helper.rb | gems/gems/erubis-2.6.0/lib/erubis/helper.rb | ##
## $Rev: 89 $
## $Release: 2.6.0 $
## copyright(c) 2006-2008 kuwata-lab.com all rights reserved.
##
module Erubis
##
## helper for xml
##
module XmlHelper
module_function
ESCAPE_TABLE = {
'&' => '&',
'<' => '<',
'>' => '>',
'"' => '"',
"'" => '''... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/gems/gems/erubis-2.6.0/lib/erubis/context.rb | gems/gems/erubis-2.6.0/lib/erubis/context.rb | ##
## $Rev: 77 $
## $Release: 2.6.0 $
## copyright(c) 2006-2008 kuwata-lab.com all rights reserved.
##
module Erubis
##
## context object for Engine#evaluate
##
## ex.
## template = <<'END'
## Hello <%= @user %>!
## <% for item in @list %>
## - <%= item %>
## <% end %>
## END
##
... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/gems/gems/erubis-2.6.0/lib/erubis/engine.rb | gems/gems/erubis-2.6.0/lib/erubis/engine.rb | ##
## $Rev: 104 $
## $Release: 2.6.0 $
## copyright(c) 2006-2008 kuwata-lab.com all rights reserved.
##
require 'erubis/generator'
require 'erubis/converter'
require 'erubis/evaluator'
require 'erubis/context'
module Erubis
##
## (abstract) abstract engine class.
## subclass must include evaluator and conve... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/gems/gems/erubis-2.6.0/lib/erubis/error.rb | gems/gems/erubis-2.6.0/lib/erubis/error.rb | ##
## $Rev: 77 $
## $Release: 2.6.0 $
## copyright(c) 2006-2008 kuwata-lab.com all rights reserved.
##
module Erubis
##
## base error class
##
class ErubisError < StandardError
end
##
## raised when method or function is not supported
##
class NotSupportedError < ErubisError
end
end
| ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/gems/gems/erubis-2.6.0/lib/erubis/evaluator.rb | gems/gems/erubis-2.6.0/lib/erubis/evaluator.rb | ##
## $Rev: 94 $
## $Release: 2.6.0 $
## copyright(c) 2006-2008 kuwata-lab.com all rights reserved.
##
require 'erubis/error'
require 'erubis/context'
module Erubis
EMPTY_BINDING = binding()
##
## evaluate code
##
module Evaluator
def self.supported_properties # :nodoc:
return []
end
... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/gems/gems/erubis-2.6.0/lib/erubis/helpers/rails_helper.rb | gems/gems/erubis-2.6.0/lib/erubis/helpers/rails_helper.rb | ###
### $Rev: 109 $
### $Release: 2.6.0 $
### copyright(c) 2006-2008 kuwata-lab.com all rights reserved.
###
require 'erubis'
require 'erubis/preprocessing'
module Erubis
class Eruby
include ErboutEnhancer # will generate '_erbout = _buf = ""; '
end
class FastEruby
include ErboutEnhancer #... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/gems/gems/erubis-2.6.0/lib/erubis/helpers/rails_form_helper.rb | gems/gems/erubis-2.6.0/lib/erubis/helpers/rails_form_helper.rb | ###
### $Rev: 109 $
### $Release: 2.6.0 $
### copyright(c) 2006-2008 kuwata-lab.com all rights reserved.
###
module Erubis
module Helpers
module RailsFormHelper
end
end
end
module Erubis::Helpers::RailsFormHelper
if ActionPack::VERSION::MAJOR == 1 ### Rails 1.X
def pp_template_filename(basename)
... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/gems/gems/erubis-2.6.0/lib/erubis/engine/ephp.rb | gems/gems/erubis-2.6.0/lib/erubis/engine/ephp.rb | ##
## $Rev: 77 $
## $Release: 2.6.0 $
## copyright(c) 2006-2008 kuwata-lab.com all rights reserved.
##
require 'erubis/engine'
require 'erubis/enhancer'
module Erubis
module PhpGenerator
include Generator
def self.supported_properties() # :nodoc:
return []
end
def init_generator(properti... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/gems/gems/erubis-2.6.0/lib/erubis/engine/eperl.rb | gems/gems/erubis-2.6.0/lib/erubis/engine/eperl.rb | ##
## $Rev: 77 $
## $Release: 2.6.0 $
## copyright(c) 2006-2008 kuwata-lab.com all rights reserved.
##
require 'erubis/engine'
require 'erubis/enhancer'
module Erubis
module PerlGenerator
include Generator
def self.supported_properties() # :nodoc:
return [
[:func, 'print', "function... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/gems/gems/erubis-2.6.0/lib/erubis/engine/eruby.rb | gems/gems/erubis-2.6.0/lib/erubis/engine/eruby.rb | ##
## $Rev: 77 $
## $Release: 2.6.0 $
## copyright(c) 2006-2008 kuwata-lab.com all rights reserved.
##
require 'erubis/engine'
require 'erubis/enhancer'
module Erubis
##
## code generator for Ruby
##
module RubyGenerator
include Generator
#include ArrayBufferEnhancer
include StringBufferEnhance... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/gems/gems/erubis-2.6.0/lib/erubis/engine/optimized.rb | gems/gems/erubis-2.6.0/lib/erubis/engine/optimized.rb | ##
## $Rev: 77 $
## $Release: 2.6.0 $
## copyright(c) 2006-2008 kuwata-lab.com all rights reserved.
##
require 'erubis/engine/eruby'
module Erubis
module OptimizedGenerator
include Generator
def self.supported_properties() # :nodoc:
return []
end
def init_generator(properties={})
... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/gems/gems/erubis-2.6.0/lib/erubis/engine/ejava.rb | gems/gems/erubis-2.6.0/lib/erubis/engine/ejava.rb | ##
## $Rev: 77 $
## $Release: 2.6.0 $
## copyright(c) 2006-2008 kuwata-lab.com all rights reserved.
##
require 'erubis/engine'
require 'erubis/enhancer'
module Erubis
module JavaGenerator
include Generator
def self.supported_properties() # :nodoc:
return [
[:indent, '', "in... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/gems/gems/erubis-2.6.0/lib/erubis/engine/ejavascript.rb | gems/gems/erubis-2.6.0/lib/erubis/engine/ejavascript.rb | ##
## $Rev: 95 $
## $Release: 2.6.0 $
## copyright(c) 2006-2008 kuwata-lab.com all rights reserved.
##
require 'erubis/engine'
require 'erubis/enhancer'
module Erubis
module JavascriptGenerator
include Generator
def self.supported_properties() # :nodoc:
list = []
#list << [:indent, '', ... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/gems/gems/erubis-2.6.0/lib/erubis/engine/ec.rb | gems/gems/erubis-2.6.0/lib/erubis/engine/ec.rb | ##
## $Rev: 77 $
## $Release: 2.6.0 $
## copyright(c) 2006-2008 kuwata-lab.com all rights reserved.
##
require 'erubis/engine'
require 'erubis/enhancer'
module Erubis
module CGenerator
include Generator
def self.supported_properties() # :nodoc:
return [
[:indent, '', "indent s... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/gems/gems/erubis-2.6.0/lib/erubis/engine/enhanced.rb | gems/gems/erubis-2.6.0/lib/erubis/engine/enhanced.rb | ##
## $Rev: 77 $
## $Release: 2.6.0 $
## copyright(c) 2006-2008 kuwata-lab.com all rights reserved.
##
require 'erubis/enhancer'
require 'erubis/engine/eruby'
module Erubis
#--
## moved to engine/ruby.rb
#class EscapedEruby < Eruby
# include EscapeEnhancer
#end
#++
#--
### (obsolete)
#class Fa... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/gems/gems/erubis-2.6.0/lib/erubis/engine/escheme.rb | gems/gems/erubis-2.6.0/lib/erubis/engine/escheme.rb | ##
## $Rev: 77 $
## $Release: 2.6.0 $
## copyright(c) 2006-2008 kuwata-lab.com all rights reserved.
##
require 'erubis/engine'
require 'erubis/enhancer'
module Erubis
module SchemeGenerator
include Generator
def self.supported_properties() # :nodoc:
return [
[:func, '_add', "func... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/autotest/discover.rb | autotest/discover.rb | Autotest.add_discovery { "merb" }
Autotest.add_discovery { "rspec" }
| ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/autotest/merb.rb | autotest/merb.rb | # Adapted from Autotest::Rails
require 'autotest'
class Autotest::Merb < Autotest
# +model_tests_dir+:: the directory to find model-centric tests
# +controller_tests_dir+:: the directory to find controller-centric tests
# +view_tests_dir+:: the directory to find view-centric tests
# +fixtures_dir+:... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/autotest/merb_rspec.rb | autotest/merb_rspec.rb | # Adapted from Autotest::Rails, RSpec's autotest class, as well as merb-core's.
require 'autotest'
class RspecCommandError < StandardError; end
# This class maps your application's structure so Autotest can understand what
# specs to run when files change.
#
# Fixtures are _not_ covered by this class. If you change a... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/bin/common.rb | bin/common.rb | # This was added via Merb's bundler
require "rubygems"
require "rubygems/source_index"
module Gem
BUNDLED_SPECS = File.join(Dir.pwd, "gems", "specifications")
MAIN_INDEX = Gem::SourceIndex.from_gems_in(BUNDLED_SPECS)
FALLBACK_INDEX = Gem::SourceIndex.from_installed_gems
def self.source_index
MultiSourc... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/spec/user_spec_helper.rb | spec/user_spec_helper.rb | module UserHelper
def valid_user_hash
{ :login => "daniel",
:email => "daniel@example.com",
:password => "sekret",
:password_confirmation => "sekret"}
end
end
| ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/spec/spec_helper.rb | spec/spec_helper.rb | require 'rubygems'
# Add the local gems dir if found within the app root; any dependencies loaded
# hereafter will try to load from the local gems before loading system gems.
if (local_gem_dir = File.join(File.dirname(__FILE__), '..', 'gems')) && $BUNDLE.nil?
$BUNDLE = true; Gem.clear_paths; Gem.path.unshift(local_g... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/spec/helpers/articles_helper_spec.rb | spec/helpers/articles_helper_spec.rb | require File.join(File.dirname(__FILE__), "..", 'spec_helper.rb')
describe Merb::Feather::ArticlesHelper do
end
| ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/spec/helpers/admin/articles_helper_spec.rb | spec/helpers/admin/articles_helper_spec.rb | require File.join(File.dirname(__FILE__), "../..", 'spec_helper.rb')
describe Merb::Feather::Admin::ArticlesHelper do
end
| ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/spec/helpers/admin/plugins_helper_spec.rb | spec/helpers/admin/plugins_helper_spec.rb | require File.join(File.dirname(__FILE__), "../..", 'spec_helper.rb')
describe Merb::Feather::Admin::PluginsHelper do
end
| ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/spec/helpers/admin/dashboard_helper_spec.rb | spec/helpers/admin/dashboard_helper_spec.rb | require File.join(File.dirname(__FILE__), "../..", 'spec_helper.rb')
describe Merb::Feather::Admin::DashboardHelper do
end
| ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/spec/helpers/admin/configurations_helper_spec.rb | spec/helpers/admin/configurations_helper_spec.rb | require File.join(File.dirname(__FILE__), "../..", 'spec_helper.rb')
describe Merb::Feather::Admin::ConfigurationsHelper do
end
| ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/spec/controllers/articles_spec.rb | spec/controllers/articles_spec.rb | require File.join(File.dirname(__FILE__), "..", 'spec_helper.rb')
describe Feather::Articles do
before(:each) do
@article = mock(:article)
@articles = [@article]
end
describe "/" do
it "should return recent articles" do
Feather::Article.should_receive(:find_recent).and_return @articles
c... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/spec/controllers/admin/articles_spec.rb | spec/controllers/admin/articles_spec.rb | require File.join(File.dirname(__FILE__), "../..", 'spec_helper.rb')
module Feather::Admin
describe Articles do
before(:each) do
@article = mock(:article)
@articles = [@article]
end
describe "/admin/articles" do
it "should get all articles in descending created order" do
::Feat... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/spec/controllers/admin/dashboard_spec.rb | spec/controllers/admin/dashboard_spec.rb | require File.join(File.dirname(__FILE__), "../..", 'spec_helper.rb')
module Feather::Admin
describe Dashboards do
before(:each) do
@activity = [mock(:activity)]
end
describe "/admin" do
it "should request dashboard" do
::Feather::Activity.should_receive(:all).with(:order => [:created... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/spec/controllers/admin/plugins_spec.rb | spec/controllers/admin/plugins_spec.rb | require File.join(File.dirname(__FILE__), "../..", 'spec_helper.rb')
module Feather::Admin
describe Plugins do
before(:each) do
@plugin = mock(:plugin)
@plugins = [@plugin]
end
describe "/admin/plugins" do
it "should get all plugins" do
::Feather::Plugin.should_receive(:all).an... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/spec/controllers/admin/configurations_spec.rb | spec/controllers/admin/configurations_spec.rb | require File.join(File.dirname(__FILE__), "../..", 'spec_helper.rb')
module Feather::Admin
describe Configurations do
before(:each) do
@configuration = mock(:configuration)
end
describe "/admin/configurations" do
it "should get current configuration" do
::Feather::Configuration.stub!... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/spec/models/article_spec.rb | spec/models/article_spec.rb | require File.join( File.dirname(__FILE__), "..", "spec_helper" )
describe Feather::Article do
before(:all) do
@article = mock(:article)
@articles = [@article]
end
describe Feather::Article do
it 'should create a new article' do
b = Feather::Article.new
b.user_id = 1
b.t... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/lib/feather.rb | lib/feather.rb | if defined?(Merb::Plugins)
$:.unshift File.dirname(__FILE__)
$:.unshift File.join(File.dirname(__FILE__), "..", "app", "models")
$:.unshift File.join(File.dirname(__FILE__), "..", "app", "controllers")
$:.unshift File.join(File.dirname(__FILE__), "..", "app", "helpers")
dependency 'merb-slices'
Merb::Plug... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/lib/merb_auth_setup.rb | lib/merb_auth_setup.rb | module Merb
class Authentication
def store_user(user)
return nil unless user
user.id
end
def fetch_user(session_info)
::Feather::User.get(session_info)
end
end # Authentication
end
| ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/lib/feather/slicetasks.rb | lib/feather/slicetasks.rb | namespace :slices do
namespace :feather do
# add your own feather tasks here
# implement this to test for structural/code dependencies
# like certain directories or availability of other files
desc "Test for any dependencies"
task :preflight do
end
# implement this to perfo... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/lib/feather/plugin_dependencies.rb | lib/feather/plugin_dependencies.rb | # Allows you to tell a plugin it depends on another, and will load the dependency first.
# Usage: Feather::PluginDependencies::register_dependency "feather-comments" in init.rb of your plugin.
module Feather
module PluginDependencies
class << self
def register_dependency(dependency)
p = Feather::Plugin... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/lib/feather/hooks.rb | lib/feather/hooks.rb | require File.join(File.dirname(__FILE__), "hooks", "menu")
require File.join(File.dirname(__FILE__), "hooks", "view")
require File.join(File.dirname(__FILE__), "hooks", "events")
require File.join(File.dirname(__FILE__), "hooks", "formatters")
require File.join(File.dirname(__FILE__), "hooks", "routing")
module Feathe... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/lib/feather/padding.rb | lib/feather/padding.rb | module Feather
class Padding
class << self
##
# This adds 0 to the beginning of the number if it's a single digit, or just returns the number as a string if it isn't a single digit
# e.g. 7 => "07", 11 => "11"
def pad_single_digit(number)
number.to_s.length == 1 ? "0#{number}" : nu... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/lib/feather/merbtasks.rb | lib/feather/merbtasks.rb | namespace :slices do
namespace :feather do
desc "Install Feather"
task :install => [:preflight, :setup_directories, :copy_assets, :migrate]
desc "Test for any dependencies"
task :preflight do # see slicetasks.rb
end
desc "Setup directories"
task :setup_directories do
puts ... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/lib/feather/cache_helper.rb | lib/feather/cache_helper.rb | module Feather
module CacheHelper
def expire_index
expire_page(:controller => '/', :action => "index")
end
def expire_article(article)
# If an article is a draft, it will not have a published_at date to go by.
unless article.published_at.nil?
year = article.published_at.year
... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/lib/feather/spectasks.rb | lib/feather/spectasks.rb | namespace :slices do
namespace :feather do
desc "Run slice specs within the host application context"
task :spec => [ "spec:explain", "spec:default" ]
namespace :spec do
slice_root = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
task :explain do
... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/lib/feather/database.rb | lib/feather/database.rb | module Feather
module Database
class << self
CORE = [Feather::Activity, Feather::Article, Feather::Configuration, Feather::PluginSetting, Feather::User]
# This provides a helper method for data migration for plugins - we can then update this to use non-destructive migrations at a later date and e... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/lib/feather/hooks/events.rb | lib/feather/hooks/events.rb | module Feather
module Hooks
module Events
class << self
##
# Event registration
##
# This registers a block against an event
def register_event(event, &block)
@events = {} if @events.nil?
@events[event] = [] if @events[event].nil?
@event... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/lib/feather/hooks/menu.rb | lib/feather/hooks/menu.rb | module Feather
module Hooks
module Menu
class << self
##
# This adds the specified menu items for the calling plugin
def add_menu_item(text, url)
@menu_item_hooks ||= {}
raise "Unable to add menu item for unrecognized plugin! (#{Hooks::get_caller})" if (plugin = F... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/lib/feather/hooks/routing.rb | lib/feather/hooks/routing.rb | module Feather
module Hooks
module Routing
class << self
##
# Route registration
##
# This registers a routing block
def register_route(&block)
@routes = [] if @routes.nil?
@routes << block
end
##
# This calls each individ... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/lib/feather/hooks/formatters.rb | lib/feather/hooks/formatters.rb | module Feather
module Hooks
module Formatters
class << self
##
# This registers a block to format article content
def register_formatter(name, &block)
@formatters = {"default" => default_formatter} if @formatters.nil?
raise "Formatter `#{name}` already registered!... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/lib/feather/hooks/view.rb | lib/feather/hooks/view.rb | module Feather
module Hooks
module View
class << self
##
# This returns an array of the available view hooks
def available_hooks
["first_article_in_list", "last_article_in_list", "before_article", "before_article_in_list", "after_article", "after_article_in_list", "article_... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/config/rack.rb | config/rack.rb | # use PathPrefix Middleware if :path_prefix is set in Merb::Config
if prefix = ::Merb::Config[:path_prefix]
use Merb::Rack::PathPrefix, prefix
end
# comment this out if you are running merb behind a load balancer
# that serves static files
use Merb::Rack::Static, Merb.dir_for(:public)
# this is our main merb applic... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/config/router.rb | config/router.rb | # Merb::Router is the request routing mapper for the merb framework.
#
# You can route a specific URL to a controller / action pair:
#
# match("/contact").
# to(:controller => "info", :action => "contact")
#
# You can define placeholder parts of the url with the :symbol notation. These
# placeholders will be avai... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/config/dependencies.rb | config/dependencies.rb | # dependencies are generated using a strict version, don't forget to edit the dependency versions when upgrading.
merb_gems_version = "1.0.11"
dm_gems_version = "0.9.11"
do_gems_version = "0.9.11"
dependency "merb-core", merb_gems_version
dependency "merb-action-args", merb_gems_version
dependency "merb-assets", m... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/config/init.rb | config/init.rb | require 'config/dependencies.rb'
use_orm :datamapper
use_test :rspec
use_template_engine :erb
# Make the app's "gems" directory a place where gems are loaded from
Gem.clear_paths
Gem.path.unshift(Merb.root / "gems")
# Make the app's "lib" directory a place where ruby files get "require"d from
$LOAD_PATH.unshift(Merb... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/config/environments/test.rb | config/environments/test.rb | Merb.logger.info("Loaded TEST Environment...")
Merb::Config.use { |c|
c[:testing] = true
c[:exception_details] = true
c[:log_auto_flush ] = true
# log less in testing environment
c[:log_level] = :error
c[:log_file] = Merb.root / "log" / "test.log"
# or redirect logger using IO handle... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/config/environments/development.rb | config/environments/development.rb | Merb.logger.info("Loaded DEVELOPMENT Environment...")
Merb::Config.use { |c|
c[:exception_details] = true
c[:reload_templates] = true
c[:reload_classes] = true
c[:reload_time] = 0.5
c[:ignore_tampered_cookies] = true
c[:log_auto_flush ] = true
c[:log_level] = :debug
c[:log_stream] = STDOUT
c[:log_fil... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/config/environments/staging.rb | config/environments/staging.rb | Merb.logger.info("Loaded STAGING Environment...")
Merb::Config.use { |c|
c[:exception_details] = false
c[:reload_classes] = false
c[:log_level] = :error
c[:log_file] = Merb.root / "log" / "staging.log"
# or redirect logger using IO handle
# c[:log_stream] = STDOUT
}
| ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/config/environments/production.rb | config/environments/production.rb | Merb.logger.info("Loaded PRODUCTION Environment...")
Merb::Config.use { |c|
c[:exception_details] = false
c[:reload_classes] = false
c[:log_level] = :error
c[:log_file] = Merb.root / "log" / "production.log"
# or redirect logger using IO handle
# c[:log_stream] = STDOUT
}
| ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/config/environments/rake.rb | config/environments/rake.rb | Merb.logger.info("Loaded RAKE Environment...")
Merb::Config.use { |c|
c[:exception_details] = true
c[:reload_classes] = false
c[:log_auto_flush ] = true
c[:log_stream] = STDOUT
c[:log_file] = nil
# Or redirect logging into a file:
# c[:log_file] = Merb.root / "log" / "development.log"
}
| ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/doc/rdoc/generators/merb_generator.rb | doc/rdoc/generators/merb_generator.rb |
# # We're responsible for generating all the HTML files
# from the object tree defined in code_objects.rb. We
# generate:
#
# [files] an html file for each input file given. These
# input files appear as objects of class
# TopLevel
#
# [classes] an html file for each class or module encountered.
... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | true |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/doc/rdoc/generators/template/merb/merb.rb | doc/rdoc/generators/template/merb/merb.rb | module RDoc
module Page
STYLE = File.read(File.join(File.dirname(__FILE__), 'merb_doc_styles.css'))
FONTS = ""
###################################################################
CLASS_PAGE = <<HTML
<div id="%class_seq%">
<div class='banner'>
<span class="file-title-prefix">%classmod%</span><br />%full_name%<br/>
... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/merb/session/session.rb | merb/session/session.rb | module Merb
module Session
# The Merb::Session module gets mixed into Merb::SessionContainer to allow
# app-level functionality; it will be included and methods will be available
# through request.session as instance methods.
end
end
| ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/merb/merb-auth/strategies.rb | merb/merb-auth/strategies.rb | # This file is specifically for you to define your strategies
#
# You should declare you strategies directly and/or use
# Merb::Authentication.activate!(:label_of_strategy)
#
# To load and set the order of strategy processing
Merb::Slices::config[:"merb-auth-slice-password"][:no_default_strategies] = true
Merb::Authe... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
mleung/feather | https://github.com/mleung/feather/blob/8039b8a99883597deeb3d03f67216755f101f667/merb/merb-auth/setup.rb | merb/merb-auth/setup.rb | # This file is specifically setup for use with the merb-auth plugin.
# This file should be used to setup and configure your authentication stack.
# It is not required and may safely be deleted.
#
# To change the parameter names for the password or login field you may set either of these two options
#
# Merb::Plugins.co... | ruby | MIT | 8039b8a99883597deeb3d03f67216755f101f667 | 2026-01-04T17:49:41.524706Z | false |
rubocop/rubocop-ast | https://github.com/rubocop/rubocop-ast/blob/69036498c11ca944c6099d1b672ba408f34a3eb4/tasks/changelog.rb | tasks/changelog.rb | # frozen_string_literal: true
# Changelog utility
class Changelog # rubocop:disable Metrics/ClassLength
ENTRIES_PATH = 'changelog/'
FIRST_HEADER = /#{Regexp.escape("## master (unreleased)\n")}/m.freeze
ENTRIES_PATH_TEMPLATE = "#{ENTRIES_PATH}%<type>s_%<name>s.md"
TYPE_REGEXP = /#{Regexp.escape(ENTRIES_PATH)}([... | ruby | MIT | 69036498c11ca944c6099d1b672ba408f34a3eb4 | 2026-01-04T17:49:41.556809Z | false |
rubocop/rubocop-ast | https://github.com/rubocop/rubocop-ast/blob/69036498c11ca944c6099d1b672ba408f34a3eb4/spec/spec_helper.rb | spec/spec_helper.rb | # frozen_string_literal: true
require 'yaml'
$VERBOSE = true
if ENV.fetch('COVERAGE', 'f').start_with? 't'
require 'simplecov'
SimpleCov.start
end
ENV['RUBOCOP_DEBUG'] = 't'
require 'rubocop-ast'
if ENV['MODERNIZE']
RuboCop::AST::Builder.modernize
RuboCop::AST::Builder.emit_forward_arg = false # inverse of ... | ruby | MIT | 69036498c11ca944c6099d1b672ba408f34a3eb4 | 2026-01-04T17:49:41.556809Z | false |
rubocop/rubocop-ast | https://github.com/rubocop/rubocop-ast/blob/69036498c11ca944c6099d1b672ba408f34a3eb4/spec/tasks/changelog_spec.rb | spec/tasks/changelog_spec.rb | # frozen_string_literal: true
require_relative '../../tasks/changelog'
RSpec.describe Changelog do
subject(:changelog) do
list = entries.to_h { |e| [e.path, e.content] }
described_class.new(content: <<~CHANGELOG, entries: list)
# Change log
## master (unreleased)
### New features
... | ruby | MIT | 69036498c11ca944c6099d1b672ba408f34a3eb4 | 2026-01-04T17:49:41.556809Z | false |
rubocop/rubocop-ast | https://github.com/rubocop/rubocop-ast/blob/69036498c11ca944c6099d1b672ba408f34a3eb4/spec/rubocop/simple_forwardable_spec.rb | spec/rubocop/simple_forwardable_spec.rb | # frozen_string_literal: true
RSpec.describe RuboCop::SimpleForwardable do
let(:delegator) do
Class.new do
attr_reader :target
def initialize
@target = Struct.new(:foo).new
end
extend RuboCop::SimpleForwardable
def_delegators :target, :foo=, :foo
end
end
it 'corr... | ruby | MIT | 69036498c11ca944c6099d1b672ba408f34a3eb4 | 2026-01-04T17:49:41.556809Z | false |
rubocop/rubocop-ast | https://github.com/rubocop/rubocop-ast/blob/69036498c11ca944c6099d1b672ba408f34a3eb4/spec/rubocop/ast/rescue_node_spec.rb | spec/rubocop/ast/rescue_node_spec.rb | # frozen_string_literal: true
RSpec.describe RuboCop::AST::RescueNode do
subject(:ast) { parse_source(source).ast }
let(:rescue_node) { ast.children.first }
describe '.new' do
let(:source) { <<~RUBY }
begin
rescue => e
end
RUBY
it { expect(rescue_node).to be_a(described_class) }
... | ruby | MIT | 69036498c11ca944c6099d1b672ba408f34a3eb4 | 2026-01-04T17:49:41.556809Z | false |
rubocop/rubocop-ast | https://github.com/rubocop/rubocop-ast/blob/69036498c11ca944c6099d1b672ba408f34a3eb4/spec/rubocop/ast/range_node_spec.rb | spec/rubocop/ast/range_node_spec.rb | # frozen_string_literal: true
RSpec.describe RuboCop::AST::RangeNode do
subject(:range_node) { parse_source(source).ast }
describe '.new' do
context 'with an inclusive range' do
let(:source) do
'1..2'
end
it { is_expected.to be_a(described_class) }
it { is_expected.to be_range... | ruby | MIT | 69036498c11ca944c6099d1b672ba408f34a3eb4 | 2026-01-04T17:49:41.556809Z | false |
rubocop/rubocop-ast | https://github.com/rubocop/rubocop-ast/blob/69036498c11ca944c6099d1b672ba408f34a3eb4/spec/rubocop/ast/and_asgn_node_spec.rb | spec/rubocop/ast/and_asgn_node_spec.rb | # frozen_string_literal: true
RSpec.describe RuboCop::AST::AndAsgnNode do
let(:or_asgn_node) { parse_source(source).ast }
let(:source) { 'var &&= value' }
describe '.new' do
it { expect(or_asgn_node).to be_a(described_class) }
end
describe '#assignment_node' do
subject { or_asgn_node.assignment_nod... | ruby | MIT | 69036498c11ca944c6099d1b672ba408f34a3eb4 | 2026-01-04T17:49:41.556809Z | false |
rubocop/rubocop-ast | https://github.com/rubocop/rubocop-ast/blob/69036498c11ca944c6099d1b672ba408f34a3eb4/spec/rubocop/ast/until_node_spec.rb | spec/rubocop/ast/until_node_spec.rb | # frozen_string_literal: true
RSpec.describe RuboCop::AST::UntilNode do
subject(:until_node) { parse_source(source).ast }
describe '.new' do
context 'with a statement until' do
let(:source) { 'until foo; bar; end' }
it { is_expected.to be_a(described_class) }
end
context 'with a modifier... | ruby | MIT | 69036498c11ca944c6099d1b672ba408f34a3eb4 | 2026-01-04T17:49:41.556809Z | false |
rubocop/rubocop-ast | https://github.com/rubocop/rubocop-ast/blob/69036498c11ca944c6099d1b672ba408f34a3eb4/spec/rubocop/ast/in_pattern_node_spec.rb | spec/rubocop/ast/in_pattern_node_spec.rb | # frozen_string_literal: true
RSpec.describe RuboCop::AST::InPatternNode do
context 'when using Ruby 2.7 or newer', :ruby27 do
let(:in_pattern_node) { parse_source(source).ast.children[1] }
describe '.new' do
let(:source) do
['case condition',
'in [42] then foo',
'end'].join(... | ruby | MIT | 69036498c11ca944c6099d1b672ba408f34a3eb4 | 2026-01-04T17:49:41.556809Z | false |
rubocop/rubocop-ast | https://github.com/rubocop/rubocop-ast/blob/69036498c11ca944c6099d1b672ba408f34a3eb4/spec/rubocop/ast/keyword_begin_node_spec.rb | spec/rubocop/ast/keyword_begin_node_spec.rb | # frozen_string_literal: true
RSpec.describe RuboCop::AST::KeywordBeginNode do
let(:parsed_source) { parse_source(source) }
let(:kwbegin_node) { parsed_source.ast }
describe '.new' do
let(:source) do
<<~RUBY
begin
foo
end
RUBY
end
it { expect(kwbegin_node).to b... | ruby | MIT | 69036498c11ca944c6099d1b672ba408f34a3eb4 | 2026-01-04T17:49:41.556809Z | false |
rubocop/rubocop-ast | https://github.com/rubocop/rubocop-ast/blob/69036498c11ca944c6099d1b672ba408f34a3eb4/spec/rubocop/ast/when_node_spec.rb | spec/rubocop/ast/when_node_spec.rb | # frozen_string_literal: true
RSpec.describe RuboCop::AST::WhenNode do
let(:when_node) { parse_source(source).ast.children[1] }
describe '.new' do
let(:source) do
['case',
'when :foo then bar',
'end'].join("\n")
end
it { expect(when_node).to be_a(described_class) }
end
descri... | ruby | MIT | 69036498c11ca944c6099d1b672ba408f34a3eb4 | 2026-01-04T17:49:41.556809Z | false |
rubocop/rubocop-ast | https://github.com/rubocop/rubocop-ast/blob/69036498c11ca944c6099d1b672ba408f34a3eb4/spec/rubocop/ast/or_asgn_node_spec.rb | spec/rubocop/ast/or_asgn_node_spec.rb | # frozen_string_literal: true
RSpec.describe RuboCop::AST::OrAsgnNode do
let(:or_asgn_node) { parse_source(source).ast }
let(:source) { 'var ||= value' }
describe '.new' do
it { expect(or_asgn_node).to be_a(described_class) }
end
describe '#assignment_node' do
subject { or_asgn_node.assignment_node... | ruby | MIT | 69036498c11ca944c6099d1b672ba408f34a3eb4 | 2026-01-04T17:49:41.556809Z | false |
rubocop/rubocop-ast | https://github.com/rubocop/rubocop-ast/blob/69036498c11ca944c6099d1b672ba408f34a3eb4/spec/rubocop/ast/for_node_spec.rb | spec/rubocop/ast/for_node_spec.rb | # frozen_string_literal: true
RSpec.describe RuboCop::AST::ForNode do
subject(:for_node) { parse_source(source).ast }
describe '.new' do
let(:source) { 'for foo in bar; baz; end' }
it { is_expected.to be_a(described_class) }
end
describe '#keyword' do
let(:source) { 'for foo in bar; baz; end' }
... | ruby | MIT | 69036498c11ca944c6099d1b672ba408f34a3eb4 | 2026-01-04T17:49:41.556809Z | false |
rubocop/rubocop-ast | https://github.com/rubocop/rubocop-ast/blob/69036498c11ca944c6099d1b672ba408f34a3eb4/spec/rubocop/ast/str_node_spec.rb | spec/rubocop/ast/str_node_spec.rb | # frozen_string_literal: true
RSpec.describe RuboCop::AST::StrNode do
subject(:str_node) { parsed_source.ast }
let(:parsed_source) { parse_source(source) }
describe '.new' do
context 'with a normal string' do
let(:source) { "'foo'" }
it { is_expected.to be_a(described_class) }
end
con... | ruby | MIT | 69036498c11ca944c6099d1b672ba408f34a3eb4 | 2026-01-04T17:49:41.556809Z | false |
rubocop/rubocop-ast | https://github.com/rubocop/rubocop-ast/blob/69036498c11ca944c6099d1b672ba408f34a3eb4/spec/rubocop/ast/token_spec.rb | spec/rubocop/ast/token_spec.rb | # frozen_string_literal: true
RSpec.describe RuboCop::AST::Token do
let(:processed_source) { parse_source(source) }
let(:source) { <<~RUBY }
# comment
def some_method
[ 1, 2 ];
foo[0] = 3.to_i
1..42
1...42
end
RUBY
let(:first_token) { processed_source.tokens.first }
let(... | ruby | MIT | 69036498c11ca944c6099d1b672ba408f34a3eb4 | 2026-01-04T17:49:41.556809Z | false |
rubocop/rubocop-ast | https://github.com/rubocop/rubocop-ast/blob/69036498c11ca944c6099d1b672ba408f34a3eb4/spec/rubocop/ast/wrapped_arguments_node.rb | spec/rubocop/ast/wrapped_arguments_node.rb | # frozen_string_literal: true
RSpec.shared_examples 'wrapped arguments node' do |keyword|
subject(:return_node) { parse_source(source).ast.body }
describe '.new' do
context 'without arguments' do
let(:source) { "x { #{keyword} }" }
it { is_expected.to be_a(described_class) }
end
context ... | ruby | MIT | 69036498c11ca944c6099d1b672ba408f34a3eb4 | 2026-01-04T17:49:41.556809Z | false |
rubocop/rubocop-ast | https://github.com/rubocop/rubocop-ast/blob/69036498c11ca944c6099d1b672ba408f34a3eb4/spec/rubocop/ast/self_class_node_spec.rb | spec/rubocop/ast/self_class_node_spec.rb | # frozen_string_literal: true
RSpec.describe RuboCop::AST::SelfClassNode do
subject(:self_class_node) { parse_source(source).ast }
describe '.new' do
let(:source) do
'class << self; end'
end
it { is_expected.to be_a(described_class) }
end
describe '#identifier' do
let(:source) do
... | ruby | MIT | 69036498c11ca944c6099d1b672ba408f34a3eb4 | 2026-01-04T17:49:41.556809Z | false |
rubocop/rubocop-ast | https://github.com/rubocop/rubocop-ast/blob/69036498c11ca944c6099d1b672ba408f34a3eb4/spec/rubocop/ast/rational_node_spec.rb | spec/rubocop/ast/rational_node_spec.rb | # frozen_string_literal: true
RSpec.describe RuboCop::AST::RationalNode do
subject(:rational_node) { parse_source(source).ast }
describe '.new' do
let(:source) { '0.2r' }
it { is_expected.to be_a(described_class) }
end
describe '#sign?' do
subject { rational_node.sign? }
context 'when expli... | ruby | MIT | 69036498c11ca944c6099d1b672ba408f34a3eb4 | 2026-01-04T17:49:41.556809Z | false |
rubocop/rubocop-ast | https://github.com/rubocop/rubocop-ast/blob/69036498c11ca944c6099d1b672ba408f34a3eb4/spec/rubocop/ast/if_node_spec.rb | spec/rubocop/ast/if_node_spec.rb | # frozen_string_literal: true
RSpec.describe RuboCop::AST::IfNode do
subject(:if_node) { parse_source(source).ast }
describe '.new' do
context 'with a regular if statement' do
let(:source) { 'if foo?; :bar; end' }
it { is_expected.to be_a(described_class) }
end
context 'with a ternary op... | ruby | MIT | 69036498c11ca944c6099d1b672ba408f34a3eb4 | 2026-01-04T17:49:41.556809Z | false |
rubocop/rubocop-ast | https://github.com/rubocop/rubocop-ast/blob/69036498c11ca944c6099d1b672ba408f34a3eb4/spec/rubocop/ast/masgn_node_spec.rb | spec/rubocop/ast/masgn_node_spec.rb | # frozen_string_literal: true
RSpec.describe RuboCop::AST::MasgnNode do
let(:masgn_node) { parse_source(source).ast }
let(:source) { 'x, y = z' }
describe '.new' do
context 'with a `masgn` node' do
it { expect(masgn_node).to be_a(described_class) }
end
end
describe '#names' do
subject { m... | ruby | MIT | 69036498c11ca944c6099d1b672ba408f34a3eb4 | 2026-01-04T17:49:41.556809Z | false |
rubocop/rubocop-ast | https://github.com/rubocop/rubocop-ast/blob/69036498c11ca944c6099d1b672ba408f34a3eb4/spec/rubocop/ast/alias_node_spec.rb | spec/rubocop/ast/alias_node_spec.rb | # frozen_string_literal: true
RSpec.describe RuboCop::AST::AliasNode do
subject(:alias_node) { parse_source(source).ast }
describe '.new' do
let(:source) do
'alias foo bar'
end
it { is_expected.to be_a(described_class) }
end
describe '#new_identifier' do
let(:source) do
'alias fo... | ruby | MIT | 69036498c11ca944c6099d1b672ba408f34a3eb4 | 2026-01-04T17:49:41.556809Z | false |
rubocop/rubocop-ast | https://github.com/rubocop/rubocop-ast/blob/69036498c11ca944c6099d1b672ba408f34a3eb4/spec/rubocop/ast/arg_node_spec.rb | spec/rubocop/ast/arg_node_spec.rb | # frozen_string_literal: true
RSpec.describe RuboCop::AST::ArgNode do
let(:args_node) { parse_source(source).ast.arguments }
let(:arg_node) { args_node.first }
describe '.new' do
context 'with a method definition' do
let(:source) { 'def foo(x) end' }
it { expect(arg_node).to be_a(described_clas... | ruby | MIT | 69036498c11ca944c6099d1b672ba408f34a3eb4 | 2026-01-04T17:49:41.556809Z | false |
rubocop/rubocop-ast | https://github.com/rubocop/rubocop-ast/blob/69036498c11ca944c6099d1b672ba408f34a3eb4/spec/rubocop/ast/def_node_spec.rb | spec/rubocop/ast/def_node_spec.rb | # frozen_string_literal: true
RSpec.describe RuboCop::AST::DefNode do
subject(:def_node) { parse_source(source).ast }
describe '.new' do
context 'with a def node' do
let(:source) { 'def foo(bar); end' }
it { is_expected.to be_a(described_class) }
end
context 'with a defs node' do
l... | ruby | MIT | 69036498c11ca944c6099d1b672ba408f34a3eb4 | 2026-01-04T17:49:41.556809Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.