diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/lib/yard/handlers/class_handler.rb b/lib/yard/handlers/class_handler.rb index abc1234..def5678 100644 --- a/lib/yard/handlers/class_handler.rb +++ b/lib/yard/handlers/class_handler.rb @@ -2,7 +2,7 @@ handles TkCLASS def process - if statement.tokens.to_s =~ /^class\s+(#{NAMESPACEMATCH})(\s*<.+|\s*\Z)/m + if statement.tokens.to_s =~ /^class\s+(#{NAMESPACEMATCH})\s*(<.+|\Z)/m classname, extra, superclass, undocsuper = $1, $2, nil, false if extra =~ /\A\s*<\s*/m superclass = extra[/\A\s*<\s*(#{NAMESPACEMATCH})\s*\Z/m, 1] @@ -17,7 +17,7 @@ register klass # Explicit registration if undocsuper - raise YARD::Handlers::UndocumentableError, 'added class, but cannot document superclass' + raise YARD::Handlers::UndocumentableError, 'superclass (class was added without superclass)' end elsif statement.tokens.to_s =~ /^class\s*<<\s*([\w\:]+)/m classname = $1
Fix whitespace matching issue, clean up error message.
diff --git a/db/migrate/20170320113139_add_loan_accountable_column.rb b/db/migrate/20170320113139_add_loan_accountable_column.rb index abc1234..def5678 100644 --- a/db/migrate/20170320113139_add_loan_accountable_column.rb +++ b/db/migrate/20170320113139_add_loan_accountable_column.rb @@ -0,0 +1,7 @@+class AddLoanAccountableColumn < ActiveRecord::Migration + def change + add_column :loan_repayments, :accountable, :boolean, default: false, null: false + + execute ('UPDATE loan_repayments SET accountable = true WHERE journal_entry_id IS NOT NULL') + end +end
Add accountable column with migration
diff --git a/docs/analytics_scripts/p_and_e_program_leaders_to_csv.rb b/docs/analytics_scripts/p_and_e_program_leaders_to_csv.rb index abc1234..def5678 100644 --- a/docs/analytics_scripts/p_and_e_program_leaders_to_csv.rb +++ b/docs/analytics_scripts/p_and_e_program_leaders_to_csv.rb @@ -0,0 +1,10 @@+# Usernames of program organizers WMF Community Insights survey + +CSV.open('/home/weswikied/leaders_with_wikis.csv', 'wb') do |csv| + csv << %w[username program_slug joined_program_at program_wikis] + + CoursesUsers.where(role: CoursesUsers::Roles::INSTRUCTOR_ROLE).each do |cu| + next if cu.course.nil? + csv << [cu.user.username, cu.course.slug, cu.created_at, cu.course.wikis.map(&:domain)] + end +end
Add script for identifying program leaders on P&E Dashboard This is for use by WMF staff for the Community Insights survey.
diff --git a/MenuPopOverView.podspec b/MenuPopOverView.podspec index abc1234..def5678 100644 --- a/MenuPopOverView.podspec +++ b/MenuPopOverView.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "MenuPopOverView" - s.version = "0.0.2" + s.version = "0.0.3" s.summary = "A custom PopOverView looks like UIMenuController works on iPhone." s.homepage = "https://github.com/camelcc/MenuPopOverView" s.screenshots = "https://github.com/camelcc/MenuPopOverView/blob/master/popOver.png" @@ -8,7 +8,7 @@ s.author = { "camel_young" => "camel.young@gmail.com" } s.social_media_url = "http://twitter.com/camel_young" s.platform = :ios, '7.0' - s.source = { :git => "https://github.com/camelcc/MenuPopOverView.git", :tag => "0.0.2" } + s.source = { :git => "https://github.com/camelcc/MenuPopOverView.git", :tag => "0.0.3" } s.source_files = 'MenuPopOverView' s.requires_arc = true end
Update pods to version 0.0.3
diff --git a/UIView+DragDrop.podspec b/UIView+DragDrop.podspec index abc1234..def5678 100644 --- a/UIView+DragDrop.podspec +++ b/UIView+DragDrop.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "UIView+DragDrop" - s.version = "0.0.2" + s.version = "1.0.0" s.summary = "Objective-C category adding drag and drop functionality to UIView" s.description = "Simple interface for adding drag and drop functionality to UIViews" s.homepage = "http://github.com/ryanmeisters/UIView-DragDrop"
Update podspec, bump version to 1.0.0
diff --git a/lib/one_click_orgs/model_wrapper.rb b/lib/one_click_orgs/model_wrapper.rb index abc1234..def5678 100644 --- a/lib/one_click_orgs/model_wrapper.rb +++ b/lib/one_click_orgs/model_wrapper.rb @@ -2,6 +2,8 @@ class ModelWrapper extend ActiveModel::Naming include ActiveModel::Validations + include ActiveModel::Conversion + extend ActiveModel::Conversion::ClassMethods def initialize(attributes={}) self.attributes = attributes @@ -19,23 +21,11 @@ def id @id end - - def to_param - id.try(:to_s) - end - - def to_key - persisted? ? [id] : nil - end - + def persisted? raise NotImplementedError, "#persisted? must be implemented by subclass" end - - def to_model - self - end - + def attributes=(attributes) attributes.each_pair do |key, value| send("#{key}=", value)
Make ModelWrapper conform with Rails 3.2's ActiveModel requirements.
diff --git a/texttube_baby.gemspec b/texttube_baby.gemspec index abc1234..def5678 100644 --- a/texttube_baby.gemspec +++ b/texttube_baby.gemspec @@ -17,7 +17,7 @@ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_dependency "texttube" + spec.add_dependency "texttube", >= "6.0.0" spec.add_dependency "nokogiri" spec.add_dependency "coderay" spec.add_development_dependency "bundler", "~> 1.7"
Correct the version numbers, texttube is a changing.
diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index abc1234..def5678 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -1,9 +1,9 @@ # encoding: utf-8 class CommentsController < ApplicationController - load_and_authorize_resource :post, :optional => true - load_and_authorize_resource :comment - load_and_authorize_resource :comment, :through => :post + load_and_authorize_resource :post, :only => :create + load_and_authorize_resource :comment, :only => [:flag, :like, :dislike] + load_and_authorize_resource :comment, :through => :post, :only => :create def create @comment = @post.comments.new(params[:comment]).publish_as(current_user, request)
Improve comments controller before filters
diff --git a/app/controllers/searches_controller.rb b/app/controllers/searches_controller.rb index abc1234..def5678 100644 --- a/app/controllers/searches_controller.rb +++ b/app/controllers/searches_controller.rb @@ -25,7 +25,7 @@ respond_to do |format| format.html - format.json do + format.js do render :json => {:html => render_to_string(:partial => "questions/question", :collection => @questions)}.to_json end
Revert "render json for search instead of jrender json for search instead of js" This reverts commit aaf2431a6f573fdf121d81c2e26ad7d58e031626.
diff --git a/lib/reunion/web/app.rb b/lib/reunion/web/app.rb index abc1234..def5678 100644 --- a/lib/reunion/web/app.rb +++ b/lib/reunion/web/app.rb @@ -7,15 +7,21 @@ set :root, File.dirname(__FILE__) - def get_all_transactions + + + def get_transfer_pairs + get_cached_books.transfer_pairs + end + + def get_books b = Reunion::ImazenBooks.new b.configure b.load b.rules - b.all_transactions - end - def get_cached_transactions - @@all ||= get_all_transactions + b + end + def get_cached_books + @@books ||= get_books end @@ -24,7 +30,7 @@ end get '/search/:query' do |query| - get_cached_transactions.select{|t| t.description.downcase.include?(query.downcase)} + get_cached_books.all_transactions.select{|t| t.description.downcase.include?(query.downcase)} slim :search, {:layout => :layout, :locals => {:results => results, :query => query}} end @@ -34,11 +40,11 @@ end get '/expense/:query' do |query| - list = get_cached_transactions.map{|t| t[:tax_expense]}.uniq + list = get_cached_books.all_transactions.map{|t| t[:tax_expense]}.uniq query = query.to_s.downcase.to_sym - results = get_cached_transactions.select{|t| query == :none ? t[:tax_expense].to_s.empty? : t[:tax_expense] == query} + results = get_cached_books.all_transactions.select{|t| query == :none ? t[:tax_expense].to_s.empty? : t[:tax_expense] == query} slim :expense, {:layout => :layout, :locals => {:results => results, :query => query, :tax_expense_names => list}} end
Refactor caching to cache entire books object
diff --git a/lib/extensions/time_bounded_record/active_record/base.rb b/lib/extensions/time_bounded_record/active_record/base.rb index abc1234..def5678 100644 --- a/lib/extensions/time_bounded_record/active_record/base.rb +++ b/lib/extensions/time_bounded_record/active_record/base.rb @@ -8,11 +8,11 @@ private def started - where.has { (start_at == nil) | (start_at <= Time.zone.now) } + where.has { (start_at == nil) | (start_at <= Time.zone.now) } # rubocop:disable Style/NilComparison end def ended - where.has { (end_at == nil) | (end_at >= Time.zone.now) } + where.has { (end_at == nil) | (end_at >= Time.zone.now) } # rubocop:disable Style/NilComparison end end
Disable lint for baby_squeel queries
diff --git a/config.rb b/config.rb index abc1234..def5678 100644 --- a/config.rb +++ b/config.rb @@ -6,4 +6,5 @@ javascripts_dir = 'assets/javascripts' relative_assets = true line_comments = false -# output_style = :compressed+# output_style = :compressed +disable_warnings = true
Add disable_warnings to disable the @media query/@extend deprecation warnings.
diff --git a/config.ru b/config.ru index abc1234..def5678 100644 --- a/config.ru +++ b/config.ru @@ -4,10 +4,10 @@ Bundler.require -require File.join(File.dirname(__FILE__), "prey_fetcher.rb") +require File.join(File.dirname(__FILE__), "web.rb") # Set Sinatra's variables -set :app_file, File.join(File.dirname(__FILE__), "prey_fetcher.rb") +set :app_file, File.join(File.dirname(__FILE__), "web.rb") set :environment, ENV['RACK_ENV'].to_sym set :root, File.dirname(__FILE__) set :public, "public"
Load web.rb in rackup file
diff --git a/app/models/repository.rb b/app/models/repository.rb index abc1234..def5678 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -20,14 +20,32 @@ property :accessibility def metadata - total = Tire.search('metadata', :search_type => 'count') do - query { all } - end.results.total - name = @name + max = total Tire.search 'metadata' do query { string 'repository:' + name } - size total + size max + end.results.map { |entry| entry.to_hash } + end + + def total + name = @name + total = Tire.search('metadata', :search_type => 'count') do + query { string 'repository:' + name } + end.results.total + end + + def metadata_with_field(field, value="*") + name = @name + max = total + Tire.search 'metadata' do + query do + boolean do + must { string 'repository:' + name } + must { string field + ":" + value } + end + end + size max end.results.map { |entry| entry.to_hash } end
Add get all metadata with certain field method I refactored the count query into a separate method so it can be used by multiple methods. Then I added a method to return all records which have a certain field defined. A concrete value can be passed in addition. Signed-off-by: Konrad Reiche <4ff0213f56e2082fcd8c882d04c546881c579ce4@gmail.com>
diff --git a/app/uploaders/header_video_uploader.rb b/app/uploaders/header_video_uploader.rb index abc1234..def5678 100644 --- a/app/uploaders/header_video_uploader.rb +++ b/app/uploaders/header_video_uploader.rb @@ -16,7 +16,7 @@ end version :webm do - process :encode_video => [:webm] + process :encode_video => [:webm, resolution: '1920x1080', preserve_aspect_ratio: :width] def full_filename(for_file) "#{File.basename(for_file, File.extname(for_file))}.webm"
Use the same resolution constraints with webm that are used with mp4 Signed-off-by: Max Fierke <0706025b2bbcec1ed8d64822f4eccd96314938d0@maxfierke.com>
diff --git a/app/views/families/index.json.jbuilder b/app/views/families/index.json.jbuilder index abc1234..def5678 100644 --- a/app/views/families/index.json.jbuilder +++ b/app/views/families/index.json.jbuilder @@ -4,6 +4,7 @@ json.points member.points json.color member.color json.imgUrl member.img_url + json.pendingRewards member.pending_rewards json.assignedTasks member.tasks_left_to_do do |task| json.user task.title json.point_value task.point_value
Add pending rewards to member
diff --git a/config.ru b/config.ru index abc1234..def5678 100644 --- a/config.ru +++ b/config.ru @@ -3,6 +3,6 @@ use Rack::ShowExceptions -set :protection, :except => [:http_origin] +disable :protection run Sinatra::Application
Disable all Rack::Protection stuff to see if that prevents the random HTTP 500 errors.
diff --git a/app/workers/video_processing_worker.rb b/app/workers/video_processing_worker.rb index abc1234..def5678 100644 --- a/app/workers/video_processing_worker.rb +++ b/app/workers/video_processing_worker.rb @@ -5,6 +5,7 @@ video = Video.find(video_id) video.set_metadata video.set_duration + video.set_air_date video.save! VideoHashsumWorker.perform_async(video.id.to_s)
Set the air date in the video processor
diff --git a/ci_environment/rvm/attributes/default.rb b/ci_environment/rvm/attributes/default.rb index abc1234..def5678 100644 --- a/ci_environment/rvm/attributes/default.rb +++ b/ci_environment/rvm/attributes/default.rb @@ -1,6 +1,6 @@ include_attribute "travis_build_environment::default" -default[:rvm][:version] = "1.25.25" +default[:rvm][:version] = "1.25.28" case node[:platform] when "debian", "ubuntu"
Update RVM to the latest release
diff --git a/lib/ec2ssh/hosts.rb b/lib/ec2ssh/hosts.rb index abc1234..def5678 100644 --- a/lib/ec2ssh/hosts.rb +++ b/lib/ec2ssh/hosts.rb @@ -8,7 +8,7 @@ @dotfile = dotfile @ec2 = Hash.new do |h,region| key = dotfile.aws_key(keyname) - raise AwsEnvNotDefined if key['access_key_id'].empty? || key['secret_access_key'].empty? + raise AwsEnvNotDefined if key['access_key_id'].nil? || key['secret_access_key'].nil? h[region] = AWS::EC2.new( :ec2_endpoint => "#{region}.ec2.amazonaws.com", :access_key_id => key['access_key_id'],
Fix undefined method `empty?` when aws keys not set key['access_key_id'] and key['secret_access_key'], when it it empty, return nil
diff --git a/lib/flipper/feature.rb b/lib/flipper/feature.rb index abc1234..def5678 100644 --- a/lib/flipper/feature.rb +++ b/lib/flipper/feature.rb @@ -43,11 +43,14 @@ ] end + def gate_for(thing) + find_gate(thing) || raise(GateNotFound.new(thing)) + end + private - def gate_for(thing) - gates.detect { |gate| gate.protects?(thing) } || - raise(GateNotFound.new(thing)) + def find_gate(thing) + gates.detect { |gate| gate.protects?(thing) } end end end
Split up gate_for and finding of gate. Publicized gate_for for internal use. Finding the gate is still private.
diff --git a/lib/hyrax/errors.rb b/lib/hyrax/errors.rb index abc1234..def5678 100644 --- a/lib/hyrax/errors.rb +++ b/lib/hyrax/errors.rb @@ -1,4 +1,6 @@ module Hyrax + require 'active_fedora/errors' + # Generic Hyrax exception class. class HyraxError < StandardError; end
Fix the uninitialized constant ActiveFedora::ObjectNotFoundError NameError.
diff --git a/lib/peek/railtie.rb b/lib/peek/railtie.rb index abc1234..def5678 100644 --- a/lib/peek/railtie.rb +++ b/lib/peek/railtie.rb @@ -19,7 +19,7 @@ end initializer 'peek.persist_request_data' do - ActiveSupport::Notifications.subscribe('process_action.action_controller') do + ActiveSupport::Notifications.subscribe('action_dispatch.request') do Peek.adapter.save Peek.clear end
Switch to action_dispatch.request for notification
diff --git a/core/app/models/spree/stock/estimator.rb b/core/app/models/spree/stock/estimator.rb index abc1234..def5678 100644 --- a/core/app/models/spree/stock/estimator.rb +++ b/core/app/models/spree/stock/estimator.rb @@ -15,7 +15,7 @@ shipping_methods.each do |shipping_method| cost = calculate_cost(shipping_method, package) - shipping_rates << shipping_method.shipping_rates.new(:cost => cost) + shipping_rates << shipping_method.shipping_rates.new(:cost => cost) unless cost.nil? end shipping_rates.sort_by! { |r| r.cost || 0 }
Allow shipping calculators to return nil values if no service is matched. With shipping calculators returning 0, we run the risk of choosing and charging a cost of $0 in cases where for example spree_active_shipping has a failed rate query with the carrier API. This could be a very expensive mistake. Current problem as it stands is that with spree_active_shipping returning nil, if the calculator returns nil, no other rate options are tried and the customer sees no shipping options in checkout. This fixes https://github.com/spree/spree_active_shipping/issues/104 Fixes #3588 Fixes spree/spree_active_shipping#104
diff --git a/server.rb b/server.rb index abc1234..def5678 100644 --- a/server.rb +++ b/server.rb @@ -4,7 +4,13 @@ File.open('./helios.pid', 'w') { |f| f.write $$ } -Helios::Lights.load_saved_light_state +begin + Helios::Lights.load_saved_light_state +rescue Exception => ex + Helios::Logger.instance.error("Error loading light state") + Helios::Logger.instance.error("ERROR: #{ex.message}") + Helios::Logger.instance.error ex.backtrace.join("\n") +end loop do listener.listen!
Add catch block for loading light state
diff --git a/activerecord/lib/rails/generators/active_record/migration.rb b/activerecord/lib/rails/generators/active_record/migration.rb index abc1234..def5678 100644 --- a/activerecord/lib/rails/generators/active_record/migration.rb +++ b/activerecord/lib/rails/generators/active_record/migration.rb @@ -44,7 +44,7 @@ config = ActiveRecord::Base.configurations.configs_for( env_name: Rails.env, - name: options[:database] + name: database ) Array(config&.migrations_paths).first
Fix rubocop warning re unused argument
diff --git a/test/turing/face/data_store_test.rb b/test/turing/face/data_store_test.rb index abc1234..def5678 100644 --- a/test/turing/face/data_store_test.rb +++ b/test/turing/face/data_store_test.rb @@ -18,4 +18,18 @@ data = ds.find('curriculum', 'projects/feed_engine') assert data.body.include?('# Feed Engine') end + + def test_it_counts_insertions + ds = Turing::Face::DataStore.instance + start = ds.changes + fake_response = Turing::Face::FetcherResponse.new('turingschool/curriculum') + + ds.store(fake_response) + one = ds.changes + assert one > start + + ds.store(fake_response) + two = ds.changes + assert two > one + end end
Test the tracking of changes in the data store
diff --git a/lib/open_data/agent.rb b/lib/open_data/agent.rb index abc1234..def5678 100644 --- a/lib/open_data/agent.rb +++ b/lib/open_data/agent.rb @@ -1,15 +1,37 @@ module OpenData - # A person or organisation. Named after foaf:Agent but using schema.org naming for internals + # A person or organisation. + # + # Naming is based on {http://xmlns.com/foaf/spec/#term_Agent foaf:Agent}, but with useful aliases for other vocabularies. class Agent - attr_accessor :name, :uri, :email - + # Create a new Agent + # + # @param [Hash] options the details of the Agent. + # @option options [String] :name The Agent's name + # @option options [String] :homepage The homepage URL for the Agent + # @option options [String] :mbox Email address for the Agent + # def initialize(options) @name = options[:name] - @uri = options[:uri] - @email = options[:email] + @homepage = options[:homepage] + @mbox = options[:mbox] end + + # @!attribute name + # @return [String] the name of the Agent + attr_accessor :name + + # @!attribute homepage + # @return [String] the homepage URL of the Agent + attr_accessor :homepage + alias_method :url, :homepage + alias_method :uri, :homepage + + # @!attribute mbox + # @return [String] the email address of the Agent + attr_accessor :mbox + alias_method :email, :mbox end
Rename Agent attributes to match FOAF and add YARD docs
diff --git a/db/migrate/20140411231959_add_twitter_omniauth_to_users.rb b/db/migrate/20140411231959_add_twitter_omniauth_to_users.rb index abc1234..def5678 100644 --- a/db/migrate/20140411231959_add_twitter_omniauth_to_users.rb +++ b/db/migrate/20140411231959_add_twitter_omniauth_to_users.rb @@ -0,0 +1,11 @@+class AddTwitterOmniauthToUsers < ActiveRecord::Migration + def self.up + add_column :users, :provider, :string + add_column :users, :uid, :string + end + + def self.down + remove_column :users, :provider + remove_column :users, :uid + end +end
Create twitter omniauth DB migration Add in provider and uid fields in preparation for 'omniauth-twitter' implementation.
diff --git a/db/migrate/20161201160541_drop_column_user_id_in_states.rb b/db/migrate/20161201160541_drop_column_user_id_in_states.rb index abc1234..def5678 100644 --- a/db/migrate/20161201160541_drop_column_user_id_in_states.rb +++ b/db/migrate/20161201160541_drop_column_user_id_in_states.rb @@ -4,9 +4,12 @@ migration( Proc.new do + Rails::Sequel::connection.run( + 'DELETE FROM states WHERE id NOT IN (SELECT state_id FROM visualizations WHERE state_id IS NOT NULL);' + ) alter_table :states do drop_column :user_id - add_index :visualization_id + add_index :visualization_id, unique: true end end, Proc.new do
Add unique visualization_id to migration
diff --git a/HandySwift.podspec b/HandySwift.podspec index abc1234..def5678 100644 --- a/HandySwift.podspec +++ b/HandySwift.podspec @@ -0,0 +1,27 @@+Pod::Spec.new do |s| + + s.name = "HandySwift" + s.version = "0.8" + s.summary = "Handy Swift features that didn't make it into the Swift standard library" + + s.description = <<-DESC + The goal of this library is to provide handy features that didn't make it to the Swift standard library (yet) + due to many different reasons. Those could be that the Swift community wants to keep the standard library clean + and manageable or simply hasn't finished discussion on a specific feature yet. + DESC + + s.homepage = "https://github.com/Flinesoft/HandySwift" + s.license = { :type => "MIT", :file => "LICENSE.md" } + + s.author = { "Cihat Gündüz" => "CihatGuenduez@posteo.de" } + s.social_media_url = "https://twitter.com/Dschee" + + s.ios.deployment_target = "8.0" + s.osx.deployment_target = "10.9" + s.tvos.deployment_target = "9.0" + + s.source = { :git => "git@github.com:Flinesoft/HandySwift.git", :tag => "0.8" } + s.source_files = "Sources", "Sources/**/*.swift" + s.framework = "Foundation" + +end
Add podspec file for CocoaPods support
diff --git a/lib/stacker/logging.rb b/lib/stacker/logging.rb index abc1234..def5678 100644 --- a/lib/stacker/logging.rb +++ b/lib/stacker/logging.rb @@ -10,6 +10,8 @@ class PrettyLogger < SimpleDelegator def initialize logger + super + old_formatter = logger.formatter logger.formatter = proc do |level, time, prog, msg| @@ -25,8 +27,6 @@ old_formatter.call level, time, prog, msg end - - super logger end %w[ debug info warn fatal ].each do |level|
Fix bug with SimpleDelegator in Ruby 2.1 Signed-off-by: Evan Owen <a31932a4150a6c43f7c4879727da9a731c3d5877@gmail.com>
diff --git a/config/initializers/devise_async.rb b/config/initializers/devise_async.rb index abc1234..def5678 100644 --- a/config/initializers/devise_async.rb +++ b/config/initializers/devise_async.rb @@ -4,5 +4,5 @@ else config.enabled = true end - config.backend = :delayed_job -end+ config.backend = :sidekiq +end
Use sidekiq as devise async engine
diff --git a/lib/facebooker/rails/extensions/rack_setup.rb b/lib/facebooker/rails/extensions/rack_setup.rb index abc1234..def5678 100644 --- a/lib/facebooker/rails/extensions/rack_setup.rb +++ b/lib/facebooker/rails/extensions/rack_setup.rb @@ -1,2 +1,8 @@+# Somewhere in 2.3 RewindableInput was removed- rack supports it natively require 'rack/facebook' -ActionController::Dispatcher.middleware.insert_after 'ActionController::RewindableInput',Rack::Facebook, Facebooker.secret_key+ActionController::Dispatcher.middleware.insert_after( + (Object.const_get('ActionController::RewindableInput') rescue false) ? + 'ActionController::RewindableInput' : + 'ActionController::Session::CookieStore', + Rack::Facebook, + Facebooker.secret_key )
Allow the rack middle_ware to fall back from after RewindableInput to after Session::CookieStore if RewindableInput is not available. It was removed somewhere in Rails 2.3
diff --git a/app/controllers/auth.rb b/app/controllers/auth.rb index abc1234..def5678 100644 --- a/app/controllers/auth.rb +++ b/app/controllers/auth.rb @@ -1,4 +1,8 @@ enable :sessions + +get "/" do + erb :welcome +end get '/login' do if current_user
Add index route to welcome page
diff --git a/config/initializers/6_rack_profiler.rb b/config/initializers/6_rack_profiler.rb index abc1234..def5678 100644 --- a/config/initializers/6_rack_profiler.rb +++ b/config/initializers/6_rack_profiler.rb @@ -3,7 +3,8 @@ # initialization is skipped so trigger it Rack::MiniProfilerRails.initialize!(Rails.application) + Rack::MiniProfiler.config.position = 'right' Rack::MiniProfiler.config.start_hidden = true - Rack::MiniProfiler.config.skip_paths << %w(/specs /teaspoon) + Rack::MiniProfiler.config.skip_paths << '/teaspoon' end
Disable Rack::MiniProfiler for /teaspoon path
diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb index abc1234..def5678 100644 --- a/config/initializers/wrap_parameters.rb +++ b/config/initializers/wrap_parameters.rb @@ -9,6 +9,6 @@ end # To enable root element in JSON for ActiveRecord objects. -# ActiveSupport.on_load(:active_record) do -# self.include_root_in_json = true -# end +ActiveSupport.on_load(:active_record) do + self.include_root_in_json = true +end
Enable root keys on json responses
diff --git a/app/models/avatar.rb b/app/models/avatar.rb index abc1234..def5678 100644 --- a/app/models/avatar.rb +++ b/app/models/avatar.rb @@ -1,7 +1,7 @@ class Avatar < Attachment mount_uploader :file, AvatarUploader - belongs_to :owner, class_name: "User" + belongs_to :owner, class_name: "User", dependent: :destroy MAX_SIZE = 5242880 # 5 megabytes EXTENSIONS = %w(jpg jpeg gif png svg)
Add dependent: :destroy to Avatar/Company association
diff --git a/spec/gimli/markup/code_block_spec.rb b/spec/gimli/markup/code_block_spec.rb index abc1234..def5678 100644 --- a/spec/gimli/markup/code_block_spec.rb +++ b/spec/gimli/markup/code_block_spec.rb @@ -0,0 +1,21 @@+# encoding: utf-8 + +require './spec/spec_helper' + +require './lib/gimli' +require './lib/gimli/markup' + +describe Gimli::Markup::CodeBlock do + + it 'should highlight code if language is supplied' do + code_block = Gimli::Markup::CodeBlock.new('1', 'ruby', 'puts "hi"') + code_block.highlighted.should include('class="CodeRay"') + code_block.highlighted.should include('class="delimiter"') + end + + it 'should highlight code if no language is supplied' do + code_block = Gimli::Markup::CodeBlock.new('1', nil, 'puts "hi"') + code_block.highlighted.should include('class="CodeRay"') + end +end +
Add tests for code block
diff --git a/spec/private/core_ext/kernel_spec.rb b/spec/private/core_ext/kernel_spec.rb index abc1234..def5678 100644 --- a/spec/private/core_ext/kernel_spec.rb +++ b/spec/private/core_ext/kernel_spec.rb @@ -1,11 +1,9 @@ require File.dirname(__FILE__) + '/../../spec_helper' - describe "Kernel#require" do - before do @logger = StringIO.new - Merb.logger = Merb::Logger.new(@logger) + Merb.logger = Merb::Logger.new(@logger) end it "should be able to require and throw a useful error message" do @@ -13,22 +11,22 @@ Merb.logger.should_receive(:error!).with("foo") Kernel.rescue_require("redcloth", "foo") end - - end + + describe "Kernel#caller" do - it "should be able to determine caller info" do __caller_info__.should be_kind_of(Array) end - + it "should be able to get caller lines" do __caller_lines__(__caller_info__[0], __caller_info__[1], 4).length.should == 9 __caller_lines__(__caller_info__[0], __caller_info__[1], 4).should be_kind_of(Array) end - end + + describe "Kernel misc." do it "should extract options from args" do @@ -36,11 +34,11 @@ Kernel.extract_options_from_args!(args).should == {:baz => :bar} args.should == ["foo", "bar"] end - + it "should throw a useful error if there's no debugger" do - Merb.logger.should_receive(:info!).with "\n***** Debugger requested, but was not " + + Merb.logger.should_receive(:info!).with "\n***** Debugger requested, but was not " + "available: Start server with --debugger " + "to enable *****\n" Kernel.debugger end -end+end
Clean up empty lines in Kernel extensions.
diff --git a/app/models/application_record.rb b/app/models/application_record.rb index abc1234..def5678 100644 --- a/app/models/application_record.rb +++ b/app/models/application_record.rb @@ -19,7 +19,7 @@ def update_without_validate!(**args) with_transaction_returning_status do assign_attributes(**args) - save!(validate: false) + save(validate: false) end end end
10907: Remove useless bang from save
diff --git a/spec/acceptance/01_zookeeper_spec.rb b/spec/acceptance/01_zookeeper_spec.rb index abc1234..def5678 100644 --- a/spec/acceptance/01_zookeeper_spec.rb +++ b/spec/acceptance/01_zookeeper_spec.rb @@ -25,7 +25,7 @@ class { 'zookeeper': install_method => 'archive', - archive_version => '3.6.0', + archive_version => '3.6.1', service_provider => $zookeeper_service_provider, manage_service_file => true, }
Use latest available version of ZooKeeper
diff --git a/spec/models/paper_admin_task_spec.rb b/spec/models/paper_admin_task_spec.rb index abc1234..def5678 100644 --- a/spec/models/paper_admin_task_spec.rb +++ b/spec/models/paper_admin_task_spec.rb @@ -8,21 +8,13 @@ end describe "updating paper admin" do - - let(:task) { PaperAdminTask.create(phase: phase, assignee: bob) } - let(:paper) { Paper.create!(short_title: "something", journal: Journal.create!) } + let(:task) { PaperAdminTask.create(phase: phase, assignee: bob, admin_id: bob.id) } + let(:paper) { Paper.create!(short_title: "something", admins: [bob], journal: Journal.create!) } let(:phase) { paper.task_manager.phases.first } - let(:sally) { User.create! email: 'sally@plos.org', - password: 'abcd1234', - password_confirmation: 'abcd1234', - username: 'sallyplos' } - let(:bob) { User.create! email: 'bob@plos.org', - password: 'abcd1234', - password_confirmation: 'abcd1234', - username: 'bobplos' } + let(:sally) { FactoryGirl.create :user } + let(:bob) { FactoryGirl.create :user } context "when paper admin is changed" do - before(:each) { task.paper.stub(:admin).and_return(bob) } it "will update paper and tasks" do task.should_receive(:update_paper_admin_and_tasks) task.admin_id = sally.id
Fix paper admin task spec
diff --git a/recipes/fix_profile.rb b/recipes/fix_profile.rb index abc1234..def5678 100644 --- a/recipes/fix_profile.rb +++ b/recipes/fix_profile.rb @@ -16,7 +16,8 @@ case node['platform_family'] when 'windows' # fix profile - file 'C:\Users\vagrant\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1' do + username = ENV['machine_user'] || 'vagrant' + file "C:\\Users\\#{username}\\Documents\\WindowsPowerShell\\Microsoft.PowerShell_profile.ps1" do content '' end end
Update powershell profile path username
diff --git a/app/models/page_part.rb b/app/models/page_part.rb index abc1234..def5678 100644 --- a/app/models/page_part.rb +++ b/app/models/page_part.rb @@ -4,7 +4,7 @@ default_scope :order => 'name' # Associations - belongs_to :page, :touch => true + belongs_to :page # Validations validates_presence_of :name
Revert "Touch page timestamp when updating a part" This reverts commit b83063904b9761fa3ffa854db3766507bc7cf9f2.
diff --git a/pp.rb b/pp.rb index abc1234..def5678 100644 --- a/pp.rb +++ b/pp.rb @@ -2,7 +2,7 @@ require 'erb' # The version of Coq. -version = `coqc -v`.match(/version ([^(]*) \(/)[1] +version = `coqc -v`.match(/version (\S+)/)[1] Dir.glob("src/*.v.erb") do |file_name| renderer = ERB.new(File.read(file_name, encoding: "UTF-8"))
Improve the version regexp for compatibility with Coq 8.14
diff --git a/canon-interpreter.rb b/canon-interpreter.rb index abc1234..def5678 100644 --- a/canon-interpreter.rb +++ b/canon-interpreter.rb @@ -1,3 +1,5 @@+ + def play_melody(mel) num_bars = mel.length for i in 0..num_bars - 1 @@ -13,10 +15,13 @@ end def play_beat(beat) + proportion_sustain = 0.7 + proportion_release = 0.3 pairs = beat[:rhythm].zip(beat[:notes]) pairs.map do |pair| - play pair[1] - sleep pair[0] + # pair[0] = pair[0] == (1/2) ? 0.5 : 1 # TODO: TEMP: uncomment if using copied and pasted canons + play pair[1], attack: 0, sustain: pair[0] * proportion_sustain, release: pair[0] * proportion_release + sleep pair[0].to_f end end
Update interpreter to deal with rationals and have good envelopes.
diff --git a/tagedit-rails.gemspec b/tagedit-rails.gemspec index abc1234..def5678 100644 --- a/tagedit-rails.gemspec +++ b/tagedit-rails.gemspec @@ -6,10 +6,10 @@ Gem::Specification.new do |spec| spec.name = "tagedit-rails" spec.version = Tagedit::Rails::VERSION - spec.authors = ["Matthew"] + spec.authors = ["Matthew Oklander"] spec.email = ["mottiokla@gmail.com"] - spec.description = 'Write a gem description' - spec.summary = 'Write a gem summary' + spec.description = 'This gem provides Tagedit extension for your Rails 3.2.6+ application.' + spec.summary = 'Use Tagedit with Rails 3.2.6+' spec.homepage = "http://www.o-sandbox.com" spec.license = "MIT"
Edit description and summary for gemspec.
diff --git a/spec/dummy/app/models/dummy_user.rb b/spec/dummy/app/models/dummy_user.rb index abc1234..def5678 100644 --- a/spec/dummy/app/models/dummy_user.rb +++ b/spec/dummy/app/models/dummy_user.rb @@ -1,17 +1,7 @@-class DummyUser - include ActiveModel::Validations - - attr_accessor :alchemy_roles, :language, :cache_key, :email, :password, :name, :id +class DummyUser < ActiveRecord::Base + attr_accessor :alchemy_roles, :name def self.logged_in [] end - - def self.stamper_class_name - :DummyUser - end - - def update_attributes(attributes) - attributes.each { |key,value| send("#{key}=".to_sym, value) } - end end
Make DummyUser class inherit from ActiveRecord again. This reverts changes from 7b1e66940ff744535469f0bbeb563adadfa68f13
diff --git a/spec/factories/changeset_factory.rb b/spec/factories/changeset_factory.rb index abc1234..def5678 100644 --- a/spec/factories/changeset_factory.rb +++ b/spec/factories/changeset_factory.rb @@ -14,6 +14,10 @@ FactoryGirl.define do factory :changeset do notes { FFaker::Lorem.paragraph } + end + + factory :changeset_with_payload, class: Changeset do + notes { FFaker::Lorem.paragraph } payload { { changes: [ @@ -27,4 +31,5 @@ } } end + end
Add second Changeset factory, this one with payloads
diff --git a/spec/features/access_denied_spec.rb b/spec/features/access_denied_spec.rb index abc1234..def5678 100644 --- a/spec/features/access_denied_spec.rb +++ b/spec/features/access_denied_spec.rb @@ -0,0 +1,18 @@+require 'spec_helper' + +feature "Access Denied" do + before do + @user = FactoryGirl.create(:user) + @institution = FactoryGirl.create(:institution) + end + + scenario "Unauthorized user tries to view page" do + login_as(@user) + + # Visit the path of an institution that is not the user's + visit(institution_path(@institution)) + + expect(page).to have_content "You are not authorized to access this page." + current_path.should == root_path + end +end
Add coverage for rescue from CanCan AccessDenied
diff --git a/middleman-webp.gemspec b/middleman-webp.gemspec index abc1234..def5678 100644 --- a/middleman-webp.gemspec +++ b/middleman-webp.gemspec @@ -18,7 +18,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_dependency "middleman-core", "~> 4.0.0" + spec.add_dependency "middleman-core", "~> 4.0" spec.add_development_dependency "bundler", "~> 1.5" spec.add_development_dependency "middleman-cli", "~> 4.0.0"
Declare dependency according to Middleman docs https://github.com/middleman/middleman#versioning
diff --git a/async.podspec b/async.podspec index abc1234..def5678 100644 --- a/async.podspec +++ b/async.podspec @@ -1,22 +1,23 @@ Pod::Spec.new do |s| -s.name = "async" -s.version = "1.0.0" -s.summary = "Async is a utility framework which provides asynchronous working to help processing background tasks without blocking the UI." + s.name = "async" + s.version = "1.0.0" + s.summary = "Utility framework which provides asynchronous working to help processing background tasks." -s.description = "Async is a utility framework which provides asynchronous working to help processing background tasks without blocking the UI. It is inspired by Javascript module https://github.com/caolan/async." + s.description = <<-DESC + Async is a utility framework which provides asynchronous working to help processing background tasks without blocking the UI. It is inspired by Javascript module https://github.com/caolan/async. + DESC -s.homepage = "https://github.com/isanjosgon/asyncpod.git" -s.license = 'MIT' -s.author = { "Isra San Jose Gonzalez" => "isanjosgon@gmail.com" } -s.source = { :git => "https://github.com/isanjosgon/async.git", :tag => s.version.to_s } -s.social_media_url = 'https://twitter.com/isanjosgon' + s.homepage = "https://github.com/isanjosgon/asyncpod.git" + s.license = 'MIT' + s.author = { "Isra San Jose Gonzalez" => "isanjosgon@gmail.com" } + s.source = { :git => "https://github.com/isanjosgon/asyncpod.git", :tag => s.version.to_s } + s.social_media_url = 'https://twitter.com/isanjosgon' -s.platform = :ios, '8.0' -s.requires_arc = true + s.platform = :ios, '8.0' + s.requires_arc = true -s.source_files = 'Pod/Classes/**/*' -s.resource_bundles = { -'async_pod' => ['Pod/Assets/*.png'] -} - + s.source_files = 'Pod/Classes/**/*' + s.resource_bundles = { + 'async' => ['Pod/Assets/*.png'] + } end
Fix error git url podspec
diff --git a/test/unit/model/test_test.rb b/test/unit/model/test_test.rb index abc1234..def5678 100644 --- a/test/unit/model/test_test.rb +++ b/test/unit/model/test_test.rb @@ -23,4 +23,14 @@ assert test.respond_to? 'ws_security=' end + def test_has_tag + test = Test.new {|t| t.tags = ["dev", "ss1"] } + + assert !test.has_tag?('dev1') + assert !test.has_tag?('tag') + + assert test.has_tag?('dev') + assert test.has_tag?('ss1') + end + end
Add support for tags at test case scope.
diff --git a/recipes/bsd_service.rb b/recipes/bsd_service.rb index abc1234..def5678 100644 --- a/recipes/bsd_service.rb +++ b/recipes/bsd_service.rb @@ -29,6 +29,11 @@ mode 00755 end + # Remove wrong rc.d script created by an older version of cookbook + file '/etc/rc.d/chef-client' do + action :delete + end + template '/etc/rc.conf.d/chef' do mode 00644 notifies :start, 'service[chef-client]', :delayed
Remove wrong rc.d script created by an older version of cookbook
diff --git a/spec/lib/reveal-ck/commands/listen_to_reload_browser_spec.rb b/spec/lib/reveal-ck/commands/listen_to_reload_browser_spec.rb index abc1234..def5678 100644 --- a/spec/lib/reveal-ck/commands/listen_to_reload_browser_spec.rb +++ b/spec/lib/reveal-ck/commands/listen_to_reload_browser_spec.rb @@ -12,11 +12,19 @@ .to(receive(:prefix_for)) .and_return('[prefix]') + output_dir = 'output_dir' + + guardfile_watches_index_html_in_output_dir = + %r{watch\(\%r\{\^#{output_dir}\/index.html\$\}\)} + + start_args = { + guardfile_contents: guardfile_watches_index_html_in_output_dir, + no_interactions: true + } expect(::Guard) - .to(receive(:start)) + .to(receive(:start).with(start_args)) .once - output_dir = 'slides' listen_to_reload_browser = ListenToReloadBrowser.new(serve_ui, output_dir) thread = listen_to_reload_browser.run
Update reload browser spec to verify output_dir
diff --git a/app/controllers/exam_authorization_requests_controller.rb b/app/controllers/exam_authorization_requests_controller.rb index abc1234..def5678 100644 --- a/app/controllers/exam_authorization_requests_controller.rb +++ b/app/controllers/exam_authorization_requests_controller.rb @@ -1,6 +1,8 @@ class ExamAuthorizationRequestsController < ApplicationController def create - authorization_request = ExamAuthorizationRequest.create! authorization_request_params + authorization_request = ExamAuthorizationRequest.find_or_create_by! create_authorization_request_params do |it| + it.assign_attributes authorization_request_params + end current_user.read_notification! authorization_request.exam_registration flash.notice = I18n.t :exam_authorization_request_created redirect_to root_path @@ -14,6 +16,10 @@ private + def create_authorization_request_params + authorization_request_params.slice :exam_registration_id, :user, :organization + end + def authorization_request_params params .require(:exam_authorization_request).permit(:exam_id, :exam_registration_id)
Replace create! by find_or_create_by! to avoid multiple creations
diff --git a/summon.rb b/summon.rb index abc1234..def5678 100644 --- a/summon.rb +++ b/summon.rb @@ -1,5 +1,5 @@ class Summon < Formula - desc "A command-line tool to make working with secrets easier" + desc "Tool to make working with secrets easier" homepage "https://github.com/conjurinc/summon" url "https://github.com/conjurinc/summon/releases/download/v0.3.2/summon_v0.3.2_darwin_amd64.tar.gz" version "0.3.2"
Update description to pass homebrew audit
diff --git a/capistrano-ext-puppetize.gemspec b/capistrano-ext-puppetize.gemspec index abc1234..def5678 100644 --- a/capistrano-ext-puppetize.gemspec +++ b/capistrano-ext-puppetize.gemspec @@ -14,8 +14,9 @@ spec.add_dependency 'capistrano', '>=2.0.0' spec.add_dependency 'capistrano-ext' - spec.add_dependency 'capistrano-spec' - spec.add_dependency 'rspec' + + spec.add_development_dependency 'rspec' + spec.add_development_dependency 'capistrano-spec' spec.require_path = 'lib' end
Change spec dependancies to development only
diff --git a/acceptance/setup/pre_suite/12_upgrade_distros.rb b/acceptance/setup/pre_suite/12_upgrade_distros.rb index abc1234..def5678 100644 --- a/acceptance/setup/pre_suite/12_upgrade_distros.rb +++ b/acceptance/setup/pre_suite/12_upgrade_distros.rb @@ -0,0 +1,21 @@+def upgrade_pkgs_on_host(host, os) + case os + when :debian + on host, "apt-get update" + on host, "DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::=\"--force-confnew\" --force-yes -fuy dist-upgrade" + when :redhat + on host, "yum clean all -y" + on host, "yum upgrade -y" + when :fedora + on host, "yum clean all -y" + on host, "yum upgrade -y" + else + raise ArgumentError, "Unsupported OS '#{os}'" + end +end + +step "Upgrade each host" do + hosts.each do |host| + upgrade_pkgs_on_host(host, test_config[:os_families][host.name]) + end +end
Upgrade distros to ensure all packages are the latest Without this we are seeing elements fall behind, such as the new SSL changes to the EPEL mirror which are no longer compatible with the SSL setup on older RHEL6/7 boxes. Signed-off-by: Ken Barber <470bc578162732ac7f9d387d34c4af4ca6e1b6f7@bob.sh>
diff --git a/spec/delayed_job_mongoid_spec.rb b/spec/delayed_job_mongoid_spec.rb index abc1234..def5678 100644 --- a/spec/delayed_job_mongoid_spec.rb +++ b/spec/delayed_job_mongoid_spec.rb @@ -1,5 +1,5 @@ require 'spec_helper' describe Delayed::Backend::Mongoid::Job do - it_should_behave_like 'a delayed_job backend' + it_behaves_like 'a delayed_job backend' end
Convert specs to the new RSpec expectation syntax See http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
diff --git a/activesupport/lib/active_support/ordered_hash.rb b/activesupport/lib/active_support/ordered_hash.rb index abc1234..def5678 100644 --- a/activesupport/lib/active_support/ordered_hash.rb +++ b/activesupport/lib/active_support/ordered_hash.rb @@ -5,7 +5,7 @@ end module ActiveSupport - # <tt>ActiveSupport::OrderedHash</tt> implements a hash that preserves + # DEPRECATED: <tt>ActiveSupport::OrderedHash</tt> implements a hash that preserves # insertion order. # # oh = ActiveSupport::OrderedHash.new
Add a commend about deprecation of ActiveSupport::OrderedHash It is in the code to provides backward compatibility for people that have this class serialized as YAML in some storage. Closes #22681
diff --git a/lib/data_mapper/engine/veritas_engine.rb b/lib/data_mapper/engine/veritas_engine.rb index abc1234..def5678 100644 --- a/lib/data_mapper/engine/veritas_engine.rb +++ b/lib/data_mapper/engine/veritas_engine.rb @@ -6,8 +6,25 @@ # Engine for Veritas class VeritasEngine < self + + # @see Engine#adapter + # + # @example + # uri = "postgres://localhost/test" + # engine = DataMapper::Engine::VeritasEngine.new(uri) + # engine.adapter + # + # @return [Veritas::Adapter::DataObjects] + # + # @api public attr_reader :adapter + # @see Engine#initialize + # + # @return [undefined] + # + # @api private + # # TODO: add specs def initialize(uri) super @@ -15,25 +32,54 @@ @adapter = Veritas::Adapter::DataObjects.new(uri) end - # @api private + # @see Engine#relation_node_class + # + # @return [RelationRegistry::RelationNode::VeritasRelation] + # + # @api public + # # TODO: add specs def relation_node_class RelationRegistry::RelationNode::VeritasRelation end - # @api private + # @see Engine#relation_edge_class + # + # @return [RelationRegistry::RelationEdge] + # + # @api public + # # TODO: add specs def relation_edge_class RelationRegistry::RelationEdge end - # @api private + # @see Engine#base_relation + # + # @param [Symbol] name + # the base relation name + # + # @param [Array<Array(Symbol, Class)>] header + # the base relation header + # + # @return [Veritas::Relation::Base] + # + # @api public + # # TODO: add specs def base_relation(name, header) Veritas::Relation::Base.new(name, header) end - # @api private + # @see Engine#gateway_relation + # + # @param [Veritas::Relation] relation + # the relation to be wrapped in a gateway relation + # + # @return [Veritas::Relation::Gateway] + # + # @api public + # # TODO: add specs def gateway_relation(relation) Veritas::Relation::Gateway.new(adapter, relation)
Add more comprehensive docs for Engine::VeritasEngine
diff --git a/lib/earth/locality/country/data_miner.rb b/lib/earth/locality/country/data_miner.rb index abc1234..def5678 100644 --- a/lib/earth/locality/country/data_miner.rb +++ b/lib/earth/locality/country/data_miner.rb @@ -16,7 +16,7 @@ store 'name', :field_number => 0 end - import 'country-specific flight route inefficiency factors derived from Ketteunen et al. (2005)', + import "country-specific flight route inefficiency factors derived from Kettunen et al. (2005)", :url => 'https://spreadsheets.google.com/pub?key=0AoQJbWqPrREqdG0yc3BxYUkybWV5M3RKb2t4X0JUOFE&hl=en&single=true&gid=0&output=csv' do key 'iso_3166_code' store 'flight_route_inefficiency_factor'
Fix typo in attribution of Country flight route inefficiency factor data
diff --git a/lib/invision_bridge/invision_bridge.rb b/lib/invision_bridge/invision_bridge.rb index abc1234..def5678 100644 --- a/lib/invision_bridge/invision_bridge.rb +++ b/lib/invision_bridge/invision_bridge.rb @@ -7,14 +7,20 @@ module ClassMethods def establish_bridge() if Rails - config = YAML::load(File.open(Rails.configuration.database_configuration_file)) - config = config["invision_bridge_#{Rails.env}"] + config_file = Rails.configuration.database_configuration_file + config_group = "invision_bridge_#{Rails.env}" else - config = YAML::load(File.open(File.join(File.dirname(__FILE__), '..', '..', 'config', 'database.yml'))) - config = config["invision_bridge"] + config_file = File.join(File.dirname(__FILE__), '..', '..', 'config', 'database.yml') + config_group = "invision_bridge" end - config['prefix'] ||= 'ibf_' + begin + config = YAML::load(config_file) + config = config[config_group] + config['prefix'] ||= 'ibf_' + rescue NoMethodError + raise "Unable to read database configuration from #{config_file} -- Make sure an #{config_group} definition exists." + end establish_connection(config)
Improve error message when database configuration can't be read
diff --git a/lib/tritium/parser/instructions/block.rb b/lib/tritium/parser/instructions/block.rb index abc1234..def5678 100644 --- a/lib/tritium/parser/instructions/block.rb +++ b/lib/tritium/parser/instructions/block.rb @@ -5,6 +5,7 @@ attr :statements, true def initialize(filename, line_num, statements = []) @filename, @line_num, @statements = filename, line_num, statements + set_parents! end def to_s(depth = 0)
Make sure to set parents after load
diff --git a/lib/vhdl_test_script/dsl/dummy_entity.rb b/lib/vhdl_test_script/dsl/dummy_entity.rb index abc1234..def5678 100644 --- a/lib/vhdl_test_script/dsl/dummy_entity.rb +++ b/lib/vhdl_test_script/dsl/dummy_entity.rb @@ -1,5 +1,6 @@ module VhdlTestScript::DSL class DummyEntity + class UndefinedPortError < NoMethodError; end def initialize(entity) @entity = entity end @@ -10,7 +11,7 @@ if port_by_name port_by_name else - raise NoMethodError + raise UndefinedPortError, "undefined port '#{action_name}'" end end end
Raise UndefinedPortError instead of NoMethodError
diff --git a/test/test_lesstidy.rb b/test/test_lesstidy.rb index abc1234..def5678 100644 --- a/test/test_lesstidy.rb +++ b/test/test_lesstidy.rb @@ -8,6 +8,7 @@ pass4: "div[name='foo'] { color: red; }", pass5: "div[name='foo'] { .gradient('$*&!*@#()&!#'); }", pass6: "tt { a: b; }", + pass7: "#menu a,div { color: red; font-weight: bold; } #menu ul li > div, td, tr, #menu a:hover div #lol yes yes .something span.clear-fix, table { text-align: center; .black; font-weight: bold; border: solid 2px #882828; cursor: default; background-repeat: no-repeat; } a:hover { .corner(5px); background: url(foo.png); span { font-weight: bold; } span, a:hover, a:active, a:hover span, a:active span { text-decoration: underline; strong em { color: blue; } } }", } fail_tests = {
Add one more test case.
diff --git a/lib/traffic_light_controller/config.rb b/lib/traffic_light_controller/config.rb index abc1234..def5678 100644 --- a/lib/traffic_light_controller/config.rb +++ b/lib/traffic_light_controller/config.rb @@ -4,13 +4,13 @@ @config = Hashie::Mash.new(YAML.load_file('./config/config.yml')) end - def method_missing(meth, *args, &block) - return config[meth.to_s] if config.has_key?(meth.to_s) + def method_missing(method_name, *args, &block) + return config[method_name.to_s] if config.has_key?(method_name.to_s) super end - def respond_to?(meth) - config.has_key?(meth.to_s) || super + def respond_to?(method_name) + config.has_key?(method_name.to_s) || super end private
Use a better argument name
diff --git a/lib/url_format/url_format_validator.rb b/lib/url_format/url_format_validator.rb index abc1234..def5678 100644 --- a/lib/url_format/url_format_validator.rb +++ b/lib/url_format/url_format_validator.rb @@ -1,6 +1,6 @@ class UrlFormatValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) - unless URI.parse(value).kind_of?(URI::HTTP) + unless URI.parse(value).kind_of?(URI::HTTP) && value =~ /\.\w{2,6}/ record.errors[attribute] << (options[:message] || "is invalid") end rescue URI::InvalidURIError
Add a check for TLD.
diff --git a/app.rb b/app.rb index abc1234..def5678 100644 --- a/app.rb +++ b/app.rb @@ -1,13 +1,10 @@ require 'rubygems' require 'open-uri' -# requests -url = 'http://api.seobrain.ru/v1/projects?apiKey=d602c8a1-922e-4663-adad-c8cd6e891cde' +url = 'http://api.seobrain.ru/v1/projects/amvzjvb1/positions?apiKey=d602c8a1-922e-4663-adad-c8cd6e891cde' doc = open(url) doc.each do |k| - k = k.split(/\W+/) - puts k + k = k.scan(/\b\d{1,2}\b/) + p k end -# positiions -# http://api.seobrain.ru/v1/projects/amvzjvb1/positions?apiKey=d602c8a1-922e-4663-adad-c8cd6e891cde
Fix regex to select correct numbers
diff --git a/avg.rb b/avg.rb index abc1234..def5678 100644 --- a/avg.rb +++ b/avg.rb @@ -11,8 +11,8 @@ if res.average != avg diff = (res.average - avg) res.map! { |el| (el - diff).round(precision) } - elsif precision != 2 - res.map! { |el| el.round(precision) } + else + res.map! { |el| el.round(precision) } if precision != 3 end return res end
Fix round situation when we have 1st shot in
diff --git a/script/cruise_build.rb b/script/cruise_build.rb index abc1234..def5678 100644 --- a/script/cruise_build.rb +++ b/script/cruise_build.rb @@ -1,4 +1,10 @@ #!/usr/bin/env ruby + +# Yes, this could be more abstracted, etc. Choosing explicitness for now. +# svn co and rake co need to be in same exec, or cruise just ends build after svn returns +# +# Intentionally doing svn co and rake cruise in separate processes to ensure that all of the +# local overrides are loaded by Rake. project_name = ARGV.first @@ -6,9 +12,7 @@ when "racing_on_rails" # Nothing else to get when "atra" - exec("svn co svn+ssh://butlerpress.com/var/repos/atra/trunk local") + exec("svn co svn+ssh://butlerpress.com/var/repos/atra/trunk local && rake cruise") else raise "Don't know how to build project named: '#{project_name}'" end - -exec("rake cruise")
Put svn co and rake task in same exec statement for unified return code
diff --git a/script/cruise_build.rb b/script/cruise_build.rb index abc1234..def5678 100644 --- a/script/cruise_build.rb +++ b/script/cruise_build.rb @@ -1,4 +1,10 @@ #!/usr/bin/env ruby + +# Yes, this could be more abstracted, etc. Choosing explicitness for now. +# svn co and rake co need to be in same exec, or cruise just ends build after svn returns +# +# Intentionally doing svn co and rake cruise in separate processes to ensure that all of the +# local overrides are loaded by Rake. project_name = ARGV.first @@ -6,9 +12,7 @@ when "racing_on_rails" # Nothing else to get when "atra" - exec("svn co svn+ssh://butlerpress.com/var/repos/atra/trunk local") + exec("svn co svn+ssh://butlerpress.com/var/repos/atra/trunk local && rake cruise") else raise "Don't know how to build project named: '#{project_name}'" end - -exec("rake cruise")
Put svn co and rake task in same exec statement for unified return code git-svn-id: 96bd6241e080dd4199045f7177cf3384e2eaed71@1423 2d86388d-c40f-0410-ad6a-a69da6a65d20
diff --git a/whipped-cream.gemspec b/whipped-cream.gemspec index abc1234..def5678 100644 --- a/whipped-cream.gemspec +++ b/whipped-cream.gemspec @@ -4,29 +4,29 @@ require 'whipped-cream/version' Gem::Specification.new do |spec| - spec.name = "whipped-cream" + spec.name = 'whipped-cream' spec.version = WhippedCream::VERSION spec.authors = ["Justin Campbell"] spec.email = ["justin@justincampbell.me"] - spec.description = %q{TODO: Write a gem description} - spec.summary = %q{TODO: Write a gem summary} - spec.homepage = "" - spec.license = "MIT" + spec.description = "HTTP topping for Raspberry Pi" + spec.summary = "HTTP topping for Raspberry Pi" + spec.homepage = 'https://github.com/justincampbell/whipped-cream' + spec.license = 'MIT' spec.files = `git ls-files`.split($/) spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) - spec.require_paths = ["lib"] + spec.require_paths = ['lib'] spec.required_ruby_version = '>= 1.9.3' - spec.add_runtime_dependency "pi_piper" - spec.add_runtime_dependency "sinatra" - spec.add_runtime_dependency "thor" + spec.add_runtime_dependency 'pi_piper' + spec.add_runtime_dependency 'sinatra' + spec.add_runtime_dependency 'thor' - spec.add_development_dependency "bundler", "~> 1.3" - spec.add_development_dependency "cane" - spec.add_development_dependency "rake" - spec.add_development_dependency "rspec" - spec.add_development_dependency "simplecov" + spec.add_development_dependency 'bundler', '~> 1.3' + spec.add_development_dependency 'cane' + spec.add_development_dependency 'rake' + spec.add_development_dependency 'rspec' + spec.add_development_dependency 'simplecov' end
Clean up gemspec, add summary/description
diff --git a/keycutter.gemspec b/keycutter.gemspec index abc1234..def5678 100644 --- a/keycutter.gemspec +++ b/keycutter.gemspec @@ -13,8 +13,6 @@ s.summary = %q{Gemcutter key management} s.description = %q{Multiple gemcutter accounts? Manage your keys with ease.} - s.rubyforge_project = "keycutter" - s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {spec,features}/*`.split("\n") s.require_paths = ["lib"]
Drop removed spec property rubyforge_project The RubyGems gemspec property rubyforge_project has been removed without a replacement. ## Background * [RubyForge was closed down in 2013][1]. * [rubygems/rubygems#2436 deprecated the `rubyforge_project` property][2]. [1]: https://twitter.com/evanphx/status/399552820380053505 [2]: rubygems/rubygems#2436
diff --git a/spec/controllers/educators_controller_spec.rb b/spec/controllers/educators_controller_spec.rb index abc1234..def5678 100644 --- a/spec/controllers/educators_controller_spec.rb +++ b/spec/controllers/educators_controller_spec.rb @@ -0,0 +1,33 @@+require 'rails_helper' + +describe EducatorsController, :type => :controller do + + describe '#reset_session_clock' do + def make_request + request.env['HTTPS'] = 'on' + request.env["devise.mapping"] = Devise.mappings[:educator] + get :reset_session_clock, format: :json + end + + context 'educator is not logged in' do + it 'returns 401 Unauthorized' do + make_request + expect(response).to have_http_status(:unauthorized) + end + end + context 'educator is logged in' do + before(:each) do + sign_in FactoryGirl.create(:educator) + make_request + end + it 'succeeds' do + expect(response).to have_http_status(:success) + end + it 'resets the session clock' do + # TODO: Get Devise test helpers like `educator_session` + # working within the Rspec controller context: + # expect(educator_session["last_request_at"]).eq Time.now + end + end + end +end
Write a very skinny EducatorsController + TODO: Get Devise test helpers like 'educator_session' working within Rspec controller context
diff --git a/test/unit/gateways/epsilon_test.rb b/test/unit/gateways/epsilon_test.rb index abc1234..def5678 100644 --- a/test/unit/gateways/epsilon_test.rb +++ b/test/unit/gateways/epsilon_test.rb @@ -1,6 +1,8 @@ require 'test_helper' class EpsilonGatewayTest < MiniTest::Test + include SamplePaymentMethods + def test_set_proxy_address_and_port ActiveMerchant::Billing::EpsilonGateway.proxy_address = 'http://myproxy.dev' ActiveMerchant::Billing::EpsilonGateway.proxy_port = 1234 @@ -8,4 +10,24 @@ assert_equal(gateway.proxy_address, 'http://myproxy.dev') assert_equal(gateway.proxy_port, 1234) end + + def test_purchase_post_data_encoding_eucjp + gateway = ActiveMerchant::Billing::EpsilonGateway.new(encoding: Encoding::EUC_JP) + fixture = YAML.load_file('test/fixtures/vcr_cassettes/purchase_successful.yml') + response_body = fixture['http_interactions'][0]['response']['body']['string'] + detail = { + user_name: '山田太郎', + item_name: 'すごい商品', + order_number: '12345678', + } + gateway.expects(:ssl_post).with( + instance_of(String), + all_of( + includes('user_name=%BB%B3%C5%C4%C2%C0%CF%BA'), + includes('item_name=%A4%B9%A4%B4%A4%A4%BE%A6%C9%CA'), + includes('order_number=12345678'), + ) + ).returns(response_body) + gateway.purchase(100, valid_credit_card, detail) + end end
Add post_data method encoding test
diff --git a/config/initializers/slack_api.rb b/config/initializers/slack_api.rb index abc1234..def5678 100644 --- a/config/initializers/slack_api.rb +++ b/config/initializers/slack_api.rb @@ -7,7 +7,7 @@ client = Slack.realtime client.on :team_join do |data| - welcome = "Welcome to slashrocket, <@#{data['user']['name']}>! Type `/rocket` for a quick tour of our channels. :simple_smile:" + welcome = "Welcome to slashrocket, @#{data['user']['name']}! Type `/rocket` for a quick tour of our channels. :simple_smile:" options = { channel: '#general', text: welcome, as_user: true } Slack.chat_postMessage(options) end
Remove brackets from welcome message
diff --git a/lib/dugway/liquid/filters/comparison_filters.rb b/lib/dugway/liquid/filters/comparison_filters.rb index abc1234..def5678 100644 --- a/lib/dugway/liquid/filters/comparison_filters.rb +++ b/lib/dugway/liquid/filters/comparison_filters.rb @@ -0,0 +1,42 @@+module ComparisonFilters + def num_gt(input, operand) + to_number(input) > to_number(operand) + end + + def num_lt(input, operand) + to_number(input) < to_number(operand) + end + + def num_eq(input, operand) + to_number(input) == to_number(operand) + end + + def num_lte(input, operand) + num_eq(input, operand) || num_lt(input, operand) + end + + def num_gte(input, operand) + num_eq(input, operand) || num_gt(input, operand) + end + + private + def to_number(obj) + case obj + when Numeric + obj + when String + (obj.strip =~ /^\d+\.\d+$/) ? obj.to_f : obj.to_i + else + 0 + end + end +end + +Liquid::Condition.send(:include, ComparisonFilters) +Liquid::Condition.class_eval do + operators['num_lt'] = lambda { |cond, left, right| cond.num_lt(left, right) } + operators['num_lte'] = lambda { |cond, left, right| cond.num_lte(left, right) } + operators['num_gt'] = lambda { |cond, left, right| cond.num_gt(left, right) } + operators['num_gte'] = lambda { |cond, left, right| cond.num_gte(left, right) } + operators['num_eq'] = lambda { |cond, left, right| cond.num_eq(left, right) } +end
Include our custom comparison filters
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index abc1234..def5678 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -12,7 +12,7 @@ authorize! :read, @project, :message => "You are not authorised to view Project ##{@project.id}" respond_to do |format| - format.html + format.html {render :action => 'show'} format.json { render json: @project.to_json( :include => [
Change ProjectsController to explicitly render show action for html format, hopefully fixing the issue where project JSON is being rendered when using the back button in Safari/Chrome
diff --git a/lib/hibiki/cli.rb b/lib/hibiki/cli.rb index abc1234..def5678 100644 --- a/lib/hibiki/cli.rb +++ b/lib/hibiki/cli.rb @@ -1,11 +1,31 @@ require 'socket' +require 'yaml' module Hibiki module Cli class << self def start(args = ARGV) - exit 0 + + config = YAML.load_file('/etc/hibiki/config.yaml') + + config['servers'].each { |server| + Thread.start { + puts server['name'] + ': Listen to port ' + server['port'].to_s + tcp_server = TCPServer.open(server['port']) + socket = tcp_server.accept + socket.close + tcp_server.close + puts server['name'] + ': Initialize with script ' + server['init'] + system server['init'] + } + } + + tcp_server = TCPServer.open(config['port']) + socket = tcp_server.accept + socket.close + tcp_server.close + end end
Load yaml config and listen to the ports
diff --git a/app/controllers/pages.rb b/app/controllers/pages.rb index abc1234..def5678 100644 --- a/app/controllers/pages.rb +++ b/app/controllers/pages.rb @@ -7,8 +7,8 @@ # I wonder if merb-action-args could conceivably support nil defaults def show(id, version = '') @page = Page.first(:slug => id) + raise NotFound unless @page @page.select_version!(version.to_i) unless version.empty? - raise NotFound unless @page display @page end @@ -19,8 +19,8 @@ def edit(id, version = '') @page = Page.first(:slug => id) + raise NotFound unless @page @page.select_version!(version.to_i) unless version.empty? - raise NotFound unless @page render end
Fix a 500 error when trying to show/edit an invalid page at a given version
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -12,7 +12,7 @@ recipe "java::oracle_i386", "Installs the 32-bit jvm without setting it as the default" -%w{ debian ubuntu centos redhat scientific fedora amazon arch oracle freebsd windows }.each do |os| +%w{ debian ubuntu centos redhat scientific fedora amazon arch oracle freebsd windows suse }.each do |os| supports os end
Add suse OS support to the cookbook.
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -10,26 +10,26 @@ supports 'centos' supports 'debian' supports 'fedora' +supports 'freebsd' +supports 'mac_os_x' supports 'oracle' supports 'redhat' -supports 'freebsd' supports 'scientific' -supports 'mac_os_x' +supports 'solaris2' supports 'suse' supports 'ubuntu' supports 'windows' -supports 'solaris2' -depends '7-zip', '~> 1.0' -depends 'build-essential', '~> 2.0' -depends 'chef-sugar', '~> 3.0' -depends 'homebrew', '~> 1.9' +depends '7-zip' +depends 'build-essential' +depends 'chef-sugar' depends 'git' +depends 'homebrew' depends 'languages' depends 'remote_install' -depends 'windows', '~> 1.30' -depends 'wix', '~> 2.0' -depends 'windows-sdk', '~> 1.0' +depends 'windows' +depends 'wix' +depends 'windows-sdk' source_url 'https://github.com/chef-cookbooks/omnibus' if respond_to?(:source_url) issues_url 'https://github.com/chef-cookbooks/omnibus/issues' if respond_to?(:issues_url)
Remove pessimistic locking in cookbook deps This makes it easier to integrate this cookbook onto nodes with large run lists.
diff --git a/spec/guest-tools/guesttools_spec.rb b/spec/guest-tools/guesttools_spec.rb index abc1234..def5678 100644 --- a/spec/guest-tools/guesttools_spec.rb +++ b/spec/guest-tools/guesttools_spec.rb @@ -1,7 +1,5 @@ require 'spec_helper' -# Since 20140106. See IMAGE-440. Addresses IMAGE-400. -# Certified Ubuntu images missing mdata-get, etc describe file('/usr/sbin/mdata-get') do it { should be_file } it { should be_mode 755 } @@ -21,9 +19,3 @@ it { should be_file } it { should be_mode 755 } end - -describe file('/lib/smartdc/mdata-get') do - it { should be_file } - it { should be_linked_to '/usr/sbin/mdata-get' } -end -
Clean up test for mdata-* tools
diff --git a/spec/project/default_config_spec.rb b/spec/project/default_config_spec.rb index abc1234..def5678 100644 --- a/spec/project/default_config_spec.rb +++ b/spec/project/default_config_spec.rb @@ -1,4 +1,8 @@ describe 'config/default.yml' do + subject(:default_config) do + RuboCop::ConfigLoader.load_file('config/default.yml') + end + let(:cop_names) do glob = SpecHelper::ROOT.join('lib', 'rubocop', 'cop', 'rspec', '*.rb') @@ -14,10 +18,6 @@ cop_names + %w(AllCops) end - subject(:default_config) do - RuboCop::ConfigLoader.load_file('config/default.yml') - end - it 'has configuration for all cops' do expect(default_config.keys.sort).to eq(config_keys.sort) end
Move test subject to beginning of describe
diff --git a/lib/bugzilla_helper.rb b/lib/bugzilla_helper.rb index abc1234..def5678 100644 --- a/lib/bugzilla_helper.rb +++ b/lib/bugzilla_helper.rb @@ -23,11 +23,13 @@ status = 'NOTFOUND' if url =~ /https?:\/\/bugzilla\.redhat\.com\/show_bug\.cgi\?id=(\d+)/ id = $1 - result = [] tries = 1 while true begin result = bug.get_bugs([id], ::Bugzilla::Bug::FIELDS_DETAILS) + if !result.empty? + status = result.first['status'] + end break rescue if tries == 3 @@ -37,9 +39,6 @@ tries += 1 end end - if !result.empty? - status = result.first['status'] - end end return status end
Make code a little more precise
diff --git a/spec/partyhat_util_spec.rb b/spec/partyhat_util_spec.rb index abc1234..def5678 100644 --- a/spec/partyhat_util_spec.rb +++ b/spec/partyhat_util_spec.rb @@ -20,10 +20,16 @@ } end - it "should successfully convert experience to level" do - @sliding_experiences.each do |key, value| - converted = Partyhat::Util.experience_to_level(value) - converted.should eq(key) + context "Experience to Level" do + it "should successfully convert experience to level" do + @sliding_experiences.each do |key, value| + converted = Partyhat::Util.experience_to_level(value) + converted.should eq(key) + end + end + + it "should return a maximum level of 200" do + Partyhat::Util.experience_to_level(500_000_000_000).should eq(200) end end
Test coverage back to 100%
diff --git a/lib/epub/book.rb b/lib/epub/book.rb index abc1234..def5678 100644 --- a/lib/epub/book.rb +++ b/lib/epub/book.rb @@ -10,7 +10,8 @@ def manifest end - def spine + def each_page_by_spine + @package.spine.items end def toc @@ -22,8 +23,9 @@ def other_navigation end - def rootfile - @container.rootfile.full_path + # Syntax suger + def rootfile_path + ocf.container.rootfile.full_path end end end
Add tiny methods to EPUB::Book
diff --git a/lib/fewer/app.rb b/lib/fewer/app.rb index abc1234..def5678 100644 --- a/lib/fewer/app.rb +++ b/lib/fewer/app.rb @@ -23,18 +23,21 @@ end def call(env) - names = names_from_path(env['PATH_INFO']) - engine = engine_klass.new(root, names) + eng = engine(names_from_path(env['PATH_INFO'])) headers = { - 'Content-Type' => engine.content_type, + 'Content-Type' => eng.content_type, 'Cache-Control' => "public, max-age=#{cache}" } - [200, headers, [engine.read]] + [200, headers, [eng.read]] rescue Fewer::MissingSourceFileError => e [404, { 'Content-Type' => 'text/plain' }, [e.message]] rescue => e [500, { 'Content-Type' => 'text/plain' }, ["#{e.class}: #{e.message}"]] + end + + def engine(names) + engine_klass.new(root, names) end private
Add method to fetch instantiated engine directly from App.
diff --git a/spec/luchadeer_spec.rb b/spec/luchadeer_spec.rb index abc1234..def5678 100644 --- a/spec/luchadeer_spec.rb +++ b/spec/luchadeer_spec.rb @@ -0,0 +1,24 @@+require 'spec_helper' + +describe Luchadeer do + let(:api_key) { 'VinnCo' } + + describe '.configure' do + it 'returns a Luchadeer::Client' do + expect(described_class.configure).to be_instance_of Luchadeer::Client + end + + it 'passes opts hash to the new client' do + hash = { api_key: api_key } + + expect(described_class.configure(hash).api_key).to eq api_key + end + + it 'passes the given block to the new client' do + proc = Proc.new { |c| c.api_key = api_key } + + expect(described_class.configure(&proc).api_key).to eq api_key + end + end + +end
Add missing specs for Luchadeer.configure
diff --git a/Casks/handbrakecli-nightly.rb b/Casks/handbrakecli-nightly.rb index abc1234..def5678 100644 --- a/Casks/handbrakecli-nightly.rb +++ b/Casks/handbrakecli-nightly.rb @@ -1,6 +1,6 @@ cask :v1 => 'handbrakecli-nightly' do - version '6985svn' - sha256 'c2dd1a1c94dff36b74bbabea48d0361666208b94b305aa0e9b87aa182b6af989' + version '7010svn' + sha256 '1ab548fe2c78fa8115736e0c26091283e2ab990825385012bf652ce3803322ac' url "http://download.handbrake.fr/nightly/HandBrake-#{version}-MacOSX.6_CLI_x86_64.dmg" homepage 'http://handbrake.fr'
Update HandbrakeCLI Nightly to v7010svn HandBrakeCLI Nightly v7010svn built 2015-03-25.
diff --git a/lib/sub_diff/differ.rb b/lib/sub_diff/differ.rb index abc1234..def5678 100644 --- a/lib/sub_diff/differ.rb +++ b/lib/sub_diff/differ.rb @@ -4,10 +4,10 @@ # # The payload contains: # - # match - the string segment matching the search. - # prefix - the string segment preceding the match. - # suffix - the string segment trailing the match. - # replacement - the string segment replacing the match. + # match - the string matching the search. + # prefix - the string preceding the match. + # suffix - the string trailing the match. + # replacement - the string replacing the match. # # This class uses some special global variables: $` and $'. # See http://ruby-doc.org/core-2.2.0/doc/globals_rdoc.html
Remove multiple references to "segment" in docs
diff --git a/lib/tasks/migrate.rake b/lib/tasks/migrate.rake index abc1234..def5678 100644 --- a/lib/tasks/migrate.rake +++ b/lib/tasks/migrate.rake @@ -1,4 +1,9 @@ namespace :migrate do + task :swap_old_tag_uniqueness_index do + Tag.collection.drop_index('tag_id_1') # this is the generated name for the unique index of tags by tag_id + Tag.collection.create_index([ [:tag_id, Mongo::ASCENDING], [:tag_type, Mongo::ASCENDING] ], unique: true) + end + desc "Sets the businesslink legacy source on all business proposition content" task :set_businesslink_tag_on_buisiness_artefacts => :environment do Artefact.observers.disable :update_search_observer, :update_router_observer do
Update the unique index on tags Previously we required Tag#tag_id to be unique across all tags, but actually it should be unique within the scope of a given tag_type.
diff --git a/app/models/contractor.rb b/app/models/contractor.rb index abc1234..def5678 100644 --- a/app/models/contractor.rb +++ b/app/models/contractor.rb @@ -26,10 +26,6 @@ end def corporate_id - if acn.present? - acn - else - abn - end + acn.present? ? acn : abn end end
Use shorthand syntax to simplify code (refactor only)
diff --git a/AreaMetricsSDK.podspec b/AreaMetricsSDK.podspec index abc1234..def5678 100644 --- a/AreaMetricsSDK.podspec +++ b/AreaMetricsSDK.podspec @@ -6,6 +6,7 @@ s.author = { "AreaMetrics, Inc." => "engineering@areametrics.com" } s.platform = :ios, "7.0" s.source = { :git => "https://github.com/AreaMetrics/iOS-SDK.git", :tag => "v2.2.199" } + s.source_files = 'AreaMetricsSDK.framework/Versions/A/Headers/*.h' s.preserve_paths = 'AreaMetricsSDK.framework' s.vendored_frameworks = 'AreaMetricsSDK.framework' s.public_header_files = 'AreaMetricsSDK.framework/Versions/A/Headers/*.h'
Add source_files line to podspec
diff --git a/spec/models/attachment_spec.rb b/spec/models/attachment_spec.rb index abc1234..def5678 100644 --- a/spec/models/attachment_spec.rb +++ b/spec/models/attachment_spec.rb @@ -4,10 +4,6 @@ it { should belong_to(:object) } it { should validate_presence_of(:file) } - - it "show the avaible codes" do - Attachment.codes.should eq([['Brief-Template', 'Prawn::LetterDocument']]) - end context "when new" do specify { should_not be_valid }
Remove a test on an old test for the attribute code.
diff --git a/spec/parser/token_list_spec.rb b/spec/parser/token_list_spec.rb index abc1234..def5678 100644 --- a/spec/parser/token_list_spec.rb +++ b/spec/parser/token_list_spec.rb @@ -25,4 +25,9 @@ it "should not accept any other input" do lambda { TokenList.new(:notcode) }.should raise_error(ArgumentError) end + + it "should not interpolate string data" do + x = TokenList.new('x = "hello #{world}"') + x.to_s.should == 'x = "hello #{world}"' + "\n" + end end
Make sure string data is not parsed out
diff --git a/spec/recipes/ec2_hints_spec.rb b/spec/recipes/ec2_hints_spec.rb index abc1234..def5678 100644 --- a/spec/recipes/ec2_hints_spec.rb +++ b/spec/recipes/ec2_hints_spec.rb @@ -3,12 +3,8 @@ describe 'aws::ec2_hints' do let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) } - it 'sets up the directory' do - expect(chef_run).to create_directory('/etc/chef/ohai/hints').at_compile_time - end - it 'adds the hint file' do - expect(chef_run).to create_file('/etc/chef/ohai/hints/ec2.json').at_compile_time + expect(chef_run).to create_ohai_hint('ec2').at_compile_time end it 'reloads ohai' do
Test for an ohai_hint resource