diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/app/api/v0/entities.rb b/app/api/v0/entities.rb
index abc1234..def5678 100644
--- a/app/api/v0/entities.rb
+++ b/app/api/v0/entities.rb
@@ -16,7 +16,9 @@ is_child = lambda {|instance, options| options[:type] == :child}
is_parent = lambda {|instance, options| options[:type] == :parent}
- expose :id
+ expose :id do |instance, options|
+ instance.id.split('/').last
+ end
expose :name
expose :classification
expose :jurisdiction_id
@@ -34,14 +36,18 @@ end
class People < Grape::Entity
- expose :id
+ expose :id do |instance, options|
+ instance.id.split('/').last
+ end
expose :name
expose :image
expose :organizations, using: MinimalOrgs
end
class Posts < Grape::Entity
- expose :id
+ expose :id do |instance, options|
+ instance.id.split('/').last
+ end
expose :role
expose :people
end
|
Cut off prefix for uuids during display.
|
diff --git a/db/data_migration/20200421181910_vanish_placeholder_working_groups_in_broken_state.rb b/db/data_migration/20200421181910_vanish_placeholder_working_groups_in_broken_state.rb
index abc1234..def5678 100644
--- a/db/data_migration/20200421181910_vanish_placeholder_working_groups_in_broken_state.rb
+++ b/db/data_migration/20200421181910_vanish_placeholder_working_groups_in_broken_state.rb
@@ -0,0 +1,8 @@+broken_group_content_ids = Services.publishing_api.lookup_content_ids(
+ base_paths: ["/government/groups/funding-external-technical-advisory-group",
+ "/government/groups/military-stabilisation-support-group"],
+).values
+
+broken_group_content_ids.each do |content_id|
+ PublishingApiVanishWorker.perform_async(content_id, "en", discard_drafts: true)
+end
|
Add migration to vanish broken groups
We want to vanish these working groups as they are in a broken state
across GOV.UK's stack, they're recorded as live & draft in
publishing-api and content-store but do not exist in whitehall or router
meaning the pages are returning a 404. This weirdity seems to originate
from a missed bit of cleanup when transitioning from
placeholder_working_group to working_group, see here ->
https://github.com/alphagov/whitehall/pull/2480.
|
diff --git a/atom.rb b/atom.rb
index abc1234..def5678 100644
--- a/atom.rb
+++ b/atom.rb
@@ -1,11 +1,75 @@-dep 'atom.app' do
+dep 'atom' do
+ requires \
+ 'Atom.app',
+ 'atom packages'
+end
+
+dep 'Atom.app' do
source "https://atom.io/download/mac"
- provides 'Atom.app'
version '0'
end
-dep 'atom', :template => 'sym_link' do
- requires 'atom.app'
+meta :apm do
+ accepts_value_for :version
- # TODO: add packages to install
+ template {
+ requires 'Atom.app'
+ pkg_name = name.split('.').first
+
+ met? {
+ !shell("apm list | grep #{pkg_name}@").nil?
+ }
+ meet {
+ shell("apm install #{pkg_name}")
+ }
+ }
end
+
+apm_packages = [
+ # beautification
+ 'atom-beautify',
+ 'editorconfig',
+ # typescript support
+ 'atom-typescript',
+ # autocompletion stuff
+ 'autocomplete-css',
+ 'autocomplete-paths',
+ 'autocomplete-plus',
+ # git
+ 'git-blame',
+ 'merge-conflicts',
+ # ctrl+click to get somewhere
+ 'hyperclick',
+ 'js-hyperclick',
+ # vue support
+ 'language-vue',
+ # linters
+ 'linter',
+ 'linter-eslint',
+ 'linter-flow',
+ 'linter-js-standard',
+ 'linter-rubocop',
+ 'linter-scss-lint',
+ 'linter-tslint',
+ # Markdown support
+ 'markdown-preview-plus',
+ # Theming
+ 'monokai',
+ # Rails support
+ 'rails-rspec',
+ # React support
+ 'react',
+ # Javascript snippets
+ 'standardjs-snippets',
+ # Showing ToDo
+ 'todo-show'
+]
+apm_packages.each do |pkg|
+ dep "#{pkg}.apm"
+end
+
+dep 'atom packages' do
+ apm_packages.each do |pkg|
+ requires "#{pkg}.apm"
+ end
+end
|
Add all basic Atom packages
|
diff --git a/spec/controllers/unsubmitted_courses_controller_spec.rb b/spec/controllers/unsubmitted_courses_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/unsubmitted_courses_controller_spec.rb
+++ b/spec/controllers/unsubmitted_courses_controller_spec.rb
@@ -18,5 +18,19 @@ expect(response.body).to_not have_content(course.title)
expect(response.body).to have_content(course2.title)
end
+
+ it 'should show course creation date' do
+ course = create(:course, title: 'My awesome course',
+ start: Date.civil(2016, 1, 10),
+ end: Date.civil(2050, 1, 10))
+ CampaignsCourses.create(course_id: course.id,
+ campaign_id: Campaign.default_campaign.id)
+ course2 = create(:course, title: 'My old not as awesome course',
+ start: Date.civil(2016, 1, 10),
+ end: Date.civil(2016, 2, 10))
+
+ get :index
+ expect(response.body).to have_content(Date.today.strftime('%Y-%m-%d'))
+ end
end
end
|
Create test for unsubmitted courses
|
diff --git a/Casks/omnipresence-beta.rb b/Casks/omnipresence-beta.rb
index abc1234..def5678 100644
--- a/Casks/omnipresence-beta.rb
+++ b/Casks/omnipresence-beta.rb
@@ -0,0 +1,13 @@+cask :v1 => 'omnipresence-beta' do
+ version '1.4.x-r232733'
+ sha256 'c21289a7a90b4efc8f0eb9cf3775bb4bb19145688229cd886718881b2c34377a'
+
+ url "http://omnistaging.omnigroup.com/omnipresence/releases/OmniPresence-#{version}-Test.dmg"
+ name 'OmniPresence Beta'
+ homepage 'http://www.omnigroup.com/omnipresence'
+ license :commercial
+
+ app 'OmniPresence.app'
+
+ depends_on :macos => '>= :yosemite'
+end
|
Add Omnipresence beta track (currently 1.4)
This creates a new cask for the Omnipresence beta (at v1.4 at the
time of creation).
|
diff --git a/lib/goshortener.rb b/lib/goshortener.rb
index abc1234..def5678 100644
--- a/lib/goshortener.rb
+++ b/lib/goshortener.rb
@@ -12,7 +12,7 @@ end
def shorten(long_url)
- if long_url.is_a? String
+ if long_url.is_a?(String) && long_url.present?
request_json = {'longUrl' => long_url}.to_json
response = RestClient.post @base_url, request_json, :accept => :json, :content_type => :json
else
|
Handle empty URLs while shortening.
|
diff --git a/lib/qrb/heading.rb b/lib/qrb/heading.rb
index abc1234..def5678 100644
--- a/lib/qrb/heading.rb
+++ b/lib/qrb/heading.rb
@@ -1,4 +1,10 @@ module Qrb
+ #
+ # Helper class for tuple and relation types.
+ #
+ # A heading is a set of attributes, with the constraint that no two
+ # attributes have the same name.
+ #
class Heading
include Enumerable
@@ -37,7 +43,7 @@ end
def hash
- attributes.hash
+ self.class.hash ^ attributes.hash
end
attr_reader :attributes
|
Document Heading and change hash strategy.
|
diff --git a/lib/tasks/lpi.rake b/lib/tasks/lpi.rake
index abc1234..def5678 100644
--- a/lib/tasks/lpi.rake
+++ b/lib/tasks/lpi.rake
@@ -0,0 +1,11 @@+namespace :lpi do
+ desc 'Import an LPI CSV file, attributing the import to the given user'
+ task :import, [:file, :user_email] => [:environment] do |t, args|
+ user = User.find_by_email!(args[:user_email])
+ importer = LandAndPropertyInformationImporter.new(args[:file], user)
+ importer.import
+ puts "Processed %d, created %d, updated %d, errors %d" % [
+ importer.processed, importer.created, importer.updated, importer.errors
+ ]
+ end
+end
|
Add rake task for LPI file import
|
diff --git a/test/specs/template_spec.rb b/test/specs/template_spec.rb
index abc1234..def5678 100644
--- a/test/specs/template_spec.rb
+++ b/test/specs/template_spec.rb
@@ -4,11 +4,30 @@ SparkleFormation.sparkle_path = File.join(File.dirname(__FILE__), 'cloudformation')
end
- describe 'Simple template' do
+ describe 'Dummy template' do
- it 'should build the template' do
- SparkleFormation.compile('dummy.rb')
+ it 'should build the dummy template' do
+ result = SparkleFormation.compile('dummy.rb')
+ result.must_be :is_a?, Hash
+ result.to_smash.get('Outputs', 'Dummy', 'Value').must_equal 'Dummy value'
+ result.to_smash.get('Parameters', 'Creator', 'Default').must_equal 'Fubar'
end
end
+
+ describe 'Nested template' do
+
+ it 'should build the nested template' do
+ result = SparkleFormation.compile('nest.rb')
+ simple = SparkleFormation.compile('simple.rb')
+ dummy = SparkleFormation.compile('dummy.rb')
+ result.must_be :is_a?, Hash
+ simple.must_be :is_a?, Hash
+ dummy.must_be :is_a?, Hash
+ result.to_smash.get('Resources', 'Dummy', 'Properties', 'Stack').to_json.must_equal dummy.to_smash.to_json
+ result.to_smash.get('Resources', 'Simple', 'Properties', 'Stack').to_json.must_equal simple.to_smash.to_json
+ end
+
+ end
+
end
|
Build templates and validate expected results
|
diff --git a/phonebook.rb b/phonebook.rb
index abc1234..def5678 100644
--- a/phonebook.rb
+++ b/phonebook.rb
@@ -0,0 +1,15 @@+# A directory of names and phone numbers
+class Phonebook
+ attr_accessor :data
+
+ def initialize()
+ self.data = {}
+ end
+
+ # Add a contact to this phone book
+ # @param name [String] The name of the contact
+ # @param number [String] The phone number of the contact
+ def add(name, number)
+ data[name] = number
+ end
+end
|
Add simple Phonebook data structure
We are going to be trying to search through a list of contacts (which I
am calling a Phonebook for ease of discussion). We are going to store
these in some form; for now, the simplest possible answer is a hash
mapping Names to Numbers.
For the time being, we are going to consider phone numbers as strings;
this way we can accept arbitrary formatting (until we know better what
expectations Twilio has).
|
diff --git a/core/argf/rewind_spec.rb b/core/argf/rewind_spec.rb
index abc1234..def5678 100644
--- a/core/argf/rewind_spec.rb
+++ b/core/argf/rewind_spec.rb
@@ -28,9 +28,7 @@ end
end
- # This fails on all versions as reported in bug #1693. If it's deemed not to
- # be a bug, this guard can be removed
- ruby_bug "#1693", "1.8.7.302" do
+ ruby_bug "#1693", "1.8" do
it "resets ARGF.lineno to 0" do
argv [@file2_name] do
ARGF.lineno = 0
|
Update ruby_bug version to 1.9 for ARGF.rewind bug.
|
diff --git a/app/models/viewport.rb b/app/models/viewport.rb
index abc1234..def5678 100644
--- a/app/models/viewport.rb
+++ b/app/models/viewport.rb
@@ -6,12 +6,16 @@ belongs_to :project
validates :project, presence: true
- # @return [String]
+ # @return [String] A representation of the Viewport instance in the format of
+ # {width}x{height}.
def to_s
[width, height].join('x')
end
- # @return [Integer]
+ # @return [Integer] Dynamically calculated height based on the width. For
+ # narrow widths, this will be tall, as if in portrait mode on a phone. For
+ # wider widths, this will be shorter, as if in landscape orientation on a
+ # laptop or desktop monitor.
def height
if width < 960
width * 2
|
Improve documentation for Viewport methods
Just adding some YARD descriptions to the return types to make this
class more coherent.
Change-Id: I9a64961eb136fe4c4a09909fa7fc1e7b12351388
|
diff --git a/spec/helpers_spec.rb b/spec/helpers_spec.rb
index abc1234..def5678 100644
--- a/spec/helpers_spec.rb
+++ b/spec/helpers_spec.rb
@@ -3,17 +3,17 @@ Sicuro.assert('true', 'true').should == true
context 'sandbox_error passed a string' do
- Sicuro.should_receive(:warn).with("[SANDBOX WARNING] test\n")
+ $stderr.should_receive(:puts).with("[SANDBOX WARNING] test\n")
Sicuro.sandbox_error('test')
end
context 'sandbox_error passed an array' do
- Sicuro.should_receive(:warn).with("[SANDBOX WARNING] test\n")
+ $stderr.should_receive(:puts).with("[SANDBOX WARNING] test\n")
Sicuro.sandbox_error(['test'])
end
context 'sandbox_error passed a number' do
- Sicuro.should_receive(:warn).with("[SANDBOX WARNING] 1\n")
+ $stderr.should_receive(:puts).with("[SANDBOX WARNING] 1\n")
Sicuro.sandbox_error(1)
end
|
Check for $stderr.puts, instead of Sicuro.warn.
|
diff --git a/spec/hash_object_spec.rb b/spec/hash_object_spec.rb
index abc1234..def5678 100644
--- a/spec/hash_object_spec.rb
+++ b/spec/hash_object_spec.rb
@@ -11,7 +11,8 @@ :posts => [
{:title => 'It is christmas'},
{:title => 'NOT'}
- ]
+ ],
+ :living? => true
}
end
@@ -21,5 +22,6 @@ assert_equal hash[:posts].size, subject.posts.size
assert_equal hash[:posts][0][:title], subject.posts[0].title
assert_equal hash[:posts][1][:title], subject.posts[1].title
+ assert_equal hash[:living?], subject.living?
end
end
|
Add postfix example-attribute to HashObject spec
|
diff --git a/spec/models/game_spec.rb b/spec/models/game_spec.rb
index abc1234..def5678 100644
--- a/spec/models/game_spec.rb
+++ b/spec/models/game_spec.rb
@@ -8,22 +8,26 @@ let(:default_starting_word) { "hangman" }
describe "#score" do
+ subject { game.score }
+
it "should be set" do
- expect(game.score).not_to be_nil
+ is_expected.not_to be_nil
end
it "should be the default" do
- expect(game.score).to eql default_starting_score
+ is_expected.to eql default_starting_score
end
end
describe "#word" do
+ subject { game.word }
+
it "should be set" do
- expect(game.word).not_to be_nil
+ is_expected.not_to be_nil
end
it "should be the default" do
- expect(game.word).to eql default_starting_word
+ is_expected.to eql default_starting_word
end
end
end
|
Change rspec tests to make better use of subject
|
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index abc1234..def5678 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -1,25 +1,22 @@ require 'rails_helper'
RSpec.describe User, type: :model do
- it "has a valid factory" do
+ it 'has a valid factory' do
create(:user).should be_valid
end
- it "is invalid without a first_name" do
+ it 'is invalid without a first_name' do
build(:user, first_name: nil).should_not be_valid
end
- it "is invalid without a last_name" do
+ it 'is invalid without a last_name' do
build(:user, last_name: nil).should_not be_valid
end
- it "is invalid without an email" do
+ it 'is invalid without an email' do
build(:user, email: nil).should_not be_valid
end
- it "is invalid without a phone" do
+ it 'is invalid without a phone' do
build(:user, phone: nil).should_not be_valid
end
- it "is invalid without a spire_id" do
+ it 'is invalid without a spire_id' do
build(:user, spire_id: nil).should_not be_valid
end
-
- describe ''
- it "returns a contact's full name as a string"
end
|
Use single quotes unless double quotes are needed
|
diff --git a/nasdaq_scraper.gemspec b/nasdaq_scraper.gemspec
index abc1234..def5678 100644
--- a/nasdaq_scraper.gemspec
+++ b/nasdaq_scraper.gemspec
@@ -18,6 +18,8 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]
+ spec.required_ruby_version = '>= 1.9.3'
+
spec.add_dependency 'rest-client', '~> 1.6'
spec.add_dependency 'thor', '~> 0.18'
|
Add ruby version to gemspec
|
diff --git a/lib/generators/redactor/templates/active_record/carrierwave/redactor/document.rb b/lib/generators/redactor/templates/active_record/carrierwave/redactor/document.rb
index abc1234..def5678 100644
--- a/lib/generators/redactor/templates/active_record/carrierwave/redactor/document.rb
+++ b/lib/generators/redactor/templates/active_record/carrierwave/redactor/document.rb
@@ -4,4 +4,8 @@ def url_content
url(:content)
end
+
+ def as_json_methods
+ [:image]
+ end
end
|
Remove thumb from Document's json methods
|
diff --git a/cookbooks/sys_dns/recipes/do_set_private.rb b/cookbooks/sys_dns/recipes/do_set_private.rb
index abc1234..def5678 100644
--- a/cookbooks/sys_dns/recipes/do_set_private.rb
+++ b/cookbooks/sys_dns/recipes/do_set_private.rb
@@ -5,8 +5,33 @@ # RightScale Terms of Service available at http://www.rightscale.com/terms.php and,
# if applicable, other agreements such as a RightScale Master Subscription Agreement.
+require 'socket'
+
+def local_ip
+ orig, Socket.do_not_reverse_lookup = Socket.do_not_reverse_lookup, true # turn off reverse DNS resolution temporarily
+ UDPSocket.open do |s|
+ s.connect '64.233.187.99', 1
+ s.addr.last
+ end
+ ensure
+ Socket.do_not_reverse_lookup = orig
+end
+
+if ! node.has_key?('cloud')
+ private_ip = "#{local_ip}"
+else
+ public_ip = node['cloud']['public_ips'][0]
+end
+
+log "Detected private IP: #{private_ip}"
+
sys_dns "default" do
id node['sys_dns']['id']
- address node['cloud']['private_ips'][0]
+ address private_ip
action :set_private
+end
+
+execute "set_private_ip_tag" do
+ command "rs_tag --add 'node:private_ip=#{private_ip}'"
+ only_if "which rs_tag"
end
|
Add private_ip detection for non-clouds.
|
diff --git a/db/migrate/20150417081217_change_name_of_payment_method_types.rb b/db/migrate/20150417081217_change_name_of_payment_method_types.rb
index abc1234..def5678 100644
--- a/db/migrate/20150417081217_change_name_of_payment_method_types.rb
+++ b/db/migrate/20150417081217_change_name_of_payment_method_types.rb
@@ -0,0 +1,22 @@+class ChangeNameOfPaymentMethodTypes < ActiveRecord::Migration
+ def up
+ name_maps.each do |old, new|
+ Spree::PaymentMethod.where(type: old).update_all(type: new)
+ end
+ end
+
+ def down
+ name_maps.each do |old, new|
+ Spree::PaymentMethod.where(type: new).update_all(type: old)
+ end
+ end
+
+ private
+ def name_maps
+ {
+ 'Spree::BillingIntegration::SisowBilling::Ideal' => 'Spree::PaymentMethod::SisowBilling::Ideal',
+ 'Spree::BillingIntegration::SisowBilling::Bancontact' => 'Spree::PaymentMethod::SisowBilling::Bancontact',
+ 'Spree::BillingIntegration::SisowBilling::Sofort' => 'Spree::PaymentMethod::SisowBilling::Sofort'
+ }
+ end
+end
|
Add migration to change the names of already made payment methods.
|
diff --git a/faraday-detailed_logger.gemspec b/faraday-detailed_logger.gemspec
index abc1234..def5678 100644
--- a/faraday-detailed_logger.gemspec
+++ b/faraday-detailed_logger.gemspec
@@ -10,7 +10,7 @@ spec.email = [""]
spec.summary = %q{A detailed request and response logger for Faraday.}
spec.description = %q{A Faraday middleware for logging request and response activity including method, URI, headers, and body at varying log levels.}
- spec.homepage = ""
+ spec.homepage = "https://github.com/envylabs/faraday-detailed_logger"
spec.license = "MIT"
spec.files = `git ls-files -z`.split("\x0")
|
Use GitHub as the gem homepage.
|
diff --git a/lib/marples/model_action_broadcast.rb b/lib/marples/model_action_broadcast.rb
index abc1234..def5678 100644
--- a/lib/marples/model_action_broadcast.rb
+++ b/lib/marples/model_action_broadcast.rb
@@ -28,7 +28,8 @@ end
def self.build_marples_client
- Marples::Client.new(marples_transport, marples_client_name, marples_logger)
+ Marples::Client.new :transport: marples_transport,
+ client_name: marples_client_name, logger: marples_logger
end
end
end
|
Make the ActiveModel integration use option-style arguments
|
diff --git a/spec/lib/gitlab/ci/pipeline/chain/validate/config_spec.rb b/spec/lib/gitlab/ci/pipeline/chain/validate/config_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/gitlab/ci/pipeline/chain/validate/config_spec.rb
+++ b/spec/lib/gitlab/ci/pipeline/chain/validate/config_spec.rb
@@ -0,0 +1,127 @@+require 'spec_helper'
+
+describe Gitlab::Ci::Pipeline::Chain::Validate::Config do
+ set(:project) { create(:project) }
+ set(:user) { create(:user) }
+
+ let(:command) do
+ double('command', project: project,
+ current_user: user,
+ save_incompleted: true)
+ end
+
+ let!(:step) { described_class.new(pipeline, command) }
+
+ before do
+ step.perform!
+ end
+
+ context 'when pipeline has no YAML configuration' do
+ let(:pipeline) do
+ build_stubbed(:ci_pipeline, project: project)
+ end
+
+ it 'appends errors about missing configuration' do
+ expect(pipeline.errors.to_a)
+ .to include 'Missing .gitlab-ci.yml file'
+ end
+
+ it 'breaks the chain' do
+ expect(step.break?).to be true
+ end
+ end
+
+ context 'when YAML configuration contains errors' do
+ let(:pipeline) do
+ build(:ci_pipeline, project: project, config: 'invalid YAML')
+ end
+
+ it 'appends errors about YAML errors' do
+ expect(pipeline.errors.to_a)
+ .to include 'Invalid configuration format'
+ end
+
+ it 'breaks the chain' do
+ expect(step.break?).to be true
+ end
+
+ context 'when saving incomplete pipeline is allowed' do
+ let(:command) do
+ double('command', project: project,
+ current_user: user,
+ save_incompleted: true)
+ end
+
+ it 'fails the pipeline' do
+ expect(pipeline.reload).to be_failed
+ end
+ end
+
+ context 'when saving incomplete pipeline is not allowed' do
+ let(:command) do
+ double('command', project: project,
+ current_user: user,
+ save_incompleted: false)
+ end
+
+ it 'does not drop pipeline' do
+ expect(pipeline).not_to be_failed
+ expect(pipeline).not_to be_persisted
+ end
+ end
+ end
+
+ context 'when pipeline has no stages / jobs' do
+ let(:config) do
+ { rspec: {
+ script: 'ls',
+ only: ['something']
+ }
+ }
+ end
+
+ let(:pipeline) do
+ build(:ci_pipeline, project: project, config: config)
+ end
+
+ it 'appends an error about missing stages' do
+ expect(pipeline.errors.to_a)
+ .to include 'No stages / jobs for this pipeline.'
+ end
+
+ it 'breaks the chain' do
+ expect(step.break?).to be true
+ end
+ end
+
+ context 'when pipeline contains configuration validation errors' do
+ let(:config) { { rspec: { } } }
+
+ let(:pipeline) do
+ build(:ci_pipeline, project: project, config: config)
+ end
+
+ it 'appends configuration validation errors to pipeline errors' do
+ expect(pipeline.errors.to_a)
+ .to include "jobs:rspec config can't be blank"
+ end
+
+ it 'breaks the chain' do
+ expect(step.break?).to be true
+ end
+ end
+
+ context 'when pipeline is correct and complete' do
+ let(:pipeline) do
+ build(:ci_pipeline_with_one_job, project: project)
+ end
+
+ it 'does not invalidate the pipeline' do
+ expect(pipeline).to be_valid
+ end
+
+ it 'does not break the chain' do
+ expect(step.break?).to be false
+ end
+ end
+end
|
Add specs for pipeline builder that validates config
|
diff --git a/opal/yeah/thing.rb b/opal/yeah/thing.rb
index abc1234..def5678 100644
--- a/opal/yeah/thing.rb
+++ b/opal/yeah/thing.rb
@@ -1,6 +1,10 @@ class Yeah::Thing
class << self
attr_accessor :look, :body
+
+ def look
+ @look ||= Look
+ end
end
attr_reader :game
@@ -9,7 +13,7 @@ def initialize(game, options)
@game = game
@look = self.class.look.new
- @body = self.class.body.new
+ @body = self.class.body.new unless self.class.body.nil?
# Assign options.
if options.respond_to? :each_pair
|
Make optional Thing ::look, ::body
|
diff --git a/ProductionBlogPost2/models/pricing/persistant_pricing_model.rb b/ProductionBlogPost2/models/pricing/persistant_pricing_model.rb
index abc1234..def5678 100644
--- a/ProductionBlogPost2/models/pricing/persistant_pricing_model.rb
+++ b/ProductionBlogPost2/models/pricing/persistant_pricing_model.rb
@@ -2,7 +2,7 @@
class PersistantPricingModel
- def initialize(model, baseDir = './data', expiration = 1000 * 60 * 60 * 24)
+ def initialize(model, baseDir = './data', expiration = 60 * 60 * 24)
@model = model
@buy_prices = Moneta.new(:PStore, :file => baseDir + "/buy.pstore", :expires => true)
@sell_prices = Moneta.new(:PStore, :file => baseDir + "/sell.pstore", :expires => true)
@@ -22,4 +22,4 @@ @sell_prices.store(id, price, :expires => @expiration)
price
end
-end+end
|
Update for millis/seconds mistake in the persistent pricing model expiration default
|
diff --git a/app/services/play_card.rb b/app/services/play_card.rb
index abc1234..def5678 100644
--- a/app/services/play_card.rb
+++ b/app/services/play_card.rb
@@ -23,7 +23,7 @@ top_card = @round.pile.top
return true if @card.playable_on?(top_card)
- @errors.push "cannot play card, #{@card.to_s} on #{top_card}"
+ @errors.push "cannot play card, #{@card} on #{top_card}"
false
end
|
Refactor string interpolation call to_s as implicit
|
diff --git a/db/migrate/20171002161539_create_gpg_key_subkeys_for_existing_gpg_keys.rb b/db/migrate/20171002161539_create_gpg_key_subkeys_for_existing_gpg_keys.rb
index abc1234..def5678 100644
--- a/db/migrate/20171002161539_create_gpg_key_subkeys_for_existing_gpg_keys.rb
+++ b/db/migrate/20171002161539_create_gpg_key_subkeys_for_existing_gpg_keys.rb
@@ -0,0 +1,59 @@+# See http://doc.gitlab.com/ce/development/migration_style_guide.html
+# for more information on how to write migrations for GitLab.
+
+class CreateGpgKeySubkeysForExistingGpgKeys < ActiveRecord::Migration
+ disable_ddl_transaction!
+
+ DOWNTIME = false
+
+ class GpgKey < ActiveRecord::Base
+ self.table_name = 'gpg_keys'
+
+ include EachBatch
+ include ShaAttribute
+
+ sha_attribute :primary_keyid
+ sha_attribute :fingerprint
+
+ has_many :subkeys, class_name: 'GpgKeySubkey'
+ end
+
+ class GpgKeySubkey < ActiveRecord::Base
+ self.table_name = 'gpg_key_subkeys'
+
+ include ShaAttribute
+
+ sha_attribute :keyid
+ sha_attribute :fingerprint
+ end
+
+ def up
+ GpgKey.each_batch do |batch|
+ batch.each do |gpg_key|
+ create_subkeys(gpg_key) && update_signatures(gpg_key)
+ end
+ end
+ end
+
+ def down
+ end
+
+ private
+
+ def create_subkeys(gpg_key)
+ gpg_subkeys = Gitlab::Gpg.subkeys_from_key(gpg_key.key)
+
+ gpg_subkeys[gpg_key.primary_keyid.upcase]&.each do |subkey_data|
+ gpg_key.subkeys.build(keyid: subkey_data[:keyid], fingerprint: subkey_data[:fingerprint])
+ end
+
+ # Improve latency by doing all INSERTs in a single call
+ GpgKey.transaction do
+ gpg_key.save!
+ end
+ end
+
+ def update_signatures(gpg_key)
+ InvalidGpgSignatureUpdateWorker.perform_async(gpg_key.id)
+ end
+end
|
Add migration to generate GpgKeySubkeys records and update signatures
|
diff --git a/tipsi-stripe.podspec b/tipsi-stripe.podspec
index abc1234..def5678 100644
--- a/tipsi-stripe.podspec
+++ b/tipsi-stripe.podspec
@@ -19,5 +19,5 @@ s.source_files = 'ios/TPSStripe/**/*.{h,m}'
s.dependency 'React'
- s.dependency 'Stripe', '>= 16.0.7'
+ s.dependency 'Stripe', '>= 19.0.1'
end
|
Fix build on xcode 11.4
See https://github.com/stripe/stripe-ios/pull/1526
|
diff --git a/app/models/user.rb b/app/models/user.rb
index abc1234..def5678 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -4,7 +4,7 @@
include BCrypt
- has_many :decks, through :rounds
+ has_many :decks, through: :rounds
validates :last_name, :first_name, :user_name, :email, presence: true
|
Fix another typo in User model
|
diff --git a/app/models/vote.rb b/app/models/vote.rb
index abc1234..def5678 100644
--- a/app/models/vote.rb
+++ b/app/models/vote.rb
@@ -0,0 +1,7 @@+class Vote < ActiveRecord::Base
+ belongs_to :voter, class_name: "User"
+ belongs_to :voteable, polymorphic: true
+
+ validates :value, minimum: -1, maximum:1
+
+end
|
Add associations and validations to model
|
diff --git a/cluster-discovery.gemspec b/cluster-discovery.gemspec
index abc1234..def5678 100644
--- a/cluster-discovery.gemspec
+++ b/cluster-discovery.gemspec
@@ -8,8 +8,8 @@ spec.version = Cluster::Discovery::VERSION
spec.authors = ['Andrew Thompson']
spec.email = ['Andrew_Thompson@rapid7.com']
- spec.summary = %q{TODO: Write a short summary. Required.}
- spec.description = %q{TODO: Write a longer description. Optional.}
+ spec.summary = 'Cluster Discovery Library'
+ spec.description = %q{This is a library that provides a generic interface to multiple cluster providers. Cluster providers include: EC2 Tags, EC2 AutoScaling Groups, and Consul}
spec.homepage = ''
spec.license = 'MIT'
|
Update gemspec summary and description
|
diff --git a/coinbase-official.podspec b/coinbase-official.podspec
index abc1234..def5678 100644
--- a/coinbase-official.podspec
+++ b/coinbase-official.podspec
@@ -14,11 +14,13 @@ s.platform = :ios, '7.0'
s.requires_arc = true
- s.source_files = 'Pod/Classes'
s.resources = 'Pod/Assets'
-
s.public_header_files = 'Pod/Classes/**/*.h'
s.frameworks = 'UIKit'
+
+ s.subspec 'client' do |ss|
+ ss.source_files = 'Pod/Classes/Coinbase.[hm]'
+ end
s.subspec 'OAuth' do |ss|
ss.source_files = 'Pod/Classes/{CoinbaseOAuth,CoinbaseDefines}.[hm]'
|
Update podspec to remove conflicting files
|
diff --git a/config/dependencies.rb b/config/dependencies.rb
index abc1234..def5678 100644
--- a/config/dependencies.rb
+++ b/config/dependencies.rb
@@ -35,3 +35,19 @@ register("groups.musicbrainz") do |musicbrainz_key|
Groups::MusicBrainz.new(musicbrainz_key)
end
+
+register("releases.sync") do |model, **options|
+ Releases::Sync.new(model, **options)
+end
+
+register("releases.source") do |**args|
+ Releases::Source.new(**args)
+end
+
+register("releases.metal_archives") do |metal_archives_key|
+ Releases::MetalArchives.new(metal_archives_key)
+end
+
+register("releases.musicbrainz") do |musicbrainz_key|
+ Releases::MusicBrainz.new(musicbrainz_key)
+end
|
Add missing sync release dependency
|
diff --git a/backend/app/controllers/spree/admin/images_controller.rb b/backend/app/controllers/spree/admin/images_controller.rb
index abc1234..def5678 100644
--- a/backend/app/controllers/spree/admin/images_controller.rb
+++ b/backend/app/controllers/spree/admin/images_controller.rb
@@ -8,30 +8,27 @@
private
- def location_after_destroy
- admin_product_images_url(@product)
- end
+ def location_after_destroy
+ admin_product_images_url(@product)
+ end
- def location_after_save
- admin_product_images_url(@product)
- end
+ def location_after_save
+ admin_product_images_url(@product)
+ end
- def load_data
- @product = Product.friendly.includes(*variant_includes).find(params[:product_id])
- @variants = @product.variants.map do |variant|
- [variant.sku_and_options_text, variant.id]
+ def load_data
+ @product = Product.friendly.find(params[:product_id])
+ @variants = @product.variants.collect do |variant|
+ [variant.sku_and_options_text, variant.id]
+ end
+ @variants.insert(0, [Spree.t(:all), @product.master.id])
end
- @variants.insert(0, [Spree.t(:all), @product.master.id])
- end
- def set_viewable
- @image.viewable_type = 'Spree::Variant'
- @image.viewable_id = params[:image][:viewable_id]
- end
+ def set_viewable
+ @image.viewable_type = 'Spree::Variant'
+ @image.viewable_id = params[:image][:viewable_id]
+ end
- def variant_includes
- [variants_including_master: { option_values: :option_type, images: :viewable }]
- end
end
end
end
|
Revert "fix n+1 for admin product images"
This reverts commit 2acb334efd85c5e0467a1db64938cf28f08d8fe8.
|
diff --git a/spec/controllers/application_controller/policy_support_spec.rb b/spec/controllers/application_controller/policy_support_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/application_controller/policy_support_spec.rb
+++ b/spec/controllers/application_controller/policy_support_spec.rb
@@ -17,4 +17,24 @@ controller.send(:assign_policies, Host)
end
end
+
+ describe '#policy_sim_cancel' do
+ before do
+ allow(controller).to receive(:flash_to_session).and_call_original
+ allow(controller).to receive(:previous_breadcrumb_url)
+ allow(controller).to receive(:redirect_to)
+ end
+
+ it 'calls redirect_to method' do
+ expect(controller).to receive(:redirect_to)
+ controller.send(:policy_sim_cancel)
+ end
+
+ it 'adds the message to flash array' do
+ flash_msg = 'Edit policy simulation was cancelled by the user'
+ expect(controller).to receive(:flash_to_session).with(flash_msg)
+ controller.send(:policy_sim_cancel)
+ expect(controller.instance_variable_get(:@flash_array)).to eq([{:message => flash_msg, :level => :success}])
+ end
+ end
end
|
Add specs regarding canceling policy simulation
|
diff --git a/spec/models/spree/calculator_spec.rb b/spec/models/spree/calculator_spec.rb
index abc1234..def5678 100644
--- a/spec/models/spree/calculator_spec.rb
+++ b/spec/models/spree/calculator_spec.rb
@@ -10,9 +10,7 @@ let!(:line_item2) { create(:line_item, order: order) }
before do
- order.line_items << line_item
- order.line_items << line_item2
- order.shipments = [shipment]
+ order.reload.shipments = [shipment]
end
describe "#line_items_for" do
|
Fix problem in calculator spec
I am not sure why this started failing on this branch only and not in master but this fix is correct because line_items are created with order defined already, an order.reload is enough to load them into the order
|
diff --git a/deep_merge.gemspec b/deep_merge.gemspec
index abc1234..def5678 100644
--- a/deep_merge.gemspec
+++ b/deep_merge.gemspec
@@ -16,7 +16,6 @@ "CHANGELOG",
"README.md",
"Rakefile",
- "VERSION",
"lib/deep_merge.rb",
"lib/deep_merge/core.rb",
"lib/deep_merge/deep_merge_hash.rb",
|
Remove deleted VERSION file from gemspec
|
diff --git a/core/lib/tasks/email.rake b/core/lib/tasks/email.rake
index abc1234..def5678 100644
--- a/core/lib/tasks/email.rake
+++ b/core/lib/tasks/email.rake
@@ -1,9 +1,9 @@ namespace :email do
- desc 'Sends test email to specified address - Example: EMAIL=spree@example.com bundle exec rake test:email'
+ desc 'Sends test email to specified address - Example: EMAIL=spree@example.com bundle exec rake email:test'
task test: :environment do
unless ENV['EMAIL'].present?
raise ArgumentError, "Must pass EMAIL environment variable. " \
- "Example: EMAIL=spree@example.com bundle exec rake test:email"
+ "Example: EMAIL=spree@example.com bundle exec rake email:test"
end
Spree::TestMailer.test_email(ENV['EMAIL']).deliver_now
end
|
Fix documentation typo on mailer rake task.
Fixes #6326
|
diff --git a/core/lib/tasks/users.rake b/core/lib/tasks/users.rake
index abc1234..def5678 100644
--- a/core/lib/tasks/users.rake
+++ b/core/lib/tasks/users.rake
@@ -1,11 +1,10 @@ namespace :user do
task :add, [:user, :email, :password] => :environment do |t, args|
u = User.new({ username: args.user,
-
- password: args.password,
- confirmed_at: DateTime.now
+ password: args.password,
})
u.email = args.email
+ u.confirmed_at = DateTime.now
u.save
if(u.errors.size > 0)
msg = "Failed to import "
|
Set confirmed_at for the generated user
|
diff --git a/recipes/default.rb b/recipes/default.rb
index abc1234..def5678 100644
--- a/recipes/default.rb
+++ b/recipes/default.rb
@@ -1,7 +1,9 @@ pythons = node['sprout']['pyenv']['pythons']
default_python = node['sprout']['pyenv']['default_python']
-package 'pyenv'
+node.default['homebrew']['formulas'] = [ name: 'pyenv', head: true ]
+
+include_recipe 'homebrew::install_formulas'
sprout_base_bash_it_enable_feature 'plugins/pyenv'
|
Install pyenv using brew instead of package;
;
|
diff --git a/db/seeds/demo/demo_students.seeds.rb b/db/seeds/demo/demo_students.seeds.rb
index abc1234..def5678 100644
--- a/db/seeds/demo/demo_students.seeds.rb
+++ b/db/seeds/demo/demo_students.seeds.rb
@@ -16,7 +16,8 @@ StudentAssessment.destroy_all
DisciplineIncident.destroy_all
AttendanceEvent.destroy_all
-
+SchoolYear.destroy_all
+StudentSchoolYear.destroy_all
InterventionType.destroy_all
InterventionType.seed_somerville_intervention_types
|
Destroy school year & student school year objects before seeding
|
diff --git a/doc/ex/colorize.rb b/doc/ex/colorize.rb
index abc1234..def5678 100644
--- a/doc/ex/colorize.rb
+++ b/doc/ex/colorize.rb
@@ -10,8 +10,8 @@ # Convert the color image to monochrome
mono = polynesia.quantize(256, Magick::GRAYColorspace)
-# Colorize with a 20% blend of a brownish-orange color
-colorized = mono.colorize(0.2, 0.2, 0.2, 'orange3')
+# Colorize with a 25% blend of a brownish-orange color
+colorized = mono.colorize(0.25, 0.25, 0.25, '#cc9933')
# Do the usual before-and-after composite. Draw a line down the middle.
colorized.crop!(colorized.columns/2,0,colorized.columns,colorized.rows)
|
Use a color that's closer to "true" sepia.
|
diff --git a/jailer-column-to-association.rb b/jailer-column-to-association.rb
index abc1234..def5678 100644
--- a/jailer-column-to-association.rb
+++ b/jailer-column-to-association.rb
@@ -1,11 +1,13 @@ #!/usr/bin/env ruby
-require 'rubygems'
-require 'slop'
+def main(argv)
+ usage if argv.empty?
+
+ p argv
+end
-opts = Slop.new({
- :help => true,
- :banner => [
+def usage
+ $stderr.puts [
'Auto-generates association.csv from column.csv when we have same column names.',
'It`s useful in case of mysql MyISAM tables or another cases, when we lost our relationships.',
'Helper for http://jailer.sourceforge.net/ -- Java written database subsetting tool.',
@@ -13,21 +15,11 @@ ' (c) 2013 github.com/garex, a@ustimen.co',
'',
'',
- "Usage: #{File.basename($0, '.*')} [options]",
+ "Usage: #{File.basename($0)} path-to-column.csv",
] * $/
- }) do
- on :s, :source=, 'Source column CSV file. Usually "column.csv"', {:required => true}
- on :d, :destination=, 'Destination associations CSV file. Usually "association.csv"', {:required => true}
-end
-
-begin
- opts.parse! ARGV
-rescue Slop::MissingOptionError => err
- $stderr.puts err
- $stderr.puts '*' * 50
- $stderr.puts opts.help
exit
end
-p opts.to_hash
+main ARGV
+
|
Rework options to more simple unix-way
|
diff --git a/app/controllers/dataset_edits_controller.rb b/app/controllers/dataset_edits_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/dataset_edits_controller.rb
+++ b/app/controllers/dataset_edits_controller.rb
@@ -11,8 +11,10 @@ @dataset_edit = current_user.dataset_edits.new(dataset_edit_params)
if @dataset_edit.save
- redirect_to dataset_path(@dataset.area),
- flash: { success: I18n.t("dataset_edit.success", key: @dataset_edit.key, value: @dataset_edit.value) }
+ redirect_to dataset_path(@dataset.area), flash: {
+ success: I18n.t("dataset_edit.success",
+ key: @dataset_edit.key, value: @dataset_edit.value)
+ }
else
@dataset_edit.build_source
|
Clean up dataset edits success message code
|
diff --git a/app/controllers/travel_advice_controller.rb b/app/controllers/travel_advice_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/travel_advice_controller.rb
+++ b/app/controllers/travel_advice_controller.rb
@@ -29,11 +29,10 @@ end
respond_to do |format|
- format.html { render "country" }
- format.atom { render "country" }
+ format.html
+ format.atom
format.print do
set_slimmer_headers template: "print"
- render "country"
end
end
rescue RecordNotFound
|
Remove redundant render calls from controller
|
diff --git a/app/models/concerns/transaction_skipping.rb b/app/models/concerns/transaction_skipping.rb
index abc1234..def5678 100644
--- a/app/models/concerns/transaction_skipping.rb
+++ b/app/models/concerns/transaction_skipping.rb
@@ -5,7 +5,7 @@
class_methods do
def transaction(*args)
- if @skip_transaction
+ if Thread.current[:skip_transaction]
yield
else
super
@@ -14,10 +14,10 @@
def skip_transaction
begin
- @skip_transaction = true
+ Thread.current[:skip_transaction] = true
yield
ensure
- @skip_transaction = nil
+ Thread.current[:skip_transaction] = nil
end
end
end
|
Make transaction skipping logic threadsafe
|
diff --git a/lib/ember/es6_template/sprockets2.rb b/lib/ember/es6_template/sprockets2.rb
index abc1234..def5678 100644
--- a/lib/ember/es6_template/sprockets2.rb
+++ b/lib/ember/es6_template/sprockets2.rb
@@ -1,7 +1,7 @@ begin
require 'coffee_script'
rescue LoadError => e
- raise e unless e.message == 'cannot load such file -- coffee_script'
+ raise e unless ['cannot load such file -- coffee_script', 'no such file to load -- coffee_script'].include?(e.message)
end
module Ember
|
Make coffee_script detection jRuby compatible
|
diff --git a/Injineer.podspec b/Injineer.podspec
index abc1234..def5678 100644
--- a/Injineer.podspec
+++ b/Injineer.podspec
@@ -8,7 +8,7 @@ s.homepage = "https://github.com/vangelov/Injineer"
s.license = { :type => "ISC", :file => "LICENSE" }
s.author = { "Vladimir Angelov" => "vlady.angelov@gmail.com" }
- s.source = { :git => "https://github.com/vangelov/Injineer.git", :tag => "1.0.0" }
+ s.source = { :git => "https://github.com/vangelov/Injineer.git", :tag => "1.0.1" }
s.source_files = "Injineer", "Injineer/**/*.{h,m}"
s.requires_arc = true
s.ios.deployment_target = "7.0"
|
Update git tag in podspec.
|
diff --git a/spec/process_shared/shared_memory_io_spec.rb b/spec/process_shared/shared_memory_io_spec.rb
index abc1234..def5678 100644
--- a/spec/process_shared/shared_memory_io_spec.rb
+++ b/spec/process_shared/shared_memory_io_spec.rb
@@ -1,3 +1,7 @@+# encoding: UTF-8
+# ^^^
+# NOTE: This magic comment is necessary for the UTF-8 string literal below
+# on Ruby 1.9.x
require 'spec_helper'
require 'process_shared'
|
Fix test on 1.9.x by adding magic file encoding comment
|
diff --git a/warden-doorkeeper.gemspec b/warden-doorkeeper.gemspec
index abc1234..def5678 100644
--- a/warden-doorkeeper.gemspec
+++ b/warden-doorkeeper.gemspec
@@ -13,5 +13,5 @@
s.files = Dir["lib/**/*", "LICENSE", "README.md"]
- s.add_dependency "warden", "~> 1.2"
+ s.add_runtime_dependency "warden", "~> 1.2"
end
|
Update gemspec to use 'add_runtime_dependency'
|
diff --git a/watir/lib/watir/loader.rb b/watir/lib/watir/loader.rb
index abc1234..def5678 100644
--- a/watir/lib/watir/loader.rb
+++ b/watir/lib/watir/loader.rb
@@ -22,8 +22,9 @@ def load_driver
require "watir-#{driver}"
rescue LoadError
- puts "watir-#{driver} gem is missing. Install it with the following command:"
- puts " gem install watir-#{driver}"
+ warn "watir-#{driver} gem is missing. Install it with the following command:"
+ warn " gem install watir-#{driver}"
+ exit 1
end
def driver
|
Exit when gem is missing.
|
diff --git a/test/lib/examples/galena/tissue/migration/helpers/test_case.rb b/test/lib/examples/galena/tissue/migration/helpers/test_case.rb
index abc1234..def5678 100644
--- a/test/lib/examples/galena/tissue/migration/helpers/test_case.rb
+++ b/test/lib/examples/galena/tissue/migration/helpers/test_case.rb
@@ -11,10 +11,33 @@ super(FIXTURES)
end
+ def create_migrator(fixture, opts={})
+ # The fixture config directory.
+ dir = File.join(CONF_DIR, fixture.to_s)
+ # The required field heading => caTissue mapping file.
+ opts[:mapping] ||= File.expand_path('fields.yaml', dir)
+ # The optional caTissue property => default value file.
+ dfile = File.expand_path('defaults.yaml', dir)
+ opts[:defaults] ||= dfile if File.exists?(dfile)
+ # The optional input value => caTissue value file.
+ ffile = File.expand_path('values.yaml', dir)
+ opts[:filters] ||= ffile if File.exists?(ffile)
+ # The optional shims.
+ sfile = File.expand_path("#{fixture}.rb", SHIMS_DIR)
+ opts[:shims] ||= sfile if File.exists?(sfile)
+ super
+ end
+
private
# The migration input data directory.
- FIXTURES = File.dirname(__FILE__) + '/../../../../examples/galena/data'
+ FIXTURES = File.join(Galena::ROOT_DIR, 'data')
+
+ # The config directory.
+ CONF_DIR = File.join(Galena::ROOT_DIR, 'conf', 'migration')
+
+ # The shims directory.
+ SHIMS_DIR = File.join(Galena::ROOT_DIR, 'lib', 'galena')
end
end
end
|
Create the migrator with the test options.
|
diff --git a/core/app/controllers/spree/admin/adjustments_controller.rb b/core/app/controllers/spree/admin/adjustments_controller.rb
index abc1234..def5678 100644
--- a/core/app/controllers/spree/admin/adjustments_controller.rb
+++ b/core/app/controllers/spree/admin/adjustments_controller.rb
@@ -1,9 +1,6 @@ module Spree
module Admin
- # Need to explicitly reference namespaced ResourceController here
- # Due to the rd_resource_controller gem, which provides a top-level
- # ResourceController module, which is obviously not inheritable from.
- class AdjustmentsController < Spree::Admin::ResourceController
+ class AdjustmentsController < ResourceController
belongs_to 'spree/order', :find_by => :number
destroy.after :reload_order
|
Revert "Inherit from namespaced ResourceController + explain why"
This workaround is not needed anymore as rd_resource_controller is now removed
This reverts commit 3959c7b9f008e6653e79674a3af1f907cf90cbb9.
|
diff --git a/db/migrate/20150205061809_make_firmware_unique_on_version_and_channel.rb b/db/migrate/20150205061809_make_firmware_unique_on_version_and_channel.rb
index abc1234..def5678 100644
--- a/db/migrate/20150205061809_make_firmware_unique_on_version_and_channel.rb
+++ b/db/migrate/20150205061809_make_firmware_unique_on_version_and_channel.rb
@@ -0,0 +1,11 @@+class MakeFirmwareUniqueOnVersionAndChannel < ActiveRecord::Migration
+ def up
+ remove_index :firmwares, :version
+ add_index :firmwares, [:version, :channel], unique: true
+ end
+
+ def down
+ remove_index :firmwares, column: [:version, :channel]
+ add_index :firmwares, :version, unique: true
+ end
+end
|
Make firmware unique on version and channel
|
diff --git a/metadata.rb b/metadata.rb
index abc1234..def5678 100644
--- a/metadata.rb
+++ b/metadata.rb
@@ -4,4 +4,4 @@ license 'Apache 2.0'
description 'System Software configuration and maintenance'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
-version '1.18.1'
+version '1.19.0'
|
Add (no-)proxy support for subversion and some smaller fixes
|
diff --git a/metadata.rb b/metadata.rb
index abc1234..def5678 100644
--- a/metadata.rb
+++ b/metadata.rb
@@ -4,8 +4,9 @@ license 'Apache 2.0'
description 'Chef Pantry is a workstation automation cookbook'
version '0.2.2'
-depends 'homebrew', '~> 2.1'
-depends 'chocolatey', '~> 0.2'
+depends 'homebrew'
+depends 'build-essential'
+depends 'chocolatey'
source_url 'https://github.com/chef-cookbooks/pantry' if respond_to?(:source_url)
issues_url 'https://github.com/chef-cookbooks/pantry/issues' if respond_to?(:issues_url)
|
Remove version constraints and depend on build-essential
Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
|
diff --git a/lib/bun/bots/catalog/ls_task.rb b/lib/bun/bots/catalog/ls_task.rb
index abc1234..def5678 100644
--- a/lib/bun/bots/catalog/ls_task.rb
+++ b/lib/bun/bots/catalog/ls_task.rb
@@ -4,8 +4,8 @@ desc "ls", "List the catalog file for the archive"
option 'archive', :aliases=>'-a', :type=>'string', :desc=>'Archive location'
def ls
- archive = Archive.new(options[:archive])
- # TODO Use Array.justify_rows
+ archive = Archive.new(:location=>options[:archive])
+ puts "Location Update File/Directory"
archive.catalog.each do |spec|
puts "#{spec[:location]} #{spec[:date].strftime('%Y/%d/%m')} #{spec[:file]}"
end
|
Add column headings to git catalog ls
|
diff --git a/lib/cinch/plugins/straw_poll.rb b/lib/cinch/plugins/straw_poll.rb
index abc1234..def5678 100644
--- a/lib/cinch/plugins/straw_poll.rb
+++ b/lib/cinch/plugins/straw_poll.rb
@@ -18,7 +18,10 @@ options << "pol pot" if mode == "pol"
response = request_poll(title.strip, options)
unless response['id'].nil?
- @bot.primary_channel.send "#{Format(:white, :blue, " VOTE ")} #{title.strip} https://strawpoll.me/#{response['id']}"
+ 3.times do
+ @bot.primary_channel.send "#{Format(:white, :blue, " VOTE ")} #{title.strip} https://strawpoll.me/#{response['id']}"
+ sleep 60
+ end
else
m.user.notice "Error: #{response['error']}"
end
|
Add repeats to vote announcement
|
diff --git a/lib/copian/collector/generic.rb b/lib/copian/collector/generic.rb
index abc1234..def5678 100644
--- a/lib/copian/collector/generic.rb
+++ b/lib/copian/collector/generic.rb
@@ -16,6 +16,7 @@ end
end
protected
+ # :stopdoc:
def load_ifnames
return if @loaded_ifnames
oid = SNMP::ObjectId.new('1.3.6.1.2.1.31.1.1.1.1')
@@ -34,6 +35,7 @@ def port_stats_collector
@port_stats_collector ||= PortStatsCollector.new(@manager)
end
+ # :startdoc:
end
end
end
|
Hide protected methods from RDoc
|
diff --git a/test/inch/cli/command/list_test.rb b/test/inch/cli/command/list_test.rb
index abc1234..def5678 100644
--- a/test/inch/cli/command/list_test.rb
+++ b/test/inch/cli/command/list_test.rb
@@ -18,6 +18,26 @@ assert_match /\bFoo::Bar#method_without_doc\b/, out
end
+ it "should run with filelist in args" do
+ out, err = capture_io do
+ @command.run("lib/**/*.rb", "app/**/*.rb")
+ end
+ refute out.empty?, "there should be some output"
+ assert err.empty?, "there should be no errors"
+ assert_match /\bFoo\b/, out
+ assert_match /\bFoo::Bar\b/, out
+ assert_match /\bFoo::Bar#method_with_full_doc\b/, out
+ assert_match /\bFoo::Bar#method_without_doc\b/, out
+ end
+
+ it "should run with non-existing filelist in args" do
+ out, err = capture_io do
+ @command.run("app/**/*.rb")
+ end
+ assert out.empty?, "there should be no output"
+ assert err.empty?, "there should be no errors"
+ end
+
it "should output info when run with --help" do
out, err = capture_io do
assert_raises(SystemExit) { @command.run("--help") }
|
Add test for path assignment with *args
|
diff --git a/app/models/transfer.rb b/app/models/transfer.rb
index abc1234..def5678 100644
--- a/app/models/transfer.rb
+++ b/app/models/transfer.rb
@@ -20,8 +20,8 @@ attr_accessor :source, :destination, :amount, :hours, :minutes
def make_movements
- movements.create(account: Account.find(source), amount: -amount.to_i)
- movements.create(account: Account.find(destination), amount: amount.to_i)
+ movements.create(account: Account.find(source_id), amount: -amount.to_i)
+ movements.create(account: Account.find(destination_id), amount: amount.to_i)
end
def movement_from
@@ -31,4 +31,12 @@ def movement_to
movements.detect {|m| m.amount > 0 }
end
+
+ def source_id
+ source.respond_to?(:id) ? source.id : source
+ end
+
+ def destination_id
+ destination.respond_to?(:id) ? destination.id : destination
+ end
end
|
Remove depreceations about using Model.find(instance)
|
diff --git a/callcredit.gemspec b/callcredit.gemspec
index abc1234..def5678 100644
--- a/callcredit.gemspec
+++ b/callcredit.gemspec
@@ -7,7 +7,7 @@ gem.add_runtime_dependency 'unicode_utils', '~> 1.4.0'
gem.add_development_dependency 'rspec', '~> 3.8.0'
- gem.add_development_dependency 'webmock', '~> 3.6.0'
+ gem.add_development_dependency 'webmock', '~> 3.7.0'
gem.add_development_dependency 'rubocop'
gem.authors = ['Grey Baker']
|
Update webmock requirement from ~> 3.6.0 to ~> 3.7.0
Updates the requirements on [webmock](https://github.com/bblimke/webmock) to permit the latest version.
- [Release notes](https://github.com/bblimke/webmock/releases)
- [Changelog](https://github.com/bblimke/webmock/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bblimke/webmock/compare/v3.6.0...v3.7.0)
Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>
|
diff --git a/db/migrate/20200327172134_convert_training_modules_to_utf8_mb4.rb b/db/migrate/20200327172134_convert_training_modules_to_utf8_mb4.rb
index abc1234..def5678 100644
--- a/db/migrate/20200327172134_convert_training_modules_to_utf8_mb4.rb
+++ b/db/migrate/20200327172134_convert_training_modules_to_utf8_mb4.rb
@@ -1,8 +1,10 @@ class ConvertTrainingModulesToUtf8Mb4 < ActiveRecord::Migration[6.0]
def change
+ remove_index :training_slides, :slug, unique: true;
execute "ALTER TABLE training_slides ROW_FORMAT=DYNAMIC"
execute "ALTER TABLE training_slides CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"
execute "ALTER TABLE training_slides MODIFY content TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"
execute "ALTER TABLE training_slides MODIFY translations TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"
+ add_index :training_slides, :slug, unique: true;
end
end
|
Remove and re-add training slug index
This may let us work around the index size problem.
|
diff --git a/RxNimble.podspec b/RxNimble.podspec
index abc1234..def5678 100644
--- a/RxNimble.podspec
+++ b/RxNimble.podspec
@@ -17,4 +17,6 @@ s.dependency "Nimble", "~> 3.0"
s.dependency "RxSwift", "~> 2.0"
s.dependency "RxBlocking", "~> 2.0"
+
+ s.pod_target_xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => '$(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks"' }
end
|
Update Framework Search Paths to include XCTest
|
diff --git a/cashmonies.gemspec b/cashmonies.gemspec
index abc1234..def5678 100644
--- a/cashmonies.gemspec
+++ b/cashmonies.gemspec
@@ -21,4 +21,6 @@ spec.add_development_dependency "bundler", "~> 1.6"
spec.add_development_dependency "rake"
spec.add_development_dependency "rspec"
+ spec.add_development_dependency "pry"
+ spec.add_development_dependency "rubocop"
end
|
Add some utility gems for development.
|
diff --git a/lib/droplet_kit/mappings/ssh_key_mapping.rb b/lib/droplet_kit/mappings/ssh_key_mapping.rb
index abc1234..def5678 100644
--- a/lib/droplet_kit/mappings/ssh_key_mapping.rb
+++ b/lib/droplet_kit/mappings/ssh_key_mapping.rb
@@ -7,11 +7,11 @@ root_key singular: 'ssh_key', plural: 'ssh_keys', scopes: [:read]
property :id, :fingerprint, :public_key, :name,
- scopes: :read
+ scopes: [:read]
- property :name, :public_key, scopes: :create
+ property :name, :public_key, scopes: [:create]
- property :name, scopes: :update
+ property :name, scopes: [:update]
end
end
end
|
Fix SshKeyMapping scopes - should be arrays.
|
diff --git a/lib/g5_authenticatable_api/grape_helpers.rb b/lib/g5_authenticatable_api/grape_helpers.rb
index abc1234..def5678 100644
--- a/lib/g5_authenticatable_api/grape_helpers.rb
+++ b/lib/g5_authenticatable_api/grape_helpers.rb
@@ -5,7 +5,8 @@ if access_token
validate_access_token
else
- throw :error, status: 401,
+ throw :error, message: 'Unauthorized',
+ status: 401,
headers: {'WWW-Authenticate' => authenticate_header}
end
end
@@ -33,7 +34,8 @@ begin
g5_auth_client.token_info
rescue OAuth2::Error => error
- throw :error, status: 401,
+ throw :error, message: 'Unauthorized',
+ status: 401,
headers: {'WWW-Authenticate' => authenticate_header(error)}
end
end
|
Add error message to 401 response body
|
diff --git a/lib/xcode-installer/download.rb b/lib/xcode-installer/download.rb
index abc1234..def5678 100644
--- a/lib/xcode-installer/download.rb
+++ b/lib/xcode-installer/download.rb
@@ -1,23 +1,25 @@ #
# XcodeInstaller::Download (Command Class)
#
+# Determines the requested Xcode release (with the help of the ReleaseManager class) and handles the download, showing a progress bar with ETA.
#
module XcodeInstaller
class Download
+ attr_accessor :release
def action(args, options)
mgr = XcodeInstaller::ReleaseManager.new
- release = mgr.get_release(nil, options.pre_release)
+ @release = mgr.get_release(options.release, options.pre_release)
if release
- xcode_url = release['download_url']
+ xcode_url = @release['download_url']
else
puts "No Xcode release with number #{options.release}. Use the 'list' command to see a list of known releases."
exit
end
- puts "Downloading Xcode #{release['version']}"
+ puts "Downloading Xcode #{@release['version']}"
puts xcode_url
agent.verbose = options.verbose
|
Store release information in a property and ensure to pass the requested release down to ReleaseManager
|
diff --git a/lib/sastrawi/dictionary/array_dictionary.rb b/lib/sastrawi/dictionary/array_dictionary.rb
index abc1234..def5678 100644
--- a/lib/sastrawi/dictionary/array_dictionary.rb
+++ b/lib/sastrawi/dictionary/array_dictionary.rb
@@ -28,6 +28,10 @@
@words.push(word)
end
+
+ def remove(word)
+ @words.delete(word)
+ end
end
end
end
|
Add function to remove word from dictionary
|
diff --git a/lib/windows_store/push_notification/tile.rb b/lib/windows_store/push_notification/tile.rb
index abc1234..def5678 100644
--- a/lib/windows_store/push_notification/tile.rb
+++ b/lib/windows_store/push_notification/tile.rb
@@ -4,8 +4,11 @@ def to_s
return %Q(
<tile>
- <visual>
- <binding template="TileWideText01">
+ <visual version="2">
+ <binding template="TileWide310x150Text01" fallback="TileWideText01">
+ <text id="1">#{text}</text>
+ </binding>
+ <binding template="TileSquare150x150Text01" fallback="TileSquareText01">
<text id="1">#{text}</text>
</binding>
</visual>
|
ADD square title type (Tile)
|
diff --git a/lib/puppet/util/es_instance_validator.rb b/lib/puppet/util/es_instance_validator.rb
index abc1234..def5678 100644
--- a/lib/puppet/util/es_instance_validator.rb
+++ b/lib/puppet/util/es_instance_validator.rb
@@ -10,6 +10,13 @@ def initialize(instance_server, instance_port)
@instance_server = instance_server
@instance_port = instance_port
+
+ # Avoid deprecation warnings in Puppet versions < 4
+ if Facter.value(:puppetversion).split('.').first.to_i < 4
+ @timeout = Puppet[:configtimeout]
+ else
+ @timeout = Puppet[:http_connect_timeout]
+ end
end
# Utility method; attempts to make an https connection to the Elasticsearch instance.
@@ -18,7 +25,7 @@ #
# @return true if the connection is successful, false otherwise.
def attempt_connection
- Timeout::timeout(Puppet[:configtimeout]) do
+ Timeout::timeout(@timeout) do
begin
TCPSocket.new(@instance_server, @instance_port).close
true
|
Fix deprecated access to configtimeout in Puppet >= 4
|
diff --git a/db/migrate/20080612111014_add_event_path.rb b/db/migrate/20080612111014_add_event_path.rb
index abc1234..def5678 100644
--- a/db/migrate/20080612111014_add_event_path.rb
+++ b/db/migrate/20080612111014_add_event_path.rb
@@ -0,0 +1,9 @@+class AddEventPath < ActiveRecord::Migration
+ def self.up
+ add_column :events, :path, :string, :limit => 255
+ end
+
+ def self.down
+ remove_column :events, :path
+ end
+end
|
Migrate events to add path
|
diff --git a/spec/git_helper.rb b/spec/git_helper.rb
index abc1234..def5678 100644
--- a/spec/git_helper.rb
+++ b/spec/git_helper.rb
@@ -10,6 +10,8 @@
def git_init
`git init`
+ `git config user.name TEST`
+ `git config user.email TEST`
end
def git_add_file(name, &block)
|
Add git config settings after repository initialization
|
diff --git a/spool_pool.gemspec b/spool_pool.gemspec
index abc1234..def5678 100644
--- a/spool_pool.gemspec
+++ b/spool_pool.gemspec
@@ -1,11 +1,11 @@ Gem::Specification.new do |s|
s.name = "spool_pool"
- s.version = "0.1"
+ s.version = "0.2"
s.required_ruby_version = ">= 1.9.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Sven Riedel"]
- s.date = %q{2010-02-07}
+ s.date = %q{2010-02-11}
s.description = %q{A simple library for spooler pools.}
s.summary = %q{A simple library for spooler pools.}
s.email = %q{sr@gimp.org}
@@ -17,6 +17,7 @@ s.extra_rdoc_files = %W{ LICENSE.txt README.rdoc }
s.files = %W{ LICENSE.txt
README.rdoc
+ History.rdoc
TODOs
lib/spool_pool.rb
lib/spool_pool/pool.rb
@@ -27,6 +28,7 @@ spec/spool_pool/spool_spec.rb
spec/spool_pool/file_spec.rb
test_spool
+ scripts/perf_test.rb
}
end
|
Update gemspec; bump version to 0.2
|
diff --git a/spec/reporters/state_reporter_spec.rb b/spec/reporters/state_reporter_spec.rb
index abc1234..def5678 100644
--- a/spec/reporters/state_reporter_spec.rb
+++ b/spec/reporters/state_reporter_spec.rb
@@ -25,11 +25,11 @@ end
it "publishes notifications of given type" do
- reporter.notify('build:started', :log => "...")
+ reporter.notify('build:started', :hostname => "giove.local")
sleep 0.5
meta, payload = queue.get
- decode(payload).should == { :log => "..." }
+ decode(payload).should == { :hostname => "giove.local" }
meta.properties.type.should == "build:started"
end
end
|
Use different paylods in tests
|
diff --git a/examples/twitter.rb b/examples/twitter.rb
index abc1234..def5678 100644
--- a/examples/twitter.rb
+++ b/examples/twitter.rb
@@ -22,16 +22,16 @@
element :id, Integer
element :text, String
- element :created_at, Time
- element :source, String
- element :truncated, Boolean
- element :in_reply_to_status_id, Integer
- element :in_reply_to_user_id, Integer
- element :favorited, Boolean
- has_one :user, User
+ element :created_at, Time
+ element :source, String
+ element :truncated, Boolean
+ element :in_reply_to_status_id, Integer
+ element :in_reply_to_user_id, Integer
+ element :favorited, Boolean
+ has_one :user, User
end
statuses = Status.parse(file_contents)
statuses.each do |status|
puts status.user.name, status.user.screen_name, status.text, status.source, ''
-end+end
|
Replace tab with 2 spaces
|
diff --git a/core/thread/list_spec.rb b/core/thread/list_spec.rb
index abc1234..def5678 100644
--- a/core/thread/list_spec.rb
+++ b/core/thread/list_spec.rb
@@ -5,6 +5,13 @@ it "includes the current and main thread" do
Thread.list.should include(Thread.current)
Thread.list.should include(Thread.main)
+ end
+
+ it "includes threads of non-default thread groups" do
+ t = Thread.new { sleep }
+ ThreadGroup.new.add(t)
+ Thread.list.should include(t)
+ t.kill
end
it "does not include deceased threads" do
|
Add a spec for Thread.list with thread groups
|
diff --git a/ext/extconf.rb b/ext/extconf.rb
index abc1234..def5678 100644
--- a/ext/extconf.rb
+++ b/ext/extconf.rb
@@ -3,19 +3,8 @@
require 'mkmf'
-if RUBY_PLATFORM =~ /darwin/
- $stderr.puts "Error: native extension disabled on OS X. This will not work."
- exit 1
-end
-
-unless RUBY_PLATFORM =~ /linux/
- $stderr.puts "Error: The oboe gem will only run under linux currently."
- exit 1
-end
-
unless have_library('oboe')
- $stderr.puts "Error: Could not find the base liboboe libraries."
- exit 1
+ $stderr.puts "Error: Could not find the base liboboe libraries. No tracing will occur."
end
$libs = append_library($libs, "oboe")
@@ -26,5 +15,5 @@ $LIBS << " #{ENV["LIBS"]}"
cpp_command('g++') if RUBY_VERSION < '1.9'
-create_makefile('oboe_ext')
+create_makefile('oboe_metal')
|
Remove all failure points and update base lib naming.
|
diff --git a/features/support/rspec.rb b/features/support/rspec.rb
index abc1234..def5678 100644
--- a/features/support/rspec.rb
+++ b/features/support/rspec.rb
@@ -0,0 +1,18 @@+require 'timeout'
+
+RSpec::Matchers.define(:become) do |expected|
+ match do |block|
+ begin
+ Timeout.timeout(Capybara.default_wait_time) do
+ sleep(0.1) until expected == block.call
+ true
+ end
+ rescue TimeoutError
+ false
+ end
+ end
+
+ failure_message_for_should do |block|
+ "expected `#{block.call}' to become `#{expected}'"
+ end
+end
|
Add custom become matcher for acceptance tests
|
diff --git a/git_tracker.gemspec b/git_tracker.gemspec
index abc1234..def5678 100644
--- a/git_tracker.gemspec
+++ b/git_tracker.gemspec
@@ -15,7 +15,6 @@
gem.add_development_dependency "rspec", "~> 2.12"
gem.add_development_dependency "rspec-spies", "~> 2.0"
- gem.add_development_dependency "pry", "~> 0.9"
gem.add_development_dependency "activesupport", "~> 3.2"
gem.add_development_dependency "rake"
|
Remove development dependency on Pry
|
diff --git a/app/helpers/code_helper.rb b/app/helpers/code_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/code_helper.rb
+++ b/app/helpers/code_helper.rb
@@ -2,6 +2,7 @@
module CodeHelper
def model_file(controller)
+ controller.gsub!(/features/, 'notes')
File.join('app', 'models', "#{ controller.singularize }.rb")
end
@@ -10,6 +11,8 @@ end
def view_file(controller, action)
+ controller.gsub!(/features/, 'notes')
+ action.gsub!(/.*show/, 'show')
File.join('app', 'views', "#{ controller.pluralize }/#{ action }.html.slim")
end
|
Fix sanitisation of controller/actions names
|
diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb
index abc1234..def5678 100644
--- a/app/mailers/user_mailer.rb
+++ b/app/mailers/user_mailer.rb
@@ -3,7 +3,7 @@
def signup_email(user)
@user = user
- @twitter_message = "A8 is upgrading nutrition. Didn’t want to leave you all behind. Check out A8 here."
+ @twitter_message = "A8 is upgrading nutrition. Didn’t want to leave you all behind. Check out A8 here. @get_dose "
mail(:to => user.email, :subject => "Thanks for signing up!")
end
|
Add twitter handle to twitter message
|
diff --git a/app/models/graph/schema.rb b/app/models/graph/schema.rb
index abc1234..def5678 100644
--- a/app/models/graph/schema.rb
+++ b/app/models/graph/schema.rb
@@ -12,6 +12,11 @@
object_from_id ->(id, query_ctx) do
gid = GlobalID.parse(id)
+ possible_types = query_ctx.warden.possible_types(GraphQL::Relay::Node.interface)
+
+ return unless possible_types.map(&:name).include?(gid.model_name)
+ return unless gid.app == GlobalID.app
+
Object.const_get(gid.model_name).find(gid.model_id)
end
end
|
Check if possible type in object from id
|
diff --git a/raygun_client.gemspec b/raygun_client.gemspec
index abc1234..def5678 100644
--- a/raygun_client.gemspec
+++ b/raygun_client.gemspec
@@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = 'raygun_client'
- s.version = '0.1.8'
+ s.version = '0.1.9'
s.summary = 'Client for the Raygun API using the Obsidian HTTP client'
s.description = ' '
|
Package version is increased from 0.1.8 to 0.1.9
|
diff --git a/spec/generator_spec.rb b/spec/generator_spec.rb
index abc1234..def5678 100644
--- a/spec/generator_spec.rb
+++ b/spec/generator_spec.rb
@@ -9,16 +9,12 @@ destination File.expand_path("../tmp", __FILE__)
arguments %w(photo)
- let(:time) { Time.new.utc.strftime("%Y%m%d%H%M%S") }
-
before do
prepare_destination
run_generator
end
it 'Should create a correct migration file' do
- # @time = time
- # raise @time.to_yaml
assert_migration 'db/migrate/create_photo_colors' do |migration|
assert_match /class CreatePhotoColors/, migration
|
Remove references to time now that we're using assert_migration
|
diff --git a/spec/support/routes.rb b/spec/support/routes.rb
index abc1234..def5678 100644
--- a/spec/support/routes.rb
+++ b/spec/support/routes.rb
@@ -1,7 +1,7 @@ # Sets up use_route across controller tests, from:
# http://bit.ly/PU4Wm4 (stackoverflow)
-module ControllerHacks
+module ControllerSetup
def get(action, parameters = nil, session = nil, flash = nil)
process_action(action, parameters, session, flash, "GET")
end
@@ -37,5 +37,5 @@ # use base_image_path and so on to get to the routes.
c.include ImageManagement::Engine.routes.url_helpers
# Always use the correct route for controller tests
- c.include ControllerHacks, :type => :controller
+ c.include ControllerSetup, :type => :controller
end
|
Rename ControllerHacks so it sounds less like a temporary fix.
|
diff --git a/example_root_schema.rb b/example_root_schema.rb
index abc1234..def5678 100644
--- a/example_root_schema.rb
+++ b/example_root_schema.rb
@@ -5,7 +5,7 @@ t.integer "host_id"
end
- add_index "databases", "database"
+ add_index "databases", "database", :unique => true
add_index "databases", "master_id"
create_table "aliases", :force => true do |t|
@@ -13,7 +13,7 @@ t.string "name"
end
- add_index "aliases", "name"
+ add_index "aliases", "name", :unique => true
create_table "hosts", :force => true do |t|
t.string "hostname"
|
Set a good example using unique index
|
diff --git a/lib/docs/scrapers/yii.rb b/lib/docs/scrapers/yii.rb
index abc1234..def5678 100644
--- a/lib/docs/scrapers/yii.rb
+++ b/lib/docs/scrapers/yii.rb
@@ -8,7 +8,7 @@ HTML
version '2.0' do
- self.release = '2.0.8'
+ self.release = '2.0.9'
self.base_url = 'http://www.yiiframework.com/doc-2.0/'
self.root_path = 'index.html'
|
Update Yii documentation (2.0.9, 1.1.17)
|
diff --git a/examples/list_files.rb b/examples/list_files.rb
index abc1234..def5678 100644
--- a/examples/list_files.rb
+++ b/examples/list_files.rb
@@ -1,12 +1,47 @@ require 'gphoto2'
-# List all files
+# Recursively list folder contents with extended metadata.
+MAGNITUDES = %w[bytes KiB MiB GiB].freeze
+
+# @param [Integer] size filesize in bytes
+# @param [Integer[ precision
+# @return [String]
+def format_filesize(size, precision = 1)
+ n = 0
+
+ while size >= 1024.0 && n < MAGNITUDES.size
+ size /= 1024.0
+ n += 1
+ end
+
+ "%.#{precision}f %s" % [size, MAGNITUDES[n]]
+end
+
+# @param [CameraFolder] folder a root directory
def visit(folder)
files = folder.files
- puts "#{folder.root? ? "/ (root)" : folder.path} (#{files.size} files)"
- files.each { |file| puts file.name }
+ puts "#{folder.path} (#{files.size} files)"
+
+ files.each do |file|
+ info = file.info
+
+ name = file.name
+ # Avoid using `File#size` here to prevent having to load the data along
+ # with it.
+ size = format_filesize(info.size)
+ mtime = info.mtime.utc.iso8601
+
+ if info.has_field?(:width) && info.has_field?(:height)
+ dimensions = "#{info.width}x#{info.height}"
+ else
+ dimensions = '-'
+ end
+
+ puts "#{name.ljust(30)} #{size.rjust(12)} #{dimensions.rjust(12)} #{mtime}"
+ end
+
puts
folder.folders.each { |child| visit(child) }
|
Update list files example to include file metadata
|
diff --git a/site-cookbooks/dna/recipes/apache2.rb b/site-cookbooks/dna/recipes/apache2.rb
index abc1234..def5678 100644
--- a/site-cookbooks/dna/recipes/apache2.rb
+++ b/site-cookbooks/dna/recipes/apache2.rb
@@ -9,6 +9,10 @@ template "#{node['sprout']['home']}/Sites/tools/setdocroot.php" do
source "setdocroot.php"
owner node['current_user']
+end
+
+execute "fix permissions on docroot" do
+ command "chmod -R 755 #{node['sprout']['home']}/Sites/tools/setdocroot.php"
end
brew "djl/apache2/apache22"
|
Fix permissions of tools file
|
diff --git a/dropbox_api.gemspec b/dropbox_api.gemspec
index abc1234..def5678 100644
--- a/dropbox_api.gemspec
+++ b/dropbox_api.gemspec
@@ -23,6 +23,6 @@ spec.add_development_dependency "vcr"
spec.add_development_dependency "webmock"
- spec.add_dependency "faraday", "<= 1.0"
+ spec.add_dependency "faraday", "<= 1.1"
spec.add_dependency "oauth2", "~> 1.1"
end
|
Allow also any 1.0.x faraday dependency version.
closes #71
|
diff --git a/spec/controllers/organization_spec.rb b/spec/controllers/organization_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/organization_spec.rb
+++ b/spec/controllers/organization_spec.rb
@@ -0,0 +1,59 @@+require 'spec_helper'
+
+describe Cyclid::UI::Controllers::Organization do
+ include Rack::Test::Methods
+
+ let :user do
+ u = double('user')
+ allow(u).to receive(:username).and_return('test')
+ allow(u).to receive(:email).and_return('test@example.com')
+ allow(u).to receive(:organizations).and_return(['a','b'])
+ allow(u).to receive(:to_hash).and_return('mocked object')
+ return u
+ end
+
+ let :klass do
+ class_double(Cyclid::UI::Models::User).as_stubbed_const
+ end
+
+ before :each do
+ allow(klass).to receive(:get).and_return(user)
+
+ cfg = instance_double(Cyclid::UI::Config)
+ allow(cfg).to receive_message_chain('api.inspect').and_return('mocked object')
+ allow(cfg).to receive_message_chain('api.host').and_return('example.com')
+ allow(cfg).to receive_message_chain('api.port').and_return(9999)
+ allow(cfg).to receive_message_chain('memcached').and_return('example.com:4242')
+ allow(Cyclid).to receive(:config).and_return(cfg)
+ end
+
+ describe '#get /:name' do
+ it 'requires authentication' do
+ get 'test'
+ expect(last_response.status).to eq(302)
+ expect(last_response['Location']).to eq 'http://example.org/login'
+ end
+
+ it 'returns an organization page' do
+ set_cookie 'cyclid.token=token'
+
+ get '/test', {}, {'rack.session' => {'username' => 'test'}}
+ expect(last_response.status).to eq(200)
+ end
+ end
+
+ describe '#get /:name/job/:id' do
+ it 'requires authentication' do
+ get 'test/job/9999'
+ expect(last_response.status).to eq(302)
+ expect(last_response['Location']).to eq 'http://example.org/login'
+ end
+
+ it 'returns a job page' do
+ set_cookie 'cyclid.token=token'
+
+ get '/test/job/9999', {}, {'rack.session' => {'username' => 'test'}}
+ expect(last_response.status).to eq(200)
+ end
+ end
+end
|
Add tests for the organization endpoints
|
diff --git a/spec/unit/vagrant_butcher/env_spec.rb b/spec/unit/vagrant_butcher/env_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/vagrant_butcher/env_spec.rb
+++ b/spec/unit/vagrant_butcher/env_spec.rb
@@ -1,9 +1,11 @@ require 'spec_helper.rb'
describe Vagrant::Butcher::Env do
+
subject { described_class.new }
- it "is a valid Vagrant UI object" do
- subject.ui.should be_a Vagrant::UI::BasicScope
+ it "is a valid Vagrant 1.5+ UI object" do
+ subject.ui.should be_a(Vagrant::UI::Colored)
end
+
end
|
Fix specs for newer vagrant versions
|
diff --git a/activesupport/lib/active_support/deprecation/instance_delegator.rb b/activesupport/lib/active_support/deprecation/instance_delegator.rb
index abc1234..def5678 100644
--- a/activesupport/lib/active_support/deprecation/instance_delegator.rb
+++ b/activesupport/lib/active_support/deprecation/instance_delegator.rb
@@ -6,6 +6,7 @@ module InstanceDelegator # :nodoc:
def self.included(base)
base.extend(ClassMethods)
+ base.singleton_class.prepend(OverrideDelegators)
base.public_class_method :new
end
@@ -19,6 +20,18 @@ singleton_class.delegate(method_name, to: :instance)
end
end
+
+ module OverrideDelegators # :nodoc:
+ def warn(message = nil, callstack = nil)
+ callstack ||= caller_locations(2)
+ super
+ end
+
+ def deprecation_warning(deprecated_method_name, message = nil, caller_backtrace = nil)
+ caller_backtrace ||= caller_locations(2)
+ super
+ end
+ end
end
end
end
|
Correct caller tracking in delegated deprecation methods
|
diff --git a/lib/domgen/ruby/model.rb b/lib/domgen/ruby/model.rb
index abc1234..def5678 100644
--- a/lib/domgen/ruby/model.rb
+++ b/lib/domgen/ruby/model.rb
@@ -1,8 +1,5 @@ module Domgen
module Ruby
- class RubyAttribute < BaseParentedElement
- end
-
class RubyClass < Domgen.ParentedElement(:object_type)
attr_writer :classname
attr_reader :included_modules
@@ -34,7 +31,6 @@ end
end
- Attribute.add_extension(:ruby, Domgen::Ruby::RubyAttribute)
ObjectType.add_extension(:ruby, Domgen::Ruby::RubyClass)
DataModule.add_extension(:ruby, Domgen::Ruby::RubyModule)
end
|
Remove empty RubyAttribute extension class
|
diff --git a/db/data_migration/20131010140102_52623285_remove_unwanted_policy_teams.rb b/db/data_migration/20131010140102_52623285_remove_unwanted_policy_teams.rb
index abc1234..def5678 100644
--- a/db/data_migration/20131010140102_52623285_remove_unwanted_policy_teams.rb
+++ b/db/data_migration/20131010140102_52623285_remove_unwanted_policy_teams.rb
@@ -0,0 +1,27 @@+# https://www.pivotaltracker.com/story/show/52623285
+
+unwanted_team_emails = "
+ 'fleet@dsa.gsi.gov.uk',
+ 'casualsites@dsa.gsi.gov.uk',
+ 'competition@dsa.gsi.gov.uk',
+ 'crowncopyright@dsa.gsi.gov.uk',
+ 'dataprotection@dsa.gsi.gov.uk',
+ 'ers@dsa.gsi.gov.uk',
+ 'foi@dsa.gsi.gov.uk',
+ 'dsaposters@dsa.gsi.gov.uk',
+ 'pressoffice@dsa.gsi.gov.uk'
+"
+
+ActiveRecord::Base.connection.execute "DELETE FROM `policy_group_attachments`
+WHERE `policy_group_id` IN (
+ SELECT id FROM `policy_groups`
+ WHERE `email` IN (#{unwanted_team_emails})
+);"
+
+ActiveRecord::Base.connection.execute "DELETE FROM `edition_policy_groups`
+WHERE `policy_group_id` IN (
+ SELECT id FROM `policy_groups`
+ WHERE `email` IN (#{unwanted_team_emails})
+);"
+
+ActiveRecord::Base.connection.execute "DELETE FROM `policy_groups` WHERE `email` IN (#{unwanted_team_emails});"
|
Remove defunct unwanted policy teams.
Also removes connections to editions and
attachments (though there aren't any for these
groups).
|
diff --git a/post_install.rb b/post_install.rb
index abc1234..def5678 100644
--- a/post_install.rb
+++ b/post_install.rb
@@ -1,7 +1 @@ # This file is executed in the Rails evironment by the `rails-post-install` script
-
-PublicBody.each{|body|
- body.translations.each{|translation|
- translation.update_attribute(:locale, "en") if translation.locale == "en_NZ"
- }
-}
|
Remove old update_attribute in post-install
|
diff --git a/lib/pg-quilter/config.rb b/lib/pg-quilter/config.rb
index abc1234..def5678 100644
--- a/lib/pg-quilter/config.rb
+++ b/lib/pg-quilter/config.rb
@@ -11,7 +11,8 @@ PGSQL_HACKERS = 'pgsql-hackers'
HACKERS_ARCHIVE = 'http://www.postgresql.org/message-id'
- WORK_DIR = '/tmp/postgres'
+ # N.B.: this must be something that is accessible when fakesu-ing
+ WORK_DIR = '/app/postgres'
BAD_PATCH_SENTINEL = '.pg-quilter-patch-application-failed.sentinel'
WORK_REPO_URL = 'git@github.com:pg-quilter/postgres.git'
UPSTREAM_REPO_URL = 'git@github.com:postgres/postgres.git'
|
Fix workdir (easier than linking dir for fakesu)
|
diff --git a/lib/rack/handler/puma.rb b/lib/rack/handler/puma.rb
index abc1234..def5678 100644
--- a/lib/rack/handler/puma.rb
+++ b/lib/rack/handler/puma.rb
@@ -4,12 +4,26 @@ module Rack
module Handler
module Puma
- DEFAULT_OPTIONS = {:Host => '0.0.0.0', :Port => 8080, :Threads => '0:16'}
+ DEFAULT_OPTIONS = {
+ :Host => '0.0.0.0',
+ :Port => 8080,
+ :Threads => '0:16',
+ :Quiet => false
+ }
def self.run(app, options = {})
options = DEFAULT_OPTIONS.merge(options)
+
+ unless options[:Quiet]
+ app = Rack::CommonLogger.new(app, STDOUT)
+ end
+
server = ::Puma::Server.new(app)
min, max = options[:Threads].split(':', 2)
+
+ puts "Puma #{::Puma::Const::PUMA_VERSION} starting..."
+ puts "* Min threads: #{min}, max threads: #{max}"
+ puts "* Listening on tcp://#{options[:Host]}:#{options[:Port]}"
server.add_tcp_listener options[:Host], options[:Port]
server.min_threads = Integer(min)
@@ -23,7 +37,8 @@ {
"Host=HOST" => "Hostname to listen on (default: localhost)",
"Port=PORT" => "Port to listen on (default: 8080)",
- "Threads=MIN:MAX" => "min:max threads to use (default 0:16)"
+ "Threads=MIN:MAX" => "min:max threads to use (default 0:16)",
+ "Quiet" => "Don't report each request"
}
end
end
|
Add output when used via rackup
|
diff --git a/lib/rtemplate/sinatra.rb b/lib/rtemplate/sinatra.rb
index abc1234..def5678 100644
--- a/lib/rtemplate/sinatra.rb
+++ b/lib/rtemplate/sinatra.rb
@@ -0,0 +1,37 @@+# Support for RTemplate in your Sinatra app.
+#
+# require 'rtemplate/sinatra'
+#
+# class App < Sinatra::Base
+# include RTemplate::Sinatra
+# end
+require 'rtemplate'
+
+class RTemplate
+ module Sinatra
+ def rtemplate(template, options={}, locals={})
+ render :rtemplate, template, options, locals
+ end
+
+ def render_rtemplate(template, data, options, locals, &block)
+ name = RTemplate.new.classify(template.to_s)
+
+ if defined?(Views) && Views.const_defined?(name)
+ instance = Views.const_get(name).new
+ elsif template == :layout
+ instance = RTemplate.new
+ else
+ raise "Can't find Views::#{name}. Did you require it\?"
+ end
+
+ locals.each do |local, value|
+ instance[local] = value
+ end
+
+ instance[:yield] = block.call if block
+
+ instance.template = data
+ instance.to_html
+ end
+ end
+end
|
Add Sinatra support, layouts and all. Whoopie!
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.