This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'monthify' | |
| module Weekify | |
| module HasWeeks | |
| def to_weeks | |
| (Week.containing(first_day))..(Week.containing(last_day)) | |
| end | |
| end | |
| class DateRange < Range |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MyPlugin | |
| constructor: (element, options) -> | |
| @elem = $(element) | |
| @settings = $.extend(param: "defaultValue", options or {}) | |
| # Public method | |
| publicMethod: () -> | |
| console.log "publicMethod() called!" | |
| $.fn.myplugin = (options) -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module OpenURI | |
| class <<self | |
| alias_method :open_uri_original, :open_uri | |
| def self.open_uri(name, options = {}) | |
| defaults = {:allow_redirections => :safe} | |
| self.open_uri_original(name, defaults.merge(options)) | |
| end | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require_relative "../core_extensions.rb" | |
| module ListDataExchange | |
| module Sql | |
| class InsertOrUpdate | |
| def initialize(quoter, table_name, column_names) | |
| @quoter = quoter | |
| @table_name = table_name | |
| @column_names = column_names | |
| @insert_sql = "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'spec_helper' | |
| describe CommentsController do | |
| let (:motion) { mock_model(Motion) } | |
| let (:comment) { mock_model(Comment, :default_motion => motion) } | |
| context "deleting comment" do | |
| stub_app_controller_resource(:comment) | |
| it "requires an authorised resource" do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'spec_helper' | |
| describe CommentsController do | |
| let (:app_controller) { controller } | |
| let (:motion) { mock_model(Motion) } | |
| let (:comment) { mock_model(Comment, :default_motion => motion) } | |
| context "deleting comment" do | |
| before do | |
| app_controller.stub(:authenticate_user!).and_return(true) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class UpgradeToRefineryTwo < ActiveRecord::Migration | |
| def self.up | |
| # For refinerycms-authentication | |
| rename_table :roles_users, :refinery_roles_users | |
| rename_table :roles, :refinery_roles | |
| rename_table :user_plugins, :refinery_user_plugins | |
| rename_table :users, :refinery_users | |
| remove_column :refinery_users, :persistence_token | |
| remove_column :refinery_users, :perishable_token | |
| remove_column :refinery_users, :remember_token |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| begin | |
| require 'spec/rake/verify_rcov' | |
| require 'metric_fu' | |
| MetricFu::Configuration.run do |config| | |
| config.metrics = [:flay, :flog, :reek, :roodi, :stats] | |
| config.graphs = [:flog, :flay, :reek, :roodi] | |
| config.flay = { :dirs_to_flay => ['spec/models/formats'] } | |
| config.flog = { :dirs_to_flog => ['app', 'lib'] } | |
| config.reek = { :dirs_to_reek => ['app', 'lib'] } |
NewerOlder