repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
jdjkelly/quant | https://github.com/jdjkelly/quant/blob/b3a1d83466ff5bb3b80e29f4d9999d871c77d280/spec/fabricators/meal_fabricator.rb | spec/fabricators/meal_fabricator.rb | # == Schema Information
#
# Table name: meals
#
# id :integer not null, primary key
# date :date
# calories :integer
# carbohydrates :integer
# protein :integer
# fat :integer
# user_id :integer
# description :string(255)
# created_at :datetime
# up... | ruby | MIT | b3a1d83466ff5bb3b80e29f4d9999d871c77d280 | 2026-01-04T17:44:17.025352Z | false |
jdjkelly/quant | https://github.com/jdjkelly/quant/blob/b3a1d83466ff5bb3b80e29f4d9999d871c77d280/spec/fabricators/weight_fabricator.rb | spec/fabricators/weight_fabricator.rb | # == Schema Information
#
# Table name: weights
#
# id :integer not null, primary key
# type :string(255)
# user_id :integer
# bmi :float
# value :float
# lean_mass :float
# fat_mass :float
# fat_percent :float
# date :datetime
# created_at :datetime
# ... | ruby | MIT | b3a1d83466ff5bb3b80e29f4d9999d871c77d280 | 2026-01-04T17:44:17.025352Z | false |
jdjkelly/quant | https://github.com/jdjkelly/quant/blob/b3a1d83466ff5bb3b80e29f4d9999d871c77d280/spec/fabricators/foursquare_account_fabricator.rb | spec/fabricators/foursquare_account_fabricator.rb | # == Schema Information
#
# Table name: foursquare_accounts
#
# id :integer not null, primary key
# uid :string(255)
# oauth_token :string(255)
# activated_at :datetime
# synced_at :datetime
# user_id :integer
# created_at :datetime
# updated_at :datetime
#
Fabricator(:... | ruby | MIT | b3a1d83466ff5bb3b80e29f4d9999d871c77d280 | 2026-01-04T17:44:17.025352Z | false |
jdjkelly/quant | https://github.com/jdjkelly/quant/blob/b3a1d83466ff5bb3b80e29f4d9999d871c77d280/spec/fabricators/user_fabricator.rb | spec/fabricators/user_fabricator.rb | # == Schema Information
#
# Table name: users
#
# id :integer not null, primary key
# created_at :datetime
# updated_at :datetime
# email :string(255) default(""), not null
# encrypted_password :string(255) default(""), not null
# ... | ruby | MIT | b3a1d83466ff5bb3b80e29f4d9999d871c77d280 | 2026-01-04T17:44:17.025352Z | false |
jdjkelly/quant | https://github.com/jdjkelly/quant/blob/b3a1d83466ff5bb3b80e29f4d9999d871c77d280/spec/fabricators/sleep_fabricator.rb | spec/fabricators/sleep_fabricator.rb | # == Schema Information
#
# Table name: sleeps
#
# id :integer not null, primary key
# start :datetime
# end :datetime
# user_id :integer
# created_at :datetime
# updated_at :datetime
# meta :hstore
# source :string(255)
#
Fabricator(:sleep) do |f|
start "2013-03-10 ... | ruby | MIT | b3a1d83466ff5bb3b80e29f4d9999d871c77d280 | 2026-01-04T17:44:17.025352Z | false |
jdjkelly/quant | https://github.com/jdjkelly/quant/blob/b3a1d83466ff5bb3b80e29f4d9999d871c77d280/spec/fabricators/fitbit_account_fabricator.rb | spec/fabricators/fitbit_account_fabricator.rb | # == Schema Information
#
# Table name: fitbit_accounts
#
# id :integer not null, primary key
# uid :string(255)
# oauth_token :string(255)
# oauth_token_secret :string(255)
# user_id :integer
# created_at :datetime
# updated_at :datetime
... | ruby | MIT | b3a1d83466ff5bb3b80e29f4d9999d871c77d280 | 2026-01-04T17:44:17.025352Z | false |
jdjkelly/quant | https://github.com/jdjkelly/quant/blob/b3a1d83466ff5bb3b80e29f4d9999d871c77d280/lib/exceptions.rb | lib/exceptions.rb | module Exceptions
class ApiError < StandardError; end
class DataProviderForMethodNotDefined < NoMethodError; end
end
| ruby | MIT | b3a1d83466ff5bb3b80e29f4d9999d871c77d280 | 2026-01-04T17:44:17.025352Z | false |
jdjkelly/quant | https://github.com/jdjkelly/quant/blob/b3a1d83466ff5bb3b80e29f4d9999d871c77d280/config/application.rb | config/application.rb | require File.expand_path('../boot', __FILE__)
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env)
module Quantify
class Application < Rails::Application
VERSION = "0.0.13"
# Settings in co... | ruby | MIT | b3a1d83466ff5bb3b80e29f4d9999d871c77d280 | 2026-01-04T17:44:17.025352Z | false |
jdjkelly/quant | https://github.com/jdjkelly/quant/blob/b3a1d83466ff5bb3b80e29f4d9999d871c77d280/config/environment.rb | config/environment.rb | # Load the rails application
require File.expand_path('../application', __FILE__)
# Initialize the rails application
Quantify::Application.initialize!
| ruby | MIT | b3a1d83466ff5bb3b80e29f4d9999d871c77d280 | 2026-01-04T17:44:17.025352Z | false |
jdjkelly/quant | https://github.com/jdjkelly/quant/blob/b3a1d83466ff5bb3b80e29f4d9999d871c77d280/config/routes.rb | config/routes.rb | Quantify::Application.routes.draw do
resources :journal_entries
authenticated :user do
get '/', to: "dashboard#index"
end
get '/', to: 'home#index'
devise_for :users, controllers: {
registrations: "registrations",
omniauth_callbacks: "omniauth_callbacks"
}
resources :dashboard, only: [:in... | ruby | MIT | b3a1d83466ff5bb3b80e29f4d9999d871c77d280 | 2026-01-04T17:44:17.025352Z | false |
jdjkelly/quant | https://github.com/jdjkelly/quant/blob/b3a1d83466ff5bb3b80e29f4d9999d871c77d280/config/unicorn.rb | config/unicorn.rb | worker_processes 3
timeout 30
preload_app true
before_fork do |server, worker|
# Replace with MongoDB or whatever
if defined?(ActiveRecord::Base)
ActiveRecord::Base.connection.disconnect!
Rails.logger.info('Disconnected from ActiveRecord')
end
# If you are using Redis but not Resque, change this
# i... | ruby | MIT | b3a1d83466ff5bb3b80e29f4d9999d871c77d280 | 2026-01-04T17:44:17.025352Z | false |
jdjkelly/quant | https://github.com/jdjkelly/quant/blob/b3a1d83466ff5bb3b80e29f4d9999d871c77d280/config/boot.rb | config/boot.rb | require 'rubygems'
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
| ruby | MIT | b3a1d83466ff5bb3b80e29f4d9999d871c77d280 | 2026-01-04T17:44:17.025352Z | false |
jdjkelly/quant | https://github.com/jdjkelly/quant/blob/b3a1d83466ff5bb3b80e29f4d9999d871c77d280/config/initializers/unit.rb | config/initializers/unit.rb | class Unit
# inspired by http://stackoverflow.com/a/15269518
SYSTEMS = [:metric, :imperial]
IMPERIAL = %w(:inches :feet :miles :pounds)
METRIC = %w(:centimeters :meters :kilometers :kilograms)
@@conversion_rates = {
meters: {
feet: 3.28084,
meters: 1.0,
centimeters: 100,
kilog... | ruby | MIT | b3a1d83466ff5bb3b80e29f4d9999d871c77d280 | 2026-01-04T17:44:17.025352Z | false |
jdjkelly/quant | https://github.com/jdjkelly/quant/blob/b3a1d83466ff5bb3b80e29f4d9999d871c77d280/config/initializers/time_formats.rb | config/initializers/time_formats.rb | # config/initializers/time_formats.rb
Time::DATE_FORMATS[:day_month_and_year] = '%d %b %Y'
| ruby | MIT | b3a1d83466ff5bb3b80e29f4d9999d871c77d280 | 2026-01-04T17:44:17.025352Z | false |
jdjkelly/quant | https://github.com/jdjkelly/quant/blob/b3a1d83466ff5bb3b80e29f4d9999d871c77d280/config/initializers/session_store.rb | config/initializers/session_store.rb | # Be sure to restart your server when you modify this file.
Quantify::Application.config.session_store :cookie_store, key: '_quantify_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... | ruby | MIT | b3a1d83466ff5bb3b80e29f4d9999d871c77d280 | 2026-01-04T17:44:17.025352Z | false |
jdjkelly/quant | https://github.com/jdjkelly/quant/blob/b3a1d83466ff5bb3b80e29f4d9999d871c77d280/config/initializers/devise.rb | config/initializers/devise.rb | # Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model.
Devise.setup do |config|
# The secret key used by Devise. Devise uses this key to generate
# random tokens. Changing this key will render invalid all existing
# confirmat... | ruby | MIT | b3a1d83466ff5bb3b80e29f4d9999d871c77d280 | 2026-01-04T17:44:17.025352Z | false |
jdjkelly/quant | https://github.com/jdjkelly/quant/blob/b3a1d83466ff5bb3b80e29f4d9999d871c77d280/config/initializers/rails_config.rb | config/initializers/rails_config.rb | RailsConfig.setup do |config|
config.const_name = "Settings"
end | ruby | MIT | b3a1d83466ff5bb3b80e29f4d9999d871c77d280 | 2026-01-04T17:44:17.025352Z | false |
jdjkelly/quant | https://github.com/jdjkelly/quant/blob/b3a1d83466ff5bb3b80e29f4d9999d871c77d280/config/initializers/withings.rb | config/initializers/withings.rb | Withings.configure(Settings.withings_oauth_key, Settings.withings_oauth_secret)
| ruby | MIT | b3a1d83466ff5bb3b80e29f4d9999d871c77d280 | 2026-01-04T17:44:17.025352Z | false |
jdjkelly/quant | https://github.com/jdjkelly/quant/blob/b3a1d83466ff5bb3b80e29f4d9999d871c77d280/config/initializers/wrap_parameters.rb | config/initializers/wrap_parameters.rb | # Be sure to restart your server when you modify this file.
#
# This file contains settings for ActionController::ParamsWrapper which
# is enabled by default.
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do
wrap_parameters ... | ruby | MIT | b3a1d83466ff5bb3b80e29f4d9999d871c77d280 | 2026-01-04T17:44:17.025352Z | false |
jdjkelly/quant | https://github.com/jdjkelly/quant/blob/b3a1d83466ff5bb3b80e29f4d9999d871c77d280/config/initializers/inflections.rb | config/initializers/inflections.rb | # Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format
# (all these examples are active by default):
# ActiveSupport::Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', ... | ruby | MIT | b3a1d83466ff5bb3b80e29f4d9999d871c77d280 | 2026-01-04T17:44:17.025352Z | false |
jdjkelly/quant | https://github.com/jdjkelly/quant/blob/b3a1d83466ff5bb3b80e29f4d9999d871c77d280/config/initializers/json_escape.rb | config/initializers/json_escape.rb | class ActionView::Base
def json_escape(s)
result = s.to_s.gsub('/', '\/')
s.html_safe? ? result.html_safe : result
end
alias j json_escape
end
| ruby | MIT | b3a1d83466ff5bb3b80e29f4d9999d871c77d280 | 2026-01-04T17:44:17.025352Z | false |
jdjkelly/quant | https://github.com/jdjkelly/quant/blob/b3a1d83466ff5bb3b80e29f4d9999d871c77d280/config/initializers/warden_callbacks.rb | config/initializers/warden_callbacks.rb | Warden::Manager.after_authentication do |user,auth,opts|
end
| ruby | MIT | b3a1d83466ff5bb3b80e29f4d9999d871c77d280 | 2026-01-04T17:44:17.025352Z | false |
jdjkelly/quant | https://github.com/jdjkelly/quant/blob/b3a1d83466ff5bb3b80e29f4d9999d871c77d280/config/initializers/backtrace_silencers.rb | config/initializers/backtrace_silencers.rb | # Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
# You can also remove all the silencers if you're trying to debug a probl... | ruby | MIT | b3a1d83466ff5bb3b80e29f4d9999d871c77d280 | 2026-01-04T17:44:17.025352Z | false |
jdjkelly/quant | https://github.com/jdjkelly/quant/blob/b3a1d83466ff5bb3b80e29f4d9999d871c77d280/config/initializers/mime_types.rb | config/initializers/mime_types.rb | # Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
# Mime::Type.register_alias "text/html", :iphone
| ruby | MIT | b3a1d83466ff5bb3b80e29f4d9999d871c77d280 | 2026-01-04T17:44:17.025352Z | false |
jdjkelly/quant | https://github.com/jdjkelly/quant/blob/b3a1d83466ff5bb3b80e29f4d9999d871c77d280/config/initializers/secret_token.rb | config/initializers/secret_token.rb | if Rails.env.test? || Rails.env.development? || Rails.env == "profile"
Quantify::Application.config.secret_token = "8ae1beeb1dbcda5851624d6dbf1c6656827e54d81c025501a7a23e09801ec2eee0f05625218ec45479bb28eb23c60fd73a89ae0e3e6cf5fbce0c2c13da6fd89b"
Quantify::Application.config.secret_key_base = "c6e66601cd5d4b6183ac99... | ruby | MIT | b3a1d83466ff5bb3b80e29f4d9999d871c77d280 | 2026-01-04T17:44:17.025352Z | false |
jdjkelly/quant | https://github.com/jdjkelly/quant/blob/b3a1d83466ff5bb3b80e29f4d9999d871c77d280/config/environments/test.rb | config/environments/test.rb | Quantify::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 s... | ruby | MIT | b3a1d83466ff5bb3b80e29f4d9999d871c77d280 | 2026-01-04T17:44:17.025352Z | false |
jdjkelly/quant | https://github.com/jdjkelly/quant/blob/b3a1d83466ff5bb3b80e29f4d9999d871c77d280/config/environments/development.rb | config/environments/development.rb | Quantify::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
config.middleware.use Rack::LiveReload
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# ... | ruby | MIT | b3a1d83466ff5bb3b80e29f4d9999d871c77d280 | 2026-01-04T17:44:17.025352Z | false |
jdjkelly/quant | https://github.com/jdjkelly/quant/blob/b3a1d83466ff5bb3b80e29f4d9999d871c77d280/config/environments/production.rb | config/environments/production.rb | Quantify::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.actio... | ruby | MIT | b3a1d83466ff5bb3b80e29f4d9999d871c77d280 | 2026-01-04T17:44:17.025352Z | false |
ayastreb/jekyll-maps | https://github.com/ayastreb/jekyll-maps/blob/14109e9917dbdc03b710981a464f8860b12a828e/spec/options_parser_spec.rb | spec/options_parser_spec.rb | require "spec_helper"
describe Jekyll::Maps::OptionsParser do
context "parses filters" do
it "ignores extra whitespaces" do
actual = Jekyll::Maps::OptionsParser.parse(" foo_key = 'bar' moo = 'baz'")
expected = {
"foo_key" => "bar",
"moo" => "baz"
}
expect(actual[:f... | ruby | MIT | 14109e9917dbdc03b710981a464f8860b12a828e | 2026-01-04T17:44:16.897613Z | false |
ayastreb/jekyll-maps | https://github.com/ayastreb/jekyll-maps/blob/14109e9917dbdc03b710981a464f8860b12a828e/spec/spec_helper.rb | spec/spec_helper.rb | $LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
require "simplecov"
SimpleCov.start
require "jekyll"
require "jekyll-maps"
Jekyll.logger.log_level = :error
RSpec.configure do |config|
config.run_all_when_everything_filtered = true
config.filter_run :focus
config.order = "random"
SOURCE_DIR = File... | ruby | MIT | 14109e9917dbdc03b710981a464f8860b12a828e | 2026-01-04T17:44:16.897613Z | false |
ayastreb/jekyll-maps | https://github.com/ayastreb/jekyll-maps/blob/14109e9917dbdc03b710981a464f8860b12a828e/spec/location_finder_spec.rb | spec/location_finder_spec.rb | require "spec_helper"
describe Jekyll::Maps::LocationFinder do
let(:site) { make_site }
let(:page) { make_page }
before :each do
site.process
end
context "looking for locations in posts" do
let(:options) { Jekyll::Maps::OptionsParser.parse("src='_posts'") }
let(:finder) { Jekyll::Maps::Locatio... | ruby | MIT | 14109e9917dbdc03b710981a464f8860b12a828e | 2026-01-04T17:44:16.897613Z | false |
ayastreb/jekyll-maps | https://github.com/ayastreb/jekyll-maps/blob/14109e9917dbdc03b710981a464f8860b12a828e/spec/google_map_tag_spec.rb | spec/google_map_tag_spec.rb | require "spec_helper"
describe Jekyll::Maps::GoogleMapTag do
let(:site) { make_site }
before { site.process }
context "full page rendering" do
let(:content) { File.read(dest_dir("page.html")) }
it "builds javascript" do
expect(content).to match(%r!#{Jekyll::Maps::GoogleMapTag::JS_LIB_NAME}!)
... | ruby | MIT | 14109e9917dbdc03b710981a464f8860b12a828e | 2026-01-04T17:44:16.897613Z | false |
ayastreb/jekyll-maps | https://github.com/ayastreb/jekyll-maps/blob/14109e9917dbdc03b710981a464f8860b12a828e/lib/jekyll-maps.rb | lib/jekyll-maps.rb | require "securerandom"
require "ostruct"
require "jekyll-maps/google_map_api"
require "jekyll-maps/google_map_tag"
require "jekyll-maps/location_finder"
require "jekyll-maps/options_parser"
require "jekyll-maps/version"
module Jekyll
module Maps
end
end
| ruby | MIT | 14109e9917dbdc03b710981a464f8860b12a828e | 2026-01-04T17:44:16.897613Z | false |
ayastreb/jekyll-maps | https://github.com/ayastreb/jekyll-maps/blob/14109e9917dbdc03b710981a464f8860b12a828e/lib/jekyll-maps/version.rb | lib/jekyll-maps/version.rb | module Jekyll
module Maps
VERSION = "2.4.0".freeze
end
end
| ruby | MIT | 14109e9917dbdc03b710981a464f8860b12a828e | 2026-01-04T17:44:16.897613Z | false |
ayastreb/jekyll-maps | https://github.com/ayastreb/jekyll-maps/blob/14109e9917dbdc03b710981a464f8860b12a828e/lib/jekyll-maps/google_map_api.rb | lib/jekyll-maps/google_map_api.rb | module Jekyll
module Maps
class GoogleMapApi
HEAD_END_TAG = %r!</[\s\t]*head>!
BODY_END_TAG = %r!</[\s\t]*body>!
class << self
def prepend_api_code(doc)
@config = doc.site.config
if doc.output =~ HEAD_END_TAG
# Insert API code before header's end if this ... | ruby | MIT | 14109e9917dbdc03b710981a464f8860b12a828e | 2026-01-04T17:44:16.897613Z | false |
ayastreb/jekyll-maps | https://github.com/ayastreb/jekyll-maps/blob/14109e9917dbdc03b710981a464f8860b12a828e/lib/jekyll-maps/google_map_tag.rb | lib/jekyll-maps/google_map_tag.rb | module Jekyll
module Maps
class GoogleMapTag < Liquid::Tag
JS_LIB_NAME = "jekyllMaps".freeze
DEFAULT_MAP_WIDTH = 600
DEFAULT_MAP_HEIGHT = 400
def initialize(_, args, _)
@args = OptionsParser.parse(args)
@finder = LocationFinder.new(@args)
super
end
... | ruby | MIT | 14109e9917dbdc03b710981a464f8860b12a828e | 2026-01-04T17:44:16.897613Z | false |
ayastreb/jekyll-maps | https://github.com/ayastreb/jekyll-maps/blob/14109e9917dbdc03b710981a464f8860b12a828e/lib/jekyll-maps/location_finder.rb | lib/jekyll-maps/location_finder.rb | module Jekyll
module Maps
class LocationFinder
def initialize(options)
@documents = []
@options = options
end
def find(site, page)
if @options[:attributes][:latitude] && @options[:attributes][:longitude]
return [location_from_options(page)]
elsif @optio... | ruby | MIT | 14109e9917dbdc03b710981a464f8860b12a828e | 2026-01-04T17:44:16.897613Z | false |
ayastreb/jekyll-maps | https://github.com/ayastreb/jekyll-maps/blob/14109e9917dbdc03b710981a464f8860b12a828e/lib/jekyll-maps/options_parser.rb | lib/jekyll-maps/options_parser.rb | module Jekyll
module Maps
class OptionsParser
OPTIONS_SYNTAX = %r!([^\s]+)\s*=\s*['"]+([^'"]+)['"]+!
ALLOWED_FLAGS = %w(
no_cluster
).freeze
ALLOWED_ATTRIBUTES = %w(
id
width
height
class
show_marker
show_popup
zoom
... | ruby | MIT | 14109e9917dbdc03b710981a464f8860b12a828e | 2026-01-04T17:44:16.897613Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/services/stats.rb | app/services/stats.rb |
class Stats
def initialize(stats_map)
@stats = []
dates = stats_map.keys.sort
dates.each_with_index do |date, index|
old_date = index == 0 ? nil : dates[index-1]
@stats << StatsEntry.new(date, stats_map[date], stats_map[old_date])
end
@stats.shift
end
def each(&block)
@stats.... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/services/newsfeed_day.rb | app/services/newsfeed_day.rb | class NewsfeedDay
attr_reader :title, :badges_added, :badges_removed,
:not_forked_projects_created, :failed_builds
def initialize(date)
@day = date.midnight
@title = @day.strftime("%Y-%m-%d")
@badges_added = Project.where('badge_in_readme = ? AND badge_in_readme_added_at > ? AND badge_in_... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/services/badge_markup.rb | app/services/badge_markup.rb | class BadgeMarkup < Struct.new(:project, :branch)
BASE_URL = "http://inch-ci.org"
IMAGE_FORMATS = [:svg, :png]
DEFAULT_IMAGE_FORMAT = IMAGE_FORMATS.first
IMAGE_STYLES = [nil, 'flat-square', 'shields']
def each(format = DEFAULT_IMAGE_FORMAT, style = nil, &block)
format_map(format, style).each(&block)
en... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/services/action/build_history.rb | app/services/action/build_history.rb | require 'inch_ci/action'
module Action
class BuildHistory
include InchCI::Action
include Action::SetProjectAndBranch
exposes :project, :branch, :builds
exposes :running_builds, :scheduled_builds, :completed_builds
def initialize(params)
@language = params[:language]
set_project_and_... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/services/action/set_project_and_branch.rb | app/services/action/set_project_and_branch.rb | require 'inch_ci/action'
module Action
module SetProjectAndBranch
def set_project_and_branch(params)
finder = InchCI::Action::FindProjectAndBranch.call(params)
unless finder.project.nil?
@project = ProjectPresenter.new(finder.project)
@branch = finder.branch
end
end
end
en... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/services/action/user/init_projects.rb | app/services/action/user/init_projects.rb | require 'inch_ci/action'
module Action
module User
class InitProjects
include InchCI::Action
exposes :user, :projects
ORIGIN = 'github_sync'
TRIGGER = 'first_signin'
def initialize(current_user, params)
@user = current_user.to_model
if @user.last_synced_projects_a... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/services/action/user/sync_projects.rb | app/services/action/user/sync_projects.rb | require 'inch_ci/action'
module Action
module User
class SyncProjects
include InchCI::Action
DEFAULT_TAB = Action::User::Show::DEFAULT_TAB
exposes :user, :projects, :languages, :active_tab
def initialize(current_user, params)
@user = UserPresenter.new(current_user)
@lan... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/services/action/user/signin.rb | app/services/action/user/signin.rb | require 'inch_ci/action'
module Action
module User
class Signin
include InchCI::Action
CLIENT_ID = InchCI::AccessToken[:github_client_id]
CLIENT_SECRET = InchCI::AccessToken[:github_secret]
exposes :user
def initialize(request)
@user = find_or_create_user(request.env[... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/services/action/user/welcome.rb | app/services/action/user/welcome.rb | require 'inch_ci/action'
module Action
module User
class Welcome
include InchCI::Action
LIMIT = 9
exposes :user, :followed_projects
def initialize(user)
@user = user
@followed_projects = find_projects(user).select(&:badge?)
count = @followed_projects.size
... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/services/action/user/show.rb | app/services/action/user/show.rb | require 'inch_ci/action'
module Action
module User
class Show
include InchCI::Action
LANGUAGES = InchCI::Config::LANGUAGES
DEFAULT_TAB = LANGUAGES.first
exposes :user, :projects, :projects_without_badges, :languages,
:active_tab
def initialize(current_user, params)
... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/services/action/code_object/show.rb | app/services/action/code_object/show.rb | require 'inch_ci/action'
module Action
module CodeObject
class Show
include InchCI::Action
include Action::SetProjectAndBranch
exposes :project, :branch, :revision, :code_object
def initialize(params)
set_project_and_branch(params)
@revision = find_revision(@branch, para... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/services/action/project/rebuild_via_hook.rb | app/services/action/project/rebuild_via_hook.rb | require 'inch_ci/action'
module Action
module Project
class RebuildViaHook
include InchCI::Action
TRIGGER = 'hook'
exposes :result
def initialize(params)
if params[:payload]
process_payload JSON[params[:payload]]
elsif params[:ref]
process_payload pa... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/services/action/project/update.rb | app/services/action/project/update.rb | require 'inch_ci/action'
module Action
module Project
class Update
include InchCI::Action
include Action::SetProjectAndBranch
exposes :project, :branch
# allow if user owns project or user is in project's org
def self.can_edit?(current_user, project)
organizations = curren... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/services/action/project/rebuild.rb | app/services/action/project/rebuild.rb | require 'inch_ci/action'
module Action
module Project
class Rebuild
include InchCI::Action
include Action::SetProjectAndBranch
exposes :project, :branch, :build
def initialize(params)
set_project_and_branch(params)
if @project && @branch
# maybe we should check... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/services/action/project/activate_hook.rb | app/services/action/project/activate_hook.rb | require 'inch_ci/action'
module Action
module Project
class ActivateHook
include InchCI::Action
include Action::SetProjectAndBranch
TRIGGER = 'activate_hook'
exposes :project
def initialize(user, params)
set_project_and_branch(params)
if user_access_token = user.g... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/services/action/project/deactivate_hook.rb | app/services/action/project/deactivate_hook.rb | require 'inch_ci/action'
module Action
module Project
class DeactivateHook
include InchCI::Action
include Action::SetProjectAndBranch
exposes :project
def initialize(user, params)
set_project_and_branch(params)
if user_access_token = user.github_access_token
pr... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/services/action/project/suggestions.rb | app/services/action/project/suggestions.rb | module Action
module Project
class Suggestions < Show
FILE_COUNT = 5
GRADES_TO_DISPLAY = %w(B C U)
GRADE_WEIGHTS = [0.2, 0.4, 0.4]
MIN_PRIORITY = 0
exposes :project, :branch, :revision, :collection, :suggestion_count
exposes :suggestions, :files
... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/services/action/project/update_info.rb | app/services/action/project/update_info.rb | require 'inch_ci/action'
module Action
module Project
class UpdateInfo
include InchCI::Action
include Action::SetProjectAndBranch
exposes :project, :branch
def initialize(current_user, params)
set_project_and_branch(params)
update_project
if current_user && @proj... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/services/action/project/badge.rb | app/services/action/project/badge.rb | require 'inch_ci/action'
module Action
module Project
class Badge
include InchCI::Action
include Action::SetProjectAndBranch
exposes :project, :branch, :badge_filename, :content_type
def initialize(params)
set_project_and_branch(params)
if !@project
create_proj... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/services/action/project/create.rb | app/services/action/project/create.rb | require 'inch_ci/action'
module Action
module Project
class Create
include InchCI::Action
exposes :project
def initialize(params, origin = nil)
return unless params[:repo_url].present?
info = InchCI::RepoURL.new(params[:repo_url])
if info.repo_url.nil?
info ... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/services/action/project/history.rb | app/services/action/project/history.rb | require 'inch_ci/action'
require 'inch_ci/grade_list_collection'
module Action
module Project
class History < Show
include InchCI::Action
include Action::SetProjectAndBranch
exposes :project, :branch, :revision, :collection, :suggestion_count
exposes :builds, :diffs, :code_object_map
... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/services/action/project/show.rb | app/services/action/project/show.rb | require 'inch_ci/action'
require 'inch_ci/grade_list_collection'
module Action
module Project
class Show
include InchCI::Action
include Action::SetProjectAndBranch
MAX_SUGGESTIONS = 20
exposes :project, :branch, :revision, :user, :code_objects,
:collection, :suggestion_cou... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/services/action/build/show.rb | app/services/action/build/show.rb | require 'inch_ci/action'
module Action
module Build
class Show
include InchCI::Action
exposes :build, :code_object_map, :filename, :dump
def initialize(params, load_dump: false, load_diff: false)
if uid = params[:id]
@build = BuildPresenter.new(InchCI::Store::FindBuild.call(... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/services/action/cli/list_dumps.rb | app/services/action/cli/list_dumps.rb | require 'inch_ci/action'
module Action
module CLI
class ListDumps
include InchCI::Action
LANGUAGES = %w(elixir nodejs)
exposes :languages, :language, :filenames, :dates
def initialize(params)
@languages = LANGUAGES
if @language = params[:language]
glob = File... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/services/action/cli/get_dump.rb | app/services/action/cli/get_dump.rb | require 'inch_ci/action'
module Action
module CLI
class GetDump
include InchCI::Action
exposes :filename, :json, :out
def initialize(params)
if @filename = params[:filename]
@json = JSON[ File.read( filename_from_params(@filename, :json) ) ]
@out = terminal File.r... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/presenters/revision_diff_presenter.rb | app/presenters/revision_diff_presenter.rb | class RevisionDiffPresenter < BasePresenter
def code_object(id)
@code_objects ||= {}
CodeObjectPresenter.new(@code_objects[id] || CodeObject.find(id))
end
def revision
@revision ||= RevisionPresenter.new(@resource.after_revision)
end
def change_count
@change_count ||= [*changes.values].flatt... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/presenters/base_presenter.rb | app/presenters/base_presenter.rb | # A BasePresenter object represents a +resource+ (i.e. data object) in the
# view layer of application delivery.
#
# == Creation
#
# You create a Presenter object by subclassing BasePresenter:
#
# class ProjectPresenter < BasePresenter
# end
#
# The constructor takes the +resource+ as its single parameter:
#
# p ... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/presenters/code_object_presenter.rb | app/presenters/code_object_presenter.rb | class CodeObjectPresenter < BasePresenter
def_delegators :code_object, :fullname, :score, :grade, :priority, :docstring
def_delegators :code_object, :project, :branch
# TODO: use_presenters :project, :branch
use_presenters :code_object_roles
def bad_code_object_roles
code_object_roles.select(&:bad?).sor... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/presenters/code_object_role_presenter.rb | app/presenters/code_object_role_presenter.rb | class CodeObjectRolePresenter < BasePresenter
def_delegators :code_object_role, :ref_name, :priority, :score, :potential_score, :min_score, :max_score
def bad?
potential_score.to_i > 0
end
def name
code_object_role.code_object_role_name.name
end
def to_desc(object = nil)
args = {
:objec... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/presenters/user_presenter.rb | app/presenters/user_presenter.rb | class UserPresenter < BasePresenter
def_delegators :user, :display_name, :user_name, :email, :provider, :follows,
:last_synced_projects_at, :last_signin_at,
:github_access_token, :organizations
use_presenters :projects
def github_url
"https://github.com/#{user... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/presenters/project_presenter.rb | app/presenters/project_presenter.rb | class ProjectPresenter < BasePresenter
def_delegators :project, :uid, :name, :description
def_delegators :project, :homepage_url, :source_code_url, :repo_url, :documentation_url
def_delegators :project, :language, :origin
def_delegators :project, :github_hook_id, :github_hook_active
def_delegators :project, :... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/presenters/revision_presenter.rb | app/presenters/revision_presenter.rb | class RevisionPresenter < BasePresenter
def_delegators :revision, :diff, :tag_uid, :badge_in_readme?
def_delegators :revision, :author_name, :author_email, :authored_at, :message
def_delegators :revision, :branch, :project
use_presenters :builds, :code_objects
def uid(short = true)
short ? revision.uid[... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/presenters/build_presenter.rb | app/presenters/build_presenter.rb | class BuildPresenter < BasePresenter
def_delegators :build, :status, :trigger, :started_at, :finished_at
def_delegators :build, :branch, :revision, :number, :stderr
use_presenters :revision, :revision_diff
def duplicate?
status == 'duplicate'
end
def finished?
status != 'created' && status != 'ru... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/helpers/projects_helper.rb | app/helpers/projects_helper.rb | module ProjectsHelper
def badge_markup
@badge_markup ||= BadgeMarkup.new(@project, @branch)
end
def escape_markdown(str)
str.to_s.gsub('_', '\_')
end
def tweet_url(project = nil)
url = project ? project_url(project) : root_url
text = project ? t("shared.twitter_text", :project_language => pr... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/helpers/code_objects_helper.rb | app/helpers/code_objects_helper.rb | module CodeObjectsHelper
def link_to_code_object(revision, code_object)
branch = revision.branch
project = branch.project
path = code_object_path(project, branch.name, revision.uid, :code_object => code_object)
link_to code_object.fullname, path, :"data-code_object-id" => code_object.id, :remote => t... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/helpers/users_helper.rb | app/helpers/users_helper.rb | module UsersHelper
end
| ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/helpers/gossip_helper.rb | app/helpers/gossip_helper.rb | module GossipHelper
def gossip_active?
InchCI::Gossip::GOSSIP_ACTIVE
end
def gossip_server
return unless gossip_active?
InchCI::Gossip::GOSSIP_HOST
end
def gossip_room
return unless gossip_active?
if @project
"projects:#{@project.uid}"
else
@gossip_room # "projects:lobby"... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/helpers/application_helper.rb | app/helpers/application_helper.rb | module ApplicationHelper
def icon(key, options = {})
opts = options.merge(:class => "fa fa-#{key} #{options[:class]}".strip)
content_tag(:i, "", opts).html_safe
end
def markdown(text)
renderer = Redcarpet::Markdown.new(TargetBlankRenderer,
:autolink => true, :space_after_headers => true)
re... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/helpers/help_helper.rb | app/helpers/help_helper.rb | module HelpHelper
end
| ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/helpers/builds_helper.rb | app/helpers/builds_helper.rb | module BuildsHelper
def back_button(path)
link_to icon('arrow-left') + ' ' + t("shared.back_link"), path, :class => "btn btn-default btn-cancel"
end
def build_css_class(build)
{
'created' => '',
'running' => :info,
'success' => :success,
'duplicate' => :warning,
'cancelled' ... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/helpers/admin/overview_helper.rb | app/helpers/admin/overview_helper.rb | module Admin::OverviewHelper
def created_at_classes(object)
today = Time.now.utc.midnight
created = object.created_at.midnight
[
created == today ? 'today' : nil,
created == today - 1.day ? 'yesterday' : nil,
]
end
def link_to_user_projects(user, language = nil)
projects = user.pr... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/controllers/revisions_controller.rb | app/controllers/revisions_controller.rb | class RevisionsController < ApplicationController
end
| ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/controllers/page_controller.rb | app/controllers/page_controller.rb | class PageController < ApplicationController
layout 'application'
end
| ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/controllers/help_controller.rb | app/controllers/help_controller.rb | class HelpController < ApplicationController
layout 'application'
end
| ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/controllers/builds_controller.rb | app/controllers/builds_controller.rb | require 'inch_ci/controller'
class BuildsController < ApplicationController
include InchCI::Controller
layout 'application'
def index
view = Action::BuildHistory.new(params)
expose view
end
def history_show
view = Action::Build::Show.new(params, load_diff: true)
expose view
end
def sh... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/controllers/projects_controller.rb | app/controllers/projects_controller.rb | require 'inch_ci/controller'
require 'inch_ci/badge'
class ProjectsController < ApplicationController
include InchCI::Controller
layout 'application'
skip_before_action :verify_authenticity_token, :only => [:rebuild_via_hook]
def badge
action = Action::Project::Badge.new(params)
if action.success?
... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/controllers/code_object_roles_controller.rb | app/controllers/code_object_roles_controller.rb | class CodeObjectRolesController < ApplicationController
end
| ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/controllers/users_controller.rb | app/controllers/users_controller.rb | require 'inch_ci/controller'
class UsersController < ApplicationController
include InchCI::Controller
before_action :require_login
layout 'application'
def init_projects
action = Action::User::InitProjects.new(current_user, params)
expose action
respond_to do |format|
format.js
end
e... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/controllers/code_objects_controller.rb | app/controllers/code_objects_controller.rb | require 'inch_ci/controller'
class CodeObjectsController < ApplicationController
include InchCI::Controller
def show
view = Action::CodeObject::Show.new(params)
expose view
if view.code_object.nil?
render :text => "CodeObject not found.", :layout => true, :status => 404
end
end
end
| ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/controllers/branches_controller.rb | app/controllers/branches_controller.rb | class BranchesController < ApplicationController
end
| ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/controllers/sessions_controller.rb | app/controllers/sessions_controller.rb | class SessionsController < ApplicationController
def create
action = Action::User::Signin.new(request)
self.current_user = action.user
redirect_to action.new_user? ? welcome_url : user_url(current_user)
end
def destroy
session[:user_id] = nil
redirect_to root_url, :notice => "Signed out!"
e... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/controllers/application_controller.rb | app/controllers/application_controller.rb | class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
private
def featured_projects(language)
@featured_projects ||= {}
@featured_projects[language] ||= FEATURE... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/controllers/admin/builds_controller.rb | app/controllers/admin/builds_controller.rb | require 'inch_ci/controller'
class Admin::BuildsController < ApplicationController
include InchCI::Controller
layout 'admin'
PER_PAGE = 200
def index
set_builds
@languages = %w(Elixir JavaScript Ruby)
@gossip_room = "projects:lobby"
end
def show
view = Action::Build::Show.new(params, loa... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/controllers/admin/projects_controller.rb | app/controllers/admin/projects_controller.rb | require 'inch_ci/controller'
class Admin::ProjectsController < ApplicationController
include InchCI::Controller
PROJECTS_PER_PAGE = 200
LANGUAGE_NOT_SET = "LANGUAGE_NOT_SET"
layout 'admin'
def create
action = Action::Project::Create.new(params, :admin)
if action.success?
redirect_to project_... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/controllers/admin/statistics_controller.rb | app/controllers/admin/statistics_controller.rb | class Admin::StatisticsController < ApplicationController
layout 'admin'
def index
weeks
end
DAYS_BACK = 21
def days
set_stats do
Statistics.where("date > ?", time_units_back_timestamp(:days, DAYS_BACK))
end
render :action => "index"
end
WEEKS_BACK = 20
def weeks
set_stats d... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/controllers/admin/users_controller.rb | app/controllers/admin/users_controller.rb | require 'inch_ci/controller'
class Admin::UsersController < ApplicationController
include InchCI::Controller
layout 'admin'
def index
@users = sort_collection(User)
@languages = InchCI::Config::LANGUAGES
end
private
def sort_collection(arel)
arel.order('created_at DESC')
end
end
| ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/controllers/admin/overview_controller.rb | app/controllers/admin/overview_controller.rb | class Admin::OverviewController < ApplicationController
layout 'admin'
def index
set_stats
respond_to do |format|
format.html do
set_chart_data
set_newsfeed
set_projects
end
format.json do
@pending_builds_24 = Build.where("created_at > ?", 24.hours.ago).wh... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/controllers/admin/cli_controller.rb | app/controllers/admin/cli_controller.rb | require 'inch_ci/controller'
class Admin::CliController < ApplicationController
include InchCI::Controller
layout 'admin'
def index
expose Action::CLI::ListDumps.new(params)
expose Action::CLI::GetDump.new(params)
end
end
| ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/controllers/admin/badges_controller.rb | app/controllers/admin/badges_controller.rb | class Admin::BadgesController < ApplicationController
layout 'admin'
def added
@date_from = Date.parse(params[:date_from])
@date_to = Date.parse(params[:date_to])
@projects_from = projects_with_badges_before(@date_from)
@projects_to = projects_with_badges_before(@date_to)
@projects = @projects_... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/controllers/api/builds_controller.rb | app/controllers/api/builds_controller.rb | require 'inch'
require 'fileutils'
require 'inch_ci/worker/project/build_json'
module Api
class BuildsController < ApplicationController
protect_from_forgery with: :null_session
def hint
render_text "> Greetings, Professor Falken.\n\n> _\n"
end
def run
# let's ensure backwards compatibi... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/controllers/api/cli_controller.rb | app/controllers/api/cli_controller.rb | require 'inch'
require 'inch/cli'
require 'inch/utils/ui'
require 'inch/utils/buffered_ui'
require 'fileutils'
module Api
class CliController < ApplicationController
protect_from_forgery with: :null_session
def hint
render_text "> Greetings, Professor Falken.\n\n> _\n"
end
def run
# let... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
inch-ci/inch_ci-web | https://github.com/inch-ci/inch_ci-web/blob/db1437218f544e4f21bdfd3690a952bf26a84028/app/models/project.rb | app/models/project.rb | require 'inch_ci/project_uid'
class Project < ActiveRecord::Base
UID_FORMAT = /\A([a-z0-9\-\_\.]+)\:([a-z0-9\-\_\.]+)\/([a-z0-9\-\_\.]+)\Z/i
has_many :branches, :dependent => :destroy
has_many :code_objects, :dependent => :destroy
belongs_to :default_branch, :class_name => 'Branch'
has_many :builds, :thro... | ruby | MIT | db1437218f544e4f21bdfd3690a952bf26a84028 | 2026-01-04T17:44:13.103953Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.