diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/app/calculators/depreciation_calculator.rb b/app/calculators/depreciation_calculator.rb index abc1234..def5678 100644 --- a/app/calculators/depreciation_calculator.rb +++ b/app/calculators/depreciation_calculator.rb @@ -12,7 +12,8 @@ end def residual_value(asset) - purchase_cost(asset) * (@policy.get_policy_item(asset).pcnt_residual_value / 100.0) + policy = @policy.nil? ? asset.policy : @policy + purchase_cost(asset) * (policy.get_policy_item(asset).pcnt_residual_value / 100.0) end def purchase_cost(asset)
Fix bug in depreciation calculator
diff --git a/fakeetc.gemspec b/fakeetc.gemspec index abc1234..def5678 100644 --- a/fakeetc.gemspec +++ b/fakeetc.gemspec @@ -23,7 +23,7 @@ gem.required_ruby_version = '>= 1.9.3' - gem.add_development_dependency 'rake', '~> 10.4.2' + gem.add_development_dependency 'rake', '~> 12.3.3' gem.add_development_dependency 'minitest', '~> 5.6.0' gem.add_development_dependency 'yard', '~> 0.9.12' end
Update rake dependency (cf. CVE-2020-8130)
diff --git a/lib/avoid_metreon/moscone_event_crawler.rb b/lib/avoid_metreon/moscone_event_crawler.rb index abc1234..def5678 100644 --- a/lib/avoid_metreon/moscone_event_crawler.rb +++ b/lib/avoid_metreon/moscone_event_crawler.rb @@ -7,7 +7,7 @@ base_url 'http://www.moscone.com/site/do/event/list' - items 'xpath=//table[@id=\'list\']/tr[td]', :iterator do + items 'xpath=//table[@id=\'list\']/tr[td+td+td+td]', :iterator do start_date xpath: 'td[1]' do |d| Date.strptime(d.split(' - ').first, '%m/%d/%y') end
Fix row detection in Moscone calendar crawler. Previously, the crawler would look for any row with at least one TD element and try to parse it as an event. However, when a month has no more remaining events, it inserts a 4-column spanned TD element. So now the parser looks for rows with 4 individual columns.
diff --git a/Casks/josm.rb b/Casks/josm.rb index abc1234..def5678 100644 --- a/Casks/josm.rb +++ b/Casks/josm.rb @@ -1,7 +1,7 @@ class Josm < Cask url 'http://josm.openstreetmap.de/download/macosx/josm-macosx.zip' homepage 'http://josm.openstreetmap.de' - version '6388' - sha1 'b7973548df871e7d7edd6f14bd0953f4786fae5a' + version 'latest' + no_checksum link 'JOSM.app' end
Change Cask for proper use of version-less download URL
diff --git a/lib/action_view/bruce/bruce-yaml-output.rb b/lib/action_view/bruce/bruce-yaml-output.rb index abc1234..def5678 100644 --- a/lib/action_view/bruce/bruce-yaml-output.rb +++ b/lib/action_view/bruce/bruce-yaml-output.rb @@ -15,10 +15,9 @@ end end - def save + def save(percentage = 0) # Create new construct object - config = Construct.new - config.percentage = 80 + config = Construct.new({percentage: percentage}) # Produce output.yaml file File.open(CONFIG_FILE, 'w') do |file|
Allow a percentage to be passed in for saving Bruce's configuration
diff --git a/lib/locomotive/liquid/filters/translate.rb b/lib/locomotive/liquid/filters/translate.rb index abc1234..def5678 100644 --- a/lib/locomotive/liquid/filters/translate.rb +++ b/lib/locomotive/liquid/filters/translate.rb @@ -17,7 +17,7 @@ if scope.blank? translation = Locomotive::Translation.where(key: input).first if translation.nil? - input + raise "No translation for #{input} found" elsif translation.values[locale].present? translation.values[locale] else
Raise an exception instead of returning the original input if no translation found
diff --git a/lib/composeeverything/functionalgoodies.rb b/lib/composeeverything/functionalgoodies.rb index abc1234..def5678 100644 --- a/lib/composeeverything/functionalgoodies.rb +++ b/lib/composeeverything/functionalgoodies.rb @@ -2,4 +2,46 @@ def compose(with) ->(x) { with[self[x]] } end + + def f_add(idx, output) + union ->(x) { + if x == idx then ouput end + } + end + + def intersection(with) + ->(x) { + a = self[x] + if a == with[x] + a + end + } + end + + def union(with) + ->(x) { + a = self[x] + if y.nil? + a + else + with[x] + end + } + end + + def f_delete(a) + remove ->(x) { + a + } + end + + def remove(removed) + ->(x) { + a = self[x] + b = removed[x] + if a != b + a + end + } + end end
Add a couple of interesting functions * `#f_add`, adds an output in the appropriate index * `#intersection`, the (index, item) pairs the two sets share * `#union`, Produces the two sets concatenated, or the union of the setsin math terms * `#f_delete`, deletes all items that are the same as a * `#remove`, removes all items shared by the two sets. Equivalent to (A.union B).remove(A.intersection B)
diff --git a/lib/generators/roboto/install_generator.rb b/lib/generators/roboto/install_generator.rb index abc1234..def5678 100644 --- a/lib/generators/roboto/install_generator.rb +++ b/lib/generators/roboto/install_generator.rb @@ -5,21 +5,18 @@ desc "Creates a Roboto locale files to your application." - def copy_robots - if FileTest.exists?("public/robots.txt") - copy_file File.join(destination_root + "/public/robots.txt"), "config/robots/production.txt" - remove_file "public/robots.txt" - end - end - def copy_locale empty_directory "config/robots" env_list = Dir.glob("#{destination_root}/config/environments/*") env_list.each do |env_file| env_name = File.basename(env_file, ".rb") - unless env_name == "production" && FileTest.exists?("public/robots.txt") + unless (env_name == "production" && FileTest.exists?("public/robots.txt")) copy_file "robots.txt", "config/robots/#{env_name}.txt" end + end + if FileTest.exists?("public/robots.txt") + copy_file File.join(destination_root + "/public/robots.txt"), "config/robots/production.txt" + remove_file "public/robots.txt" end end
FIX generator conflict on production.txt
diff --git a/lib/rollbar/truncation/strings_strategy.rb b/lib/rollbar/truncation/strings_strategy.rb index abc1234..def5678 100644 --- a/lib/rollbar/truncation/strings_strategy.rb +++ b/lib/rollbar/truncation/strings_strategy.rb @@ -22,10 +22,10 @@ ::Rollbar::Util.iterate_and_update(new_payload, truncate_proc) result = dump(new_payload) - return result unless truncate?(result) + break unless truncate?(result) end - result # Here we are just returning the last result value + result end def truncate_strings_proc(threshold)
Replace return statement with break in StringsStrategy.
diff --git a/lib/tasks/import/service_interactions.rake b/lib/tasks/import/service_interactions.rake index abc1234..def5678 100644 --- a/lib/tasks/import/service_interactions.rake +++ b/lib/tasks/import/service_interactions.rake @@ -0,0 +1,29 @@+require 'local-links-manager/import/services_importer' +require 'local-links-manager/import/interactions_importer' +require 'local-links-manager/import/service_interactions_importer' + +namespace :import do + namespace :service_interactions do + desc "Import ServiceInteractions and dependencies" + task import_all: :environment do + Rake::Task["import:service_interactions:import_services"].invoke + Rake::Task["import:service_interactions:import_interactions"].invoke + Rake::Task["import:service_interactions:import_service_interactions"].invoke + end + + desc "Import Services from standards.esd.org.uk" + task import_services: :environment do + LocalLinksManager::Import::ServicesImporter.import + end + + desc "Import Interactions from standards.esd.org.uk" + task import_interactions: :environment do + LocalLinksManager::Import::InteractionsImporter.import + end + + desc "Import ServicesInteractions from standards.esd.org.uk" + task import_service_interactions: :environment do + LocalLinksManager::Import::ServiceInteractionsImporter.import + end + end +end
Create import task for ServiceInteractions The rake task groups all import tasks for Services, Interactions and ServiceInteractions. The order is important so that Services and Interactions are fully imported before ServiceInteractions which links them together. Therefore, the rake task should be invoked with `import_all`
diff --git a/Casks/lingon-x.rb b/Casks/lingon-x.rb index abc1234..def5678 100644 --- a/Casks/lingon-x.rb +++ b/Casks/lingon-x.rb @@ -2,10 +2,12 @@ version :latest sha256 :no_check - url 'http://www.peterborgapps.com/downloads/LingonX.zip' - appcast 'http://www.peterborgapps.com/updates/lingonx-appcast.xml' + url 'http://www.peterborgapps.com/downloads/LingonX2.zip' + appcast 'http://www.peterborgapps.com/updates/lingonx2-appcast.xml' homepage 'http://www.peterborgapps.com/lingon/' - license :unknown # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder + license :commercial app 'Lingon X.app' + + depends_on :macos => '>= :yosemite' end
Add Lingon X 2.0, moved Lingon X 1.0 to versions Per the discussion on caskroom/homebrew-cask#8844, Lingon X v1.0 will be moved to caskroom/homebrew-versions and v2.0 will replace v1.0 here (+2 squashed commits) [280f122] Add OS version conditional to Lingon X Cask Added a conditional to determine if we should install Lingon 1 or Lingon 2 depending on the user's version of OS X. [80d3909] Add Lingon X.app v2.0 Lingon X version 1.0 already exists as lingon-x but Lingon X 2.0 is an entirely new version of Lingon X which only runs on Yosemite 10.10 or higher. In my opinion, Lingon X 1.0 is still a valid Cask for this very reason, and I think including 2.0 as lingon-x2 is the best way to handle this updated version.
diff --git a/lib/wovnrb/html_replacers/replacer_base.rb b/lib/wovnrb/html_replacers/replacer_base.rb index abc1234..def5678 100644 --- a/lib/wovnrb/html_replacers/replacer_base.rb +++ b/lib/wovnrb/html_replacers/replacer_base.rb @@ -18,7 +18,7 @@ # <title> may not contain other markup, so add comment-node to node's previous # @see https://www.w3.org/TR/html401/struct/global.html#h-7.4.2 def add_comment_node(node, text) - comment_node = Nokogiri::XML::Comment.new(node, "wovn-src:#{text}") + comment_node = Nokogiri::XML::Comment.new(node.document, "wovn-src:#{text}") if node.parent.name == 'title' node.parent.add_previous_sibling(comment_node) else @@ -30,4 +30,4 @@ from.gsub(/\A(\s*)[\S\s]*?(\s*)\Z/, '\1' + to + '\2') end end -end+end
Fix segmentation introduced with release 0.2.11. Creating a comment node needs to be done from the node's document instead of the node itself.
diff --git a/populate_task.rb b/populate_task.rb index abc1234..def5678 100644 --- a/populate_task.rb +++ b/populate_task.rb @@ -2,7 +2,6 @@ require 'json' require 'base64' require 'couch' -require 'actionpool' class PopulateTask < Rake::TaskLib @@ -27,14 +26,12 @@ percent = 0.0 start = Time.now.to_i - pool = ActionPool::Pool.new :min_threads => 3, :max_threads => 10 couch.each do |doc| data = JSON(doc['data']) id = doc['id'] - pool.process do - RestClient.post "#{cla}/train/#{Base64.encode64(id)}", data - puts "#{percent = (progress*100.0/count).floor}% geladen" if ((progress+=1)*100.0/count).floor > percent - end + RestClient.post "#{cla}/train/#{Base64.encode64(id)}", data + progress += 1 + puts "#{percent = (progress*100.0/count).floor}% geladen" if (progress*100.0/count).floor > percent end puts "done. #{(Time.now.to_i-start)} secs." end
Revert "Thread pooling in populate task" This reverts commit 48858ffaa677c4b8534c42bdbd56b0dd60dcc717.
diff --git a/app/models/effective/datatable_dsl_tool.rb b/app/models/effective/datatable_dsl_tool.rb index abc1234..def5678 100644 --- a/app/models/effective/datatable_dsl_tool.rb +++ b/app/models/effective/datatable_dsl_tool.rb @@ -18,7 +18,7 @@ @view = datatable.view end - def method_missing(method, *args, &block) + def method_missing(method, *args, **kwargs, &block) # Catch a common error if [:bulk_actions, :charts, :collection, :filters].include?(method) && in_datatables_do_block raise "#{method} block must be declared outside the datatable do ... end block" @@ -26,15 +26,15 @@ if datatable.respond_to?(method) if block_given? - datatable.send(method, *args) { yield } + datatable.send(method, *args, **kwargs) { yield } else - datatable.send(method, *args) + datatable.send(method, *args, **kwargs) end elsif view.respond_to?(method) if block_given? - view.send(method, *args) { yield } + view.send(method, *args, **kwargs) { yield } else - view.send(method, *args) + view.send(method, *args, **kwargs) end else super
Add support for ruby 3.1 keyword arguments
diff --git a/LambdaKit.podspec b/LambdaKit.podspec index abc1234..def5678 100644 --- a/LambdaKit.podspec +++ b/LambdaKit.podspec @@ -12,5 +12,5 @@ s.watchos.deployment_target = '2.0' s.ios.source_files = 'Source/*.swift' - s.watchos.source_files = 'Source/NSObject*.swift', 'Source/NSTimer*.swift', 'Source/CLLocationManager*.swift' + s.watchos.source_files = 'Source/NSObject*.swift', 'Source/CLLocationManager*.swift' end
Remove timer from watchOS files
diff --git a/app/controllers/api/v1/ndcs_controller.rb b/app/controllers/api/v1/ndcs_controller.rb index abc1234..def5678 100644 --- a/app/controllers/api/v1/ndcs_controller.rb +++ b/app/controllers/api/v1/ndcs_controller.rb @@ -13,11 +13,34 @@ values: [:label, :location] ) + if location_list + indicators = indicators.where( + values: { locations: { iso_code3: location_list } } + ) + end + + if params[:filter] == 'map' + indicators = indicators.where(on_map: true) + end + + if params[:filter] == 'summary' + indicators = indicators.where(summary_list: true) + end + categories = ::CaitIndc::Category.all render json: NdcIndicators.new(indicators, categories), serializer: Api::V1::CaitIndc::NdcIndicatorsSerializer end + + private + + def location_list + params[:location].blank? ? + nil : + params[:location].split(',') + end + end end end
Add filters to `/ndcs` endpoint `location` will take a comma-separated list of ISO3 values: `?location=AFG,CHN` `filter` will take either `map` or `summary` as a parameter, and it will retrieve indicators that are to be rendered on the map or on the summary screen.
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 @@ -21,8 +21,4 @@ User.current = current_user end - def auth_user - redirect_to new_user_registration_path unless @current_user.present? - end - end
Remove unnecessary method from application controller.
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,5 @@ class ApplicationController < ActionController::Base - UNSTORED_LOCATIONS = ['/users/sign_up', '/users/sign_in', '/users/password', 'users/sign_out'] + UNSTORED_LOCATIONS = ['/users/sign_up', '/users/sign_in', '/users/password', '/users/sign_out', '/users/invitation'] before_filter :store_location
Add invitations path to blacklist stored paths
diff --git a/app/controllers/consultants_controller.rb b/app/controllers/consultants_controller.rb index abc1234..def5678 100644 --- a/app/controllers/consultants_controller.rb +++ b/app/controllers/consultants_controller.rb @@ -19,6 +19,6 @@ private def consultant_params - params.require(:consultant).permit! + params.require(:consultant).permit(:name, :nickname, :email, :outcome, :income) end end
Resolve params.permit! on consultants controller
diff --git a/app/controllers/invitations_controller.rb b/app/controllers/invitations_controller.rb index abc1234..def5678 100644 --- a/app/controllers/invitations_controller.rb +++ b/app/controllers/invitations_controller.rb @@ -1,5 +1,5 @@ class InvitationsController < ApplicationController - ssl_required :create, :edit, :update + ssl_required :edit, :update layout 'front_layout' @@ -20,7 +20,6 @@ end def update - render :action => :edit and return unless params[:user] @user = User[:id => params[:id]] @@ -36,17 +35,14 @@ end def invite_token_valid? - redirect_to root_path and return if params.blank? + redirect_to root_path and return false if params.blank? || (params[:invite_token].blank? && params[:user].blank?) invite_token = params[:invite_token] || params[:user][:invite_token] - redirect_to root_path and return if params[:id].blank? || invite_token.blank? + redirect_to root_path and return false if params[:id].blank? || invite_token.blank? @user = User.filter({:id => params[:id]} & {:invite_token => invite_token}).first - - redirect_to root_path and return if @user.nil? || @user.invite_token_date < 30.days.ago.to_date - rescue - redirect_to root_path + redirect_to root_path and return false if @user.nil? || @user.invite_token_date < 30.days.ago.to_date end private :invite_token_valid? -end +end
Create method without SSL Some refactoring
diff --git a/app/view_adapters/view_adapter_registry.rb b/app/view_adapters/view_adapter_registry.rb index abc1234..def5678 100644 --- a/app/view_adapters/view_adapter_registry.rb +++ b/app/view_adapters/view_adapter_registry.rb @@ -3,21 +3,22 @@ get(document.document_type).new(document) end - private +private + VIEW_ADAPTER_MAP = { + "aaib_report" => AaibReportViewAdapter, + "asylum_support_decision" => AsylumSupportDecisionViewAdapter, + "cma_case" => CmaCaseViewAdapter, + "countryside_stewardship_grant" => CountrysideStewardshipGrantViewAdapter, + "drug_safety_update" => DrugSafetyUpdateViewAdapter, + "esi_fund" => EsiFundViewAdapter, + "international_development_fund" => InternationalDevelopmentFundViewAdapter, + "maib_report" => MaibReportViewAdapter, + "medical_safety_alert" => MedicalSafetyAlertViewAdapter, + "raib_report" => RaibReportViewAdapter, + "vehicle_recalls_and_faults_alert" => VehicleRecallsAndFaultsAlertViewAdapter, + }.freeze def get(type) - { - "aaib_report" => AaibReportViewAdapter, - "cma_case" => CmaCaseViewAdapter, - "countryside_stewardship_grant" => CountrysideStewardshipGrantViewAdapter, - "drug_safety_update" => DrugSafetyUpdateViewAdapter, - "esi_fund" => EsiFundViewAdapter, - "international_development_fund" => InternationalDevelopmentFundViewAdapter, - "maib_report" => MaibReportViewAdapter, - "medical_safety_alert" => MedicalSafetyAlertViewAdapter, - "raib_report" => RaibReportViewAdapter, - "vehicle_recalls_and_faults_alert" => VehicleRecallsAndFaultsAlertViewAdapter, - "asylum_support_decision" => AsylumSupportDecisionViewAdapter, - }.fetch(type) + VIEW_ADAPTER_MAP.fetch(type) end end
Make view adapter mapping a constant hash with sorted keys.
diff --git a/site-cookbooks/dna/recipes/osx_apps.rb b/site-cookbooks/dna/recipes/osx_apps.rb index abc1234..def5678 100644 --- a/site-cookbooks/dna/recipes/osx_apps.rb +++ b/site-cookbooks/dna/recipes/osx_apps.rb @@ -7,7 +7,7 @@ include_recipe "sprout-osx-apps::android_sdk" include_recipe "pivotal_workstation::sublime_text" include_recipe "sprout-osx-apps::chrome_canary" -# include_recipe "dna-osx-apps::keepassx" +include_recipe "dna-osx-apps::keepassx" # include_recipe "sprout-osx-apps::charles_proxy" # include_recipe "dna-osx-apps::vmwarefusion" # include_recipe "dna-osx-apps::imageoptim" @@ -15,4 +15,4 @@ include_recipe "sprout-osx-apps::viscosity" include_recipe "sprout-osx-apps::1password" include_recipe "sprout-osx-apps::evernote" -include_recipe "sprout-osx-apps::vlc"+include_recipe "sprout-osx-apps::vlc"
Use keepass on the machines.
diff --git a/zurui-sass-rails.gemspec b/zurui-sass-rails.gemspec index abc1234..def5678 100644 --- a/zurui-sass-rails.gemspec +++ b/zurui-sass-rails.gemspec @@ -15,5 +15,5 @@ gem.require_paths = ["lib"] gem.version = ZuruiSassRails::VERSION - gem.add_dependency "railties", "~> 3.1" + gem.add_dependency "railties", ">= 3.1" end
Fix gem dependency for Rails4
diff --git a/app/controllers/practiceit_controller.rb b/app/controllers/practiceit_controller.rb index abc1234..def5678 100644 --- a/app/controllers/practiceit_controller.rb +++ b/app/controllers/practiceit_controller.rb @@ -5,7 +5,8 @@ @error_messages = Array.new begin - grades_spreadsheet = GradesSpreadsheet.new(ENV['BB_EMAIL'], ENV['BB_CRED'], ENV['BB_DOC_ID']) + raise "You need to provide the doc_id of the google spreadsheet" if params[:doc_id].nil? + grades_spreadsheet = GradesSpreadsheet.new(ENV['BB_EMAIL'], ENV['BB_CRED'], params[:doc_id]) students = grades_spreadsheet.students_list
Allow to receive the google spreadsheet doc id as a parameter in the controller
diff --git a/app/models/manageiq/providers/regions.rb b/app/models/manageiq/providers/regions.rb index abc1234..def5678 100644 --- a/app/models/manageiq/providers/regions.rb +++ b/app/models/manageiq/providers/regions.rb @@ -2,7 +2,7 @@ class Regions class << self def regions - from_file.merge(additional_regions).except(*disabled_regions) + from_source.merge(additional_regions).except(*disabled_regions) end def all @@ -15,9 +15,9 @@ private - def from_file + def from_source # Memoize the regions file as this should not change at runtime - @from_file ||= YAML.load_file(regions_yml).transform_values(&:freeze).freeze + @from_source ||= YAML.load_file(regions_yml).transform_values(&:freeze).freeze end def additional_regions
Rename Regions from_file to from_source
diff --git a/spec/features/stashes_features_spec.rb b/spec/features/stashes_features_spec.rb index abc1234..def5678 100644 --- a/spec/features/stashes_features_spec.rb +++ b/spec/features/stashes_features_spec.rb @@ -0,0 +1,33 @@+require 'spec_helper' + +describe "Stashes" do + before :all do + load "#{Rails.root}/db/seeds.rb" + end + + before :each do + user = FactoryGirl.create(:user) + user.add_role :admin + sign_in_user(user) + visit '/stashes' + end + + it "should show the stashes page" do + page.should have_content "Stashes" + end + + it "should show the correct stash count" do + page.should have_content "Stashes (#{Stash.all.count})" + end + + it "should show stashes and correct data" do + page.should have_content "i-424242" + page.should have_content "Never" + page.should have_content time_ago_in_words(Time.at(1364332102)) + end + + it "should have a delete link" do + page.should have_button "Delete" + end + +end
Add feature specs for stashes
diff --git a/spec/helpers/navegacion_helper_spec.rb b/spec/helpers/navegacion_helper_spec.rb index abc1234..def5678 100644 --- a/spec/helpers/navegacion_helper_spec.rb +++ b/spec/helpers/navegacion_helper_spec.rb @@ -0,0 +1,50 @@+# encoding: utf-8 + +require 'spec_helper' + +describe NavegacionHelper do + describe "#lista_con_enlaces" do + it "devuelve nada pasándole nada" do + helper.lista_con_enlaces([]).should == '' + end + + context "un enlace como URL" do + let(:lista) { helper.lista_con_enlaces [['Posts', '/posts']] } + + it "genera una lista con un elemento" do + lista.should have_selector 'ul', count: 1 + lista.should have_selector 'li', count: 1 + end + + it "genera un enlace" do + lista.should have_selector 'li a', count: 1 + lista.should have_selector 'a[href="/posts"]' + lista.should have_selector 'a', text: 'Posts' + end + end + + context "un enlace con opciones" do + let(:lista) do + helper.lista_con_enlaces [['Posts', '/posts', :class => :mejor]] + end + + it "genera un enlace con las opciones indicadas" do + lista.should have_selector 'a[class=mejor]' + end + end + + context "un enlace como formulario" do + let(:lista) do + helper.lista_con_enlaces [['Borrar', '/posts', form: true, method: :delete]] + end + + it "genera un formulario" do + lista.should have_selector 'li form', count: 1 + end + + it "genera un botón con el texto" do + lista.should have_selector 'input[type="submit"][value="Borrar"]' + end + end + end +end
Test de la generación de lista de enlaces.
diff --git a/spec/package_command_generator_spec.rb b/spec/package_command_generator_spec.rb index abc1234..def5678 100644 --- a/spec/package_command_generator_spec.rb +++ b/spec/package_command_generator_spec.rb @@ -13,5 +13,22 @@ "" ]) end + + it "works with the example project with no additional parameters and an apostrophe/single quote in the product name" do + options = { project: "./examples/standard/Example.xcodeproj" } + Gym.config = FastlaneCore::Configuration.create(Gym::Options.available_options, options) + + allow(Gym::PackageCommandGenerator).to receive(:appfile_path).and_return("Krause's App") + + result = Gym::PackageCommandGenerator.generate + expect(result).to eq([ + "/usr/bin/xcrun /tmp/PackageApplication4Gym -v", + Shellwords.escape("Krause's App"), + "-o '#{Gym::PackageCommandGenerator.ipa_path}'", + "exportFormat ipa", + "" + ]) + end + end end
Test to make sure the path is shell escaped.
diff --git a/app/services/submit_dirty_answers_job.rb b/app/services/submit_dirty_answers_job.rb index abc1234..def5678 100644 --- a/app/services/submit_dirty_answers_job.rb +++ b/app/services/submit_dirty_answers_job.rb @@ -4,14 +4,15 @@ end def send_to_report_service(run) - begin - # only send answers which are 'dirty': - sender = ReportService::RunSender.new(run, {send_all_answers: false}) - sender.send() - rescue => e - Rails.logger.error("Couldn't send run #{run.key} to report service:") - Rails.logger.error(e) - end + # only send answers which are 'dirty': + sender = ReportService::RunSender.new(run, {send_all_answers: false}) + response = sender.send + Rails.logger.info( + "Run sent to report service, success: #{response.success?}, " + + "num_answers: #{run.answers.count}, #{run.run_info_string}, " + + "response: #{response.code} #{response.message} #{response.body}" + ) + run.abort_job_and_requeue(run.run_info_string) unless response.success? end def perform @@ -19,20 +20,18 @@ # Find array of dirty answers and send them to the portal da = run.dirty_answers return if da.empty? - if run.send_to_portal(da, start_time) - # if there is a report service configured send run data there - send_to_report_service(run) if ReportService::configured? - run.set_answers_clean(da) # We're only cleaning the same set we sent to the portal - run.reload - if run.dirty_answers.empty? - run.mark_clean - else - # I'm not sure about using this method here, because it raises an error when the - # "problem" may just be that (a) new dirty answer(s) were submitted between the - # send_to_portal call and the check here. - run.abort_job_and_requeue - end + run.send_to_portal(da, start_time) + # if there is a report service configured send run data there + send_to_report_service(run) if ReportService::configured? + # We're only cleaning the same set we sent to the portal and report service + run.set_answers_clean(da) + run.reload + if run.dirty_answers.empty? + run.mark_clean else + # I'm not sure about using this method here, because it raises an error when the + # "problem" may just be that (a) new dirty answer(s) were submitted between the + # send_to_portal call and the check here. run.abort_job_and_requeue end end
Add logging and fix job error handling while sending run to report service [#168170575]
diff --git a/spec/traffic_jam_configuration_spec.rb b/spec/traffic_jam_configuration_spec.rb index abc1234..def5678 100644 --- a/spec/traffic_jam_configuration_spec.rb +++ b/spec/traffic_jam_configuration_spec.rb @@ -10,7 +10,7 @@ describe 'constructor' do it "should take default options" do config = TrafficJam::Configuration.new(key_prefix: 'hello') - config.key_prefix = 'hello' + assert_equal 'hello', config.key_prefix end end
Fix a test that didn't have an assertion.
diff --git a/spec/unit/concurrent/condition_spec.rb b/spec/unit/concurrent/condition_spec.rb index abc1234..def5678 100644 --- a/spec/unit/concurrent/condition_spec.rb +++ b/spec/unit/concurrent/condition_spec.rb @@ -44,24 +44,24 @@ describe "#notify_all" do it "notifies all the threads waiting on the latch" do condition = described_class.new - xs = [] + @xs = [] t1 = Thread.new do subject.wait - xs << :notified1 + @xs << :notified1 end - sleep 0.25 + sleep 1.0 t2 = Thread.new do subject.wait - xs << :notified2 + @xs << :notified2 end sleep 0.5 subject.notify_all - sleep 0.5 - xs.should include(:notified1) - xs.should include(:notified2) + sleep 1.5 + @xs.should include(:notified1) + @xs.should include(:notified2) end end end
Make this test consistently pass on JRuby We all love heisenbugs, right
diff --git a/week-5/acct_groups.rb b/week-5/acct_groups.rb index abc1234..def5678 100644 --- a/week-5/acct_groups.rb +++ b/week-5/acct_groups.rb @@ -0,0 +1,32 @@+##Pseudocode + +# Iterate through the list of names +# => Divide the list into sets of 4 +# => Make each set of 4 a separate group +# => Increment the group number + + +list_of_names = [ "Alec", "Bubba", "Goofy", "Blossom", "Gary", "Larry", "Mary", "Harry" ] + +def group_maker(list_of_names) + groups = [] + list_of_names.each_slice(4) { |a| groups << a } + groups + groups.each_with_index do |group, i| + puts "Group#{i + 1}: #{group}" + end +end +group_maker(list_of_names) + +=begin +**What was the most interesting and most difficult part of this challenge?** + The number of different methods that I could potentially use was really interesting and also really difficult. I found that I was bouncing around between methods because I started with an idea of what I wanted to do, and I tried to find a method to fit what I had in mind. This led to quite a bit of frustration and failed attempts. +**Do you feel you are improving in your ability to write pseudocode and break the problem down?** + I feel like I am thinking more about each step that I have to take before diving in, and I do check back with my pseudocode more often when I am having trouble finding a solution. It feels like I am laying an outline for my code, and trying to find methods to fit the outline. I am running into trouble with this line of thinking when I am unable to find a method that fits right. Maybe I just need to be more flexible. +**Was your approach for automating this task a good solution? What could have made it even better?** + I think it's a good solution. To make it better, I could add some logic to check the length of the list and make sure that everyone is getting into equal groups. +**What data structure did you decide to store the accountability groups in and why?** + I stored the groups in an array because they had a built in index that I could split them up by. +**What did you learn in the process of refactoring your initial solution? Did you learn any new Ruby methods?** + I learned how to properly use "each_slice" to chop up one array and create another. +=end
Create accountability groups from a list
diff --git a/ci_environment/cassandra/recipes/datastax.rb b/ci_environment/cassandra/recipes/datastax.rb index abc1234..def5678 100644 --- a/ci_environment/cassandra/recipes/datastax.rb +++ b/ci_environment/cassandra/recipes/datastax.rb @@ -40,3 +40,10 @@ package "dsc" do action :install end + +service "cassandra" do + supports :restart => true, :status => true + # intentionally disabled on boot to save on RAM available to projects, + # supposed to be started manually by projects that need it. MK. + action [:disable] +end
Disable Cassandra service, too (for the same reason as ElasticSearch) Won't start on boot, supposed to be started manually.
diff --git a/app/jobs/slack_job.rb b/app/jobs/slack_job.rb index abc1234..def5678 100644 --- a/app/jobs/slack_job.rb +++ b/app/jobs/slack_job.rb @@ -1,5 +1,5 @@ class SlackJob < ActiveJob::Base - + def perform(post) # Assemble message url = "#{AppSettings['settings.site_url']}#{Rails.application.routes.url_helpers.admin_topic_path(post.topic.id)}" @@ -11,7 +11,7 @@ } # Send Ping - notifier = Slack::Notifier.new AppSettings['slack.post_url'] + notifier = Slack::Notifier.new AppSettings['slack.post_url'], username: "HelpyBot" notifier.ping title, attachments: [message], channel: AppSettings['slack.default_channel'] end end
Add username back in correct place
diff --git a/apache2/recipes/mod_php5.rb b/apache2/recipes/mod_php5.rb index abc1234..def5678 100644 --- a/apache2/recipes/mod_php5.rb +++ b/apache2/recipes/mod_php5.rb @@ -22,6 +22,10 @@ package "libapache2-mod-php5" do action :install end +when "centos", "redhat", "fedora" + package "php" do + action :install + end end apache_module "php5"
Add support for php on redhat/centos/fedora.
diff --git a/app/models/ability.rb b/app/models/ability.rb index abc1234..def5678 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -5,7 +5,7 @@ # person can :update, person - can :update, Person.undeleted, family: person.family if person.adult? + can :update, Person, family: person.family, deleted: false if person.adult? can :manage, Person if person.admin?(:edit_profiles) # family
Speed up Ability definition on person by not using scope. I'm not sure why using the 'undeleted' scope was so slow here. It seems to add about 1-2 seconds every time it is called -- perhaps it is querying *all* undeleted Persons in order to determine if any of them match the conditions in the third parameter?
diff --git a/app/models/contact.rb b/app/models/contact.rb index abc1234..def5678 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -14,7 +14,7 @@ validates :message, presence: true def send_copy=(value) - @send_copy = ActiveRecord::Type::Boolean.new.type_cast_from_database(value) + @send_copy = ActiveRecord::Type::Boolean.new.cast(value) end def add_recipients(recipients=[])
Update Contact model sendcopy setter There was an api change in the final release of rails 5.0.0 for casting user submitted form data to booleans. The correct call is now ActiveRecord::Type::Boolean.new.cast.
diff --git a/spec/deploy_spec.rb b/spec/deploy_spec.rb index abc1234..def5678 100644 --- a/spec/deploy_spec.rb +++ b/spec/deploy_spec.rb @@ -41,6 +41,19 @@ end describe "find" do - it "is pending" + before :all do + @attributes = FactoryGirl.attributes_for(:deploy) + @project_id = 1 + @deploy_id = 2 + + client_stub = stub('client') + client_stub.expects(:get).with("projects/#{@project_id}/deploys/#{@deploy_id}").returns(@attributes) + Honeybadger::Read.stubs(:client).returns(client_stub) + end + + it "should find a deploy" do + Honeybadger::Read::Deploy.expects(:new).with(@attributes).once + Honeybadger::Read::Deploy.find(@project_id, @deploy_id) + end end end
Add test for finding a deploy.
diff --git a/app/jobs/update_pharmgkb.rb b/app/jobs/update_pharmgkb.rb index abc1234..def5678 100644 --- a/app/jobs/update_pharmgkb.rb +++ b/app/jobs/update_pharmgkb.rb @@ -22,7 +22,7 @@ end Zip::InputStream.open(StringIO.new(response.body)) do |io| while entry = io.get_next_entry - if entry.name == 'interactions.tsv' + if entry.name == 'relationships.tsv' tempfile.write(io.read.encode("ASCII-8BIT").force_encoding("utf-8")) end end
Fix filename of tsv to import
diff --git a/lib/superb_text_constructor/view_helpers/sanitize_block_helper.rb b/lib/superb_text_constructor/view_helpers/sanitize_block_helper.rb index abc1234..def5678 100644 --- a/lib/superb_text_constructor/view_helpers/sanitize_block_helper.rb +++ b/lib/superb_text_constructor/view_helpers/sanitize_block_helper.rb @@ -6,7 +6,7 @@ # @param text [String] original text # @return [ActiveSupport::SafeBuffer] HTML safe text with permitted only tags def sanitize_block(text) - sanitize(text, tags: %w(a b i img br), attributes: %w(id class style src href target)) + sanitize(text, tags: %w(a b i img span br), attributes: %w(id class style src href target)) end
Add span to permitted tags
diff --git a/app/lib/service_provider.rb b/app/lib/service_provider.rb index abc1234..def5678 100644 --- a/app/lib/service_provider.rb +++ b/app/lib/service_provider.rb @@ -1,11 +1,11 @@ ## # RTP when being used to pay for an agency or service provider invoice module ServiceProvider - def start_date + def display_start_date service_provider_service_start end - def end_date + def display_end_date service_provider_service_end end
Fix method names in Supplier module.
diff --git a/ports/browserplus/service_testing/recipe.rb b/ports/browserplus/service_testing/recipe.rb index abc1234..def5678 100644 --- a/ports/browserplus/service_testing/recipe.rb +++ b/ports/browserplus/service_testing/recipe.rb @@ -1,6 +1,6 @@ { :deps => [ "service_runner" ], - :url => 'github://browserplus/service-testing/10fa1fc9c1d40151dfd0853676e890d6425a7de3', + :url => 'github://browserplus/service-testing/4db0b2539e26dab82f2900edbbb1a51d0c27d1a0', :install => lambda { |c| tgtDir = File.join(c[:output_dir], "share", "service_testing") FileUtils.mkdir_p(tgtDir)
Integrate change to service_testing for host services
diff --git a/app/models/identity_file.rb b/app/models/identity_file.rb index abc1234..def5678 100644 --- a/app/models/identity_file.rb +++ b/app/models/identity_file.rb @@ -1,5 +1,7 @@ class IdentityFile < MyplaceonlineActiveRecord include AllowExistingConcern + + before_update :do_before_update belongs_to :encrypted_password, class_name: EncryptedValue, dependent: :destroy @@ -25,4 +27,12 @@ def size file_file_size end + + def do_before_update + if self.file_file_size_changed? + # Make sure any thumbnail is cleared (if it's a picture) + self.thumbnail_contents = nil + self.thumbnail_bytes = nil + end + end end
Clear thumbnail if needed when picture updated
diff --git a/app/services/user_poller.rb b/app/services/user_poller.rb index abc1234..def5678 100644 --- a/app/services/user_poller.rb +++ b/app/services/user_poller.rb @@ -5,7 +5,11 @@ def perform with_appsignal do with_database do + Rails.logger.info "UserPoller running..." + users_to_poll.each do |user| + Rails.logger.info "Polling #{user.domain}" + begin UserFetcher.perform(user.url) user.poll! @@ -13,6 +17,8 @@ Rails.logger.error "Error while polling #{user.domain}: #{e.message}" end end + + Rails.logger.info "UserPoller done." end end end
Add a bit of logging to UserPoller.
diff --git a/double_booked.gemspec b/double_booked.gemspec index abc1234..def5678 100644 --- a/double_booked.gemspec +++ b/double_booked.gemspec @@ -9,7 +9,7 @@ s.version = DoubleBooked::VERSION s.authors = ["Jay McAliley", "John McAliley", "Jim Van Fleet"] s.email = ["jay@logicleague.com"] - s.homepage = "" + s.homepage = "https://github.com/logicleague/double_booked" s.summary = "Flexible double-entry accounting engine for Rails apps" s.description = "Double-entry accounting issues credits and debits, calculates balances, allows for summary accounts and more."
Add url to github repo
diff --git a/sample/spec/lib/load_sample_spec.rb b/sample/spec/lib/load_sample_spec.rb index abc1234..def5678 100644 --- a/sample/spec/lib/load_sample_spec.rb +++ b/sample/spec/lib/load_sample_spec.rb @@ -1,6 +1,15 @@ require 'spec_helper' describe "Load samples" do + before do + # Seeds are only run for rake test_app so to allow this spec to pass without + # rerunning rake test_app every time we must load them in if not already. + unless Spree::Zone.find_by_name("North America") + load Rails.root + 'Rakefile' + load Rails.root + 'db/seeds.rb' + end + end + it "doesn't raise any error" do expect { SpreeSample::Engine.load_samples
Fix rerunning sample specs without new dummy app.
diff --git a/vendor/gobierto_engines/custom-fields-data-grid-plugin/app/models/gobierto_common/custom_field_functions/human_resource.rb b/vendor/gobierto_engines/custom-fields-data-grid-plugin/app/models/gobierto_common/custom_field_functions/human_resource.rb index abc1234..def5678 100644 --- a/vendor/gobierto_engines/custom-fields-data-grid-plugin/app/models/gobierto_common/custom_field_functions/human_resource.rb +++ b/vendor/gobierto_engines/custom-fields-data-grid-plugin/app/models/gobierto_common/custom_field_functions/human_resource.rb @@ -15,7 +15,7 @@ def cost(options = {}) percentages = progress_percentages(options[:date] || Date.current) - percentages(date).each_with_index.inject(0) do |total, (percentage, index)| + percentages.each_with_index.inject(0) do |total, (percentage, index)| total + percentage * data[index].cost end / percentages.size.to_f end
Fix cost function on human resources
diff --git a/hash_db.gemspec b/hash_db.gemspec index abc1234..def5678 100644 --- a/hash_db.gemspec +++ b/hash_db.gemspec @@ -19,5 +19,7 @@ gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) gem.require_paths = ["lib"] - gem.add_development_dependency "rake" + %w{rake rspec guard-rspec}.each do |name| + gem.add_development_dependency name + end end
Add rspec and guard-rspec as development dependencies.
diff --git a/cookbooks/lib/features/elasticsearch_spec.rb b/cookbooks/lib/features/elasticsearch_spec.rb index abc1234..def5678 100644 --- a/cookbooks/lib/features/elasticsearch_spec.rb +++ b/cookbooks/lib/features/elasticsearch_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true def db_url - 'http://localhost:9200/travis' + 'http://0.0.0.0:9200/travis' end describe 'elasticsearch installation', sudo: true do @@ -12,7 +12,7 @@ before :all do sh('sudo service elasticsearch restart') sleep 5 - tcpwait('localhost', 9200, 30) + tcpwait('0.0.0.0', 9200, 30) sh(%(curl -H "Content-Type: application/json" -X PUT "#{db_url}/user/koopa93" -d "{ \"name\": \"Shy Bowser\" }"
Use 0.0.0.0 instead of localhost for ES
diff --git a/attributes/default.rb b/attributes/default.rb index abc1234..def5678 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -1,13 +1,13 @@ default[:teamcity][:version] = "9.0.1" default[:teamcity][:host] = "localhost" default[:teamcity][:port] = "8111" -default[:teamcity][:url] = lazy "http://#{node[:teamcity][:host]}:#{node[:teamcity][:port]}/" +default[:teamcity][:url] = "http://#{node[:teamcity][:host]}:#{node[:teamcity][:port]}/" default[:teamcity][:user] = "teamcity" default[:teamcity][:path] = "/usr/local/teamcity" default[:teamcity][:data_path] = "/var/teamcity" -default[:teamcity][:user_home] = lazy "/home/#{node[:teamcity][:user]}" +default[:teamcity][:user_home] = "/home/#{node[:teamcity][:user]}" -default[:teamcity][:file_name] = lazy "TeamCity-#{node[:teamcity][:version]}.tar.gz" -default[:teamcity][:download_url] = lazy "http://download.jetbrains.com/teamcity/#{node[:teamcity][:file_name]}" +default[:teamcity][:file_name] = "TeamCity-#{node[:teamcity][:version]}.tar.gz" +default[:teamcity][:download_url] = "http://download.jetbrains.com/teamcity/#{node[:teamcity][:file_name]}" default[:teamcity][:download_path] = Chef::Config[:file_cache_path] -default[:teamcity][:install_path] = lazy "#{node[:teamcity][:path]}-#{node[:teamcity][:version]}" +default[:teamcity][:install_path] = "#{node[:teamcity][:path]}-#{node[:teamcity][:version]}"
Revert "Does lazy work here?" This reverts commit 80f537324d7bfb2c2c92dd4a745ae327526a7b69.
diff --git a/spec/admin/views/application_layout_spec.rb b/spec/admin/views/application_layout_spec.rb index abc1234..def5678 100644 --- a/spec/admin/views/application_layout_spec.rb +++ b/spec/admin/views/application_layout_spec.rb @@ -5,7 +5,7 @@ let(:rendered) { layout.render } let(:template) { Hanami::View::Template.new('apps/admin/templates/application.html.slim') } - it 'contains application name' do + xit 'contains application name' do expect(rendered).to include('Admin') end end
Make the build to pass again
diff --git a/spec/orchestrate.io/core_ext/string_spec.rb b/spec/orchestrate.io/core_ext/string_spec.rb index abc1234..def5678 100644 --- a/spec/orchestrate.io/core_ext/string_spec.rb +++ b/spec/orchestrate.io/core_ext/string_spec.rb @@ -0,0 +1,35 @@+require 'spec_helper' + +describe String do + describe "#camelize" do + it 'camelizes the given string' do + string = "hana_moguella" + expect(string.camelize).to eql "HanaMoguella" + expect(string).to eql "hana_moguella" + end + end + + describe "#camelize!" do + it 'camelizes destructively the given string' do + string = "hana_moguella" + expect(string.camelize!).to eql "HanaMoguella" + expect(string).to eql "HanaMoguella" + end + end + + describe "#underscore" do + it 'snakes the given string' do + string = "HanaMoguella" + expect(string.underscore).to eql "hana_moguella" + expect(string).to eql "HanaMoguella" + end + end + + describe "#underscore!" do + it 'snakes destructively the given string' do + string = "HanaMoguella" + expect(string.underscore!).to eql "hana_moguella" + expect(string).to eql "hana_moguella" + end + end +end
Add a spec for the extended String
diff --git a/spec/services/delete_branch_service_spec.rb b/spec/services/delete_branch_service_spec.rb index abc1234..def5678 100644 --- a/spec/services/delete_branch_service_spec.rb +++ b/spec/services/delete_branch_service_spec.rb @@ -20,6 +20,12 @@ expect(result[:status]).to eq :success expect(branch_exists?('feature')).to be false end + + it 'calls after branch delete hooks' do + expect(service).to receive(:execute_after_branch_delete_hooks) + + service.execute('feature') + end end context 'when user does not have access to push to repository' do @@ -32,6 +38,12 @@ expect(result[:message]).to eq 'You dont have push access to repo' expect(branch_exists?('feature')).to be true end + + it 'does not call after branch delete hooks' do + expect(service).not_to receive(:execute_after_branch_delete_hooks) + + service.execute('feature') + end end end
Test call to after branch delete hooks in service
diff --git a/api/config/routes.rb b/api/config/routes.rb index abc1234..def5678 100644 --- a/api/config/routes.rb +++ b/api/config/routes.rb @@ -8,7 +8,7 @@ end end - namespace :api do + namespace :api, :defaults => { :format => 'json' } do resources :products do resources :variants resources :product_properties
[api] Set default format to json
diff --git a/lib/nyny.rb b/lib/nyny.rb index abc1234..def5678 100644 --- a/lib/nyny.rb +++ b/lib/nyny.rb @@ -27,14 +27,6 @@ def self.env @env ||= EnvString.new(ENV['RACK_ENV'] || 'development') end - - def self.logger - @logger ||= Logger.new(STDOUT) - end - - def self.logger= new_logger - @logger = new_logger - end end NYNY::App.register NYNY::Runner
Remove logger, it's useless and only creates problems
diff --git a/config/initializers/custom_validations.rb b/config/initializers/custom_validations.rb index abc1234..def5678 100644 --- a/config/initializers/custom_validations.rb +++ b/config/initializers/custom_validations.rb @@ -1,3 +1,3 @@-BraintreeRails::BillingAddressValidator::Validations = BraintreeRails::BillingAddressValidator::Validations.deep_dup -BraintreeRails::BillingAddressValidator::Validations << [:country_code_numeric, :inclusion => {:in => ['124', '840']}] -BraintreeRails::BillingAddressValidator.setup +BraintreeRails::BillingAddressValidator.setup do |validations| + validations << [:country_name, :inclusion => { :in => ["Canada", "United States of America"], :message => "%{value} is not supported yet." }] +end
Change the custom validation code to use the easier way
diff --git a/config/initializers/wopi_startup_check.rb b/config/initializers/wopi_startup_check.rb index abc1234..def5678 100644 --- a/config/initializers/wopi_startup_check.rb +++ b/config/initializers/wopi_startup_check.rb @@ -2,7 +2,7 @@ # Only check if connection works when server starts, and if WOPI is # enabled -if defined? Rails::Server && ENV['WOPI_ENABLED'] == 'true' +if defined?(Rails::Server).present? && ENV['WOPI_ENABLED'] == 'true' missing_vars = [] %w( WOPI_TEST_ENABLED WOPI_DISCOVERY_URL WOPI_ENDPOINT_URL USER_SUBDOMAIN
Fix 'if..' logic to work properly when WOPI_ENABLED is undefined
diff --git a/lib/rodt.rb b/lib/rodt.rb index abc1234..def5678 100644 --- a/lib/rodt.rb +++ b/lib/rodt.rb @@ -2,13 +2,13 @@ require "nokogiri" require "xml/xslt" require "zip" - -require "rodt/image" -require "rodt/odt" -require "rodt/version" module Rodt XHTML2ODT_XSL = File.join(File.dirname(__FILE__), "..", "xsl", "xhtml2odt.xsl") XHTML2ODT_STYLES_XSL = File.join(File.dirname(__FILE__), "..", "xsl", "styles.xsl") ODT_TEMPLATE = File.join(File.dirname(__FILE__), "..", "odt", "template.odt") end + +require "rodt/image" +require "rodt/odt" +require "rodt/version"
Make sure to define module before extending it This enables loading the code without rubygems/bundler, i.e. executing the gemspec, e.g. when executing a single test file.
diff --git a/lib/task.rb b/lib/task.rb index abc1234..def5678 100644 --- a/lib/task.rb +++ b/lib/task.rb @@ -34,6 +34,11 @@ end def update_tags(tag_names) + remove_tags_not_in_list(tag_names) + add_extra_tags_in_list(tag_names) + end + + def remove_tags_not_in_list(tag_names) new_tags = tag_names.split(',').map(&:strip) tags.select do |tag| @@ -41,6 +46,10 @@ end.each do |tag| tags.delete(tag).destroy end + end + + def add_extra_tags_in_list(tag_names) + new_tags = tag_names.split(',').map(&:strip) new_tags.select do |name| !tags.map(&:name).include? name
Split method in two smaller ones
diff --git a/app/models/campus.rb b/app/models/campus.rb index abc1234..def5678 100644 --- a/app/models/campus.rb +++ b/app/models/campus.rb @@ -1,3 +1,6 @@ class Campus < ActiveRecord::Base + validates :name, presence: true + validates :mode, presence: true + enum mode: { physical: 0, online: 1 } end
ENHANCE: Validate the presence of name and mode
diff --git a/sli/sarje/eventbus/eventbus.gemspec b/sli/sarje/eventbus/eventbus.gemspec index abc1234..def5678 100644 --- a/sli/sarje/eventbus/eventbus.gemspec +++ b/sli/sarje/eventbus/eventbus.gemspec @@ -8,7 +8,7 @@ gem.summary = %q{TODO: Write a gem summary} gem.homepage = "" - gem.files = `git ls-files`.split($\) + gem.files = Dir['conf/*yml', 'lib/**/*.rb', 'test/*.rb', 'test/data/*.json', '*rb'] + ['Gemfile','Rakefile', 'eventbus.gemspec'] gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) gem.name = "eventbus"
Fix gemspec for deployment in environments
diff --git a/core/spec/acceptance/add_factlink_spec.rb b/core/spec/acceptance/add_factlink_spec.rb index abc1234..def5678 100644 --- a/core/spec/acceptance/add_factlink_spec.rb +++ b/core/spec/acceptance/add_factlink_spec.rb @@ -32,8 +32,7 @@ click_button "submit" visit created_channel_path(@user) - page.select 'Factlinks from people I follow', from: 'channel-topic-switch' - + page.should have_content fact_name # and delete it:
Revert "Hope to fix this finally" This reverts commit cdbcd6e620191722d1820a23eebb6d1aada605a5.
diff --git a/spec/factories/line_item_factory.rb b/spec/factories/line_item_factory.rb index abc1234..def5678 100644 --- a/spec/factories/line_item_factory.rb +++ b/spec/factories/line_item_factory.rb @@ -1,6 +1,6 @@ FactoryGirl.define do factory :subscription_line_item, class: 'SolidusSubscriptions::LineItem' do - subscribable_id 1 + subscribable_id { create(:variant, subscribable: true).id } quantity 1 interval 30.days
Create an actual subscribable in factory Instead of a random id, actually create the subscribable variant
diff --git a/ext/byebug/extconf.rb b/ext/byebug/extconf.rb index abc1234..def5678 100644 --- a/ext/byebug/extconf.rb +++ b/ext/byebug/extconf.rb @@ -1,11 +1,11 @@-require 'mkmf' - -RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC'] - if RUBY_VERSION < "2.0" STDERR.print("Ruby version is too old\n") exit(1) end + +require 'mkmf' + +RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC'] if RbConfig::MAKEFILE_CONFIG['CC'] =~ /gcc/ $CFLAGS ||= ''
Check ruby version before anything
diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index abc1234..def5678 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -13,7 +13,13 @@ Sidekiq::Web.disable(:sessions) require 'sidekiq/cron/web' -Sidekiq::Cron::Job.create(name: 'Scan for batches - every 1min', cron: '*/1 * * * *', class: 'BatchScanJob') -Sidekiq::Cron::Job.create(name: 'Status Checking and Email Notification of Existing Batches - every 15min', cron: '*/15 * * * *', class: 'IngestBatchStatusEmailJobs::IngestFinished') -Sidekiq::Cron::Job.create(name: 'Status Checking and Email Notification for Stalled Batches - every 1day', cron: '0 1 * * *', class: 'IngestBatchStatusEmailJobs::StalledJob') -Sidekiq::Cron::Job.create(name: 'Clean out user sessions older than 7 days - every 6hour', cron: '0 */6 * * *', class: 'CleanupSessionJob') +begin + # Only create cron jobs if Sidekiq can connect to Redis + Sidekiq.redis(&:info) + Sidekiq::Cron::Job.create(name: 'Scan for batches - every 1min', cron: '*/1 * * * *', class: 'BatchScanJob') + Sidekiq::Cron::Job.create(name: 'Status Checking and Email Notification of Existing Batches - every 15min', cron: '*/15 * * * *', class: 'IngestBatchStatusEmailJobs::IngestFinished') + Sidekiq::Cron::Job.create(name: 'Status Checking and Email Notification for Stalled Batches - every 1day', cron: '0 1 * * *', class: 'IngestBatchStatusEmailJobs::StalledJob') + Sidekiq::Cron::Job.create(name: 'Clean out user sessions older than 7 days - every 6hour', cron: '0 */6 * * *', class: 'CleanupSessionJob') +rescue Redis::CannotConnectError => e + Rails.logger.warn "Cannot create sidekiq-cron jobs: #{e.message}" +end
Check for Redis before creating cron jobs
diff --git a/raygun_client.gemspec b/raygun_client.gemspec index abc1234..def5678 100644 --- a/raygun_client.gemspec +++ b/raygun_client.gemspec @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = 'raygun_client' - s.version = '0.1.2' + s.version = '0.1.3' s.summary = 'Client for the Raygun API using the Obsidian HTTP client' s.description = ' '
Package version patch number is incremented from 0.1.2 to 0.1.3
diff --git a/app/models/map_layer.rb b/app/models/map_layer.rb index abc1234..def5678 100644 --- a/app/models/map_layer.rb +++ b/app/models/map_layer.rb @@ -4,4 +4,6 @@ end belongs_to :layer belongs_to :map, :foreign_key => "mapscan_id" +validates_uniqueness_of :layer_id, :scope => :mapscan_id, :message => "Layer already has this map" + end
Add validation to map layers join model to ensure that a map can not have multiple layers the same
diff --git a/app/models/vat_chunk.rb b/app/models/vat_chunk.rb index abc1234..def5678 100644 --- a/app/models/vat_chunk.rb +++ b/app/models/vat_chunk.rb @@ -5,6 +5,7 @@ validates :start_date, :presence=> true validates :company_id, :presence=> true validates :account_id, :presence=> true - validates :number, :uniqueness => { :scope => :company_id, :message => I18n.t("global.number_not_unique") }, :presence => true, :numericality => :only_integer + validates_numericality_of :number, :only_integer => true + validates :number, :uniqueness => { :scope => :company_id, :message => I18n.t("global.number_not_unique") }, :presence => true end
Fix bug in validation of vat chunks
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -12,15 +12,15 @@ recipe 'appserver::webserver', 'Internal recipe to setup php-fpm and nginx.' depends 'timezone-ii' -depends 'apt' -depends 'zsh' -depends 'git' -depends 'chef-solo-search' -depends 'users' -depends 'sudo' -depends 'oh-my-zsh' +depends 'apt', '~>2.6.1' +depends 'zsh', '~>1.0.1' +depends 'git', '~>4.1.0' +depends 'chef-solo-search', '~>0.5.1' +depends 'users', '~>1.7.0' +depends 'sudo', '~>2.7.1' +depends 'oh-my-zsh', '~>0.4.3' +depends 'database', '~>2.3.1' depends 'mysql', '~>5.4.4' depends 'mysql-chef_gem', '~>0.0.5' -depends 'database' depends 'nginx' # https://github.com/phlipper/chef-nginx depends 'compass' # https://github.com/phlipper/chef-nginx
Add version numbers of dependencies
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version "1.1.1" -%w{ubuntu debian redhat centos}.each do |os| +%w{ubuntu debian redhat centos suse}.each do |os| supports os end
Add openSuSE platform support to the cookbook.
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -4,7 +4,7 @@ license 'Apache 2.0' description 'Installs/Configures phantomjs' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '1.1.0' +version '1.0.3' %w(amazon centos debian fedora gentoo oracle rhel scientific ubuntu windows).each do |os| supports os
Undo updating the version number.
diff --git a/lib/basepath.rb b/lib/basepath.rb index abc1234..def5678 100644 --- a/lib/basepath.rb +++ b/lib/basepath.rb @@ -14,7 +14,7 @@ # read dot_base base_conf = IO.read(::BASE_PATH.join(dot_base)).strip.gsub(/[ \t]/, '').gsub(/\n+/, "\n")\ .scan(/^\[(\w+)\]((?:\n[^\[].*)*)/)\ - .inject({}) { |h, (k, s)| h[k.to_sym] = s.strip; h } + .inject(Hash.new('')) { |h, (k, s)| h[k.to_sym] = s.strip; h } # set path consts base_conf[:consts].scan(/([A-Z][A-Z0-9_]*)=(.+)/).each { |k, v| Object.const_set(k, ::BASE_PATH.join(v)) }
Handle when .base does not specify all base_conf headers
diff --git a/Casks/banktivity.rb b/Casks/banktivity.rb index abc1234..def5678 100644 --- a/Casks/banktivity.rb +++ b/Casks/banktivity.rb @@ -2,6 +2,7 @@ version :latest sha256 :no_check + # iggsoft.com was verified as official when first introduced to the cask url 'https://www.iggsoft.com/banktivity/Banktivity5_Web.dmg' name 'Banktivity' homepage 'https://www.iggsoftware.com/banktivity'
Fix `url` stanza comment for Banktivity.
diff --git a/Casks/tower-beta.rb b/Casks/tower-beta.rb index abc1234..def5678 100644 --- a/Casks/tower-beta.rb +++ b/Casks/tower-beta.rb @@ -1,9 +1,9 @@ cask :v1 => 'tower-beta' do - version '2.2.3-285' - sha256 'c9d79a6a8bfc298f38a2d7dbe724d71468f86c1de09fabd1d9da754fd8a40f74' + version '2.3.0-290' + sha256 '5afc0f512f198782070973f12f93f5ca600b18c97032a1a81ef4670f2e5a8c45' # amazonaws.com is the official download host per the vendor homepage - url "https://fournova-app-updates.s3.amazonaws.com/apps/tower2-mac/285-e057eb4f/Tower-2-#{version}.zip" + url "https://fournova-app-updates.s3.amazonaws.com/apps/tower2-mac/290-bfbb31e4/Tower-2-#{version}.zip" appcast 'https://updates.fournova.com/updates/tower2-mac/beta' name 'Tower' homepage 'http://www.git-tower.com/'
Update Tower Beta to version 2.3.0 This commit updates the version, sha256 and url stanzas.
diff --git a/lib/goku/cli.rb b/lib/goku/cli.rb index abc1234..def5678 100644 --- a/lib/goku/cli.rb +++ b/lib/goku/cli.rb @@ -30,7 +30,7 @@ def save(path, implementation, spec) failure("File #{path.full.colorize(:red)} already exists") if path.exists? - failure("Spec #{path.to_spec.full.colorize(:red)} already exists") if path.to_spec.exists? + failure("File #{path.to_spec.full.colorize(:red)} already exists") if path.to_spec.exists? puts "Creating #{path.full.colorize(:green)}" path.write(implementation)
Rename spec to file in error output
diff --git a/lib/jiraSOAP.rb b/lib/jiraSOAP.rb index abc1234..def5678 100644 --- a/lib/jiraSOAP.rb +++ b/lib/jiraSOAP.rb @@ -13,4 +13,4 @@ require 'jiraSOAP/JIRAservice.rb' #overrides and additions -require 'lib/jiraSOAP/macruby_bonuses.rb' if RUBY_ENGINE == 'macruby' +require 'jiraSOAP/macruby_bonuses.rb' if RUBY_ENGINE == 'macruby'
Fix requiring of MacRuby bonuses As pointed out to me on the MacRuby trac (http://www.macruby.org/trac/ticket/995).
diff --git a/build/win32/make_gem.rb b/build/win32/make_gem.rb index abc1234..def5678 100644 --- a/build/win32/make_gem.rb +++ b/build/win32/make_gem.rb @@ -0,0 +1,46 @@+# -*- ruby -*- + +def usage + puts "#{$0} target_directory" +end + +if ARGV.size < 1 + usage + exit 1 +end + +target_dir = ARGV.shift + +if target_dir == "--help" + usage + exit +end + +base_dir = File.expand_path(File.join(target_dir, "ruby")) +$LOAD_PATH.unshift(File.join(base_dir, "ext")) +$LOAD_PATH.unshift(File.join(base_dir, "lib")) + +require 'svn/core' + +gem_file = nil +Dir.chdir(target_dir) do + require 'rubygems' + Gem.manage_gems + + spec = Gem::Specification.new do |s| + s.name = "subversion" + s.date = Time.now + s.version = Svn::Core::VER_NUM + s.summary = "The Ruby bindings for Subversion." + s.email = "dev@subversion.tigris.org" + s.homepage = "http://subversion.tigris.org/" + s.description = s.summary + s.authors = ["Kouhei Sutou"] + s.files = Dir.glob(File.join("**", "*")).delete_if {|x| /\.gem$/i =~ x} + s.require_paths = ["ruby/ext", "ruby/lib"] + s.platform = Gem::Platform::WIN32 + end + + gem_file = File.expand_path(Gem::Builder.new(spec).build) +end +FileUtils.mv(gem_file, File.basename(gem_file))
Add a script that generates RubyGem for the Ruby bindings. * build/win32/make_gem.rb: New file. Approved by: djh
diff --git a/spec/amakanize/author_name_spec.rb b/spec/amakanize/author_name_spec.rb index abc1234..def5678 100644 --- a/spec/amakanize/author_name_spec.rb +++ b/spec/amakanize/author_name_spec.rb @@ -14,6 +14,7 @@ "author" => "author", "BNGI/PROJECTiM@S:原作" => "BNGI/PROJECTiM@S", "ハノカゲ ほか" => "ハノカゲ", + "ハノカゲ:漫画" => "ハノカゲ", "バンダイナムコゲームス 原作" => "バンダイナムコゲームス", "ぽんかん(8)" => "ぽんかん8", "ぽんかん(8)" => "ぽんかん8", @@ -21,7 +22,6 @@ "ぽんかん⑧" => "ぽんかん8", "渡 航" => "渡航", "渡 航" => "渡航", - "漫画:ハノカゲ" => "ハノカゲ", "漫画:ハノカゲ" => "ハノカゲ", }.each do |key, value| context "with #{key.inspect}" do
Fix author name spec test case
diff --git a/Formula/ctop-bin.rb b/Formula/ctop-bin.rb index abc1234..def5678 100644 --- a/Formula/ctop-bin.rb +++ b/Formula/ctop-bin.rb @@ -0,0 +1,23 @@+class CtopBin < Formula + version '0.6.1' + desc "Top-like interface for container metrics." + homepage "https://github.com/bcicen/ctop" + + if /darwin/ =~ RUBY_PLATFORM + url "https://github.com/bcicen/ctop/releases/download/v#{version}/ctop-#{version}-darwin-amd64", + :using => :nounzip + sha256 "fea5e0dd7380330f3b4dc796a6858e7bde557880983b5cf99bcb8f4655287072" + elsif /linux/ =~ RUBY_PLATFORM + url "https://github.com/bcicen/ctop/releases/download/v#{version}/ctop-#{version}-linux-amd64", + :using => :nounzip + sha256 "a0e5e3b5cc0bb1905b756a8b817a727f71ea8fe645aba54c7324491efa73f96f" + end + + conflicts_with "ctop" + + def install + system 'mv ctop-* ctop' + system 'chmod +x ctop' + bin.install "ctop" + end +end
Add formula to install pre-built ctop
diff --git a/spec/acceptance/tomcat_spec.rb b/spec/acceptance/tomcat_spec.rb index abc1234..def5678 100644 --- a/spec/acceptance/tomcat_spec.rb +++ b/spec/acceptance/tomcat_spec.rb @@ -12,4 +12,19 @@ apply_manifest(pp, :catch_changes => true) end end + + context 'with source' do + it 'should idempotently run' do + pp = <<-EOS + class { 'tomcat': + sources => true, + srcversion => '6.0.41', + version => '6', + } + EOS + + apply_manifest(pp, :catch_failures => true) + apply_manifest(pp, :catch_changes => true) + end + end end
Add tests for archive integration
diff --git a/spec/features/articles_spec.rb b/spec/features/articles_spec.rb index abc1234..def5678 100644 --- a/spec/features/articles_spec.rb +++ b/spec/features/articles_spec.rb @@ -0,0 +1,57 @@+require 'rails_helper' + +RSpec.feature 'Managing articles' do + scenario 'List all articles' do + Article.create!(title: 'One Stupid Trick', body: "You won't believe what they did next...") + Article.create!(title: 'One Stupid Trick', body: "You won't believe what they did next...") + Article.create!(title: 'One Stupid Trick', body: "You won't believe what they did next...") + + visit '/articles' + + expect(page).to have_content 'Articles' + expect(page).to have_selector 'article', count: 3 + end + + scenario 'Create an article' do + visit '/articles/new' + + fill_in 'Title', with: 'One Stupid Trick' + fill_in 'Body', with: "You won't believe what they did next..." + click_on 'Create Article' + + expect(page).to have_content(/success/i) + end + + scenario 'Read an article' do + article = Article.create!(title: 'One Stupid Trick', body: "You won't believe what they did next...") + + visit "/articles/#{article.id}" + + expect(page.find('h1')).to have_content 'One Stupid Trick' + expect(page).to have_content "You won't believe what they did next..." + end + + scenario 'Update an article' do + article = Article.create!(title: 'One Stupid Trick', body: "You won't believe what they did next...") + + visit "articles/#{article.id}/edit" + + fill_in 'Title', with: 'A Different Trick' + fill_in 'Body', with: 'Much disbelief. Wow.' + click_on 'Update Article' + + expect(page).to have_content(/success/i) + expect(page.find('h1')).to have_content 'A Different Trick' + expect(page).to have_content 'Much disbelief. Wow.' + end + + scenario 'Delete an article' do + article = Article.create!(title: 'One Stupid Trick', body: "You won't believe what they did next...") + + visit "articles/#{article.id}/edit" + + click_on 'Delete Article' + + expect(page).to have_content(/success/i) + end +end
Add full feature spec for articles
diff --git a/config/application.rb b/config/application.rb index abc1234..def5678 100644 --- a/config/application.rb +++ b/config/application.rb @@ -11,6 +11,7 @@ # Initialize configuration defaults for originally generated Rails version. config.load_defaults 5.1 + config.assets.initialize_on_precompile = false # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded.
Tweak config for Heroku deployment
diff --git a/config/application.rb b/config/application.rb index abc1234..def5678 100644 --- a/config/application.rb +++ b/config/application.rb @@ -14,6 +14,8 @@ config.i18n.available_locales = [:fr] config.i18n.default_locale = :fr + config.active_job.queue_adapter = :sidekiq + # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded.
Set Sidekiq as ActiveJob queue adapter
diff --git a/simple_aspect.gemspec b/simple_aspect.gemspec index abc1234..def5678 100644 --- a/simple_aspect.gemspec +++ b/simple_aspect.gemspec @@ -4,20 +4,23 @@ require 'simple_aspect/version' Gem::Specification.new do |spec| - spec.name = "simple_aspect" + spec.name = 'simple_aspect' spec.version = SimpleAspect::VERSION - spec.authors = ["Ricardo Tealdi"] - spec.email = ["ricardo.tealdi@gmail.com"] + spec.authors = ['Ricardo Tealdi'] + spec.email = ['ricardo.tealdi@gmail.com'] - spec.summary = %q{Simple AOP implementation for Ruby} - spec.description = %q{Simple AOP implementation for Ruby} - spec.homepage = "https://github.com/ricardotealdi/simple_aspect" + spec.summary = 'Simple AOP implementation for Ruby' + spec.description = 'Simple AOP implementation for Ruby' + spec.homepage = 'https://github.com/ricardotealdi/simple_aspect' - spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } - spec.bindir = "exe" + spec.files = `git ls-files -z` + .split("\x0") + .reject { |f| f.match(%r{^(test|spec|features)/}) } + + spec.bindir = 'exe' spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } - spec.require_paths = ["lib"] + spec.require_paths = ['lib'] - spec.add_development_dependency "rspec", '~> 3.4.0' - spec.add_development_dependency "pry" + spec.add_development_dependency 'rspec', '~> 3.4.0' + spec.add_development_dependency 'pry' end
Fix `Rubocop`'s issues from `gemspec`
diff --git a/app/controllers/amp_articles_controller.rb b/app/controllers/amp_articles_controller.rb index abc1234..def5678 100644 --- a/app/controllers/amp_articles_controller.rb +++ b/app/controllers/amp_articles_controller.rb @@ -25,7 +25,7 @@ private def retrieve_article - @article ||= Mas::Cms::Article.find(params[:article_id], locale: I18n.locale) + @article ||= Mas::Cms::Article.find(params[:article_id], locale: params[:locale]) end def redirect_page(e)
Fix locale switching on AMP pages The controller for AMP articles uses I18n.locale, which isn't being dynamically updated based on the request params. Use the locale param directly.
diff --git a/NSObject+Rx.podspec b/NSObject+Rx.podspec index abc1234..def5678 100644 --- a/NSObject+Rx.podspec +++ b/NSObject+Rx.podspec @@ -12,7 +12,7 @@ s.ios.deployment_target = '8.0' s.osx.deployment_target = '10.10' - s.watchos.deployment_target = '2.0' + s.watchos.deployment_target = '3.0' s.tvos.deployment_target = '9.0' s.swift_version = '5.0'
Increase minimum version for watchOS
diff --git a/methane.gemspec b/methane.gemspec index abc1234..def5678 100644 --- a/methane.gemspec +++ b/methane.gemspec @@ -25,4 +25,5 @@ gem.add_dependency('libnotify') if RUBY_PLATFORM[/linux/i] gem.add_development_dependency('rake') + gem.add_development_dependency('bacon') end
Add bacon gem for tests.
diff --git a/lib/nehm/playlist.rb b/lib/nehm/playlist.rb index abc1234..def5678 100644 --- a/lib/nehm/playlist.rb +++ b/lib/nehm/playlist.rb @@ -1,6 +1,5 @@ require 'nehm/applescripts' class Playlist - attr_reader :name def initialize(name)
Remove extra line at the beginning of track class
diff --git a/opal/corelib/file.rb b/opal/corelib/file.rb index abc1234..def5678 100644 --- a/opal/corelib/file.rb +++ b/opal/corelib/file.rb @@ -19,6 +19,7 @@ end new_parts.join(SEPARATOR) end + alias realpath expand_path def dirname(path) split(path)[0..-2]
Add File.realpath as an alias of .expand_path
diff --git a/3months_staff_schedule.gemspec b/3months_staff_schedule.gemspec index abc1234..def5678 100644 --- a/3months_staff_schedule.gemspec +++ b/3months_staff_schedule.gemspec @@ -20,4 +20,5 @@ gem.add_dependency "google_drive" gem.add_dependency "highline" gem.add_dependency "activesupport" + gem.add_development_dependency "rake" end
Add rake as a development dependency
diff --git a/spec/squeel/core_ext/symbol_spec.rb b/spec/squeel/core_ext/symbol_spec.rb index abc1234..def5678 100644 --- a/spec/squeel/core_ext/symbol_spec.rb +++ b/spec/squeel/core_ext/symbol_spec.rb @@ -0,0 +1,58 @@+require 'spec_helper' + +describe Symbol do + describe '#asc' do + it 'creates an ascending order node' do + order = :blah.asc + order.should be_a Squeel::Nodes::Order + order.expr.should eq :blah + order.should be_ascending + end + end + + describe '#desc' do + it 'creates a descending order node' do + order = :blah.desc + order.should be_a Squeel::Nodes::Order + order.expr.should eq :blah + order.should be_descending + end + end + + describe '#func' do + it 'creates a function node' do + function = :blah.func('foo') + function.should be_a Squeel::Nodes::Function + function.name.should eq :blah + function.args.should eq ['foo'] + end + end + + describe '#inner' do + it 'creates an inner join' do + join = :blah.inner + join.should be_a Squeel::Nodes::Join + join._name.should eq :blah + join._type.should eq Arel::InnerJoin + end + end + + describe '#outer' do + it 'creates an outer join' do + join = :blah.outer + join.should be_a Squeel::Nodes::Join + join._name.should eq :blah + join._type.should eq Arel::OuterJoin + end + end + + describe '#of_class' do + it 'creates an inner polymorphic join with the given class' do + join = :blah.of_class(Person) + join.should be_a Squeel::Nodes::Join + join._name.should eq :blah + join._type.should eq Arel::InnerJoin + join._klass.should eq Person + end + end +end
Add specs for symbol extensions
diff --git a/app.rb b/app.rb index abc1234..def5678 100644 --- a/app.rb +++ b/app.rb @@ -4,7 +4,7 @@ class App < Sinatra::Base set :assets_precompile, %w(app.js app.css *.png *.jpg *.svg *.eot *.ttf *.woff *.ogg *.mp3 *.json *.xml) - set :assets_host, 'files.bryanbibat.net' + set :assets_host, 'datenshizero.github.io' set :assets_css_compressor, :sass set :assets_js_compressor, :uglifier
Move back to GH Pages
diff --git a/app.rb b/app.rb index abc1234..def5678 100644 --- a/app.rb +++ b/app.rb @@ -31,7 +31,7 @@ configure :production do require 'newrelic_rpm' require 'rack/ssl' - use Rack::SSL + use Rack::SSL unless ENV['NO_SSL'] == 'true' end end end
Configure ssl with env var
diff --git a/SIGS/app/controllers/coordinator_controller.rb b/SIGS/app/controllers/coordinator_controller.rb index abc1234..def5678 100644 --- a/SIGS/app/controllers/coordinator_controller.rb +++ b/SIGS/app/controllers/coordinator_controller.rb @@ -1,11 +1,11 @@ class CoordinatorController < ApplicationController - def registration_request + def new + @coordinator = Coordinator.new end - def edit - end - - def update + def create + @coordinator = Coordinator.create(coordinator_params) + if @coordinator.save end def show @@ -24,4 +24,7 @@ def index @coordinators = Coordinator.all end + private + def coordinator_params + params[:coordinator].permit(:user_id, :course_id) end
Add methods new and create
diff --git a/SwiftLint.podspec b/SwiftLint.podspec index abc1234..def5678 100644 --- a/SwiftLint.podspec +++ b/SwiftLint.podspec @@ -1,11 +1,15 @@ Pod::Spec.new do |s| - s.name = 'SwiftLint' - s.version = `make get_version` - s.summary = 'A tool to enforce Swift style and conventions.' - s.homepage = 'https://github.com/realm/SwiftLint' - s.license = { type: 'MIT', file: 'LICENSE' } - s.author = { 'JP Simard' => 'jp@jpsim.com' } - s.source = { http: "#{s.homepage}/releases/download/#{s.version}/portable_swiftlint.zip" } - s.preserve_paths = '*' - s.exclude_files = '**/file.zip' + s.name = 'SwiftLint' + s.version = `make get_version` + s.summary = 'A tool to enforce Swift style and conventions.' + s.homepage = 'https://github.com/realm/SwiftLint' + s.license = { type: 'MIT', file: 'LICENSE' } + s.author = { 'JP Simard' => 'jp@jpsim.com' } + s.source = { http: "#{s.homepage}/releases/download/#{s.version}/portable_swiftlint.zip" } + s.preserve_paths = '*' + s.exclude_files = '**/file.zip' + s.ios.deployment_target = '9.0' + s.macos.deployment_target = '10.10' + s.tvos.deployment_target = '9.0' + s.watchos.deployment_target = '2.0' end
Add deployment targets to iOS/macOS/watchos/tvos
diff --git a/Timepiece.podspec b/Timepiece.podspec index abc1234..def5678 100644 --- a/Timepiece.podspec +++ b/Timepiece.podspec @@ -9,7 +9,8 @@ s.ios.deployment_target = "8.0" s.osx.deployment_target = "10.9" s.watchos.deployment_target = "2.0" - + s.tvos.deployment_target = "9.0" + s.source = { :git => "https://github.com/naoty/Timepiece.git", :tag => s.version } s.source_files = "Sources/**/*.swift" s.requires_arc = true
Add missing deployment_target in podspec for tvOS
diff --git a/revenant.gemspec b/revenant.gemspec index abc1234..def5678 100644 --- a/revenant.gemspec +++ b/revenant.gemspec @@ -9,11 +9,12 @@ s.date = %q{2010-06-06} s.email = %q{wilson@supremetyrant.com} s.files = Dir['lib/**/*.rb'] - s.has_rdoc = true + s.has_rdoc = false s.homepage = %q{http://github.com/wilson/revenant} s.require_paths = ["lib"] s.rubygems_version = %q{1.3.7} s.summary = %q{Distributed daemons that just will not die.} + s.description = "A framework for building reliable distributed workers." s.specification_version = 2 end
Add a description to the gemspec
diff --git a/xcodeproj.podspec b/xcodeproj.podspec index abc1234..def5678 100644 --- a/xcodeproj.podspec +++ b/xcodeproj.podspec @@ -18,6 +18,5 @@ s.dependency "PathKit", "~> 0.8" s.dependency "Unbox", "~> 2.5" - s.dependency "CCommonCrypto", "~> 1.0" s.dependency "AEXML", "~> 4.1" end
[cocoapods] Remove CommonCrypto dependency from podspec
diff --git a/HTHorizontalSelectionList.podspec b/HTHorizontalSelectionList.podspec index abc1234..def5678 100644 --- a/HTHorizontalSelectionList.podspec +++ b/HTHorizontalSelectionList.podspec @@ -16,7 +16,7 @@ s.platform = :ios, "7.0" s.source = { :git => "https://github.com/hightower/HTHorizontalSelectionList.git", :tag => "0.3.2" } - s.source_files = 'HTHorizontalSelectionList' + s.source_files = 'HTHorizontalSelectionList/**/*.{h,m}' s.requires_arc = true s.frameworks = 'Foundation', 'UIKit'
Update podspec to include subfolders of source code.
diff --git a/command_protocol/lib/command_protocol/command_constants.rb b/command_protocol/lib/command_protocol/command_constants.rb index abc1234..def5678 100644 --- a/command_protocol/lib/command_protocol/command_constants.rb +++ b/command_protocol/lib/command_protocol/command_constants.rb @@ -28,6 +28,7 @@ # Ports used for command protocol BASE_INSTANCE_AGENT_SOCKET_PORT = 60000 BASE_CORE_AGENT_SOCKET_PORT = 70000 + BASE_MAPPER_SOCKET_PORT = 80000 end end
Add command io port for mapper