diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/lib/all_seeing_pi/uploader.rb b/lib/all_seeing_pi/uploader.rb index abc1234..def5678 100644 --- a/lib/all_seeing_pi/uploader.rb +++ b/lib/all_seeing_pi/uploader.rb @@ -27,7 +27,7 @@ def fetch_or_create_directory_name(directories) directory_name = directories.map do |directory| key = directory.key - key if key.match /all_seeing_pi/ + key if key.match /#{DIRECTORY_PREFIX}/ end.compact.first AllSeeingPi.config[:directory_name] ||= "#{DIRECTORY_PREFIX}-#{directory_id}"
Use directory prefix to find existing directory.
diff --git a/lib/roger_scsslint/generator.rb b/lib/roger_scsslint/generator.rb index abc1234..def5678 100644 --- a/lib/roger_scsslint/generator.rb +++ b/lib/roger_scsslint/generator.rb @@ -1,9 +1,4 @@ require 'open-uri' - -# <- hekje -module Roger - module Cli; end -end require 'roger/cli/generate' require 'roger/cli/command'
Remove hack after fix landed in DigitPaint/roger/pull/5 Making pull request for roger to fix this hack over here, patch will need to wait on roger update
diff --git a/app/models/assignment.rb b/app/models/assignment.rb index abc1234..def5678 100644 --- a/app/models/assignment.rb +++ b/app/models/assignment.rb @@ -6,8 +6,10 @@ def submit(project_id, comments) proj = Project.find(project_id) subCopy = proj.dup - subCopy.last_modified = proj.last_modified + subCopy.last_modified = Time.now subCopy.read_only = true + subCopy.submitted = true + subCopy.title += " --Submitted: #{Time.now}--" subCopy.save Submission.create(title: subCopy.title, assignment_id: assignment_id, comments: comments, project_id: subCopy.id) end
Change the time and title for submission creation
diff --git a/app/models/collection.rb b/app/models/collection.rb index abc1234..def5678 100644 --- a/app/models/collection.rb +++ b/app/models/collection.rb @@ -1,5 +1,7 @@ class Collection < ActiveFedora::Base include Hydra::Collection + # override the default Hydra properties so we don't get a prefix deprecation warning. + has_metadata "properties", type: Worthwhile::PropertiesDatastream include CurationConcern::CollectionModel include Hydra::Collections::Collectible
Use the local properties datastream to avoid a deprecation warning
diff --git a/lib/scss_lint/linter/comment.rb b/lib/scss_lint/linter/comment.rb index abc1234..def5678 100644 --- a/lib/scss_lint/linter/comment.rb +++ b/lib/scss_lint/linter/comment.rb @@ -4,11 +4,7 @@ include LinterRegistry def visit_comment(node) - add_lint(node) unless node.invisible? - end - - def description - 'Use // comments everywhere' + add_lint(node, 'Use `//` comments everywhere') unless node.invisible? end end end
Remove description method from Comment linter This was unnecessary and is being deprecated. Change-Id: Ie53665206f3769152f61b78c2fef2ff78f3d9334 Reviewed-on: http://gerrit.causes.com/36720 Tested-by: jenkins <d95b56ce41a2e1ac4cecdd398defd7414407cc08@causes.com> Reviewed-by: Shane da Silva <6f6e68d1df92f30cb4b3ce35260ddf94a402f33d@causes.com>
diff --git a/lib/text_tunnel/watched_file.rb b/lib/text_tunnel/watched_file.rb index abc1234..def5678 100644 --- a/lib/text_tunnel/watched_file.rb +++ b/lib/text_tunnel/watched_file.rb @@ -42,6 +42,6 @@ end def sanitize_name(name) - name.gsub(/[^a-zA-Z0-9-_. ]/, "").strip + name.gsub(/[^a-zA-Z0-9\-_. ]/, "").strip end end
Fix unescaped hyphen in regex character class
diff --git a/lib/kaminari-cells.rb b/lib/kaminari-cells.rb index abc1234..def5678 100644 --- a/lib/kaminari-cells.rb +++ b/lib/kaminari-cells.rb @@ -1,12 +1,12 @@ require "cells" -require "kaminari" +require "kaminari/helpers/helper_methods" require "kaminari/cells/version" require "cell/partial" module Kaminari module Helpers module CellsHelper - include Kaminari::ActionViewExtension + include Kaminari::Helpers::HelperMethods include ActionView::Helpers::OutputSafetyHelper include ActionView::Helpers::TranslationHelper include Cell::ViewModel::Partial @@ -19,4 +19,4 @@ end end -require 'kaminari/cells'+require 'kaminari/cells'
Change included Kaminari helper module for Kaminari 1.0.0 compatibility
diff --git a/lib/gazouillis/user_stream.rb b/lib/gazouillis/user_stream.rb index abc1234..def5678 100644 --- a/lib/gazouillis/user_stream.rb +++ b/lib/gazouillis/user_stream.rb @@ -1,13 +1,15 @@ # encoding: utf-8 module Gazouillis - # This class concern is to handle stream connections. + # This class concern is to handle connections to_user_stream. # class UserStream < Stream + API_VERSION = "1.1" + def initialize(opts) opts.merge!({ host: "userstream.twitter.com" }) - super "/1.1/user.json", opts + super "/#{API_VERSION}/user.json", opts end end end
Store twitter's api version in constant Signed-off-by: chatgris <f9469d12bf3d131e7aae80be27ccfe58aa9db1f1@af83.com>
diff --git a/lib/git_pissed/formats/csv.rb b/lib/git_pissed/formats/csv.rb index abc1234..def5678 100644 --- a/lib/git_pissed/formats/csv.rb +++ b/lib/git_pissed/formats/csv.rb @@ -9,7 +9,7 @@ end def table - [["date", *options.words].join(',')].tap do |table| + [["date", *words_by_date[0][1].keys].join(',')].tap do |table| words_by_date.each do |date, words| table << [date, *words.values].join(',') end
Fix word ordering in CSV (and HTML) output The problem is that the options word order may not correspond to the words_by_date word order. So for safety, we extract the words directly from words_by_date rather than relying on the options values.
diff --git a/lib/scorebutt.rb b/lib/scorebutt.rb index abc1234..def5678 100644 --- a/lib/scorebutt.rb +++ b/lib/scorebutt.rb @@ -23,13 +23,13 @@ start_time = Time.now counter=0 and loop do + puts "\n #{Time.now.strftime("%k:%M:%S")} ------------------------------------------------------------------------\n" counter+=1 watchees.get_blocks.each do |watcher| # Watcher is a proc, so run it puts watcher.call end sleep self.sleep_time - puts "\n\n\n\n\n\n\n\n\n\n\n\n" end rescue SystemExit, Interrupt # From SIGINT
Add timestamp for each check
diff --git a/common_lips.gemspec b/common_lips.gemspec index abc1234..def5678 100644 --- a/common_lips.gemspec +++ b/common_lips.gemspec @@ -1,7 +1,7 @@ # coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require 'common_lips/version' +require 'common_lips' Gem::Specification.new do |spec| spec.name = "common_lips"
Fix the require call for the removed version.rb file
diff --git a/lib/j7w1/active_record_ext.rb b/lib/j7w1/active_record_ext.rb index abc1234..def5678 100644 --- a/lib/j7w1/active_record_ext.rb +++ b/lib/j7w1/active_record_ext.rb @@ -34,6 +34,10 @@ device.push! options end end + + def set_badge(count = 0) + push!(badge: count) + end end end end
Add set_badge to set/reset badge count.
diff --git a/lib/skyed/git.rb b/lib/skyed/git.rb index abc1234..def5678 100644 --- a/lib/skyed/git.rb +++ b/lib/skyed/git.rb @@ -9,12 +9,12 @@ unless Skyed::Settings.current_stack?(stack[:stack_id]) Skyed::Init.opsworks_git_key options end - puts "PKEY is: #{ENV['PKEY']}" ENV['PKEY'] ||= Skyed::Settings.opsworks_git_key Skyed::Utils.create_template('/tmp', 'ssh-git', 'ssh-git.erb', 0755) ENV['GIT_SSH'] = '/tmp/ssh-git' path = "/tmp/skyed.#{SecureRandom.hex}" - ::Git.clone(stack[:custom_cookbooks_source][:url], path) + r = ::Git.clone(stack[:custom_cookbooks_source][:url], path) + puts r.status path end end
INF-941: Add check if remore is cloned
diff --git a/lib/rails_invitable/engine.rb b/lib/rails_invitable/engine.rb index abc1234..def5678 100644 --- a/lib/rails_invitable/engine.rb +++ b/lib/rails_invitable/engine.rb @@ -1,4 +1,5 @@ require 'pundit' +require 'jsonapi/rails' module RailsInvitable class Engine < ::Rails::Engine
Fix the json api require problem
diff --git a/lib/unshorten.rb b/lib/unshorten.rb index abc1234..def5678 100644 --- a/lib/unshorten.rb +++ b/lib/unshorten.rb @@ -2,6 +2,9 @@ class << self def unshorten(url, options = {}) + httpcheck = url.split('http://') + httpscheck = url.split('https://') + return url if httpcheck.count == 0 || httpscheck.count == 0 uri_str = URI.encode(url) uri = URI.parse(url) rescue nil return url if uri.nil? @@ -11,6 +14,7 @@ if result && !result.nil? && result.header_str && !result.header_str.nil? && result.header_str.split('Location: ').count > 1 return result.header_str.split('Location: ')[1].split(' ')[0] end + return url end alias :'[]' :unshorten end
Fix the check for bad url
diff --git a/lib/app/presenters/workload.rb b/lib/app/presenters/workload.rb index abc1234..def5678 100644 --- a/lib/app/presenters/workload.rb +++ b/lib/app/presenters/workload.rb @@ -39,7 +39,7 @@ when 'no-nits' scope = scope.where(nit_count: 0) else - scope = pending.where(slug: slug) + scope = scope.where(slug: slug) end unless user.mastery.include?(language) @@ -63,4 +63,4 @@ def pending @pending ||= Submission.pending.where(language: language).unmuted_for(user) end -end+end
Sort pending submissions in ascending order.
diff --git a/lib/atheme/parsers/chanserv.rb b/lib/atheme/parsers/chanserv.rb index abc1234..def5678 100644 --- a/lib/atheme/parsers/chanserv.rb +++ b/lib/atheme/parsers/chanserv.rb @@ -12,4 +12,20 @@ raw_services_output.match(/Successor\s+:\s+\(none\)/) ? nil : match(/Successor\s+:\s+(\w+)/) end end + + parse :list do + command :to_a do + output = raw_services_output.split("\n") + output.delete_at(0) + output.delete_at(output.length - 1) + + output.map do |info| + out = info.sub('- ', '').split('(') + channel = out[0].sub(' ', '') + owner = out[1].sub(')', '').sub(' ', '') + + { channel: channel, owner: owner } + end + end + end end
Add ChanServ.list.to_a - which returns an array of hashes with channel and owner
diff --git a/lib/chassis/repo/delegation.rb b/lib/chassis/repo/delegation.rb index abc1234..def5678 100644 --- a/lib/chassis/repo/delegation.rb +++ b/lib/chassis/repo/delegation.rb @@ -2,52 +2,56 @@ class Repo module Delegation def all - Repo.instance.all object_class + backend.all object_class end def count - Repo.instance.count object_class + backend.count object_class end def find(id) - Repo.instance.find object_class, id + backend.find object_class, id end def save(record) - Repo.instance.save(record) + backend.save(record) end def delete(record) - Repo.instance.delete record + backend.delete record end def first - Repo.instance.first object_class + backend.first object_class end def last - Repo.instance.last object_class + backend.last object_class end def query(selector) - Repo.instance.query object_class, selector + backend.query object_class, selector end def sample - Repo.instance.sample object_class + backend.sample object_class end def graph(id) - Repo.instance.graph object_class, id + backend.graph object_class, id end def graph_query(selector) - Repo.instance.graph_query object_class, selector + backend.graph_query object_class, selector end def object_class @object_class ||= self.to_s.match(/^(.+)Repo/)[1].constantize end + + def backend + Repo.instance + end end end end
Allow repos to use custom backends
diff --git a/jquery-rails.gemspec b/jquery-rails.gemspec index abc1234..def5678 100644 --- a/jquery-rails.gemspec +++ b/jquery-rails.gemspec @@ -8,8 +8,8 @@ s.authors = ["André Arko"] s.email = ["andre@arko.net"] s.homepage = "http://rubygems.org/gems/jquery-rails" - s.summary = "Use jQuery with Rails 3" - s.description = "This gem provides jQuery and the jQuery-ujs driver for your Rails 3 application." + s.summary = "Use jQuery with Rails 3+" + s.description = "This gem provides jQuery and the jQuery-ujs driver for your Rails 3+ application." s.license = "MIT" s.required_rubygems_version = ">= 1.3.6"
Update gemspec to reflect Rails 4 compatibility
diff --git a/lib/whenever/setup.rb b/lib/whenever/setup.rb index abc1234..def5678 100644 --- a/lib/whenever/setup.rb +++ b/lib/whenever/setup.rb @@ -10,12 +10,12 @@ set :job_template, "/bin/bash -l -c ':job'" set :runner_command, case + when Whenever.bundler? + "bundle exec rails runner" when Whenever.bin_rails? "bin/rails runner" when Whenever.script_rails? "script/rails runner" - when Whenever.bundler? - "bundle exec rails runner" else "script/runner" end
Move bundler priority to top
diff --git a/lib/gitlab_access.rb b/lib/gitlab_access.rb index abc1234..def5678 100644 --- a/lib/gitlab_access.rb +++ b/lib/gitlab_access.rb @@ -10,7 +10,8 @@ def initialize(repo_path, actor, changes) @config = GitlabConfig.new - @repo_path, @actor = repo_path.strip, actor + @repo_path = repo_path.strip + @actor = actor @repo_name = extract_repo_name(@repo_path.dup, config.repos_path.to_s) @changes = changes.lines end
Split one instance variable per line
diff --git a/lib/hatchet/tasks.rb b/lib/hatchet/tasks.rb index abc1234..def5678 100644 --- a/lib/hatchet/tasks.rb +++ b/lib/hatchet/tasks.rb @@ -1,6 +1,6 @@ namespace :hatchet do task :setup_ci do - script = File.expand_path = File.join(__dir__, "../../etc/ci_setup.rb") + script = File.expand_path(File.join(__dir__, "../../etc/ci_setup.rb")) out = `#{script}` raise "Command #{script.inspect} failed\n#{out}" end
Fix syntax, how did this even work before?
diff --git a/lib/tasks/check_clean_db.rake b/lib/tasks/check_clean_db.rake index abc1234..def5678 100644 --- a/lib/tasks/check_clean_db.rake +++ b/lib/tasks/check_clean_db.rake @@ -6,6 +6,7 @@ Team.all.each do |t| t.reset_slack_notifications_enabled t.reset_slack_webhook + t.private = false t.save end # config/cleandb_exceptions.yml is an array of emails that should not be cleaned up.
Reset private flag on database cleanup
diff --git a/lib/tasks/mnemosyne/clean.rake b/lib/tasks/mnemosyne/clean.rake index abc1234..def5678 100644 --- a/lib/tasks/mnemosyne/clean.rake +++ b/lib/tasks/mnemosyne/clean.rake @@ -19,9 +19,9 @@ end ActiveRecord::Base.connection.execute <<~SQL - SELECT _timescaledb_internal.drop_chunks_older_than(#{cutoff}, 'traces', NULL); - SELECT _timescaledb_internal.drop_chunks_older_than(#{cutoff}, 'spans', NULL); - SELECT _timescaledb_internal.drop_chunks_older_than(#{cutoff}, 'failures', NULL); + SELECT drop_chunks(#{cutoff}, 'traces', NULL); + SELECT drop_chunks(#{cutoff}, 'spans', NULL); + SELECT drop_chunks(#{cutoff}, 'failures', NULL); SQL logger.info do
Use new drop_chunks(INTEGER) function from timescaledb 0.6
diff --git a/lib/tasks/stagehand_tasks.rake b/lib/tasks/stagehand_tasks.rake index abc1234..def5678 100644 --- a/lib/tasks/stagehand_tasks.rake +++ b/lib/tasks/stagehand_tasks.rake @@ -1,4 +1,6 @@-# desc "Explaining what the task does" -# task :stagehand do -# # Task goes here -# end +namespace :stagehand do + desc "Explaining what the task does" + task :auto_sync, [:delay] => :environment do |t, args| + Stagehand::Staging::Synchronizer.auto_sync(args[:delay] ||= 5.seconds) + end +end
Add a rake task for auto syncing
diff --git a/lib/tasks/ridgepole_rake.rake b/lib/tasks/ridgepole_rake.rake index abc1234..def5678 100644 --- a/lib/tasks/ridgepole_rake.rake +++ b/lib/tasks/ridgepole_rake.rake @@ -32,15 +32,17 @@ RidgepoleRake::Tasks.export end - desc '`rake db:drop`, `rake db:create` and `ridgepole --apply`' - task reset: :environment do - ActiveRecord::Tasks::DatabaseTasks.drop_current - ActiveRecord::Tasks::DatabaseTasks.create_current - RidgepoleRake::Tasks.apply - end - desc 'diff current db schema and current schema file' task diff: :environment do RidgepoleRake::Tasks.diff end + + if defined?(ActiveRecord) + desc '`rake db:drop`, `rake db:create` and `ridgepole --apply`' + task reset: :environment do + ActiveRecord::Tasks::DatabaseTasks.drop_current + ActiveRecord::Tasks::DatabaseTasks.create_current + RidgepoleRake::Tasks.apply + end + end end
Add the condition of loaded ActiveRecord
diff --git a/lib/users/gateways/gateway.rb b/lib/users/gateways/gateway.rb index abc1234..def5678 100644 --- a/lib/users/gateways/gateway.rb +++ b/lib/users/gateways/gateway.rb @@ -1,4 +1,3 @@-require 'persistence' require 'json' module Users
Remove unnecessary (?) persistence requirement
diff --git a/kumo_ki.gemspec b/kumo_ki.gemspec index abc1234..def5678 100644 --- a/kumo_ki.gemspec +++ b/kumo_ki.gemspec @@ -20,7 +20,7 @@ spec.add_development_dependency 'rake', '~> 10.0' spec.add_development_dependency 'rspec', '~> 3.0' - spec.add_development_dependency 'rubocop', '~> 0.40' + spec.add_development_dependency 'rubocop', '~> 0.49' spec.add_runtime_dependency 'aws-sdk-kms', '~> 1' end
Update rubocop to fix vulnerability
diff --git a/vim-flavor.gemspec b/vim-flavor.gemspec index abc1234..def5678 100644 --- a/vim-flavor.gemspec +++ b/vim-flavor.gemspec @@ -24,5 +24,6 @@ spec.add_development_dependency('aruba', '~> 0.14') spec.add_development_dependency('cucumber', '~> 3.1') spec.add_development_dependency('pry') + spec.add_development_dependency('relish', '~> 0.7') spec.add_development_dependency('rspec', '~> 3.7') end
Declare relish as a development dependency
diff --git a/lib/pulitzer.rb b/lib/pulitzer.rb index abc1234..def5678 100644 --- a/lib/pulitzer.rb +++ b/lib/pulitzer.rb @@ -14,7 +14,7 @@ @@base_controller = base_controller_name.constantize @@metadata_closure = options[:metadata_authorization] @@authentication_closure = options[:authentication] - @@tagging_models = options[:tagging_models] + @@tagging_models = options[:tagging_models] || [] @@layout = options[:layout] || 'application' end
Set taggins_models default to empty array
diff --git a/lib/ruby_dig.rb b/lib/ruby_dig.rb index abc1234..def5678 100644 --- a/lib/ruby_dig.rb +++ b/lib/ruby_dig.rb @@ -11,12 +11,10 @@ end end -_ = Array class Array include RubyDig end -_ = Hash class Hash include RubyDig end
Remove unnecessary _ = ...
diff --git a/lib/sastrawi.rb b/lib/sastrawi.rb index abc1234..def5678 100644 --- a/lib/sastrawi.rb +++ b/lib/sastrawi.rb @@ -1,5 +1,12 @@-require "sastrawi/version" +require 'sastrawi/version' + +require 'sastrawi/stemmer/stemmer_factory' module Sastrawi - # TODO: Main section of sastrawi + def self.stem(sentence) + stemmer_factory = Sastrawi::Stemmer::StemmerFactory.new + stemmer = stemmer_factory.create_stemmer + + puts stemmer.stem(sentence) + end end
Add interface to stem words
diff --git a/app/controllers/api/json/users_controller.rb b/app/controllers/api/json/users_controller.rb index abc1234..def5678 100644 --- a/app/controllers/api/json/users_controller.rb +++ b/app/controllers/api/json/users_controller.rb @@ -1,4 +1,5 @@ class Api::Json::UsersController < Api::ApplicationController + skip_before_filter :api_authorization_required, only: [:get_authenticated_users] if Rails.env.production? || Rails.env.staging? ssl_required :show @@ -6,11 +7,11 @@ def show user = current_user - render :json => user.data + render json: user.data end def get_authenticated_users - render :json => request.session.select {|k,v| k.start_with?("warden.user")}.values + render json: request.session.select {|k,v| k.start_with?("warden.user")}.values end end
Fix on users controller auth
diff --git a/test/models/base_model_test.rb b/test/models/base_model_test.rb index abc1234..def5678 100644 --- a/test/models/base_model_test.rb +++ b/test/models/base_model_test.rb @@ -7,16 +7,23 @@ end class BaseModelTest < MiniTest::Unit::TestCase + def setup + @foo = :foo + @bar_baz = :bar_baz + @qux = :qux + data_hash = { foo: @foo, barBaz: @bar_baz, qux: @qux } + @test_model = TestModel.new(data_hash) + end + def test_initialize_sets_proper_attributes - foo = :foo - bar_baz = :bar_baz - qux = :qux - data_hash = { foo: foo, barBaz: bar_baz, qux: qux } - test_model = TestModel.new(data_hash) + assert_equal(@test_model.foo, @foo) + assert_equal(@test_model.bar_baz, @bar_baz) + assert_equal(@test_model.qux, @qux) + end - assert_equal(test_model.foo, foo) - assert_equal(test_model.bar_baz, bar_baz) - assert_equal(test_model.qux, qux) + def test_to_h + expected_hash = { 'foo' => @foo, 'bar_baz' => @bar_baz, 'qux' => @qux } + assert_equal(@test_model.to_h, expected_hash) end end end
Test to_h method for base model
diff --git a/with_model.gemspec b/with_model.gemspec index abc1234..def5678 100644 --- a/with_model.gemspec +++ b/with_model.gemspec @@ -6,7 +6,7 @@ spec.name = 'with_model' spec.version = WithModel::VERSION spec.authors = ['Case Commons, LLC', 'Grant Hutchins'] - spec.email = ['casecommons-dev@googlegroups.com', 'gems@nertzy.com'] + spec.email = ['casecommons-dev@googlegroups.com', 'gems@nertzy.com', 'andrew@johnandrewmarshall.com'] spec.homepage = 'https://github.com/Casecommons/with_model' spec.summary = %q(Dynamically build a model within an RSpec context) spec.description = spec.summary
Add me as an owner
diff --git a/app/workers/assign_recommendations_worker.rb b/app/workers/assign_recommendations_worker.rb index abc1234..def5678 100644 --- a/app/workers/assign_recommendations_worker.rb +++ b/app/workers/assign_recommendations_worker.rb @@ -5,6 +5,6 @@ teacher = User.find(teacher_id) analytics = AssignRecommendationsAnalytics.new - analytics.track_activity_assignment(teacher) + analytics.track(teacher) end end
Fix no method error in segment worker.
diff --git a/lib/tasks/check.rake b/lib/tasks/check.rake index abc1234..def5678 100644 --- a/lib/tasks/check.rake +++ b/lib/tasks/check.rake @@ -7,6 +7,8 @@ # Call the AussieDetector aussieDetector = OriginDetector::AussieDetector.new("#{Rails.root}/Gemfile") config = Bruce::Config.new - config.save(aussieDetector.how_australian?) # Save into config/bruce_output.yml + result = aussieDetector.how_australian? + config.save(result) # Save into config/bruce_output.yml + puts result end end
Print the result after doing the rake task
diff --git a/lib/tasks/users.rake b/lib/tasks/users.rake index abc1234..def5678 100644 --- a/lib/tasks/users.rake +++ b/lib/tasks/users.rake @@ -2,6 +2,6 @@ desc 'Update the training data for all users' task update_users: "batch:setup_logger" do Rails.logger.debug 'Updating user names, global ids, and training status' - User.update_users + UserImporter.update_users end end
Fix broken reference in update task
diff --git a/lib/akephalos/console.rb b/lib/akephalos/console.rb index abc1234..def5678 100644 --- a/lib/akephalos/console.rb +++ b/lib/akephalos/console.rb @@ -1,5 +1,5 @@ def session - Capybara.app_host = "http://localhost:8070" + Capybara.app_host = "http://localhost:3000" @session ||= Capybara::Session.new(:Akephalos) end alias page session
Set app_host to localhost:3000 in interactive mode
diff --git a/lib/docs/scrapers/vue.rb b/lib/docs/scrapers/vue.rb index abc1234..def5678 100644 --- a/lib/docs/scrapers/vue.rb +++ b/lib/docs/scrapers/vue.rb @@ -3,8 +3,6 @@ self.name = 'Vue.js' self.slug = 'vue' self.type = 'vue' - self.release = '1.0.24' - self.base_url = 'https://vuejs.org' self.root_path = '/guide/index.html' self.initial_paths = %w(/api/index.html) self.links = { @@ -20,5 +18,15 @@ &copy; 2013&ndash;2016 Evan You, Vue.js contributors<br> Licensed under the MIT License. HTML + + version '2' do + self.release = '2.0.1' + self.base_url = 'https://vuejs.org' + end + + version '1' do + self.release = '1.0.27' + self.base_url = 'https://v1.vuejs.org' + end end end
Update Vue.js documentation (2.0.1, 1.0.27)
diff --git a/lib/git/release_notes.rb b/lib/git/release_notes.rb index abc1234..def5678 100644 --- a/lib/git/release_notes.rb +++ b/lib/git/release_notes.rb @@ -16,7 +16,10 @@ start_index.upto(end_index-1) do |i| start = tags[i] finish = tags[i+1] - log = `git log --no-merges --pretty=format:"%h %s" #{'refs/tags/' + finish + '..' if finish}refs/tags/#{start}`.strip + range = '' + range << "refs/tags/#{finish}.." if finish # log until end tag if there is an end tag + range << "refs/tags/#{start}" + log = `git log --no-merges --pretty=format:"%h %s" #{range}`.strip next if log.empty? puts "#{start}" puts "=" * start.length
Break out range logic to be more readable
diff --git a/checkin-service/spec/models/location_spec.rb b/checkin-service/spec/models/location_spec.rb index abc1234..def5678 100644 --- a/checkin-service/spec/models/location_spec.rb +++ b/checkin-service/spec/models/location_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Location do -let(:store) { Location.new(name: "711") } +let(:store) { Location.new(store_name: "711") } it 'can be created' do location = create :location
Fix second typo for store_name in location spec file
diff --git a/lib/tasks/reporting.rake b/lib/tasks/reporting.rake index abc1234..def5678 100644 --- a/lib/tasks/reporting.rake +++ b/lib/tasks/reporting.rake @@ -4,6 +4,6 @@ desc "Send a daily system report email to confguired recpients" task send_daily_summary_email: :environment do recipents = Array(ENV.fetch("DAILY_REPORT_EMAIL_RECIPIENTS", "dev@airslie.com").split(",")) - Renalware::Reporting::ReportMailer.daily_summary(to: recipents) + Renalware::Reporting::ReportMailer.daily_summary(to: recipents).deliver_now end end
Fix non-delivery of daily summary emails
diff --git a/lib/trackler/problems.rb b/lib/trackler/problems.rb index abc1234..def5678 100644 --- a/lib/trackler/problems.rb +++ b/lib/trackler/problems.rb @@ -9,7 +9,7 @@ end def each - valid.each do |problem| + active.each do |problem| yield problem end end @@ -25,8 +25,8 @@ private - def valid - @valid ||= all.select(&:active?) + def active + @active ||= all.select(&:active?) end def all @@ -43,7 +43,7 @@ def problem_map hash = Hash.new { |_, k| Problem.new(k, root) } - valid.each do |problem| + active.each do |problem| hash[problem.slug] = problem end hash
Rename private method 'valid' to 'active'
diff --git a/Casks/baiduinput.rb b/Casks/baiduinput.rb index abc1234..def5678 100644 --- a/Casks/baiduinput.rb +++ b/Casks/baiduinput.rb @@ -1,9 +1,9 @@ # encoding: UTF-8 class Baiduinput < Cask - version '3.2_1000e' - sha256 'a8599116bb9248a06b7a26f7be73061cb00263263fe685cb0b7c6c99fce6cf56' + version '3.3_1000e' + sha256 '57d50c7991e0d833ed5b34297168745590074d838f6948469dbaf8b92a84e082' - url 'http://wuxian.baidu.com/download/1000e/baiduinput_mac_v3.2_1000e.dmg' + url "http://wuxian.baidu.com/download/1000e/baiduinput_mac_v#{version}.dmg" homepage 'http://wuxian.baidu.com/input/mac.html' install '安装百度输入法.pkg'
Upgrade Baidu Input Method to v3.3_1000e
diff --git a/config/software/sysstat.rb b/config/software/sysstat.rb index abc1234..def5678 100644 --- a/config/software/sysstat.rb +++ b/config/software/sysstat.rb @@ -0,0 +1,23 @@+name "sysstat" +default_version "10.2.1" + +source :url => "http://pagesperso-orange.fr/sebastien.godard/sysstat-10.2.1.tar.gz", + :md5 => "039dcd235dfcfb3d4acc0a05730f9512" + +relative_path 'sysstat-10.2.1' + +env = { + "LDFLAGS" => "-L#{install_dir}/embedded/lib -I#{install_dir}/embedded/include", + "CFLAGS" => "-L#{install_dir}/embedded/lib -I#{install_dir}/embedded/include", + "LD_RUN_PATH" => "#{install_dir}/embedded/lib" +} + +build do + command(["./configure", + "--prefix=#{install_dir}/embedded", + "--disable-nls"].join(" "), + :env => env) + command "make -j #{max_build_jobs}", :env => {"LD_RUN_PATH" => "#{install_dir}/embedded/lib"} + command "sudo make install" + command "sudo chown -R vagrant #{install_dir}" +end
Add sys stat software def
diff --git a/Casks/omnidazzle.rb b/Casks/omnidazzle.rb index abc1234..def5678 100644 --- a/Casks/omnidazzle.rb +++ b/Casks/omnidazzle.rb @@ -4,8 +4,12 @@ url "http://downloads2.omnigroup.com/software/MacOSX/10.6/OmniDazzle-#{version}.dmg" name 'OmniDazzle' - homepage 'http://www.omnigroup.com/more' - license :unknown # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder + homepage 'https://support.omnigroup.com/omnidazzle-troubleshooting' + license :gratis app 'OmniDazzle.app' + + caveats do + discontinued + end end
Make OmniDazzle discontinued and add license. App was no longer listed on the old homepage. All edit infos come from the site now set as homepage.
diff --git a/Casks/onionshare.rb b/Casks/onionshare.rb index abc1234..def5678 100644 --- a/Casks/onionshare.rb +++ b/Casks/onionshare.rb @@ -2,6 +2,7 @@ version '0.9' sha256 '9142dcce2aa313e628432408ffcfbd9928ddd5d50b529a7701f4f9e75e6df9a4' + # github.com/micahflee/onionshare was verified as official when first introduced to the cask url "https://github.com/micahflee/onionshare/releases/download/v#{version}/OnionShare.pkg" appcast 'https://github.com/micahflee/onionshare/releases.atom', checkpoint: '388c9b60d7dd35c10ef53856d832055cf3de414387b6977ea782dcf011d67c6c'
Fix `url` stanza comment for OnionShare.
diff --git a/garufa.gemspec b/garufa.gemspec index abc1234..def5678 100644 --- a/garufa.gemspec +++ b/garufa.gemspec @@ -13,6 +13,7 @@ s.homepage = "http://github.com/Juanmcuello/garufa" s.bindir = 'bin' s.executables << 'garufa' + s.required_ruby_version = '>=1.9' s.files = Dir[ "LICENSE",
Add required ruby version to .gemspec
diff --git a/AIQJSBridge.podspec b/AIQJSBridge.podspec index abc1234..def5678 100644 --- a/AIQJSBridge.podspec +++ b/AIQJSBridge.podspec @@ -18,7 +18,7 @@ s.public_header_files = 'Pod/Classes/**/AIQ*.h' s.dependency 'AIQCoreLib', '~> 1.5.2' - s.dependency 'Google/Analytics', '1.1.0' + s.dependency 'Google/Analytics' s.subspec 'Cordova' do |ss| ss.source_files = 'Cordova/Classes/**/*'
Use newer version of Google Analytics
diff --git a/Casks/burp-suite.rb b/Casks/burp-suite.rb index abc1234..def5678 100644 --- a/Casks/burp-suite.rb +++ b/Casks/burp-suite.rb @@ -2,7 +2,7 @@ version '1.7.06' sha256 'ce2da473fdb65f4704ad6597dcd6615ec84e7a4c3c81deaf4f2de360d362a9bd' - url "https://portswigger.net/Burp/Releases/Download?productId=100&version=#{version.major_minor_patch}&type=MacOsx" + url "https://portswigger.net/Burp/Releases/Download?productId=100&version=#{version}&type=MacOsx" name 'Burp Suite' homepage 'https://portswigger.net/burp/'
Update the URL to use the shorter version syntax
diff --git a/Casks/coderunner.rb b/Casks/coderunner.rb index abc1234..def5678 100644 --- a/Casks/coderunner.rb +++ b/Casks/coderunner.rb @@ -0,0 +1,11 @@+cask :v1 => 'coderunner' do + version :latest + sha256 :no_check + + url "https://coderunnerapp.com/download" + name 'CodeRunner' + homepage 'https://coderunnerapp.com/' + license :unknown + + app 'CodeRunner.app' +end
Add CodeRunner at latest version I've set up this new cask to use the :latest as the main download URL will redirect to the appropriately versioned file. If it is preferable to use an explicit version I can change it to do so.
diff --git a/Formula/sshuttle.rb b/Formula/sshuttle.rb index abc1234..def5678 100644 --- a/Formula/sshuttle.rb +++ b/Formula/sshuttle.rb @@ -1,10 +1,10 @@ require 'formula' class Sshuttle <Formula - url 'https://github.com/apenwarr/sshuttle/tarball/sshuttle-0.43' + url 'https://github.com/apenwarr/sshuttle/tarball/sshuttle-0.43a' homepage 'https://github.com/apenwarr/sshuttle' - md5 '590352aa7cbaad90c8f46dab64b829f4' - version '0.43' + md5 '51c736b890b9a7fcfc731e82f4279638' + version '0.43a' head 'git://github.com/apenwarr/sshuttle.git'
Upgrade Sshuttle to 0.43a in order to fix a crash Signed-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>
diff --git a/react-native-contacts.podspec b/react-native-contacts.podspec index abc1234..def5678 100644 --- a/react-native-contacts.podspec +++ b/react-native-contacts.podspec @@ -12,6 +12,5 @@ s.platform = :ios, "9.0" s.source = { :git => package_json["repository"]["url"] } s.source_files = 'ios/RCTContacts/*.{h,m}' - s.dependency 'React' end
Remove deprecated React Pod dependency * fixes #261
diff --git a/messaging.gemspec b/messaging.gemspec index abc1234..def5678 100644 --- a/messaging.gemspec +++ b/messaging.gemspec @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = 'evt-messaging' - s.version = '2.5.7.0' + s.version = '2.5.8.0' s.summary = 'Common primitives for platform-specific messaging implementations for Eventide' s.description = ' '
Package version is increased from 2.5.7.0 to 2.5.8.0
diff --git a/rainman.gemspec b/rainman.gemspec index abc1234..def5678 100644 --- a/rainman.gemspec +++ b/rainman.gemspec @@ -4,8 +4,8 @@ Gem::Specification.new do |gem| gem.authors = ["Justin Mazzi"] gem.email = ["jmazzi@gmail.com"] - gem.description = %q{A library for abstracting drivers} - gem.summary = %q{A library for abstracting drivers} + gem.description = %q{A library for writing drivers using the abstract factory pattern} + gem.summary = %q{Rainman is an experiment in writing drivers and handlers. It is a Ruby implementation of the abstract factory pattern. Abstract factories provide the general API used to interact with any number of interfaces. Interfaces perform actual operations. Rainman provides a simple DSL for implementing this design.} gem.homepage = "http://www.eng5.com" gem.files = `git ls-files`.split("\n")
Add a better description and summary
diff --git a/sepa_king.gemspec b/sepa_king.gemspec index abc1234..def5678 100644 --- a/sepa_king.gemspec +++ b/sepa_king.gemspec @@ -14,7 +14,6 @@ s.license = 'MIT' s.files = `git ls-files`.split($/) - s.test_files = s.files.grep(%r{^(test|spec|features)/}) s.require_paths = ['lib'] s.required_ruby_version = '>= 2.6'
Drop unused directive from gemspec RubyGems.org are not using test_files for anything.
diff --git a/Casks/scratch.rb b/Casks/scratch.rb index abc1234..def5678 100644 --- a/Casks/scratch.rb +++ b/Casks/scratch.rb @@ -1,6 +1,6 @@ cask 'scratch' do - version '441.2' - sha256 '46cb9b5806bea0d0b6fc111eabc5f24b18226f437643ff8173a57a394492bba0' + version '442' + sha256 'f122355c34dbcfe9e8ab806dd1c7b0998af67d343a8352f320601e9be0b9e869' url "https://scratch.mit.edu/scratchr2/static/sa/Scratch-#{version}.dmg" name 'Scratch'
Update Scratch Version to 442 The Version 442 works with Adobe Air 20.0
diff --git a/Casks/trufont.rb b/Casks/trufont.rb index abc1234..def5678 100644 --- a/Casks/trufont.rb +++ b/Casks/trufont.rb @@ -2,6 +2,7 @@ version '0.4.0' sha256 '05a3b3b9b9188dfe7af9fc7c3d19dc301e7c877ec249dce7f01ac183e7a8af27' + # github.com/trufont/trufont was verified as official when first introduced to the cask url "https://github.com/trufont/trufont/releases/download/#{version}/TruFont.app.zip" appcast 'https://github.com/trufont/trufont/releases.atom', checkpoint: '0d89b0382b94ce03d1b09b053773413259850682263fe0f0fe06b1c3efd240fa'
Fix `url` stanza comment for TruFont.
diff --git a/Formula/readline.rb b/Formula/readline.rb index abc1234..def5678 100644 --- a/Formula/readline.rb +++ b/Formula/readline.rb @@ -4,6 +4,7 @@ homepage 'http://tiswww.case.edu/php/chet/readline/rltop.html' url 'ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz' sha256 '79a696070a058c233c72dd6ac697021cc64abd5ed51e59db867d66d196a89381' + version '6.2.1' keg_only <<-EOS OS X provides the BSD libedit library, which shadows libreadline.
Add explicit version number for Readline. Signed-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>
diff --git a/MTGenericSemimodalSegue.podspec b/MTGenericSemimodalSegue.podspec index abc1234..def5678 100644 --- a/MTGenericSemimodalSegue.podspec +++ b/MTGenericSemimodalSegue.podspec @@ -1,13 +1,14 @@-VERSION = "0.0.4" +POD_VERSION = "0.0.4" Pod::Spec.new do |s| s.name = "MTGenericSemimodalSegue" - s.version = VERSION + s.version = POD_VERSION s.summary = "A basic framework on which to build block-driven semimodal segues that play well with view controller containment" s.homepage = "https://github.com/mtrudel/MTGenericSemimodalSegue" s.license = { :type => 'MIT', :file => 'LICENSE' } s.author = { "Mat Trudel" => "mat@geeky.net" } s.platform = :ios, '6.0' - s.source = { :git => "https://github.com/mtrudel/MTGenericSemimodalSegue.git", :tag => VERSION } + s.source = { :git => + "https://github.com/mtrudel/MTGenericSemimodalSegue.git", :tag => POD_VERSION } s.source_files = 'Classes', 'Classes/**/*.{h,m}' s.exclude_files = 'Classes/Exclude' s.framework = 'QuartzCore'
Fix how versioning is done
diff --git a/NAPlaybackIndicatorView.podspec b/NAPlaybackIndicatorView.podspec index abc1234..def5678 100644 --- a/NAPlaybackIndicatorView.podspec +++ b/NAPlaybackIndicatorView.podspec @@ -20,17 +20,10 @@ s.author = { 'Yuji Nakayama' => 'nkymyj@gmail.com' } s.source = { git: 'http://EXAMPLE/NAME.git', tag: s.version.to_s } - # s.platform = :ios, '5.0' - # s.ios.deployment_target = '5.0' - # s.osx.deployment_target = '10.7' + s.platform = :ios, '7.0' + s.ios.deployment_target = '7.0' s.requires_arc = true s.source_files = 'Classes' - s.resources = 'Assets' - - s.ios.exclude_files = 'Classes/osx' - s.osx.exclude_files = 'Classes/ios' - # s.public_header_files = 'Classes/**/*.h' - # s.frameworks = 'SomeFramework', 'AnotherFramework' - # s.dependency 'JSONKit', '~> 1.4' + s.frameworks = 'QuartzCore' end
Update build infomation of podspec
diff --git a/lib/zipline.rb b/lib/zipline.rb index abc1234..def5678 100644 --- a/lib/zipline.rb +++ b/lib/zipline.rb @@ -19,6 +19,6 @@ response.sending_file = true response.cache_control[:public] ||= false self.response_body = zip_generator - self.response.headers['Last-Modified'] = Time.now.to_s + self.response.headers['Last-Modified'] = Time.now.httpdate end end
Use Time.now.httpdate instead of Time.now.to_s
diff --git a/SwiftCharts.podspec b/SwiftCharts.podspec index abc1234..def5678 100644 --- a/SwiftCharts.podspec +++ b/SwiftCharts.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "SwiftCharts" - s.version = "0.42" + s.version = "0.50" s.summary = "extensible, flexible charts library for iOS with extensions for Grafiti.io" s.homepage = "http://grafiti.io" s.license = { :type => "Apache License, Version 2.0", :file => "LICENSE" }
Create version 0.5 as the Swift 2.3 version
diff --git a/mongoid_silo.gemspec b/mongoid_silo.gemspec index abc1234..def5678 100644 --- a/mongoid_silo.gemspec +++ b/mongoid_silo.gemspec @@ -22,5 +22,5 @@ gem.add_dependency 'activesupport', '~> 3.2.9' gem.add_dependency 'mongoid', '~> 3.0.16' - gem.add_dependency 'sidekiq', '~> 2.6.1' + gem.add_dependency 'sidekiq', '~> 2.7.0' end
Bring Sidekiq dep up to date.
diff --git a/scripts/build.rb b/scripts/build.rb index abc1234..def5678 100644 --- a/scripts/build.rb +++ b/scripts/build.rb @@ -7,6 +7,6 @@ # Create .cog Zip::File.open("miasma.cog", Zip::File::CREATE) do |z| bundle_files.each do |f| - z.add(f, f) + z.add("miasma/#{f}", f) end end
Include miasma dir in bundle archive During install, Cog looks in a directory with the same name as the bundle for the config and all other files.
diff --git a/app/models/match.rb b/app/models/match.rb index abc1234..def5678 100644 --- a/app/models/match.rb +++ b/app/models/match.rb @@ -7,4 +7,13 @@ join_table: 'matches_away_players', class_name: 'Player' ) + + validates :home_goals, numericality: { + greater_than_or_equal_to: 0, + only_integer: true + } + validates :away_goals, numericality: { + greater_than_or_equal_to: 0, + only_integer: true + } end
Allow only positive integer values for home and away goals
diff --git a/spec/card_spec.rb b/spec/card_spec.rb index abc1234..def5678 100644 --- a/spec/card_spec.rb +++ b/spec/card_spec.rb @@ -10,25 +10,32 @@ end describe "value" do - it "will always be 10 for face cards" do + it "will always be 10 for jacks" do expect(Card.new(11, :clubs).value).to eq 10 + end + + it "will always be 10 for queens" do expect(Card.new(12, :clubs).value).to eq 10 - expect(Card.new(13, :diamonds).value).to eq 10 + end + + it "will always be 10 for kings" do + expect(Card.new(13, :clubs).value).to eq 10 end end it "knows when it is a face card" do expect(Card.new(11, :hearts).face?).to eq true - expect(Card.new(12, :spades).face?).to eq true - expect(Card.new(13, :clubs).face?).to eq true + end + it "knows when it is NOT a face card" do expect(Card.new(10, :spades).face?).to eq false - expect(Card.new(1, :spades).face?).to eq false - expect(Card.new(3, :diamonds).face?).to eq false end it "knows when it is an ace card" do expect(Card.new(1, :spades).ace?).to eq true + end + + it "knows when it is NOT an ace card" do expect(Card.new(2, :diamonds).ace?).to eq false end end
Change the card specs... one assertion per test.
diff --git a/spec/factories.rb b/spec/factories.rb index abc1234..def5678 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -6,9 +6,8 @@ factory :user, aliases: [:creator] do username password "password" - - factory :user_with_email do - email "fake@faker.com" + sequence :email do |n| + "fake#{n}@faker.com" end factory :admin_user do
Fix user factory to use email sequence
diff --git a/issuehub.gemspec b/issuehub.gemspec index abc1234..def5678 100644 --- a/issuehub.gemspec +++ b/issuehub.gemspec @@ -23,6 +23,8 @@ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] + spec.add_runtime_dependency "dotenv" + spec.add_development_dependency "bundler", "~> 1.8" spec.add_development_dependency "rake", "~> 10.0" end
Add dotenv as runtime dependency
diff --git a/spec/api_classes/auth_spec.rb b/spec/api_classes/auth_spec.rb index abc1234..def5678 100644 --- a/spec/api_classes/auth_spec.rb +++ b/spec/api_classes/auth_spec.rb @@ -2,10 +2,10 @@ describe LastFM::Auth do it "should define unrestricted methods" do - LastFM::Auth.unrestricted_methods.should == [:get_token] + LastFM::Auth.should respond_to(:get_token) end it "should define restricted methods" do - LastFM::Auth.restricted_methods.should == [:get_mobile_session, :get_session] + LastFM::Auth.should respond_to(:get_mobile_session, :get_session) end end
Check restricted method definitions for Album
diff --git a/spec/appraisal/file_spec.rb b/spec/appraisal/file_spec.rb index abc1234..def5678 100644 --- a/spec/appraisal/file_spec.rb +++ b/spec/appraisal/file_spec.rb @@ -1,5 +1,9 @@ require 'spec_helper' require 'appraisal/file' + +# Requiring this to make the test pass on Rubinius 2.2.5 +# https://github.com/rubinius/rubinius/issues/2934 +require 'rspec/matchers/built_in/raise_error' describe Appraisal::File do it "should complain when no Appraisals file is found" do
Fix build error on Rubinius by requiring matcher There was some problem with class autoloading in Rubinius, which can be workaround by just requiring that missing file. See https://github.com/rubinius/rubinius/issues/2934
diff --git a/spec/command_result_spec.rb b/spec/command_result_spec.rb index abc1234..def5678 100644 --- a/spec/command_result_spec.rb +++ b/spec/command_result_spec.rb @@ -10,4 +10,4 @@ expect(command_result.include?("ccc")).to be_false end end -end+end
Add new-line to end of file
diff --git a/week-4/factorial/my_solution.rb b/week-4/factorial/my_solution.rb index abc1234..def5678 100644 --- a/week-4/factorial/my_solution.rb +++ b/week-4/factorial/my_solution.rb @@ -1,9 +1,47 @@ # Factorial -# I worked on this challenge [by myself, with: ]. - +# I worked on this challenge with Matthew Oppenheimer. # Your Solution Below +=begin Initial Solution def factorial(number) - # Your code goes here -end+ num_array = [] + product = 1 + if (number==0) + return 1 + end + if number > 0 + while number > 0 + num_array.push(number) + number -= 1 + end + num_array.each do |x| + product *= x + end + return product + end +end +=end +=begin +def factorial(n) + if n < 0 + return nil + end + + result = 1 + while n > 0 + result = result * n + + n -= 1 + end + + return result +end +=end +#Refactored Solution + +def factorial(n) + if n == 0; return 1; end + (1..n).reduce(:*) +end +
Add intial and refactored solutions
diff --git a/spec/opsicle/deploy_spec.rb b/spec/opsicle/deploy_spec.rb index abc1234..def5678 100644 --- a/spec/opsicle/deploy_spec.rb +++ b/spec/opsicle/deploy_spec.rb @@ -8,19 +8,19 @@ context "#execute" do let(:client) { double } before do - Client.stub(:new).with('derp').and_return(client) + allow(Client).to receive(:new).with('derp').and_return(client) end it "creates a new deployment" do - subject.should_receive(:open_deploy).with('derp') - client.should_receive(:run_command).with('deploy').and_return({deployment_id: 'derp'}) + expect(subject).to receive(:open_deploy).with('derp') + expect(client).to receive(:run_command).with('deploy').and_return({deployment_id: 'derp'}) subject.execute end end context "#client" do it "generates a new aws client from the given configs" do - Client.should_receive(:new).with('derp') + expect(Client).to receive(:new).with('derp') subject.client end end
Convert deploy spec to rspec3 syntax
diff --git a/spec/unit/harvester_spec.rb b/spec/unit/harvester_spec.rb index abc1234..def5678 100644 --- a/spec/unit/harvester_spec.rb +++ b/spec/unit/harvester_spec.rb @@ -11,6 +11,7 @@ it 'starts from the datestamp of the last successfully indexed record' it 'records the datestamp of the last successfully indexed record' it 'in the event of a "partial success", records the datestamp of the first failed record' + it 'maintains enough state to keep track of the start/end datestamp itself' it 'handles resumptionTokens' it 'handles badResumptionToken errors' it 'handles resumptionTokens with expirationDates'
Make it explicit that the harvester manages the state, per email w/Stephen Abrams 17 March 2015
diff --git a/opsview_rest.gemspec b/opsview_rest.gemspec index abc1234..def5678 100644 --- a/opsview_rest.gemspec +++ b/opsview_rest.gemspec @@ -6,10 +6,10 @@ gem.name = 'opsview_rest' gem.summary = %(Opsview REST API library) gem.description = %(Update configuration on Opsview server via REST API) - gem.email = 'christian.paredes@seattlebiomed.org' + gem.email = 'cp@redbluemagenta.com' gem.homepage = 'http://github.com/cparedes/opsview_rest' gem.authors = ['Christian Paredes'] - gem.license = 'Apache' + gem.license = 'Apache-2.0' gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR) gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
Fix up gemspec to include personal email and appropriate license string for apache 2.0
diff --git a/recipes/apt.rb b/recipes/apt.rb index abc1234..def5678 100644 --- a/recipes/apt.rb +++ b/recipes/apt.rb @@ -3,7 +3,7 @@ distribution 'stable' components %w(main) key node['chrome']['apt_key'] - arch 'amd64' if 'x86_64' == node['kernel']['processor'] + arch 'amd64' if 'x86_64' == node['kernel']['machine'] action :nothing end.run_action(:add)
Use the machine key as opposed to processor
diff --git a/test/csv_query/query_test.rb b/test/csv_query/query_test.rb index abc1234..def5678 100644 --- a/test/csv_query/query_test.rb +++ b/test/csv_query/query_test.rb @@ -4,6 +4,13 @@ require 'csv_query/outputter' describe CsvQuery::Query do + class CapturingOutputter + attr_reader :lines + + def output(lines) + @lines = lines + end + end describe "creating a new instance" do it "stores CSV data for later use" do @@ -34,14 +41,12 @@ csv_data = "Foo\nBar" results = [["Foo"], ["Bar"]] - outputter = MiniTest::Mock.new - outputter.expect(:output, '', [results]) + outputter = CapturingOutputter.new query = CsvQuery::Query.new(csv_data, outputter) query.run - outputter.verify + outputter.lines.must_equal(results) end end - end
Use an object that allows us to verify the actual output Sure beats using a mock
diff --git a/lib/cuttlefish_log_daemon.rb b/lib/cuttlefish_log_daemon.rb index abc1234..def5678 100644 --- a/lib/cuttlefish_log_daemon.rb +++ b/lib/cuttlefish_log_daemon.rb @@ -11,13 +11,13 @@ if log_line && log_line.status == "hard_bounce" # We don't want to save duplicates if BlackList.find_by(team_id: log_line.delivery.app.team_id, address: log_line.delivery.address).nil? - # TEMPORARY addition to debug something in production - if log_line.delivery.app.team_id.nil? - puts "team_id is NIL" - p log_line - p line + # It is possible for the team_id to be nil if it's a mail from the cuttlefish "app" that is causing a hard bounce + # For the time being let's just ignore those mails and not try to add them to the black list because if we do + # they will cause an error + # TODO: Fix this properly. What's here now is just a temporary workaround + if log_line.delivery.app.team_id + BlackList.create(team_id: log_line.delivery.app.team_id, address: log_line.delivery.address, caused_by_delivery: log_line.delivery) end - BlackList.create(team_id: log_line.delivery.app.team_id, address: log_line.delivery.address, caused_by_delivery: log_line.delivery) end end end
Add temporary workaround for log daemon failure
diff --git a/lib/jsonapi/utils/request.rb b/lib/jsonapi/utils/request.rb index abc1234..def5678 100644 --- a/lib/jsonapi/utils/request.rb +++ b/lib/jsonapi/utils/request.rb @@ -9,7 +9,7 @@ def setup_request @request ||= JSONAPI::Request.new( - params, + params.dup, context: context, key_formatter: key_formatter, server_error_callbacks: (self.class.server_error_callbacks || [])
Use a copy of params to avoid errors with jsonapi-resources' default update action
diff --git a/lib/discordrb/events/generic.rb b/lib/discordrb/events/generic.rb index abc1234..def5678 100644 --- a/lib/discordrb/events/generic.rb +++ b/lib/discordrb/events/generic.rb @@ -1,3 +1,5 @@+require 'active_support/core_ext/module' + module Discordrb::Events class Negated attr_reader :object
Add require to fix 'undefined method delegate' error
diff --git a/lib/embassy/parser/tokenizer.rb b/lib/embassy/parser/tokenizer.rb index abc1234..def5678 100644 --- a/lib/embassy/parser/tokenizer.rb +++ b/lib/embassy/parser/tokenizer.rb @@ -19,6 +19,7 @@ end validate_top_level! + validate_group! end private @@ -28,6 +29,16 @@ end raise 'Invalid top level' if invalid end + + def validate_group! + has_normal = @tokens.any? do |t| + t.is_route? || t.is_meta? + end + has_raw = @tokens.any? do |t| + !t.is_route? && !t.is_meta? + end + raise 'Invalid object combination' if has_raw && has_normal + end end end end
Add validation layer for wrongly combined objects
diff --git a/lib/garage/no_authentication.rb b/lib/garage/no_authentication.rb index abc1234..def5678 100644 --- a/lib/garage/no_authentication.rb +++ b/lib/garage/no_authentication.rb @@ -16,8 +16,10 @@ before_filter Garage::HypermediaFilter skip_before_filter :require_action_permission_crud - rescue_from Garage::HTTPError do |exception| - render json: { status_code: exception.status_code, error: exception.message }, status: exception.status + if Garage.configuration.rescue_error + rescue_from Garage::HTTPError do |exception| + render json: { status_code: exception.status_code, error: exception.message }, status: exception.status + end end end
Add rescue_error check to NoAuthentication as ControllerHelper
diff --git a/lib/model_presenter/has_many.rb b/lib/model_presenter/has_many.rb index abc1234..def5678 100644 --- a/lib/model_presenter/has_many.rb +++ b/lib/model_presenter/has_many.rb @@ -1,6 +1,6 @@ module ModelPresenter module HasMany - # The DSL adds an instance method `relation` to represnet a `has_many` relationship + # The DSL adds an instance method +relation+ to represnet a +has_many+ relationship # # # class User @@ -8,10 +8,10 @@ # has_many :groups, presenter_class: Presenters::Group # end # - # The macro will generates a ```groups``` methods, which will return an array. Each element of the array is an instance of ```Presenters::Group``` whose ```model``` is one of the group models that the user has. + # The macro will generates a +groups+ methods, which will return an array. Each element of the array is an instance of +Presenters::Group+ whose +model+ is one of the group models that the user has. # # @param [Symbol, #read] relation the name of the relationship - # @param [Hash, #read] options Currently it accepts one key `presenter_class` is a class. The class is supposed to be a presenter class. The `relation` method will return an array of elements that are instances of the class + # @param [Hash, #read] options Currently it accepts one key +presenter_class+ is a class. The class is supposed to be a presenter class. The +relation+ method will return an array of elements that are instances of the class # # @return none def has_many(relation, options)
Use rdoc format for inline code
diff --git a/lib/sastrawi/stemmer/stemmer.rb b/lib/sastrawi/stemmer/stemmer.rb index abc1234..def5678 100644 --- a/lib/sastrawi/stemmer/stemmer.rb +++ b/lib/sastrawi/stemmer/stemmer.rb @@ -1,8 +1,13 @@+require 'filter/text_normalizer' + module Sastrawi module Stemmer class Stemmer - def initialize - # TODO: Implement this method here. + attr_reader :dictionary, :visitor_provider + + def initialize(dictionary) + @dictionary = dictionary + @visitor_provider = VisitorProviver.new end def get_dictionary @@ -10,11 +15,22 @@ end def stem(text) - # TODO: Implement this method here. + normalized_text = TextNormalizer.normalize_text(text) + + words = normalize_text.split(' ') + stems = [] + + words.each { |w| stems.push(w) } + + stems.join(' ') end def stem_word(word) - # TODO: Implement this method here. + if self.plural?(word) + self.stem_plural_word(word) + else + self.stem_singular_word(word) + end end def plural?(word)
Implement "stem" and "stem_word" functions
diff --git a/app.rb b/app.rb index abc1234..def5678 100644 --- a/app.rb +++ b/app.rb @@ -26,6 +26,7 @@ end get '/*' do |domain| + redirect to(domain.gsub(%r[/.*], '')) if domain.include?('/') result = lookup(domain) haml :result, locals: { result: result, domain: domain } end
Cut all chars after slash in domain name
diff --git a/app.rb b/app.rb index abc1234..def5678 100644 --- a/app.rb +++ b/app.rb @@ -39,7 +39,12 @@ :value => data[:val], :measure_time => time.to_i, :type => 'gauge', - :attributes => { :source_aggregate => true } + :attributes => { + :source_aggregate => true, + :display_min => 0, + :display_units_short => data[:units], + :display_units_long => data[:units] + } } end
Add more attributes when creating metrics
diff --git a/lib/tasks/bundler_audit.rake b/lib/tasks/bundler_audit.rake index abc1234..def5678 100644 --- a/lib/tasks/bundler_audit.rake +++ b/lib/tasks/bundler_audit.rake @@ -1,8 +1,7 @@-require "bundler/audit/cli" - namespace :bundler do desc "Updates the ruby-advisory-db and runs audit" task :audit do + require "bundler/audit/cli" %w(update check).each do |command| Bundler::Audit::CLI.start [command] end
Fix bundler audit in production When `bundle exec rake` runs it loads all of the rake tasks. Because `bundler-audit` is only included in development and test environments, this causes all Rake tasks to fail on production. Moving the require into the task fixes this.
diff --git a/raygun_client.gemspec b/raygun_client.gemspec index abc1234..def5678 100644 --- a/raygun_client.gemspec +++ b/raygun_client.gemspec @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = 'raygun_client' - s.version = '0.1.0.0' + s.version = '0.2.0.0' s.summary = 'Client for the Raygun API using the Obsidian HTTP client' s.description = ' '
Package version is increased from 0.1.0.0 to 0.2.0.0 Changing from an environment variable to a settings file is not backward compatible
diff --git a/test/editor/models/image_test.rb b/test/editor/models/image_test.rb index abc1234..def5678 100644 --- a/test/editor/models/image_test.rb +++ b/test/editor/models/image_test.rb @@ -11,7 +11,7 @@ end test 'path should handle blank base_folder' do - Rails.application.secrets.s3['path'] = "" + Rails.application.secrets.s3[:path] = "" file = Struct::File.new('some_image.jpg') image = Admin::Image.new @@ -21,7 +21,7 @@ end test 'path should handle base_folder' do - Rails.application.secrets.s3['path'] = "my_blog" + Rails.application.secrets.s3[:path] = "my_blog" file = Struct::File.new('some_image.jpg') image = Admin::Image.new
Fix tests to use symbols
diff --git a/test/models/opening_hour_test.rb b/test/models/opening_hour_test.rb index abc1234..def5678 100644 --- a/test/models/opening_hour_test.rb +++ b/test/models/opening_hour_test.rb @@ -4,6 +4,7 @@ def test_valid_from_time openinghour = OpeningHour.new + openinghour.week_day = 0 openinghour.from_time = "18:00" openinghour.to_time = "22:00" assert openinghour.valid? @@ -15,6 +16,7 @@ def test_valid_to_time openinghour = OpeningHour.new + openinghour.week_day = 1 openinghour.from_time = "18:00" openinghour.to_time = "22:00" assert openinghour.valid?
Add week day to opening hour test
diff --git a/lib/amazon_athena/partition.rb b/lib/amazon_athena/partition.rb index abc1234..def5678 100644 --- a/lib/amazon_athena/partition.rb +++ b/lib/amazon_athena/partition.rb @@ -0,0 +1,21 @@+module AmazonAthena + class Partition + + def initialize(options: {}, location: nil) + @options = options + @location = location + end + + def to_s + return nil if @options.empty? + + # TODO: Sanitize and handle non-strings + opts = @options.map {|k,v| "#{k} = '#{v}'"}.join(", ") + + sql = "PARTITION (#{opts})" + sql += " LOCATION '#{@location}'" if @location + + sql + end + end +end
Add object for PARTITION specs
diff --git a/lib/girl_friday/persistence.rb b/lib/girl_friday/persistence.rb index abc1234..def5678 100644 --- a/lib/girl_friday/persistence.rb +++ b/lib/girl_friday/persistence.rb @@ -23,7 +23,7 @@ class Redis def initialize(name, options) @opts = options - @key = "girl_friday-#{name}" + @key = "girl_friday-#{name}-#{environment}" end def push(work) @@ -43,6 +43,10 @@ private + def environment + ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'none' + end + def redis @redis ||= ::Redis.new(*@opts) end
Add environment to redis queue name
diff --git a/lib/graphql/relay/page_info.rb b/lib/graphql/relay/page_info.rb index abc1234..def5678 100644 --- a/lib/graphql/relay/page_info.rb +++ b/lib/graphql/relay/page_info.rb @@ -4,8 +4,8 @@ PageInfo = GraphQL::ObjectType.define do name("PageInfo") description("Metadata about a connection") - field :hasNextPage, !types.Boolean, property: :has_next_page - field :hasPreviousPage, !types.Boolean, property: :has_previous_page + field :hasNextPage, !types.Boolean, "Indicates if there are more pages to fetch", property: :has_next_page + field :hasPreviousPage, !types.Boolean, "Indicates if there are any pages prior to the current page", property: :has_previous_page end end end
Add default description for pageInfo
diff --git a/recipes/authoritative.rb b/recipes/authoritative.rb index abc1234..def5678 100644 --- a/recipes/authoritative.rb +++ b/recipes/authoritative.rb @@ -1,6 +1,6 @@ include_recipe "pdns::#{node['pdns']['build_method']}" -template '/etc/powerdns/pdns.conf' do +template '/etc/pdns/pdns.conf' do source 'pdns.conf.erb' owner 'pdns' group 'pdns'
Use the default /etc/pdns path for configs
diff --git a/gem-ctags.gemspec b/gem-ctags.gemspec index abc1234..def5678 100644 --- a/gem-ctags.gemspec +++ b/gem-ctags.gemspec @@ -13,4 +13,6 @@ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ["lib"] + + s.add_development_dependency('rake') end
Add rake to development dependencies
diff --git a/run.rb b/run.rb index abc1234..def5678 100644 --- a/run.rb +++ b/run.rb @@ -11,11 +11,13 @@ if filename.nil? || (filename.respond_to?(:empty?) && filename.empty?) puts "Please provide the path of the input file!" + puts "USAGE: ruby run.rb <filename> <output_directory>" exit end if output_dir.nil? || (output_dir.respond_to?(:empty?) && output_dir.empty?) puts "Please provide the directory for the output!" + puts "USAGE: ruby run.rb <filename> <output_directory>" exit end
Update error message on script.
diff --git a/app/controllers/articles_controller.rb b/app/controllers/articles_controller.rb index abc1234..def5678 100644 --- a/app/controllers/articles_controller.rb +++ b/app/controllers/articles_controller.rb @@ -14,11 +14,13 @@ def create @article = Article.create(article_params) + flash.notice = "Article '#{@article.title}' was created!" redirect_to article_path(@article) end def destroy article.destroy + flash.notice = "Article '#{@article.title}' was destroyed!" redirect_to articles_path end @@ -28,9 +30,7 @@ def update article.update(article_params) - flash.notice = "Article '#{article.title}' is updated!" - redirect_to article_path(article) end
Add flash notice for create and destroy actions
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 @@ -11,9 +11,12 @@ redirect_to submission_path(submission_id), notice: 'Comment was successfully created.' else submission = Submission.find(submission_id) + rate_presenters = create_rate_presenters(submission.rates) + comment_presenters = create_comment_presenters(submission.comments) + render "submissions/show", locals: { submission: submission, - comment: result.object, submissions_comments: submission.comments, - submissions_rates: submission.rates } + comment: result.object, comment_presenters: comment_presenters, + rate_presenters: rate_presenters } end end @@ -21,4 +24,12 @@ def comment_params params.require(:comment).permit(:body) end + + def create_rate_presenters(rates) + rates.map { |rate| RatePresenter.new(rate, rate.user) } + end + + def create_comment_presenters(comments) + comments.map { |comment| CommentPresenter.new(comment, comment.user) } + end end
Fix rendering submission show view when comment is not created by sending comment_presenters and rate_presenters in locals from comment create method