diff stringlengths 65 26.7k | message stringlengths 7 9.92k |
|---|---|
diff --git a/cloby.gemspec b/cloby.gemspec
index abc1234..def5678 100644
--- a/cloby.gemspec
+++ b/cloby.gemspec
@@ -2,7 +2,7 @@
Gem::Specification.new do |s|
s.name = %q{cloby}
- s.version = "0.0.2"
+ s.version = "0.0.3"
s.authors = ["Charles Oliver Nutter"]
s.date = Time.now
s.description = "Clojure-based transactional semantics for Ruby instance variables"
@@ -13,4 +13,5 @@ s.summary = "Clojure-based transactional semantics for Ruby instance variables"
s.test_files = Dir["spec/*_spec.rb"]
s.platform = "java"
+ s.add_dependency "mvn:org.clojure:clojure", "> 1.3"
end
| Add back mvn dependency, since rubygems.org now allows it! Yay!
|
diff --git a/spec/core/licensefile_spec.rb b/spec/core/licensefile_spec.rb
index abc1234..def5678 100644
--- a/spec/core/licensefile_spec.rb
+++ b/spec/core/licensefile_spec.rb
@@ -1,17 +1,23 @@ require 'spec_helper'
-describe file('/etc/cumulus/.license.txt') do
- it { should be_file }
+if file('/etc/cumulus/.license.txt').exists?
+ describe file('/etc/cumulus/.license.txt') do
+ it { should be_file }
+ end
+
+ describe command('/usr/cumulus/bin/cl-license') do
+ its(:stdout) { should match(/email=/) }
+ its(:stdout) { should match(/account=/) }
+ its(:stdout) { should match(/expires=/) }
+ its(:stdout) { should match(/serial=/) }
+ its(:stdout) { should match(/num_licenses=/) }
+ its(:stdout) { should match(/need_eula=0/) }
+ its(:stdout) { should match(/BEGIN PGP SIGNED MESSAGE/) }
+ its(:stdout) { should match(/BEGIN PGP SIGNATURE/) }
+ its(:stdout) { should match(/END PGP SIGNATURE/) }
+ end
+else
+ describe file('/etc/cumulus/.license') do
+ it { should be_file }
+ end
end
-
-describe command('/usr/cumulus/bin/cl-license') do
- its(:stdout) { should match(/email=/) }
- its(:stdout) { should match(/account=/) }
- its(:stdout) { should match(/expires=/) }
- its(:stdout) { should match(/serial=/) }
- its(:stdout) { should match(/num_licenses=/) }
- its(:stdout) { should match(/need_eula=0/) }
- its(:stdout) { should match(/BEGIN PGP SIGNED MESSAGE/) }
- its(:stdout) { should match(/BEGIN PGP SIGNATURE/) }
- its(:stdout) { should match(/END PGP SIGNATURE/) }
-end
| Make the license tests work for both v1 & v2
Check if a V1 license file exists and perform a slightly different set of tests
if it does; the filename is different between V1 & V2 and there aren't many
useful tests we can apply to a V2 license.
|
diff --git a/spec/currency_convert_spec.rb b/spec/currency_convert_spec.rb
index abc1234..def5678 100644
--- a/spec/currency_convert_spec.rb
+++ b/spec/currency_convert_spec.rb
@@ -6,6 +6,7 @@ end
it "can create a new money" do
- expect(false).to eq(true)
+ fifty_euros = Money.new('EUR', 50)
+ expect(response).to be_success
end
end
| Test create a new Money
|
diff --git a/spec/support/email_helpers.rb b/spec/support/email_helpers.rb
index abc1234..def5678 100644
--- a/spec/support/email_helpers.rb
+++ b/spec/support/email_helpers.rb
@@ -1,8 +1,6 @@ module EmailHelpers
- def sent_to_user?(user, recipients = nil)
- recipients ||= ActionMailer::Base.deliveries.flat_map(&:to)
-
- recipients.count(user.email) == 1
+ def sent_to_user?(user, recipients = email_recipients)
+ recipients.include?(user.email)
end
def reset_delivered_emails!
@@ -10,22 +8,26 @@ end
def should_only_email(*users)
- recipients = ActionMailer::Base.deliveries.flat_map(&:to)
+ recipients = email_recipients
users.each { |user| should_email(user, recipients) }
expect(recipients.count).to eq(users.count)
end
- def should_email(user, recipients = nil)
+ def should_email(user, recipients = email_recipients)
expect(sent_to_user?(user, recipients)).to be_truthy
end
- def should_not_email(user, recipients = nil)
+ def should_not_email(user, recipients = email_recipients)
expect(sent_to_user?(user, recipients)).to be_falsey
end
def should_email_no_one
expect(ActionMailer::Base.deliveries).to be_empty
end
+
+ def email_recipients
+ ActionMailer::Base.deliveries.flat_map(&:to)
+ end
end
| Introduce email_recipients and use include? Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6342#note_16075554
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6342#note_16075622
|
diff --git a/test/test_novell_plugin.rb b/test/test_novell_plugin.rb
index abc1234..def5678 100644
--- a/test/test_novell_plugin.rb
+++ b/test/test_novell_plugin.rb
@@ -0,0 +1,17 @@+require File.join(File.dirname(__FILE__), 'helper')
+
+class NovellPlugin_test < Test::Unit::TestCase
+
+ def test_urls_are_correct
+ client = Bicho::Client.new('https://bugzilla.novell.com')
+
+ assert_raises NoMethodError do
+ client.url
+ end
+
+ assert_equal 'https://apibugzilla.novell.com/tr_xmlrpc.cgi', "#{client.api_url.scheme}://#{client.api_url.host}#{client.api_url.path}"
+ assert_equal 'https://bugzilla.novell.com', "#{client.site_url.scheme}://#{client.site_url.host}#{client.site_url.path}"
+
+ end
+
+end
| Add test for Novell bugzilla plugin
|
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
@@ -0,0 +1,90 @@+require 'rails_helper'
+
+describe UsersController do
+ let(:user) { User.first }
+
+ describe 'GET #show' do
+ it 'responds with status code 200' do
+ get :show, params: { id: user.id }
+ expect(response).to have_http_status 200
+ end
+
+ it 'assigns the correct user to @user' do
+ get :show, params: { id: user.id }
+ expect(assigns(:user)).to eq user
+ end
+
+ it 'renders the :show template' do
+ get :show, params: { id: user.id }
+ expect(response).to render_template(:show)
+ end
+ end
+
+ describe 'GET #new' do
+ before(:each) do
+ get :new
+ end
+
+ it 'responds with status code 200' do
+ expect(response).to have_http_status 200
+ end
+
+ it 'assigns a new user to @user' do
+ expect(assigns(:user)).to be_a_new User
+ end
+
+ it 'renders the new template' do
+ expect(response).to render_template(:new)
+ end
+ end
+
+ describe 'POST #create' do
+ context 'when valid params are passed' do
+ before(:each) do
+ post :create, params: { user: { username: 'Example', email: 'example@test.com', password: 'password' } }
+ end
+
+ it 'responds with status code 302' do
+ expect(response).to have_http_status 302
+ end
+
+ it 'creates a new user in the database' do
+ expect(User.last.username).to eq 'Example'
+ end
+
+ it 'assigns the newly created user as @user' do
+ expect(assigns(:user)).to eq User.last
+ end
+
+ it 'creates a new session' do
+ expect(session[:id]).to eq User.last.id
+ end
+
+ it 'redirects to the root_path' do
+ expect(response).to redirect_to root_path
+ end
+ end
+
+ context 'when invalid params are passed' do
+ before(:each) do
+ post :create, params: { user: { username: 'Example', email: '', password: '123' } }
+ end
+
+ it 'does not add a user to the database' do
+ expect(assigns(User.last.username)).to_not eq 'Example'
+ end
+
+ it 'assigns the unsaved user as @user' do
+ expect(assigns(:user)).to be_a_new User
+ end
+
+ it 'does not create a new session' do
+ expect(session[:id]).to eq nil
+ end
+
+ it 'renders the new template' do
+ expect(response).to render_template(:new)
+ end
+ end
+ end
+end
| Add test for UsersController spec
|
diff --git a/jssignals-rails.gemspec b/jssignals-rails.gemspec
index abc1234..def5678 100644
--- a/jssignals-rails.gemspec
+++ b/jssignals-rails.gemspec
@@ -13,7 +13,6 @@
s.add_dependency "railties", "~> 3.0"
- s.add_development_dependency "fuubar", "~> 1.0"
s.add_development_dependency "rspec", "~> 2.0"
s.files = Dir[".gitignore"] +
@@ -25,4 +24,4 @@ Dir["**/*.js"] +
Dir["**/*.rb"]
s.require_paths = ["lib"]
-end+end
| Remove custom formatter from gemspec |
diff --git a/lib/appsignal/marker.rb b/lib/appsignal/marker.rb
index abc1234..def5678 100644
--- a/lib/appsignal/marker.rb
+++ b/lib/appsignal/marker.rb
@@ -30,7 +30,9 @@
def config
file = File.join(Dir.pwd, "config/appsignal.yml")
- raise ArgumentError, "config not found at: #{file}" unless File.exists?(file)
+ unless File.exists?(file)
+ raise ArgumentError, "config not found at: #{file}"
+ end
config = YAML.load_file(file)[@rails_env]
raise ArgumentError,
"config for '#{@rails_env}' environment not found" unless config
| Make sure we stay inside 80 chars
|
diff --git a/config/initializers/avalon.rb b/config/initializers/avalon.rb
index abc1234..def5678 100644
--- a/config/initializers/avalon.rb
+++ b/config/initializers/avalon.rb
@@ -7,4 +7,3 @@ require 'avalon/batch'
I18n.config.enforce_available_locales = true
-RoleMap.load(force: true)
| Revert initializer force loading of role map
|
diff --git a/taiwan_validator.gemspec b/taiwan_validator.gemspec
index abc1234..def5678 100644
--- a/taiwan_validator.gemspec
+++ b/taiwan_validator.gemspec
@@ -21,6 +21,6 @@ spec.add_dependency "activesupport", ">= 4.2"
spec.add_development_dependency "bundler", "> 1.17"
- spec.add_development_dependency "rake", "~> 10.0"
+ spec.add_development_dependency "rake", "~> 13.0"
spec.add_development_dependency "rspec", "~> 3.3"
end
| Update rake requirement from ~> 10.0 to ~> 13.0
Updates the requirements on [rake](https://github.com/ruby/rake) to permit the latest version.
- [Release notes](https://github.com/ruby/rake/releases)
- [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc)
- [Commits](https://github.com/ruby/rake/compare/rake-10.0.0...v13.0.1)
Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com> |
diff --git a/lib/tasks/rummager.rake b/lib/tasks/rummager.rake
index abc1234..def5678 100644
--- a/lib/tasks/rummager.rake
+++ b/lib/tasks/rummager.rake
@@ -10,5 +10,28 @@ }]
Rummageable.index(documents)
+
+ # Remove old support pages from search.
+ # This can be removed once it's run on production
+ old_support_pages = %w(
+ about-govuk
+ accessibility
+ apis
+ broken-pages
+ browsers
+ cookies
+ directgov-businesslink
+ government-gateway
+ health
+ jobs-employment-tools
+ linking-to-govuk
+ privacy-policy
+ student-finance
+ terms-conditions
+ wales-scotland-ni
+ )
+ old_support_pages.each do |slug|
+ Rummageable.delete("/support/#{slug}")
+ end
end
end
| Remove old support pages from search
|
diff --git a/db/migrate/20140421162948_change_user_indeces.rb b/db/migrate/20140421162948_change_user_indeces.rb
index abc1234..def5678 100644
--- a/db/migrate/20140421162948_change_user_indeces.rb
+++ b/db/migrate/20140421162948_change_user_indeces.rb
@@ -0,0 +1,16 @@+class ChangeUserIndeces < ActiveRecord::Migration
+ def self.up
+ remove_index :users, :email
+
+ add_index :users, :email, unique: false, using: 'btree'
+ add_index :users, column: [:provider, :uid], unique: true, using: 'btree'
+
+ end
+
+ def self.down
+ remove_index :users, :email
+ remove_index :users, column: [:provider, :uid]
+
+ add_index :users, :email, unique: true, using: 'btree'
+ end
+end
| Add User table index migrartion
Prepare a migration to change the indeces on the users table:
- Remove the unique requirement for the users' email index
- Add an index over the provider and uid columns
|
diff --git a/db/migrate/20161117092921_add_author_to_tasks.rb b/db/migrate/20161117092921_add_author_to_tasks.rb
index abc1234..def5678 100644
--- a/db/migrate/20161117092921_add_author_to_tasks.rb
+++ b/db/migrate/20161117092921_add_author_to_tasks.rb
@@ -1,5 +1,5 @@ class AddAuthorToTasks < ActiveRecord::Migration[5.0]
def change
- add_reference :tasks, :author, foreign_key: true
+ add_reference :tasks, :author, foreign_key: { to_table: :users }
end
end
| Fix foreign key reference in migration
|
diff --git a/templates/haml_layout.rb b/templates/haml_layout.rb
index abc1234..def5678 100644
--- a/templates/haml_layout.rb
+++ b/templates/haml_layout.rb
@@ -4,7 +4,12 @@ %html
%head
%title #{app_name.humanize}
- = stylesheet_link_tag :all
+
+ = stylesheet_link_tag 'screen.css', :media => 'screen, projection'
+ = stylesheet_link_tag 'print.css', :media => 'print'
+ /[if lt IE 8]
+ = stylesheet_link_tag 'ie.css', :media => 'screen, projection'
+
= javascript_include_tag :defaults
= csrf_meta_tag
%body
| Use the Compass stylesheets in Haml application layout
|
diff --git a/source/feed.xml.builder b/source/feed.xml.builder
index abc1234..def5678 100644
--- a/source/feed.xml.builder
+++ b/source/feed.xml.builder
@@ -1,13 +1,13 @@ xml.instruct!
xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
- site_url = "http://blog.url.com/"
- xml.title "Blog Name"
- xml.subtitle "Blog subtitle"
+ site_url = config[:meta][:siteurl]
+ xml.title config[:meta][:sitename]
+ xml.subtitle config[:meta][:catchcopy]
xml.id URI.join(site_url, blog.options.prefix.to_s)
xml.link "href" => URI.join(site_url, blog.options.prefix.to_s)
xml.link "href" => URI.join(site_url, current_page.path), "rel" => "self"
xml.updated(blog.articles.first.date.to_time.iso8601) unless blog.articles.empty?
- xml.author { xml.name "Blog Author" }
+ xml.author { xml.name config[:meta][:author] }
blog.articles[0..5].each do |article|
xml.entry do
@@ -16,8 +16,8 @@ xml.id URI.join(site_url, article.url)
xml.published article.date.to_time.iso8601
xml.updated File.mtime(article.source_file).iso8601
- xml.author { xml.name "Article Author" }
- # xml.summary article.summary, "type" => "html"
+ xml.author { xml.name config[:meta][:author] }
+ xml.summary strip_tags(article.summary), "type" => "html"
xml.content article.body, "type" => "html"
end
end
| fix: Add site url, author name, site name, site subtitle
|
diff --git a/lib/engineyard-serverside-adapter/version.rb b/lib/engineyard-serverside-adapter/version.rb
index abc1234..def5678 100644
--- a/lib/engineyard-serverside-adapter/version.rb
+++ b/lib/engineyard-serverside-adapter/version.rb
@@ -1,7 +1,7 @@ module EY
module Serverside
class Adapter
- VERSION = "2.2.0"
+ VERSION = "2.2.1.pre"
end
end
end
| Add .pre for next release
|
diff --git a/lib/test_after_commit/database_statements.rb b/lib/test_after_commit/database_statements.rb
index abc1234..def5678 100644
--- a/lib/test_after_commit/database_statements.rb
+++ b/lib/test_after_commit/database_statements.rb
@@ -1,9 +1,9 @@ module TestAfterCommit::DatabaseStatements
def transaction(*)
@test_open_transactions ||= 0
- skip_emulation = ActiveRecord::Base.connection.open_transactions.zero?
run_callbacks = false
result = nil
+ rolled_back = false
super do
begin
@@ -17,7 +17,7 @@ raise
ensure
@test_open_transactions -= 1
- if @test_open_transactions == 0 && !rolled_back && !skip_emulation
+ if @test_open_transactions == 0 && !rolled_back
if TestAfterCommit.enabled
run_callbacks = true
elsif ActiveRecord::VERSION::MAJOR == 3
@@ -42,6 +42,9 @@ # This is because we're re-using the transaction on the stack, before
# it's been popped off and re-created by the AR code.
original = @transaction || @transaction_manager.current_transaction
+
+ return unless original.respond_to?(:records)
+
transaction = original.dup
transaction.instance_variable_set(:@records, transaction.records.dup) # deep clone of records array
original.records.clear # so that this clear doesn't clear out both copies
| Fix undefined method `records' error.
|
diff --git a/1.8/library/logger/fixtures/common.rb b/1.8/library/logger/fixtures/common.rb
index abc1234..def5678 100644
--- a/1.8/library/logger/fixtures/common.rb
+++ b/1.8/library/logger/fixtures/common.rb
@@ -3,7 +3,7 @@ module LoggerSpecs
def self.strip_date(str)
- str[37..-1].lstrip
+ str[38..-1].lstrip
end
class TestApp < Logger::Application
def initialize(appname, log_file=nil)
| Revert "Fixing Logger helpers for OS 10.4"
* This blows up the tests in Linux/OS X Leopard, reverting.
This reverts commit 9f9fa0989446fabef4a361930cfb9ccc944ae880.
|
diff --git a/spec/controllers/api/users_controller_spec.rb b/spec/controllers/api/users_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/api/users_controller_spec.rb
+++ b/spec/controllers/api/users_controller_spec.rb
@@ -15,12 +15,17 @@ expect(response).to be_success
end
- it 'should not update a timeslot with valid data' do
+ it 'should not update a timeslot with invalid data' do
expect {
patch :update, id: user.id, email_notify: nil
}.not_to change { user.reload.email_notify }
expect(response).not_to be_success
end
+
+ it 'should return error messages with invalid data' do
+ patch :update, id: user.id, text_notify: nil, cellphone: nil
+ expect(user.errors.messages).not_to be_empty
+ end
end
end
| Add another test for making sure the controller has error messages
|
diff --git a/spec/unit/generator/acknowledgements/plist_spec.rb b/spec/unit/generator/acknowledgements/plist_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/generator/acknowledgements/plist_spec.rb
+++ b/spec/unit/generator/acknowledgements/plist_spec.rb
@@ -35,8 +35,9 @@ }
end
- it "writes a plist to disk" do
+ it "writes a plist to disk at the given path" do
path = @sandbox.root + "#{@target_definition.label}-Acknowledgements.plist"
- @plist.save_as(path).should.be.true
+ Xcodeproj.expects(:write_plist).with(equals(@plist.plist), equals(path))
+ @plist.save_as(path)
end
end
| Improve Plist Acknowledgements unit testing a little
|
diff --git a/spec/overcommit/hook_context/pre_push_spec.rb b/spec/overcommit/hook_context/pre_push_spec.rb
index abc1234..def5678 100644
--- a/spec/overcommit/hook_context/pre_push_spec.rb
+++ b/spec/overcommit/hook_context/pre_push_spec.rb
@@ -0,0 +1,47 @@+require 'spec_helper'
+require 'overcommit/hook_context/pre_push'
+
+describe Overcommit::HookContext::PrePush do
+ let(:config) { double('config') }
+ let(:args) { [remote_name, remote_url] }
+ let(:remote_name) { 'origin' }
+ let(:remote_url) { 'git@github.com:brigade/overcommit.git' }
+ let(:context) { described_class.new(config, args) }
+
+ describe '#remote_name' do
+ subject { context.remote_name }
+
+ it { should == remote_name }
+ end
+
+ describe '#remote_url' do
+ subject { context.remote_url }
+
+ it { should == remote_url }
+ end
+
+ describe '#pushed_commits' do
+ subject(:pushed_commits) { context.pushed_commits }
+
+ let(:local_ref) { 'refs/heads/master' }
+ let(:local_sha1) { random_hash }
+ let(:remote_ref) { 'refs/heads/master' }
+ let(:remote_sha1) { random_hash }
+
+ before do
+ ARGF.stub(:read).and_return([
+ "#{local_ref} #{local_sha1} #{remote_ref} #{remote_sha1}"
+ ].join("\n"))
+ end
+
+ it 'should parse commit info from the input' do
+ pushed_commits.length.should == 1
+ pushed_commits.each do |pushed_commit|
+ pushed_commit.local_ref.should == local_ref
+ pushed_commit.local_sha1.should == local_sha1
+ pushed_commit.remote_ref.should == remote_ref
+ pushed_commit.remote_sha1.should == remote_sha1
+ end
+ end
+ end
+end
| Add specs for pre_push hook context
|
diff --git a/spec/factories/trips.rb b/spec/factories/trips.rb
index abc1234..def5678 100644
--- a/spec/factories/trips.rb
+++ b/spec/factories/trips.rb
@@ -5,8 +5,8 @@ date { Faker::Date.between(1000.days.ago, 1000.days.from_now) }
hour { Faker::Time.between(1000.days.ago, 1000.days.from_now) }
starting_point { Faker::Address.street_name }
- destination_id (- 1)
- event_id (- 1)
+ association :destination, factory: :destination
+ association :event, factory: :event
end
factory :invalid_arguments, parent: :trip do
| Add associations to destination and event for trip factory
|
diff --git a/test/dummy/config/environments/development.rb b/test/dummy/config/environments/development.rb
index abc1234..def5678 100644
--- a/test/dummy/config/environments/development.rb
+++ b/test/dummy/config/environments/development.rb
@@ -10,7 +10,7 @@ config.whiny_nils = true
# Show full error reports and disable caching
- config.consider_all_requests_local = true
+ config.consider_all_requests_local = false
config.action_controller.perform_caching = false
# Don't care if the mailer can't send
| Disable all local requests so we can get real errors.
|
diff --git a/cookbooks/pkgutil/metadata.rb b/cookbooks/pkgutil/metadata.rb
index abc1234..def5678 100644
--- a/cookbooks/pkgutil/metadata.rb
+++ b/cookbooks/pkgutil/metadata.rb
@@ -1,3 +1,4 @@+name 'pkgutil'
maintainer "Martha Greenberg"
maintainer_email "marthag@wix.com"
license "Apache 2.0"
| Fix stupid CBs that don't support knife cookbook site install
|
diff --git a/mongoid-autoinc.gemspec b/mongoid-autoinc.gemspec
index abc1234..def5678 100644
--- a/mongoid-autoinc.gemspec
+++ b/mongoid-autoinc.gemspec
@@ -14,9 +14,9 @@ s.files = Dir.glob("lib/**/*") + %w(README.rdoc)
s.require_path = 'lib'
- s.add_development_dependency 'foreman'
s.add_dependency 'mongoid', '~> 3.0'
- s.add_dependency 'rspec'
s.add_dependency 'activesupport'
s.add_dependency 'rake'
+ s.add_development_dependency 'foreman'
+ s.add_development_dependency 'rspec'
end
| Reduce rspec to a development dependency
|
diff --git a/filewatcher.gemspec b/filewatcher.gemspec
index abc1234..def5678 100644
--- a/filewatcher.gemspec
+++ b/filewatcher.gemspec
@@ -23,7 +23,7 @@ s.add_development_dependency 'codecov', '~> 0.2.5'
s.add_development_dependency 'rake', '~> 13.0'
s.add_development_dependency 'rspec', '~> 3.8'
- s.add_development_dependency 'rubocop', '~> 0.93.1'
+ s.add_development_dependency 'rubocop', '~> 1.3.0'
s.add_development_dependency 'rubocop-performance', '~> 1.5'
s.add_development_dependency 'rubocop-rspec', '~> 1.43'
end
| Update rubocop to version 1.3.0 |
diff --git a/config/boot.rb b/config/boot.rb
index abc1234..def5678 100644
--- a/config/boot.rb
+++ b/config/boot.rb
@@ -1,3 +1,14 @@ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' # Set up gems listed in the Gemfile.
+
+require 'rails/commands/server'
+module Rails
+ class Server
+ # Intercode uses different domain names for different conventions, so we'll need to
+ # bind to 0.0.0.0 rather than just localhost by default.
+ def default_options
+ super.merge(Host: '0.0.0.0', Port: 3000)
+ end
+ end
+end | Make 'bin/rails s' work out of the box
|
diff --git a/core/app/models/spree/gateway/bogus_simple.rb b/core/app/models/spree/gateway/bogus_simple.rb
index abc1234..def5678 100644
--- a/core/app/models/spree/gateway/bogus_simple.rb
+++ b/core/app/models/spree/gateway/bogus_simple.rb
@@ -4,6 +4,14 @@
def payment_profiles_supported?
false
+ end
+
+ def capture(money, response_code, options = {})
+ if response_code == '12345'
+ ActiveMerchant::Billing::Response.new(true, 'Bogus Gateway: Forced success', {}, :test => true, :authorization => '67890')
+ else
+ ActiveMerchant::Billing::Response.new(false, 'Bogus Gateway: Forced failure', :error => 'Bogus Gateway: Forced failure', :test => true)
+ end
end
def authorize(money, credit_card, options = {})
| Add process method to BogusSimple gateway to be able to process payments.
Fixes issue where hitting "process" on payments screen breaks with
BogusSimple gateway.
|
diff --git a/scopy.gemspec b/scopy.gemspec
index abc1234..def5678 100644
--- a/scopy.gemspec
+++ b/scopy.gemspec
@@ -1,7 +1,5 @@ # coding: utf-8
-lib = File.expand_path('../lib', __FILE__)
-$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
-require 'scopy/version'
+require './lib/scopy/version'
Gem::Specification.new do |spec|
spec.name = "scopy"
| Remove load path wankery from gemspec
|
diff --git a/RxOptional.podspec b/RxOptional.podspec
index abc1234..def5678 100644
--- a/RxOptional.podspec
+++ b/RxOptional.podspec
@@ -9,7 +9,7 @@ Pod::Spec.new do |s|
s.name = 'RxOptional'
s.version = '1.0.0'
- s.summary = "RxSwift extensions for Swift's optionals"
+ s.summary = 'RxSwift extentions for Swift optionals and Occupiable types'
s.description = <<-DESC
RxSwift extentions for Swift optionals and "Occupiable" types.
| Update summary to reflect change of github description
|
diff --git a/app/controllers/api/v1/events_controller.rb b/app/controllers/api/v1/events_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/api/v1/events_controller.rb
+++ b/app/controllers/api/v1/events_controller.rb
@@ -9,7 +9,7 @@
def show
event = Event.find_by_id(params[:id])
- render json: event
+ render json: event, include: ['organization.name', 'cause.name']
end
def create
| Include organization and cause name data for event show
|
diff --git a/week1/test_solution.rb b/week1/test_solution.rb
index abc1234..def5678 100644
--- a/week1/test_solution.rb
+++ b/week1/test_solution.rb
@@ -2,8 +2,8 @@
require_relative 'solution'
-class SolutionTest
+class SolutionTest < Minitest::Unit::TestCase
def test_the_truth
- assert true
+ assert_equal true, true
end
end
| Fix the test base class
|
diff --git a/db/migrate/20140930000502_create_companies.rb b/db/migrate/20140930000502_create_companies.rb
index abc1234..def5678 100644
--- a/db/migrate/20140930000502_create_companies.rb
+++ b/db/migrate/20140930000502_create_companies.rb
@@ -16,6 +16,6 @@
def down
drop_table :companies
- Company.drop_tranlation_table!
+ Company.drop_translation_table!
end
end
| Fix typo in companies migration
|
diff --git a/PremierKit.podspec b/PremierKit.podspec
index abc1234..def5678 100644
--- a/PremierKit.podspec
+++ b/PremierKit.podspec
@@ -10,7 +10,7 @@
s.platform = :ios, '9.0'
s.requires_arc = true
- s.swift_version = '3.1'
+ s.swift_version = '4.1'
s.source_files = 'PremierKit/*.{h}', 'Source/**/*.{h,swift}'
s.frameworks = 'UIKit'
| Update Podspec for Swift 4.1
|
diff --git a/feed_healthcheck.rb b/feed_healthcheck.rb
index abc1234..def5678 100644
--- a/feed_healthcheck.rb
+++ b/feed_healthcheck.rb
@@ -16,22 +16,24 @@ latest = Feedjira.parse(response.body).entries.sort_by(&:published).last
if !latest
puts "No posts found: #{feed}"
- errors[feed][:length] = true
+ errors[feed] = :length
elsif latest.published < one_year_ago
puts "Not updated in over 1 year: #{feed}"
- errors[feed][:recent] = true
+ errors[feed] = :recent
end
rescue Feedjira::NoParserAvailable
puts "Failed parsing feed: #{feed}"
- errors[feed][:parse] = true
+ errors[feed] = :parse
end
else
puts "Failed to load feed: #{feed}"
- errors[feed][:fetch] = true
+ errors[feed] = :fetch
end
end
hydra.queue(request)
end
hydra.run
-pp errors+pp errors
+
+exit(1) if errors.size > 0 | Update feed healthcheck script to hopefully work with Github Actions
|
diff --git a/test/features/feature_test.rb b/test/features/feature_test.rb
index abc1234..def5678 100644
--- a/test/features/feature_test.rb
+++ b/test/features/feature_test.rb
@@ -45,7 +45,12 @@ end
def match_expect_pdf?
- system("diff-pdf --output-diff=#{path_of('diff.pdf')} #{expect_pdf} #{actual_pdf}")
+ opts = [
+ '--mark-differences',
+ # Allow for small differences that cannot be seen
+ '--channel-tolerance=40'
+ ]
+ system("diff-pdf #{opts.join(' ')} --output-diff=#{path_of('diff.pdf')} #{expect_pdf} #{actual_pdf}")
end
def actual_pdf
| Allow for small differences in pdf test results
In Ruby 3.0, the features/image_block test fails due to an unseen difference.
|
diff --git a/test/visualops_test.rb b/test/visualops_test.rb
index abc1234..def5678 100644
--- a/test/visualops_test.rb
+++ b/test/visualops_test.rb
@@ -0,0 +1,57 @@+require File.expand_path('../helper', __FILE__)
+
+class VisualOpsTest < Service::TestCase
+
+ def setup
+ @stubs = Faraday::Adapter::Test::Stubs.new
+ @data = {'username' => 'someuser', 'app_list' => 'abc123, madeira:master, xyz456:devel', 'consumer_token' => 'madeira-visualops'}
+ end
+
+ def test_push
+ svc = service :push, @data
+
+ def svc.message_max_length; 4 end
+
+ @stubs.post "/v1/apps" do |env|
+ assert_equal 'api.visualops.io', env[:url].host
+ body = JSON.parse(env[:body])
+ assert_equal 'someuser', body['user']
+ assert_equal 'madeira-visualops', body['token']
+ assert_equal ['abc123','madeira'], body['app']
+ [200, {}, '']
+ end
+
+ svc.receive_push
+ end
+
+ def test_develop
+ svc = service :push, @data,
+ payload.update("ref" => "refs/heads/devel")
+
+ @stubs.post "/v1/apps" do |env|
+ assert_equal 'api.visualops.io', env[:url].host
+ body = JSON.parse(env[:body])
+ assert_equal 'someuser', body['user']
+ assert_equal 'madeira-visualops', body['token']
+ assert_equal ['xyz456'], body['app']
+ [200, {}, '']
+ end
+
+ svc.receive_push
+ end
+
+ def test_other_branch
+ svc = service :push, @data,
+ payload.update("ref" => "refs/heads/no-such-branch")
+
+ @stubs.post "/v1/apps" do |env|
+ raise "This should not be called"
+ end
+
+ svc.receive_push
+ end
+
+ def service(*args)
+ super Service::VisualOps, *args
+ end
+end
| Test cases for visualops.io service
- test for app more than 2
- test for push to branch other than master (but listed)
- test for push to branch not list
Signed-off-by: Wang Xu <2383e706924bd9292154c9aaa0e716f1f4f020f5@mc2.io>
|
diff --git a/app/admin/optional_modules/videos/video_setting.rb b/app/admin/optional_modules/videos/video_setting.rb
index abc1234..def5678 100644
--- a/app/admin/optional_modules/videos/video_setting.rb
+++ b/app/admin/optional_modules/videos/video_setting.rb
@@ -49,10 +49,19 @@ controller do
before_action :redirect_to_show, only: [:index], if: proc { current_user_and_administrator? && @video_module.enabled? }
+ def update
+ remove_video_background_param
+ super
+ end
+
private
def redirect_to_show
redirect_to admin_video_setting_path(VideoSetting.first), status: 301
end
+
+ def remove_video_background_param
+ params[:video_setting].delete :video_background unless current_user.super_administrator?
+ end
end
end
| Remove video_background params before update unless super administrator
|
diff --git a/app/controllers/api/v1/project_roles_controller.rb b/app/controllers/api/v1/project_roles_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/api/v1/project_roles_controller.rb
+++ b/app/controllers/api/v1/project_roles_controller.rb
@@ -10,26 +10,31 @@ allowed_params :create, roles: [], links: [:user, :project]
allowed_params :update, roles: []
+
def create
if should_update?
- unless controlled_resource.roles.empty?
- raise Api::RolesExist.new
- end
-
- ActiveRecord::Base.transaction do
- build_resource_for_update(create_params.except(:links))
- controlled_resource.save!
- end
-
- if controlled_resource.persisted?
- created_resource_response(controlled_resource)
- end
+ fake_update
else
super
end
end
private
+
+ def fake_update
+ unless controlled_resource.roles.empty?
+ raise Api::RolesExist.new
+ end
+
+ ActiveRecord::Base.transaction do
+ build_resource_for_update(create_params.except(:links))
+ controlled_resource.save!
+ end
+
+ if controlled_resource.persisted?
+ created_resource_response(controlled_resource)
+ end
+ end
def should_update?
@controlled_resource = resource_class.find_by(**create_params[:links])
| Move fake update action into a separate method
|
diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/notifications_controller.rb
+++ b/app/controllers/notifications_controller.rb
@@ -1,10 +1,34 @@ class NotificationsController < ApplicationController
+ before_action :require_user
+
def index
+ @notifications = current_user.notifications.recent
+ current_user.read_notifications(@notifications)
+ end
+
+ def clear
+ current_user.notifications.delete_all
+ respond_with do |format|
+ format.html { redirect_to notifications_path }
+ format.js { render layout: false }
+ end
+ end
+
+ def delete
+ @notification = current_user.notifications.find(params[:id])
+ @notification.delete
+ respond_with do |format|
+ format.html { redirect_to notifications_path }
+ format.js { render layout: false }
+ end
end
def destroy
- end
-
- def clear
+ @notification = current_user.notifiacations.find(params[:id])
+ @notification.destroy
+ respond_with do |format|
+ format.html { redirect_to notifications_path }
+ format.js { render layout: false }
+ end
end
end
| Add the method to clear or destroy the notifications.
|
diff --git a/pipeline/config/routes.rb b/pipeline/config/routes.rb
index abc1234..def5678 100644
--- a/pipeline/config/routes.rb
+++ b/pipeline/config/routes.rb
@@ -6,6 +6,8 @@ namespace :api, defaults: { format: :json } do
resources :login, only: [:create, :destroy], controller: :sessions
resources :register, only: [:create], controller: :users
- resources :pathways, only: [:index, :show]
+ resources :pathways, only: [:index, :show] do
+ resources :projects, only:[:show]
+ end
end
end
| Create nested route for project show page
|
diff --git a/app/decorators/models/artefact_decorator.rb b/app/decorators/models/artefact_decorator.rb
index abc1234..def5678 100644
--- a/app/decorators/models/artefact_decorator.rb
+++ b/app/decorators/models/artefact_decorator.rb
@@ -24,4 +24,12 @@
class Artefact
field "author", type: String
+
+ def self.category_tags
+ [:person, :timed_item, :asset, :article, :organization]
+ end
+
+ stores_tags_for :sections, :writing_teams, :propositions,
+ :keywords, :legacy_sources, category_tags
+
end | Add extra tag types to Artefact
|
diff --git a/curly.podspec b/curly.podspec
index abc1234..def5678 100644
--- a/curly.podspec
+++ b/curly.podspec
@@ -6,7 +6,7 @@ s.license = { :type => "MIT", :file => "LICENSE" }
s.author = "Johan Lantz"
- s.platform = :ios, "7.0"
+ s.platform = :ios, "8.2"
s.source = { :git => "https://github.com/johanlantz/curly.git", :tag => s.version.to_s }
s.source_files = "*.{h,c}"
| Change target version to 8.2
|
diff --git a/spec/routes/app_spec.rb b/spec/routes/app_spec.rb
index abc1234..def5678 100644
--- a/spec/routes/app_spec.rb
+++ b/spec/routes/app_spec.rb
@@ -0,0 +1,22 @@+require_relative '../spec_helper'
+
+describe "Sinatra application" do
+
+ it 'compiles the sass stylesheet' do
+ get '/stylesheet.css'
+ last_response.status.should == 200
+ last_response.body.should =~ /\.feed-list/
+ end
+
+ it 'concatenates all the backbone app files' do
+ get '/app.js'
+ last_response.status.should == 200
+ last_response.body.should =~ /function formatDate/
+ last_response.body.should =~ /var Router/
+ last_response.body.should =~ /var Item/
+ last_response.body.should =~ /var ItemCollection/
+ last_response.body.should =~ /var ItemView/
+ last_response.body.should =~ /var ItemListView/
+ end
+
+end
| Add app specs for sass and js files
|
diff --git a/bukkit.gemspec b/bukkit.gemspec
index abc1234..def5678 100644
--- a/bukkit.gemspec
+++ b/bukkit.gemspec
@@ -1,32 +1,31 @@-# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'bukkit/version'
Gem::Specification.new do |spec|
- spec.name = "bukkit"
- spec.version = Bukkit::VERSION
- spec.authors = ["Jesse Herrick"]
- spec.email = ["school@jessegrant.net"]
- spec.description = %q{A command line wrapper for CraftBukkit.}
- spec.summary = %q{A command line wrapper for CraftBukkit. Manage your server much easier.}
- spec.homepage = "https://github.com/JesseHerrick/Bukkit-CLI"
- spec.license = "MIT"
+ spec.name = "bukkit"
+ spec.version = Bukkit::VERSION
+ spec.authors = ["Jesse Herrick"]
+ spec.email = ["school@jessegrant.net"]
+ spec.description = %q{A command line wrapper for CraftBukkit.}
+ spec.summary = %q{A command line wrapper for CraftBukkit. Manage your server much easier.}
+ spec.homepage = "https://github.com/JesseHerrick/Bukkit-CLI"
+ spec.license = "MIT"
- spec.files = `git ls-files`.split($/)
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
- spec.require_paths = ["lib"]
+ spec.files = `git ls-files`.split($/)
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
+ spec.require_paths = ["lib"]
- # Runtime Dependencies
- spec.add_runtime_dependency('archive-zip')
- spec.add_runtime_dependency('colorize')
- spec.add_runtime_dependency('commander')
- spec.add_runtime_dependency('multi_json')
- spec.add_runtime_dependency('launchy')
- spec.add_runtime_dependency('curb')
+ # Runtime Dependencies
+ spec.add_runtime_dependency('archive-zip')
+ spec.add_runtime_dependency('colorize')
+ spec.add_runtime_dependency('commander')
+ spec.add_runtime_dependency('multi_json')
+ spec.add_runtime_dependency('launchy')
+ spec.add_runtime_dependency('curb')
- # Dev Dependencies
- spec.add_development_dependency('bundler')
- spec.add_development_dependency('rake')
+ # Dev Dependencies
+ spec.add_development_dependency('bundler')
+ spec.add_development_dependency('rake')
end | Convert gemspec to 4 space hard tabs.
|
diff --git a/GTScrollNavigationBar.podspec b/GTScrollNavigationBar.podspec
index abc1234..def5678 100644
--- a/GTScrollNavigationBar.podspec
+++ b/GTScrollNavigationBar.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |s|
s.name = "GTScrollNavigationBar"
- s.version = "0.1.3"
+ s.version = "0.2"
s.summary = "A scrollable UINavigationBar that follows a UIScrollView"
s.homepage = "https://github.com/luugiathuy/GTScrollNavigationBar"
s.license = 'BSD'
| Update pod version to 0.2
|
diff --git a/spec/unit/field_spec.rb b/spec/unit/field_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/field_spec.rb
+++ b/spec/unit/field_spec.rb
@@ -25,13 +25,13 @@ subject.stub(:respond_to?).with(:has_value?).and_return(false)
end
- describe "== method" do
+ describe "==" do
it "behaves in the conventional way" do
(subject == "A value").should be_false
end
end
- describe "!= method" do
+ describe "!=" do
it "behaves in the conventional way" do
(subject != "A value").should be_true
end
| Stop misleadingly referring to "methods".
!= is a method in Ruby 1.9, but more of an operator in Ruby 1.8.
|
diff --git a/sprockets-rails.gemspec b/sprockets-rails.gemspec
index abc1234..def5678 100644
--- a/sprockets-rails.gemspec
+++ b/sprockets-rails.gemspec
@@ -15,6 +15,7 @@ s.add_dependency "actionpack", ">= 3.0"
s.add_dependency "activesupport", ">= 3.0"
s.add_development_dependency "rake"
+ s.add_development_dependency "railties", ">= 3.0"
s.author = "Joshua Peek"
s.email = "josh@joshpeek.com"
| Define railties as development dependency
|
diff --git a/lib/prefix_routes_with_locale/action_dispatch.rb b/lib/prefix_routes_with_locale/action_dispatch.rb
index abc1234..def5678 100644
--- a/lib/prefix_routes_with_locale/action_dispatch.rb
+++ b/lib/prefix_routes_with_locale/action_dispatch.rb
@@ -18,8 +18,11 @@ # is optional.
# This should be fixed, first: %{path} is parsed, second, it forces url prefix
# even on non-prefixed paths
- def ensure_url_has_locale
+ def ensure_all_routes_have_prefix
match '*path', to: redirect("/#{I18n.default_locale}/%{path}"), constraints: lambda { |req| !req.path.starts_with? "/#{I18n.default_locale}/" }
+ end
+
+ def ensure_home_has_prefix
match '', to: redirect("/#{I18n.default_locale}")
end
| Split ensure_url_has_locale in two more appropriated methods
|
diff --git a/Casks/menubar-colors.rb b/Casks/menubar-colors.rb
index abc1234..def5678 100644
--- a/Casks/menubar-colors.rb
+++ b/Casks/menubar-colors.rb
@@ -1,6 +1,6 @@ cask :v1 => 'menubar-colors' do
- version '1.4.1'
- sha256 '98f7136e01ac5e8da0d265258100ffda98d5e95f84d86bcb78d3345b2e2f56d6'
+ version '2.0.0'
+ sha256 'e150d4d0b2abe1183c38393ec4ea186b753925e3c1978aeebce34586e027feef'
url "https://github.com/nvzqz/menubar-colors/releases/download/v#{version}/Menubar-Colors.zip"
appcast 'https://github.com/nvzqz/menubar-colors/releases.atom'
| Upgrade Menubar Colors to v2.0.0
|
diff --git a/Casks/webkit-nightly.rb b/Casks/webkit-nightly.rb
index abc1234..def5678 100644
--- a/Casks/webkit-nightly.rb
+++ b/Casks/webkit-nightly.rb
@@ -1,6 +1,6 @@ cask 'webkit-nightly' do
- version 'r194284'
- sha256 'c06cae8dd3d9ecacf89a440a19ac5fda5587695c5c6f5e58e41eea40ba685827'
+ version 'r198607'
+ sha256 '7ed00fcc62a4f8ba334df551eba9e08cf54e8bf6abce2765b785061cc0c3e93c'
url "http://builds.nightly.webkit.org/files/trunk/mac/WebKit-SVN-#{version}.dmg"
name 'WebKit Nightly'
| Update WebKit Nightly to r198607
http://builds.nightly.webkit.org/files/trunk/mac/WebKit-SVN-r198607.dmg |
diff --git a/app.rb b/app.rb
index abc1234..def5678 100644
--- a/app.rb
+++ b/app.rb
@@ -2,7 +2,12 @@ class App < Sinatra::Base
configure do
- AnyGood::REDIS = Redis.new
+ if ENV["REDISTOGO_URL"]
+ uri = URI.parse(ENV["REDISTOGO_URL"])
+ AnyGood::REDIS = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password)
+ else
+ AnyGood::REDIS = Redis.new
+ end
end
get '/' do
| Make Redis work with Herokus RedisToGo
|
diff --git a/Casks/flickr-uploadr.rb b/Casks/flickr-uploadr.rb
index abc1234..def5678 100644
--- a/Casks/flickr-uploadr.rb
+++ b/Casks/flickr-uploadr.rb
@@ -4,7 +4,7 @@
url 'https://downloads.flickr.com/uploadr/FlickrUploadr.dmg'
name 'Flickr Uploadr'
- homepage 'http://www.flickr.com/tools/'
+ homepage 'https://www.flickr.com/tools/'
license :gratis
app 'Flickr Uploadr.app'
| Fix homepage to use SSL in Flickr Uploadr Cask
The HTTP URL is already getting redirected to HTTPS. Using the HTTPS URL directly
makes it more secure and saves a HTTP round-trip.
|
diff --git a/Casks/omnifocus-beta.rb b/Casks/omnifocus-beta.rb
index abc1234..def5678 100644
--- a/Casks/omnifocus-beta.rb
+++ b/Casks/omnifocus-beta.rb
@@ -1,10 +1,10 @@ cask :v1 => 'omnifocus-beta' do
- version '2.2.x-r241602'
- sha256 '72c8e43de504ba18450d8c04cefefeea8e90bb81561b8c52869c2ce91ed61ae8'
+ version 'r243022'
+ sha256 '4afcc45844522d63b787f7f346bfa81094aecce790cec8b4b9fbedbafcc217c3'
- url "http://omnistaging.omnigroup.com/omnifocus-2.2.x/releases/OmniFocus-#{version}-Test.dmg"
+ url "http://omnistaging.omnigroup.com/omnifocus-2.x/releases/OmniFocus-#{version}-Test.dmg"
name 'OmniFocus'
- homepage 'http://omnistaging.omnigroup.com/omnifocus-2.2.x/'
+ homepage 'http://omnistaging.omnigroup.com/omnifocus-2.x/'
license :commercial
app 'OmniFocus.app'
| Update OmniFocus Beta to version 2.3 (r243022)
This commit updates the version, sha256 and url stanzas.
|
diff --git a/Library/Formula/swig.rb b/Library/Formula/swig.rb
index abc1234..def5678 100644
--- a/Library/Formula/swig.rb
+++ b/Library/Formula/swig.rb
@@ -0,0 +1,13 @@+require 'brewkit'
+
+class Swig <Formula
+ url 'http://downloads.sourceforge.net/swig/swig-1.3.40.tar.gz'
+ homepage 'http://www.swig.org/'
+ md5 '2df766c9e03e02811b1ab4bba1c7b9cc'
+
+ def install
+ system "./configure", "--prefix=#{prefix}", "--disable-debug", "--disable-dependency-tracking"
+ system "make"
+ system "make install"
+ end
+end
| Add Formula for Swig 1.3.40
|
diff --git a/lib/pycall/eval.rb b/lib/pycall/eval.rb
index abc1234..def5678 100644
--- a/lib/pycall/eval.rb
+++ b/lib/pycall/eval.rb
@@ -7,6 +7,7 @@ locals_ptr = maindict_ptr
defer_sigint do
py_code_ptr = LibPython.Py_CompileString(str, filename, Py_eval_input)
+ raise PyError.fetch if py_code_ptr.null?
LibPython.PyEval_EvalCode(py_code_ptr, globals_ptr, locals_ptr)
end
end
| Raise PyError when Py_CompileString fails
|
diff --git a/lib/raven/extra.rb b/lib/raven/extra.rb
index abc1234..def5678 100644
--- a/lib/raven/extra.rb
+++ b/lib/raven/extra.rb
@@ -6,7 +6,7 @@
def with_extra(extra)
self.extra ||= {}
- self.extra.merge!(extra)
+ self.extra.deep_merge!(extra)
self
end
@@ -31,7 +31,7 @@
if exception.respond_to?(:extra) && extra = exception.extra
self.extra ||= {}
- self.extra.merge!(extra)
+ self.extra.deep_merge!(extra)
end
end
| Use deep merge to support multiple tags
|
diff --git a/lib/tasks/aws.rake b/lib/tasks/aws.rake
index abc1234..def5678 100644
--- a/lib/tasks/aws.rake
+++ b/lib/tasks/aws.rake
@@ -23,8 +23,8 @@ templates = et.read_templates(Rails.root.join(Settings.encoding.presets_path))
templates.each do |template|
unless et.find_preset_by_name(template[:name]).present?
- preset = et.create_preset(template)
- Rails.logger.info "#{template[:name]}: #{preset.id}"
+ resp = et.create_preset(template)
+ Rails.logger.info "#{template[:name]}: #{resp.preset.id}"
end
end
end
| Fix rake create_presets for AWS |
diff --git a/lib/timer/timer.rb b/lib/timer/timer.rb
index abc1234..def5678 100644
--- a/lib/timer/timer.rb
+++ b/lib/timer/timer.rb
@@ -5,9 +5,7 @@ def self.start(minutes, messages=nil)
alert_start(minutes)
count_down(minutes, messages)
-
- # Play a chime when finished
- `say timer done`
+ play_done_chime
end
def self.count_down(starting_with, messages)
@@ -23,4 +21,8 @@ def self.alert_start(minutes)
puts "Starting timer for #{minutes} minutes..."
end
+
+ def self.play_done_chime
+ `say timer done`
+ end
end
| Remove done chime to method
|
diff --git a/lib/valutec/api.rb b/lib/valutec/api.rb
index abc1234..def5678 100644
--- a/lib/valutec/api.rb
+++ b/lib/valutec/api.rb
@@ -8,7 +8,7 @@
base_uri 'https://ws.valutec.net/Valutec.asmx'
- attr_accessor :client_key, :terminal_id, :server_id, :identifier
+ attr_accessor :client_key, :terminal_id, :server_id
Response = Struct.new(:response, :error)
@@ -16,11 +16,6 @@ @client_key = ENV['VALUTEC_CLIENT_KEY'] || raise("ENV['VALUTEC_CLIENT_KEY'] not specified")
@terminal_id = ENV['VALUTEC_TERMINAL_ID'] || raise("ENV['VALUTEC_TERMINAL_ID'] not specified, nor is it included in class initialization")
@server_id = ENV['VALUTEC_SERVER_ID'] || raise("ENV['VALUTEC_SERVER_ID'] not specified, nor is it included in class initialization")
- # I'm not convinced identifier is used for anything, but Valutec
- # complains when this param is missing. Generate random things to
- # shove into this field unless otherwise specified.
- @identifier = ENV.fetch('VALUTEC_IDENTIFIER', SecureRandom.hex(5))
-
end
def call(method,params={})
@@ -34,5 +29,14 @@ # TODO: Use or lose :error variable in Response
Response.new(response, "No errors detected.")
end
+
+ private
+
+ def identifier
+ # I'm not convinced identifier is used for anything, but Valutec
+ # complains when this param is missing. Generate random things to
+ # shove into this field unless otherwise specified.
+ ENV.fetch('VALUTEC_IDENTIFIER', SecureRandom.hex(5))
+ end
end
end
| Move identifier to own method
We need to generate this for every request, otherwise bad things happen.
It may have implications for an order identifier though.
|
diff --git a/app/controllers/conversations_controller.rb b/app/controllers/conversations_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/conversations_controller.rb
+++ b/app/controllers/conversations_controller.rb
@@ -16,7 +16,7 @@
def create
friend = User.find(params[:friend_id])
- conversation = current_user.send_message(friend, "Prueba", "New").conversation
+ conversation = current_user.send_message(friend, params[:message], params[:subject]).conversation
redirect_to user_conversation_path(current_user, conversation)
end
| Add new params to the conversation creation
|
diff --git a/app/controllers/go_redirector_controller.rb b/app/controllers/go_redirector_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/go_redirector_controller.rb
+++ b/app/controllers/go_redirector_controller.rb
@@ -19,10 +19,11 @@ if repository.nil?
logger.error("GoRedirector : repository not found at path : '#{repo_path}', exiting !")
render_404
- elsif !repository.smart_http_enabled?
- logger.error("GoRedirector : SmartHttp is disabled for this repository '#{repository.gitolite_repository_name}', exiting !")
+ elsif !repository.go_access_available?
+ logger.error("GoRedirector : GoAccess is disabled for this repository '#{repository.gitolite_repository_name}', exiting !")
render_403
else
+ logger.info("GoRedirector : access granted for repository '#{repository.gitolite_repository_name}'")
@repository = repository
end
end
| Fix wrong behavior of GoRedirectorController when project is private
|
diff --git a/app/controllers/script_levels_controller.rb b/app/controllers/script_levels_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/script_levels_controller.rb
+++ b/app/controllers/script_levels_controller.rb
@@ -32,6 +32,7 @@ @callback = milestone_url(user_id: current_user.try(:id) || 0, script_level_id: @script_level)
@full_width = true
@callouts = Callout.select(:element_id, :text, :qtip_at, :qtip_my)
+ @autoplay_video = nil if params[:noautoplay]
render 'levels/show'
end
end
| Add "noautoplay" param to prevent video auto-play
|
diff --git a/ci_environment/phpenv/attributes/default.rb b/ci_environment/phpenv/attributes/default.rb
index abc1234..def5678 100644
--- a/ci_environment/phpenv/attributes/default.rb
+++ b/ci_environment/phpenv/attributes/default.rb
@@ -1,6 +1,6 @@ default[:phpenv] = {
:git => {
:repository => "git://github.com/CHH/phpenv.git",
- :revision => "a3091e84de6dd2c61ea1bdb96cf3053c62740a3f"
+ :revision => "01a2c1e25096f8ff10f2f781428a5d470e1ecaba"
}
}
| Update phpenv with a fix to config-rm.
Fixes travis-ci/travis-ci#999.
|
diff --git a/peek.gemspec b/peek.gemspec
index abc1234..def5678 100644
--- a/peek.gemspec
+++ b/peek.gemspec
@@ -13,6 +13,13 @@ gem.homepage = 'https://github.com/peek/peek'
gem.license = 'MIT'
+ gem.metadata = {
+ 'bug_tracker_uri' => 'https://github.com/peek/peek/issues',
+ 'changelog_uri' => "https://github.com/peek/peek/blob/v#{gem.version}/CHANGELOG.md",
+ 'documentation_uri' => "https://www.rubydoc.info/gems/peek/#{gem.version}",
+ 'source_code_uri' => "https://github.com/peek/peek/tree/v#{gem.version}",
+ }
+
gem.files = `git ls-files`.split($/)
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
| Add project metadata to the gemspec
As per https://guides.rubygems.org/specification-reference/#metadata,
add metadata to the gemspec file. This'll allow people to more easily
access the source code, raise issues and read the changelog. These
`bug_tracker_uri`, `changelog_uri`, `documentation_uri`, and
`source_code_uri` links will appear on the rubygems page at
https://rubygems.org/gems/peek and be available via the rubygems
API after the next release.
|
diff --git a/mailchimp3.gemspec b/mailchimp3.gemspec
index abc1234..def5678 100644
--- a/mailchimp3.gemspec
+++ b/mailchimp3.gemspec
@@ -4,7 +4,7 @@
Gem::Specification.new do |s|
s.name = "mailchimp3"
- s.version = Mailchimp3::VERSION
+ s.version = MailChimp3::VERSION
s.homepage = "https://github.com/seven1m/mailchimp3"
s.summary = "wrapper for MailChimp's 3.0 API"
s.description = "mailchimp3 is a gem for working with MailChimp's RESTful JSON API documented at http://kb.mailchimp.com/api/ using HTTP basic auth or OAuth 2.0. This library can talk to any endpoint the API provides, since it is written to build endpoint URLs dynamically using method_missing."
| Fix class name in gemspec
|
diff --git a/lib/buildr_plus/java_multimodule.rb b/lib/buildr_plus/java_multimodule.rb
index abc1234..def5678 100644
--- a/lib/buildr_plus/java_multimodule.rb
+++ b/lib/buildr_plus/java_multimodule.rb
@@ -0,0 +1,34 @@+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require 'buildr_plus/java'
+
+BuildrPlus::Roles.project('model', :roles => [:model], :parent => :container, :description => 'Persistent Entities, Messages and Data Structures')
+BuildrPlus::Roles.project('model-qa-support', :roles => [:model_qa_support], :parent => :container, :description => 'Model Test Infrastructure')
+BuildrPlus::Roles.project('server', :roles => [:server], :parent => :container, :description => 'Server Archive')
+
+if BuildrPlus::FeatureManager.activated?(:gwt)
+ BuildrPlus::Roles.project('gwt', :roles => [:gwt], :parent => :container, :description => 'GWT Library')
+ BuildrPlus::Roles.project('gwt-qa-support', :roles => [:gwt_qa_support], :parent => :container, :description => 'GWT Test Infrastructure')
+end
+
+if BuildrPlus::FeatureManager.activated?(:soap)
+ BuildrPlus::Roles.project('soap-client', :roles => [:soap_client], :parent => :container, :description => 'SOAP Client API')
+ BuildrPlus::Roles.project('soap-qa-support', :roles => [:soap_qa_support], :parent => :container, :description => 'SOAP Test Infrastructure')
+end
+
+BuildrPlus::Roles.project('integration-qa-support', :roles => [:integration_qa_support], :parent => :container, :description => 'Integration Test Infrastructure')
+BuildrPlus::Roles.project('integration-tests', :roles => [:integration_tests], :parent => :container, :description => 'Integration Tests')
+
+BuildrPlus::ExtensionRegistry.auto_activate!
| Add a multi_module template that follows our standard pattern
|
diff --git a/lib/codeclimate_ci/api_requester.rb b/lib/codeclimate_ci/api_requester.rb
index abc1234..def5678 100644
--- a/lib/codeclimate_ci/api_requester.rb
+++ b/lib/codeclimate_ci/api_requester.rb
@@ -13,5 +13,9 @@ def branch_info(branch)
self.class.get("/branches/#{branch}")
end
+
+ def connection_established?
+ true if self.class.get('/').code == 200
+ end
end
end
| Add connection_established method to ApiRequester class
|
diff --git a/api/solidus_api.gemspec b/api/solidus_api.gemspec
index abc1234..def5678 100644
--- a/api/solidus_api.gemspec
+++ b/api/solidus_api.gemspec
@@ -2,27 +2,28 @@
require_relative '../core/lib/spree/core/version.rb'
-Gem::Specification.new do |gem|
- gem.author = 'Solidus Team'
- gem.email = 'contact@solidus.io'
- gem.homepage = 'http://solidus.io/'
- gem.license = 'BSD-3-Clause'
+Gem::Specification.new do |s|
+ s.platform = Gem::Platform::RUBY
+ s.name = "solidus_api"
+ s.version = Spree.solidus_version
+ s.summary = 'REST API for the Solidus e-commerce framework.'
+ s.description = s.summary
- gem.summary = 'REST API for the Solidus e-commerce framework.'
- gem.description = gem.summary
+ s.author = 'Solidus Team'
+ s.email = 'contact@solidus.io'
+ s.homepage = 'http://solidus.io/'
+ s.license = 'BSD-3-Clause'
- gem.files = `git ls-files -z`.split("\x0").reject do |f|
+ s.files = `git ls-files -z`.split("\x0").reject do |f|
f.match(%r{^(spec|script)/})
end
- gem.name = "solidus_api"
- gem.require_paths = ["lib"]
- gem.version = Spree.solidus_version
+ s.require_paths = ["lib"]
- gem.required_ruby_version = '>= 2.4.0'
- gem.required_rubygems_version = '>= 1.8.23'
+ s.required_ruby_version = '>= 2.4.0'
+ s.required_rubygems_version = '>= 1.8.23'
- gem.add_dependency 'jbuilder', '~> 2.8'
- gem.add_dependency 'kaminari-activerecord', '~> 1.1'
- gem.add_dependency 'responders'
- gem.add_dependency 'solidus_core', gem.version
+ s.add_dependency 'jbuilder', '~> 2.8'
+ s.add_dependency 'kaminari-activerecord', '~> 1.1'
+ s.add_dependency 'responders'
+ s.add_dependency 'solidus_core', s.version
end
| Make api gemspec uniform to other ones
This commit just changes the inner block variable `gem` to `s`,
to reflect what we do in other gemspecs.
It also reorder items so it's easy to find gemspecs pieces where
we have them in the gemspec of the other components.
|
diff --git a/api/app/controllers/v1/analytics_controller.rb b/api/app/controllers/v1/analytics_controller.rb
index abc1234..def5678 100644
--- a/api/app/controllers/v1/analytics_controller.rb
+++ b/api/app/controllers/v1/analytics_controller.rb
@@ -15,7 +15,7 @@ end
def group
- segment(:group, %w(user_id group_id))
+ segment(:group, %w(user_id group_id traits))
end
private
| Add group traits to analytics
|
diff --git a/lib/enchant_encoder/encode_proxy.rb b/lib/enchant_encoder/encode_proxy.rb
index abc1234..def5678 100644
--- a/lib/enchant_encoder/encode_proxy.rb
+++ b/lib/enchant_encoder/encode_proxy.rb
@@ -9,16 +9,12 @@ end
def each(*args, &block)
- if @obj.respond_to?(:each)
- if block_given?
- @obj.each do |row|
- yield ::NKF.nkf('-Lu -w -m0', row)
- end
- else
- @obj.each.extend(NkfEach)
+ if block_given?
+ @obj.each do |row|
+ yield ::NKF.nkf('-Lu -w -m0', row)
end
else
- @obj.each(*args, &block)
+ @obj.each.extend(NkfEach)
end
end
@@ -26,13 +22,9 @@ if @obj == CSV
CsvRefiner.new(@obj).foreach(*args, &block)
else
- if @obj.respond_to?(:foreach)
- if block_given?
- @obj.foreach(*args) do |row|
- yield ::NKF.nkf('-Lu -w -m0', row)
- end
- else
- @obj.foreach(*args).extend(NkfEach)
+ if block_given?
+ @obj.foreach(*args) do |row|
+ yield ::NKF.nkf('-Lu -w -m0', row)
end
else
@obj.foreach(*args).extend(NkfEach)
@@ -44,12 +36,8 @@ if @obj == CSV
CsvRefiner.new(@obj).open(*args, &block)
else
- if @obj.respond_to?(:open)
- io = @obj.open(*args).extend(NkfEach)
- block_given? ? yield(io) : io
- else
- @obj.open(*args, &block)
- end
+ io = @obj.open(*args).extend(NkfEach)
+ block_given? ? yield(io) : io
end
end
| Refactor
* Remove respond_to? because it is unnecessary
|
diff --git a/lib/craigslister/post_scraper.rb b/lib/craigslister/post_scraper.rb
index abc1234..def5678 100644
--- a/lib/craigslister/post_scraper.rb
+++ b/lib/craigslister/post_scraper.rb
@@ -1,4 +1,4 @@-# Creates Post objects out of an HTML page
+# Scrapes craigslist posts and packages data in Post objects
class PostScraper
def initialize(page, link)
@page = page
| Add more descriptive comment for PostScraper |
diff --git a/app/controllers/forem/categories_controller.rb b/app/controllers/forem/categories_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/forem/categories_controller.rb
+++ b/app/controllers/forem/categories_controller.rb
@@ -1,6 +1,6 @@ module Forem
class CategoriesController < Forem::ApplicationController
helper 'forem/forums'
- load_and_authorize_resource :class => Forem::Category
+ load_and_authorize_resource :class => 'Forem::Category'
end
end
| Use class names, not constants
|
diff --git a/app/controllers/forem/categories_controller.rb b/app/controllers/forem/categories_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/forem/categories_controller.rb
+++ b/app/controllers/forem/categories_controller.rb
@@ -2,5 +2,9 @@ class CategoriesController < Forem::ApplicationController
helper 'forem/forums'
load_and_authorize_resource
+
+ def index
+ @categories = Forem::Category.all.order("ordinal ASC")
+ end
end
end
| Order admin categories list by ordinal
|
diff --git a/app/controllers/kracken/sessions_controller.rb b/app/controllers/kracken/sessions_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/kracken/sessions_controller.rb
+++ b/app/controllers/kracken/sessions_controller.rb
@@ -13,7 +13,6 @@
def destroy
reset_session
- flash[:notice] = "Signed out successfully."
redirect_to "#{provider_url}/users/sign_out#{signout_redirect_query}"
end
| Drop flash from sign out action
The flow redirects to the account server. The account server may not be
redirecting back. Thus the flash will only appear the next time the user
hits the service site, which may actually be after they log in - thus
providing a very confusing flash notice. Instead of trying to use
cookies or something else to handle cross origin messages this simply
drops the flash notice so no message will appear.
|
diff --git a/lib/active_interaction/filters/time_filter.rb b/lib/active_interaction/filters/time_filter.rb
index abc1234..def5678 100644
--- a/lib/active_interaction/filters/time_filter.rb
+++ b/lib/active_interaction/filters/time_filter.rb
@@ -21,10 +21,11 @@ # @private
class TimeFilter < AbstractDateTimeFilter
def self.prepare(key, value, options = {}, &block)
- if value.is_a?(Numeric)
- time.at(value)
- else
- super(key, value, options.merge(class: time), &block)
+ case value
+ when Numeric
+ time.at(value)
+ else
+ super(key, value, options.merge(class: time), &block)
end
end
| Use a case statement for the time filter
This keeps all the filters consistent.
|
diff --git a/vendor/plugins/themes/lib/theme_server.rb b/vendor/plugins/themes/lib/theme_server.rb
index abc1234..def5678 100644
--- a/vendor/plugins/themes/lib/theme_server.rb
+++ b/vendor/plugins/themes/lib/theme_server.rb
@@ -1,7 +1,7 @@ # Allow the metal piece to run in isolation
require(File.dirname(__FILE__) + "/../../config/environment") unless defined?(Rails)
-# Servers theme files from the them directory without touching Rails too much
+# Serves theme files from the theme directory without touching Rails too much
class ThemeServer
def initialize(app)
@@ -15,13 +15,14 @@ if (file_path = Rails.root.join("themes", RefinerySetting[:theme], relative_path)).exist?
# generate an etag for client-side caching.
etag = Digest::MD5.hexdigest("#{file_path.to_s}#{file_path.mtime}")
- unless (env["HTTP_IF_NONE_MATCH"] == etag and RefinerySetting.find_or_set(:themes_use_etags, false))
+ unless (env["HTTP_IF_NONE_MATCH"] == etag and RefinerySetting.find_or_set(:themes_use_etags, false) == true)
[200, {
"Content-Type" => Rack::Mime.mime_type(file_path.extname),
+ "Cache-Control" => "public",
"ETag" => etag
}, file_path.open]
else
- [304, {"Content-Type" => Rack::Mime.mime_type(file_path.extname)}, "Not Modified"]
+ [304, {}, []]
end
else
[404, {"Content-Type" => "text/html"}, ["Not Found"]]
| Send a blank response with 304
|
diff --git a/lib/shopify_api/defined_versions.rb b/lib/shopify_api/defined_versions.rb
index abc1234..def5678 100644
--- a/lib/shopify_api/defined_versions.rb
+++ b/lib/shopify_api/defined_versions.rb
@@ -4,6 +4,7 @@ def define_known_versions
define_version(ShopifyAPI::ApiVersion::Unstable.new)
define_version(ShopifyAPI::ApiVersion::Release.new('2019-04'))
+ define_version(ShopifyAPI::ApiVersion::Release.new('2019-07'))
end
end
end
| Define the upcoming version of July
|
diff --git a/lib/stackprofiler/data_collector.rb b/lib/stackprofiler/data_collector.rb
index abc1234..def5678 100644
--- a/lib/stackprofiler/data_collector.rb
+++ b/lib/stackprofiler/data_collector.rb
@@ -14,12 +14,14 @@ req.fullpath =~ regex
end
end
+
+ @stackprof_opts = {mode: :wall, interval: 1000, raw: true}.merge(options[:stackprof] || {})
end
def call(env)
if @predicate.call(env)
out = nil
- profile = StackProf.run(mode: :wall, interval: 1000, raw: true) { out = @app.call env }
+ profile = StackProf.run(@stackprof_opts) { out = @app.call env }
req = Rack::Request.new env
run = Run.new req.fullpath, profile, Time.now
| Allow stackprof options to be configured in middleware
|
diff --git a/lib/uniara_virtual_parser/client.rb b/lib/uniara_virtual_parser/client.rb
index abc1234..def5678 100644
--- a/lib/uniara_virtual_parser/client.rb
+++ b/lib/uniara_virtual_parser/client.rb
@@ -1,4 +1,7 @@ module UniaraVirtualParser
+ #
+ # This module handle the connections between all services and the UniaraVirtual server
+ #
class Client
ENDPOINT = 'http://virtual.uniara.com.br'
class << self
| Add a little comment in Client
|
diff --git a/lib/attributable/validators/slug_validator.rb b/lib/attributable/validators/slug_validator.rb
index abc1234..def5678 100644
--- a/lib/attributable/validators/slug_validator.rb
+++ b/lib/attributable/validators/slug_validator.rb
@@ -1,5 +1,5 @@ class SlugValidator < ActiveModel::EachValidator
- SLUG_REGEXP = /\A[a-zA-Z][a-zA-Z0-9\-]+\Z/
+ SLUG_REGEXP = /\A[a-zA-Z0-9\-]+\Z/
def validate_each(object, attribute, value)
configuration = { :message => I18n.t("activerecord.errors.messages.slugable") }
| Allow slugs to start with digit(s)
|
diff --git a/lib/baustelle/cloud_formation/internal_dns.rb b/lib/baustelle/cloud_formation/internal_dns.rb
index abc1234..def5678 100644
--- a/lib/baustelle/cloud_formation/internal_dns.rb
+++ b/lib/baustelle/cloud_formation/internal_dns.rb
@@ -22,8 +22,6 @@
OpenStruct.new(id: 'InternalDNSZone', domain: domain)
end
- end
-
def cname(template, zone, name:, target:, ttl: 60)
name = Array(name).map(&:underscore).
@@ -43,5 +41,6 @@ domain
end
+ end
end
end
| Move method to proper module
|
diff --git a/spec/features/issues/filter_by_milestone_spec.rb b/spec/features/issues/filter_by_milestone_spec.rb
index abc1234..def5678 100644
--- a/spec/features/issues/filter_by_milestone_spec.rb
+++ b/spec/features/issues/filter_by_milestone_spec.rb
@@ -13,7 +13,7 @@ visit_issues(project)
filter_by_milestone(Milestone::None.title)
- expect(page).to have_css('.title', count: 1)
+ expect(page).to have_css('.issue .title', count: 1)
end
scenario 'filters by a specific Milestone', js: true do
@@ -23,7 +23,7 @@ visit_issues(project)
filter_by_milestone(milestone.title)
- expect(page).to have_css('.title', count: 1)
+ expect(page).to have_css('.issue .title', count: 1)
end
def visit_issues(project)
| Fix issue milestone filter spec
|
diff --git a/app/serializers/activity_session_serializer.rb b/app/serializers/activity_session_serializer.rb
index abc1234..def5678 100644
--- a/app/serializers/activity_session_serializer.rb
+++ b/app/serializers/activity_session_serializer.rb
@@ -2,5 +2,5 @@ attributes :uid, :percentage, :state, :completed_at, :data, :temporary,
:activity_uid, :anonymous
- has_many :concept_results
+ # has_many :concept_results
end
| Stop sending the concept result back to the app when we are done as they aren't needed.
|
diff --git a/spec/system/bus_stops/managing_bus_stops_spec.rb b/spec/system/bus_stops/managing_bus_stops_spec.rb
index abc1234..def5678 100644
--- a/spec/system/bus_stops/managing_bus_stops_spec.rb
+++ b/spec/system/bus_stops/managing_bus_stops_spec.rb
@@ -28,6 +28,7 @@ click_link 'Edit'
end
expect(page).to have_content "Editing #{@bus_stop.name}"
+ expect(page.current_path).to match edit_bus_stop_path(@bus_stop.hastus_id)
end
end
end
| Make sure the path is right
|
diff --git a/app/views/versions/_versions_feed.atom.builder b/app/views/versions/_versions_feed.atom.builder
index abc1234..def5678 100644
--- a/app/views/versions/_versions_feed.atom.builder
+++ b/app/views/versions/_versions_feed.atom.builder
@@ -7,9 +7,9 @@ builder.link "rel" => "alternate", "href" => rubygems_url
builder.id rubygems_url
- builder.updated(versions.first.updated_at.iso8601) if versions.any?
+ builder.updated(versions.first.rubygem.updated_at.iso8601) if versions.any?
- builder.author { xml.name "Rubygems" }
+ builder.author {xml.name "Rubygems"}
versions.each do |version|
builder.entry do
@@ -17,7 +17,7 @@ builder.link "rel" => "alternate", "href" => rubygem_version_url(version.rubygem, version.slug)
builder.id rubygem_version_url(version.rubygem, version.slug)
builder.updated version.created_at.iso8601
- builder.author {|author| author.name h(version.authors) }
+ builder.author {|author| author.name h(version.authors)}
builder.summary version.summary if version.summary?
builder.content "type" => "html" do
builder.text! h(version.description)
| Make feed date behavior match specs
|
diff --git a/lib/poise_application/version.rb b/lib/poise_application/version.rb
index abc1234..def5678 100644
--- a/lib/poise_application/version.rb
+++ b/lib/poise_application/version.rb
@@ -15,5 +15,5 @@ #
module PoiseApplication
- VERSION = '5.0.0'
+ VERSION = '5.0.0.pre'
end
| Mark as prerelease for Halite. |
diff --git a/lib/reporter/writers/circonus.rb b/lib/reporter/writers/circonus.rb
index abc1234..def5678 100644
--- a/lib/reporter/writers/circonus.rb
+++ b/lib/reporter/writers/circonus.rb
@@ -3,10 +3,16 @@ module Reporter
module Writers
class Circonus
- attr_reader :uri
+ class Error < StandardError; end
+ class TrapUnreachable < Error; end
+
+ attr_reader :uri, :failure_count
+
+ FAILURE_LIMIT = 100
def initialize(url)
@uri = URI(url)
+ @failure_count = 0
end
def write(body)
@@ -15,6 +21,9 @@ http.request_post(uri.path, body)
end
rescue Zlib::BufError
+ rescue Errno::ECONNREFUSED
+ @failure_count += 1
+ raise TrapUnreachable if failure_count > FAILURE_LIMIT
end
def http_options
| Allow up to 100 failures if Circonus trap URL blips
|
diff --git a/app/controllers/schools_controller.rb b/app/controllers/schools_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/schools_controller.rb
+++ b/app/controllers/schools_controller.rb
@@ -23,11 +23,25 @@ dbn: school.dbn,
grade_span_min: school.grade_span_min,
grade_span_max: school.grade_span_max,
+ programs: [],
:'marker-color' => '#00607d',
:'marker-symbol' => 'circle',
:'marker-size' => 'medium'
}
}
+ @programs = school.programs
+ @programs.each do |program|
+ programs = @geojson[0][:properties][:programs]
+ program_name = program.program_name
+ programs << {
+ program_name: {
+ interest_area: program.interest_area,
+ selection_method: program.selection_method,
+ selection_method_abbrevi: program.selection_method_abbrevi,
+ urls: program.urls,
+ }
+ }
+ end
end
respond_to do |format|
format.html
| Add program information to school geojson
|
diff --git a/lib/stream_reader/avro_parser.rb b/lib/stream_reader/avro_parser.rb
index abc1234..def5678 100644
--- a/lib/stream_reader/avro_parser.rb
+++ b/lib/stream_reader/avro_parser.rb
@@ -9,7 +9,11 @@ buffer = StringIO.new(@data)
reader = Avro::DataFile::Reader.new(buffer, Avro::IO::DatumReader.new)
reader.each do |record|
- schema_name = reader.datum_reader.readers_schema.try(:name) || reader.datum_reader.readers_schema.schemas.last.name
+ if reader.datum_reader.readers_schema.class == Avro::Schema::RecordSchema
+ schema_name = reader.datum_reader.readers_schema.name
+ else
+ reader.datum_reader.readers_schema.schemas.last.name
+ end
yield record, schema_name
end
end
| Add conditional around reading Avro schemas |
diff --git a/app/mailers/module_proposal_mailer.rb b/app/mailers/module_proposal_mailer.rb
index abc1234..def5678 100644
--- a/app/mailers/module_proposal_mailer.rb
+++ b/app/mailers/module_proposal_mailer.rb
@@ -3,8 +3,10 @@ def confirmation(proposal)
@proposal = proposal
@subject = "College STAR Module Proposal Received"
+ @admin_email = "WATSONR16@ECU.EDU"
mail(
to: @proposal.email,
+ bcc: @admin_email,
subject: @subject
)
end
| Add Ruben as a bcc to the module proposal confirmation
|
diff --git a/cookbooks/yournavigation/recipes/default.rb b/cookbooks/yournavigation/recipes/default.rb
index abc1234..def5678 100644
--- a/cookbooks/yournavigation/recipes/default.rb
+++ b/cookbooks/yournavigation/recipes/default.rb
@@ -19,10 +19,9 @@
include_recipe "apache"
-package "php5"
-package "php5-cli"
-
-package "php-apc"
+package "php"
+package "php-cli"
+package "php-apcu"
# Required for osmosis
package "default-jre-headless"
@@ -38,10 +37,9 @@ package "buffer"
package "git"
package "cmake"
-package "libqt4-core"
package "libqt4-dev"
package "qt4-dev-tools"
package "qt4-linguist-tools"
-package "libicu52"
+package "libicu-dev"
-apache_module "php5"
+apache_module "php7.0"
| Update yournavigation cookbook for Ubuntu 16.04
|
diff --git a/app/resources/application_resource.rb b/app/resources/application_resource.rb
index abc1234..def5678 100644
--- a/app/resources/application_resource.rb
+++ b/app/resources/application_resource.rb
@@ -35,7 +35,7 @@
class << self
def records(options = {})
- ::Pundit.policy_scope!(options[:context][:user], _model_class)
+ ::Pundit.policy_scope!(options[:context][:user] || options[:context][:current_user], _model_class)
end
end
end
| Fix bug where current_user is not set correctly by JR
|
diff --git a/schmitt-trigger.gemspec b/schmitt-trigger.gemspec
index abc1234..def5678 100644
--- a/schmitt-trigger.gemspec
+++ b/schmitt-trigger.gemspec
@@ -8,19 +8,9 @@ spec.version = SchmittTrigger::VERSION
spec.authors = ["Gagan Awhad"]
spec.email = ["gagan.a.awhad@gmail.com"]
-
spec.summary = "This is a simple rubygem that implements a Schmitt Trigger in ruby"
spec.homepage = "https://github.com/gaganawhad/schmitt-trigger"
spec.license = "MIT"
-
- # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
- # delete this section to allow pushing this gem to any host.
- if spec.respond_to?(:metadata)
- spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
- else
- raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
- end
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
| Remove lock to push to rubygems
|
diff --git a/client.rb b/client.rb
index abc1234..def5678 100644
--- a/client.rb
+++ b/client.rb
@@ -2,8 +2,9 @@
project = ARGV[0]
status = ARGV[1]
+port = ARGV[2] ? ARGV[2] : 4712
-sock = TCPSocket.new('127.0.0.1', 8083)
+socket = TCPSocket.new('127.0.0.1', port)
data = <<eos
{
"name": "#{project}",
@@ -30,5 +31,5 @@ }
}
eos
-sock.write data
-sock.close
+socket.write data
+socket.close
| Make the port a command line argument
|
diff --git a/db/migrate/20201215180423_create_gdb_dashboards.rb b/db/migrate/20201215180423_create_gdb_dashboards.rb
index abc1234..def5678 100644
--- a/db/migrate/20201215180423_create_gdb_dashboards.rb
+++ b/db/migrate/20201215180423_create_gdb_dashboards.rb
@@ -0,0 +1,15 @@+# frozen_string_literal: true
+
+class CreateGdbDashboards < ActiveRecord::Migration[6.0]
+ def change
+ create_table :gdb_dashboards do |t|
+ t.references :site, index: true
+ t.jsonb :title_translations
+ t.integer :visibility_level, null: false, default: 0
+ t.string :context
+ t.jsonb :widgets_configuration
+
+ t.timestamps
+ end
+ end
+end
| Add migration to create table of dashboards
|
diff --git a/watir/lib/watir/html_element.rb b/watir/lib/watir/html_element.rb
index abc1234..def5678 100644
--- a/watir/lib/watir/html_element.rb
+++ b/watir/lib/watir/html_element.rb
@@ -10,7 +10,7 @@ @what = what
if how == :index
raise MissingWayOfFindingObjectException,
- "Option does not support attribute #{@how}"
+ "#{self.class} does not support attribute #{@how}"
end
super nil
end
| Fix typo - thanks jarmo!
|
diff --git a/spec/watch_tower/server/models/duration_spec.rb b/spec/watch_tower/server/models/duration_spec.rb
index abc1234..def5678 100644
--- a/spec/watch_tower/server/models/duration_spec.rb
+++ b/spec/watch_tower/server/models/duration_spec.rb
@@ -0,0 +1,60 @@+require 'spec_helper'
+
+module Server
+ describe Duration do
+ describe "Attributes" do
+ it { should respond_to :date }
+
+ it { should respond_to :duration }
+ end
+
+ describe "Validations" do
+ it { should_not be_valid }
+
+ it "should require a file" do
+ d = FactoryGirl.build :duration, file: nil
+ d.should_not be_valid
+ end
+
+ it "should require a date" do
+ d = FactoryGirl.build :duration, date: nil
+ d.should_not be_valid
+ end
+
+ it "should require a duration" do
+ d = FactoryGirl.build :duration, duration: nil
+ d.should_not be_valid
+ end
+ end
+
+ describe "Associations" do
+ it "should belong to a file" do
+ f = FactoryGirl.create :file
+ d = FactoryGirl.create :duration, file: f
+
+ d.file.should == f
+ end
+ end
+
+ describe "#duration" do
+ it "should default to 0 for a project with 0 elapsed time" do
+ p = FactoryGirl.create :project
+ f = FactoryGirl.create :file, project: p
+ t = FactoryGirl.create :time_entry, file: f
+
+ p.durations.inject(0) { |count, d| count += d.duration }.should == 0
+ end
+
+ it "should correctly be calculated" do
+ now = Time.now
+ p = FactoryGirl.create :project
+ f = FactoryGirl.create :file, project: p
+ t1 = FactoryGirl.create :time_entry, file: f, mtime: now
+ t2 = FactoryGirl.create :time_entry, file: f, mtime: now + 10.seconds
+
+ p.durations.inject(0) { |count, d| count += d.duration }.should == 10
+ end
+ end
+
+ end
+end | Spec/Server: Add tests for the durations model.
|
diff --git a/lib/capybara/dsl.rb b/lib/capybara/dsl.rb
index abc1234..def5678 100644
--- a/lib/capybara/dsl.rb
+++ b/lib/capybara/dsl.rb
@@ -44,7 +44,8 @@
SESSION_METHODS = [
:visit, :body, :click_link, :click_button, :fill_in, :choose, :has_xpath?, :has_css?,
- :check, :uncheck, :attach_file, :select, :has_content?, :within, :save_and_open_page
+ :check, :uncheck, :attach_file, :select, :has_content?, :within, :save_and_open_page,
+ :find_field, :find_link, :find_button, :field_labeled
]
SESSION_METHODS.each do |method|
class_eval <<-RUBY, __FILE__, __LINE__+1
| Add find methods to DSL |
diff --git a/dimma.gemspec b/dimma.gemspec
index abc1234..def5678 100644
--- a/dimma.gemspec
+++ b/dimma.gemspec
@@ -8,21 +8,22 @@ gem.authors = ['Kim Burgestrand']
gem.email = 'kim@burgestrand.se'
gem.license = 'X11 License'
-
+
gem.files = `git ls-files`.split("\n")
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
gem.executables = []
gem.require_paths = ['lib']
-
+
gem.version = Dimma::VERSION
gem.platform = Gem::Platform::RUBY
gem.required_ruby_version = '>= 1.8.7'
-
+
gem.requirements << 'JSON::parse'
gem.add_dependency 'rest-client'
gem.add_development_dependency 'bundler', '~> 1.0.0'
gem.add_development_dependency 'webmock'
gem.add_development_dependency 'rspec', '~> 2.0'
gem.add_development_dependency 'yard'
+ gem.add_development_dependency 'rake', '~> 0.8'
end
| Add rake as a development dependency
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.