diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/spec/lib/gitometer/warden_helpers_spec.rb b/spec/lib/gitometer/warden_helpers_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/gitometer/warden_helpers_spec.rb
+++ b/spec/lib/gitometer/warden_helpers_spec.rb
@@ -0,0 +1,17 @@+require 'spec_helper'
+
+module Gitometer
+ class WardenHelped; include WardenHelpers; end
+
+ describe WardenHelpers do
+ subject { WardenHelped.new }
+
+ pending 'returns the warden user'
+
+ pending 'can logout the warden user'
+
+ pending 'can return the authenticated status for a warden user'
+
+ pending 'can ensure the user is authenticated through warden'
+ end
+end
|
Add pending specs until we figure out how to test warden.
|
diff --git a/resources/habitat_build.rb b/resources/habitat_build.rb
index abc1234..def5678 100644
--- a/resources/habitat_build.rb
+++ b/resources/habitat_build.rb
@@ -13,6 +13,7 @@ property :artifact, String
property :home_dir, String
property :auth_token, String
+property :live_stream, Boolean, default: true
action :build do
execute 'build-plan' do
@@ -21,7 +22,7 @@ " build #{plan_dir}"
environment('TERM' => 'vt100', 'HAB_ORIGIN' => origin)
cwd new_resource.cwd
- live_stream true
+ live_stream new_resource.live_stream
end
end
@@ -36,7 +37,7 @@ 'HOME' => home_dir,
'HAB_AUTH_TOKEN' => auth_token
)
- live_stream true
+ live_stream new_resource.live_stream
sensitive true
end
end
|
Add ability to toggle live stream for hab_build resource
Signed-off-by: Elliott Davis <ddda907ff26ca0abaafd09579d559b51098ffe8e@chef.io>
|
diff --git a/web/test/test_web.rb b/web/test/test_web.rb
index abc1234..def5678 100644
--- a/web/test/test_web.rb
+++ b/web/test/test_web.rb
@@ -34,6 +34,9 @@ def test_visualizations
get '/visualizations'
assert last_response.ok?
- assert last_response.body.include? '<h1>Number of Packages per Ruby Target:</h1>'
+ assert last_response.body.include? '<h1>Visualizations</h1>'
+ assert last_response.body.include? '<h2>Number of Packages per Ruby Target</h2>'
+ assert last_response.body.include? '<h2>Number of Outdated Gems</h2>'
+ assert last_response.body.include? '<h2>Number of Packages per Build Result</h2>'
end
end
|
Correct heading sizes in tests for visualization page
|
diff --git a/spec/poof_bang_spec.rb b/spec/poof_bang_spec.rb
index abc1234..def5678 100644
--- a/spec/poof_bang_spec.rb
+++ b/spec/poof_bang_spec.rb
@@ -5,6 +5,9 @@ describe '#poof!' do
before(:all) do
+
+ RSpec.configure { |conf| conf.include Poof::Syntax }
+
ActiveRecord::Base.logger = Logger.new(File.open('database.log', 'w'))
ActiveRecord::Base.establish_connection(
@@ -28,7 +31,7 @@
it 'ensures a record will be removed from the database' do
Poof::Magic.start
- record = Poof::Magic.poof!(TestModels::Car.create! make: "Chevy", model: "Volt", year: Date.today.year)
+ record = poof!(TestModels::Car.create! make: "Chevy", model: "Volt", year: Date.today.year)
expect { TestModels::Car.find record.id }.to_not raise_error
Poof::Magic.end
expect { TestModels::Car.find record.id }.to raise_error ActiveRecord::RecordNotFound
|
Make the spec less confusing - technically poof! is a class method, but is intended to be used as an instance method by include
|
diff --git a/spec/support/sequel.rb b/spec/support/sequel.rb
index abc1234..def5678 100644
--- a/spec/support/sequel.rb
+++ b/spec/support/sequel.rb
@@ -2,6 +2,7 @@ DB = Sequel.sqlite # in memory
Sequel.extension :migration
Sequel::Migrator.run(DB, 'spec/support/sequel_migrations', :current => 0)
+ Sequel::Model.strict_param_setting = true
def clear_sequel_db
ParentSequelModel.truncate
@@ -18,8 +19,6 @@ plugin :class_table_inheritance, key: :kind
one_to_many :child_sequel_models
-
- strict_param_setting = true
attr_accessor :extra_fields
|
Set Sequel strict_param_setting globally for models
|
diff --git a/spec/versioner_spec.rb b/spec/versioner_spec.rb
index abc1234..def5678 100644
--- a/spec/versioner_spec.rb
+++ b/spec/versioner_spec.rb
@@ -33,4 +33,21 @@ end
end
end
+
+ describe '#mark-postinstall' do
+ it 'adds everything and commits' do
+ Kosmos::Versioner.init_repo(ksp_dir)
+
+ Dir.chdir(ksp_dir) do
+ package = OpenStruct.new
+ package.title = "Example"
+
+ `touch hello.txt`
+ Kosmos::Versioner.mark_postinstall(ksp_dir, package)
+
+ expect(`git ls-files --others`).to be_empty
+ expect(`git log -1 --pretty=%B`).to eq "POST: Example\n"
+ end
+ end
+ end
end
|
Add a test for mark_postinstall.
|
diff --git a/spec/integration/hanami/router/context_spec.rb b/spec/integration/hanami/router/context_spec.rb
index abc1234..def5678 100644
--- a/spec/integration/hanami/router/context_spec.rb
+++ b/spec/integration/hanami/router/context_spec.rb
@@ -0,0 +1,21 @@+RSpec.describe Hanami::Router do
+ describe "context option" do
+ let(:app) { Rack::MockRequest.new(router) }
+
+ let(:router) { described_class.new(context: context, &routes) }
+
+ let(:routes) {
+ proc do |context|
+ mount -> _ {
+ [200, {}, ["context says #{context.greeting}"]]
+ }, at: "/test"
+ end
+ }
+
+ let(:context) { double(:context, greeting: "hello world") }
+
+ it "is available as a routing block argument" do
+ expect(app.request("GET", "/test").body).to eq("context says hello world")
+ end
+ end
+end
|
Add test for context option
|
diff --git a/spec/paho-mqtt_spec.rb b/spec/paho-mqtt_spec.rb
index abc1234..def5678 100644
--- a/spec/paho-mqtt_spec.rb
+++ b/spec/paho-mqtt_spec.rb
@@ -6,6 +6,6 @@ end
it 'does something useful' do
- expect(false).to eq(true)
+ expect(true).to eq(true)
end
end
|
Change default spec to True
|
diff --git a/spec/dotenv/environment_spec.rb b/spec/dotenv/environment_spec.rb
index abc1234..def5678 100644
--- a/spec/dotenv/environment_spec.rb
+++ b/spec/dotenv/environment_spec.rb
@@ -31,7 +31,7 @@
describe 'apply!' do
it 'sets variables in the ENV' do
- subject.apply
+ subject.apply!
expect(ENV['OPTION_A']).to eq('1')
end
|
Call the right method in the spec
closes #129
|
diff --git a/spec/support/factory_helpers.rb b/spec/support/factory_helpers.rb
index abc1234..def5678 100644
--- a/spec/support/factory_helpers.rb
+++ b/spec/support/factory_helpers.rb
@@ -17,14 +17,14 @@
def build_serialized_user(options = {})
{
- :nickname => options[:nickname] ||'nickname',
- :email => options[:email] ||'email',
- :auth_key => options[:auth_key] ||'auth_key',
+ :nickname => options[:nickname] || 'nickname',
+ :email => options[:email] || 'email',
+ :auth_key => options[:auth_key] || 'auth_key',
:favorites => options[:favorities] || [],
:added => options[:added] || [],
- :terms_accepted => true
+ :terms => true
}
end
end
-end+end
|
Change 'terms_accepted' to 'terms' in helper
|
diff --git a/db/migrate/20191031193436_remove_old_akismet_states.rb b/db/migrate/20191031193436_remove_old_akismet_states.rb
index abc1234..def5678 100644
--- a/db/migrate/20191031193436_remove_old_akismet_states.rb
+++ b/db/migrate/20191031193436_remove_old_akismet_states.rb
@@ -1,6 +1,6 @@ # frozen_string_literal: true
-class RemoveOldAkismetStates < ActiveRecord::Migration[6.0]
+class RemoveOldAkismetStates < ActiveRecord::Migration[5.2]
def up
DB.exec(<<~SQL, updated_at: 5.minutes.ago
DELETE FROM post_custom_fields
|
FIX: Make migrations work with Discourse stable
|
diff --git a/validates_xml_of.gemspec b/validates_xml_of.gemspec
index abc1234..def5678 100644
--- a/validates_xml_of.gemspec
+++ b/validates_xml_of.gemspec
@@ -22,7 +22,7 @@ spec.add_dependency "nokogiri"
spec.add_development_dependency "bundler", "~> 1.11"
- spec.add_development_dependency "rake", "~> 10.0"
+ spec.add_development_dependency "rake", "~> 12.3"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency "activemodel", ">= 3.0"
end
|
Update rake requirement from ~> 10.0 to ~> 12.3
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/commits/v12.3.1)
Signed-off-by: dependabot[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>
|
diff --git a/Casks/waterfox.rb b/Casks/waterfox.rb
index abc1234..def5678 100644
--- a/Casks/waterfox.rb
+++ b/Casks/waterfox.rb
@@ -1,6 +1,6 @@ cask :v1 => 'waterfox' do
- version '39.0'
- sha256 'ba25c4c3a422b2727d5d47a1369fb26b3c66d9c03967fdd22076e27fff982134'
+ version '40.0.2'
+ sha256 '49720ec39019cc7991531677014bbd140062fb72f0d5dbd963f7f14b75da37b6'
# cloudfront.net is the official download host per the vendor homepage
url "https://d1th2p59px32bw.cloudfront.net/releases/osx64/installer/Waterfox%20#{version}%20Setup.dmg"
|
Upgrade Waterfox.app to version 40.0.2
|
diff --git a/ochibako_share.gemspec b/ochibako_share.gemspec
index abc1234..def5678 100644
--- a/ochibako_share.gemspec
+++ b/ochibako_share.gemspec
@@ -9,6 +9,7 @@ s.executables = %w(ochibako-share ochibako-share-auth)
s.homepage = 'https://github.com/zunda/ochibako-share#readme'
s.license = 'MIT'
+ s.extra_rdoc_files = %w(README.md license.md)
s.add_dependency('dropbox-sdk')
end
|
Add doc files into gemspec
|
diff --git a/spec/features/search_options_spec.rb b/spec/features/search_options_spec.rb
index abc1234..def5678 100644
--- a/spec/features/search_options_spec.rb
+++ b/spec/features/search_options_spec.rb
@@ -9,5 +9,9 @@ it 'provides an All Fields search option' do
expect(page).to have_select('search_field', with_options: ['All Fields'])
end
+
+ it 'provides a Title search option' do
+ expect(page).to have_select('search_field', with_options: ['Title'])
+ end
end
end
|
Add test for title field search config
|
diff --git a/spec/finders/projects_finder_spec.rb b/spec/finders/projects_finder_spec.rb
index abc1234..def5678 100644
--- a/spec/finders/projects_finder_spec.rb
+++ b/spec/finders/projects_finder_spec.rb
@@ -46,5 +46,13 @@ end
end
end
+
+ describe 'with project_ids_relation' do
+ let(:project_ids_relation) { Project.where(id: internal_project.id) }
+
+ subject { finder.execute(user, project_ids_relation) }
+
+ it { is_expected.to eq([internal_project]) }
+ end
end
end
|
Add a spec for ProjectsFinder project_ids_relation option
Follow-up 1003454c
|
diff --git a/spec/stylers/ui_image_view_styler.rb b/spec/stylers/ui_image_view_styler.rb
index abc1234..def5678 100644
--- a/spec/stylers/ui_image_view_styler.rb
+++ b/spec/stylers/ui_image_view_styler.rb
@@ -1,6 +1,6 @@ class StyleSheetForUIViewStylerTests < RubyMotionQuery::Stylesheet
- def u_image_view_kitchen_sink(st)
+ def ui_image_view_kitchen_sink(st)
st.image = image.resource('logo')
end
@@ -10,13 +10,13 @@ before do
@vc = UIViewController.alloc.init
@vc.rmq.stylesheet = StyleSheetForUIViewStylerTests
- @view_klass = UIImageView
+ @view_klass = UIImageView
end
behaves_like "styler"
it 'should apply a style with every UIImageViewStyler wrapper method' do
- view = @vc.rmq.append(@view_klass, :u_image_view_kitchen_sink).get
+ view = @vc.rmq.append(@view_klass, :ui_image_view_kitchen_sink).get
view.image.should == @vc.rmq.image.resource('logo')
end
|
Fix typo in UIImageViewStyler spec.
|
diff --git a/SipHash.podspec b/SipHash.podspec
index abc1234..def5678 100644
--- a/SipHash.podspec
+++ b/SipHash.podspec
@@ -1,8 +1,8 @@ Pod::Spec.new do |spec|
spec.name = 'SipHash'
spec.version = '1.0.0'
+ spec.ios.deployment_target = "8.0"
spec.osx.deployment_target = "10.9"
- spec.ios.deployment_target = "8.0"
spec.tvos.deployment_target = "9.0"
spec.watchos.deployment_target = "2.0"
spec.summary = 'Simple and secure hashing in Swift with the SipHash algorithm'
|
Fix order of deployment targets to match version.xcconfig.
|
diff --git a/mako.gemspec b/mako.gemspec
index abc1234..def5678 100644
--- a/mako.gemspec
+++ b/mako.gemspec
@@ -24,6 +24,7 @@ spec.add_development_dependency 'rake'
spec.add_development_dependency 'minitest'
spec.add_development_dependency 'vcr'
+ spec.add_development_dependency 'rubocop'
spec.add_runtime_dependency 'feedjira', '~> 2.0'
spec.add_runtime_dependency 'faraday'
|
Add rubocop as a development dependency
|
diff --git a/spec/lib/api_canon_spec.rb b/spec/lib/api_canon_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/api_canon_spec.rb
+++ b/spec/lib/api_canon_spec.rb
@@ -7,14 +7,12 @@ end
end
describe 'including' do
- context :class_methods do
- subject {fake_controller}
- its(:methods) { should include(:document_method)}
+ it "adds class methods to the controller" do
+ expect(fake_controller.methods.map(&:to_s)).to include('document_method')
end
- context :instance_methods do
- subject {fake_controller.new}
- its(:methods) { should include(:api_canon_docs)}
- its(:methods) { should include(:index)}
+ it "adds instance methods to the controller" do
+ expect(fake_controller.new.methods.map(&:to_s)).to include('api_canon_docs')
+ expect(fake_controller.new.methods.map(&:to_s)).to include('index')
end
end
|
Fix to allow specs to run in 1.8.7
|
diff --git a/spec/sub_diff/diff_spec.rb b/spec/sub_diff/diff_spec.rb
index abc1234..def5678 100644
--- a/spec/sub_diff/diff_spec.rb
+++ b/spec/sub_diff/diff_spec.rb
@@ -0,0 +1,58 @@+require_relative '../../lib/sub_diff/diff'
+
+RSpec.describe SubDiff::Diff do
+ let(:diff) { described_class.new(value, value_was) }
+ let(:diff_without_value_was) { described_class.new(value) }
+ let(:diff_with_empty_values) { described_class.new('', '') }
+
+ let(:value) { 'test' }
+ let(:value_was) { 'testing' }
+
+ describe '#initialize' do
+ it 'should accept value_was' do
+ expect(diff.value_was).to eq value_was
+ end
+
+ it 'should set value_was to value if it is not specified' do
+ expect(diff_without_value_was.value_was).to eq value
+ end
+ end
+
+ describe '#changed?' do
+ it 'should return true if value does not match value_was' do
+ expect(diff).to be_changed
+ end
+
+ it 'should return false if value matches value_was' do
+ expect(diff_without_value_was).not_to be_changed
+ expect(diff_with_empty_values).not_to be_changed
+ end
+ end
+
+ describe '#enumerable?' do
+ it 'should return true if the diff was changed' do
+ expect(diff).to be_enumerable
+ end
+
+ it 'should return true if the diff value is not empty' do
+ expect(diff).to receive(:changed?).and_return false
+ expect(diff).to be_enumerable
+ end
+
+ it 'should return false if the diff was not changed and is empty' do
+ expect(diff_with_empty_values).not_to be_enumerable
+ end
+ end
+
+ describe '#to_s' do
+ it 'should return the diff value' do
+ expect(diff.to_s).to eq value
+ end
+ end
+
+ describe '#value' do
+ it 'should return the diff value' do
+ expect(diff.value).to eq value
+ end
+ end
+end
|
Add specs for `Diff` class
|
diff --git a/test/integration/debian7_knife_bootstrap_test.rb b/test/integration/debian7_knife_bootstrap_test.rb
index abc1234..def5678 100644
--- a/test/integration/debian7_knife_bootstrap_test.rb
+++ b/test/integration/debian7_knife_bootstrap_test.rb
@@ -6,7 +6,7 @@ end
def image_id
- "ami-1d620e74"
+ "ami-9e95e8f7"
end
def prepare_server
|
Update the Debian 7 test AMI to Debian 7.1
|
diff --git a/Whisper.podspec b/Whisper.podspec
index abc1234..def5678 100644
--- a/Whisper.podspec
+++ b/Whisper.podspec
@@ -11,4 +11,6 @@ s.requires_arc = true
s.source_files = 'Source/**/*'
s.resource_bundles = { 'Whisper' => ['Images/*.{png}'] }
+
+ s.frameworks = 'UIKit', 'Foundation'
end
|
Add UIKit and Foundation as dependencies
|
diff --git a/Casks/android-studio.rb b/Casks/android-studio.rb
index abc1234..def5678 100644
--- a/Casks/android-studio.rb
+++ b/Casks/android-studio.rb
@@ -1,8 +1,8 @@ class AndroidStudio < Cask
- version '0.8.2 build-135.1267975'
- sha256 '55a20e6f9a9e76468344aacf2909b6db224fa3a87e4eac0d76d277ae8c479f89'
+ version '0.8.3 build-135.1281642'
+ sha256 'fcc6a0b4817e83bc6251764637041e90db7c8df65e7a362e50b9083664cee0f9'
- url 'https://dl.google.com/dl/android/studio/ide-zips/0.8.2/android-studio-ide-135.1267975-mac.zip'
+ url 'https://dl.google.com/dl/android/studio/ide-zips/0.8.3/android-studio-ide-135.1281642-mac.zip'
homepage 'https://developer.android.com/sdk/installing/studio.html'
link 'Android Studio.app'
|
Upgrade Android Studio.app to v0.8.3 build-135.1281642
|
diff --git a/Casks/devonthink-pro.rb b/Casks/devonthink-pro.rb
index abc1234..def5678 100644
--- a/Casks/devonthink-pro.rb
+++ b/Casks/devonthink-pro.rb
@@ -1,11 +1,11 @@ cask :v1 => 'devonthink-pro' do
- version '2.8.6'
- sha256 '3b5d369bc641d6c0d8ded140ca6c496474051f93f79f53a97c872631f17530a7'
+ version '2.8.7'
+ sha256 '49f5ebd10dfb79c4610f3042d04ce49801160e69d37c9efd6da651c9e375be35'
# amazonaws.com is the official download host per the vendor homepage
url "https://s3.amazonaws.com/DTWebsiteSupport/download/devonthink/#{version}/DEVONthink_Pro.dmg.zip"
appcast 'http://www.devon-technologies.com/Sparkle/DEVONthinkPro2.xml',
- :sha256 => 'ab35058aac9f3010b0a12054fba2e80cb6d03ac65443c6d90e4fb14937f45d20'
+ :sha256 => 'd1c3526d9d9d9f0c81fa3348ef39c26118be13e3b8bad33724897ea49058470f'
name 'DEVONthink Pro'
homepage 'http://www.devontechnologies.com/products/devonthink/devonthink-pro.html'
license :commercial
|
Update DEVONthink Pro to 2.8.6
|
diff --git a/Casks/iterm2-nightly.rb b/Casks/iterm2-nightly.rb
index abc1234..def5678 100644
--- a/Casks/iterm2-nightly.rb
+++ b/Casks/iterm2-nightly.rb
@@ -2,8 +2,8 @@ version :latest
sha256 :no_check
- url 'http://www.iterm2.com/nightly/latest'
- homepage 'http://www.iterm2.com/'
+ url 'https://www.iterm2.com/nightly/latest'
+ homepage 'https://www.iterm2.com/'
license :oss
app 'iTerm.app'
|
Update Iterm2 Nightly URL and Homepage
|
diff --git a/Casks/the-unarchiver.rb b/Casks/the-unarchiver.rb
index abc1234..def5678 100644
--- a/Casks/the-unarchiver.rb
+++ b/Casks/the-unarchiver.rb
@@ -1,8 +1,8 @@ cask :v1 => 'the-unarchiver' do
- version '3.9.1'
- sha256 '4911c332df7f4bb23877652700e845fe097b793ae37450948319398009e923a3'
+ version '3.10'
+ sha256 'fa5fd1d3ec1c293b8fa8d60f6c3f36f441eeaf1237975249f7521eace430ea22'
- url "http://unarchiver.c3.cx/downloads/TheUnarchiver#{version}_legacy.zip"
+ url "http://unarchiver.c3.cx/downloads/TheUnarchiver#{version}.dmg"
name 'The Unarchiver'
homepage 'http://unarchiver.c3.cx/unarchiver'
license :oss
|
Upgrade The Unarchiver to v3.10
|
diff --git a/db/fixtures/010_fuel_markets.rb b/db/fixtures/010_fuel_markets.rb
index abc1234..def5678 100644
--- a/db/fixtures/010_fuel_markets.rb
+++ b/db/fixtures/010_fuel_markets.rb
@@ -1,18 +1,34 @@ FuelMarket.seed_many([
{:id => 1, :name => "Wind",
- :description => "The movement of air."},
+ :description => "The movement of air.",
+ :initial_average_price => 42,
+ :initial_standard_deviation => 4},
{:id => 2, :name => "Sun",
- :description => "Solar radiation."},
+ :description => "Solar radiation.",
+ :initial_average_price => 42,
+ :initial_standard_deviation => 4},
{:id => 3, :name => "Water",
- :description => "The movement of water."},
+ :description => "The movement of water.",
+ :initial_average_price => 42,
+ :initial_standard_deviation => 4},
{:id => 4, :name => "Natural Gas",
- :description => "TODO"},
+ :description => "TODO",
+ :initial_average_price => 42,
+ :initial_standard_deviation => 4},
{:id => 5, :name => "Coal",
- :description => "TODO"},
+ :description => "TODO",
+ :initial_average_price => 42,
+ :initial_standard_deviation => 4},
{:id => 6, :name => "Gasoline",
- :description => "TODO"},
+ :description => "TODO",
+ :initial_average_price => 42,
+ :initial_standard_deviation => 4},
{:id => 7, :name => "Low-enriched Uranium",
- :description => "TODO"},
+ :description => "TODO",
+ :initial_average_price => 42,
+ :initial_standard_deviation => 4},
{:id => 8, :name => "Highly-enriched Uranium",
- :description => "TODO"},
+ :description => "TODO",
+ :initial_average_price => 42,
+ :initial_standard_deviation => 4},
])
|
Add defaults to fixtures for fuel markets.
|
diff --git a/Casks/dbeaver-community.rb b/Casks/dbeaver-community.rb
index abc1234..def5678 100644
--- a/Casks/dbeaver-community.rb
+++ b/Casks/dbeaver-community.rb
@@ -1,11 +1,11 @@ cask :v1 => 'dbeaver-community' do
- version '3.3.0'
+ version '3.3.1'
if Hardware::CPU.is_32_bit?
- sha256 'd91acbac3dc2c86d20f3562f2b7ef5e5a87229a9f32f7bc8f4542d135c5eb31e'
+ sha256 '0ad6a3a7011415cfb990b6027bf62b93b334a12dff9740ebc03993c9e235f332'
url "http://dbeaver.jkiss.org/files/dbeaver-#{version}-macosx.cocoa.x86.zip"
else
- sha256 'c8dbf2f6f86c64ea4e2812336ef0f4d35af6659ece26a2afdcb4de95d6d991cd'
+ sha256 'f4aaf0314ff4fd1f9084f7d634566c82aac37f208161fe4d4f6f670745f3c1f7'
url "http://dbeaver.jkiss.org/files/dbeaver-#{version}-macosx.cocoa.x86_64.zip"
end
|
Update DBeaver community to v3.3.1
|
diff --git a/Casks/nulloy.rb b/Casks/nulloy.rb
index abc1234..def5678 100644
--- a/Casks/nulloy.rb
+++ b/Casks/nulloy.rb
@@ -2,6 +2,7 @@ version '0.8.2'
sha256 '67acc5ada9b5245cda7da04456bc18ad6e9b49dbdcb1e2752ce988d4d3607b35'
+ # github.com/nulloy/nulloy was verified as official when first introduced to the cask
url "https://github.com/nulloy/nulloy/releases/download/#{version}/Nulloy-#{version}-x86_64.dmg"
appcast 'https://github.com/nulloy/nulloy/releases.atom',
checkpoint: '6b12d536ceefb813d7e269dc5943e5fa1efca77de4f1e9b9b5eb700ee9d0a3ff'
|
Fix `url` stanza comment for Nulloy.
|
diff --git a/app/models/manageiq/providers/ansible_tower/shared/automation_manager/event_parser.rb b/app/models/manageiq/providers/ansible_tower/shared/automation_manager/event_parser.rb
index abc1234..def5678 100644
--- a/app/models/manageiq/providers/ansible_tower/shared/automation_manager/event_parser.rb
+++ b/app/models/manageiq/providers/ansible_tower/shared/automation_manager/event_parser.rb
@@ -1,9 +1,8 @@ module ManageIQ::Providers::AnsibleTower::Shared::AutomationManager::EventParser
def event_to_hash(event, ems_id)
{
- :event_type => "#{self.event_type}_#{event.operation}",
+ :event_type => "#{event.object1}_#{event.operation}",
:source => "#{self.source}",
- :message => event.changes.to_s,
:timestamp => event.timestamp,
:full_data => event.to_h,
:ems_id => ems_id
|
Add Ansible event target type into event_type.
Add Ansible event target type into event_type to distinguish the event from different event targets.
No need to repeat event.changes in message to reduce the event object's size.
|
diff --git a/lib/asteroids/ship/ship-graphics.rb b/lib/asteroids/ship/ship-graphics.rb
index abc1234..def5678 100644
--- a/lib/asteroids/ship/ship-graphics.rb
+++ b/lib/asteroids/ship/ship-graphics.rb
@@ -0,0 +1,15 @@+module Asteroids
+ class ShipGraphics < Component
+
+ def initialize(game_object)
+ super(game_object)
+ @image = Gosu::Image.load_tiles($window,
+ Utils.get_image_path("ship.png"), 90, 90, true)
+ end
+
+ def draw
+ @image[1].draw_rot(x, y, 1, angle)
+ end
+
+ end
+end
|
Add the ship graphics class.
This class will take care for the ship drawing.
|
diff --git a/spec/define_dimension_spec.rb b/spec/define_dimension_spec.rb
index abc1234..def5678 100644
--- a/spec/define_dimension_spec.rb
+++ b/spec/define_dimension_spec.rb
@@ -1,6 +1,6 @@ require 'spec_helper'
-describe Dims do
+describe Measurb do
describe '.define' do
before :example do
clear_defined_inches
@@ -14,26 +14,35 @@ expect { int.__send__(method) }.to raise_error(NoMethodError)
expect { float.__send__(method) }.to raise_error(NoMethodError)
- Dims.define(:inches, options)
+ Measurb.define(:inches, options)
- expect(int.__send__(method)).to eq(Dims::Inches.new(int))
- expect(float.__send__(method)).to eq(Dims::Inches.new(float))
+ expect(int.__send__(method)).to eq(Measurb::Inches.new(int))
+ expect(float.__send__(method)).to eq(Measurb::Inches.new(float))
end
end
it 'creates the class' do
- expect { Dims::Inches }.to raise_error(NameError)
- Dims.define(:inches)
- expect(Dims::Inches).to be < Dims::Dimension
+ expect { Measurb::Inches }.to raise_error(NameError)
+ Measurb.define(:inches)
+ expect(Measurb::Inches).to be < Measurb::Dimension
+ end
+
+ it 'adds the helper method' do
+ expect(Measurb).to_not respond_to(:inches)
+ Measurb.define(:inches)
+ expect(Measurb).to respond_to(:inches)
end
it 'returns the dimension class' do
- expect(Dims.define(:inches)).to be(Dims::Inches)
+ expect(Measurb.define(:inches)).to be(Measurb::Inches)
end
it 'raises an error if the class is already defined' do
- Dims.define(:inches)
- expect { Dims.define(:inches) }.to raise_error(NameError, 'Already defined dimension class `Inches`')
+ Measurb.define(:inches)
+
+ expect {
+ Measurb.define(:inches)
+ }.to raise_error(Measurb::DuplicateDimensionError, 'Already defined dimension class `Inches`')
end
include_context 'adding the Numeric method', :inches
|
Rename Dims -> Measurb. Add more specs.
|
diff --git a/spec/support/active_record.rb b/spec/support/active_record.rb
index abc1234..def5678 100644
--- a/spec/support/active_record.rb
+++ b/spec/support/active_record.rb
@@ -8,7 +8,6 @@ # require 'rspec/rails/matchers/relation_match_array'
require 'rspec/rails/fixture_support'
require 'rspec/rails/mocks'
-require 'rspec/rails/module_inclusion'
require 'rspec/rails/example/rails_example_group'
require 'rspec/rails/example/model_example_group'
|
Spec: Remove module_inclusion, it is a deperecated method.
|
diff --git a/spec/support/slack_helpers.rb b/spec/support/slack_helpers.rb
index abc1234..def5678 100644
--- a/spec/support/slack_helpers.rb
+++ b/spec/support/slack_helpers.rb
@@ -14,7 +14,7 @@ channel_id: "C99NNAY74",
channel_name: "zf-promo",
command: "/heroku",
- response_url: "https://hooks.slack.com/commands/T123YG08V/2459573/mfZPdDq",
+ response_url: "https://hooks.slack.com/commands/T123YG08V/2459573/mPdDq",
team_id: "T123YG08V",
team_domain: "zf",
text: text
|
Complete url is not needed
|
diff --git a/spec/vimrunner/errors_spec.rb b/spec/vimrunner/errors_spec.rb
index abc1234..def5678 100644
--- a/spec/vimrunner/errors_spec.rb
+++ b/spec/vimrunner/errors_spec.rb
@@ -1,4 +1,5 @@ require "spec_helper"
+require "vimrunner"
require "vimrunner/errors"
module Vimrunner
@@ -6,7 +7,7 @@ it "has a useful message" do
expect {
raise NoSuitableVimError
- }.to raise_error("No suitable Vim executable could be found for this system.")
+ }.to raise_error(/No suitable Vim executable could be found for this system./)
end
end
@@ -14,7 +15,17 @@ it "has a useful message" do
expect {
raise TimeoutError
- }.to raise_error("Timed out while waiting for serverlist. Is an X11 server running?")
+ }.to raise_error(/Timed out while waiting for serverlist. Is an X11 server running?/)
+ end
+ end
+
+ describe InvalidCommandError do
+ it "has a useful message" do
+ expect {
+ Vimrunner.start do |vim|
+ vim.command :nonexistent
+ end
+ }.to raise_error(/Not an editor command: nonexistent/)
end
end
end
|
Add a spec for InvalidCommandError
|
diff --git a/Reachability.podspec b/Reachability.podspec
index abc1234..def5678 100644
--- a/Reachability.podspec
+++ b/Reachability.podspec
@@ -0,0 +1,13 @@+Pod::Spec.new do |s|
+ s.name = 'Reachability'
+ s.version = '3.0.0'
+ s.license = 'BSD'
+ s.platform = :ios
+ s.homepage = 'https://github.com/tonymillion/Reachability'
+ s.authors = { 'Tony Million' => 'tonymillion@gmail.com' }
+ s.summary = 'ARC and GCD Compatible Reachability Class for iOS. Drop in replacement for Apple Reachability.'
+ s.source = { :git => 'https://github.com/tonymillion/Reachability.git', :tag => '3.0.0' }
+ s.source_files = 'Reachability.{h,m}'
+ s.framework = 'SystemConfiguration'
+ s.requires_arc = true
+end
|
Add a CocoaPods podspec for a future 3.0.0 release.
|
diff --git a/app/models/friendship.rb b/app/models/friendship.rb
index abc1234..def5678 100644
--- a/app/models/friendship.rb
+++ b/app/models/friendship.rb
@@ -21,6 +21,12 @@ end
def destroy
- Friendship.delete_all ['(friend_id = ? and person_id = ?) or (friend_id = ? and person_id = ?)', person.id, friend.id, friend.id, person.id]
+ Friendship.where(
+ '(friend_id = ? and person_id = ?) or (friend_id = ? and person_id = ?)',
+ person.id,
+ friend.id,
+ friend.id,
+ person.id
+ ).delete_all
end
end
|
Update delete_all usage to fix deprecation
|
diff --git a/lib/app.rb b/lib/app.rb
index abc1234..def5678 100644
--- a/lib/app.rb
+++ b/lib/app.rb
@@ -22,25 +22,28 @@
module ExercismWeb
class App < Sinatra::Base
- enable :sessions
- set :session_secret, ENV.fetch('SESSION_SECRET') { "Need to know only." }
+ configure do
+ enable :sessions
+ set :session_secret, ENV.fetch('SESSION_SECRET') { "Need to know only." }
+ end
if settings.development?
- use ExercismWeb::Routes::Backdoor
+ use Routes::Backdoor
end
use ExercismIO::Routes::Help
- use ExercismWeb::Routes::Legacy
- use ExercismWeb::Routes::Sessions
- use ExercismWeb::Routes::Stats
- use ExercismWeb::Routes::Static
- use ExercismWeb::Routes::Account
- use ExercismWeb::Routes::Metadata
- use ExercismWeb::Routes::Exercises
- use ExercismWeb::Routes::Solutions
- use ExercismWeb::Routes::Comments
- use ExercismWeb::Routes::Teams
- use ExercismWeb::Routes::User
- use ExercismWeb::Routes::Errors
+
+ use Routes::Legacy
+ use Routes::Sessions
+ use Routes::Stats
+ use Routes::Static
+ use Routes::Account
+ use Routes::Metadata
+ use Routes::Exercises
+ use Routes::Solutions
+ use Routes::Comments
+ use Routes::Teams
+ use Routes::User
+ use Routes::Errors
end
end
|
Clean up namespaces a bit
|
diff --git a/completion_generator.rb b/completion_generator.rb
index abc1234..def5678 100644
--- a/completion_generator.rb
+++ b/completion_generator.rb
@@ -43,7 +43,8 @@ args = {}
function.css('arg').each_with_object(args) do |arg, args|
- args[arg['name'].to_sym] = arg['declared_type']
+ arg_name = (arg['name'] || arg['declared_type'].underscore[1] || arg['declared_type']).to_sym
+ args[arg_name] = arg['declared_type']
end
function_name = function['name']
|
Handle special case when function arg doesn't have a name
|
diff --git a/spec/formaggio/puma_config_spec.rb b/spec/formaggio/puma_config_spec.rb
index abc1234..def5678 100644
--- a/spec/formaggio/puma_config_spec.rb
+++ b/spec/formaggio/puma_config_spec.rb
@@ -5,7 +5,7 @@ @dummy_path ||= File.expand_path("../../dummy", __FILE__)
end
- it "returns correct settings based on config" do
+ it "returns correct settings based on config when not ssl" do
puma_config = PumaConfig.new('9292')
puma_config.port.should eq('9292')
puma_config.bind.should eq('tcp://127.0.0.1:9292')
@@ -13,5 +13,14 @@ puma_config.log.should eq("#{dummy_path}/log/puma-test-9292.log")
puma_config.scripts_path.should eq("#{dummy_path}/config/deploy/puma")
end
+
+ it "returns correct settings based on config when ssl" do
+ puma_config = PumaConfig.new('9292', ssl_enabled: true)
+ puma_config.port.should eq('9292')
+ puma_config.bind.should eq('ssl://127.0.0.1:9292')
+ puma_config.pid.should eq("#{dummy_path}/tmp/pids/puma-9292.pid")
+ puma_config.log.should eq("#{dummy_path}/log/puma-test-9292.log")
+ puma_config.scripts_path.should eq("#{dummy_path}/config/deploy/puma")
+ end
end
end
|
Add test for ssl puma
|
diff --git a/spec/gitlab/build/build_qa_spec.rb b/spec/gitlab/build/build_qa_spec.rb
index abc1234..def5678 100644
--- a/spec/gitlab/build/build_qa_spec.rb
+++ b/spec/gitlab/build/build_qa_spec.rb
@@ -14,7 +14,8 @@ it 'calls the git command' do
allow(Build::Info).to receive(:package).and_return("gitlab-ee")
allow(Build::Info).to receive(:gitlab_version).and_return("9.0.0")
- expect(described_class).to receive("system").with("git --git-dir=/tmp/gitlab.#{$PROCESS_ID}/.git --work-tree=/tmp/gitlab.#{$PROCESS_ID} checkout --quiet 9.0.0")
+ allow(Build::Check).to receive(:on_tag?).and_return(true)
+ expect(described_class).to receive("system").with("git --git-dir=/tmp/gitlab.#{$PROCESS_ID}/.git --work-tree=/tmp/gitlab.#{$PROCESS_ID} checkout --quiet v9.0.0")
Build::QA.checkout_gitlab_rails
end
end
|
Fix QA spec tests for checkout
|
diff --git a/spec/helpers/course_helper_spec.rb b/spec/helpers/course_helper_spec.rb
index abc1234..def5678 100644
--- a/spec/helpers/course_helper_spec.rb
+++ b/spec/helpers/course_helper_spec.rb
@@ -0,0 +1,21 @@+require 'rails_helper'
+
+describe CourseHelper, :type => :helper do
+ describe '.contribution_link' do
+ it "should return a link to a user's contributions page" do
+ user = build(:user)
+ link = contribution_link(user)
+ expect(link).to include('<a href=')
+ end
+ end
+
+ describe '.user_links' do
+ it "should return contrib links for multiples users" do
+ build(:user).save
+ build(:trained).save
+ links = user_links(User.all)
+ expect(links).to include('<a href=')
+ end
+ end
+
+end
|
Add test of CourseHelper methods.
|
diff --git a/spec/ruboty/adapters/shell_spec.rb b/spec/ruboty/adapters/shell_spec.rb
index abc1234..def5678 100644
--- a/spec/ruboty/adapters/shell_spec.rb
+++ b/spec/ruboty/adapters/shell_spec.rb
@@ -24,7 +24,7 @@
context "with `quit`" do
it "stops" do
- Readline.stub(readline: "exit")
+ Readline.stub(readline: "quit")
adapter.should_receive(:stop).and_call_original
adapter.run
end
|
Fix typo in the spec file
|
diff --git a/spec/todo/containers/queue_spec.rb b/spec/todo/containers/queue_spec.rb
index abc1234..def5678 100644
--- a/spec/todo/containers/queue_spec.rb
+++ b/spec/todo/containers/queue_spec.rb
@@ -5,4 +5,25 @@ before(:each) do
@sut = Todo::Containers::Queue.new(2)
end
+
+ it('pops a value from the queue') do
+ expect {
+ @sut.pop!
+ }.to raise_error(RuntimeError, 'The queue is empty.')
+
+ @sut.push! 1
+ @sut.push! 2
+
+ expect(@sut.pop!).to eq(1)
+ expect(@sut.pop!).to eq(2)
+ end
+
+ it('returns the top element of the queue') do
+ expect(@sut.peek).to eq(nil)
+
+ @sut.push! 1
+ @sut.push! 2
+
+ expect(@sut.peek).to eq(1)
+ end
end
|
Cover all untested methods in Queue.
|
diff --git a/ruby/t/tc_display.rb b/ruby/t/tc_display.rb
index abc1234..def5678 100644
--- a/ruby/t/tc_display.rb
+++ b/ruby/t/tc_display.rb
@@ -0,0 +1,24 @@+require 'test/unit'
+require 'caca'
+
+class TC_Canvas < Test::Unit::TestCase
+ def test_create
+ d = Caca::Display.new
+ assert_not_nil(d, 'Display creation failed')
+ end
+ def test_create_with_driver
+ d = Caca::Display.new(nil, Caca::Display.driver_list[0])
+ assert_not_nil(d, 'Display creation failed')
+ end
+ def test_create_from_canvas
+ c = Cucul::Canvas.new(3, 3)
+ d = Caca::Display.new(c)
+ assert_not_nil(d, 'Display creation failed')
+ assert_equal(d.canvas, c, 'Wrong canvas')
+ end
+ def test_set_title
+ c = Cucul::Canvas.new(3, 3)
+ d = Caca::Display.new(c)
+ d.title = "Test !"
+ end
+end
|
Add few unit tests for Caca::Display
git-svn-id: 3f9eced0add15b5a9fa491ea3f7f263c10f60fd6@2297 92316355-f0b4-4df1-b90c-862c8a59935f
|
diff --git a/spec/features/geolocation_alert_spec.rb b/spec/features/geolocation_alert_spec.rb
index abc1234..def5678 100644
--- a/spec/features/geolocation_alert_spec.rb
+++ b/spec/features/geolocation_alert_spec.rb
@@ -16,7 +16,7 @@ button = page.find('.joined-link', match: :first)
button.click
click_on 'Create Hangout'
-
+ sleep 2
expect(page).to have_content 'Warning'
end
end
|
Complete test for geolocation error alert
|
diff --git a/spec/system/admin/admin_flashes_spec.rb b/spec/system/admin/admin_flashes_spec.rb
index abc1234..def5678 100644
--- a/spec/system/admin/admin_flashes_spec.rb
+++ b/spec/system/admin/admin_flashes_spec.rb
@@ -0,0 +1,33 @@+require 'rails_helper'
+
+RSpec.describe 'Admin Flashes', type: :system do
+ let(:user) { create(:user, admin: true) }
+
+ before do
+ sign_in(user)
+ end
+
+ context 'when creating a new admin flash' do
+ before do
+ visit new_admin_admin_flash_path
+ fill_in :admin_flash_message, with: 'Test Message'
+ fill_in :admin_flash_expires, with: '2022/01/01'
+ find_button('Create Admin flash').trigger("click")
+ end
+
+ it 'displays the flash title on the index page' do
+ visit admin_admin_flashes_path
+ expect(page).to have_content('Test Message')
+ end
+
+ it 'displays the flash date on the index page' do
+ visit admin_admin_flashes_path
+ expect(page).to have_content('January 01, 2022')
+ end
+
+ it 'displays the flash on the User Dashboard' do
+ visit dashboard_path
+ expect(page).to have_content('Test Message')
+ end
+ end
+end
|
Add system tests for Admin Flash
|
diff --git a/lib/reunion/rules/rules_reporter.rb b/lib/reunion/rules/rules_reporter.rb
index abc1234..def5678 100644
--- a/lib/reunion/rules/rules_reporter.rb
+++ b/lib/reunion/rules/rules_reporter.rb
@@ -8,7 +8,8 @@
def by_line_number(filename)
- Hash[@rules.map do |r|
+ by_lines = {}
+ @rules.each do |r|
trace = r.chain.last[:stacktrace].map{ |x|
x.match(/^(.+?):(\d+)(|:in `(.+)')$/);
[$1,$2,$4]
@@ -17,8 +18,10 @@ line_number = trace.find{|a| a[0].downcase.end_with?(filename.downcase)}[1]
matched_count = r.matched_transactions.uniq.count
- [line_number.to_i,matched_count]
- end]
+ by_lines[line_number.to_i] ||= []
+ by_lines[line_number.to_i] << matched_count
+ end
+ by_lines
end
def interpolate(text, filename)
@@ -27,8 +30,8 @@ new_text = ""
text.lines.each_with_index do |line, ix|
new_text << line.rstrip
- count = line_matches[ix + 1]
- new_text << "\t\# matched: #{count}" if count
+ counts = line_matches[ix + 1]
+ new_text << "\t\# matched: #{counts.join ', '}" if counts
new_text << "\n"
end
new_text
|
Add support for multiple rules per line.
|
diff --git a/spec/factories.rb b/spec/factories.rb
index abc1234..def5678 100644
--- a/spec/factories.rb
+++ b/spec/factories.rb
@@ -1,5 +1,6 @@ FactoryGirl.define do
factory :user do
+ # id 1
sequence(:username) { |n| "user#{n}"}
sequence(:email) {|n| "email#{n}@gmail.com" }
password "password"
@@ -16,13 +17,14 @@ factory :query do
sequence(:english) {|n| "Hello #{n}"}
title "Need help"
- user_id [1,2,3,4].sample
+ user_id 1
end
factory :comment do
sequence(:content) {|n| "Here is comment no. #{n}."}
commentable_id 1
commentable_type "Query"
+ user_id 1
end
end
|
Modify user_id call in query factory
|
diff --git a/spec/factories.rb b/spec/factories.rb
index abc1234..def5678 100644
--- a/spec/factories.rb
+++ b/spec/factories.rb
@@ -36,7 +36,7 @@ name "Bryan Ricker"
end
- factory :version, class: "Secretary::Version" do
+ factory :version, :class => "Secretary::Version" do
versioned { |v| v.association :story }
user
end
|
Switch to 1.8 hash syntax
|
diff --git a/lib/tty/prompt/answers_collector.rb b/lib/tty/prompt/answers_collector.rb
index abc1234..def5678 100644
--- a/lib/tty/prompt/answers_collector.rb
+++ b/lib/tty/prompt/answers_collector.rb
@@ -37,8 +37,14 @@ self
end
+ # Change to collect all values for a key
+ #
+ # @example
+ # key(:colors).values.ask('Color?')
+ #
+ # @api public
def values(&block)
- @answers[@name] = @answers.key?(@name) ? [*@answers[@name]] : []
+ @answers[@name] = Array(@answers[@name])
if block
answer = create_collector.call(&block)
add_answer(answer)
|
Change to coerce values into array type
|
diff --git a/UINavigationControllerWithCompletionBlock.podspec b/UINavigationControllerWithCompletionBlock.podspec
index abc1234..def5678 100644
--- a/UINavigationControllerWithCompletionBlock.podspec
+++ b/UINavigationControllerWithCompletionBlock.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |s|
s.name = 'UINavigationControllerWithCompletionBlock'
- s.version = '0.0.6'
+ s.version = '0.0.7'
s.requires_arc = true
s.author = {
'Morissard Jérome' => 'morissardj@gmail.com'
@@ -11,7 +11,7 @@ s.homepage = 'https://github.com/leverdeterre/UINavigationControllerWithCompletionBlock'
s.source = {
:git => 'https://github.com/leverdeterre/UINavigationControllerWithCompletionBlock.git',
- :tag => '0.0.6'
+ :tag => '0.0.7'
}
s.source_files = 'UINavigationControllerWithCompletionBlock/UINavigationControllerWithCompletionBlock/UINavigationControllerWithCompletionBlock/*'
s.dependency 'JRSwizzle', '~> 1.0'
|
FIX bad podspec version number
|
diff --git a/app/controllers/cotn_email_controller.rb b/app/controllers/cotn_email_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/cotn_email_controller.rb
+++ b/app/controllers/cotn_email_controller.rb
@@ -2,19 +2,17 @@
class CotnEmailController < ApplicationController
before_action :set_users
+ before_action :set_event
def new
@message = Message.new
- @message.subject = 'Call for Vols for MN-POP at Con of the North 2020'
+ @message.subject = 'Call for Vols for MN-POP at Con of the North 2023'
end
def create
return unless restrict_to_admin
@message = Message.new(message_params)
- # This is specific to CotN 2023
- # TODO: Make this a param, so that we can just reuse.
- @message.event = Event.find(20)
# defense, for a single real test
puts "Email list: #{@message.email_list}"
@@ -40,6 +38,12 @@ @users = User.where(opt_out: false).sort
end
+ def set_event
+ # This is specific to CotN 2023
+ # TODO: Make this a param, so that we can just reuse.
+ @message.event = Event.find(20)
+ end
+
def message_params
params.require(:message).permit!
end
|
Add a few tweaks to the cotn email process
|
diff --git a/app/controllers/supporters_controller.rb b/app/controllers/supporters_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/supporters_controller.rb
+++ b/app/controllers/supporters_controller.rb
@@ -7,12 +7,17 @@ def create
@price = params[:price]
- # TODO: Save customer to user
- customer = Stripe::Customer.create(
- email: params[:stripeEmail],
- card: params[:stripeToken],
- description: "Customer for @#{current_user.nickname}"
- )
+ if current_user.stripe_customer_id
+ # TODO: Handle missing or deleted customer
+ customer = Stripe::Customer.retrieve current_user.stripe_customer_id
+ else
+ customer = Stripe::Customer.create(
+ email: params[:stripeEmail],
+ card: params[:stripeToken],
+ description: "Customer for @#{current_user.nickname}"
+ )
+ current_user.update! stripe_customer_id: customer.id
+ end
# TODO: Use subscriptions
charge = Stripe::Charge.create(
|
Save Stripe customer to the user
And don't recreate it if we already have one.
|
diff --git a/app/services/persister/post_persister.rb b/app/services/persister/post_persister.rb
index abc1234..def5678 100644
--- a/app/services/persister/post_persister.rb
+++ b/app/services/persister/post_persister.rb
@@ -17,7 +17,13 @@ end
def update_attributes(params)
- post.update_attributes(params)
+ ::ActiveRecord::Base.transaction do
+ post.update_attributes!(params)
+ create_update_event!
+ post
+ end
+ rescue ActiveRecord::RecordInvalid => _exception
+ false
end
private
@@ -25,5 +31,9 @@ def create_save_event!
::Event.create! action: :created, post: post
end
+
+ def create_update_event!
+ ::Event.create! action: :updated, post: post
+ end
end
end
|
Create :updated event on Post update
|
diff --git a/app/controllers/api/votes_controller.rb b/app/controllers/api/votes_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/api/votes_controller.rb
+++ b/app/controllers/api/votes_controller.rb
@@ -12,7 +12,7 @@
private
- def visible_records
+ def accessible_records
load_and_authorize :motion
@motion.votes.most_recent.order(:created_at)
end
|
Fix errors for logged out angular votes
|
diff --git a/app/controllers/campaigns_controller.rb b/app/controllers/campaigns_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/campaigns_controller.rb
+++ b/app/controllers/campaigns_controller.rb
@@ -3,7 +3,7 @@ expose(:campaign, attributes: :campaign_params)
before_filter :authenticate_user!
- respond_to :html
+ respond_to :html, :json, :xml
def join
result = AddUserToCampaign.new(current_user, campaign).call
@@ -12,7 +12,6 @@ else
redirect_to @campaign, alert: "Couldn't join to campaign: #{result.error}"
end
-
end
def resign
@@ -22,7 +21,6 @@ else
redirect_to @campaign, alert: "Couldn't resign from this campaign #{result.error}"
end
-
end
def index
@@ -62,4 +60,4 @@ def campaign_params
params.require(:campaign).permit(:name, :description)
end
-end
+end
|
Add json and xml output in campaigns controller
|
diff --git a/app/controllers/employees_controller.rb b/app/controllers/employees_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/employees_controller.rb
+++ b/app/controllers/employees_controller.rb
@@ -1,6 +1,10 @@ class EmployeesController < ApplicationController
def index
@employees = Employee.all
+ end
+
+ def show
+ @employee = Employee.find(params[:id])
end
def new
@@ -17,8 +21,29 @@ end
end
+ def edit
+ @employee = Employee.find(params[:id])
+ end
+
+ def update
+ @employee = Employee.find(params[:id])
+
+ if @employee.update(employee_params)
+ redirect_to @employee
+ else
+ render action: 'new'
+ end
+ end
+
+ def destroy
+ @employee = Employee.find(params[:id])
+ @employee.destroy
+
+ redirect_to employees_path
+ end
+
private
-
+
def employee_params
params.require(:employee).permit(:name, :contact, :search, :salary)
end
|
Add show, update & destroy actions
|
diff --git a/event_store-client-http.gemspec b/event_store-client-http.gemspec
index abc1234..def5678 100644
--- a/event_store-client-http.gemspec
+++ b/event_store-client-http.gemspec
@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
s.name = 'event_store-client-http'
s.summary = 'HTTP Client for EventStore'
- s.version = '0.1.2'
+ s.version = '0.1.3'
s.authors = ['']
s.require_paths = ['lib']
s.files = Dir.glob('{lib}/**/*')
|
Increment version⇒ 0.1.3 enabling setting override
|
diff --git a/app/controllers/api/public/channels_controller.rb b/app/controllers/api/public/channels_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/api/public/channels_controller.rb
+++ b/app/controllers/api/public/channels_controller.rb
@@ -13,7 +13,7 @@ end
def timestamp
- latest_updated_at = Rails.cache.fetch("last_updated_channel_timestamp", expires_in: 10.seconds) do
+ latest_updated_at = Rails.cache.fetch("last_updated_channel_timestamp", expires_in: 10.minutes) do
# (Albert Wang): To satisfy backwards compatibility in Ledger's v3.timestamp
Channel.maximum("updated_at").to_i << 32
end
|
Set a cache time for 10 minutes. We might change this later, but this shouldn't be noticeable to the user
|
diff --git a/app/controllers/forem/admin/members_controller.rb b/app/controllers/forem/admin/members_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/forem/admin/members_controller.rb
+++ b/app/controllers/forem/admin/members_controller.rb
@@ -1,18 +1,19 @@ module Forem
- class Admin::MembersController < ApplicationController
+ module Admin
+ class MembersController < BaseController
+ def create
+ user = Forem.user_class.where(Forem.autocomplete_field => params[:user]).first
+ unless group.members.exists?(user.id)
+ group.members << user
+ end
+ render :status => :ok
+ end
- def create
- user = Forem.user_class.where(Forem.autocomplete_field => params[:user]).first
- unless group.members.exists?(user.id)
- group.members << user
+ private
+
+ def group
+ @group ||= Forem::Group.find(params[:group_id])
end
- render :status => :ok
- end
-
- private
-
- def group
- @group ||= Forem::Group.find(params[:group_id])
end
end
end
|
Fix MembersController inherited class to be Forem::Admin::BaseController
|
diff --git a/app/overrides/add_return_requests_to_admin_tab.rb b/app/overrides/add_return_requests_to_admin_tab.rb
index abc1234..def5678 100644
--- a/app/overrides/add_return_requests_to_admin_tab.rb
+++ b/app/overrides/add_return_requests_to_admin_tab.rb
@@ -3,7 +3,7 @@ name: 'add_return_requests_to_admin_tab',
insert_top: '[data-hook="admin_tabs"]',
text: '
- <li class="tab-with-icon <%= params[:controller] == "spree/admin/return_requests" ? "selected" : "" %>">
+ <li class="tab-with-icon <%= params[:controller] == "spree/admin/return_requests" ? "selected" : "" %>" data-hook="return-requests-admin-tab">
<%= link_to admin_return_requests_path, class: "icon_link with-tip icon-ambulance return_requests" do %>
<span class="text">Return Requests</span>
<% end %>
|
Add data hook to admin tab for easy hookin'
|
diff --git a/test/unit/wdpa/importer_test.rb b/test/unit/wdpa/importer_test.rb
index abc1234..def5678 100644
--- a/test/unit/wdpa/importer_test.rb
+++ b/test/unit/wdpa/importer_test.rb
@@ -13,6 +13,7 @@ Wdpa::SourceImporter.expects(:import).with(wdpa_release).in_sequence(import)
Wdpa::ProtectedAreaImporter.expects(:import).with(wdpa_release).in_sequence(import)
Wdpa::NetworkImporter.expects(:import).in_sequence(import)
+ Wdpa::OverseasTerritoriesImporter.expects(:import).in_sequence(import)
Wdpa::GreenListImporter.expects(:import).in_sequence(import)
Wdpa::MarineStatsImporter.expects(:import).in_sequence(import)
|
Add OverseasTerritoriesImporter to importer test
|
diff --git a/app/representers/account_representer.rb b/app/representers/account_representer.rb
index abc1234..def5678 100644
--- a/app/representers/account_representer.rb
+++ b/app/representers/account_representer.rb
@@ -4,6 +4,7 @@ include Roar::JSON
include Roar::JSON::HAL
+ property :id
property :has_payment_account
link :payment_portal do
|
Add id to account representer.
|
diff --git a/bashcov.gemspec b/bashcov.gemspec
index abc1234..def5678 100644
--- a/bashcov.gemspec
+++ b/bashcov.gemspec
@@ -18,6 +18,8 @@ gem.executables = gem.files.grep(%r{\Abin/}).map { |f| File.basename(f) }
gem.require_paths = ["lib"]
+ gem.required_ruby_version = ">= 2.0.0"
+
gem.add_dependency "simplecov", "~> 0.11"
gem.add_development_dependency "rake"
|
Make sure nobody tries to install Bashcov on obsolete Rubies
[References #19]
|
diff --git a/lib/dock_test/dsl.rb b/lib/dock_test/dsl.rb
index abc1234..def5678 100644
--- a/lib/dock_test/dsl.rb
+++ b/lib/dock_test/dsl.rb
@@ -13,7 +13,7 @@
ARGV.clear # clear ARGV as it is used by Rack to configure server
- server = WEBrick::HTTPServer.new(:Port => port).tap do |server|
+ server = WEBrick::HTTPServer.new(:Port => port, AccessLog: []).tap do |server|
server.mount '/', Rack::Handler::WEBrick, Rack::Server.new.app
end
@server_thread = Thread.new { server.start }
|
Disable Webrick's access log to make tests quieter
|
diff --git a/spec/integration/member/update!_spec.rb b/spec/integration/member/update!_spec.rb
index abc1234..def5678 100644
--- a/spec/integration/member/update!_spec.rb
+++ b/spec/integration/member/update!_spec.rb
@@ -0,0 +1,18 @@+# require 'spec_helper'
+
+# RSpec.describe 'Trell::Member.update!' do
+# include IntegrationHelpers
+
+# before { setup_trello }
+
+# it 'can update! a member' do
+# VCR.use_cassette('can_success_update_bong_a_member') do
+# member = Trello::Member.find('hoppertest')
+# member.bio = 'test'
+# member.update!
+
+# member = Trello::Member.find('hoppertest')
+# expect(member.bio).to eq('test')
+# end
+# end
+# end
|
Add comment out tests for Trello::Member.update!
Current trello update API return permission require message. Maybe, we can try it in future
|
diff --git a/app/uploaders/content_image_uploader.rb b/app/uploaders/content_image_uploader.rb
index abc1234..def5678 100644
--- a/app/uploaders/content_image_uploader.rb
+++ b/app/uploaders/content_image_uploader.rb
@@ -4,7 +4,7 @@ storage :file
def filename
- @name ||= "#{secure_token}.#{file.extension.downcase}" if original_filename
+ @name ||= "#{secure_token}-#{model.id}.#{file.extension.downcase}" if original_filename
end
private
@@ -16,7 +16,8 @@ end
def store_dir
- "uploads/#{model.class.to_s.underscore.pluralize}/#{mounted_as}/#{model.id}"
+ main_dir = Digest::MD5.hexdigest(model.id.to_s)[0,2]
+ "uploads/flexible_content/images/#{main_dir}"
end
def extension_white_list
|
Change where content images are saved.
|
diff --git a/rack-transform.gemspec b/rack-transform.gemspec
index abc1234..def5678 100644
--- a/rack-transform.gemspec
+++ b/rack-transform.gemspec
@@ -16,7 +16,7 @@ s.files = Dir["{lib}/**/*", "MIT-LICENSE", "README.md"]
s.test_files = Dir["spec/**/*"]
- s.add_dependency "rack", "~> 1.5", ">= 1.5.0"
+ s.add_dependency "rack", ">= 1.5.0", "< 3.0"
s.add_development_dependency "rake"
s.add_development_dependency "rspec", "~> 3.2", ">= 3.2.0"
|
Update rack requirement from >= 1.5.0, ~> 1.5 to >= 1.5.0, < 3.0
Updates the requirements on [rack](https://github.com/rack/rack) to permit the latest version.
- [Release notes](https://github.com/rack/rack/releases)
- [Changelog](https://github.com/rack/rack/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rack/rack/commits/2.0.5)
Signed-off-by: dependabot[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>
|
diff --git a/lib/pugbot/timers.rb b/lib/pugbot/timers.rb
index abc1234..def5678 100644
--- a/lib/pugbot/timers.rb
+++ b/lib/pugbot/timers.rb
@@ -9,7 +9,7 @@ # @return <Cinch::Timer> The timer that has just been created.
# @see Game.timeout
def timer_game_end(game)
- Timer(15, shots: 1) { game.timeout }
+ Timer(FINISH_TIMEOUT, shots: 1) { game.timeout }
end
end
end
|
Use finish_timeout constant rather than 15s in timer_game_end
|
diff --git a/lib/anemone/storage.rb b/lib/anemone/storage.rb
index abc1234..def5678 100644
--- a/lib/anemone/storage.rb
+++ b/lib/anemone/storage.rb
@@ -18,7 +18,7 @@ self::TokyoCabinet.new(file)
end
- def self.KyotoCabinet(file = 'anemone.tch')
+ def self.KyotoCabinet(file = 'anemone.kch')
require 'anemone/storage/kyoto_cabinet'
self::KyotoCabinet.new(file)
end
|
Fix default filename extension for the kyotocabinet adapter.
|
diff --git a/lib/asset_hat/tasks.rb b/lib/asset_hat/tasks.rb
index abc1234..def5678 100644
--- a/lib/asset_hat/tasks.rb
+++ b/lib/asset_hat/tasks.rb
@@ -4,7 +4,7 @@ namespace :asset_hat do
desc 'Minifies all CSS and JS bundles'
- task :minify, :needs => :environment do
+ task :minify, [] => :environment do
format = ENV['FORMAT']
print 'Minifying CSS/JS...'
puts unless format == 'dot'
|
Fix another deprecated rake syntax after move to rake 0.9
|
diff --git a/database_yml_storage.rb b/database_yml_storage.rb
index abc1234..def5678 100644
--- a/database_yml_storage.rb
+++ b/database_yml_storage.rb
@@ -0,0 +1,32 @@+module Moltrio
+ module Config
+
+ class DatabaseYmlStorage < Storage
+ attr_reader :real_storage, :environment
+
+ def initialize(storage, environment: RAILS_ENV)
+ @real_storage = storage
+ @environment = environment
+ end
+
+ def [](key)
+ real_storage[transform_key(key)]
+ end
+
+ def []=(key, value)
+ real_storage[transform_key(key)] = value
+ end
+
+ def has_key?(key)
+ real_storage.has_key?(transform_key(key))
+ end
+
+ private
+
+ def transform_key(key)
+ key.sub(/^database_yml/, environment)
+ end
+ end
+
+ end
+end
|
Remove the database.yml hack; Make it possible to not have a database.yml
|
diff --git a/lib/tasks/setup.rake b/lib/tasks/setup.rake
index abc1234..def5678 100644
--- a/lib/tasks/setup.rake
+++ b/lib/tasks/setup.rake
@@ -13,11 +13,11 @@ raise "You should provide a valid password" if ENV['PASSWORD'].nil? || ENV['PASSWORD'].empty?
raise "You should provide a valid subdomain" if ENV['SUBDOMAIN'].nil? || ENV['SUBDOMAIN'].empty?
u = User.new
- u.email = ENV['email']
- u.password = ENV['password']
- u.password_confirmation = ENV['password']
- u.subdomain = ENV['subdomain']
- u.username = ENV['subdomain']
+ u.email = ENV['EMAIL']
+ u.password = ENV['PASSWORD']
+ u.password_confirmation = ENV['PASSWORD']
+ u.subdomain = ENV['SUBDOMAIN']
+ u.username = ENV['SUBDOMAIN']
u.save
if u.new?
raise u.errors.inspect
|
Use upcase environment variable names
|
diff --git a/lib/tl_ember_edit.rb b/lib/tl_ember_edit.rb
index abc1234..def5678 100644
--- a/lib/tl_ember_edit.rb
+++ b/lib/tl_ember_edit.rb
@@ -1,4 +1,16 @@ require "tl_ember_edit/engine"
module TlEmberEdit
+
+ # Override these settings in an initializer or your application.rb
+
+ # The editor command. 'FILENAME' will be replaced by the actual file name.
+ # EDIT_CMD = "vim FILENAME"
+ # EDIT_CMD = "emacs FILENAME"
+ # EDIT_CMD = "mate FILENAME"
+ EDIT_CMD = "subl FILENAME"
+
+ EMBER_ROOT = "app/assets/javascripts"
+ VIEWS_DIR = "views"
+
end
|
Add a few default settings
|
diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb
index abc1234..def5678 100644
--- a/spec/rails_helper.rb
+++ b/spec/rails_helper.rb
@@ -4,6 +4,7 @@ require 'spec_helper'
require 'rspec/rails'
require "capybara/rspec"
+ActiveRecord::Migration.maintain_test_schema!
RSpec.configure do |config|
config.fixture_path = "#{::Rails.root}/spec/fixtures"
config.use_transactional_fixtures = true
|
Add Maintain Test Schema Test
|
diff --git a/app/jobs/feed_job.rb b/app/jobs/feed_job.rb
index abc1234..def5678 100644
--- a/app/jobs/feed_job.rb
+++ b/app/jobs/feed_job.rb
@@ -1,12 +1,13 @@-# To create outside of Rails, insert into the `delayed_jobs` table:
+# To create outside of Rails, insert a row with values for the following columns
+# into the `delayed_jobs` table:
#
# handler: {see example.yml}
# run_at: {current_time}
#
-# Note: raw_message for the handler must have line endings "\n"
-# To run delayed_jobs see e.g.
-# http://blog.andolasoft.com/2013/04/4-simple-steps-to-implement-delayed-job-in-rails.html
-# in devel use rake jobs:work
+# Notes:
+#
+# - the key `raw_message` for the `handler` column must have line endings "\n"
+# - to run delayed_jobs see in development use rake jobs:work
#
PathologyFeedJob = Struct.new(:raw_message) do
def perform
|
Clarify comments for feed job
|
diff --git a/lib/virus_scanner.rb b/lib/virus_scanner.rb
index abc1234..def5678 100644
--- a/lib/virus_scanner.rb
+++ b/lib/virus_scanner.rb
@@ -6,8 +6,6 @@ # to either clamscan or clamdscan
class VirusScanner
class Error < StandardError; end
-
- # Used for sending exception notices on infection
class InfectedFile < StandardError; end
def scan(file_path)
|
Remove unnecessary comment from VirusScanner class
Now that we are explicitly handling VirusScanner::InfectedFile
exceptions in VirusScanWorker#perform, I think this comment is less
useful and just clutters up the code.
|
diff --git a/lib/map.rb b/lib/map.rb
index abc1234..def5678 100644
--- a/lib/map.rb
+++ b/lib/map.rb
@@ -6,6 +6,8 @@ 32, 32, false)
get_lines(mapfile)
+ get_map_width
+ get_map_height
end
def get_lines(file)
|
Call width and height methods in initialize
|
diff --git a/tasks/db.rake b/tasks/db.rake
index abc1234..def5678 100644
--- a/tasks/db.rake
+++ b/tasks/db.rake
@@ -15,6 +15,7 @@ require 'yaml'
puts "Removing database #{db_file}"
FileUtils.rm_f db_file
+ FileUtils.mkdir_p File.dirname(db_file)
end
def db_file
|
Drop task now recreates tmp dir
|
diff --git a/lib/franklin/config.rb b/lib/franklin/config.rb
index abc1234..def5678 100644
--- a/lib/franklin/config.rb
+++ b/lib/franklin/config.rb
@@ -14,7 +14,7 @@
class << self
def from_yaml(yaml)
- self.new(YAML.load(yaml))
+ new(YAML.load(yaml))
end
def load_from_file(file_path = DEFAULT_CONFIG_FILE)
|
Remove unnecessary call to `self`
|
diff --git a/test/integration/users_login_test.rb b/test/integration/users_login_test.rb
index abc1234..def5678 100644
--- a/test/integration/users_login_test.rb
+++ b/test/integration/users_login_test.rb
@@ -0,0 +1,14 @@+require 'test_helper'
+
+class UsersLoginTest < ActionDispatch::IntegrationTest
+ test 'login with invalid information' do
+ get login_path
+ assert_template 'sessions/new'
+ post login_path, session: {email: '', password: ''}
+ assert_template 'sessions/new'
+ assert_not flash.empty?
+ # ensure flash doesn't persist for an extra pageload
+ get login_path
+ assert flash.empty?
+ end
+end
|
Add integration test for user login
|
diff --git a/app/helpers/admin/document_collection_helper.rb b/app/helpers/admin/document_collection_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/admin/document_collection_helper.rb
+++ b/app/helpers/admin/document_collection_helper.rb
@@ -1,7 +1,7 @@ module Admin::DocumentCollectionHelper
def document_collection_select_options(edition, user, selected_ids)
options = Rails.cache.fetch("document_collection_select_options", expires_in: 30.minutes) do
- DocumentCollection.alphabetical.map do |collection|
+ DocumentCollection.alphabetical.includes(:groups).flat_map do |collection|
collection.groups.map do |group|
["#{collection.title} (#{group.heading})", group.id]
end
|
Fix document collection membership in speed tagger
Also eager load document collection groups to avoid an N+1 query
|
diff --git a/test/simple_drilldown/helper_test.rb b/test/simple_drilldown/helper_test.rb
index abc1234..def5678 100644
--- a/test/simple_drilldown/helper_test.rb
+++ b/test/simple_drilldown/helper_test.rb
@@ -9,14 +9,14 @@
test 'subcaption blank' do
@search = Search.new({})
- assert_equal 'Simple Drilldown/Application Record Count', caption
+ assert_equal 'Application Record Count', caption
assert_equal '', subcaption
end
test 'subcaption with filter text' do
@search = Search.new({})
@filter_text = 'Subcaption'
- assert_equal 'Simple Drilldown/Application Record Count', caption
+ assert_equal 'Application Record Count', caption
assert_equal 'for Subcaption', subcaption
end
@@ -32,7 +32,7 @@ def controller
return @controller if @controller
- Controller.target_class ApplicationRecord
+ Controller.target_class ::ApplicationRecord
@controller = Controller.new
end
end
|
Use dummy app ApplicationRecord in test
|
diff --git a/app/models/concerns/scholarship/role_request.rb b/app/models/concerns/scholarship/role_request.rb
index abc1234..def5678 100644
--- a/app/models/concerns/scholarship/role_request.rb
+++ b/app/models/concerns/scholarship/role_request.rb
@@ -7,7 +7,7 @@
scope :order_by_user_full_name, -> do
joins(:user).
- select(table_name + '.*, CONCAT(users.first_name, " ", users.last_name) AS user_full_name').
+ select(table_name + ".*, CONCAT(users.first_name, ' ', users.last_name) AS user_full_name").
order('user_full_name ASC')
end
|
Handle weird postgresql string concat error.
|
diff --git a/lib/middleware/base.rb b/lib/middleware/base.rb
index abc1234..def5678 100644
--- a/lib/middleware/base.rb
+++ b/lib/middleware/base.rb
@@ -21,6 +21,7 @@ @exporter.start_tracker_segment(tracker_name)
end
+ # Called on tracker end
def end_tracker_segment
@exporter.end_tracker_segment
end
|
Add a meaningful comment for tracker end
|
diff --git a/lib/net_x/http_unix.rb b/lib/net_x/http_unix.rb
index abc1234..def5678 100644
--- a/lib/net_x/http_unix.rb
+++ b/lib/net_x/http_unix.rb
@@ -9,8 +9,11 @@ case address
when UNIX_REGEXP
@socket_type = 'unix'
- @address = address.sub(UNIX_REGEXP, '')
- @port = nil
+ @socket_path = address.sub(UNIX_REGEXP, '')
+ # Address and port are set to localhost so the HTTP client constructs
+ # a HOST request header nginx will accept.
+ @address = 'localhost'
+ @port = 80
else
@socket_type = 'inet'
end
@@ -28,8 +31,8 @@ # connect_unix is an alternative implementation of Net::HTTP#connect specific
# to the use case of using a Unix Domain Socket.
def connect_unix
- D "opening connection to #{conn_address()}..."
- s = timeout(@open_timeout) { UNIXSocket.open(conn_address()) }
+ D "opening connection to #{@socket_path}..."
+ s = timeout(@open_timeout) { UNIXSocket.open(@socket_path) }
D "opened"
@socket = BufferedIO.new(s)
@socket.read_timeout = @read_timeout
|
Fix incorrect HOST request header causing 400 errors
Without this patch nginx returns a 400 error response for requests that
otherwise are 200 OK over TCP connections. The specific error message
is:
2014/11/25 21:47:24 [info] 19036#0: *1 client sent invalid host
header while reading client request headers, client: unix:, server:
localhost, request: "POST /command-api HTTP/1.1", host:
"/var/run/command-api.sock:"
This patch addresses the problem by storing a valid hostname of
'localhost' in the @address instance variable rather than the socket
path. This change allows the HTTP client to construct a HOST request
header nginx will accept. The unix domain socket specific connection
method uses the @socket_path instance variable instead of relying on the
behavior of conn_address() which in turn used @address.
|
diff --git a/RxSugar.podspec b/RxSugar.podspec
index abc1234..def5678 100644
--- a/RxSugar.podspec
+++ b/RxSugar.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |s|
s.name = "RxSugar"
- s.version = "0.0.10"
+ s.version = "0.0.11"
s.summary = "Simple RxSwift extensions for interacting with Apple APIs"
s.description = <<-DESC
RxSugar adds simple UI extensions for interacting with Apple APIs, and includes custom operators.
@@ -24,5 +24,5 @@
s.requires_arc = true
- s.dependency "RxSwift", "~> 2.3"
+ s.dependency "RxSwift", "~> 3"
end
|
Update podspec to use most recent version of RxSwift
This will allow it to take advantage of swift 3
|
diff --git a/lib/wash_out/router.rb b/lib/wash_out/router.rb
index abc1234..def5678 100644
--- a/lib/wash_out/router.rb
+++ b/lib/wash_out/router.rb
@@ -10,7 +10,10 @@ controller = @controller_name.constantize
soap_action = env['HTTP_SOAPACTION']
- soap_action.force_encoding('UTF-8')
+
+ # RUBY18 1.8 does not have force_encoding.
+ soap_action.force_encoding('UTF-8') if soap_action.respond_to? :force_encoding
+
soap_action.gsub!(/^\"(.*)\"$/, '\1')
env['wash_out.soap_action'] = soap_action
|
Add a 1.8 compatibility shim.
|
diff --git a/lib/billogram/resources/regional_sweden.rb b/lib/billogram/resources/regional_sweden.rb
index abc1234..def5678 100644
--- a/lib/billogram/resources/regional_sweden.rb
+++ b/lib/billogram/resources/regional_sweden.rb
@@ -1,5 +1,6 @@ module Billogram
class RegionalSweden < Resource
- attr_accessor :rotavdrag, :rotavdrag_personal_number, :rotavdrag_description, :reversed_vat
+ attr_accessor :rotavdrag, :rotavdrag_personal_number, :rotavdrag_description,
+ :reversed_vat, :rotavdrag_account
end
end
|
Add a field to regional sweden
|
diff --git a/lib/finite_machine/undefined_transition.rb b/lib/finite_machine/undefined_transition.rb
index abc1234..def5678 100644
--- a/lib/finite_machine/undefined_transition.rb
+++ b/lib/finite_machine/undefined_transition.rb
@@ -16,6 +16,14 @@ false
end
+ def same?(_)
+ false
+ end
+
+ def current?
+ false
+ end
+
def execute(*args)
raise UndefinedError, "No transition for: #{name}"
end
|
Change to mock out undefined transition.
|
diff --git a/lib/solidus_shipwire/response_decorator.rb b/lib/solidus_shipwire/response_decorator.rb
index abc1234..def5678 100644
--- a/lib/solidus_shipwire/response_decorator.rb
+++ b/lib/solidus_shipwire/response_decorator.rb
@@ -1,19 +1,19 @@-module SolidusShipwire::Response
- def resource
- body['resource'].with_indifferent_access
- end
+module SolidusShipwire
+ module ResponseDecorator
+ def resource
+ body['resource'].with_indifferent_access
+ end
- def to_sku_id_hashmap
- Hash[resource[:items].map do |v|
- [v[:resource][:sku], v[:resource][:id]]
- end]
- end
+ def to_sku_id_hashmap
+ Hash[resource[:items].map do |v|
+ [v[:resource][:sku], v[:resource][:id]]
+ end]
+ end
- def next?
- resource[:next].present?
- end
+ def next?
+ resource[:next].present?
+ end
+ Shipwire::Response.prepend self
end
end
-
-Shipwire::Response.prepend SolidusShipwire::Response
|
Improve module namespacing for ResponseDecorator
|
diff --git a/lib/tagooru.rb b/lib/tagooru.rb
index abc1234..def5678 100644
--- a/lib/tagooru.rb
+++ b/lib/tagooru.rb
@@ -10,11 +10,28 @@
include HTTParty
base_uri 'http://tagoo.ru'
- default_params :for => :audio
+ default_params :for => :audio, :key => '74d8940f'
+ headers 'Referer' => 'http://tagoo.ru/en/webmaster.php?mode=json_api'
+ format :plain
+
+ # override method from HTTParty to prevent cookies from overriding other
+ # header data (httparty 0.4.4)
+ def self.perform_request(http_method, path, options) #:nodoc:
+ Request.new(http_method, path, default_options.dup.merge(options)).perform
+ end
def self.search(query, page = 1)
- playlist = get '/en/search_playlist.php', :query => {:search => query, :page => page}
- Playlist.new(playlist).parse
+ response = get '/api_search.php', :query => {:search => query, :page => page, :seed => generate_seed}
+ data = Crack::JSON.parse(response.sub(/^.+= /, ''))
+ data['data'].map do |d|
+ Track.new d['title'], d['file_url']
+ end
+ end
+
+ # seed argument taken from search api
+ # http://tagoo.ru/script/api/search.js
+ def self.generate_seed
+ (rand * 100_000).to_i
end
def self.first(query, page = 1)
|
Replace playlist search with api search
Playlist search now requires authentication, so I'm replacing it with
the ajax api search. Currently I'm sending in the api key used in their
example on the documentation page, we'll see how long that lasts.
|
diff --git a/app/validators/variable_duplicates_validator.rb b/app/validators/variable_duplicates_validator.rb
index abc1234..def5678 100644
--- a/app/validators/variable_duplicates_validator.rb
+++ b/app/validators/variable_duplicates_validator.rb
@@ -6,7 +6,9 @@ class VariableDuplicatesValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
if options[:scope]
- scoped = value.group_by { |variable| Array(options[:scope]).map { |attr| variable.send(attr) } } # rubocop:disable GitlabSecurity/PublicSend
+ scoped = value.group_by do |variable|
+ Array(options[:scope]).map { |attr| variable.send(attr) } # rubocop:disable GitlabSecurity/PublicSend
+ end
scoped.each_value { |scope| validate_duplicates(record, attribute, scope) }
else
validate_duplicates(record, attribute, value)
|
Refactor outer anonymous function into a do block
|
diff --git a/attributes/default.rb b/attributes/default.rb
index abc1234..def5678 100644
--- a/attributes/default.rb
+++ b/attributes/default.rb
@@ -18,7 +18,7 @@ #
default['activemq']['mirror'] = 'https://repository.apache.org/content/repositories/releases/org/apache'
-default['activemq']['version'] = '5.9.1'
+default['activemq']['version'] = '5.11.1'
default['activemq']['home'] = '/opt'
default['activemq']['wrapper']['max_memory'] = '1024'
default['activemq']['wrapper']['useDedicatedTaskRunner'] = 'true'
|
Use the latest version of ActiveMQ
|
diff --git a/breaktime.gemspec b/breaktime.gemspec
index abc1234..def5678 100644
--- a/breaktime.gemspec
+++ b/breaktime.gemspec
@@ -8,7 +8,7 @@ gem.version = Breaktime::VERSION
gem.authors = ["Jon Cairns"]
gem.email = ["jon@joncairns.com"]
- gem.description = %q{Enforce screen breaks at regular intervals.}
+ gem.description = %q{Enforce screen breaks at regular intervals, when you want them}
gem.summary = %q{Breaktime}
gem.homepage = "https://github.com/joonty/breaktime"
|
Add a bit more to description of gem
|
diff --git a/vendor/plugins/somatics_generator/init.rb b/vendor/plugins/somatics_generator/init.rb
index abc1234..def5678 100644
--- a/vendor/plugins/somatics_generator/init.rb
+++ b/vendor/plugins/somatics_generator/init.rb
@@ -1,2 +1,3 @@ # Include hook code here
-require 'somatic_link_renderer'+raise "You Should install will_paginate gems or plugin" unless defined?(WillPaginate)
+require 'somatic_link_renderer'
|
Raise Error when Will Paginate Gems not installed.
|
diff --git a/spec_helper.rb b/spec_helper.rb
index abc1234..def5678 100644
--- a/spec_helper.rb
+++ b/spec_helper.rb
@@ -35,5 +35,6 @@ :operatingsystemrelease => possible_releases[dist_preferred],
:lsbdistid => 'Debian',
:lsbdistcodename => dist_preferred.capitalize,
+ :architecture => 'amd64',
}
end
|
Add a default architecture fact to stop tests failing.
We're moving to Puppet 4 (eventually) and enabling `strict_variables`
is one part of this. Adding this as a global default fixes issues in
a range of module tests.
|
diff --git a/app/models/github_user.rb b/app/models/github_user.rb
index abc1234..def5678 100644
--- a/app/models/github_user.rb
+++ b/app/models/github_user.rb
@@ -17,7 +17,7 @@ end
def to_param
- login.downcase
+ login
end
def github_client
|
Fix redirect loops for some github users
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.