diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/rb/lib/selenium/webdriver/chrome/profile.rb b/rb/lib/selenium/webdriver/chrome/profile.rb index abc1234..def5678 100644 --- a/rb/lib/selenium/webdriver/chrome/profile.rb +++ b/rb/lib/selenium/webdriver/chrome/profile.rb @@ -13,14 +13,11 @@ @model = verify_model(model) end - def layout_on_disk - dir = @model ? create_tmp_copy(@model) : Dir.mktmpdir("webdriver-chrome-profile") - FileReaper << dir - - write_prefs_to dir - - dir - end + # + # Set a preference in the profile. + # + # See http://codesearch.google.com/codesearch#OAMlx_jo-ck/src/chrome/common/pref_names.cc&exact_package=chromium + # def []=(key, value) parts = key.split(".") @@ -32,6 +29,17 @@ parts.inject(prefs) { |pr, k| pr.fetch(k) } end + def layout_on_disk + dir = @model ? create_tmp_copy(@model) : Dir.mktmpdir("webdriver-chrome-profile") + FileReaper << dir + + write_prefs_to dir + + dir + end + + private + def write_prefs_to(dir) prefs_file = prefs_file_for(dir) @@ -42,8 +50,6 @@ def prefs @prefs ||= read_model_prefs end - - private def read_model_prefs return {} unless @model
JariBakken: Add some docs to Chrome::Profile git-svn-id: 4179480af2c2519a5eb5e1e9b541cbdf5cf27696@13146 07704840-8298-11de-bf8c-fd130f914ac9
diff --git a/db/seeds.rb b/db/seeds.rb index abc1234..def5678 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -13,7 +13,7 @@ link = page.css('td.cafename')[item_num].css('a').first['href'] members = page.css('td.member')[item_num].text.gsub(/,/, '').to_f # members = 0 if members < 1 - @cafe = Cafe.where(title: name).first + @cafe = Cafe.where(url: link).first if @cafe @cafe.url = link @cafe.score = members
Check for url instead of name
diff --git a/Casks/istat-menus.rb b/Casks/istat-menus.rb index abc1234..def5678 100644 --- a/Casks/istat-menus.rb +++ b/Casks/istat-menus.rb @@ -1,6 +1,6 @@ cask :v1 => 'istat-menus' do - version '5.10' - sha256 'cde4c1b69201dbaa7a7f2adcf9ee5294d7b4201d141a3fde647a6bf90edc902b' + version '5.11' + sha256 'cb02606a90e1cf4a9b771b6e0418c1e37233e4d736be285d03e7f5f2f9d6d5c4' # amazonaws.com is the official download host per the vendor homepage url "https://s3.amazonaws.com/bjango/files/istatmenus5/istatmenus#{version}.zip"
Upgrade iStat Menus.app to v5.11.
diff --git a/test/test_rice.rb b/test/test_rice.rb index abc1234..def5678 100644 --- a/test/test_rice.rb +++ b/test/test_rice.rb @@ -1,15 +1,18 @@ require 'test/unit' +require 'rbconfig' class RiceTest < Test::Unit::TestCase # TODO: probably a better way to find this out... VERBOSE = ARGV.include?('-v') + EXEEXT = Config::CONFIG['EXEEXT'] + def test_unittest - run_external_test('./unittest') + run_external_test("./unittest#{EXEEXT}") end def test_vm_unittest - run_external_test('./vm_unittest') + run_external_test("./vm_unittest#{EXEEXT}") end def run_external_test(executable)
Append EXEEXT to executable names. git-svn-id: 81de8714785daa4de355a86eff9ce8518e4b389c@166 e2d4e900-5bc4-4db4-8b5f-7ecdbb188e69
diff --git a/features/support/env.rb b/features/support/env.rb index abc1234..def5678 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -1,3 +1,5 @@+require 'vim-flavor' + class FakeUserEnvironment def create_file virtual_path, content File.open(expand(virtual_path), 'w') do |f|
Load vim-flavor before running tests
diff --git a/lib/rbplusplus/builders/allocation_strategy.rb b/lib/rbplusplus/builders/allocation_strategy.rb index abc1234..def5678 100644 --- a/lib/rbplusplus/builders/allocation_strategy.rb +++ b/lib/rbplusplus/builders/allocation_strategy.rb @@ -20,13 +20,13 @@ end def write - includes << "#include <rice/Allocation_Strategies.hpp>" + includes << "#include <rice/Data_Object.hpp>" node_name = self.code.qualified_name code = <<-END namespace Rice { template<> - struct Default_Allocation_Strategy< #{node_name} > { + struct Default_Free_Function< #{node_name} > { static void free(#{node_name} * obj); }; } @@ -34,7 +34,7 @@ declarations << code - pre = "Rice::Default_Allocation_Strategy< #{node_name} >::" + pre = "Rice::Default_Free_Function< #{node_name} >::" tmp = "void #{pre}free(#{node_name} * obj) { " tmp += @public_destructor ? "delete obj;" : ""
Update allocation strategies with updated Rice API
diff --git a/lib/vagrant-cloudstack/action/stop_instance.rb b/lib/vagrant-cloudstack/action/stop_instance.rb index abc1234..def5678 100644 --- a/lib/vagrant-cloudstack/action/stop_instance.rb +++ b/lib/vagrant-cloudstack/action/stop_instance.rb @@ -17,7 +17,7 @@ env[:ui].info(I18n.t("vagrant_cloudstack.already_status", :status => env[:machine].state.id)) else env[:ui].info(I18n.t("vagrant_cloudstack.stopping")) - server.stop(!!env[:force_halt]) + server.stop({'force' => !!env[:force_halt]}) end @app.call(env)
Fix Fog deprecation for stop call [fog][DEPRECATION] Passing force as a boolean option has been deprecated. Please pass a hash with 'force' => (true|false)
diff --git a/app/grid.rb b/app/grid.rb index abc1234..def5678 100644 --- a/app/grid.rb +++ b/app/grid.rb @@ -4,28 +4,43 @@ def initialize @cells = LooplessArray.new end + # - def living_neighbor_cells(x, y) - @x = x - @y = y - neighbors.compact().rmap(&:status).reduce(:+) + def each_cell_count(&block) + each_cell(&block) end private - def neighbors + def each_cell(&block) + cells.recurse_each_with_index do |row, x| + row.recurse_each_with_index do |cell, y| + block.call(cell, neighbor_live_count(x,y)) + end + end + end + + def neighbor_live_count(x, y) + count = 0 + neighbors(x, y).rmap(&:status).recurse_each do |status| + count += status + end + count + end + + def neighbors(x, y) filtered_neighbors = LooplessArray.new - neighbor_map.recurse_each do |e| - bounds_check_neighbors(e) && filtered_neighbors << cells[e[0]][e[1]] + neighbor_map(x, y).recurse_each do |c| + bounds_check_neighbors(c) && filtered_neighbors << cells[ c[0] ][ c[1] ] end filtered_neighbors end - def neighbor_map + def neighbor_map(x, y) LooplessArray.new [ - [@x - 1, @y - 1], [@x - 1, @y ], [@x - 1, @y + 1], - [@x, @y - 1], [@x, @y + 1], - [@x + 1, @y + 1], [@x + 1, @y ], [@x + 1, @y + 1] + [x - 1, y - 1], [x - 1, y ], [x - 1, y + 1], + [x, y - 1], [x, y + 1], + [x + 1, y + 1], [x + 1, y ], [x + 1, y + 1] ] end
Implement each cell with count
diff --git a/lib/puppet/provider/network_command_ssh/ce.rb b/lib/puppet/provider/network_command_ssh/ce.rb index abc1234..def5678 100644 --- a/lib/puppet/provider/network_command_ssh/ce.rb +++ b/lib/puppet/provider/network_command_ssh/ce.rb @@ -31,7 +31,7 @@ def flush return unless exists? - Puppet::NetDev::CE::Device.command_ssh_api.command_ssh(resource) + Puppet::NetDev::CE::Device_ssh.command_ssh_api.command_ssh(resource) end def exists?
Add description of LICENSE and Modify
diff --git a/lib/rspec/rails/example/cell_example_group.rb b/lib/rspec/rails/example/cell_example_group.rb index abc1234..def5678 100644 --- a/lib/rspec/rails/example/cell_example_group.rb +++ b/lib/rspec/rails/example/cell_example_group.rb @@ -7,14 +7,13 @@ include RSpec::Rails::RailsExampleGroup include Cell::TestCase::TestMethods include RSpec::Rails::ViewRendering - include RSpec::Rails::BrowserSimulators - webrat do + if defined?(Webrat) include Webrat::Matchers include Webrat::Methods end - capybara do + if defined?(Capybara) include Capybara begin include Capybara::RSpec::StringMatchers @@ -41,7 +40,7 @@ render_views subject { controller } end - + RSpec.configure do |c| c.include self, :example_group => { :file_path => /spec\/cells/ } end
Make it work with rspec-rails 2.6
diff --git a/lib/coffeelint/config.rb b/lib/coffeelint/config.rb index abc1234..def5678 100644 --- a/lib/coffeelint/config.rb +++ b/lib/coffeelint/config.rb @@ -7,8 +7,8 @@ locations = default_locations # handle environment variables - locations << ENV['COFFEELINT_CONFIG'] if ENV['COFFEELINT_CONFIG'] - locations += config_files_in_path(ENV['HOME']) if ENV['HOME'] + locations.push(ENV['COFFEELINT_CONFIG']) if ENV['COFFEELINT_CONFIG'] + locations.concat(config_files_in_path(ENV['HOME'])) if ENV['HOME'] locations.compact.detect { |file| File.exists?(file) } end
Use Array methods to modify locations
diff --git a/features/support/env.rb b/features/support/env.rb index abc1234..def5678 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -1 +1,9 @@+#!/usr/bin/env ruby + +$: << File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'lib')) + require 'cucumber/nagios/steps' + +World do + Webrat::Session.new(Webrat::MechanizeAdapter.new) +end
Load up Webrat into World. Put the bundled cucumber/nagios/steps on the load path
diff --git a/features/step_definitions/repository_steps.rb b/features/step_definitions/repository_steps.rb index abc1234..def5678 100644 --- a/features/step_definitions/repository_steps.rb +++ b/features/step_definitions/repository_steps.rb @@ -0,0 +1,5 @@+When(/^I enter the Git URL of a public repository$/) do + visit '/' + fill_in 'Repository URL', with: 'git://github.com/git/git.git' + click_on 'View repository' +end
Add step for entering a repository URL
diff --git a/recipes/postgres_user.rb b/recipes/postgres_user.rb index abc1234..def5678 100644 --- a/recipes/postgres_user.rb +++ b/recipes/postgres_user.rb @@ -11,16 +11,20 @@ if @configs.key?("activerecord") && @configs["activerecord"].key?('database') @chosen_database = @configs["activerecord"]['database']; if @chosen_database == "postgresql" - say_wizard "Creating PostgreSQL user '#{app_name}'" - run "createuser #{app_name} --no-superuser --createdb --no-createrole" + begin + say_wizard "Creating PostgreSQL user '#{app_name}'" + run "createuser #{app_name} --no-superuser --createdb --no-createrole" + rescue StandardError + say_error "Unable to create PostgreSQL user" + end else - say_wizard "Database '#{@chosen_database}' was chosen, skipping " + - "PostgreSQL user creation." + say_warning "Database '#{@chosen_database}' was chosen, skipping " + + "PostgreSQL user creation." end else - say_wizard "Database not chosen, skipping PostgreSQL user creation. " + - "Hint: invoke ActiveRecord recipe first" + say_error "Database not chosen, skipping PostgreSQL user creation. " + + "Hint: invoke ActiveRecord recipe first" end else - say_wizard "ActiveRecord recipe not found, skipping PostgreSQL user creation" + say_error "ActiveRecord recipe not found, skipping PostgreSQL user creation" end
Add rescue block to PostgreSQL user creation
diff --git a/lib/app.rb b/lib/app.rb index abc1234..def5678 100644 --- a/lib/app.rb +++ b/lib/app.rb @@ -27,7 +27,7 @@ end error 500 do - Bugsnag.auto_notify($ERROR_INFO) + Bugsnag.auto_notify($ERROR_INFO, nil, request) msg = "So sorry! We've been notified of the error and will investigate." { error: msg }.to_json end
Add more information to bugsnag errors
diff --git a/lib/calvin/evaluator.rb b/lib/calvin/evaluator.rb index abc1234..def5678 100644 --- a/lib/calvin/evaluator.rb +++ b/lib/calvin/evaluator.rb @@ -15,15 +15,15 @@ # Just return expression, for now. expression when :- - Evaluator::Helpers.negate expression + Evaluator::Helpers.apply lambda { |x| -x }, expression when :* - Evaluator::Helpers.sign expression + Evaluator::Helpers.apply lambda { |x| x <=> 0 },expression when :/ - Evaluator::Helpers.reciprocal expression + Evaluator::Helpers.apply lambda { |x| 1 / x },expression when :^ - Evaluator::Helpers.exponential expression + Evaluator::Helpers.apply lambda { |x| Math::E ** x },expression when :% - Evaluator::Helpers.magnitude expression + Evaluator::Helpers.apply lambda { |x| x.abs },expression end end end @@ -32,43 +32,11 @@ module Helpers extend self - def negate(object) + def apply(fn, object) if object.is_a?(Array) - object.map(&method(:negate)) + object.map { |el| apply(fn, el) } else - - object - end - end - - def sign(object) - if object.is_a?(Array) - object.map(&method(:sign)) - else - object <=> 0 - end - end - - def reciprocal(object) - if object.is_a?(Array) - object.map(&method(:reciprocal)) - else - 1 / object - end - end - - def exponential(object) - if object.is_a?(Array) - object.map(&method(:exponential)) - else - Math::E ** object - end - end - - def magnitude(object) - if object.is_a?(Array) - object.map(&method(:magnitude)) - else - object.abs + fn.call object end end end
Refactor mapping of monads, by passing lambdas into an `apply` function.
diff --git a/lib/class2/exercise4.rb b/lib/class2/exercise4.rb index abc1234..def5678 100644 --- a/lib/class2/exercise4.rb +++ b/lib/class2/exercise4.rb @@ -1,7 +1,7 @@ # 5 points # # Write a program that asks for a person's first name, then middle name, and -# then last name. Finally, it should greet the person using their full name. +# then last name. Finally, it greets the person using their full name. # # Here's how the program must work: #
Fix a typo with class 2 exercise 4
diff --git a/lib/dancer/factories.rb b/lib/dancer/factories.rb index abc1234..def5678 100644 --- a/lib/dancer/factories.rb +++ b/lib/dancer/factories.rb @@ -13,7 +13,7 @@ def self.extent(start_at, size, step, exclude_end = false) offset = exclude_end ? 0 : 1 - end_at = if size.negative? + end_at = if size < 0 start_at + (step * size) + offset else start_at + (step * size) - offset
Remove method to support Ruby 2.2
diff --git a/test/integration/default/serverspec/influxdb_spec.rb b/test/integration/default/serverspec/influxdb_spec.rb index abc1234..def5678 100644 --- a/test/integration/default/serverspec/influxdb_spec.rb +++ b/test/integration/default/serverspec/influxdb_spec.rb @@ -8,11 +8,9 @@ it { should be_running } end -describe "InfluxDB Server" do - - it "has a daemon runing" do - expect(service("influxdb")).to be_running +influxdb_ports = [ 8083, 8086, 8099, 8090 ] +for influxdb_port in influxdb_ports do + describe port(8083) do + it {should be_listening} end - end -
Test if the InfluxDB ports are listening
diff --git a/lib/web.rb b/lib/web.rb index abc1234..def5678 100644 --- a/lib/web.rb +++ b/lib/web.rb @@ -3,6 +3,7 @@ require_relative 'shields' DEFAULT_SUBJECT = 'maven central' +MAVEN_SEARCH_URI = 'http://search.maven.org' PROJECT_SITE = 'https://github.com/jirutka/maven-badges' configure :production do @@ -15,6 +16,7 @@ "Nothing is here, see #{PROJECT_SITE}." end +# Returns badge image get '/maven-central/:group/:artifact/badge.?:format?' do |group, artifact, format| halt 415 unless ['svg', 'png'].include? format @@ -32,6 +34,16 @@ Shields.badge_image subject, version, color, format end +# Redirects to artifact's page on maven.org +get '/maven-central/:group/:artifact/?' do |group, artifact| + begin + version = Sonatype.last_artifact_version(group, artifact) + redirect to "#{MAVEN_SEARCH_URI}/#artifactdetails|#{group}|#{artifact}|#{version}|" + rescue NotFoundError + redirect to "#{MAVEN_SEARCH_URI}/#search|ga|1|g:\"#{group}\" AND a:\"#{artifact}\"" + end +end + error do content_type :text halt 500, "Something went wrong, please open an issue on #{PROJECT_SITE}/issues"
Add resource for redirect to search.maven.org
diff --git a/lib/hashery/core_ext.rb b/lib/hashery/core_ext.rb index abc1234..def5678 100644 --- a/lib/hashery/core_ext.rb +++ b/lib/hashery/core_ext.rb @@ -0,0 +1,82 @@+module Hashery + + # This module is included into Ruby's core Hash class. + # + # These method derive from Ruby Facets. + module CoreExt + + # + def to_h + self + end + + # + def to_hash + self + end + + # Synonym for Hash#rekey, but modifies the receiver in place (and returns it). + # + # foo = { :name=>'Gavin', :wife=>:Lisa } + # foo.rekey!{ |k| k.to_s } #=> { "name"=>"Gavin", "wife"=>:Lisa } + # foo.inspect #=> { "name"=>"Gavin", "wife"=>:Lisa } + # + def rekey(key_map=nil, &block) + if !(key_map or block) + block = lambda{|k| k.to_sym} + end + + key_map ||= {} + + hash = {} + + (keys - key_map.keys).each do |key| + hash[key] = self[key] + end + + key_map.each do |from, to| + hash[to] = self[from] if key?(from) + end + + hash2 = {} + + if block + if block.arity == 1 # TODO: is this condition needed? + hash.each do |k, v| + nk = block[k] + nk = (NA == nk ? k : nk) + hash2[nk] = v + end + else + hash.each do |k, v| + nk = block[k,v] + nk = (NA == nk ? k : nk) + hash2[nk] = v + end + end + else + hash2 = hash + end + + hash2 + end + + # Synonym for Hash#rekey, but modifies the receiver in place (and returns it). + # + # foo = { :name=>'Gavin', :wife=>:Lisa } + # foo.rekey!{ |k| k.to_s } #=> { "name"=>"Gavin", "wife"=>:Lisa } + # foo #=> { "name"=>"Gavin", "wife"=>:Lisa } + # + # CREDIT: Trans, Gavin Kistner + + def rekey!(key_map=nil, &block) + replace(rekey(key_map, &block)) + end + + end + +end + +class Hash #:nodoc: + include Hashery::CoreExt +end
Add CoreExt module inlcuded in Hash.
diff --git a/lib/rfreeimage/image.rb b/lib/rfreeimage/image.rb index abc1234..def5678 100644 --- a/lib/rfreeimage/image.rb +++ b/lib/rfreeimage/image.rb @@ -33,6 +33,17 @@ to_bpp 8 end + def bgra? + bpp == ImageBPP::BGRA + end + + def to_bgra + return self if bgra? + to_bpp 32 + end + + alias_method :write, :save + alias_method :columns, :cols end end
Add methods for rmagick compatability
diff --git a/plugins/guests/freebsd/cap/mount_nfs_folder.rb b/plugins/guests/freebsd/cap/mount_nfs_folder.rb index abc1234..def5678 100644 --- a/plugins/guests/freebsd/cap/mount_nfs_folder.rb +++ b/plugins/guests/freebsd/cap/mount_nfs_folder.rb @@ -8,6 +8,8 @@ nfs_version_mount_option="-o nfsv#{opts[:nfs_version]}" end + machine.communicate.sudo("mkdir -p #{opts[:guestpath]}", {shell: "sh"}) + machine.communicate.sudo( "mount -t nfs #{nfs_version_mount_option} " + "'#{ip}:#{opts[:hostpath]}' '#{opts[:guestpath]}'", {shell: "sh"})
Add back creation of mount point Accidentally removed in ad4b30dd
diff --git a/ASCFlatUIColor.podspec b/ASCFlatUIColor.podspec index abc1234..def5678 100644 --- a/ASCFlatUIColor.podspec +++ b/ASCFlatUIColor.podspec @@ -3,8 +3,7 @@ s.version = "0.1.0" s.summary = "A collection of all Flat UI Colors." s.homepage = "https://github.com/schneiderandre/ASCFlatUIColor" - s.screenshots = [ "https://dl.dropboxusercontent.com/u/19150300/Github/ASCFlatUIColor/iphone_white_1.png", - "https://dl.dropboxusercontent.com/u/19150300/Github/ASCFlatUIColor/iphone_white_2.png" ] + s.screenshot = "https://dl.dropboxusercontent.com/u/19150300/Github/ASCFlatUIColor/ASCFlatUIColor.gif" s.license = 'MIT' s.author = { "André Schneider" => "hello@andreschneider.me" } s.source = { :git => "https://github.com/schneiderandre/ASCFlatUIColor.git", :tag => s.version.to_s }
Use gif as podspec screenshot.
diff --git a/test/bench/client_integration/write_batch.rb b/test/bench/client_integration/write_batch.rb index abc1234..def5678 100644 --- a/test/bench/client_integration/write_batch.rb +++ b/test/bench/client_integration/write_batch.rb @@ -30,10 +30,12 @@ 2.times do |i| i += 1 - event_data = eval("read_data_#{i}") + event_data = binding.local_variable_get "read_data_#{i}" test "Individual events are written" do - assert(event_data.data['some_attribute'] == eval("token_#{i}")) + control_attribute = binding.local_variable_get "token_#{i}" + + assert event_data.data[:some_attribute] == control_attribute end end end
Update tests to expect event data with Symbol keys
diff --git a/Casks/appcleaner.rb b/Casks/appcleaner.rb index abc1234..def5678 100644 --- a/Casks/appcleaner.rb +++ b/Casks/appcleaner.rb @@ -2,6 +2,6 @@ url 'http://www.freemacsoft.net/downloads/AppCleaner_2.2.1.zip' homepage 'http://www.freemacsoft.net/appcleaner/' version '2.2.1' - sha1 'd52dfbed9903799d21753be7fdd229c7277fba2a' + no_checksum link 'AppCleaner.app' end
Switch AppCleaner to no checksum #2160 #2158
diff --git a/FWTDragView.podspec b/FWTDragView.podspec index abc1234..def5678 100644 --- a/FWTDragView.podspec +++ b/FWTDragView.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |s| s.name = "FWTDragView" - s.version = "0.2.6" + s.version = "0.2.7" s.summary = "A tinder style draggable view control for use across FW projects." s.description = <<-DESC #FWTDragView @@ -18,7 +18,7 @@ s.homepage = "https://github.com/FutureWorkshops/FWTDragView" s.license = 'MIT' s.author = { "Tim Chilvers" => "tim@futureworkshops.com" } - s.source = { :git => "https://github.com/FutureWorkshops/FWTDragView.git", :tag => s.version.to_s } + s.source = { :git => "git@github.com:FutureWorkshops/FWTDragView.git", :tag => s.version.to_s } s.platform = :ios, '7.0' s.requires_arc = true
Fix podfile HTTPS auth not working
diff --git a/zebra-zpl.gemspec b/zebra-zpl.gemspec index abc1234..def5678 100644 --- a/zebra-zpl.gemspec +++ b/zebra-zpl.gemspec @@ -1,7 +1,7 @@ # coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require 'lib/zebra/zpl/version' +require 'zebra/zpl/version' Gem::Specification.new do |spec| spec.name = "zebra-zpl"
Fix bad require path on gemspec
diff --git a/Casks/data-science-studio.rb b/Casks/data-science-studio.rb index abc1234..def5678 100644 --- a/Casks/data-science-studio.rb +++ b/Casks/data-science-studio.rb @@ -1,11 +1,11 @@ cask 'data-science-studio' do - version '2.0.0' - sha256 '97a2e10d14a26d337ba71170ddc5e4ad6e2b3eafe36adcd02048c7da2d402774' + version '2.2.2' + sha256 '4644cf19ba15acfadedfed1f005d9ac9a8970a829e4fdb0c8b7f7246f69ddaef' - url "https://downloads.dataiku.com/public/studio/Data%20Science%20Studio%20#{version}.dmg" + url "https://downloads.dataiku.com/public/studio/#{version}/Data%20Science%20Studio%20#{version}.dmg" name 'Dataiku Data Science Studio' homepage 'https://www.dataiku.com' - license :unknown # TODO: change license and remove this comment; ':unknown' is a machine-generated placeholder + license :gratis app 'DataScienceStudio.app' end
Update Data Science Studio to 2.2.2 and add gratis license
diff --git a/CloudMine.podspec b/CloudMine.podspec index abc1234..def5678 100644 --- a/CloudMine.podspec +++ b/CloudMine.podspec @@ -2,7 +2,7 @@ s.name = "CloudMine" s.version = "1.7.5" s.summary = "The iOS Framework for interacting with the CloudMine platform." - s.homepage = "https://cloudmine.me/docs/ios/reference" + s.homepage = "https://cloudmine.me/docs/#/ios" s.license = 'MIT' s.author = { "CloudMine" => "support@cloudmine.me" } s.platform = :ios, '6.0'
Change to new doc URL for 1.7.5
diff --git a/lib/did_you_mean/no_method_error_extension.rb b/lib/did_you_mean/no_method_error_extension.rb index abc1234..def5678 100644 --- a/lib/did_you_mean/no_method_error_extension.rb +++ b/lib/did_you_mean/no_method_error_extension.rb @@ -1,6 +1,19 @@ module DidYouMean module NoMethodErrorExtension attr_reader :receiver + + def self.included(base) + base.class_eval do + alias all_backtrace backtrace + alias backtrace backtrace_without_unneeded_lines + end + end + + def backtrace_without_unneeded_lines + all_backtrace.reject do |line| + line.include?("lib/did_you_mean/core_ext/object.rb") + end if all_backtrace.is_a?(Array) + end def did_you_mean? return if similar_methods.empty?
Exclude backtrace coming from this gem
diff --git a/lib/payments/client/operations/settlements.rb b/lib/payments/client/operations/settlements.rb index abc1234..def5678 100644 --- a/lib/payments/client/operations/settlements.rb +++ b/lib/payments/client/operations/settlements.rb @@ -12,7 +12,7 @@ include GetOperation def path - "/settlements/{settlement_id}/{account_id}/donation-transaction-detail-report" + "/settlements/{settlement_id}/donation-transaction-detail-report/{account_id}" end end end
Update account donation transaction detail report path
diff --git a/DMCircularScrollView.podspec b/DMCircularScrollView.podspec index abc1234..def5678 100644 --- a/DMCircularScrollView.podspec +++ b/DMCircularScrollView.podspec @@ -3,9 +3,9 @@ s.version = '1.0.0' s.summary = 'Infinite/Circular Scrolling Implementation for UIScrollView' s.author = { 'Daniele Margutti' => 'http://www.danielemargutti.com' } - s.source = { :git => 'https://github.com/lennypham/DMCircularScrollView.git' } + s.source = { :git => 'https://github.com/malcommac/DMCircularScrollView.git' } s.platform = :ios s.ios.deployment_target = '5.0' s.source_files = 'Classes', 'DMCircularScrollView/DMCircularScrollView/*.{h,m}' s.requires_arc = true -end+end
Update podspec s.source to point to original repo
diff --git a/app/controllers/base_controller_decorator.rb b/app/controllers/base_controller_decorator.rb index abc1234..def5678 100644 --- a/app/controllers/base_controller_decorator.rb +++ b/app/controllers/base_controller_decorator.rb @@ -3,10 +3,10 @@ def save_search - suggest_on = Spree::Suggestion::Config.field + keywords = @searcher.try :keywords - if @products.present? and params[suggest_on] - query = Spree::Suggestion.find_or_initialize_by_keywords(params[suggest_on]) + if @products.present? and keywords.present? + query = Spree::Suggestion.find_or_initialize_by_keywords(keywords) query.items_found = @products.size query.increment(:count)
Save searches by @searcher.keywords instead params
diff --git a/db/migrate/20150429184106_create_user_types.rb b/db/migrate/20150429184106_create_user_types.rb index abc1234..def5678 100644 --- a/db/migrate/20150429184106_create_user_types.rb +++ b/db/migrate/20150429184106_create_user_types.rb @@ -2,9 +2,10 @@ def change create_table :user_types do |t| t.string :type - t.references :user + t.references :user, index: true t.timestamps null: false end + add_foreign_key :user_types, :users end end
Add foreign key to user type table
diff --git a/db/migrate/20160104234733_create_activities.rb b/db/migrate/20160104234733_create_activities.rb index abc1234..def5678 100644 --- a/db/migrate/20160104234733_create_activities.rb +++ b/db/migrate/20160104234733_create_activities.rb @@ -3,11 +3,11 @@ # Create table def self.up create_table :activities do |t| - t.belongs_to :trackable, :polymorphic => true - t.belongs_to :owner, :polymorphic => true - t.string :key - t.text :parameters - t.belongs_to :recipient, :polymorphic => true + t.belongs_to :trackable, polymorphic: true + t.belongs_to :owner, polymorphic: true + t.string :key + t.text :parameters + t.belongs_to :recipient, polymorphic: true t.timestamps end
Use ruby 1.9 hash syntax
diff --git a/app/controllers/people_network_controller.rb b/app/controllers/people_network_controller.rb index abc1234..def5678 100644 --- a/app/controllers/people_network_controller.rb +++ b/app/controllers/people_network_controller.rb @@ -5,6 +5,7 @@ def destroy @people_network = PeopleNetwork.find(params[:id]) trusted_person = @people_network.trusted_person + EventLog.create_news_event_log(@people_network.person, @people_network.trusted_person, nil, EventType.trust_withdrawn) PeopleNetwork.involves(@people_network.person).involves(@people_network.trusted_person).limit(2).destroy_all redirect_to(trusted_person, :notice => I18n.t('messages.people_network.destroy')) end
Save to event log if relationship broken
diff --git a/app/presenters/event_presenter/push_event.rb b/app/presenters/event_presenter/push_event.rb index abc1234..def5678 100644 --- a/app/presenters/event_presenter/push_event.rb +++ b/app/presenters/event_presenter/push_event.rb @@ -4,6 +4,14 @@ def action action_for_event(:event_pushed, :link => repository_link) + end + + def body + if commits + super + else + '' + end end def repository_link
Return blank body for push events with no commits
diff --git a/test/support/test_case.rb b/test/support/test_case.rb index abc1234..def5678 100644 --- a/test/support/test_case.rb +++ b/test/support/test_case.rb @@ -14,6 +14,7 @@ Byebug.handler = Byebug::CommandProcessor.new(Byebug::TestInterface.new) Byebug.breakpoints.clear if Byebug.breakpoints Byebug.catchpoints.clear if Byebug.catchpoints + Byebug.stubs(:run_init_script) set_defaults
Make sure .byebugrc's don't interfere with tests
diff --git a/cookbooks/chef/attributes/default.rb b/cookbooks/chef/attributes/default.rb index abc1234..def5678 100644 --- a/cookbooks/chef/attributes/default.rb +++ b/cookbooks/chef/attributes/default.rb @@ -5,7 +5,7 @@ default[:chef][:server][:version] = "12.0.8-1" # Set the default client version -default[:chef][:client][:version] = "12.4.1-1" +default[:chef][:client][:version] = "12.4.2-1" # A list of gems needed by chef recipes default[:chef][:gems] = []
Update chef client to 12.4.2
diff --git a/cookbooks/chef/attributes/default.rb b/cookbooks/chef/attributes/default.rb index abc1234..def5678 100644 --- a/cookbooks/chef/attributes/default.rb +++ b/cookbooks/chef/attributes/default.rb @@ -5,4 +5,4 @@ default[:chef][:server][:version] = "12.9.1-1" # Set the default client version -default[:chef][:client][:version] = "12.16.42" +default[:chef][:client][:version] = "12.17.44"
Update chef client to 12.17.44
diff --git a/BHCDatabase/app/controllers/initiatives_controller.rb b/BHCDatabase/app/controllers/initiatives_controller.rb index abc1234..def5678 100644 --- a/BHCDatabase/app/controllers/initiatives_controller.rb +++ b/BHCDatabase/app/controllers/initiatives_controller.rb @@ -39,5 +39,10 @@ end column(:location, :mandatory => true) column(:description, :mandatory => true) + column(:area_id, :header => "Area", :mandatory => true) do |model| + format(model.area_id) do |value| + Area.find(value).name + end + end end
Add area field to initative table.
diff --git a/Casks/coda.rb b/Casks/coda.rb index abc1234..def5678 100644 --- a/Casks/coda.rb +++ b/Casks/coda.rb @@ -6,12 +6,19 @@ appcast 'http://www.panic.com/updates/update.php' name 'Coda' homepage 'https://panic.com/Coda/' - license :unknown # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder + license :commercial + tags :vendor => 'Panic' + + zap :delete => [ + '~/Library/Application Support/Coda 2', + '~/Library/Application Support/Growl/Tickets/Coda 2.growlTicket', + '~/Library/Caches/com.panic.Coda2', + '~/Library/Caches/com.apple.helpd/Generated/com.panic.Coda2.help', + '~/Library/Preferences/com.panic.Coda2.plist', + '~/Library/Preferences/com.panic.Coda2.LSSharedFileList.plist', + '~/Library/Preferences/com.panic.Coda2.LSSharedFileList.plist.lockfile', + '~/Library/Saved Application State/com.panic.Coda2.savedState' + ] app 'Coda 2.app' - - zap :delete => [ - '~/Library/Application Support/Coda 2', - '~/Library/Preferences/com.panic.Coda2.plist', - ] end
Add license, vendor and zap for Coda 2.app
diff --git a/RxAlamofire.podspec b/RxAlamofire.podspec index abc1234..def5678 100644 --- a/RxAlamofire.podspec +++ b/RxAlamofire.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = 'RxAlamofire' - s.version = '3.0.2' + s.version = '3.0.3' s.license = 'MIT' s.summary = 'RxSwift wrapper around the elegant HTTP networking in Swift Alamofire' s.homepage = 'https://github.com/RxSwiftCommunity/RxAlamofire'
Update pod spec with new version
diff --git a/ChattoAdditions.podspec b/ChattoAdditions.podspec index abc1234..def5678 100644 --- a/ChattoAdditions.podspec +++ b/ChattoAdditions.podspec @@ -16,5 +16,5 @@ s.requires_arc = true s.swift_version = '5.3' s.resources = ["ChattoAdditions/Source/**/*.xib", "ChattoAdditions/Source/**/*.storyboard", "ChattoAdditions/Source/**/*.xcassets"] - s.dependency 'Chatto' + s.dependency 'Chatto', s.version.to_s end
Add Chatto version in spec declaration
diff --git a/rb/lib/selenium/webdriver/android/bridge.rb b/rb/lib/selenium/webdriver/android/bridge.rb index abc1234..def5678 100644 --- a/rb/lib/selenium/webdriver/android/bridge.rb +++ b/rb/lib/selenium/webdriver/android/bridge.rb @@ -3,7 +3,7 @@ module Android class Bridge < Remote::Bridge - DEFAULT_URL = "http://#{Platform.localhost}:8080/hub/" + DEFAULT_URL = "http://#{Platform.localhost}:8080/wd/hub/" def initialize(opts = {}) remote_opts = {
JariBakken: Fix default URL in the Ruby Android driver. git-svn-id: aa1aa1384423cb28c2b1e29129bb3a91de1d9196@13650 07704840-8298-11de-bf8c-fd130f914ac9
diff --git a/request.rb b/request.rb index abc1234..def5678 100644 --- a/request.rb +++ b/request.rb @@ -32,7 +32,7 @@ # Will need to study the 'recv' method more carefully to figure out why I need to specify the content_length instead of trying to # read everything, line by line def extract_content(client, content_length) - client.recv(content_length) + client.recv_nonblock(content_length) end
Implement 'recv_nonblock' instead of recv This solves Issue #4.
diff --git a/db/seeds/demo/demo_educator.seeds.rb b/db/seeds/demo/demo_educator.seeds.rb index abc1234..def5678 100644 --- a/db/seeds/demo/demo_educator.seeds.rb +++ b/db/seeds/demo/demo_educator.seeds.rb @@ -4,9 +4,11 @@ Educator.create!([{ email: "demo@example.com", password: "demo-password", + local_id: '350', admin: true }, { email: "fake-fifth-grade@example.com", password: "demo-password", + local_id: '450', admin: false }])
Update demo task to respect newly added validation for local_id
diff --git a/robot_name/robot_name.rb b/robot_name/robot_name.rb index abc1234..def5678 100644 --- a/robot_name/robot_name.rb +++ b/robot_name/robot_name.rb @@ -9,15 +9,7 @@ def initialize(args = {}) @@registry ||= [] @name_generator = args[:name_generator] - - if @name_generator - @name = @name_generator.call - else - @name = generate_name - end - - # TODO Move error handling out of initilize. It really belongs - # in the generate_name method. + @name = generate_name check_name_format check_name_collision @@registry << @name @@ -25,8 +17,14 @@ def generate_name temp_name = '' - 2.times { temp_name << ('A'..'Z').to_a.sample } - 3.times { temp_name << rand(10).to_s } + + if @name_generator + temp_name = @name_generator.call + else + 2.times { temp_name << ('A'..'Z').to_a.sample } + 3.times { temp_name << rand(10).to_s } + end + temp_name end
Move name generation code out of initialize There is still a part of this that I don't like. It seems that the generate_name method should handle the naming errors. However, the bouncer methods currently depend on the @name instance variable being set. I see two alternatives: (1) change bouncer methods to use a passed in variable, or (2) handle the name generation in another class altogether. I think I like the (2) better because I'm already fighting this class. It's at a point where I need some substantial work done before the object is even initialized. It feels like this work should maybe be done by another class in this case.
diff --git a/features/step_definitions/audit_trail_steps.rb b/features/step_definitions/audit_trail_steps.rb index abc1234..def5678 100644 --- a/features/step_definitions/audit_trail_steps.rb +++ b/features/step_definitions/audit_trail_steps.rb @@ -4,7 +4,7 @@ assert page.has_content?('An frequently changed publication') @the_publication = Publication.find_by(title: 'An frequently changed publication') # fake it - states = %w[draft submitted published superseded] + states = %w[draft submitted published] 50.times do |i| Timecop.travel i.hours.from_now do @the_publication.versions.create event: 'update', whodunnit: @user, state: states.sample
Fix broken Audit Trail feature test
diff --git a/box_score.rb b/box_score.rb index abc1234..def5678 100644 --- a/box_score.rb +++ b/box_score.rb @@ -8,7 +8,7 @@ BS_URI = "http://scores.espn.go.com/nba/gamecast12/master?xhr=1&gameId=%s&lang=en&init=true&setType=true&confId=null" def initialize (gid) - json = JSON.parse(open(BS_URI % gid.to_s).read) + json = JSON.parse(open(BS_URI % gid.to_s).read.scan(/[[:print:]]/).join) bses = json['gamecast']['stats']['player']['home'][0...-1] + json['gamecast']['stats']['player']['away'][0...-1] @bses = []
Remove non-printable characters from JSON string
diff --git a/spec/javascripts/support/jasmine_helper.rb b/spec/javascripts/support/jasmine_helper.rb index abc1234..def5678 100644 --- a/spec/javascripts/support/jasmine_helper.rb +++ b/spec/javascripts/support/jasmine_helper.rb @@ -1,5 +1,10 @@ #Use this file to set/override Jasmine configuration options +#You can remove it if you don't need it. #This file is loaded *after* jasmine.yml is interpreted. -Jasmine.configure do |config| - config.prevent_phantom_js_auto_install = true -end +# +#Example: using a different boot file. +#Jasmine.configure do |config| +# config.boot_dir = '/absolute/path/to/boot_dir' +# config.boot_files = lambda { ['/absolute/path/to/boot_dir/file.js'] } +#end +#
Allow PhantomJS to be auto-installed again The [phantomjs gem] can automatically install PhantomJS if it isn't already available on the system. This functionality was disabled in commit b938bff6f76bc23232b523e0d2a688d34b9d6e22. This was done for security reasons – because at the time, the gem would auto-install from an insecure `http://` URL without performing any file integrity checks. At that point in time, the Jenkins CI server must have had PhantomJS installed so these tests could run. However this no longer seems to be the case, as builds now fail because they're unable to find the `phantomjs` command. The security hole was implicitly fixed in colszowka/phantomjs-gem@b41fc6feedd78cf05372c62ca55cf341ec0dc208 when the `http://` URLs were changed to `https://` – which still remains the case in the [current release]. It's therefore safe to re-enable automatic installation, which is now required due to PhantomJS no longer being pre-installed on our Jenkins CI servers. [phantomjs gem]: https://github.com/colszowka/phantomjs-gem [current release]: https://github.com/colszowka/phantomjs-gem/blob/38a722deeb7989e2de093fd628139266386492c1/lib/phantomjs/platform.rb#L133
diff --git a/Library/Formula/p0f.rb b/Library/Formula/p0f.rb index abc1234..def5678 100644 --- a/Library/Formula/p0f.rb +++ b/Library/Formula/p0f.rb @@ -6,7 +6,7 @@ sha1 'ae2c4fbcddf2a5ced33abd81992405b93207e7c8' def install - inreplace 'config.h', 'p0f.fp', "#{etc}/p0f/p0f.fp" + inreplace "config.h", "p0f.fp", "#{etc}/p0f/p0f.fp" system './build.sh' sbin.install 'p0f' (etc + 'p0f').install 'p0f.fp' @@ -19,6 +19,6 @@ 'RAAAAAIAAABFAABAbvpAAEAGAAB/AAABfwAAAcv8Iyjt2/Pg' \ 'AAAAALAC///+NAAAAgQ/2AEDAwQBAQgKCyrc9wAAAAAEAgAA' (testpath / 'test.pcap').write(Base64.decode64(pcap)) - system "#{sbin}/p0f", '-r', 'test.pcap' + system "#{sbin}/p0f", "-r", "test.pcap" end end
Use double-quotes on lines w/ string interpolation
diff --git a/config.ru b/config.ru index abc1234..def5678 100644 --- a/config.ru +++ b/config.ru @@ -5,14 +5,17 @@ def call(env) status, headers, response = @file_server.call(env) if status == 404 - if env["PATH_INFO"] == "/" + ori_path = env["PATH_INFO"] + if ori_path == "/" env["PATH_INFO"] = "index.html" else - env["PATH_INFO"] = "#{env["PATH_INFO"]}.html" - end - status, headers, response = @file_server.call(env) - if status == 404 - env["PATH_INFO"] = App::ERROR_404_PATH + env["PATH_INFO"] = "#{ori_path}.html" + status, headers, response = @file_server.call(env) + if status == 404 + env["PATH_INFO"] = "#{ori_path}/index.html" + status, headers, response = @file_server.call(env) + env["PATH_INFO"] = App::ERROR_404_PATH if status == 404 + end end end super @@ -34,4 +37,4 @@ }, File.open('build/index.html', File::RDONLY) ] -}+}
B: Fix posts/index.html is not found
diff --git a/config.ru b/config.ru index abc1234..def5678 100644 --- a/config.ru +++ b/config.ru @@ -2,5 +2,6 @@ use Rack::Session::Cookie use Rack::ShowExceptions +use Rack::Static, :urls => [ '/favicon.ico', '/css' ], :root => "public" run Application
Use the Rack::Static middleware for serving the static public folder.
diff --git a/config.ru b/config.ru index abc1234..def5678 100644 --- a/config.ru +++ b/config.ru @@ -10,7 +10,7 @@ config.ignore << "Sinatra::NotFound" end -use Honeybadger::Rack +use Honeybadger::Rack::ErrorNotifier require './no_phone' configure { set :server, :puma }
Use newer Honeybadger middleware Old one is deprecated.
diff --git a/app/controllers/devices/computers_controller.rb b/app/controllers/devices/computers_controller.rb index abc1234..def5678 100644 --- a/app/controllers/devices/computers_controller.rb +++ b/app/controllers/devices/computers_controller.rb @@ -5,8 +5,7 @@ def new @computer = Computer.new - puts request.remote_addr - @computer.value = Arp.mac_by_ip_address(request.remote_addr) + @computer.value = Arp.mac_by_ip_address(request.env['HTTP_X_FORWARDED_FOR'] || request.remote_ip) end def create
Make the autofill of the mac address work with proxies
diff --git a/dpl-cloud_files.gemspec b/dpl-cloud_files.gemspec index abc1234..def5678 100644 --- a/dpl-cloud_files.gemspec +++ b/dpl-cloud_files.gemspec @@ -1,7 +1,3 @@ require './gemspec_helper' -if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.3.0") - gemspec_for 'cloud_files', [['net-ssh'], ['mime-types'], ['nokogiri', '< 1.10'], ['fog-rackspace']] -else - gemspec_for 'cloud_files', [['net-ssh'], ['mime-types'], ['nokogiri'], ['fog-rackspace']] -end +gemspec_for 'cloud_files', [['nokogiri', '< 1.10'], ['fog-rackspace']]
Fix cloud_files gemspec: nokogiri < 1.10
diff --git a/recipes/google-chrome.rb b/recipes/google-chrome.rb index abc1234..def5678 100644 --- a/recipes/google-chrome.rb +++ b/recipes/google-chrome.rb @@ -9,6 +9,7 @@ apt_repository 'google-chrome-unstable' do uri 'http://dl.google.com/linux/chrome/deb/' + arch 'amd64' components ['stable', 'main'] keyserver 'keyserver.ubuntu.com' key 'A040830F7FAC5991'
Update google chrome repo to be amd64-only
diff --git a/lib/identity/importer/tasks/civicrm/members.rb b/lib/identity/importer/tasks/civicrm/members.rb index abc1234..def5678 100644 --- a/lib/identity/importer/tasks/civicrm/members.rb +++ b/lib/identity/importer/tasks/civicrm/members.rb @@ -8,7 +8,7 @@ def self.sql(sync_since=nil) if sync_since - where_when = "AND contact.created_date > \"#{sync_since.getlocal.strftime('%Y-%m-%d %H:%M:%S')}\"" + where_when = "AND contact.created_date > \"#{sync_since.strftime('%Y-%m-%d %H:%M:%S')}\"" else where_when = '' end
Fix passing datetime param to sql
diff --git a/lib/rails_soft_deletable/rails/associations.rb b/lib/rails_soft_deletable/rails/associations.rb index abc1234..def5678 100644 --- a/lib/rails_soft_deletable/rails/associations.rb +++ b/lib/rails_soft_deletable/rails/associations.rb @@ -5,15 +5,17 @@ extend ActiveSupport::Concern included do - def target_scope - return klass.scoped if options[:polymorphic] && klass.nil? + alias_method_chain :target_scope, :deleted + end - if options[:with_deleted] && klass.soft_deletable? - klass.with_deleted - else - klass.scoped - end + def target_scope_with_deleted + scope = target_scope_without_deleted + + if scope && options[:with_deleted] && klass.soft_deletable? + scope = scope.with_deleted end + + scope end end end
Use alias_method_chain instead of reimplementing method
diff --git a/spec/perf/size_spec.rb b/spec/perf/size_spec.rb index abc1234..def5678 100644 --- a/spec/perf/size_spec.rb +++ b/spec/perf/size_spec.rb @@ -6,19 +6,19 @@ RSpec.describe TTY::Screen, ".size" do include RSpec::Benchmark::Matchers - it "detectes size 15x slower than io-console" do + it "detectes size 13x slower than io-console" do expect { TTY::Screen.size }.to perform_slower_than { IO.console.winsize - }.at_most(10).times + }.at_most(13).times end - it "performs at least 27K i/s" do - expect { TTY::Screen.size }.to perform_at_least(270_000).ips + it "performs at least 28K i/s" do + expect { TTY::Screen.size }.to perform_at_least(28_000).ips end - it "allocates at most 11 objects" do - expect { TTY::Screen.size }.to perform_allocation(1).objects + it "allocates at most 10 objects" do + expect { TTY::Screen.size }.to perform_allocation(10).objects end end
Change perf tests to new boundaries
diff --git a/app.rb b/app.rb index abc1234..def5678 100644 --- a/app.rb +++ b/app.rb @@ -3,9 +3,16 @@ require 'word_bunny' get '/' do + @sample_text_title = "Example: President Duterte's State of the Nation Address 2017" + @speech = File.read('./SONA2017.txt') + @results = tally! @speech + haml :index, format: :html5 +end + +get '/2013' do @sample_text_title = "Example: President Aquino's State of the Nation Address 2013" - speech = File.read('./SONA2013.txt') - @results = tally! speech + @speech = File.read('./SONA2013.txt') + @results = tally! @speech haml :index, format: :html5 end
Add 2017 State of the Nation Address and polish markup.
diff --git a/stash_datacite.gemspec b/stash_datacite.gemspec index abc1234..def5678 100644 --- a/stash_datacite.gemspec +++ b/stash_datacite.gemspec @@ -1,24 +1,24 @@-$:.push File.expand_path("../lib", __FILE__) +$:.push File.expand_path('../lib', __FILE__) # Maintain your gem's version: -require "stash_datacite/version" +require 'stash_datacite/version' # Describe your gem and declare its dependencies: Gem::Specification.new do |s| - s.name = "stash_datacite" + s.name = 'stash_datacite' s.version = StashDatacite::VERSION - s.authors = ["sfisher"] - s.email = ["scott.fisher@ucop.edu"] - s.homepage = "https://github.com/CDLUC3/stash_datacite" - s.summary = "An engine for working with the DataCite schema in Stash." - s.description = "An engine for working with the DataCite schema in Stash." - s.license = "MIT" + s.authors = ['sfisher'] + s.email = ['scott.fisher@ucop.edu'] + s.homepage = 'https://github.com/CDLUC3/stash_datacite' + s.summary = 'An engine for working with the DataCite schema in Stash.' + s.description = 'An engine for working with the DataCite schema in Stash.' + s.license = 'MIT' - s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"] - s.test_files = Dir["test/**/*"] + s.files = Dir['{app,config,db,lib}/**/*', 'MIT-LICENSE', 'Rakefile', 'README.rdoc'] + s.test_files = Dir['test/**/*'] - s.add_dependency "rails", "~> 4.2.4" - s.add_development_dependency "mysql2" + s.add_dependency 'rails', '~> 4.2.4' + s.add_development_dependency 'mysql2' s.add_dependency 'responders', '~> 2.0' s.add_dependency 'leaflet-rails' s.add_dependency 'datacite-mapping', '~> 0.1', '>= 0.1.12'
Use single quotes for non-interpolated strings
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index abc1234..def5678 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -11,6 +11,6 @@ private def set_raven_context - Raven.extra_context(params: params.to_hash, url: request.url) + Raven.extra_context(params: params.to_unsafe_h, url: request.url) end end
Raven: Use to_unsafe_h instead of to_hash whichi is deprecated. Former-commit-id: cf4f069b658e8d4c705cd0a42a8d64a8e3c0c994
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index abc1234..def5678 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,5 +1,20 @@ class ApplicationController < ActionController::Base + + before_filter :redirect_to if Rails.env.production? + # Prevent CSRF attacks by raising an exception. # For APIs, you may want to use :null_session instead. protect_from_forgery with: :exception + + + private + + def redirect_to + domain_to_redirect_to = 'www.jodelstats.com' + domain_exceptions = ['jodelstats.com', 'www.jodelstats.com'] + should_redirect = !(domain_exceptions.include? request.host) + new_url = "#{request.protocol}#{domain_to_redirect_to}#{request.fullpath}" + redirect_to new_url, status: :moved_permanently if should_redirect + end + end
Add 301 redirect for heroku domain
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index abc1234..def5678 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,13 +1,22 @@ class ApplicationController < ActionController::Base # Prevent CSRF attacks by raising an exception. # For APIs, you may want to use :null_session instead. - protect_from_forgery with: :null_session + # protect_from_forgery with: :null_session # Add this before action to force CAS Authentication on all controllers + actions before_action CASClient::Frameworks::Rails::Filter, unless: :skip_login? # Add this before action to set a local variable for the current user from CAS session before_action :getMe + + after_filter :set_access_control_headers + + def set_access_control_headers + headers['Access-Control-Allow-Origin'] = '*' + headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS' + headers['Access-Control-Request-Method'] = '*' + headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization' + end protected
Set access headers to all (todo: revert)
diff --git a/app/controllers/team_invite_controller.rb b/app/controllers/team_invite_controller.rb index abc1234..def5678 100644 --- a/app/controllers/team_invite_controller.rb +++ b/app/controllers/team_invite_controller.rb @@ -6,9 +6,9 @@ @team = current_team if @team_invite_submissions.valid? - TeamInviteAdder.create_from_email_list(@team_invite_submissions.emails, @team) + TeamInviteAdder.create_from_email_list(@team_invite_submissions.emails, current_team) flash[:success] = 'Team invites have been sent!' - redirect_to manage_path(team: @team.slug) + redirect_to manage_path(team: current_team.slug) else render 'teams/manage' end
Make use of current_team helper
diff --git a/app/decorators/gameye_server_decorator.rb b/app/decorators/gameye_server_decorator.rb index abc1234..def5678 100644 --- a/app/decorators/gameye_server_decorator.rb +++ b/app/decorators/gameye_server_decorator.rb @@ -21,8 +21,17 @@ end def locations - { "londen" => {name: "London", flag: "en"}, - "frankfurt" => {name: "Frankfurt", flag: "de"} } + { + "amsterdam" => {name: "Amsterdam", flag: "nl"}, + "chicago" => {name: "Chicago", flag: "us"}, + "frankfurt" => {name: "Frankfurt", flag: "de"}, + "londen" => {name: "London", flag: "en"}, + "moscow" => {name: "Frankfurt", flag: "de"}, + "phoenix" => {name: "Phoenix", flag: "us"}, + "sao_paulo" => {name: "Frankfurt", flag: "br"}, + "warsaw" => {name: "Warsaw", flag: "pl"}, + "washington_dc" => {name: "Washington D.C.", flag: "us"} + } end end
Prepare decorator for all locations
diff --git a/app/models/concerns/primary_attachment.rb b/app/models/concerns/primary_attachment.rb index abc1234..def5678 100644 --- a/app/models/concerns/primary_attachment.rb +++ b/app/models/concerns/primary_attachment.rb @@ -1,3 +1,6 @@+# +# == PrimaryAttachment Concerns +# module PrimaryAttachment extend ActiveSupport::Concern include ApplicationHelper
Add top level documentation for concerns
diff --git a/lib/patches/controller/previews_controller_patch.rb b/lib/patches/controller/previews_controller_patch.rb index abc1234..def5678 100644 --- a/lib/patches/controller/previews_controller_patch.rb +++ b/lib/patches/controller/previews_controller_patch.rb @@ -14,7 +14,7 @@ elsif @notes if Pwfmt::Context.has_format_for?('issue_notes') @notes.wiki_format = Pwfmt::Context.format_for('issue_notes') - else + elsif Pwfmt::Context.formats.try(:first) @notes.wiki_format = Pwfmt::Context.formats.first.last end end
Fix NoMethodError on journal preview without JavaScript
diff --git a/spec/integration/arel/many_to_one_spec.rb b/spec/integration/arel/many_to_one_spec.rb index abc1234..def5678 100644 --- a/spec/integration/arel/many_to_one_spec.rb +++ b/spec/integration/arel/many_to_one_spec.rb @@ -0,0 +1,27 @@+require 'spec_helper_integration' + +describe '[Arel] Many To One with generated mapper' do + include_context 'Models and Mappers' + + before(:all) do + setup_db + + insert_user 1, 'John', 18 + insert_user 2, 'Jane', 21 + + insert_address 1, 1, 'Street 1/2', 'Chicago', '12345' + insert_address 2, 2, 'Street 2/4', 'Boston', '67890' + + user_mapper + address_mapper.belongs_to :user, user_model + end + + it 'loads associated object' do + mapper = DM_ENV[address_model].include(:user) + address = mapper.first + user = DM_ENV[user_model].first + + address.user.should be_instance_of(user_model) + address.user.id.should eql(user.id) + end +end
Add explicit many_to_one integration spec for arel
diff --git a/spec/resampling/hybrid_resampling_spec.rb b/spec/resampling/hybrid_resampling_spec.rb index abc1234..def5678 100644 --- a/spec/resampling/hybrid_resampling_spec.rb +++ b/spec/resampling/hybrid_resampling_spec.rb @@ -8,7 +8,7 @@ sample_rate = 400 test_freq = 10.0 size = 64 - upsample_factor = 4 + upsample_factor = 10 downsample_factor = 4 order = (sample_rate / test_freq).to_i @@ -16,7 +16,7 @@ signal1 *= BlackmanWindow.new(size).data signal2 = signal1.clone.resample_hybrid upsample_factor, downsample_factor, order - #plotter = Plotter.new(:title => "Discrete resampling, up by #{upsampling_factor}, down by #{downsample_factor}") + #plotter = Plotter.new(:title => "Discrete resampling, up by #{upsample_factor}, down by #{downsample_factor}") #plotter.plot_1d("original signal" => signal1.data, "resampled signal" => signal2.data) signal2.size.should eq(signal1.size * upsample_factor / downsample_factor)
Fix typo in commented code.
diff --git a/lib/livereload-rails.rb b/lib/livereload-rails.rb index abc1234..def5678 100644 --- a/lib/livereload-rails.rb +++ b/lib/livereload-rails.rb @@ -7,4 +7,5 @@ require "livereload-rails/engine" if defined?(Rails) module Livereload + class Error < StandardError; end end
Add a specific error class.
diff --git a/lib/nehm/http_client.rb b/lib/nehm/http_client.rb index abc1234..def5678 100644 --- a/lib/nehm/http_client.rb +++ b/lib/nehm/http_client.rb @@ -34,7 +34,7 @@ end if response['status'] =~ /302/ - get_hash(response['location']) + get_hash(URI(response['location'])) end end
Fix 'undefined method `hostname' for String'
diff --git a/lib/rigor/middleware.rb b/lib/rigor/middleware.rb index abc1234..def5678 100644 --- a/lib/rigor/middleware.rb +++ b/lib/rigor/middleware.rb @@ -15,11 +15,11 @@ session_id = request.cookies['rigor.session_id'] || Digest::SHA256.hexdigest(rand.to_s) session = Rigor::Middleware::Session.new(session_id) session.load_treatment_cookies(cookies) - subject = Rigor::Subject.new(session) + Rigor.subject = Rigor::Subject.new(session) status, headers, body = app.call(env) - subject.save + Rigor.subject.save response = ::Rack::Response.new(body, status, headers) response.set_cookie('rigor.session_id', value: session_id, path: '/', expires: 1.year.from_now)
Fix handling of the subject - treatments should stick now
diff --git a/lib/ruby/cabar/error.rb b/lib/ruby/cabar/error.rb index abc1234..def5678 100644 --- a/lib/ruby/cabar/error.rb +++ b/lib/ruby/cabar/error.rb @@ -10,8 +10,8 @@ msg = [ ] msg << Cabar.yaml_header(:error) msg << " message: #{err.inspect.inspect}" - msg << " backtrace: " if err.respond_to? :backtrace + msg << " backtrace: " err.backtrace.each do | x | msg << " - #{x.to_s.inspect}" end
Print backtrace: only if err responds to it. git-svn-id: 55dab261027a0615fa60e6fe1b42a29d056462f7@84 3b289f47-807e-410a-85af-7ee1d5ead6e2
diff --git a/lib/tasks/teaspoon.rake b/lib/tasks/teaspoon.rake index abc1234..def5678 100644 --- a/lib/tasks/teaspoon.rake +++ b/lib/tasks/teaspoon.rake @@ -9,5 +9,7 @@ driver_options: ENV["driver_options"], } + options.delete_if { |k, v| v.nil? } + abort("rake teaspoon failed") if Teaspoon::Console.new(options).failures? end
Remove rake args that don't have a value Fixes #413
diff --git a/lib/twat/actions/add.rb b/lib/twat/actions/add.rb index abc1234..def5678 100644 --- a/lib/twat/actions/add.rb +++ b/lib/twat/actions/add.rb @@ -15,7 +15,7 @@ oauth = OAuth::Consumer.new( v[0], v[1], oauth_options ) token_request = oauth.get_request_token() - puts "Please authenticate the application at #{token_request.authorize_url}, then enter pin" + puts "Please authenticate the application at #{token_request.authorize_url} , then enter pin" pin = STDIN.gets.chomp begin access_token = token_request.get_access_token(oauth_verifier: pin)
Make link to auth clickable
diff --git a/config/initializers/forbid_sidekiq_in_transactions.rb b/config/initializers/forbid_sidekiq_in_transactions.rb index abc1234..def5678 100644 --- a/config/initializers/forbid_sidekiq_in_transactions.rb +++ b/config/initializers/forbid_sidekiq_in_transactions.rb @@ -1,22 +1,24 @@ module Sidekiq module Worker + mattr_accessor :inside_after_commit + self.inside_after_commit = false + module ClassMethods module NoSchedulingFromTransactions NESTING = ::Rails.env.test? ? 1 : 0 %i(perform_async perform_at perform_in).each do |name| define_method(name) do |*args| - if ActiveRecord::Base.connection.open_transactions > NESTING - raise <<-MSG.strip_heredoc - `#{self}.#{name}` cannot be called inside a transaction as this can lead to race - conditions when the worker runs before the transaction is committed and tries to - access a model that has not been saved yet. + return super(*args) if Sidekiq::Worker.inside_after_commit + return super(*args) unless ActiveRecord::Base.connection.open_transactions > NESTING - Schedule the worker from inside a `run_after_commit` block instead. - MSG - end + raise <<-MSG.strip_heredoc + `#{self}.#{name}` cannot be called inside a transaction as this can lead to + race conditions when the worker runs before the transaction is committed and + tries to access a model that has not been saved yet. - super(*args) + Use an `after_commit` hook, or include `AfterCommitQueue` and use a `run_after_commit` block instead. + MSG end end end @@ -25,3 +27,19 @@ end end end + +module ActiveRecord + class Base + module InsideAfterCommit + def committed!(*) + inside_after_commit = Sidekiq::Worker.inside_after_commit + Sidekiq::Worker.inside_after_commit = true + super + ensure + Sidekiq::Worker.inside_after_commit = inside_after_commit + end + end + + prepend InsideAfterCommit + end +end
Allow scheduling from after_commit hooks
diff --git a/lib/invenio/reviewer.rb b/lib/invenio/reviewer.rb index abc1234..def5678 100644 --- a/lib/invenio/reviewer.rb +++ b/lib/invenio/reviewer.rb @@ -0,0 +1,23 @@+module Invenio + class Reviewer + + attr_reader :client, :pull_requests + + def self.run + reviewer = new + reviewer.fetch + reviewer.review + end + + def initialize(client = GitHub::Client.new) + @client = client + @pull_requests = [] + end + + def fetch + end + + def review + end + end +end
Add Reviewer so Invenio can fetch and review Pull Requests
diff --git a/lib/json/merge_patch.rb b/lib/json/merge_patch.rb index abc1234..def5678 100644 --- a/lib/json/merge_patch.rb +++ b/lib/json/merge_patch.rb @@ -18,10 +18,19 @@ if merge_patch.is_a? Hash document.merge!(merge_patch) - document.delete_if {|k, v| v.nil? } + document.delete_if(&method(:recursive_delete_if)) return JSON.dump(document) end - rescue + rescue raise MergeError end + + def self.recursive_delete_if(key, value) + if value.kind_of?(Hash) + value.delete_if(&method(:recursive_delete_if)) + nil + else + value.nil? + end + end end
Implement a basic recursive_delete_if that passes the failing test.
diff --git a/lib/mtgox/connection.rb b/lib/mtgox/connection.rb index abc1234..def5678 100644 --- a/lib/mtgox/connection.rb +++ b/lib/mtgox/connection.rb @@ -1,4 +1,5 @@ require 'faraday_middleware' +require 'mtgox/version' module MtGox module Connection @@ -6,9 +7,11 @@ def connection options = { + :headers => { + :user_agent => "mtgox gem #{MtGox::VERSION}", + }, :ssl => {:verify => false}, :url => 'https://mtgox.com', - :headers => {:user_agent => "MtGoxGem"} } Faraday.new(options) do |connection|
Add version to user agent
diff --git a/lib/tasks/ckeditor.rake b/lib/tasks/ckeditor.rake index abc1234..def5678 100644 --- a/lib/tasks/ckeditor.rake +++ b/lib/tasks/ckeditor.rake @@ -16,6 +16,7 @@ copy_assets(/ckeditor\/styles.js/) copy_assets(/ckeditor\/skins\/moono\/.+png/) copy_assets(/ckeditor\/skins\/moono\/.+css/) + copy_assets(/ckeditor\/plugins\/.+js/) end end
Add plugins to asset copying
diff --git a/spec/shared/presenters/tree_node/common.rb b/spec/shared/presenters/tree_node/common.rb index abc1234..def5678 100644 --- a/spec/shared/presenters/tree_node/common.rb +++ b/spec/shared/presenters/tree_node/common.rb @@ -10,6 +10,14 @@ describe '#image' do it "returns with #{image}" do expect(subject.image).to eq(image) + end + end +end + +shared_examples 'TreeNode::Node#icon' do |icon| + describe '#icon' do + it "returns with #{icon}" do + expect(subject.icon).to eq(icon) end end end
Add a spec shared_example for testing TreeNode:: icons
diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index abc1234..def5678 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -1,6 +1,4 @@ class HomeController < ApplicationController - - decorates_assigned :directory_categories, with: CategoryDecorator def show
Remove forgotten decorates_assigned call in HomeController.
diff --git a/db/migrations/20161121185614_create_tasks.rb b/db/migrations/20161121185614_create_tasks.rb index abc1234..def5678 100644 --- a/db/migrations/20161121185614_create_tasks.rb +++ b/db/migrations/20161121185614_create_tasks.rb @@ -5,6 +5,7 @@ column :title, String column :body, String, text: true column :link, String + column :approved, TrueClass, default: false column :created_at, DateTime column :updated_at, DateTime end
Add new column for task model
diff --git a/app/services/action/user/signin.rb b/app/services/action/user/signin.rb index abc1234..def5678 100644 --- a/app/services/action/user/signin.rb +++ b/app/services/action/user/signin.rb @@ -32,6 +32,9 @@ def find_or_create_user(auth) user = ::User.find_or_create_with_omniauth(auth) user.github_access_token = auth["credentials"]["token"] + user.display_name = auth["info"]["name"] + user.user_name = auth["info"]["nickname"] + user.email = auth["info"]["email"] user.follows = follows(user) if user.follows.nil? user end
Update GitHub user information on sign in
diff --git a/Library/Formula/clay.rb b/Library/Formula/clay.rb index abc1234..def5678 100644 --- a/Library/Formula/clay.rb +++ b/Library/Formula/clay.rb @@ -1,8 +1,8 @@ require 'formula' class Clay < Formula - url 'http://tachyon.in/clay/binaries/clay-macosx-2011.04.18.zip' - homepage 'http://claylanguage.org' + url 'http://claylabs.com/clay/binaries/clay-macosx-2011.04.18.zip' + homepage 'http://claylabs.com/clay/' md5 '9f43d8147f95ce0d7c3cd12e368406a4' def install
Clay: Use current binary and homepage URLs The Clay homepage has moved to http://claylabs.com/clay/. The claylanguage.org hostname still redirects to the old site, so that should be changed as well. Closes #8935. Signed-off-by: Charlie Sharpsteen <828d338a9b04221c9cbe286f50cd389f68de4ecf@sharpsteen.net>
diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb index abc1234..def5678 100644 --- a/app/helpers/events_helper.rb +++ b/app/helpers/events_helper.rb @@ -5,7 +5,7 @@ end def available?(event) - event.owner == nil + event.owner == nil && event.pending end end
Remove events from the events index if they are booked
diff --git a/app/models/arcade_machine.rb b/app/models/arcade_machine.rb index abc1234..def5678 100644 --- a/app/models/arcade_machine.rb +++ b/app/models/arcade_machine.rb @@ -37,7 +37,8 @@ def as_json(opts = {}) super(opts).merge({ latitude: location.latitude, - longitude: location.longitude + longitude: location.longitude, + location: location.humanize }) end
Add location to ArcadeMachine json.
diff --git a/app/models/dto_collection.rb b/app/models/dto_collection.rb index abc1234..def5678 100644 --- a/app/models/dto_collection.rb +++ b/app/models/dto_collection.rb @@ -28,6 +28,7 @@ end def find(manager_uuid) + raise "Trying to find #{manager_uuid} in a non saved DtoCollection #{self}" unless saved? data_index[manager_uuid] end
Allow for find only in saved DtoCollection Allow for find only in saved DtoCollection
diff --git a/app/views/topics/show.atom.builder b/app/views/topics/show.atom.builder index abc1234..def5678 100644 --- a/app/views/topics/show.atom.builder +++ b/app/views/topics/show.atom.builder @@ -13,7 +13,7 @@ #entry.updated(msg.updated_at.strftime("%Y-%m-%dT%H:%M:%SZ")) entry.author do |author| - author.name msg.user.login + author.name (msg.user ? msg.user.login : msg.username) end end end @@ -26,7 +26,7 @@ #entry.updated(topic.updated_at.strftime("%Y-%m-%dT%H:%M:%SZ")) entry.author do |author| - author.name @topic.user.login + author.name (@topic.user ? @topic.user.login : @topic.username) end end
Fix use of login when no user associated
diff --git a/app/workers/extract_extension_version_worker.rb b/app/workers/extract_extension_version_worker.rb index abc1234..def5678 100644 --- a/app/workers/extract_extension_version_worker.rb +++ b/app/workers/extract_extension_version_worker.rb @@ -46,7 +46,7 @@ return body, ext rescue Octokit::NotFound - return "No readme found!", "txt" + return "There is no README file for this extension.", "txt" end def octokit
Update default missing README text
diff --git a/Framezilla.podspec b/Framezilla.podspec index abc1234..def5678 100644 --- a/Framezilla.podspec +++ b/Framezilla.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = "Framezilla" - spec.version = "2.5.0" + spec.version = "2.6.0" spec.summary = "Comfortable syntax for working with frames." spec.homepage = "https://github.com/Otbivnoe/Framezilla"
Change the podspec version -> 2.6.0
diff --git a/app/controllers/saml_controller.rb b/app/controllers/saml_controller.rb index abc1234..def5678 100644 --- a/app/controllers/saml_controller.rb +++ b/app/controllers/saml_controller.rb @@ -9,7 +9,7 @@ end def request_post - x_forwarded_for = headers.fetch("X-Forwarded-For", UNDETERMINED_IP) + x_forwarded_for = request.headers.fetch("X-Forwarded-For", UNDETERMINED_IP) cookies_from_api = authn_request_proxy.proxy(params['SAMLRequest'], params['RelayState'], x_forwarded_for) cookies_hash = CookieFactory.new(Rails.configuration.x.cookies.secure).create(cookies_from_api) cookies_hash.each { |name, value| cookies[name] = value }
3321: Fix getting principal IP from headers Authors: 72d0743fa974f1b94d0389ab43a06cc7eebf90ac@chrisholmes
diff --git a/simple_datatable.gemspec b/simple_datatable.gemspec index abc1234..def5678 100644 --- a/simple_datatable.gemspec +++ b/simple_datatable.gemspec @@ -9,9 +9,9 @@ s.version = SimpleDatatable::VERSION s.authors = ["An Cao"] s.email = ["ancv.it@gmail.com"] - s.homepage = "TODO" - s.summary = "TODO: Summary of SimpleDatatable." - s.description = "TODO: Description of SimpleDatatable." + s.homepage = "https://github.com/Ruby-SG/simple_datatable/" + s.summary = "Simple manage admin with datatable" + s.description = "Add datatable" s.license = "MIT" s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"]
Update gemspec file: homepage, summary and description
diff --git a/lib/buildbox/result.rb b/lib/buildbox/result.rb index abc1234..def5678 100644 --- a/lib/buildbox/result.rb +++ b/lib/buildbox/result.rb @@ -23,11 +23,11 @@ end def append(chunk) - @output += chunk + @output += Buildbox::UTF8.clean(chunk) end def output - Buildbox::UTF8.clean(@output).chomp + @output.chomp end def as_json
Clean up utf8 as we go.
diff --git a/lib/doccy/documents.rb b/lib/doccy/documents.rb index abc1234..def5678 100644 --- a/lib/doccy/documents.rb +++ b/lib/doccy/documents.rb @@ -3,7 +3,8 @@ class Documents def self.create(auth_token, template_id, document_params) - options = { query: { auth_token: auth_token, document: document_params} } + # options = { query: { auth_token: auth_token, document: document_params} } + options = { body: { auth_token: auth_token, document: document_params} } response = HTTParty.post("#{Doccy::Config.url}/templates/#{template_id}/documents.json", options) end
Fix issue with 414 error when posting to create a document
diff --git a/app/models/metrics/link_checker.rb b/app/models/metrics/link_checker.rb index abc1234..def5678 100644 --- a/app/models/metrics/link_checker.rb +++ b/app/models/metrics/link_checker.rb @@ -0,0 +1,24 @@+require 'typhoeus' + +module Metrics + + class LinkChecker < Metric + attr_reader :score + + def initialize(metadata, worker=nil) + @worker = worker + @total = metadata.length + @resource_availability = Hash.new + metadata.each_with_index do |dataset, i| + dataset[:resources].each do |resource| + @resources += 1 + url = resource[:url] + enqueue_request(url) + end + @worker.at(i + i, @total) + end + end + + end + +end
Create Link Checker metric class with initializer Similar to the Accuracy metric I have added code for the Link Checker metric initializer. Signed-off-by: Konrad Reiche <4ff0213f56e2082fcd8c882d04c546881c579ce4@gmail.com>