repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
Milstein/spinone | spec/requests/milestones_spec.rb | <reponame>Milstein/spinone
require 'rails_helper'
describe "Milestones", type: :request, vcr: true do
it "milestones" do
get '/milestones'
expect(last_response.status).to eq(200)
meta = json["meta"]
expect(meta["total"]).to eq(8)
expect(json["data"].size).to eq(8)
page = json["data"].first
... |
Milstein/spinone | spec/requests/works_spec.rb | <filename>spec/requests/works_spec.rb
require 'rails_helper'
describe "Works", type: :request, vcr: true do
let(:expected_work) { OpenStruct.new(id: "https://handle.test.datacite.org/10.1234/rh5j9bx3gn.1", title: "2018-09-21 07:26:21.58 3 authors public mode (revised)") }
it "works" do
get '/works'
expec... |
yagihiro/action-cable-testing | test/test_helper.rb | <filename>test/test_helper.rb
# frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
begin
require "pry-byebug"
rescue LoadError
end
require "action_cable"
require "action-cable-testing"
require "active_support/testing/autorun"
# Require all the stubs and models
Dir[File.expand_... |
yagihiro/action-cable-testing | spec/generators/test_unit_spec.rb | <reponame>yagihiro/action-cable-testing<filename>spec/generators/test_unit_spec.rb
# frozen_string_literal: true
require "spec_helper"
require "generators/test_unit/channel/channel_generator"
describe TestUnit::Generators::ChannelGenerator, type: :generator do
destination File.expand_path("../../../tmp", __FILE__)
... |
yagihiro/action-cable-testing | spec/support/helpers.rb | <reponame>yagihiro/action-cable-testing
# Copied from rspec-rails
module Helpers
include RSpec::Rails::FeatureCheck
def with_isolated_config
original_config = RSpec.configuration
RSpec.configuration = RSpec::Core::Configuration.new
RSpec::Rails.initialize_configuration(RSpec.configuration)
if def... |
yagihiro/action-cable-testing | lib/generators/test_unit/channel/channel_generator.rb | <gh_stars>100-1000
# frozen_string_literal: true
require "rails/generators/test_unit"
module TestUnit # :nodoc:
module Generators # :nodoc:
class ChannelGenerator < Base # :nodoc:
source_root File.expand_path("../templates", __FILE__)
check_class_collision suffix: "ChannelTest"
def create_te... |
yagihiro/action-cable-testing | spec/rspec/rails/channel_example_group_spec.rb | require "spec_helper"
module RSpec::Rails
describe ChannelExampleGroup do
if defined?(ActionCable)
it_behaves_like "an rspec-rails example group mixin", :channel,
'./spec/channels/', '.\\spec\\channels\\'
end
end
end
|
yagihiro/action-cable-testing | lib/generators/rspec/channel/channel_generator.rb | <reponame>yagihiro/action-cable-testing
# frozen_string_literal: true
require "generators/rspec"
module Rspec
module Generators
# @private
class ChannelGenerator < Base
source_root File.expand_path("../templates", __FILE__)
def create_channel_spec
template "channel_spec.rb.erb", File.jo... |
yagihiro/action-cable-testing | test/stubs/test_connection.rb | # frozen_string_literal: true
require_relative "user"
class TestConnection
attr_reader :identifiers, :logger, :current_user, :server, :transmissions
delegate :pubsub, to: :server
def initialize(user = User.new("lifo"), coder: ActiveSupport::JSON, subscription_adapter: SuccessAdapter)
@coder = coder
@i... |
yagihiro/action-cable-testing | spec/spec_helper.rb | <filename>spec/spec_helper.rb
# frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
begin
require "pry-byebug"
rescue LoadError
end
require "action_controller/railtie"
require "action_view/railtie"
require "action_cable"
require "action_cable/testing/rspec"
require "ammeter/ini... |
yagihiro/action-cable-testing | action-cable-testing.gemspec | # frozen_string_literal: true
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "action_cable/testing/version"
Gem::Specification.new do |spec|
spec.name = "action-cable-testing"
spec.version = ActionCable::Testing::VERSION
spec.authors ... |
yagihiro/action-cable-testing | lib/action_cable/testing/rspec.rb | # frozen_string_literal: true
require "action-cable-testing"
require "rspec/rails"
require "rspec/rails/example/channel_example_group"
require "rspec/rails/matchers/action_cable"
require "rspec/rails/shared_contexts/action_cable"
module RSpec # :nodoc:
module Rails
module FeatureCheck
module_function
... |
yagihiro/action-cable-testing | lib/action-cable-testing.rb | # frozen_string_literal: true
require "action_cable/testing"
|
yagihiro/action-cable-testing | test/test_helper_test.rb | # frozen_string_literal: true
require_relative "test_helper"
class BroadcastChannel < ActionCable::Channel::Base
end
class TransmissionsTest < ActionCable::TestCase
def test_assert_broadcasts
assert_nothing_raised do
assert_broadcasts("test", 1) do
ActionCable.server.broadcast "test", "message"
... |
yagihiro/action-cable-testing | spec/dummy/app/models/broadcaster.rb | class Broadcaster; end
|
yagihiro/action-cable-testing | lib/action_cable/testing/version.rb | # frozen_string_literal: true
module ActionCable
module Testing
VERSION = "0.3.1"
end
end
|
yagihiro/action-cable-testing | lib/action_cable/subscription_adapter/test.rb | <gh_stars>100-1000
# frozen_string_literal: true
require "action_cable/subscription_adapter/async"
module ActionCable
module SubscriptionAdapter
# == Test adapter for Action Cable
#
# The test adapter should be used only in testing. Along with
# <tt>ActionCable::TestHelper</tt> it makes a great tool... |
yagihiro/action-cable-testing | spec/dummy/app/channels/chat_channel.rb | <filename>spec/dummy/app/channels/chat_channel.rb<gh_stars>100-1000
class ChatChannel < ApplicationCable::Channel
periodically every: 5.seconds do
transmit action: :now, time: Time.now
end
def subscribed
reject unless user_id.present?
@room_id = params[:room_id]
stream_from "chat_#{@room_id}" i... |
yagihiro/action-cable-testing | features/support/env.rb | <gh_stars>100-1000
require "aruba/cucumber"
require "fileutils"
Before do
@aruba_timeout_seconds = 30
end
Before do
example_app_dir = "spec/dummy"
aruba_dir = "tmp/aruba"
# Remove the previous aruba workspace.
FileUtils.rm_rf(aruba_dir) if File.exist?(aruba_dir)
FileUtils.cp_r(example_app_dir, aruba_dir)... |
yagihiro/action-cable-testing | spec/dummy/app/channels/echo_channel.rb | <gh_stars>100-1000
class EchoChannel < ApplicationCable::Channel
def subscribed
end
def echo(data)
data.delete("action")
transmit data
end
end
|
yagihiro/action-cable-testing | lib/rspec/rails/shared_contexts/action_cable.rb | <reponame>yagihiro/action-cable-testing
# frozen_string_literal: true
# Generate contexts to use specific Action Cable adapter:
# - "action_cable:async" (action_cable: :async)
# - "action_cable:inline" (action_cable: :inline)
# - "action_cable:test" (action_cable: :test)
%w[async inline test].each do |adapter|
RSpec... |
yagihiro/action-cable-testing | lib/action_cable/test_helper.rb | <gh_stars>0
# frozen_string_literal: true
module ActionCable
# Provides helper methods for testing Action Cable broadcasting
module TestHelper
CHANNEL_NOT_FOUND = ArgumentError.new("Broadcastnig channel can't be infered. Please, specify it with `:channel`")
def before_setup # :nodoc:
server = Action... |
yagihiro/action-cable-testing | lib/action_cable/testing.rb | # frozen_string_literal: true
require "action_cable/testing/version"
require "action_cable"
module ActionCable
autoload :TestCase
autoload :TestHelper
module Channel
eager_autoload do
autoload :TestCase
end
end
module Connection
eager_autoload do
autoload :TestCase
end
end
... |
pwim/emoticon | lib/emoticon/conversion_table/docomo.rb | module Emoticon
module ConversionTable
DOCOMO_SJIS_TO_UNICODE = {
0xF89F=>0xE63E,
0xF8A0=>0xE63F,
0xF8A1=>0xE640,
0xF8A2=>0xE641,
0xF8A3=>0xE642,
0xF8A4=>0xE643,
0xF8A5=>0xE644,
0xF8A6=>0xE645,
0xF8A7=>0xE646,
0xF8A8=>0xE647,
0xF8A9=>0xE6... |
pwim/emoticon | lib/emoticon/transcoder/jphone.rb | <filename>lib/emoticon/transcoder/jphone.rb
require File.join(File.dirname(File.dirname(__FILE__)), "transcoder", "softbank")
class Emoticon::Transcoder::Jphone < Emoticon::Transcoder::Softbank
# +str+のなかでWebcodeのSoftBank絵文字を(+0x1000だけシフトして)Unicode数値文字参照に変換した文字列を返す。
def external_to_unicodecr(str)
# SoftBank We... |
pwim/emoticon | lib/emoticon/transcoder/vodafone.rb | <gh_stars>1-10
require File.join(File.dirname(File.dirname(__FILE__)), "transcoder", "softbank")
Emoticon::Transcoder::Vodafone = Emoticon::Transcoder::Softbank
|
pwim/emoticon | test/emoticon_test.rb | <gh_stars>1-10
require File.dirname(__FILE__) + '/test_helper'
require 'emoticon'
class EmoticonTest < Test::Unit::TestCase
def test_transcoder_for_carrier
assert_instance_of(Emoticon::Transcoder::Docomo, Emoticon.transcoder_for_carrier("docomo"))
assert_instance_of(Emoticon::Transcoder::Au, Emoticon.transco... |
pwim/emoticon | test/emoticon/transcoder/au_test.rb | <reponame>pwim/emoticon<gh_stars>1-10
require 'test/unit'
require File.dirname(__FILE__) + '/../../test_helper'
require "emoticon/transcoder/au"
class AuTest < Test::Unit::TestCase
def setup
@transcoder = Emoticon::Transcoder::Au.instance
end
def test_internal_to_external
assert_equal "\xf6\x60", @tran... |
pwim/emoticon | lib/emoticon/conversion_table/softbank.rb | <filename>lib/emoticon/conversion_table/softbank.rb
module Emoticon
module ConversionTable
SOFTBANK_UNICODE_TO_WEBCODE = {
0xE001 => "G!",
0xE002 => "G\"",
0xE003 => "G#",
0xE004 => "G$",
0xE005 => "G%",
0xE006 => "G&",
0xE007 => "G'",
0xE008 => "G(",
0xE009 =... |
pwim/emoticon | lib/emoticon/transcoder/au.rb | require File.join(File.dirname(File.dirname(__FILE__)), "transcoder")
class Emoticon::Transcoder::Au < Emoticon::Transcoder
# +str+ のなかでDoCoMo絵文字をUnicode数値文字参照に置換した文字列を返す。
def external_to_unicodecr(str)
str.gsub(AU_SJIS_REGEXP) do |match|
sjis = match.unpack('n').first
unicode = AU_SJIS_TO_UNICODE[... |
pwim/emoticon | test/test_helper.rb | <filename>test/test_helper.rb
require 'test/unit'
$:.unshift File.dirname(__FILE__) + '/../lib'
DOCOMO_CR = ""
DOCOMO_UTF8 = [0xe63e].pack("U")
DOCOMO_DOCOMO_POINT = ""
AU_CR = ""
AU_UTF8 = [0xe488].pack("U")
SOFTBANK_CR = ""
SOFTBANK_UTF8 = [0xf04a].pack("U")
|
pwim/emoticon | lib/emoticon.rb | Dir.glob(File.join(File.dirname(__FILE__), "emoticon", "transcoder", "*.rb")) do |file|
require "emoticon/transcoder/#{File.basename(file, ".rb")}"
end
module Emoticon
def self.transcoder_for_carrier(carrier)
name = carrier.to_s.capitalize
if !name.empty? && Transcoder.const_defined?(name)
Transcoder... |
pwim/emoticon | lib/emoticon/transcoder/null.rb | require File.join(File.dirname(File.dirname(__FILE__)), "transcoder")
class Emoticon::Transcoder::Null < Emoticon::Transcoder
# 対応する変換メソッドが定義されていない場合は素通し
def external_to_unicodecr(str)
str
end
end
|
pwim/emoticon | lib/emoticon/conversion_table/au.rb | <gh_stars>1-10
module Emoticon
module ConversionTable
AU_SJIS_TO_UNICODE = {
0xF659=>0xE481,
0xF75E=>0xE542,
0xF65A=>0xE482,
0xF75F=>0xE543,
0xF65B=>0xE483,
0xF760=>0xE544,
0xF748=>0xE52C,
0xF761=>0xE545,
0xF749=>0xE52D,
0xF762=>0xE546,
0xF74A=>0xE52E,
0xF763=>0xE547,... |
pwim/emoticon | lib/emoticon/transcoder/softbank.rb | <filename>lib/emoticon/transcoder/softbank.rb<gh_stars>1-10
require File.join(File.dirname(File.dirname(__FILE__)), "transcoder")
class Emoticon::Transcoder::Softbank < Emoticon::Transcoder
# +str+ のなかでDoCoMo絵文字をUnicode数値文字参照に置換した文字列を返す。
def external_to_unicodecr(str)
# SoftBank Unicode
str.gsub(SOFTBANK_... |
pwim/emoticon | lib/emoticon/transcoder.rb | require "emoticon/conversion_table"
require 'scanf'
require "kconv"
require "singleton"
module Emoticon
class Transcoder
include Emoticon::ConversionTable
include Singleton
def unicodecr_to_external(str)
str.gsub(/&#x([0-9a-f]{4});/i) do |match|
unicode = $1.scanf("%x").first
if co... |
pwim/emoticon | test/emoticon/transcoder/docomo_test.rb | <reponame>pwim/emoticon<filename>test/emoticon/transcoder/docomo_test.rb
require 'test/unit'
require File.dirname(__FILE__) + '/../../test_helper'
require "emoticon/transcoder/docomo"
class DocomoTest < Test::Unit::TestCase
def setup
@transcoder = Emoticon::Transcoder::Docomo.instance
end
def test_internal... |
pwim/emoticon | lib/emoticon/transcoder/docomo.rb | <reponame>pwim/emoticon<filename>lib/emoticon/transcoder/docomo.rb
require File.join(File.dirname(File.dirname(__FILE__)), "transcoder")
class Emoticon::Transcoder::Docomo < Emoticon::Transcoder
# +str+ のなかでDoCoMo絵文字をUnicode数値文字参照に置換した文字列を返す。
def external_to_unicodecr(str)
str.gsub(SJIS_REGEXP) do |match|
... |
pwim/emoticon | emoticon.gemspec | Gem::Specification.new do |s|
s.name = "emoticon"
s.version = "0.0.4"
s.date = "2008-11-12"
s.summary = "Emoticon (emoji) handling for Japanese mobile phones"
s.email = "<EMAIL>"
s.homepage = "http://github.com/pwim/emoticon"
s.description = "Emoticon is a Ruby library for transcoding emotico... |
pwim/emoticon | test/emoticon/transcoder/vodafone_test.rb | <filename>test/emoticon/transcoder/vodafone_test.rb
require 'test/unit'
require File.dirname(__FILE__) + '/../../test_helper'
require "emoticon/transcoder/vodafone"
class VodafoneTest < Test::Unit::TestCase
def setup
@transcoder = Emoticon::Transcoder::Vodafone.instance
end
def test_internal_to_external
... |
teohm/simplecov-html | lib/simplecov-html/version.rb | module SimpleCov
module Formatter
class HTMLFormatter
VERSION = "0.10.2".freeze
end
end
end
|
michaelakh/igstories | app/helpers/application_helper.rb | <reponame>michaelakh/igstories
module ApplicationHelper
def active?(page)
current_page?(page) ? 'active' : ''
end
def meta_tag(meta_tag)
#add array type tester before if statement
#test functionality
meta = ''
if meta_tag.kind_of?(Hash) && meta_tag != nil
meta_tag.each do |key,value|... |
michaelakh/igstories | spec/routing/users_routing_spec.rb | require "rails_helper"
RSpec.describe UsersController, type: :routing do
describe "routing" do
it "routes to #search" do
expect(:get => "/search").to route_to("users#search")
end
it "routes to #stories" do
expect(:get => "/stories/user").to route_to("users#stories", user:'user')
... |
michaelakh/igstories | app/helpers/users_helper.rb | <reponame>michaelakh/igstories
module UsersHelper
def time_passed(hours)
days = hours/24
case
when days == 0
return hours == 1 ? "1 hour" : "#{hours} hours"
when days == 1
return "#{days} day"
when days.between?(1,29)
return "#{days} days"
when days.betwee... |
michaelakh/igstories | spec/controllers/messages_controller_spec.rb | <reponame>michaelakh/igstories
require 'rails_helper'
RSpec.describe MessagesController, type: :controller do
it "renders the Contact page" do
get :contact
expect(response).to be_success
end
end
|
michaelakh/igstories | spec/routing/pages_routing_spec.rb | require "rails_helper"
RSpec.describe PagesController, type: :routing do
describe "routing" do
it "routes to #index" do
expect(:get => "/welcome").to route_to("pages#welcome")
end
it "routes to #root" do
expect(:get => "/").to route_to("pages#welcome")
end
end
end
|
michaelakh/igstories | spec/routing/messages_routing_spec.rb | require "rails_helper"
RSpec.describe MessagesController, type: :routing do
describe "routing" do
it "routes to #contact" do
expect(:get => "/contact").to route_to("messages#contact")
end
end
end |
michaelakh/igstories | spec/models/page_spec.rb | require 'rails_helper'
RSpec.describe Page, type: :model do
end
|
michaelakh/igstories | spec/controllers/docs_controller_spec.rb | <gh_stars>0
require 'rails_helper'
RSpec.describe DocsController, type: :controller do
it "renders the privacy policy page" do
get :privacy_policy
expect(response).to be_success
end
it "renders the cookies policy page" do
get :cookies_policy
expect(response).to be_success
end
it "renders th... |
michaelakh/igstories | app/controllers/docs_controller.rb | <reponame>michaelakh/igstories
class DocsController < ApplicationController
def privacy_policy
@title = 'Privacy Policy'
end
def cookies_policy
@title = 'Cookies Policy'
end
def disclaimer
@title = 'Disclaimer'
end
end
|
michaelakh/igstories | app/controllers/messages_controller.rb | class MessagesController < ApplicationController
def contact
@title = 'Contact Me'
end
end
|
michaelakh/igstories | app/controllers/users_controller.rb | <filename>app/controllers/users_controller.rb
class UsersController < ApplicationController
def index
end
def search
@title = 'Stories Search'
@httprequest = HTTP.get("https://api.storiesig.com/stories/#{params[:q]}")
if @httprequest.status == 200 || @httprequest.status == 400
@respo... |
michaelakh/igstories | spec/helpers/users_helper_spec.rb | <filename>spec/helpers/users_helper_spec.rb
require 'rails_helper'
RSpec.describe UsersHelper, type: :helper do
describe "time_passed" do
it "returns '1 hour' if 1 is passed in" do
expect(helper.time_passed(1)).to eq "1 hour"
end
it "returns '12 hours' if 12 is passed in" do
expect(he... |
michaelakh/igstories | spec/controllers/pages_controller_spec.rb | require 'rails_helper'
RSpec.describe PagesController, type: :controller do
describe "GET welcome" do
it "renders the welcome page" do
get :welcome
expect(response).to be_success
end
end
end
|
michaelakh/igstories | config/routes.rb | Rails.application.routes.draw do
root 'pages#welcome'
#Pages
get 'welcome', to:'pages#welcome'
#Users
get 'search', to:'users#search'
get 'stories/:user', to:'users#stories'
get ':user/highlights/:highlight_id', to:'users#highlights'
#Docs
get 'privacy_policy', to:'docs#privacy_policy'
get ... |
michaelakh/igstories | services/page/builder.rb | module Page
module Builder
def self.call(params)
end
end
end |
michaelakh/igstories | spec/routing/docs_routing_spec.rb | <reponame>michaelakh/igstories
require "rails_helper"
RSpec.describe DocsController, type: :routing do
describe "routing" do
it "routes to #privacy" do
expect(:get => "/privacy_policy").to route_to("docs#privacy_policy")
end
it "routes to #cookies" do
expect(:get => "/cookies_policy... |
supernini/activerecord-i18n | test/activerecord_i18n_test.rb | require 'test_helper'
class ActiverecordI18n::Test < ActiveSupport::TestCase
test "get_item allow the default_value to be nil" do
result = ActiverecordI18n.get_item('abc')
assert_equal(result, "")
end
end
|
supernini/activerecord-i18n | lib/activerecord_i18n.rb | <reponame>supernini/activerecord-i18n<gh_stars>1-10
require 'rails'
require "active_support"
require "activerecord_i18n/railtie"
require "activerecord_i18n/helper"
require "activerecord_i18n/engine" if defined?(Rails)
module ActiverecordI18n
def self.setup
yield self
end
def self.get_translation(key, defaul... |
supernini/activerecord-i18n | lib/activerecord_i18n/engine.rb | <reponame>supernini/activerecord-i18n
module ActiverecordI18n
class Engine < ::Rails::Engine
isolate_namespace ActiverecordI18n
end
end
|
supernini/activerecord-i18n | lib/activerecord_i18n/helper.rb | module ActiverecordI18n
module Helper
def self.ot(key, default_value=nil)
return ActiverecordI18n.get_translation(key, default_value)
end
def ot(key, default_value=nil)
return ActiverecordI18n.get_translation(key, default_value, @current_template || nil)
end
end
end
|
supernini/activerecord-i18n | activerecord-i18n.gemspec | $:.push File.expand_path("lib", __dir__)
require "activerecord_i18n/version"
Gem::Specification.new do |spec|
spec.name = 'activerecord_i18n'
spec.version = ActiverecordI18n::VERSION
spec.authors = ["<NAME>"]
spec.email = '<EMAIL>'
spec.homepage = "https://github.com/supernini/activer... |
supernini/activerecord-i18n | lib/activerecord_i18n/version.rb | module ActiverecordI18n
VERSION = '0.1.4'
end
|
jlongtine/homebrew-tap | dagger.rb | <filename>dagger.rb<gh_stars>0
# typed: false
# frozen_string_literal: true
# This file was generated by GoReleaser. DO NOT EDIT.
class Dagger < Formula
desc "Dagger is a programmable deployment system."
homepage "https://github.com/dagger/dagger"
version "0.1.0-alpha.27"
bottle :unneeded
on_macos do
if... |
Flare576/homebrew-scripts | Formula/gac.rb | class Gac < Formula
desc "Git Add Commit makes common git tasks easier"
homepage "https://github.com/Flare576/gac"
url "https://github.com/Flare576/gac/archive/refs/tags/v0.4.0.tar.gz"
sha256 "d0c430e958e1cac7adce05c10d781d63ca4843aec654eaf65b3e223686110d5b"
license "MIT"
depends_on "git"
depends_on "nod... |
Flare576/homebrew-scripts | Formula/dvol.rb | class Dvol < Formula
include Language::Python::Virtualenv
desc "Docker Volume mapping control; container access made easy!"
homepage "https://github.com/Flare576/dvol"
url "https://files.pythonhosted.org/packages/32/3c/428a5e44b9f407136b8ab277b56a924c5e3012a5d00afda74e30a9a26305/dvol-0.1.0.tar.gz"
sha256 "27... |
Flare576/homebrew-scripts | Formula/jira-cli.rb | class JiraCli < Formula
desc "Go-Jira/jira with Flare customizations. Non-semver version: setup.cookie.config"
homepage "https://github.com/Flare576/jira-cli"
url "https://github.com/Flare576/jira-cli/archive/refs/tags/v3.3.8.tar.gz"
sha256 "3982ab52d9f0bae6bbde3f8d7c7410d232f30a1ec1e3b869a7fb397811dcc248"
li... |
Flare576/homebrew-scripts | Formula/newScript.rb | class Newscript < Formula
desc "Quickly generate script stubs in js, sh, or py"
homepage "https://github.com/Flare576/newScript"
url "https://github.com/Flare576/newScript/archive/refs/tags/v0.0.7.tar.gz"
sha256 "c167ab9a7b399858a17242d0f03c558e6bbef2d521655db8e2cf867e0c3a8b5c"
license "MIT"
depends_on "no... |
Flare576/homebrew-scripts | Formula/switch-theme.rb | class SwitchTheme < Formula
desc "Tool for switching themes in vim, tmux, zsh, bat, vsCode, terminals (gnome, mintty, Terminal.app), and whatever else I figure out."
homepage "https://github.com/Flare576/switch-theme"
url "https://github.com/Flare576/switch-theme/archive/refs/tags/v1.1.5.tar.gz"
sha256 "9f49fba... |
Flare576/homebrew-scripts | Formula/git-clone.rb | class GitClone < Formula
desc "Tool for maintaining multiple git accounts across any git system supporting HTTPS."
homepage "https://github.com/Flare576/git-clone"
url "https://github.com/Flare576/git-clone/archive/refs/tags/v0.1.2.tar.gz"
sha256 "de5cc4be237894b7673726e2a4f240db91f875c9d6d4ed22f11b2481627c9377... |
Flare576/homebrew-scripts | Formula/vroom.rb | <reponame>Flare576/homebrew-scripts<gh_stars>0
class Vroom < Formula
desc "Wrapper for make to help setup/execute standard destroy/setup/run/watch commands"
homepage "https://github.com/Flare576/vroom"
url "https://github.com/Flare576/vroom/archive/refs/tags/v12.0.2.tar.gz"
sha256 "9f8216c53baf98747c7d230be8ff7... |
Flare576/homebrew-scripts | Formula/monitorjobs.rb | class Monitorjobs < Formula
desc ""
homepage "https://github.com/Flare576/monitorjobs"
url "https://github.com/Flare576/monitorjobs/archive/refs/tags/v0.1.1.tar.gz"
sha256 "b47f5f41e55120bb1bff194f5a262fb66f2339991c9a13978d51ca7be50640d9"
license "MIT"
depends_on "jq"
# Don't install a separate version, ... |
JuanjoSalvador/JuanjoPackageManager | main.rb | require './utils'
require './help'
utils = Utils.new
help = Help.new
case ARGV[0]
when "get"
utils.init()
utils.download(ARGV[1])
when "list"
utils.list()
when "update"
utils.update()
when "help"
help.info()
else
puts "Prueba con el comando ... |
JuanjoSalvador/JuanjoPackageManager | utils.rb | <filename>utils.rb<gh_stars>1-10
require 'rubygems'
require 'git'
require 'yaml'
require 'fileutils'
class Utils
def init()
username = %x[ #{'whoami'} ]
username = username.chomp
jpm_dir = "/home/#{username}/JPM"
if !Dir.exists?(jpm_dir)
FileUtils::mkdir_p jpm_dir
... |
JuanjoSalvador/JuanjoPackageManager | help.rb | <filename>help.rb
class Help
def info()
puts "AYUDA DE JPM"
puts "En desarrollo"
end
end |
ZaaLabs/PushButtonEngine | script/licenseCheck/checkLicenses.rb | require 'ftools'
require 'yaml'
require 'pp'
def validatePath (path, do_exit=false)
if !File.exists? path
puts "[ERROR] \"#{path}\" is not valid"
if(do_exit)
puts "Exiting Script"
exit
end
end
end
def loopThroughDirectory( dirname )
Dir["#{dirname}/**/**"].each do |file|
if(File... |
nikolabebic95/LoopsOptimizationTests | Ruby/concatenate.rb | <filename>Ruby/concatenate.rb
str = ""
File.open("words.txt", "r") do |fh|
while(line = fh.gets) != nil
str.concat(line.strip)
end
end
puts str.length
|
nikolabebic95/LoopsOptimizationTests | Ruby/count.rb | num = 0
File.open("words.txt", "r") do |fh|
while(line = fh.gets) != nil
num += line.strip.length
end
end
puts num
|
nikolabebic95/LoopsOptimizationTests | Ruby/concatenate_optimized.rb | <reponame>nikolabebic95/LoopsOptimizationTests<gh_stars>0
str = ""
File.foreach("words.txt") do |line|
str.concat(line.strip)
end
puts str.length
|
nikolabebic95/LoopsOptimizationTests | Ruby/count_optimized.rb | <gh_stars>0
num = 0
File.foreach("words.txt") do |line|
num += line.strip.length
end
puts num
|
ack43/rocket_cms | app/models/menu.rb | if RocketCMS.active_record?
class Menu < ActiveRecord::Base
end
end
class Menu
include RocketCMS::Models::Menu
RocketCMS.apply_patches self
rails_admin &RocketCMS.menu_config
end
|
ack43/rocket_cms | lib/rocket_cms/models/mongoid/gallery_image.rb | module RocketCMS
module Models
module Mongoid
module GalleryImage
extend ActiveSupport::Concern
include ::Mongoid::Paperclip
included do
acts_as_nested_set
scope :sorted, -> { order_by([:lft, :asc]) }
has_mongoid_attached_file :image # need to override... |
ack43/rocket_cms | activerecord/rocket_cms_activerecord.gemspec | <filename>activerecord/rocket_cms_activerecord.gemspec<gh_stars>0
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
lib = File.expand_path('../../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'rocket_cms/version'
Gem::Specification.new... |
ack43/rocket_cms | app/models/gallery.rb | if RocketCMS.mongoid?
class Gallery
include RocketCMS::Models::Gallery
RocketCMS.apply_patches self
rails_admin &RocketCMS.gallery_config
end
end |
ack43/rocket_cms | lib/rocket_cms/models/gallery.rb | <gh_stars>0
module RocketCMS
module Models
module Gallery
extend ActiveSupport::Concern
include RocketCMS::Model
include Enableable
include ManualSlug
include SitemapData
include RocketCMS.orm_specific('Gallery')
included do
has_many :gallery_images
field... |
ack43/rocket_cms | lib/rocket_cms/controllers/news.rb | <gh_stars>0
module RocketCMS
module Controllers
module News
extend ActiveSupport::Concern
def index
@news = model.enabled.after_now.by_date
unless RocketCMS.config.news_per_page.nil?
@news = @news.page(params[:page])
end
end
def show
@news = mod... |
ack43/rocket_cms | lib/rocket_cms.rb | unless defined?(RocketCMS) && RocketCMS.respond_to?(:orm) && [:active_record, :mongoid].include?(RocketCMS.orm)
puts "please use ack_rocket_cms_mongoid or ack_rocket_cms_activerecord and not ack_rocket_cms directly"
exit 1
end
require 'rocket_cms/version'
require 'devise'
require 'simple_form'
require 'rocket_cms... |
ack43/rocket_cms | app/controllers/pages_controller.rb | class PagesController < ApplicationController
include RocketCMS::Controllers::Pages
end
|
ack43/rocket_cms | lib/rocket_cms/models/active_record/news.rb | module RocketCMS
module Models
module ActiveRecord
module News
extend ActiveSupport::Concern
included do
unless RocketCMS.config.news_image_styles.nil?
has_attached_file :image, styles: RocketCMS.config.news_image_styles
end
has_paper_trail
... |
ack43/rocket_cms | lib/rocket_cms/elastic_search.rb | module RocketCMS::ElasticSearch
extend ActiveSupport::Concern
included do
searchkick(
language: "Russian",
suggest: ["name"],
settings: {
analysis: {
analyzer: {
default_index: {
type: "custom",
... |
ack43/rocket_cms | mongoid/lib/rocket_cms_mongoid.rb | require 'mongoid'
require 'glebtv-mongoid-paperclip'
require 'glebtv-mongoid_nested_set'
require 'mongoid-audit'
require 'mongoid_slug'
require 'mongo_session_store-rails4'
require 'rails_admin_settings'
module RocketCMS
def self.orm
:mongoid
end
end
require 'rocket_cms'
|
ack43/rocket_cms | lib/rocket_cms/seo_helpers.rb | <reponame>ack43/rocket_cms<gh_stars>10-100
module RocketCMS
module SeoHelpers
extend ActiveSupport::Concern
def page_title
title.blank? ? name : title
end
def get_og_title
og_title.blank? ? name : og_title
end
end
end
|
ack43/rocket_cms | app/models/concerns/rocket_cms_mongoid_paperclip.rb | <reponame>ack43/rocket_cms
module RocketCMSMongoidPaperclip
extend ActiveSupport::Concern
module ClassMethods
def rocket_cms_mongoid_attached_file(name, opts = {})
name = name.to_sym
unless opts.blank?
content_type = opts.delete(:content_type)
jcrop_options = opts.delete(:jcrop_opti... |
ack43/rocket_cms | lib/rocket_cms/models/contact_message.rb | module RocketCMS
module Models
module ContactMessage
extend ActiveSupport::Concern
include RocketCMS::Model
include RocketCMS.orm_specific('ContactMessage')
included do
apply_simple_captcha message: RocketCMS.configuration.contacts_captcha_error_message
validates_email_f... |
ack43/rocket_cms | lib/generators/rocket_cms/templates/migration_seos.rb | <gh_stars>0
class RocketCmsCreateSeos < ActiveRecord::Migration
def change
create_table :seos do |t|
t.boolean :enabled, default: true, null: false
t.integer :seoable_id
t.string :seoable_type
RocketCMS::Migration.seo_fields(t)
t.timestamps
end
add_index :seos, [:seoable_id... |
ack43/rocket_cms | app/controllers/concerns/rs_errors.rb | module RsErrors
extend ActiveSupport::Concern
included do
if Rails.env.production? || Rails.env.staging?
rescue_from Exception, with: :render_500
rescue_from ActionController::RoutingError, with: :render_404
rescue_from ActionController::UnknownController, with: :render_404
rescue_from A... |
ack43/rocket_cms | lib/rocket_cms/controllers/contacts.rb | module RocketCMS
module Controllers
module Contacts
extend ActiveSupport::Concern
def index
@contact_message = ContactMessage.new
after_initialize
end
def new
@contact_message = model.new
after_initialize
end
def create
@contact_message... |
ack43/rocket_cms | lib/rocket_cms/models/active_record/page.rb | <gh_stars>0
module RocketCMS
module Models
module ActiveRecord
module Page
extend ActiveSupport::Concern
included do
acts_as_nested_set
has_paper_trail
validates_lengths_from_database only: [:name, :title, :content, :excerpt, :h1, :keywords, :robots, :og_title,... |
ack43/rocket_cms | lib/rocket_cms/models/news.rb | module RocketCMS
module Models
module News
extend ActiveSupport::Concern
include RocketCMS::Model
include Seoable
include Enableable
include ManualSlug
include SitemapData
include RocketCMS.orm_specific('News')
if RocketCMS.config.search_enabled
include Roc... |
ack43/rocket_cms | app/models/embedded_element.rb | <filename>app/models/embedded_element.rb
if RocketCMS.mongoid?
class EmbeddedElement
include RocketCMS::Models::EmbeddedElement
RocketCMS.apply_patches self
# use it in inherited model
#rails_admin &RocketCMS.embedded_image_config
# use it in rails_admin in parent model for sort
# sort_embed... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.