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
tyne/tyne
https://github.com/tyne/tyne
spec/features/projects_spec.rb
Ruby
mit
48
master
500
require 'spec_helper' describe :projects do include_context 'authenticated' it "should create a new project" do login create_project('Foo') create_issue('Bar') page.should have_content 'Bar' logout end describe :private do before do login create_project('Foo', :private ...
github
tyne/tyne
https://github.com/tyne/tyne
spec/features/issues_spec.rb
Ruby
mit
48
master
590
require 'spec_helper' describe :issues do include_context 'authenticated' before:each do login create_project('Foo') create_issue('Bar') end after :each do logout end subject { page } it { should have_content 'Bar' } context 'when updating an issue' do let(:new_description) { ...
github
tyne/tyne
https://github.com/tyne/tyne
db/schema.rb
Ruby
mit
48
master
7,448
# encoding: UTF-8 # This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # Note that this schema.rb definition is the authoritative sou...
github
tyne/tyne
https://github.com/tyne/tyne
db/seeds.rb
Ruby
mit
48
master
286
IssueType.delete_all %w(Bug Enhancement Story Feature Task).each do |issue_type| IssueType.create!(:name => issue_type) end IssuePriority.delete_all %w(Low Medium High).each_with_index do |issue_priority, index| IssuePriority.create!(:name => issue_priority, :number => index) end
github
tyne/tyne
https://github.com/tyne/tyne
db/migrate/20121109223619_create_issues.rb
Ruby
mit
48
master
312
class CreateIssues < ActiveRecord::Migration def change create_table :issues do |t| t.string :summary t.text :description t.integer :reported_by_id t.integer :project_id t.timestamps end add_index :issues, :reported_by_id add_index :issues, :project_id end end
github
tyne/tyne
https://github.com/tyne/tyne
db/migrate/20121211190305_create_organization_memberships.rb
Ruby
mit
48
master
452
class CreateOrganizationMemberships < ActiveRecord::Migration def change create_table :organization_memberships do |t| t.references :organization t.references :user t.timestamps end add_index :organization_memberships, :organization_id add_index :organization_memberships, :user_id ...
github
tyne/tyne
https://github.com/tyne/tyne
db/migrate/20121126221415_create_issue_priorities.rb
Ruby
mit
48
master
234
class CreateIssuePriorities < ActiveRecord::Migration def change create_table :issue_priorities do |t| t.string :name t.integer :number t.timestamps end add_index :issue_priorities, :number end end
github
tyne/tyne
https://github.com/tyne/tyne
db/migrate/20121208213957_create_votes.rb
Ruby
mit
48
master
315
class CreateVotes < ActiveRecord::Migration def change create_table :votes do |t| t.references :user t.string :votable_type t.integer :votable_id t.integer :weight t.timestamps end add_index :votes, :user_id add_index :votes, [:votable_type, :votable_id] end end
github
tyne/tyne
https://github.com/tyne/tyne
db/migrate/20130118181423_install_audited.rb
Ruby
mit
48
master
943
class InstallAudited < ActiveRecord::Migration def self.up create_table :audits, :force => true do |t| t.column :auditable_id, :integer t.column :auditable_type, :string t.column :associated_id, :integer t.column :associated_type, :string t.column :user_id, :integer t.column :u...
github
tyne/tyne
https://github.com/tyne/tyne
db/migrate/20121209170602_create_team_members.rb
Ruby
mit
48
master
246
class CreateTeamMembers < ActiveRecord::Migration def change create_table :team_members do |t| t.integer :user_id t.integer :team_id end add_index :team_members, :user_id add_index :team_members, :team_id end end
github
tyne/tyne
https://github.com/tyne/tyne
db/migrate/20121209170601_create_teams.rb
Ruby
mit
48
master
224
class CreateTeams < ActiveRecord::Migration def change create_table :teams do |t| t.string :name t.integer :project_id t.boolean :admin_privileges end add_index :teams, :project_id end end
github
tyne/tyne
https://github.com/tyne/tyne
db/migrate/20121123184753_create_comments.rb
Ruby
mit
48
master
241
class CreateComments < ActiveRecord::Migration def change create_table :comments do |t| t.text :message t.integer :issue_id t.integer :user_id t.timestamps end add_index :comments, :issue_id end end
github
tyne/tyne
https://github.com/tyne/tyne
db/migrate/20130123231729_add_position_to_issues.rb
Ruby
mit
48
master
353
class AddPositionToIssues < ActiveRecord::Migration def change add_column :issues, :position, :integer add_column :issues, :sprint_position, :integer Project.all.each do |project| project.issues.order("created_at").all.each_with_index do |issue, index| issue.position = index issue.s...
github
tyne/tyne
https://github.com/tyne/tyne
db/migrate/20121001195812_create_users.rb
Ruby
mit
48
master
236
class CreateUsers < ActiveRecord::Migration def change create_table :users do |t| t.string :uid t.string :name t.string :username t.string :email t.string :token t.timestamps end end end
github
tyne/tyne
https://github.com/tyne/tyne
db/migrate/20130121213202_create_sprints.rb
Ruby
mit
48
master
227
class CreateSprints < ActiveRecord::Migration def change create_table :sprints do |t| t.string :name t.date :start_date t.date :end_date t.integer :project_id t.timestamps end end end
github
tyne/tyne
https://github.com/tyne/tyne
db/migrate/20121001195811_create_projects.rb
Ruby
mit
48
master
229
class CreateProjects < ActiveRecord::Migration def change create_table :projects do |t| t.string :name t.string :key t.text :description t.timestamps end add_index :projects, :key end end
github
tyne/tyne
https://github.com/tyne/tyne
db/migrate/20130413101651_create_labels.rb
Ruby
mit
48
master
276
class CreateLabels < ActiveRecord::Migration def change create_table :labels do |t| t.string :name t.integer :project_id t.timestamps end create_table :issue_labels do |t| t.integer :issue_id t.integer :label_id end end end
github
tyne/tyne
https://github.com/tyne/tyne
db/migrate/20121109212601_create_dashboards.rb
Ruby
mit
48
master
218
class CreateDashboards < ActiveRecord::Migration def change create_table :dashboards do |t| t.string :name t.integer :user_id t.timestamps end add_index :dashboards, :user_id end end
github
tyne/tyne
https://github.com/tyne/tyne
db/migrate/20130224130203_create_sprint_activities.rb
Ruby
mit
48
master
353
class CreateSprintActivities < ActiveRecord::Migration def change create_table :sprint_activities do |t| t.integer :sprint_id t.integer :issue_id t.string :type_of_change t.decimal :scope_change t.timestamps end add_index :sprint_activities, :sprint_id add_index :sprint...
github
tyne/tyne
https://github.com/tyne/tyne
config/deploy.rb
Ruby
mit
48
master
1,607
require "rvm/capistrano" require "bundler/capistrano" require 'sidekiq/capistrano' default_run_options[:pty] = true ssh_options[:forward_agent] = true set :application, "tyne" set :repository, "git@github.com:tyne/tyne.git" set :scm, :git role :web, "tyne-tickets.org" role :app, "tyne-tickets.org" role :db, "tyne...
github
tyne/tyne
https://github.com/tyne/tyne
config/application.rb
Ruby
mit
48
master
2,950
require File.expand_path('../boot', __FILE__) require 'rails/all' 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 # Bundler.requi...
github
tyne/tyne
https://github.com/tyne/tyne
config/routes.rb
Ruby
mit
48
master
1,832
Tyne::Application.routes.draw do mount Jasminerice::Engine => "/jasmine" if defined?(Jasminerice) get '/login', :action => "new", :as => :login, :controller => "sessions" get "/auth/:provider/callback", :action => "create", :as => :auth, :controller => "sessions" get "/auth/failure", :action => "failure", :as ...
github
tyne/tyne
https://github.com/tyne/tyne
config/environment.rb
Ruby
mit
48
master
265
# Load the rails application require File.expand_path('../application', __FILE__) config_hash = YAML.load_file("#{Rails.root}/config/tyne.yml")[Rails.env] APP_CONFIG = Hashie::Mash.new(config_hash) # Initialize the rails application Tyne::Application.initialize!
github
tyne/tyne
https://github.com/tyne/tyne
config/initializers/secret_token.rb
Ruby
mit
48
master
495
# 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
tyne/tyne
https://github.com/tyne/tyne
config/initializers/client_side_validations.rb
Ruby
mit
48
master
636
# ClientSideValidations Initializer # Uncomment to disable uniqueness validator, possible security issue # ClientSideValidations::Config.disabled_validators = [:uniqueness] # Uncomment the following block if you want each input field to have the validation messages attached. # ActionView::Base.field_error_proc = Proc...
github
tyne/tyne
https://github.com/tyne/tyne
config/initializers/session_store.rb
Ruby
mit
48
master
409
# Be sure to restart your server when you modify this file. Tyne::Application.config.session_store :cookie_store, key: '_tyne_host_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 ge...
github
tyne/tyne
https://github.com/tyne/tyne
config/initializers/omniauth.rb
Ruby
mit
48
master
260
Rails.application.config.middleware.use(OmniAuth::Builder) do begin provider :github, APP_CONFIG.omniauth.github.client_id, APP_CONFIG.omniauth.github.client_secret rescue raise "Please add your github API credentials to config/tyne.yml" end end
github
tyne/tyne
https://github.com/tyne/tyne
config/initializers/simple_form_bootstrap.rb
Ruby
mit
48
master
1,795
# Use this setup block to configure all options available in SimpleForm. SimpleForm.setup do |config| config.wrappers :bootstrap, :tag => 'div', :class => 'control-group', :error_class => 'error' do |b| b.use :html5 b.use :placeholder b.use :label b.wrapper :tag => 'div', :class => 'controls' do |ba| ...
github
tyne/tyne
https://github.com/tyne/tyne
config/environments/development.rb
Ruby
mit
48
master
1,467
Tyne::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 serve...
github
tyne/tyne
https://github.com/tyne/tyne
config/environments/test.rb
Ruby
mit
48
master
1,603
Tyne::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 suite...
github
tyne/tyne
https://github.com/tyne/tyne
config/environments/production.rb
Ruby
mit
48
master
3,610
Tyne::Application.configure do # Settings specified here will take precedence over those in config/application.rb config.middleware.use ExceptionNotifier, { :email_prefix => "[ERROR] ", :sender_address => "notifications@tyne-tickets.org", :exception_recipients => "exceptions@tyne-tickets.org" } con...
github
tyne/tyne
https://github.com/tyne/tyne
app/cells/issue_cell.rb
Ruby
mit
48
master
259
# Represents a create button for issues class IssueCell < Cell::Rails # Renders a new create button for issue creation # # @param [String] dialog_path PJAX path to the dialog def create(dialog_path) @dialog_path = dialog_path render end end
github
tyne/tyne
https://github.com/tyne/tyne
app/cells/pod_cell.rb
Ruby
mit
48
master
459
# Represents a pod element class PodCell < Cell::Rails attr_accessor :content # Renders a collapsable pod def collapsable(title, options={}) @title = title @features = [:collapsable] @state = options[:state] || :expanded; @content_style = if @state == :expanded "display: bl...
github
tyne/tyne
https://github.com/tyne/tyne
app/cells/backlog_sidebar_cell.rb
Ruby
mit
48
master
1,638
# Cell for backlog sidebar class BacklogSidebarCell < Cell::Rails helper FilterHelper # Displays a pod with predefined search options def search(default_filter = false) @klass = default_filter ? "selected" : "" @predefined = {} @predefined[:open] = { :state => [:open, :reopened] } @predefined[:my...
github
tyne/tyne
https://github.com/tyne/tyne
app/cells/votes_cell.rb
Ruby
mit
48
master
283
# Represents the Votes feature class VotesCell < Cell::Rails # Shows the Votes cell def show(votable, *args) @votable = votable @total_votes = votable.total_votes @upvote_path = args[0][:upvote_path] @downvote_path = args[0][:downvote_path] render end end
github
tyne/tyne
https://github.com/tyne/tyne
app/cells/notification_cell.rb
Ruby
mit
48
master
237
# The NotificationCell class represents the notification bar that is used # to display success, error and otherwise classified messages class NotificationCell < Cell::Rails # Shows the notification cell def show render end end
github
tyne/tyne
https://github.com/tyne/tyne
app/cells/pagination_cell.rb
Ruby
mit
48
master
415
# Displays some elements to pagiate your records class PaginationCell < Cell::Rails # Renders the main pagination view def show(*args) options = args.extract_options! @collection = options[:collection] @current_page = options[:current_page] @page_count = options[:page_count] @total = options[:to...
github
tyne/tyne
https://github.com/tyne/tyne
app/models/sprint_activity.rb
Ruby
mit
48
master
638
# Represents an event that effects the sprint or its remaining # estimates. class SprintActivity < ActiveRecord::Base # Array of all valid scope changes VALID_ESTIMATES = Issue::VALID_ESTIMATES + Issue::VALID_ESTIMATES.map {|x| x * -1} attr_accessible :issue_id, :sprint_id, :type_of_change, :scope_change belo...
github
tyne/tyne
https://github.com/tyne/tyne
app/models/issue.rb
Ruby
mit
48
master
4,285
# Represents an issue that affects a particular project. # Issues can be part of a sprint and they have an issue type. class Issue < ActiveRecord::Base include Extensions::Issues::Workflow include Extensions::Votable # Array of all valid estimation options. VALID_ESTIMATES = [0, 0.5, 1, 2, 3, 5, 8, 13, 20, 40,...
github
tyne/tyne
https://github.com/tyne/tyne
app/models/project.rb
Ruby
mit
48
master
1,809
# Represents a project. class Project < ActiveRecord::Base has_associated_audits attr_accessible :description, :key, :name validates :key, :name, :user_id, :presence => true validates :key, :name, :uniqueness => { :scope => :user_id } validates :key, :format => { :with => /^[a-zA-Z\d\s]*$/ } belongs_to :...
github
tyne/tyne
https://github.com/tyne/tyne
app/models/label.rb
Ruby
mit
48
master
309
# A label for an issue class Label < ActiveRecord::Base belongs_to :project has_many :issue_labels, :dependent => :destroy has_many :issues, :through => :issue_labels attr_accessible :name, :colour validates :name, :presence => true validates :name, :uniqueness => { :scope => :project_id } end
github
tyne/tyne
https://github.com/tyne/tyne
app/models/user.rb
Ruby
mit
48
master
1,329
# Represents an user class User < ActiveRecord::Base validates :name, :uid, :token, :presence => true attr_accessible :name, :username, :uid, :email, :token, :gravatar_id, :notification_email has_many :organization_memberships has_many :organizations, :through => :organization_memberships has_many :projects ...
github
tyne/tyne
https://github.com/tyne/tyne
app/models/organization_membership.rb
Ruby
mit
48
master
206
# Present a membership of an organisation class OrganizationMembership < ActiveRecord::Base belongs_to :organization belongs_to :user validates_uniqueness_of :user_id, :scope => :organization_id end
github
tyne/tyne
https://github.com/tyne/tyne
app/models/backlog_item.rb
Ruby
mit
48
master
349
# A BacklogItem is an Issue that is not part of any sprint. class BacklogItem < Issue attr_accessible :project_id, :summary, :description, :issue_type_id, :issue_priority_id, :assigned_to_id acts_as_list :scope => :project, :column => "position" after_create :send_to_bottom private def send_to_bottom s...
github
tyne/tyne
https://github.com/tyne/tyne
app/models/team_member.rb
Ruby
mit
48
master
380
# A team member is part of a team that belongs to a project. class TeamMember < ActiveRecord::Base belongs_to :user belongs_to :team, :touch => true validates :user, :team, :presence => true validates :user_id, :uniqueness => { :scope => :team_id } attr_accessible :user_id default_scope includes(:user) ...
github
tyne/tyne
https://github.com/tyne/tyne
app/models/vote.rb
Ruby
mit
48
master
243
# Represents a vote (up/down) for an arbitrary resource class Vote < ActiveRecord::Base belongs_to :user belongs_to :votable, :polymorphic => true, :touch => true attr_accessible :user, :weight validates :user, :presence => true end
github
tyne/tyne
https://github.com/tyne/tyne
app/models/sprint.rb
Ruby
mit
48
master
1,564
# A Sprint is an iteration to deliver a subset of your product backlog # in a certain time frame. class Sprint < ActiveRecord::Base attr_accessible :end_date, :name, :project_id, :start_date belongs_to :project has_many :issues, :class_name => 'SprintItem', :order => 'sprint_position', :dependent => :nullify h...
github
tyne/tyne
https://github.com/tyne/tyne
app/models/comment.rb
Ruby
mit
48
master
328
# A comment is a message on a issue class Comment < ActiveRecord::Base audited :associated_with => :project, :allow_mass_assignment => true belongs_to :user belongs_to :issue, :touch => true validates :message, :issue_id, :user_id, :presence => true attr_accessible :message delegate :project, :to => :is...
github
tyne/tyne
https://github.com/tyne/tyne
app/models/issue_label.rb
Ruby
mit
48
master
357
# Assigned Label to an issue class IssueLabel < ActiveRecord::Base belongs_to :issue, :touch => true belongs_to :label attr_accessible :issue_id, :label_id before_save :secure_labels private def secure_labels if (self.issue.project != self.label.project) errors.add(:base, :unknown_label) end...
github
tyne/tyne
https://github.com/tyne/tyne
app/models/team.rb
Ruby
mit
48
master
320
# Represents a team for a project. # A team can allow a member to have admin privileges. class Team < ActiveRecord::Base belongs_to :project, :touch => true has_many :members, :class_name => "TeamMember", :autosave => true, :dependent => :destroy validates :project, :presence => true attr_accessible :name end
github
tyne/tyne
https://github.com/tyne/tyne
app/helpers/filter_helper.rb
Ruby
mit
48
master
1,977
# View helper to build filter panel for the backlog module FilterHelper # Creates a filter option to exclude the filter def filter_option_all(form_builder, field) options = {} options[:label] = "All" options[:required] = false options[:input_html] = { :id => "filter_#{field}_all", :type => :checkbox...
github
tyne/tyne
https://github.com/tyne/tyne
app/helpers/application_helper.rb
Ruby
mit
48
master
1,236
# Contains application-wide view helper methods. module ApplicationHelper # Returns the brand name wrapped in a span def brand result = content_tag(:span, "Tyne", :class => "brand-name") result.html_safe end # Builds a localised page title. def page_title options = {} options[:key] = @project...
github
tyne/tyne
https://github.com/tyne/tyne
app/helpers/dashboards_helper.rb
Ruby
mit
48
master
601
# View helper for dashboard module DashboardsHelper # Renders the font icon depending on the project privacy state # @param [Project] project def project_icon(project) klass = ["icon"] klass << if project.privacy "icon-lock" else ["mini-icon", "mini-icon-public"] ...
github
tyne/tyne
https://github.com/tyne/tyne
app/helpers/issues_helper.rb
Ruby
mit
48
master
3,223
# Provides issue related helper methods module IssuesHelper # Displays a label with the issue reporter def issue_reported_by(issue) issue_label(t("labels.reporter"), issue.reported_by.name) end # Displays a label with the issue type def issue_type(issue, short = false) name = if short is...
github
tyne/tyne
https://github.com/tyne/tyne
app/helpers/teams_helper.rb
Ruby
mit
48
master
686
# Provides view helpers for the team area in the core engine. module TeamsHelper # Returns the list of potentional team members. # You cannot add user which are already part of the team. def available_members(team) scope = User.scoped team.members.all.each do |member| scope = scope.where(User.arel_t...
github
tyne/tyne
https://github.com/tyne/tyne
app/helpers/notification_helper.rb
Ruby
mit
48
master
352
# Helper for notifications module NotificationHelper # uses the Notification cell to display flash messages def flash_notification unless flash.empty? classification = flash.keys.first message = flash[classification] javascript_tag "$(function() { Notification.show('#{classification}', '#{mes...
github
tyne/tyne
https://github.com/tyne/tyne
app/helpers/avatar_helper.rb
Ruby
mit
48
master
691
# View helper for gravatar images module AvatarHelper # Returns the gravatar url for a particular user # # @param [User] user # @param [Hash] options def avatar_url(user, options={}) default_url = "retro" return default_url unless user.gravatar_id "http://gravatar.com/avatar/#{user.gravatar_id}....
github
tyne/tyne
https://github.com/tyne/tyne
app/helpers/sprints_helper.rb
Ruby
mit
48
master
1,583
# Provides view helpers for the sprints in the core engine. module SprintsHelper # Renders a start sprint for a particular sprint. # The button will be disabled if either a sprint is already running # or if the sprint is empty (no issues). def start_sprint_button(sprint) options = { :class => "btn btn-small...
github
tyne/tyne
https://github.com/tyne/tyne
app/helpers/labels_helper.rb
Ruby
mit
48
master
1,042
# View helpers for labels module LabelsHelper # Determines if a label is assigned to an issue def labelled?(label, issue) return false unless issue label.issues.include?(issue) end # Returns the associated label identifier def labelled_id(label, issue) return unless issue labelled = label.i...
github
tyne/tyne
https://github.com/tyne/tyne
app/inputs/datepicker_input.rb
Ruby
mit
48
master
529
# Creates an input that allows the user to pick a # date from a calendar. class DatepickerInput < SimpleForm::Inputs::Base # Renders the markup for the datepicker widget def input value = object.send(attribute_name) if object.respond_to? attribute_name value = value.to_date unless value.nil? input_html...
github
tyne/tyne
https://github.com/tyne/tyne
app/inputs/suggest_input.rb
Ruby
mit
48
master
406
# Creates an input that allows the user to select arbritary data. # The data gets suggested via a controller action. class SuggestInput < SimpleForm::Inputs::Base # Renders the markup for the suggest widget def input input_html_options.merge!(:data => { :url => options[:url] }) @builder.text_field(attribut...
github
tyne/tyne
https://github.com/tyne/tyne
app/mailers/issue_mailer.rb
Ruby
mit
48
master
1,604
# Mailer for issues class IssueMailer < ActionMailer::Base default :from => "'Tyne' <notifications@tyne-tickets.org>" # Sends a notification to all contributors # that a new issue has been raised. def self.send_issue_raised(issue_id) issue = Issue.find_by_id(issue_id) issue.project.workers.each do |tea...
github
tyne/tyne
https://github.com/tyne/tyne
app/audit_formatters/comment_audit_formatter.rb
Ruby
mit
48
master
827
# Formats comment audits class CommentAuditFormatter < AuditFormatter::Base # Converts a comment audit into a user readable message # # @return [String] localised audit message as html def format message = "#{i18n_base_scope}.create_html" return t(message, :user => user_link, :issue => issue_link, :proj...
github
tyne/tyne
https://github.com/tyne/tyne
app/audit_formatters/issue_audit_formatter.rb
Ruby
mit
48
master
1,877
# Formats an issue audit class IssueAuditFormatter < AuditFormatter::Base include AvatarHelper # Formats an issue audit into a human readable format. def format try(object.action) end def icon format_context.image_tag "icon-sweets/32/#{icon_name}" end def details return issue.description if...
github
tyne/tyne
https://github.com/tyne/tyne
app/controllers/teams_controller.rb
Ruby
mit
48
master
1,226
# Handles request to show the team structure of a project class TeamsController < AdminController self.responder = ::ApplicationResponder respond_to :html, :json before_filter :load_user before_filter :load_project before_filter :require_login before_filter :load_team before_filter :prepare_breadcrumb ...
github
tyne/tyne
https://github.com/tyne/tyne
app/controllers/labels_controller.rb
Ruby
mit
48
master
820
# Handles requests for labels class LabelsController < ApplicationController self.responder = ::ApplicationResponder respond_to :html, :json before_filter :load_label_project before_filter :require_login before_filter :ensure_can_collaborate # Creates a new label for a project def create @label = @p...
github
tyne/tyne
https://github.com/tyne/tyne
app/controllers/team_members_controller.rb
Ruby
mit
48
master
1,302
# Handle request to add and remove team members from a team class TeamMembersController < AdminController self.responder = ::ApplicationResponder respond_to :html, :json before_filter :load_user before_filter :load_project before_filter :require_login before_filter :require_owner # Adds a team member to...
github
tyne/tyne
https://github.com/tyne/tyne
app/controllers/sprints_controller.rb
Ruby
mit
48
master
2,330
# Handles request for sprints of a project class SprintsController < AdminController self.responder = ::ApplicationResponder respond_to :html, :json, :pjax before_filter :load_user before_filter :load_project before_filter :require_login, :except => [:current] before_filter :ensure_can_collaborate, :except...
github
tyne/tyne
https://github.com/tyne/tyne
app/controllers/issues_controller.rb
Ruby
mit
48
master
4,278
# Handles requests for issue creation, updates, deletions class IssuesController < ApplicationController include Extensions::ActionController::Filter include Extensions::ActionController::Pagination include Extensions::ActionController::Sorting include Extensions::ActionController::Query self.responder = ::A...
github
tyne/tyne
https://github.com/tyne/tyne
app/controllers/sessions_controller.rb
Ruby
mit
48
master
1,038
# Handles requests to create and destroy sessions (e.g. login, logout) class SessionsController < ApplicationController before_filter :require_login, :only => [:destroy] # Tries to login user with provided details or creates a new user # It redirects to the root page def create auth_hash = request.env['omn...
github
tyne/tyne
https://github.com/tyne/tyne
app/controllers/projects_controller.rb
Ruby
mit
48
master
1,780
# Handles requests for project creation, updates, deletions class ProjectsController < ApplicationController self.responder = ::ApplicationResponder respond_to :html, :json helper :teams before_filter :load_user, :only => [:admin] before_filter :load_project, :only => [:admin] before_filter :require_login ...
github
tyne/tyne
https://github.com/tyne/tyne
app/controllers/comments_controller.rb
Ruby
mit
48
master
614
# Handles requests for comments class CommentsController < ApplicationController self.responder = ::ApplicationResponder respond_to :html, :json before_filter :load_user before_filter :load_project before_filter :require_login # Creates a new comment for an issue def create load_issue @comment =...
github
tyne/tyne
https://github.com/tyne/tyne
app/controllers/application_controller.rb
Ruby
mit
48
master
2,000
# Application controller for core engine. class ApplicationController < ActionController::Base helper_method :current_user, :admin_area? before_filter :add_breadcrumb_root # Returns the current user if user is logged in or nil. # # @return User def current_user User.find(session[:user_id]) if session[:...
github
tyne/tyne
https://github.com/tyne/tyne
app/controllers/reports_controller.rb
Ruby
mit
48
master
911
# Handles requests for reports class ReportsController < ApplicationController self.responder = ::ApplicationResponder respond_to :html, :json, :pjax before_filter :load_user before_filter :load_project before_filter :require_login before_filter :ensure_can_collaborate before_filter :add_report_breadcrum...
github
tyne/tyne
https://github.com/tyne/tyne
app/controllers/users_controller.rb
Ruby
mit
48
master
752
# Handles requests for user specific tasks class UsersController < ApplicationController self.responder = ::ApplicationResponder respond_to :html, :json before_filter :load_user before_filter :require_login, :only => [:edit, :update] # Displays an overview page with user information and the list # of publ...
github
tyne/tyne
https://github.com/tyne/tyne
app/controllers/dashboards_controller.rb
Ruby
mit
48
master
631
# Handles all requests for dashboards class DashboardsController < ApplicationController self.responder = ::ApplicationResponder respond_to :html, :json before_filter :require_login # Displays the index view with the default dashboard def index @accessible_projects = current_user.accessible_projects ...
github
tyne/tyne
https://github.com/tyne/tyne
lib/extensions.rb
Ruby
mit
48
master
255
require "extensions/active_record/relation" require "extensions/action_controller/filter" require "extensions/action_controller/pagination" require "extensions/action_controller/sorting" # Contains logic to extend existing classes module Extensions end
github
tyne/tyne
https://github.com/tyne/tyne
lib/link_helper.rb
Ruby
mit
48
master
836
#Helper class for generating links to areas within the system class LinkHelper #TODO: No code asserts these link contents, as discovered when extracting # attr_reader :context def initialize(context) @context = context end #Generate a link for a given issue def issue_link(issue) context.link_to...
github
tyne/tyne
https://github.com/tyne/tyne
lib/audit_formatter.rb
Ruby
mit
48
master
1,771
# Contains logic to format audit messages module AuditFormatter # Base class for formatted audit messages class Base include ActionView::Helpers::TranslationHelper attr_reader :object, :options def initialize(object, options={}) @object, @options = object, options end # Abstract format ...
github
tyne/tyne
https://github.com/tyne/tyne
lib/auth_processor.rb
Ruby
mit
48
master
1,002
# Processes authentication class AuthProcessor attr_reader :credentials def initialize(credentials) @credentials = credentials end # Creates or finds a user based on the initialized credentials # # @return TyneAuth::User def find_or_create_user unless user = User.find_by_uid(uid) user = U...
github
tyne/tyne
https://github.com/tyne/tyne
lib/cache_key_generator.rb
Ruby
mit
48
master
759
#Generates cache keys for objects class CacheKeyGenerator attr_reader :collection #Key for an active record collection/relation def for_collection(collection) @collection = collection if collection.empty? 'empty/' + collection.object_id.to_s else key = "" key << collection_type ...
github
tyne/tyne
https://github.com/tyne/tyne
lib/reports/burn_down.rb
Ruby
mit
48
master
1,649
module Reports # Burn Down Chart Report class BurnDown def initialize(sprint) @sprint = sprint @options = { :width => "100%", :height => 500, :title => 'Burn Down', :is3D => false, :pointSize => 5} end # Translates sprint activity into google chart data. # # @return [GoogleVisualr:...
github
tyne/tyne
https://github.com/tyne/tyne
lib/reports/issue_type_ratio.rb
Ruby
mit
48
master
1,000
module Reports # Contains logic to create a issue type ratio report class IssueTypeRatio def initialize(project) @project = project @options = { :width => 800, :height => 600, :title => 'Issue Type Ratio', :is3D => false } end # Returns the chart data in a google chart tools compliant for...
github
tyne/tyne
https://github.com/tyne/tyne
lib/format_contexts/html.rb
Ruby
mit
48
master
323
#Formatting context to generate html output class FormatContexts::Html include Rails.application.routes.url_helpers include ActionView::Helpers::UrlHelper include AvatarHelper delegate :controller, :image_tag, :to => :view_context private def view_context @view_context ||= ActionView::Base.new end e...
github
tyne/tyne
https://github.com/tyne/tyne
lib/markdown_preprocessors/issue_auto_link.rb
Ruby
mit
48
master
1,336
module MarkdownPreprocessors # Create links between issues. # # #1 => [#1](issue/path) # #FOO-1 => [#FOO-1](issue/path) class IssueAutoLink include Rails.application.routes.url_helpers # Matcher for issue links inside a project like #1 and #2 INTERNAL_MATCHER = /#(\d+)/ # Matcher for p...
github
tyne/tyne
https://github.com/tyne/tyne
lib/extensions/votable.rb
Ruby
mit
48
master
1,670
module Extensions # The Votable extensions allows arbitrary resources to be votable by users module Votable extend ActiveSupport::Concern included do has_many :votes, :as => :votable end # Returns the total weight of upvotes # # @return [Integer] def upvotes votes.where(Vot...
github
tyne/tyne
https://github.com/tyne/tyne
lib/extensions/action_controller/query.rb
Ruby
mit
48
master
597
module Extensions module ActionController # Adds query functionality to action controller module Query extend ActiveSupport::Concern private def apply_query(reflection) return reflection if params[:query].blank? persist_query_information! q = "%#{params[:query]}%" ...
github
tyne/tyne
https://github.com/tyne/tyne
lib/extensions/action_controller/pagination.rb
Ruby
mit
48
master
1,261
module Extensions # ActionController extensions module ActionController # Adds pagination functionality to action controller module Pagination extend ActiveSupport::Concern private def apply_pagination(reflection) @total = reflection.count persist_pagination_information! ...
github
tyne/tyne
https://github.com/tyne/tyne
lib/extensions/action_controller/filter.rb
Ruby
mit
48
master
806
module Extensions # ActionController extensions module ActionController # Adds filter functionality to action controller module Filter extend ActiveSupport::Concern private def apply_filter(reflection) return reflection unless params[:filter] persist_filter_information! ...
github
tyne/tyne
https://github.com/tyne/tyne
lib/extensions/action_controller/sorting.rb
Ruby
mit
48
master
1,464
module Extensions # ActionController extensions module ActionController # Adds sorting functionality to action controller module Sorting extend ActiveSupport::Concern private def apply_sorting(reflection) persist_sort_information! column = get_sort_column(reflection) ...
github
tyne/tyne
https://github.com/tyne/tyne
lib/extensions/active_record/relation.rb
Ruby
mit
48
master
447
module Extensions # ActiveRecord extensions module ActiveRecord # Extensions for ActiveRecord::Relation module Relation extend ActiveSupport::Concern # Generate a cache key for active record relations def cache_key CacheKeyGenerator.new.for_collection(self) end end end...
github
tyne/tyne
https://github.com/tyne/tyne
lib/extensions/issues/workflow.rb
Ruby
mit
48
master
2,074
module Extensions # Contains logic for issue extensions module Issues # Defines a basic workflow for issues # The workflow is as follows: # --- # default_state: open # --- # open or reopened -> wip # open or reopened or wip -> done # open or reopened or wip -> invalid # wip -> op...
github
tyne/tyne
https://github.com/tyne/tyne
lib/form_builder/disabled_form_builder.rb
Ruby
mit
48
master
572
module FormBuilder # Specialised form builder in order to display a disabled form class DisabledFormBuilder < SimpleForm::FormBuilder # Appends a disabled attribute to the input def input(attribute_name, options = {}, &block) options[:input_html] ||= {} options[:input_html].merge! :disabled => '...
github
joshnesbitt/project
https://github.com/joshnesbitt/project
Rakefile
Ruby
mit
48
master
501
# Quick task to build and deploy gem. require 'lib/project' GEM_NAME = "project-#{Project::Version::STRING}.gem" GEM_PATH = "pkg/#{GEM_NAME}" def execute_commands(commands) commands.each do |command| output = `#{command}` puts "* executed #{command}" puts output unless output.empty? end end task :bui...
github
joshnesbitt/project
https://github.com/joshnesbitt/project
project.gemspec
Ruby
mit
48
master
1,036
require 'lib/project' Gem::Specification.new do |s| s.name = %q{project} s.version = Project::Version::STRING s.authors = ["Josh Nesbitt"] s.description = %q{Project aims to make working with multiple projects as simple as possible. By registering projects with workflows you can quickly create a set of command...
github
joshnesbitt/project
https://github.com/joshnesbitt/project
spec/watch.rb
Ruby
mit
48
master
660
# A simple alternative to autotest that isnt as painful options = { :options => "--require '#{File.expand_path(File.dirname(__FILE__)) + "/spec_helper"}' --format nested --color", :binary => "spec" } watch("(lib|spec)/(.*)\.rb") do |match| puts %x[ clear ] file = match[match.size - 1] opts = options[...
github
joshnesbitt/project
https://github.com/joshnesbitt/project
spec/lib/project_spec.rb
Ruby
mit
48
master
1,004
module Project describe Project do before do Project.clear_all @data = { :one => { :workflow => :default, :path => "/one/two/three" }, :two => { :workflow => :other, :path => "/one/two/three/four" } } end ...
github
joshnesbitt/project
https://github.com/joshnesbitt/project
spec/lib/loader_spec.rb
Ruby
mit
48
master
1,065
module Project describe Loader do before do @config_path = File.join(ROOT, 'spec', 'fixtures', 'config.yml') Loader.config_path(@config_path) end it "should allow a config path to be set" do path = "/my/path/.project" Loader.config_path(path) Loader.config_path.shou...
github
joshnesbitt/project
https://github.com/joshnesbitt/project
spec/lib/template_spec.rb
Ruby
mit
48
master
850
module Project describe Template do it "should successfully replace a strings variables with the replacements given" do subject = "cd %path && echo '%text' && echo '%other_var'" replacements = { :path => "/some/path", :text => "hello there", :other_var => "something" ...
github
joshnesbitt/project
https://github.com/joshnesbitt/project
spec/lib/core_ext_spec.rb
Ruby
mit
48
master
346
module Project describe OpenStruct do before do @struct = OpenStruct.new(:one => "one", :two => "two", :three => "three") end it "should provide [] as an interface to the OpenStructs' attributes" do @struct[:one].should == @struct.one # one @struct[:four].should == @struct.fou...