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 |
|---|---|---|---|---|---|---|---|---|
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/test/spec/net/authorization_spec.rb | test/spec/net/authorization_spec.rb | describe Net::Authorization do
context "Invalid params" do
it "expects valid token or basic params" do
Proc.new { Net::Authorization.new }.should.raise? RuntimeError
end
end
context "Basic authorization" do
before do
@subject = Net::Authorization.new(username: "foo", password: "bar")
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/test/spec/net/session_spec.rb | test/spec/net/session_spec.rb | describe Net::Session do
before do
@subject = Net::Session.build("www.example.com") do
header(:content_type, :json)
authorize(token: "xxxx")
end
end
it ".headers" do
@subject.headers.should == {"Content-Type" => "application/json"}
end
it ".authorization" do
@subject.authorizatio... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/test/spec/net/config_spec.rb | test/spec/net/config_spec.rb | describe Net::Config do
it "can set connect_timeout" do
Net::Config.connect_timeout = 10
Net::Config.connect_timeout.should == 10
end
it "has a default connect_timeout" do
Net::Config.connect_timeout = nil
Net::Config.connect_timeout.should == 30
end
it "can set read_timeout" do
Net::Con... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/test/spec/ui/view.rb | test/spec/ui/view.rb | describe UI::View do
context "#hidden=(hidden)" do
it "should set size to [0, 0]" do
view = UI::View.new
view.width = 100
view.height = 100
view.hidden = true
view.width.should == 0
view.height.should == 0
end
it "should restore previous size" do
view = UI::View.... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/test/spec/ui/color_spec.rb | test/spec/ui/color_spec.rb | describe UI::Color do
context "#() protocol conversion" do
it "should convert a String with a #" do
UI::Color("#00F").to_a.should == [0, 0, 255, 255]
end
it "should convert a String without a #" do
UI::Color("00F").to_a.should == [0, 0, 255, 255]
end
it "should convert a String witho... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/test/spec/ui/label.rb | test/spec/ui/label.rb | describe UI::Label do
describe "#measure" do
context "when text is nil" do
it "returns [0, 0]" do
label = UI::Label.new
label.text = nil
w = h = 500.0
label.measure(w,h).should == [0,0]
end
end
context "when text is empty" do
it "returns [0, 0]" do
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/test/config/ios.rb | test/config/ios.rb | # -*- coding: utf-8 -*-
Motion::Project::App.setup do |app|
# Use `rake ios:config' to see complete project settings.
app.name = 'test'
app.info_plist['NSAppTransportSecurity'] = { 'NSAllowsArbitraryLoads' => true }
app.info_plist['NSLocationWhenInUseUsageDescription'] = "Required to test location services"
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/test/config/osx.rb | test/config/osx.rb | # -*- coding: utf-8 -*-
Motion::Project::App.setup do |app|
# Use `rake ios:config' to see complete project settings.
app.name = 'test'
app.info_plist['NSAppTransportSecurity'] = { 'NSAllowsArbitraryLoads' => true }
end
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/test/config/android.rb | test/config/android.rb | # -*- coding: utf-8 -*-
Motion::Project::App.setup do |app|
# Use `rake android:config' to see complete project settings.
app.name = 'test'
app.archs = ['x86']
app.api_version = '23'
app.vm_debug_logs = true
app.permissions = ["android.permission.INTERNET", "android.permission.ACCESS_NETWORK_STATE", "andro... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/lib/common.rb | lib/common.rb | FLOW_COMPONENTS = %w{net json digest store base64 location task ui}
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/lib/motion-flow.rb | lib/motion-flow.rb | if defined?(Motion::Project::App)
# iOS or Android project.
dirname = File.dirname(__FILE__)
case Motion::Project::App.template
when :android
require "#{dirname}/android.rb"
when :ios, :tvos, :osx, :'ios-extension'
require "#{dirname}/cocoa.rb"
else
raise "Project template #{Motion::... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/lib/android.rb | lib/android.rb | require File.join(File.dirname(__FILE__), 'common.rb')
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project/template/android'
require 'motion-gradle'
Motion::Project::App.setup do |app|
app.api_version = '23' unless Motion::Project::Config.starter?
app.build_dir = 'build/android'
app.assets_dirs << 're... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/lib/cocoa.rb | lib/cocoa.rb | require File.join(File.dirname(__FILE__), 'common.rb')
$:.unshift("/Library/RubyMotion/lib")
template = ENV['template'] || 'ios'
require "motion/project/template/#{template}"
Motion::Project::App.setup do |app|
app.build_dir = "build/#{template}"
app.deployment_target = '7.0' if template == :ios && !Motion::Proje... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/lib/motion-flow/task.rb | lib/motion-flow/task.rb | require_relative 'loader'
Motion::Flow.load_library 'task'
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/lib/motion-flow/ui.rb | lib/motion-flow/ui.rb | require_relative 'loader'
# Load Dependencies
require_relative 'task'
Motion::Flow.load_library 'ui' do |app|
app.custom_init_funcs << 'Init_CSSNode'
end
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/lib/motion-flow/digest.rb | lib/motion-flow/digest.rb | require_relative 'loader'
Motion::Flow.load_library 'digest'
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/lib/motion-flow/loader.rb | lib/motion-flow/loader.rb | $:.unshift("/Library/RubyMotion/lib")
module Motion
class Flow
def self.load_library(lib_name)
lib_dir = File.join(File.dirname(__FILE__), '../../flow', lib_name)
case Motion::Project::App.template
when :android
platform = 'android'
when :ios, :tvos, :osx, :'ios-extension'
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/lib/motion-flow/store.rb | lib/motion-flow/store.rb | require_relative 'loader'
# Load Dependencies
require_relative 'json'
Motion::Flow.load_library 'store'
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/lib/motion-flow/json.rb | lib/motion-flow/json.rb | require_relative 'loader'
Motion::Flow.load_library 'json'
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/lib/motion-flow/location.rb | lib/motion-flow/location.rb | require_relative 'loader'
Motion::Flow.load_library 'location'
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/lib/motion-flow/base64.rb | lib/motion-flow/base64.rb | require_relative 'loader'
Motion::Flow.load_library 'base64'
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/lib/motion-flow/net.rb | lib/motion-flow/net.rb | require_relative 'loader'
# Load Dependencies
require_relative 'base64'
require_relative 'json'
require_relative 'task'
Motion::Flow.load_library 'net'
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/template/flow/files/app/android/main_activity.rb | template/flow/files/app/android/main_activity.rb | class MainActivity < Android::App::Activity
def onCreate(savedInstanceState)
Store.context = self
super
end
end
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/template/flow/files/app/ios/app_delegate.rb | template/flow/files/app/ios/app_delegate.rb | class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
rootViewController = UIViewController.alloc.init
rootViewController.title = 'testios'
rootViewController.view.backgroundColor = UIColor.whiteColor
navigationController = UINavigationController.alloc.initWithRo... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
patrickdavey/vimwiki_markdown | https://github.com/patrickdavey/vimwiki_markdown/blob/cd15e729489cc20cb1344c51a3a6e050b6a238c4/spec/spec_helper.rb | spec/spec_helper.rb | require 'bundler/setup'
require 'pry'
require 'rspec/its'
require 'vimwiki_markdown'
RSpec.configure do |config|
# rspec-expectations config goes here. You can use an alternate
# assertion/expectation library such as wrong or the stdlib/minitest
# assertions if you prefer.
config.expect_with :rspec do |expecta... | ruby | MIT | cd15e729489cc20cb1344c51a3a6e050b6a238c4 | 2026-01-04T17:39:56.697492Z | false |
patrickdavey/vimwiki_markdown | https://github.com/patrickdavey/vimwiki_markdown/blob/cd15e729489cc20cb1344c51a3a6e050b6a238c4/spec/lib/vimwiki_markdown/vimwiki_link_spec.rb | spec/lib/vimwiki_markdown/vimwiki_link_spec.rb | require "spec_helper"
module VimwikiMarkdown
describe VimwikiLink do
let(:markdown_extension) { ".md" }
let(:root_path) { "-" }
context "external or fragment only" do
let(:markdown_link) { "[title](http://www.google.com)" }
let(:source_filepath) { "unimportant" }
let(:output_dir) { "un... | ruby | MIT | cd15e729489cc20cb1344c51a3a6e050b6a238c4 | 2026-01-04T17:39:56.697492Z | false |
patrickdavey/vimwiki_markdown | https://github.com/patrickdavey/vimwiki_markdown/blob/cd15e729489cc20cb1344c51a3a6e050b6a238c4/spec/lib/vimwiki_markdown/template_spec.rb | spec/lib/vimwiki_markdown/template_spec.rb | require 'spec_helper'
require 'vimwiki_markdown/options'
require 'vimwiki_markdown/template'
require 'vimwiki_markdown/exceptions'
require 'rspec-html-matchers'
require 'date'
module VimwikiMarkdown
describe Template do
let(:options) { Options.new }
context "template" do
subject { Template.new(option... | ruby | MIT | cd15e729489cc20cb1344c51a3a6e050b6a238c4 | 2026-01-04T17:39:56.697492Z | false |
patrickdavey/vimwiki_markdown | https://github.com/patrickdavey/vimwiki_markdown/blob/cd15e729489cc20cb1344c51a3a6e050b6a238c4/spec/lib/vimwiki_markdown/wiki_body_spec.rb | spec/lib/vimwiki_markdown/wiki_body_spec.rb | require 'spec_helper'
require 'vimwiki_markdown/options'
require 'vimwiki_markdown/wiki_body'
require 'rspec-html-matchers'
module VimwikiMarkdown
describe WikiBody do
let(:wiki_body) { WikiBody.new(double(:options, input_file: 'blah', extension: 'md', root_path: '-', output_dir: ".")) }
let(:markdown_file_... | ruby | MIT | cd15e729489cc20cb1344c51a3a6e050b6a238c4 | 2026-01-04T17:39:56.697492Z | false |
patrickdavey/vimwiki_markdown | https://github.com/patrickdavey/vimwiki_markdown/blob/cd15e729489cc20cb1344c51a3a6e050b6a238c4/spec/lib/vimwiki_markdown/options_spec.rb | spec/lib/vimwiki_markdown/options_spec.rb | require 'spec_helper'
require 'vimwiki_markdown/options'
module VimwikiMarkdown
describe Options do
subject { Options.new }
context "no options passed" do
before do
allow(Options).to receive(:arguments).and_return(Options::DEFAULTS)
end
its(:force) { should be(true) }
its(:s... | ruby | MIT | cd15e729489cc20cb1344c51a3a6e050b6a238c4 | 2026-01-04T17:39:56.697492Z | false |
patrickdavey/vimwiki_markdown | https://github.com/patrickdavey/vimwiki_markdown/blob/cd15e729489cc20cb1344c51a3a6e050b6a238c4/lib/vimwiki_markdown.rb | lib/vimwiki_markdown.rb | require "vimwiki_markdown/version"
require "vimwiki_markdown/options"
require "vimwiki_markdown/template"
require "vimwiki_markdown/vimwiki_link"
require "vimwiki_markdown/wiki_body"
require "vimwiki_markdown/exceptions"
module VimwikiMarkdown
def self.convert_wikimarkdown_to_html
::I18n.enforce_available_locale... | ruby | MIT | cd15e729489cc20cb1344c51a3a6e050b6a238c4 | 2026-01-04T17:39:56.697492Z | false |
patrickdavey/vimwiki_markdown | https://github.com/patrickdavey/vimwiki_markdown/blob/cd15e729489cc20cb1344c51a3a6e050b6a238c4/lib/vimwiki_markdown/wiki_body.rb | lib/vimwiki_markdown/wiki_body.rb | require 'active_support/inflector'
require 'github/markup'
require 'html/pipeline'
require 'pathname'
require "vimwiki_markdown/vimwiki_link"
require "vimwiki_markdown/vimwiki_toc_filter"
class VimwikiMarkdown::WikiBody
def initialize(options)
@options = options
end
def to_s
hack_replace_commonmarker_p... | ruby | MIT | cd15e729489cc20cb1344c51a3a6e050b6a238c4 | 2026-01-04T17:39:56.697492Z | false |
patrickdavey/vimwiki_markdown | https://github.com/patrickdavey/vimwiki_markdown/blob/cd15e729489cc20cb1344c51a3a6e050b6a238c4/lib/vimwiki_markdown/version.rb | lib/vimwiki_markdown/version.rb | module VimwikiMarkdown
VERSION = "0.9.3".freeze
end
| ruby | MIT | cd15e729489cc20cb1344c51a3a6e050b6a238c4 | 2026-01-04T17:39:56.697492Z | false |
patrickdavey/vimwiki_markdown | https://github.com/patrickdavey/vimwiki_markdown/blob/cd15e729489cc20cb1344c51a3a6e050b6a238c4/lib/vimwiki_markdown/exceptions.rb | lib/vimwiki_markdown/exceptions.rb | module VimwikiMarkdown
class MissingRequiredParamError < StandardError
end
end
| ruby | MIT | cd15e729489cc20cb1344c51a3a6e050b6a238c4 | 2026-01-04T17:39:56.697492Z | false |
patrickdavey/vimwiki_markdown | https://github.com/patrickdavey/vimwiki_markdown/blob/cd15e729489cc20cb1344c51a3a6e050b6a238c4/lib/vimwiki_markdown/options.rb | lib/vimwiki_markdown/options.rb | require 'active_support/inflector'
module VimwikiMarkdown
class Options
DEFAULTS = ["1", #force - 1/0
"markdown",
"md",
"~/vimwiki/site_html/",
"~/vimwiki/index.md",
"~/vimwiki/site_html/style.css",
"~/vimwiki/t... | ruby | MIT | cd15e729489cc20cb1344c51a3a6e050b6a238c4 | 2026-01-04T17:39:56.697492Z | false |
patrickdavey/vimwiki_markdown | https://github.com/patrickdavey/vimwiki_markdown/blob/cd15e729489cc20cb1344c51a3a6e050b6a238c4/lib/vimwiki_markdown/vimwiki_toc_filter.rb | lib/vimwiki_markdown/vimwiki_toc_filter.rb | require "cgi"
class VimwikiTOCFilter < HTML::Pipeline::TableOfContentsFilter
def call
result[:toc] = String.new('')
headers = Hash.new(1)
doc.css('h1, h2, h3, h4, h5, h6').each do |node|
text = node.text
id = ascii_downcase(text)
id.gsub!(PUNCTUATION_REGEXP, '') # remove punctuation
... | ruby | MIT | cd15e729489cc20cb1344c51a3a6e050b6a238c4 | 2026-01-04T17:39:56.697492Z | false |
patrickdavey/vimwiki_markdown | https://github.com/patrickdavey/vimwiki_markdown/blob/cd15e729489cc20cb1344c51a3a6e050b6a238c4/lib/vimwiki_markdown/template.rb | lib/vimwiki_markdown/template.rb | require 'rouge'
require 'date'
module VimwikiMarkdown
class Template
def initialize(options)
@options = options
get_template_contents
validate_template
end
def to_s
fixtags(template)
end
private
attr_reader :options, :template
def get_template_contents
... | ruby | MIT | cd15e729489cc20cb1344c51a3a6e050b6a238c4 | 2026-01-04T17:39:56.697492Z | false |
patrickdavey/vimwiki_markdown | https://github.com/patrickdavey/vimwiki_markdown/blob/cd15e729489cc20cb1344c51a3a6e050b6a238c4/lib/vimwiki_markdown/vimwiki_link.rb | lib/vimwiki_markdown/vimwiki_link.rb | # This class takes in a string of a markdown link and spits out
# a correctly formed markdown link, with absolute and relative
# links to markdown files correctly altered.
#
# The main thing we're working around is that markdown files can
# be linked to with (or without) an extension. That and we're also
# rewiring the... | ruby | MIT | cd15e729489cc20cb1344c51a3a6e050b6a238c4 | 2026-01-04T17:39:56.697492Z | false |
ianwhite/nested_has_many_through | https://github.com/ianwhite/nested_has_many_through/blob/cfe4b60adba8631df60df865d28923474e2cd442/garlic.rb | garlic.rb | garlic do
repo 'nested_has_many_through', :path => '.'
repo 'rails', :url => 'git://github.com/rails/rails'
repo 'rspec', :url => 'git://github.com/dchelimsky/rspec'
repo 'rspec-rails', :url => 'git://github.com/dchelimsky/rspec-rails'
# target rails versions
['2-3-stable', '2-2-stable', '2-1-stable']... | ruby | MIT | cfe4b60adba8631df60df865d28923474e2cd442 | 2026-01-04T17:40:02.613787Z | false |
ianwhite/nested_has_many_through | https://github.com/ianwhite/nested_has_many_through/blob/cfe4b60adba8631df60df865d28923474e2cd442/init.rb | init.rb | require 'nested_has_many_through'
ActiveRecord::Associations::HasManyThroughAssociation.send :include, NestedHasManyThrough::Association
# BC
if defined?(ActiveRecord::Reflection::ThroughReflection)
ActiveRecord::Reflection::ThroughReflection.send :include, NestedHasManyThrough::Reflection
else
ActiveRecord::Refl... | ruby | MIT | cfe4b60adba8631df60df865d28923474e2cd442 | 2026-01-04T17:40:02.613787Z | false |
ianwhite/nested_has_many_through | https://github.com/ianwhite/nested_has_many_through/blob/cfe4b60adba8631df60df865d28923474e2cd442/spec/app.rb | spec/app.rb | # Testing app setup
##################
# Database schema
##################
ActiveRecord::Migration.suppress_messages do
ActiveRecord::Schema.define(:version => 0) do
create_table :users, :force => true do |t|
t.column "type", :string
end
create_table :posts, :force => true do |t|
t.col... | ruby | MIT | cfe4b60adba8631df60df865d28923474e2cd442 | 2026-01-04T17:40:02.613787Z | false |
ianwhite/nested_has_many_through | https://github.com/ianwhite/nested_has_many_through/blob/cfe4b60adba8631df60df865d28923474e2cd442/spec/spec_helper.rb | spec/spec_helper.rb | # This file is copied to ~/spec when you run 'ruby script/generate rspec'
# from the project root directory.
ENV["RAILS_ENV"] ||= "test"
require File.expand_path(File.join(File.dirname(__FILE__), "../../../../config/environment"))
require 'spec/rails'
Spec::Runner.configure do |config|
config.use_transactional_fixtu... | ruby | MIT | cfe4b60adba8631df60df865d28923474e2cd442 | 2026-01-04T17:40:02.613787Z | false |
ianwhite/nested_has_many_through | https://github.com/ianwhite/nested_has_many_through/blob/cfe4b60adba8631df60df865d28923474e2cd442/spec/models/commenter_spec.rb | spec/models/commenter_spec.rb | require File.expand_path(File.join(File.dirname(__FILE__), '../spec_helper'))
require File.expand_path(File.join(File.dirname(__FILE__), '../app'))
describe 'Commenter use case (a1: p1>c1, a2: p2>c1, p3>c2, a3: p4>c3)' do
before do
@c1 = Category.create!
@c2 = Category.create!
@c3 = Category.create!
... | ruby | MIT | cfe4b60adba8631df60df865d28923474e2cd442 | 2026-01-04T17:40:02.613787Z | false |
ianwhite/nested_has_many_through | https://github.com/ianwhite/nested_has_many_through/blob/cfe4b60adba8631df60df865d28923474e2cd442/spec/models/author_spec.rb | spec/models/author_spec.rb | require File.expand_path(File.join(File.dirname(__FILE__), '../spec_helper'))
require File.expand_path(File.join(File.dirname(__FILE__), '../app'))
describe Author do
describe "(newly created)" do
before do
@category = Category.create!
@other_category = Category.create!
@author = Author.create!... | ruby | MIT | cfe4b60adba8631df60df865d28923474e2cd442 | 2026-01-04T17:40:02.613787Z | false |
ianwhite/nested_has_many_through | https://github.com/ianwhite/nested_has_many_through/blob/cfe4b60adba8631df60df865d28923474e2cd442/lib/nested_has_many_through.rb | lib/nested_has_many_through.rb | module NestedHasManyThrough
module Reflection # :nodoc:
def self.included(base)
base.send :alias_method_chain, :check_validity!, :nested_has_many_through
end
def check_validity_with_nested_has_many_through!
check_validity_without_nested_has_many_through!
rescue ActiveRecord::HasManyThro... | ruby | MIT | cfe4b60adba8631df60df865d28923474e2cd442 | 2026-01-04T17:40:02.613787Z | false |
mariusandra/aristotle | https://github.com/mariusandra/aristotle/blob/75db288721770f892540b6162f362d6427269986/test/test_aristotle.rb | test/test_aristotle.rb | require 'minitest/autorun'
require 'aristotle'
class TestLogic < Aristotle::Logic
action /Go to a bar/ do |_|
false
end
action /Do something else/ do |_|
false
end
action /Do a third thing/ do |_|
false
end
action /Return (\d+)/ do |_, number|
number.to_i
end
action /Return payload/ d... | ruby | MIT | 75db288721770f892540b6162f362d6427269986 | 2026-01-04T17:40:07.440901Z | false |
mariusandra/aristotle | https://github.com/mariusandra/aristotle/blob/75db288721770f892540b6162f362d6427269986/lib/aristotle.rb | lib/aristotle.rb | require 'aristotle/logic'
require 'aristotle/utility'
require 'aristotle/command'
require 'aristotle/presenter'
| ruby | MIT | 75db288721770f892540b6162f362d6427269986 | 2026-01-04T17:40:07.440901Z | false |
mariusandra/aristotle | https://github.com/mariusandra/aristotle/blob/75db288721770f892540b6162f362d6427269986/lib/aristotle/command.rb | lib/aristotle/command.rb | module Aristotle
class Command
attr_reader :action, :condition, :action_proc, :condition_proc
def initialize(line, conditions, actions)
@action, @condition = line.split(' if ', 2).map(&:strip)
raise 'Badly formatted line' if @action == '' || @condition == ''
conditions.each do |condition_... | ruby | MIT | 75db288721770f892540b6162f362d6427269986 | 2026-01-04T17:40:07.440901Z | false |
mariusandra/aristotle | https://github.com/mariusandra/aristotle/blob/75db288721770f892540b6162f362d6427269986/lib/aristotle/presenter.rb | lib/aristotle/presenter.rb | module Aristotle
class Presenter
def initialize(klass)
@klass = klass
end
def html_rules(show_code: true)
@klass.commands.map do |command_title, commands|
"<strong>#{command_title}</strong>"+
"<ul>"+
commands.map do |command|
"<li>"+
... | ruby | MIT | 75db288721770f892540b6162f362d6427269986 | 2026-01-04T17:40:07.440901Z | false |
mariusandra/aristotle | https://github.com/mariusandra/aristotle/blob/75db288721770f892540b6162f362d6427269986/lib/aristotle/utility.rb | lib/aristotle/utility.rb | module Aristotle
class Utility
def self.check_all
logic_objects.each do |logic_object|
puts "Checking #{logic_object[:class_name]}"
is_everything_covered_for? logic_object
puts
end
end
protected
def self.logic_objects
init_logic_objects if @logic_objects.nil... | ruby | MIT | 75db288721770f892540b6162f362d6427269986 | 2026-01-04T17:40:07.440901Z | false |
mariusandra/aristotle | https://github.com/mariusandra/aristotle/blob/75db288721770f892540b6162f362d6427269986/lib/aristotle/logic.rb | lib/aristotle/logic.rb | module Aristotle
class Logic
def initialize(object)
@object = object
end
def process(logic_method, return_command: false)
self.class.commands(logic_method).each do |command|
next unless command.condition_passes_with?(@object)
return_value = command.do_action_with(@object)
... | ruby | MIT | 75db288721770f892540b6162f362d6427269986 | 2026-01-04T17:40:07.440901Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/app/controllers/sortable_controller.rb | app/controllers/sortable_controller.rb | class SortableController < ApplicationController
VERIFIER = Rails.application.message_verifier(:rails_sortable_generate_sortable_id)
#
# post /sortable/reorder, rails_sortable: [
# "BAhJIhVjbGFzcz1JdGVtLGlkPTUwBjoGRVQ=--b48adfad6d6d7764e4106c44fc090fcad15d721e",
# "BAhJIhVjbGFzcz1JdGVtLGlkPTQxBjoGRVQ=--... | ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/app/models/rails_sortable/model.rb | app/models/rails_sortable/model.rb | module RailsSortable
#
# Include this module to your ActiveRecord model.
# And you must call `set_sortable` method for using sortable model.
#
# ex)
# class SampleModel < ActiveRecord::Base
# include RailsSortable::Model
# set_sortable :sort, without_updating_timestamps: true
# end
#
module Mo... | ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/spec/spec_helper.rb | spec/spec_helper.rb | # This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../dummy/config/environment", __FILE__)
require 'rspec/rails'
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root... | ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/spec/controllers/sortable_controller_spec.rb | spec/controllers/sortable_controller_spec.rb | require 'spec_helper'
def create_token(klass, id)
return SortableController::VERIFIER.generate("class=#{klass},id=#{id}")
end
describe SortableController, type: :controller do
describe 'POST reorder' do
before do
@item1 = Item.create!
@item2 = Item.create!
@item3 = Item.create!
end
i... | ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/spec/models/rails_sortable/model_spec.rb | spec/models/rails_sortable/model_spec.rb | require 'spec_helper'
describe RailsSortable::Model, type: :model do
describe "before_create" do
context "when sort is nil" do
it "should be automatically set maximum sort value" do
Item.create! sort: 1000
new_item = Item.create!
expect(new_item.sort).to eql 1001
end
end
... | ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/spec/dummy/app/controllers/items_controller.rb | spec/dummy/app/controllers/items_controller.rb | class ItemsController < ApplicationController
before_action :set_item, only: [:show, :edit, :update, :destroy]
# GET /items
def index
@items = Item.all
end
# GET /items/1
def show
end
# GET /items/new
def new
@item = Item.new
end
# GET /items/1/edit
def edit
end
# POST /items
... | ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/spec/dummy/app/controllers/sequenced_items_controller.rb | spec/dummy/app/controllers/sequenced_items_controller.rb | class SequencedItemsController < ApplicationController
before_action :set_sequenced_item, only: [:show, :edit, :update, :destroy]
# GET /sequenced_items
def index
@sequenced_items = SequencedItem.all
end
# GET /sequenced_items/1
def show
end
# GET /sequenced_items/new
def new
@sequenced_ite... | ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/spec/dummy/app/controllers/multiple_classes_controller.rb | spec/dummy/app/controllers/multiple_classes_controller.rb | class MultipleClassesController < ApplicationController
# GET /multiple_classes
def index
@items = (FirstItem.all + SecondItem.all).sort_by(&:sort)
end
end
| ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/spec/dummy/app/controllers/application_controller.rb | spec/dummy/app/controllers/application_controller.rb | class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
end
| ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/spec/dummy/app/models/item.rb | spec/dummy/app/models/item.rb | class Item < ActiveRecord::Base
include RailsSortable::Model
set_sortable :sort
default_scope -> { order(:sort) }
end
| ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/spec/dummy/app/models/validated_item.rb | spec/dummy/app/models/validated_item.rb | class ValidatedItem < Item
self.table_name = "items"
validates_presence_of :title
end
| ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/spec/dummy/app/models/first_item.rb | spec/dummy/app/models/first_item.rb | class FirstItem < ActiveRecord::Base
include RailsSortable::Model
set_sortable :sort
default_scope -> { order(:sort) }
end
| ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/spec/dummy/app/models/sequenced_item.rb | spec/dummy/app/models/sequenced_item.rb | class SequencedItem < ActiveRecord::Base
include RailsSortable::Model
set_sortable :sequence, without_updating_timestamps: true
default_scope -> { order(:sequence) }
end
| ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/spec/dummy/app/models/second_item.rb | spec/dummy/app/models/second_item.rb | class SecondItem < ActiveRecord::Base
include RailsSortable::Model
set_sortable :sort
default_scope -> { order(:sort) }
end
| ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/spec/dummy/db/seeds.rb | spec/dummy/db/seeds.rb | Item.delete_all
10.times {|i| Item.create! title: "Title#{i}", sort: i }
SequencedItem.delete_all
10.times {|i| SequencedItem.create! title: "OtherTitle#{i}", sequence: i }
FirstItem.delete_all
(0..4).each {|i| FirstItem.create! title: "FirstTitle#{i}", sort: i }
SecondItem.delete_all
(5..9).each {|i| SecondItem.crea... | ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/spec/dummy/db/migrate/20180427061457_create_multiple_classes.rb | spec/dummy/db/migrate/20180427061457_create_multiple_classes.rb | class CreateMultipleClasses < Dummy::MigrationClass
def change
create_table :first_items do |t|
t.string :title
t.integer :sort
t.timestamps null: false
end
create_table :second_items do |t|
t.string :title
t.integer :sort
t.timestamps null: false
end
end
end
| ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/spec/dummy/db/migrate/20170414031946_create_sequenced_items.rb | spec/dummy/db/migrate/20170414031946_create_sequenced_items.rb | class CreateSequencedItems < Dummy::MigrationClass
def change
create_table :sequenced_items do |t|
t.string :title
t.integer :sequence
t.timestamps null: false
end
end
end
| ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/spec/dummy/db/migrate/20131223124841_create_items.rb | spec/dummy/db/migrate/20131223124841_create_items.rb | class CreateItems < Dummy::MigrationClass
def change
create_table :items do |t|
t.string :title
t.integer :sort
t.timestamps null: false
end
end
end
| ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/spec/dummy/config/application.rb | spec/dummy/config/application.rb | require File.expand_path('../boot', __FILE__)
# Pick the frameworks you want:
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "sprockets/railtie"
# require "rails/test_unit/railtie"
Bundler.require(*Rails.groups)
require "rails_sortable"
module Dummy
clas... | ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/spec/dummy/config/environment.rb | spec/dummy/config/environment.rb | # Load the Rails application.
require File.expand_path('../application', __FILE__)
# Initialize the Rails application.
Dummy::Application.initialize!
| ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/spec/dummy/config/routes.rb | spec/dummy/config/routes.rb | Dummy::Application.routes.draw do
resources :items
resources :sequenced_items
get 'multiple_classes', to: 'multiple_classes#index'
end
| ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/spec/dummy/config/boot.rb | spec/dummy/config/boot.rb | # Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
$LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
| ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/spec/dummy/config/initializers/filter_parameter_logging.rb | spec/dummy/config/initializers/filter_parameter_logging.rb | # Be sure to restart your server when you modify this file.
# Configure sensitive parameters which will be filtered from the log file.
Rails.application.config.filter_parameters += [:password]
| ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/spec/dummy/config/initializers/session_store.rb | spec/dummy/config/initializers/session_store.rb | # Be sure to restart your server when you modify this file.
Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
| ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/spec/dummy/config/initializers/wrap_parameters.rb | spec/dummy/config/initializers/wrap_parameters.rb | # Be sure to restart your server when you modify this file.
# This file contains settings for ActionController::ParamsWrapper which
# is enabled by default.
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do
wrap_parameters f... | ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/spec/dummy/config/initializers/inflections.rb | spec/dummy/config/initializers/inflections.rb | # Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format. Inflections
# are locale specific, and you may define rules for as many different
# locales as you wish. All of these examples are active by default:
# ActiveSupport::Inflector.inflections(:en) do |inflec... | ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/spec/dummy/config/initializers/backtrace_silencers.rb | spec/dummy/config/initializers/backtrace_silencers.rb | # Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
# You can also remove all the silencers if you're trying to debug a probl... | ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/spec/dummy/config/initializers/mime_types.rb | spec/dummy/config/initializers/mime_types.rb | # Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
# Mime::Type.register_alias "text/html", :iphone
| ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/spec/dummy/config/initializers/secret_token.rb | spec/dummy/config/initializers/secret_token.rb | # Be sure to restart your server when you modify this file.
# Your secret key is used for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to diction... | ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/spec/dummy/config/environments/test.rb | spec/dummy/config/environments/test.rb | Dummy::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test sui... | ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/spec/dummy/config/environments/development.rb | spec/dummy/config/environments/development.rb | Dummy::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web ser... | ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/spec/dummy/config/environments/production.rb | spec/dummy/config/environments/production.rb | Dummy::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both thread web server... | ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/lib/rails_sortable.rb | lib/rails_sortable.rb | require "rails_sortable/engine"
require "rails_sortable/core_ext"
module RailsSortable
end
| ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/lib/rails_sortable/version.rb | lib/rails_sortable/version.rb | module RailsSortable
VERSION = '1.6.0'
end
| ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/lib/rails_sortable/core_ext.rb | lib/rails_sortable/core_ext.rb | Dir.glob(File.expand_path('core_ext/*.rb', File.dirname(__FILE__))).each do |path|
require path
end
| ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/lib/rails_sortable/engine.rb | lib/rails_sortable/engine.rb | module RailsSortable
class Engine < ::Rails::Engine
end
end
| ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/lib/rails_sortable/core_ext/enumerable.rb | lib/rails_sortable/core_ext/enumerable.rb | module Enumerable
def each_with_sortable_id(&block)
raise "Must be called with block!" unless block_given?
each { |e| yield e, e.sortable_id }
end
end
| ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
itmammoth/rails_sortable | https://github.com/itmammoth/rails_sortable/blob/31f49365a545e7d2a93e56d2fcb9220a190713bd/config/routes.rb | config/routes.rb | Rails.application.routes.draw do
post "/sortable/reorder", to: "sortable#reorder"
end
| ruby | MIT | 31f49365a545e7d2a93e56d2fcb9220a190713bd | 2026-01-04T17:40:04.631758Z | false |
mamuso/acts_as_unvlogable | https://github.com/mamuso/acts_as_unvlogable/blob/a31180dd5a242790730432b2f81fb7d70306b60f/spec/acts_as_unvlogable_spec.rb | spec/acts_as_unvlogable_spec.rb | # encoding: utf-8
require 'spec_helper'
describe UnvlogIt do
context "without any url" do
it {
expect { UnvlogIt.new }.to raise_error(ArgumentError, "We need a video url")
}
end
context "with an unsupported url" do
it {
expect { UnvlogIt.new("http://iwannagothere.net") }.to raise_error(A... | ruby | MIT | a31180dd5a242790730432b2f81fb7d70306b60f | 2026-01-04T17:40:12.920328Z | false |
mamuso/acts_as_unvlogable | https://github.com/mamuso/acts_as_unvlogable/blob/a31180dd5a242790730432b2f81fb7d70306b60f/spec/spec_helper.rb | spec/spec_helper.rb | require 'coveralls'
Coveralls.wear!
require 'acts_as_unvlogable' | ruby | MIT | a31180dd5a242790730432b2f81fb7d70306b60f | 2026-01-04T17:40:12.920328Z | false |
mamuso/acts_as_unvlogable | https://github.com/mamuso/acts_as_unvlogable/blob/a31180dd5a242790730432b2f81fb7d70306b60f/lib/acts_as_unvlogable.rb | lib/acts_as_unvlogable.rb | require "bundler/setup"
require "cgi"
require "json"
require "net/http"
require 'rexml/document'
require 'active_support'
require 'active_support/core_ext/hash'
require "yt"
require "nokogiri"
require "acts_as_unvlogable/flickr"
if defined?(ActiveSupport).nil?
require "acts_as_unvlogable/string_base"
require "act... | ruby | MIT | a31180dd5a242790730432b2f81fb7d70306b60f | 2026-01-04T17:40:12.920328Z | false |
mamuso/acts_as_unvlogable | https://github.com/mamuso/acts_as_unvlogable/blob/a31180dd5a242790730432b2f81fb7d70306b60f/lib/acts_as_unvlogable/vg_youtube.rb | lib/acts_as_unvlogable/vg_youtube.rb | # ----------------------------------------------
# Class for Youtube (youtube.com)
# http://www.youtube.com/watch?v=MVa4q-YVjD8
# ----------------------------------------------
class VgYoutube
def initialize(url=nil, options={})
settings ||= YAML.load_file(RAILS_ROOT + '/config/unvlogable.yml') rescue {}
... | ruby | MIT | a31180dd5a242790730432b2f81fb7d70306b60f | 2026-01-04T17:40:12.920328Z | false |
mamuso/acts_as_unvlogable | https://github.com/mamuso/acts_as_unvlogable/blob/a31180dd5a242790730432b2f81fb7d70306b60f/lib/acts_as_unvlogable/version.rb | lib/acts_as_unvlogable/version.rb | module ActsAsUnvlogable
VERSION = "1.0.5"
end
| ruby | MIT | a31180dd5a242790730432b2f81fb7d70306b60f | 2026-01-04T17:40:12.920328Z | false |
mamuso/acts_as_unvlogable | https://github.com/mamuso/acts_as_unvlogable/blob/a31180dd5a242790730432b2f81fb7d70306b60f/lib/acts_as_unvlogable/vg_pleer.rb | lib/acts_as_unvlogable/vg_pleer.rb | class VgPleer
attr_accessor :track_id
def initialize(url, options={})
url = url.sub(/pleer.com/, 'pleer.net') #addressing permanent redirection
@uri = URI.parse(url)
@track_id = @uri.path.match(/tracks\/([\w\d]+)/)[1]
@url = url
raise ArgumentError unless @track_id
end
def title
@t... | ruby | MIT | a31180dd5a242790730432b2f81fb7d70306b60f | 2026-01-04T17:40:12.920328Z | false |
mamuso/acts_as_unvlogable | https://github.com/mamuso/acts_as_unvlogable/blob/a31180dd5a242790730432b2f81fb7d70306b60f/lib/acts_as_unvlogable/vg_collegehumor.rb | lib/acts_as_unvlogable/vg_collegehumor.rb | # ----------------------------------------------
# Class for Collegehumor (www.collegehumor.com)
# http://www.collegehumor.com/video:1781938
# ----------------------------------------------
class VgCollegehumor
def initialize(url=nil, options={})
@url = url
@video_id = parse_url(url)
res = Net::HTT... | ruby | MIT | a31180dd5a242790730432b2f81fb7d70306b60f | 2026-01-04T17:40:12.920328Z | false |
mamuso/acts_as_unvlogable | https://github.com/mamuso/acts_as_unvlogable/blob/a31180dd5a242790730432b2f81fb7d70306b60f/lib/acts_as_unvlogable/vg_dalealplay.rb | lib/acts_as_unvlogable/vg_dalealplay.rb | # encoding: utf-8
# ----------------------------------------------
# Class for dalealplay (dalealplay.com)
# http://www.dalealplay.com/informaciondecontenido.php?con=80280
#
# Crappy without api
# ----------------------------------------------
class VgDalealplay
def initialize(url=nil, options={})
@url = ur... | ruby | MIT | a31180dd5a242790730432b2f81fb7d70306b60f | 2026-01-04T17:40:12.920328Z | false |
mamuso/acts_as_unvlogable | https://github.com/mamuso/acts_as_unvlogable/blob/a31180dd5a242790730432b2f81fb7d70306b60f/lib/acts_as_unvlogable/vg_dailymotion.rb | lib/acts_as_unvlogable/vg_dailymotion.rb | # ----------------------------------------------
# Class for Dailymotion (www.dailymotion.com)
# http://www.dailymotion.com/visited-week/lang/es/video/x7u5kn_parkour-dayyy_sport
# ----------------------------------------------
class VgDailymotion
def initialize(url=nil, options={})
@url = url
@video_id... | ruby | MIT | a31180dd5a242790730432b2f81fb7d70306b60f | 2026-01-04T17:40:12.920328Z | false |
mamuso/acts_as_unvlogable | https://github.com/mamuso/acts_as_unvlogable/blob/a31180dd5a242790730432b2f81fb7d70306b60f/lib/acts_as_unvlogable/vg_myspace.rb | lib/acts_as_unvlogable/vg_myspace.rb | # ----------------------------------------------
# Class for Myspace (vids.myspace.com)
# http://vids.myspace.com/index.cfm?fuseaction=vids.individual&VideoID=27111431
# ----------------------------------------------
class VgMyspace
def initialize(url=nil, options={})
@url = url
@page = Nokogiri::HTML(... | ruby | MIT | a31180dd5a242790730432b2f81fb7d70306b60f | 2026-01-04T17:40:12.920328Z | false |
mamuso/acts_as_unvlogable | https://github.com/mamuso/acts_as_unvlogable/blob/a31180dd5a242790730432b2f81fb7d70306b60f/lib/acts_as_unvlogable/vg_rutube.rb | lib/acts_as_unvlogable/vg_rutube.rb | class VgRutube
def initialize(url=nil, options={})
@url = url
@page = Nokogiri::HTML(open(@url)) rescue nil
raise ArgumentError.new("Unsuported url or service") if @page.xpath("//meta[@property='og:video:iframe']").blank?
end
def title
@page.xpath("//meta[@property='og:title']").first["content"]... | ruby | MIT | a31180dd5a242790730432b2f81fb7d70306b60f | 2026-01-04T17:40:12.920328Z | false |
mamuso/acts_as_unvlogable | https://github.com/mamuso/acts_as_unvlogable/blob/a31180dd5a242790730432b2f81fb7d70306b60f/lib/acts_as_unvlogable/vg_ted.rb | lib/acts_as_unvlogable/vg_ted.rb | # ----------------------------------------------
# Class for Ted Talks (www.ted.com/talks)
# http://www.ted.com/talks/benjamin_wallace_on_the_price_of_happiness.html
# ----------------------------------------------
class VgTed
def initialize(url=nil, options={})
@url = url
raise ArgumentError.new("Unsu... | ruby | MIT | a31180dd5a242790730432b2f81fb7d70306b60f | 2026-01-04T17:40:12.920328Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.