diff stringlengths 65 26.7k | message stringlengths 7 9.92k |
|---|---|
diff --git a/lib/specjour/cpu.rb b/lib/specjour/cpu.rb
index abc1234..def5678 100644
--- a/lib/specjour/cpu.rb
+++ b/lib/specjour/cpu.rb
@@ -1,12 +1,12 @@ module Specjour
module CPU
- # copied from github.com/grosser/parallel
+ # inspired by github.com/grosser/parallel
def self.cores
case RUBY_PLATFORM
when /darwin/
`hwprefs cpu_count`.to_i
when /linux/
- `cat /proc/cpuinfo | grep --count processor`.to_i
+ `grep --count processor /proc/cpuinfo`.to_i
end
end
end
| Use grep as it was intended, no more piping!
|
diff --git a/lib/spree_social.rb b/lib/spree_social.rb
index abc1234..def5678 100644
--- a/lib/spree_social.rb
+++ b/lib/spree_social.rb
@@ -1,5 +1,5 @@ require 'spree_core'
-require 'spree_auth_devise'
+require 'solidus_auth_devise'
require 'omniauth-twitter'
require 'omniauth-facebook'
require 'omniauth-github'
| Modify Require For Solidus Auth Devise
For the spree_social gem to work, we need to require solidus over spree
auth devise.
|
diff --git a/spec/controllers/pages_controller_spec.rb b/spec/controllers/pages_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/pages_controller_spec.rb
+++ b/spec/controllers/pages_controller_spec.rb
@@ -4,7 +4,7 @@ render_views
%w(about_us faq).each do |page|
- %w(en fr pt ru).each do |locale|
+ %w(en es fr pt ru).each do |locale|
context "on GET to /#{locale}/#{page}" do
before do
get :show, id: page, locale: locale
| Add es as a valid locale to the PagesController specs
|
diff --git a/linux_admin.gemspec b/linux_admin.gemspec
index abc1234..def5678 100644
--- a/linux_admin.gemspec
+++ b/linux_admin.gemspec
@@ -22,11 +22,12 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]
- spec.add_development_dependency "bundler", "~> 1.3"
+ spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "rake"
- spec.add_development_dependency "rspec", "~> 2.13"
+ spec.add_development_dependency "rspec", "~> 2.13"
spec.add_development_dependency "coveralls"
+ spec.add_dependency "inifile", "~> 2.0.2"
spec.add_dependency "more_core_extensions"
spec.add_dependency "nokogiri"
end
| Add gem to parse files with ini type contents
|
diff --git a/period.gemspec b/period.gemspec
index abc1234..def5678 100644
--- a/period.gemspec
+++ b/period.gemspec
@@ -18,6 +18,8 @@
spec.require_paths = ['lib']
+ spec.required_ruby_version = '>= 2.0.0'
+
spec.add_dependency 'activesupport', '>= 3.0.0'
spec.add_development_dependency 'rake'
| Set required Ruby version to 2.0.0
|
diff --git a/src/jenkins_api.rb b/src/jenkins_api.rb
index abc1234..def5678 100644
--- a/src/jenkins_api.rb
+++ b/src/jenkins_api.rb
@@ -1,5 +1,10 @@ module Jenkins
module Api
+
+ if ENV['http_proxy']
+ uri = URI.parse(ENV['http_proxy'])
+ http_proxy uri.host, uri.port
+ end
@error
def self.error
| Support connecting through an HTTP proxy
Apply to httparty based methods in the Jenkins API gem as well.
|
diff --git a/active_decorator-graphql.gemspec b/active_decorator-graphql.gemspec
index abc1234..def5678 100644
--- a/active_decorator-graphql.gemspec
+++ b/active_decorator-graphql.gemspec
@@ -17,12 +17,12 @@ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
spec.require_paths = ["lib"]
- spec.add_development_dependency "bundler", "~> 1.15"
- spec.add_development_dependency "pry-byebug", "~> 3.0"
- spec.add_development_dependency "rake", "~> 10.0"
- spec.add_development_dependency "rspec", "~> 3.0"
+ spec.add_development_dependency "bundler"
+ spec.add_development_dependency "pry-byebug"
+ spec.add_development_dependency "rake"
+ spec.add_development_dependency "rspec"
- spec.add_dependency "active_decorator"
- spec.add_dependency "graphql"
- spec.add_dependency "rails"
+ spec.add_runtime_dependency "active_decorator"
+ spec.add_runtime_dependency "graphql"
+ spec.add_runtime_dependency "rails"
end
| Update gem dependent versions in gemspec.
|
diff --git a/valvat_cache.gemspec b/valvat_cache.gemspec
index abc1234..def5678 100644
--- a/valvat_cache.gemspec
+++ b/valvat_cache.gemspec
@@ -20,7 +20,7 @@ spec.require_paths = ["lib"]
spec.add_development_dependency "valvat"
- spec.add_development_dependency "bundler", "~> 1.11"
+ spec.add_development_dependency "bundler", "~> 1.11.2"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "rspec", "~> 3.0"
end
| Set bundler version to 1.11.2
|
diff --git a/app/models/carto/notification.rb b/app/models/carto/notification.rb
index abc1234..def5678 100644
--- a/app/models/carto/notification.rb
+++ b/app/models/carto/notification.rb
@@ -8,6 +8,7 @@
belongs_to :organization, inverse_of: :notifications
+ # TODO: `icon` should be a restricted list of values
validates :icon, presence: true
validates :recipients, inclusion: { in: [nil, 'builders', 'viewers', 'all'] }
validates :recipients, presence: true, if: :organization
| Add reminder to validate `icon`
|
diff --git a/app/models/tutorial_enrolment.rb b/app/models/tutorial_enrolment.rb
index abc1234..def5678 100644
--- a/app/models/tutorial_enrolment.rb
+++ b/app/models/tutorial_enrolment.rb
@@ -7,4 +7,21 @@
# Always add a unique index to the DB to prevent new records from passing the validations when checked at the same time before being written
validates_uniqueness_of :tutorial, :scope => :project, message: 'already exists for the selected student'
+
+ # Only one tutorial enrolment per stream for each project
+ validate :already_enrolled_in_tutorial_stream
+
+ # Ensure that student cannot enrol in tutorial of different campus
+ # TODO (stream)
+ # validate :campus_must_be_same
+
+
+ def already_enrolled_in_tutorial_stream
+ project.tutorial_enrolments.each do |tutorial_enrolment|
+ # If tutorial stream matches, check whether we are updating the current enrolment
+ if tutorial.tutorial_stream.eql? tutorial_enrolment.tutorial.tutorial_stream and tutorial.id != tutorial_enrolment.tutorial.id
+ errors.add :project, "already enrolled in a tutorial with same tutorial stream"
+ end
+ end
+ end
end
| ENHANCE: Validate if already enrolled in tutorial stream
|
diff --git a/Casks/navicat-premium.rb b/Casks/navicat-premium.rb
index abc1234..def5678 100644
--- a/Casks/navicat-premium.rb
+++ b/Casks/navicat-premium.rb
@@ -1,6 +1,6 @@ cask :v1 => 'navicat-premium' do
- version '11.1.15'
- sha256 'c1ba91359da1da4c1a8ebc437abf62c14b03d94e843bb04a76d30c19cb840e39'
+ version '11.1.16'
+ sha256 '940a7c343e9b0fd97141411e871c540b8ddf48cf2afbfd7c531cbfccc17c5a72'
url "http://download.navicat.com/download/navicat#{version.sub(%r{^(\d+)\.(\d+).*},'\1\2')}_premium_en.dmg"
name 'Navicat Premium'
| Upgrade Navicat Premium to 11.1.16.
|
diff --git a/RZTransitions.podspec b/RZTransitions.podspec
index abc1234..def5678 100644
--- a/RZTransitions.podspec
+++ b/RZTransitions.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |s|
s.name = "RZTransitions"
- s.version = "1.2"
+ s.version = "1.2.1"
s.summary = "RZTransitions is a library to help make iOS7 custom View Controller transitions slick and simple."
s.description = <<-DESC
@@ -19,7 +19,7 @@ s.social_media_url = "http://twitter.com/raizlabs"
s.platform = :ios, "7.0"
- s.source = { :git => "https://github.com/Raizlabs/RZTransitions.git", :tag => "1.2" }
+ s.source = { :git => "https://github.com/Raizlabs/RZTransitions.git", :tag => "1.2.1" }
s.source_files = "RZTransitions/**/*.{h,m,swift}"
s.frameworks = "CoreGraphics", "UIKit", "Foundation"
s.requires_arc = true
| Update the podspec to version 1.2.1
|
diff --git a/rails_translation_manager.gemspec b/rails_translation_manager.gemspec
index abc1234..def5678 100644
--- a/rails_translation_manager.gemspec
+++ b/rails_translation_manager.gemspec
@@ -24,4 +24,5 @@ spec.add_development_dependency "bundler"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "minitest"
+ spec.add_development_dependency "rspec"
end
| Add RSpec as a dependency
We're transitioning the app from Minitest to RSpec and RSpec will be needed
in the following commits as we add some locale checking logic to the
codebase.
|
diff --git a/react-native-instabug-sdk.podspec b/react-native-instabug-sdk.podspec
index abc1234..def5678 100644
--- a/react-native-instabug-sdk.podspec
+++ b/react-native-instabug-sdk.podspec
@@ -13,6 +13,7 @@ s.source = { git: package[:repository][:url] }
s.source_files = "ios/*"
s.platform = :ios, "8.0"
+ s.frameworks = ["Instabug"]
s.dependency "Instabug"
end
| Add Instabug to search frameworks
|
diff --git a/reagan.gemspec b/reagan.gemspec
index abc1234..def5678 100644
--- a/reagan.gemspec
+++ b/reagan.gemspec
@@ -8,14 +8,18 @@ s.description = s.summary
s.authors = ['Tim Smith']
s.email = 'tim@cozy.co'
+
s.add_dependency 'octokit', '~> 3.0'
s.add_dependency 'chef', '~> 11.0'
s.add_dependency 'ridley', '~> 4.0'
s.add_development_dependency 'rake', '~> 10.0'
+
s.files = %w(Rakefile README.md LICENSE bin/reagan reagan.yml.EXAMPLE reagan_test.yml.EXAMPLE) + Dir.glob('lib/*')
s.homepage =
'http://www.github.com/tas50/reagan'
s.license = 'Apache-2.0'
s.executables << 'reagan'
s.required_ruby_version = '>= 1.9.3'
+ s.extra_rdoc_files = ['README.md']
+ s.rdoc_options = ['--line-numbers', '--inline-source', '--title', 'reagan', '--main', 'README.md']
end
| Add rdoc setup in the gemspec
|
diff --git a/test/test_helper.rb b/test/test_helper.rb
index abc1234..def5678 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -7,4 +7,16 @@ fixtures :all
# Add more helper methods to be used by all tests here...
+ def login_as(user)
+ session[:user_id] = users(user).id
+ end
+
+ def logout
+ session.delete :user_id
+ end
+
+ def setup
+ login_as :one if defined? session
+ end
+
end
| Add login/logout helpers to tests
|
diff --git a/test/test_helper.rb b/test/test_helper.rb
index abc1234..def5678 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -1,6 +1,6 @@ require 'simplecov'
SimpleCov.start
-SimpleCov.minimum_coverage 66
+SimpleCov.minimum_coverage 86
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
| Increase test coverage limit to 86%
|
diff --git a/recipes/_service.rb b/recipes/_service.rb
index abc1234..def5678 100644
--- a/recipes/_service.rb
+++ b/recipes/_service.rb
@@ -9,7 +9,7 @@
# Allow local access over port 4001
if node[:etcd][:local]
- args << " -cl 0.0.0.0"
+ args << " -cl 0.0.0.0 -sl 0.0.0.0"
end
if node.run_state.has_key? :etcd_slave and node.run_state[:etcd_slave] == true
| Fix local args. add "-sl 0.0.0.0"
|
diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb
index abc1234..def5678 100644
--- a/spec/dummy/config/application.rb
+++ b/spec/dummy/config/application.rb
@@ -11,14 +11,6 @@
module Dummy
class Application < Rails::Application
- # Load application's model / class decorators
- initializer 'spree.decorators' do |app|
- config.to_prepare do
- Dir.glob(Rails.root.join('app/**/*_decorator*.rb')) do |path|
- require_dependency(path)
- end
- end
- end
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 5.2
| Remove spree decorators initializer from dummy app
This will be added by the solidus installer and causes issues with the latest versions of solidus.
|
diff --git a/spec/lib/champaign_queue_spec.rb b/spec/lib/champaign_queue_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/champaign_queue_spec.rb
+++ b/spec/lib/champaign_queue_spec.rb
@@ -1,6 +1,14 @@ require 'champaign_queue'
describe ChampaignQueue, :sqs do
+
+ before do
+ # send stuff to the correct (fake) address
+ ChampaignQueue.client.config.endpoint = $fake_sqs.uri
+ # Queue name MUST correspond to the queue name of your AWS SQS queue!
+ ChampaignQueue.client.create_queue(queue_name: 'post_test')
+ end
+
let!(:campaign_page) {
create(:page,
widgets: [build(:text_body_widget)],
@@ -8,10 +16,13 @@ campaign: build(:campaign)
)
}
- context 'when pushing a new campaign page object to the message queue' do
+ context 'when pushing a new campaign page object to the message queue', :sqs do
let(:params) {campaign_page.as_json}
+ let(:expected_params) {params.to_json}
it 'adds an object to the queue that corresponds to that page' do
ChampaignQueue::SqsPusher.push(params)
+ results = ChampaignQueue::SqsPoller.poll
+ expect(results.messages.first.body).to eq(expected_params)
end
end
end
| Add spec for pushing page data into a local fake SQS.
|
diff --git a/recipes/ec2.rb b/recipes/ec2.rb
index abc1234..def5678 100644
--- a/recipes/ec2.rb
+++ b/recipes/ec2.rb
@@ -2,7 +2,7 @@ if(node[:ec2][:instance_type] == 'm1.xlarge')
# First device comes mounted
lvm_volume_group 'vg00' do
- physical_volumes [ '/dev/xvdb', '/dev/xvdc', '/dev/xvdc', '/dev/xvde' ]
+ physical_volumes [ '/dev/xvdb', '/dev/xvdc', '/dev/xvdd', '/dev/xvde' ]
logical_volume 'data1' do
size '75%VG'
filesystem 'ext4'
| Fix typo - c was being used twice
|
diff --git a/pry-power_assert.gemspec b/pry-power_assert.gemspec
index abc1234..def5678 100644
--- a/pry-power_assert.gemspec
+++ b/pry-power_assert.gemspec
@@ -19,7 +19,7 @@ spec.require_paths = ["lib"]
spec.add_dependency "power_assert", "0.1.3"
- spec.add_dependency "pry"
+ spec.add_dependency "pry", ">= 0.9.8"
spec.add_development_dependency "bundler", "~> 1.7"
spec.add_development_dependency "rake", "~> 10.0"
| Declare versions of add_dependency pry
|
diff --git a/pronto.gemspec b/pronto.gemspec
index abc1234..def5678 100644
--- a/pronto.gemspec
+++ b/pronto.gemspec
@@ -22,7 +22,7 @@
s.add_dependency 'rugged', '~> 0.19.0'
s.add_dependency 'thor', '~> 0.18.0'
- s.add_dependency 'octokit', '~> 2.4.0'
+ s.add_dependency 'octokit', '~> 2.5.0'
s.add_dependency 'grit', '~> 2.5.0'
s.add_development_dependency 'rake', '~> 10.1.0'
s.add_development_dependency 'rspec', '~> 2.14.0'
| Update octokit version - from 2.4 to 2.5
|
diff --git a/tools/purge_archived_storages.rb b/tools/purge_archived_storages.rb
index abc1234..def5678 100644
--- a/tools/purge_archived_storages.rb
+++ b/tools/purge_archived_storages.rb
@@ -0,0 +1,28 @@+#!/usr/bin/env ruby
+require File.expand_path('../config/environment', __dir__)
+require "optimist"
+
+opts = Optimist.options do
+ opt :dry_run, "Just print out what would be done without modifying anything", :type => :boolean, :default => true
+end
+
+if opts[:dry_run]
+ puts "\n"
+ puts "* This is a dry run and will not modify the database"
+ puts "* To actually delete archived datastores pass --no-dry-run\n\n"
+end
+
+active_storage_ids = HostStorage.pluck(:storage_id).uniq
+archived_storages = Storage.where.not(:id => active_storage_ids).pluck(:id, :name)
+
+if archived_storages.empty?
+ puts "No archived storages found"
+else
+ puts "Deleting the following storages:"
+ puts archived_storages.map { |id, name| "ID [#{id}] Name [#{name}]" }.join("\n")
+end
+
+return if opts[:dry_run]
+
+archived_storage_ids = archived_storages.map(&:first)
+Storage.destroy(archived_storage_ids)
| Add a tool to purge archived storages
Storages that aren't connected to any hosts aren't automatically deleted
and thus a tool is needed to clean them up.
This looks for storages which aren't represented in the host_storages
table which means they aren't a part of any EMS and can be removed.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1721612
|
diff --git a/cookbooks/kernel/kernel-4.1.2.rb b/cookbooks/kernel/kernel-4.1.2.rb
index abc1234..def5678 100644
--- a/cookbooks/kernel/kernel-4.1.2.rb
+++ b/cookbooks/kernel/kernel-4.1.2.rb
@@ -22,5 +22,5 @@
execute "build kernel" do
user node["rbenv"]["user"]
- command "cd #{build_dir} && make && mv #{build_dir}/build/linux-4.1.2 ~/."
+ command "cd #{build_dir} && make KERNEL_VER=4.1.2 && mv #{build_dir}/build/linux-4.1.2 ~/."
end
| Add kernel version to make
|
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1,6 +1,6 @@ module ApplicationHelper
def avatar_url(user)
gravatar_id = Digest::MD5::hexdigest(user.email_address.downcase)
- "http://www.gravatar.com/avatar/#{gravatar_id}"
+ "https://www.gravatar.com/avatar/#{gravatar_id}"
end
end
| Use https for gravatar image
* To remove not secure resource warning
|
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -14,7 +14,7 @@ end
end
end
- host
+ host || admin?
end
| Correct `event_host?` to also include admins.
|
diff --git a/spec/config_spec.rb b/spec/config_spec.rb
index abc1234..def5678 100644
--- a/spec/config_spec.rb
+++ b/spec/config_spec.rb
@@ -13,6 +13,15 @@ expect(chef_run).to create_directory('/etc/coopr/conf.chef')
end
+ %w(
+ coopr-site.xml
+ provisioner-site.xml
+ ).each do |file|
+ it "creates #{file} from template" do
+ expect(chef_run).to create_template("/etc/coopr/conf.chef/#{file}")
+ end
+ end
+
it 'runs execute[update coopr-conf alternatives]' do
expect(chef_run).to run_execute('update coopr-conf alternatives')
end
| Test templates and get 100% coverage
|
diff --git a/spec/models/user.rb b/spec/models/user.rb
index abc1234..def5678 100644
--- a/spec/models/user.rb
+++ b/spec/models/user.rb
@@ -7,7 +7,7 @@
referenced_in :site, :inverse_of => :users
references_many :articles, :foreign_key => :author_id
- references_many :comments, :dependent => :destroy, :autosave => true, :index => true
+ references_many :comments, :dependent => :destroy, :autosave => true
references_and_referenced_in_many :children, :class_name => "User"
references_one :record
| Remove option that caused exception
Fixes
```
Invalid option :index provided to relation :comments. Valid options are:
as, autosave, dependent, foreign_key, order, class_name, extend,
inverse_class_name, inverse_of, name, relation, validate.
(Mongoid::Errors::InvalidOptions)
```
when running `rake`
All specs now pass.
|
diff --git a/spec/sample_jobs.rb b/spec/sample_jobs.rb
index abc1234..def5678 100644
--- a/spec/sample_jobs.rb
+++ b/spec/sample_jobs.rb
@@ -41,7 +41,7 @@ self.class.messages << 'perform'
end
- def after(job, error = nil)
+ def after(job)
self.class.messages << 'after'
end
| Remove arg from sample job |
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -6,6 +6,7 @@
require 'action_dispatch/railtie'
+$:<< 'lib'
require 'biceps'
# Load support files
| Add the local lib file to the LOAD_PATH
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -22,13 +22,13 @@ end
def mock_mapper(model_class)
- klass = Class.new(DataMapper::Mapper) do
+ Class.new(DataMapper::Mapper) do
+ model model_class
+
def inspect
"#<#{self.class.model}Mapper:#{object_id} model=#{self.class.model}>"
end
end
- klass.model model_class
- klass
end
def clear_mocked_models
| Revert "Workaround a problem with Mapper.inherited on 1.8.7"
This reverts commit 7b374383aa448f6c217ac617417d8f36b679b07a.
The Mapper.inherited hook was previously removed
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,5 +1,5 @@-require 'slack-ruby-bot/rspec'
-require 'bunny-mock'
+# require 'slack-ruby-bot/rspec'
+# require 'bunny-mock'
require 'rspec'
require_relative '../word_list'
| Comment out unneeded stuff from spec helper
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -19,4 +19,8 @@ config.filter_run :focus
config.run_all_when_everything_filtered = true
config.warnings = true
+
+ config.after(:suite) do
+ WebMock.disable_net_connect!(allow: "codeclimate.com")
+ end
end
| Allow HTTP connection to codeclimate for sending code coverage
|
diff --git a/lib/dry/web/roda/application.rb b/lib/dry/web/roda/application.rb
index abc1234..def5678 100644
--- a/lib/dry/web/roda/application.rb
+++ b/lib/dry/web/roda/application.rb
@@ -36,6 +36,10 @@ def self.root
config.container.config.root
end
+
+ def notifications
+ self.class[:notifications]
+ end
end
end
end
| Add a shortcut for :notifications
|
diff --git a/lib/kahuna_client/connection.rb b/lib/kahuna_client/connection.rb
index abc1234..def5678 100644
--- a/lib/kahuna_client/connection.rb
+++ b/lib/kahuna_client/connection.rb
@@ -1,3 +1,4 @@+require 'logger'
require 'faraday_middleware'
Dir[File.expand_path('../../faraday/*.rb', __FILE__)].each{|f| require f}
@@ -25,7 +26,7 @@ connection.use Faraday::Response::ParseJson
end
connection.use FaradayMiddleware::RaiseHttpException
- connection.use Faraday::Response::Logger if debug
+ connection.use Faraday::Response::Logger, ::Logger.new(STDOUT), {:bodies => true} if debug
connection.adapter(adapter)
end
end
| Debug the request body in addition to response, when the :debug is enabled
|
diff --git a/app/admin/dashboard.rb b/app/admin/dashboard.rb
index abc1234..def5678 100644
--- a/app/admin/dashboard.rb
+++ b/app/admin/dashboard.rb
@@ -1,3 +1,4 @@+# encoding: UTF-8
ActiveAdmin.register_page "Dashboard" do
menu :priority => 1, :label => proc{ I18n.t("active_admin.dashboard") }
| Add explicit uft-8 encoding marker.
|
diff --git a/app/exporters/users.rb b/app/exporters/users.rb
index abc1234..def5678 100644
--- a/app/exporters/users.rb
+++ b/app/exporters/users.rb
@@ -2,13 +2,19 @@ class Users < Base
def current_students
+ export_for_season(Season.current)
+ end
+
+ private
+
+ def export_for_season(season)
students = User.with_role('student').with_team_kind(%w(sponsored voluntary)).
- where("teams.season_id" => Season.current)
+ where("teams.season_id" => season)
generate(students, 'User ID', 'Name', 'Email', 'Country', 'Locality', 'Address', 'T-shirt size') do |u|
[u.id, u.name, u.email, u.country, u.location, u.postal_address, u.tshirt_size]
end
+ end
- end
end
end
| Make export a function of season
|
diff --git a/arrowhead/arrowhead.rb b/arrowhead/arrowhead.rb
index abc1234..def5678 100644
--- a/arrowhead/arrowhead.rb
+++ b/arrowhead/arrowhead.rb
@@ -15,19 +15,20 @@ },
}
- # FIXME: I don't have time to deal with this.
def self.classify(region, shape)
- if CLASSIFICATIONS.include? region
- shapes = CLASSIFICATIONS[region]
- if shapes.include? shape
- arrowhead = shapes[shape]
- "You have a(n) '#{arrowhead}' arrowhead. Probably priceless."
- else
- raise "Unknown shape value. Are you sure you know what you're talking about?"
- end
- else
+ unless CLASSIFICATIONS.include? region
raise "Unknown region, please provide a valid region."
end
+
+ shapes = CLASSIFICATIONS[region]
+
+ unless shapes.include? shape
+ raise "Unknown shape value. Are you sure you know what you're talking about?"
+ end
+
+ arrowhead = shapes[shape]
+
+ "You have a(n) '#{arrowhead}' arrowhead. Probably priceless."
end
end
| Move error conditions near their conditions
This was an interesting exercise. The process was actually very
straightforward, but only because I had read the Ruby Style Guide
recently. I remembered the style guide to fail out of a method
as soon as possible. That meant that I should move the code in the
outer else statement to the top to fail immediately if the
condition was met. I saw that the condition needed to be changed
from expecting true to expecting false, so I changed it to unless
instead of if. I then did the same two steps for the inner if
statement.
|
diff --git a/db/migrate/20141110063114_create_invitations.rb b/db/migrate/20141110063114_create_invitations.rb
index abc1234..def5678 100644
--- a/db/migrate/20141110063114_create_invitations.rb
+++ b/db/migrate/20141110063114_create_invitations.rb
@@ -4,7 +4,8 @@ t.belongs_to :provider, null: false, default: nil
t.belongs_to :subject, null: false, default: nil
t.string :identifier, null: false, default: nil
- t.string :email, null: false, default: nil
+ t.string :name, null: false, default: nil
+ t.string :mail, null: false, default: nil
t.boolean :used, null: false, default: false
t.timestamp :expires, null: false, default: nil
t.timestamps
| Adjust invitation columns to mirror subject better
When creating an invitation, we want to capture the name and email
address entered by the administrator for auditing purposes. If there is
ever a question about where an invite went and why somebody else claimed
it, we can look here for clues.
|
diff --git a/Casks/okapi-apps.rb b/Casks/okapi-apps.rb
index abc1234..def5678 100644
--- a/Casks/okapi-apps.rb
+++ b/Casks/okapi-apps.rb
@@ -0,0 +1,15 @@+cask 'okapi-apps' do
+ version '0.32'
+ sha256 '5d63f1ef997b05b4faa896a10a2d35ae4998648fada60230e65757a240c62c5c'
+
+ # bintray.com/okapi was verified as official when first introduced to the cask
+ url "http://dl.bintray.com/okapi/Distribution/okapi-apps_cocoa-macosx-x86_64_#{version}.dmg"
+ name 'Okapi-Apps'
+ homepage 'http://okapiframework.org/'
+
+ suite "Okapi_#{version}", target: 'Okapi'
+
+ caveats do
+ depends_on_java('8+')
+ end
+end
| Add Cask for Okapi-Apps v0.32
|
diff --git a/Casks/pycharm-ce.rb b/Casks/pycharm-ce.rb
index abc1234..def5678 100644
--- a/Casks/pycharm-ce.rb
+++ b/Casks/pycharm-ce.rb
@@ -1,6 +1,6 @@ cask :v1 => 'pycharm-ce' do
- version '4.0.3'
- sha256 '1a88ee3565d82fec595d7d15ba23d1ad67faa85a83df4f4fd0104d5ad7b1ecea'
+ version '4.0.4'
+ sha256 'abbad61e767c29ddb0f3c7bf8d8baf1d22cf9c3ff06f542dc2b5460e4ba3d252'
url "https://download.jetbrains.com/python/pycharm-community-#{version}.dmg"
name 'PyCharm'
| Update PyCharm-CE to version 4.0.4 |
diff --git a/test/support/component_helpers.rb b/test/support/component_helpers.rb
index abc1234..def5678 100644
--- a/test/support/component_helpers.rb
+++ b/test/support/component_helpers.rb
@@ -12,4 +12,38 @@ assert_equal context, component_data.fetch("context") if context
end
end
+
+ def assert_has_button_component(text, attrs = {})
+ all(shared_component_selector('button')).each do |button|
+ data = JSON.parse(button.text).symbolize_keys
+ next unless text == data.delete(:text)
+ data.delete(:extra_attrs) if data[:extra_attrs].blank?
+ return assert_equal attrs, data
+ end
+
+ fail_button_not_found(text)
+ end
+
+ def click_button_component(text)
+ selector = shared_component_selector("button")
+
+ all(selector).each do |button|
+ data = JSON.parse(button.text).symbolize_keys
+
+ next if data[:text] != text
+
+ if data.has_key?(:href)
+ return visit(data[:href])
+ else
+ form = find(selector).first(:xpath, "ancestor::form")
+ return Capybara::RackTest::Form.new(page.driver, form.native).submit({})
+ end
+ end
+
+ fail_button_not_found(text)
+ end
+
+ def fail_button_not_found(button_text)
+ fail "Button component not found with text '#{button_text}'"
+ end
end
| Add button component test helper support
|
diff --git a/lib/gds_api/test_helpers/asset_manager.rb b/lib/gds_api/test_helpers/asset_manager.rb
index abc1234..def5678 100644
--- a/lib/gds_api/test_helpers/asset_manager.rb
+++ b/lib/gds_api/test_helpers/asset_manager.rb
@@ -2,14 +2,14 @@ module TestHelpers
module AssetManager
- ASSET_ENDPOINT = Plek.current.find('asset-manager')
+ ASSET_MANAGER_ENDPOINT = Plek.current.find('asset-manager')
def asset_manager_has_an_asset(id, atts)
response = atts.merge({
"_response_info" => { "status" => "ok" }
})
- stub_request(:get, "#{ASSET_ENDPOINT}/assets/#{id}")
+ stub_request(:get, "#{ASSET_MANAGER_ENDPOINT}/assets/#{id}")
.to_return(:body => response.to_json, :status => 200)
end
@@ -18,7 +18,7 @@ "_response_info" => { "status" => "not found" }
}
- stub_request(:get, "#{ASSET_ENDPOINT}/assets/#{id}")
+ stub_request(:get, "#{ASSET_MANAGER_ENDPOINT}/assets/#{id}")
.to_return(:body => response.to_json, :status => 404)
end
end
| Rename test helper constant to match convention
|
diff --git a/config/initializers/postgresql.rb b/config/initializers/postgresql.rb
index abc1234..def5678 100644
--- a/config/initializers/postgresql.rb
+++ b/config/initializers/postgresql.rb
@@ -0,0 +1,9 @@+# Only needed for postgres-pr gem prior to version 0.6.3, for details see
+# https://rails.lighthouseapp.com/projects/8994/tickets/3210-rails-postgres-issue
+class PGconn
+
+ def self.quote_ident(name)
+ %("#{name}")
+ end
+
+end | Fix for :quote_ident issue with Postgres (thanks, Matt!)
|
diff --git a/config/initializers/redis_test.rb b/config/initializers/redis_test.rb
index abc1234..def5678 100644
--- a/config/initializers/redis_test.rb
+++ b/config/initializers/redis_test.rb
@@ -0,0 +1,19 @@+
+host = Settings.redis_host || "127.0.0.1"
+port = Settings.redis_port || 6379
+begin
+ r = Redis.new(host: host, port: port)
+ r.ping
+rescue Redis::CannotConnectError => e
+ msg = []
+ msg << ""
+ msg << "***"
+ msg << ""
+ msg << "Machiavelli Initialization Error"
+ msg << ""
+ msg << "Redis::CannotConnectError."
+ msg << "Check a redis installation exists at #{host}:#{port}"
+ msg << ""
+ msg << "***"
+ raise msg.join("\n")
+end
| Add intialiation check to confirm redis exists
Add super obvious rails error message to config/initializers to
exit out before starting the rails server in the event that the
redis server doesn't exist.
|
diff --git a/lib/puppet/provider/mountpoint/solaris.rb b/lib/puppet/provider/mountpoint/solaris.rb
index abc1234..def5678 100644
--- a/lib/puppet/provider/mountpoint/solaris.rb
+++ b/lib/puppet/provider/mountpoint/solaris.rb
@@ -12,7 +12,7 @@ line = mount.split("\n").find do |line|
File.expand_path(line.split.first) == File.expand_path(resource[:name])
end
- line =~ /^(\S+) on (\S+)/
- {:name => $1, :device => $2}
+ line =~ /^(\S*) on (\S*)(?: (\S+))?/
+ {:name => $1, :device => $2, :options => $3}
end
end
| Read the mount options from the output of mount on Solaris
In order to actually see if there are changes we need to sync on the
mount point, we also need to check if the mount options have changed.
|
diff --git a/lib/simple_form/components/label_input.rb b/lib/simple_form/components/label_input.rb
index abc1234..def5678 100644
--- a/lib/simple_form/components/label_input.rb
+++ b/lib/simple_form/components/label_input.rb
@@ -8,28 +8,20 @@ end
def label_input(context=nil)
- options[:label] == false ? deprecated_input(context) : (deprecated_label(context) + deprecated_input(context))
+ if options[:label] == false
+ deprecated_component(:input ,context)
+ else
+ deprecated_component(:label, context) + deprecated_component(:input, context)
+ end
end
private
- def deprecated_input(context)
- method = method(:input)
+ def deprecated_component(namespace ,context)
+ method = method(namespace)
if method.arity == 0
- ActiveSupport::Deprecation.warn(SimpleForm::CUSTOM_INPUT_DEPRECATION_WARN % { name: 'input' })
-
- method.call
- else
- method.call(context)
- end
- end
-
- def deprecated_label(context)
- method = method(:label)
-
- if method.arity == 0
- ActiveSupport::Deprecation.warn(SimpleForm::CUSTOM_INPUT_DEPRECATION_WARN % { name: 'label' })
+ ActiveSupport::Deprecation.warn(SimpleForm::CUSTOM_INPUT_DEPRECATION_WARN % { name: namespace })
method.call
else
| Remove duplication at the deprecated methods
|
diff --git a/lib/slippery/processors/hr_to_sections.rb b/lib/slippery/processors/hr_to_sections.rb
index abc1234..def5678 100644
--- a/lib/slippery/processors/hr_to_sections.rb
+++ b/lib/slippery/processors/hr_to_sections.rb
@@ -24,11 +24,12 @@ page = 1
element.children.each do |child|
if child.tag == :hr
- sections << @wrapper.merge_attrs(child)
+ last_section = @wrapper.merge_attrs(child)
if @anchor
- sections[-1].merge_attrs(name: "#{page}")
+ last_section = last_section.merge_attrs(name: "#{page}")
page += 1
end
+ sections << last_section
else
sections[-1] = sections.last << child
end
| Fix missing anchor due to immutability
|
diff --git a/app/workers/weighted_completeness_metric_worker.rb b/app/workers/weighted_completeness_metric_worker.rb
index abc1234..def5678 100644
--- a/app/workers/weighted_completeness_metric_worker.rb
+++ b/app/workers/weighted_completeness_metric_worker.rb
@@ -0,0 +1,12 @@+class WeightedCompletenessMetricWorker < MetricsWorker
+
+ def perform(repository_name)
+ repository = Repository.find repository_name
+ schema = JSON.parse File.read 'public/ckan-schema.json'
+ schema = self.class.symbolize_keys schema
+ weights = 'public/ckan-weight.yml'
+ metric = Metrics::WeightedCompleteness.new(weights)
+ compute(repository, metric, schema)
+ end
+
+end
| Add weighted completeness metric worker
I have added the weighted completeness metric worker which is more or
less the same code as the completeness metric code. I probably should
delegate some of the common code into the completeness metric only.
Signed-off-by: Konrad Reiche <4ff0213f56e2082fcd8c882d04c546881c579ce4@gmail.com>
|
diff --git a/calculators/bmi/bmi.rb b/calculators/bmi/bmi.rb
index abc1234..def5678 100644
--- a/calculators/bmi/bmi.rb
+++ b/calculators/bmi/bmi.rb
@@ -5,8 +5,8 @@ weight = get_field_as_float :weight_in_kg
height = get_field_as_float :height_in_m
- raise FieldError.new("weight", "must be greater than zero") if weight <= 0
- raise FieldError.new("height", "must be greater than zero") if height <= 0
+ fail FieldError.new('weight', 'must be greater than zero') if weight <= 0
+ fail FieldError.new('height', 'must be greater than zero') if height <= 0
{
value: weight / (height ** 2),
| Use fail instead of raise to throw exceptions
|
diff --git a/haproxy_log_parser.gemspec b/haproxy_log_parser.gemspec
index abc1234..def5678 100644
--- a/haproxy_log_parser.gemspec
+++ b/haproxy_log_parser.gemspec
@@ -9,7 +9,7 @@
s.add_dependency 'treetop'
- s.add_development_dependency 'rspec', '~> 2.13'
+ s.add_development_dependency 'rspec', '~> 3.5.0'
s.files = Dir.glob('lib/**/*') + [
'README.rdoc',
| Upgrade to rspec ~> 3.5.0
|
diff --git a/test/locotimezone_errors_test.rb b/test/locotimezone_errors_test.rb
index abc1234..def5678 100644
--- a/test/locotimezone_errors_test.rb
+++ b/test/locotimezone_errors_test.rb
@@ -3,7 +3,7 @@ class LocotimezoneErrorsTest < Minitest::Test
describe 'testing error handling' do
- it 'must be empty if bad request' do
+ it 'must be empty if getting location returns bad request' do
result = Locotimezone.locotime address: ''
assert true, result[:geo].empty?
assert true, result[:timezone].empty?
@@ -20,7 +20,7 @@ assert true, result[:timezone].empty?
end
- it 'must be empty if location returns bad request' do
+ it 'must be empty if getting timezone returns bad request' do
result = Locotimezone.locotime location: { lat: 'bob', lng: 'loblaw' },
timezone_only: true
assert true, result[:timezone].empty?
| Update error test assertions to make them more informative as to what is being
tested.
|
diff --git a/OROpenSubtitleDownloader.podspec b/OROpenSubtitleDownloader.podspec
index abc1234..def5678 100644
--- a/OROpenSubtitleDownloader.podspec
+++ b/OROpenSubtitleDownloader.podspec
@@ -5,11 +5,11 @@ s.homepage = "https://github.com/orta/OROpenSubtitleDownloader"
s.license = { :type => 'BSD', :file => 'LICENSE' }
s.author = { "orta" => "orta.therox@gmail.com" }
- s.source = { :git => "https://github.com/orta/OROpenSubtitleDownloader.git", :commit => :head }
+ s.source = { :git => "https://github.com/orta/OROpenSubtitleDownloader.git", :tag => "1.1.1" }
s.source_files = 'OROpenSubtitleDownloader.{h,m}'
s.library = 'z'
s.requires_arc = true
-
+
s.ios.deployment_target = '7.0'
s.osx.deployment_target = '10.9'
| Fix podspec to conforms sources to a specific tag
|
diff --git a/test/helper.rb b/test/helper.rb
index abc1234..def5678 100644
--- a/test/helper.rb
+++ b/test/helper.rb
@@ -7,23 +7,16 @@ $stderr.puts "Run `bundle install` to install missing gems"
exit e.status_code
end
-
require 'simplecov'
+require 'faker'
+require 'randexp'
require 'minitest'
-require 'minitest/unit'
+require 'minitest/reporters'
+require 'minitest/spec'
require 'minitest/autorun'
-require 'minitest/reporters'
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'nodus'
-
-class Reporter < Minitest::Reporters::BaseReporter
- def start
- super
- puts "# AWESOME!"
- puts
- end
-end
Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new
@@ -41,6 +34,36 @@ ENV["COVERAGE"] && SimpleCov.start do
add_filter "/.rvm/"
end
+I18n.enforce_available_locales = false
-class MiniTest::Unit::TestCase
+include Faker
+
+
+module RandomGen
+ def rand_poisson(lmbda=10)
+ # Poisson distribution with mean & variance of lmda- via knuth's simple algorithm
+ el = Math.exp(- lmbda); k=0; p=1
+ loop do
+ k += 1; p *= rand
+ return k - 1 if p <= el
+ end
+ end
+
+ def rand_times(lmbda=10, &block)
+ k = rand_poisson(lmbda)
+ if block_given? then k.times.map(&block)
+ else k.times end
+ end
+
+ def rand_word
+ len = rand_poisson
+ return '' if len == 0
+ /\w{#{len}}/.gen
+ end
+
+ def random_path
+ '/' + rand_times{rand_word}.join('/')
+ end
end
+
+include RandomGen
| Add and use more random generation stuff and better spec for testing
|
diff --git a/lib/assignments_manager.rb b/lib/assignments_manager.rb
index abc1234..def5678 100644
--- a/lib/assignments_manager.rb
+++ b/lib/assignments_manager.rb
@@ -7,8 +7,12 @@ user_params['assignments'].each do |assignment|
assignment['course_id'] = course.id
assignment['article_title'] = Utils.format_article_title(assignment['article_title'])
- assigned = Article.find_by(title: assignment['article_title'])
- assignment['article_id'] = assigned.id unless assigned.nil?
+ assigned = Article.find_by(title: assignment['article_title'], namespace: 0)
+ if assigned
+ # We double check that the titles are equal to avoid false matches of case variants.
+ # We can revise this once the database is set to use case-sensitive collation.
+ assignment['article_id'] = assigned.id if assigned.title == assignment['article_title']
+ end
update_util Assignment, assignment
end
| Check for exact title match and namespace 0 for assignments
|
diff --git a/lib/cms/attributes/base.rb b/lib/cms/attributes/base.rb
index abc1234..def5678 100644
--- a/lib/cms/attributes/base.rb
+++ b/lib/cms/attributes/base.rb
@@ -13,7 +13,7 @@ @association = options[:association]
@required = options[:required] || false
@show = true
- @center = %w(integer boolean).include?(type)
+ @center = %w(integer boolean float decimal).include?(type)
@wysiwyg = %w(text).include?(type)
end
| Set center for float and decimal attributes
|
diff --git a/lib/collectors/cpu_load.rb b/lib/collectors/cpu_load.rb
index abc1234..def5678 100644
--- a/lib/collectors/cpu_load.rb
+++ b/lib/collectors/cpu_load.rb
@@ -3,7 +3,9 @@ output = `mpstat 1 1` # Get stats on a single 1 second sample.
fields = output.split("\n")[3].split(/\s+/)
- i = 2
+ # Some versions of mpstat output time as 01:35:40 PM, while others us a 24 hours clock.
+ i = (fields[2] == "all") ? 3 : 2
+
%w(user nice sys iowait irq soft steal guest idle).each do |field|
queue_gauge("system.cpu.#{field}", fields[i])
i += 1
| Deal with dodgy time formats from mpstat
|
diff --git a/lib/http/request_stream.rb b/lib/http/request_stream.rb
index abc1234..def5678 100644
--- a/lib/http/request_stream.rb
+++ b/lib/http/request_stream.rb
@@ -9,20 +9,19 @@
# Stream the request to a socket
def stream
- socket = @socket
@headers.each do |field, value|
@request_header << "#{field}: #{value}#{CRLF}"
end
case @body
when NilClass
- socket << @request_header << CRLF
+ @socket << @request_header << CRLF
when String
@request_header << "Content-Length: #{@body.length}#{CRLF}" unless @headers['Content-Length']
@request_header << CRLF
- socket << @request_header
- socket << @body
+ @socket << @request_header
+ @socket << @body
when Enumerable
if encoding = @headers['Transfer-Encoding']
raise ArgumentError, "invalid transfer encoding" unless encoding == "chunked"
@@ -31,13 +30,13 @@ @request_header << "Transfer-Encoding: chunked#{CRLF * 2}"
end
- socket << @request_header
+ @socket << @request_header
@body.each do |chunk|
- socket << chunk.bytesize.to_s(16) << CRLF
- socket << chunk
+ @socket << chunk.bytesize.to_s(16) << CRLF
+ @socket << chunk
end
- socket << "0" << CRLF * 2
+ @socket << "0" << CRLF * 2
else raise TypeError, "invalid @body type: #{@body.class}"
end
end
| Replace all socket with @socket
Signed-off-by: Sam Phippen <e5a09176608998a68778e11d5021c871e8fae93c@googlemail.com>
|
diff --git a/lib/libra2/tasks/logs.rake b/lib/libra2/tasks/logs.rake
index abc1234..def5678 100644
--- a/lib/libra2/tasks/logs.rake
+++ b/lib/libra2/tasks/logs.rake
@@ -0,0 +1,40 @@+namespace :libra2 do
+
+ namespace :logs do
+ def get_request_line(input, output)
+ of = File.new(output, "w+")
+ File.open(input, "r").each_line do |line|
+ if line.include?("-- : Started") # This will match the first log line of each request
+ of.puts(line)
+ end
+ end
+ of.close
+ end
+
+ def convert_file(input, output)
+ tmp = "#{output}.tmp"
+ strip_non_rails(input, tmp)
+ `sort -k1 < #{tmp} > #{output}`
+ end
+
+ def strip_non_rails(input, output)
+ of = File.new(output, "w+")
+ File.open(input, "r").each_line do |line|
+ if line.include?("-- :") # get rid of the lines not added by the Libra2 Rails app
+ line = line[65,line.length] # get rid of the tacked on stuff that looks like: 2016-07-14T09:49:00-04:00 dockerprod1 docker/49a126baed37[6764]:
+ of.puts(line)
+ end
+ end
+ of.close
+ end
+
+ desc "Get rid of non-Libra2 items from log file"
+ task clean_up: :environment do |t, args|
+ log_folder = "#{Rails.root}/log"
+ # get_request_line("#{log_folder}/docker1.log", "#{log_folder}/docker1-filtered.log")
+ convert_file("#{log_folder}/docker1.log", "#{log_folder}/docker1-filtered.log")
+ convert_file("#{log_folder}/docker2.log", "#{log_folder}/docker2-filtered.log")
+ end
+ end # namespace logs
+
+end # namespace libra2
| Clean up log files from production.
|
diff --git a/lib/smartsheet/api/urls.rb b/lib/smartsheet/api/urls.rb
index abc1234..def5678 100644
--- a/lib/smartsheet/api/urls.rb
+++ b/lib/smartsheet/api/urls.rb
@@ -1,12 +1,62 @@ module Smartsheet
module API
# Methods for building Smartsheet API URLs
- module URLs
+ class UrlBuilder
API_URL = 'https://api.smartsheet.com/2.0'.freeze
- def build_url(*segments)
- segments.unshift(API_URL).join '/'
+ def initialize
+ @segments = nil
+ @args = nil
+ end
+
+ def for_endpoint(endpoint_spec)
+ self.segments = endpoint_spec.url_segments
+ self
+ end
+
+ def for_request(request_spec)
+ self.args = request_spec.path_args
+ self
+ end
+
+ def apply(req)
+ validate_spec_compatibility
+
+ req.url(
+ segments
+ .collect { |seg| seg.is_a?(Symbol) ? args[seg] : seg }
+ .unshift(API_URL)
+ .join('/')
+ )
+ end
+
+ private
+
+ attr_accessor :segments, :args
+
+ def validate_spec_compatibility
+ segment_vars = segments.select { |seg| seg.is_a? Symbol }.to_set
+ arg_keys = args.keys.to_set
+
+ validate_args_present(segment_vars, arg_keys)
+ validate_args_match(segment_vars, arg_keys)
+ end
+
+ def validate_args_present(segment_vars, arg_keys)
+ missing_args = segment_vars - arg_keys
+ return if missing_args.empty?
+
+ missing_args_string = missing_args.to_a.join(', ')
+ raise "Missing request parameters [#{missing_args_string}]"
+ end
+
+ def validate_args_match(segment_vars, arg_keys)
+ extra_args = arg_keys - segment_vars
+ return if extra_args.empty?
+
+ extra_args_string = extra_args.to_a.join(', ')
+ raise "Unexpected request parameters [#{extra_args_string}]"
end
end
end
-end+end
| Make the URL builder a robust object. (Partial Commit)
|
diff --git a/lib/tasks/bumbleworks.rake b/lib/tasks/bumbleworks.rake
index abc1234..def5678 100644
--- a/lib/tasks/bumbleworks.rake
+++ b/lib/tasks/bumbleworks.rake
@@ -1,11 +1,21 @@ namespace :bumbleworks do
desc 'Start a Bumbleworks worker'
task :start_worker => :environment do
- Bumbleworks.start_worker!
+ puts "Starting Bumbleworks worker..." if verbose == true
+ Bumbleworks.start_worker!(:join => true)
end
desc 'Reload all process definitions from directory'
task :reload_definitions => :environment do
+ puts "Reloading all Bumbleworks process definitions..." if verbose == true
Bumbleworks.load_definitions!
end
+
+ desc 'Launch a given Bumbleworks process'
+ task :launch, [:process] => :environment do |task, args|
+ process = args[:process]
+ raise ArgumentError, "Process name required" unless process
+ puts "Launching process '#{process}'..." if verbose == true
+ Bumbleworks.launch!(process)
+ end
end | Update tasks; add launch_process task |
diff --git a/Casks/font-ubuntu.rb b/Casks/font-ubuntu.rb
index abc1234..def5678 100644
--- a/Casks/font-ubuntu.rb
+++ b/Casks/font-ubuntu.rb
@@ -2,7 +2,7 @@ url 'http://font.ubuntu.com/download/ubuntu-font-family-0.80.zip'
homepage 'http://font.ubuntu.com/'
version '0.80'
- sha1 '88276ba9d38d75b33a9640efa15cd80979cb21e2'
+ sha256 '107170099bbc3beae8602b97a5c423525d363106c3c24f787d43e09811298e4c'
font 'ubuntu-font-family-0.80/Ubuntu-B.ttf'
font 'ubuntu-font-family-0.80/Ubuntu-BI.ttf'
font 'ubuntu-font-family-0.80/Ubuntu-C.ttf'
| Update Ubuntu to sha256 checksums
|
diff --git a/Casks/powerphotos.rb b/Casks/powerphotos.rb
index abc1234..def5678 100644
--- a/Casks/powerphotos.rb
+++ b/Casks/powerphotos.rb
@@ -10,6 +10,7 @@ homepage 'http://www.fatcatsoftware.com/powerphotos/'
license :commercial
+ auto_updates true
depends_on macos: '>= :yosemite'
app 'PowerPhotos.app'
| Add auto_updates flag to PowerPhotos
|
diff --git a/MRGArchitect.podspec b/MRGArchitect.podspec
index abc1234..def5678 100644
--- a/MRGArchitect.podspec
+++ b/MRGArchitect.podspec
@@ -1,9 +1,9 @@ Pod::Spec.new do |s|
s.name = 'MRGArchitect'
- s.version = '0.1.1'
+ s.version = '0.2.0'
s.license = 'BSD 3-Clause'
s.summary = 'Static application configuration via JSON'
- s.homepage = 'https://github.com/mirego/MRGArchitect'
+ s.homepage = 'http://open.mirego.com'
s.authors = { 'Mirego, Inc.' => 'info@mirego.com' }
s.source = { :git => 'https://github.com/mirego/MRGArchitect.git', :tag => s.version.to_s }
s.source_files = 'MRGArchitect/*.{h,m}'
| Set the version number to 0.2.0.
|
diff --git a/Library/Homebrew/requirements/java_requirement.rb b/Library/Homebrew/requirements/java_requirement.rb
index abc1234..def5678 100644
--- a/Library/Homebrew/requirements/java_requirement.rb
+++ b/Library/Homebrew/requirements/java_requirement.rb
@@ -6,7 +6,7 @@ download "http://www.oracle.com/technetwork/java/javase/downloads/index.html"
satisfy :build_env => false do
- return quiet_system "java", "-version" unless OS.mac?
+ next quiet_system "java", "-version" unless OS.mac?
args = %w[--failfast]
args << "--version" << "#{@version}" if @version
@java_home = Utils.popen_read("/usr/libexec/java_home", *args).chomp
| JavaRequirement: Fix a bug for Linuxbrew
|
diff --git a/reevoocop.gemspec b/reevoocop.gemspec
index abc1234..def5678 100644
--- a/reevoocop.gemspec
+++ b/reevoocop.gemspec
@@ -17,7 +17,7 @@ spec.test_files = spec.files.grep(/^(test|spec|features)\//)
spec.require_paths = ["lib"]
- spec.add_dependency "rubocop", "~> 0.88"
+ spec.add_dependency "rubocop", "0.91"
spec.add_dependency "rubocop-performance", "~> 1.5.1"
spec.add_development_dependency "bundler", ">= 1.17"
spec.add_development_dependency "rake"
| Use currently latest and exact version of rubocop
|
diff --git a/NTYSmartTextView.podspec b/NTYSmartTextView.podspec
index abc1234..def5678 100644
--- a/NTYSmartTextView.podspec
+++ b/NTYSmartTextView.podspec
@@ -10,7 +10,7 @@ s.homepage = "https://github.com/naoty/NTYSmartTextView"
s.license = "MIT"
s.author = { "Naoto Kaneko" => "naoty.k@gmail.com" }
- s.source = { git: "https://github.com/naoty/NTYSmartTextView.git", tag: s.version.to_s }
+ s.source = { :git => "https://github.com/naoty/NTYSmartTextView.git", :tag => s.version.to_s }
s.social_media_url = "https://twitter.com/naoty_k"
s.platform = :osx
| Fix podspec to pass travis
|
diff --git a/config/initializers/active_admin_index_calendar.rb b/config/initializers/active_admin_index_calendar.rb
index abc1234..def5678 100644
--- a/config/initializers/active_admin_index_calendar.rb
+++ b/config/initializers/active_admin_index_calendar.rb
@@ -13,7 +13,7 @@ {
id: item.id,
title: item.to_s,
- start: item.date_hour,
+ start: item.created_at.blank? ? Date.today.to_s : item.created_at,
url: "#{auto_url_for(item)}"
}
end
| Fix error assigning start date to events using resource created_at field
|
diff --git a/0_code_wars/7_not_visible_cubes.rb b/0_code_wars/7_not_visible_cubes.rb
index abc1234..def5678 100644
--- a/0_code_wars/7_not_visible_cubes.rb
+++ b/0_code_wars/7_not_visible_cubes.rb
@@ -0,0 +1,12 @@+# http://www.codewars.com/kata/560d6ebe7a8c737c52000084/
+
+# iteration 1
+def not_visible_cubes(n)
+ return 0 if n < 3
+ (n-2)**3
+end
+
+# iteration 2
+def not_visible_cubes(n)
+ (n <= 2 && 0) || (n - 2) ** 3
+end
| Add code wars (7) not visible cubes
|
diff --git a/lib/active_model/merge_errors.rb b/lib/active_model/merge_errors.rb
index abc1234..def5678 100644
--- a/lib/active_model/merge_errors.rb
+++ b/lib/active_model/merge_errors.rb
@@ -1,7 +1,7 @@ ActiveModel::Errors.class_eval do
def <<(other)
copy_messages_from(other)
- copy_details_from(other)
+ copy_details_from(other) if respond_to?(:details)
self
end
| Make ons-context work with Rails4
details were introduced in Rails5
|
diff --git a/lib/bot/githubapi/git_hub_api.rb b/lib/bot/githubapi/git_hub_api.rb
index abc1234..def5678 100644
--- a/lib/bot/githubapi/git_hub_api.rb
+++ b/lib/bot/githubapi/git_hub_api.rb
@@ -14,7 +14,7 @@ module GitHubApi
def self.connect(username, password)
@user = GitHubApi::User.new
- @user.client ||= Octokit::Client.new(:login => username, :password => password, :auto_traversal => true)
+ @user.client ||= Octokit::Client.new(:login => username, :password => password, :auto_paginate => true)
return @user
end
| Fix issue where auto_paginate was not working.
|
diff --git a/Canvas.podspec b/Canvas.podspec
index abc1234..def5678 100644
--- a/Canvas.podspec
+++ b/Canvas.podspec
@@ -6,7 +6,7 @@ s.license = { :type => 'MIT', :file => 'LICENSE' }
s.authors = { "Meng To" => "shadownessguy@gmail.com", "Jamz Tang" => "jamz@jamztang.com" }
s.platform = :ios, '7.0'
- s.source = { :git => "git@github.com:CanvasPod/Canvas.git", :tag => s.version.to_s }
+ s.source = { :git => "https://github.com/CanvasPod/Canvas.git", :tag => s.version.to_s }
s.source_files = 'CanvasLibrary/*.{h,m}'
s.exclude_files = 'Classes/Exclude'
s.requires_arc = true
| Fix https link warning by pod lint
|
diff --git a/lib/number_to_words_ru/i18n_initialization.rb b/lib/number_to_words_ru/i18n_initialization.rb
index abc1234..def5678 100644
--- a/lib/number_to_words_ru/i18n_initialization.rb
+++ b/lib/number_to_words_ru/i18n_initialization.rb
@@ -2,11 +2,12 @@ extend self
def environment
+ working_locale = I18n.locale
I18n.locale = :ru
- I18n.load_path << locale_files
+ I18n.load_path += locale_files
yield
- I18n.load_path.pop 2
- I18n.locale = I18n.default_locale
+ I18n.load_path.pop locale_files.count
+ I18n.locale = working_locale
end
def locale_files
| Save working locale. Replace magic number 2 by locale_files.count.
|
diff --git a/main.rb b/main.rb
index abc1234..def5678 100644
--- a/main.rb
+++ b/main.rb
@@ -4,13 +4,18 @@
proj_list = Dir['/home/ethan/games/kerbal/CKAN-meta/*']
-proj_list.each { |proj|
+proj_list.each do |proj|
versions = Dir["#{proj}/*.ckan"]
- versions.each { |v|
+ versions.each do |v|
puts "Reading #{v}"
info = JSON.parse(File.read(v))
- $main_info[info['identifier']] = info['version']
- }
-}
+ $main_info[info['identifier']] = info
+ end
+end
-puts $main_info
+puts "Done reading\n\n"
+
+$main_info.keys.sort.each do |key|
+ info = $main_info[key]
+ puts "#{info['name']}: #{info['abstract']}"
+end
| Format output a bit better
|
diff --git a/app/mailers/newsletter_mailer.rb b/app/mailers/newsletter_mailer.rb
index abc1234..def5678 100644
--- a/app/mailers/newsletter_mailer.rb
+++ b/app/mailers/newsletter_mailer.rb
@@ -3,7 +3,7 @@ #
class NewsletterMailer < ActionMailer::Base
add_template_helper(HtmlHelper)
- default from: Setting.first.email
+ default from: Setting.first.try(:email)
# Email send after a user subscribed to the newsletter
def welcome_user(newsletter_user)
| Use try to avoid bug with email parameter in NewsletterMailer
|
diff --git a/activerecord-spatial.gemspec b/activerecord-spatial.gemspec
index abc1234..def5678 100644
--- a/activerecord-spatial.gemspec
+++ b/activerecord-spatial.gemspec
@@ -11,6 +11,7 @@ s.description = "ActiveRecord Spatial gives AR the ability to work with PostGIS columns."
s.summary = s.description
s.email = "code@zoocasa.com"
+ s.license = "MIT"
s.extra_rdoc_files = [
"README.rdoc"
]
| Add license details to gemspec.
|
diff --git a/scripts/dump_html.rb b/scripts/dump_html.rb
index abc1234..def5678 100644
--- a/scripts/dump_html.rb
+++ b/scripts/dump_html.rb
@@ -0,0 +1,64 @@+parser = OptionParser.new
+
+parser.banner = <<BANNER
+Usage
+ $ bin/rails r scripts/dump_html.rb [runner options] -- [options]
+BANNER
+
+base_directory = nil
+fqdn = nil
+public_id = nil
+
+parser.on("-b", "--base-dir=BASE_DIR", "Output files here") do |dir|
+ base_directory = Pathname(dir)
+end
+
+parser.on("--fqdn=FQDN", "FQDN") do |_fqdn|
+ fqdn = _fqdn
+end
+
+parser.on("--public-id=ID", "Public ID") do |id|
+ public_id = id
+end
+
+parser.on("-e", "--environment=NAME", "Rails environment. This option is handled by `bin/rails r`") do |name|
+ # NOP
+end
+
+argv = ARGV.dup
+
+argv.delete("--")
+
+begin
+ parser.parse!(argv)
+rescue OptionParser::ParseError => ex
+ $stderr.puts ex.message
+ $stderr.puts parser.help
+ exit(false)
+end
+
+unless base_directory
+ $stderr.puts "--base-dir is required."
+ $stderr.puts parser.help
+ exit(false)
+end
+
+posts = nil
+
+if fqdn
+ site = Site.find_by!(fqdn: fqdn)
+ if public_id
+ posts = [site.posts.find_by(public_id: public_id)]
+ else
+ posts = site.posts
+ end
+else
+ posts = Post.all
+end
+
+include ApplicationHelper
+
+posts.each do |post|
+ (base_directory + post.site.fqdn).mkpath
+ (base_directory + post.site.fqdn + "#{post.public_id}.html").write(render_markdown(post.body))
+end
| Add a script to dump html for comparing
1. Dump html
2. Modify markdown renderer options
3. Dump html again
4. Compare 1. and 3.
|
diff --git a/PullToMakeFlight.podspec b/PullToMakeFlight.podspec
index abc1234..def5678 100644
--- a/PullToMakeFlight.podspec
+++ b/PullToMakeFlight.podspec
@@ -18,7 +18,7 @@
s.source = { :git => "https://github.com/Yalantis/PullToMakeFlight.git", :tag => "1.1" }
s.source_files = "PullToMakeFlight/**/*.{h,swift}"
- s.resources = 'PullToMakeFlight/**/*.{png,xib}'
+ s.resources = ['PullToMakeFlight/Image.xcassets', 'PullToMakeFlight/**/*.{png,xib}']
s.module_name = "PullToMakeFlight"
s.requires_arc = true
s.framework = 'CoreGraphics'
| Fix podspec for missed assets
|
diff --git a/TodUni/app/controllers/application_controller.rb b/TodUni/app/controllers/application_controller.rb
index abc1234..def5678 100644
--- a/TodUni/app/controllers/application_controller.rb
+++ b/TodUni/app/controllers/application_controller.rb
@@ -5,13 +5,21 @@ before_action :set_i18n_locale_from_params
def after_sign_in_path_for(resource)
+ if current_user.is_a?(User) && current_user.locale != I18n.locale
+ I18n.locale = current_user.locale
+ end
+
dashboard_path(current_user)
end
private
def set_i18n_locale_from_params
- if params[:locale]
+ valid_locales = ['en', 'es']
+
+ if user_signed_in? && valid_locales.include?(current_user.locale)
+ I18n.locale = current_user.locale
+ elsif params[:locale]
if I18n.available_locales.map(&:to_s).include?(params[:locale])
I18n.locale = params[:locale]
else
@@ -24,5 +32,4 @@ def default_url_options(options = {})
{locale: I18n.locale}
end
-
end
| Set locale from current signed in user if available
|
diff --git a/lib/omniauth/failure_endpoint.rb b/lib/omniauth/failure_endpoint.rb
index abc1234..def5678 100644
--- a/lib/omniauth/failure_endpoint.rb
+++ b/lib/omniauth/failure_endpoint.rb
@@ -38,7 +38,7 @@
def origin_query_param
return "" unless env['omniauth.origin']
- "&origin=#{CGI.escape(env['omniauth.origin'])}"
+ "&origin=#{Rack::Utils.escape(env['omniauth.origin'])}"
end
end
-end+end
| Use Rack::Utils escape instead of CGI as it's included in Rack and may fix the travis build :)
|
diff --git a/lib/shuttle/deployment/nodejs.rb b/lib/shuttle/deployment/nodejs.rb
index abc1234..def5678 100644
--- a/lib/shuttle/deployment/nodejs.rb
+++ b/lib/shuttle/deployment/nodejs.rb
@@ -1,9 +1,11 @@ module Shuttle
class Nodejs < Shuttle::Deploy
def setup
- error "Please install Node.js first" unless node_installed?
-
- log "Using Node.js v#{node_version}, NPM v#{npm_version}"
+ if node_installed?
+ log "Using Node.js v#{node_version}, NPM v#{npm_version}"
+ else
+ error "Node.js is not installed."
+ end
super
end
| Change setup formatting for node.js
|
diff --git a/active_model_serializers.gemspec b/active_model_serializers.gemspec
index abc1234..def5678 100644
--- a/active_model_serializers.gemspec
+++ b/active_model_serializers.gemspec
@@ -8,7 +8,7 @@ gem.email = ["jose.valim@gmail.com", "wycats@gmail.com"]
gem.description = %q{Making it easy to serialize models for client-side use}
gem.summary = %q{Bringing consistency and object orientation to model serialization. Works great for client-side MVC frameworks!}
- gem.homepage = "https://github.com/josevalim/active_model_serializers"
+ gem.homepage = "https://github.com/rails-api/active_model_serializers"
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
gem.files = `git ls-files`.split("\n")
| Change gem.homepage to new location |
diff --git a/week-4/leap-years/my_solution.rb b/week-4/leap-years/my_solution.rb
index abc1234..def5678 100644
--- a/week-4/leap-years/my_solution.rb
+++ b/week-4/leap-years/my_solution.rb
@@ -1,6 +1,6 @@ # Leap Years
-# I worked on this challenge [by myself, with: ].
+# I worked on this challenge with: Samantha Holmes
# Your Solution Below
| Add pair's name to leap year solution file
|
diff --git a/app/file_handlers/mileage_update_event_loader.rb b/app/file_handlers/mileage_update_event_loader.rb
index abc1234..def5678 100644
--- a/app/file_handlers/mileage_update_event_loader.rb
+++ b/app/file_handlers/mileage_update_event_loader.rb
@@ -1,31 +1,31 @@ #------------------------------------------------------------------------------
#
-# MileageUpdateEventLoader
+# Mileage Update Event
#
-# Generic class for processing mileage update events
+# Used to process both SOGR updates and new inventory updates
#
#------------------------------------------------------------------------------
class MileageUpdateEventLoader < EventLoader
-
- MILEAGE_COL = 0
- EVENT_DATE_COL = 2
-
+
+ CURRENT_MILEAGE_COL = 0
+ EVENT_DATE_COL = 1
+
def process(asset, cells)
# Create a new MileageUpdateEvent
@event = asset.build_typed_event(MileageUpdateEvent)
+ # Current Mileage
+ @event.current_mileage = as_integer(cells[CURRENT_MILEAGE_COL])
+
# Event Date
@event.event_date = as_date(cells[EVENT_DATE_COL])
-
- # Current Mileage
- @event.current_mileage = as_integer(cells[MILEAGE_COL])
-
+
end
-
+
private
def initialize
super
end
-
-end+
+end
| Move generic handlers to transit
|
diff --git a/Casks/indigo.rb b/Casks/indigo.rb
index abc1234..def5678 100644
--- a/Casks/indigo.rb
+++ b/Casks/indigo.rb
@@ -0,0 +1,9 @@+class Indigo < Cask
+ url 'http://cloud.goprism.com/download/Indigo.dmg'
+ homepage 'http://www.perceptiveautomation.com/indigo/index.html'
+ version 'latest'
+ no_checksum
+ install 'Indigo Installer.pkg'
+ uninstall :kext => 'com.perceptiveautomation.indigo_overrides.kext',
+ :pkgutil => 'com.perceptiveautomation.pkg.*'
+end
| Add Cask for Indigo latest
|
diff --git a/FreeStreamer.podspec b/FreeStreamer.podspec
index abc1234..def5678 100644
--- a/FreeStreamer.podspec
+++ b/FreeStreamer.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |s|
s.name = 'FreeStreamer'
- s.version = '1.5.3'
+ s.version = '1.5.2'
s.license = 'BSD'
s.summary = 'A low-memory footprint streaming audio client for iOS and OS X.'
s.homepage = 'http://freestreamer.io'
| Revert "Bump the version to 1.5.3."
This reverts commit 8130823fb019b497a524eb18572e129cf0179615.
|
diff --git a/spec/controllers/pages_controller_spec.rb b/spec/controllers/pages_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/pages_controller_spec.rb
+++ b/spec/controllers/pages_controller_spec.rb
@@ -5,7 +5,7 @@ describe "GET 'index'" do
it "returns http success" do
get 'index'
- response.should be_success
+ expect(response).to be_success
end
end
| Fix a deprecation warning, only 1 left...but bed time.
|
diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/users_controller_spec.rb
+++ b/spec/controllers/users_controller_spec.rb
@@ -1,5 +1,37 @@ require 'rails_helper'
RSpec.describe UsersController, type: :controller do
+ let(:sample_user) {FactoryGirl.build(:user)}
+
+ it '#new' do
+ get :new
+ expect(assigns(:user)).to be_a_kind_of(User)
+ end
+
+ context '#create' do
+ it 'creates a new user with valid params' do
+ expect{
+ post :create, user: FactoryGirl.attributes_for(:user)
+ }.to change(User, :count).by(1)
+ end
+
+ it 'does not create a user with invalid params' do
+ expect{
+ post :create, user: {username: "sdf"}
+ }.to_not change(User, :count)
+ end
+
+ it 'redirects to the root_path when the user is created' do
+ expect(
+ post :create, user: FactoryGirl.attributes_for(:user)
+ ).to redirect_to root_path
+ end
+
+ it 'render new when user fails to create' do
+ expect(
+ post :create, user: {username: "sdf"}
+ ).to render_template(:new)
+ end
+ end
end
| Add spec for new and create
|
diff --git a/spec/baby_squeel_spec.rb b/spec/baby_squeel_spec.rb
index abc1234..def5678 100644
--- a/spec/baby_squeel_spec.rb
+++ b/spec/baby_squeel_spec.rb
@@ -6,6 +6,10 @@ expect(BabySqueel[Post]).to be_a(BabySqueel::Relation)
end
+ it 'accepts an Arel::Table' do
+ expect(BabySqueel[Post.arel_table]).to be_a(BabySqueel::Table)
+ end
+
it 'accepts a symbol' do
expect(BabySqueel[:posts]).to be_a(BabySqueel::Table)
end
| Add missing test for BabySqueel.[] with an Arel::Table
|
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
@@ -0,0 +1,18 @@+require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+
+describe User do
+
+ before(:all) do
+ @user = FactoryGirl.create(:user)
+ end
+
+ subject { @user }
+
+ it { should be_valid }
+
+ it { should respond_to(:gitolite_identifier) }
+
+ it "has a gitolite_identifier" do
+ expect(@user.gitolite_identifier).to match(/redmine_user\d+_\d+/)
+ end
+end
| Add tests for patched User
|
diff --git a/spec/yelp/client_spec.rb b/spec/yelp/client_spec.rb
index abc1234..def5678 100644
--- a/spec/yelp/client_spec.rb
+++ b/spec/yelp/client_spec.rb
@@ -1,16 +1,19 @@ require 'yelp'
describe Yelp::Client do
+ let(:keys) { Hash[consumer_key: 'abc',
+ consumer_secret: 'def',
+ token: 'ghi',
+ token_secret: 'jkl'] }
+
+ before do
+ @client = Yelp::Client.new(keys)
+ end
+
describe 'client initialization' do
it 'should create a client with the appropriate keys set' do
- keys = { consumer_key: 'abc',
- consumer_secret: 'def',
- token: 'ghi',
- token_secret: 'jkl' }
-
- client = Yelp::Client.new(keys)
Yelp::Client::AUTH_KEYS.each do |key|
- client.send(key).should eql keys[key]
+ @client.send(key).should eql keys[key]
end
end
end
| Refactor client spec to prevent reused code
|
diff --git a/db/migrate/20180625081911_create_album_identities.rb b/db/migrate/20180625081911_create_album_identities.rb
index abc1234..def5678 100644
--- a/db/migrate/20180625081911_create_album_identities.rb
+++ b/db/migrate/20180625081911_create_album_identities.rb
@@ -0,0 +1,19 @@+# frozen_string_literal: true
+
+class CreateAlbumIdentities < ActiveRecord::Migration[5.1]
+ def change
+ create_table :album_identities, id: :uuid, default: "uuid_generate_v4()" do |t|
+ t.string :name, null: false
+ t.string :artist_name, null: false
+ t.index [:name]
+ t.index [:name, :artist_name], unique: true
+ end
+ create_table :album_track_identities do |t|
+ t.uuid :album_identity_id, null: false
+ t.uuid :track_identity_id, null: false
+ t.index [:album_identity_id, :track_identity_id], unique: true, name: "index_album_track_identities"
+ end
+ add_column :albums, :identity_id, :uuid
+ add_index :albums, :identity_id
+ end
+end
| Add migration: Create album_identities table
|
diff --git a/spec/factories/organizations.rb b/spec/factories/organizations.rb
index abc1234..def5678 100644
--- a/spec/factories/organizations.rb
+++ b/spec/factories/organizations.rb
@@ -12,6 +12,7 @@ organization_type { OrganizationType.find_by(:class_name => 'TransitOperator') rescue Rails.logger.info "ERROR: No seed data." }
sequence(:name) { |n| "Org #{n}" }
short_name {name}
+ legal_name {name}
license_holder { true }
end
| [TTPLAT-1117] Add legal name to organization factories.
|
diff --git a/spec/models/stewardship_spec.rb b/spec/models/stewardship_spec.rb
index abc1234..def5678 100644
--- a/spec/models/stewardship_spec.rb
+++ b/spec/models/stewardship_spec.rb
@@ -2,6 +2,7 @@
# t.integer "user_id"
# t.integer "race_id"
+# t.integer "level"
RSpec.describe Stewardship, type: :model do
it "should be valid when created with a user_id and a race_id" do
| Add level to comment schema in stewardship spec.
|
diff --git a/spec/wait_spec.rb b/spec/wait_spec.rb
index abc1234..def5678 100644
--- a/spec/wait_spec.rb
+++ b/spec/wait_spec.rb
@@ -3,26 +3,49 @@
describe Watir::Wait do
describe "#until" do
- it "waits until the block returns true"
- it "times out"
+ it "waits until the block returns true" do
+ pending
+ end
+
+ it "times out" do
+ pending
+ end
end
describe "#while" do
- it "waits while the block returns true"
- it "times out"
+ it "waits while the block returns true" do
+ pending
+ end
+
+ it "times out" do
+ pending
+ end
end
end
describe Watir::Element do
describe "#present?" do
- it "returns true if the element exists and is visible"
- it "returns false if the element exists but is not visible"
- it "returns false if the element does not exist"
+ it "returns true if the element exists and is visible" do
+ pending
+ end
+
+ it "returns false if the element exists but is not visible" do
+ pending
+ end
+
+ it "returns false if the element does not exist" do
+ pending
+ end
end
describe "#when_present" do
- it "invokes subsequent methods after waiting for the element's presence"
- it "times out"
+ it "invokes subsequent methods after waiting for the element's presence" do
+ pending
+ end
+
+ it "times out" do
+ pending
+ end
end
end | Work around RSpec + 1.9.2 issue with pending specs.
|
diff --git a/app/models/budget.rb b/app/models/budget.rb
index abc1234..def5678 100644
--- a/app/models/budget.rb
+++ b/app/models/budget.rb
@@ -20,7 +20,7 @@
def initialize_additional_applicant_income
return unless grant.people.size > 2
- self.other_household_income ||= grant.people.slice(2..-1).map(&:current_income).sum
+ self.other_household_income ||= grant.people.to_a.slice(2..-1).map(&:current_income).sum
end
def initialize_rent
| Fix build failure with missing to_a.
|
diff --git a/app/models/course.rb b/app/models/course.rb
index abc1234..def5678 100644
--- a/app/models/course.rb
+++ b/app/models/course.rb
@@ -1,5 +1,7 @@ class Course < ActiveRecord::Base
attr_accessible :description, :logo, :title
+
+ acts_as_list :scope => :club
validates :title, :presence => { :message => "for course can't be blank" }
validates :description, :presence => { :message => "for course can't be blank" }
| Add acts_as_list for Course Model
Update the Course model to acts_as_list.
|
diff --git a/app/models/domain.rb b/app/models/domain.rb
index abc1234..def5678 100644
--- a/app/models/domain.rb
+++ b/app/models/domain.rb
@@ -15,9 +15,9 @@ begin
doc = RestClient::Resource.new("http://#{domain_name}", verify_ssl: OpenSSL::SSL::VERIFY_NONE).get
header = Nokogiri::HTML(doc).at("html head")
- tag = header.at("meta[name='description']") || header.at("meta[name='Description']")
+ tag = (header.at("meta[name='description']") || header.at("meta[name='Description']")) if header
meta = tag["content"] if tag
- title_tag = header.at("title")
+ title_tag = header.at("title") if header
title = title_tag.inner_text.strip if title_tag
{meta: meta, title: title}
rescue RestClient::InternalServerError, RestClient::BadRequest, RestClient::ResourceNotFound, RestClient::Forbidden, RestClient::BadGateway, Errno::ECONNREFUSED, Errno::EINVAL
| Handle missing head in html
|
diff --git a/agent/bosh_agent.gemspec b/agent/bosh_agent.gemspec
index abc1234..def5678 100644
--- a/agent/bosh_agent.gemspec
+++ b/agent/bosh_agent.gemspec
@@ -0,0 +1,55 @@+ $:.unshift(File.join(File.dirname(__FILE__), 'lib'))
+
+require 'agent/version'
+
+Gem::Specification.new do |s|
+ s.name = 'bosh_agent'
+ s.summary = 'Agent for Cloud Foundry BOSH release engineering tool.'
+ s.description = 'This agent listens for instructions from the bosh director on each server that bosh manages.'
+ s.author = 'VMware'
+ s.homepage = 'https://github.com/cloudfoundry/bosh'
+ s.license = 'Apache 2.0'
+ s.version = Bosh::Agent::VERSION
+
+ %w{
+ highline
+ monit_api
+ netaddr
+ posix-spawn
+ rack-test
+ rake
+ ruby-atmos-pure
+ sinatra
+ thin
+ uuidtools
+ yajl-ruby
+ }.each { |g| s.add_dependency g }
+
+ %w{
+ blobstore_client ~> 0.3.13
+ bosh_common >= 0.5.1
+ bosh_encryption >= 0.0.3
+ nats = 0.4.22
+ sigar >= 0.7.2
+ }.each_slice(3) { |g,o,v| s.add_dependency(g, "#{o} #{v}") }
+
+ %w{
+ ci_reporter
+ guard
+ guard-bundler
+ guard-rspec
+ rcov
+ ruby-debug
+ ruby-debug19
+ ruby_gntp
+ simplecov
+ simplecov-rcov
+ }.each { |g| s.add_development_dependency g }
+
+ %w{
+ rspec = 2.8
+ }.each_slice(3) { |g,o,v| s.add_development_dependency(g, "#{o} #{v}") }
+
+ s.files = `git ls-files`.split("\n")
+ s.executables = %w{agent}
+end
| Add gemspec for bosh agent.
This does not replace the Gemfile yet due to some remaining issues with
dependency selection by platform. I plan to use it to build the gem and
vendor it in the micro repo.
Change-Id: I05f72e0063df20dbd6e88ba9dad5fa2c10b5c836
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.