diff stringlengths 65 26.7k | message stringlengths 7 9.92k |
|---|---|
diff --git a/spec/models/privacy_spec.rb b/spec/models/privacy_spec.rb
index abc1234..def5678 100644
--- a/spec/models/privacy_spec.rb
+++ b/spec/models/privacy_spec.rb
@@ -2,7 +2,13 @@
shared_examples_for 'content with privacy' do
context 'model is public' do
- let(:model) { build(:character, name: 'Ellen', privacy: 'public')}
+ let(:model) {
+ build(
+ described_class.model_name.param_key.to_sym,
+ name: 'Public model',
+ privacy: 'public'
+ )
+ }
describe '.public_content?' do
subject { model.public_content? }
| Fix privacy spec to test described object
|
diff --git a/spec/undo/model_spec.rb b/spec/undo/model_spec.rb
index abc1234..def5678 100644
--- a/spec/undo/model_spec.rb
+++ b/spec/undo/model_spec.rb
@@ -9,6 +9,15 @@ Undo.config do |config|
config.mutator_methods = [:change]
end
+ end
+
+ it "is a decorator" do
+ object = [:a, :b]
+ decorator = subject.new object
+ expect(object).to receive(:some_method)
+
+ decorator.some_method
+ expect(object.class).to eq Array
end
it "restores object" do
| Add test to ensure Undo::Model is a decorator
|
diff --git a/lib/groupify/adapter/active_record/group_membership.rb b/lib/groupify/adapter/active_record/group_membership.rb
index abc1234..def5678 100644
--- a/lib/groupify/adapter/active_record/group_membership.rb
+++ b/lib/groupify/adapter/active_record/group_membership.rb
@@ -13,8 +13,6 @@ extend ActiveSupport::Concern
included do
- attr_accessible(:member, :group, :group_name, :membership_type, :as) if ActiveSupport::VERSION::MAJOR < 4
-
belongs_to :member, polymorphic: true
belongs_to :group, polymorphic: true
end
| Remove conditional for older versions of active support.
|
diff --git a/lib/generators/kaleidoscope/templates/kaleidoscope.rb b/lib/generators/kaleidoscope/templates/kaleidoscope.rb
index abc1234..def5678 100644
--- a/lib/generators/kaleidoscope/templates/kaleidoscope.rb
+++ b/lib/generators/kaleidoscope/templates/kaleidoscope.rb
@@ -2,9 +2,9 @@ Kaleidoscope.configure do |config|
# Reference colors in hexadecimal, used to match and find colors
- config.colors = ["#660000", "#990000", "#cc0000", "#cc3333", "#ea4c88",
- "#993399", "#663399", "#333399", "#0066cc", "#0099cc", "#66cccc",
- "#77cc33", "#669900", "#336600", "#666600", "#999900", "#cccc33",
- "#ffff00", "#ffcc33", "#ff9900", "#ff6600", "#cc6633", "#996633",
- "#663300", "#000000", "#999999", "#cccccc", "#ffffff"]
+ config.colors = ["660000", "990000", "cc0000", "cc3333", "ea4c88",
+ "993399", "663399", "333399", "0066cc", "0099cc", "66cccc",
+ "77cc33", "669900", "336600", "666600", "999900", "cccc33",
+ "ffff00", "ffcc33", "ff9900", "ff6600", "cc6633", "996633",
+ "663300", "000000", "999999", "cccccc", "ffffff"]
end | Remove hex symbol from colors in generated config
|
diff --git a/db/migrate/20130909195929_rename_table_deployment_credentials.rb b/db/migrate/20130909195929_rename_table_deployment_credentials.rb
index abc1234..def5678 100644
--- a/db/migrate/20130909195929_rename_table_deployment_credentials.rb
+++ b/db/migrate/20130909195929_rename_table_deployment_credentials.rb
@@ -1,11 +1,13 @@ class RenameTableDeploymentCredentials < ActiveRecord::Migration
def self.up
+ remove_index :deployment_credentials, :gitolite_public_key_id
rename_table :deployment_credentials, :repository_deployment_credentials
end
def self.down
rename_table :repository_deployment_credentials, :deployment_credentials
+ add_index :deployment_credentials, :gitolite_public_key_id
end
end
| Remove indexes before renaming table
|
diff --git a/lib/fulmar/domain/service/config_tests/misc.rb b/lib/fulmar/domain/service/config_tests/misc.rb
index abc1234..def5678 100644
--- a/lib/fulmar/domain/service/config_tests/misc.rb
+++ b/lib/fulmar/domain/service/config_tests/misc.rb
@@ -10,3 +10,12 @@ end
end
end
+
+target_test 'test if at least one shared directory exists' do |config|
+ if config[:type] == 'rsync_with_versions' && (config[:shared].nil? || config[:shared].empty?)
+ next {
+ severity: warning,
+ message: 'config does not contain a shared directory for versioning'
+ }
+ end
+end
| Add a warning if no shared directory exists
|
diff --git a/lib/orange-flickr/resources/flickr_resource.rb b/lib/orange-flickr/resources/flickr_resource.rb
index abc1234..def5678 100644
--- a/lib/orange-flickr/resources/flickr_resource.rb
+++ b/lib/orange-flickr/resources/flickr_resource.rb
@@ -12,7 +12,7 @@ options["flickr_nsid"] = orange.options["flickr_nsid"] || false
end
- def photosets
+ def photosets(packet, opts = {})
if FlickRaw.api_key && options["flickr_nsid"]
ret = {}
sets = flickr.photosets.getList(:user_id => options["flickr_nsid"])
@@ -22,7 +22,7 @@ end
end
- def gallery
+ def gallery(packet, opts = {})
if options["flickr_nsid"]
sets_url = FlickRaw::URL_PHOTOSTREAM + options["flickr_nsid"] + "/sets"
else
| Allow gallery and photosets to accept args
|
diff --git a/lib/rails_admin/config/fields/types/boolean.rb b/lib/rails_admin/config/fields/types/boolean.rb
index abc1234..def5678 100644
--- a/lib/rails_admin/config/fields/types/boolean.rb
+++ b/lib/rails_admin/config/fields/types/boolean.rb
@@ -12,12 +12,12 @@
register_instance_option :pretty_value do
case value
- when nil
- %(<span class='label label-default'>‒</span>)
when false
%(<span class='label label-danger'>✘</span>)
when true
%(<span class='label label-success'>✓</span>)
+ else
+ %(<span class='label label-default'>‒</span>)
end.html_safe
end
| Update Boolean pretty_value to include default fallback
This will prevent the interface from breaking in the event a value is not correctly matched as 'true' or 'false'
|
diff --git a/webapp/config.ru b/webapp/config.ru
index abc1234..def5678 100644
--- a/webapp/config.ru
+++ b/webapp/config.ru
@@ -6,6 +6,6 @@
require_relative 'energie_api.rb'
-map '/energie-api' do
+map '/api' do
run EnergieApi
end
| Use the new API path.
|
diff --git a/app/controllers/remote_follow_controller.rb b/app/controllers/remote_follow_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/remote_follow_controller.rb
+++ b/app/controllers/remote_follow_controller.rb
@@ -22,7 +22,7 @@ render(:new) && return
end
- redirect_to Addressable::Template.new(redirect_url_link.template).expand(uri: "acct:#{@account.username}@#{Rails.configuration.x.local_domain}").to_s
+ redirect_to Addressable::Template.new(redirect_url_link.template).expand(uri: "#{@account.username}@#{Rails.configuration.x.local_domain}").to_s
else
render :new
end
| Fix uri expansion during remote follow
|
diff --git a/Casks/trailer.rb b/Casks/trailer.rb
index abc1234..def5678 100644
--- a/Casks/trailer.rb
+++ b/Casks/trailer.rb
@@ -1,6 +1,6 @@ cask 'trailer' do
- version '1.3.16'
- sha256 '4004b46c1fb50aab721410ab6bb109afa4eb8cfadc42abfd3183183964654b87'
+ version '1.3.17'
+ sha256 '3c556eb1e68751818346e3468ca5d779c7f38f1ad3cd9b8d14a3baddc7deb2be'
url "https://ptsochantaris.github.io/trailer/trailer#{version.no_dots}.zip"
appcast 'https://ptsochantaris.github.io/trailer/appcast.xml',
| Update Trailer to version 1.3.17
This commit updates the version and sha256 stanzas.
|
diff --git a/features/app/blueprints.rb b/features/app/blueprints.rb
index abc1234..def5678 100644
--- a/features/app/blueprints.rb
+++ b/features/app/blueprints.rb
@@ -1,8 +1,11 @@ # Blueprints
-require 'machinist'
+require 'machinist/active_record'
Sham.spoon_name { |i| "Spoon #{i}" }
Spoon.blueprint do
name { Sham.spoon_name }
end
+
+# reset shams between scenarios
+Before { Sham.reset } | Update machinist in pickle cucumber tests for latest machinist
|
diff --git a/bosh-template/lib/bosh/template/renderer.rb b/bosh-template/lib/bosh/template/renderer.rb
index abc1234..def5678 100644
--- a/bosh-template/lib/bosh/template/renderer.rb
+++ b/bosh-template/lib/bosh/template/renderer.rb
@@ -12,7 +12,7 @@ def render(template_name)
spec = JSON.parse(@context)
evaluation_context = EvaluationContext.new(spec)
- template = ERB.new(File.read(template_name))
+ template = ERB.new(File.read(template_name), safe_level = nil, trim_mode = "-")
template.result(evaluation_context.get_binding)
end
end
| Enable trim mode (<% -%>) for templating
|
diff --git a/lib/hamlit/block/engine.rb b/lib/hamlit/block/engine.rb
index abc1234..def5678 100644
--- a/lib/hamlit/block/engine.rb
+++ b/lib/hamlit/block/engine.rb
@@ -1,7 +1,32 @@+require 'hamlit/engine'
+
module Hamlit
module Block
- class Engine < ::Hamlit::Engine
- options[:escape_html] = false
+ class Engine < Temple::Engine
+ define_options(
+ :buffer_class,
+ generator: Temple::Generators::ArrayBuffer,
+ format: :html,
+ attr_quote: "'",
+ escape_html: false,
+ escape_attrs: true,
+ autoclose: %w(area base basefont br col command embed frame
+ hr img input isindex keygen link menuitem meta
+ param source track wbr),
+ filename: "",
+ )
+
+ use Hamlit::Parser
+ use Hamlit::Compiler
+ use Hamlit::HTML
+ use Hamlit::StringSplitter
+ use Hamlit::StaticAnalyzer
+ use Hamlit::Escapable
+ use Hamlit::ForceEscapable
+ filter :ControlFlow
+ filter :MultiFlattener
+ filter :StaticMerger
+ use :Generator, -> { options[:generator] }
end
end
end
| Duplicate Hamlit::Engine with hamlit-block's default
|
diff --git a/test/unit/workers/publishing_api_discard_draft_worker_test.rb b/test/unit/workers/publishing_api_discard_draft_worker_test.rb
index abc1234..def5678 100644
--- a/test/unit/workers/publishing_api_discard_draft_worker_test.rb
+++ b/test/unit/workers/publishing_api_discard_draft_worker_test.rb
@@ -0,0 +1,15 @@+require 'test_helper'
+require 'gds_api/test_helpers/publishing_api_v2'
+
+class PublishingApDiscardDraftiWorkerTest < ActiveSupport::TestCase
+ include GdsApi::TestHelpers::PublishingApiV2
+
+ test "registers a draft edition with the publishing api" do
+ edition = create(:draft_case_study)
+ request = stub_publishing_api_discard_draft(edition.content_id)
+
+ PublishingApiDiscardDraftWorker.new.perform(edition.content_id, 'en')
+
+ assert_requested request
+ end
+end
| Add test for successful Publishing API draft deletion
|
diff --git a/ci_environment/perlbrew/attributes/multi.rb b/ci_environment/perlbrew/attributes/multi.rb
index abc1234..def5678 100644
--- a/ci_environment/perlbrew/attributes/multi.rb
+++ b/ci_environment/perlbrew/attributes/multi.rb
@@ -1,4 +1,6 @@ default[:perlbrew][:perls] = [
- { :name => "5.14", :version => "perl-5.14.2" }
-]
+ { :name => "5.14", :version => "perl-5.14.2" },
+ { :name => "5.12", :version => "perl-5.12.4" },
+ { :name => "5.10", :version => "perl-5.10.1" }
+ ]
| Add two more Perls to the default perlbrew cookbook attribute list
Just like php::multi, this recipe won't be used outside of PHP[/Perl/Python] VM images,
so we can just keep all 3 versions we care about in the attributes as opposed to passing
them in in travis-boxes.
|
diff --git a/app/helpers/medal_helper.rb b/app/helpers/medal_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/medal_helper.rb
+++ b/app/helpers/medal_helper.rb
@@ -4,41 +4,33 @@ end
def content_medal_for(content, user)
- completion = completion_class_for content, user
- "#{content_medal_outline completion} #{content_medal_inlay_for(content, completion)}".html_safe
+ medal_for content, 'content', completion_class_for(content, user)
end
def corollary_medal_for(content)
- "#{corollary_medal_outline} #{corollary_medal_inlay_for(content)}".html_safe
+ medal_for content, 'corollary'
end
private
- def content_medal_inlay_for(content, completion)
- inlay_image_for content, "inlay content #{completion}"
+ def completion_class_for(content, user)
+ content.once_completed_for?(user, Organization.current) ? '' : 'unacquired'
end
- def corollary_medal_inlay_for(content)
- inlay_image_for content, 'inlay corollary'
- end
-
- def content_medal_outline(completion)
- outline_image "content #{completion}"
- end
-
- def corollary_medal_outline
- outline_image "corollary"
- end
-
- def inlay_image_for(content, clazz)
- image_tag content.medal.image_url, class: "mu-medal #{clazz}"
+ def medal_for(content, view, completion='')
+ %Q{
+ <div class="mu-medal #{completion}">
+ #{outline_image(view)}
+ #{inlay_image_for(content, view)}
+ </div>
+ }.html_safe
end
def outline_image(clazz)
image_tag '/medal/outline.svg', class: "mu-medal outline #{clazz}"
end
- def completion_class_for(content, user)
- content.once_completed_for?(user, Organization.current) ? '' : 'unacquired'
+ def inlay_image_for(content, clazz)
+ image_tag content.medal.image_url, class: "mu-medal inlay #{clazz}"
end
end
| Remove duplicated logic in medal helper
|
diff --git a/scripts/ruby/random_string_helper.rb b/scripts/ruby/random_string_helper.rb
index abc1234..def5678 100644
--- a/scripts/ruby/random_string_helper.rb
+++ b/scripts/ruby/random_string_helper.rb
@@ -0,0 +1,8 @@+module RandomStringHelper
+
+ def random_string(size = 8)
+ chars = (('a'..'z').to_a + ('0'..'9').to_a) - %w(i o 0 1 l 0)
+ (1..size).collect{|a| chars[rand(chars.size)] }.join
+ end
+
+end
| Add ruby script for testing user password syncing. PL-11239.
|
diff --git a/config/initializers/scheduled_tasks.rb b/config/initializers/scheduled_tasks.rb
index abc1234..def5678 100644
--- a/config/initializers/scheduled_tasks.rb
+++ b/config/initializers/scheduled_tasks.rb
@@ -9,15 +9,17 @@ end
end
- # Ensure the jobs run only in a web server.
- if defined?(Rack::Server)
- fire_up_those_scheduled_tasks!
-
- # Make this thing work in Passenger, too.
- elsif defined?(PhusionPassenger)
+ # First of all, look for Passenger
+ if defined?(PhusionPassenger)
+ Rails.logger.info "Passenger detected."
PhusionPassenger.on_event(:starting_worker_process) do |forked|
fire_up_those_scheduled_tasks!
end
+
+ # Check for Rack::Server (we don't want these running in our console.)
+ elsif defined?(Rack::Server)
+ Rails.logger.info "Rack::Server detected."
+ fire_up_those_scheduled_tasks!
# When we get here, we couldn't start up the background task. Shit!
elsif
| Check for Passenger first; Rack::Server second. |
diff --git a/web/lib/assets/umakadata/lib/umakadata/criteria/service_clause.rb b/web/lib/assets/umakadata/lib/umakadata/criteria/service_clause.rb
index abc1234..def5678 100644
--- a/web/lib/assets/umakadata/lib/umakadata/criteria/service_clause.rb
+++ b/web/lib/assets/umakadata/lib/umakadata/criteria/service_clause.rb
@@ -14,7 +14,7 @@ sparql_query = <<-"SPARQL"
SELECT *
WHERE {
- SERVICE <#{uri}> { <example.com> ?p ?o }
+ SERVICE <#{uri}> { <http://example.com> ?p ?o }
}
LIMIT 1
SPARQL
| Add URI scheme at query in ServiceClause.
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -25,4 +25,6 @@ # in case people had bookmarks set up. Using a proc as otherwise the
# path parameter gets escaped
get "/admin(/*path)", to: redirect { |params, req| "/#{params[:path]}" }
+
+ mount GovukAdminTemplate::Engine, at: "/style-guide"
end
| Include admin template style guide
* Keep a reference to admin design patterns
* Show how local styles may have affected those patterns
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -20,7 +20,7 @@
resources :sources do
collection do
- put :import
+ post :import
end
end
| Use correct POST verb for sources/import |
diff --git a/lib/restforce/file_part.rb b/lib/restforce/file_part.rb
index abc1234..def5678 100644
--- a/lib/restforce/file_part.rb
+++ b/lib/restforce/file_part.rb
@@ -1,9 +1,20 @@ # frozen_string_literal: true
-begin
+case Faraday::VERSION
+when /\A0\./
+ require 'faraday/upload_io'
+when /\A1\.9/
+ # Faraday v1.9 automatically includes the `faraday-multipart`
+ # gem, which includes `Faraday::FilePart`
+ require 'faraday/multipart'
+when /\A1\./
+ # Faraday 1.x versions before 1.9 - not matched by
+ # the previous clause - use `FilePart` (which must be explicitly
+ # required)
require 'faraday/file_part'
-rescue LoadError
- require 'faraday/upload_io'
+else
+ raise "Unexpected Faraday version #{Faraday::VERSION} - not sure how to set up " \
+ "multipart support"
end
module Restforce
| Load the right multipart code for each Faraday version
|
diff --git a/lib/socketry/exceptions.rb b/lib/socketry/exceptions.rb
index abc1234..def5678 100644
--- a/lib/socketry/exceptions.rb
+++ b/lib/socketry/exceptions.rb
@@ -2,7 +2,7 @@
module Socketry
# Generic catch all for all Socketry errors
- Error = Class.new(::IOError)
+ Error = Class.new(StandardError)
# Invalid address
AddressError = Class.new(Socketry::Error)
| Use StandardError as the base class for Socketry::Error
Previously it was using IOError, which makes it more difficult to differentiate
exceptions raised by Socketry from ones raised from MRI's I/O.
|
diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/users/omniauth_callbacks_controller.rb
+++ b/app/controllers/users/omniauth_callbacks_controller.rb
@@ -20,6 +20,11 @@ password: Devise.friendly_token[0,20])
if user.save
+ Player.where(creator_id: User.anonymous, creator_session_id: session.id).
+ update_all(user_id: user.id)
+ Composition.where(user_id: User.anonymous, session_id: session.id).
+ update_all(user_id: user.id)
+
session['devise.bnet_data'] = nil
set_flash_message(:notice, :success, kind: "Battle.net")
sign_in_and_redirect user, event: :authentication
| Update players and compositions on signup
|
diff --git a/app/mailers/error_mailer.rb b/app/mailers/error_mailer.rb
index abc1234..def5678 100644
--- a/app/mailers/error_mailer.rb
+++ b/app/mailers/error_mailer.rb
@@ -4,6 +4,7 @@ @error_info = JSON.parse(error_info).with_indifferent_access
mail(
+ from: Rails.application.secrets.error_email,
to: Rails.application.secrets.error_email,
subject: @error_info[:exception],
)
| Set the FROM to the same as the TO for sending error emails
Rails apparently requires this in production mode
We had hoped to let sendmail set this, but it doesn't look like
rails will allow that.
|
diff --git a/buildserver/cookbooks/fdroidbuild-general/recipes/default.rb b/buildserver/cookbooks/fdroidbuild-general/recipes/default.rb
index abc1234..def5678 100644
--- a/buildserver/cookbooks/fdroidbuild-general/recipes/default.rb
+++ b/buildserver/cookbooks/fdroidbuild-general/recipes/default.rb
@@ -18,3 +18,11 @@ end
end
+if node['kernel']['machine'] == "x86_64"
+ %w{ia32-libs}.each do |pkg|
+ package pkg do
+ action :install
+ end
+ end
+end
+
| Install ia32-libs on 64 bit vm only (I think)
I think this will work, but I haven't tested it yet. It's required
because all the android sdk tools (e.g. aapt) are 32 bit binaries.
|
diff --git a/spec/acceptance/z_alternative_pgdata_spec.rb b/spec/acceptance/z_alternative_pgdata_spec.rb
index abc1234..def5678 100644
--- a/spec/acceptance/z_alternative_pgdata_spec.rb
+++ b/spec/acceptance/z_alternative_pgdata_spec.rb
@@ -4,8 +4,8 @@ # location properly.
# Allow postgresql to use /tmp/* as a datadir
-if fact('osfamily') == 'RedHat'
- shell("setenforce 0")
+if fact('osfamily') == 'RedHat' and fact('selinux') == true
+ shell 'setenforce 0'
end
describe 'postgres::server', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
| Fix for not running acceptance tests on CentOS box
This was caused by fact that SELinux is already disabled and `setenforce 0` returns 1 insted of 0 in that case.
|
diff --git a/cookbooks/tilecache/recipes/default.rb b/cookbooks/tilecache/recipes/default.rb
index abc1234..def5678 100644
--- a/cookbooks/tilecache/recipes/default.rb
+++ b/cookbooks/tilecache/recipes/default.rb
@@ -21,27 +21,6 @@
tilecaches = search(:node, "roles:tilecache").sort_by { |n| n[:hostname] }
-@tilecaches.each do |cache|
- cache.ipaddresses(:family => :inet, :role => :external).sort.each do |address|
- firewall_rule "accept-squid" do
- action :accept
- source "net:#{address}"
- dest "fw"
- proto "tcp:syn"
- dest_ports "3128"
- source_ports "1024:"
- end
- firewall_rule "accept-squid-icp" do
- action :accept
- source "net:#{address}"
- dest "fw"
- proto "udp"
- dest_ports "3130"
- source_ports "1024:"
- end
- end
-end
-
squid_fragment "tilecache" do
template "squid.conf.erb"
variables :caches => tilecaches
| Revert "Tilecache: Firewall allow ICP traffic between caches"
This reverts commit b0da4432c68bf24f58fcf0c367e3d091493eb6aa.
|
diff --git a/spec/support/fixtures_generation/pipeline_generator.rb b/spec/support/fixtures_generation/pipeline_generator.rb
index abc1234..def5678 100644
--- a/spec/support/fixtures_generation/pipeline_generator.rb
+++ b/spec/support/fixtures_generation/pipeline_generator.rb
@@ -0,0 +1,66 @@+require_relative 'base_generator.rb'
+
+module FixturesGeneration
+ class PipelineGenerator < BaseGenerator
+ RAILS_SERVER_TEST_PORT = 3001
+ RAILS_SERVER_TEST_PID = Rails.root.join('tmp', 'pids',
+ 'rails-server-test.pid')
+ RAILS_SERVER_HOSTNAME = "localhost:#{RAILS_SERVER_TEST_PORT}"
+
+ attr_reader :file, :subdir
+
+ def initialize(file = nil, subdir = nil)
+ super()
+ @file = file
+ @subdir = subdir
+ end
+
+ def call
+ # We don't want to call this before the tests.
+ end
+
+ def with_cassette(cassette = nil, &block)
+ cassette ||= cassette_path_in_fixtures(file)
+ with_vcr(cassette, {}) do
+ block.call
+ end
+ rescue Exception
+ with_vcr(cassette, {record: :all}) do
+ with_running_hets do
+ with_running_rails_server_test do
+ block.call
+ end
+ end
+ end
+ end
+
+ protected
+
+ def with_vcr(cassette, vcr_options, &block)
+ notice_localhost_while do
+ VCR.use_cassette(cassette, vcr_options) do
+ block.call
+ end
+ end
+ end
+
+ def notice_localhost_while(&block)
+ VCR.configure { |c| c.ignore_localhost = false }
+ result = block.call
+ VCR.configure { |c| c.ignore_localhost = true }
+ result
+ end
+
+ def files
+ [file]
+ end
+
+ def with_running_rails_server_test(&block)
+ port = RAILS_SERVER_TEST_PORT
+ pid = RAILS_SERVER_TEST_PID
+ with_running('rails server',
+ "bundle exec rails s -p #{port} -P #{pid} -e test",
+ port, 15, &block)
+ end
+ end
+end
| Add PipelineGenerator to record the whole evaluation.
|
diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/home_controller.rb
+++ b/app/controllers/home_controller.rb
@@ -18,7 +18,7 @@ if @recent_anime.length < 4
@recent_anime += current_user.watchlists.where("status <> 'Currently Watching'").includes(:anime).order("updated_at DESC, created_at DESC").limit(4 - @recent_anime.length)
end
- @trending_anime = Rails.cache.fetch(:cached_trending_anime, expires_in: 5.minutes) do
+ @trending_anime = Rails.cache.fetch(:cached_trending_anime, expires_in: 60.minutes) do
TrendingAnime.get.map {|x| {anime: Anime.find(x), currently_watching: Watchlist.where(anime_id: x).count} }.dup
end
else
| Increase homepage trending cache time to 1 hour.
|
diff --git a/db/migrate/20140113000001_create_simple_slug_history_slug.rb b/db/migrate/20140113000001_create_simple_slug_history_slug.rb
index abc1234..def5678 100644
--- a/db/migrate/20140113000001_create_simple_slug_history_slug.rb
+++ b/db/migrate/20140113000001_create_simple_slug_history_slug.rb
@@ -2,9 +2,10 @@ def change
create_table :simple_slug_history_slugs do |t|
t.string :slug, null: false, limit: 191
+ t.string :locale, limit: 10
t.integer :sluggable_id, null: false
t.string :sluggable_type, limit: 50, null: false
- t.datetime :created_at
+ t.timestamps
end
add_index :simple_slug_history_slugs, :slug
| Add locale to history slug migration
|
diff --git a/lib/git_trend.rb b/lib/git_trend.rb
index abc1234..def5678 100644
--- a/lib/git_trend.rb
+++ b/lib/git_trend.rb
@@ -20,10 +20,8 @@ # GitTrend.get(language: :ruby, since: :weekly)
def self.get(*opts)
if opts[0].instance_of?(Hash)
- hash = opts[0]
- language = hash.key?(:language) ? hash[:language] : nil
- since = hash.key?(:since) ? hash[:since] : nil
- Scraper.new.get(language, since)
+ opt = opts[0]
+ Scraper.new.get(opt[:language], opt[:since])
else
Scraper.new.get(*opts)
end
| Refactor to simlify arguments handling
|
diff --git a/lib/lasp/eval.rb b/lib/lasp/eval.rb
index abc1234..def5678 100644
--- a/lib/lasp/eval.rb
+++ b/lib/lasp/eval.rb
@@ -4,11 +4,11 @@ module Lasp
module_function
- def eval(ast, env)
- case ast
- when Symbol then env.fetch(ast)
- when Array then eval_form(ast, env)
- else ast
+ def eval(form, env)
+ case form
+ when Symbol then env.fetch(form)
+ when Array then eval_form(form, env)
+ else form
end
end
| Rename parameter ast to form
I think form is more appropriate to Lisp.
|
diff --git a/app/models/keyword_search_index.rb b/app/models/keyword_search_index.rb
index abc1234..def5678 100644
--- a/app/models/keyword_search_index.rb
+++ b/app/models/keyword_search_index.rb
@@ -0,0 +1,26 @@+class KeywordSearchIndex < ActiveRecord::Base
+
+ belongs_to :organization
+
+ #validates :organization, :presence => true
+ validates :object_key, :presence => true
+ validates :object_class, :presence => true
+ validates :search_text, :presence => true
+
+ def to_s
+ name
+ end
+
+ # Return the Rails path to this object
+ def name
+ if InfrastructureComponent.find_by(object_key: object_key)
+ "inventory_path(:id => '#{InfrastructureComponent.find_by(object_key: object_key).parent.object_key}')"
+ elsif object_class == Rails.application.config.asset_base_class_name
+ "inventory_path(:id => '#{object_key}')"
+ else
+ "#{object_class.underscore}_path(:id => '#{object_key}')"
+ end
+
+ end
+
+end
| [TTPLAT-1391] Fix keyword search on infrastructure components.
|
diff --git a/ci/scripts/upload-to-object-storage.rb b/ci/scripts/upload-to-object-storage.rb
index abc1234..def5678 100644
--- a/ci/scripts/upload-to-object-storage.rb
+++ b/ci/scripts/upload-to-object-storage.rb
@@ -19,7 +19,20 @@ file = files.first
file_name = file.basename
+release_version_file = Pathname(ENV.fetch('VERSION_FILE'))
+release_version = release_version_file.read.chomp
+
+if release_version.empty?
+ warn "Could not find a release version in #{release_version_file}"
+ exit 1
+end
+
dir = s.directories.create key: ENV.fetch('REMOTE_FOLDER'), public: true
-remote_file = dir.files.create key: file_name.to_s, body: file.open, public: true
+
+remote_file = dir.files.create(
+ key: (release_version / file_name).to_s,
+ body: file.open,
+ public: true
+)
puts "Successfully uploaded #{file_name} as #{remote_file.public_url}"
| Add the release version to name of the published file
[#115144847]
Signed-off-by: Steffen Uhlig <f82265073a33b8214db2ab356bc472f35869736c@de.ibm.com>
|
diff --git a/app/controllers/api/invoices_controller.rb b/app/controllers/api/invoices_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/api/invoices_controller.rb
+++ b/app/controllers/api/invoices_controller.rb
@@ -1,7 +1,5 @@ module Api
class InvoicesController < ActionController::Base
- protect_from_forgery with: :exception
-
def create
project_anchor = ProjectAnchor.find_by(token: params[:token])
| Remove protect from forgery for API call
|
diff --git a/app/controllers/api/v1/index_controller.rb b/app/controllers/api/v1/index_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/api/v1/index_controller.rb
+++ b/app/controllers/api/v1/index_controller.rb
@@ -2,12 +2,17 @@ # authorize_resource class: false
def index
- @w_api = Wunderground.new(Figaro.env.wunderground_api_key)
- puts @w_api.forecast_for("WA", "Spokane")
end
def location
- # make an call to wunderground api
- # render json: something from wunderground
+ w_api = Wunderground.new(Figaro.env.wunderground_api_key)
+ forecast = w_api.forecast_for(params[:zip])
+
+ three_day_forecast = forecast["forecast"]["txt_forecast"]["forecastday"][0..5]
+
+ respond_to do |format|
+ format.html
+ format.json {render :json => three_day_forecast}
+ end
end
end | Move wunderground api call to location method, request forecast for zip, parse out everything but three day forecast, render json for three-day
|
diff --git a/spec/helpers/application_helper/buttons/report_only_spec.rb b/spec/helpers/application_helper/buttons/report_only_spec.rb
index abc1234..def5678 100644
--- a/spec/helpers/application_helper/buttons/report_only_spec.rb
+++ b/spec/helpers/application_helper/buttons/report_only_spec.rb
@@ -0,0 +1,43 @@+describe ApplicationHelper::Button::ReportOnly do
+ let(:view_context) { setup_view_context_with_sandbox({}) }
+ let(:result_detail) { FactoryGirl.create(:miq_report_result_detail, :miq_report_result_id => report_result_id) }
+ let(:record) { FactoryGirl.create(:miq_report_result, :miq_report_result_details => []) }
+ let(:report) { FactoryGirl.create(:miq_report, :miq_report_results => []) }
+ let(:report_result_id) { record.id }
+ let(:instance_data) { {'record' => record, 'report' => report, 'report_result_id' => report_result_id} }
+ let(:button) { described_class.new(view_context, {}, instance_data, {}) }
+
+ describe '#calculate_properties' do
+ let(:setup_report_result_details) { record.miq_report_result_details << result_detail if record }
+ before do
+ setup_report_result_details
+ button.calculate_properties
+ end
+
+ context 'when record not present' do
+ let(:record) { nil }
+ it_behaves_like 'a render_report button'
+ end
+ context 'when record is present' do
+ context 'and record has report' do
+ context 'and record has report_result_id' do
+ context 'and report has result details' do
+ it_behaves_like 'an enabled button'
+ end
+ context 'and report has no result details' do
+ let(:setup_report_result_details) {}
+ it_behaves_like 'a disabled button', 'No records found for this report'
+ end
+ end
+ context 'and record does not have report_result_id' do
+ let(:report_result_id) { nil }
+ it_behaves_like 'a disabled button', 'No records found for this report'
+ end
+ end
+ context 'and record does not have report' do
+ let(:report) { nil }
+ it_behaves_like 'a disabled button', 'No records found for this report'
+ end
+ end
+ end
+end
| Create spec examples for ReportOnly button class
|
diff --git a/app/helpers/cloud_resource_quota_helper.rb b/app/helpers/cloud_resource_quota_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/cloud_resource_quota_helper.rb
+++ b/app/helpers/cloud_resource_quota_helper.rb
@@ -7,6 +7,7 @@ CloudResourceQuota.where(
:cloud_tenant_id => cloud_tenant_id,
:service_name => service_name,
- :name => quota_name).first
+ :name => quota_name
+ ).first
end
end
| Fix rubocop warnings in CloudResourceQuotaHelper
|
diff --git a/app/serializers/api/contacts_serializer.rb b/app/serializers/api/contacts_serializer.rb
index abc1234..def5678 100644
--- a/app/serializers/api/contacts_serializer.rb
+++ b/app/serializers/api/contacts_serializer.rb
@@ -1,11 +1,12 @@ class Api::ContactsSerializer < ActiveModel::Serializer
-
class Api::ContactsSerializer::Show < ActiveModel::Serializer
- attributes(:email, :name, :text)
+ attributes(:email, :name, :text, :avatar)
+ attribute(:users) { object.users.collect { |u| u.firstname + ' ' + u.lastname } }
end
class Api::ContactsSerializer::Index < ActiveModel::Serializer
- attributes(:id, :email, :name, :text)
+ attributes(:id, :email, :name, :text, :avatar)
+ attribute(:users) { object.users.collect { |u| u.firstname + ' ' + u.lastname } }
def text
MarkdownHelper.markdown_api(object.text)
| Include avatar and users in contact API
|
diff --git a/lib/scss_init.rb b/lib/scss_init.rb
index abc1234..def5678 100644
--- a/lib/scss_init.rb
+++ b/lib/scss_init.rb
@@ -3,11 +3,11 @@ # Enables support for SCSS template reloading in rack applications.
# See http://nex-3.com/posts/88-sass-supports-rack for more details.
# Store SCSS files (by default) within 'app/stylesheets'
-require 'sass/plugin/rack'
-Sass::Plugin.options[:syntax] = :scss
-Sass::Plugin.options[:template_location] = Padrino.root("app/stylesheets")
-Sass::Plugin.options[:css_location] = Padrino.root("public/stylesheets")
-app.use Sass::Plugin::Rack
+#require 'sass/plugin/rack'
+#Sass::Plugin.options[:syntax] = :scss
+#Sass::Plugin.options[:template_location] = Padrino.root("app/stylesheets")
+#Sass::Plugin.options[:css_location] = Padrino.root("public/stylesheets")
+#app.use Sass::Plugin::Rack
end
end | Disable SCSS Init to avoid a Padrino bug
|
diff --git a/lib/beaglebone/GPIO.rb b/lib/beaglebone/GPIO.rb
index abc1234..def5678 100644
--- a/lib/beaglebone/GPIO.rb
+++ b/lib/beaglebone/GPIO.rb
@@ -3,7 +3,7 @@ module GPIO
def self.list
str = `ls /sys/class/gpio/`
- str.gsub! '\n', ','
+ str.gsub! "\n", ','
str.split(',')
end
end
| Convert list string to array
|
diff --git a/lib/combined_errors.rb b/lib/combined_errors.rb
index abc1234..def5678 100644
--- a/lib/combined_errors.rb
+++ b/lib/combined_errors.rb
@@ -6,7 +6,7 @@ define_method new_method do
methods_to_combine.flatten.each do |m|
if errors[m].any?
- title = m.to_s.respond_to?(:titleize) ? m.titleize : m.capitalize
+ title = m.to_s.respond_to?(:titleize) ? m.to_s.titleize : m.to_s.capitalize
errors[m].each do |error|
errors.add(new_method, "#{title} #{error}")
end
| Fix ".to_s" problem if passed in value is a symbol |
diff --git a/lib/active_admin/devise.rb b/lib/active_admin/devise.rb
index abc1234..def5678 100644
--- a/lib/active_admin/devise.rb
+++ b/lib/active_admin/devise.rb
@@ -7,7 +7,9 @@ {
:path => ActiveAdmin.application.default_namespace,
:controllers => ActiveAdmin::Devise.controllers,
- :path_names => { :sign_in => 'login', :sign_out => "logout" }
+ :path_names => { :sign_in => 'login', :sign_out => "logout" },
+ # Support sign_out via :get and Devise default (:get or :delete depending on version)
+ :sign_out_via => [::Devise.sign_out_via, :get].flatten.uniq
}
end
| Support sign_out via :get and Devise default.
|
diff --git a/lib/haml_coffee_assets/action_view/template_handler.rb b/lib/haml_coffee_assets/action_view/template_handler.rb
index abc1234..def5678 100644
--- a/lib/haml_coffee_assets/action_view/template_handler.rb
+++ b/lib/haml_coffee_assets/action_view/template_handler.rb
@@ -5,22 +5,36 @@ new(template).render
end
- def initialize(template)
+ def initialize(template, partial = false)
@template = template
+ @partial = partial
end
def render
"ExecJS.compile(#{compilation_string}).eval(#{evaluation_string}).html_safe"
end
+ def compilation_string
+ string = ""
+
+ unless @partial
+ string << preamble
+ string << helpers
+ end
+
+ string << compiled_template
+
+ if @partial
+ string
+ else
+ string.inspect
+ end
+ end
+
private
- def compilation_string
- (preamble + helpers + compiled_template).inspect
- end
-
def evaluation_string
- string = "window.JST['#{@template.virtual_path}'](\#{local_assigns.to_json})"
+ string = "window.JST['#{logical_path}'](\#{local_assigns.to_json})"
string.inspect.sub(/\\#/, "#")
end
@@ -33,10 +47,48 @@ end
def compiled_template
- ::HamlCoffeeAssets::Compiler.compile(
- @template.virtual_path,
+ compiled = ::HamlCoffeeAssets::Compiler.compile(
+ logical_path,
@template.source
)
+
+ compiled.dup.scan(/window.JST\[["']([\w\/]+)["']\]/) do |match|
+ path = match[0]
+
+ next if path == logical_path
+
+ partial = ::ActionView::Template.new(
+ partial_source(path),
+ path,
+ self.class,
+ :virtual_path => partial_path(path)
+ )
+
+ compiled << self.class.new(partial, true).compilation_string
+ end
+
+ compiled
+ end
+
+ def logical_path
+ return @logical_path if defined?(@logical_path)
+
+ path = @template.virtual_path.split("/")
+ path.last.sub!(/^_/, "")
+ @logical_path = path.join("/")
+ end
+
+ def partial_source(path)
+ ::Rails.root.join(
+ ::HamlCoffeeAssets.config.shared_template_path,
+ partial_path(path) + ".hamlc"
+ ).read
+ end
+
+ def partial_path(path)
+ parts = path.split("/")
+ parts[-1] = "_#{parts[-1]}"
+ parts.join("/")
end
end
end
| Add support for server-side partials.
|
diff --git a/lib/analyze_staff_table.rb b/lib/analyze_staff_table.rb
index abc1234..def5678 100644
--- a/lib/analyze_staff_table.rb
+++ b/lib/analyze_staff_table.rb
@@ -32,4 +32,10 @@ data.select { |row| row[:stf_name_view] == full_name }[0].to_hash
end
+ def get_educators_missing_local_ids
+ data.select { |row| row[:stf_id_local].nil? }
+ .map { |row| row[:stf_name_view] }
+ .sort
+ end
+
end
| Print names of all educators in X2 w/o local ID
+ #6
|
diff --git a/lib/chronicle/interface.rb b/lib/chronicle/interface.rb
index abc1234..def5678 100644
--- a/lib/chronicle/interface.rb
+++ b/lib/chronicle/interface.rb
@@ -1,8 +1,8 @@ module Chronicle::Interface
def self.included(base)
base.class_eval {
- before_filter :add_chronicle_stylesheet, :only => [:index, :edit, :new]
- before_filter :add_chronicle_javascript, :only => [:edit, :new]
+ before_filter :add_chronicle_stylesheet, :only => [:index, :edit, :new, :create, :update]
+ before_filter :add_chronicle_javascript, :only => [:edit, :new, :create, :update]
include InstanceMethods
helper 'admin/timeline'
}
| Add stylesheet and javascripts to :create and :update actions so timeline looks right even when model has validation errors. |
diff --git a/lib/indexer/amender.rb b/lib/indexer/amender.rb
index abc1234..def5678 100644
--- a/lib/indexer/amender.rb
+++ b/lib/indexer/amender.rb
@@ -8,7 +8,7 @@
def amend(document_id, updates)
if updates.include?("link")
- raise ArgumentError, "Cannot change document the `link` attribute of a document."
+ raise ArgumentError, "Cannot change the `link` attribute of a document."
end
document = index.get_document_by_id(document_id)
| Fix typo in error message
|
diff --git a/lib/jekyll-mentions.rb b/lib/jekyll-mentions.rb
index abc1234..def5678 100644
--- a/lib/jekyll-mentions.rb
+++ b/lib/jekyll-mentions.rb
@@ -13,7 +13,7 @@
def generate(site)
site.pages.each { |page| mentionify page if html_page?(page) }
- site.posts.each { |page| mentionify post }
+ site.posts.each { |post| mentionify post }
site.docs_to_write.each { |doc| mentionify doc }
end
| Correct error in var name |
diff --git a/make-sponsors.rb b/make-sponsors.rb
index abc1234..def5678 100644
--- a/make-sponsors.rb
+++ b/make-sponsors.rb
@@ -0,0 +1,19 @@+require "yaml"
+print "Enter the event in YYYY-city format: "
+cityname = gets.chomp
+config = YAML.load_file("data/events/#{cityname}.yml")
+sponsors = config['sponsors']
+sponsors.each {|s|
+ if File.exist?("data/sponsors/#{s['id']}.yml")
+ puts "The file for #{s['id']} totally exists already"
+ else
+ puts "I need to make a file for #{s['id']}"
+ puts "What is the sponsor URL?"
+ sponsor_url = gets.chomp
+ sponsorfile = File.open("data/sponsors/#{s['id']}.yml", "w")
+ sponsorfile.write "name: #{s['id']}\n"
+ sponsorfile.write "url: #{sponsor_url}\n"
+ sponsorfile.close
+ puts "It will be data/sponsors/#{s['id']}.yml"
+ end
+}
| Create script for generating sponsor files
This ruby script basically reads in a city config file and creates the sponsor file associated with it. It will NOT create the images, naturally, but this will make it somewhat easier.
Former-commit-id: 4c9503f6a12b3c0eac0eb1e4610acd20acce7c8c |
diff --git a/config/unicorn.rb b/config/unicorn.rb
index abc1234..def5678 100644
--- a/config/unicorn.rb
+++ b/config/unicorn.rb
@@ -29,7 +29,7 @@
class Unicorn::HttpServer # rubocop:disable ClassAndModuleChildren
def proc_name(tag)
- $0 = ([File.basename(START_CTX[0]), 'saml',
- tag]).concat(START_CTX[:argv]).join(' ')
+ $0 = [File.basename(START_CTX[0]), 'saml',
+ tag].concat(START_CTX[:argv]).join(' ')
end
end
| Update configs to latest Rubocop specification
|
diff --git a/lib/paml/node/noisy.rb b/lib/paml/node/noisy.rb
index abc1234..def5678 100644
--- a/lib/paml/node/noisy.rb
+++ b/lib/paml/node/noisy.rb
@@ -1,6 +1,7 @@ module Paml
class Node
- class Noisy < Node
+ # I pretend that any content passed to me is PHP, and I echo it.
+ class Noisy < Lonely
def initialize options = {}
super options
@intro = "<?php echo #{options[:content] || ""}; ?>"
| Make the Noisy node a descendent of Lonely
Noisy nodes shouldn't have any children.
|
diff --git a/base/lib/social_stream/population/activity_object.rb b/base/lib/social_stream/population/activity_object.rb
index abc1234..def5678 100644
--- a/base/lib/social_stream/population/activity_object.rb
+++ b/base/lib/social_stream/population/activity_object.rb
@@ -5,7 +5,7 @@ puts "#{ klass.name } population"
start_time = Time.now
- 50.times do
+ 10.times do
author = Actor.all[rand(Actor.all.size)]
owner = author
relation_ids = [Relation::Public.instance.id]
| Decrease public object population number
|
diff --git a/lib/gem_release/gemspec.rb b/lib/gem_release/gemspec.rb
index abc1234..def5678 100644
--- a/lib/gem_release/gemspec.rb
+++ b/lib/gem_release/gemspec.rb
@@ -7,7 +7,7 @@
@authors ||= [user_name]
@email ||= user_email
- @homepage ||= "http://github.com/#{github_user}/#{name}" || "[your github name]"
+ @homepage ||= "https://github.com/#{github_user}/#{name}" || "[your github name]"
@summary ||= '[summary]'
@description ||= '[description]'
| Use https for github homepage.
github uses https for everything nowadays. |
diff --git a/yard-chef.gemspec b/yard-chef.gemspec
index abc1234..def5678 100644
--- a/yard-chef.gemspec
+++ b/yard-chef.gemspec
@@ -13,9 +13,7 @@ gem.add_runtime_dependency 'yard', '~> 0.8'
gem.add_runtime_dependency 'redcarpet', '~> 2.1.1'
- gem.files = Dir.glob('templates/**/*.erb')
- gem.files += Dir.glob('templates/**/*.rb')
- gem.files += Dir.glob('templates/**/*.css')
+ gem.files = Dir.glob('templates/**/*.{erb,rb,css,js}')
gem.files += Dir.glob('lib/**/*.rb')
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
| Add js templates to gemspec for gem packaging
|
diff --git a/lib/resume/pdf/font.rb b/lib/resume/pdf/font.rb
index abc1234..def5678 100644
--- a/lib/resume/pdf/font.rb
+++ b/lib/resume/pdf/font.rb
@@ -1,8 +1,19 @@ module Resume
+ # Namespace for all parts and functionality of the resume
+ # PDF document.
+ #
+ # @author Paul Fioravanti
module PDF
+ # Module for configuration of fonts to use in the resume PDF document
+ #
+ # @author Paul Fioravanti
module Font
module_function
+ # Configures the PDF font.
+ #
+ # @param pdf [Prawn::Document] The PDF to configure the font for.
+ # @param font [Hash] Determines which font is needed for the PDF.
def configure(pdf, font)
# Accented characters will bring up a
# warning that we don't care about
| Document PDF module and Font module
|
diff --git a/lib/tasks/kinesis.rake b/lib/tasks/kinesis.rake
index abc1234..def5678 100644
--- a/lib/tasks/kinesis.rake
+++ b/lib/tasks/kinesis.rake
@@ -7,7 +7,7 @@ prefix: ENV['KINESIS_STREAM_PREFIX'] || ''
)
- stream.run! do |record, kind|
+ stream.run!(batch_size: Integer(ENV['KINESIS_BATCH_SIZE'] || StreamReader::DEFAULT_BATCH_SIZE)) do |record, kind|
CreateEventFromStream.call(record: record, kind: kind.underscore)
end
end
| Make batch size an ENV var
|
diff --git a/lib/yarn/error_page.rb b/lib/yarn/error_page.rb
index abc1234..def5678 100644
--- a/lib/yarn/error_page.rb
+++ b/lib/yarn/error_page.rb
@@ -4,7 +4,7 @@
def serve_404_page
@response.status = 404
- @response.body = ["<html><head><title>404</title></head><body><h1>File does not exist.</h1></body><html>"]
+ @response.body = ["<html><head><title>404</title></head><body><h1>File: #{@request[:uri][:path]} does not exist.</h1></body><html>"]
end
def serve_500_page
| Include filename in 404 message
|
diff --git a/lib/classless_mud.rb b/lib/classless_mud.rb
index abc1234..def5678 100644
--- a/lib/classless_mud.rb
+++ b/lib/classless_mud.rb
@@ -3,12 +3,17 @@ require "classless_mud/version"
class Game
- def initialize player
- @player = player
+ def initialize
+ @players = []
end
- def start
- @player.handle_message "game starting"
+ def add_player player
+ @players << player
+ self.start_game_for player
+ end
+
+ def start_game_for player
+ player.handle_message "game starting"
end
end
@@ -26,6 +31,7 @@ module ClasslessMud
server = TCPServer.new 2000
+ game = Game.new
puts "Starting server on port 2000"
loop do
Thread.start(server.accept) do |client|
@@ -34,9 +40,7 @@ client.puts name
player = Player.new client, name
client.puts player
- game = Game.new player
- client.puts game
- game.start
+ game.add_player player
end
end
end
| Change it so there is only one game instance
Players are added to the one game rather than creating new game
instances
|
diff --git a/plugins/guests/freebsd/cap/change_host_name.rb b/plugins/guests/freebsd/cap/change_host_name.rb
index abc1234..def5678 100644
--- a/plugins/guests/freebsd/cap/change_host_name.rb
+++ b/plugins/guests/freebsd/cap/change_host_name.rb
@@ -4,7 +4,7 @@ class ChangeHostName
def self.change_host_name(machine, name)
if !machine.communicate.test("hostname -f | grep '^#{name}$' || hostname -s | grep '^#{name}$'", {shell: "sh"})
- machine.communicate.sudo("sed -i '' 's/^hostname=.*$/hostname=#{name}/' /etc/rc.conf", {shell: "sh"})
+ machine.communicate.sudo("sed -i '' 's/^hostname=.*$/hostname=\"#{name}\"/' /etc/rc.conf", {shell: "sh"})
machine.communicate.sudo("hostname #{name}", {shell: "sh"})
end
end
| FreeBSD: Use quotes around hostname in rc.conf
Use double quotes around the hostname value in /etc/rc.conf
|
diff --git a/lib/cucumber/core.rb b/lib/cucumber/core.rb
index abc1234..def5678 100644
--- a/lib/cucumber/core.rb
+++ b/lib/cucumber/core.rb
@@ -15,11 +15,11 @@ self
end
- def compile(gherkin_documents, receiver, filters = [])
- filters.each do |filter_type, args|
- receiver = filter_type.new(*args + [receiver])
+ def compile(gherkin_documents, last_receiver, filters = [])
+ first_receiver = filters.reduce(last_receiver) do |receiver, (filter_type, args)|
+ filter_type.new(*args + [receiver])
end
- compiler = Compiler.new(receiver)
+ compiler = Compiler.new(first_receiver)
parse gherkin_documents, compiler
self
end
| Use more functional style in building filter chain
Thanks @dchelimsky
|
diff --git a/spec/hacklet/serial_connection_spec.rb b/spec/hacklet/serial_connection_spec.rb
index abc1234..def5678 100644
--- a/spec/hacklet/serial_connection_spec.rb
+++ b/spec/hacklet/serial_connection_spec.rb
@@ -19,10 +19,10 @@ it 'is successful' do
serial_port = mock('SerialPort')
serial_port.should_receive(:flow_control=)
- serial_port.should_receive(:write).with("\x02\xA26\x04\xFC\xFF\x00\x01\x92")
+ serial_port.should_receive(:write).with([0x02, 0x40, 0x04, 0x00, 0x44].pack('c*'))
SerialPort.should_receive(:new).and_return(serial_port)
- subject.transmit(Hacklet::LockRequest.new)
+ subject.transmit(Hacklet::BootRequest.new)
end
end
| Write specs using hex for compatibility
|
diff --git a/vendor/cookbooks/rails/metadata.rb b/vendor/cookbooks/rails/metadata.rb
index abc1234..def5678 100644
--- a/vendor/cookbooks/rails/metadata.rb
+++ b/vendor/cookbooks/rails/metadata.rb
@@ -5,6 +5,7 @@ description "Installs/Configures rails"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.2.0"
+depends "rbenv", "~> 1.7.1"
depends "sudo", "> 1.2.0"
depends "database"
depends "nginx"
| Add rbenv dependency to rails cookbook
|
diff --git a/lib/grit/ext/diff.rb b/lib/grit/ext/diff.rb
index abc1234..def5678 100644
--- a/lib/grit/ext/diff.rb
+++ b/lib/grit/ext/diff.rb
@@ -12,11 +12,11 @@ end
def full_a_path
- File.join(repo.working_dir, a_path)
+ full(a_path)
end
def full_b_path
- File.join(repo.working_dir, b_path)
+ full(b_path)
end
def added
@@ -33,6 +33,10 @@ hunks.collect { |h| yield(h) }.flatten
end
+ def full(path)
+ File.join(repo.working_dir, path)
+ end
+
def lines
@lines ||= diff.split("\n")
end
| Remove duplication of full_a_path and full_b_path methods
|
diff --git a/lib/react/rails/railtie.rb b/lib/react/rails/railtie.rb
index abc1234..def5678 100644
--- a/lib/react/rails/railtie.rb
+++ b/lib/react/rails/railtie.rb
@@ -5,7 +5,7 @@ class Railtie < ::Rails::Railtie
config.react = ActiveSupport::OrderedOptions.new
- initializer "react_rails.setup_vendor", :after => "sprockets.environment" do |app|
+ initializer "react_rails.setup_vendor", :after => "sprockets.environment", group: :all do |app|
variant = app.config.react.variant
# Mimic behavior of ember-rails...
| improv: Initialize assets for all groups
|
diff --git a/lib/sicuro/reader.rb b/lib/sicuro/reader.rb
index abc1234..def5678 100644
--- a/lib/sicuro/reader.rb
+++ b/lib/sicuro/reader.rb
@@ -1,9 +1,9 @@ class Sicuro
# :nodoc:
# Copies data from one IO-like object to another.
- class Reader
- def self.new(from, to)
- Thread.new(from, to) do |from, to|
+ class Reader < Thread
+ def initialize(from, to)
+ super(from, to) do |from, to|
ret = ''
until from.eof?
@@ -24,9 +24,9 @@ # Stops copying when $done is true.
#
# TODO: Make more generic? (Can this be merged into +reader+?)
- class RewindingReader
- def self.new(from, to)
- Thread.new(from, to) do
+ class RewindingReader < Thread
+ def initialize(from, to)
+ super(from, to) do
ret = ''
pos = 0
| Clean up Reader and RewindingReader.
|
diff --git a/lib/split/version.rb b/lib/split/version.rb
index abc1234..def5678 100644
--- a/lib/split/version.rb
+++ b/lib/split/version.rb
@@ -1,8 +1,5 @@ # frozen_string_literal: true
module Split
- MAJOR = 3
- MINOR = 4
- PATCH = 1
- VERSION = [MAJOR, MINOR, PATCH].join('.')
+ VERSION = "4.0.0.pre"
end
| Set main branch as 4.0.0.pre
|
diff --git a/lib/stepdown/step.rb b/lib/stepdown/step.rb
index abc1234..def5678 100644
--- a/lib/stepdown/step.rb
+++ b/lib/stepdown/step.rb
@@ -18,5 +18,8 @@ self.id == other.id
end
+ def to_s
+ regex.inspect.to_s
+ end
end
-end+end
| Add sensible to_s to Step
|
diff --git a/event-reporting-handler.gemspec b/event-reporting-handler.gemspec
index abc1234..def5678 100644
--- a/event-reporting-handler.gemspec
+++ b/event-reporting-handler.gemspec
@@ -21,5 +21,5 @@ spec.add_development_dependency 'rake', '~> 10.0'
spec.add_development_dependency 'rspec'
- spec.add_runtime_dependency 'sentry-raven', '~> 0.15.2'
+ spec.add_runtime_dependency 'sentry-raven', '~> 0.9.4'
end
| Fix sentry raven version in dependency
|
diff --git a/cookbooks/wt_heatmaps/recipes/apiserver.rb b/cookbooks/wt_heatmaps/recipes/apiserver.rb
index abc1234..def5678 100644
--- a/cookbooks/wt_heatmaps/recipes/apiserver.rb
+++ b/cookbooks/wt_heatmaps/recipes/apiserver.rb
@@ -7,7 +7,8 @@ # All rights reserved - Do Not Redistribute
#
-package "heatmaps_#{node['wt_heatmaps']['heatmaps_version']}_amd64.deb" do
+package "heatmaps" do
+ version "#{node['wt_heatmaps']['heatmaps_version']}"
action :install
end
| Fix package resource for wt_heatmaps to actually install
Former-commit-id: 19388ce6131744f45fb33c45adaa58f9584070f5 [formerly 582a6e63ccf7386a01418923038542e2a7523fde] [formerly a056bed97691d8edbeb921383be768afc016d8bf [formerly c0c1a7c7b48512549f03f52f79b1ad24eae5e713]]
Former-commit-id: 68eedacadd84973f3be8a4975e28a48e6e14d24f [formerly 16c6606a8080b9afbef04f028f81276cb271ba58]
Former-commit-id: d257e082e2d5d159ad2732c3ec584c75c1cc8a67 |
diff --git a/test/isolated/test_mimic_single.rb b/test/isolated/test_mimic_single.rb
index abc1234..def5678 100644
--- a/test/isolated/test_mimic_single.rb
+++ b/test/isolated/test_mimic_single.rb
@@ -19,11 +19,10 @@
begin
require('json_spec')
+ assert(false, '** should raise LoadError')
rescue LoadError
assert(true)
- return
end
- assert(false, '** should raise LoadError')
# Make sure to_json is define for object.
{'a' => 1}.to_json()
| Improve $LOADED_FEATURES: do not mess with return
|
diff --git a/spec/dummy/config/initializers/secret_token.rb b/spec/dummy/config/initializers/secret_token.rb
index abc1234..def5678 100644
--- a/spec/dummy/config/initializers/secret_token.rb
+++ b/spec/dummy/config/initializers/secret_token.rb
@@ -4,4 +4,4 @@ # If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
-Dummy::Application.config.secret_token = '7d56424b85d69ed2b9baec67295bfa3ddf7bc6be60e10a72acc7f73ac06e584572aeb5db3db6eaa8cdfe591e445f8ba0c748aded452b643f098d88d911a82022'
+Dummy::Application.config.secret_key_base = '7d56424b85d69ed2b9baec67295bfa3ddf7bc6be60e10a72acc7f73ac06e584572aeb5db3db6eaa8cdfe591e445f8ba0c748aded452b643f098d88d911a82022' | Fix last warning about secret_key_base (Rails 4)
|
diff --git a/spec/models/concerns/user/completeness_spec.rb b/spec/models/concerns/user/completeness_spec.rb
index abc1234..def5678 100644
--- a/spec/models/concerns/user/completeness_spec.rb
+++ b/spec/models/concerns/user/completeness_spec.rb
@@ -21,7 +21,7 @@ end
context 'when the profile type is channel' do
- let(:user) { create(:channel, name: 'Some Channel', description: 'Some other text here', user: create(:user, other_url: nil, address: 'Kansas City, MO', profile_type: 'channel')).user }
+ let(:user) { create(:channel, name: 'Some Channel', description: 'Some other text here', user: create(:user, name: nil, other_url: nil, address: 'Kansas City, MO', profile_type: 'channel')).user.reload }
it 'completeness progress should be 42' do
expect(subject).to eq 42
| Fix spec completeness user concern spec
|
diff --git a/spec/requests/api/json/layer_presenter_spec.rb b/spec/requests/api/json/layer_presenter_spec.rb
index abc1234..def5678 100644
--- a/spec/requests/api/json/layer_presenter_spec.rb
+++ b/spec/requests/api/json/layer_presenter_spec.rb
@@ -4,7 +4,7 @@ require_relative '../../../../app/models/layer/presenter'
require_relative 'layer_presenter_shared_examples'
-describe Api::Json::LayersController do
+describe CartoDB::LayerModule::Presenter do
# Old presenter, old model
it_behaves_like 'layer presenters', CartoDB::LayerModule::Presenter, ::Layer
end
| Fix layer presenter spec the right way (tm)
|
diff --git a/spec/support/pages/fragments/phase_fragment.rb b/spec/support/pages/fragments/phase_fragment.rb
index abc1234..def5678 100644
--- a/spec/support/pages/fragments/phase_fragment.rb
+++ b/spec/support/pages/fragments/phase_fragment.rb
@@ -24,7 +24,6 @@ container = find('.add-column', visible: false)
container.hover
find('.add-column', visible: false).click
- sleep(0.3)
end
def remove_phase
| Remove sleep after adding phases. |
diff --git a/AlgoliaSearch-Offline-Swift.podspec b/AlgoliaSearch-Offline-Swift.podspec
index abc1234..def5678 100644
--- a/AlgoliaSearch-Offline-Swift.podspec
+++ b/AlgoliaSearch-Offline-Swift.podspec
@@ -10,7 +10,7 @@
s.ios.deployment_target = '8.0'
- s.dependency 'AlgoliaSearchOfflineCore-iOS', '0.1'
+ s.dependency 'AlgoliaSearchOfflineCore-iOS', '~> 0.2'
# Activate Core-dependent code.
# WARNING: Specifying the preprocessor macro is not enough; it must be added to Swift flags as well.
| [offline] Upgrade to OfflineCore version 0.2
Also introduced the optimistic version operator, to avoid being stuck on an obsolete version.
[ci skip] |
diff --git a/spec/adminable/configuration_spec.rb b/spec/adminable/configuration_spec.rb
index abc1234..def5678 100644
--- a/spec/adminable/configuration_spec.rb
+++ b/spec/adminable/configuration_spec.rb
@@ -7,4 +7,22 @@ expect(resources.map(&:name)).to eq(%w(blog/comments blog/posts users))
end
end
+
+ describe '#redirect_root_path' do
+ describe 'if resources exists' do
+ it 'returns first resource url' do
+ expect(Adminable::Configuration.redirect_root_path).to eq(
+ 'blog/comments'
+ )
+ end
+ end
+
+ describe 'if no resources exists' do
+ it 'returns main app root path' do
+ allow(Adminable::Configuration).to receive(:resources).and_return([])
+
+ expect(Adminable::Configuration.redirect_root_path).to eq('/')
+ end
+ end
+ end
end
| Add spec for configuration redirect_root_path method
|
diff --git a/spec/features/admin/sign_out_spec.rb b/spec/features/admin/sign_out_spec.rb
index abc1234..def5678 100644
--- a/spec/features/admin/sign_out_spec.rb
+++ b/spec/features/admin/sign_out_spec.rb
@@ -16,7 +16,7 @@ scenario 'allows a signed in user to logout' do
click_link 'Logout'
visit spree.admin_login_path
- expect(page).to have_text 'Login'
+ expect(page).to have_button 'Login'
expect(page).not_to have_text 'Logout'
end
end
| Fix allows a signed in user to logout spec
|
diff --git a/routes/stars/get_images.rb b/routes/stars/get_images.rb
index abc1234..def5678 100644
--- a/routes/stars/get_images.rb
+++ b/routes/stars/get_images.rb
@@ -25,7 +25,7 @@
profile = Fbstarsprofile.get(id)
- images = Starsgcsimage.all(limit: 10) -
+ images = Starsgcsimage.all(limit: 10, order: [:created_at.desc]) -
Starsgcsimage.all(Starsgcsimage.starsimagevote.starsupvotes
.starsvote.fbstarsprofile.id => id)
| Change order for next images route
|
diff --git a/lib/ci/reporter/test_utils/accessor.rb b/lib/ci/reporter/test_utils/accessor.rb
index abc1234..def5678 100644
--- a/lib/ci/reporter/test_utils/accessor.rb
+++ b/lib/ci/reporter/test_utils/accessor.rb
@@ -4,12 +4,28 @@ class Accessor
attr_reader :root
+ Failure = Struct.new(:xml) do
+ def type
+ xml.attributes['type']
+ end
+ end
+
+ Testcase = Struct.new(:xml) do
+ def name
+ xml.attributes['name']
+ end
+
+ def failures
+ xml.elements.to_a('failure').map {|f| Failure.new(f) }
+ end
+ end
+
def initialize(xml)
@root = xml.root
end
def failures
- root.elements.to_a("/testsuite/testcase/failure")
+ root.elements.to_a("/testsuite/testcase/failure").map {|f| Failure.new(f) }
end
def errors
@@ -17,7 +33,11 @@ end
def testcases
- root.elements.to_a("/testsuite/testcase")
+ root.elements.to_a("/testsuite/testcase").map {|tc| Testcase.new(tc) }
+ end
+
+ def testcase(name)
+ testcases.select {|tc| tc.name == name }.first
end
[:failures, :errors, :skipped, :assertions, :tests].each do |attr|
| Add structure to returned testcases / failures
|
diff --git a/lib/compass-magick/commands/filters.rb b/lib/compass-magick/commands/filters.rb
index abc1234..def5678 100644
--- a/lib/compass-magick/commands/filters.rb
+++ b/lib/compass-magick/commands/filters.rb
@@ -1,7 +1,7 @@ module Compass::Magick::Commands::Filters
class Grayscale < Compass::Magick::Command
def invoke(image)
- image.quantize(256, Magick::GRAYColorspace, Magick::NoDitherMethod)
+ image.modulate(1.0, 0.0, 1.0)
end
end
end
| Use Magick::modulate instead of Magick::quantize as the latter has issues with transparent PNGs.
|
diff --git a/lib/integrity/helpers/authorization.rb b/lib/integrity/helpers/authorization.rb
index abc1234..def5678 100644
--- a/lib/integrity/helpers/authorization.rb
+++ b/lib/integrity/helpers/authorization.rb
@@ -8,11 +8,8 @@ end
def authorized?
- unless Integrity.config.protected?
- return true
- end
-
- !!request.env["REMOTE_USER"]
+ !!request.env["REMOTE_USER"] ||
+ authorize(*auth.credentials) if auth.provided?
end
def authorize(user, password)
| Allow users to see full list of projects if they has
been logged in and browser session is alive. |
diff --git a/config/initializers/rails_3_4_flash_compatibility.rb b/config/initializers/rails_3_4_flash_compatibility.rb
index abc1234..def5678 100644
--- a/config/initializers/rails_3_4_flash_compatibility.rb
+++ b/config/initializers/rails_3_4_flash_compatibility.rb
@@ -0,0 +1,46 @@+# Taken from:
+# https://gist.github.com/henrik/bb6732d5d4cddb5085a4
+
+# The way the flash is stored in the session changed in a backwards-incompatible way.
+
+if Rails::VERSION::MAJOR == 3
+ module ActionDispatch
+ class Flash
+ def call(env)
+ if (session = env["rack.session"]) && (flash = session["flash"])
+
+ # Beginning of change!
+
+ if flash.respond_to?(:sweep)
+ flash.sweep
+ else
+ session.delete("flash")
+ end
+
+ # End of change!
+
+ end
+
+ @app.call(env)
+ ensure
+ session = env["rack.session"] || {}
+ flash_hash = env[KEY]
+
+ if flash_hash
+ if !flash_hash.empty? || session.key?("flash")
+ session["flash"] = flash_hash
+ new_hash = flash_hash.dup
+ else
+ new_hash = flash_hash
+ end
+
+ env[KEY] = new_hash
+ end
+
+ if session.key?("flash") && session["flash"].empty?
+ session.delete("flash")
+ end
+ end
+ end
+ end
+end
| Make Rails's flash messages work across both apps
While this app is deployed alongside the rebuild, there
are cases when a user is redirected to a page on the
other app with a flash message.
When Rails 4 was released, they changed the interface for
flash messages and this broke compatibility. This
initializer fixes it.
|
diff --git a/lib/sastrawi/stemmer/context/visitor/remove_derivational_suffix.rb b/lib/sastrawi/stemmer/context/visitor/remove_derivational_suffix.rb
index abc1234..def5678 100644
--- a/lib/sastrawi/stemmer/context/visitor/remove_derivational_suffix.rb
+++ b/lib/sastrawi/stemmer/context/visitor/remove_derivational_suffix.rb
@@ -1,4 +1,9 @@ require 'sastrawi/stemmer/context/removal'
+
+##
+# Remove derivational suffix
+# Asian J. (2007) "Effective Techniques for Indonesian Text Retrieval" page 61
+# http://researchbank.rmit.edu.au/eserv/rmit:6312/Asian.pdf
module Sastrawi
module Stemmer
@@ -18,6 +23,10 @@ end
end
+ ##
+ # Original rule: i|kan|an
+ # Added the adopted foreign suffix rule: is|isme|isasi
+
def remove_suffix(word)
word.sub(/(is|isme|isasi|i|kan|an)$/, '')
end
| Add comments to "RemoveDerivationalSuffix" class
|
diff --git a/spec/open_weather/version_spec.rb b/spec/open_weather/version_spec.rb
index abc1234..def5678 100644
--- a/spec/open_weather/version_spec.rb
+++ b/spec/open_weather/version_spec.rb
@@ -1,7 +1,7 @@ require 'spec_helper'
describe "Version" do
- it "should be version 0.9.1" do
- OpenWeather::VERSION.should == "0.9.1"
+ it "should be version 0.9.2" do
+ OpenWeather::VERSION.should == "0.9.2"
end
end
| Test to ensure that the version has not changed.
|
diff --git a/spec/policies/hero_policy_spec.rb b/spec/policies/hero_policy_spec.rb
index abc1234..def5678 100644
--- a/spec/policies/hero_policy_spec.rb
+++ b/spec/policies/hero_policy_spec.rb
@@ -0,0 +1,59 @@+require 'rails_helper'
+require 'pundit/rspec'
+
+RSpec.describe HeroPolicy do
+ subject { described_class }
+ let(:user) { create(:user) }
+ let(:other_member) { create(:user) }
+ let(:campaign) { build(:campaign, users: [user, other_member]) }
+ let(:hero) { build(:hero, user: user, campaign: campaign) }
+
+ permissions :edit? do
+ describe 'user is a member of campaign' do
+ context 'user owns hero' do
+ before { hero.user_character = true }
+ it 'allows user to edit hero' do
+ expect(subject).to permit(user, hero)
+ end
+ it 'denies another member to edit hero' do
+ expect(subject).to_not permit(other_member, hero)
+ end
+ end
+ context 'hero is NPC and all members can edit' do
+ before { hero.user_character = false }
+ it 'allows user to edit hero' do
+ expect(subject).to permit(user, hero)
+ end
+ it 'allows other member of campaign to edit hero' do
+ expect(subject).to permit(other_member, hero)
+ end
+ end
+ end
+ end
+ permissions :new? do
+ context 'user is a member of campaign' do
+ it 'grants access' do
+ expect(subject).to permit(user, hero)
+ end
+ end
+ context 'user is not a member of campaign' do
+ let(:user_not_member) { build(:user) }
+ it 'denies access' do
+ expect(subject).to_not permit(user_not_member, hero)
+ end
+ end
+ end
+ permissions :create? do
+ context 'user is a member of campaign' do
+ it 'grants access' do
+ expect(subject).to permit(user, hero)
+ end
+ end
+ context 'user is not a member of campaign' do
+ let(:user_not_member) { build(:user) }
+ it 'denies access' do
+ expect(subject).to_not permit(user_not_member, hero)
+ end
+ end
+ end
+end
| Add specs for edit?, new? and create? hero policies
|
diff --git a/Formula/gource.rb b/Formula/gource.rb
index abc1234..def5678 100644
--- a/Formula/gource.rb
+++ b/Formula/gource.rb
@@ -21,6 +21,9 @@ ENV.x11
ENV.prepend 'PATH', "/usr/X11/bin", ":"
+ # For non-/usr/local installs
+ ENV.append "CXXFLAGS", "-I#{HOMEBREW_PREFIX}/include"
+
system "autoreconf -f -i" unless File.exist? "configure"
system "./configure", "--disable-dependency-tracking",
| Fix Gource for non-/usr/local installs.
|
diff --git a/shared/json_convertible.rb b/shared/json_convertible.rb
index abc1234..def5678 100644
--- a/shared/json_convertible.rb
+++ b/shared/json_convertible.rb
@@ -20,7 +20,7 @@ #
# ignore_instance_variables: [:@project, :@something_else]
#
- def to_object_dictionary(ignore_instance_variables: nil)
+ def to_object_dictionary(ignore_instance_variables: [])
object_hash = {}
self.instance_variables.each do |var|
next if ignore_instance_variables.include?(var)
| Add default value for ignore_instance_variables |
diff --git a/cldr-plurals-runtime-rb.gemspec b/cldr-plurals-runtime-rb.gemspec
index abc1234..def5678 100644
--- a/cldr-plurals-runtime-rb.gemspec
+++ b/cldr-plurals-runtime-rb.gemspec
@@ -7,6 +7,7 @@ s.authors = ["Cameron Dutro"]
s.email = ["camertron@gmail.com"]
s.homepage = "http://github.com/camertron"
+ s.license = "MIT"
s.description = s.summary = 'Ruby runtime methods for CLDR plural rules (see camertron/cldr-plurals).'
| Add license info to the gemspec. |
diff --git a/recipes/upstart_service.rb b/recipes/upstart_service.rb
index abc1234..def5678 100644
--- a/recipes/upstart_service.rb
+++ b/recipes/upstart_service.rb
@@ -9,12 +9,9 @@ node.default['chef_client']['bin'] = client_bin
create_chef_directories
-upstart_job_dir = '/etc/init'
-upstart_job_suffix = '.conf'
-
-template "#{upstart_job_dir}/chef-client#{upstart_job_suffix}" do
+template "/etc/init/chef-client.conf" do
source 'debian/init/chef-client.conf.erb'
- mode '644'
+ mode '0644'
variables(
client_bin: client_bin
)
| Remove upstart variables we only use in 1 place
Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
|
diff --git a/app/controllers/payments_controller.rb b/app/controllers/payments_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/payments_controller.rb
+++ b/app/controllers/payments_controller.rb
@@ -1,4 +1,6 @@ class PaymentsController < ApplicationController
+ skip_before_action :verify_authenticity_token
+
def create
conn = ActiveRecord::Base.connection
query = ActiveRecord::Base.send(:sanitize_sql_array, ["INSERT INTO raw_payments_data (data) VALUES (?)", request.raw_post])
| Disable CSRF verification in PaymentsController
|
diff --git a/spec/sisimai/lhost_spec.rb b/spec/sisimai/lhost_spec.rb
index abc1234..def5678 100644
--- a/spec/sisimai/lhost_spec.rb
+++ b/spec/sisimai/lhost_spec.rb
@@ -19,7 +19,10 @@ it('returns Array') { expect(Sisimai::Lhost.index).to be_a Array }
it('is not empty' ) { expect(Sisimai::Lhost.index.size).to be > 0 }
end
-
+ describe '.path' do
+ it('returns Hash') { expect(Sisimai::Lhost.path).to be_a Hash }
+ it('is not empty' ) { expect(Sisimai::Lhost.path.size).to be > 0 }
+ end
describe '.make' do
it('returns nil') { expect(Sisimai::Lhost.make).to be nil }
end
| Add test code for fb7aa1b
|
diff --git a/Casks/java6.rb b/Casks/java6.rb
index abc1234..def5678 100644
--- a/Casks/java6.rb
+++ b/Casks/java6.rb
@@ -1,6 +1,6 @@ cask :v1 => 'java6' do
version '1.6.0_65'
- sha256 '1b7b88c7c7ca3a1c50eacee1977dee974a50157ff7c88d0e73902bd98fc58a86'
+ sha256 '8f40dbf821e21410feab4d9e2e533c42518897b7cac5edfad895e91016f918fc'
url 'https://support.apple.com/downloads/DL1572/en_US/javaforosx.dmg'
homepage 'https://support.apple.com/kb/DL1572'
| Fix SHA256 of Java6 Cask |
diff --git a/TATLayout.podspec b/TATLayout.podspec
index abc1234..def5678 100644
--- a/TATLayout.podspec
+++ b/TATLayout.podspec
@@ -11,4 +11,5 @@ s.platform = :ios, "6.0"
s.ios.deployment_target = "6.0"
s.source_files = "TATLayout/TATLayout/*.{h,m}"
+ s.public_header_files = 'TATLayout/TATLayout/*.h'
end
| Add public header files setting
|
diff --git a/clock.gemspec b/clock.gemspec
index abc1234..def5678 100644
--- a/clock.gemspec
+++ b/clock.gemspec
@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
s.name = 'clock'
s.summary = 'Clock interface with support for dependency configuration for real and null object implementations'
- s.version = '0.0.1.4'
+ s.version = '0.0.2.0'
s.description = ' '
s.authors = ['Obsidian Software, Inc']
| Package version increased from 0.0.1.4 to 0.0.2.0
|
diff --git a/config/deploy/production.rb b/config/deploy/production.rb
index abc1234..def5678 100644
--- a/config/deploy/production.rb
+++ b/config/deploy/production.rb
@@ -2,5 +2,4 @@ # ======================
# server "example.com", user: "deploy", roles: %w{app db web}, my_property: :my_value
-server 'vps', roles: %w[app db web]
-
+server 'vps', user: 'deploy', roles: %w[app db web]
| Set deploy user for prod
|
diff --git a/lib/sastrawi/stemmer/context/visitor/prefix_disambiguator.rb b/lib/sastrawi/stemmer/context/visitor/prefix_disambiguator.rb
index abc1234..def5678 100644
--- a/lib/sastrawi/stemmer/context/visitor/prefix_disambiguator.rb
+++ b/lib/sastrawi/stemmer/context/visitor/prefix_disambiguator.rb
@@ -6,6 +6,8 @@ attr_accessor :disambiguators
def initialize(disambiguators = [])
+ @disambiguators = []
+
add_disambiguators(disambiguators)
end
@@ -13,17 +15,17 @@ result = nil
@disambiguators.each do |disambiguator|
- result = disambiguator.disambiguate(context.get_current_word)
+ result = disambiguator.disambiguate(context.current_word)
- next if context.get_dictionary.include?(result)
+ next if context.dictionary.include?(result)
end
return if result.nil?
end
- def add_disambiguators(disambiguators = [])
+ def add_disambiguators(disambiguators)
disambiguators.each do |disambiguator|
- self.add_disambiguator(disambiguator)
+ add_disambiguator(disambiguator)
end
end
| Fix implementation of "PrefixDisambiguator" class
Changes:
- Initialize a new array when object is initialized.
- Fix getting attributes from other classes.
|
diff --git a/features/build/build_controller.rb b/features/build/build_controller.rb
index abc1234..def5678 100644
--- a/features/build/build_controller.rb
+++ b/features/build/build_controller.rb
@@ -21,7 +21,11 @@ build_number: build_number
)
- raise "Couldn't find build runner for project #{project_id} with build_number #{build_number}" if current_build_runner.nil?
+ if current_build_runner.nil?
+ # Loading the output of a finished build after a server restart isn't finished yet
+ # see https://github.com/fastlane/ci/issues/312 for more information
+ raise "Couldn't find build runner for project #{project_id} with build_number #{build_number}"
+ end
locals = {
project: project,
| Add link to GH issue to track progress of build loading
Related https://github.com/fastlane/ci/issues/312 |
diff --git a/lib/vcr/extensions/net_http_response.rb b/lib/vcr/extensions/net_http_response.rb
index abc1234..def5678 100644
--- a/lib/vcr/extensions/net_http_response.rb
+++ b/lib/vcr/extensions/net_http_response.rb
@@ -1,16 +1,16 @@-# A Net::HTTP response that has already been read raises an IOError when #read_body
-# is called with a destination string or block.
-#
-# This causes a problem when VCR records a response--it reads the body before yielding
-# the response, and if the code that is consuming the HTTP requests uses #read_body, it
-# can cause an error.
-#
-# This is a bit of a hack, but it allows a Net::HTTP response to be "re-read"
-# after it has aleady been read. This attemps to preserve the behavior of
-# #read_body, acting just as if it had never been read.
-
module VCR
module Net
+ # A Net::HTTP response that has already been read raises an IOError when #read_body
+ # is called with a destination string or block.
+ #
+ # This causes a problem when VCR records a response--it reads the body before yielding
+ # the response, and if the code that is consuming the HTTP requests uses #read_body, it
+ # can cause an error.
+ #
+ # This is a bit of a hack, but it allows a Net::HTTP response to be "re-read"
+ # after it has aleady been read. This attemps to preserve the behavior of
+ # #read_body, acting just as if it had never been read.
+ # @private
module HTTPResponse
def self.extended(response)
response.instance_variable_set(:@__read_body_previously_called, false)
| Move comment so its not picked up by yard as the VCR overview.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.