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 | solrpl/explain | https://github.com/solrpl/explain | explainapp/config/initializers/devise.rb | Ruby | apache-2.0 | 48 | master | 9,413 | #
# Copyright [2011-2012] [Solr.pl, Marek Rogoziński, Rafał Kuć]
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
github | solrpl/explain | https://github.com/solrpl/explain | explainapp/config/initializers/active_admin.rb | Ruby | apache-2.0 | 48 | master | 2,615 | #
# Copyright [2011-2012] [Solr.pl, Marek Rogoziński, Rafał Kuć]
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
github | solrpl/explain | https://github.com/solrpl/explain | explainapp/config/initializers/session_store.rb | Ruby | apache-2.0 | 48 | master | 725 | #
# Copyright [2011-2012] [Solr.pl, Marek Rogoziński, Rafał Kuć]
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
github | solrpl/explain | https://github.com/solrpl/explain | explainapp/config/environments/production.rb | Ruby | apache-2.0 | 48 | master | 2,394 | #
# Copyright [2011-2012] [Solr.pl, Marek Rogoziński, Rafał Kuć]
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
github | solrpl/explain | https://github.com/solrpl/explain | explainapp/config/environments/test.rb | Ruby | apache-2.0 | 48 | master | 2,150 | #
# Copyright [2011-2012] [Solr.pl, Marek Rogoziński, Rafał Kuć]
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
github | solrpl/explain | https://github.com/solrpl/explain | explainapp/config/environments/development.rb | Ruby | apache-2.0 | 48 | master | 1,626 | #
# Copyright [2011-2012] [Solr.pl, Marek Rogoziński, Rafał Kuć]
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
github | charlotte-ruby/yettings | https://github.com/charlotte-ruby/yettings | yettings.gemspec | Ruby | mit | 48 | master | 1,799 | # Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = %q{yettings}
s.version = "0.1.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubyg... |
github | charlotte-ruby/yettings | https://github.com/charlotte-ruby/yettings | Rakefile | Ruby | mit | 48 | master | 1,337 | require 'rubygems'
require 'bundler'
begin
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
$stderr.puts e.message
$stderr.puts "Run `bundle install` to install missing gems"
exit e.status_code
end
require 'rake'
require 'jeweler'
Jeweler::Tasks.new do |gem|
# gem is a Gem::Specificati... |
github | charlotte-ruby/yettings | https://github.com/charlotte-ruby/yettings | lib/yettings.rb | Ruby | mit | 48 | master | 1,333 | require 'yaml'
require 'erb'
YETTINGS_PATH = "#{File.dirname(__FILE__)}/yettings"
require "#{YETTINGS_PATH}/railtie.rb"
module Yettings
class UndefinedYetting < StandardError; end
class << self
def setup!
find_ymls.each do |yml|
create_yetting_class(yml)
end
end
def find_ymls
... |
github | charlotte-ruby/yettings | https://github.com/charlotte-ruby/yettings | test_app/Gemfile | Ruby | mit | 48 | master | 207 | source 'http://rubygems.org'
gem 'rails', '~> 3.2'
gem 'sqlite3', '~> 1.3.5'
gem 'rspec-rails'
gem 'test-unit', '~> 3.0'
gem 'yettings', :path=>"#{File.dirname(__FILE__)}/../"
gem "pry"
gem "awesome_print" |
github | charlotte-ruby/yettings | https://github.com/charlotte-ruby/yettings | test_app/Rakefile | Ruby | mit | 48 | master | 267 | # Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
require 'rake'
TestApp::Application.load_tasks |
github | charlotte-ruby/yettings | https://github.com/charlotte-ruby/yettings | test_app/spec/spec_helper.rb | Ruby | mit | 48 | master | 1,016 | # This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'pry'
require 'awesome_print'
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and... |
github | charlotte-ruby/yettings | https://github.com/charlotte-ruby/yettings | test_app/spec/yettings_spec.rb | Ruby | mit | 48 | master | 2,887 | require 'spec_helper'
describe Yettings do
YETTINGS_DIR = "#{Rails.root}/config/yettings"
YETTING_FILE = "#{Rails.root}/config/yetting.yml"
BLANK_YETTING_FILE = "#{Rails.root}/config/yettings/blank.yml"
it "should load yettings in the rails app" do
assert defined?(Yettings)
end
before(:each) do
i... |
github | charlotte-ruby/yettings | https://github.com/charlotte-ruby/yettings | test_app/config/application.rb | Ruby | mit | 48 | master | 1,925 | require File.expand_path('../boot', __FILE__)
require 'rails/all'
# If you have a Gemfile, require the gems listed there, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env) if defined?(Bundler)
module TestApp
class Application < Rails::Application
#... |
github | charlotte-ruby/yettings | https://github.com/charlotte-ruby/yettings | test_app/config/initializers/secret_token.rb | Ruby | mit | 48 | master | 498 | # Be sure to restart your server when you modify this file.
# Your secret key for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attac... |
github | charlotte-ruby/yettings | https://github.com/charlotte-ruby/yettings | test_app/config/initializers/session_store.rb | Ruby | mit | 48 | master | 417 | # Be sure to restart your server when you modify this file.
TestApp::Application.config.session_store :cookie_store, :key => '_test_app_session'
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rai... |
github | charlotte-ruby/yettings | https://github.com/charlotte-ruby/yettings | test_app/config/environments/production.rb | Ruby | mit | 48 | master | 1,756 | TestApp::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# The production environment is meant for finished, "live" apps.
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on... |
github | charlotte-ruby/yettings | https://github.com/charlotte-ruby/yettings | test_app/config/environments/test.rb | Ruby | mit | 48 | master | 1,511 | TestApp::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test ... |
github | charlotte-ruby/yettings | https://github.com/charlotte-ruby/yettings | test_app/config/environments/development.rb | Ruby | mit | 48 | master | 987 | TestApp::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the webse... |
github | mgolovnia/mongoid_commentable | https://github.com/mgolovnia/mongoid_commentable | Rakefile | Ruby | mit | 48 | master | 1,256 | require 'rubygems'
require 'bundler'
begin
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
$stderr.puts e.message
$stderr.puts "Run `bundle install` to install missing gems"
exit e.status_code
end
require 'rake'
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = "mongoid_comment... |
github | mgolovnia/mongoid_commentable | https://github.com/mgolovnia/mongoid_commentable | Gemfile | Ruby | mit | 48 | master | 250 | source "http://rubygems.org"
gem "mongoid", ">= 2.2"
gem "bson_ext", ">= 1.3"
group :development do
gem "rr"
gem "rspec", "~> 2.3.0"
gem "database_cleaner"
gem "bundler", ">= 1.0.0"
gem "jeweler", "~> 1.6.0"
gem "simplecov", ">= 0"
end |
github | mgolovnia/mongoid_commentable | https://github.com/mgolovnia/mongoid_commentable | mongoid_commentable.gemspec | Ruby | mit | 48 | master | 3,056 | # Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = "mongoid_commentable"
s.version = "0.0.6"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :requi... |
github | mgolovnia/mongoid_commentable | https://github.com/mgolovnia/mongoid_commentable | spec/spec_helper.rb | Ruby | mit | 48 | master | 664 | $:.unshift(File.join(File.dirname(__FILE__),'..','lib'))
$:.unshift(File.join(File.dirname(__FILE__),'models'))
require 'mongoid'
require 'rubygems'
require 'bundler'
require 'logger'
require 'rspec'
require 'rr'
require 'database_cleaner'
require 'mongoid_commentable'
require 'models/comment'
require 'models/commentab... |
github | mgolovnia/mongoid_commentable | https://github.com/mgolovnia/mongoid_commentable | spec/mongoid/commentable_spec.rb | Ruby | mit | 48 | master | 1,597 | require 'spec_helper'
describe Mongoid::Commentable do
describe Comment do
context 'creating new comment' do
subject {CommentableModel.new.create_comment!(:author => 'Author', :text => 'test') }
its(:class){should == Comment}
its(:author){should == 'Author'}
its(:text){should ==... |
github | mgolovnia/mongoid_commentable | https://github.com/mgolovnia/mongoid_commentable | spec/models/comment.rb | Ruby | mit | 48 | master | 250 | require File.join(File.dirname(__FILE__),'..','..','lib','comment')
class Comment
include Mongoid::Document
include Mongoid_Commentable::Comment
attr_accessible :text, :author
field :text, :type => String
field :author, :type => String
end |
github | mgolovnia/mongoid_commentable | https://github.com/mgolovnia/mongoid_commentable | app/controllers/comments_controller.rb | Ruby | mit | 48 | master | 1,304 | class CommentsController < ActionController::Base
prepend_before_filter :get_model
before_filter :get_comment, :only => [:show, :edit, :update, :destroy]
respond_to :html
def index
@comments = @model.comments
respond_with([@model,@comments])
end
def show
respond_with([@model,@comment])
... |
github | mgolovnia/mongoid_commentable | https://github.com/mgolovnia/mongoid_commentable | lib/mongoid_commentable.rb | Ruby | mit | 48 | master | 353 | require 'comment'
require 'active_support/dependencies'
require File.join(File.dirname(__FILE__), 'mongoid/commentable')
%w{ controllers }.each do |dir|
path = File.join(File.dirname(__FILE__), '../app', dir)
$LOAD_PATH << path
ActiveSupport::Dependencies.autoload_paths << path
ActiveSupport::Dependencies.autol... |
github | mgolovnia/mongoid_commentable | https://github.com/mgolovnia/mongoid_commentable | lib/comment.rb | Ruby | mit | 48 | master | 633 | module Mongoid_Commentable
module Comment
extend ActiveSupport::Concern
included do |base|
base.attr_accessible :path,:parent
base.field :path, :type => String, :default => ""
base.field :parent, :type => String
base.field :deleted_at, :type => Time
base.embedded_in :commentable... |
github | mgolovnia/mongoid_commentable | https://github.com/mgolovnia/mongoid_commentable | lib/generators/mongoid_commentable/install_generator.rb | Ruby | mit | 48 | master | 596 | require 'tmpdir'
module Mongoid_Commentable
module Generators
class InstallGenerator < Rails::Generators::Base
source_root File.expand_path("../../templates", __FILE__)
desc "Creates mongoid_commentable views and model for your application."
argument :scope, :required => false, :default => nil,
... |
github | mgolovnia/mongoid_commentable | https://github.com/mgolovnia/mongoid_commentable | lib/mongoid/commentable.rb | Ruby | mit | 48 | master | 890 | module Mongoid::Commentable
extend ActiveSupport::Concern
included do |base|
base.embeds_many :comments, :as => :commentable
if Gem::Version.new(Mongoid::VERSION) < Gem::Version.new('3.0.0')
base.index [['comments', Mongo::ASCENDING]]
else
base.index 'comments' => 1
end
end
mod... |
github | jffjs/mongoid_auto_inc | https://github.com/jffjs/mongoid_auto_inc | Gemfile | Ruby | mit | 48 | master | 372 | source "http://rubygems.org"
gem 'activesupport', '>= 3.0.0'
group :development do
gem 'rspec', '>= 2.0.0.beta.22'
# moving mongoid to be a development dependency
# having it as a gem dependency may cause issues, change the version here to test
gem 'mongoid', '>= 2.4.10'
# to test Mongoid 3
# gem 'mongoi... |
github | jffjs/mongoid_auto_inc | https://github.com/jffjs/mongoid_auto_inc | mongoid_auto_inc.gemspec | Ruby | mit | 48 | master | 935 | # -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require "mongoid_auto_inc/version"
Gem::Specification.new do |s|
s.name = "mongoid_auto_inc"
s.version = MongoidAutoInc::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ["Jeff Smith"]
s.email = ["jffreyjs@gmai... |
github | jffjs/mongoid_auto_inc | https://github.com/jffjs/mongoid_auto_inc | lib/mongoid_auto_inc.rb | Ruby | mit | 48 | master | 519 | require "mongoid"
require "mongoid_auto_inc/incrementor"
module MongoidAutoInc
extend ActiveSupport::Concern
module ClassMethods
def auto_increment(name, options={})
field name, :type => Integer
seq_name = "#{self.name.downcase}_#{name}"
incrementor = MongoidAutoInc::Incrementor.new(options)... |
github | jffjs/mongoid_auto_inc | https://github.com/jffjs/mongoid_auto_inc | lib/mongoid_auto_inc/incrementor.rb | Ruby | mit | 48 | master | 1,949 | # This is a modified version of the code found on this blog post:
# http://ihswebdesign.com/blog/autoincrement-in-mongodb-with-ruby/
module MongoidAutoInc
class Incrementor
class Sequence
def initialize(sequence, collection_name, seed)
@sequence = sequence.to_s
@collection = collection_nam... |
github | jffjs/mongoid_auto_inc | https://github.com/jffjs/mongoid_auto_inc | spec/mongoid_auto_inc_spec.rb | Ruby | mit | 48 | master | 2,178 | # -*- coding: utf-8 -*-
# rspec spec/mongoid_auto_inc_spec.rb
require 'bundler/setup'
Bundler.require(:default, :development)
require 'mongoid_auto_inc'
describe MongoidAutoInc do
before(:all) do
Mongoid.master = Mongo::Connection.new.db("mongoid_auto_inc_test")
end
describe "auto increment" do
before(:... |
github | tablecheck/dartsass-sprockets | https://github.com/tablecheck/dartsass-sprockets | Rakefile | Ruby | mit | 48 | master | 724 | # frozen_string_literal: true
require 'bundler/gem_tasks'
task :test do
$LOAD_PATH.unshift('lib', 'test')
Dir.glob('./test/**/*_test.rb').each { |f| require(f) }
end
task default: [:test]
namespace :tests do
gemfiles = Dir['gemfiles/*.gemfile'].map { |f| File.basename(f, '.gemfile') }.freeze
gemfiles.each d... |
github | tablecheck/dartsass-sprockets | https://github.com/tablecheck/dartsass-sprockets | dartsass-sprockets.gemspec | Ruby | mit | 48 | master | 1,022 | # frozen_string_literal: true
lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'sassc/rails/version'
Gem::Specification.new do |spec|
spec.name = 'dartsass-sprockets'
spec.version = SassC::Rails::VERSION
spec.authors = ['Ryan Boland', 'Johnny ... |
github | tablecheck/dartsass-sprockets | https://github.com/tablecheck/dartsass-sprockets | test/sassc_rails_test.rb | Ruby | mit | 48 | master | 13,105 | # frozen_string_literal: true
require_relative 'test_helper'
class SassRailsTest < Minitest::Test
attr_reader :app
def setup
@app = Class.new(Rails::Application).new
@app.config.active_support.deprecation = :log
@app.config.eager_load = false
@app.config.root = File.join(File.dirname(__FILE__), '... |
github | tablecheck/dartsass-sprockets | https://github.com/tablecheck/dartsass-sprockets | test/test_helper.rb | Ruby | mit | 48 | master | 400 | # frozen_string_literal: true
ENV['RAILS_ENV'] = 'test'
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'dartsass-sprockets'
require 'fileutils'
require 'rails'
require 'bundler/setup'
require 'minitest/autorun'
require 'mocha/minitest'
Bundler.re... |
github | tablecheck/dartsass-sprockets | https://github.com/tablecheck/dartsass-sprockets | test/compressor_test.rb | Ruby | mit | 48 | master | 633 | # frozen_string_literal: true
require_relative 'test_helper'
class CompressorTest < Minitest::Test
attr_reader :compressor
def setup
@compressor = Sprockets::SassCompressor.new
end
def test_cache_key
bytes = [
0xA9, 0x10, 0x69, 0x14, 0x7F, 0x9B, 0xD9, 0x24, 0x5C, 0xDA, 0xCA, 0xEF, 0x8E, 0xAD, ... |
github | tablecheck/dartsass-sprockets | https://github.com/tablecheck/dartsass-sprockets | lib/rails/generators/sass_scaffold.rb | Ruby | mit | 48 | master | 504 | # frozen_string_literal: true
require 'sassc/engine'
require 'rails/generators/named_base'
module Sass
module Generators
class ScaffoldBase < ::Rails::Generators::NamedBase
def copy_stylesheet
dir = ::Rails::Generators::ScaffoldGenerator.source_root
file = File.join(dir, 'scaffold.css')
... |
github | tablecheck/dartsass-sprockets | https://github.com/tablecheck/dartsass-sprockets | lib/rails/generators/scss/scaffold/scaffold_generator.rb | Ruby | mit | 48 | master | 227 | # frozen_string_literal: true
require 'rails/generators/sass_scaffold'
module Scss
module Generators
class ScaffoldGenerator < ::Sass::Generators::ScaffoldBase
def syntax
:scss
end
end
end
end |
github | tablecheck/dartsass-sprockets | https://github.com/tablecheck/dartsass-sprockets | lib/rails/generators/scss/assets/assets_generator.rb | Ruby | mit | 48 | master | 372 | # frozen_string_literal: true
require 'rails/generators/named_base'
module Scss
module Generators
class AssetsGenerator < ::Rails::Generators::NamedBase
source_root File.expand_path('templates', __dir__)
def copy_scss
template 'stylesheet.scss', File.join('app/assets/stylesheets', class_pat... |
github | tablecheck/dartsass-sprockets | https://github.com/tablecheck/dartsass-sprockets | lib/rails/generators/sass/scaffold/scaffold_generator.rb | Ruby | mit | 48 | master | 227 | # frozen_string_literal: true
require 'rails/generators/sass_scaffold'
module Sass
module Generators
class ScaffoldGenerator < ::Sass::Generators::ScaffoldBase
def syntax
:sass
end
end
end
end |
github | tablecheck/dartsass-sprockets | https://github.com/tablecheck/dartsass-sprockets | lib/rails/generators/sass/assets/assets_generator.rb | Ruby | mit | 48 | master | 372 | # frozen_string_literal: true
require 'rails/generators/named_base'
module Sass
module Generators
class AssetsGenerator < ::Rails::Generators::NamedBase
source_root File.expand_path('templates', __dir__)
def copy_sass
template 'stylesheet.sass', File.join('app/assets/stylesheets', class_pat... |
github | tablecheck/dartsass-sprockets | https://github.com/tablecheck/dartsass-sprockets | lib/sassc/rails.rb | Ruby | mit | 48 | master | 262 | # frozen_string_literal: true
require_relative 'rails/version'
require 'sassc-embedded'
require_relative 'rails/functions'
require_relative 'rails/importer'
require_relative 'rails/template'
require_relative 'rails/compressor'
require_relative 'rails/railtie' |
github | tablecheck/dartsass-sprockets | https://github.com/tablecheck/dartsass-sprockets | lib/sassc/rails/compressor.rb | Ruby | mit | 48 | master | 647 | # frozen_string_literal: true
require 'sprockets/sass_compressor'
require 'securerandom'
module Sprockets
class SassCompressor
def initialize(options = {})
@options = {
syntax: :scss,
cache: false,
read_cache: false,
style: :compressed
}.merge(options).freeze
v... |
github | tablecheck/dartsass-sprockets | https://github.com/tablecheck/dartsass-sprockets | lib/sassc/rails/railtie.rb | Ruby | mit | 48 | master | 3,082 | # frozen_string_literal: true
require 'active_support/core_ext/class/attribute'
require 'sprockets/railtie'
module SassC
module Rails
class Railtie < ::Rails::Railtie
config.sass = ActiveSupport::OrderedOptions.new
# Establish static configuration defaults
# Emit scss files during stylesheet ... |
github | tablecheck/dartsass-sprockets | https://github.com/tablecheck/dartsass-sprockets | lib/sassc/rails/importer.rb | Ruby | mit | 48 | master | 4,895 | # frozen_string_literal: true
require 'tilt'
module SassC
module Rails
class Importer < SassC::Importer
class Extension
attr_reader :postfix
def initialize(postfix = nil)
@postfix = postfix
end
def import_for(full_path, _parent_dir, _options)
SassC::Im... |
github | tablecheck/dartsass-sprockets | https://github.com/tablecheck/dartsass-sprockets | lib/sassc/rails/functions.rb | Ruby | mit | 48 | master | 310 | # frozen_string_literal: true
require 'sprockets/sass_functions'
module Sprockets
module SassFunctions
def asset_data_url(path)
::SassC::Script::Value::String.new("url(#{sprockets_context.asset_data_uri(path.value)})")
end
end
end
SassC::Script::Functions.include Sprockets::SassFunctions |
github | tablecheck/dartsass-sprockets | https://github.com/tablecheck/dartsass-sprockets | lib/sassc/rails/template.rb | Ruby | mit | 48 | master | 3,522 | # frozen_string_literal: true
require 'sprockets/version'
require 'sprockets/sass_processor'
require 'sprockets/utils'
require 'sprockets/uri_utils'
module SassC
module Rails
class SassTemplate < Sprockets::SassProcessor
PASS_THRU_OPTIONS = %i[
style
charset
importers
logge... |
github | NARKOZ/holder_rails | https://github.com/NARKOZ/holder_rails | holder_rails.gemspec | Ruby | bsd-2-clause | 48 | master | 844 | # -*- encoding: utf-8 -*-
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'holder_rails/version'
Gem::Specification.new do |gem|
gem.name = "holder_rails"
gem.version = HolderRails::VERSION
gem.authors = ["Nihad Abbasov"]
gem.email... |
github | NARKOZ/holder_rails | https://github.com/NARKOZ/holder_rails | lib/holder_rails.rb | Ruby | bsd-2-clause | 48 | master | 223 | require "holder_rails/version"
require "holder_rails/helpers"
require "rails/engine"
require "action_view"
module HolderRails
class Engine < ::Rails::Engine; end
end
ActionView::Base.send :include, HolderRails::Helpers |
github | NARKOZ/holder_rails | https://github.com/NARKOZ/holder_rails | lib/holder_rails/helpers.rb | Ruby | bsd-2-clause | 48 | master | 534 | module HolderRails
module Helpers
def holder_tag(size, text='', theme=nil, html_options={}, holder_options={})
size = "#{size}x#{size}" unless size =~ /\A\d+p?x\d+\z/
holder_options[:text] = text unless text.to_s.empty?
holder_options[:theme] = theme unless theme.nil?
holder_options = hol... |
github | NARKOZ/holder_rails | https://github.com/NARKOZ/holder_rails | test/holder_rails_test.rb | Ruby | bsd-2-clause | 48 | master | 1,268 | require 'holder_rails'
require 'minitest/autorun'
class HolderRailsTest < ActionView::TestCase
include HolderRails::Helpers
test "size" do
assert_dom_equal '<img data-src="holder.js/100x100?" src="" />', holder_tag(100)
assert_dom_equal '<img data-src="holder.js/200x300?" src="" />', holder_tag('200x300')... |
github | pink-room/fastlane-plugin-run_tests_firebase_testlab | https://github.com/pink-room/fastlane-plugin-run_tests_firebase_testlab | fastlane-plugin-run_tests_firebase_testlab.gemspec | Ruby | mit | 48 | master | 1,237 | # coding: utf-8
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'fastlane/plugin/run_tests_firebase_testlab/version'
Gem::Specification.new do |spec|
spec.name = 'fastlane-plugin-run_tests_firebase_testlab'
spec.version = Fastlane::RunTests... |
github | pink-room/fastlane-plugin-run_tests_firebase_testlab | https://github.com/pink-room/fastlane-plugin-run_tests_firebase_testlab | lib/fastlane/plugin/run_tests_firebase_testlab.rb | Ruby | mit | 48 | master | 518 | require 'fastlane/plugin/run_tests_firebase_testlab/version'
module Fastlane
module RunTestsFirebaseTestlab
# Return all .rb files inside the "actions" and "commands" directory
def self.all_classes
Dir[File.expand_path('**/{actions,commands}/*.rb', File.dirname(__FILE__))]
end
end
end
# By defau... |
github | pink-room/fastlane-plugin-run_tests_firebase_testlab | https://github.com/pink-room/fastlane-plugin-run_tests_firebase_testlab | lib/fastlane/plugin/run_tests_firebase_testlab/commands/commands.rb | Ruby | mit | 48 | master | 371 | module Fastlane
module Commands
def self.config
"gcloud config set project"
end
def self.auth
"gcloud auth activate-service-account"
end
def self.run_tests
"gcloud firebase test android run"
end
def self.download_results
"gsutil -m cp -r"
end
def self.de... |
github | pink-room/fastlane-plugin-run_tests_firebase_testlab | https://github.com/pink-room/fastlane-plugin-run_tests_firebase_testlab | lib/fastlane/plugin/run_tests_firebase_testlab/actions/run_tests_firebase_testlab_action.rb | Ruby | mit | 48 | master | 13,353 | module Fastlane
module Actions
class RunTestsFirebaseTestlabAction < Action
PIPE = "testlab-pipe"
@client_secret_file = "client-secret.json"
@test_console_output_file = "instrumentation_output.txt"
class << self
attr_reader :client_secret_file, :test_console_output_file
end
... |
github | pink-room/fastlane-plugin-run_tests_firebase_testlab | https://github.com/pink-room/fastlane-plugin-run_tests_firebase_testlab | spec/spec_helper.rb | Ruby | mit | 48 | master | 470 | $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/run_test... |
github | pink-room/fastlane-plugin-run_tests_firebase_testlab | https://github.com/pink-room/fastlane-plugin-run_tests_firebase_testlab | spec/run_tests_firebase_testlab_action_spec.rb | Ruby | mit | 48 | master | 9,534 | describe Fastlane::Actions::RunTestsFirebaseTestlabAction do
describe '#run' do
minimum_sh_actions = 5
let(:available_options) { Fastlane::Actions::RunTestsFirebaseTestlabAction.available_options }
let(:test_console_output) { "Raw results will be stored in your GCS bucket at [https://console.developers.go... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | Gemfile | Ruby | mit | 48 | main | 1,046 | source 'https://gem.coop'
git_source(:github){ |repo_name| "https://github.com/#{repo_name}.git" }
gem 'rails', '~> 8'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3', '~> 2.1'
gem 'sassc-rails'
gem 'coffee-rails'
gem 'bootstrap', "~> 5"
gem 'uglifier'
gem 'jqu... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | config.ru | Ruby | mit | 48 | main | 514 | # This file is used by Rack-based servers to start the application.
require_relative 'config/environment'
root = if ENV['RAILS_RELATIVE_URL_ROOT'] != nil
if ENV['RAILS_RELATIVE_URL_ROOT'] != '/' and ENV['RAILS_RELATIVE_URL_ROOT'].end_with? '/'
raise 'Invalid environment variable RAILS_RELATIVE_URL_ROOT `%... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | Rakefile | Ruby | mit | 48 | main | 208 | #!/usr/bin/env rake
# Add your own tasks in files placed in lib/tasks ending in .rake,
# and they will automatically be available to Rake.
require_relative 'config/application'
Mete::Application.load_tasks |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | app/models/audit.rb | Ruby | mit | 48 | main | 473 | class Audit < ApplicationRecord
validates :difference, presence: true
belongs_to :drink, optional: true, foreign_key: :drink
belongs_to :user, optional: true, foreign_key: :user
default_scope ->{ order('created_at DESC') }
scope :deposits, ->{ where('difference > 0') }
scope :payments, ->{ where('differenc... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | app/models/user.rb | Ruby | mit | 48 | main | 1,194 | # frozen_string_literal: true
class User < ApplicationRecord
validates :name, presence: true
validates :barcode, uniqueness: { conditions: -> { where.not(barcode: nil) } }
enum :avatar_provider, [ :gravatar, :webfinger ]
scope :order_by_name_asc, -> {
order(arel_table['name'].lower.asc)
}
before_sav... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | app/models/drink.rb | Ruby | mit | 48 | main | 834 | class Drink < ApplicationRecord
scope :order_by_name_asc, -> {
order(arel_table['name'].lower.asc)
}
validates :name, :bottle_size, :price, presence: true
has_attached_file :logo, :styles => { :thumb => "100x100#", :medium => "640x640#" }, :default_style => :medium
validates_attachment_content_type :log... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | app/helpers/users_helper.rb | Ruby | mit | 48 | main | 4,892 | module UsersHelper
# see also: /config/initializers/gravatar_image_tag.rb
def avatar(user)
case user.avatar_provider
when 'gravatar'
if user.avatar.nil? or user.avatar.empty? then
content_tag :div, nil, class: [ 'avatar-missing' ]
else
gravatar_image_tag user.avatar, class... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | app/helpers/application_helper.rb | Ruby | mit | 48 | main | 395 | require 'git_rev'
module ApplicationHelper
def get_revision
GitRev::Sha.new.short
end
def show_amount(price)
return 'n/a' if price.blank?
sprintf('%.2f €', price)
end
def link_to_drink_if_exists(drink)
drink = Drink.find_by(:id => drink)
if drink.nil?
return "n/a"
else
... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | app/controllers/wrapped_controller.rb | Ruby | mit | 48 | main | 2,662 | class WrappedController < ApplicationController
# GET /user/1/wrapped
def index
@user = User.find(params[:user_id])
@years = Date.today.year.downto(2010)
.select { |y| audits_for(@user, y).any? }
# index.html.haml
end
# GET /users/1/wrapped/1970
def show
@user = User.find(params[:user... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | app/controllers/users_controller.rb | Ruby | mit | 48 | main | 4,500 | class UsersController < ApplicationController
include ApplicationHelper
include UsersHelper
# GET /users
def index
if params[:barcode] != nil
@user = User.find_by(barcode: params[:barcode])
if @user
redirect_to @user
else
redirect_to users_url, :flash => { :error => "no us... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | app/controllers/barcodes_controller.rb | Ruby | mit | 48 | main | 1,603 | class BarcodesController < ApplicationController
# GET /barcodes
def index
@barcodes = Barcode.all
# index.html.haml
end
# GET /barcodes/new
def new
@barcode = Barcode.new
if params.key?(:id)
@barcode.id = params[:id]
end
if params.key?(:drink)
@barcode.drink = params[:d... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | app/controllers/audits_controller.rb | Ruby | mit | 48 | main | 920 | class AuditsController < ApplicationController
# GET /audits
def index
if params[:start_date] and params[:end_date]
@start_date = parse_date params[:start_date]
@end_date = parse_date params[:end_date]
else
# If no range is specified, show audits from the last 14 days.
@start_date = ... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | app/controllers/drinks_controller.rb | Ruby | mit | 48 | main | 1,714 | class DrinksController < ApplicationController
# GET /drinks
def index
@drinks = Drink.order(active: :desc).order_by_name_asc
# index.html.haml
end
# GET /drinks/1
def show
@drink = Drink.find(params[:id])
# show.html.haml
end
# GET /drinks/new
def new
@drink = Drink.new
# new.... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | app/controllers/application_controller.rb | Ruby | mit | 48 | main | 202 | class ApplicationController < ActionController::Base
def no_resp_redir(dest)
respond_to do |format|
format.html { redirect_to dest }
format.json { head :no_content }
end
end
end |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | app/controllers/api/v1/users_controller.rb | Ruby | mit | 48 | main | 2,790 | class Api::V1::UsersController < ApplicationController
skip_before_action :verify_authenticity_token
# GET /users.json
def index
@users = User.order(active: :desc).order_by_name_asc
render json: @users
end
# GET /users/1.json
def show
@user = User.find(params[:id])
@drinks = Drink.order(ac... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | app/controllers/api/v1/audits_controller.rb | Ruby | mit | 48 | main | 1,118 | class Api::V1::AuditsController < ApplicationController
skip_before_action :verify_authenticity_token
# GET /audits.json
def index
if params[:start_date] and params[:end_date]
@start_date = parse_date params[:start_date]
@end_date = parse_date params[:end_date]
else
# If no range is s... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | app/controllers/api/v1/barcodes_controller.rb | Ruby | mit | 48 | main | 1,350 | class Api::V1::BarcodesController < ApplicationController
skip_before_action :verify_authenticity_token
# GET /barcodes.json
def index
@barcodes = Barcode.all
render json: @barcodes
end
# GET /barcodes/new.json
def new
@barcode = Barcode.new
if params.key?(:id)
@barcode.id = para... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | app/controllers/api/v1/drinks_controller.rb | Ruby | mit | 48 | main | 1,312 | class Api::V1::DrinksController < ApplicationController
skip_before_action :verify_authenticity_token
# GET /drinks.json
def index
@drinks = Drink.order(active: :desc).order_by_name_asc
render json: @drinks
end
# GET /drinks/1.json
def show
@drink = Drink.find(params[:id])
render json: @... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | test/test_helper.rb | Ruby | mit | 48 | main | 490 | ENV["RAILS_ENV"] = "test"
require "simplecov"
SimpleCov.start
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
class ActiveSupport::TestCase
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
#
# Note: You'll currently still have to decl... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | test/functional/wrapped_controller_test.rb | Ruby | mit | 48 | main | 1,197 | require 'test_helper'
class WrappedControllerTest < ActionController::TestCase
setup do
@user = users(:two)
@year = Date.today.year
@drink = drinks(:one)
@user.buy @drink
end
test 'should get empty index' do
get :index, params: { user_id: users(:one) }
assert_response :success
assert... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | test/functional/drinks_controller_test.rb | Ruby | mit | 48 | main | 1,552 | require 'test_helper'
class DrinksControllerTest < ActionController::TestCase
setup do
@drink = drinks(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:drinks)
end
test "should get new" do
get :new
assert_response :success
end
tes... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | test/functional/users_controller_test.rb | Ruby | mit | 48 | main | 3,732 | require 'test_helper'
class UsersControllerTest < ActionController::TestCase
include UsersHelper
setup do
@user = users(:one)
@drink = drinks(:one)
@barcode = barcodes(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:users)
end
test... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | test/functional/barcodes_controller_test.rb | Ruby | mit | 48 | main | 1,082 | require 'test_helper'
class BarcodesControllerTest < ActionController::TestCase
setup do
@barcode = barcodes(:one)
@drink = drinks(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:barcodes)
end
test "should get new" do
get :new
... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | test/functional/audits_controller_test.rb | Ruby | mit | 48 | main | 478 | require 'test_helper'
class AuditsControllerTest < ActionController::TestCase
test "should get audits" do
get :index
assert_response :success
assert_not_nil(:audits)
end
test "should get no audits" do
# This is way back in the past.
@date = {
"year" => 1970,
"month" => 1,
... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | test/functional/api/v1/users_controller_test.rb | Ruby | mit | 48 | main | 3,129 | require 'test_helper'
class Api::V1::UsersControllerTest < ActionController::TestCase
setup do
@user = users(:one)
@drink = drinks(:one)
@barcode = barcodes(:one)
end
test "should get index as json" do
get :index
assert_response :success
resp = JSON.parse(response.body)
assert_not_ni... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | test/functional/api/v1/drinks_controller_test.rb | Ruby | mit | 48 | main | 2,941 | require 'test_helper'
class Api::V1::DrinksControllerTest < ActionController::TestCase
setup do
@drink = drinks(:one)
end
test "should get index as json" do
get :index
assert_response :success
resp = JSON.parse(response.body)
assert_not_nil resp
end
test "should get new as json" do
... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | test/functional/api/v1/barcodes_controller_test.rb | Ruby | mit | 48 | main | 1,843 | require 'test_helper'
class Api::V1::BarcodesControllerTest < ActionController::TestCase
setup do
@barcode = barcodes(:one)
@drink = drinks(:one)
end
test "should get index as json" do
get :index
assert_response :success
resp = JSON.parse(response.body)
assert_not_nil resp
end
t... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | test/functional/api/v1/audits_controller_test.rb | Ruby | mit | 48 | main | 613 | require 'test_helper'
class Api::V1::AuditsControllerTest < ActionController::TestCase
test "should get audits as json" do
get :index
assert_response :success
# The following line is the test.
resp = JSON.parse(response.body)
assert_not_nil resp["audits"]
end
test "should get no audits" do
... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | test/unit/drink_test.rb | Ruby | mit | 48 | main | 1,599 | require 'test_helper'
class DrinkTest < ActiveSupport::TestCase
test "should not save without name" do
drink = Drink.new
drink.name = nil
drink.bottle_size = 0.5
drink.price = 1.5
assert_not drink.save, "Saved without a name"
end
test "should not save without bottle_size" do
drink = Dr... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | test/unit/audit_test.rb | Ruby | mit | 48 | main | 483 | require 'test_helper'
class AuditTest < ActiveSupport::TestCase
test "should save" do
audit = Audit.new
assert audit.save, "Failed to save"
end
test "should have attributes" do
a = audits(:one)
assert_respond_to a, :id, "id missing"
assert_respond_to a, :created_at, "created_at missing"
... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | test/unit/user_test.rb | Ruby | mit | 48 | main | 2,207 | require 'test_helper'
class UserTest < ActiveSupport::TestCase
test "should not save without name" do
user = User.new
assert_not user.save, "Saved the user without a name"
end
test "should save" do
user = User.new
user.name = "test"
assert user.save, "Failed to save the user with a name"
... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | test/unit/barcode_test.rb | Ruby | mit | 48 | main | 1,186 | require 'test_helper'
class BarcodeTest < ActiveSupport::TestCase
test "should not save without id" do
barcode = Barcode.new
barcode.id = nil
barcode.drink = 1
assert_not barcode.save, "Saved without an id"
end
test "should not save without drink" do
barcode = Barcode.new
barcode.id = ... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | config/routes.rb | Ruby | mit | 48 | main | 3,736 | Mete::Application.routes.draw do
# Redirections for legacy clients
get 'audits.json', to: redirect('api/v1/audits.json'), format: false
get 'barcodes.json', to: redirect('api/v1/barcodes.json'), format: false
get 'barcodes/new.json', to: redirect('api/v1/barcodes/new.json'), format: false
get 'barcodes/:id... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | config/application.rb | Ruby | mit | 48 | main | 988 | 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 Mete
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails vers... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | config/unicorn.rb | Ruby | mit | 48 | main | 1,765 | # see https://github.com/blog/517-unicorn and
# https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-unicorn-and-nginx-on-ubuntu-14-04
# set path to application
app_dir = File.expand_path("../..", __FILE__)
working_directory app_dir
#set the environment
rails_env = ENV['RAILS_ENV'] || 'prod... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | config/environments/production.rb | Ruby | mit | 48 | main | 4,475 | 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 | chaosdorf/mete | https://github.com/chaosdorf/mete | config/initializers/session_store.rb | Ruby | mit | 48 | main | 394 | # Be sure to restart your server when you modify this file.
Mete::Application.config.session_store :cookie_store, key: '_mete_session'
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rails generat... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | config/initializers/simple_form.rb | Ruby | mit | 48 | main | 6,906 | # frozen_string_literal: true
#
# Uncomment this and change the path if necessary to include your own
# components.
# See https://github.com/plataformatec/simple_form#custom-components to know
# more about custom components.
# Dir[Rails.root.join('lib/components/**/*.rb')].each { |f| require f }
#
# Use this setup bloc... |
github | chaosdorf/mete | https://github.com/chaosdorf/mete | config/initializers/simple_form_bootstrap.rb | Ruby | mit | 48 | main | 14,109 | # frozen_string_literal: true
# Please do not make direct changes to this file!
# This generator is maintained by the community around simple_form-bootstrap:
# https://github.com/heartcombo/simple_form-bootstrap
# All future development, tests, and organization should happen there.
# Background history: https://github... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.