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
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/format_quality.rb
Ruby
mit
204
master
443
# frozen_string_literal: true require "imgproxy/options_casters/integer" module Imgproxy module OptionsCasters # Casts `format_quality` info option module FormatQuality def self.cast(raw) return raw unless raw.is_a?(Hash) raw.flat_map do |format, quality| next if quality.nil...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/autoquality.rb
Ruby
mit
204
master
819
# frozen_string_literal: true require "imgproxy/options_casters/group" require "imgproxy/options_casters/string" require "imgproxy/options_casters/integer" require "imgproxy/options_casters/float" module Imgproxy module OptionsCasters # Casts `autoquality` processing option module Autoquality CASTER =...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/array.rb
Ruby
mit
204
master
235
# frozen_string_literal: true module Imgproxy module OptionsCasters # Casts array option module Array def self.cast(raw) return if raw.nil? raw.is_a?(::Array) ? raw : [raw] end end end end
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/extend.rb
Ruby
mit
204
master
756
# frozen_string_literal: true require "imgproxy/options_casters/group" require "imgproxy/options_casters/bool" require "imgproxy/options_casters/gravity" module Imgproxy module OptionsCasters # Casts `extend` processing option module Extend CASTER = Imgproxy::OptionsCasters::Group.new( extend:...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/draw_detections.rb
Ruby
mit
204
master
749
# frozen_string_literal: true require "imgproxy/trim_array" require "imgproxy/options_casters/bool" require "imgproxy/options_casters/array" module Imgproxy module OptionsCasters # Casts `draw_detections` processing option module DrawDetections using TrimArray def self.cast(raw) # Allow...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/options_casters/background.rb
Ruby
mit
204
master
774
# frozen_string_literal: true require "imgproxy/options_casters/group" require "imgproxy/options_casters/integer" require "imgproxy/options_casters/string" module Imgproxy module OptionsCasters # Casts `background` info option module Background CASTER = Imgproxy::OptionsCasters::Group.new( r: ...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/option_aliases/processing.rb
Ruby
mit
204
master
1,787
# frozen_string_literal: true module Imgproxy module OptionAliases PROCESSING = { resize: :rs, size: :s, resizing_type: :rt, resizing_algorithm: :ra, width: :w, height: :h, "min-width": :mw, "min-height": :mh, zoom: :z, enlarge: :el, extend: :ex, ...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/option_aliases/info.rb
Ruby
mit
204
master
692
# frozen_string_literal: true module Imgproxy module OptionAliases INFO = { size: :s, format: :f, dimensions: :d, video_meta: :vm, detect_objects: :do, colorspace: :cs, bands: :b, sample_format: :sf, pages_number: :pn, alpha: :a, crop: :c, p...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/url_adapters/active_storage.rb
Ruby
mit
204
master
1,531
# frozen_string_literal: true module Imgproxy class UrlAdapters # Adapter for ActiveStorage # # Imgproxy.configure do |config| # config.url_adapters.add Imgproxy::UrlAdapters::ActiveStorage.new # end # # Imgproxy.url_for(user.avatar) class ActiveStorage def applicable?...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
lib/imgproxy/url_adapters/shrine.rb
Ruby
mit
204
master
904
# frozen_string_literal: true module Imgproxy class UrlAdapters # Adapter for Shrine # # Imgproxy.configure do |config| # config.url_adapters.add Imgproxy::UrlAdapters::Shrine.new # end # # Imgproxy.url_for(user.avatar) class Shrine def applicable?(image) image...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
spec/url_for_spec.rb
Ruby
mit
204
master
28,434
# frozen_string_literal: true require "spec_helper" RSpec.describe Imgproxy, ".url_for" do subject(:url) { described_class.url_for(src_url, options) } let(:src_url) { "https://images.test/image.jpg" } let(:options) do { resize: { resizing_type: :auto, width: 100, height: "200...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
spec/info_url_for_spec.rb
Ruby
mit
204
master
14,431
# frozen_string_literal: true require "spec_helper" RSpec.describe Imgproxy, ".info_url_for" do subject(:url) { described_class.info_url_for(src_url, options) } let(:src_url) { "https://images.test/image.jpg" } let(:options) do { size: true, format: false, dimensions: true, exif: f...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
spec/rails_helper.rb
Ruby
mit
204
master
816
# frozen_string_literal: true require "spec_helper" require "combustion" begin Combustion.initialize!(:active_storage, :active_record) do config.active_storage.service = :local config.logger = Logger.new(nil) config.log_level = :fatal end rescue => e $stdout.puts "Failed to load the app: #{e.message...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
spec/spec_helper.rb
Ruby
mit
204
master
903
# frozen_string_literal: true begin require "debug" unless ENV["CI"] rescue LoadError end ENV["RAILS_ENV"] = "test" require "imgproxy" RSpec.configure do |config| config.mock_with :rspec config.example_status_persistence_file_path = "tmp/rspec_examples.txt" config.filter_run :focus config.run_all_when_ev...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
spec/url_adapters/active_storage_spec.rb
Ruby
mit
204
master
4,935
# frozen_string_literal: true require "rails_helper" RSpec.describe Imgproxy::UrlAdapters::ActiveStorage do let(:active_storage_service_name) { :local } let(:user) do User.create.tap do |user| user.avatar.attach( io: StringIO.new("AVATAR"), filename: "avatar.jpg", content_type: ...
github
imgproxy/imgproxy.rb
https://github.com/imgproxy/imgproxy.rb
spec/url_adapters/shrine_spec.rb
Ruby
mit
204
master
3,134
# frozen_string_literal: true require "spec_helper" require "shrine" require "shrine/storage/file_system" require "shrine/storage/s3" RSpec.describe Imgproxy::UrlAdapters::Shrine do let(:shrine_storages) do { cache: Shrine::Storage::FileSystem.new("."), store: Shrine::Storage::FileSystem.new("."), ...
github
iancanderson/ingreedy
https://github.com/iancanderson/ingreedy
ingreedy.gemspec
Ruby
mit
203
master
804
require File.expand_path("../lib/ingreedy/version", __FILE__) Gem::Specification.new do |s| s.name = "ingreedy" s.version = Ingreedy::VERSION s.licenses = ["MIT"] s.authors = ["Ian C. Anderson"] s.email = ["ian@iancanderson.com"] s.summary = "Recipe parser" s.description = <<...
github
iancanderson/ingreedy
https://github.com/iancanderson/ingreedy
lib/ingreedy.rb
Ruby
mit
203
master
586
path = File.expand_path(File.join(File.dirname(__FILE__), "ingreedy")) require File.join(path, "case_insensitive_parser") require File.join(path, "ingreedy_parser") require File.join(path, "dictionary_collection") module Ingreedy ParseFailed = Class.new(StandardError) class << self attr_accessor :locale, :pr...
github
iancanderson/ingreedy
https://github.com/iancanderson/ingreedy
lib/ingreedy/unit_variation_mapper.rb
Ruby
mit
203
master
1,215
module Ingreedy class UnitVariationMapper def self.regexp regexp_string = all_variations.map { |v| Regexp.escape(v) }.join("|") Regexp.new(regexp_string, Regexp::IGNORECASE) end def self.all_variations # Return these in order of size, descending # That way, the longer versions wil...
github
iancanderson/ingreedy
https://github.com/iancanderson/ingreedy
lib/ingreedy/amount_parser.rb
Ruby
mit
203
master
1,423
require "parslet" module Ingreedy class AmountParser < Parslet::Parser include CaseInsensitiveParser rule(:whitespace) do match("\s") end rule(:integer) do match("[0-9]").repeat(1) end rule(:float) do integer.maybe >> float_delimiter >> integer end rule(:...
github
iancanderson/ingreedy
https://github.com/iancanderson/ingreedy
lib/ingreedy/root_parser.rb
Ruby
mit
203
master
2,553
module Ingreedy class RootParser < Parslet::Parser rule(:range) do AmountParser.new.as(:amount) >> whitespace.maybe >> range_separator >> whitespace.maybe >> AmountParser.new.as(:amount_end) end rule(:range_separator) do str("-") | str("~") end rule(:a...
github
iancanderson/ingreedy
https://github.com/iancanderson/ingreedy
lib/ingreedy/rationalizer.rb
Ruby
mit
203
master
1,295
module Ingreedy class Rationalizer def self.rationalize(options) new(options).rationalize end def initialize(options) @integer = options.fetch(:integer, nil) @float = options.fetch(:float, nil) @fraction = options.fetch(:fraction, nil) @word = options.fetch(:word, ni...
github
iancanderson/ingreedy
https://github.com/iancanderson/ingreedy
lib/ingreedy/dictionary.rb
Ruby
mit
203
master
885
module Ingreedy class Dictionary attr_reader :units, :numbers, :prepositions def initialize(entries = {}) @units = entries[:units] || raise("No units found in dictionary") @numbers = entries[:numbers] || {} @prepositions = entries[:prepositions] || [] end # https://en.wikipedia.org...
github
iancanderson/ingreedy
https://github.com/iancanderson/ingreedy
lib/ingreedy/dictionary_collection.rb
Ruby
mit
203
master
747
require "yaml" require_relative "dictionary" module Ingreedy class DictionaryCollection def initialize @collection = {} end def []=(locale, attributes) @collection[locale] = Dictionary.new(attributes) end def current @collection[locale] ||= Dictionary.new load_yaml(locale) ...
github
iancanderson/ingreedy
https://github.com/iancanderson/ingreedy
lib/ingreedy/ingreedy_parser.rb
Ruby
mit
203
master
1,832
require "parslet" require_relative "amount_parser" require_relative "rationalizer" require_relative "root_parser" require_relative "unit_variation_mapper" module Ingreedy class Parser attr_reader :original_query Result = Struct.new( :amount, :unit, :container_amount, :container_unit...
github
iancanderson/ingreedy
https://github.com/iancanderson/ingreedy
lib/ingreedy/case_insensitive_parser.rb
Ruby
mit
203
master
217
module Ingreedy module CaseInsensitiveParser def stri(str) key_chars = str.split(//) key_chars. map! { |char| match["#{char.upcase}#{char.downcase}"] }. reduce(:>>) end end end
github
iancanderson/ingreedy
https://github.com/iancanderson/ingreedy
spec/spec_helper.rb
Ruby
mit
203
master
791
if ENV["CI"] require "coveralls" Coveralls.wear! end require "ingreedy" require "parslet/rig/rspec" require "pry" RSpec::Matchers.define :parse_the_unit do |unit| match do |ingreedy_output| ingreedy_output.unit == unit end failure_message do |ingreedy_output| <<-MSG expected to parse the unit ...
github
iancanderson/ingreedy
https://github.com/iancanderson/ingreedy
spec/ingreedy_spec.rb
Ruby
mit
203
master
11,033
# encoding: utf-8 require "spec_helper" describe Ingreedy, ".parse" do it "parses a simple example correctly" do result = Ingreedy.parse("1 lb potatoes") expect(result.amount).to eq(1) expect(result.unit).to eq(:pound) expect(result.ingredient).to eq("potatoes") end end describe Ingreedy, "amount...
github
iancanderson/ingreedy
https://github.com/iancanderson/ingreedy
spec/ingreedy/rationalizer_spec.rb
Ruby
mit
203
master
1,427
# encoding: utf-8 require "spec_helper" describe Ingreedy::Rationalizer do subject { described_class } context "with an integer and a fraction" do it "gives back an improper rational" do rational = subject.rationalize(integer: "1", fraction: "1/2") expect(rational).to eq("3/2".to_r) end end ...
github
iancanderson/ingreedy
https://github.com/iancanderson/ingreedy
spec/ingreedy/unit_variation_mapper_spec.rb
Ruby
mit
203
master
321
require "spec_helper" describe Ingreedy::UnitVariationMapper do subject { described_class } describe ".unit_from_variation" do context "uppercased variation" do it "gives back the correct unit as a symbol" do expect(subject.unit_from_variation("TSP")).to eq(:teaspoon) end end end end
github
iancanderson/ingreedy
https://github.com/iancanderson/ingreedy
spec/ingreedy/amount_parser_spec.rb
Ruby
mit
203
master
2,436
# encoding: utf-8 require "spec_helper" describe Ingreedy::AmountParser do context "given mixed case insensitive english words" do %w(one two three four five six seven eight nine ten eleven twelve).each do |word| word += " " it %(parses a lowercase "#{word}" followed by space) do expect(subje...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
Gemfile
Ruby
mit
203
main
3,641
source "https://rubygems.org" # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" gem "rails", "~> 8.1.2" # The modern asset pipeline for Rails [https://github.com/rails/propshaft] gem "propshaft" # Use sqlite3 as the database for Active Record gem "sqlite3", ">= 2.1" # Use the Puma web ser...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
lib/rails/generators/erb/scaffold/scaffold_generator.rb
Ruby
mit
203
main
1,152
# frozen_string_literal: true require "rails/generators/erb" require "rails/generators/resource_helpers" module Erb # :nodoc: module Generators # :nodoc: class ScaffoldGenerator < Base # :nodoc: include Rails::Generators::ResourceHelpers argument :attributes, type: :array, default: [], banner: "fie...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
app/models/role.rb
Ruby
mit
203
main
1,535
# frozen_string_literal: true # == Schema Information # # Table name: roles # # id :bigint not null, primary key # name :string # permissions :jsonb not null # type :string # value :string # created_at :datetime not null # updated_at :datetime ...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
app/models/user.rb
Ruby
mit
203
main
2,097
# frozen_string_literal: true # == Schema Information # # Table name: users # # id :bigint not null, primary key # admin :boolean default(FALSE) # color_mode :string # color_scheme :string # confirmation_sent_at :datetime # confirmat...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
app/models/space.rb
Ruby
mit
203
main
785
# frozen_string_literal: true # == Schema Information # # Table name: spaces # # id :bigint not null, primary key # name :string # phone :string # email :string # status :integer # address :text # created_at :datetime not null # updated_at :datetime not ...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
app/models/app_settings.rb
Ruby
mit
203
main
871
# frozen_string_literal: true # == Schema Information # # Table name: app_settings # # id :bigint not null, primary key # settings :jsonb not null, default({}) # created_at :datetime not null # updated_at :datetime not null # class AppSettings < ApplicationRecord re...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
app/models/blog_post.rb
Ruby
mit
203
main
2,376
# frozen_string_literal: true class BlogPost DIRECTORY = Rails.root.join("content/blog") attr_reader :filepath def initialize(filepath) @filepath = filepath parse_file end class << self def all Rails.cache.fetch(cache_key) do posts.select(&:published?).sort_by { |post| post.date ...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
app/models/plan.rb
Ruby
mit
203
main
565
# == Schema Information # # Table name: plans # # id :bigint not null, primary key # currency :string not null # description :json # duration :string not null # name :string not null # price :float not null # created_at :datetime ...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
app/models/user_role.rb
Ruby
mit
203
main
543
# frozen_string_literal: true # == Schema Information # # Table name: user_roles # # id :bigint not null, primary key # role_id :bigint not null # space_id :bigint not null # user_id :bigint not null # class UserRole < ApplicationRecord belongs_to :user belongs_t...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
app/models/subscription.rb
Ruby
mit
203
main
450
# == Schema Information # # Table name: subscriptions # # id :bigint not null, primary key # end_date :datetime # seats :integer # start_date :datetime not null # plan_id :bigint not null # space_id :bigint not null # class Subscription < ApplicationRecord...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
app/models/roles/common.rb
Ruby
mit
203
main
447
# frozen_string_literal: true # == Schema Information # # Table name: roles # # id :bigint not null, primary key # name :string # permissions :jsonb not null # type :string # value :string # created_at :datetime not null # updated_at :datetime ...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
app/models/roles/custom.rb
Ruby
mit
203
main
470
# frozen_string_literal: true # == Schema Information # # Table name: roles # # id :bigint not null, primary key # name :string # permissions :jsonb not null # type :string # value :string # created_at :datetime not null # updated_at :datetime ...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
app/services/blog_renderer.rb
Ruby
mit
203
main
441
# frozen_string_literal: true class BlogRenderer def initialize(content) @content = content end def render markdown.render(@content).html_safe end private def markdown renderer = Redcarpet::Render::HTML.new(hard_wrap: true, filter_html: true) Redcarpet::Markdown.new(renderer, { au...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
app/helpers/blog_helper.rb
Ruby
mit
203
main
482
# frozen_string_literal: true module BlogHelper def blog_path(post = nil, page: nil) if page "/blog/page/#{page}" elsif post "/blog/#{post.slug}" else "/blog" end end def formatted_date(date) return "" unless date date.strftime("%B %d, %Y") end def reading_time(co...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
app/helpers/application_helper.rb
Ruby
mit
203
main
1,431
# frozen_string_literal: true module ApplicationHelper include SettingsHelper def render_flash_stream turbo_stream.update "flash", partial: "common/flash" end def nav_bar(&) content_tag(:ul, class: "navbar-nav", &) end def nav_link(path, &) options = current_page?(path) ? { class: "nav-item ...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
app/helpers/settings_helper.rb
Ruby
mit
203
main
1,269
# frozen_string_literal: true module SettingsHelper def login_layout case AppSettings.login_layout when "ILLUSTRATION" "body/login_illustration" when "COVER" "body/login_cover" else "body/login" end end def interface_layout case AppSettings.interface_layout when "VE...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
app/policies/user_policy.rb
Ruby
mit
203
main
276
class UserPolicy < ApplicationPolicy def initialize(user, record) super @role = user.get_role_in_space(record) end def create? @role.can_create_user? end def update? @role.can_update_user? end def destroy? @role.can_delete_user? end end
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
app/policies/space_policy.rb
Ruby
mit
203
main
231
class SpacePolicy < ApplicationPolicy def initialize(user, record) super @role = user.get_role_in_space(record) end def update? @role.can_update_space? end def destroy? @role.can_delete_space? end end
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
app/policies/application_policy.rb
Ruby
mit
203
main
625
# frozen_string_literal: true class ApplicationPolicy attr_reader :user, :record def initialize(user, record) @user = user @record = record end def index? false end def show? false end def create? false end def new? create? end def update? false end def ed...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
app/controllers/users_controller.rb
Ruby
mit
203
main
1,855
# frozen_string_literal: true class UsersController < ApplicationController before_action :set_user, only: %i[show edit update destroy] before_action :set_space, only: %i[index] # GET /users or /users.json def index; end # GET /users/1 or /users/1.json def show; end # GET /users/new def new @use...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
app/controllers/setup_controller.rb
Ruby
mit
203
main
667
class SetupController < ApplicationController include SettingsHelper def edit @app_setting = AppSettings.first_or_initialize end def update @app_setting = AppSettings.first_or_initialize respond_to do |format| if @app_setting.update(settings: setup_params) format.html { redirect_to ...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
app/controllers/blog_controller.rb
Ruby
mit
203
main
1,099
# frozen_string_literal: true class BlogController < ApplicationController skip_before_action :authenticate_user!, only: %i[index show categories category feed] layout "blog" def index page = params[:page].to_i > 0 ? params[:page].to_i : 1 @posts = BlogPost.paginate(page: page, per: 6) @total_pages ...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
app/controllers/application_controller.rb
Ruby
mit
203
main
716
class ApplicationController < ActionController::Base include Pundit::Authorization include SettingsHelper # Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has. allow_browser versions: :modern before_action :authenticate_user!, except: [ :landing ] be...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
app/controllers/errors_controller.rb
Ruby
mit
203
main
275
class ErrorsController < ActionController::Base VALID_CODES = %w[404 422 500].freeze layout "plain" def show status_code = "500" unless VALID_CODES.include?(code) flash.alert = "Status #{status_code}" render status_code.to_s, status: status_code end end
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
app/controllers/spaces_controller.rb
Ruby
mit
203
main
1,625
# frozen_string_literal: true class SpacesController < ApplicationController before_action :set_space, only: %i[ show edit update destroy ] before_action :check_multi_tenant_mode, only: %i[new index] def index @spaces = current_user.spaces.includes(user_roles: :role, subscriptions: :plan).page params[:page]...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
app/controllers/spaces/roles_controller.rb
Ruby
mit
203
main
2,181
# frozen_string_literal: true class Spaces::RolesController < ApplicationController before_action :set_role, only: %i[show edit update destroy] before_action :set_space, only: %i[index edit update new create] # GET /roles or /roles.json def index @space_roles = @space.all_roles.page params[:page] end ...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
app/controllers/spaces/users_controller.rb
Ruby
mit
203
main
2,473
# frozen_string_literal: true class Spaces::UsersController < ApplicationController before_action :set_space, only: %i[index new create edit update destroy] before_action :set_user, only: %i[edit update destroy] before_action :set_user_role, only: %i[edit update destroy] # GET /spaces/:space_id/users def in...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
app/controllers/spaces/subscriptions_controller.rb
Ruby
mit
203
main
1,457
# frozen_string_literal: true class Spaces::SubscriptionsController < ApplicationController before_action :set_space, only: %i[index new create] before_action :set_plan, only: %i[new] before_action :set_active_subscription, only: %i[index] # GET /spaces/:space_id/subscriptions or /spaces/:space_id/subscriptio...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
config/routes.rb
Ruby
mit
203
main
1,542
Rails.application.routes.draw do devise_for :users authenticate :user, ->(user) { user.admin? } do mount RailsAdmin::Engine => "/admin", as: "rails_admin" end # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html resources :users, only: %i[edit update destroy] re...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
config/application.rb
Ruby
mit
203
main
1,002
require_relative "boot" 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 RailsTabler8 class Application < Rails::Application # Initialize configuration defaults for originally generated Ra...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
config/importmap.rb
Ruby
mit
203
main
444
# Pin npm packages by running ./bin/importmap pin "application" pin "@hotwired/turbo-rails", to: "turbo.min.js" pin "@hotwired/stimulus", to: "stimulus.min.js" pin "@hotwired/stimulus-loading", to: "stimulus-loading.js" pin_all_from "app/javascript/controllers", under: "controllers" pin "apexcharts", to: "apexcharts.e...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
config/importmap.rails_admin.rb
Ruby
mit
203
main
953
pin "rails_admin", preload: true pin "rails_admin/src/rails_admin/base", to: "https://ga.jspm.io/npm:rails_admin@3.3.0/src/rails_admin/base.js" pin "@hotwired/turbo", to: "https://ga.jspm.io/npm:@hotwired/turbo@7.3.0/dist/turbo.es2017-esm.js" pin "@hotwired/turbo-rails", to: "https://ga.jspm.io/npm:@hotwired/turbo-rail...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
config/initializers/devise.rb
Ruby
mit
203
main
15,479
# frozen_string_literal: true # Assuming you have not yet modified this file, each configuration option below # is set to its default value. Note that some are commented out while others # are not: uncommented lines are intended to protect your configuration from # breaking changes in upgrades (i.e., in the event that...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
config/initializers/form_errors.rb
Ruby
mit
203
main
456
# Inline form-field error messages ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| if html_tag =~ /type="hidden"/ || html_tag =~ /<label/ html_tag else html_tag.gsub!("form-control", "form-control is-invalid") %(<div class="field-with-errors"> #{html_tag} <span clas...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
config/initializers/assets.rb
Ruby
mit
203
main
995
# 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 Rails.application.config...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
config/initializers/rails_admin.rb
Ruby
mit
203
main
970
RailsAdmin.config do |config| config.asset_source = :importmap ### Popular gems integration ## == Devise == # config.authenticate_with do # warden.authenticate! scope: :user # end # config.current_user_method(&:current_user) ## == CancanCan == # config.authorize_with :cancancan ## == Pundit ==...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
config/initializers/inflections.rb
Ruby
mit
203
main
754
# Be sure to restart your server when you modify this file. # Add new inflection rules using the following format. Inflections # are locale specific, and you may define rules for as many different # locales as you wish. All of these examples are active by default: # ActiveSupport::Inflector.inflections(:en) do |inflec...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
config/environments/test.rb
Ruby
mit
203
main
2,488
# The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped # and recreated between test runs. Don't rely on the data there! Rails.application.configure do config.aft...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
config/environments/development.rb
Ruby
mit
203
main
3,006
require "active_support/core_ext/integer/time" Rails.application.configure do config.after_initialize do Bullet.enable = true Bullet.alert = false Bullet.bullet_logger = true Bullet.console = true Bullet.rails_logger = true Bullet.add_footer = true end # Settings...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
config/environments/production.rb
Ruby
mit
203
main
3,726
require "active_support/core_ext/integer/time" Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. config.enable_reloading = false # Eager load code on boot for better performance and memory savings (ignor...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
db/schema.rb
Ruby
mit
203
main
3,695
# This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # This file is the source Rails uses to define your schema when running `bin/rai...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
db/seeds.rb
Ruby
mit
203
main
2,053
# This file should ensure the existence of records required to run the application in every environment (production, # development, test). The code here should be idempotent so that it can be executed at any point in every environment. # The data can then be loaded with the bin/rails db:seed command (or created alongsi...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
db/migrate/20241226184723_create_plans.rb
Ruby
mit
203
main
326
class CreatePlans < ActiveRecord::Migration[8.0] def change create_table :plans do |t| t.string :name, null: false t.string :crm_id t.float :price, null: false t.string :currency, null: false t.string :description t.string :duration, null: false t.timestamps end en...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
db/migrate/20251227061905_convert_app_settings_to_jsonb.rb
Ruby
mit
203
main
573
class ConvertAppSettingsToJsonb < ActiveRecord::Migration[8.1] def up remove_column :app_settings, :key, :string remove_column :app_settings, :value, :string add_column :app_settings, :settings, :jsonb, default: {}, null: false add_index :app_settings, :settings, using: :gin end def down ex...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
db/migrate/20241215190402_add_columns_to_user.rb
Ruby
mit
203
main
449
class AddColumnsToUser < ActiveRecord::Migration[8.0] def change add_column :users, :first_name, :string add_column :users, :last_name, :string add_column :users, :phone, :string add_column :users, :status, :integer, default: 0 add_column :users, :session_token, :string add_column :users, :adm...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
db/migrate/20250921114838_add_user_ivitable_fields.rb
Ruby
mit
203
main
503
class AddUserIvitableFields < ActiveRecord::Migration[8.0] def change add_column :users, :invitation_token, :string add_column :users, :invitation_created_at, :datetime add_column :users, :invitation_sent_at, :datetime add_column :users, :invitation_accepted_at, :datetime add_column :users, :invit...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
db/migrate/20241226065722_create_app_settings.rb
Ruby
mit
203
main
261
class CreateAppSettings < ActiveRecord::Migration[8.0] def change create_table :app_settings do |t| t.string :key, null: false t.string :value, null: false t.timestamps end add_index :app_settings, :key, unique: true end end
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
db/migrate/20241226190401_create_subscriptions.rb
Ruby
mit
203
main
308
class CreateSubscriptions < ActiveRecord::Migration[8.0] def change create_table :subscriptions do |t| t.references :plan, null: false t.references :space, null: false t.datetime :start_date, null: false t.datetime :end_date, null: true t.integer :seats end end end
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
db/migrate/20241226181050_create_roles.rb
Ruby
mit
203
main
337
# frozen_string_literal: true class CreateRoles < ActiveRecord::Migration[8.0] def change create_table :roles do |t| t.string :name t.string :value t.string :type t.json :permissions, null: false, default: '{}' t.references :space, null: true, foreign_key: true t.timestamps ...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
db/migrate/20241226183159_create_join_table_user_roles.rb
Ruby
mit
203
main
383
# frozen_string_literal: true class CreateJoinTableUserRoles < ActiveRecord::Migration[8.0] def change create_table :user_roles do |t| t.references :user, index: false, null: false t.references :space, index: false, null: false t.references :role, index: false, null: false end add_inde...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
spec/rails_helper.rb
Ruby
mit
203
main
3,445
# This file is copied to spec/ when you run 'rails generate rspec:install' require 'spec_helper' ENV['RAILS_ENV'] ||= 'test' require_relative '../config/environment' # Prevent database truncation if the environment is production abort("The Rails environment is running in production mode!") if Rails.env.production? # Un...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
spec/requests/spaces_spec.rb
Ruby
mit
203
main
886
require 'rails_helper' RSpec.describe "/spaces", type: :request do let(:user) { create(:user) } before do login_as user, scope: :user end describe "GET /index" do it "renders a successful response" do Space.create!(name: "Test Space") get spaces_url expect(response).to be_successful...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
spec/views/spaces/new.html.erb_spec.rb
Ruby
mit
203
main
415
require 'rails_helper' RSpec.describe "spaces/new", type: :view do before(:each) do assign(:space, Space.new( name: "MyString", status: "active" )) end it "renders new space form" do render assert_select "form[action=?][method=?]", spaces_path, "post" do assert_select "input[n...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
spec/views/spaces/show.html.erb_spec.rb
Ruby
mit
203
main
367
require 'rails_helper' RSpec.describe "spaces/show", type: :view do let(:user) { create(:user) } before do sign_in user @space = Space.create!(name: "Test Space", status: :active) assign(:space, @space) end it "renders the space name in the page title" do render expect(view.content_for(:p...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
spec/views/spaces/edit.html.erb_spec.rb
Ruby
mit
203
main
462
require 'rails_helper' RSpec.describe "spaces/edit", type: :view do let(:space) { Space.create!( name: "MyString", status: "active" ) } before(:each) do assign(:space, space) end it "renders the edit space form" do render assert_select "form[action=?][method=?]", space_path...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
spec/views/spaces/index.html.erb_spec.rb
Ruby
mit
203
main
473
require 'rails_helper' RSpec.describe "spaces/index", type: :view do let(:user) { create(:user) } before do sign_in user @spaces = [ Space.create!(name: "Space 1", status: :active), Space.create!(name: "Space 2", status: :active) ] assign(:spaces, Kaminari.paginate_array(@spaces).page(...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
spec/routing/spaces_routing_spec.rb
Ruby
mit
203
main
959
require "rails_helper" RSpec.describe SpacesController, type: :routing do describe "routing" do it "routes to #index" do expect(get: "/spaces").to route_to("spaces#index") end it "routes to #new" do expect(get: "/spaces/new").to route_to("spaces#new") end it "routes to #show" do ...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
spec/factories/roles.rb
Ruby
mit
203
main
461
FactoryBot.define do factory :role do sequence(:name) { |n| "Role #{n}" } permissions { {} } type { "common" } trait :common do type { "common" } name { "admin" } permissions { { "create_user" => "true", "read_user" => "true", "update_user" => "true", "delete_user" => "true" } } ...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
spec/factories/plans.rb
Ruby
mit
203
main
232
FactoryBot.define do factory :plan do name { "Free" } price { 0.0 } currency { "USD" } duration { "monthly" } description { {} } trait :paid do name { "Pro" } price { 29.99 } end end end
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
spec/factories/users.rb
Ruby
mit
203
main
384
FactoryBot.define do factory :user do sequence(:email) { |n| "user#{n}@example.com" } password { "password123" } first_name { "John" } last_name { "Doe" } status { :active } trait :admin do admin { true } end trait :archived do status { :archived } end trait :con...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
spec/factories/subscriptions.rb
Ruby
mit
203
main
264
FactoryBot.define do factory :subscription do association :space association :plan start_date { Date.current } seats { 5 } trait :active do end_date { nil } end trait :expired do end_date { 1.day.ago } end end end
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
spec/models/space_spec.rb
Ruby
mit
203
main
2,351
require 'rails_helper' RSpec.describe Space, type: :model do describe 'associations' do it 'has many user_roles' do expect(Space.reflect_on_association(:user_roles).macro).to eq(:has_many) end it 'has many users through user_roles' do expect(Space.reflect_on_association(:users).macro).to eq(...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
spec/models/plan_spec.rb
Ruby
mit
203
main
722
require 'rails_helper' RSpec.describe Plan, type: :model do describe 'associations' do it 'has many subscriptions' do expect(Plan.reflect_on_association(:subscriptions).macro).to eq(:has_many) end it 'has many spaces through subscriptions' do expect(Plan.reflect_on_association(:spaces).macro...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
spec/models/user_role_spec.rb
Ruby
mit
203
main
1,627
require 'rails_helper' RSpec.describe UserRole, type: :model do describe 'associations' do it 'belongs to user' do expect(UserRole.reflect_on_association(:user).macro).to eq(:belongs_to) end it 'belongs to space' do expect(UserRole.reflect_on_association(:space).macro).to eq(:belongs_to) ...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
spec/models/subscription_spec.rb
Ruby
mit
203
main
1,333
require 'rails_helper' RSpec.describe Subscription, type: :model do describe 'associations' do it 'belongs to space' do expect(Subscription.reflect_on_association(:space).macro).to eq(:belongs_to) end it 'belongs to plan' do expect(Subscription.reflect_on_association(:plan).macro).to eq(:bel...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
spec/models/app_settings_spec.rb
Ruby
mit
203
main
1,394
require 'rails_helper' RSpec.describe AppSettings, type: :model do describe 'callbacks' do describe '#clear_memoization' do let!(:app_settings) { create(:app_settings, settings: { "color_mode" => "DARK" }) } it 'clears memoization after save' do expect(AppSettings).to receive(:clear_memoizat...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
spec/models/user_spec.rb
Ruby
mit
203
main
2,876
require 'rails_helper' RSpec.describe User, type: :model do describe 'associations' do it 'has many user_roles' do expect(User.reflect_on_association(:user_roles).macro).to eq(:has_many) end it 'has many spaces through user_roles' do expect(User.reflect_on_association(:spaces).macro).to eq(:...
github
tarunvelli/rails-tabler-starter
https://github.com/tarunvelli/rails-tabler-starter
spec/models/role_spec.rb
Ruby
mit
203
main
3,403
require 'rails_helper' RSpec.describe Role, type: :model do describe 'validations' do describe 'type inclusion' do it 'accepts valid type "common"' do role = Role.new(type: "common") role.valid? expect(role.errors[:type]).not_to be_present end it 'accepts valid type "cu...
github
cloudfoundry/cloud_controller_ng
https://github.com/cloudfoundry/cloud_controller_ng
Gemfile
Ruby
apache-2.0
203
main
2,264
source 'https://rubygems.org' gem 'addressable' gem 'bootsnap', require: false gem 'clockwork', require: false gem 'cloudfront-signer' gem 'concurrent-ruby' gem 'digest-xxhash' gem 'fluent-logger' gem 'googleapis-common-protos', '>= 1.8.0' gem 'hashdiff' gem 'httpclient' gem 'json-diff' gem 'json-schema' gem 'mime-typ...