diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/omniauth-thebase.gemspec b/omniauth-thebase.gemspec
index abc1234..def5678 100644
--- a/omniauth-thebase.gemspec
+++ b/omniauth-thebase.gemspec
@@ -14,10 +14,8 @@ gem.require_paths = ["lib"]
gem.version = OmniAuth::Thebase::VERSION
- gem.add_dependency 'omniauth'
- # Nothing lower than omniauth-oauth2 1.1.1
- # http://www.rubysec.com/advisories/CVE-2012-6134/
- gem.add_dependency 'omniauth-oauth2', '>= 1.1.1'
+ gem.add_dependency 'omniauth', '~> 1.2'
+ gem.add_dependency 'omniauth-oauth2', '~> 1.4'
gem.add_development_dependency "rspec", "~> 3.0"
gem.add_development_dependency 'rack-test', "~> 0.6"
gem.add_development_dependency "webmock", "~> 1.22"
|
Fix omniauth and omniauth-oauth2 gems version
|
diff --git a/db/migrate/20150429184013_create_fitness_professional_profiles.rb b/db/migrate/20150429184013_create_fitness_professional_profiles.rb
index abc1234..def5678 100644
--- a/db/migrate/20150429184013_create_fitness_professional_profiles.rb
+++ b/db/migrate/20150429184013_create_fitness_professional_profiles.rb
@@ -0,0 +1,25 @@+class CreateFitnessProfessionalProfiles < ActiveRecord::Migration
+ def change
+ create_table :fitness_professional_profiles do |t|
+ t.string :ethnicity
+ t.string :training_location
+ t.text :client_space_descrip
+ t.text :independent_facility_descrip
+ t.text :membership_facility_descrip
+ t.text :private_facility_descrip
+ t.text :credentials
+ t.text :goals, array: true, default: []
+ t.text :goal_specifics
+ t.text :medical_conditions, array: true, default: []
+ t.text :orthopedic_injury_experience, array: true, default: []
+ t.text :population_experience, array: true, default: []
+ t.text :athlete_experience
+ t.text :training_style, array: true, default: []
+ t.text :appointment_lengths, array: true, default: []
+ t.text :group_training, array: true, default: []
+ t.boolean :consent_waiver
+
+ t.timestamps null: false
+ end
+ end
+end
|
Add fitness prof profile migration
|
diff --git a/actionview/lib/action_view/template/types.rb b/actionview/lib/action_view/template/types.rb
index abc1234..def5678 100644
--- a/actionview/lib/action_view/template/types.rb
+++ b/actionview/lib/action_view/template/types.rb
@@ -32,7 +32,7 @@ alias to_str to_s
def ref
- to_sym || to_s
+ @symbol
end
def ==(type)
|
Make ref return the internal symbol.
We delegate to_sym to the internal symbol, which we've already called to_sym on in
initialize, so we don't need to do that.
We also know to_sym will never return a falsy value, so we'll never hit to_s.
Just return the symbolized symbol.
|
diff --git a/meta_model.gemspec b/meta_model.gemspec
index abc1234..def5678 100644
--- a/meta_model.gemspec
+++ b/meta_model.gemspec
@@ -19,7 +19,7 @@
s.add_dependency 'rails', '~> 4.2.0'
s.add_dependency 'neo4j', '~> 4.1.0'
- s.add_dependency 'ember-rails', '~> 0.15.0'
+ s.add_dependency 'ember-rails', '~> 0.16.1'
s.add_dependency 'ember-source', '~> 1.8.1'
s.add_dependency 'emblem-rails', '~> 0.2.2'
s.add_dependency 'slim-rails'
|
Update ember-rails to fix compile bug
|
diff --git a/app/presenters/dspace/community_presenter.rb b/app/presenters/dspace/community_presenter.rb
index abc1234..def5678 100644
--- a/app/presenters/dspace/community_presenter.rb
+++ b/app/presenters/dspace/community_presenter.rb
@@ -11,7 +11,7 @@ end
def items
- @items ||= Dspace::CommunitiesToItem.where(community_id: id)
+ @items ||= Dspace::CommunitiesToItem.where(community_id: self.id)
end
def metadata_fields
|
Fix reference to self.id parameter
|
diff --git a/config/initializers/default_settings.rb b/config/initializers/default_settings.rb
index abc1234..def5678 100644
--- a/config/initializers/default_settings.rb
+++ b/config/initializers/default_settings.rb
@@ -1,10 +1,10 @@-Setting.save_default(:ctf_name, 'Parasol')
-Setting.save_default(:submit_burst_count, 10)
-Setting.save_default(:submit_burst_time, 10)
-Setting.save_default(:cooling_down, 900)
-Setting.save_default(:rules, '**No rules, No world.**')
-Setting.save_default(:team_registrable_from, Time.zone.now)
-Setting.save_default(:team_registrable_until, Time.zone.now.weeks_since(2))
-Setting.save_default(:contest_starts_at, Time.zone.now.next_month)
-Setting.save_default(:contest_ends_at, Time.zone.now.next_month.tomorrow)
-Setting.save_default(:first_break_points, '0.1, 0.08, 0.05')
+Setting.defaults[:ctf_name] = 'Parasol'
+Setting.defaults[:submit_burst_count] = 10
+Setting.defaults[:submit_burst_time] = 10
+Setting.defaults[:cooling_down] = 900
+Setting.defaults[:rules] = '**No rules, No world.**'
+Setting.defaults[:team_registrable_from] = Time.zone.now
+Setting.defaults[:team_registrable_until] = Time.zone.now.weeks_since(2)
+Setting.defaults[:contest_starts_at] = Time.zone.now.next_month
+Setting.defaults[:contest_ends_at] = Time.zone.now.next_month.tomorrow
+Setting.defaults[:first_break_points] = '0.1, 0.08, 0.05'
|
Use `defaults' instead of `save_default' for default settings.
|
diff --git a/test/generator_test.rb b/test/generator_test.rb
index abc1234..def5678 100644
--- a/test/generator_test.rb
+++ b/test/generator_test.rb
@@ -3,6 +3,10 @@ class GeneratorTest < TestHelper
def setup
@gen = setup_test[:gen]
+ end
+
+ def encrypt(password)
+ @gen.send(:file_it).send(:encrypt).encrypt_password(password)
end
def test_it_generates_a_random_password_of_default_12_chars
@@ -22,6 +26,6 @@ clean_test_csvs
assert_equal csv[:username], ['test@test.com']
- assert_equal csv[:password], [meta_data[:password]]
+ assert_equal csv[:password], [encrypt(meta_data[:password])]
end
end
|
Add encryption functionality to generator
|
diff --git a/app/models/spree/slide.rb b/app/models/spree/slide.rb
index abc1234..def5678 100644
--- a/app/models/spree/slide.rb
+++ b/app/models/spree/slide.rb
@@ -13,7 +13,7 @@ scope :published, -> { where(published: true).order('position ASC') }
scope :location, -> (location) { joins(:slide_locations).where('spree_slide_locations.name = ?', location) }
- belongs_to :product, touch: true
+ belongs_to :product, touch: true, optional: true
def initialize(attrs = nil)
attrs ||= { published: true }
|
Add `optional: true` to `belongs_to` to retain the rails<5 behaviour.
|
diff --git a/main.rb b/main.rb
index abc1234..def5678 100644
--- a/main.rb
+++ b/main.rb
@@ -16,7 +16,7 @@ end
x+=1
end
- "<iframe width=\"100%\" height=\"100%\" src=\"https://s3-us-west-1.amazonaws.com/cc-travis-api-doc/api_docs/#{number}/index.html\" seamless />"
+ "<iframe width=\"100%\" height=\"100%\" src=\"https://s3.amazonaws.com/cc-api-docs/#{number}/index.html\" seamless />"
rescue => e
"Error encountered getting latest API doc build number from travis"
end
|
Update api-docs to pull from new s3 bucket
|
diff --git a/rubo.gemspec b/rubo.gemspec
index abc1234..def5678 100644
--- a/rubo.gemspec
+++ b/rubo.gemspec
@@ -18,6 +18,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ['lib']
+ spec.add_runtime_dependency 'twitter', '~> 5.7.1'
spec.add_runtime_dependency 'hashie', '~> 2.0.5'
spec.add_runtime_dependency 'colorize', '~> 0.6.0'
|
Add twitter gem to dependency
|
diff --git a/helpers/race_helper.rb b/helpers/race_helper.rb
index abc1234..def5678 100644
--- a/helpers/race_helper.rb
+++ b/helpers/race_helper.rb
@@ -16,20 +16,20 @@ }
RACE_ID = {
- "Aluvian" => 0,
- "Gharundim" => 1,
- "Gharu'ndim" => 1,
- "Sho" => 2,
- "Viamontian" => 3,
- "Shadowbound" => 4,
- "Gearknight" => 5,
- "Tumerok" => 6,
- "Lugian" => 7,
- "Empyrean" => 8,
- "Penumbraen" => 9,
- "Undead" => 10,
- "Olthoi" => 11,
- "OlthoiAcid" => 12
+ "Aluvian" => 1,
+ "Gharundim" => 2,
+ "Gharu'ndim" => 2,
+ "Sho" => 3,
+ "Viamontian" => 4,
+ "Shadowbound" => 5,
+ "Gearknight" => 6,
+ "Tumerok" => 7,
+ "Lugian" => 8,
+ "Empyrean" => 9,
+ "Penumbraen" => 10,
+ "Undead" => 11,
+ "Olthoi" => 12,
+ "OlthoiAcid" => 13
}
def self.get_race_name(id)
|
Fix off by one issue in race helper
|
diff --git a/scss-lint.gemspec b/scss-lint.gemspec
index abc1234..def5678 100644
--- a/scss-lint.gemspec
+++ b/scss-lint.gemspec
@@ -27,5 +27,5 @@
s.add_development_dependency 'nokogiri', '~> 1.6.0'
s.add_development_dependency 'rspec', '~> 2.0'
- s.add_development_dependency 'rubocop', '0.23.0'
+ s.add_development_dependency 'rubocop', '0.24.1'
end
|
Upgrade Rubocop version pin from 0.23.0 -> 0.24.1
This didn't result in any new lints.
Change-Id: I21d0d4b8f6f7afb4ed2a2ead6f6fe58fefe9abd3
Reviewed-on: http://gerrit.causes.com/40446
Tested-by: jenkins <d95b56ce41a2e1ac4cecdd398defd7414407cc08@causes.com>
Reviewed-by: Shane da Silva <67fb7bfe39f841b16a1f86d3928acc568d12c716@brigade.com>
|
diff --git a/scss_lint.gemspec b/scss_lint.gemspec
index abc1234..def5678 100644
--- a/scss_lint.gemspec
+++ b/scss_lint.gemspec
@@ -25,6 +25,7 @@
s.required_ruby_version = '>= 1.9.3'
+ s.add_dependency 'rake', '~> 10.0'
s.add_dependency 'sass', '~> 3.4.15'
s.add_development_dependency 'rspec', '~> 3.3.0'
|
Add explicit dependency on rake gem
This appears to be required as of Ruby 2.3, otherwise we get a LoadError
when attempting to run `bundle exec rspec` (since our SimpleCov
integration loads rake).
|
diff --git a/cookbooks/universe_ubuntu/metadata.rb b/cookbooks/universe_ubuntu/metadata.rb
index abc1234..def5678 100644
--- a/cookbooks/universe_ubuntu/metadata.rb
+++ b/cookbooks/universe_ubuntu/metadata.rb
@@ -1,4 +1,4 @@-name 'Universe on Ubuntu'
+name 'universe_ubuntu'
maintainer 'Alexandro de Oliveira'
maintainer_email 'alexandro.oliveira@holbertonschool.com'
license 'all_rights'
|
Change cookbook name to meet specification
|
diff --git a/spec/deep_struct_spec.rb b/spec/deep_struct_spec.rb
index abc1234..def5678 100644
--- a/spec/deep_struct_spec.rb
+++ b/spec/deep_struct_spec.rb
@@ -26,31 +26,29 @@ }
end
- before(:each) do
- @object = DeepStruct.new(hash)
+ subject(:deep_struct) { DeepStruct.new(hash) }
+
+ it 'turns top level into a struct' do
+ expect(deep_struct.foo).to eql 1
end
- it 'should turn top level into a struct' do
- @object.foo.should eql 1
+ it 'recursively creates structs all the way down the hash' do
+ expect(deep_struct.bar.baz).to equal 2
+ expect(deep_struct.bar.bender.bending.rodriguez).to eql true
end
- it 'should recursively create structs all the way down the hash' do
- @object.bar.baz.should eql 2
- @object.bar.bender.bending.rodriguez.should eql true
+ it 'correctly creates arrays with hashes into new structs' do
+ expect(deep_struct.fry[0].past).to eql true
+ expect(deep_struct.fry[1].present).to eql true
+ expect(deep_struct.fry[2].future).to eql true
end
- it 'should correctly create arrays with hases into new structs' do
- @object.fry[0].past.should eql true
- @object.fry[1].present.should eql true
- @object.fry[2].future.should eql true
- end
-
- it 'should turn string keys into structs' do
- @object.hubert.should eql 'farnsworth'
+ it 'turns string keys into structs' do
+ expect(deep_struct.hubert).to eql 'farnsworth'
end
it 'should maintain arrays with non hashes' do
- @object.zoidberg.size.should eql 3
- @object.zoidberg[0].should eql 'doctor'
+ expect(deep_struct.zoidberg.size).to eql 3
+ expect(deep_struct.zoidberg[0]).to eql 'doctor'
end
end
|
Update DeepStruct spec to use expect
|
diff --git a/spec/unit/spec_helper.rb b/spec/unit/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/unit/spec_helper.rb
+++ b/spec/unit/spec_helper.rb
@@ -7,4 +7,5 @@ config.version = '10.11.1'
config.before { stub_const('ENV', 'SUDO_USER' => 'fauxhai') }
config.after(:suite) { FileUtils.rm_r('.librarian') }
+ config.file_cache_path = '/var/chef/cache'
end
|
Set chef file cache path for tests
We were making an expecation on the path that wasn't necessarily true
|
diff --git a/test/models/instance/validations/relationship_ref_must_match_cited_by__ref_test.rb b/test/models/instance/validations/relationship_ref_must_match_cited_by__ref_test.rb
index abc1234..def5678 100644
--- a/test/models/instance/validations/relationship_ref_must_match_cited_by__ref_test.rb
+++ b/test/models/instance/validations/relationship_ref_must_match_cited_by__ref_test.rb
@@ -14,3 +14,13 @@ # See the License for the specific language governing permissions and
# limitations under the License.
#
+require 'test_helper'
+
+class RelationshipMustMatchCitedByRefTest < ActiveSupport::TestCase
+
+ test "instance relationship must match cited by reference" do
+ skip
+ end
+
+end
+
|
Set an empty test to a skip.
|
diff --git a/thor.gemspec b/thor.gemspec
index abc1234..def5678 100644
--- a/thor.gemspec
+++ b/thor.gemspec
@@ -4,7 +4,7 @@ require "thor/version"
Gem::Specification.new do |spec|
- spec.add_development_dependency "bundler", "~> 1.0"
+ spec.add_development_dependency "bundler", ">= 1.0", "< 3"
spec.authors = ["Yehuda Katz", "José Valim"]
spec.description = "Thor is a toolkit for building powerful command-line interfaces."
spec.email = "ruby-thor@googlegroups.com"
|
Allow testing with bundler 2
|
diff --git a/spec/ciso_spec.rb b/spec/ciso_spec.rb
index abc1234..def5678 100644
--- a/spec/ciso_spec.rb
+++ b/spec/ciso_spec.rb
@@ -1,17 +1,18 @@ require_relative '../lib/ciso.rb'
+require 'open-uri'
describe CISO do
describe "compression" do
+ # TODO Write this out to a file after the first fetch
+ subject { CISO::Deflate.new(open('http://www.memtest.org/download/5.01/memtest86+-5.01.iso.gz')) }
+ before do
+ subject.deflate
+ end
+
+ it "can compress an iso" do
+ expect(subject).to be_compressed
+ end
end
- subject { CISO::Deflate.new(File.expand_path("~/Desktop/memtest86+-5.01.iso")) }
-
- before do
- subject.deflate
- end
-
- it "can compress an iso" do
- expect(subject).to be_compressed
- end
end
|
Make tests pass for other people
|
diff --git a/services/twitter.rb b/services/twitter.rb
index abc1234..def5678 100644
--- a/services/twitter.rb
+++ b/services/twitter.rb
@@ -6,7 +6,7 @@ commit = commit.last
begin
Timeout::timeout(2) do
- github_url = Net::HTTP.get "tinyurl.com", "/api-create.php?url=#{commit['url']}"
+ github_url = Net::HTTP.get "is.gd", "/api.php?longurl=#{commit['url']}"
end
rescue
end
|
Use is.gd instead of tinyurl.com
|
diff --git a/rqrcode_rails3.gemspec b/rqrcode_rails3.gemspec
index abc1234..def5678 100644
--- a/rqrcode_rails3.gemspec
+++ b/rqrcode_rails3.gemspec
@@ -5,7 +5,7 @@ s.summary = "Render QR codes with Rails 3"
s.description = "Render QR codes with Rails 3"
- s.files = Dir["{app,lib,config}/**/*"] + ["MIT-LICENSE", "Rakefile", "Gemfile", "README.rdoc"]
+ s.files = Dir["{app,lib,config}/**/*"] + ["MIT-LICENSE", "Rakefile", "Gemfile", "README.md"]
s.author = "Sam Vincent"
s.email = "sam.vincent@mac.com"
|
Update readme from rdoc to markdown in gemspec
|
diff --git a/Formula/root5.rb b/Formula/root5.rb
index abc1234..def5678 100644
--- a/Formula/root5.rb
+++ b/Formula/root5.rb
@@ -0,0 +1,62 @@+class Root5 < Formula
+ homepage "http://root.cern.ch"
+
+ stable do
+ version "5.34.36"
+ sha256 "fc868e5f4905544c3f392cc9e895ef5571a08e48682e7fe173bd44c0ba0c7dcd"
+ url "https://root.cern.ch/download/root_v#{version}.source.tar.gz"
+ mirror "http://ftp.riken.jp/pub/ROOT/root_v#{version}.source.tar.gz"
+ end
+ revision 1
+
+ head do
+ url "https://github.com/root-mirror/root.git", :branch => "v5-34-00-patches"
+ end
+
+ keg_only "Conflicts with production version ROOT6"
+
+ depends_on "cmake" => :build
+ option :cxx11
+
+ depends_on "openssl"
+ depends_on "gsl" => :recommended
+ depends_on :python => :recommended
+
+ def install
+ # When building the head, temp patch for ROOT-8032
+ if build.head? || build.devel?
+ inreplace "cmake/modules/RootBuildOptions.cmake", "thread|cxx11|cling|builtin_llvm|builtin_ftgl|explicitlink", "thread|cxx11|cling|builtin_llvm|builtin_ftgl|explicitlink|python|mathmore|asimage|gnuinstall|rpath|soversion|opengl|builtin_glew"
+ end
+
+ mkdir "hb-build-root" do
+ ENV.cxx11 if build.cxx11?
+
+ # Defaults
+ args = std_cmake_args
+ args << "-Dgnuinstall=ON"
+ args << "-DCMAKE_INSTALL_SYSCONFDIR=etc/root"
+ args << "-Dgminimal=ON"
+ args << "-Dx11=OFF" if OS.mac?
+ args << "-Dcocoa=ON" if OS.mac?
+ args << "-Dlibcxx=ON" if OS.mac?
+ args << "-Dfortran=OFF"
+ args << "-Drpath=ON"
+ args << "-Dsoversion=ON"
+ args << "-Dasimage=ON"
+ args << "-Dbuiltin_asimage=ON"
+ args << "-Dbuiltin_freetype=ON"
+ args << "-Dopengl=ON"
+ args << "-Dbuiltin_glew=ON"
+
+ # Options
+ args << "-Dcxx11=ON" if build.cxx11?
+ args << "-Dpython=".concat((build.with? "python") ? "ON" : "OFF")
+ args << "-Dmathmore=".concat((build.with? "gsl") ? "ON" : "OFF")
+
+ system "cmake", "../", *args
+ system "make"
+ system "make", "install"
+ end
+ end
+end
+
|
Add Formula for ROOT 5.34.36
|
diff --git a/simple_form.gemspec b/simple_form.gemspec
index abc1234..def5678 100644
--- a/simple_form.gemspec
+++ b/simple_form.gemspec
@@ -7,7 +7,7 @@ s.version = SimpleForm::VERSION.dup
s.platform = Gem::Platform::RUBY
s.summary = "Forms made easy!"
- s.email = "contact@plataformatec.com.br"
+ s.email = "opensource@plataformatec.com.br"
s.homepage = "https://github.com/plataformatec/simple_form"
s.description = "Forms made easy!"
s.authors = ['José Valim', 'Carlos Antônio', 'Rafael França']
|
Change the gem email to use the opensource
|
diff --git a/lib/entraceable.rb b/lib/entraceable.rb
index abc1234..def5678 100644
--- a/lib/entraceable.rb
+++ b/lib/entraceable.rb
@@ -8,7 +8,7 @@ def #{method}(*args)
indent = " " * ((@indent_level ||= 0) * 2)
puts = ->c{Rails.logger.tagged(%Q(#{tag})) {Rails.logger.send :#{level}, indent + c}}
- puts.call %Q(#{method} is called with arguments, \#\{args\})
+ puts.call %Q(#{method} is called with arguments, \#\{args.join(", ")\})
@indent_level += 1
send(:#{alias_name}, *args).tap do |result|
@indent_level -= 1
|
:sparkles: Put arguments as arguments, not as an array
|
diff --git a/lib/frankie/app.rb b/lib/frankie/app.rb
index abc1234..def5678 100644
--- a/lib/frankie/app.rb
+++ b/lib/frankie/app.rb
@@ -18,8 +18,8 @@ end
def self.run! port=9292
- use Rack::ShowExceptions
- use Rack::CommonLogger
+ middlewares.unshift Rack::ShowExceptions, Rack::CommonLogger
+
handler = Rack::Handler::Thin rescue Rack::Handler::WEBrick
handler.run new, :Port => port
end
|
Add the default middleware on top os the stack
|
diff --git a/lib/proteus/kit.rb b/lib/proteus/kit.rb
index abc1234..def5678 100644
--- a/lib/proteus/kit.rb
+++ b/lib/proteus/kit.rb
@@ -16,13 +16,15 @@
if system "git ls-remote #{url(kit_name)} #{repo_name} > /dev/null 2>&1"
puts "Starting a new proteus-#{kit_name} project in #{repo_name}"
- system "git clone #{url(kit_name)}#{' ' + repo_name} && \
- cd #{repo_name} && \
- rm -rf .git && \
- git init && \
- git add . && \
- git commit -am 'New proteus-#{kit_name} project' && \
- cd - "
+ system %{
+ git clone #{url(kit_name)} #{repo_name} &&
+ cd #{repo_name} &&
+ rm -rf .git &&
+ git init &&
+ git add . &&
+ git commit -am 'New proteus-#{kit_name} project' &&
+ cd -
+ }
else
puts "A thoughtbot repo doesn't exist with that name"
end
|
Change string characters to %{ } and remove unnecessary trailing slashes
|
diff --git a/lib/steam_stats.rb b/lib/steam_stats.rb
index abc1234..def5678 100644
--- a/lib/steam_stats.rb
+++ b/lib/steam_stats.rb
@@ -1,3 +1,7 @@+require 'nokogiri'
+require 'open-uri'
+require 'json'
+
require "steam_stats/version"
require "steam_stats/user"
|
Add importing required libs to module
|
diff --git a/lib/twitter_ads.rb b/lib/twitter_ads.rb
index abc1234..def5678 100644
--- a/lib/twitter_ads.rb
+++ b/lib/twitter_ads.rb
@@ -12,7 +12,7 @@ # Usage:
# Initialisation
#
-# ads=TwitterAds::Client.new({consumer_key :"YOUR_CONSUER_KEY",
+# ads=TwitterAds::Client.new({consumer_key :"YOUR_CONSUER_KEY",
# consumer_secret:"YOUR CONSUMER SECRET",
# access_token :"YOUR ACCESS TOKEN",
# access_secret :"YOUR ACCESS SECRET"})
|
Add missing fles in the gem
|
diff --git a/workers/ping_worker.rb b/workers/ping_worker.rb
index abc1234..def5678 100644
--- a/workers/ping_worker.rb
+++ b/workers/ping_worker.rb
@@ -1,6 +1,8 @@ class PingWorker
include Sidekiq::Worker
def perform(message)
- puts message
+ adapter = Bazooka::Adapter.fetch('gobierno-federal')
+ adapter.auth(username: ENV['test_user'], password: ENV['test_password'])
+ adapter.publish(message)
end
end
|
Fix adapter variables in worker
|
diff --git a/lib/generators/manageiq/plugin/templates/lib/%plugin_path%/engine.rb b/lib/generators/manageiq/plugin/templates/lib/%plugin_path%/engine.rb
index abc1234..def5678 100644
--- a/lib/generators/manageiq/plugin/templates/lib/%plugin_path%/engine.rb
+++ b/lib/generators/manageiq/plugin/templates/lib/%plugin_path%/engine.rb
@@ -4,7 +4,7 @@
config.autoload_paths << root.join('lib').to_s
- def vmdb_plugin?
+ def self.vmdb_plugin?
true
end
|
Change plugin common methods to class methods
|
diff --git a/db/migrate/20141205225139_create_programs.rb b/db/migrate/20141205225139_create_programs.rb
index abc1234..def5678 100644
--- a/db/migrate/20141205225139_create_programs.rb
+++ b/db/migrate/20141205225139_create_programs.rb
@@ -0,0 +1,17 @@+class CreatePrograms < ActiveRecord::Migration
+ def change
+ create_table :programs do |t|
+ t.string :program_code
+ t.string :program_name
+ t.string :dbn
+ t.string :printed_school_name
+ t.string :interest_area
+ t.string :selection_method
+ t.string :selection_method_abbrevi
+ t.string :directory_page_
+ t.string :borough
+ t.string :urls
+ t.timestamps
+ end
+ end
+end
|
Create migration for new model programs
|
diff --git a/files/chef-marketplace-cookbooks/chef-marketplace/recipes/_automate_enable.rb b/files/chef-marketplace-cookbooks/chef-marketplace/recipes/_automate_enable.rb
index abc1234..def5678 100644
--- a/files/chef-marketplace-cookbooks/chef-marketplace/recipes/_automate_enable.rb
+++ b/files/chef-marketplace-cookbooks/chef-marketplace/recipes/_automate_enable.rb
@@ -40,7 +40,7 @@ end
# Use a 30 day trial license if we're on Azure
-cookbook_file 'var/opt/delivery/license/delivery.license' do
+cookbook_file '/var/opt/delivery/license/delivery.license' do
source 'delivery.license'
action :create_if_missing
not_if { node["chef-marketplace"]["license"]["type"] == "flexible" }
|
Fix path for license file.
Signed-off-by: Ryan Hass <7a1efea0847aa10fda44596a4a622bd3187d968e@users.noreply.github.com>
|
diff --git a/spec/ci/yarn_pnp_spec.rb b/spec/ci/yarn_pnp_spec.rb
index abc1234..def5678 100644
--- a/spec/ci/yarn_pnp_spec.rb
+++ b/spec/ci/yarn_pnp_spec.rb
@@ -4,7 +4,7 @@ it "zero-install with NODE_MODLES_CACHE=false should deploy successfully" do
app = Hatchet::Runner.new(
"spec/fixtures/repos/yarn-pnp-zero-install",
- config: { "NODE_MODLES_CACHE": "false" }
+ config: { "NODE_MODULES_CACHE": "false" }
)
app.deploy do |app|
expect(successful_body(app).strip).to eq("Hello from yarn-pnp-zero-install")
|
Use correct ENV var for pnp spec
|
diff --git a/spec/models/farm_spec.rb b/spec/models/farm_spec.rb
index abc1234..def5678 100644
--- a/spec/models/farm_spec.rb
+++ b/spec/models/farm_spec.rb
@@ -13,4 +13,17 @@ expect(@farm.latitude).not_to be_nil
expect(@farm.longitude).not_to be_nil
end
+
+ it "inserts a farm relation entry" do
+ related_farm = build(:farm, name: "A related farm")
+ @farm.places << related_farm.place
+ expect(@farm.places).to include(related_farm.place)
+ end
+
+ it "inserts a depot relation entry" do
+ related_depot = build(:depot, name: "A related depot")
+ @farm.places << related_depot.place
+ expect(@farm.places).to include(related_depot.place)
+ end
+
end
|
Add tests for farm relation insertions.
|
diff --git a/spec/pcore/stall_spec.rb b/spec/pcore/stall_spec.rb
index abc1234..def5678 100644
--- a/spec/pcore/stall_spec.rb
+++ b/spec/pcore/stall_spec.rb
@@ -33,6 +33,29 @@ expect(ex['errors']).to eq([])
expect(ex['counters']).to eq({ 'msgs' => 4 })
end
+
+ it 'executes its attributes' do
+
+ r = @executor.launch(
+ %q{
+ sequence
+ stall tag: 'dead' + 'end'
+ })
+
+ expect(r).to eq(nil)
+
+ ent = @executor.journal
+ .select { |m| m['point'] == 'entered' }
+ .collect { |m| m['tags'] }
+ .compact
+ lef = @executor.journal
+ .select { |m| m['point'] == 'left' }
+ .collect { |m| m['tags'] }
+ .compact
+
+ expect(ent).to eq([ %w[ deadend ] ])
+ expect(lef).to eq([])
+ end
end
end
|
Add "stall" vs attributes spec
|
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
@@ -16,12 +16,12 @@ c.discover
begin
Timeout.timeout(5) do
- while c.lights.empty?
+ while !c.lights.find { |l| l.label =~ /^Test/ }
sleep 0.5
end
end
rescue Timeout::Error
- raise "Could not find any lights"
+ raise "Could not find any lights matching /^Test/"
end
c
end
@@ -33,7 +33,7 @@
let(:site) { lifx.sites.first }
let(:lights) { site.lights }
- let(:light) { lights.first }
+ let(:light) { lights.find { |l| l.label =~ /^Test/} }
let(:all_lights) { site.all_lights }
end
|
Use a light beginning with Test
|
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,8 +1,8 @@-PADRINO_ENV = 'test'
+RACK_ENV = 'test'
PADRINO_ROOT = File.dirname(__FILE__) unless defined?(PADRINO_ROOT)
require 'rubygems' unless defined?(Gem)
require 'bundler'
-Bundler.require(:default, PADRINO_ENV)
+Bundler.require(:default, RACK_ENV)
require 'padrino-contrib'
|
Use RACK_ENV instead of deprecated PADRINO_ENV
|
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
@@ -23,24 +23,3 @@ PuppetlabsSpec::Files.cleanup
end
end
-
-require 'pathname'
-dir = Pathname.new(__FILE__).parent
-Puppet[:modulepath] = File.join(dir, 'fixtures', 'modules')
-
-# There's no real need to make this version dependent, but it helps find
-# regressions in Puppet
-#
-# 1. Workaround for issue #16277 where default settings aren't initialised from
-# a spec and so the libdir is never initialised (3.0.x)
-# 2. Workaround for 2.7.20 that now only loads types for the current node
-# environment (#13858) so Puppet[:modulepath] seems to get ignored
-# 3. Workaround for 3.5 where context hasn't been configured yet,
-# ticket https://tickets.puppetlabs.com/browse/MODULES-823
-#
-ver = Gem::Version.new(Puppet.version.split('-').first)
-if Gem::Requirement.new("~> 2.7.20") =~ ver || Gem::Requirement.new("~> 3.0.0") =~ ver || Gem::Requirement.new("~> 3.5") =~ ver
- puts "augeasproviders: setting Puppet[:libdir] to work around broken type autoloading"
- # libdir is only a single dir, so it can only workaround loading of one external module
- Puppet[:libdir] = "#{Puppet[:modulepath]}/augeasproviders_core/lib"
-end
|
Use modulesync to manage meta files
|
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
@@ -28,9 +28,4 @@ # (e.g. via a command-line flag).
config.default_formatter = 'doc'
end
-
- # Print the 10 slowest examples and example groups at the
- # end of the spec run, to help surface which specs are running
- # particularly slow.
- config.profile_examples = 10
end
|
Remove RSpec 10 profile examples
|
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
@@ -4,4 +4,4 @@
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'bayonet'
-require 'pry-byebug'
+require 'byebug'
|
Fix byebug dependency in spec helper
|
diff --git a/gitfyncy.gemspec b/gitfyncy.gemspec
index abc1234..def5678 100644
--- a/gitfyncy.gemspec
+++ b/gitfyncy.gemspec
@@ -8,9 +8,10 @@ gem.version = Gitfyncy::VERSION
gem.authors = ["Ryan McGowan"]
gem.email = ["ryan@ryanmcg.com"]
- gem.description = %q{TODO: Write a gem description}
- gem.summary = %q{TODO: Write a gem summary}
- gem.homepage = ""
+ gem.description = %q{The funky git aware syncer.}
+ gem.summary = %q{Want to sync the working directories of your git
+ directory with a remote one. Look no futher.}
+ gem.homepage = "https://github.com/RyanMcG/git-fyncy"
gem.files = `git ls-files`.split($/)
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
Add description and things to gemspec.
|
diff --git a/start_bot.rb b/start_bot.rb
index abc1234..def5678 100644
--- a/start_bot.rb
+++ b/start_bot.rb
@@ -15,6 +15,6 @@ end
end
-# Thread.abort_on_exception = true
+Thread.abort_on_exception = true if ARGV[0] == '-dev'
EM.run { Bot::Core.new(File.join(Dir.pwd, 'lib', 'settings', 'bot_settings.json')) }
exec "ruby #{__FILE__}" if $restart
|
Add -dev flag for non-silent exception throwing
|
diff --git a/BHCDatabase/app/grids/initiatives_grid.rb b/BHCDatabase/app/grids/initiatives_grid.rb
index abc1234..def5678 100644
--- a/BHCDatabase/app/grids/initiatives_grid.rb
+++ b/BHCDatabase/app/grids/initiatives_grid.rb
@@ -6,11 +6,9 @@ end
filter(:id, :string, :multiple => ',')
- filter(:name, :string) do |value|
- where.has {name =~ "#{value}%"}
- end
+ filter(:name, :string) { |value| where.has { name =~ "#{value}%" } }
filter(:area, :string, :multiple => ',', :header => 'Area ID')
- filter(:location, :string) { |value| where('location like ?', "%#{value}%") }
+ filter(:location, :string) { |value| where.has { location =~ "#{value}%" } }
column(:id, :mandatory => true) do |model|
format(model.id) { |value| link_to value, model }
|
Update initiatives grid to make use of baby_sqeel
|
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
@@ -15,7 +15,7 @@ end
def sequel_database_memory
- "#{Alf::Sequel::Adapter.sqlite_protocol}:memory"
+ "#{Alf::Sequel::Adapter.sqlite_protocol}::memory:"
end
def sap
|
Fix URIs of memory databases.
|
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,3 +1,5 @@+require 'adjutant'
+
RSpec.configure do |config|
# Many RSpec users commonly either run the entire suite or an individual
# file, and it's useful to allow more verbose output when running an
|
Add root module require in 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
@@ -2,3 +2,7 @@ require 'chefspec/berkshelf'
at_exit { ChefSpec::Coverage.report! }
+
+RSpec.configure do |config|
+ config.log_level = :error
+end
|
Set testing log level to error, to remove deprecation spam
|
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,9 +1,7 @@ # Setup for test coverage instrumentation (e.g. simplecov, codeclimate)
# MUST happen before any other code is loaded
require 'simplecov'
-SimpleCov.start do
- add_filter '/spec'
-end
+SimpleCov.start 'test_frameworks'
require 'codeclimate-test-reporter'
CodeClimate::TestReporter.start
|
Use simplecov default "test_frameworks" profile
|
diff --git a/rspec-matchers_test.gemspec b/rspec-matchers_test.gemspec
index abc1234..def5678 100644
--- a/rspec-matchers_test.gemspec
+++ b/rspec-matchers_test.gemspec
@@ -20,5 +20,5 @@
spec.add_development_dependency "bundler", "~> 1.7"
spec.add_development_dependency "rake", "~> 10.0"
- spec.add_development_dependency "rspec", "3.2"
+ spec.add_development_dependency "rspec", ">= 3.3"
end
|
Upgrade rspec, so we are using the new matchers
|
diff --git a/lib/firering/instantiator.rb b/lib/firering/instantiator.rb
index abc1234..def5678 100644
--- a/lib/firering/instantiator.rb
+++ b/lib/firering/instantiator.rb
@@ -17,7 +17,7 @@ else
msg = "WARNING: Could not set attribute '#{key}' to value '#{value}' on #{self} object."
msg << " It is likely the Campfire API has changed. Please report this! (https://github.com/EmmanuelOga/firering/issues)"
- conn.logger.warn msg
+ instance.connection.logger.warn msg
end
end
|
Change conn to correct connection instance
|
diff --git a/lib/hooks/docker-hub/hook.rb b/lib/hooks/docker-hub/hook.rb
index abc1234..def5678 100644
--- a/lib/hooks/docker-hub/hook.rb
+++ b/lib/hooks/docker-hub/hook.rb
@@ -1,6 +1,6 @@ module Idobata::Hook
class DockerHub < Base
- screen_name 'Docker Hub automated build'
+ screen_name 'Docker Hub'
icon_url hook_image_url('mono_vertical_small.png')
end
end
|
Rename screen_name: Docker Hub automated build -> Docker Hub
|
diff --git a/lib/import/import_samples.rb b/lib/import/import_samples.rb
index abc1234..def5678 100644
--- a/lib/import/import_samples.rb
+++ b/lib/import/import_samples.rb
@@ -2,14 +2,16 @@ class Import::ImportSamples
def self.import_samples_from_file(file_path, collection_id)
- xlsx = Roo::Spreadsheet.open(file_path)
- rows = xlsx.parse(name: "Name", description: "Beschreibung", smiles: "Smiles")
- rows.shift
- rows.map do |row|
- molfile = Chemotion::PubchemService.molfile_from_smiles URI::encode(row[:smiles], '[]/()+-.@#=\\')
- molecule = Molecule.find_or_create_by_molfile(molfile)
- sample = Sample.create(name: row[:name], description: row[:description], molecule: molecule)
- CollectionsSample.create(collection_id: collection_id, sample_id: sample.id)
+ ActiveRecord::Base.transaction do
+ xlsx = Roo::Spreadsheet.open(file_path)
+ rows = xlsx.parse(name: "Name", description: "Beschreibung", smiles: "Smiles")
+ rows.shift
+ rows.map do |row|
+ molfile = Chemotion::PubchemService.molfile_from_smiles URI::encode(row[:smiles], '[]/()+-.@#=\\')
+ molecule = Molecule.find_or_create_by_molfile(molfile)
+ sample = Sample.create(name: row[:name], description: row[:description], molecule: molecule)
+ CollectionsSample.create(collection_id: collection_id, sample_id: sample.id)
+ end
end
end
|
Add ActiveRecord Base Transaction into import of samples from file
|
diff --git a/db/data_migration/20130429203455_deindex_duplicate_eos.rb b/db/data_migration/20130429203455_deindex_duplicate_eos.rb
index abc1234..def5678 100644
--- a/db/data_migration/20130429203455_deindex_duplicate_eos.rb
+++ b/db/data_migration/20130429203455_deindex_duplicate_eos.rb
@@ -0,0 +1,4 @@+Rummageable.delete('/government/organisations/the-prime-ministers-office-number-10', Whitehall.government_search_index_path)
+Rummageable.delete('/government/organisations/the-deputy-prime-ministers-office', Whitehall.government_search_index_path)
+
+puts "Removed bad records from Rummager"
|
Remove bad URLs for Number10 and DPMO from search
https://www.pivotaltracker.com/story/show/48925175
|
diff --git a/db/migrate/20150727212724_add_private_profile_to_users.rb b/db/migrate/20150727212724_add_private_profile_to_users.rb
index abc1234..def5678 100644
--- a/db/migrate/20150727212724_add_private_profile_to_users.rb
+++ b/db/migrate/20150727212724_add_private_profile_to_users.rb
@@ -1,5 +1,5 @@ class AddPrivateProfileToUsers < ActiveRecord::Migration
def change
- add_column :users, :private_profile, :boolean, index: { where: "(private_profile = true)" }, default: false
+ add_column :users, :private_profile, :boolean, index: { where: "(private_profile = false)" }, default: true
end
end
|
Make private_profile flag true by default.
Change the expression index to match the usual query for it.
|
diff --git a/lib/tasks/elasticsearch.rake b/lib/tasks/elasticsearch.rake
index abc1234..def5678 100644
--- a/lib/tasks/elasticsearch.rake
+++ b/lib/tasks/elasticsearch.rake
@@ -35,7 +35,7 @@ end
end
end
- Spree::Product.where(out_of_date_at: nil).find_each do |product|
+ Spree::Product.available.find_each do |product|
product.save
end
end
|
Change rake task to use .available instead of out_of_date_at (sometimes
a product is unavailable for a reason other than its out_of_date_at
field)
|
diff --git a/Casks/aerofs.rb b/Casks/aerofs.rb
index abc1234..def5678 100644
--- a/Casks/aerofs.rb
+++ b/Casks/aerofs.rb
@@ -1,7 +1,7 @@ class Aerofs < Cask
- url 'https://dsy5cjk52fz4a.cloudfront.net/AeroFSInstall.dmg'
+ url 'https://dsy5cjk52fz4a.cloudfront.net/AeroFSInstall-0.8.32.dmg'
homepage 'https://www.aerofs.com/'
- version 'latest'
- no_checksum
+ version '0.8.32'
+ sha256 '5c5e52266f48f0aa6d1f49353c35c1152eda4e850325b1e7f25e958ee0ed4fbe'
link 'AeroFS.app'
end
|
Fix AeroFS cask url (now v0.0.32)
|
diff --git a/lib/astaire/railtie.rb b/lib/astaire/railtie.rb
index abc1234..def5678 100644
--- a/lib/astaire/railtie.rb
+++ b/lib/astaire/railtie.rb
@@ -5,7 +5,10 @@ end
initializer "astaire.cascade_routing" do |app|
- app.middleware.use ActionDispatch::Cascade, lambda { ApplicationController }
+ # A lambda is needed here to ensure that the constant is reloaded
+ # after each request (in development mode)
+ astaire_app = proc { |env| ApplicationController.call(env) }
+ app.middleware.use ActionDispatch::Cascade, lambda { astaire_app }
end
# Controllers must be preloaded in order for Astaire's routing
|
Fix a bug with reloading in development mode
|
diff --git a/lib/webpack_support_rails.rb b/lib/webpack_support_rails.rb
index abc1234..def5678 100644
--- a/lib/webpack_support_rails.rb
+++ b/lib/webpack_support_rails.rb
@@ -2,5 +2,17 @@ require 'webpack_support_rails/railtie' if defined?(Rails)
module WebpackSupportRails
- mattr_accessor :update_webpack_manifest_every_request, :bypass_inline_webpack
+ # Forces the webpack manifest to be updated on every page request.
+ # Set to true for development
+ # Set to false in production to increase response speed
+ # Default: !Rails.env.production?
+ mattr_accessor :update_webpack_manifest_every_request
+ @@update_webpack_manifest_every_request = !Rails.env.production?
+
+ # When set to true, all js bundles will be loaded externally instead of inlined.
+ # Set to true for development
+ # Set to false in production to inline javascript
+ # Default: !Rails.env.production?
+ mattr_accessor :bypass_inline_webpack
+ @@bypass_inline_webpack = !Rails.env.production?
end
|
Set defaults in WebpackSupportRails module
|
diff --git a/test/cookbook/recipes/django.rb b/test/cookbook/recipes/django.rb
index abc1234..def5678 100644
--- a/test/cookbook/recipes/django.rb
+++ b/test/cookbook/recipes/django.rb
@@ -19,7 +19,7 @@
application '/opt/test_django' do
git 'https://github.com/poise/test_django.git'
- python 'pypy3'
+ python 'pypy3-5.5'
virtualenv
pip_requirements
django do
|
Make pypy3 work again by switching to the 3.3 compat alpha, which works with pip 9.
|
diff --git a/plugin.rb b/plugin.rb
index abc1234..def5678 100644
--- a/plugin.rb
+++ b/plugin.rb
@@ -5,9 +5,11 @@ # url: https://github.com/xfalcox/discourse-backups-to-dropbox
gem 'public_suffix', '2.0.5', {require: false }
+gem 'domain_name', '0.5.20170404', {require: false }
gem 'addressable', '2.5.1', {require: false }
gem 'http_parser.rb', '0.6.0', {require: false }
+gem 'http-cookie', '1.0.3', {require: false }
gem 'http-form_data', '1.0.1', {require: false }
gem 'http', '2.0.3', {require: false }
|
Add gem dependencies dropped by Discourse
|
diff --git a/lib/solid/default_security_rules.rb b/lib/solid/default_security_rules.rb
index abc1234..def5678 100644
--- a/lib/solid/default_security_rules.rb
+++ b/lib/solid/default_security_rules.rb
@@ -14,3 +14,10 @@ Module => [:const_get, :const_set, :const_defined?, :freeze, :ancestors],
Class => [:new, :allocate, :superclass],
)
+
+if defined?(JSON::Ext::Generator::GeneratorMethods)
+ Solid::MethodWhitelist.allow(
+ JSON::Ext::Generator::GeneratorMethods::Fixnum => [:to_json],
+ JSON::Ext::Generator::GeneratorMethods::Bignum => [:to_json],
+ )
+end
|
Allow to_json for Integer and Bignum instances under 1.9.3
|
diff --git a/test/support/mock_controller.rb b/test/support/mock_controller.rb
index abc1234..def5678 100644
--- a/test/support/mock_controller.rb
+++ b/test/support/mock_controller.rb
@@ -13,12 +13,12 @@ "http://example.com"
end
- def url_helpers
- self
+ def url_options
+ {}
end
- def hash_for_user_path(*args); end
- def hash_for_validating_user_path(*args); end
- def hash_for_other_validating_user_path(*args); end
- def hash_for_users_path(*args); end
+ def hash_for_user_path(*); end
+ def hash_for_validating_user_path(*); end
+ def hash_for_other_validating_user_path(*); end
+ def hash_for_users_path(*); end
end
|
Update the MockController code to work with Rails 4
|
diff --git a/lib/rubill/customer.rb b/lib/rubill/customer.rb
index abc1234..def5678 100644
--- a/lib/rubill/customer.rb
+++ b/lib/rubill/customer.rb
@@ -9,24 +9,17 @@ new(record)
end
- def self.receive_payment(opts)
- ReceivedPayment.create(opts)
- end
-
- def self.void_received_payment(id)
- ReceivedPayment.void(id)
- end
-
- def create_credit(amount, description="")
+ def create_credit(amount, description="", syncReference="")
data = {
customerId: id,
amount: amount.to_f,
description: description,
+ syncReference: syncReference,
paymentType: "5",
paymentDate: Date.today,
}
- self.class.receive_payment(data)
+ ReceivedPayment.create(data)
end
def self.remote_class_name
|
Add syncReference as optional field in credit creation.
|
diff --git a/lib/thredded/errors.rb b/lib/thredded/errors.rb
index abc1234..def5678 100644
--- a/lib/thredded/errors.rb
+++ b/lib/thredded/errors.rb
@@ -5,7 +5,7 @@ module Errors
class DatabaseEmpty < Thredded::Error
def message
- 'Seed the database with "rake thredded:dev:seed".'
+ 'Seed the database with "rake dev:seed".'
end
end
|
[JRO] Update error w/correct rake task to run
If there's no data and you visit the dummy app server you will get this
error. The previous error message had the incorrect rake task in the
error message - this fixes that.
|
diff --git a/recipes/default.rb b/recipes/default.rb
index abc1234..def5678 100644
--- a/recipes/default.rb
+++ b/recipes/default.rb
@@ -29,3 +29,14 @@ action :nothing
end
+directory File.join(node['jvogt_tomcat']['install_path'], 'conf') do
+ group node['jvogt_tomcat']['group'] # TODO: write execute to idempotently chgrp on contents
+ mode '0755'
+end
+
+%w(webapps work temp logs).each do |d|
+ directory File.join(node['jvogt_tomcat']['install_path'], d) do
+ user node['jvogt_tomcat']['user'] # TODO: write execute to idempotently chgrp on contents
+ end
+end
+
|
Manage permissions on tomcat directories
|
diff --git a/lib/hyphenify/rails/action_view/base.rb b/lib/hyphenify/rails/action_view/base.rb
index abc1234..def5678 100644
--- a/lib/hyphenify/rails/action_view/base.rb
+++ b/lib/hyphenify/rails/action_view/base.rb
@@ -5,14 +5,17 @@ extend ActiveSupport::Concern
included do
- alias_method_chain :tag_option, :hyphen
+ alias_method_chain :tag_options, :hyphen
end
private
- def tag_option_with_hyphen(key, value, escape)
- value = value.to_s.dasherize if %w[id class].include? key.to_s
- tag_option_without_hyphen key, value, escape
+ def tag_options_with_hyphen(options, escape = true)
+ options.stringify_keys!
+ %w[id class].each do |key|
+ options[key] = options[key].to_s.dasherize if options.has_key? key
+ end
+ tag_options_without_hyphen options, escape
end
end
|
Make it compatible with rails 3.2
|
diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/comments_controller.rb
+++ b/app/controllers/comments_controller.rb
@@ -7,6 +7,7 @@ format.html { render :partial => 'entries/comment', :object => created_comment }
format.json { render :json => { :comment => created_comment } }
end
+ @entry.add_starlight!(1)
end
def destroy
|
Add starlight to a new comment's entry.
|
diff --git a/lib/mspec/matchers/be_valid_dns_name.rb b/lib/mspec/matchers/be_valid_dns_name.rb
index abc1234..def5678 100644
--- a/lib/mspec/matchers/be_valid_dns_name.rb
+++ b/lib/mspec/matchers/be_valid_dns_name.rb
@@ -1,7 +1,8 @@ class BeValidDNSName
# http://stackoverflow.com/questions/106179/regular-expression-to-match-hostname-or-ip-address
# ftp://ftp.rfc-editor.org/in-notes/rfc3696.txt
- VALID_DNS = /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])\.?$/
+ # http://domainkeys.sourceforge.net/underscore.html
+ VALID_DNS = /^(([a-zA-Z0-9_]|[a-zA-Z0-9_][a-zA-Z0-9\-_]*[a-zA-Z0-9_])\.)*([A-Za-z_]|[A-Za-z_][A-Za-z0-9\-_]*[A-Za-z0-9_])\.?$/
def matches?(actual)
@actual = actual
|
Change DNS matcher to allow underscores. Caused failing specs if you've got certain things in your hosts file
|
diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/profiles_controller.rb
+++ b/app/controllers/profiles_controller.rb
@@ -13,7 +13,7 @@ private
def profile_params
- allowed = %w[name staff_number grade organisation current_role_start_date]
+ allowed = %w[name staff_number grade current_role_start_date]
params.require(:user).permit(allowed)
end
|
Remove organisation from allowed params.
|
diff --git a/db/migrate/20110516083636_change_feedback_field_to_integer.rb b/db/migrate/20110516083636_change_feedback_field_to_integer.rb
index abc1234..def5678 100644
--- a/db/migrate/20110516083636_change_feedback_field_to_integer.rb
+++ b/db/migrate/20110516083636_change_feedback_field_to_integer.rb
@@ -0,0 +1,24 @@+class ChangeFeedbackFieldToInteger < ActiveRecord::Migration
+ def self.up
+ feedbacks = Feedback.all
+ feedbacks.each do |f|
+ case f.feedback
+ when 'positive'
+ f.feedback = Feedback::FEEDBACK_POSITIVE
+ when 'negative'
+ f.feedback = Feedback::FEEDBACK_NEGATIVE
+ when 'neutral'
+ f.feedback = Feedback::FEEDBACK_NEUTRAL
+ else
+ #
+ end
+ f.save!
+ end
+ change_table :feedbacks do |t|
+ t.change :feedback, :integer
+ end
+ end
+
+ def self.down
+ end
+end
|
Change field type for feedback
|
diff --git a/db/migrate/20200416210758_drop_enrollment_section_index.rb b/db/migrate/20200416210758_drop_enrollment_section_index.rb
index abc1234..def5678 100644
--- a/db/migrate/20200416210758_drop_enrollment_section_index.rb
+++ b/db/migrate/20200416210758_drop_enrollment_section_index.rb
@@ -0,0 +1,28 @@+#
+# Copyright (C) 2020 - present Instructure, Inc.
+#
+# This file is part of Canvas.
+#
+# Canvas is free software: you can redistribute it and/or modify it under
+# the terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, version 3 of the License.
+#
+# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Affero General Public License along
+# with this program. If not, see <http://www.gnu.org/licenses/>.
+
+class DropEnrollmentSectionIndex < ActiveRecord::Migration[5.2]
+ tag :postdeploy
+
+ def self.up
+ remove_index :enrollments, [:course_section_id]
+ end
+
+ def self.down
+ add_index :enrollments, [:course_section_id], algorithm: :concurrently
+ end
+end
|
Drop index on course_section_id from enrollments
closes: KNO-408
test plan
- migrations should run
- specs should pass
Change-Id: I3414d55110f9cb84e0d99d03796f0613081af7e1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/234401
Reviewed-by: James Williams <3a5f4ed991dbfa5c9ef76ad729d240ca12f62180@instructure.com>
Reviewed-by: Cody Cutrer <c4fe2b1d90ef8f2548c8aeabfa633434316f0305@instructure.com>
QA-Review: James Williams <3a5f4ed991dbfa5c9ef76ad729d240ca12f62180@instructure.com>
Product-Review: James Williams <3a5f4ed991dbfa5c9ef76ad729d240ca12f62180@instructure.com>
Tested-by: Service Cloud Jenkins <9144042a601061f88f1e1d7a1753ea3e2972119d@instructure.com>
|
diff --git a/app/helpers/seo_cms/articles_helper.rb b/app/helpers/seo_cms/articles_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/seo_cms/articles_helper.rb
+++ b/app/helpers/seo_cms/articles_helper.rb
@@ -1,7 +1,14 @@ module SeoCms
module ArticlesHelper
def generate_breadcrumbs(breadcrumbs_info)
- breadcrumbs_info.map { |breadcrumb| link_to breadcrumb[:label], breadcrumb[:url] }.join(' > ').html_safe
+ breadcrumbs_info.each_with_index.map do |breadcrumb, i|
+ last_element = (i == breadcrumbs_info.size - 1)
+ if last_element
+ breadcrumb[:label]
+ else
+ link_to(breadcrumb[:label], breadcrumb[:url])
+ end
+ end.join(' > ').html_safe
end
end
end
|
Update breadrcumbs formatting not to include link on the last node
|
diff --git a/Expecta.podspec b/Expecta.podspec
index abc1234..def5678 100644
--- a/Expecta.podspec
+++ b/Expecta.podspec
@@ -1,12 +1,12 @@ Pod::Spec.new do |s|
s.name = 'Expecta'
s.version = '0.2.4'
- s.license = 'MIT'
+ s.license = { :type => 'MIT', :file => 'LICENSE' }
s.summary = 'A matcher framework for Objective-C & Cocoa.'
s.homepage = 'http://github.com/petejkim/expecta'
s.author = { 'Peter Jihoon Kim' => 'raingrove@gmail.com' }
- s.source = { :git => 'https://github.com/specta/expecta.git', :tag => "#{s.version}" }
+ s.source = { :git => 'https://github.com/specta/expecta.git', :tag => "v#{s.version}" }
s.description = %{
Expecta is a matcher framework for Objective-C and Cocoa. The main
@@ -18,5 +18,9 @@
s.source_files = 'src/**/*.{h,m}'
+ s.requires_arc = false
+ s.ios.deployment_target = '4.0'
+ s.osx.deployment_target = '10.6'
+
s.frameworks = 'Foundation'
end
|
Add license format, disable ARC and add deployment targets to podspec
Also fixes format of tag version string. Passes `pod spec lint` validation.
|
diff --git a/ruby-gumbo.gemspec b/ruby-gumbo.gemspec
index abc1234..def5678 100644
--- a/ruby-gumbo.gemspec
+++ b/ruby-gumbo.gemspec
@@ -0,0 +1,25 @@+require 'rake/file_list'
+
+Gem::Specification.new do |spec|
+ spec.name = "ruby-gumbo"
+ spec.version = "1.1.0.rc1"
+ spec.summary = "Ruby bindings for the gumbo html5 parser"
+ spec.author = "Nicolas Martyanoff"
+ spec.email = "khaelin@gmail.com"
+ spec.license = "ISC"
+
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
+ spec.files = Rake::FileList[
+ "Rakefile",
+ "LICENSE",
+ "README.mkd",
+ "lib/**/*.rb",
+ "ext/extconf.rb",
+ "ext/*.[hc]"
+ ]
+ spec.extensions = "ext/extconf.rb"
+
+ spec.required_ruby_version = ">= 1.9.3"
+
+ spec.add_runtime_dependency 'mini_portile', '~> 0.6'
+end
|
Add temporary gemspec so that the gem can be built via URL
|
diff --git a/lib/active_set/filtering/operation.rb b/lib/active_set/filtering/operation.rb
index abc1234..def5678 100644
--- a/lib/active_set/filtering/operation.rb
+++ b/lib/active_set/filtering/operation.rb
@@ -30,7 +30,10 @@
attribute_instructions.reject(&:processed?).reduce(activerecord_filtered_set) do |set, attribute_instruction|
maybe_set_or_false = EnumerableStrategy.new(set, attribute_instruction).execute
- maybe_set_or_false.presence || set
+ next set unless maybe_set_or_false
+
+ attribute_instruction.processed = true
+ maybe_set_or_false
end
end
# rubocop:enable Metrics/MethodLength
|
Fix the logic for ensuring the filtering Enumerable adapter has properly processed a filtering instruction
|
diff --git a/app.rb b/app.rb
index abc1234..def5678 100644
--- a/app.rb
+++ b/app.rb
@@ -22,6 +22,7 @@ configure :production do
require 'rack/ssl-enforcer'
use Rack::SslEnforcer
+ disable :logging
end
configure do
|
Disable route logging in production
|
diff --git a/main.rb b/main.rb
index abc1234..def5678 100644
--- a/main.rb
+++ b/main.rb
@@ -19,6 +19,7 @@ obj = JSON.parse(request.body.read)
order_no = obj['data']['order_no']
order_socket_pair[order_no].send JSON.generate({status: 'charged'})
+ 'ok'
end
post '/charge' do
|
Add a correct return to webhooks
|
diff --git a/Text/reverse_string/lib/reverse_string.rb b/Text/reverse_string/lib/reverse_string.rb
index abc1234..def5678 100644
--- a/Text/reverse_string/lib/reverse_string.rb
+++ b/Text/reverse_string/lib/reverse_string.rb
@@ -1,4 +1,4 @@-require "reverse_string/version"
+# reverse_string.rb
module ReverseString
@@ -6,4 +6,14 @@ string.reverse
end
+ def self.prompt_user
+ print 'Enter a string to be reversed: '
+ input_string = gets.chomp
+ puts self.reverse_string(input_string)
+ end
+
end
+
+if __FILE__==$0
+ ReverseString.prompt_user
+end
|
Update the solution so that the script now prompts the user.
|
diff --git a/lib/tasks/add_achievements_to_fb.rake b/lib/tasks/add_achievements_to_fb.rake
index abc1234..def5678 100644
--- a/lib/tasks/add_achievements_to_fb.rake
+++ b/lib/tasks/add_achievements_to_fb.rake
@@ -1,6 +1,40 @@ namespace :db do
+ require 'koala'
+ require 'json'
task add_achievements_to_fb: :environment do
+ # setup the FB graph
+ get_fbgraph_for_app
+ app_info = @graph.get_connection("app", "")
+ app_namespace = app_info["namespace"]
+ #iterate through all undeleted achievements
+ Achievement.all.each do |ach|
+ badge = init_badge(ach) #prepare the badge object
+
+ #post badge object to FB
+ id = @graph.put_connections("app", "objects/#{app_namespace}:badge",
+ :object => JSON.generate(badge))
+
+ # get ID as response and save it to the db
+ ach.facebook_obj_id = id["id"]
+ ach.save!
+ end
+ end
+
+ # same as functions in achievement controller
+ def get_fbgraph_for_app
+ oauth = Koala::Facebook::OAuth.new
+ app_token = oauth.get_app_access_token
+ @graph = Koala::Facebook::API.new(app_token)
+ end
+
+ def init_badge(ach)
+ badge = {"title" => ach.title, "description" => ach.description}
+
+ unless ach.icon_url.blank?
+ badge["image"] = ach.icon_url
+ end
+ badge
end
end
|
Complete rake task for adding existing achievements to FB as badges.
References Coursemology/coursemology.org#192.
|
diff --git a/Lock-GooglePlus.podspec b/Lock-GooglePlus.podspec
index abc1234..def5678 100644
--- a/Lock-GooglePlus.podspec
+++ b/Lock-GooglePlus.podspec
@@ -6,10 +6,10 @@ [](http://auth0.com)
Plugin for [Auth0 Lock](https://github.com/auth0/Lock.iOS-OSX) that handles authentication using Google+ iOS SDK.
DESC
- s.homepage = "https://github.com/auth0/Lock-GooglePlus.iOS"
+ s.homepage = "https://github.com/auth0/Lock-Google.iOS"
s.license = 'MIT'
s.author = { "Auth0" => "support@auth0.com", "Hernan Zalazar" => "hernan@auth0.com" }
- s.source = { :git => "https://github.com/auth0/Lock-GooglePlus.iOS.git", :tag => s.version.to_s }
+ s.source = { :git => "https://github.com/auth0/Lock-Google.iOS.git", :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/auth0'
s.platform = :ios, '7.0'
@@ -21,4 +21,5 @@
s.dependency 'googleplus-ios-sdk', '~> 1.7.1'
s.dependency 'Lock/Core', '~> 1.11'
+ s.deprecated = true
end
|
Use new origin and deprecate it
|
diff --git a/lib/vendors/simple_navigation/renderer/twitter_sidenav.rb b/lib/vendors/simple_navigation/renderer/twitter_sidenav.rb
index abc1234..def5678 100644
--- a/lib/vendors/simple_navigation/renderer/twitter_sidenav.rb
+++ b/lib/vendors/simple_navigation/renderer/twitter_sidenav.rb
@@ -3,6 +3,8 @@ content, first_item_selected = '', false
item_container.items.each do |item|
+ next if [I18n.t('general.edit'), I18n.t('general.destroy')].include?(item.name)
+
selected = item.selected? && item.method.blank?
klass = selected && !first_item_selected ? 'active' : ''
options = {}
|
Hide edit and destroy links from sidenav
|
diff --git a/Formula/scalate.rb b/Formula/scalate.rb
index abc1234..def5678 100644
--- a/Formula/scalate.rb
+++ b/Formula/scalate.rb
@@ -1,10 +1,10 @@ require 'formula'
class Scalate <Formula
- url 'http://repo.fusesource.com/nexus/content/repositories/public/org/fusesource/scalate/scalate-distro/1.4.0/scalate-distro-1.4.0-unix-bin.tar.gz'
- version '1.4.0'
+ url 'http://repo.fusesource.com/nexus/content/repositories/public/org/fusesource/scalate/scalate-distro/1.4.1/scalate-distro-1.4.1-unix-bin.tar.gz'
+ version '1.4.1'
homepage 'http://scalate.fusesource.org/'
- md5 'e2c7f309a2774a13262102ce70f78a21'
+ md5 'ed58ac43592bdbb15148a5453b254cee'
def startup_script
<<-EOS.undent
|
Update Scalate to release 1.4.1.
Signed-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>
|
diff --git a/Slash.podspec b/Slash.podspec
index abc1234..def5678 100644
--- a/Slash.podspec
+++ b/Slash.podspec
@@ -15,14 +15,6 @@ s.osx.deployment_target = '10.6'
s.public_header_files = 'Slash/Slash.h', 'Slash/SLSMarkupParser.h', 'Slash/SLSErrors.h'
-
- s.subspec 'arc' do |ss|
- ss.source_files = 'Slash/SLSMarkupParser.m', 'Slash/SLSTaggedRange.m', 'Slash/*.h'
- ss.requires_arc = true
- end
-
- s.subspec 'no-arc' do |ss|
- ss.source_files = 'Slash/SLSTagParser.m', 'Slash/SLSTagLexer.gen.m', 'Slash/SLSTagParser.gen.m', 'Slash/*.h'
- ss.requires_arc = false
- end
+ s.source_files = 'Slash/*.m', 'Slash/*.h'
+ s.requires_arc = 'Slash/SLSMarkupParser.m', 'SLSTaggedRange.m'
end
|
Update podspec to suppress ARC in generated source files using the current CocoaPods syntax
|
diff --git a/test/test_misc.rb b/test/test_misc.rb
index abc1234..def5678 100644
--- a/test/test_misc.rb
+++ b/test/test_misc.rb
@@ -0,0 +1,18 @@+# encoding: UTF-8
+require File.dirname(__FILE__) + '/helper'
+
+# Random tests for specific issues.
+#
+# The test suite will be cleaned up at some point soon.
+class TestMisc < Test::Unit::TestCase
+ include WEBrick
+
+ # in response to http://github.com/alexdunae/premailer/issues#issue/4
+ def test_parsing_extra_quotes
+ io = StringIO.new('<p></p>
+ <h3 "id="WAR"><a name="WAR"></a>Writes and Resources</h3>
+ <table></table>')
+ premailer = Premailer.new(io)
+ assert_match /<h3>[\s]*<a name="WAR">[\s]*<\/a>[\s]*Writes and Resources[\s]*<\/h3>/i, premailer.to_inline_css
+ end
+end
|
Test parsing dodgy HTML attributes
|
diff --git a/test/test_post.rb b/test/test_post.rb
index abc1234..def5678 100644
--- a/test/test_post.rb
+++ b/test/test_post.rb
@@ -12,33 +12,41 @@ end
subject do
- filename = '2015-01-01-a-post.markdown'
- file_path = File.join(test_site.source_paths[:posts], filename)
- Dimples::Post.new(test_site, file_path)
+ test_site.posts.select { |post| post.slug == 'another-post' }.first
end
it 'parses its YAML front matter' do
- subject.title.must_equal('My first post')
- subject.categories.sort.must_equal(%w[green red])
+ subject.title.must_equal('My second post')
+ subject.categories.sort.must_equal(['green'])
+ end
+
+ it 'finds its next post' do
+ subject.next_post.slug.must_equal('yet-another-post')
+ end
+
+ it 'finds its previous post' do
+ subject.previous_post.slug.must_equal('a-post')
end
it 'correctly sets its slug' do
- subject.slug.must_equal('a-post')
+ subject.slug.must_equal('another-post')
end
it 'correctly sets its date' do
subject.year.must_equal('2015')
- subject.month.must_equal('01')
+ subject.month.must_equal('02')
subject.day.must_equal('01')
end
+ it 'returns the correct value when inspected' do
+ subject.inspect.must_equal "#<Dimples::Post @slug=#{subject.slug} @output_path=#{subject.output_path}>"
+ end
+
describe 'when publishing' do
- let(:file_path) { subject.output_path(test_site.output_paths[:site]) }
- before { subject.write(file_path) }
+ before { subject.write }
it 'creates the generated file' do
- File.exist?(file_path).must_equal(true)
- compare_file_to_fixture(file_path, 'posts/2015-01-01-a-post')
+ compare_file_to_fixture(subject.output_path, 'posts/2015-02-01-another-post')
end
end
end
|
Switch to a different subject post, add tests for previous and next posts and the inspect method, switch to the simpler write method.
|
diff --git a/lib/combustion/database/reset.rb b/lib/combustion/database/reset.rb
index abc1234..def5678 100644
--- a/lib/combustion/database/reset.rb
+++ b/lib/combustion/database/reset.rb
@@ -12,8 +12,11 @@ end
def call
- ActiveRecord::Base.configurations.values.each do |conf|
- operator_class(conf['adapter']).new(conf).reset
+ ActiveRecord::Base.configurations.values.each do |configuration|
+ adapter = configuration['adapter'] ||
+ configuration['url'].split('://').first
+
+ operator_class(adapter).new(configuration).reset
end
end
|
Handle databases specified by URL.
|
diff --git a/lib/aruba-doubles/hooks.rb b/lib/aruba-doubles/hooks.rb
index abc1234..def5678 100644
--- a/lib/aruba-doubles/hooks.rb
+++ b/lib/aruba-doubles/hooks.rb
@@ -3,5 +3,6 @@ end
Before('@repeat_arguments') do
+ warn(%{\e[35m The @repeat_arguments tag is deprecated and will be removed in v0.1.1. Please use the new mock feature to check for arguments (see README)!\e[0m})
@repeat_arguments = true
end
|
Add deprecation warning to @repeat_arguments hook
|
diff --git a/lib/checky/checks/check.rb b/lib/checky/checks/check.rb
index abc1234..def5678 100644
--- a/lib/checky/checks/check.rb
+++ b/lib/checky/checks/check.rb
@@ -47,7 +47,7 @@
def to_s(base)
return base unless called?
- base + (pass? ? ' PASSED' : (error ? 'FAILED (%s)' % error : ' FAILED'))
+ base + (pass? ? ' PASSED' : (error ? ' FAILED (%s)' % error : ' FAILED'))
end
end
end
|
Fix missing space in results.
|
diff --git a/lib/guard/rspectacle/humanity.rb b/lib/guard/rspectacle/humanity.rb
index abc1234..def5678 100644
--- a/lib/guard/rspectacle/humanity.rb
+++ b/lib/guard/rspectacle/humanity.rb
@@ -1,8 +1,15 @@ module Guard
class RSpectacle
+ # The humanity class helps to bring some randomness
+ # into the so boring and static messages from rspectacle.
+ #
class Humanity
+ # Picks a random success message.
+ #
+ # @return [String] a success message
+ #
def success
pick [
'How cool, all works!',
@@ -14,6 +21,10 @@ ]
end
+ # Picks a random failure message.
+ #
+ # @return [String] a failure message
+ #
def failure
pick [
'Try harder, failing.',
@@ -24,14 +35,14 @@ ]
end
+ private
+
# Picks one item from array at random.
#
# @param [Array] array of items to pick from.
+ # @return [Object] a randomly chosen item from the array
#
- # #### Returns
- # * +Object+ - a randommly choosen item from the array
def pick(items)
- ['abc']
items[rand items.length]
end
|
Add yardoc and remove unnecessary ['abc'].
|
diff --git a/lib/rambulance/exceptions_app.rb b/lib/rambulance/exceptions_app.rb
index abc1234..def5678 100644
--- a/lib/rambulance/exceptions_app.rb
+++ b/lib/rambulance/exceptions_app.rb
@@ -19,7 +19,7 @@ private
def status_in_words
- ActionDispatch::ExceptionWrapper.rescue_responses[exception.class.to_s]
+ Rack::Utils::SYMBOL_TO_STATUS_CODE.invert[status.to_i]
end
def exception
|
Use status value to get http status in symbol
|
diff --git a/lib/glimpse/views/redis.rb b/lib/glimpse/views/redis.rb
index abc1234..def5678 100644
--- a/lib/glimpse/views/redis.rb
+++ b/lib/glimpse/views/redis.rb
@@ -8,9 +8,9 @@ self.query_count = 0
self.query_time = 0
- def call_with_timing(*args)
+ def call_with_timing(*args, &block)
start = Time.now
- call_without_timing(*args)
+ call_without_timing(*args, &block)
ensure
Redis::Client.query_time += (Time.now - start)
Redis::Client.query_count += 1
|
Include the block if one is given
|
diff --git a/lib/tasks/full_import.rake b/lib/tasks/full_import.rake
index abc1234..def5678 100644
--- a/lib/tasks/full_import.rake
+++ b/lib/tasks/full_import.rake
@@ -6,7 +6,20 @@ event_type: 'full_import'
)
- Study.destroy_all
+ all_tables = ActiveRecord::Base.connection.tables
+
+ blacklist = %w(
+ schema_migrations
+ load_events
+ )
+
+ tables_to_truncate = all_tables.reject do |table|
+ blacklist.include?(table)
+ end
+
+ tables_to_truncate.each do |table|
+ ActiveRecord::Base.connection.truncate(table)
+ end
client = ClinicalTrials::Client.new
client.download_xml_files
|
Truncate tables for full load.
|
diff --git a/spec/builders/pdf_spec.rb b/spec/builders/pdf_spec.rb
index abc1234..def5678 100644
--- a/spec/builders/pdf_spec.rb
+++ b/spec/builders/pdf_spec.rb
@@ -1,12 +1,16 @@ require 'spec_helper'
describe Polytexnic::Builders::Pdf do
- before(:all) { generate_book }
+ before(:all) do
+ generate_book
+ @builder = Polytexnic::Builders::Pdf.new
+ @builder.build!
+ chdir_to_book
+ end
after(:all) { remove_book }
+ subject(:builder) { Polytexnic::Builders::Pdf.new }
describe "#build!" do
- subject(:builder) { Polytexnic::Builders::Pdf.new }
- before { builder.build! }
it "should create a tmp LaTeX file" do
expect(Polytexnic::Utils.tmpify('book.tex')).to exist
|
Move builder.build! into before(:all) block for PDf
[#52758883]
|
diff --git a/lib/tasks/development/load_calendar_data.rake b/lib/tasks/development/load_calendar_data.rake
index abc1234..def5678 100644
--- a/lib/tasks/development/load_calendar_data.rake
+++ b/lib/tasks/development/load_calendar_data.rake
@@ -4,14 +4,14 @@ desc 'Load banes-default-calendar'
task load_banes_default_calendar: [:environment] do
england = CalendarArea.where(title: 'England and Wales').first_or_create
- area = ArCalendarAreaea.where(title: 'Bath and North East Somerset (BANES)', parent_calendar_area: england).first_or_create
+ area = CalendarArea.where(title: 'Bath and North East Somerset (BANES)', parent_area: england).first_or_create
Loader::Calendars.load!("etc/banes-default-calendar.csv", area)
end
desc 'Load sheffield-calendar'
task load_sheffield_default_calendar: [:environment] do
england = CalendarArea.where(title: 'England and Wales').first_or_create
- area = CalendarArea.where(title: 'Sheffield', parent_calendar_area: england).first_or_create
+ area = CalendarArea.where(title: 'Sheffield', parent_area: england).first_or_create
Loader::Calendars.load!("etc/sheffield-default-calendar.csv", area)
end
end
|
Fix typos in this old file
|
diff --git a/spec/lib/truncate_spec.rb b/spec/lib/truncate_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/truncate_spec.rb
+++ b/spec/lib/truncate_spec.rb
@@ -25,4 +25,9 @@ query = 'SELECT * FROM t'
expect(described_class.parse(query).truncate(10)).to eq 'SELECT ...'
end
+
+ it 'works problematic cases' do
+ query = 'SELECT CASE WHEN $2.typtype = ? THEN $2.typtypmod ELSE $1.atttypmod END'
+ expect(described_class.parse(query).truncate(50)).to eq 'SELECT ...'
+ end
end
|
Add additional test for truncation/deparsing.
|
diff --git a/spec/font_attribute_spec.rb b/spec/font_attribute_spec.rb
index abc1234..def5678 100644
--- a/spec/font_attribute_spec.rb
+++ b/spec/font_attribute_spec.rb
@@ -2,6 +2,7 @@
before do
@builder = MotionMastr::Builder.new
+ @font = UIFont.systemFontOfSize(30)
end
it "should return nil if given nil" do
@@ -17,8 +18,13 @@ end
it "should return the UIFont passed" do
- sample = UIFont.new
- @builder.font_attribute(font: sample).should == sample
+ @builder.font_attribute(font: @font).should == @font
+ end
+
+ it "should get applied through the builder" do
+ as = @builder.add("a").add("b", font: @font).build
+ as.attributesAtIndex(1, effectiveRange:nil).keys[0].should == NSFontAttributeName
+ as.attributesAtIndex(1, effectiveRange:nil).values[0].should == @font
end
end
|
Test for font getting built.
|
diff --git a/spec/spec_helper_rails.rb b/spec/spec_helper_rails.rb
index abc1234..def5678 100644
--- a/spec/spec_helper_rails.rb
+++ b/spec/spec_helper_rails.rb
@@ -3,9 +3,10 @@ require 'action_controller/railtie'
require 'rails/test_unit/railtie'
-Class.new(Rails::Application) do
+class TestApplication < Rails::Application
config.active_support.deprecation = :stderr
-end.initialize!
+end
+TestApplication.initialize!
require 'rspec/rails'
|
Use a sub-class of Rails::Application for 1.8.7.
|
diff --git a/specs/raygun/raygun_spec.rb b/specs/raygun/raygun_spec.rb
index abc1234..def5678 100644
--- a/specs/raygun/raygun_spec.rb
+++ b/specs/raygun/raygun_spec.rb
@@ -0,0 +1,34 @@+require_relative '../spec_helper'
+require 'stringio'
+
+describe Raygun do
+ let(:failsafe_logger) { FakeLogger.new }
+
+ describe '#track_exception' do
+ context 'send in background' do
+ before do
+ Raygun.setup do |c|
+ c.send_in_background = true
+ c.api_url = 'http://example.api'
+ c.api_key = 'foo'
+ c.debug = true
+ c.failsafe_logger = failsafe_logger
+ end
+ end
+
+ context 'request times out' do
+ before do
+ stub_request(:post, 'http://example.api/entries').to_timeout
+ end
+
+ it 'logs the failure to the failsafe logger' do
+ error = StandardError.new
+
+ Raygun.track_exception(error)
+
+ failsafe_logger.get.must_match /Problem reporting exception to Raygun/
+ end
+ end
+ end
+ end
+end
|
Add test around send_in_background and timeouts
Unfortunately this just triggers a timeout, doesn't actually confirm it
will time out. But confirms that the behaviour when a time out _does_
happen is correct
|
diff --git a/models/model_object.rb b/models/model_object.rb
index abc1234..def5678 100644
--- a/models/model_object.rb
+++ b/models/model_object.rb
@@ -20,8 +20,8 @@ # This expects a to_hash method to be defined.
#
# Returns the JSON representation of the model object.
- def to_json
- to_hash.to_json
+ def to_json(*args)
+ to_hash.to_json(*args)
end
end
end
|
Fix general case of to_json for model objects.
|
diff --git a/lib/active_attr/version.rb b/lib/active_attr/version.rb
index abc1234..def5678 100644
--- a/lib/active_attr/version.rb
+++ b/lib/active_attr/version.rb
@@ -1,5 +1,5 @@ module ActiveAttr
# Complete version string
# @since 0.1.0
- VERSION = "0.8.2"
+ VERSION = "0.8.3"
end
|
Mark the release of 0.8.3 [ci skip]
|
diff --git a/core/spec/controllers/spree/admin/shipping_methods_controller_spec.rb b/core/spec/controllers/spree/admin/shipping_methods_controller_spec.rb
index abc1234..def5678 100644
--- a/core/spec/controllers/spree/admin/shipping_methods_controller_spec.rb
+++ b/core/spec/controllers/spree/admin/shipping_methods_controller_spec.rb
@@ -1,6 +1,7 @@ require 'spec_helper'
describe Spree::Admin::ShippingMethodsController do
+ stub_authorization!
# Regression test for #1240
it "should not hard-delete shipping methods" do
|
Add stub_authorization to admin/shipping_methods controller spec
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.