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 | nilenso/ashoka-survey-web | https://github.com/nilenso/ashoka-survey-web | lib/generators/question_type/templates/backbone_actual_template.rb | Ruby | mit | 47 | master | 674 | <label><%= t("surveys.build.question_title") %> </label>
<input type="text" name="content" value="{{content}}"></input>
<div>
<label><%= t("activerecord.attributes.question.mandatory") %> </label>
<input type="checkbox" name="mandatory" value="{{mandatory}}"></input>
</div>
<div>
<label><%= t("activerecord.attribute... |
github | nilenso/ashoka-survey-web | https://github.com/nilenso/ashoka-survey-web | lib/generators/question_type/templates/backbone_model.rb | Ruby | mit | 47 | master | 316 | ##= require ./question_model
# Job of the class goes here
class SurveyBuilder.Models.<%= class_name %>Model extends SurveyBuilder.Models.QuestionModel
defaults: {
type: '<%= class_name %>',
content: 'Untitled question'
mandatory: false
}
SurveyBuilder.Models.<%= class_name %>QuestionModel.setup() |
github | nilenso/ashoka-survey-web | https://github.com/nilenso/ashoka-survey-web | lib/omniauth/strategies/user_owner.rb | Ruby | mit | 47 | master | 737 | module OmniAuth
module Strategies
class UserOwner < OmniAuth::Strategies::OAuth2
option :name, :user_owner
option :client_options, {
site: ENV["OAUTH_SERVER_URL"],
authorize_path: "/oauth/authorize"
}
uid do
raw_info["id"]
end
info do
{
... |
github | nilenso/ashoka-survey-web | https://github.com/nilenso/ashoka-survey-web | config/application.rb | Ruby | mit | 47 | master | 3,307 | require File.expand_path('../boot', __FILE__)
require 'rails/all'
require 'csv'
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require(*Rails.groups(:assets => %w(development test)))
# If you want your assets lazily compiled in production, use this line
#... |
github | nilenso/ashoka-survey-web | https://github.com/nilenso/ashoka-survey-web | config/routes.rb | Ruby | mit | 47 | master | 2,583 | SurveyWeb::Application.routes.draw do
scope "(:locale)", :locale => /#{I18n.available_locales.join('|')}/ do
match '/auth/:provider/callback', :to => 'sessions#create'
match '/auth/failure', :to => 'sessions#failure'
match '/logout', :to => 'sessions#destroy', :as => 'logout'
resources :dashboards, ... |
github | nilenso/ashoka-survey-web | https://github.com/nilenso/ashoka-survey-web | config/environments/production.rb | Ruby | mit | 47 | master | 3,404 | SurveyWeb::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
memcached_config = YAML.load_file(Rails.root.join('config/memcached.yml'))
memcached_hosts = memcached_config['defaults']['servers']
config.cache_store = :dalli_store, *memcached_hosts
# A... |
github | nilenso/ashoka-survey-web | https://github.com/nilenso/ashoka-survey-web | config/environments/test.rb | Ruby | mit | 47 | master | 1,682 | SurveyWeb::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 | nilenso/ashoka-survey-web | https://github.com/nilenso/ashoka-survey-web | config/environments/staging.rb | Ruby | mit | 47 | master | 2,706 | SurveyWeb::Application.configure do
config.action_dispatch.rack_cache = {
:metastore => Dalli::Client.new,
:entitystore => 'file:tmp/cache/rack/body',
:allow_reload => false
}
# Add HTTP headers to cache static assets for an hour
config.static_cache_control = "public, max-age=2592000"
# Code... |
github | nilenso/ashoka-survey-web | https://github.com/nilenso/ashoka-survey-web | config/environments/development.rb | Ruby | mit | 47 | master | 1,676 | SurveyWeb::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 web ... |
github | nilenso/ashoka-survey-web | https://github.com/nilenso/ashoka-survey-web | config/initializers/secret_token.rb | Ruby | mit | 47 | master | 389 | # 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 | nilenso/ashoka-survey-web | https://github.com/nilenso/ashoka-survey-web | config/initializers/formtastic.rb | Ruby | mit | 47 | master | 4,096 | # encoding: utf-8
# Set the default text field size when input is a string. Default is nil.
# Formtastic::FormBuilder.default_text_field_size = 50
# Set the default text area height when input is a text. Default is 20.
# Formtastic::FormBuilder.default_text_area_height = 5
# Set the default text area width when inpu... |
github | nilenso/ashoka-survey-web | https://github.com/nilenso/ashoka-survey-web | config/initializers/carrierwave_backgrounder.rb | Ruby | mit | 47 | master | 285 | CarrierWave::Backgrounder.configure do |c|
c.backend :delayed_job, queue: :carrierwave
# c.backend :resque, queue: :carrierwave
# c.backend :sidekiq, queue: :carrierwave
# c.backend :girl_friday, queue: :carrierwave
# c.backend :qu, queue: :carrierwave
# c.backend :qc
end |
github | nilenso/ashoka-survey-web | https://github.com/nilenso/ashoka-survey-web | config/initializers/session_store.rb | Ruby | mit | 47 | master | 440 | # Be sure to restart your server when you modify this file.
SurveyWeb::Application.config.session_store :cookie_store, key: '_survey-web_session', :httponly => false
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the se... |
github | nilenso/ashoka-survey-web | https://github.com/nilenso/ashoka-survey-web | config/initializers/konacha.rb | Ruby | mit | 47 | master | 253 | if defined?(Konacha)
Capybara.register_driver(:slow_poltergeist) { |app| Capybara::Poltergeist::Driver.new(app, :timeout => 2.minutes) }
Konacha.configure do |config|
require 'capybara/poltergeist'
config.driver = :slow_poltergeist
end
end |
github | nilenso/ashoka-survey-web | https://github.com/nilenso/ashoka-survey-web | config/initializers/omniauth.rb | Ruby | mit | 47 | master | 204 | require File.expand_path('lib/omniauth/strategies/user_owner', Rails.root)
Rails.application.config.middleware.use OmniAuth::Builder do
provider :user_owner, ENV["OAUTH_ID"], ENV["OAUTH_SECRET"]
end |
github | nilenso/ashoka-survey-web | https://github.com/nilenso/ashoka-survey-web | config/initializers/carrierwave.rb | Ruby | mit | 47 | master | 507 | CarrierWave.configure do |config|
config.fog_credentials = {
:provider => 'AWS', # required
:aws_access_key_id => ENV['S3_ACCESS_KEY'], # required
:aws_secret_access_key => ENV['S3_SECRET'], # required
}
config.st... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | rally_api.gemspec | Ruby | mit | 47 | master | 1,300 | # -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require "rally_api/version"
Gem::Specification.new do |s|
s.name = "rally_api"
s.version = RallyAPI::VERSION
s.authors = ["Dave Smith", "Rylee Keys", "Kip Lehman"]
s.email = ["dsmith@rallydev.com", "rylee@rallydev.com",... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | Rakefile | Ruby | mit | 47 | master | 367 | require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
task :make_rally_api_gem do
system("gem build rally_api.gemspec")
end
desc "run all api tests"
RSpec::Core::RakeTask.new('api_tests') do |t|
t.pattern = ['spec/*_spec.rb']
end
desc "run api create tests"
RSpec::Core::RakeTask.new('api_create_tests') do |... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | spec/rally_object_spec.rb | Ruby | mit | 47 | master | 4,092 | require_relative "spec_helper"
describe "Rally Json Object Tests" do
JSON_TEST_OBJECT = { "Name" => "Test Name", "Severity" => "High", "_type" => "defect", "ScheduleState" => "In-Progress"}
UPDATED_TEST_OBJECT = { "Name" => "Test Name", "Severity" => "High", "Priority" => "Very Important","_type" => "defect"}
... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | spec/rally_custom_http_header_spec.rb | Ruby | mit | 47 | master | 2,297 | require_relative "spec_helper"
describe "Rally Custom Headers" do
it "should have the basic information" do
ch = RallyAPI::CustomHttpHeader.new()
expect(ch.name).to eq("RallyRestJsonRuby")
expect(ch.platform).to match("Ruby")
expect(ch.library).to match("RallyRestJson version")
end
it "should g... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | spec/spec_helper.rb | Ruby | mit | 47 | master | 2,807 | require 'simplecov'
require 'yaml'
require 'rspec'
require 'pry'
#clear simplecov filters so this works in Rubymine
SimpleCov.profiles.delete(:root_filter)
SimpleCov.filters.clear
SimpleCov.start do
add_filter '/spec/'
add_filter '/.rvm/'
end
# The lib directory must be loaded AFTER SimpleCov to enable code cove... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | spec/rally_api_basic_spec.rb | Ruby | mit | 47 | master | 3,566 | require_relative "spec_helper"
describe "Rally Json API" do
before(:all) { @rally = RallyAPI::RallyRestJson.new(load_api_config) }
let(:rally_config) { load_api_config }
it "should connect to Rally" do
expect(@rally.user.UserName).not_to be_nil
end
it "should properly allow aliases for types" do... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | spec/rally_api_read_spec.rb | Ruby | mit | 47 | master | 2,967 | require_relative "spec_helper"
describe "Rally Json Read Tests" do
#Side note - trying to keep things from getting too cluttered
# hence the before all instead of before each
before :all do
@rally = RallyAPI::RallyRestJson.new(load_api_config)
fields = {"Name" => "rally_api tests - Defect #{Time.now}", ... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | spec/rally_dynatypes_spec.rb | Ruby | mit | 47 | master | 2,761 | require_relative "spec_helper"
describe "DynaType and Portfolio Item specific tests" do
before :all do
@rally = RallyAPI::RallyRestJson.new(load_api_config)
end
#1-------------------------------------------------------------------------------------------
it "should be able to create a PI post 1.37" do
... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | spec/rally_api_create_spec.rb | Ruby | mit | 47 | master | 3,266 | require_relative "spec_helper"
describe "Rally Json Create Tests" do
before :all do
@rally = RallyAPI::RallyRestJson.new(load_api_config)
end
def setup_test_defect(fields = {})
obj = fields
obj["Name"] = "Test Defect created #{DateTime.now()}"
obj["Environment"] = "Production"
obj["TargetDa... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | spec/rally_api_update_spec.rb | Ruby | mit | 47 | master | 5,537 | require_relative "spec_helper"
describe "Rally Json Update Tests" do
#Side note - trying to keep things from getting too cluttered
# hence the before all instead of before each
before :all do
@rally = RallyAPI::RallyRestJson.new(load_api_config)
fields = {"Name" => "rally_api tests - Defect #{Time.now}"... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | spec/rally_apikey_spec.rb | Ruby | mit | 47 | master | 2,675 | require_relative "spec_helper"
describe "Rally API Key Auth" do
#TODO: Use RSpec configuration (in spec helper) to only run tests if
# config_file is present, and config file includes an API key,
# username, and password
let(:config_file) { "APIconfig_rally1.txt" }
let(:rally_config) { load_api... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | spec/rally_api_general_spec.rb | Ruby | mit | 47 | master | 4,600 | require_relative "spec_helper"
describe "Rally API specific artifact tests" do
USE_TAGNAME = "zzTag1"
def find_tag(tagname)
tg_query = RallyAPI::RallyQuery.new()
tg_query.type = :tag
tg_query.query_string = "(Name = \"#{tagname}\")"
tg_query.limit = 20
tg_result = @rally.find(tg_query)
... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | spec/rally_query_spec.rb | Ruby | mit | 47 | master | 9,831 | require_relative "spec_helper"
describe "Rally Query Tests" do
#setup 3 defects and stories for the tests below
before :all do
@rally = RallyAPI::RallyRestJson.new(load_api_config)
@base_name = "rally_api Test - #{Time.now}"
story_fields = {:Name => "#{@base_name.to_s} - #{rand()}", :Description => ... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | examples/03-read-defect.rb | Ruby | mit | 47 | master | 1,184 | #! /usr/bin/env ruby
require 'rally_api'
require 'pp'
#Configuration for rally connection specified in 00-config.rb
require_relative '00-config'
def show_some_values(title, defect)
values = ["Name", "CreationDate", "FormattedID", "Priority"]
format = "%-12s : %s"
puts "-" * 80
puts title
values.each do |f... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | examples/08-add-attachment.rb | Ruby | mit | 47 | master | 3,248 | #! /usr/bin/env ruby
require 'pp'
require 'base64'
require 'rally_api'
#Configuration for rally connection specified in 00-config.rb
require_relative '00-config'
jpg_file_name = "earthjello.jpeg"
jpg_file_path = File::join(File.dirname(__FILE__),jpg_file_name)
def show_some_values(title, defect)
values = ["Nam... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | examples/04-create-defect.rb | Ruby | mit | 47 | master | 777 | #! /usr/bin/env ruby
require 'rally_api'
require 'pp'
#Configuration for rally connection specified in 00-config.rb
require_relative '00-config'
def show_some_values(title, defect)
values = ["Name", "CreationDate", "FormattedID", "Priority"]
format = "%-12s : %s"
puts "-" * 80
puts title
values.each do |f... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | examples/02-defect-query.rb | Ruby | mit | 47 | master | 1,556 | #! /usr/bin/env ruby
require 'rally_api'
require 'pp'
#Configuration for rally connection specified in 00-config.rb
require_relative '00-config'
def show_results(title,results)
puts "-" * 80
puts title
puts ""
results.each do |result|
printf("%-30s %s \n",result.CreationDate, result.Name)
end
puts "... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | examples/05-update-defect.rb | Ruby | mit | 47 | master | 1,059 | #! /usr/bin/env ruby
require 'rally_api'
require 'pp'
#Configuration for rally connection specified in 00-config.rb
require_relative '00-config'
def show_some_values(title, defect)
values = ["Name", "CreationDate", "FormattedID", "Priority","Description"]
format = "%-12s : %s"
puts "-" * 80
puts title
val... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | examples/07-add-discussion.rb | Ruby | mit | 47 | master | 1,730 | #! /usr/bin/env ruby
require 'rally_api'
require 'pp'
#Configuration for rally connection specified in 00-config.rb
require_relative '00-config'
def show_some_values(title, defect)
values = ["Name", "CreationDate", "FormattedID", "Priority"]
format = "%-12s : %s"
puts "-" * 80
puts title
values.each do |f... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | examples/01-connect-to-rally.rb | Ruby | mit | 47 | master | 409 | #! /usr/bin/env ruby
require 'rally_api'
require 'pp'
#Configuration for rally connection specified in 00-config.rb
require_relative '00-config'
begin
rally = RallyAPI::RallyRestJson.new(@config)
puts "rally_api version : #{RallyAPI::VERSION}"
puts "Rally Web Services API version: #{rally.wsapi_version}"
res... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | examples/10-user-query.rb | Ruby | mit | 47 | master | 1,036 | #! /usr/bin/env ruby
require 'rally_api'
require 'pp'
#Configuration for rally connection specified in 00-config.rb
require_relative '00-config'
def show_results(title,results)
puts "-" * 80
puts title
puts ""
format = "%-30s : %-30s : %-30s : %s\n"
printf(format,"User Name","Email Address","Display Name... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | examples/06-update-defect.rb | Ruby | mit | 47 | master | 1,106 | #! /usr/bin/env ruby
require 'rally_api'
require 'pp'
#Configuration for rally connection specified in 00-config.rb
require_relative '00-config'
def show_some_values(title, defect)
values = ["Name", "CreationDate", "FormattedID", "Priority","Description"]
format = "%-12s : %s"
puts "-" * 80
puts title
val... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | examples/09-get-attachment.rb | Ruby | mit | 47 | master | 2,984 | #! /usr/bin/env ruby
require 'pp'
require 'base64'
require 'rally_api'
#Configuration for rally connection specified in 00-config.rb
require_relative '00-config'
jpg_file_name = "earthjello.jpeg"
jpg_file_path = File::join(File.dirname(__FILE__),jpg_file_name)
def show_some_values(title, defect)
values = ["Nam... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | examples/11-story-hierarchy.rb | Ruby | mit | 47 | master | 2,664 | #! /usr/bin/env ruby
require 'rally_api'
require 'pp'
#Configuration for rally connection specified in 00-config.rb
require_relative '00-config'
class RallyRunner
def initialize(config)
@rally = RallyAPI::RallyRestJson.new(config)
@fields = {}
@fields["Priority"] = "High Attention"
end
def... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | lib/rally_api.rb | Ruby | mit | 47 | master | 555 | #Copyright (c) 2002-2015 Rally Software Development Corp. All Rights Reserved.
#Your use of this Software is governed by the terms and conditions
#of the applicable Subscription Agreement between your company and
#Rally Software Development Corp.
require "rally_api/custom_http_header"
require "rally_api/rally_json_con... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | lib/rally_api/rally_rest_json.rb | Ruby | mit | 47 | master | 20,527 | #require "custom_http_header"
#require "rally_json_connection"
#require "rally_object"
#require "rally_query"
#require "rally_query_result"
# --
#Copyright (c) 2002-2015 Rally Software Development Corp. All Rights Reserved.
#Your use of this Software is governed by the terms and conditions
#of the applicable Subscript... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | lib/rally_api/version.rb | Ruby | mit | 47 | master | 297 | # :nodoc:
#Copyright (c) 2002-2015 Rally Software Development Corp. All Rights Reserved.
#Your use of this Software is governed by the terms and conditions
#of the applicable Subscription Agreement between your company and
#Rally Software Development Corp.
module RallyAPI
VERSION = "1.2.1"
end |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | lib/rally_api/rally_json_connection.rb | Ruby | mit | 47 | master | 7,799 | require "httpclient"
require 'json'
# :stopdoc:
#Copyright (c) 2002-2015 Rally Software Development Corp. All Rights Reserved.
#Your use of this Software is governed by the terms and conditions
#of the applicable Subscription Agreement between your company and
#Rally Software Development Corp.
# :startdoc:
module Ral... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | lib/rally_api/rally_query.rb | Ruby | mit | 47 | master | 5,293 | # :stopdoc:
#Copyright (c) 2002-2015 Rally Software Development Corp. All Rights Reserved.
#Your use of this Software is governed by the terms and conditions
#of the applicable Subscription Agreement between your company and
#Rally Software Development Corp.
# :startdoc:
module RallyAPI
# ===RallyAPI::RallyQuery - A h... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | lib/rally_api/custom_http_header.rb | Ruby | mit | 47 | master | 1,512 | #Copyright (c) 2002-2015 Rally Software Development Corp. All Rights Reserved.
#Your use of this Software is governed by the terms and conditions
#of the applicable Subscription Agreement between your company and
#Rally Software Development Corp.
#custom headers help Rally identify the integration you have written
# ... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | lib/rally_api/rally_object.rb | Ruby | mit | 47 | master | 4,997 | # :stopdoc:
#Copyright (c) 2002-2015 Rally Software Development Corp. All Rights Reserved.
#Your use of this Software is governed by the terms and conditions
#of the applicable Subscription Agreement between your company and
#Rally Software Development Corp.
# :startdoc:
module RallyAPI
# RallyObject is a helper cl... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | lib/rally_api/lookback_api_query.rb | Ruby | mit | 47 | master | 2,433 | # :stopdoc:
#Copyright (c) 2002-2015 Rally Software Development Corp. All Rights Reserved.
#Your use of this Software is governed by the terms and conditions
#of the applicable Subscription Agreement between your company and
#Rally Software Development Corp.
# :startdoc:
module RallyAPI
# query is like:
# quer... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | lib/rally_api/rally_query_result.rb | Ruby | mit | 47 | master | 1,128 | # :stopdoc:
#Copyright (c) 2002-2015 Rally Software Development Corp. All Rights Reserved.
#Your use of this Software is governed by the terms and conditions
#of the applicable Subscription Agreement between your company and
#Rally Software Development Corp.
# :startdoc:
module RallyAPI
class RallyQueryResult
inc... |
github | RallyTools/RallyRestToolkitForRuby | https://github.com/RallyTools/RallyRestToolkitForRuby | lib/rally_api/rally_collection.rb | Ruby | mit | 47 | master | 1,362 | # :stopdoc:
#Copyright (c) 2002-2015 Rally Software Development Corp. All Rights Reserved.
#Your use of this Software is governed by the terms and conditions
#of the applicable Subscription Agreement between your company and
#Rally Software Development Corp.
# :startdoc:
module RallyAPI
class RallyCollection
in... |
github | osheroff/git-spelunk | https://github.com/osheroff/git-spelunk | git_spelunk.gemspec | Ruby | mit | 47 | master | 850 | $LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
require "git_spelunk/version"
Gem::Specification.new do |s|
s.name = "git_spelunk"
s.version = GitSpelunk::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ["Ben Osheroff", "Saroj Yadav"]
s.email = ["ben@zendesk.com", "saroj@... |
github | osheroff/git-spelunk | https://github.com/osheroff/git-spelunk | test/integration_test.rb | Ruby | mit | 47 | master | 581 | require_relative "test_helper"
describe "CLI" do
def sh(cmd, options={})
result = `#{cmd} 2>&1`
raise "FAILED #{cmd} --> #{result}" if $?.success? != !options[:fail]
result
end
def spelunk(command, options={})
sh "#{File.expand_path("../../bin/git-spelunk", __FILE__)} #{command}", options
end
... |
github | osheroff/git-spelunk | https://github.com/osheroff/git-spelunk | lib/git_spelunk/ui.rb | Ruby | mit | 47 | master | 5,347 | require 'git_spelunk/ui/pager'
require 'git_spelunk/ui/repo'
require 'git_spelunk/ui/status'
module GitSpelunk
class UI
def initialize(file_context)
Dispel::Screen.open(:colors => true) do |screen|
@file_context = file_context
@history = [file_context]
@pager = PagerWindow.new(0)
... |
github | osheroff/git-spelunk | https://github.com/osheroff/git-spelunk | lib/git_spelunk/blame.rb | Ruby | mit | 47 | master | 1,512 | require 'open3'
module GitSpelunk
BlameLine = Struct.new(:line_number, :old_line_number, :sha, :commit, :filename, :content)
class EmptyBlame < StandardError ; end
class Blame
def initialize(repo, file, sha)
@lines = nil
@repo = repo
@file = file
@sha = sha
end
def lines
... |
github | osheroff/git-spelunk | https://github.com/osheroff/git-spelunk | lib/git_spelunk/file_context.rb | Ruby | mit | 47 | master | 1,503 | require 'rugged'
require 'fileutils'
require 'git_spelunk/blame'
module GitSpelunk
class FileContext
attr_accessor :line_number
attr_reader :repo, :sha, :file
def initialize(file, options = {})
@sha = options[:sha] || 'HEAD'
@line_number = options[:line_number] || 1
@repo = options.fe... |
github | osheroff/git-spelunk | https://github.com/osheroff/git-spelunk | lib/git_spelunk/offset.rb | Ruby | mit | 47 | master | 4,536 | # Given a sha and a line_number in this sha, this module calculates the corresponding line number in sha's parent.
# 1. It uses git diff for the sha & its parent to get all the diff chunks.
# 2. It then calculates which chunk given line_number belongs to.
# 3. Once found the target chunk, it then goes to the sha's line... |
github | osheroff/git-spelunk | https://github.com/osheroff/git-spelunk | lib/git_spelunk/ui/repo.rb | Ruby | mit | 47 | master | 709 | module GitSpelunk
class UI
class RepoWindow
attr_accessor :content, :command_mode, :command_buffer, :height
def initialize(height)
@height = height
self.content = ""
end
def draw
styles = Dispel::StyleMap.new(@height)
styles.add(:reverse, 0, 0..999)
... |
github | osheroff/git-spelunk | https://github.com/osheroff/git-spelunk | lib/git_spelunk/ui/pager.rb | Ruby | mit | 47 | master | 3,802 | ACTIVE_SHA_COLOR=1
module GitSpelunk
class UI
class PagerWindow
ACTIVE_SHA_COLOR = ["#00ff00", "#000000"]
FOUND_COLOR = :reverse
CURRENT_COLOR = ["#000000", "#00ff00"]
def initialize(height)
@height = height
@cursor = 1
@top = 1
@highlight_sha = true
... |
github | osheroff/git-spelunk | https://github.com/osheroff/git-spelunk | lib/git_spelunk/ui/status.rb | Ruby | mit | 47 | master | 786 | module GitSpelunk
class UI
class StatusWindow
def initialize
@command_buffer = ""
@status_message = ""
@onetime_message = nil
end
attr_accessor :command_buffer, :status_message
def clear_onetime_message!
@onetime_message = nil
end
def set_onet... |
github | southbridgeio/redmine_recurring_tasks | https://github.com/southbridgeio/redmine_recurring_tasks | init.rb | Ruby | mit | 47 | master | 1,508 | require File.dirname(__FILE__) + '/lib/redmine_recurring_tasks'
register_after_redmine_initialize_proc =
if Redmine::VERSION::MAJOR >= 5
Rails.application.config.public_method(:after_initialize)
else
reloader = defined?(ActiveSupport::Reloader) ? ActiveSupport::Reloader : ActionDispatch::Reloader
reloa... |
github | southbridgeio/redmine_recurring_tasks | https://github.com/southbridgeio/redmine_recurring_tasks | config/schedule.rb | Ruby | mit | 47 | master | 549 | # Use this file to easily define all of your cron jobs.
#
# It's helpful, but not entirely necessary to understand cron before proceeding.
# http://en.wikipedia.org/wiki/Cron
# Example:
#
# set :output, "/path/to/my/cron_log.log"
#
# every 2.hours do
# command "/usr/bin/some_great_command"
# runner "MyModel.some_m... |
github | southbridgeio/redmine_recurring_tasks | https://github.com/southbridgeio/redmine_recurring_tasks | test/unit/recurring_task_test.rb | Ruby | mit | 47 | master | 6,602 | require File.expand_path('../../test_helper', __FILE__)
class RecurringTaskTest < ActiveSupport::TestCase
fixtures :projects, :users, :email_addresses, :user_preferences, :members, :member_roles, :roles,
:groups_users,
:trackers, :projects_trackers,
:enabled_modules,
:vers... |
github | southbridgeio/redmine_recurring_tasks | https://github.com/southbridgeio/redmine_recurring_tasks | test/unit/lib/issue_checker_test.rb | Ruby | mit | 47 | master | 408 | require File.expand_path('../../../test_helper', __FILE__)
class RecurringTaskTest < ActiveSupport::TestCase
def test_full_days
recurring_task = RecurringTask.new
assert recurring_task.days, RecurringTask::DAYS
end
def test_partial_days
recurring_task = RecurringTask.new
recurring_task.monday = ... |
github | southbridgeio/redmine_recurring_tasks | https://github.com/southbridgeio/redmine_recurring_tasks | test/unit/lib/redmine_recurring_tasks/issue_checker_test.rb | Ruby | mit | 47 | master | 1,815 | require File.expand_path('../../../../test_helper', __FILE__)
module RedmineRecurringTasks
class IssueCheckerTest < ActiveSupport::TestCase
fixtures :projects, :users, :email_addresses, :user_preferences, :members, :member_roles, :roles,
:groups_users,
:trackers, :projects_trackers,
... |
github | southbridgeio/redmine_recurring_tasks | https://github.com/southbridgeio/redmine_recurring_tasks | test/functional/recurring_tasks_controller_test.rb | Ruby | mit | 47 | master | 1,258 | require File.expand_path('../../test_helper', __FILE__)
class RecurringTasksControllerTest < ActionController::TestCase
fixtures :projects,
:users,
:roles,
:members,
:member_roles,
:trackers,
:projects_trackers,
:issue_statuses,
... |
github | southbridgeio/redmine_recurring_tasks | https://github.com/southbridgeio/redmine_recurring_tasks | db/migrate/001_create_weekly_schedules.rb | Ruby | mit | 47 | master | 834 | class CreateWeeklySchedules < Rails.version < '5.0' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
def change
create_table :weekly_schedules do |t|
t.integer :issue_id, null: false, index: true
t.integer :tracker_id, null: false, index: true
t.boolean :sunday, default: false, ... |
github | southbridgeio/redmine_recurring_tasks | https://github.com/southbridgeio/redmine_recurring_tasks | db/migrate/003_add_new_intervals_tasks.rb | Ruby | mit | 47 | master | 305 | class AddNewIntervalsTasks < Rails.version < '5.0' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
def change
change_table :recurring_tasks do |t|
t.string :months, default: (1..12).to_a.map(&:to_s).to_json, null: false
t.string :month_days, default: '[]'
end
end
end |
github | southbridgeio/redmine_recurring_tasks | https://github.com/southbridgeio/redmine_recurring_tasks | lib/redmine_recurring_tasks.rb | Ruby | mit | 47 | master | 575 | module RedmineRecurringTasks
def self.issue_associations
# it's a associations which should be preserved anyway
default_associations = ['parent', 'project', 'tracker', 'status', 'author', 'assigned_to', 'fixed_version',
'priority', 'category', 'journals', 'visible_journals', 'time_e... |
github | southbridgeio/redmine_recurring_tasks | https://github.com/southbridgeio/redmine_recurring_tasks | lib/tasks/process.rake | Ruby | mit | 47 | master | 214 | namespace :redmine_recurring_tasks do
desc 'Run issues check'
task exec: :environment do
checker = RedmineRecurringTasks::IssueChecker.new(Setting.plugin_redmine_recurring_tasks)
checker.call
end
end |
github | southbridgeio/redmine_recurring_tasks | https://github.com/southbridgeio/redmine_recurring_tasks | lib/redmine_recurring_tasks/issue_checker.rb | Ruby | mit | 47 | master | 1,005 | module RedmineRecurringTasks
# Class for check which tasks should be copied
class IssueChecker
attr_accessor :settings
# @param [Hash] redmine plugin settings
def initialize(settings = nil)
@settings = settings
end
# @return [void]
def call
schedules.each do |schedule|
... |
github | southbridgeio/redmine_recurring_tasks | https://github.com/southbridgeio/redmine_recurring_tasks | lib/redmine_recurring_tasks/issue_presenter.rb | Ruby | mit | 47 | master | 1,286 | module RedmineRecurringTasks
class IssuePresenter < SimpleDelegator
include RecurringTasksHelper
include Rails.application.routes.url_helpers
def schedule
return '' if recurring_task.blank?
if recurring_task_root.run_type == RecurringTask::RUN_TYPE_M_DAYS
return "#{recurring_task_roo... |
github | southbridgeio/redmine_recurring_tasks | https://github.com/southbridgeio/redmine_recurring_tasks | lib/redmine_recurring_tasks/patches/issue_patch.rb | Ruby | mit | 47 | master | 1,019 | module RedmineRecurringTasks
module Patches
# Patch to make link to RecurringTask
module IssuePatch
def self.included(base) # :nodoc:
base.class_eval do
has_one :recurring_task, dependent: :destroy
# Return parent issue of children
def recurring_task_ro... |
github | southbridgeio/redmine_recurring_tasks | https://github.com/southbridgeio/redmine_recurring_tasks | lib/redmine_recurring_tasks/hooks/issue_view_hook.rb | Ruby | mit | 47 | master | 275 | module RedmineRecurringTasks
module Hooks
# Issue sidebar hook for show weekly schedule on issue page
class IssueViewHook < Redmine::Hook::ViewListener
render_on :view_issues_show_description_bottom, partial: 'recurring_tasks/issues/bottom'
end
end
end |
github | southbridgeio/redmine_recurring_tasks | https://github.com/southbridgeio/redmine_recurring_tasks | app/controllers/recurring_tasks_controller.rb | Ruby | mit | 47 | master | 1,706 | class RecurringTasksController < ApplicationController
before_action :set_schedule, only: [:edit, :destroy, :update]
before_action :set_issue
before_action :check_permission
def new
existing_schedule = RecurringTask.find_by(issue: @issue)
if existing_schedule
return redirect_to edit_recurring_tas... |
github | southbridgeio/redmine_recurring_tasks | https://github.com/southbridgeio/redmine_recurring_tasks | app/models/recurring_task.rb | Ruby | mit | 47 | master | 5,493 | class RecurringTask < ActiveRecord::Base
UnauthorizedError = Class.new(StandardError)
belongs_to :issue
belongs_to :tracker
validates :issue_id, presence: true, uniqueness: true
validates :tracker_id, presence: true
validates :time, presence: true
DAYS = %w(monday tuesday wednesday thursday friday... |
github | dry-rb/dry-operation | https://github.com/dry-rb/dry-operation | dry-operation.gemspec | Ruby | mit | 47 | main | 1,605 | # frozen_string_literal: true
# This file is synced from hanakai-rb/repo-sync. To update it, edit repo-sync.yml.
lib = File.expand_path("lib", __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "dry/operation/version"
Gem::Specification.new do |spec|
spec.name = "dry-operation"
spe... |
github | dry-rb/dry-operation | https://github.com/dry-rb/dry-operation | Rakefile | Ruby | mit | 47 | main | 419 | # frozen_string_literal: true
require "bundler/setup"
require "bundler/gem_tasks"
require "rspec/core/rake_task"
require "rubocop/rake_task"
require "yard"
RSpec::Core::RakeTask.new { |task| task.verbose = false }
RuboCop::RakeTask.new
YARD::Rake::YardocTask.new do |task|
task.options = %w[--fail-on-warning --no-ou... |
github | dry-rb/dry-operation | https://github.com/dry-rb/dry-operation | Guardfile | Ruby | mit | 47 | main | 245 | # frozen_string_literal: true
guard :rspec, cmd: "NO_COVERAGE=true bin/rspec --format documentation" do
watch %r{^spec/.+_spec\.rb$}
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch("spec/spec_helper.rb") { "spec" }
end |
github | dry-rb/dry-operation | https://github.com/dry-rb/dry-operation | Gemfile | Ruby | mit | 47 | main | 762 | # frozen_string_literal: true
source "https://rubygems.org"
eval_gemfile "Gemfile.devtools"
gemspec
group :tools do
gem "debug", platform: :mri
end
group :docs do
gem "redcarpet", platform: :mri
gem "yard"
gem "yard-junk"
end
group :test do
gem "guard-rspec"
end
group :development, :test do
gem "acti... |
github | dry-rb/dry-operation | https://github.com/dry-rb/dry-operation | spec/spec_helper.rb | Ruby | mit | 47 | main | 947 | # frozen_string_literal: true
require_relative "support/coverage"
require_relative "support/warnings"
Bundler.require :tools
require "dry/operation"
require "dry/operation/extensions/active_record"
require "dry/operation/extensions/validation"
require "dry/operation/extensions/rom"
require "dry/operation/extensions/... |
github | dry-rb/dry-operation | https://github.com/dry-rb/dry-operation | spec/integration/operations_spec.rb | Ruby | mit | 47 | main | 9,311 | # frozen_string_literal: true
require "spec_helper"
RSpec.describe "Operations" do
include Dry::Monads[:result]
it "chains successful operations and returns wrapping in a Success" do
klass = Class.new(Dry::Operation) do
def add_one_then_two(x)
steps do
y = step add_one(x)
st... |
github | dry-rb/dry-operation | https://github.com/dry-rb/dry-operation | spec/integration/extensions/sequel_spec.rb | Ruby | mit | 47 | main | 2,767 | # frozen_string_literal: true
require "spec_helper"
RSpec.describe Dry::Operation::Extensions::Sequel do
include Dry::Monads[:result]
let(:db) do
if RUBY_ENGINE == "jruby"
Sequel.connect("jdbc:sqlite::memory:")
else
Sequel.sqlite
end
end
before do
db.create_table(:users) do
... |
github | dry-rb/dry-operation | https://github.com/dry-rb/dry-operation | spec/integration/extensions/active_record_spec.rb | Ruby | mit | 47 | main | 3,463 | # frozen_string_literal: true
require "spec_helper"
RSpec.describe Dry::Operation::Extensions::ActiveRecord do
include Dry::Monads[:result]
before :all do
ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:")
ActiveRecord::Schema.define do
ActiveRecord::Migration.suppres... |
github | dry-rb/dry-operation | https://github.com/dry-rb/dry-operation | spec/integration/extensions/validation_spec.rb | Ruby | mit | 47 | main | 12,509 | # frozen_string_literal: true
require "spec_helper"
RSpec.describe Dry::Operation::Extensions::Validation do
include Dry::Monads[:result]
describe "validating operation inputs" do
it "validates params and allows operation to proceed on success" do
create_user = Class.new(Dry::Operation) do
incl... |
github | dry-rb/dry-operation | https://github.com/dry-rb/dry-operation | spec/integration/extensions/rom_spec.rb | Ruby | mit | 47 | main | 2,713 | # frozen_string_literal: true
require "spec_helper"
RSpec.describe Dry::Operation::Extensions::ROM do
include Dry::Monads[:result]
let(:rom) do
database_url =
if RUBY_ENGINE == "jruby"
"jdbc:sqlite::memory:"
else
"sqlite:file::memory:?cache=private"
end
ROM.container(:s... |
github | dry-rb/dry-operation | https://github.com/dry-rb/dry-operation | spec/unit/operation_spec.rb | Ruby | mit | 47 | main | 3,391 | # frozen_string_literal: true
require "spec_helper"
RSpec.describe Dry::Operation do
include Dry::Monads[:result]
describe "#steps" do
it "wraps block's return value in a Success" do
klass = Class.new(described_class) do
def foo(value)
steps { value }
end
end
resu... |
github | dry-rb/dry-operation | https://github.com/dry-rb/dry-operation | spec/unit/extensions/validation_spec.rb | Ruby | mit | 47 | main | 3,431 | # frozen_string_literal: true
require "spec_helper"
RSpec.describe Dry::Operation::Extensions::Validation do
include Dry::Monads[:result]
describe ".contract" do
it "accepts a pre-built Contract class" do
contract_class = Class.new(Dry::Validation::Contract) do
params do
required(:nam... |
github | dry-rb/dry-operation | https://github.com/dry-rb/dry-operation | spec/unit/extensions/sequel_spec.rb | Ruby | mit | 47 | main | 1,362 | # frozen_string_literal: true
require "spec_helper"
RSpec.describe Dry::Operation::Extensions::Sequel do
describe "#transaction" do
it "raises a meaningful error when #db method is not implemented" do
instance = Class.new(Dry::Operation).include(Dry::Operation::Extensions::Sequel).new
expect { inst... |
github | dry-rb/dry-operation | https://github.com/dry-rb/dry-operation | spec/unit/extensions/rom_spec.rb | Ruby | mit | 47 | main | 2,317 | # frozen_string_literal: true
require "spec_helper"
RSpec.describe Dry::Operation::Extensions::ROM do
describe "#transaction" do
it "raises a meaningful error when #rom method is not implemented" do
instance = Class.new.include(Dry::Operation::Extensions::ROM).new
expect { instance.transaction {} }... |
github | dry-rb/dry-operation | https://github.com/dry-rb/dry-operation | spec/unit/extensions/active_record_spec.rb | Ruby | mit | 47 | main | 1,069 | # frozen_string_literal: true
require "spec_helper"
RSpec.describe Dry::Operation::Extensions::ActiveRecord do
describe "#transaction" do
it "forwards options to ActiveRecord transaction call" do
instance = Class.new(Dry::Operation).include(Dry::Operation::Extensions::ActiveRecord).new
expect(Activ... |
github | dry-rb/dry-operation | https://github.com/dry-rb/dry-operation | lib/dry/operation.rb | Ruby | mit | 47 | main | 6,267 | # frozen_string_literal: true
require "zeitwerk"
require "dry/monads"
require "dry/operation/errors"
module Dry
# DSL for chaining operations that can fail
#
# {Dry::Operation} is a thin DSL wrapping dry-monads that allows you to chain
# operations by focusing on the happy path and short-circuiting on failure... |
github | dry-rb/dry-operation | https://github.com/dry-rb/dry-operation | lib/dry/operation/class_context.rb | Ruby | mit | 47 | main | 2,146 | # frozen_string_literal: true
module Dry
class Operation
# {Dry::Operation} class context
module ClassContext
# Default methods to be prepended unless changed via {.operate_on}
DEFAULT_METHODS_TO_PREPEND = [:call].freeze
# Configures the instance methods to be prepended
#
# The... |
github | dry-rb/dry-operation | https://github.com/dry-rb/dry-operation | lib/dry/operation/errors.rb | Ruby | mit | 47 | main | 1,850 | # frozen_string_literal: true
module Dry
class Operation
class Error < ::StandardError; end
# Methods to prepend have already been defined
class MethodsToPrependAlreadyDefinedError < Error
def initialize(methods:)
super <<~MSG
'.operate_on' must be called before the given methods... |
github | dry-rb/dry-operation | https://github.com/dry-rb/dry-operation | lib/dry/operation/extensions/active_record.rb | Ruby | mit | 47 | main | 4,601 | # frozen_string_literal: true
begin
require "active_record"
rescue LoadError
raise Dry::Operation::MissingDependencyError.new(gem: "activerecord", extension: "ActiveRecord")
end
module Dry
class Operation
module Extensions
# Add ActiveRecord transaction support to operations
#
# When this ... |
github | dry-rb/dry-operation | https://github.com/dry-rb/dry-operation | lib/dry/operation/extensions/rom.rb | Ruby | mit | 47 | main | 4,135 | # frozen_string_literal: true
begin
require "rom-sql"
rescue LoadError
raise Dry::Operation::MissingDependencyError.new(gem: "rom-sql", extension: "ROM")
end
module Dry
class Operation
module Extensions
# Add Rom transaction support to operations.
#
# When this extension is included, you c... |
github | dry-rb/dry-operation | https://github.com/dry-rb/dry-operation | lib/dry/operation/extensions/validation.rb | Ruby | mit | 47 | main | 7,287 | # frozen_string_literal: true
begin
require "dry/validation"
rescue LoadError
raise Dry::Operation::MissingDependencyError.new(gem: "dry-validation", extension: "Validation")
end
module Dry
class Operation
module Extensions
# Adds validation support to operations using Dry Validation.
#
# ... |
github | dry-rb/dry-operation | https://github.com/dry-rb/dry-operation | lib/dry/operation/extensions/sequel.rb | Ruby | mit | 47 | main | 3,228 | # frozen_string_literal: true
begin
require "sequel"
rescue LoadError
raise Dry::Operation::MissingDependencyError.new(gem: "sequel", extension: "Sequel")
end
module Dry
class Operation
module Extensions
# Add Sequel transaction support to operations
#
# When this extension is included, yo... |
github | dry-rb/dry-operation | https://github.com/dry-rb/dry-operation | lib/dry/operation/class_context/steps_method_prepender.rb | Ruby | mit | 47 | main | 1,531 | # frozen_string_literal: true
require "dry/operation/errors"
module Dry
class Operation
module ClassContext
# @api private
class StepsMethodPrepender < Module
FAILURE_HOOK_METHOD_NAME = :on_failure
RESULT_HANDLER = lambda do |instance, method, result|
return if result.succ... |
github | dry-rb/dry-operation | https://github.com/dry-rb/dry-operation | lib/dry/operation/class_context/prepend_manager.rb | Ruby | mit | 47 | main | 1,523 | # frozen_string_literal: true
require "dry/operation/errors"
module Dry
class Operation
module ClassContext
# @api private
class PrependManager
def initialize(klass:, methods_to_prepend:, prepended_methods: [])
@klass = klass
@methods_to_prepend = methods_to_prepend
... |
github | icalendar/icalendar-recurrence | https://github.com/icalendar/icalendar-recurrence | icalendar-recurrence.gemspec | Ruby | mit | 47 | main | 1,294 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'icalendar/recurrence/version'
Gem::Specification.new do |spec|
spec.name = "icalendar-recurrence"
spec.version = Icalendar::Recurrence::VERSION
spec.authors = ["Jordan ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.