diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/app/admin/photos.rb b/app/admin/photos.rb index abc1234..def5678 100644 --- a/app/admin/photos.rb +++ b/app/admin/photos.rb @@ -1,6 +1,11 @@ ActiveAdmin.register Photo do belongs_to :poi, :optional => true belongs_to :user, :optional => true + + filter :user_id, :as => :numeric + filter :poi_id, :as => :numeric + filter :taken_at + filter :created_at controller do def collection @@ -11,7 +16,7 @@ index do column :id column :image do |photo| - link_to "Gallerie", photo.image.url(:gallery).to_s + link_to(image_tag(photo.image.url(:thumb_iphone).to_s), photo.image.url) end column :user column :poi
Fix photo list in admin backend.
diff --git a/app/controllers/storytime/pages_controller.rb b/app/controllers/storytime/pages_controller.rb index abc1234..def5678 100644 --- a/app/controllers/storytime/pages_controller.rb +++ b/app/controllers/storytime/pages_controller.rb @@ -8,7 +8,7 @@ @page = Page.published.friendly.find(params[:id]) - if request.path != page_path(@page) + if request.path != page_path(@page) && request.path != "/" return redirect_to @page, :status => :moved_permanently end
Allow a page to be at the root url
diff --git a/lib/lazily/threading.rb b/lib/lazily/threading.rb index abc1234..def5678 100644 --- a/lib/lazily/threading.rb +++ b/lib/lazily/threading.rb @@ -6,12 +6,11 @@ def in_threads(max_threads, &block) collect do |item| - Thread.new(item, &block) + Thread.new { block.call(item) } end.prefetch(max_threads - 1).collect do |thread| thread.join.value end end - end end
Revert "Thread.new takes arguments. That's handy." This reverts commit e7780633ac2473d3265903c4f680171b17217ee4. It didn't work so well in Ruby 1.8.7.
diff --git a/spec/support/install_organisation_resolver.rb b/spec/support/install_organisation_resolver.rb index abc1234..def5678 100644 --- a/spec/support/install_organisation_resolver.rb +++ b/spec/support/install_organisation_resolver.rb @@ -0,0 +1,34 @@+# This is an altered version of the #install_organisation_resolver +# method in ApplicationController proper. It is necessary in order +# for RSpec's controller specs to work. RSpec introduces a custom +# resolver, RSpec::Rails::ViewRendering::PathSetDelegatorResolver, +# in order to exercise controller actions without actually rendering +# views. However, PathSetDelegatorResolver is incompatible with the +# way we create our custom OrganisationResolvers based on standard +# ActionView resolvers. This altered method creates +# OrganisationResolvers based on PathSetDelegatorResolvers instead, +# when it encounters them. + +require 'rspec/rails/view_rendering' +require 'one_click_orgs/organisation_resolver' +require 'action_view/paths' + +class ApplicationController < ActionController::Base + def install_organisation_resolver_with_rspec_workaround(organisation) + if view_paths.length == 1 && view_paths[0].respond_to?(:path_set) + path_set_delegator_resolver = view_paths[0] + original_path_set = path_set_delegator_resolver.path_set + + new_path_set = original_path_set.dup + + new_path_set.unshift(*original_path_set.reverse.map{|p| OneClickOrgs::OrganisationResolver.new(p.to_path, organisation.class)}) + + new_path_set_delegator_resolver = RSpec::Rails::ViewRendering::PathSetDelegatorResolver.new(view_paths) + + self.class.view_paths = ActionView::PathSet.new.push(new_path_set_delegator_resolver) + else + install_organisation_resolver_without_rspec_workaround(organisation) + end + end + alias_method_chain :install_organisation_resolver, :rspec_workaround +end
Make RSpec controller specs work with OrganisationResolvers.
diff --git a/lib/tasks/user.rake b/lib/tasks/user.rake index abc1234..def5678 100644 --- a/lib/tasks/user.rake +++ b/lib/tasks/user.rake @@ -4,7 +4,7 @@ task :downgrade_expired => :environment do User.pro_only.not_forever.joins(:payments).having("MAX(payments.date) < ?", 1.year.ago).group("users.id").each do |user| user.update(plan: "Free") - UserMailer.downgraded(user) + UserMailer.downgraded(user).deliver_later end end
Fix rake task to actually send emails
diff --git a/lib/thyme/server.rb b/lib/thyme/server.rb index abc1234..def5678 100644 --- a/lib/thyme/server.rb +++ b/lib/thyme/server.rb @@ -27,11 +27,11 @@ get '/photo' do pass unless request.accept?('application/json') - content_type :json conditions = { id: params[:id], set: { id: params[:set_id].to_i } } if photo = Photo.first(conditions) + content_type :json photo.to_json else halt 404, 'Not Found'
Set Content-Type to JSON only when sending JSON
diff --git a/lib/honyomi/pdf.rb b/lib/honyomi/pdf.rb index abc1234..def5678 100644 --- a/lib/honyomi/pdf.rb +++ b/lib/honyomi/pdf.rb @@ -22,3 +22,4 @@ end end end +
Add line feed at last
diff --git a/lib/yard/logging.rb b/lib/yard/logging.rb index abc1234..def5678 100644 --- a/lib/yard/logging.rb +++ b/lib/yard/logging.rb @@ -1,7 +1,11 @@-require "logger" +require 'logger' module YARD class Logger < ::Logger + def self.instance(pipe = STDERR) + @logger ||= new(pipe) + end + def initialize(*args) super self.level = INFO @@ -23,10 +27,6 @@ "[#{sev.downcase}]: #{msg}\n" end end - - def self.logger - @logger ||= YARD::Logger.new(STDERR) - end end -def log; YARD.logger end+def log; YARD::Logger.instance end
Move YARD.logger into Logger class (make it a proper Singleton)
diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb index abc1234..def5678 100644 --- a/config/initializers/wrap_parameters.rb +++ b/config/initializers/wrap_parameters.rb @@ -5,7 +5,7 @@ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. ActiveSupport.on_load(:action_controller) do - wrap_parameters format: [:json] + wrap_parameters :format => [:json] end # Disable root element in JSON by default.
Change initializer to ruby 1.8.7 hash syntax
diff --git a/app/models/search_aspect.rb b/app/models/search_aspect.rb index abc1234..def5678 100644 --- a/app/models/search_aspect.rb +++ b/app/models/search_aspect.rb @@ -1,11 +1,13 @@ # An aspect class that adds a search query term class SearchAspect < Aspect + DEFAULT_LIMIT = 50000 + def add_clause( query, preferences ) present?( preferences ) ? add_search_clause( query, preferences ) : query end def add_search_clause( query, preferences ) - query.search_aspect_property( aspect_property, key_property, text_index_term( preferences )) + query.search_aspect_property( aspect_property, key_property, text_index_term( preferences ), {"@limit" => DEFAULT_LIMIT}) end def add_search_regex_clause( query, preferences )
Increase default Lucene limit to 50K
diff --git a/app/models/snapshot_diff.rb b/app/models/snapshot_diff.rb index abc1234..def5678 100644 --- a/app/models/snapshot_diff.rb +++ b/app/models/snapshot_diff.rb @@ -9,5 +9,5 @@ validates_attachment_content_type :image, content_type: /\Aimage\/.*\Z/ - validates_numericality_of :diff_in_percent + validates :diff_in_percent, numericality: true end
Use the new "sexy" validations for SnapshotDiff As pointed out by Rubocop. This resolves all of the cops for this file. Change-Id: Id82cf7a6ba34c6de958ed3064ceae683a14f5fdf
diff --git a/app/models/spree/digital.rb b/app/models/spree/digital.rb index abc1234..def5678 100644 --- a/app/models/spree/digital.rb +++ b/app/models/spree/digital.rb @@ -8,13 +8,13 @@ do_not_validate_attachment_file_type :attachment validates_attachment_presence :attachment - if Paperclip::Attachment.default_options[:storage] == :s3 + if Paperclip::Attachment.default_options[:storage] == :s3 || attachment_definitions[:attachment][:storage] == :s3 attachment_definitions[:attachment][:s3_permissions] = :private attachment_definitions[:attachment][:s3_headers] = { content_disposition: 'attachment' } end def cloud? - Paperclip::Attachment.default_options[:storage] == :s3 + attachment.options[:storage] == :s3 end def create_drm_record(line_item)
Support setting the storage not using default_options When paperclip was configured to use s3 by accessing the attachment definition directly, the settings would not be picked up.
diff --git a/app/models/spreedly_core.rb b/app/models/spreedly_core.rb index abc1234..def5678 100644 --- a/app/models/spreedly_core.rb +++ b/app/models/spreedly_core.rb @@ -5,7 +5,7 @@ headers 'Content-Type' => 'text/xml' base_uri "http://core.dev:3003/v1" format :xml - + def self.configure(api_login, api_secret, gateway_token) basic_auth(api_login, api_secret) @api_login, @gateway_token = api_login, gateway_token @@ -14,7 +14,7 @@ def self.api_login @api_login end - + def self.to_xml_params(hash) # :nodoc: hash.collect do |key, value| tag = key.to_s.tr('_', '-') @@ -31,8 +31,18 @@ def self.purchase(payment_method_token, amount, currency_code="USD") - transaction = { :transaction_type => "Purchase", :amount => amount, :currency_code => currency_code, :payment_method_token => payment_method_token, :gateway_token => @gateway_token } - self.post("/transactions.xml", :body => self.to_xml_params(:transaction => transaction)) + post_transaction("Purchase", payment_method_token, amount, currency_code) end + def self.authorize(payment_method_token, amount, currency_code="USD") + post_transaction("Authorization", payment_method_token, amount, currency_code) + end + + private + def self.post_transaction(transaction_type, payment_method_token, amount, currency_code="USD") + transaction = { :transaction_type => transaction_type, :amount => amount, :currency_code => currency_code, :payment_method_token => payment_method_token, :gateway_token => @gateway_token } + self.post("/transactions.xml", :body => self.to_xml_params(:transaction => transaction)) + end + + end
Add ability to call authorize.
diff --git a/omnibus/files/pushy-server-cookbooks/opscode-pushy-server/libraries/helper.rb b/omnibus/files/pushy-server-cookbooks/opscode-pushy-server/libraries/helper.rb index abc1234..def5678 100644 --- a/omnibus/files/pushy-server-cookbooks/opscode-pushy-server/libraries/helper.rb +++ b/omnibus/files/pushy-server-cookbooks/opscode-pushy-server/libraries/helper.rb @@ -27,7 +27,7 @@ def self.check_status(service_name, path="/opt/opscode-push-jobs-server", command="opscode-push-jobs-server-ctl") - o = Chef::ShellOut.new("#{path}/bin/#{command} status #{service_name}") + o = Mixlib::ShellOut.new("#{path}/bin/#{command} status #{service_name}") o.run_command o.exitstatus == 0 ? true : false end
Use Mixlib::ShellOut; Chef::ShellOut is deprecated
diff --git a/app/models/calendar_invite.rb b/app/models/calendar_invite.rb index abc1234..def5678 100644 --- a/app/models/calendar_invite.rb +++ b/app/models/calendar_invite.rb @@ -17,12 +17,11 @@ Icalendar::Calendar.new.tap do |calendar| calendar.event do |event| if outcome.poll_option.name.match /^\d+-\d+-\d+$/ - event.dtstart = outcome.poll_option.name.to_date event.duration = "+P0W1D0H0M" else - event.dtstart = date_time(outcome.poll_option.name) event.duration = "+P0W0D0H#{outcome.poll.meeting_duration}M" end + event.dtstart = outcome.poll_option.name event.organizer = Icalendar::Values::CalAddress.new(outcome.author.email, cn: outcome.author.name) event.summary = outcome.event_summary event.description = outcome.event_description
Use raw poll option name for dtstart
diff --git a/lib/state_handler/ca.rb b/lib/state_handler/ca.rb index abc1234..def5678 100644 --- a/lib/state_handler/ca.rb +++ b/lib/state_handler/ca.rb @@ -3,8 +3,8 @@ ALLOWED_NUMBER_OF_EBT_CARD_DIGITS = [16] def button_sequence(ebt_number) - waiting_ebt_number = ebt_number.split('').join('w') - "wwww1wwwwww#{waiting_ebt_number}w#ww" + waiting_ebt_number = ebt_number.split('').join('ww') + "wwww1wwwwwwww#{waiting_ebt_number}ww#ww" end def transcribe_balance_response(transcription_text, language = :english)
Modify CA button sequence to one that more consistently seems to work
diff --git a/lib/tapfinder/search.rb b/lib/tapfinder/search.rb index abc1234..def5678 100644 --- a/lib/tapfinder/search.rb +++ b/lib/tapfinder/search.rb @@ -16,7 +16,7 @@ end def client - @client ||= RestClient::Resource.new("#{Tapfinder.host}#{Tapfinder.search_path}") + @client ||= RestClient::Resource.new("https://#{Tapfinder.host}#{Tapfinder.search_path}") end def search_terms_for(params)
Connect to Philly Tapfinder via https At some point recently, Philly Tapfinder rolled out https support and added 301s to redirect http => https, which caused errors in beer_bot. This updates to connect via https now that we can.
diff --git a/freecodecampruby/fear_not_letter.rb b/freecodecampruby/fear_not_letter.rb index abc1234..def5678 100644 --- a/freecodecampruby/fear_not_letter.rb +++ b/freecodecampruby/fear_not_letter.rb @@ -0,0 +1,33 @@+#Pseudocode +=begin +INPUT: Obtain a string +STEPS: +Create a letter array containing [a-z] +Split the word into seperate characters +Store the first character into the first_letter variable +Store the last character into the last_letter variable +find the index of the first_letter in the letter_array +find the index of the last_letter in the letter_array +FOR letter in (first_letter..last_letter) THEN + IF string_array.include?(letter) THEN + next + ELSEs + return letter +END FOR +OUTPUT: Return the missing letter in the sequence. If nothing missing return "Nothing missing" +Find the missing letter in the passed letter range and return it. + +If all letters are present in the range, return undefined. +=end + +def fear_not_letter(string) + string_array = string.split("") + first_letter = string_array[0] + last_letter = string_array.last + (first_letter..last_letter).find_all { |letter| letter unless string_array.include?(letter)} +end + +p fear_not_letter("abce") #should return "d". +p fear_not_letter("abcdefghjklmno") #should return "i". +p fear_not_letter("bcd") #should return undefined. +p fear_not_letter("yz") #should return undefined.
Create a method that returns the missing value in the sequence
diff --git a/gtk3/sample/misc/flowbox.rb b/gtk3/sample/misc/flowbox.rb index abc1234..def5678 100644 --- a/gtk3/sample/misc/flowbox.rb +++ b/gtk3/sample/misc/flowbox.rb @@ -0,0 +1,76 @@+#!/usr/bin/env ruby +=begin + flowbox.rb Ruby/GTK script + + Adapted (or stolen) from http://python-gtk-3-tutorial.readthedocs.org/en/latest/layout.html#flowbox + + Copyright (c) 2004-2015 Ruby-GNOME2 Project Team + This program is licenced under the same licence as Ruby-GNOME2. +=end +require "gtk3" + +COLORS = %w(AliceBlue AntiqueWhite AntiqueWhite1 AntiqueWhite2 AntiqueWhite3 + AntiqueWhite4 aqua aquamarine aquamarine1 aquamarine2 aquamarine3 + aquamarine4 azure azure1 azure2 azure3 azure4 beige bisque bisque1 + bisque2 bisque3 bisque4 black BlanchedAlmond blue blue1 blue2 + blue3 blue4 BlueViolet brown brown1 brown2 brown3 brown4 burlywood + burlywood1 burlywood2 burlywood3 burlywood4 CadetBlue CadetBlue1 + CadetBlue2 CadetBlue3 CadetBlue4 chartreuse chartreuse1 chartreuse2 + chartreuse3 chartreuse4 chocolate chocolate1 chocolate2 chocolate3 + chocolate4 coral coral1 coral2 coral3 coral4) + +class FlowBoxWindow < Gtk::Window + def initialize + super + + set_border_width(10) + set_default_size(300, 250) + + header = Gtk::HeaderBar.new + header.set_title("Flow Box") + header.subtitle = "Sample FlowBox app" + header.show_close_button = true + + set_titlebar(header) + + scrolled = Gtk::ScrolledWindow.new + scrolled.set_policy(Gtk::PolicyType::NEVER, Gtk::PolicyType::AUTOMATIC) + + @flowbox = Gtk::FlowBox.new + @flowbox.set_valign(Gtk::Align::START) + @flowbox.set_max_children_per_line(30) + @flowbox.set_selection_mode(Gtk::SelectionMode::NONE) + fill_flowbox + + scrolled.add(@flowbox) + add(scrolled) + + signal_connect("destroy") { Gtk.main_quit } + end + + private + + def color_swatch_new(color_name) + color = Gdk::RGBA.parse(color_name) + button = Gtk::Button.new + + area = Gtk::DrawingArea.new + area.set_size_request(24, 24) + area.override_background_color(0, color) + + button.add(area) + + button + end + + def fill_flowbox + COLORS.each do |color| + @flowbox.add(color_swatch_new(color)) + end + end +end + +win = FlowBoxWindow.new +win.show_all + +Gtk.main
Add new example for Gtk::FlowBox
diff --git a/Casks/fluid.rb b/Casks/fluid.rb index abc1234..def5678 100644 --- a/Casks/fluid.rb +++ b/Casks/fluid.rb @@ -3,5 +3,5 @@ homepage 'http://fluidapp.com/' version '1.6.1' sha1 '7de2fe4372e9d055bd2bb6f5afcefa549740a7ce' - link :app, 'Fluid.app' + link 'Fluid.app' end
Remove :app designation from Fluid link
diff --git a/lib/capistrano/detect_migrations.rb b/lib/capistrano/detect_migrations.rb index abc1234..def5678 100644 --- a/lib/capistrano/detect_migrations.rb +++ b/lib/capistrano/detect_migrations.rb @@ -16,7 +16,7 @@ end def approved? - $stdin.gets.strip == 'Y' + $stdin.gets.strip.downcase == 'y' end def self.load_into(configuration)
Allow for either upper or lower case approval.
diff --git a/spec/core_ext_spec.rb b/spec/core_ext_spec.rb index abc1234..def5678 100644 --- a/spec/core_ext_spec.rb +++ b/spec/core_ext_spec.rb @@ -19,7 +19,7 @@ end it "should define Kernel.hexdump" do - expect(Kernel).to be_kind_of(Hexdump::ModuleMethods) + expect(Kernel).to include(Hexdump::ModuleMethods) expect(Kernel).to respond_to(:hexdump) end end
Check if Hexdump::ModuleMethods is included into Kernel.
diff --git a/spec/geocoder_spec.rb b/spec/geocoder_spec.rb index abc1234..def5678 100644 --- a/spec/geocoder_spec.rb +++ b/spec/geocoder_spec.rb @@ -6,6 +6,11 @@ let(:sf) { [-122.4022462, 37.7892022] } let(:auckland) { [174.7758815, -36.7764613] } + it "Can have a configurable directory" do + test = LocalGeocoder::Geocoder.new("/tmp/test") + test.data_dir.should == "/tmp/test" + end + it "Returns a result" do gc.reverse_geocode(*auckland).should be_kind_of LocalGeocoder::Result end
Check directory can be configured
diff --git a/spec/progress_spec.rb b/spec/progress_spec.rb index abc1234..def5678 100644 --- a/spec/progress_spec.rb +++ b/spec/progress_spec.rb @@ -25,12 +25,12 @@ ticker.to_hash.should == { "orz" => { "top" => 100, "current" => 10, "status" => "working" } } end - context "#tick!" do + context "#tick" do it "should send progress updates" do ticker = job.status_ticker("orz") sink.should_receive(:update_job).with(job, { "orz" => { "status" => "funky", "current" => 1 } }) - ticker.tick! :status => "funky" + ticker.tick :status => "funky" end end
Correct progress spec to match API.
diff --git a/db/migrate/20130318140727_add_default_value_address_client.rb b/db/migrate/20130318140727_add_default_value_address_client.rb index abc1234..def5678 100644 --- a/db/migrate/20130318140727_add_default_value_address_client.rb +++ b/db/migrate/20130318140727_add_default_value_address_client.rb @@ -0,0 +1,9 @@+class AddDefaultValueAddressClient < ActiveRecord::Migration + def self.up + change_column_default :clients, :address, "" + end + + def self.down + change_column_default :clients, :address, nil + end +end
Add default value address client
diff --git a/lib/modules/active_storage_transfer.rb b/lib/modules/active_storage_transfer.rb index abc1234..def5678 100644 --- a/lib/modules/active_storage_transfer.rb +++ b/lib/modules/active_storage_transfer.rb @@ -0,0 +1,28 @@+module ActiveStorageTransfer + def self.transfer only_dump=false + config = ActiveRecord::Base.connection_config + + backup_path = Rails.root.join("tmp/active_storage.dump") + + dump_command = [] + dump_command << "PGPASSWORD=#{config[:password]}" if config[:password].present? + dump_command << "pg_dump" + dump_command << "-d #{config[:database]}_backup" + dump_command << "-t 'active_storage_*'" + dump_command << "-U #{config[:username]}" + dump_command << "-h #{config[:host]}" + dump_command << "> #{backup_path.to_s}" + system(dump_command.join(" ")) + + return true if only_dump + + restore_command = [] + restore_command << "PGPASSWORD=#{config[:password]}" if config[:password].present? + restore_command << "psql" + restore_command << "-d #{config[:database]}" + restore_command << "-U #{config[:username]}" + restore_command << "-h #{config[:host]}" + restore_command << "< #{backup_path.to_s}" + system(restore_command.join(" ")) + end +end
Add module to transfer ActiveStorage tables from backup db
diff --git a/lib/rubocop/cop/style/case_equality.rb b/lib/rubocop/cop/style/case_equality.rb index abc1234..def5678 100644 --- a/lib/rubocop/cop/style/case_equality.rb +++ b/lib/rubocop/cop/style/case_equality.rb @@ -7,10 +7,10 @@ class CaseEquality < Cop MSG = 'Avoid the use of the case equality operator `===`.'.freeze + def_node_matcher :case_equality?, '(send _ :=== _)' + def on_send(node) - _receiver, method_name, *_args = *node - - add_offense(node, :selector) if method_name == :=== + case_equality?(node) { add_offense(node, :selector) } end end end
Modify Style/CaseEquality to use NodePattern
diff --git a/lib/shopify_app/sessions_controller.rb b/lib/shopify_app/sessions_controller.rb index abc1234..def5678 100644 --- a/lib/shopify_app/sessions_controller.rb +++ b/lib/shopify_app/sessions_controller.rb @@ -35,7 +35,7 @@ def authenticate if shop_name = sanitize_shop_param(params) - fullpage_redirect_to "/auth/shopify?shop=#{shop_name}" + fullpage_redirect_to "#{main_app.root_url}auth/shopify?shop=#{shop_name}" else redirect_to return_address end
Use root_url from main_app when redirecting the user in authenticate
diff --git a/lib/ost.rb b/lib/ost.rb index abc1234..def5678 100644 --- a/lib/ost.rb +++ b/lib/ost.rb @@ -2,7 +2,7 @@ module Ost VERSION = "0.1.1" - TIMEOUT = ENV["OST_TIMEOUT"] || 0 + TIMEOUT = ENV["OST_TIMEOUT"] || 2 class Queue attr :key
Change default timeout to 2 seconds.
diff --git a/lib/docs/scrapers/node.rb b/lib/docs/scrapers/node.rb index abc1234..def5678 100644 --- a/lib/docs/scrapers/node.rb +++ b/lib/docs/scrapers/node.rb @@ -23,17 +23,17 @@ HTML version do - self.release = '7.4.0' + self.release = '7.5.0' self.base_url = 'https://nodejs.org/dist/latest-v7.x/docs/api/' end version '6 LTS' do - self.release = '6.9.4' + self.release = '6.9.5' self.base_url = 'https://nodejs.org/dist/latest-v6.x/docs/api/' end version '4 LTS' do - self.release = '4.7.2' + self.release = '4.7.3' self.base_url = 'https://nodejs.org/dist/latest-v4.x/docs/api/' end end
Update Node.js documentation (7.5.0, 6.9.5, 4.7.3)
diff --git a/lib/domgen/jaxb/helper.rb b/lib/domgen/jaxb/helper.rb index abc1234..def5678 100644 --- a/lib/domgen/jaxb/helper.rb +++ b/lib/domgen/jaxb/helper.rb @@ -15,13 +15,13 @@ s end - def jaxb_field_annotation(field) + def jaxb_field_annotation(field, wrap_collections = true) ns = namespace_annotation_parameter(field.xml) if field.collection? -<<JAVA -@javax.xml.bind.annotation.XmlElementWrapper( name = "#{field.xml.name}", required = #{field.xml.required?}#{ns}) - @javax.xml.bind.annotation.XmlElement( name = "#{field.xml.component_name}" ) -JAVA + s = '' + s << " @javax.xml.bind.annotation.XmlElementWrapper( name = \"#{field.xml.name}\", required = #{field.xml.required?}#{ns})" if wrap_collections + s << " @javax.xml.bind.annotation.XmlElement( name = \"#{field.xml.component_name}\" )" + s else "@javax.xml.bind.annotation.Xml#{field.xml.element? ? "Element" : "Attribute" }( name = \"#{field.xml.name}\", required = #{field.xml.required?}#{ns} )\n" end
Make it possible to annotate non wrapped collections
diff --git a/lib/engineyard/version.rb b/lib/engineyard/version.rb index abc1234..def5678 100644 --- a/lib/engineyard/version.rb +++ b/lib/engineyard/version.rb @@ -1,4 +1,4 @@ module EY - VERSION = '2.3.0' + VERSION = '2.3.1.pre' ENGINEYARD_SERVERSIDE_VERSION = ENV['ENGINEYARD_SERVERSIDE_VERSION'] || '2.3.1' end
Add .pre for next release
diff --git a/lib/fluent/plugin/out_logio.rb b/lib/fluent/plugin/out_logio.rb index abc1234..def5678 100644 --- a/lib/fluent/plugin/out_logio.rb +++ b/lib/fluent/plugin/out_logio.rb @@ -25,7 +25,7 @@ super puts @host puts @port - @socket = TCPSocket.open(@host, 28777) + @socket = TCPSocket.open(@host, @port) end def shutdown
Use port parameter instead of hardcoded number for connection
diff --git a/lib/signed_form-activeadmin.rb b/lib/signed_form-activeadmin.rb index abc1234..def5678 100644 --- a/lib/signed_form-activeadmin.rb +++ b/lib/signed_form-activeadmin.rb @@ -15,6 +15,8 @@ define_method :build do |resource, options = {}, &block| options[:signed] = true orig_build resource, options, &block + @opening_tag.gsub! /<input type="hidden" name="form_signature" value=".+" \/>\n/, + form_builder.form_signature_tag end end end
Fix integration with arbre-style active admin form tag Fields are added after the form has been rendered, so the signature needs to be updated
diff --git a/lib/node-elasticsearch.rb b/lib/node-elasticsearch.rb index abc1234..def5678 100644 --- a/lib/node-elasticsearch.rb +++ b/lib/node-elasticsearch.rb @@ -5,10 +5,47 @@ include Elasticsearch::Persistence::Model attribute :name, String + attribute :fqdn, String, default: :name # TODO: limit these two to a list of defaults attribute :ilk, String attribute :status, String - attribute :facts, Hashie::Mash, mapping: { type: 'object' } - attribute :params, Hashie::Mash, mapping: { type: 'object' } + attribute :facts, Hashie::Mash, mapping: { type: 'object' }, default: {} + attribute :params, Hashie::Mash, mapping: { type: 'object' }, default: {} + + # Magic: + # + # Make everything return either JSON or pretty text, defaul based on + # either user-agent or accepts or both or more :) + # + # Duplicate existing: + # hostname (partial or full) + # x=y + # x=~y + # @x=y + # x= + # x? + # x?= + # full + # json + # jmm :) Maybe by some extensible plugin thing? + # + # New ideas: + # - Make precedence explicit: + # - if both fact and param, param wins. + # - And bare words are highest (or tunable?) + # - Make order explicit? Needed? + # - ~x=y That is, regexp on the fact/param name + # - barewords=paramname1[,paramname2,factname1,...] (needs better name) + # Allow a list of fact/param names the values of which can be used + # as bare words in queries. + # + # For example, if 'prodlevel' were in the list then 'prod' + # could be used in a search to mean prodlevel=prod + def magic + end + + def find_by_names(string) + + end end
Node: Add fqdn and default to empty hashes. Plus comment/stub magic.
diff --git a/node_linked_list.rb b/node_linked_list.rb index abc1234..def5678 100644 --- a/node_linked_list.rb +++ b/node_linked_list.rb @@ -6,53 +6,74 @@ @next = next_node end - def to_s - value.to_s - end end class LinkedList - include Enumerable - attr_accessor :head + attr_accessor :head, :tail - def each - #if @head is nil the second half of the && expression won't run - @head && yield(@head) + # This linked list must be initialized with a node instance + def initialize(head) + @head = head + @tail = head + end - next_node = @head.next - while next_node - yield(next_node) - next_node = next_node.next + # Insert a new node after the tail of the linked list + def insert(node) + @tail.next = node + @tail = @tail.next + end + + # Print out all the values of the linked list in order + def print + current_node = @head + while current_node != nil + puts current_node.value + current_node = current_node.next end end - def initialize(head = Node.new) - @head = head + # Iterate through the linked list and yield to a block + def each + if block_given? + current_node = @head + while current_node != nil + yield current_node + current_node = current_node.next + end + end end - #add node to the front of the list - def unshift(new_head) - new_head.next = @head - @head = new_head - end - - def shift - old_head = @head - @head = @head.next - old_head - end end # 2.1: Write code to remove duplicates from a unsorted linked list. -def remove_linked_list_duplicates(list) - +def remove_duplicates(list) + hash = Hash.new + unique = nil + list.each do |node| + if unique == nil + unique = LinkedList.new(node) + hash[node.value] = true + end + unless hash.has_key?(node.value) + unique.insert(node) + hash[node.value] = true + end + end + unique end -test_list = LinkedList.new("A") -test_list.unshift("B") -test_list.unshift("C") -test_list.unshift("B") +node_a = Node.new("A") +node_b = Node.new("B") +node_c = Node.new("C") +node_d = Node.new("D") +node_x = Node.new("D") -p test_list.head +my_list = LinkedList.new(node_a) +my_list.insert(node_b) +my_list.insert(node_c) +my_list.insert(node_d) +my_list.insert(node_x) + +p remove_duplicates(my_list)
Complete node and linked list implementation
diff --git a/app/validators/city_and_state_validator.rb b/app/validators/city_and_state_validator.rb index abc1234..def5678 100644 --- a/app/validators/city_and_state_validator.rb +++ b/app/validators/city_and_state_validator.rb @@ -4,10 +4,8 @@ if record.address_city.present? && record.address_state.present? result = Geocoder.search(record.address, params: { countrycodes: "us" }) - if result.first.present? - record.address_city = result.first.city - record.address_state = result.first.state_code - end + record.address_city = result.first.city rescue nil + record.address_state = result.first.state_code rescue nil record.errors.add(:address, I18n.t('activerecord.validators.city_and_state.invalid')) unless record.address_city.present? && record.address_state.present? elsif not options.include?(:allow_blank)
Solve problem with city and state validation
diff --git a/ohm-contrib.gemspec b/ohm-contrib.gemspec index abc1234..def5678 100644 --- a/ohm-contrib.gemspec +++ b/ohm-contrib.gemspec @@ -21,7 +21,7 @@ s.require_paths = ["lib"] s.rubyforge_project = "ohm-contrib" - s.add_dependency "ohm", "~> 2.0" + s.add_dependency "ohm", "~> 2.0.0.rc1" s.add_development_dependency "cutest" s.add_development_dependency "override"
Fix ohm version on gemspec.
diff --git a/storage.rb b/storage.rb index abc1234..def5678 100644 --- a/storage.rb +++ b/storage.rb @@ -13,11 +13,16 @@ raise NotImplementedError end - def fetch(key, *args) - return self[key] if has_key?(key) - return args.first if args.size == 1 - - raise KeyError, key + def fetch(key, default = Moltrio::Undefined) + if has_key?(key) + self[key] + elsif default != Moltrio::Undefined + default + elsif block_given? + yield + else + raise KeyError, key + end end end end
Allow passing a block to Moltrio::Config.fetch to compute a default
diff --git a/docs/_plugins/copy_images_directory.rb b/docs/_plugins/copy_images_directory.rb index abc1234..def5678 100644 --- a/docs/_plugins/copy_images_directory.rb +++ b/docs/_plugins/copy_images_directory.rb @@ -1,15 +1,22 @@-class MyCustomCommand < Jekyll::Command +require 'fileutils' + +class MyNewCommand < Jekyll::Command class << self # As the docs get precompiled before being sent up to jekyll, # and they sit inside Chameleon, the images folder needs to be # copied into the docs repo. + if (!File.directory?('images')) + FileUtils.cp_r '../images', 'images' + end + def init_with_program(prog) prog.command(:build) do |c| - puts "hello world" - FileUtils.cp_r '../images', 'images' + c.action do + puts "hello world" + end end end end -end +end
Fix docs image dir plugin
diff --git a/lib/sapience/extensions/notifications.rb b/lib/sapience/extensions/notifications.rb index abc1234..def5678 100644 --- a/lib/sapience/extensions/notifications.rb +++ b/lib/sapience/extensions/notifications.rb @@ -1,5 +1,9 @@-require "active_support" -require "active_support/notifications" +begin + require "active_support" + require "active_support/notifications" +rescue LoadError + warn "ActiveSupport not available" +end module Sapience module Extensions @@ -11,8 +15,12 @@ end def self.subscribe(pattern, &block) - ::ActiveSupport::Notifications.subscribe(pattern) do |*args| - block.call ::ActiveSupport::Notifications::Event.new(*args) + if defined?(ActiveSupport::Notifications) + ::ActiveSupport::Notifications.subscribe(pattern) do |*args| + block.call ::ActiveSupport::Notifications::Event.new(*args) + end + else + warn "ActiveSupport not available" end end
Load ActiveSupport only when available
diff --git a/AGEmojiKeyboard.podspec b/AGEmojiKeyboard.podspec index abc1234..def5678 100644 --- a/AGEmojiKeyboard.podspec +++ b/AGEmojiKeyboard.podspec @@ -20,4 +20,5 @@ s.requires_arc = true s.source_files = 'AGEmojiKeyboard/*.{h,m}' + s.resources = 'Resources/*.plist' end
Add plist in resources list in podspec
diff --git a/kiwi/app/models/question.rb b/kiwi/app/models/question.rb index abc1234..def5678 100644 --- a/kiwi/app/models/question.rb +++ b/kiwi/app/models/question.rb @@ -7,4 +7,9 @@ has_many :votes, as: :votable validates_presence_of :title, :content, :user_id + + def best_answer + Answer.find_by(id: self.best_answer_id) + end + end
Add best_answer getter method to Question model
diff --git a/example/account_stat.rb b/example/account_stat.rb index abc1234..def5678 100644 --- a/example/account_stat.rb +++ b/example/account_stat.rb @@ -0,0 +1,24 @@+#!/bin/sh ruby +# -*- encoding: utf-8 -*- + +### +### Show account statuses +### Kazuki Hamasaki (ashphy@ashphy.com) +### + +require 'rubygems' +require 'active_record' + +require_relative '../rietveld_models' +require_relative 'db_load' + +puts "E-mail, Name, Received CCs, Reviews, Owners" +Account.find_each() do |account| + puts %Q{"%s","%s",%d,%d,%d} % [ + account.email, + account.name, + account.received_ccs.count, + account.review_issues.count, + account.owner_issues.count + ] +end
Add analysis script of showing account statuses
diff --git a/RSSKit.podspec b/RSSKit.podspec index abc1234..def5678 100644 --- a/RSSKit.podspec +++ b/RSSKit.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "RSSKit" - s.version = "1.0.6" + s.version = "1.0.7" s.license = {:type => "MIT", :file => "LICENSE"} s.summary = "A RSS/Atom Parser in Swift" s.homepage = "https://github.com/quan118/RSSKit"
Upgrade the version of podspec
diff --git a/db/migrate/20160308165211_move_network_port_cloud_subnet_id_to_network_ports_cloud_subnets.rb b/db/migrate/20160308165211_move_network_port_cloud_subnet_id_to_network_ports_cloud_subnets.rb index abc1234..def5678 100644 --- a/db/migrate/20160308165211_move_network_port_cloud_subnet_id_to_network_ports_cloud_subnets.rb +++ b/db/migrate/20160308165211_move_network_port_cloud_subnet_id_to_network_ports_cloud_subnets.rb @@ -14,7 +14,7 @@ def up # Move NetworkPort belongs_to :cloud_subnet to NetworkPort has_many :cloud_subnets, :through => :cloud_subnet_network_port - NetworkPort.all.each do |network_port| + NetworkPort.find_each do |network_port| CloudSubnetNetworkPort.create!( :cloud_subnet_id => network_port.cloud_subnet_id, :network_port_id => network_port.id) @@ -23,7 +23,7 @@ def down # Move NetworkPort belongs_to :cloud_subnet to NetworkPort has_many :cloud_subnets, :through => :cloud_subnet_network_port - NetworkPort.all.each do |network_port| + NetworkPort.find_each do |network_port| cloud_subnet_network_port = CloudSubnetNetworkPort.find_by(:network_port_id => network_port.id) if cloud_subnet_network_port network_port.update_attributes!(:cloud_subnet_id => cloud_subnet_network_port.cloud_subnet_id)
Use find_each instead of all to be more memory friendly Use find_each instead of all to be more memory friendly
diff --git a/models/buy.rb b/models/buy.rb index abc1234..def5678 100644 --- a/models/buy.rb +++ b/models/buy.rb @@ -11,7 +11,7 @@ property :rate_per_spot, Integer property :election_cycle, Enum[:primary, :general] - belongs_to :submitter, User + belongs_to :submitter, "User" belongs_to :station belongs_to :buyer belongs_to :advertiser
Use string for relationship class name
diff --git a/unziper.rb b/unziper.rb index abc1234..def5678 100644 --- a/unziper.rb +++ b/unziper.rb @@ -0,0 +1,32 @@+#!/usr/bin/ruby + + +require './downloader.rb' +require 'zip' + +module Unziper + + + def self.unzip(file) + Zip::File.open(file) do |zipfile| + zipfile.each do |entry| + # The 'next if...' code can go here, though I didn't use it + unless File.exist?(entry.name) + FileUtils::mkdir_p(File.dirname(entry.name)) + zipfile.extract(entry, "#{Downloader::TEMP_FOLDER}/#{entry.name}") + end + end + end + end + + def self.extract_all() + Dir["#{Downloader::TEMP_FOLDER}/*.zip"].each do |file| + self.unzip(file) + end + end + + if __FILE__ == $0 + self.extract_all + end +end +
Add a utility to unzip all files
diff --git a/lib/carrierwave/storage/webdav.rb b/lib/carrierwave/storage/webdav.rb index abc1234..def5678 100644 --- a/lib/carrierwave/storage/webdav.rb +++ b/lib/carrierwave/storage/webdav.rb @@ -29,7 +29,7 @@ true end def url(options = {}) - "http://files.fu2.redcursor.net/#{path}" + "http://files.redcursor.net/#{path}" end end
Use the correct hostname for file uploads
diff --git a/tasks/buildr_artifact_patch.rake b/tasks/buildr_artifact_patch.rake index abc1234..def5678 100644 --- a/tasks/buildr_artifact_patch.rake +++ b/tasks/buildr_artifact_patch.rake @@ -0,0 +1,46 @@+raise 'Patch already integrated into buildr code' unless Buildr::VERSION.to_s == '1.5.6' + +class URI::HTTP + private + + def write_internal(options, &block) + options ||= {} + connect do |http| + trace "Uploading to #{path}" + http.read_timeout = 500 + content = StringIO.new + while chunk = yield(RW_CHUNK_SIZE) + content << chunk + end + headers = { 'Content-MD5' => Digest::MD5.hexdigest(content.string), 'Content-Type' => 'application/octet-stream', 'User-Agent' => "Buildr-#{Buildr::VERSION}" } + request = Net::HTTP::Put.new(request_uri.empty? ? '/' : request_uri, headers) + request.basic_auth URI.decode(self.user), URI.decode(self.password) if self.user + response = nil + with_progress_bar options[:progress], path.split('/').last, content.size do |progress| + request.content_length = content.size + content.rewind + stream = Object.new + class << stream; + self; + end.send :define_method, :read do |*args| + bytes = content.read(*args) + progress << bytes if bytes + bytes + end + request.body_stream = stream + response = http.request(request) + end + + case response + when Net::HTTPRedirection + # Try to download from the new URI, handle relative redirects. + trace "Redirected to #{response['Location']}" + content.rewind + return (self + URI.parse(response['location'])).write_internal(options) {|bytes| content.read(bytes)} + when Net::HTTPSuccess + else + raise RuntimeError, "Failed to upload #{self}: #{response.message}" + end + end + end +end
Apply patch to work around Buildr password encoding issue
diff --git a/test/models/search/index_test.rb b/test/models/search/index_test.rb index abc1234..def5678 100644 --- a/test/models/search/index_test.rb +++ b/test/models/search/index_test.rb @@ -4,6 +4,8 @@ test "concatenates multiple keywords" do author = items(:one_author_stephen_king) data = Search::Index.new(:item => author, :locale => :en).data - assert_match(/Stephen King Steve/, data) + assert_instance_of(String, data) + assert_match(/Stephen King/, data) + assert_match(/Steve/, data) end end
Make test insensitive to field ordering
diff --git a/features/support/env.rb b/features/support/env.rb index abc1234..def5678 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -5,3 +5,10 @@ Before do @aruba_timeout_seconds = 3600 end + +Aruba.configure do |config| + config.before_cmd do |cmd| + set_env('JRUBY_OPTS', "-X-C #{ENV['JRUBY_OPTS']}") # disable JIT since these processes are so short lived + set_env('JAVA_OPTS', "-d32 #{ENV['JAVA_OPTS']}") # force jRuby to use client JVM for faster startup times + end +end if RUBY_PLATFORM == 'java'
Speed up performance on jruby
diff --git a/capistrano-technogate.gemspec b/capistrano-technogate.gemspec index abc1234..def5678 100644 --- a/capistrano-technogate.gemspec +++ b/capistrano-technogate.gemspec @@ -7,7 +7,7 @@ s.version = Capistrano::Technogate::Version::STRING.dup s.authors = ["Wael Nasreddine"] s.email = ["wael.nasreddine@gmail.com"] - s.homepage = "" + s.homepage = "https://github.com/TechnoGate/capistrano-technogate" s.summary = %q{This gem provides some receipts for helping me in my every-day development} s.description = s.summary
MISC: Add github projet page as the home page.
diff --git a/lib/delayed/performable_method.rb b/lib/delayed/performable_method.rb index abc1234..def5678 100644 --- a/lib/delayed/performable_method.rb +++ b/lib/delayed/performable_method.rb @@ -1,7 +1,7 @@ module Delayed class PerformableMethod < Struct.new(:object, :method, :args) def initialize(object, method, args = []) - raise NoMethodError, "undefined method `#{method}' for #{object.inspect}" unless object.respond_to?(method) + raise NoMethodError, "undefined method `#{method}' for #{object.inspect}" unless object.respond_to?(method, true) self.object = object self.args = args
Allow asynchronous methods to be private Change-Id: Ib552811667570f212b2eba78a0a852dee488b293
diff --git a/jekyll-commonmark.gemspec b/jekyll-commonmark.gemspec index abc1234..def5678 100644 --- a/jekyll-commonmark.gemspec +++ b/jekyll-commonmark.gemspec @@ -20,7 +20,6 @@ spec.required_ruby_version = ">= 2.3.0" spec.add_runtime_dependency "commonmarker", "~> 0.14" - spec.add_runtime_dependency "jekyll", ">= 3.7", "< 5.0" spec.add_development_dependency "bundler" spec.add_development_dependency "rake", "~> 12.0"
Remove gemspec dependency on Jekyll So that it can be bundled with Jekyll directly
diff --git a/lib/cukestart/generator/structure.rb b/lib/cukestart/generator/structure.rb index abc1234..def5678 100644 --- a/lib/cukestart/generator/structure.rb +++ b/lib/cukestart/generator/structure.rb @@ -17,7 +17,7 @@ empty_directory("#{project_name}/features") empty_directory("#{project_name}/features/support") empty_directory("#{project_name}/features/step_definitions") - empty_directory("#{project_name}/features/pages") if page_object & front + empty_directory("#{project_name}/features/pages") if page_object end def copy_cucumber_yml
Create page folder if is not a front project
diff --git a/lib/jekyll/filters/url_filters.rb b/lib/jekyll/filters/url_filters.rb index abc1234..def5678 100644 --- a/lib/jekyll/filters/url_filters.rb +++ b/lib/jekyll/filters/url_filters.rb @@ -32,12 +32,8 @@ private def ensure_leading_slash(input) - return input if input.nil? || input.empty? - if input.start_with?("/") - input - else - "/#{input}" - end + return input if input.nil? || input.empty? || input.start_with?("/") + "/#{input}" end end
Consolidate ensure_leading_slash to 2 lines.
diff --git a/tests/aws/signed_params_tests.rb b/tests/aws/signed_params_tests.rb index abc1234..def5678 100644 --- a/tests/aws/signed_params_tests.rb +++ b/tests/aws/signed_params_tests.rb @@ -8,10 +8,10 @@ end tests('Keys should be canonicalised using Unicode NFC') do - returns( Fog::AWS.escape( "\u{00e9}" ) ) { "%C3%A9" } + returns( Fog::AWS.escape( ["C3A9".to_i(16)].pack("U*") ) ) { "%C3%A9" } tests('Characters with combining mark should be combined and then escaped') do - returns( Fog::AWS.escape( "\u{0065}\u{0301}" ) ) { "%C3%A9" } + returns( Fog::AWS.escape( ["0065".to_i(16), "CC81".to_i(16)].pack("U*") ) ) { "%C3%A9" } end end end
Fix the Unicode strings for Ruby 1.8.7 Can’t use \u{xxxx} :(
diff --git a/lib/dropbox/archive/authorization.rb b/lib/dropbox/archive/authorization.rb index abc1234..def5678 100644 --- a/lib/dropbox/archive/authorization.rb +++ b/lib/dropbox/archive/authorization.rb @@ -1,3 +1,5 @@+require 'dropbox_sdk' + module Dropbox module Archive class Authorization @@ -6,16 +8,19 @@ DropboxOAuth2FlowNoRedirect.new( Dropbox::Archive.config.get("dropbox_app_key"), Dropbox::Archive.config.get("dropbox_app_secret") - end.tap do |flow| + ).tap do |flow| authorize_url = flow.start puts "Please authorize this application at: #{authorize_url}" puts "Enter authorization code:" - authorization_code = gets.chomp + authorization_code = $stdin.gets.chomp access_token, user_id = flow.finish(authorization_code) Dropbox::Archive.config.set("dropbox_access_token", access_token) end + + puts "Welcome, #{Dropbox::Archive.client.account_info['display_name']}!" + Dropbox::Archive.client end end end
Fix syntax error, use $stdin for getting input, and add welcome message so there's some output from the task
diff --git a/lib/juici/helpers/form_helpers.rb b/lib/juici/helpers/form_helpers.rb index abc1234..def5678 100644 --- a/lib/juici/helpers/form_helpers.rb +++ b/lib/juici/helpers/form_helpers.rb @@ -7,4 +7,5 @@ end form << %Q{<button type="submit" class="btn">#{opts[:submit] || "submit"}</button>} + form << %Q{</form>} end
Fix form helper not closing it's tags
diff --git a/lib/extensions/generic_view_paths.rb b/lib/extensions/generic_view_paths.rb index abc1234..def5678 100644 --- a/lib/extensions/generic_view_paths.rb +++ b/lib/extensions/generic_view_paths.rb @@ -8,7 +8,7 @@ find_template_without_active_scaffold(original_template_path, format) rescue MissingTemplate if active_scaffold_paths && original_template_path.include?('/') - active_scaffold_paths.find_template_without_active_scaffold(original_template_path.split('/', 2).last, format) + active_scaffold_paths.find_template_without_active_scaffold(original_template_path.split('/').last, format) else raise end
Fix find templates for namespaced controllers
diff --git a/lib/sequel/connection_pool/single.rb b/lib/sequel/connection_pool/single.rb index abc1234..def5678 100644 --- a/lib/sequel/connection_pool/single.rb +++ b/lib/sequel/connection_pool/single.rb @@ -2,13 +2,13 @@ # It is just a wrapper around a single connection that uses the connection pool # API. class Sequel::SingleConnectionPool < Sequel::ConnectionPool - # The SingleConnectionPool always has a size of 1, since the connection - # is always available. + # The SingleConnectionPool always has a size of 1 if connected + # and 0 if not. def size @conn ? 1 : 0 end - # Disconnect and immediately reconnect from the database. + # Disconnect the connection from the database. def disconnect(opts=nil, &block) block ||= @disconnection_proc block.call(@conn) if block
Fix the RDoc for the SingleConnectionPool
diff --git a/lib/cask/source/path_base.rb b/lib/cask/source/path_base.rb index abc1234..def5678 100644 --- a/lib/cask/source/path_base.rb +++ b/lib/cask/source/path_base.rb @@ -15,8 +15,23 @@ end def load - require path - Cask.const_get(cask_class_name).new + raise CaskError.new "File '#{path}' does not exist" unless path.exist? + raise CaskError.new "File '#{path}' is not readable" unless path.readable? + raise CaskError.new "File '#{path}' is not a plain file" unless path.file? + begin + require path + rescue CaskError, StandardError, ScriptError => e + # bug: e.message.concat doesn't work with CaskError exceptions + e.message.concat(" while loading '#{path}'") + raise e + end + begin + Cask.const_get(cask_class_name).new + rescue CaskError, StandardError, ScriptError => e + # bug: e.message.concat doesn't work with CaskError exceptions + e.message.concat(" while instantiating '#{cask_class_name}' from '#{path}'") + raise e + end end def cask_class_name
Improve error checking and messages on Cask load Other Cask sources ultimately invoke the `load` method in the abstract class Cask::Source::PathBase, so these changes apply to all other sources.
diff --git a/lib/heroku/command/deploy.rb b/lib/heroku/command/deploy.rb index abc1234..def5678 100644 --- a/lib/heroku/command/deploy.rb +++ b/lib/heroku/command/deploy.rb @@ -34,9 +34,9 @@ pack.deploy!(branch) display('Deployment successful.'.green) rescue Pack::NotFound - error("\e[91mNo suitable deploy pack found.\e[0m") + error('No suitable deploy pack found.'.red) rescue Pack::AmbiguousApp - error("\e[91mAmbiguous application, multiple deploy packs apply.\e[0m") + error('Ambiguous application, multiple deploy packs apply.'.red) rescue CommandExecutionFailure error('Deployment aborted.'.red.blink) end
Use colors for pack exceptions, too
diff --git a/lib/kracken/authenticator.rb b/lib/kracken/authenticator.rb index abc1234..def5678 100644 --- a/lib/kracken/authenticator.rb +++ b/lib/kracken/authenticator.rb @@ -34,7 +34,8 @@ Hashie::Mash.new({ provider: response_hash['provider'], uid: response_hash['uid'], - info: response_hash['info'] + info: response_hash['info'], + credentials: response_hash['credentials'], }) end
Include credential details in the `auth_hash` when creating a user This will pass the credential details to the host app, allowing them to collect the tokens needed for API access.
diff --git a/lib/modulr/sync_collector.rb b/lib/modulr/sync_collector.rb index abc1234..def5678 100644 --- a/lib/modulr/sync_collector.rb +++ b/lib/modulr/sync_collector.rb @@ -7,9 +7,14 @@ private def lib - File.read(PATH_TO_MODULR_SYNC_JS) + output = File.read(PATH_TO_MODULR_SYNC_JS) + if top_level_modules.size > 1 + output << "\nvar module = {};\n" + output << "\nrequire.main = module;\n" + end + output end - + def requires top_level_modules.map { |m| "\n require('#{m.id}');" }.join end
Make main module global when handling more than one file at the same time.
diff --git a/lib/chroma/color_modes.rb b/lib/chroma/color_modes.rb index abc1234..def5678 100644 --- a/lib/chroma/color_modes.rb +++ b/lib/chroma/color_modes.rb @@ -3,7 +3,7 @@ class << self private - def build(name, *attrs) + def build(*attrs) Class.new do attr_accessor *(attrs + [:a]) @@ -17,27 +17,13 @@ end alias_method :to_ary, :to_a - - protected - - def to_rgb - Converters::RgbConverter.convert_#{name}(self) - end - - def to_hsl - Converters::HslConverter.convert_#{name}(self) - end - - def to_hsv - Converters::HsvConverter.convert_#{name}(self) - end EOS end end end - Rgb = build :rgb, :r, :g, :b - Hsl = build :hsl, :h, :s, :l - Hsv = build :hsv, :h, :s, :v + Rgb = build :r, :g, :b + Hsl = build :h, :s, :l + Hsv = build :h, :s, :v end end
Revert "Add conversion to_* methods to ColorModes classes" This reverts commit 6a0b0ddd60932e3fda7acb26383954976e9f911c.
diff --git a/lib/convergence/config.rb b/lib/convergence/config.rb index abc1234..def5678 100644 --- a/lib/convergence/config.rb +++ b/lib/convergence/config.rb @@ -2,11 +2,15 @@ require 'yaml' class Convergence::Config - attr_accessor :adapter, :database, :host, :port, :username, :password + ATTRIBUTES = %i[adapter database host port username password].freeze + + attr_accessor(*ATTRIBUTES) def initialize(attributes) attributes.each do |k, v| - instance_variable_set("@#{k}", v) unless v.nil? + next if v.nil? + next if !ATTRIBUTES.include?(k.to_sym) && !ATTRIBUTES.include?(k.to_s) + instance_variable_set("@#{k}", v) end end
Fix not to assign unnecessary instance variables
diff --git a/lib/rasti/app/interaction.rb b/lib/rasti/app/interaction.rb index abc1234..def5678 100644 --- a/lib/rasti/app/interaction.rb +++ b/lib/rasti/app/interaction.rb @@ -12,13 +12,24 @@ end def call(params) - execute self.class.build_form(params) + Thread.current[thread_form_key] = self.class.build_form(params) + execute + ensure + Thread.current[thread_form_key] = nil end private attr_reader :container, :context + def form + Thread.current[thread_form_key] + end + + def thread_form_key + "#{self.class.name}::Form[#{self.object_id}]" + end + end end end
Move form argument to instance call scoped method (thread safe)
diff --git a/lib/salesforce_bulk/batch.rb b/lib/salesforce_bulk/batch.rb index abc1234..def5678 100644 --- a/lib/salesforce_bulk/batch.rb +++ b/lib/salesforce_bulk/batch.rb @@ -1,9 +1,12 @@ module SalesforceBulk class Batch + attr_accessor :created_at attr_accessor :id attr_accessor :job_id + attr_accessor :processed_records attr_accessor :state + attr_accessor :updated_at # <id>751D0000000004rIAA</id> # <jobId>750D0000000002lIAA</jobId>
Add attr_accessors in Batch class called created_at, updated_at and processed_records.
diff --git a/lib/tasks/asset_manager.rake b/lib/tasks/asset_manager.rake index abc1234..def5678 100644 --- a/lib/tasks/asset_manager.rake +++ b/lib/tasks/asset_manager.rake @@ -1,6 +1,6 @@ namespace :asset_manager do - desc "Migrates Organisation logos to Asset Manager." - task migrate_organisation_logos: :environment do + desc "Migrates Assets to Asset Manager." + task migrate_assets: :environment do MigrateAssetsToAssetManager.new.perform end end
Rename rake task migrate_organisation_logos -> migrate_assets
diff --git a/lib/tasks/sidekiq_stats.rake b/lib/tasks/sidekiq_stats.rake index abc1234..def5678 100644 --- a/lib/tasks/sidekiq_stats.rake +++ b/lib/tasks/sidekiq_stats.rake @@ -0,0 +1,16 @@+require 'sidekiq/api' + +desc 'report basic sidekiq stats' +task :sidekiq_stats do + stats = Sidekiq::Stats.new + + log_info = { + '@timestamp' => Time.new.getutc.iso8601, + 'enqueued' => stats.enqueued, + 'retry_size' => stats.retry_size, + 'scheduled_size' => stats.scheduled_size, + 'queues' => stats.queues + } + + puts log_info.to_json +end
Add basic rake task to report sidekiq queue status The task will be cron'd so that sidekiq status info can be logged and shipped to kibana.
diff --git a/lib/tent-validator/runner.rb b/lib/tent-validator/runner.rb index abc1234..def5678 100644 --- a/lib/tent-validator/runner.rb +++ b/lib/tent-validator/runner.rb @@ -19,7 +19,7 @@ require 'tent-validator/runner/cli' def self.run(&block) - paths = Dir[File.expand_path(File.join(File.dirname(__FILE__), 'validators', '*_validator.rb'))] + paths = Dir[File.expand_path(File.join(File.dirname(__FILE__), 'validators', '**', '*_validator.rb'))] paths.each { |path| require path } results = Results.new
Allow validations to be organized into subdirs
diff --git a/lib/has_accounts/model.rb b/lib/has_accounts/model.rb index abc1234..def5678 100644 --- a/lib/has_accounts/model.rb +++ b/lib/has_accounts/model.rb @@ -40,10 +40,7 @@ booking_template = BookingTemplate.find_by_code(template_code) # Prepare booking parameters - booking_params = { - :value_date => value_date, - :reference => self - } + booking_params = {:reference => self} booking_params.merge!(params) # Build and assign booking
Drop reliance on .value_date on including class for has_accounts.
diff --git a/lib/polytexnic/mathjax.rb b/lib/polytexnic/mathjax.rb index abc1234..def5678 100644 --- a/lib/polytexnic/mathjax.rb +++ b/lib/polytexnic/mathjax.rb @@ -25,8 +25,8 @@ EOS end - MATHJAX = '/MathJax/MathJax.js?config=' - AMS_HTML = MATHJAX + 'TeX-AMS_HTML' + MATHJAX = 'MathJax/MathJax.js?config=' + AMS_HTML = '/' + MATHJAX + 'TeX-AMS_HTML' AMS_SVG = MATHJAX + 'TeX-AMS-MML_SVG' end end
Fix MathJax path in self-contained HTML [#53728737]
diff --git a/lib/retryable_typhoeus.rb b/lib/retryable_typhoeus.rb index abc1234..def5678 100644 --- a/lib/retryable_typhoeus.rb +++ b/lib/retryable_typhoeus.rb @@ -10,19 +10,12 @@ DEFAULT_RETRIES = 10 class Request < Typhoeus::Request + attr_accessor :retries + def initialize(base_url, options = {}) @retries = (options.delete(:retries) || DEFAULT_RETRIES) super end - - def retries=(retries) - @retries = retries - end - - def retries - @retries ||= 0 - end end - end
Use attr_accessor instead of methods
diff --git a/lib/srtshifter/options.rb b/lib/srtshifter/options.rb index abc1234..def5678 100644 --- a/lib/srtshifter/options.rb +++ b/lib/srtshifter/options.rb @@ -31,7 +31,7 @@ opts.on_tail('-h', '--help', 'Show this help message.') do puts(opts) - exit(0) + # exit(0) end opts.parse! @@ -54,7 +54,7 @@ rescue Exception => ex puts "#{ex.message}. Please use -h or --help for usage." - exit(1) + # exit(1) end end end
Remove exit method from Options
diff --git a/lib/transproc/function.rb b/lib/transproc/function.rb index abc1234..def5678 100644 --- a/lib/transproc/function.rb +++ b/lib/transproc/function.rb @@ -13,7 +13,7 @@ alias_method :[], :call def compose(other) - self.class.new(-> *result { other[fn[*result]] }, args) + self.class.new(-> *input { other[fn[*input]] }, args) end alias_method :+, :compose end
Change result variable to input
diff --git a/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb b/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb index abc1234..def5678 100644 --- a/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb +++ b/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb @@ -3,8 +3,6 @@ # History: # Stan Smith 2017-03-11 refactored for mdJson/mdTranslator 2.0 # Josh Bradley original script - -# TODO Complete tests require 'jbuilder' require_relative 'mdJson_citation'
Refactor mdJson writer module for 'dictionary' include minitest modules
diff --git a/qtrix.gemspec b/qtrix.gemspec index abc1234..def5678 100644 --- a/qtrix.gemspec +++ b/qtrix.gemspec @@ -18,6 +18,7 @@ gem.require_paths = ["lib"] gem.add_dependency "redis-namespace", "~> 1.0.2" gem.add_dependency "mixlib-cli", "1.3.0" + gem.add_development_dependency 'rake', '~> 0.9' gem.add_development_dependency "rspec-core", "2.11.0" gem.add_development_dependency "rspec-prof", "0.0.3" gem.add_development_dependency "pry-debugger"
Add rake to gemfile for Travis
diff --git a/test/jenkins_github_test.rb b/test/jenkins_github_test.rb index abc1234..def5678 100644 --- a/test/jenkins_github_test.rb +++ b/test/jenkins_github_test.rb @@ -8,13 +8,15 @@ def test_push @stubs.post "/github-webhook/" do |env| assert_equal 'jenkins.example.com', env[:url].host + assert_equal 'Basic bW9ua2V5OnNlY3JldA==', + env[:request_headers]['authorization'] assert_equal 'application/x-www-form-urlencoded', env[:request_headers]['content-type'] [200, {}, ''] end svc = service :push, - {'jenkins_hook_url' => 'http://jenkins.example.com/github-webhook/'}, payload + {'jenkins_hook_url' => 'http://monkey:secret@jenkins.example.com/github-webhook/'}, payload svc.receive_push end
Add Authorization test to Jenkins (GitHub) hook
diff --git a/motion/core_ext/hash.rb b/motion/core_ext/hash.rb index abc1234..def5678 100644 --- a/motion/core_ext/hash.rb +++ b/motion/core_ext/hash.rb @@ -2,7 +2,9 @@ class NSDictionary def to_hash - Hash.new(self) + Hash.new.tap do |h| + h.replace self + end end delegate :symbolize_keys, :to => :to_hash
Fix symbolizing keys in NSDictionary instances
diff --git a/rails_legit.gemspec b/rails_legit.gemspec index abc1234..def5678 100644 --- a/rails_legit.gemspec +++ b/rails_legit.gemspec @@ -13,9 +13,7 @@ spec.homepage = "" spec.license = "MIT" - spec.files = `git ls-files`.split($/) - spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } - spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) + spec.files = Dir.glob('lib/**/*') + ['Rakefile', 'README.md', 'LICENSE.txt'] spec.require_paths = ["lib"] spec.add_development_dependency "bundler", "~> 1.3"
Remove spec related files from gemspec * This will reduce the number of files packaged. A good practice although for this small a gem, it probably wouldn't make much difference.
diff --git a/tasks/metrics/ci.rake b/tasks/metrics/ci.rake index abc1234..def5678 100644 --- a/tasks/metrics/ci.rake +++ b/tasks/metrics/ci.rake @@ -1,7 +1,7 @@ desc 'Run metrics with Heckle' -task :ci => [ 'ci:metrics', :heckle ] +task :ci => %w[ ci:metrics heckle ] namespace :ci do desc 'Run metrics' - task :metrics => [ :verify_measurements, :flog, :flay, :reek, :roodi, 'metrics:all' ] + task :metrics => %w[ verify_measurements flog flay reek roodi metrics:all ] end
Change to use a quoted array for the task list
diff --git a/railties/lib/rails/commands/console.rb b/railties/lib/rails/commands/console.rb index abc1234..def5678 100644 --- a/railties/lib/rails/commands/console.rb +++ b/railties/lib/rails/commands/console.rb @@ -4,6 +4,8 @@ module Rails class Console + ENVIRONMENTS = %w(production development test) + def self.start new.start end @@ -16,6 +18,10 @@ opt.on('-s', '--sandbox', 'Rollback database modifications on exit.') { |v| options[:sandbox] = v } opt.on("--debugger", 'Enable ruby-debugging for the console.') { |v| options[:debugger] = v } opt.parse!(ARGV) + end + + if env = ARGV.first + ENV['RAILS_ENV'] = ENVIRONMENTS.find { |e| e.index(env) } || env end require "#{Rails.root}/config/environment" @@ -33,15 +39,6 @@ end end - ENV['RAILS_ENV'] = - case ARGV.first - when "p" then "production" - when "d" then "development" - when "t" then "test" - else - ARGV.first || ENV['RAILS_ENV'] || 'development' - end - if options[:sandbox] puts "Loading #{ENV['RAILS_ENV']} environment in sandbox (Rails #{Rails.version})" puts "Any modifications you make will be rolled back on exit" @@ -51,4 +48,4 @@ IRB.start end end -end+end
Set RAILS_ENV before loading config/environment
diff --git a/omniauth-github.gemspec b/omniauth-github.gemspec index abc1234..def5678 100644 --- a/omniauth-github.gemspec +++ b/omniauth-github.gemspec @@ -1,24 +1,32 @@ # -*- encoding: utf-8 -*- -require File.expand_path('../lib/omniauth-cabify/version', __FILE__) + +lib = File.expand_path('../lib', __FILE__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +require 'omniauth-cabify/version' Gem::Specification.new do |gem| - gem.authors = ["Michael Koper"] - gem.email = ["michaelkoper@gmail.com"] - gem.description = %q{Official OmniAuth strategy for Cabify.} - gem.summary = %q{Official OmniAuth strategy for Cabify.} - gem.homepage = "https://github.com/michaelkoper/omniauth-cabify" - gem.license = "MIT" + gem.name = 'omniauth-cabify' + gem.version = OmniAuth::Cabify::VERSION + gem.authors = ['Michael Koper'] + gem.email = ['michaelkoper@gmail.com'] - gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } - gem.files = `git ls-files`.split("\n") - gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") - gem.name = "omniauth-cabify" - gem.require_paths = ["lib"] - gem.version = OmniAuth::Cabify::VERSION + gem.description = 'Official OmniAuth strategy for Cabify.' + gem.summary = 'Official OmniAuth strategy for Cabify.' + gem.homepage = 'https://github.com/michaelkoper/omniauth-cabify' + gem.license = 'MIT' - gem.add_dependency 'omniauth', '~> 1.0' - gem.add_dependency 'omniauth-oauth2', '~> 1.1' - gem.add_development_dependency 'rspec', '~> 2.7' + gem.files = `git ls-files -z`.split("\x0").reject do |f| + f.match(%r{^(test|spec|features)/}) + end + gem.executables = gem.files.grep(%r{^bin/}) { |f| File.basename(f) } + gem.require_paths = ['lib'] + + gem.add_dependency 'omniauth', '~> 1' + gem.add_dependency 'omniauth-oauth2', '~> 1' + + gem.add_development_dependency 'bundler', '~> 1.15' gem.add_development_dependency 'rack-test' + gem.add_development_dependency 'rake', '~> 10.0' + gem.add_development_dependency 'rspec', '~> 3.0' gem.add_development_dependency 'webmock' end
Update gemspec for Bundler gem style
diff --git a/pummel.rb b/pummel.rb index abc1234..def5678 100644 --- a/pummel.rb +++ b/pummel.rb @@ -3,6 +3,8 @@ require 'rss/2.0' require 'open-uri' require 'sinatra' +$: << File.join(File.dirname(__FILE__), 'vendor', 'ruby-oembed', 'lib') +require 'oembed' @@rss_url = "http://feeds.pinboard.in/rss/u:evaryont/" ic = Iconv.new('UTF-8//IGNORE', 'UTF-8') @@ -24,12 +26,9 @@ @@ index <%# Borrowed from http://rubyrss.org %> <h4><a href="<%= rss.channel.link %>"><%= rss.channel.title %></a></h4> -% if rss.channel.date -<small>Last updated on <%= rss.channel.date.strftime("%d %b %Y") %></small> -% end <p><%= rss.channel.description %></p> <ol> -% rss.channel.items.each do |item| +<% rss.items.each do |item| %> <li><%= item.title %></li> -%end +<% end %> </ol>
Use the vendored directory to load Ruby-OEmbed
diff --git a/em-scheduled-timer.gemspec b/em-scheduled-timer.gemspec index abc1234..def5678 100644 --- a/em-scheduled-timer.gemspec +++ b/em-scheduled-timer.gemspec @@ -20,7 +20,7 @@ spec.add_dependency "eventmachine", "~> 1.0" - spec.add_development_dependency "bundler", "~> 1.3" + spec.add_development_dependency "bundler", "~> 1.0" spec.add_development_dependency "rake" spec.add_development_dependency "rspec" end
Use a less stringent version number for the Bundler dependency
diff --git a/spec/models/renalware/hd/find_or_create_diary_by_week_query_spec.rb b/spec/models/renalware/hd/find_or_create_diary_by_week_query_spec.rb index abc1234..def5678 100644 --- a/spec/models/renalware/hd/find_or_create_diary_by_week_query_spec.rb +++ b/spec/models/renalware/hd/find_or_create_diary_by_week_query_spec.rb @@ -2,28 +2,26 @@ module Renalware describe HD::FindOrCreateDiaryByWeekQuery do - before(:all) do - @unit = create(:hospital_unit) - @user = create(:user) - end let(:week_period){ WeekPeriod.from_date(Time.zone.today) } + let(:user) { create(:user) } + let(:unit) { create(:hospital_unit) } it "finds an existing diary for the given week period" do master_diary = create( :hd_master_diary, - hospital_unit_id: @unit.id, - by: @user + hospital_unit_id: unit.id, + by: user ) created_diary = create( :hd_weekly_diary, master_diary: master_diary, - hospital_unit_id: @unit.id, + hospital_unit_id: unit.id, week_number: week_period.week_number, year: week_period.year, - by: @user) + by: user) - found_diary = described_class.new(by: @user, - unit_id: @unit.id, + found_diary = described_class.new(by: user, + unit_id: unit.id, week_period: week_period ).call @@ -31,14 +29,14 @@ end it "creates a new diary if one does not exists for the given week period" do - diary = described_class.new(by: @user, - unit_id: @unit.id, + diary = described_class.new(by: user, + unit_id: unit.id, week_period: week_period ).call expect(diary.week_number).to eq(week_period.week_number) expect(diary.year).to eq(week_period.year) - expect(diary.hospital_unit_id).to eq(@unit.id) + expect(diary.hospital_unit_id).to eq(unit.id) end end end
Remove before(:all) causing random spec error
diff --git a/rails_event_store-browser/rails_event_store-browser.gemspec b/rails_event_store-browser/rails_event_store-browser.gemspec index abc1234..def5678 100644 --- a/rails_event_store-browser/rails_event_store-browser.gemspec +++ b/rails_event_store-browser/rails_event_store-browser.gemspec @@ -12,7 +12,7 @@ s.summary = 'Web interface for RailsEventStore' s.license = 'MIT' - s.files = Dir['{app,config,db,lib}/**/*', 'MIT-LICENSE', 'Rakefile', 'README.md'] + s.files = Dir['{app,config,db,lib,public}/**/*', 'MIT-LICENSE', 'Rakefile', 'README.md'] s.add_dependency 'rails', '>= 4.2' s.add_dependency 'rails_event_store', '= 0.22.0'
Add missing directory to released gem.
diff --git a/homebrew/chruby-fish.rb b/homebrew/chruby-fish.rb index abc1234..def5678 100644 --- a/homebrew/chruby-fish.rb +++ b/homebrew/chruby-fish.rb @@ -1,15 +1,15 @@ require 'formula' class ChrubyFish < Formula - homepage 'https://github.com/JeanMertz/chruby-fish#readme' - url 'https://github.com/JeanMertz/chruby-fish/archive/v0.6.0.tar.gz' - sha1 'e8262283018137db89ba5031ec088a5df3df19d0' + desc "Thin wrapper around chruby to make it work with the Fish shell" + homepage "https://github.com/JeanMertz/chruby-fish#readme" + url "https://github.com/JeanMertz/chruby-fish/archive/v0.7.0.tar.gz" + sha256 "8d74471f75c7cd90ff319092afe9520c79ed7ff982b6025507f68ac862dc0526" + head "https://github.com/JeanMertz/chruby-fish.git" - head 'https://github.com/JeanMertz/chruby-fish.git' - - depends_on 'chruby' => :recommended + depends_on "chruby" => :recommended def install - system 'make', 'install', "PREFIX=#{prefix}" + system "make", "install", "PREFIX=#{prefix}" end end
Update Homebrew formula for v0.7.0
diff --git a/vagrant-puppet-modules.gemspec b/vagrant-puppet-modules.gemspec index abc1234..def5678 100644 --- a/vagrant-puppet-modules.gemspec +++ b/vagrant-puppet-modules.gemspec @@ -9,7 +9,7 @@ spec.authors = ['Anis Safine'] spec.email = ['anis@poensis.fr'] spec.description = 'A Vagrant plugin that installs the appropriate Puppet modules on your guest machine, via' \ - ' puppet-librarian.' + ' librarian-puppet.' spec.summary = spec.description spec.homepage = 'https://github.com/anis/vagrant-puppet-modules' spec.license = 'MIT'
Correct the name of librarian-puppet in description
diff --git a/Formula/jython.rb b/Formula/jython.rb index abc1234..def5678 100644 --- a/Formula/jython.rb +++ b/Formula/jython.rb @@ -1,7 +1,8 @@ require 'formula' class Jython <Formula - url 'http://downloads.sourceforge.net/project/jython/jython/2.5.1/jython_installer-2.5.1.jar' + JAR = 'jython_installer-2.5.1.jar' + url "http://downloads.sourceforge.net/project/jython/jython/2.5.1/#{JAR}" homepage 'http://www.jython.org' md5 '2ee978eff4306b23753b3fe9d7af5b37' @@ -10,6 +11,6 @@ end def install - system "java", "-jar", "jython_installer-2.5.1.jar", "-s", "-d", prefix + system "java", "-jar", JAR, "-s", "-d", prefix end end
Remove duplication of Jar name in Jython.
diff --git a/spec/helpers/application_helper/buttons/set_ownership_spec.rb b/spec/helpers/application_helper/buttons/set_ownership_spec.rb index abc1234..def5678 100644 --- a/spec/helpers/application_helper/buttons/set_ownership_spec.rb +++ b/spec/helpers/application_helper/buttons/set_ownership_spec.rb @@ -21,5 +21,10 @@ let(:tenant_mapping_enabled) { false } it_behaves_like 'an enabled button' end + + context 'when vm is not belong to any Vm' do + let(:ext_management_system) { nil } + it_behaves_like 'an enabled button' + end end end
Add case Instance/Vm without ext_management_system
diff --git a/test/test_category.rb b/test/test_category.rb index abc1234..def5678 100644 --- a/test/test_category.rb +++ b/test/test_category.rb @@ -0,0 +1,39 @@+# frozen_string_literal: true + +$LOAD_PATH.unshift(__dir__) + +require 'helper' + +describe Dimples::Category do + before do + @site = Dimples::Site.new(test_configuration) + end + + describe 'with a custom name in the configuration' do + before { @category = Dimples::Category.new(@site, 'windows') } + + it 'sets the correct name' do + @category.name.must_equal('Windows') + end + + it 'returns the correct value when inspected' do + @category.inspect.must_equal( + '#<Dimples::Category @slug=windows @name=Windows>' + ) + end + end + + describe 'without a custom name in the configuration' do + before { @category = Dimples::Category.new(@site, 'mac') } + + it 'sets the correct name' do + @category.name.must_equal('Macintosh') + end + + it 'returns the correct value when inspected' do + @category.inspect.must_equal( + '#<Dimples::Category @slug=mac @name=Macintosh>' + ) + end + end +end
Add tests for the category class
diff --git a/lib/preprocessors/image-preprocessor.rb b/lib/preprocessors/image-preprocessor.rb index abc1234..def5678 100644 --- a/lib/preprocessors/image-preprocessor.rb +++ b/lib/preprocessors/image-preprocessor.rb @@ -1,2 +1,2 @@ Pakyow::Assets.preprocessor :ico -Pakyow::Assets.preprocessor :png, :jpg, :gif, fingerprint: true +Pakyow::Assets.preprocessor :png, :jpg, :gif, :svg, fingerprint: true
Add svg to image preprocessor
diff --git a/UIImage-SolidColor.podspec b/UIImage-SolidColor.podspec index abc1234..def5678 100644 --- a/UIImage-SolidColor.podspec +++ b/UIImage-SolidColor.podspec @@ -1,11 +1,11 @@ Pod::Spec.new do |spec| spec.name = 'UIImage-SolidColor' - spec.version = '1.0.0' + spec.version = '1.0.1' spec.license = { :type => 'MIT' } spec.homepage = 'https://github.com/awojnowski/UIImage-SolidColor' spec.authors = { 'Aaron Wojnowski' => 'aaronwojnowski@gmail.com' } spec.summary = 'Simple category to convert an image to a solid color.' - spec.source = { :git => 'https://github.com/awojnowski/UIImage-SolidColor.git', :tag => '1.0.0'} + spec.source = { :git => 'https://github.com/awojnowski/UIImage-SolidColor.git', :tag => '1.0.1'} spec.source_files = 'src/*' spec.ios.deployment_target = '7.0' spec.ios.frameworks = 'Foundation', 'UIKit'
Build bump to version 1.0.1.
diff --git a/rpush-redis.gemspec b/rpush-redis.gemspec index abc1234..def5678 100644 --- a/rpush-redis.gemspec +++ b/rpush-redis.gemspec @@ -18,7 +18,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_dependency "modis", "~> 2.0" + spec.add_dependency "modis", "~> 3.0" spec.add_development_dependency "bundler", "~> 1.15" spec.add_development_dependency "rake"
Update modis for Rails 5.2 support
diff --git a/rss-dcterms.gemspec b/rss-dcterms.gemspec index abc1234..def5678 100644 --- a/rss-dcterms.gemspec +++ b/rss-dcterms.gemspec @@ -19,4 +19,5 @@ gem.add_development_dependency 'pry' gem.add_development_dependency 'pry-doc' gem.add_development_dependency 'yard' + gem.add_development_dependency 'redcarpet' end
Add redcarpet to deps to use Markdown
diff --git a/plugin.rb b/plugin.rb index abc1234..def5678 100644 --- a/plugin.rb +++ b/plugin.rb @@ -7,7 +7,7 @@ enabled_site_setting :nntp_bridge_enabled # install dependencies -gem 'active_attr', '0.9.0' +gem 'active_attr', '0.10.2' gem 'thoughtafter-nntp', '1.0.0.3', require: false gem 'rfc2047', '0.3', github: 'ConradIrwin/rfc2047-ruby'
Upgrade active_attr to 0.10.2 to support latest Discourse