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
ananace/ruby-matrix-sdk
https://github.com/ananace/ruby-matrix-sdk
lib/matrix_sdk/util/uri.rb
Ruby
mit
93
master
2,926
# frozen_string_literal: true require 'uri' module URI # A mxc:// Matrix content URL class MXC < Generic def full_path select(:host, :port, :path, :query, :fragment) .compact .join end end # TODO: Use +register_scheme+ on Ruby >=3.1 and fall back to old behavior # for older Ru...
github
ananace/ruby-matrix-sdk
https://github.com/ananace/ruby-matrix-sdk
lib/matrix_sdk/util/extensions.rb
Ruby
mit
93
master
1,737
# frozen_string_literal: true unless Object.respond_to? :yield_self class Object def yield_self yield(self) end end end module MatrixSdk module Extensions def events(*symbols) module_name = "#{name}Events" initializers = [] readers = [] methods = [] symbols.each...
github
ananace/ruby-matrix-sdk
https://github.com/ananace/ruby-matrix-sdk
lib/matrix_sdk/util/tinycache_adapter.rb
Ruby
mit
93
master
1,844
# frozen_string_literal: true module MatrixSdk::Util class TinycacheAdapter extend MatrixSdk::Extensions attr_accessor :config, :client ignore_inspect :client def initialize @config = {} clear end def read(key) cache[key]&.value end def write(key, value, expire...
github
ananace/ruby-matrix-sdk
https://github.com/ananace/ruby-matrix-sdk
lib/matrix_sdk/util/account_data_cache.rb
Ruby
mit
93
master
2,173
# frozen_string_literal: true module MatrixSdk::Util class AccountDataCache extend MatrixSdk::Extensions extend MatrixSdk::Util::Tinycache include Enumerable attr_reader :client, :room attr_accessor :cache_time ignore_inspect :client, :room, :tinycache_adapter def initialize(client, r...
github
ananace/ruby-matrix-sdk
https://github.com/ananace/ruby-matrix-sdk
lib/matrix_sdk/util/state_event_cache.rb
Ruby
mit
93
master
2,511
# frozen_string_literal: true module MatrixSdk::Util class StateEventCache extend MatrixSdk::Extensions extend MatrixSdk::Util::Tinycache include Enumerable attr_reader :room attr_accessor :cache_time ignore_inspect :client, :room, :tinycache_adapter def initialize(room, cache_time: 3...
github
ananace/ruby-matrix-sdk
https://github.com/ananace/ruby-matrix-sdk
lib/matrix_sdk/bot/base.rb
Ruby
mit
93
master
27,121
# frozen_string_literal: true require 'shellwords' module MatrixSdk::Bot class Base extend MatrixSdk::Extensions RequestHandler = Struct.new('RequestHandler', :command, :type, :proc, :data) do def command? type == :command end def event? type == :event end de...
github
ananace/ruby-matrix-sdk
https://github.com/ananace/ruby-matrix-sdk
lib/matrix_sdk/bot/main.rb
Ruby
mit
93
master
2,393
# frozen_string_literal: true module MatrixSdk::Bot PARAMS_CONFIG = {} # rubocop:disable Style/MutableConstant Intended require 'optparse' parser = OptionParser.new do |op| op.on('-s homeserver', 'Specify homeserver') { |val| PARAMS_CONFIG[:homeserver] = val } op.on('-T token', 'Token') { |val| PARAMS_...
github
ananace/ruby-matrix-sdk
https://github.com/ananace/ruby-matrix-sdk
lib/matrix_sdk/protocols/is.rb
Ruby
mit
93
master
920
# frozen_string_literal: true module MatrixSdk::Protocols::IS def identity_status request(:get, :identity_api_v1, '/') end def identity_get_pubkey(id) id = ERB::Util.url_encode id.to_s request(:get, :identity_api_v1, "/pubkey/#{id}") end def identity_pubkey_isvalid(key, ephemeral: false) i...
github
ananace/ruby-matrix-sdk
https://github.com/ananace/ruby-matrix-sdk
lib/matrix_sdk/protocols/ss.rb
Ruby
mit
93
master
358
# frozen_string_literal: true module MatrixSdk::Protocols::SS # Gets the server version def server_version MatrixSdk::Response.new(self, request(:get, :federation_v1, '/version').server).tap do |resp| resp.instance_eval <<-'CODE', __FILE__, __LINE__ + 1 def to_s "#{name} #{version}" ...
github
ananace/ruby-matrix-sdk
https://github.com/ananace/ruby-matrix-sdk
lib/matrix_sdk/protocols/msc.rb
Ruby
mit
93
master
4,953
# frozen_string_literal: true # Preliminary support for unmerged MSCs (Matrix Spec Changes) module MatrixSdk::Protocols::MSC def refresh_mscs @msc = {} end # Check if there's support for MSC2108 - Sync over Server Sent Events def msc2108? @msc ||= {} @msc[2108] ||= \ begin request(:g...
github
ananace/ruby-matrix-sdk
https://github.com/ananace/ruby-matrix-sdk
lib/matrix_sdk/protocols/cs.rb
Ruby
mit
93
master
86,004
# frozen_string_literal: true # rubocop:disable Metrics/ModuleLength module MatrixSdk::Protocols::CS # Gets the available client API versions # @return [Array] # # @example Getting API versions # api.client_api_versions # # => [ 'r0.1.0', 'r0.2.0', ... # api.client_api_versions.latest # # => 'l...
github
shr3jn/fastlane-plugin-huawei_appgallery_connect
https://github.com/shr3jn/fastlane-plugin-huawei_appgallery_connect
fastlane-plugin-huawei_appgallery_connect.gemspec
Ruby
mit
93
master
1,415
# coding: utf-8 lib = File.expand_path("../lib", __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'fastlane/plugin/huawei_appgallery_connect/version' Gem::Specification.new do |spec| spec.name = 'fastlane-plugin-huawei_appgallery_connect' spec.version = Fastlane::HuaweiAppg...
github
shr3jn/fastlane-plugin-huawei_appgallery_connect
https://github.com/shr3jn/fastlane-plugin-huawei_appgallery_connect
lib/fastlane/plugin/huawei_appgallery_connect.rb
Ruby
mit
93
master
513
require 'fastlane/plugin/huawei_appgallery_connect/version' module Fastlane module HuaweiAppgalleryConnect # Return all .rb files inside the "actions" and "helper" directory def self.all_classes Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))] end end end # By default we...
github
shr3jn/fastlane-plugin-huawei_appgallery_connect
https://github.com/shr3jn/fastlane-plugin-huawei_appgallery_connect
lib/fastlane/plugin/huawei_appgallery_connect/helper/huawei_appgallery_connect_helper.rb
Ruby
mit
93
master
17,647
require 'fastlane_core/ui/ui' require 'cgi' require 'time' module Fastlane UI = FastlaneCore::UI unless Fastlane.const_defined?("UI") module Helper class HuaweiAppgalleryConnectHelper def self.get_token(client_id, client_secret) UI.important("Fetching app access token") uri = URI('https...
github
shr3jn/fastlane-plugin-huawei_appgallery_connect
https://github.com/shr3jn/fastlane-plugin-huawei_appgallery_connect
lib/fastlane/plugin/huawei_appgallery_connect/actions/huawei_appgallery_connect_update_app_localization.rb
Ruby
mit
93
master
2,496
require 'fastlane/action' require_relative '../helper/huawei_appgallery_connect_helper' module Fastlane module Actions class HuaweiAppgalleryConnectUpdateAppLocalizationAction < Action def self.run(params) token = Helper::HuaweiAppgalleryConnectHelper.get_token(params[:client_id], params[:client_se...
github
shr3jn/fastlane-plugin-huawei_appgallery_connect
https://github.com/shr3jn/fastlane-plugin-huawei_appgallery_connect
lib/fastlane/plugin/huawei_appgallery_connect/actions/huawei_appgallery_connect_set_gms_dependency.rb
Ruby
mit
93
master
2,769
require 'fastlane/action' require_relative '../helper/huawei_appgallery_connect_helper' module Fastlane module Actions class HuaweiAppgalleryConnectSetGmsDependencyAction < Action def self.run(params) token = Helper::HuaweiAppgalleryConnectHelper.get_token(params[:client_id], params[:client_secret...
github
shr3jn/fastlane-plugin-huawei_appgallery_connect
https://github.com/shr3jn/fastlane-plugin-huawei_appgallery_connect
lib/fastlane/plugin/huawei_appgallery_connect/actions/huawei_appgallery_connect_get_app_info.rb
Ruby
mit
93
master
2,517
require 'fastlane/action' require_relative '../helper/huawei_appgallery_connect_helper' module Fastlane module Actions module SharedValues ANDROID_APPGALLERY_APP_INFO = :ANDROID_APPGALLERY_APP_INFO end class HuaweiAppgalleryConnectGetAppInfoAction < Action def self.run(params) token ...
github
shr3jn/fastlane-plugin-huawei_appgallery_connect
https://github.com/shr3jn/fastlane-plugin-huawei_appgallery_connect
lib/fastlane/plugin/huawei_appgallery_connect/actions/huawei_appgallery_connect_action.rb
Ruby
mit
93
master
11,327
require 'fastlane/action' require_relative '../helper/huawei_appgallery_connect_helper' module Fastlane module Actions class HuaweiAppgalleryConnectAction < Action def self.run(params) token = Helper::HuaweiAppgalleryConnectHelper.get_token(params[:client_id], params[:client_secret]) if to...
github
shr3jn/fastlane-plugin-huawei_appgallery_connect
https://github.com/shr3jn/fastlane-plugin-huawei_appgallery_connect
lib/fastlane/plugin/huawei_appgallery_connect/actions/huawei_appgallery_connect_get_app_id.rb
Ruby
mit
93
master
2,533
require 'fastlane/action' require_relative '../helper/huawei_appgallery_connect_helper' module Fastlane module Actions module SharedValues ANDROID_APPGALLERY_APP_ID = :ANDROID_APPGALLERY_APP_ID end class HuaweiAppgalleryConnectGetAppIdAction < Action def self.run(params) token = Help...
github
shr3jn/fastlane-plugin-huawei_appgallery_connect
https://github.com/shr3jn/fastlane-plugin-huawei_appgallery_connect
lib/fastlane/plugin/huawei_appgallery_connect/actions/huawei_appgallery_connect_submit_for_review.rb
Ruby
mit
93
master
5,800
require 'fastlane/action' require_relative '../helper/huawei_appgallery_connect_helper' module Fastlane module Actions class HuaweiAppgalleryConnectSubmitForReviewAction < Action def self.run(params) token = Helper::HuaweiAppgalleryConnectHelper.get_token(params[:client_id], params[:client_secret])...
github
shr3jn/fastlane-plugin-huawei_appgallery_connect
https://github.com/shr3jn/fastlane-plugin-huawei_appgallery_connect
spec/spec_helper.rb
Ruby
mit
93
master
469
$LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__)) require 'simplecov' # SimpleCov.minimum_coverage 95 SimpleCov.start # This module is only used to check the environment is currently a testing env module SpecHelper end require 'fastlane' # to import the Action super class require 'fastlane/plugin/huawei_a...
github
shr3jn/fastlane-plugin-huawei_appgallery_connect
https://github.com/shr3jn/fastlane-plugin-huawei_appgallery_connect
spec/huawei_appgallery_connect_action_spec.rb
Ruby
mit
93
master
299
describe Fastlane::Actions::HuaweiAppgalleryConnectAction do describe '#run' do it 'prints a message' do expect(Fastlane::UI).to receive(:message).with("The huawei_appgallery_connect plugin is working!") Fastlane::Actions::HuaweiAppgalleryConnectAction.run(nil) end end end
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
pragmatic_tokenizer.gemspec
Ruby
mit
93
master
1,026
lib = File.expand_path('lib', __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'pragmatic_tokenizer/version' Gem::Specification.new do |spec| spec.name = "pragmatic_tokenizer" spec.version = PragmaticTokenizer::VERSION spec.authors = ["Kevin S. Dias"] spec.email ...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
lib/pragmatic_tokenizer/languages.rb
Ruby
mit
93
master
1,965
require 'pragmatic_tokenizer/languages/common' require 'pragmatic_tokenizer/languages/english' require 'pragmatic_tokenizer/languages/arabic' require 'pragmatic_tokenizer/languages/bulgarian' require 'pragmatic_tokenizer/languages/catalan' require 'pragmatic_tokenizer/languages/czech' require 'pragmatic_tokenizer/lang...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
lib/pragmatic_tokenizer/tokenizer.rb
Ruby
mit
93
master
12,198
require 'set' require 'cgi' require 'pragmatic_tokenizer/regex' require 'pragmatic_tokenizer/languages' require 'pragmatic_tokenizer/pre_processor' require 'pragmatic_tokenizer/post_processor' require 'unicode' module PragmaticTokenizer class Tokenizer PUNCTUATION_OPTIONS = Set.new(%i[all semi none only])...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
lib/pragmatic_tokenizer/pre_processor.rb
Ruby
mit
93
master
2,114
module PragmaticTokenizer module PreProcessor def pre_process(language: Languages::Common) remove_non_breaking_space! shift_various_characters! replace_colon_in_url! shift_remaining_colons! shift_hashtag! convert_double_quotes! convert_single_quotes!(language) conv...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
lib/pragmatic_tokenizer/post_processor.rb
Ruby
mit
93
master
2,605
module PragmaticTokenizer class PostProcessor DOT = '.'.freeze attr_reader :text, :abbreviations, :downcase def initialize(text:, abbreviations:, downcase:) @text = text @abbreviations = abbreviations @downcase = downcase end # Every #flat_map will increas...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
lib/pragmatic_tokenizer/regex.rb
Ruby
mit
93
master
7,558
module PragmaticTokenizer class Regex # Things that can or should be done: # - check where the use of unicode categories helps (\p{Abbreviation}) # - use URI.parse and other libraries instead of regexp to identify urls, domains, emails # - check multiple domain regex, we have spec issues when using o...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
lib/pragmatic_tokenizer/languages/greek.rb
Ruby
mit
93
master
1,494
module PragmaticTokenizer module Languages module Greek include Languages::Common ABBREVIATIONS = Set.new([]).freeze STOP_WORDS = Set.new(%w[μή ἑαυτοῦ ἄν ἀλλ’ ἀλλά ἄλλοσ ἀπό ἄρα αὐτόσ δ’ δέ δή διά δαί δαίσ ἔτι ἐγώ ἐκ ἐμόσ ἐν ἐπί εἰ εἰμί εἴμι εἰσ γάρ γε γα^ ἡ ἤ καί κατά μέν μετά μή ὁ ὅδε ὅσ ὅσ...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
lib/pragmatic_tokenizer/languages/polish.rb
Ruby
mit
93
master
2,933
module PragmaticTokenizer module Languages module Polish include Languages::Common ABBREVIATIONS = Set.new(['ags', 'alb', 'ang', 'aor', 'awest', 'bałt', 'bojkow', 'bret', 'brus', 'bsł', 'bułg', 'c.b.d.o', 'c.b.d.u', 'celt', 'chorw', 'cs', 'czakaw', 'czerw', 'czes', 'dłuż', 'dniem', 'dor', 'dubrow', 'd...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
lib/pragmatic_tokenizer/languages/english.rb
Ruby
mit
93
master
11,653
module PragmaticTokenizer module Languages module English include Languages::Common ABBREVIATIONS = Set.new(%w[adj adm adv al ala alta apr arc ariz ark art assn asst attys aug ave bart bld bldg blvd brig bros btw cal calif capt cl cmdr co col colo comdr con conn corp cpl cres ct d.phil dak dec del dep...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
lib/pragmatic_tokenizer/languages/italian.rb
Ruby
mit
93
master
20,454
module PragmaticTokenizer module Languages module Italian include Languages::Common ABBREVIATIONS = Set.new(['1°', 'a.c', 'a.c/a', 'a.cam', 'a.civ', 'a.cor', 'a.d.r', 'a.gov', 'a.mil', 'a.mon', 'a.smv', 'a.v', 'a/a', 'a/c', 'a/i', 'aa', 'aaaa', 'aaal', 'aacst', 'aamct', 'aams', 'aar', 'aato', 'ab', 'a...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
lib/pragmatic_tokenizer/languages/bulgarian.rb
Ruby
mit
93
master
3,075
module PragmaticTokenizer module Languages module Bulgarian include Languages::Common ABBREVIATIONS = Set.new(%w[акад ал б.р б.ред бел.а бел.пр бр бул в вж вкл вм вр г ген гр дж дм доц др ем заб зам инж к.с кв кв.м кг км кор куб куб.м л лв м м.г мин млн млрд мм н.с напр пл полк проф р рис с св сек см ...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
lib/pragmatic_tokenizer/languages/turkish.rb
Ruby
mit
93
master
1,740
module PragmaticTokenizer module Languages module Turkish include Languages::Common ABBREVIATIONS = Set.new([]).freeze STOP_WORDS = Set.new(%w[acaba altmış altı ama ancak arada aslında ayrıca bana bazı belki ben benden beni benim beri beş bile bin bir birçok biri birkaç birkez birşey birşeyi ...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
lib/pragmatic_tokenizer/languages/dutch.rb
Ruby
mit
93
master
1,986
module PragmaticTokenizer module Languages module Dutch include Languages::Common ABBREVIATIONS = Set.new([]).freeze STOP_WORDS = Set.new(%w[aan af al als bij dan dat die dit een en er had heb hem het hij hoe hun ik in is je kan me men met mij nog nu of ons ook te tot uit van was wat we wel w...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
lib/pragmatic_tokenizer/languages/deutsch.rb
Ruby
mit
93
master
6,501
module PragmaticTokenizer module Languages module Deutsch include Languages::Common ABBREVIATIONS = Set.new(%w[a a.d a.k.a a.s.a.p abg alt apr art aug b b.a b.s best bgm bldg btw buchst bzgl bzw c ca co d d.d d.h d.r dergl dez dgl dr dr dt dzt e e.l e.u e.v ehem eig etc etc.p.p eu europ ev ev evtl f f...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
lib/pragmatic_tokenizer/languages/finnish.rb
Ruby
mit
93
master
5,945
module PragmaticTokenizer module Languages module Finnish include Languages::Common ABBREVIATIONS = Set.new([]).freeze STOP_WORDS = Set.new(%w[aiemmin aika aikaa aikaan aikaisemmin aikaisin aikajen aikana aikoina aikoo aikovat aina ainakaan ainakin ainoa ainoat aiomme aion aiotte aist aivan a...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
lib/pragmatic_tokenizer/languages/portuguese.rb
Ruby
mit
93
master
2,952
module PragmaticTokenizer module Languages module Portuguese include Languages::Common ABBREVIATIONS = Set.new([]).freeze STOP_WORDS = Set.new(%w[acerca agora algmas alguns ali ambos antes apontar aquela aquelas aquele aqueles aqui atrás bem bom cada caminho cima com como comprido conhecido corr...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
lib/pragmatic_tokenizer/languages/latvian.rb
Ruby
mit
93
master
1,696
module PragmaticTokenizer module Languages module Latvian include Languages::Common ABBREVIATIONS = Set.new([]).freeze STOP_WORDS = Set.new(["aiz", "ap", "ar", "apakš", "ārpus", "augšpus", "bez", "caur", "dēļ", "gar", "iekš", "iz", "kopš", "labad", "lejpus", "līdz", "no", "otrpus", "pa", "par", ...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
lib/pragmatic_tokenizer/languages/danish.rb
Ruby
mit
93
master
551
module PragmaticTokenizer module Languages module Danish include Languages::Common ABBREVIATIONS = Set.new([]).freeze STOP_WORDS = Set.new(%w[De I af aldrig alle altid bagved de der du efter eller en endnu et fjernt for foran fra få gennem god han her hos hovfor hun hurtig hvad hvem hvonår hv...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
lib/pragmatic_tokenizer/languages/catalan.rb
Ruby
mit
93
master
1,282
module PragmaticTokenizer module Languages module Catalan include Languages::Common ABBREVIATIONS = Set.new([]).freeze STOP_WORDS = Set.new(["a", "abans", "algun", "alguna", "algunes", "alguns", "altre", "amb", "ambdós", "anar", "ans", "aquell", "aquelles", "aquells", "aquí", "bastant", "bé", "c...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
lib/pragmatic_tokenizer/languages/romanian.rb
Ruby
mit
93
master
1,869
module PragmaticTokenizer module Languages module Romanian include Languages::Common ABBREVIATIONS = Set.new([]).freeze STOP_WORDS = Set.new(%w[acea aceasta această aceea acei aceia acel acela acele acelea acest acesta aceste acestea aceşti aceştia acolo acord acum ai aia aibă aici al ăla ale...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
lib/pragmatic_tokenizer/languages/norwegian.rb
Ruby
mit
93
master
883
module PragmaticTokenizer module Languages module Norwegian include Languages::Common ABBREVIATIONS = Set.new([]).freeze STOP_WORDS = Set.new(%w[alle andre arbeid av bare begge bli bort bra bruk bruke da deg denne der deres det dette din disse du eller en ene eneste enhver enn er et folk for ...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
lib/pragmatic_tokenizer/languages/russian.rb
Ruby
mit
93
master
5,208
module PragmaticTokenizer module Languages module Russian include Languages::Common ABBREVIATIONS = Set.new(%w[y y.e а авт адм.-терр акад в вв вкз вост.-европ г гг гос гр д деп дисс дол долл ежедн ж жен з зап зап.-европ заруб и ин иностр инст к канд кв кг куб л л.h л.н м мин моск муж н нед о п пгт пер...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
lib/pragmatic_tokenizer/languages/indonesian.rb
Ruby
mit
93
master
2,912
module PragmaticTokenizer module Languages module Indonesian include Languages::Common ABBREVIATIONS = Set.new([]).freeze STOP_WORDS = Set.new(%w[ada adanya adalah adapun agak agaknya agar akan akankah akhirnya aku akulah amat amatlah anda andalah antar diantaranya antara antaranya diantara a...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
lib/pragmatic_tokenizer/languages/czech.rb
Ruby
mit
93
master
2,518
module PragmaticTokenizer module Languages module Czech include Languages::Common ABBREVIATIONS = Set.new([]).freeze STOP_WORDS = Set.new(%w[ačkoli ahoj ale anebo ano asi aspoň během bez beze blízko bohužel brzo bude budeme budeš budete budou budu byl byla byli bylo byly bys čau chce chceme c...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
lib/pragmatic_tokenizer/languages/french.rb
Ruby
mit
93
master
5,765
module PragmaticTokenizer module Languages module French include Languages::Common ABBREVIATIONS = Set.new(%w[a.c.n a.m al ann apr art auj av b.p boul c.-à-d c.n c.n.s c.p.i c.q.f.d c.s ca cf ch.-l chap co contr dir e.g e.v env etc ex fasc fig fr fém hab i.e ibid id inf l.d lib ll.aa ll.aa.ii ll.aa.rr...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
lib/pragmatic_tokenizer/languages/swedish.rb
Ruby
mit
93
master
2,723
module PragmaticTokenizer module Languages module Swedish include Languages::Common ABBREVIATIONS = Set.new([]).freeze STOP_WORDS = Set.new(%w[aderton adertonde adjö aldrig alla allas allt alltid alltså än andra andras annan annat ännu artonde artonn åtminstone att åtta åttio åttionde åttonde...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
lib/pragmatic_tokenizer/languages/persian.rb
Ruby
mit
93
master
3,171
module PragmaticTokenizer module Languages module Persian include Languages::Common ABBREVIATIONS = Set.new([]).freeze STOP_WORDS = Set.new(%w[و در به از كه مي اين است را با هاي براي آن يك شود شده خود ها كرد شد اي تا كند بر بود گفت نيز وي هم كنند دارد ما كرده يا اما بايد دو اند هر خواهد او مو...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
lib/pragmatic_tokenizer/languages/slovak.rb
Ruby
mit
93
master
1,122
module PragmaticTokenizer module Languages module Slovak include Languages::Common ABBREVIATIONS = Set.new([]).freeze STOP_WORDS = Set.new(%w[a aby aj ak ako ale alebo and ani áno asi až bez bude budem budeš budeme budete budú by bol bola boli bolo byť cez čo či ďalší ďalšia ďalšie dnes do ho...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
lib/pragmatic_tokenizer/languages/common.rb
Ruby
mit
93
master
1,629
module PragmaticTokenizer module Languages module Common PUNCTUATION_MAP = { "。" => "♳", "." => "♴", "." => "♵", "!" => "♶", "!" => "♷", "?" => "♸", "?" => "♹", "、" => "♺", "¡" => "⚀", "¿" => "⚁", "„" => "⚂", "“" => "⚃", "[" => "⚄", "]" => "⚅", "\"" => "☇", "#" => "☈", "$" => "☉", "%" => "☊", "&" => "☋", "(...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
lib/pragmatic_tokenizer/languages/spanish.rb
Ruby
mit
93
master
6,436
module PragmaticTokenizer module Languages module Spanish include Languages::Common ABBREVIATIONS = Set.new(["a", "a.c", "a/c", "abr", "adj", "admón", "aero", "afmo", "ago", "almte", "ambi", "an", "anfi", "ante", "anti", "ap", "apdo", "archi", "arci", "arq", "art", "atte", "auto", "av", "avda", "bco",...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
lib/pragmatic_tokenizer/languages/arabic.rb
Ruby
mit
93
master
1,749
module PragmaticTokenizer module Languages module Arabic include Languages::Common ABBREVIATIONS = Set.new(['ا', 'ا. د', 'ا.د', 'ا.ش.ا', 'ا.ش.ا', 'إلخ', 'ت.ب', 'ت.ب', 'ج.ب', 'جم', 'ج.ب', 'ج.م.ع', 'ج.م.ع', 'س.ت', 'س.ت', 'سم', 'ص.ب.', 'ص.ب', 'كج.', 'كلم.', 'م', 'م.ب', 'م.ب', 'ه', 'د‪']).freeze STO...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
spec/pragmatic_tokenizer_spec.rb
Ruby
mit
93
master
1,695
require 'spec_helper' describe PragmaticTokenizer do it 'has a version number' do expect(PragmaticTokenizer::VERSION).not_to be nil end describe '#initialize' do it 'raises an error if the text argument is nil' do -> { expect(PragmaticTokenizer::Tokenizer.new(nil, language: 'en').tokenize).to rais...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
spec/performance_spec.rb
Ruby
mit
93
master
9,200
require 'benchmark' require 'spec_helper' require 'stackprof' describe PragmaticTokenizer do # Speed benchmarks tests # it 'is fast?' do # string = "Hello World. My name is Jonas. What is your name? My name is Jonas. There it is! I found it. My name is Jonas E. Smith. Please turn to p. 55. Were Jane and co. a...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
spec/languages/french_spec.rb
Ruby
mit
93
master
379
require 'spec_helper' describe PragmaticTokenizer do context 'Language: French (fr)' do it 'tokenizes a string #001' do text = "D'art de l'univers, c'est un art" pt = PragmaticTokenizer::Tokenizer.new( language: 'fr' ) expect(pt.tokenize(text)).to eq(["d'", "art", "de", "l'", "u...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
spec/languages/english_spec.rb
Ruby
mit
93
master
77,546
require 'spec_helper' describe PragmaticTokenizer do context 'Language: English (en)' do context '#tokenize (example strings)' do context 'no options selected' do it 'tokenizes a string #001' do text = "Hello world." pt = PragmaticTokenizer::Tokenizer.new expect(pt.tok...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
spec/languages/deutsch_spec.rb
Ruby
mit
93
master
8,975
require 'spec_helper' describe PragmaticTokenizer do context 'Language: German (de)' do it 'tokenizes a string #001' do text = 'Das steht auf S. 23, s. vorherige Anmerkung.' expect(PragmaticTokenizer::Tokenizer.new(language: 'de').tokenize(text)).to eq(['das', 'steht', 'auf', 's.', '23', ',', 's.', '...
github
diasks2/pragmatic_tokenizer
https://github.com/diasks2/pragmatic_tokenizer
spec/languages/bulgarian_spec.rb
Ruby
mit
93
master
2,096
require 'spec_helper' describe PragmaticTokenizer do context 'Language: Bulgarian (bg)' do it 'tokenizes a string #001' do text = 'Стойностни, вкл. български и руски' pt = PragmaticTokenizer::Tokenizer.new( language: 'bg' ) expect(pt.tokenize(text)).to eq(["стойностни", ",", "вк...
github
khiav223577/rails_or
https://github.com/khiav223577/rails_or
rails_or.gemspec
Ruby
mit
93
master
1,951
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'rails_or/version' Gem::Specification.new do |spec| spec.name = 'rails_or' spec.version = RailsOr::VERSION spec.authors = ['khiav reoy'] spec.email = ['khiav22...
github
khiav223577/rails_or
https://github.com/khiav223577/rails_or
test/test_helper.rb
Ruby
mit
93
master
280
require 'simplecov' SimpleCov.start 'test_frameworks' $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) require 'rails_or' require 'minitest/autorun' ActiveRecord::Base.establish_connection( 'adapter' => 'sqlite3', 'database' => ':memory:', ) require 'lib/seeds'
github
khiav223577/rails_or
https://github.com/khiav223577/rails_or
test/rails_or_test.rb
Ruby
mit
93
master
13,428
require 'test_helper' class RailsOrTest < Minitest::Test def setup end def test_that_it_has_a_version_number refute_nil ::RailsOr::VERSION end # ---------------------------------------------------------------- # ● Parameter check # ---------------------------------------------------------------- ...
github
khiav223577/rails_or
https://github.com/khiav223577/rails_or
test/lib/seeds.rb
Ruby
mit
93
master
1,898
ActiveRecord::Schema.define do self.verbose = false create_table :users, force: true do |t| t.string :name t.string :email t.text :serialized_attribute end create_table :posts, force: true do |t| t.integer :user_id t.string :title t.datetime :start_time end create_table :user_mess...
github
khiav223577/rails_or
https://github.com/khiav223577/rails_or
test/lib/models/user.rb
Ruby
mit
93
master
885
# frozen_string_literal: true class User < ActiveRecord::Base if Gem::Version.new(ActiveRecord::VERSION::STRING) < Gem::Version.new('7.1.0') serialize :serialized_attribute, Hash else serialize :serialized_attribute, type: Hash end has_many :posts has_many :sent_messages, class_name: 'UserMessag...
github
khiav223577/rails_or
https://github.com/khiav223577/rails_or
lib/rails_or.rb
Ruby
mit
93
master
2,459
require 'rails_or/version' require 'rails_or/where_binding_mixs' require 'active_record' require 'rails_or/patches/null_relation' if defined?(ActiveRecord::NullRelation) require 'rails_or/active_record/extension' module RailsOr IS_RAILS3_FLAG = Gem::Version.new(ActiveRecord::VERSION::STRING) < Gem::Version.new('4.0....
github
khiav223577/rails_or
https://github.com/khiav223577/rails_or
lib/rails_or/where_binding_mixs.rb
Ruby
mit
93
master
1,044
class RailsOr::WhereBindingMixs attr_reader :where_values attr_reader :bind_values def initialize(where_values, bind_values) @where_values = where_values @bind_values = bind_values end def +(other) self.class.new(@where_values + other.where_values, @bind_values + other.bind_values) end def ...
github
khiav223577/rails_or
https://github.com/khiav223577/rails_or
lib/rails_or/active_record/extension.rb
Ruby
mit
93
master
1,631
class ActiveRecord::Relation if method_defined?(:or) if not method_defined?(:rails5_or) alias rails5_or or def or(*other) rails5_or(RailsOr.parse_parameter(self, *other)) end end else def or(*other) other = RailsOr.parse_parameter(self, *other) combining =...
github
khiav223577/rails_or
https://github.com/khiav223577/rails_or
lib/rails_or/patches/null_relation.rb
Ruby
mit
93
master
211
module ActiveRecord::NullRelation if method_defined?(:or) and not method_defined?(:rails5_or) alias rails5_or or def or(*other) rails5_or(RailsOr.parse_parameter(self, *other)) end end end
github
acrogenesis/owlcarousel-rails
https://github.com/acrogenesis/owlcarousel-rails
owlcarousel-rails.gemspec
Ruby
mit
93
master
995
# -*- encoding: utf-8 -*- require File.expand_path('../lib/owlcarousel-rails/version', __FILE__) Gem::Specification.new do |gem| gem.name = "owlcarousel-rails" gem.version = Owlcarousel::Rails::VERSION gem.authors = ["OwlFonk", "Adrian Rangel"] gem.email = ["adrian.rangel@gmail.com"] gem...
github
Zomato/vinifera
https://github.com/Zomato/vinifera
Gemfile
Ruby
apache-2.0
93
master
1,677
source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby '2.6.6' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 6.0.3.6', '>= 6.0.3.6' # Use postgresql as the database for Active Record gem 'pg', '>= 0.18', '< 2.0' # Use Puma as the app serve...
github
Zomato/vinifera
https://github.com/Zomato/vinifera
app/workers/stray_code_scanner_worker.rb
Ruby
apache-2.0
93
master
925
class StrayCodeScannerWorker include Sidekiq::Worker include Sidekiq::Throttled::Worker sidekiq_throttle_as(:code_scanner_throttler) sidekiq_options queue: :code_scanner, retry: 2 sidekiq_retries_exhausted do |msg, error| if [CodeScanner::ReaperKill, Docker::Error::DockerError].include?(error.class) ...
github
Zomato/vinifera
https://github.com/Zomato/vinifera
app/workers/target_monitor_worker.rb
Ruby
apache-2.0
93
master
1,463
class TargetMonitorWorker include Sidekiq::Worker include Sidekiq::Throttled::Worker sidekiq_options queue: :monitor, retry: 5 sidekiq_throttle(TargetMonitorThrottler.new.throttle_config) sidekiq_retries_exhausted do |msg, error| message = "Error in *TargetMonitorWorker* \n error #{msg}: `#{error}`" ...
github
Zomato/vinifera
https://github.com/Zomato/vinifera
app/workers/notification_worker.rb
Ruby
apache-2.0
93
master
502
class NotificationWorker include Sidekiq::Worker sidekiq_options queue: :notification, retry: 2 sidekiq_retries_exhausted do |msg, error| message = "Error in *NotificationWorker* \n error #{msg}: `#{error}`" SlackNotifier.new.notify(message, SlackNotifier::CHANNELS[:ERROR]) end sidekiq_retry_in do |...
github
Zomato/vinifera
https://github.com/Zomato/vinifera
app/workers/target_revision_monitor_worker.rb
Ruby
apache-2.0
93
master
1,102
class TargetRevisionMonitorWorker include Sidekiq::Worker include Sidekiq::Throttled::Worker sidekiq_throttle_as(:code_scanner_throttler) sidekiq_options queue: :revision_monitor, retry: 5 sidekiq_retries_exhausted do |msg, error| message = "Error in *TargetMonitorWorker* \n error #{msg}: `#{error}`" ...
github
Zomato/vinifera
https://github.com/Zomato/vinifera
app/workers/code_scanner_worker.rb
Ruby
apache-2.0
93
master
1,046
class CodeScannerWorker include Sidekiq::Worker include Sidekiq::Throttled::Worker sidekiq_options queue: :code_scanner, retry: 2 sidekiq_throttle_as(:code_scanner_throttler) sidekiq_retries_exhausted do |msg, error| if [CodeScanner::ReaperKill, Docker::Error::DockerError].include?(error.class) Co...
github
Zomato/vinifera
https://github.com/Zomato/vinifera
app/workers/pager_duty_notification_worker.rb
Ruby
apache-2.0
93
master
1,009
class PagerDutyNotificationWorker include Sidekiq::Worker sidekiq_options queue: :notification, retry: 2 sidekiq_retries_exhausted do |msg, error| message = "Error in *PagerDutyNotificationWorker* \n error #{msg}: `#{error}`" SlackNotifier.new.notify(message, SlackNotifier::CHANNELS[:ERROR]) end sid...
github
Zomato/vinifera
https://github.com/Zomato/vinifera
app/workers/target_monitor_install_worker.rb
Ruby
apache-2.0
93
master
644
class TargetMonitorInstallWorker include Sidekiq::Worker sidekiq_options queue: :monitor_installer, retry: 2 sidekiq_retries_exhausted do |msg, error| message = "Error in *TargetMonitorInstallWorker* \n error #{msg}: `#{error}`" SlackNotifier.new.notify(message, SlackNotifier::CHANNELS[:ERROR]) end ...
github
Zomato/vinifera
https://github.com/Zomato/vinifera
app/workers/commit_scanner_worker.rb
Ruby
apache-2.0
93
master
1,163
class CommitScannerWorker include Sidekiq::Worker include Sidekiq::Throttled::Worker sidekiq_throttle_as(:code_scanner_throttler) sidekiq_options queue: :code_scanner, retry: 2 sidekiq_retries_exhausted do |msg, error| if [CodeScanner::ReaperKill, Docker::Error::DockerError].include?(error.class) ...
github
Zomato/vinifera
https://github.com/Zomato/vinifera
app/services/github_event_tracker_service.rb
Ruby
apache-2.0
93
master
265
class GithubEventTrackerService def register(events) events = [events] unless events.is_a? Array events.present? ? GithubEventTracker.insert_all(events, unique_by: :event_id) : [] end def exists?(attrs) GithubEventTracker.exists?(attrs) end end
github
Zomato/vinifera
https://github.com/Zomato/vinifera
app/services/target_revision_service.rb
Ruby
apache-2.0
93
master
345
class TargetRevisionService def revision_exists?(external_id,revision_id) TargetRevision.find_by(external_id: external_id, revision_id: revision_id) end def latest_revision(external_id) TargetRevision.where(external_id: external_id).last end def add_revision(details) TargetRevision.c...
github
Zomato/vinifera
https://github.com/Zomato/vinifera
app/services/model_metrics.rb
Ruby
apache-2.0
93
master
830
class ModelMetrics include Singleton def push_stats return unless Rails.env.production? continuous_stats = { target_count: Target.count, target_monitor_count: TargetMonitor.count, report_count: Report.count, target_revision_count: TargetRevision.count, target_github_...
github
Zomato/vinifera
https://github.com/Zomato/vinifera
app/services/target_service.rb
Ruby
apache-2.0
93
master
1,608
class TargetService class UnProcessableTarget < Exception; end class RecoverableTarget < Exception; end def register(params) params = [params] unless params.is_a? Array params.present? ? Target.insert_all(params) : [] end def monitor(target_monitor) target = target_monitor.target targe...
github
Zomato/vinifera
https://github.com/Zomato/vinifera
app/services/report_service.rb
Ruby
apache-2.0
93
master
433
class ReportService def create_report(scan_report, target, target_monitor_id) return unless scan_report[:report] Report.create!(target_id: target.id, target_monitor_id: target_monitor_id, run_logs: scan_report[:run_logs], meta_data: scan_report[:report]) end def create_stray_report(scan_report, url) ...
github
Zomato/vinifera
https://github.com/Zomato/vinifera
app/services/sidekiq_metrics.rb
Ruby
apache-2.0
93
master
1,043
class SidekiqMetrics include Singleton def push_stats return unless Rails.env.production? sidekiq_stats = Sidekiq::Stats.new continuous_stats = { enqueued: sidekiq_stats.enqueued, busy: Sidekiq::Workers.new.size, retries: sidekiq_stats.retry_size, dead: sidekiq_stats.dea...
github
Zomato/vinifera
https://github.com/Zomato/vinifera
app/services/github_service/public_commit_processor.rb
Ruby
apache-2.0
93
master
2,248
module GithubService class PublicCommitProcessor def initialize @target_service = TargetService.new @slack_notifier = SlackNotifier.new @github_event_tracker_service = GithubEventTrackerService.new @transformer = GithubEventTrackerTransformer.new end def process(events, target) ...
github
Zomato/vinifera
https://github.com/Zomato/vinifera
app/services/github_service/user/monitor.rb
Ruby
apache-2.0
93
master
734
module GithubService module User class Monitor def initialize(monitor) @github = Github.new @github_gist_syncer = GithubUserGistSyncer.new @github_repo_syncer = GithubUserRepoSyncer.new @github_activity_syncer = GithubUserActivitySyncer.new @monitor = monitor en...
github
Zomato/vinifera
https://github.com/Zomato/vinifera
app/services/github_service/gist/monitor.rb
Ruby
apache-2.0
93
master
1,886
module GithubService module Gist class Monitor def initialize(monitor) @github = Github.new @target_revision_service = TargetRevisionService.new @slack_notifier = SlackNotifier.new @monitor = monitor end def monitor target = @monitor.target return...
github
Zomato/vinifera
https://github.com/Zomato/vinifera
app/services/github_service/commit/content_processor.rb
Ruby
apache-2.0
93
master
650
module GithubService module Commit class ContentProcessor def initialize @github = Github.new end def process(commit_url) commit_data = @github.get(commit_url) return unless commit_data.files commit_data.files.each_with_object([]) do |file,result| resul...
github
Zomato/vinifera
https://github.com/Zomato/vinifera
app/services/github_service/repo/repo_branch_monitor.rb
Ruby
apache-2.0
93
master
2,065
module GithubService module Repo class RepoBranchMonitor SKIPPABLE_DIFF_STATUS = %w[identical behind].freeze def initialize(monitor, opts = {}) @github = Github.new(skip_cache: true) @revision_service = TargetRevisionService.new @slack_notifier = SlackNotifier.new @mon...
github
Zomato/vinifera
https://github.com/Zomato/vinifera
app/services/github_service/repo/source_repo_monitor.rb
Ruby
apache-2.0
93
master
2,020
module GithubService module Repo class SourceRepoMonitor REPORT_SPLIT_SIZE = 4 def initialize(monitor) @github = Github.new @revision_service = TargetRevisionService.new @slack_notifier = SlackNotifier.new @monitor = monitor end def monitor target ...
github
Zomato/vinifera
https://github.com/Zomato/vinifera
app/services/github_service/repo/monitor.rb
Ruby
apache-2.0
93
master
454
module GithubService module Repo class Monitor def initialize(monitor) @monitor = monitor end def monitor target = @monitor.target return unless target.github? && target.repo? if target.meta_exists?("fork") && ENV['VINIFERA_ENABLE_FORK_SCANNING'] ForkRe...
github
Zomato/vinifera
https://github.com/Zomato/vinifera
app/services/github_service/repo/fork_repo_monitor.rb
Ruby
apache-2.0
93
master
684
module GithubService module Repo class ForkRepoMonitor def initialize(monitor) @github = Github.new(skip_cache: true) @monitor = monitor end def monitor target = @monitor.target branches = @github.repo_branches(target.external_id.to_i) branches.each do |b...
github
Zomato/vinifera
https://github.com/Zomato/vinifera
app/services/scan_result_service/scan_result_processor.rb
Ruby
apache-2.0
93
master
982
module ScanResultService class ScanResultProcessor REPORT_SPLIT_SIZE = 1 REPORT_LIMIT = 10 def initialize(opts = {}) @slack_notifier = SlackNotifier.new @report_service = ReportService.new set_options(opts) end protected def process_report(report) reports_processed =...
github
Zomato/vinifera
https://github.com/Zomato/vinifera
app/services/scan_result_service/file_scan_result_processor.rb
Ruby
apache-2.0
93
master
1,168
module ScanResultService class FileScanResultProcessor < ScanResultService::ScanResultProcessor REPORT_SPLIT_SIZE = 1 def initialize(target = nil, monitor = nil) @target = target @monitor = monitor super() end def process(scan_result, target_url) return unless scan_result[:re...
github
Zomato/vinifera
https://github.com/Zomato/vinifera
app/services/scan_result_service/stray_code_scan_result_processor.rb
Ruby
apache-2.0
93
master
1,079
module ScanResultService class StrayCodeScanResultProcessor < ScanResultService::ScanResultProcessor def process(scan_result, url) return unless scan_result[:report] report_data = @report_service.create_stray_report(scan_result, url) process_report(scan_result[:report]) do |report_chunk| ...
github
Zomato/vinifera
https://github.com/Zomato/vinifera
app/services/scan_result_service/code_scan_result_processor.rb
Ruby
apache-2.0
93
master
1,148
module ScanResultService class CodeScanResultProcessor < ScanResultService::ScanResultProcessor REPORT_SPLIT_SIZE = 1 NOTIFY_CHUNK_LIMIT = 10 def initialize(target, monitor) @target = target @monitor = monitor super() end def process(scan_result) return unless scan_result...
github
Zomato/vinifera
https://github.com/Zomato/vinifera
app/models/target_monitor.rb
Ruby
apache-2.0
93
master
789
class TargetMonitor < ApplicationRecord DEFAULT_REPEAT_INTERVAL = 40.minutes belongs_to :target enum monitor_type: { gitleaks: 'gitleaks', user_monitor: 'user_monitor' } def record_last_run updated_meta_data = add_meta_data(last_run: Time.zone.now) update!(meta_data: updated_meta_data) end def f...
github
Zomato/vinifera
https://github.com/Zomato/vinifera
app/models/target.rb
Ruby
apache-2.0
93
master
802
class Target < ApplicationRecord has_many :target_revisions has_many :target_monitors enum target_type: { user: 'user', repo: 'repo', gist: 'gist' } enum status: { active: 'active', archived: 'archived', deleted: 'deleted' } enum provider: { github: 'github' } def add_meta_data!(data) self.meta_data =...
github
Zomato/vinifera
https://github.com/Zomato/vinifera
app/models/report.rb
Ruby
apache-2.0
93
master
248
class Report < ApplicationRecord belongs_to :target after_create_commit -> { PagerDutyNotificationWorker.perform_async(self.class.name, self.id) }, if: -> { ENV['ENABLE_PAGER_DUTY_TRIGGER'] } def report_source self.target.url end end
github
Zomato/vinifera
https://github.com/Zomato/vinifera
app/models/stray_report.rb
Ruby
apache-2.0
93
master
224
class StrayReport < ApplicationRecord after_create_commit -> { PagerDutyNotificationWorker.perform_async(self.class.name, self.id) }, if: -> { ENV['ENABLE_PAGER_DUTY_TRIGGER'] } def report_source self.url end end