diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/api_cache.gemspec b/api_cache.gemspec index abc1234..def5678 100644 --- a/api_cache.gemspec +++ b/api_cache.gemspec @@ -16,7 +16,7 @@ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ["lib"] - s.add_development_dependency('rspec', "~> 2.8") + s.add_development_dependency('rspec', "~> 2.7") s.add_development_dependency('webmock') s.add_development_dependency('rake') s.add_development_dependency('moneta', "~> 0.6.0")
Add rspec ~> 2.7 to gemspec development dependencies
diff --git a/lib/structured_logger.rb b/lib/structured_logger.rb index abc1234..def5678 100644 --- a/lib/structured_logger.rb +++ b/lib/structured_logger.rb @@ -6,10 +6,11 @@ class StructuredLogger - def initialize(name, log_device=STDOUT) + def initialize(name, level=Logger::DEBUG, log_device=STDOUT) @logger = ::Logger.new(STDOUT).tap do |logger| logger.formatter = JSONFormatter.new logger.progname = name + logger.level = level end end
Allow setting the level for the logger
diff --git a/lib/tasks/pathology.rake b/lib/tasks/pathology.rake index abc1234..def5678 100644 --- a/lib/tasks/pathology.rake +++ b/lib/tasks/pathology.rake @@ -0,0 +1,29 @@+require "benchmark" + +namespace :pathology do + namespace :test do + desc "In development only, import a test HL7 message. Useful for testing listeners." + task import_one: :environment do + raise NotImplementedError unless Rails.env.development? + + # Load the example HL7 file. + path = Renalware::Engine.root.join("app", "jobs", "hl7_message_example.yml") + raw_message = File.read(path) + + # It has a struct header at the top so it can also be dumped into + # the delayed_job queue, but we want to skip queuing so strip out that header and simulate + # the message being passed directly to the FeedJob which will persist and process the message. + raw_message = raw_message.gsub("--- !ruby/struct:FeedJob\n", "") + + # Replace the MSH date with now() to guarantee a unique message. not doing so results in + # an index violation becuase we calc am MD5 hash of the message and this has to be unique - + # this prevents us importing the same message twice. + raw_message = raw_message.gsub("20091112164645", Time.zone.now.strftime("%Y%m%d%H%M%S")) + + # Load the message into a hash as delayed_Job would do and spalt the hash keys as keyword args + # into the FeedJob ctor. + hash = YAML.safe_load(*raw_message).symbolize_keys + FeedJob.new(*hash).perform + end + end +end
Add rake task to help debugging HL7 messages rake pathology:test:import_one
diff --git a/arbre.gemspec b/arbre.gemspec index abc1234..def5678 100644 --- a/arbre.gemspec +++ b/arbre.gemspec @@ -11,6 +11,7 @@ s.homepage = "" s.summary = %q{An Object Oriented DOM Tree in Ruby} s.description = %q{An Object Oriented DOM Tree in Ruby} + s.license = "MIT" s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
Add missing license info to gemspec
diff --git a/radius-rails.gemspec b/radius-rails.gemspec index abc1234..def5678 100644 --- a/radius-rails.gemspec +++ b/radius-rails.gemspec @@ -19,7 +19,7 @@ spec.require_paths = ["lib"] #spec.add_dependency "font-awesome-rails" - spec.add_dependency "railties", ">= 3.2", "~> 6.0" + spec.add_dependency "railties", ">= 3.2", "<= 6.0" spec.add_development_dependency "bundler", "~> 1.6" spec.add_development_dependency "rake", "~> 12.3.3"
Use <= contraint on railties instead of pessimistic version lock This was causing us some issues when attempting to upgrade some gems in iris. Using <= over ~> resolves this issue
diff --git a/logglier.gemspec b/logglier.gemspec index abc1234..def5678 100644 --- a/logglier.gemspec +++ b/logglier.gemspec @@ -7,6 +7,8 @@ s.date = Time.now s.summary = 'Loggly "plugin" for Logger' s.description = 'Logger => Loggly' + + s.license = "http://opensource.org/licenses/Apache-2.0" s.authors = ["Edward Muller (aka freeformz)"] s.email = 'edwardam@interlix.com' @@ -21,9 +23,9 @@ s.required_ruby_version = '>= 1.8.6' s.required_rubygems_version = '>= 1.3.6' - s.add_dependency 'multi_json' - s.add_development_dependency 'rake' - s.add_development_dependency 'rspec', '~> 2.11.0' + s.add_dependency 'multi_json', '~> 0' + s.add_development_dependency 'rake', '~> 0' + s.add_development_dependency 'rspec', '~> 2.11', '>= 2.11.0' end
Resolve gem build warnings, add a license.
diff --git a/redis_cache_mailer_delivery.gemspec b/redis_cache_mailer_delivery.gemspec index abc1234..def5678 100644 --- a/redis_cache_mailer_delivery.gemspec +++ b/redis_cache_mailer_delivery.gemspec @@ -21,4 +21,5 @@ gem.add_development_dependency(%q<guard-rspectacle>) gem.add_development_dependency(%q<growl>) gem.add_development_dependency(%q<rb-fsevent>) + gem.add_development_dependency(%q<rake>) end
Add rake into bundler env
diff --git a/spec/authentication_spec.rb b/spec/authentication_spec.rb index abc1234..def5678 100644 --- a/spec/authentication_spec.rb +++ b/spec/authentication_spec.rb @@ -3,7 +3,7 @@ class DummyClient - def secret + def api_secret_key "uA96CFtJa138E2T5GhKfngml" end
Fix secret key call method.
diff --git a/spec/mixin_writable_spec.rb b/spec/mixin_writable_spec.rb index abc1234..def5678 100644 --- a/spec/mixin_writable_spec.rb +++ b/spec/mixin_writable_spec.rb @@ -2,21 +2,20 @@ require 'rdf/spec/writable' describe RDF::Writable do - before :each do + subject {RDF::Repository.new} + + # @see lib/rdf/spec/writable.rb in rdf-spec + it_behaves_like 'an RDF::Writable' do # The available reference implementations are `RDF::Repository` and # `RDF::Graph`, but a plain Ruby array will do fine as well: - #@writable = [].extend(RDF::Writable) # FIXME - @writable = RDF::Repository.new + let(:writable) { RDF::Repository.new } end - - # @see lib/rdf/spec/writable.rb in rdf-spec - include RDF_Writable describe "#freeze" do it "should make the object no longer writable" do - @writable.freeze + subject.freeze - expect(@writable).not_to be_writable + expect(subject).not_to be_writable end end end
Use RDF::Writable behavior, instead of RDF_Writable include.
diff --git a/app/helpers/owners_helper.rb b/app/helpers/owners_helper.rb index abc1234..def5678 100644 --- a/app/helpers/owners_helper.rb +++ b/app/helpers/owners_helper.rb @@ -8,10 +8,23 @@ options[:class] += " has-tooltip" # Trying container: 'body' as a workaround for a bug where gravatars move when # tooltips are activated - tooltip_text = owner.nickname if tooltip_text.nil? - options[:data] = {placement: "bottom", title: tooltip_text, container: 'body'} + if tooltip_text.nil? + tooltip_text = owner_tooltip_content(owner) + html = true + else + html = false + end + options[:data] = {placement: "bottom", title: tooltip_text, html: html, container: 'body'} end options[:alt] = owner.nickname image_tag owner.gravatar_url(size), options end + + def owner_tooltip_content(owner) + if owner.name + "<h4>#{h(owner.name)}</h4><h5>#{h(owner.nickname)}</h5>" + else + "<h4>#{h(owner.nickname)}</h4>" + end + end end
Make tooltip for owners show the full name as well if it's available
diff --git a/app/jobs/slack_pinger_job.rb b/app/jobs/slack_pinger_job.rb index abc1234..def5678 100644 --- a/app/jobs/slack_pinger_job.rb +++ b/app/jobs/slack_pinger_job.rb @@ -8,7 +8,7 @@ actual_location = booking_location.name_for(booking_request.location_id) hook = WebHook.new(hook_uri) - hook.call(payload(actual_location)) + hook.call(payload(actual_location, booking_request.slots.size)) end private @@ -17,11 +17,11 @@ ENV['BOOKING_REQUESTS_SLACK_PINGER_URI'] end - def payload(actual_location) + def payload(actual_location, slot_count) { username: 'frank', channel: '#online-bookings', - text: ":rotating_light: #{actual_location} :rotating_light:", + text: ":rotating_light: #{actual_location} (#{slot_count} slots) :rotating_light:", icon_emoji: ':frank:' } end
Include number of chosen slots for slack ping Pings slack with the location and number of slots the customer chose.
diff --git a/app/models/procedure_path.rb b/app/models/procedure_path.rb index abc1234..def5678 100644 --- a/app/models/procedure_path.rb +++ b/app/models/procedure_path.rb @@ -23,7 +23,7 @@ end def publish!(new_procedure) - if procedure&.publiee? + if procedure&.publiee? && procedure != new_procedure procedure.archive! end update!(procedure: new_procedure)
Archive only when path changes owner
diff --git a/app/models/event.rb b/app/models/event.rb index abc1234..def5678 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -1,4 +1,6 @@ class Event < ActiveRecord::Base has_many :participations, class_name: EventParticipation.name, dependent: :destroy has_many :users, through: :participations + + validates :name, presence: true end
Add validate presence to Event model
diff --git a/spec/models/renalware/feeds/files/practices/import_job_spec.rb b/spec/models/renalware/feeds/files/practices/import_job_spec.rb index abc1234..def5678 100644 --- a/spec/models/renalware/feeds/files/practices/import_job_spec.rb +++ b/spec/models/renalware/feeds/files/practices/import_job_spec.rb @@ -8,7 +8,7 @@ module Practices describe ImportJob do context "when importing fullfile.zip" do - it "imports the 2 sample practices in the test fullfile.zip" do + it "imports the 4 sample practices in the test fullfile.zip" do pending("PG COPY not avail on CircleCI docker setup yet") if ENV.key?("CI") file = create( :feed_file, @@ -20,7 +20,7 @@ expect{ described_class.new.perform(file) } - .to change{ Patients::Practice.count }.by(1) + .to change{ Patients::Practice.count }.by(4) .and change{ Patients::Practice.deleted.count }.by(1) end end
Fix practice import spec now we import more types of practice
diff --git a/spec/lib/gitlab/ci/status/build/common_spec.rb b/spec/lib/gitlab/ci/status/build/common_spec.rb index abc1234..def5678 100644 --- a/spec/lib/gitlab/ci/status/build/common_spec.rb +++ b/spec/lib/gitlab/ci/status/build/common_spec.rb @@ -0,0 +1,37 @@+require 'spec_helper' + +describe Gitlab::Ci::Status::Build::Common do + let(:user) { create(:user) } + let(:build) { create(:ci_build) } + let(:project) { build.project } + + subject do + Gitlab::Ci::Status::Core + .new(build, user) + .extend(described_class) + end + + describe '#has_action?' do + it { is_expected.not_to have_action } + end + + describe '#has_details?' do + context 'when user has access to read build' do + before { project.team << [user, :developer] } + + it { is_expected.to have_details } + end + + context 'when user does not have access to read build' do + before { project.update(public_builds: false) } + + it { is_expected.not_to have_details } + end + end + + describe '#details_path' do + it 'links to the build details page' do + expect(subject.details_path).to include "builds/#{build.id}" + end + end +end
Add tests for common build detailed status helpers
diff --git a/lib/bumper/version.rb b/lib/bumper/version.rb index abc1234..def5678 100644 --- a/lib/bumper/version.rb +++ b/lib/bumper/version.rb @@ -1,7 +1,7 @@ module Bumper class Version - ['major', 'minor', 'revision', 'build'].each do |part| + [:major, :minor, :revision, :build].each do |part| define_method part do @v[part] end @@ -14,22 +14,22 @@ def initialize(v) @v = {} if v =~ /^(\d+)\.(\d+)\.(\d+)(?:\.(.*?))?$/ - @v['major'] = $1.to_i - @v['minor'] = $2.to_i - @v['revision'] = $3.to_i - @v['build'] = $4 + @v[:major] = $1.to_i + @v[:minor] = $2.to_i + @v[:revision] = $3.to_i + @v[:build] = $4 end end def bump(part) @v[part] = @v[part].succ - return @v[part] if part == 'build' - @v['build'] = '0' - return @v[part] if part == 'revision' - @v['revision'] = 0 - return @v[part] if part == 'minor' - @v['minor'] = 0 + return @v[part] if part == :build + @v[:build] = '0' + return @v[part] if part == :revision + @v[:revision] = 0 + return @v[part] if part == :minor + @v[:minor] = 0 @v[part] end
Use symbol keys instead of string keys
diff --git a/lib/cap-git-deploy.rb b/lib/cap-git-deploy.rb index abc1234..def5678 100644 --- a/lib/cap-git-deploy.rb +++ b/lib/cap-git-deploy.rb @@ -16,9 +16,9 @@ # The name of the current logged user def self.current_user login = Etc.getlogin - user = Etc.getpwnam(login) + user = Etc.getpwnam(login).gecos host = Socket.gethostname - "<#{user}> #{login}@#{host}" + "#{login}@#{host} (#{user})" end end end
Fix full username (used to inspect a struct instead)
diff --git a/lib/deployml/shell.rb b/lib/deployml/shell.rb index abc1234..def5678 100644 --- a/lib/deployml/shell.rb +++ b/lib/deployml/shell.rb @@ -4,8 +4,8 @@ # module Shell - def initialize(&block) - block.call(self) if block + def initialize + yield self if block_given? end #
Use yield instead of block.call.
diff --git a/black_list.rb b/black_list.rb index abc1234..def5678 100644 --- a/black_list.rb +++ b/black_list.rb @@ -5,12 +5,16 @@ BlackList = [ ["coq-bdds.8.5.0", "Error: Could not find the .cmi file for interface parser.mli."], ["coq-bdds.8.7.0", "Error: Could not find the .cmi file for interface parser.mli."], + ["coq-bdds.8.8.0", "Error: Could not find the .cmi file for interface parser.mli."], ["coq-bignums.8.6.0", "Error: Corrupted compiled interface"], ["coq-bignums.8.7.0", "Error: Unable to locate library NMake_gen."], ["coq-coq2html.1.0", "Error: Unbound module Resources"], ["coq-coq2html.1.1", "Error: Unbound module Resources"], ["coq-cybele.1.3.0", "make inconsistent assumptions over interface CybeleConstants"], + ["coq-hammer.1.0.8+8.7", "Error: Corrupted compiled interface"], + ["coq-hammer.1.0.8+8.7", "make inconsistent assumptions over interface Hhlib"], ["coq-hammer.1.1.1+8.9", "Error: Corrupted compiled interface"], ["coq-ltac2.0.3", "coq-ltac2 -> coq >= 8.10"], + ["coq-plugin-utils.1.1.0", "Error: Corrupted compiled interface"], ["coq-string.8.5.0", "Error: Unbound module G_local_ascii_syntax"] ]
Add new packages to the black-list
diff --git a/lib/em-dir-watcher.rb b/lib/em-dir-watcher.rb index abc1234..def5678 100644 --- a/lib/em-dir-watcher.rb +++ b/lib/em-dir-watcher.rb @@ -10,7 +10,7 @@ end end -require "em-dir-watcher/platform/#{EMDirWatcher::PLATFORM.upcase}" +require "em-dir-watcher/platform/#{EMDirWatcher::PLATFORM.downcase}" module EMDirWatcher Watcher = Platform.const_get(PLATFORM)::Watcher
Fix a bug when running on case-insensitive file systems
diff --git a/lib/gds_api/maslow.rb b/lib/gds_api/maslow.rb index abc1234..def5678 100644 --- a/lib/gds_api/maslow.rb +++ b/lib/gds_api/maslow.rb @@ -1,5 +1,5 @@ class GdsApi::Maslow < GdsApi::Base - def need_page_url(need_id) - "#{endpoint}/needs/#{need_id}" + def need_page_url(content_id) + "#{endpoint}/needs/#{content_id}" end end
Change need_id to content_id in need_page_url This is to match changes in Maslow. Using need ids will continue to work, and this isn't required for using content ids, but may be less confusing going forward.
diff --git a/lib/juici/callback.rb b/lib/juici/callback.rb index abc1234..def5678 100644 --- a/lib/juici/callback.rb +++ b/lib/juici/callback.rb @@ -5,8 +5,9 @@ attr_reader :url attr_accessor :payload - def initialize(url) + def initialize(url, pl=nil) @url = url + @payload = pl if pl end def process!
Allow payload to be specified at init time
diff --git a/lib/kaminari/hooks.rb b/lib/kaminari/hooks.rb index abc1234..def5678 100644 --- a/lib/kaminari/hooks.rb +++ b/lib/kaminari/hooks.rb @@ -27,14 +27,6 @@ ::MongoMapper::Document.send :include, Kaminari::MongoMapperExtension::Document ::Plucky::Query.send :include, Kaminari::PluckyCriteriaMethods end - - # Rails 3.0.x fails to load helpers in Engines (?) - if defined?(::ActionView) && ::ActionPack::VERSION::STRING < '3.1' - ActiveSupport.on_load(:action_view) do - require 'kaminari/helpers/action_view_extension' - ::ActionView::Base.send :include, Kaminari::ActionViewExtension - end - end require 'kaminari/models/array_extension' end end
Revert "Rails 3.0.x fails to load helpers in Engines (?)" This reverts commit 00c912d12bc49c0e7b3d748854e0bdce94ff3470. reason: reverting back from app/helpers to ActionView::Base freedom-patch. Because mounted engines on the app doesn't search the main_app's helpers, then throws "undefined method `paginate'" in the views
diff --git a/lib/orchid/routing.rb b/lib/orchid/routing.rb index abc1234..def5678 100644 --- a/lib/orchid/routing.rb +++ b/lib/orchid/routing.rb @@ -2,10 +2,35 @@ module Routing module_function - def draw(reserved_names: []) + def draw(reserved_names: [], parent_scope: "") # Retrieve list of main app's route names drawn_routes = defined?(Rails.application.routes) ? Rails.application.routes.routes.map { |r| r.name } : [] + + eval_routes = proc { + # if app has specified multiple language support + # then they should be included as possible routes + # the default language should NOT be specified + # as it will not have a locale in the URL + langs = APP_OPTS["languages"] + if langs.present? + locales = Regexp.new(langs) + scope "(:locale)", constraints: { locale: locales } do + ROUTES.each do |route| + next if drawn_routes.include?(route[:name]) + + # Call routing DSL methods in Orchid route procs in this context + instance_eval(&route[:definition]) + end + end + else + ROUTES.each do |route| + next if drawn_routes.include?(route[:name]) + # Call routing DSL methods in Orchid route procs in this context + instance_eval(&route[:definition]) + end + end + } # If home path drawn, assume Orchid's routes have already been drawn if !drawn_routes.include?("home") && const_defined?(:APP_OPTS) @@ -13,29 +38,15 @@ # Add names reserved by main app for more general routes, e.g. '/:id' drawn_routes += reserved_names - # if app has specified multiple language support - # then they should be included as possible routes - # the default language should NOT be specified - # as it will not have a locale in the URL - langs = APP_OPTS["languages"] - if langs.present? - locales = Regexp.new(langs) - scope "(:locale)", constraints: { locale: locales } do - ROUTES.each do |route| - next if drawn_routes.include?(route[:name]) - # Call routing DSL methods in Orchid route procs in this context - instance_eval(&route[:definition]) - end + if parent_scope.present? + scope parent_scope do + instance_eval(&eval_routes) end else - ROUTES.each do |route| - next if drawn_routes.include?(route[:name]) - # Call routing DSL methods in Orchid route procs in this context - instance_eval(&route[:definition]) - end + instance_eval(&eval_routes) end end - end - end + end # end if !drawn_routes.include?("home") + end # end draw method end end
Add ability to scope routes from main app
diff --git a/lib/redmine_charts.rb b/lib/redmine_charts.rb index abc1234..def5678 100644 --- a/lib/redmine_charts.rb +++ b/lib/redmine_charts.rb @@ -11,7 +11,7 @@ module RedmineCharts def self.has_sub_issues_functionality_active - ((Redmine::VERSION.to_a <=> [0,9,5]) >= 0) or (Redmine::VERSION.to_a == [0,9,4,'devel']) + ((Redmine::VERSION.to_a <=> [1,0,0]) >= 0) end end
Fix subtasks problem in Redmine 0.9.x
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 @@ -14,6 +14,8 @@ "bin/rails runner" when Whenever.script_rails? "script/rails runner" + when Whenever.bundler? + "bundle exec rails runner" else "script/runner" end
Add condition path to use bundle exec as runner command
diff --git a/pronto-rubocop.gemspec b/pronto-rubocop.gemspec index abc1234..def5678 100644 --- a/pronto-rubocop.gemspec +++ b/pronto-rubocop.gemspec @@ -1,7 +1,8 @@ # -*- encoding: utf-8 -*- + $LOAD_PATH.push File.expand_path('../lib', __FILE__) - require 'pronto/rubocop/version' +require 'English' Gem::Specification.new do |s| s.name = 'pronto-rubocop' @@ -12,16 +13,28 @@ s.homepage = 'http://github.org/mmozuras/pronto-rubocop' s.summary = 'Pronto runner for Rubocop, ruby code analyzer' - s.required_rubygems_version = '>= 1.3.6' - s.license = 'MIT' + s.licenses = ['MIT'] + s.required_ruby_version = '>= 1.9.3' + s.rubygems_version = '1.8.23' - s.files = Dir.glob('{lib}/**/*') + %w(LICENSE README.md) - s.test_files = `git ls-files -- {spec}/*`.split("\n") + s.files = `git ls-files`.split($RS).reject do |file| + file =~ %r{^(?: + spec/.* + |Gemfile + |Rakefile + |\.rspec + |\.gitignore + |\.rubocop.yml + |\.travis.yml + )$}x + end + s.test_files = [] + s.extra_rdoc_files = ['LICENSE', 'README.md'] s.require_paths = ['lib'] - s.add_runtime_dependency 'rubocop', '~> 0.34.0' - s.add_runtime_dependency 'pronto', '~> 0.4.0' - s.add_development_dependency 'rake', '~> 10.3' - s.add_development_dependency 'rspec', '~> 3.0' - s.add_development_dependency 'rspec-its', '~> 1.0' + s.add_runtime_dependency('rubocop', '~> 0.35.0') + s.add_runtime_dependency('pronto', '~> 0.5.0') + s.add_development_dependency('rake', '~> 10.4') + s.add_development_dependency('rspec', '~> 3.3') + s.add_development_dependency('rspec-its', '~> 1.2') end
Reduce size of the gem by only including the necessary files via gemspec
diff --git a/slack-mathbot/commands/calculate.rb b/slack-mathbot/commands/calculate.rb index abc1234..def5678 100644 --- a/slack-mathbot/commands/calculate.rb +++ b/slack-mathbot/commands/calculate.rb @@ -10,10 +10,10 @@ if result && result.length > 0 send_message client, data.channel, result else - send_message client, data.channel, 'Got nothing.' + send_message client, data.channel, 'Got nothing.', 'nothing' end rescue StandardError => e - send_message client, data.channel, "Sorry, #{e.message}." + send_message client, data.channel, "Sorry, #{e.message}.", 'idiot' end end end
Revert "Remove giphy query from end of error strings" This reverts commit 0f3bde20c569e4c7bfd0030b20d875592c817dd0.
diff --git a/recipes/registrator.rb b/recipes/registrator.rb index abc1234..def5678 100644 --- a/recipes/registrator.rb +++ b/recipes/registrator.rb @@ -5,11 +5,11 @@ command = node['docker-simple']['registrator']['command'] compose = { - 'registrator': { - 'image': "gliderlabs/registrator:#{tag}", - 'command': command, - 'volumes': [ - '/var/run/docker.sock:/tmp/docker.sock' + "registrator": { + .image": "gliderlabs/registrator:#{tag}", + "command": command, + "volumes": [ + "/var/run/docker.sock:/tmp/docker.sock" ] } }
Change quotes to prevent symbolizing
diff --git a/Casks/meld.rb b/Casks/meld.rb index abc1234..def5678 100644 --- a/Casks/meld.rb +++ b/Casks/meld.rb @@ -0,0 +1,12 @@+cask 'meld' do + version '3.16.0 (r1)' + sha256 '324e096e0253e8ad4237f64a90cdda200fe427db8cf7ebc78143fc98e2d33ebc' + + # github.com/yousseb/meld was verified as official when first introduced to the cask + url 'https://github.com/yousseb/meld/releases/download/osx-9/meldmerge.dmg' + name 'Meld for OSX' + homepage 'https://yousseb.github.io/meld/' + license :gpl + + app 'Meld.app' +end
Add Meld for OSX v3.16.0 (r1)
diff --git a/Casks/xact.rb b/Casks/xact.rb index abc1234..def5678 100644 --- a/Casks/xact.rb +++ b/Casks/xact.rb @@ -1,7 +1,7 @@ class Xact < Cask - url 'http://xact.scottcbrown.org/xACT2.25.zip' + url 'http://xact.scottcbrown.org/xACT2.27.zip' homepage 'http://xact.scottcbrown.org' - version '2.25' - sha256 '16425a50bdf9c8af8b436f88f4918145b553135a93887ae1ccddaad8edc79b51' - link 'xACT 2.25/xACT.app' + version '2.27' + sha256 'a99965cc9c34838b2492dd99a5d5419123132b5eae30b7db5be14fc095750135' + link 'xACT 2.27/xACT.app' end
Update xACT 2.25 to 2.27
diff --git a/test/test_helper_methods.rb b/test/test_helper_methods.rb index abc1234..def5678 100644 --- a/test/test_helper_methods.rb +++ b/test/test_helper_methods.rb @@ -19,7 +19,7 @@ def test_filelist rim = Rim.instance - fl = rim.filelist(/rakefile/i, 'lib') + fl = rim.filelist(/^rakefile/i, 'lib') assert_equal %w(Rakefile lib), fl.to_a end
Bugfix: Make tests work in unclean directory tree.
diff --git a/spec/lib/text_filter_plugin_spec.rb b/spec/lib/text_filter_plugin_spec.rb index abc1234..def5678 100644 --- a/spec/lib/text_filter_plugin_spec.rb +++ b/spec/lib/text_filter_plugin_spec.rb @@ -1,6 +1,32 @@ # frozen_string_literal: true require "rails_helper" + +RSpec.describe TextFilterPlugin do + describe ".available_filters" do + subject { described_class.available_filters } + + it { is_expected.to include(PublifyApp::Textfilter::Markdown) } + it { is_expected.to include(PublifyApp::Textfilter::Smartypants) } + it { is_expected.to include(PublifyApp::Textfilter::Twitterfilter) } + it { is_expected.not_to include(TextFilterPlugin::Markup) } + it { is_expected.not_to include(TextFilterPlugin::Macro) } + it { is_expected.not_to include(TextFilterPlugin::MacroPre) } + it { is_expected.not_to include(TextFilterPlugin::MacroPost) } + end + + describe ".macro_filters" do + subject { described_class.macro_filters } + + it { is_expected.not_to include(PublifyApp::Textfilter::Markdown) } + it { is_expected.not_to include(PublifyApp::Textfilter::Smartypants) } + it { is_expected.not_to include(PublifyApp::Textfilter::Twitterfilter) } + it { is_expected.not_to include(TextFilterPlugin::Markup) } + it { is_expected.not_to include(TextFilterPlugin::Macro) } + it { is_expected.not_to include(TextFilterPlugin::MacroPre) } + it { is_expected.not_to include(TextFilterPlugin::MacroPost) } + end +end RSpec.describe TextFilterPlugin::Macro do describe "#self.attributes_parse" do
Improve specs for list of available filters
diff --git a/spec/ruby/library/etc/group_spec.rb b/spec/ruby/library/etc/group_spec.rb index abc1234..def5678 100644 --- a/spec/ruby/library/etc/group_spec.rb +++ b/spec/ruby/library/etc/group_spec.rb @@ -4,4 +4,14 @@ describe "Etc.group" do it_behaves_like(:etc_on_windows, :group) + + it "raises a RuntimeError for parallel iteration" do + proc { + Etc.group do | group | + Etc.group do | group2 | + end + end + }.should raise_error(RuntimeError) + end + end
Add spec for parallel group iteration Spec is shamelessly taken from #1149 by @cwgem. This way it's ensured it is run and don't have to wait for a Rubyspec pull request.
diff --git a/bin/production_cache_test.rb b/bin/production_cache_test.rb index abc1234..def5678 100644 --- a/bin/production_cache_test.rb +++ b/bin/production_cache_test.rb @@ -36,6 +36,10 @@ puts page response = conn.get(page) + unless response.status == 200 + raise "Status code was #{response.status}" + end + unless DateTime.parse(response.headers['expires']).to_time > Time.now raise "Expires at #{response.headers['expires']}" end
Check production pages are 200 OK
diff --git a/test/integration_helper.rb b/test/integration_helper.rb index abc1234..def5678 100644 --- a/test/integration_helper.rb +++ b/test/integration_helper.rb @@ -40,10 +40,10 @@ end def setup - VCR.insert_cassette(api_name) + ENV['LIVE'] ? VCR.turn_off! : VCR.insert_cassette(api_name) end def teardown - VCR.eject_cassette + VCR.eject_cassette if VCR.turned_on? end end
Add switch to run integration against live data
diff --git a/spec/search_builder/sufia/single_admin_set_search_builder_spec.rb b/spec/search_builder/sufia/single_admin_set_search_builder_spec.rb index abc1234..def5678 100644 --- a/spec/search_builder/sufia/single_admin_set_search_builder_spec.rb +++ b/spec/search_builder/sufia/single_admin_set_search_builder_spec.rb @@ -6,7 +6,10 @@ current_ability: ability) } let(:builder) { described_class.new(context) } describe "#query" do + before do + expect(builder).to receive(:find_one) + end subject { builder.with(id: '123').query.fetch('fq') } - it { is_expected.to match_array ["", "{!terms f=has_model_ssim}AdminSet", "_query_:\"{!field f=id}123\""] } + it { is_expected.to match_array ["", "{!terms f=has_model_ssim}AdminSet"] } end end
Adjust test for changes in curation_concerns
diff --git a/spec/rails/unit/collection_spec.rb b/spec/rails/unit/collection_spec.rb index abc1234..def5678 100644 --- a/spec/rails/unit/collection_spec.rb +++ b/spec/rails/unit/collection_spec.rb @@ -9,9 +9,3 @@ c.db.name.should == 'mingo_rails_test' end end - -describe "Mingo.collection=" do - it "should raise an error if it's passed anything but a collection or nil" do - proc { Mingo.collection = 'blah' }.should raise_error StandardError, /was instead given blah/ - end -end
Remove rails test that's already covered in main suite.
diff --git a/test_site/sequel_setup.rb b/test_site/sequel_setup.rb index abc1234..def5678 100644 --- a/test_site/sequel_setup.rb +++ b/test_site/sequel_setup.rb @@ -2,8 +2,10 @@ require 'sequel' Sequel.single_threaded = true SequelDB = Sequel.sqlite("db/#{SE_TEST_FRAMEWORK}.sequel.sqlite3", :single_threaded=>true, :foreign_keys=>false) +Sequel::Model.plugin :prepared_statements +Sequel::Model.plugin :prepared_statements_associations %w'sq_employee sq_group sq_position sq_officer sq_meeting'.each{|x| require "model/#{x}"} require 'logger' -#SequelDB.logger = Logger.new(STDOUT) +SequelDB.logger = Logger.new(STDOUT) require 'sequel/extensions/inflector' require 'sequel/extensions/migration'
Use the Sequel prepared statement plugins in the test site
diff --git a/rom-yaml.gemspec b/rom-yaml.gemspec index abc1234..def5678 100644 --- a/rom-yaml.gemspec +++ b/rom-yaml.gemspec @@ -18,7 +18,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ['lib'] - spec.add_runtime_dependency 'rom-core', '~> 4.0.0.beta' + spec.add_runtime_dependency 'rom-core', '~> 4.0' spec.add_development_dependency 'bundler' spec.add_development_dependency 'rake'
Update rom version to rom-4
diff --git a/config/initializers/rollbar.rb b/config/initializers/rollbar.rb index abc1234..def5678 100644 --- a/config/initializers/rollbar.rb +++ b/config/initializers/rollbar.rb @@ -6,7 +6,7 @@ config.access_token = ENV['ROLLBAR_ACCESS_TOKEN'] # Here we'll disable in 'test': - if Rails.env.test? + if ['development', 'hot', 'test'].include?(Rails.env) config.enabled = false end
Disable Rollbar for dev envs
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,2 +1,9 @@ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) +require 'rspec' +require 'fakefs/safe' +require 'fakefs/spec_helpers' require 'failspell' + +RSpec.configure do |config| + config.include FakeFS::SpecHelpers, fakefs: true +end
Create a flag to include fakefs for specs
diff --git a/cookbooks/duckduckhack-vm/recipes/default.rb b/cookbooks/duckduckhack-vm/recipes/default.rb index abc1234..def5678 100644 --- a/cookbooks/duckduckhack-vm/recipes/default.rb +++ b/cookbooks/duckduckhack-vm/recipes/default.rb @@ -2,6 +2,10 @@ # Cookbook Name:: duckduckhack-vm # Recipe:: default # + +# Enable multiverse because many users will want to install packages from it. +execute "cp -a /etc/apt/sources.list /etc/apt/sources.list.before-multiverse" +execute 'awk \'{if ($1 == "#" && $5 == "multiverse") { print $2,$3,$4,$5} else {print $0}}\' /etc/apt/sources.list.before-multiverse > /etc/apt/sources.list' include_recipe "duckduckhack-vm::setpassword"
Enable multiverse because many users will want to install packages from it
diff --git a/db/migrate/20180712141700_fix_gss_codes_for_some_councils_in_existing_support_schemes.rb b/db/migrate/20180712141700_fix_gss_codes_for_some_councils_in_existing_support_schemes.rb index abc1234..def5678 100644 --- a/db/migrate/20180712141700_fix_gss_codes_for_some_councils_in_existing_support_schemes.rb +++ b/db/migrate/20180712141700_fix_gss_codes_for_some_councils_in_existing_support_schemes.rb @@ -0,0 +1,22 @@+class FixGssCodesForScottishCouncilsInExistingSupportSchemes < Mongoid::Migration + def self.up + Edition.skip_callback(:save, :before, :check_for_archived_artefact) + + fife_schemes = BusinessSupportEdition.where(area_gss_codes: "S12000015") + fife_schemes.each do |fi| + fi.area_gss_codes.delete("S12000015") + fi.area_gss_codes.push("S12000047") + fi.save!(validate: false) + end + + perth_kinross_schemes = BusinessSupportEdition.where(area_gss_codes: "S12000024") + perth_kinross_schemes.each do |pk| + pk.area_gss_codes.delete("S12000024") + pk.area_gss_codes.push("S12000048") + pk.save!(validate: false) + end + end + + def self.down + end +end
Fix GSS codes for two councils in Scotland with recent border changes
diff --git a/delocalize.gemspec b/delocalize.gemspec index abc1234..def5678 100644 --- a/delocalize.gemspec +++ b/delocalize.gemspec @@ -13,7 +13,7 @@ s.require_paths = ['lib'] s.test_files = Dir['test/**/*'] - s.add_dependency 'rails', '>= 3.0' + s.add_dependency 'rails', '>= 2' s.add_development_dependency 'mocha' s.add_development_dependency 'timecop' end
Allow Rails 2 in gemspec
diff --git a/lib/convection/model/template/resource_property/aws_cloudfront_defaultcachebehavior.rb b/lib/convection/model/template/resource_property/aws_cloudfront_defaultcachebehavior.rb index abc1234..def5678 100644 --- a/lib/convection/model/template/resource_property/aws_cloudfront_defaultcachebehavior.rb +++ b/lib/convection/model/template/resource_property/aws_cloudfront_defaultcachebehavior.rb @@ -12,6 +12,7 @@ property :compress, 'Compress' property :default_ttl, 'DefaultTTL' property :forwarded_values, 'ForwardedValues' + property :max_ttl, 'MaxTTL' property :min_ttl, 'MinTTL' property :smooth_streaming, 'SmoothStreaming' property :target_origin, 'TargetOriginId'
Add max ttl option for cloudfront
diff --git a/Watt.podspec b/Watt.podspec index abc1234..def5678 100644 --- a/Watt.podspec +++ b/Watt.podspec @@ -7,9 +7,9 @@ s.source = { :git => 'https://github.com/benoit-pereira-da-silva/Watt.git'} s.license = { :type => "LGPL", :file => "LICENSE" } - s.platform = :ios, '5.0' + s.ios.deployment_target = '5.0' + s.osx.deployment_target = '10.7' s.requires_arc = true s.source_files = 'WattPlayer','WattPlayer/**/*.{h,m}' s.public_header_files = 'WattPlayer/**/*.h' - s.ios.deployment_target = '5.0' end
Support of Mac OS X 10.7
diff --git a/common_spree_dependencies.rb b/common_spree_dependencies.rb index abc1234..def5678 100644 --- a/common_spree_dependencies.rb +++ b/common_spree_dependencies.rb @@ -27,6 +27,7 @@ gem 'launchy' gem 'pry' gem 'webmock', '1.8.11' + gem 'email_spec', '1.4.0' end gemspec
Make frontend tests happy again by adding email_spec as a dependency
diff --git a/ducksauce.gemspec b/ducksauce.gemspec index abc1234..def5678 100644 --- a/ducksauce.gemspec +++ b/ducksauce.gemspec @@ -1,4 +1,5 @@ # -*- encoding: utf-8 -*- + lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'ducksauce/version' @@ -9,7 +10,7 @@ gem.authors = ['Josh Ballanco'] gem.email = ['jballanc@gmail.com'] gem.license = 'BSD 2-Clause' - gem.description = 'DuckSauce handles duck type boilerplate so you don\'t have to.' + gem.description = 'DuckSauce handles duck typing so you don\'t have to.' gem.summary = <<-EOS.lines.map(&:lstrip).join DuckSauce is a gem that takes the hard work out of doing duck typing in Ruby. It allows you to both quickly @@ -19,7 +20,10 @@ EOS gem.homepage = 'https://github.com/jballanc/ducksauce' - gem.files = Dir['{lib,test}/**/*.rb'] + %w|README.md NEWS.md LICENSE.txt ducksauce.gemspec| - gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) + gem.required_ruby_version = '>= 2.1.0' + + gem.files = Dir['{lib,test}/**/*.rb'] + gem.files += %w|README.md NEWS.md COPYING ducksauce.gemspec| + gem.test_files = gem.files.grep(%r|^test/|) gem.require_paths = ['lib'] end
Add Ruby 2.1.0 requirement to Gemspec
diff --git a/business.gemspec b/business.gemspec index abc1234..def5678 100644 --- a/business.gemspec +++ b/business.gemspec @@ -23,5 +23,5 @@ spec.add_development_dependency "gc_ruboconfig", "~> 2.23.0" spec.add_development_dependency "rspec", "~> 3.1" spec.add_development_dependency "rspec_junit_formatter", "~> 0.4.1" - spec.add_development_dependency "rubocop", "~> 1.5.2" + spec.add_development_dependency "rubocop", "~> 1.6.0" end
Update rubocop requirement from ~> 1.5.2 to ~> 1.6.0 Updates the requirements on [rubocop](https://github.com/rubocop-hq/rubocop) to permit the latest version. - [Release notes](https://github.com/rubocop-hq/rubocop/releases) - [Changelog](https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop-hq/rubocop/compare/v1.5.2...v1.6.0) Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>
diff --git a/editorium.gemspec b/editorium.gemspec index abc1234..def5678 100644 --- a/editorium.gemspec +++ b/editorium.gemspec @@ -8,8 +8,8 @@ spec.version = Editorium::VERSION spec.authors = ["Gabor Babicz"] spec.email = ["gabor.babicz@gmail.com"] - spec.summary = %q{TODO: Write a short summary. Required.} - spec.description = %q{TODO: Write a longer description. Optional.} + spec.summary = %q{Will fill out later.} + spec.description = %q{Will fill out later.} spec.homepage = "" spec.license = "MIT"
Remove TODOs so that rake will work correctly
diff --git a/lib/shell_commands/shell_command.rb b/lib/shell_commands/shell_command.rb index abc1234..def5678 100644 --- a/lib/shell_commands/shell_command.rb +++ b/lib/shell_commands/shell_command.rb @@ -20,9 +20,9 @@ end @@last_result = { - :command => command, - :result => result, - :success => $?.success? + "command" => command, + "result" => result, + "success" => $?.success? } @@results << @@last_result return $?.success?
Use strings as keys in the results hash
diff --git a/lib/tasks/auto_annotate_models.rake b/lib/tasks/auto_annotate_models.rake index abc1234..def5678 100644 --- a/lib/tasks/auto_annotate_models.rake +++ b/lib/tasks/auto_annotate_models.rake @@ -1,6 +1,4 @@-# NOTE: only doing this in development as some production environments (Heroku) -# NOTE: are sensitive to local FS writes, and besides -- it's just not proper -# NOTE: to have a dev-mode tool do its thing in production. +# frozen_string_literal: true if Rails.env.development? task :set_annotation_options do # You can override any of these by setting an environment variable of the @@ -16,6 +14,9 @@ 'model_dir' => 'app/models', 'include_version' => 'false', 'require' => '', + 'exclude_scaffolds' => 'true', + 'exclude_controllers' => 'true', + 'exclude_helpers' => 'true', 'exclude_tests' => 'true', 'exclude_fixtures' => 'false', 'exclude_factories' => 'false',
Exclude controllers and helpers to be annoted by the annotation gem
diff --git a/spree_s3.gemspec b/spree_s3.gemspec index abc1234..def5678 100644 --- a/spree_s3.gemspec +++ b/spree_s3.gemspec @@ -16,7 +16,7 @@ s.require_path = 'lib' s.requirements << 'none' - s.add_dependency 'spree_core', '~> 1.0.0' + s.add_dependency 'spree_core', '~> 1.0' s.add_dependency 'aws-sdk', '~> 1.3.4' s.add_development_dependency 'capybara', '1.0.1'
Change to support Spree 1.x series
diff --git a/clash.gemspec b/clash.gemspec index abc1234..def5678 100644 --- a/clash.gemspec +++ b/clash.gemspec @@ -13,9 +13,8 @@ spec.homepage = "https://github.com/imathis/clash" spec.license = "MIT" - spec.files = `git ls-files -z`.split("\x0") + spec.files = `git ls-files -z`.split("\x0").grep(%r{(bin|lib)/}) 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_runtime_dependency "diffy", "~> 3.0"
Remove test files from gem distribution.
diff --git a/roles/web-db.rb b/roles/web-db.rb index abc1234..def5678 100644 --- a/roles/web-db.rb +++ b/roles/web-db.rb @@ -4,6 +4,6 @@ default_attributes( :web => { :database_host => "katla.bm.openstreetmap.org", - :readonly_database_host => "katla.bm.openstreetmap.org" + :readonly_database_host => "ramoth.ic.openstreetmap.org" } )
Move readonly database load to ramoth
diff --git a/rollbar.gemspec b/rollbar.gemspec index abc1234..def5678 100644 --- a/rollbar.gemspec +++ b/rollbar.gemspec @@ -19,18 +19,5 @@ gem.require_paths = ["lib"] gem.version = Rollbar::VERSION - gem.add_development_dependency 'oj', '~> 2.12.14' unless is_jruby - - gem.add_development_dependency 'sidekiq', '>= 2.13.0' if RUBY_VERSION != '1.8.7' - if RUBY_VERSION.start_with?('1.9') - gem.add_development_dependency 'sucker_punch', '~> 1.0' - elsif RUBY_VERSION.start_with?('2') - gem.add_development_dependency 'sucker_punch', '~> 2.0' - end - - gem.add_development_dependency 'sinatra' - gem.add_development_dependency 'resque' - gem.add_development_dependency 'delayed_job' - gem.add_development_dependency 'redis' gem.add_runtime_dependency 'multi_json' end
Remove dev dependencies from gemspec We use the gemfiles in gemfiles/ for the tests.
diff --git a/skymorph.gemspec b/skymorph.gemspec index abc1234..def5678 100644 --- a/skymorph.gemspec +++ b/skymorph.gemspec @@ -18,8 +18,9 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] + spec.add_dependency "nokogiri" + spec.add_development_dependency "bundler", "~> 1.3" spec.add_development_dependency "rake" spec.add_development_dependency "rspec" - spec.add_development_dependency "nokogiri" end
Move nokogiri to runtime dependencies
diff --git a/chef-api.gemspec b/chef-api.gemspec index abc1234..def5678 100644 --- a/chef-api.gemspec +++ b/chef-api.gemspec @@ -6,8 +6,8 @@ Gem::Specification.new do |spec| spec.name = 'chef-api' spec.version = ChefAPI::VERSION - spec.authors = ['Seth Vargo'] - spec.email = ['sethvargo@gmail.com'] + spec.authors = ['Seth Vargo', 'Tim Smith'] + spec.email = ['sethvargo@gmail.com', 'tsmith84@gmail.com'] spec.description = 'A tiny Chef API client with minimal dependencies' spec.summary = 'A Chef API client in Ruby' spec.homepage = 'https://github.com/sethvargo/chef-api'
Add myself to the author list now Thanks for the handoff Seth Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/enumerable-statistics.gemspec b/enumerable-statistics.gemspec index abc1234..def5678 100644 --- a/enumerable-statistics.gemspec +++ b/enumerable-statistics.gemspec @@ -4,7 +4,7 @@ Gem::Specification.new do |spec| spec.name = "enumerable-statistics" - spec.version = '1.1.0' + spec.version = '1.1.0.dev' spec.authors = ["Kenta Murata"] spec.email = ["mrkn@mrkn.jp"]
Add .dev suffix in version number
diff --git a/init.rb b/init.rb index abc1234..def5678 100644 --- a/init.rb +++ b/init.rb @@ -1,6 +1,6 @@ # Include hook code here -require "lib/emailthing" +require File.dirname(__FILE__) + "lib/emailthing" require "net/http" require "action_mailer"
Make plugin use full path
diff --git a/spec/automation/unit/method_validation/vm_migrate_task_complete_spec.rb b/spec/automation/unit/method_validation/vm_migrate_task_complete_spec.rb index abc1234..def5678 100644 --- a/spec/automation/unit/method_validation/vm_migrate_task_complete_spec.rb +++ b/spec/automation/unit/method_validation/vm_migrate_task_complete_spec.rb @@ -0,0 +1,23 @@+require 'spec_helper' + +describe 'vmmigratetask_complete method' do + let(:miq_server) { EvmSpecHelper.local_miq_server } + let(:user) { FactoryGirl.create(:user_with_email_and_group) } + let(:miq_request_task) { FactoryGirl.create(:miq_request_task, :miq_request => request, :source => vm) } + let(:request) { FactoryGirl.create(:vm_migrate_request, :requester => user) } + + let(:ems) { FactoryGirl.create(:ems_vmware, :tenant => Tenant.root_tenant) } + let(:vm) { FactoryGirl.create(:vm_vmware, :ems_id => ems.id, :evm_owner => user) } + + it 'sends email' do + expect(GenericMailer).to receive(:deliver).with(:automation_notification, + hash_including(:to => user.email, + :from => "evmadmin@example.com" + ) + ) + attrs = ["MiqServer::miq_server=#{miq_server.id}"] + attrs << "MiqRequestTask::vm_migrate_task=#{miq_request_task.id}" + attrs << "vm_migrate_task_id=#{miq_request_task.id}" + MiqAeEngine.instantiate("/Infrastructure/VM/Migrate/Email/VmMigrateTask_Complete?event=vm_migrated&#{attrs.join('&')}", user) + end +end
Add test case for automate method vmmigratetask_complete. https://bugzilla.redhat.com/show_bug.cgi?id=1284110
diff --git a/griddler-mandrill.gemspec b/griddler-mandrill.gemspec index abc1234..def5678 100644 --- a/griddler-mandrill.gemspec +++ b/griddler-mandrill.gemspec @@ -9,7 +9,7 @@ spec.authors = ['Stafford Brunk'] spec.email = ['stafford.brunk@gmail.com'] spec.summary = %q{Mandrill adapter for Griddler} - spec.description = %q{Adapter to allow the use of Mandrill's Inboud Email Processing with Griddler} + spec.description = %q{Adapter to allow the use of Mandrill's Inbound Email Processing with Griddler} spec.homepage = 'https://github.com/wingrunr21/griddler-mandrill' spec.license = 'MIT'
Fix typo in gem description
diff --git a/spec/commands/deploy_spec.rb b/spec/commands/deploy_spec.rb index abc1234..def5678 100644 --- a/spec/commands/deploy_spec.rb +++ b/spec/commands/deploy_spec.rb @@ -15,7 +15,7 @@ end it "should honor releases_path" do - stdout.should include "#{Dir.pwd}/deploy/releases" + stdout.should include "releases/" end it "should symlink the current_path" do
Update the deploy spec which got outta sync.
diff --git a/spec/lhm_integration_spec.rb b/spec/lhm_integration_spec.rb index abc1234..def5678 100644 --- a/spec/lhm_integration_spec.rb +++ b/spec/lhm_integration_spec.rb @@ -16,7 +16,7 @@ context 'creating column', index: true do let(:direction) { :up } - it 'adds the column in the DB table' do + xit 'adds the column in the DB table' do ActiveRecord::Migrator.new( direction, [migration_fixtures],
Mark lhm integration test as pending. We'll be done in another branch
diff --git a/Casks/duplicate-annihilator.rb b/Casks/duplicate-annihilator.rb index abc1234..def5678 100644 --- a/Casks/duplicate-annihilator.rb +++ b/Casks/duplicate-annihilator.rb @@ -1,8 +1,8 @@ class DuplicateAnnihilator < Cask url 'http://brattoo.com/propaganda/downloadDa.php' homepage 'http://brattoo.com/propaganda/' - version '4.16.0' - sha1 '80af306c21f1f6c16d08fe6a672af3d20a43591d' + version 'latest' + no_checksum nested_container 'Duplicate Annihilator.dmg' link 'Duplicate Annihilator.app' end
Switch to latest version, no_checksum
diff --git a/Casks/soundcloud-downloader.rb b/Casks/soundcloud-downloader.rb index abc1234..def5678 100644 --- a/Casks/soundcloud-downloader.rb +++ b/Casks/soundcloud-downloader.rb @@ -1,8 +1,8 @@ cask :v1 => 'soundcloud-downloader' do - version '2.6.2' - sha256 'a68b69c3c1e523a1f93f8f9d774f8fa071e33cd0bbebdaaf7972103a58832005' + version '2.6.4' + sha256 'eabb5f3f7ef0db45a804a720069fa98160ff51ca6ec6e0184423f1f4ef98e0af' - url "http://black-burn.ch/scd/downloads/#{version.delete('.')}/ex/b" + url "http://black-burn.ch/scd/downloads/#{version.delete('.')}/in/b" name 'SoundCloud Downloader' appcast 'http://black-burn.ch/applications/scd/updates.php?hwni=1', :sha256 => '3aec7755cdc3208b781ce41613d60f8e574f6c34e3fd819826e6734dd7aac70d'
Update SoundCloud Downloader to 2.6.4
diff --git a/examples/eventmachine_adapter/tls/tls_without_peer_verification.rb b/examples/eventmachine_adapter/tls/tls_without_peer_verification.rb index abc1234..def5678 100644 --- a/examples/eventmachine_adapter/tls/tls_without_peer_verification.rb +++ b/examples/eventmachine_adapter/tls/tls_without_peer_verification.rb @@ -10,7 +10,7 @@ EM.run do AMQ::Client::EventMachineClient.connect(:port => 5671, - :vhost => "/amq_client_testbed", + :vhost => "amq_client_testbed", :user => "amq_client_gem", :password => "amq_client_gem_password", :ssl => { @@ -33,4 +33,4 @@ # TLS connections take forever and a day # (compared to non-TLS connections) to estabilish. EM.add_timer(8, show_stopper) -end+end
Correct vhost to not use leading slash
diff --git a/vendor/plugins/model_stubbing/lib/model_stubbing/extensions.rb b/vendor/plugins/model_stubbing/lib/model_stubbing/extensions.rb index abc1234..def5678 100644 --- a/vendor/plugins/model_stubbing/lib/model_stubbing/extensions.rb +++ b/vendor/plugins/model_stubbing/lib/model_stubbing/extensions.rb @@ -48,6 +48,7 @@ end if database? ActiveRecord::Base.connection.rollback_db_transaction + ActiveRecord::Base.connection.decrement_open_transactions ActiveRecord::Base.verify_active_connections! end end
Update to history's fork of model_stubbing to make compat with Edge Rails.
diff --git a/config/common_application.rb b/config/common_application.rb index abc1234..def5678 100644 --- a/config/common_application.rb +++ b/config/common_application.rb @@ -8,6 +8,7 @@ set :server, [:thin, :mongrel, :webrick] set :host, '0.0.0.0' set :port, 3000 +set :development, false # Default controllers set :root_page, ::User_Page_Index
Make `development' context entry exist in all common application configurations
diff --git a/lib/cc/engine/source_file.rb b/lib/cc/engine/source_file.rb index abc1234..def5678 100644 --- a/lib/cc/engine/source_file.rb +++ b/lib/cc/engine/source_file.rb @@ -32,7 +32,7 @@ end def rubocop_team - RuboCop::Cop::Team.new(RuboCop::Cop::Cop.all, config_store) + RuboCop::Cop::Team.new(RuboCop::Cop::Cop.registry, config_store) end def display_path
Replace Cop.all with Cop.registry to follow rubocop refactoring
diff --git a/lib/cellular/backends/log.rb b/lib/cellular/backends/log.rb index abc1234..def5678 100644 --- a/lib/cellular/backends/log.rb +++ b/lib/cellular/backends/log.rb @@ -2,7 +2,7 @@ module Backends class Log def self.deliver(options = {}, savon_options = {}) - STDOUT.puts options[:message] + $stdout.puts options[:message] end def self.receive(data)
Use $stdout instead of STDOUT Fixes #8
diff --git a/lib/email_center_api/base.rb b/lib/email_center_api/base.rb index abc1234..def5678 100644 --- a/lib/email_center_api/base.rb +++ b/lib/email_center_api/base.rb @@ -2,6 +2,10 @@ class Base include HTTParty default_timeout 10 + + def to_i + id + end def self.get(*args, &block) base_uri EmailCenterApi.endpoint
Make the objects respond to_i
diff --git a/lib/ffi-glib/list_methods.rb b/lib/ffi-glib/list_methods.rb index abc1234..def5678 100644 --- a/lib/ffi-glib/list_methods.rb +++ b/lib/ffi-glib/list_methods.rb @@ -11,7 +11,7 @@ replace_method base, :next, :tail replace_method base, :data, :head - base.singleton_class.send :remove_method, :new + class << base; self end.send :remove_method, :new base.extend ListClassMethods base.extend ContainerClassMethods
Use 1.8.7-compatible way of getting the singleton class
diff --git a/lib/kafka/pending_message.rb b/lib/kafka/pending_message.rb index abc1234..def5678 100644 --- a/lib/kafka/pending_message.rb +++ b/lib/kafka/pending_message.rb @@ -11,5 +11,15 @@ @create_time = create_time @bytesize = key.to_s.bytesize + value.to_s.bytesize end + + def ==(other) + @value == other.value && + @key == other.key && + @topic == other.topic && + @partition == other.partition && + @partition_key == other.partition_key && + @create_time == other.create_time && + @bytesize == other.bytesize + end end end
Support equality checks for Kafka::PendingMessage
diff --git a/test/features/support/pages/catalinker/catalinker_client.rb b/test/features/support/pages/catalinker/catalinker_client.rb index abc1234..def5678 100644 --- a/test/features/support/pages/catalinker/catalinker_client.rb +++ b/test/features/support/pages/catalinker/catalinker_client.rb @@ -3,6 +3,10 @@ require_relative '../page_root.rb' class CatalinkerClient < PageRoot + def ontology_ns + "http://192.168.50.12:8005/ontology#" + end + def visit @browser.goto catalinker_client(:home) self @@ -11,25 +15,18 @@ def add(title, author, date, biblio) @browser.button(:data_automation_id => /new_work_button/).click - addTriple("navn", title) - addTriple("dato", date) + addTriple("name", title) + addTriple("year", date) addTriple("biblio", biblio) if biblio - addTriple("skaper", author) + addTriple("creator", author) self end def addTriple(field, value) - predicate_selector = @browser.element(:data_automation_id => /predicate_selector/) - predicate_selector.wait_until_present - predicate_selector.click - predicate_selector.send_keys field, :tab, :enter - - # Occasionaly the predicate dropdown lingers on, so we fire an extra tab key - # to make it disappair. - @browser.send_keys :tab - - input = @browser.text_field(:data_automation_id => field) + @browser.select_list(:data_automation_id => /predicate_selector/).select_value(self.ontology_ns+field) + @browser.button(:text => "+").click + input = @browser.text_field(:data_automation_id => self.ontology_ns+field) input.set(value) end
Make test pass on non-material-design ui
diff --git a/lib/tasks/elasticsearch.rake b/lib/tasks/elasticsearch.rake index abc1234..def5678 100644 --- a/lib/tasks/elasticsearch.rake +++ b/lib/tasks/elasticsearch.rake @@ -8,4 +8,22 @@ Rubygem.__elasticsearch__.create_index! force: true Rubygem.__elasticsearch__.refresh_index! end + + task :import_alias do + idx = Rubygem.__elasticsearch__.index_name + res = Rubygem.__elasticsearch__.client.count index: idx + puts "Count before import: #{res['count']}" + + new_idx = "#{idx}-#{Time.zone.today.strftime('%Y%m%d')}" + Rubygem.import index: new_idx, force: true + res = Rubygem.__elasticsearch__.client.count index: new_idx + puts "Count after import: #{res['count']}" + + Rubygem.__elasticsearch__.delete_index! index: idx + Rubygem.__elasticsearch__.client.indices.update_aliases body: { + actions: [ + { add: { index: new_idx, alias: idx } } + ] + } + end end
Add rake task to import and create alias
diff --git a/lib/tasks/rglossa_tasks.rake b/lib/tasks/rglossa_tasks.rake index abc1234..def5678 100644 --- a/lib/tasks/rglossa_tasks.rake +++ b/lib/tasks/rglossa_tasks.rake @@ -1,4 +1,19 @@-# desc "Explaining what the task does" -# task :rglossa do -# # Task goes here -# end +namespace "rglossa" do + namespace "install" do + + desc "Install thor scripts" + task :thor do + puts "Installing thor scripts..." + + filenames = "rglossa_*.thor" + source = Dir["#{Rglossa::Engine.root}/lib/tasks/#{filenames}"] + dest = "#{Rails.root}/lib/tasks" + old_files = Dir["#{dest}/#{filenames}"] + + FileUtils.rm(old_files) + FileUtils.cp(source, dest) + end + + end + +end
Add rake task for copying thor scripts to host app
diff --git a/lib/watch_tower/appscript.rb b/lib/watch_tower/appscript.rb index abc1234..def5678 100644 --- a/lib/watch_tower/appscript.rb +++ b/lib/watch_tower/appscript.rb @@ -1,8 +1,15 @@ # -*- encoding: utf-8 -*- begin + require 'rubygems' require 'appscript' rescue LoadError + require 'rbconfig' + if RbConfig::CONFIG['target_os'] =~ /darwin/i + STDERR.puts "Please install 'appscript' to use this gem with Textmate" + STDERR.puts "gem install appscript" + end + # Define a part of the Appscript gem so WatchTower is fully operational module ::Appscript CommandError = Class.new(Exception)
Revert "Appscript: Remove the useless message it is now included in the Gemspec." This reverts commit 5c6b9c92247a02183404c23a5a79da5638fbd518.
diff --git a/omnibus/files/private-chef-cookbooks/private-chef/recipes/plugin_chef_run.rb b/omnibus/files/private-chef-cookbooks/private-chef/recipes/plugin_chef_run.rb index abc1234..def5678 100644 --- a/omnibus/files/private-chef-cookbooks/private-chef/recipes/plugin_chef_run.rb +++ b/omnibus/files/private-chef-cookbooks/private-chef/recipes/plugin_chef_run.rb @@ -12,6 +12,12 @@ plugins.each do |plugin| next if !plugin.parent_plugin.nil? + + if plugin.cookbook_path.nil? + Chef::Log.warn("The plugin #{plugin.name} does not include a cookbook path.") + next + end + chef_run plugin.run_list do cookbook_path plugin.cookbook_path included_attrs ["private_chef"]
Allow plugins to leave cookbook_path unset Some plugins (such as the new chef-aws plugin) do not require additional configuration. Previously, we required such plugins to define empty enable and disable recipes. This commit allow such plugins to leave cookbook_path unset if they don't have cookbooks to run.
diff --git a/Library/Formula/sublercli.rb b/Library/Formula/sublercli.rb index abc1234..def5678 100644 --- a/Library/Formula/sublercli.rb +++ b/Library/Formula/sublercli.rb @@ -0,0 +1,14 @@+require 'formula' + +class Sublercli <Formula + head 'http://subler.googlecode.com/svn/trunk/' + homepage 'http://code.google.com/p/subler/' + + def install + ENV.llvm + cd "SublerCLI" do + system "xcodebuild -configuration Release ARCHS='-arch i386 -arch x86_64'" + bin.install "build/Release/SublerCLI" + end + end +end
Add formula to build SublerCLI from SVN Signed-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>
diff --git a/Casks/wimoweh-beta.rb b/Casks/wimoweh-beta.rb index abc1234..def5678 100644 --- a/Casks/wimoweh-beta.rb +++ b/Casks/wimoweh-beta.rb @@ -1,5 +1,5 @@ class WimowehBeta < Cask - url 'http://www.serialangels.co.uk/sa-content/uploads/2013/12/Wimoweh.0.66.BETA.zip' + url 'http://www.serialangels.co.uk/sa-content/uploads/2013/12/Wimoweh.0.66.BETA_.zip' homepage 'http://www.serialangels.co.uk/index.php/wimoweh/' version '0.66-beta' sha1 '5d408c963e0b4318cbbe933e17facde8dad74a51'
Fix Wimoweh Beta URL Missed a rogue _ before the file extension, not sure why the dev has it there.
diff --git a/Library/Homebrew/extend/ENV.rb b/Library/Homebrew/extend/ENV.rb index abc1234..def5678 100644 --- a/Library/Homebrew/extend/ENV.rb +++ b/Library/Homebrew/extend/ENV.rb @@ -4,10 +4,7 @@ require 'extend/ENV/super' def superenv? - return false if MacOS::Xcode.without_clt? && MacOS.sdk_path.nil? - return false unless Superenv.bin && Superenv.bin.directory? - return false if ARGV.env == "std" - true + Superenv.bin && Superenv.bin.directory? && ARGV.env != "std" end module EnvActivation
Simplify conditions for superenv activation `MacOS::Xcode.without_clt? && MacOS.sdk_path.nil?` should never be true. In its earliest form, this would raise a bare RuntimeError in an effort to have the bug reported. Later, it was changed to silently disable superenv. But we don't want to do that. If there's a bug, or the user's system is misconfigured, we want to know, so that we can fix the bug, or the user can fix their system. So let's remove the condition.
diff --git a/app/services/testing_ground/tree_sampler.rb b/app/services/testing_ground/tree_sampler.rb index abc1234..def5678 100644 --- a/app/services/testing_ground/tree_sampler.rb +++ b/app/services/testing_ground/tree_sampler.rb @@ -1,8 +1,10 @@ class TestingGround - class TreeSampler + module TreeSampler RESOLUTION_LENGTH_LOW = 365 - def self.sample(networks, resolution = nil, nodes = nil) + module_function + + def sample(networks, resolution = nil, nodes = nil) Hash[networks.each_pair.map do |carrier, graph| NetworkCache::LoadSetter.set(graph, nodes) do |node| downsample(node.load, resolution || :low) @@ -12,7 +14,7 @@ end] end - def self.downsample(node_load, resolution) + def downsample(node_load, resolution) size = (node_load.length / RESOLUTION_LENGTH_LOW).floor if resolution.to_sym == :low && size > 0
Change TreeSampler to be a module
diff --git a/Casks/identify.rb b/Casks/identify.rb index abc1234..def5678 100644 --- a/Casks/identify.rb +++ b/Casks/identify.rb @@ -1,7 +1,7 @@ class Identify < Cask - url 'https://www.macupdate.com/download/33814/iDentifyLite532.zip' + url 'https://www.macupdate.com/download/33814/iDentifyLite545.zip' homepage 'http://identify2.arrmihardies.com/' - version '532' - sha1 'cf1ce8abc5f3c2cc545177d40e0a3615e74150fc' + version '545' + sha256 'e850d12335befe8c092b8758f0ca1b26cb7f0c1decda98e5ef0525b3a37fb2d2' link 'iDentify.app' end
Update Identify to version 545
diff --git a/lib/patches/translations_for_associations.rb b/lib/patches/translations_for_associations.rb index abc1234..def5678 100644 --- a/lib/patches/translations_for_associations.rb +++ b/lib/patches/translations_for_associations.rb @@ -13,6 +13,7 @@ translation_class = association_class.translation_class locales = translation_class.translated_locales if locales.empty? includes(association => :translations). + references(association). merge(translation_class.with_locales(locales)). merge(association_class.with_required_attributes) end
Disable deprecated implicit join references
diff --git a/lib/sitemap_generator/adapters/s3_adapter.rb b/lib/sitemap_generator/adapters/s3_adapter.rb index abc1234..def5678 100644 --- a/lib/sitemap_generator/adapters/s3_adapter.rb +++ b/lib/sitemap_generator/adapters/s3_adapter.rb @@ -15,7 +15,11 @@ storage = Fog::Storage.new(credentials) directory = storage.directories.get(ENV['FOG_DIRECTORY']) - directory.files.create(:key => location.path_in_public, :body => File.open(location.path)) + directory.files.create( + :key => location.path_in_public, + :body => File.open(location.path), + :public => true, + ) end end end
Add :public => true option when creating sitemap.
diff --git a/authy.gemspec b/authy.gemspec index abc1234..def5678 100644 --- a/authy.gemspec +++ b/authy.gemspec @@ -20,7 +20,7 @@ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ["lib"] - s.add_dependency('httpclient', '>= 2.3.4') + s.add_dependency('httpclient', '>= 2.5.3.3') s.add_development_dependency('rake') s.add_development_dependency('rspec')
Update the dependency of HttpClient to version 2.5.3.3
diff --git a/examples/association_loader.rb b/examples/association_loader.rb index abc1234..def5678 100644 --- a/examples/association_loader.rb +++ b/examples/association_loader.rb @@ -36,7 +36,7 @@ end def preload_association(records) - ::ActiveRecord::Associations::Preloader.new.preload(records, @association_name) + ::ActiveRecord::Associations::Preloader.new(records: records, associations: @association_name).call end def read_association(record)
Fix AssociationLoader Rails 7 Deprecation Warning Currently running this example code with rails 7 yields the following warning: ``` DEPRECATION WARNING: `preload` is deprecated and will be removed in Rails 7.0. Call `Preloader.new(kwargs).call` instead. ``` Updating the preloader code to use kwargs and call silences the warning.
diff --git a/BHCDatabase/app/controllers/users_controller.rb b/BHCDatabase/app/controllers/users_controller.rb index abc1234..def5678 100644 --- a/BHCDatabase/app/controllers/users_controller.rb +++ b/BHCDatabase/app/controllers/users_controller.rb @@ -42,11 +42,19 @@ User.where(:privilege => false) end - column(:id, :mandatory => true) - column(:name, :mandatory => true) + column(:id, :mandatory => true) do |model| + format(model.id) do |value| + link_to value, model + end + end + column(:name, :mandatory => true) do |model| + format(model.name) do |value| + link_to value, model + end + end column(:email, :mandatory => true) column(:telephone, :mandatory => true) column(:dob, :mandatory => true) column(:privilege, :mandatory => true) -end+end
Add links to each volunteer in volunteer table.
diff --git a/db/migrate/20200616162646_move_all_calculators_outside_the_spree_namespace.rb b/db/migrate/20200616162646_move_all_calculators_outside_the_spree_namespace.rb index abc1234..def5678 100644 --- a/db/migrate/20200616162646_move_all_calculators_outside_the_spree_namespace.rb +++ b/db/migrate/20200616162646_move_all_calculators_outside_the_spree_namespace.rb @@ -2,28 +2,36 @@ class MoveAllCalculatorsOutsideTheSpreeNamespace < ActiveRecord::Migration def up - convert_calculator("Spree::Calculator::DefaultTax", "Calculator::DefaultTax") - convert_calculator("Spree::Calculator::FlatPercentItemTotal", - "Calculator::FlatPercentItemTotal") - convert_calculator("Spree::Calculator::FlatRate", "Calculator::FlatRate") - convert_calculator("Spree::Calculator::FlexiRate", "Calculator::FlexiRate") - convert_calculator("Spree::Calculator::PerItem", "Calculator::PerItem") - convert_calculator("Spree::Calculator::PriceSack", "Calculator::PriceSack") + convert_calculator("DefaultTax") + convert_calculator("FlatPercentItemTotal") + convert_calculator("FlatRate") + convert_calculator("FlexiRate") + convert_calculator("PerItem") + convert_calculator("PriceSack") end def down - convert_calculator("Calculator::DefaultTax", "Spree::Calculator::DefaultTax") - convert_calculator("Calculator::FlatPercentItemTotal", - "Spree::Calculator::FlatPercentItemTotal") - convert_calculator("Calculator::FlatRate", "Spree::Calculator::FlatRate") - convert_calculator("Calculator::FlexiRate", "Spree::Calculator::FlexiRate") - convert_calculator("Calculator::PerItem", "Spree::Calculator::PerItem") - convert_calculator("Calculator::PriceSack", "Spree::Calculator::PriceSack") + revert_calculator("DefaultTax") + revert_calculator("FlatPercentItemTotal") + revert_calculator("FlatRate") + revert_calculator("FlexiRate") + revert_calculator("PerItem") + revert_calculator("PriceSack") end private - def convert_calculator(from, to) + def convert_calculator(calculator_base_name) + update_calculator("Spree::Calculator::" + calculator_base_name, + "Calculator::" + calculator_base_name) + end + + def revert_calculator(calculator_base_name) + update_calculator("Calculator::" + calculator_base_name, + "Spree::Calculator::" + calculator_base_name) + end + + def update_calculator(from, to) Spree::Calculator.connection.execute( "UPDATE spree_calculators SET type = '" + to + "' WHERE type = '" + from + "'" )
Make migration a bit easier to read
diff --git a/redis-rack-cache.gemspec b/redis-rack-cache.gemspec index abc1234..def5678 100644 --- a/redis-rack-cache.gemspec +++ b/redis-rack-cache.gemspec @@ -20,7 +20,7 @@ s.add_dependency 'rack-cache', '>= 1.6', '< 2' s.add_development_dependency 'rake', '~> 10' - s.add_development_dependency 'bundler', '~> 2' + s.add_development_dependency 'bundler', '> 1', '< 3' s.add_development_dependency 'mocha', '~> 0.14.0' s.add_development_dependency 'minitest', '~> 5' s.add_development_dependency 'redis-store-testing', '~> 0'
Update bundler dependency to be more permissive
diff --git a/fastlane-plugin-trainer/lib/fastlane/plugin/trainer/actions/trainer_action.rb b/fastlane-plugin-trainer/lib/fastlane/plugin/trainer/actions/trainer_action.rb index abc1234..def5678 100644 --- a/fastlane-plugin-trainer/lib/fastlane/plugin/trainer/actions/trainer_action.rb +++ b/fastlane-plugin-trainer/lib/fastlane/plugin/trainer/actions/trainer_action.rb @@ -9,7 +9,7 @@ resulting_paths = ::Trainer::TestParser.auto_convert(params) resulting_paths.each do |path, test_successful| - UI.user_error!("Unit tests failed", show_github_issues: false) unless test_successful + UI.test_failure!("Unit tests failed") unless test_successful end return resulting_paths
Switch from user_error! to test_failure!
diff --git a/lib/godmin/application.rb b/lib/godmin/application.rb index abc1234..def5678 100644 --- a/lib/godmin/application.rb +++ b/lib/godmin/application.rb @@ -16,7 +16,7 @@ helper_method :authentication_enabled? helper_method :authorization_enabled? - before_action :append_view_paths + before_action :prepend_view_paths layout "godmin/application" end @@ -25,9 +25,9 @@ private - def append_view_paths - append_view_path Godmin::EngineResolver.new(controller_name) - append_view_path Godmin::GodminResolver.new(controller_name) + def prepend_view_paths + prepend_view_path Godmin::GodminResolver.new(controller_name) + prepend_view_path Godmin::EngineResolver.new(controller_name) end def authentication_enabled?
Prepend view paths to make our override the Rails default
diff --git a/test/unit/counter_cache_test.rb b/test/unit/counter_cache_test.rb index abc1234..def5678 100644 --- a/test/unit/counter_cache_test.rb +++ b/test/unit/counter_cache_test.rb @@ -11,9 +11,13 @@ cc.increment :foo, :by => 5 assert_equal 6, cc[:foo] + # legacy style + cc.increment :foo, 2 + assert_equal 8, cc[:foo] + # strings or symbols work cc.increment 'foo' - assert_equal 7, cc['foo'] + assert_equal 9, cc['foo'] end def test_custom_sources
Add test to cover legacy style of >1 incrementation
diff --git a/lib/niles/helpers/html.rb b/lib/niles/helpers/html.rb index abc1234..def5678 100644 --- a/lib/niles/helpers/html.rb +++ b/lib/niles/helpers/html.rb @@ -25,12 +25,16 @@ html_tag(:a, options.merge(href: url_for(target))) { name } end - def url_for(what) - case what - when String then what - when Symbol then "/#{what}" - when Array then target.map { |i| url_for i }.join - else what.to_s + def url_for(*what) + return what.first if what.size == 1 && what.first.is_a?(String) + + what.flatten.inject('') do |url, item| + url << "/%s" % case item + when String, Symbol then item.to_s + else "%s/%s" % [item.class.to_s.tableize.pluralize, item.try(:to_param) || item.try(:to_id) || item.try(:id)] + end + + url end end
Make url_for helper object aware
diff --git a/lib/pah/partials/_gems.rb b/lib/pah/partials/_gems.rb index abc1234..def5678 100644 --- a/lib/pah/partials/_gems.rb +++ b/lib/pah/partials/_gems.rb @@ -3,13 +3,17 @@ in_root do gsub_file 'Gemfile', /RAILS_VERSION/, ::Pah::RAILS_VERSION - # Since the gemset is likely empty, manually install bundler so it can install the rest - if !(run "gem install bundler --no-ri --no-rdoc") - puts "Error installing bundler, will attempt to continue" + begin + require 'bundler' + rescue LoadError + # Install bundler if needed + if !(run "gem install bundler --no-ri --no-rdoc") + puts "Error installing bundler, will attempt to continue" + end + require 'bundler' end # Install all other gems needed from Gemfile - require 'bundler' Bundler.with_clean_env do if !(run "bundle install --jobs=4") puts "Error installing gems, aborting"
Install bundler only when needed in order to speed up the build
diff --git a/lib/phonenumber-client.rb b/lib/phonenumber-client.rb index abc1234..def5678 100644 --- a/lib/phonenumber-client.rb +++ b/lib/phonenumber-client.rb @@ -0,0 +1,11 @@+require 'httparty' + +module PhoneNumberClient + include HTTParty + + base_uri 'http://phonenumber.herokuapp.com' + + def self.phone_number number, country_code + get('/', :query => { :number => number, :country_code => country_code }).parsed_response + end +end
Create PhoneNumberClient class with phone_number method.
diff --git a/lib/rubiks/nodes/level.rb b/lib/rubiks/nodes/level.rb index abc1234..def5678 100644 --- a/lib/rubiks/nodes/level.rb +++ b/lib/rubiks/nodes/level.rb @@ -1,5 +1,4 @@ require 'rubiks/nodes/annotated_node' -require 'rubiks/nodes/hierarchy' module ::Rubiks
Remove unnecessary require in Level
diff --git a/lib/schnitzelpress/app.rb b/lib/schnitzelpress/app.rb index abc1234..def5678 100644 --- a/lib/schnitzelpress/app.rb +++ b/lib/schnitzelpress/app.rb @@ -2,8 +2,7 @@ class App < Sinatra::Base set :views, Schnitzelpress.root.join('lib').join('views') - use Rack::Session::Cookie - set :session_secret, Random.rand.to_s + use Rack::Session::Cookie, :secret => Random.rand.to_s helpers Sinatra::ContentFor helpers Schnitzelpress::Helpers
Set session cookie secret (for real this time)