source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | tsechingho/ckeditor-rails | https://github.com/tsechingho/ckeditor-rails | test/rails4/Gemfile | Ruby | mit | 211 | master | 1,644 | source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.11.3'
# Use sqlite3 as the database for Active Record
gem 'sqlite3', '~> 1.3.13'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= ... |
github | tsechingho/ckeditor-rails | https://github.com/tsechingho/ckeditor-rails | test/rails4/config/routes.rb | Ruby | mit | 211 | master | 1,622 | Rails.application.routes.draw do
root 'home#index'
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".
# You can have the root of your site routed with "root"
# root 'welcome#index'
# Example of regular route:
# get ... |
github | tsechingho/ckeditor-rails | https://github.com/tsechingho/ckeditor-rails | test/rails4/config/application.rb | Ruby | mit | 211 | master | 1,113 | require File.expand_path('../boot', __FILE__)
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module Rails4
class Application < Rails::Application
# Settings in config/environments/* take preced... |
github | tsechingho/ckeditor-rails | https://github.com/tsechingho/ckeditor-rails | test/rails4/config/initializers/assets.rb | Ruby | mit | 211 | master | 580 | # Be sure to restart your server when you modify this file.
# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = '1.0'
# Add additional assets to the asset load path
# Rails.application.config.assets.paths << Emoji.images_path
# Precompile additional ... |
github | tsechingho/ckeditor-rails | https://github.com/tsechingho/ckeditor-rails | test/rails4/config/initializers/to_time_preserves_timezone.rb | Ruby | mit | 211 | master | 500 | # Be sure to restart your server when you modify this file.
# Preserve the timezone of the receiver when calling to `to_time`.
# Ruby 2.4 will change the behavior of `to_time` to preserve the timezone
# when converting to an instance of `Time` instead of the previous behavior
# of converting to the local system timezo... |
github | tsechingho/ckeditor-rails | https://github.com/tsechingho/ckeditor-rails | lib/ckeditor-rails.rb | Ruby | mit | 211 | master | 2,105 | require 'ckeditor-rails/version'
module Ckeditor
module Rails
mattr_accessor :assets_languages
@@assets_languages = nil
mattr_accessor :assets_plugins
@@assets_plugins = nil
mattr_accessor :assets_skins
@@assets_skins = nil
mattr_writer :assets_base_path
@@assets_base_path = nil
... |
github | tsechingho/ckeditor-rails | https://github.com/tsechingho/ckeditor-rails | lib/ckeditor-rails/railtie.rb | Ruby | mit | 211 | master | 238 | module Ckeditor
module Rails
class Railtie < ::Rails::Railtie
initializer 'ckeditor.assets.precompile', group: :all do |app|
app.config.assets.precompile += Ckeditor::Rails::Asset.new.files
end
end
end
end |
github | tsechingho/ckeditor-rails | https://github.com/tsechingho/ckeditor-rails | lib/ckeditor-rails/engine3.rb | Ruby | mit | 211 | master | 236 | module Ckeditor
module Rails
class Engine < ::Rails::Engine
initializer 'ckeditor.assets.precompile', group: :all do |app|
app.config.assets.precompile += Ckeditor::Rails::Asset.new.files
end
end
end
end |
github | tsechingho/ckeditor-rails | https://github.com/tsechingho/ckeditor-rails | lib/ckeditor-rails/engine.rb | Ruby | mit | 211 | master | 900 | require 'ckeditor-rails/asset_url_processor'
module Ckeditor
module Rails
class Engine < ::Rails::Engine
initializer 'ckeditor.assets.precompile', group: :all do |app|
app.config.assets.precompile += Ckeditor::Rails::Asset.new.files
end
# Follow sprockets-rails 3.3.0+ to use postproces... |
github | tsechingho/ckeditor-rails | https://github.com/tsechingho/ckeditor-rails | lib/ckeditor-rails/asset_url_processor.rb | Ruby | mit | 211 | master | 1,266 | module Ckeditor
module Rails
# Rewrites urls in CSS files with the digested paths
class AssetUrlProcessor
REGEX = /url\(\s*["']?(?!(?:\#|data|http))([^"'\s)]+)\s*["']?\)/
def self.stylesheet_files
@stylesheet_files ||= ::Ckeditor::Rails::Asset.new.stylesheet_files
end
def sel... |
github | tsechingho/ckeditor-rails | https://github.com/tsechingho/ckeditor-rails | lib/ckeditor-rails/asset.rb | Ruby | mit | 211 | master | 2,376 | module Ckeditor
module Rails
class Asset
attr_reader :name, :root
def initialize name = 'ckeditor', path = '../vendor/assets'
@name = name
@root = Ckeditor::Rails.root_path.join path
end
def image_files
path = root.join('images', name)
files = Dir.glob(pa... |
github | tsechingho/ckeditor-rails | https://github.com/tsechingho/ckeditor-rails | lib/ckeditor-rails/tasks.rake | Ruby | mit | 211 | master | 733 | require 'fileutils'
desc "Create nondigest versions of all ckeditor digest assets"
task "assets:precompile" do
fingerprint = /\-([0-9a-f]{32}|[0-9a-f]{64})\./
files = Dir["#{File.join('public', Rails.configuration.assets.prefix)}/ckeditor/**/*"]
# sort files having same digest with/without .gz by file mtime to ... |
github | tsechingho/ckeditor-rails | https://github.com/tsechingho/ckeditor-rails | lib/ckeditor-rails/source_file.rb | Ruby | mit | 211 | master | 3,404 | require 'thor'
class SourceFile < Thor
include Thor::Actions
source_root 'tmp'
desc 'fetch VERSION', 'fetch source files from http://ckeditor.com/'
def fetch version
download_url = file_url version
archive_file = "#{source_root}/#{filename(version)}"
in_root do
say_status ' fetch', ar... |
github | nicksieger/sheepsafe | https://github.com/nicksieger/sheepsafe | Rakefile | Ruby | mit | 211 | master | 2,484 | require 'date'
require 'rake/clean'
#############################################################################
#
# Helper functions
#
#############################################################################
def name
@name ||= Dir['*.gemspec'].first.split('.').first
end
def version
line = File.read("lib/#... |
github | nicksieger/sheepsafe | https://github.com/nicksieger/sheepsafe | sheepsafe.gemspec | Ruby | mit | 211 | master | 2,023 | # -*- encoding: utf-8 ; mode: ruby -*-
Gem::Specification.new do |s|
s.name = 'sheepsafe'
s.version = '0.3.3'
s.date = '2012-04-01'
s.rubyforge_project = %q{caldersphere}
s.summary = "Makes sure you're safe from FireSheep!"
s.description = "Automatically toggle net... |
github | nicksieger/sheepsafe | https://github.com/nicksieger/sheepsafe | lib/sheepsafe/config.rb | Ruby | mit | 211 | master | 1,211 | require 'yaml'
module Sheepsafe
class Config
FILE = File.expand_path('~/.sheepsafe/sheepsafe.yml')
DEFAULT_CONFIG = {"untrusted_location" => "Untrusted", "socks_port" => "9999", "trust_encrypted?" => "false", "disabled" => "false"}
ATTRS = %w(trusted_location untrusted_location last_network ssh_host ssh_... |
github | nicksieger/sheepsafe | https://github.com/nicksieger/sheepsafe | lib/sheepsafe/network.rb | Ruby | mit | 211 | master | 949 | module Sheepsafe
class Network
attr_reader :current_location
def initialize(config = nil)
@current_location = `networksetup -getcurrentlocation`.chomp
@data = YAML.load(`/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I`.gsub(/^\s*([^:]+)/, '"\1"'))
@con... |
github | nicksieger/sheepsafe | https://github.com/nicksieger/sheepsafe | lib/sheepsafe/installer.rb | Ruby | mit | 211 | master | 6,357 | module Sheepsafe
class Installer
PLIST_FILE = File.expand_path("~/Library/LaunchAgents/sheepsafe.plist")
attr_reader :config, :network, :controller
def initialize(config = nil, network = nil, controller = nil)
check_config_path
require 'highline/import'
@config = config || (File.read... |
github | nicksieger/sheepsafe | https://github.com/nicksieger/sheepsafe | lib/sheepsafe/controller.rb | Ruby | mit | 211 | master | 4,639 | require 'daemons'
require 'logger'
begin
require 'growl'
rescue LoadError
end
module Sheepsafe
class Controller
LOG_FILE = Sheepsafe::Config::FILE.sub(/\.yml/, '.log')
class TeeStdout
def initialize(controller)
@stdout, @controller = $stdout, controller
end
def write(*args,&bloc... |
github | nicksieger/sheepsafe | https://github.com/nicksieger/sheepsafe | spec/sheepsafe_spec.rb | Ruby | mit | 211 | master | 7,342 | require 'rspec'
require 'sheepsafe'
describe Sheepsafe::Controller do
let(:config) do
double("config", :trusted_location => "trusted_location", :untrusted_location => "untrusted_location",
:last_network= => nil, :write => nil, :disabled => nil)
end
let (:network) do
double("network", :up? => tr... |
github | ymoyao/cocoapods-privacy | https://github.com/ymoyao/cocoapods-privacy | Gemfile | Ruby | mit | 211 | main | 219 | source 'https://rubygems.org'
# Specify your gem's dependencies in cocoapods-privacy.gemspec
gemspec
group :development do
gem 'cocoapods'
gem 'mocha'
gem 'bacon'
gem 'mocha-on-bacon'
gem 'prettybacon'
end |
github | ymoyao/cocoapods-privacy | https://github.com/ymoyao/cocoapods-privacy | cocoapods-privacy.gemspec | Ruby | mit | 211 | main | 1,019 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'cocoapods-privacy/gem_version.rb'
Gem::Specification.new do |spec|
spec.name = 'cocoapods-privacy'
spec.version = CocoapodsPrivacy::VERSION
spec.authors = ['youhui']
... |
github | ymoyao/cocoapods-privacy | https://github.com/ymoyao/cocoapods-privacy | spec/command/privacy_spec.rb | Ruby | mit | 211 | main | 261 | require File.expand_path('../../spec_helper', __FILE__)
module Pod
describe Command::Privacy do
describe 'CLAide' do
it 'registers it self' do
Command.parse(%w{ privacy }).should.be.instance_of Command::Privacy
end
end
end
end |
github | ymoyao/cocoapods-privacy | https://github.com/ymoyao/cocoapods-privacy | lib/cocoapods-privacy/command.rb | Ruby | mit | 211 | main | 1,159 | ### common
require 'cocoapods-privacy/common/config'
require 'cocoapods-privacy/common/BBSpec'
require 'cocoapods-privacy/common/BBSpecManager'
### privacy
require 'cocoapods-privacy/command/privacy'
require 'cocoapods-privacy/command/privacy/config'
require 'cocoapods-privacy/command/privacy/install'
require 'cocoap... |
github | ymoyao/cocoapods-privacy | https://github.com/ymoyao/cocoapods-privacy | lib/cocoapods-privacy/command/install.rb | Ruby | mit | 211 | main | 2,438 | require 'cocoapods-privacy/command'
#### 以下是隐私协议部分 ####
module Pod
class Config
attr_accessor :privacy_folds
attr_accessor :is_privacy
attr_accessor :is_query
attr_accessor :is_all
end
end
module Pod
class Command
class Install < Command
class << self
... |
github | ymoyao/cocoapods-privacy | https://github.com/ymoyao/cocoapods-privacy | lib/cocoapods-privacy/command/privacy.rb | Ruby | mit | 211 | main | 689 | module Pod
class Command
class Privacy < Command
def initialize(argv)
super
end
def run
if PrivacyUtils.isMainProject
puts "检测到#{PrivacyUtils.project_path || ""}工程文件, 请使用 pod privacy install 对工程进行隐私清单创建和自动检索"
elsif PrivacyUtils.podspec_file_path
puts... |
github | ymoyao/cocoapods-privacy | https://github.com/ymoyao/cocoapods-privacy | lib/cocoapods-privacy/command/privacy/install.rb | Ruby | mit | 211 | main | 1,588 | module Pod
class Command
class Privacy < Command
class Install < Privacy
self.summary = '在工程中创建对应隐私清单文件'
self.description = <<-DESC
1、在工程Resources 文件夹下创建隐私清单文件
2、搜索对应组件,补全隐私Api部分
3、只处理隐私Api部分,隐私权限相关需要自行处理!!!
DESC
... |
github | ymoyao/cocoapods-privacy | https://github.com/ymoyao/cocoapods-privacy | lib/cocoapods-privacy/command/privacy/config.rb | Ruby | mit | 211 | main | 2,100 | require 'cocoapods-privacy/command'
module Pod
class Command
class Privacy < Command
class Config < Privacy
self.summary = '初始化隐私清单配置'
self.description = <<-DESC
初始化隐私清单配置,包含必须的隐私api模版,和source 黑白名单等,配置文件格式详细见 #{"https://github.com/ymoyao/cocoapods-privacy"}
... |
github | ymoyao/cocoapods-privacy | https://github.com/ymoyao/cocoapods-privacy | lib/cocoapods-privacy/command/privacy/spec.rb | Ruby | mit | 211 | main | 1,067 | module Pod
class Command
class Privacy < Command
class Spec < Privacy
self.summary = '根据 podspec 创建对应隐私清单文件'
self.description = <<-DESC
根据podspec 创建对应隐私清单文件,并自动修改podspec文件,以映射对应隐私清单文件。
DESC
self.arguments = [
CLAide:... |
github | ymoyao/cocoapods-privacy | https://github.com/ymoyao/cocoapods-privacy | lib/cocoapods-privacy/command/confuse/spec.rb | Ruby | mit | 211 | main | 1,019 | module Pod
class Command
class Confuse < Command
class Spec < Confuse
self.summary = '根据 podspec 创建对应混淆文件'
self.description = <<-DESC
根据podspec 创建对应混淆文件,并自动修改podspec文件。
DESC
self.arguments = [
CLAide::Argument.new('p... |
github | ymoyao/cocoapods-privacy | https://github.com/ymoyao/cocoapods-privacy | lib/cocoapods-privacy/confuse/ConfuseModule.rb | Ruby | mit | 211 | main | 7,287 | require 'cocoapods-privacy/command'
require 'cocoapods-core/specification/dsl/attribute_support'
require 'cocoapods-core/specification/dsl/attribute'
require 'xcodeproj'
require 'plist'
require 'yaml'
module ConfuseModule
public
# 处理组件
def self.load_module(podspec_file_path)
# puts "podspec_file_path = #{p... |
github | ymoyao/cocoapods-privacy | https://github.com/ymoyao/cocoapods-privacy | lib/cocoapods-privacy/confuse/confuse_specification_hook.rb | Ruby | mit | 211 | main | 2,516 | require 'cocoapods-core/specification/root_attribute_accessors'
require 'cocoapods-privacy/command'
module Pod
# The Specification provides a DSL to describe a Pod. A pod is defined as a
# library originating from a source. A specification can support detailed
# attributes for modules of code through subs... |
github | ymoyao/cocoapods-privacy | https://github.com/ymoyao/cocoapods-privacy | lib/cocoapods-privacy/confuse/ConfuseHunter.rb | Ruby | mit | 211 | main | 23,812 | require 'json'
require 'cocoapods-privacy/command'
require 'securerandom'
require 'active_support/core_ext/module/attribute_accessors'
##
# 功能介绍:
# 1、检索到的混淆内容转换成加密议格式写入 混淆文件
##
module Confuse
class Hunter
# 类变量,用于缓存版本号
def initialize(version)
@version = version
end
def search_need... |
github | ymoyao/cocoapods-privacy | https://github.com/ymoyao/cocoapods-privacy | lib/cocoapods-privacy/confuse/confuse_installer_hook.rb | Ruby | mit | 211 | main | 12,946 | require 'active_support/core_ext/string/inflections'
require 'fileutils'
require 'cocoapods/podfile'
require 'cocoapods-privacy/command'
module Pod
# The Installer is responsible of taking a Podfile and transform it in the
# Pods libraries. It also integrates the user project so the Pods
# libraries can be used ... |
github | ymoyao/cocoapods-privacy | https://github.com/ymoyao/cocoapods-privacy | lib/cocoapods-privacy/confuse/SwiftCallAssembly.rb | Ruby | mit | 211 | main | 975 | module Confuse
class SwiftCallAssembly
#method_confuse 用来替换掉函数名 儒 BB_Confuse_asdasfas
#swift 完整函数 如 @objc public func calculateAreaWithWidth(width: (Bool, String) -> Void, height: CGFloat) -> CGFloat
#params 参数名数组 width, height
def self.assembly(method_confuse,swift_method_declarat... |
github | ymoyao/cocoapods-privacy | https://github.com/ymoyao/cocoapods-privacy | lib/cocoapods-privacy/confuse/ConfuseUtils.rb | Ruby | mit | 211 | main | 4,087 | require 'digest'
require 'cocoapods-privacy/command'
module ConfuseUtils
def self.confuse_name
"bb_c_o_f_u_s_e.h"
end
def self.confuse_pch_name
"bb_pre_head_cf.pch"
end
def self.confuse_folder
"Confuse"
end
# xcode工程地址
def self.project_path
matching_fil... |
github | ymoyao/cocoapods-privacy | https://github.com/ymoyao/cocoapods-privacy | lib/cocoapods-privacy/confuse/ObjCMethodAPIConverter.rb | Ruby | mit | 211 | main | 8,194 | module Confuse
class ObjCMethodAPIConverter
# Regular expression to match Objective-C method declarations
# def initialize
# @blockRegex = /#{ConfuseUtils.oc_block_regular}/
# @regex = /#{ConfuseUtils.noneBlock}/
@param_regex = /(\w+):\s*\(([^:]+)\)(\w+)/x
# end
... |
github | ymoyao/cocoapods-privacy | https://github.com/ymoyao/cocoapods-privacy | lib/cocoapods-privacy/privacy/PrivacyHunter.rb | Ruby | mit | 211 | main | 12,860 | require 'json'
require 'cocoapods-privacy/command'
##
# 功能介绍:
# 1、检测本地隐私协议清单模版是否最新,如果不存在或不是最新,那么下载远端隐私协议模版
# 2、使用模版对相关文件夹进行检索
# 3、检索到的内容转换成隐私协议格式写入 隐私清单文件 PrivacyInfo.xcprivacy
##
module PrivacyHunter
KTypes = "NSPrivacyAccessedAPITypes"
KType = "NSPrivacyAccessedAPIType"
KReasons = "NSPrivacyAccessed... |
github | ymoyao/cocoapods-privacy | https://github.com/ymoyao/cocoapods-privacy | lib/cocoapods-privacy/privacy/privacy_installer_hook.rb | Ruby | mit | 211 | main | 6,856 | require 'active_support/core_ext/string/inflections'
require 'fileutils'
require 'cocoapods/podfile'
require 'cocoapods-privacy/command'
module Pod
# The Installer is responsible of taking a Podfile and transform it in the
# Pods libraries. It also integrates the user project so the Pods
# libraries can be used ... |
github | ymoyao/cocoapods-privacy | https://github.com/ymoyao/cocoapods-privacy | lib/cocoapods-privacy/privacy/PrivacyLog.rb | Ruby | mit | 211 | main | 763 | require 'cocoapods-privacy/command'
module PrivacyLog
# 提示log 存放地址
def self.result_log_tip()
puts "详细log请查看 #{PrivacyUtils.cache_log_file} 文件"
end
# 写入结果log 文件
def self.write_to_result_log(log)
log_file_path = PrivacyUtils.cache_log_file
is_create = PrivacyUtils.create_fil... |
github | ymoyao/cocoapods-privacy | https://github.com/ymoyao/cocoapods-privacy | lib/cocoapods-privacy/privacy/privacy_specification_hook.rb | Ruby | mit | 211 | main | 2,820 | require 'cocoapods-core/specification/root_attribute_accessors'
module Pod
# The Specification provides a DSL to describe a Pod. A pod is defined as a
# library originating from a source. A specification can support detailed
# attributes for modules of code through subspecs.
#
# Usually it is stor... |
github | ymoyao/cocoapods-privacy | https://github.com/ymoyao/cocoapods-privacy | lib/cocoapods-privacy/privacy/PrivacyModule.rb | Ruby | mit | 211 | main | 2,866 | require 'cocoapods-privacy/command'
require 'cocoapods-core/specification/dsl/attribute_support'
require 'cocoapods-core/specification/dsl/attribute'
require 'xcodeproj'
module PrivacyModule
public
# 处理工程
def self.load_project(folds,exclude_folds)
project_path = PrivacyUtils.project_path()
resources_fo... |
github | ymoyao/cocoapods-privacy | https://github.com/ymoyao/cocoapods-privacy | lib/cocoapods-privacy/privacy/PrivacyUtils.rb | Ruby | mit | 211 | main | 3,397 | require 'digest'
require 'cocoapods-privacy/command'
module PrivacyUtils
def self.privacy_name
'PrivacyInfo.xcprivacy'
end
# 通过是否包含podspec 来判断是否为主工程
def self.isMainProject
!(podspec_file_path && !podspec_file_path.empty?)
end
# 查找podspec
def self.podspec_file_path
b... |
github | ymoyao/cocoapods-privacy | https://github.com/ymoyao/cocoapods-privacy | lib/cocoapods-privacy/common/config.rb | Ruby | mit | 211 | main | 1,850 | require 'cocoapods-privacy/command'
require 'digest'
module Common
class Config
def initialize()
load_config_content_if_exist()
end
def api_template_url
load_config_content_if_exist()
return @json['api.template.url'] || ""
end
... |
github | ymoyao/cocoapods-privacy | https://github.com/ymoyao/cocoapods-privacy | lib/cocoapods-privacy/common/BBSpecManager.rb | Ruby | mit | 211 | main | 5,942 | require 'cocoapods-privacy/command'
module BB
class BBSpecManager
def initialize(type)
@type = type
end
def check(podspec_file_path)
# Step 1: 读取podspec
lines = read_podspec(podspec_file_path)
# Step 2: 逐行解析并转位BBRow 模型
... |
github | ymoyao/cocoapods-privacy | https://github.com/ymoyao/cocoapods-privacy | lib/cocoapods-privacy/common/BBSpec.rb | Ruby | mit | 211 | main | 8,650 | require 'cocoapods-privacy/command'
KSpecTypePrivacy = 'bb_privacy'
KSpecTypeConfuse = 'bb_confuse'
KSource_Files_Key = 'source_files' #不存在单数 source_file
KExclude_Files_Key = 'exclude_files' #不存在单数 exclude_file
KResource_Bundle_Key = 'resource_bundle' #resource_bundle 和 resource_bundles 这两个参数本质上是一样的,resource_bundle... |
github | captn3m0/jekyll-sqlite | https://github.com/captn3m0/jekyll-sqlite | Gemfile | Ruby | mit | 211 | main | 321 | # frozen_string_literal: true
source "https://rubygems.org"
# Specify your gem's dependencies in jekyll-sqlite.gemspec
gemspec
# These are development dependencies
gem "erb", "~> 6.0"
gem "jekyll", "~> 4.4", ">= 4.4.1"
gem "logger", "~> 1.7"
gem "rake", "~> 13.3"
gem "rubocop", "~> 1.80"
gem "rubocop-rake", "~> 0.7" |
github | captn3m0/jekyll-sqlite | https://github.com/captn3m0/jekyll-sqlite | Rakefile | Ruby | mit | 211 | main | 3,413 | # frozen_string_literal: true
require "bundler/gem_tasks"
require "rubocop/rake_task"
require "jekyll"
require "sqlite3"
RuboCop::RakeTask.new
def assert(cond, msg = "Assertion Failed")
raise msg unless cond
end
def query_db(query)
db = SQLite3::Database.new "_db/northwind.db"
db.results_as_hash = true
resu... |
github | captn3m0/jekyll-sqlite | https://github.com/captn3m0/jekyll-sqlite | jekyll-sqlite.gemspec | Ruby | mit | 211 | main | 1,082 | # frozen_string_literal: true
require_relative "lib/jekyll-sqlite/version"
Gem::Specification.new do |spec|
spec.name = "jekyll-sqlite"
spec.license = "MIT"
spec.version = Jekyll::Sqlite::VERSION
spec.authors = ["Nemo"]
spec.email = ["jekyll-sqlite@captnemo.in"]
spec.summary = "A Jekyll plugin to use SQL... |
github | captn3m0/jekyll-sqlite | https://github.com/captn3m0/jekyll-sqlite | lib/jekyll-sqlite/generator.rb | Ruby | mit | 211 | main | 3,578 | # frozen_string_literal: true
require "sqlite3"
module JekyllSQlite
# Main generator class
class Generator < Jekyll::Generator
# Set to high to be higher than the Jekyll Datapages Plugin
priority :high
def get_database(file)
return @db[file] if @db.key?(file)
@db[file] = SQLite3::Databas... |
github | sandro/specjour | https://github.com/sandro/specjour | specjour.gemspec | Ruby | mit | 211 | master | 1,069 | lib = File.expand_path('../lib/', __FILE__)
$:.unshift lib unless $:.include?(lib)
require 'specjour'
Gem::Specification.new do |s|
s.required_rubygems_version = '>= 1.3.6'
s.version = Specjour::VERSION
s.name = 'specjour'
s.authors = ['Sandro Turriate']
s.email = 'sandro.turriate@gmail.com'
s.homepage... |
github | sandro/specjour | https://github.com/sandro/specjour | Rakefile | Ruby | mit | 211 | master | 672 | require 'bundler/gem_tasks'
require "bundler/setup"
# require 'rspec/core/rake_task'
# RSpec::Core::RakeTask.new(:spec)
# RSpec::Core::RakeTask.new(:rcov)
# task :default => :spec
# begin
# require 'yard'
# YARD::Rake::YardocTask.new
# rescue LoadError
# task :yardoc do
# abort "YARD is not available. In ... |
github | sandro/specjour | https://github.com/sandro/specjour | lib/specjour_plugin.rb | Ruby | mit | 211 | master | 201 | require "specjour/plugin/rails"
require "specjour/plugin/rspec"
Specjour.plugin_manager.register_plugin Specjour::Plugin::Rails.new
Specjour.plugin_manager.register_plugin Specjour::Plugin::RSpec.new |
github | sandro/specjour | https://github.com/sandro/specjour | lib/specjour.rb | Ruby | mit | 211 | master | 2,980 | autoload :URI, 'uri'
autoload :Forwardable, 'forwardable'
autoload :Timeout, 'timeout'
autoload :Benchmark, 'benchmark'
autoload :Logger, 'logger'
autoload :Socket, 'socket'
autoload :StringIO, 'stringio'
autoload :OpenStruct, 'ostruct'
autoload :Pathname, 'pathname'
module Specjour
autoload :CLI, 'specjour/cli'
a... |
github | sandro/specjour | https://github.com/sandro/specjour | lib/specjour/printer.rb | Ruby | mit | 211 | master | 8,677 | module Specjour
class Printer
require 'dnssd'
include Logger
include SocketHelper
attr_reader :host, :port, :clients
attr_accessor :tests_to_run, :test_paths, :example_size, :examples_complete, :profiler, :machines
Thread.abort_on_exception = true
def initialize(options={})
@opti... |
github | sandro/specjour | https://github.com/sandro/specjour | lib/specjour/formatter.rb | Ruby | mit | 211 | master | 4,142 | module Specjour
class Formatter
include Colors
# description, status [pending,failed,passed] file_path, line_number, exception => [class, message, backtrace]
STATUSES = Hash.new({char: "?", color: :cyan}).merge!(
"passed" => {char: ".", color: :green},
"failed" => {char: "F", color: :red},
... |
github | sandro/specjour | https://github.com/sandro/specjour | lib/specjour/loader.rb | Ruby | mit | 211 | master | 2,775 | module Specjour
require 'specjour/worker'
class Loader
include Logger
include SocketHelper
attr_reader \
:options,
:quiet,
:task,
:worker_pids
def initialize(options = {})
@options = options
@task = options[:task]
@quiet = options[:quiet]
@worker_pid... |
github | sandro/specjour | https://github.com/sandro/specjour | lib/specjour/configuration.rb | Ruby | mit | 211 | master | 1,464 | module Specjour
class Configuration
attr_accessor :options
DEFAULT_BACKTRACE_EXCLUSION = Regexp.union([
"/lib/specjour/",
/lib\/rspec\/(core|expectations|matchers|mocks)/,
"/gems/",
"spec/spec_helper.rb",
"spec/rails_helper.rb",
"bin/"
]).freeze
DEFAULT_OPTIONS = ... |
github | sandro/specjour | https://github.com/sandro/specjour | lib/specjour/rspec_formatter.rb | Ruby | mit | 211 | master | 414 | module Specjour
require 'rspec/core/formatters/json_formatter'
class RspecFormatter < ::RSpec::Core::Formatters::JsonFormatter
def hostname
@hostname ||= Socket.gethostname
end
def close(_notification=nil)
@output_hash[:examples].each do |e|
e[:hostname] = hostname
e[:worke... |
github | sandro/specjour | https://github.com/sandro/specjour | lib/specjour/cli.rb | Ruby | mit | 211 | master | 2,980 | module Specjour
require 'optparse'
class CLI
include Logger
COMMANDS = %w(listen ls stop)
attr_accessor :options
def initialize
self.options = {}
end
def stop_running_listener
listener = Listener.new
if listener.started?
listener.stop
end
listener
... |
github | sandro/specjour | https://github.com/sandro/specjour | lib/specjour/protocol.rb | Ruby | mit | 211 | master | 473 | module Specjour
module Protocol
def recv_data
bytes = socket.gets.to_i
string = socket.read(bytes)
debug "recv_string #{bytes} #{string.inspect} #{socket.inspect}"
if !string.empty?
Marshal.load(string)
end
end
def send_data(data)
mdata = Marshal.dump(data)
... |
github | sandro/specjour | https://github.com/sandro/specjour | lib/specjour/socket_helper.rb | Ruby | mit | 211 | master | 1,089 | module Specjour
module SocketHelper
Socket.do_not_reverse_lookup = true
def connection
return @connection if connection?
@connection = Connection.new Specjour.configuration.printer_uri
@connection.connect
@connection
end
def connection?
!@connection.nil?
end
de... |
github | sandro/specjour | https://github.com/sandro/specjour | lib/specjour/logger.rb | Ruby | mit | 211 | master | 783 | module Specjour
module Logger
def log(msg)
Specjour.logger.info(self.class.name) { format(msg) }
end
def debug(msg)
Specjour.logger.debug(self.class.name) { format("#{msg}\n\t#{called_from}") }
end
private
def format(msg)
prefix = Specjour.configuration.worker_number > 0 ... |
github | sandro/specjour | https://github.com/sandro/specjour | lib/specjour/rsync_daemon.rb | Ruby | mit | 211 | master | 2,597 | module Specjour
class RsyncDaemon
require 'fileutils'
include SocketHelper
include Logger
# Corresponds to the version of specjour that changed the configuration
# file.
CONFIG_VERSION = "0.5.0".freeze
CONFIG_FILE_NAME = "rsyncd.conf"
PID_FILE_NAME = "rsyncd.pid"
attr_reader :pro... |
github | sandro/specjour | https://github.com/sandro/specjour | lib/specjour/fork.rb | Ruby | mit | 211 | master | 481 | module Specjour::Fork
module_function
# fork, but don't run the parent's exit handlers
# The one exit handler we lose however, is the printing out
# of exceptions, so reincorporate that.
def fork
Kernel.fork do
at_exit { exit! }
begin
yield
rescue Exception => e
$stderr... |
github | sandro/specjour | https://github.com/sandro/specjour | lib/specjour/colors.rb | Ruby | mit | 211 | master | 371 | module Specjour
module Colors
VT100_COLORS = {
:black => 30,
:red => 31,
:green => 32,
:yellow => 33,
:blue => 34,
:magenta => 35,
:cyan => 36,
:white => 37
}
def colorize(text, color)
if output.tty?
"\e[#{VT100_COLORS[color]}m#{text}\e[0m"
... |
github | sandro/specjour | https://github.com/sandro/specjour | lib/specjour/listener.rb | Ruby | mit | 211 | master | 5,401 | module Specjour
class Listener
require 'dnssd'
require 'fileutils'
Thread.abort_on_exception = true
LOCK_FILE = "listener.lock"
include Logger
include SocketHelper
attr_accessor :options, :printer
def self.ensure_started
listener = new
unless listener.started?
l... |
github | sandro/specjour | https://github.com/sandro/specjour | lib/specjour/worker.rb | Ruby | mit | 211 | master | 1,869 | module Specjour
class Worker
include Logger
include Protocol
include SocketHelper
attr_reader :number, :options
def initialize(options = {})
Specjour.trap_interrupt_with_exit
ARGV.replace []
@options = options
@number = options[:number].to_i
Specjour.configuration.w... |
github | sandro/specjour | https://github.com/sandro/specjour | lib/specjour/cpu.rb | Ruby | mit | 211 | master | 431 | module Specjour
module CPU
def self.cores
case platform
when /darwin/
command('hostinfo') =~ /^(\d+).+physically/
$1.to_i
when /linux/
command('grep --count processor /proc/cpuinfo').to_i
end
end
def self.half_cores
cores / 2
end
protected
... |
github | sandro/specjour | https://github.com/sandro/specjour | lib/specjour/connection.rb | Ruby | mit | 211 | master | 3,035 | module Specjour
class Connection
include Logger
include Protocol
extend Forwardable
attr_reader :uri, :retries
attr_writer :socket
def_delegators :socket, :flush, :close, :closed?, :each, :eof?, :tty?
def self.wrap(established_connection)
host, port = established_connection.peerad... |
github | sandro/specjour | https://github.com/sandro/specjour | lib/specjour/plugin/rails_v3.rb | Ruby | mit | 211 | master | 833 | module Specjour
module Plugin
module RailsV3
def versioned_load_application
load "active_record/railties/databases.rake"
Rake::Task.define_task(:environment) unless Rake::Task.task_defined?(:environment)
Rake::Task.define_task(:rails_env) unless Rake::Task.task_defined?(:rails_env)
... |
github | sandro/specjour | https://github.com/sandro/specjour | lib/specjour/plugin/rspec_v2.rb | Ruby | mit | 211 | master | 2,230 | module Specjour
module Plugin
module RSpecV2
# stub out the summary stream because the specjour socket raises an error
# when trying to handled unstructured messages
def self.extended(klass)
if defined?(::RSpec::Core::Formatters::DeprecationFormatter::ImmediatePrinter)
::RSpec... |
github | sandro/specjour | https://github.com/sandro/specjour | lib/specjour/plugin/rails_v4.rb | Ruby | mit | 211 | master | 984 | module Specjour
module Plugin
module RailsV4
def versioned_load_application
# require File.expand_path("config/environment", Dir.pwd)
load "active_record/railties/databases.rake"
ActiveRecord::Tasks::DatabaseTasks.database_configuration = ::Rails.application.config.database_configur... |
github | sandro/specjour | https://github.com/sandro/specjour | lib/specjour/plugin/rspec_v3.rb | Ruby | mit | 211 | master | 1,925 | module Specjour
module Plugin
module RSpecV3
::RSpec::Core::Formatters.register Specjour::RspecFormatter, :message, :dump_summary, :dump_profile, :stop, :close
def versioned_load_application
# require File.expand_path("spec/rails_helper", Dir.pwd)
@configuration_options = ::RSpec::Co... |
github | sandro/specjour | https://github.com/sandro/specjour | lib/specjour/plugin/ssh.rb | Ruby | mit | 211 | master | 474 | module Specjour
module Plugin
class SSH < Base
def initialize
end
def after_loader_fork
# hosts.each do |host|
# host.connect
# host.rsync
# host.load_plugins
# host.load_application
# host.launch_workers
# host.proxy_tests!
... |
github | sandro/specjour | https://github.com/sandro/specjour | lib/specjour/plugin/rails.rb | Ruby | mit | 211 | master | 1,092 | module Specjour::Plugin
class Rails < Base
def load_application
log "Loading rails plugin"
if File.exists?("./config/application.rb")
bundle_install
ENV["RAILS_ENV"] ||= "test"
require File.expand_path("config/application", Dir.pwd)
# require File.expand_path("config/... |
github | sandro/specjour | https://github.com/sandro/specjour | lib/specjour/plugin/base.rb | Ruby | mit | 211 | master | 839 | module Specjour
module Plugin
class Base
include SocketHelper
include Specjour::Logger
attr_reader :listener, :loader, :worker
def after_register
end
def before_suite
end
def after_suite
end
def before_loader_fork
end
def load_applicati... |
github | sandro/specjour | https://github.com/sandro/specjour | lib/specjour/plugin/manager.rb | Ruby | mit | 211 | master | 574 | module Specjour::Plugin
class Manager
include Specjour::Logger
attr_reader :plugins
def initialize
@plugins = []
end
def register_plugin(plugin, position=-1)
if !plugins.include?(plugin)
plugins.insert(position, plugin)
end
end
def clear_plugins
plugins.c... |
github | sandro/specjour | https://github.com/sandro/specjour | lib/specjour/plugin/rspec.rb | Ruby | mit | 211 | master | 4,005 | module Specjour
module Plugin
class RSpec < Base
FILE_RE = /_spec\.rb/
Specjour::Configuration.make_option(:rspec_rerun)
Specjour.configuration.rspec_rerun = true
attr_reader :rerunner
def initialize
@all_specs = {}
end
def interrupted!
if defined?(:... |
github | sandro/specjour | https://github.com/sandro/specjour | spec/specjour_spec.rb | Ruby | mit | 211 | master | 2,569 | require 'spec_helper'
class CustomException < RuntimeError
end
def boo
raise CustomException, 'fails'
end
# shared_examples "a collection" do
# it "responds to #each" do
# expect(collection).to respond_to(:each)
# end
# end
# shared_examples "a passing example" do
# it "works" do
# expect(true).to... |
github | sandro/specjour | https://github.com/sandro/specjour | spec/spec_helper.rb | Ruby | mit | 211 | master | 323 | $LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'specjour'
require 'rspec/autorun'
require 'rr'
require 'fakefs/spec_helpers'
class NullObject
def method_missing(name, *args)
self
end
end
RSpec.configure do |config|
config.mock_with :rr
e... |
github | sandro/specjour | https://github.com/sandro/specjour | spec/specjour/cpu_spec.rb | Ruby | mit | 211 | master | 809 | require 'spec_helper'
describe Specjour::CPU do
context "on a Mac" do
let(:hostinfo) do
%(
Mach kernel version:
Darwin Kernel Version 10.2.0: Tue Nov 3 10:37:10 PST 2009; root:xnu-1486.2.11~1/RELEASE_I386
Kernel configured for up to 2 processors.
440 processors are physically available.
220 processors a... |
github | sandro/specjour | https://github.com/sandro/specjour | spec/specjour/printer_spec.rb | Ruby | mit | 211 | master | 6,086 | require 'spec_helper'
describe Specjour::Printer do
include FakeFS::SpecHelpers::All
def makefs(paths)
FakeFS do
paths.each do |k,v|
FileUtils.mkdir_p k
Dir.chdir k do
v.each do |file|
file = File.expand_path(file, Dir.pwd)
if String === file
... |
github | sandro/specjour | https://github.com/sandro/specjour | spec/specjour/configuration_spec.rb | Ruby | mit | 211 | master | 3,806 | require 'spec_helper'
require 'rspec/core/formatters/progress_formatter'
module RailsAndActiveRecordDefined
def self.extended(base)
base.class_eval do
before do
rails = Module.new do
def self.version
"3.0.0"
end
end
Object.const_set(:Rails, rails)
... |
github | sandro/specjour | https://github.com/sandro/specjour | spec/specjour/loader_spec.rb | Ruby | mit | 211 | master | 2,875 | require 'spec_helper'
describe Specjour::Loader do
describe "#spec_files" do
before do
stub(Dir).pwd { '/home/someone/myproject' }
stub(Dir).chdir
end
it "finds all specs in spec/ by default" do
mock(Dir).[]("/myproject/spec/**/*_spec.rb") { ["/myproject/spec/foo_spec.rb"] }
loa... |
github | sandro/specjour | https://github.com/sandro/specjour | spec/specjour/cli_spec.rb | Ruby | mit | 211 | master | 4,706 | require 'spec_helper'
describe Specjour::CLI do
subject { Specjour::CLI.new }
let(:fake_pid) { 100_000_000 }
before do
stub(Specjour::CPU).cores.returns(27)
end
describe "#listen" do
let(:manager) { NullObject.new }
before do
stub(Dir).pwd { '/home/someone/myproject' }
end
def ma... |
github | sandro/specjour | https://github.com/sandro/specjour | spec/specjour/rsync_daemon_spec.rb | Ruby | mit | 211 | master | 2,326 | require 'spec_helper'
describe Specjour::RsyncDaemon do
subject do
Specjour::RsyncDaemon.new('/tmp/seasonal', 'seasonal', 23456)
end
before do
stub(Kernel).system
stub(Kernel).at_exit
stub(Dir).chdir
stub(File).open
stub(File).read
stub(FileUtils).rm
stub(Process).kill
end
s... |
github | ruby-passkeys/devise-passkeys | https://github.com/ruby-passkeys/devise-passkeys | devise-passkeys.gemspec | Ruby | mit | 212 | main | 1,743 | # frozen_string_literal: true
require_relative "lib/devise/passkeys/version"
Gem::Specification.new do |spec|
spec.name = "devise-passkeys"
spec.version = Devise::Passkeys::VERSION
spec.authors = ["Thomas Cannon"]
spec.email = ["tcannon00@gmail.com"]
spec.summary = "Use passkeys instead of passwords for De... |
github | ruby-passkeys/devise-passkeys | https://github.com/ruby-passkeys/devise-passkeys | Gemfile | Ruby | mit | 212 | main | 473 | # frozen_string_literal: true
source "https://rubygems.org"
# Specify your gem's dependencies in devise-passkeys.gemspec
gemspec
group :development, :test do
gem "appraisal"
gem "debug"
gem "rake", "~> 13.0"
gem "rubocop", "~> 1.21"
gem "webrick"
gem "yard"
end
group :test do
gem "database_cleaner-act... |
github | ruby-passkeys/devise-passkeys | https://github.com/ruby-passkeys/devise-passkeys | lib/devise/passkeys.rb | Ruby | mit | 212 | main | 1,742 | # frozen_string_literal: true
require "devise"
require "warden/webauthn"
require_relative "passkeys/rails"
require_relative "passkeys/model"
require_relative "passkeys/controllers"
require_relative "passkeys/passkey_issuer"
require_relative "passkeys/strategy"
require_relative "passkeys/reauthentication_strategy"
requ... |
github | ruby-passkeys/devise-passkeys | https://github.com/ruby-passkeys/devise-passkeys | lib/devise/passkeys/controllers.rb | Ruby | mit | 212 | main | 2,649 | # frozen_string_literal: true
require_relative "controllers/concerns/reauthentication"
require_relative "controllers/concerns/reauthentication_challenge"
require_relative "controllers/sessions_controller_concern"
require_relative "controllers/registrations_controller_concern"
require_relative "controllers/reauthentica... |
github | ruby-passkeys/devise-passkeys | https://github.com/ruby-passkeys/devise-passkeys | lib/devise/passkeys/strategy.rb | Ruby | mit | 212 | main | 1,780 | # frozen_string_literal: true
require "devise/strategies/authenticatable"
require_relative "passkey_issuer"
module Devise
module Strategies
class PasskeyAuthenticatable < Authenticatable
include Warden::WebAuthn::StrategyHelpers
def store?
super && !mapping.to.skip_session_storage.include?(... |
github | ruby-passkeys/devise-passkeys | https://github.com/ruby-passkeys/devise-passkeys | lib/devise/passkeys/reauthentication_strategy.rb | Ruby | mit | 212 | main | 635 | # frozen_string_literal: true
require "devise/strategies/authenticatable"
require_relative "passkey_issuer"
module Devise
module Strategies
class PasskeyReauthentication < PasskeyAuthenticatable
def authentication_challenge_key
"#{mapping.singular}_current_reauthentication_challenge"
end
... |
github | ruby-passkeys/devise-passkeys | https://github.com/ruby-passkeys/devise-passkeys | lib/devise/passkeys/model.rb | Ruby | mit | 212 | main | 681 | # frozen_string_literal: true
module Devise
module Models
# This is the actual module that gets included in your
# model when you include `:passkey_authenticatable` in the
# `devise` call (eg: `devise :passkey_authenticatable, ...`).
module PasskeyAuthenticatable
# This is a callback that is ca... |
github | ruby-passkeys/devise-passkeys | https://github.com/ruby-passkeys/devise-passkeys | lib/devise/passkeys/passkey_issuer.rb | Ruby | mit | 212 | main | 1,411 | # frozen_string_literal: true
module Devise
module Passkeys
class PasskeyIssuer
def self.build
new
end
def create_and_return_passkey(resource:, label:, webauthn_credential:, extra_attributes: {})
# rubocop:disable Lint/UselessAssignment
passkey_class = passkey_class(res... |
github | ruby-passkeys/devise-passkeys | https://github.com/ruby-passkeys/devise-passkeys | lib/devise/passkeys/controllers/sessions_controller_concern.rb | Ruby | mit | 212 | main | 1,108 | # frozen_string_literal: true
module Devise
module Passkeys
module Controllers
module SessionsControllerConcern
extend ActiveSupport::Concern
included do
include Warden::WebAuthn::AuthenticationInitiationHelpers
include Warden::WebAuthn::RackHelpers
# Prepend... |
github | ruby-passkeys/devise-passkeys | https://github.com/ruby-passkeys/devise-passkeys | lib/devise/passkeys/controllers/reauthentication_controller_concern.rb | Ruby | mit | 212 | main | 6,442 | # frozen_string_literal: true
module Devise
module Passkeys
module Controllers
# This concern is responsible for handling reauthentication.
# It should be included in any controller that handles reauthentication, and defines:
#
# - Useful methods to assist with the reauthentication proces... |
github | ruby-passkeys/devise-passkeys | https://github.com/ruby-passkeys/devise-passkeys | lib/devise/passkeys/controllers/passkeys_controller_concern.rb | Ruby | mit | 212 | main | 5,018 | # frozen_string_literal: true
module Devise
module Passkeys
module Controllers
module PasskeysControllerConcern
extend ActiveSupport::Concern
included do
include Devise::Passkeys::Controllers::Concerns::Reauthentication
include Devise::Passkeys::Controllers::Concerns::R... |
github | ruby-passkeys/devise-passkeys | https://github.com/ruby-passkeys/devise-passkeys | lib/devise/passkeys/controllers/registrations_controller_concern.rb | Ruby | mit | 212 | main | 10,803 | # frozen_string_literal: true
module Devise
module Passkeys
module Controllers
# This concern should be included in any controller that handles
# user (`resource`) registration management (ie: signup/deleting an account),
# and defines:
#
# - Useful methods and before filters to str... |
github | ruby-passkeys/devise-passkeys | https://github.com/ruby-passkeys/devise-passkeys | lib/devise/passkeys/controllers/concerns/reauthentication_challenge.rb | Ruby | mit | 212 | main | 2,097 | # frozen_string_literal: true
module Devise
module Passkeys
module Controllers
module Concerns
# This concern is responsible for storing the reauthentication challenge in the session.
#
# A reauthentication challenge is a WebAuthn challenge exchange (i.e. authentication)
# t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.