diff stringlengths 65 26.7k | message stringlengths 7 9.92k |
|---|---|
diff --git a/app/overrides/add_recipient_list_to_products_show.rb b/app/overrides/add_recipient_list_to_products_show.rb
index abc1234..def5678 100644
--- a/app/overrides/add_recipient_list_to_products_show.rb
+++ b/app/overrides/add_recipient_list_to_products_show.rb
@@ -0,0 +1,37 @@+Deface::Override.new(:virtual_path => "spree/products/show",
+ :insert_after => "[data-hook='product_properties']",
+ :text => '<div data-hook="product_recipients">
+ <% if @product.recipients.any? %>
+ <h6 class="product-section-title"><%= t(\'recipients\')%></h6>
+ <table id="product-properties" class="table-display" data-hook>
+ <tbody>
+ <% @product.recipients.each do |recipient| %>
+ <% css_class = cycle(\'even\', \'odd\', :name => "recipients") %>
+ <tr class="<%= css_class %>">
+ <td><strong><%= recipient.name %></strong></td>
+ <td><%= recipient.description %></td>
+ </tr>
+ <% end %>
+ <% reset_cycle(\'recipients\') %>
+ </tbody>
+ </table>
+ <% end %>
+ </div>',
+ :name => "add_recipient_list_to_products_show")
+
+
+
+
+# <h6 class="product-section-title"><%= t('properties')%></h6>
+# <table id="product-properties" class="table-display" data-hook>
+# <tbody>
+# <% @product_properties.each do |product_property| %>
+# <% css_class = cycle('even', 'odd', :name => "properties") %>
+# <tr class="<%= css_class %>">
+# <td><strong><%= product_property.property.presentation %></strong></td>
+# <td><%= product_property.value %></td>
+# </tr>
+# <% end %>
+# <% reset_cycle('properties') %>
+# </tbody>
+# </table>
| Add recipients to product view
|
diff --git a/app/serializers/gobierto_people/person_serializer.rb b/app/serializers/gobierto_people/person_serializer.rb
index abc1234..def5678 100644
--- a/app/serializers/gobierto_people/person_serializer.rb
+++ b/app/serializers/gobierto_people/person_serializer.rb
@@ -8,9 +8,10 @@ :name,
:email,
:position,
- :positions,
- :positions_str,
- :positions_html,
+ :filtered_positions,
+ :filtered_positions_str,
+ :filtered_positions_html,
+ :filtered_positions_tooltip,
:bio,
:bio_url,
:avatar_url,
@@ -33,19 +34,27 @@ end
def position
- positions.first
+ filtered_positions.first&.name
end
- def positions
- charges[object.id]&.map(&:to_s) || []
+ def all_positions_html
+ object.historical_charges.reverse_sorted.join("<br>")
end
- def positions_html
- positions.map { |pos| "<span>#{pos}</span>" }.join
+ def filtered_positions
+ charges[object.id] || []
end
- def positions_str
- positions.join(" ")
+ def filtered_positions_html
+ filtered_positions.map { |pos| "<span>#{pos}</span>" }.join
+ end
+
+ def filtered_positions_tooltip
+ filtered_positions.join("<br>")
+ end
+
+ def filtered_positions_str
+ filtered_positions.join(" ")
end
def exclude_content_block_records?
@@ -55,7 +64,11 @@ private
def charges
- instance_options[:charges].presence || {}
+ instance_options[:charges].presence || charges_query
+ end
+
+ def charges_query
+ { object.id => object.historical_charges.between_dates(instance_options[:date_range_params]).with_department(instance_options[:department]).reverse_sorted }
end
def date_range_query
| Change person serializer to provide position data with filtered charges
|
diff --git a/rspec_testing.rb b/rspec_testing.rb
index abc1234..def5678 100644
--- a/rspec_testing.rb
+++ b/rspec_testing.rb
@@ -13,7 +13,7 @@ status = 1
end
conn = TCPSocket.new '127.0.0.1', 3030
- conn.puts %({"handlers": ["default"], "name": "#{test_name}", "output": "#{output}", "status": #{status} })
+ conn.puts %({"handlers": ["default"], "name": "#{test_name}", "output": #{output.to_json}, "status": #{status} })
conn.close
end
| Convert output string to JSON
|
diff --git a/db/migrate/20171010145123_remove_business_support_editions_and_support_objects.rb b/db/migrate/20171010145123_remove_business_support_editions_and_support_objects.rb
index abc1234..def5678 100644
--- a/db/migrate/20171010145123_remove_business_support_editions_and_support_objects.rb
+++ b/db/migrate/20171010145123_remove_business_support_editions_and_support_objects.rb
@@ -0,0 +1,49 @@+class RemoveBusinessSupportEditionsAndSupportObjects < Mongoid::Migration
+ def self.up
+ db = Mongoid::Clients.default
+
+ say_with_time "Removing business support editions from editions collection" do
+ editions = db[:editions]
+ editions.delete_many(_type: 'BusinessSupportEdition').deleted_count
+ end
+
+ say_with_time "Removing business support business sizes collection" do
+ business_support_business_sizes = db[:business_support_business_sizes]
+ business_support_business_sizes.drop()
+ end
+
+ say_with_time "Removing business support business types collection" do
+ business_support_business_types = db[:business_support_business_types]
+ business_support_business_types.drop()
+ end
+
+ say_with_time "Removing business support locations collection" do
+ business_support_locations = db[:business_support_locations]
+ business_support_locations.drop()
+ end
+
+ say_with_time "Removing business support purposes collection" do
+ business_support_purposes = db[:business_support_purposes]
+ business_support_purposes.drop()
+ end
+
+ say_with_time "Removing business support sectors collection" do
+ business_support_sectors = db[:business_support_sectors]
+ business_support_sectors.drop()
+ end
+
+ say_with_time "Removing business support stages collection" do
+ business_support_stages = db[:business_support_stages]
+ business_support_stages.drop()
+ end
+
+ say_with_time "Removing business support support types collection" do
+ business_support_support_types = db[:business_support_support_types]
+ business_support_support_types.drop()
+ end
+ end
+
+ def self.down
+ # this can't be undone
+ end
+end
| Remove all business support editions and supporting objects
We leave their artefacts as we'll use these later to make sure they're
properly turned into publishing-api redirects, but we don't need the
editions or other things to do this.
|
diff --git a/Typhoon.podspec b/Typhoon.podspec
index abc1234..def5678 100644
--- a/Typhoon.podspec
+++ b/Typhoon.podspec
@@ -6,11 +6,16 @@ spec.homepage = 'http://www.typhoonframework.org'
spec.author = { 'Jasper Blues, Robert Gilliam & Contributors' => 'jasper@appsquick.ly' }
spec.source = { :git => 'https://github.com/typhoon-framework/Typhoon.git', :tag => spec.version.to_s, :submodules => true }
+
+ spec.ios.deployment_target = '5.0'
+ spec.osx.deployment_target = '10.7'
+
spec.source_files = 'Source/**/*.{h,m}'
spec.ios.exclude_files = "Source/osx"
spec.osx.exclude_files = "Source/ios"
spec.libraries = 'z', 'xml2'
spec.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2' }
spec.requires_arc = true
+
spec.documentation_url = 'http://www.typhoonframework.org/docs/latest/api/'
end
| Add deployment targets to podspec.
|
diff --git a/lib/generators/authkit/templates/app/controllers/email_confirmation_controller.rb b/lib/generators/authkit/templates/app/controllers/email_confirmation_controller.rb
index abc1234..def5678 100644
--- a/lib/generators/authkit/templates/app/controllers/email_confirmation_controller.rb
+++ b/lib/generators/authkit/templates/app/controllers/email_confirmation_controller.rb
@@ -34,7 +34,7 @@ # lock the account.
def require_token
verifier = ActiveSupport::MessageVerifier.new(Rails.application.config.secret_key_base)
- valid = params[:token].present?
+ valid = params[:token].present? && current_user.confirmation_token.present?
valid = valid && verifier.send(:secure_compare, params[:token], current_user.confirmation_token)
valid = valid && !current_user.confirmation_token_expired?
deny_user("Invalid token", root_path) unless valid
| Make sure there is an expected confirmation
|
diff --git a/metadata.rb b/metadata.rb
index abc1234..def5678 100644
--- a/metadata.rb
+++ b/metadata.rb
@@ -1,7 +1,7 @@ name 'iis'
maintainer 'Chef Software, Inc.'
maintainer_email 'cookbooks@chef.io'
-license 'Apache 2.0'
+license 'Apache-2.0'
description 'Installs/Configures Microsoft Internet Information Services'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '5.1.0'
@@ -9,5 +9,4 @@ depends 'windows', '>= 2.0'
source_url 'https://github.com/chef-cookbooks/iis'
issues_url 'https://github.com/chef-cookbooks/iis/issues'
-
-chef_version '>= 12.1'
+chef_version '>= 12.1' if respond_to?(:chef_version)
| Fix compatibility with older Chef 12 clients
Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
|
diff --git a/metadata.rb b/metadata.rb
index abc1234..def5678 100644
--- a/metadata.rb
+++ b/metadata.rb
@@ -10,7 +10,7 @@ supports 'centos', '>= 6.0'
supports 'redhat', '>= 6.0'
supports 'debian', '~> 7.0'
-supports 'ubuntu', '>= 12.04'
+supports 'ubuntu', '>= 14.04'
supports 'windows'
source_url 'https://github.com/dhoer/chef-flywaydb' if respond_to?(:source_url)
| Drop support for Ubuntu 12.04
|
diff --git a/spec/models/appendable/reaction_spec.rb b/spec/models/appendable/reaction_spec.rb
index abc1234..def5678 100644
--- a/spec/models/appendable/reaction_spec.rb
+++ b/spec/models/appendable/reaction_spec.rb
@@ -0,0 +1,61 @@+# frozen_string_literal: true
+
+require "rails_helper"
+
+describe Appendable::Reaction do
+ let(:user) { FactoryBot.create(:user) }
+ let(:owner) { FactoryBot.create(:user) }
+ let(:parent) { FactoryBot.create(:answer, user: owner) }
+
+ before do
+ subject.content = "🙂"
+ subject.parent = parent
+ subject.user = user
+ end
+
+ describe "associations" do
+ it { should belong_to(:user) }
+ it { should belong_to(:parent) }
+ end
+
+ describe "after_create" do
+ context "owner is subscribed to the parent" do
+ before do
+ Subscription.subscribe(owner, parent)
+ end
+
+ it "should notify the parent's author" do
+ expect { subject.save }.to change { owner.notifications.count }.by(1)
+ end
+ end
+
+ it "should increment the user's smiled count" do
+ expect { subject.save }.to change { user.smiled_count }.by(1)
+ end
+
+ it "should increment the parent's smiled count" do
+ expect { subject.save }.to change { parent.smile_count }.by(1)
+ end
+ end
+
+ describe "before_destroy" do
+ context "owner has a notification for this reaction" do
+ before do
+ subject.save
+ Notification.notify(owner, subject)
+ end
+
+ it "should denotify the parent's author" do
+ expect { subject.destroy }.to change { owner.notifications.count }.by(-1)
+ end
+ end
+
+ it "should reduce the user's smiled count" do
+ expect { subject.destroy }.to change { user.smiled_count }.by(-1)
+ end
+
+ it "should reduce the parent's smiled count" do
+ expect { subject.destroy }.to change { parent.smile_count }.by(-1)
+ end
+ end
+end
| Add model tests for `Appendable::Reaction`
|
diff --git a/rspec_hue.gemspec b/rspec_hue.gemspec
index abc1234..def5678 100644
--- a/rspec_hue.gemspec
+++ b/rspec_hue.gemspec
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
Gem::Specification.new do |spec|
- spec.name = "rspec_hue"
+ spec.name = "rspec-hue"
spec.version = '0.1.0'
spec.authors = ["larskrantz"]
spec.email = ["lars.krantz@alaz.se"]
| Rename to rspec-hue, RSpec likes this better for some reason.
|
diff --git a/brakeman.gemspec b/brakeman.gemspec
index abc1234..def5678 100644
--- a/brakeman.gemspec
+++ b/brakeman.gemspec
@@ -9,7 +9,7 @@ s.homepage = "http://brakemanscanner.org"
s.files = ["bin/brakeman", "WARNING_TYPES", "FEATURES", "README.md"] + Dir["lib/**/*.rb"] + Dir["lib/brakeman/format/*.css"]
s.executables = ["brakeman"]
- s.add_dependency "activesupport", "~>2.2"
+ s.add_dependency "activesupport"
s.add_dependency "ruby2ruby", "~>1.2.4"
s.add_dependency "ruport", "~>1.6.3"
s.add_dependency "erubis", "~>2.6.5"
| Remove veresion restriction on activesupport
|
diff --git a/spec/controllers/grades_controller_spec.rb b/spec/controllers/grades_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/grades_controller_spec.rb
+++ b/spec/controllers/grades_controller_spec.rb
@@ -1,6 +1,11 @@ require 'rails_helper'
describe GradesController do
+ let(:teacher) { create(:teacher, :with_classrooms_students_and_activities) }
+ before do
+ session[:user_id] = teacher.id
+ end
+
it { should use_before_action :authorize! }
describe '#index' do
@@ -16,7 +21,7 @@ end
it 'should render the correct json' do
- get :tooltip, user_id: 1, completed: true, classroom_activity_id: ""
+ get :tooltip, user_id: teacher.id, completed: true, classroom_activity_id: ""
expect(response.body).to eq({concept_results: ["query result"], scores: ["query result"]}.to_json)
end
end
| Update grades controller test to account for timezone.
|
diff --git a/brochure.gemspec b/brochure.gemspec
index abc1234..def5678 100644
--- a/brochure.gemspec
+++ b/brochure.gemspec
@@ -14,7 +14,7 @@ s.add_dependency "rack", "~> 1.0"
s.add_dependency "tilt", "~> 1.1"
+ s.add_development_dependency "rake"
s.add_development_dependency "rack-test"
s.add_development_dependency "haml"
end
-
| Add rake as a dev dep
|
diff --git a/spec/models/forum_add_forum_wizard_spec.rb b/spec/models/forum_add_forum_wizard_spec.rb
index abc1234..def5678 100644
--- a/spec/models/forum_add_forum_wizard_spec.rb
+++ b/spec/models/forum_add_forum_wizard_spec.rb
@@ -0,0 +1,30 @@+require File.expand_path(File.dirname(__FILE__)) + "/../../../../../spec/spec_helper"
+
+require File.expand_path(File.dirname(__FILE__)) + '/../forum_test_helper'
+
+describe ForumAddForumWizard do
+
+ include ForumTestHelper
+
+ reset_domain_tables :forum_categories, :content_nodes, :content_types, :site_nodes, :page_paragraphs,:page_revisions
+
+ before(:each) do
+ @category = create_forum_category
+ end
+
+ it "should add the forum category to site" do
+ root_node = SiteVersion.default.root_node.add_subpage('tester')
+ wizard = ForumAddForumWizard.new(
+ :forum_category_id => @category.id,
+ :add_to_id => root_node.id,
+ :add_to_subpage => 'forums',
+ :forum_page_url => 'view',
+ :new_page_url => 'new'
+ )
+ wizard.add_to_site!
+
+ SiteNode.find_by_node_path('/forums').should_not be_nil
+ SiteNode.find_by_node_path('/forums/view').should_not be_nil
+ SiteNode.find_by_node_path('/forums/new').should_not be_nil
+ end
+end
| Add tests for forum wizard
|
diff --git a/spec/presenters/document_presenter_spec.rb b/spec/presenters/document_presenter_spec.rb
index abc1234..def5678 100644
--- a/spec/presenters/document_presenter_spec.rb
+++ b/spec/presenters/document_presenter_spec.rb
@@ -0,0 +1,94 @@+require 'ostruct'
+require 'spec_helper'
+
+describe DocumentPresenter do
+ subject { DocumentPresenter.new(document) }
+
+ let(:document) do
+ OpenStruct.new(title: document_title,
+ updated_at: document_updated_at,
+ details: document_details)
+ end
+
+ let(:document_title) { 'A Document' }
+ let(:document_updated_at) { 3.days.ago }
+ let(:document_details) { OpenStruct.new }
+
+ describe '#metadata' do
+ context 'with all attributes present' do
+ let(:document_details) do
+ OpenStruct.new(
+ market_sector: 'Energy',
+ case_type: 'Merger',
+ case_state: 'closed',
+ outcome_type: 'Referred',
+ )
+ end
+
+ specify do
+ subject.metadata.should == {
+ 'Market sector' => 'Energy',
+ 'Case type' => 'Merger',
+ 'Case state' => 'Closed',
+ 'Outcome type' => 'Referred',
+ }
+ end
+ end
+
+ context 'with outcome type blank' do
+ let(:document_details) do
+ OpenStruct.new(
+ market_sector: 'Energy',
+ case_type: 'Merger',
+ case_state: 'closed',
+ outcome_type: nil,
+ )
+ end
+
+ specify do
+ subject.metadata.should == {
+ 'Market sector' => 'Energy',
+ 'Case type' => 'Merger',
+ 'Case state' => 'Closed',
+ }
+ end
+ end
+ end
+
+ describe '#date_metadata' do
+ let(:document_updated_at) { DateTime.new(2014, 4, 1) }
+
+ context 'with all attributes present' do
+ let(:document_details) do
+ OpenStruct.new(
+ opened_date: Date.new(2013, 9, 1),
+ closed_date: Date.new(2014, 3, 1),
+ )
+ end
+
+ specify do
+ subject.date_metadata.should == {
+ 'Opened date' => Date.new(2013, 9, 1),
+ 'Closed date' => Date.new(2014, 3, 1),
+ 'Updated at' => DateTime.new(2014, 4, 1),
+ }
+ end
+ end
+
+ context 'with closed date blank' do
+ let(:document_details) do
+ OpenStruct.new(
+ opened_date: Date.new(2013, 9, 1),
+ closed_date: nil,
+ )
+ end
+
+ specify do
+ subject.date_metadata.should == {
+ 'Opened date' => Date.new(2013, 9, 1),
+ 'Updated at' => DateTime.new(2014, 4, 1),
+ }
+ end
+ end
+ end
+end
| Add spec for document presenter
Only testing the #metadata and #document_metadata methods here because
everything else is boring.
|
diff --git a/spec/sitemap_generator/interpreter_spec.rb b/spec/sitemap_generator/interpreter_spec.rb
index abc1234..def5678 100644
--- a/spec/sitemap_generator/interpreter_spec.rb
+++ b/spec/sitemap_generator/interpreter_spec.rb
@@ -5,7 +5,7 @@ # The interpreter doesn't have the URL helpers included for some reason, so it
# fails when adding links. That messes up later specs unless we reset the sitemap object.
after :all do
- SitemapGenerator::Sitemap = SitemapGenerator::LinkSet.new
+ SitemapGenerator::Sitemap.reset!
end
it "should find the config file if Rails.root doesn't end in a slash" do
@@ -13,10 +13,10 @@ Rails.expects(:root).returns(rails_root).at_least_once
lambda { SitemapGenerator::Interpreter.run }.should_not raise_exception(Errno::ENOENT)
end
-
+
it "should set the verbose option" do
SitemapGenerator::Interpreter.any_instance.expects(:instance_eval)
interpreter = SitemapGenerator::Interpreter.run(:verbose => true)
interpreter.instance_variable_get(:@linkset).verbose.should be_true
end
-end+end
| Use the reset! method in the interpreter spec |
diff --git a/spec/views/catalog/_form.html.haml_spec.rb b/spec/views/catalog/_form.html.haml_spec.rb
index abc1234..def5678 100644
--- a/spec/views/catalog/_form.html.haml_spec.rb
+++ b/spec/views/catalog/_form.html.haml_spec.rb
@@ -1,9 +1,16 @@+include Spec::Support::AutomationHelper
+
describe "catalog/_form.html.haml" do
before do
set_controller_for_view("catalog")
set_controller_for_view_to_be_nonrestful
@edit = {:new => {:available_catalogs => [], :available_dialogs => {}}}
- @sb = {:st_form_active_tab => "Basic"}
+ @sb = {:st_form_active_tab => "Basic", :trees => {:ot_tree => {:open_nodes => []}}, :active_tree => :ot_tree}
+ user = FactoryGirl.create(:user_with_group)
+ login_as user
+ create_state_ae_model(:name => 'LUIGI', :ae_class => 'CLASS1', :ae_namespace => 'A/B/C')
+ create_ae_model(:name => 'MARIO', :ae_class => 'CLASS3', :ae_namespace => 'C/D/E')
+ @automate_tree = TreeBuilderAeClass.new(:automate_tree, "automate", @sb)
end
it "Renders form when adding catalog bundle and st_prov_type is not set" do
| Correct specs that PR broke
|
diff --git a/or-tools.rb b/or-tools.rb
index abc1234..def5678 100644
--- a/or-tools.rb
+++ b/or-tools.rb
@@ -6,8 +6,9 @@ homepage "https://developers.google.com/optimization/"
head 'https://github.com/google/or-tools.git'
- url "https://github.com/google/or-tools/archive/v6.7.1.tar.gz"
- sha256 "c82c63a6c2b0913fe06b8d7ec2a4b42c54c1810d42c6350cf08a022915963793"
+ url "https://github.com/google/or-tools.git",
+ :tag => "v6.7.1",
+ :revision => "2e4c5b3617c433ab5ccdad6f5f5f7ccaa82adda7"
depends_on 'cmake' => :build
depends_on 'pkg-config' => :build
| Use git tag/revision instead of tarball
|
diff --git a/Casks/realm-browser.rb b/Casks/realm-browser.rb
index abc1234..def5678 100644
--- a/Casks/realm-browser.rb
+++ b/Casks/realm-browser.rb
@@ -1,10 +1,10 @@ cask 'realm-browser' do
- version '0.98.6'
- sha256 'a2d7be0985433239640416cb098db0f0812766bbeec3b6113e9a8557f1fc66f7'
+ version '0.101.0'
+ sha256 '2bda0e80feaa09d799822d0893498d697a159fe1393c6e426d9c01f61b09ca5d'
url "https://github.com/realm/realm-browser-osx/releases/download/#{version}/RealmBrowser#{version}.zip"
appcast 'https://github.com/realm/realm-browser-osx/releases.atom',
- checkpoint: 'b3cf66797d3469ee99ba6b8615d8cc53f583f44a893c5294bab98dd8d55a05bc'
+ checkpoint: '29539a7cfaea5e2c001b8e4d42a5430184493b5f5be8316225f04818f05b2e79'
name 'Realm Browser'
homepage 'https://github.com/realm/realm-browser-osx/'
license :apache
| Update Realm Browser to 0.101.0 |
diff --git a/ost.gemspec b/ost.gemspec
index abc1234..def5678 100644
--- a/ost.gemspec
+++ b/ost.gemspec
@@ -8,14 +8,7 @@ s.homepage = "http://github.com/soveran/ost"
s.license = "MIT"
- s.files = Dir[
- "LICENSE",
- "README.md",
- "Rakefile",
- "lib/**/*.rb",
- "*.gemspec",
- "test/*.*"
- ]
+ s.files = `git ls-files`.split("\n")
s.add_dependency "nest", "~> 1.0"
s.add_development_dependency "cutest", "~> 1.0"
| Use git to list required files.
|
diff --git a/shared_mustache.gemspec b/shared_mustache.gemspec
index abc1234..def5678 100644
--- a/shared_mustache.gemspec
+++ b/shared_mustache.gemspec
@@ -13,7 +13,7 @@ gem.homepage = ""
gem.add_dependency 'mustache', '~> 0.99.4'
- gem.add_dependency 'execjs', '~> 1.2.4'
+ gem.add_dependency 'execjs', '>= 1.2.4'
gem.add_development_dependency "gem_publisher", "~> 1.1.1"
| Allow newer versions of execjs
|
diff --git a/lib/jekyll/minibundle/mini_bundle_block.rb b/lib/jekyll/minibundle/mini_bundle_block.rb
index abc1234..def5678 100644
--- a/lib/jekyll/minibundle/mini_bundle_block.rb
+++ b/lib/jekyll/minibundle/mini_bundle_block.rb
@@ -24,7 +24,7 @@ file.markup
end
- def default_config
+ def self.default_config
{
'source_dir' => '_assets',
'destination_path' => 'assets/site',
@@ -36,7 +36,7 @@ private
def get_current_config(user_config, site)
- default_config.
+ MiniBundleBlock.default_config.
merge(user_config).
merge({ 'type' => @type, 'site_dir' => site.source })
end
| Define default config as a class instance method
|
diff --git a/examples/intersect-line.rb b/examples/intersect-line.rb
index abc1234..def5678 100644
--- a/examples/intersect-line.rb
+++ b/examples/intersect-line.rb
@@ -4,16 +4,17 @@ # 交線 発生サンプル
#
-tor = Prim::torus [], Vec::zdir, 30, 10, Math::PI * 2
-pln = Build::infplane [], [0.5, 0.3, 0.8].to_v.normal
-int_line = tor.section(pln)
+tor = Prim.torus [0, 0, 0], Vec.zdir, 30, 10, Math::PI * 2
+pln = Build.infplane [0, 0, 0], [0.5, 0.3, 0.8].to_v.normal
+int_curve = tor.section(pln)
faces = []
-int_line.explore(ShapeType::EDGE) do |e|
- w = Build::wire [e]
- faces << (Build::face w, true)
+int_curve.edges do |e|
+ w = Build.wire [e]
+ faces << (Build.face w, true)
end
-comp = Build::compound faces
-BRepIO::save comp, "int.brep"
-BRepIO::save tor, "torus.brep"
+comp = Build.compound faces
+BRepIO.save comp, "int.brep"
+BRepIO.save tor, "torus.brep"
+
| Fix the name of variable.
|
diff --git a/sorting/merge.rb b/sorting/merge.rb
index abc1234..def5678 100644
--- a/sorting/merge.rb
+++ b/sorting/merge.rb
@@ -0,0 +1,60 @@+require './merging/binary'
+module Sorting
+ # @abstract a Service that executes a MergeSort on any given list. Each item
+ # in the list must be comparable, ie. It must respond to and implement the
+ # Ruby comparison methods (:<, :<=, :==, :>=, :>, :<=>), at the very least
+ # they should implement the default :< used in the binary merge after the
+ # list has been split.
+ #
+ # @see
+ class Merge
+ # Splits an unsorted list up into multiple sorted lists
+ # (ie. single value list = sorted) and BinaryMerges them back into a
+ # single sorted list.
+ #
+ # @example Using Integers.
+ # Sorting::Merge.call [5, 3, 7, 3, 1, 4]
+ # #=> [1, 3, 3, 4, 5, 7]
+ #
+ # @example Using Strings.
+ # Sorting::Merge.call ['b', 'e', 'a', 'a', 'a', 'f']
+ # #=> ['a', 'a', 'a', 'b', 'e', 'f']
+ #
+ # @example Using custom comparable class instances.
+ # class TestCompare
+ # include Comparable
+ # attr_accessor :comp_val
+ #
+ # def initialize(val)
+ # @comp_val = val
+ # end
+ #
+ # def <=>(other)
+ # comp_cal <=> other.comp_val
+ # end
+ # end
+ #
+ # Sorting::Merge.call [TestCompare.new(4),
+ # TestCompare.new(2),
+ # TestCompare.new(3)]
+ # #=> [#<TestCompa...@comp_val=2>, #<Te...@comp_val=3>, #<...@comp_val=4>]
+ #
+ # @param list [Array] An unsorted list
+ # @param dir [Symbol] the direction to sort the list, defaults to :< for an
+ # ascending sort, pass :> if a descending sort is desired
+ #
+ # @return [Array] A sorted list
+ def self.call(list, dir = :<)
+ return list if list.length <= 1 # Already Sorted
+
+ left = []
+ right = []
+ list.each_with_index do |list_item, i|
+ receiver = i < (list.length / 2) ? :left : :right
+ binding.local_variable_get(receiver).send :<<, list_item
+ end
+
+ Merging::Binary.call call(left), call(right), dir
+ end
+ end
+end
| Change module / class naming and add documentation |
diff --git a/sr71.gemspec b/sr71.gemspec
index abc1234..def5678 100644
--- a/sr71.gemspec
+++ b/sr71.gemspec
@@ -22,4 +22,5 @@ s.add_dependency "em-http-request", "~> 1.0"
s.add_development_dependency "rspec", "~> 2.11.0"
+ s.add_development_dependency "rake", "~> 10.3"
end
| Add missing dev dependency on Rake
|
diff --git a/spec/models/spree/order_spec.rb b/spec/models/spree/order_spec.rb
index abc1234..def5678 100644
--- a/spec/models/spree/order_spec.rb
+++ b/spec/models/spree/order_spec.rb
@@ -3,16 +3,35 @@ describe Spree::Order do
describe '#update' do
context 'when a order is completed products are relates as algo bought' do
+ let(:order){ FactoryGirl.create :completed_order_with_totals, completed_at: nil}
+
before do
- @order = FactoryGirl.create :completed_order_with_totals
- @order.finalize!
- @products = @order.products
+ order.finalize!
+ @products = order.products
end
it 'gets all related products bought' do
product = @products.shift
expect(product.also_bought).to eq @products
end
+
+ it 'sets relation with count in one' do
+ expect(Spree::AlsoBought.all.map(&:count)).to eq [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
+ end
+ end
+
+ context 'when order is updated but also bought products were alredy processed' do
+ let(:order){ FactoryGirl.create :completed_order_with_totals, also_bought_processed: true, completed_at: nil}
+
+ before do
+ order.finalize!
+ @products = order.products
+ end
+
+ it 'does not relate products' do
+ product = @products.shift
+ expect(product.also_bought).to eq []
+ end
end
end
end
| Modify and add test to avoid duplicate also bought data
|
diff --git a/spec/squarespace/client_spec.rb b/spec/squarespace/client_spec.rb
index abc1234..def5678 100644
--- a/spec/squarespace/client_spec.rb
+++ b/spec/squarespace/client_spec.rb
@@ -2,4 +2,13 @@
describe Squarespace::Client do
+ test_configuration
+
+ let(:client) { Squarespace::Client.new }
+
+ context 'For the Squarespace Commerce API' do
+ it 'set the commerce api url' do
+ expect(client.commerce_url).to eq 'https://api.squarespace.com/0.1/commerce/orders'
+ end
+ end
end
| Test for commerce api url
|
diff --git a/src/block.rb b/src/block.rb
index abc1234..def5678 100644
--- a/src/block.rb
+++ b/src/block.rb
@@ -22,6 +22,9 @@ when 'right'
@x += 20;
end
+
+ @x %= 640
+ @y %= 480
end
def draw
| Add window bounders and behavior.
|
diff --git a/db/migrate/20170106122600_set_document_id_on_content_items.rb b/db/migrate/20170106122600_set_document_id_on_content_items.rb
index abc1234..def5678 100644
--- a/db/migrate/20170106122600_set_document_id_on_content_items.rb
+++ b/db/migrate/20170106122600_set_document_id_on_content_items.rb
@@ -1,4 +1,6 @@ class SetDocumentIdOnContentItems < ActiveRecord::Migration[5.0]
+ disable_ddl_transaction!
+
def up
Document.find_each do |doc|
ContentItem.where(content_id: doc.content_id, locale: doc.locale)
| Set document ids outside of a transaction
Since these can be safely re-attempted if this migration fails we'll run
this outside of a transaction and lesser the risk of deadlocks.
|
diff --git a/solid_assert.gemspec b/solid_assert.gemspec
index abc1234..def5678 100644
--- a/solid_assert.gemspec
+++ b/solid_assert.gemspec
@@ -15,7 +15,7 @@ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
spec.require_paths = ["lib"]
- spec.required_ruby_version = "~> 2.0"
+ spec.required_ruby_version = ">= 2.3"
spec.add_development_dependency "bundler", "~> 1.11"
spec.add_development_dependency "rake", "~> 10.5"
| Change required Ruby version to >= 2.3
|
diff --git a/Casks/font-menlo-powerline.rb b/Casks/font-menlo-powerline.rb
index abc1234..def5678 100644
--- a/Casks/font-menlo-powerline.rb
+++ b/Casks/font-menlo-powerline.rb
@@ -0,0 +1,7 @@+class FontMenloPowerline < Cask
+ url 'https://gist.github.com/raw/1627888/c4e92f81f7956d4ceaee11b5a7b4c445f786dd90/Menlo-ForPowerline.ttc.zip'
+ homepage 'https://powerline.readthedocs.org/en/latest/fontpatching.html'
+ version '6.1d8e1'
+ sha1 '9b317e7597c8acd5de2991175223eeb5cf694fde'
+ font 'Menlo-ForPowerline.ttc'
+end
| Add deps to install Powerline patched Menlo font
|
diff --git a/spec/kenny_g_spec.rb b/spec/kenny_g_spec.rb
index abc1234..def5678 100644
--- a/spec/kenny_g_spec.rb
+++ b/spec/kenny_g_spec.rb
@@ -1,33 +1,14 @@ require 'spec_helper'
require 'kenny_g'
-require 'kenny_g/errors'
require 'kenny_g/game_setup'
-require 'kenny_g/player'
describe KennyG do
let(:params) { { winning_score: 100, players: ['shelly'] } }
- let(:kenny_g) { KennyG.please_be_the_scorekeeper(params) }
- context '.please_be_the_scorekeeper' do
- it 'has a winning score' do
- expect(kenny_g.winning_score).to eq 100
- end
-
- context 'with no players' do
- let(:params) { { winning_score: 100, players: [] } }
- it 'raises an error' do
- expect{ KennyG.please_be_the_scorekeeper(params) }
- .to raise_error(Errors::WinningScoreError)
- end
- end
- end
-
- describe '#add_player' do
- let(:player_params) { { name: 'Esme' } }
- let(:expected_players) { [Scorekeeper::Player.new(player_params)] }
- it 'increments the players count' do
- expect{ kenny_g.add_player(player_params) }
- .to change{ kenny_g.players.size }.by 1
+ describe '.please_be_the_scorekeeper' do
+ it 'call the game setup' do
+ expect(GameSetup).to receive(:new).with(params)
+ described_class.please_be_the_scorekeeper(params)
end
end
end
| Modify spec to test only what the method does, and not reach through
service object
|
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
@@ -2,7 +2,7 @@
ENV['RAILS_ENV'] ||= 'test'
-require File.expand_path('../../config/environment', __FILE__)
+require File.expand_path('../dummy/config/environment.rb', __FILE__)
abort('The Rails environment is running in production mode!') if Rails.env.production?
| Fix rspec dummy app config path
|
diff --git a/spree_slider.gemspec b/spree_slider.gemspec
index abc1234..def5678 100644
--- a/spree_slider.gemspec
+++ b/spree_slider.gemspec
@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'spree_slider'
- s.version = '1.2.0'
+ s.version = '3.1.0'
s.summary = 'Spree Slider extension'
s.description = 'Adds a slider to the homepage'
s.required_ruby_version = '>= 1.8.7'
@@ -16,6 +16,6 @@ s.require_path = 'lib'
s.requirements << 'none'
- s.add_dependency 'spree_core', '>= 3.0.0.beta'
- s.add_dependency 'spree_backend', '>= 3.0.0.beta'
+ s.add_dependency 'spree_core', '>= 3.1.0.beta'
+ s.add_dependency 'spree_backend', '>= 3.1.0.beta'
end
| Bump version and spree dependencies
|
diff --git a/textalyze.rb b/textalyze.rb
index abc1234..def5678 100644
--- a/textalyze.rb
+++ b/textalyze.rb
@@ -8,6 +8,12 @@ counts
end
+def format_counts(counts)
+ counts.map do |item, count|
+ "#{item} - #{count}"
+ end.join("\n")
+end
+
if ARGV[0] == "test"
p item_counts([1,2,1,2,1]) == {1 => 3, 2 => 2}
p item_counts(["a","b","a","b","a","ZZZ"]) == {"a" => 3, "b" => 2, "ZZZ" => 1}
@@ -15,4 +21,9 @@ p item_counts(["hi", "hi", "hi"]) == {"hi" => 3}
p item_counts([true, nil, "dinosaur"]) == {true => 1, nil => 1, "dinosaur" => 1}
p item_counts(["a","a","A","A"]) == {"a" => 2, "A" => 2}
+
+ sample_items = ["a", "a", "a", "b", "b", "c"]
+
+ puts "The counts for #{sample_items} are..."
+ puts format_counts( item_counts(sample_items) )
end
| Print item counts with nice formatting; completes v0.1
format_counts() takes a hash of item/count pairs and returns a
pleasantly-formatted string for printing.
|
diff --git a/Casks/yed.rb b/Casks/yed.rb
index abc1234..def5678 100644
--- a/Casks/yed.rb
+++ b/Casks/yed.rb
@@ -1,6 +1,6 @@ cask :v1 => 'yed' do
- version '3.14.1'
- sha256 '1db07a4e108c13ed4e28ebec30d6acf4fe7b593a78ceeeed3e5a1c9d1132c512'
+ version '3.14.2'
+ sha256 '8d15d7bcc04ec5ab15f11934158ce97179642ba45a87b0b3bb15e8d712ce43ee'
url "https://www.yworks.com/products/yed/demo/yEd-#{version}_with-JRE8.dmg"
name 'yEd'
| Update cask yEd to latest version 3.14.2
|
diff --git a/railties/test/application/load_test.rb b/railties/test/application/load_test.rb
index abc1234..def5678 100644
--- a/railties/test/application/load_test.rb
+++ b/railties/test/application/load_test.rb
@@ -43,6 +43,13 @@ assert Rails.application.new.is_a?(Rails::Application)
end
+ # Passenger still uses AC::Dispatcher, so we need to
+ # keep it working for now
+ test "deprecated ActionController::Dispatcher still works" do
+ rackup
+ assert ActionController::Dispatcher.new.is_a?(Rails::Application)
+ end
+
test "the config object is available on the application object" do
rackup
assert_equal 'UTC', Rails.application.config.time_zone
| Put test in place for deprecated dispatcher
|
diff --git a/recipes/desktop_backgrounds_in_dropbox.rb b/recipes/desktop_backgrounds_in_dropbox.rb
index abc1234..def5678 100644
--- a/recipes/desktop_backgrounds_in_dropbox.rb
+++ b/recipes/desktop_backgrounds_in_dropbox.rb
@@ -0,0 +1,53 @@+ruby_block "Dropbox Backgrounds" do
+ block do
+ require 'plist'
+
+ def plist_path
+ "#{ENV['HOME']}/Library/Preferences/com.apple.desktop.plist"
+ end
+
+ def plist_to_hash
+ if File.exists?(plist_path)
+ `plutil -convert xml1 #{plist_path}`
+ Plist::parse_xml(plist_path)
+ else
+ Plist::parse_xml('<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict></dict></plist>')
+ end
+ end
+
+ def rotate_backgrounds_from(pictures_path, time_in_seconds)
+ {
+ "default" =>
+ {
+ "BackgroundColor" =>
+ [0.0, 0.250980406999588, 0.501960813999176],
+ "Change" => "TimeInterval",
+ "ChangePath" => pictures_path,
+ "ChangeTime" => time_in_seconds,
+ "DSKDesktopPrefPane" => {
+ "UserFolderPaths" => [
+ pictures_path
+ ]
+ },
+ "DrawBackgroundColor" => true,
+ "LastName" => Dir.glob(pictures_path).first,
+ "NewChangePath" => pictures_path,
+ "NoImage" => false,
+ "Placement" => "Crop",
+ "Random" => true,
+ }
+ }
+ end
+
+ Gem.clear_paths
+
+ desktop_plist = plist_to_hash
+ desktop_plist["Background"] = rotate_backgrounds_from("/Users/#{WS_USER}/Dropbox/Photos/Desktop", 1800)
+
+ File.open(plist_path, "w") do |f|
+ f << Plist::Emit.dump(desktop_plist)
+ end
+
+ `killall Dock`
+ end
+end | Move over Dropbox for rotated desktop images
|
diff --git a/Casks/intellij-idea-ce-eap.rb b/Casks/intellij-idea-ce-eap.rb
index abc1234..def5678 100644
--- a/Casks/intellij-idea-ce-eap.rb
+++ b/Casks/intellij-idea-ce-eap.rb
@@ -1,10 +1,19 @@ cask :v1 => 'intellij-idea-ce-eap' do
- version '141.1192.2'
- sha256 '18f8ecfa66e2e687cab6ddd844bde8996ecb54eb93279a8e8ce5e43a9aa6def3'
+ version '142.2491.4'
+ sha256 '280e852beecff74301ecd402aa07109e9387930693d9bfd6357fc327d401e776'
- url "http://download.jetbrains.com/idea/ideaIC-#{version}.dmg"
- homepage 'https://confluence.jetbrains.com/display/IDEADEV/IDEA+14.1+EAP'
+ url "https://download.jetbrains.com/idea/ideaIC-#{version}-custom-jdk-bundled.dmg"
+ name 'IntelliJ IDEA EAP :: CE'
+ homepage 'https://confluence.jetbrains.com/display/IDEADEV/IDEA+15+EAP'
license :apache
- app 'IntelliJ IDEA 14 CE EAP.app'
+ app 'IntelliJ IDEA 15 CE EAP.app'
+
+ zap :delete => [
+ '~/Library/Preferences/com.jetbrains.intellij.plist',
+ '~/Library/Application Support/IdeaIC15',
+ '~/Library/Preferences/IdeaIC15',
+ '~/Library/Caches/IdeaIC15',
+ '~/Library/Logs/IdeaIC15',
+ ]
end
| Update IntelliJ IDEA CE to EAP 15; version 142.2491.4.
|
diff --git a/lib/activeadmin_addons/support/input_helpers/input_methods.rb b/lib/activeadmin_addons/support/input_helpers/input_methods.rb
index abc1234..def5678 100644
--- a/lib/activeadmin_addons/support/input_helpers/input_methods.rb
+++ b/lib/activeadmin_addons/support/input_helpers/input_methods.rb
@@ -10,7 +10,6 @@ end
def valid_object
- # raise "blank object given" if @object.blank?
@object
end
@@ -23,7 +22,7 @@ end
def method_model
- object_class.reflect_on_association(association_name).try(:klass) ||
+ object_class.try(:reflect_on_association, association_name).try(:klass) ||
association_name.classify.constantize
end
| FIX for models without associations.
|
diff --git a/spec/oga/oga_spec.rb b/spec/oga/oga_spec.rb
index abc1234..def5678 100644
--- a/spec/oga/oga_spec.rb
+++ b/spec/oga/oga_spec.rb
@@ -33,7 +33,7 @@ end
it 'parses an HTML document using the SAX parser' do
- Oga.sax_parse_xml(@handler, '<link>')
+ Oga.sax_parse_html(@handler, '<link>')
@handler.name.should == 'link'
end
| Use sax_parse_html for HTML documents.
I suspect the only reason this test ever passed due to Racc's error handling.
Either way this was using the wrong method.
|
diff --git a/spec/url_for_spec.rb b/spec/url_for_spec.rb
index abc1234..def5678 100644
--- a/spec/url_for_spec.rb
+++ b/spec/url_for_spec.rb
@@ -1,7 +1,7 @@ require 'spec_helper'
require 'sinatra'
-require 'sinatra/test'
require 'sinatra/url_for'
+require 'rack/test'
get "/" do
content_type "text/plain"
@@ -13,11 +13,16 @@ end
describe Sinatra::UrlForHelper do
- include Sinatra::Test
+ include Rack::Test::Methods
+
+ def app
+ Sinatra::Application
+ end
+
it "should return absolute paths and full URLs" do
get "/"
- response.should be_ok
- response.body.should == <<EOD
+ last_response.should be_ok
+ last_response.body.should == <<EOD
/
/foo
http://example.org/foo
| Fix spec so it runs in today's Sinatra
|
diff --git a/attributes/default.rb b/attributes/default.rb
index abc1234..def5678 100644
--- a/attributes/default.rb
+++ b/attributes/default.rb
@@ -6,6 +6,7 @@ default['rvm']['default_ruby'] = 'ruby-1.9.3'
default['rvm']['user_installs'] = [
{ 'user' => 'jenkins',
+ 'home' => '/var/lib/jenkins',
'default_ruby' => 'ruby-1.9.3'
}
]
| Add explicit definition of homedir for jenkins
|
diff --git a/spec/cache/gems_spec.rb b/spec/cache/gems_spec.rb
index abc1234..def5678 100644
--- a/spec/cache/gems_spec.rb
+++ b/spec/cache/gems_spec.rb
@@ -18,6 +18,21 @@ it "uses the cache as a source when installing gems" do
system_gems []
bundle :install
+
+ should_be_installed("rack 1.0.0")
+ end
+
+ it "does not reinstall gems from the cache if they exist on the system" do
+ system_gems "rack-1.0.0"
+ build_gem "rack", "1.0.0", :path => bundled_app('vendor/cache') do |s|
+ s.write "lib/rack.rb", "RACK = 'FAIL'"
+ end
+
+ install_gemfile <<-G
+ gem "rack"
+ G
+
+ puts out
should_be_installed("rack 1.0.0")
end
| Make sure that gems are not reinstalled if they are packed and already on the system.
|
diff --git a/spec/factories/users.rb b/spec/factories/users.rb
index abc1234..def5678 100644
--- a/spec/factories/users.rb
+++ b/spec/factories/users.rb
@@ -7,7 +7,7 @@ last_name "My Last Name"
username 'user'
password 'my password'
- email 'email@email.eml'
+ email 'email@domain.eml'
practice_id 1
end
end | Change for testing TeamCity auto build after check-in
|
diff --git a/spec/support/profile.rb b/spec/support/profile.rb
index abc1234..def5678 100644
--- a/spec/support/profile.rb
+++ b/spec/support/profile.rb
@@ -0,0 +1,7 @@+# Frozen-string-literal: true
+# Copyright: 2015 Jordon Bedwell - MIT License
+# Encoding: utf-8
+
+RSpec.configure do |c|
+ c.profile_examples = true
+end
| Add some profiling so we can spot slow code and specs.
|
diff --git a/config/routes.rb b/config/routes.rb
index abc1234..def5678 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -5,9 +5,11 @@
# Search
match 'search', to: 'pages#search', via: [:get], defaults: { format: :json }, constraints: { format: :json }
+ match 'search', to: 'annotations#options', via: [:options], defaults: { format: :json }, constraints: { format: :json }
# Annotations Endpoint
resources :annotations, only: [:create, :show, :update, :destroy], defaults: { format: :json }, constraints: { format: :json } do
match '/', to: 'annotations#options', via: [:options], on: :collection
+ match '/', to: 'annotations#options', via: [:options], on: :member
end
end
| Create options responses for other endpoints
|
diff --git a/venn.gemspec b/venn.gemspec
index abc1234..def5678 100644
--- a/venn.gemspec
+++ b/venn.gemspec
@@ -8,8 +8,8 @@ spec.version = Venn::VERSION
spec.authors = ["Darren Cauthon"]
spec.email = ["darren@cauthon.com"]
- spec.description = %q{TODO: Write a gem description}
- spec.summary = %q{TODO: Write a gem summary}
+ spec.description = %q{Simple venn diagrams}
+ spec.summary = %q{Simple venn diagrams}
spec.homepage = ""
spec.license = "MIT"
| Add a description to the gemspec.
|
diff --git a/spec/adapter_spec.rb b/spec/adapter_spec.rb
index abc1234..def5678 100644
--- a/spec/adapter_spec.rb
+++ b/spec/adapter_spec.rb
@@ -37,7 +37,7 @@ end
context 'when response non standard' do
- let(:url) { 'http://www.google.com' }
+ let(:url) { 'https://httpstat.us/418' }
let(:adapter_response) {
VCR.use_cassette 'wrong_url' do
@@ -48,7 +48,7 @@ specify do
expect { adapter_response }.to raise_error(
QuickTravel::AdapterError,
- /That’s all we know/
+ /418 I'm a teapot/
)
end
end
| Update spec to not rely on google giving a specific response
|
diff --git a/spec/api/api_spec.rb b/spec/api/api_spec.rb
index abc1234..def5678 100644
--- a/spec/api/api_spec.rb
+++ b/spec/api/api_spec.rb
@@ -10,14 +10,9 @@ Sinatra::Application
end
-RSpec.configure do |config|
- config.treat_symbols_as_metadata_keys_with_true_values = true
- config.run_all_when_everything_filtered = true
- config.filter_run :focus
- config.include Rack::Test::Methods
-end
+describe "segmenter api" do
+ include Rack::Test::Methods
-describe "segmenter api" do
describe '/segment' do
context "with URI as input" do
it "responds to GET" do
| Include rack test methods in describe block instead of reconfiguring rspec.
|
diff --git a/spec/payload_spec.rb b/spec/payload_spec.rb
index abc1234..def5678 100644
--- a/spec/payload_spec.rb
+++ b/spec/payload_spec.rb
@@ -4,27 +4,27 @@ describe '.parse' do
it 'returns payload instance for github' do
payload = Magnum::Payload.parse('github', fixture('github.json'))
- payload.should be_a Magnum::Payload::Github
+ expect(payload).to be_a Magnum::Payload::Github
end
it 'returns payload instance for gitslice' do
payload = Magnum::Payload.parse('gitslice', fixture('gitslice.json'))
- payload.should be_a Magnum::Payload::Gitslice
+ expect(payload).to be_a Magnum::Payload::Gitslice
end
it 'returns payload instance for gitlab' do
payload = Magnum::Payload.parse('gitlab', fixture('gitlab/commits.json'))
- payload.should be_a Magnum::Payload::Gitlab
+ expect(payload).to be_a Magnum::Payload::Gitlab
end
it 'returns payload instance for bitbucket' do
payload = Magnum::Payload.parse('bitbucket', fixture('bitbucket/git.json'))
- payload.should be_a Magnum::Payload::Bitbucket
+ expect(payload).to be_a Magnum::Payload::Bitbucket
end
it 'returns payload instance for beanstalk' do
payload = Magnum::Payload.parse('beanstalk', fixture('beanstalk/git.json'))
- payload.should be_a Magnum::Payload::Beanstalk
+ expect(payload).to be_a Magnum::Payload::Beanstalk
end
it 'raises error if source is invalid' do
| Refactor payload class specs to use new matchers
|
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
@@ -21,6 +21,13 @@ PaperTrail.whodunnit = 'Test User'
end
+ config.around(:each, type: :feature) do |example|
+ original_adapter = ActiveJob::Base.queue_adapter
+ ActiveJob::Base.queue_adapter = :inline
+ example.run
+ ActiveJob::Base.queue_adapter = original_adapter
+ end
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
config.use_transactional_fixtures = true
config.infer_spec_type_from_file_location!
| Use inline adapter for feature specs
|
diff --git a/test/fixtures/policies/default.rb b/test/fixtures/policies/default.rb
index abc1234..def5678 100644
--- a/test/fixtures/policies/default.rb
+++ b/test/fixtures/policies/default.rb
@@ -1,9 +1,12 @@ name 'default'
-default_source :community
+default_source :supermarket
default_source :chef_repo, '..'
cookbook 'consul', path: '../../..'
run_list 'consul::default', "consul_spec::#{name}"
-named_run_list :centos, 'yum::default', 'yum-centos::default', 'sudo::default', run_list
+named_run_list :centos, 'sudo::default', run_list
named_run_list :debian, 'apt::default', run_list
named_run_list :freebsd, 'freebsd::default', 'sudo::default', run_list
named_run_list :windows, 'windows::default', run_list
+
+default['authorization']['sudo']['users'] = %w(kitchen vagrant)
+default['authorization']['sudo']['passwordless'] = true
| Enable passwordless sudo for test user on RHEL/CentOS
|
diff --git a/config/initializers/initialize_viking.rb b/config/initializers/initialize_viking.rb
index abc1234..def5678 100644
--- a/config/initializers/initialize_viking.rb
+++ b/config/initializers/initialize_viking.rb
@@ -1,3 +1,8 @@+# Sometimes Viking isn't loaded at this point, so we make sure it is here
+unless Object.const_defined?("Viking")
+ require Merb.root / 'lib' / 'viking' / 'viking'
+end
+
Merb::BootLoader.after_app_loads do
config_path = Merb.root / 'config' / 'spam_protection.yml'
| Fix a problem where Viking wasn't always loaded when the initializer was running
|
diff --git a/spec/workers/mark_vector_from_text_spec.rb b/spec/workers/mark_vector_from_text_spec.rb
index abc1234..def5678 100644
--- a/spec/workers/mark_vector_from_text_spec.rb
+++ b/spec/workers/mark_vector_from_text_spec.rb
@@ -5,11 +5,6 @@ let(:product) { Product.make! }
describe '#perform' do
- it 'test marking a user from text' do
- pending "Test depends on a downstream worker and class; add spies and test that they're called correctly ASAP"
- Mark.create!({name: "elrond"})
- sample_text = "elrond"
- MarkVectorFromText.new.perform(user.id, sample_text)
- end
+ it 'test marking a user from text'
end
end
| Fix failing test for good
No idea why Travis barfed on this
|
diff --git a/bin/dependencytree.rb b/bin/dependencytree.rb
index abc1234..def5678 100644
--- a/bin/dependencytree.rb
+++ b/bin/dependencytree.rb
@@ -0,0 +1,42 @@+require 'pp'
+require_relative 'docparser'
+
+$classes = parse_any_path 'src'
+
+def prefix lines
+ if lines.empty?
+ ''
+ else
+ lines.gsub(/^/, '- ')
+ end
+end
+
+def find_class klass_name
+ $classes.find{|c| c[:name] == klass_name }
+end
+
+def describe klass_name
+ out = []
+ out << klass_name
+ klass = find_class klass_name
+ if klass
+ if klass[:parent]
+ out.push prefix describe klass[:parent]
+ end
+ if klass[:mixins]
+ klass[:mixins].each do |mixin|
+ out.push prefix describe mixin
+ end
+ end
+ end
+ out.select{|a| !a.empty? }.join "\n"
+end
+
+$classes.sort_by!{|klass|
+ # sort by "type" first (widget/layout/element/etc.), then by name
+ klass[:name].split(/(?=Layout|Widget|Element|Dialog|Tool|Theme)/).reverse
+}
+
+$classes.each{|klass|
+ puts describe klass[:name]
+}
| Add a script to print the dependency tree of everything
The usefullness of this is limited, since it only takes into account
the documented inheritance and mixins, but not currently undocumented
composition (e.g. DropdownInputWidget using DropdownWidget).
Change-Id: I1f002ba37cb6abd388622638eeccc5aaf9a782a4
|
diff --git a/lib/treetop/compiler/node_classes/character_class.rb b/lib/treetop/compiler/node_classes/character_class.rb
index abc1234..def5678 100644
--- a/lib/treetop/compiler/node_classes/character_class.rb
+++ b/lib/treetop/compiler/node_classes/character_class.rb
@@ -4,7 +4,7 @@ def compile(address, builder, parent_expression = nil)
super
- builder.if__ "input.index(Regexp.new(#{single_quote(text_value)}), index) == index" do
+ builder.if__ "input.index(Regexp.new(#{grounded_regexp(text_value)}), index) == index" do
assign_result "instantiate_node(#{node_class_name},input, index...(index + 1))"
extend_result_with_inline_module
builder << "@index += 1"
@@ -14,6 +14,11 @@ assign_result 'nil'
end
end
+
+ def grounded_regexp(string)
+ # Double any backslashes, then backslash any single-quotes:
+ "'\\G#{string.gsub(/\\/) { '\\\\' }.gsub(/'/) { "\\'"}}'"
+ end
end
end
end
| Use \G to force Regexps to match only at the first position
|
diff --git a/spec/features/cdx/admin/login_spec.rb b/spec/features/cdx/admin/login_spec.rb
index abc1234..def5678 100644
--- a/spec/features/cdx/admin/login_spec.rb
+++ b/spec/features/cdx/admin/login_spec.rb
@@ -0,0 +1,26 @@+require 'rails_helper'
+
+RSpec.feature 'Login to admin dashboard', type: :feature do
+
+ let(:user) { create(:cdx_user, password: :feature) }
+
+ scenario 'User success to login' do
+ visit '/admin'
+
+ fill_in id: 'admin_user_email', with: user.email
+ fill_in id: 'admin_user_password', with: :feature
+
+ click_button
+
+ expect(page).to have_text('Dashboard')
+ end
+
+ scenario 'User fail to login' do
+ visit '/admin'
+
+ click_button
+
+ expect(page).to have_text('Invalid Email or password.')
+ end
+
+end | Add first feature spec as demo
|
diff --git a/spec/features/emo_states_list_spec.rb b/spec/features/emo_states_list_spec.rb
index abc1234..def5678 100644
--- a/spec/features/emo_states_list_spec.rb
+++ b/spec/features/emo_states_list_spec.rb
@@ -19,4 +19,14 @@ expect(current_path).to eq(emo_states_path)
end
+ it "user can see his emotion in the emotions list" do
+ within('#emo-state') do
+ choose('emo_state_emotion_happy')
+ fill_in "Comment", with: "I feel good"
+ click_button('Submit')
+ end
+
+ expect(page).to have_content('I feel good')
+ end
+
end
| Add test for user being able to see submitted emotion in the index page
|
diff --git a/spec/lib/course_alert_manager_spec.rb b/spec/lib/course_alert_manager_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/course_alert_manager_spec.rb
+++ b/spec/lib/course_alert_manager_spec.rb
@@ -7,7 +7,7 @@
describe CourseAlertManager do
describe '#create_no_students_alerts' do
- let(:course) { create(:course, timeline_start: 16.days.ago) }
+ let(:course) { create(:course, start: 16.days.ago, timeline_start: 16.days.ago, end: 1.month.from_now) }
let(:admin) { create(:admin, email: 'staff@wikiedu.org') }
let!(:courses_user) do
create(:courses_user,
| Tweak spec that failed on travis
|
diff --git a/spec/services/map_marker_json_spec.rb b/spec/services/map_marker_json_spec.rb
index abc1234..def5678 100644
--- a/spec/services/map_marker_json_spec.rb
+++ b/spec/services/map_marker_json_spec.rb
@@ -1,10 +1,11 @@ require 'rails_helper'
describe MapMarkerJson do
- let(:organisation) { double(:organisation) }
+ let(:organisation) { create(:organisation) }
+ let(:organisations) { Organisation.where(id: organisation) }
it do
- expect {|b| Gmaps4rails.build_markers([organisation], &b) }.to yield_control
+ expect {|b| Gmaps4rails.build_markers(organisations, &b) }.to yield_control
end
it 'yields the organisation and a marker' do
@@ -23,6 +24,6 @@ end
def _subject
- JSON.parse(described_class.build([organisation]) {|o,m| yield o,m })
+ JSON.parse(described_class.build(organisations) {|o,m| yield o,m })
end
end
| Change map_marker_json spec to use a relation of organisations
|
diff --git a/spec/nz_mps_popolo/extractor_spec.rb b/spec/nz_mps_popolo/extractor_spec.rb
index abc1234..def5678 100644
--- a/spec/nz_mps_popolo/extractor_spec.rb
+++ b/spec/nz_mps_popolo/extractor_spec.rb
@@ -1,7 +1,37 @@ require 'spec_helper'
+require 'support/mps'
+require 'support/null_logger'
describe NZMPsPopolo::Extractor do
subject { NZMPsPopolo::Extractor }
- it 'does not explode'
+ # There are a number of examples of MP pages with
+ # slight HTML variations. We will try to include
+ # the ones that cause our parser trouble to test against.
+ let(:mps) do
+ NZMPsPopolo::TestHelpers.sample_mps.map do |opts|
+ instance_double('NZMPsPopolo::MP', opts)
+ end
+
+ end
+
+ let(:options) do
+ mps.map do |mp|
+ VCR.use_cassette(mp.name.downcase.gsub(/[ |']/, '-')) do
+ { mp: mp, container: NZMPsPopolo::HTMLParser.new(mp: mp).container }
+ end
+ end
+ end
+
+ it 'does not explode' do
+ options.each do |opts|
+ ext = subject.new(opts.merge(logger: NullLogger.new))
+ %i(honorific entered_parliament_at parliaments_in electoral_history
+ current_roles former_roles image links).each do |meth|
+ expect { ext.public_send(meth) }.to_not raise_error
+ end
+ end
+
+ end
+
end
| Test Extractor parses without Capybara element not found exceptions
|
diff --git a/spec/retryable/configuration_spec.rb b/spec/retryable/configuration_spec.rb
index abc1234..def5678 100644
--- a/spec/retryable/configuration_spec.rb
+++ b/spec/retryable/configuration_spec.rb
@@ -21,6 +21,22 @@ end
end
+ context 'when configured locally' do
+ it 'does not affect the original global config' do
+ new_sleep = 2
+ original_sleep = described_class.configuration.send(:sleep)
+
+ expect(original_sleep).not_to eq(new_sleep)
+
+ counter(tries: 2, sleep: new_sleep) do |tries, ex|
+ raise StandardError if tries < 1
+ end
+
+ actual = described_class.configuration.send(:sleep)
+ expect(actual).to eq(original_sleep)
+ end
+ end
+
context 'when configured globally with custom sleep parameter' do
it 'passes retry count and exception on retry' do
expect(Kernel).to receive(:sleep).once.with(3)
| Add regression spec for configuration
|
diff --git a/app/controllers/contacts_controller.rb b/app/controllers/contacts_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/contacts_controller.rb
+++ b/app/controllers/contacts_controller.rb
@@ -1,4 +1,5 @@ class ContactsController < ApplicationController
+ before_filter :authenticate_user!
def new
@contact = Contact.new
| Add devise method to restrict Contact form to authenticated users
|
diff --git a/test/cookbooks/setup/recipes/default.rb b/test/cookbooks/setup/recipes/default.rb
index abc1234..def5678 100644
--- a/test/cookbooks/setup/recipes/default.rb
+++ b/test/cookbooks/setup/recipes/default.rb
@@ -2,7 +2,7 @@ # Cookbook Name:: setup
# Recipe:: default
#
-# Copyright 2014-2019, Threat Stack
+# Copyright 2014-2020, Threat Stack
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -19,4 +19,4 @@ # Set up tests to run apt update. It's not run as part of
# default threatstack recipe so that companies can decide
# how often to run it on their own.
-apt_update unless platform_family?('fedora', 'amazon')
+apt_update unless platform_family?('rhel', 'fedora', 'amazon')
| Update copyright year and added 'rhel' to the conditional to not run `apt update`
|
diff --git a/spec/features/admin/newsletters_spec.rb b/spec/features/admin/newsletters_spec.rb
index abc1234..def5678 100644
--- a/spec/features/admin/newsletters_spec.rb
+++ b/spec/features/admin/newsletters_spec.rb
@@ -6,6 +6,8 @@
background do
@admin = create(:administrator)
+ @newsletter_user = create(:user, newsletter: true)
+ @non_newsletter_user = create(:user, newsletter: false)
login_as(@admin.user)
visit admin_newsletters_path
end
@@ -16,7 +18,9 @@
scenario 'Download newsletter email zip' do
click_link download_button_text
- expect( Zip::InputStream.open(StringIO.new(page.body)).get_next_entry.get_input_stream {|is| is.read } ).to include @admin.user.email
+ downloaded_file_content = Zip::InputStream.open(StringIO.new(page.body)).get_next_entry.get_input_stream {|is| is.read }
+ expect(downloaded_file_content).to include(@admin.user.email, @newsletter_user.email)
+ expect(downloaded_file_content).not_to include(@non_newsletter_user.email)
end
end
| Add expectations for newsletter users and non-newsletter users on email zip download scenario
|
diff --git a/spec/features/open_welcome_page_spec.rb b/spec/features/open_welcome_page_spec.rb
index abc1234..def5678 100644
--- a/spec/features/open_welcome_page_spec.rb
+++ b/spec/features/open_welcome_page_spec.rb
@@ -0,0 +1,17 @@+require 'rails_helper'
+
+describe 'Open the welcome page' do
+
+ it 'should open the page with success' do
+ visit '/en'
+
+ expect(page).to have_title('Welcome to Villeme - Events and activities in your city')
+ end
+
+ it 'should open the welcome page in portuguese language' do
+ visit '/pt-BR'
+
+ expect(page).to have_title('Bem-vindo ao Villeme - Eventos e atividades na sua cidade!')
+ end
+
+end | Test with Capybara created to test welcome page
|
diff --git a/spec/support/matchers/table_matchers.rb b/spec/support/matchers/table_matchers.rb
index abc1234..def5678 100644
--- a/spec/support/matchers/table_matchers.rb
+++ b/spec/support/matchers/table_matchers.rb
@@ -19,6 +19,15 @@ end
end
+ failure_message_for_should do |text|
+ "expected to find table row #{@row}"
+ end
+
+ failure_message_for_should_not do |text|
+ "expected not to find table row #{@row}"
+ end
+
+
def rows_under(node)
node.all('tr').map { |tr| tr.all('th, td').map(&:text) }
end
@@ -31,13 +40,4 @@ true
end
-
- failure_message_for_should do |text|
- "expected to find table row #{@row}"
- end
-
- failure_message_for_should_not do |text|
- "expected not to find table row #{@row}"
- end
-
end
| Reorder helper method at bottom
|
diff --git a/spec/sessions/sessions_controller_spec.rb b/spec/sessions/sessions_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/sessions/sessions_controller_spec.rb
+++ b/spec/sessions/sessions_controller_spec.rb
@@ -0,0 +1,11 @@+require 'rails_helper'
+
+RSpec.describe SessionsController, :type => :controller do
+ describe "true" do
+ it "is true" do
+ # get :index
+ puts 'in the test'
+ expect(true).to be(true)
+ end
+ end
+end | Write basic test for sessions controller
Basic 'true == true' test in spec/sessions/sessions_controller_spec.rb just proving that all gems and required files are set up correctly.
|
diff --git a/app/helpers/admin/activities_helper.rb b/app/helpers/admin/activities_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/admin/activities_helper.rb
+++ b/app/helpers/admin/activities_helper.rb
@@ -1,6 +1,6 @@ module Admin::ActivitiesHelper
def admin_review_paper_link(activity)
- label = "Review Papers"
+ label = link_to "Review Papers", nil
return label if activity.nil?
unreviewed_papers = activity.papers.size - activity.review_by(current_user).size
label << "(#{unreviewed_papers})"
| Fix navigation bar broken when no activity
|
diff --git a/app/helpers/admin/activities_helper.rb b/app/helpers/admin/activities_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/admin/activities_helper.rb
+++ b/app/helpers/admin/activities_helper.rb
@@ -1,5 +1,6 @@ module Admin::ActivitiesHelper
def admin_review_paper_link(activity)
+ return 0 if activity.nil?
label = "Review Papers"
unreviewed_papers = activity.papers.size - activity.review_by(current_user).size
label << "(#{unreviewed_papers})"
| Fix nil activity case unreviewed count broken
|
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
@@ -8,9 +8,9 @@
def create
@comment = Comment.new(comment_params)
- @comment.user_id = current_user
+ @comment.user_id = current_user.id
if @comment.save
- redirect_to trail_path
+ redirect_to trail_path(:id => params[:trail_id])
else
render :new
end
| Include id on redirect after comment is posted
|
diff --git a/app/jobs/promo/email_breakdowns_job.rb b/app/jobs/promo/email_breakdowns_job.rb
index abc1234..def5678 100644
--- a/app/jobs/promo/email_breakdowns_job.rb
+++ b/app/jobs/promo/email_breakdowns_job.rb
@@ -14,6 +14,7 @@ ).perform)
new_csv = []
csv.each do |row|
+ row.delete_at(5) # delete the 30-day-confirmation column
row.delete_at(2) # delete Day column
new_csv << row.join(",")
end
| Disable confirmation column in the CSV. We'll re-add once we get the proper data and if it clears security
|
diff --git a/lib/super_settings/calculate.rb b/lib/super_settings/calculate.rb
index abc1234..def5678 100644
--- a/lib/super_settings/calculate.rb
+++ b/lib/super_settings/calculate.rb
@@ -1,4 +1,7 @@ module SuperSettings
+ # The Calculate class allows a user to define operators.
+ # These registrators are registered into the class and are
+ # accessible via method_missing lookup
class Calculate
@operators = {}
| Add description to the Calculate class
|
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/sessions_controller.rb
+++ b/app/controllers/sessions_controller.rb
@@ -40,6 +40,7 @@ # If we use some DB in the future, change this to store token with expire limitation (not password).
#
# Currently, only store to session if default password is used.
- session[:succeed_password] = session_params[:password] if session_params[:password] == Settings.default_password
+ # TODO: How to keep a login session to be decide
+ session[:succeed_password] = session_params[:password]
end
end
| Fix can't login if password changed
|
diff --git a/app/controllers/students_controller.rb b/app/controllers/students_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/students_controller.rb
+++ b/app/controllers/students_controller.rb
@@ -1,7 +1,13 @@ class StudentsController < ApplicationController
before_filter :authenticate_user!
+ #TODO: Add before filter to ensure user's partner has a relationship
def index
@students = Student.order("name")
end
+
+ def show
+ @student = Student.find(params[:id])
+ end
+
end
| Add action to show user profile page
|
diff --git a/rakefile.rb b/rakefile.rb
index abc1234..def5678 100644
--- a/rakefile.rb
+++ b/rakefile.rb
@@ -13,7 +13,7 @@ desc 'Test the validates_email_format_of plugin.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
- t.pattern = 'test/**/*_test.rb'
+ t.pattern = FileList['test/**/*_test.rb']
t.verbose = true
end
| Use FileList in TestTask for Ruby 1.9.3
|
diff --git a/randname.rb b/randname.rb
index abc1234..def5678 100644
--- a/randname.rb
+++ b/randname.rb
@@ -25,4 +25,4 @@ # combine with random number
number = SecureRandom.random_number(1000)
# return name
-puts "#{adjectives[a]}-#{nouns[n]}-#{number}"
+puts "#{adjectives[a]}#{nouns[n]}#{number}"
| Remove - in random names as cloudControl does not allow it
|
diff --git a/app/helpers/umlaut/html_head_helper.rb b/app/helpers/umlaut/html_head_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/umlaut/html_head_helper.rb
+++ b/app/helpers/umlaut/html_head_helper.rb
@@ -14,8 +14,8 @@ # if requested by presence of @meta_refresh_self ivar.
# this method usually called in a layout.
def render_meta_refresh
- (@meta_refresh_self) ?
- tag( "meta", "http-equiv" => "refresh", "content" => @meta_refresh_self) : ""
+ (@meta_refresh_self) ?
+ tag("meta", "http-equiv" => "refresh", "content" => @meta_refresh_self) : ""
end
# standard umlaut head content, may later include more
| Clean up whitespace in helpers.
|
diff --git a/app/models/hackbot/interactions/stats.rb b/app/models/hackbot/interactions/stats.rb
index abc1234..def5678 100644
--- a/app/models/hackbot/interactions/stats.rb
+++ b/app/models/hackbot/interactions/stats.rb
@@ -1,10 +1,7 @@ module Hackbot
module Interactions
- class Stats < Hackbot::Interactions::Channel
- def self.should_start?(event, team)
- event[:type].eql?('message') &&
- mentions_command?(event, team, 'stats')
- end
+ class Stats < Command
+ TRIGGER = /stats/
def start(event)
stats = statistics(event)
| Convert Hackbot::Interactions::Stats to a Command
|
diff --git a/app/serializers/district_serializer.rb b/app/serializers/district_serializer.rb
index abc1234..def5678 100644
--- a/app/serializers/district_serializer.rb
+++ b/app/serializers/district_serializer.rb
@@ -1,7 +1,5 @@ class DistrictSerializer < ActiveModel::Serializer
- attributes :name, :region, :vpc_id, :public_elb_security_group, :private_elb_security_group,
- :instance_security_group, :ecs_service_role, :ecs_instance_profile,
- :private_hosted_zone_id, :s3_bucket_name, :container_instances,
+ attributes :name, :region, :s3_bucket_name, :container_instances,
:stack_status, :nat_type, :cluster_size, :cluster_instance_type,
:cluster_backend, :cidr_block, :stack_name, :bastion_ip,
:aws_access_key_id, :aws_role
| Remove unused district serializer params
|
diff --git a/app/concepts/payload/operation.rb b/app/concepts/payload/operation.rb
index abc1234..def5678 100644
--- a/app/concepts/payload/operation.rb
+++ b/app/concepts/payload/operation.rb
@@ -10,6 +10,7 @@
def update_status
status = success? ? 'success' : 'failure'
+ Rails.logger.info("repo=#{repo_full_name} sha=#{sha} status=#{status} pr_number=#{pr_number}")
client.create_status(repo_full_name, sha, status, context: 'peer-review/prpal')
end
| Add some logging to help debug issues
|
diff --git a/db/migrate/20190212154510_change_legal_document_variable_id_to_bigint.rb b/db/migrate/20190212154510_change_legal_document_variable_id_to_bigint.rb
index abc1234..def5678 100644
--- a/db/migrate/20190212154510_change_legal_document_variable_id_to_bigint.rb
+++ b/db/migrate/20190212154510_change_legal_document_variable_id_to_bigint.rb
@@ -0,0 +1,9 @@+class ChangeLegalDocumentVariableIdToBigint < ActiveRecord::Migration[6.0]
+ def up
+ change_column :legal_document_variable_options, :legal_document_variable_id, :bigint
+ end
+
+ def down
+ change_column :legal_document_variable_options, :legal_document_variable_id, :integer
+ end
+end
| Update legal_document_variable_id foreign key to bigint
|
diff --git a/Library/Formula/percona-toolkit.rb b/Library/Formula/percona-toolkit.rb
index abc1234..def5678 100644
--- a/Library/Formula/percona-toolkit.rb
+++ b/Library/Formula/percona-toolkit.rb
@@ -3,7 +3,7 @@ class PerconaToolkit < Formula
homepage 'http://www.percona.com/software/percona-toolkit/'
url 'http://www.percona.com/redir/downloads/percona-toolkit/2.1.1/percona-toolkit-2.1.1.tar.gz'
- md5 '14be6a3e31c7b20aeca78e3e0aed6edc'
+ sha1 'bbaf2440c55bb62b5e98d08bd3246e82c84f6f2a'
depends_on 'Time::HiRes' => :perl
depends_on 'DBD::mysql' => :perl
| percona: Use SHA1 instead of MD5
Signed-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>
|
diff --git a/Library/Homebrew/tap_migrations.rb b/Library/Homebrew/tap_migrations.rb
index abc1234..def5678 100644
--- a/Library/Homebrew/tap_migrations.rb
+++ b/Library/Homebrew/tap_migrations.rb
@@ -4,4 +4,5 @@ 'denyhosts' => 'homebrew/boneyard',
'ipopt' => 'homebrew/science',
'qfits' => 'homebrew/boneyard',
+ 'blackbox' => 'homebrew/boneyard',
}
| Move blackbox to the boneyard
Closes Homebrew/homebrew#24370.
|
diff --git a/app/helpers/restaurants_helper.rb b/app/helpers/restaurants_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/restaurants_helper.rb
+++ b/app/helpers/restaurants_helper.rb
@@ -33,16 +33,16 @@ def parse_restaurant_info(restaurants_json)
restaurants = restaurants_json['businesses'].map do | restaurant |
{
- "name": restaurant['name'],
- "image_url": restaurant['image_url'],
- "phone_number": restaurant['phone'],
- "address1": restaurant['location']['address1'],
- "address2": restaurant['location']['address2'],
- "city": restaurant['location']['city'],
- "state": restaurant['location']['state'],
- "zip_code": restaurant['location']['zip_code'],
- "longitude": restaurant['coordinates']['longitude'],
- "latitude": restaurant['coordinates']['latitude']
+ "name" => restaurant['name'],
+ "image_url" => restaurant['image_url'],
+ "phone_number" => restaurant['phone'],
+ "address1" => restaurant['location']['address1'],
+ "address2" => restaurant['location']['address2'],
+ "city" => restaurant['location']['city'],
+ "state" => restaurant['location']['state'],
+ "zip_code" => restaurant['location']['zip_code'],
+ "longitude" => restaurant['coordinates']['longitude'],
+ "latitude" => restaurant['coordinates']['latitude']
}
end
end
| Change hash symbols to strings in parsed json
|
diff --git a/SwiftyUserDefaults.podspec b/SwiftyUserDefaults.podspec
index abc1234..def5678 100644
--- a/SwiftyUserDefaults.podspec
+++ b/SwiftyUserDefaults.podspec
@@ -1,8 +1,8 @@ Pod::Spec.new do |s|
s.name = 'SwiftyUserDefaults'
- s.version = '5.0.0-beta.5'
+ s.version = '5.0.0'
s.license = 'MIT'
- s.summary = 'Swifty API for NSUserDefaults'
+ s.summary = 'Swifty API for UserDefaults'
s.homepage = 'https://github.com/sunshinejr/SwiftyUserDefaults'
s.authors = { 'Radek Pietruszewski' => 'this.is@radex.io', 'Łukasz Mróz' => 'thesunshinejr@gmail.com' }
s.source = { :git => 'https://github.com/radex/SwiftyUserDefaults.git', :tag => s.version }
| Update Podspec for version 5.0.0
|
diff --git a/app/views/courses/_block.json.jbuilder b/app/views/courses/_block.json.jbuilder
index abc1234..def5678 100644
--- a/app/views/courses/_block.json.jbuilder
+++ b/app/views/courses/_block.json.jbuilder
@@ -16,7 +16,7 @@ )
json.call(tm, :slug, :id, :name, :kind)
json.module_progress due_date_manager.module_progress
- json.due_date due_date_manager.computed_due_date.strftime('%Y/%m/%d')
+ json.due_date due_date_manager.computed_due_date
json.overdue due_date_manager.overdue?
json.deadline_status due_date_manager.deadline_status
json.flags due_date_manager.flags(course.id)
| Fix another date format warning from moment.js
|
diff --git a/app/validators/email_validator.rb b/app/validators/email_validator.rb
index abc1234..def5678 100644
--- a/app/validators/email_validator.rb
+++ b/app/validators/email_validator.rb
@@ -0,0 +1,21 @@+require 'mail'
+class EmailValidator < ActiveModel::EachValidator
+ def validate_each(record,attribute,value)
+ begin
+ m = Mail::Address.new(value)
+ # We must check that value contains a domain and that value is an email address
+ r = m.domain && m.address == value
+ t = m.__send__(:tree)
+ # We need to dig into treetop
+ # A valid domain must have dot_atom_text elements size > 1
+ # user@localhost is excluded
+ # treetop must respond to domain
+ # We exclude valid email values like <user@localhost.com>
+ # Hence we use m.__send__(tree).domain
+ r &&= (t.domain.dot_atom_text.elements.size > 1)
+ rescue Exception => e
+ r = false
+ end
+ record.errors[attribute] << (options[:message] || "is invalid") unless r
+ end
+end
| Add email validation class withouth regex
|
diff --git a/app/helpers/sub_nav_helper.rb b/app/helpers/sub_nav_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/sub_nav_helper.rb
+++ b/app/helpers/sub_nav_helper.rb
@@ -1,11 +1,13 @@ module SubNavHelper
def show_teachers_dashboard_button?
+ return false unless current_user
return false if current_user.pupil?
return false if current_page?(teachers_school_path(@school))
can?(:show_teachers_dash, @school)
end
def show_pupils_dashboard_button?
+ return false unless current_user
return false if current_user.pupil?
return false if current_page?(pupils_school_path(@school))
can?(:show_pupils_dash, @school)
| Add other check for logged in users
|
diff --git a/app/models/progress_update.rb b/app/models/progress_update.rb
index abc1234..def5678 100644
--- a/app/models/progress_update.rb
+++ b/app/models/progress_update.rb
@@ -3,6 +3,8 @@ belongs_to :project
belongs_to :user
has_many :comments, dependent: :destroy
+
+ validates :content, presence: true
def self.add_and_update_project(params, word_format, project)
update = self.new
@@ -21,4 +23,9 @@ update.hours = params[:hours].to_f
update
end
+
+ def full_errors_string
+ self.errors.full_messages.join(". ")
+ end
+
end
| Add full_errors_string method. Validate presence of content
|
diff --git a/lib/autobots.rb b/lib/autobots.rb
index abc1234..def5678 100644
--- a/lib/autobots.rb
+++ b/lib/autobots.rb
@@ -1,4 +1,5 @@ require 'autobots/version'
+require 'active_support/all'
require 'active_model_serializers'
require 'bulk_cache_fetcher'
| Revert "remove a require for active support"
This reverts commit 74990ac51ceec77145b64359920aa5b05488169c.
|
diff --git a/lib/junit5_adapter.rb b/lib/junit5_adapter.rb
index abc1234..def5678 100644
--- a/lib/junit5_adapter.rb
+++ b/lib/junit5_adapter.rb
@@ -3,7 +3,7 @@ class Junit5Adapter < TestingFrameworkAdapter
COUNT_REGEXP = /(\d+) tests found/.freeze
FAILURES_REGEXP = /(\d+) tests failed/.freeze
- ASSERTION_ERROR_REGEXP = /=> java\.lang\.AssertionError:?\s(.*?)\s*org.junit|=> org\.junit\.ComparisonFailure:\s(.*?)\s*org.junit/m.freeze
+ ASSERTION_ERROR_REGEXP = /=> java\.lang\.AssertionError:?\s(.*?)\s*org\.junit|=> org\.junit\.ComparisonFailure:\s(.*?)\s*org\.junit|=>\s(.*?)\s*org\.junit\.internal\.ComparisonCriteria\.arrayEquals/m.freeze
def self.framework_name
'JUnit 5'
| Fix JUnit 5 for ArrayComparisonFailure
|
diff --git a/ServiceDeployer/src/main/resources/tomcat-service-deploy-template/attributes/default.rb b/ServiceDeployer/src/main/resources/tomcat-service-deploy-template/attributes/default.rb
index abc1234..def5678 100644
--- a/ServiceDeployer/src/main/resources/tomcat-service-deploy-template/attributes/default.rb
+++ b/ServiceDeployer/src/main/resources/tomcat-service-deploy-template/attributes/default.rb
@@ -13,11 +13,11 @@ default['service']['$NAME']['URL'] = "$URL"
# Set the default path to tomcat's webapps folder
-default['service']['$NAME']['webappsPath'] = "$WEBAPPS"
+default['service']['$NAME']['webappsPath'] = "/var/lib/tomcat6/webapps"
+
+# Set the default log filewar_depl
+default['service']['$NAME']['logFile'] = "/dev/stdout"
# Set the default log file
-default['service']['$NAME']['logFile'] = "$LOGFILE"
+default['service']['$NAME']['bashscript'] = "war_deploy_script_service_$NAME.sh"
-# Set the default log file
-default['service']['$NAME']['bashscript'] = "$BASHSCRIPT"
-
| Set static variables in attributes file |
diff --git a/birth_number.gemspec b/birth_number.gemspec
index abc1234..def5678 100644
--- a/birth_number.gemspec
+++ b/birth_number.gemspec
@@ -21,6 +21,8 @@ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(spec)/}) }
spec.require_paths = ['lib']
+ spec.required_ruby_version = '>= 2.0'
+
spec.add_development_dependency 'bundler', '~> 1.10'
spec.add_development_dependency 'rake', '~> 10.0'
spec.add_development_dependency 'rspec', '~> 3.3'
| Add minimum ruby version to gemspec
|
diff --git a/month.gemspec b/month.gemspec
index abc1234..def5678 100644
--- a/month.gemspec
+++ b/month.gemspec
@@ -15,6 +15,6 @@ 'homepage' => 'https://github.com/readysteady/month',
'source_code_uri' => 'https://github.com/readysteady/month',
'bug_tracker_uri' => 'https://github.com/readysteady/month/issues',
- 'changelog_uri' => 'https://github.com/readysteady/month/blob/master/CHANGES.md'
+ 'changelog_uri' => 'https://github.com/readysteady/month/blob/main/CHANGES.md'
}
end
| Update branch name in changelog_uri
|
diff --git a/app/services/manage_action.rb b/app/services/manage_action.rb
index abc1234..def5678 100644
--- a/app/services/manage_action.rb
+++ b/app/services/manage_action.rb
@@ -5,6 +5,8 @@
def create
Action.find_or_create_by( action_user: action_user, page: page ) do |action|
+ queue_message = {type: 'action', params: {slug: page.slug, email: action_user.email}.merge(@params)}
+ ChampaignQueue.push(queue_message)
action.form_data = @params
end
end
| Add queue post to action creation.
|
diff --git a/rdw.gemspec b/rdw.gemspec
index abc1234..def5678 100644
--- a/rdw.gemspec
+++ b/rdw.gemspec
@@ -21,7 +21,7 @@
spec.add_development_dependency "bundler", "~> 1.5"
spec.add_development_dependency "rake"
- spec.add_development_dependency "rspec", "~> 3.0.0.beta2"
+ spec.add_development_dependency "rspec", "~> 3.7.0"
spec.add_development_dependency "rspec-its"
spec.add_development_dependency "guard-rspec"
spec.add_development_dependency "webmock"
| Update rspec requirement to ~> 3.7.0
Updates the requirements on [rspec](https://github.com/rspec/rspec) to permit the latest version.
- [Commits](https://github.com/rspec/rspec/commits/v3.7.0) |
diff --git a/gitback.rb b/gitback.rb
index abc1234..def5678 100644
--- a/gitback.rb
+++ b/gitback.rb
@@ -13,7 +13,7 @@ #repositories =
# .map{|r| %Q[#{r[:name]}] }
#FileUtils.mkdir_p #{backupDirectory}
-YAML.load(open("http://github.com/api/v2/yaml/repos/show/#{username}"))['repositories'].map{|repository|
+YAML.load(open("https://github.com/api/v2/yaml/repos/show/#{username}"))['repositories'].map{|repository|
puts "discovered repository: #{repository[:name]} ... backing up ..."
#exec
system "git clone git@github.com:#{username}/#{repository[:name]}.git #{backupDirectory}/#{repository[:name]}"
| Use HTTPS to connect to GitHub
It is mandatory, without this change code will error:
/usr/lib/ruby/2.1.0/open-uri.rb:223:in `open_loop': redirection forbidden: http://github.com/api/v2/yaml/repos/show/irnc -> https://github.com/api/v2/yaml/repos/show/irnc (RuntimeError)
|
diff --git a/lib/bus_tracker/service.rb b/lib/bus_tracker/service.rb
index abc1234..def5678 100644
--- a/lib/bus_tracker/service.rb
+++ b/lib/bus_tracker/service.rb
@@ -13,18 +13,12 @@ document = Nokogiri::HTML(open("#{BASE_URI}getServicePoints.php?serviceMnemo=#{self.number}"))
bus_stops = document.xpath('//map/markers/busstop')
bus_stops.each do |bus_stop|
- code = bus_stop.xpath('sms')[0].content
- name = bus_stop.xpath('nom')[0].content
- latitude = bus_stop.xpath('x')[0].content
- longitude = bus_stop.xpath('y')[0].content
- service_numbers = bus_stop.xpath('services/service/mnemo').map {|s| s.content}
-
self.bus_stops << BusTracker::BusStop.new(
- :code => code,
- :name => name,
- :latitude => latitude,
- :longitude => longitude,
- :service_numbers => service_numbers
+ :code => bus_stop.xpath('sms')[0].content,
+ :name => bus_stop.xpath('nom')[0].content,
+ :latitude => bus_stop.xpath('x')[0].content,
+ :longitude => bus_stop.xpath('y')[0].content,
+ :service_numbers => bus_stop.xpath('services/service/mnemo').map {|s| s.content}
)
end
end
| Tidy up the creation of new bus stops, don't be overeager with local variables.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.