diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/app/serializers/full_manga_serializer.rb b/app/serializers/full_manga_serializer.rb
index abc1234..def5678 100644
--- a/app/serializers/full_manga_serializer.rb
+++ b/app/serializers/full_manga_serializer.rb
@@ -2,10 +2,10 @@ embed :ids, include: true
attributes :cover_image,
- :cover_image_top_offset,
- :featured_castings
+ :cover_image_top_offset
has_one :manga_library_entry
+ has_many :featured_castings, root: :castings
def manga_library_entry
scope && MangaLibraryEntry.where(user_id: scope.id, manga_id: object.id).first
|
Fix serializer to properly serialize relationship for castings
|
diff --git a/SharedInstanceGCD.podspec b/SharedInstanceGCD.podspec
index abc1234..def5678 100644
--- a/SharedInstanceGCD.podspec
+++ b/SharedInstanceGCD.podspec
@@ -1,11 +1,11 @@ Pod::Spec.new do |s|
s.name = "SharedInstanceGCD"
- s.version = "1.0.1"
+ s.version = "1.0.2"
s.summary = "A collection of the best GCD singleton macros."
s.homepage = "https://github.com/timshadel/SharedInstanceGCD"
s.license = "MIT"
s.author = { 'Tim Shadel' => 'github@timshadel.com' }
- s.source = { :git => "https://github.com/timshadel/SharedInstanceGCD.git", :tag => "1.0.0" }
+ s.source = { :git => "https://github.com/timshadel/SharedInstanceGCD.git", :tag => s.version.to_s }
s.source_files = 'SharedInstanceGCD.h'
s.public_header_files = 'SharedInstanceGCD.h'
end
|
Fix tag reference in podspec
Thanks to @Keithbsmiley for the tip to keep it in sync with the
podspec version.
|
diff --git a/spec/class2/exercise6_spec.rb b/spec/class2/exercise6_spec.rb
index abc1234..def5678 100644
--- a/spec/class2/exercise6_spec.rb
+++ b/spec/class2/exercise6_spec.rb
@@ -4,19 +4,42 @@ end
before do
- allow_any_instance_of(Kernel).to receive(:gets).and_return('i want a raise')
+ allow_any_instance_of(Kernel).to receive(:gets).and_return('anything')
end
it 'outputs to STDOUT' do
expect { exercise6 }.to output.to_stdout
end
- it 'rudely asks what you want, yells at you, and fires you' do
- message = <<END
+ context 'i want a raise' do
+ before do
+ stub = 'i want a raise'
+ allow_any_instance_of(Kernel).to receive(:gets).and_return(stub)
+ end
+
+ it 'rudely asks what you want, yells at you, and fires you' do
+ message = <<END
CAN'T YOU SEE I'M BUSY?! MAKE IT FAST, JOHNSON!
WHADDAYA MEAN 'I WANT A RAISE'?!? YOU'RE FIRED!!
END
- expect { exercise6 }.to output(message).to_stdout
+ expect { exercise6 }.to output(message).to_stdout
+ end
+ end
+
+ context 'I want an iPhone' do
+ before do
+ stub = 'I want an iPhone'
+ allow_any_instance_of(Kernel).to receive(:gets).and_return(stub)
+ end
+
+ it 'rudely asks what you want, yells at you, and fires you' do
+ message = <<END
+CAN'T YOU SEE I'M BUSY?! MAKE IT FAST, JOHNSON!
+WHADDAYA MEAN 'I WANT AN IPHONE'?!? YOU'RE FIRED!!
+END
+
+ expect { exercise6 }.to output(message).to_stdout
+ end
end
end
|
Improve specs for class 2 exercise 6
|
diff --git a/spec/controller_macro_spec.rb b/spec/controller_macro_spec.rb
index abc1234..def5678 100644
--- a/spec/controller_macro_spec.rb
+++ b/spec/controller_macro_spec.rb
@@ -1,6 +1,12 @@ require 'spec_helper'
describe 'serve_resource', type: :controller do
+ shared_examples "a controller serving the User class" do
+ it "serves the User class" do
+ subject.send(:resource_class).should == User
+ end
+ end
+
context "when a resource class is not explicitly specified" do
class UsersController < ApplicationController
respond_to :html
@@ -8,9 +14,7 @@ end
describe UsersController, type: :controller do
- it "should choose the resource class name based on the controller class name" do
- subject.send(:resource_class).should == User
- end
+ it_behaves_like "a controller serving the User class"
end
end
@@ -20,9 +24,7 @@ serve_resource User
end
- it 'should set the resource class according to the argument' do
- subject.send(:resource_class).should == User
- end
+ it_behaves_like "a controller serving the User class"
end
context "when specifying the resource class as a symbol" do
@@ -32,9 +34,7 @@ serve_resource :user
end
- it 'correctly sets the resource class' do
- subject.send(:resource_class).should == User
- end
+ it_behaves_like "a controller serving the User class"
end
context "when symbol is plural" do
@@ -43,9 +43,7 @@ serve_resource :users
end
- it 'correctly sets the resource class' do
- subject.send(:resource_class).should == User
- end
+ it_behaves_like "a controller serving the User class"
end
end
end
|
Use a shared example to DRY up specs.
|
diff --git a/spec/first_click_free_spec.rb b/spec/first_click_free_spec.rb
index abc1234..def5678 100644
--- a/spec/first_click_free_spec.rb
+++ b/spec/first_click_free_spec.rb
@@ -4,6 +4,6 @@ describe "#permitted_domains" do
subject { described_class.permitted_domains }
it { should have_at_least(10).items }
- it { subject.select { |domain| domain =~ /google/ }.length.should eq subject.length }
+ it { subject.select { |domain| domain =~ /google|bing|yahoo/ }.length.should eq subject.length }
end
end
|
Update spec to check for all search providers listed in domains.yml, not just google
|
diff --git a/sprockets-illusionist.gemspec b/sprockets-illusionist.gemspec
index abc1234..def5678 100644
--- a/sprockets-illusionist.gemspec
+++ b/sprockets-illusionist.gemspec
@@ -20,5 +20,5 @@
spec.add_development_dependency 'bundler', '~> 1.5'
spec.add_development_dependency 'rake'
- spec.add_dependency 'sprockets', '~> 2.10.1'
+ spec.add_dependency 'sprockets', '>= 2.10.1', '< 3.0'
end
|
Support sprockets up to 3.0
|
diff --git a/spec/routing/targets_routing_spec.rb b/spec/routing/targets_routing_spec.rb
index abc1234..def5678 100644
--- a/spec/routing/targets_routing_spec.rb
+++ b/spec/routing/targets_routing_spec.rb
@@ -0,0 +1,34 @@+require 'spec_helper'
+
+describe TargetsController do
+ describe "routing" do
+
+ it "#index" do
+ expect(get("/targets")).to route_to("targets#index")
+ end
+
+ it "#show" do
+ expect(get("/targets/1")).to route_to("targets#show", id: "1")
+ end
+
+ it "#new" do
+ expect(get("/targets/new")).to route_to("targets#new")
+ end
+
+ it "#edit" do
+ expect(get("/targets/1/edit")).to route_to("targets#edit", id: "1")
+ end
+
+ it "#create" do
+ expect(post("/targets")).to route_to("targets#create")
+ end
+
+ it "#update" do
+ expect(put("/targets/1")).to route_to("targets#update", id: "1")
+ end
+
+ it "#destroy" do
+ expect(delete("/targets/1")).to route_to("targets#destroy", id: "1")
+ end
+ end
+end
|
Add routing spec for targets
|
diff --git a/spec/system/types/mysql_user_spec.rb b/spec/system/types/mysql_user_spec.rb
index abc1234..def5678 100644
--- a/spec/system/types/mysql_user_spec.rb
+++ b/spec/system/types/mysql_user_spec.rb
@@ -0,0 +1,35 @@+require 'spec_helper_system'
+
+describe 'mysql_user' do
+
+ describe 'setup' do
+ it 'should work with no errors' do
+ pp = <<-EOS
+ class { 'mysql::server': }
+ EOS
+
+ puppet_apply(pp)
+ end
+ end
+
+ describe 'adding user' do
+ it 'should work without errors' do
+ pp = <<-EOS
+ mysql_user { 'ashp@localhost':
+ password_hash => '6f8c114b58f2ce9e',
+ }
+ EOS
+
+ puppet_apply(pp)
+ end
+
+ it 'should find the user' do
+ shell("mysql -NBe \"select '1' from mysql.user where CONCAT(user, '@', host) = 'ashp@localhost'\"") do |r|
+ r.stdout.should =~ /^1$/
+ r.stderr.should be_empty
+ r.exit_code.should be_zero
+ end
+ end
+ end
+
+end
|
Add rspec-system test for mysql_user.
|
diff --git a/db/migrate/20140617193351_add_and_remove_indexes_on_topic_links.rb b/db/migrate/20140617193351_add_and_remove_indexes_on_topic_links.rb
index abc1234..def5678 100644
--- a/db/migrate/20140617193351_add_and_remove_indexes_on_topic_links.rb
+++ b/db/migrate/20140617193351_add_and_remove_indexes_on_topic_links.rb
@@ -0,0 +1,13 @@+class AddAndRemoveIndexesOnTopicLinks < ActiveRecord::Migration
+ def up
+ # Index (topic_id) is a subset of (topic_id, post_id, url)
+ remove_index :topic_links, :topic_id
+
+ add_index :topic_links, :post_id
+ end
+
+ def down
+ remove_index :topic_links, :post_id
+ add_index :topic_links, :topic_id
+ end
+end
|
Add index on topic_links post_id. Remove a redundant index.
|
diff --git a/db/migrate/20200309222710_add_root_account_id_to_lti_line_items.rb b/db/migrate/20200309222710_add_root_account_id_to_lti_line_items.rb
index abc1234..def5678 100644
--- a/db/migrate/20200309222710_add_root_account_id_to_lti_line_items.rb
+++ b/db/migrate/20200309222710_add_root_account_id_to_lti_line_items.rb
@@ -0,0 +1,25 @@+#
+# Copyright (C) 2020 - present Instructure, Inc.
+#
+# This file is part of Canvas.
+#
+# Canvas is free software: you can redistribute it and/or modify it under
+# the terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, version 3 of the License.
+#
+# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Affero General Public License along
+# with this program. If not, see <http://www.gnu.org/licenses/>.
+
+class AddRootAccountIdToLtiLineItems < ActiveRecord::Migration[5.2]
+ tag :predeploy
+
+ def change
+ add_column :lti_line_items, :root_account_id, :integer, limit: 8
+ add_foreign_key :lti_line_items, :accounts, column: :root_account_id
+ end
+end
|
Add root_account_id to Lti::LineItems table
closes PLAT-5481
flag=none
Test plan
- n/a
Change-Id: I0be294ede5e44d91c8d2edc29728df115fa04ced
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/229399
Tested-by: Service Cloud Jenkins <9144042a601061f88f1e1d7a1753ea3e2972119d@instructure.com>
Reviewed-by: Weston Dransfield <e9203059795dc94e28a8831c65eb7869e818825e@instructure.com>
Reviewed-by: Rob Orton <7e09c9d3e96378bf549fc283fd6e1e5b7014cc33@instructure.com>
QA-Review: Mysti Lilla <431d062aff1e8f25416b3a7b732fe6effdb03f9a@instructure.com>
Product-Review: Mysti Lilla <431d062aff1e8f25416b3a7b732fe6effdb03f9a@instructure.com>
|
diff --git a/core/spec/poltergeist_style_overrides.rb b/core/spec/poltergeist_style_overrides.rb
index abc1234..def5678 100644
--- a/core/spec/poltergeist_style_overrides.rb
+++ b/core/spec/poltergeist_style_overrides.rb
@@ -4,8 +4,8 @@ (<<-'SNIPPET'
<style>
* { transition: none !important; }
- html.phantom_js * { font-family:"Comic Sans MS"; }
html.phantom_js { min-height: 2000px; }
+ * { font-family:"DejaVu Sans Mono" !important; letter-spacing:-1px; }
</style>
<script>
document.addEventListener("DOMContentLoaded", function(){
|
Use a monospace font to avoid kerning issues.
|
diff --git a/spec/codeclimate_ci/api_requester_spec.rb b/spec/codeclimate_ci/api_requester_spec.rb
index abc1234..def5678 100644
--- a/spec/codeclimate_ci/api_requester_spec.rb
+++ b/spec/codeclimate_ci/api_requester_spec.rb
@@ -21,4 +21,18 @@ expect(WebMock).to have_requested(:get, endpoint)
end
end
+
+ describe '#connection_established?' do
+ let(:endpoint) do
+ "https://codeclimate.com/api/repos/#{repo_id}/?api_token=#{token}"
+ end
+
+ before do
+ stub_request(:get, endpoint).to_return(status: 404)
+ end
+
+ it 'requests correct API endpoint' do
+ expect(api_requester.connection_established?).to be_falsey
+ end
+ end
end
|
Add spec for connection_established method in api requester spec
|
diff --git a/spec/codeclimate_ci/configuration_spec.rb b/spec/codeclimate_ci/configuration_spec.rb
index abc1234..def5678 100644
--- a/spec/codeclimate_ci/configuration_spec.rb
+++ b/spec/codeclimate_ci/configuration_spec.rb
@@ -0,0 +1,27 @@+require 'spec_helper'
+
+module CodeclimateCi
+ describe Configuration do
+ let(:options) do
+ {
+ 'codeclimate_api_token' => '12345678',
+ 'repo_id' => '124356',
+ 'branch_name' => 'new-feature'
+ }
+ end
+
+ let(:configuration) { CodeclimateCi::Configuration.new }
+
+ describe '#load_from_options(options)' do
+ before do
+ configuration.load_from_options(options)
+ end
+
+ it 'properly setups options' do
+ expect(configuration.codeclimate_api_token).to eq('12345678')
+ expect(configuration.repo_id).to eq('124356')
+ expect(configuration.branch_name).to eq('new-feature')
+ end
+ end
+ end
+end
|
Add spec for Configuration class
|
diff --git a/app/forms/rubygem_form.rb b/app/forms/rubygem_form.rb
index abc1234..def5678 100644
--- a/app/forms/rubygem_form.rb
+++ b/app/forms/rubygem_form.rb
@@ -1,8 +1,19 @@ require 'reform/rails'
class ExistsInRubygemsDotOrgValidator < ActiveModel::EachValidator
- def validate_each(record, attribute, value)
+ def validate_each record, attribute, value
record.errors[attribute] << "is not the name of a gem registered in http://rubygems.org" if Net::HTTP.get("rubygems.org", "/api/v1/gems/#{value}.json") == "This rubygem could not be found."
+ end
+end
+
+class HasRubygemNameFormatValidator < ActiveModel::EachValidator
+ SPECIAL_CHARACTERS = ".-_"
+ ALLOWED_CHARACTERS = "[A-Za-z0-9#{Regexp.escape(SPECIAL_CHARACTERS)}]+"
+ NAME_PATTERN = /\A#{ALLOWED_CHARACTERS}\Z/
+
+ def validate_each record, attribute, value
+ record.errors[attribute] << "must include at least one letter" if value !~ /[a-zA-Z]+/
+ record.errors[attribute] << "can only include letters, numbers, dashes, and underscores" if value !~ NAME_PATTERN
end
end
@@ -16,7 +27,7 @@
model :rubygem
- validates :name, presence: true, uniqueness: { case_sensitive: false }, exists_in_rubygems_dot_org: true
+ validates :name, presence: true, uniqueness: { case_sensitive: false }, has_rubygem_name_format: true, exists_in_rubygems_dot_org: true
validates :status, presence: true, inclusion: Rubygem::STATUSES
validates :notes, presence: true
validates :miel, format: { without: /.+/ }
|
Check if gem name has valid format
|
diff --git a/app/models/choice_user.rb b/app/models/choice_user.rb
index abc1234..def5678 100644
--- a/app/models/choice_user.rb
+++ b/app/models/choice_user.rb
@@ -1,4 +1,14 @@ class ChoiceUser < ActiveRecord::Base
belongs_to :user
belongs_to :choice
+
+ after_create :add_survey_users_record
+
+ private
+
+ def add_survey_users_record
+ user = User.find(user_id)
+ survey = choice.question.survey
+ SurveyUser.find_or_create_by(user: user, survey: survey)
+ end
end
|
Add trigger to ChoiceUser model to auto-create SurveyUser records
|
diff --git a/tests.rb b/tests.rb
index abc1234..def5678 100644
--- a/tests.rb
+++ b/tests.rb
@@ -1,3 +1,5 @@+#!/usr/bin/env ruby
+
utf = IO.read("index.html")
em = utf.scan(/<em[^>]*>&#([^;]*);<\/em>/)
|
Add ruby shebang to test and chmod +x
|
diff --git a/app/controllers/rhinoart/omniauth_callbacks_controller.rb b/app/controllers/rhinoart/omniauth_callbacks_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/rhinoart/omniauth_callbacks_controller.rb
+++ b/app/controllers/rhinoart/omniauth_callbacks_controller.rb
@@ -7,7 +7,10 @@
if @user.persisted?
flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => "Google"
- sign_in_and_redirect @user, :event => :authentication
+ # sign_in_and_redirect @user, :event => :authentication
+ sign_in @user, :event => :authentication
+ redirect_to session[:redirect_to] || main_app.root_path
+
else
session["devise.google_data"] = request.env["omniauth.auth"]
redirect_to new_user_registration_url
|
Make omniauth_callbacks redirect after sign_in
|
diff --git a/app/services/external_api_ambassadors/uber_api_service.rb b/app/services/external_api_ambassadors/uber_api_service.rb
index abc1234..def5678 100644
--- a/app/services/external_api_ambassadors/uber_api_service.rb
+++ b/app/services/external_api_ambassadors/uber_api_service.rb
@@ -18,7 +18,7 @@ end
def price(product, response)
- unless response && response['prices']
+ unless response && response['prices'].present?
return {product_id: nil, price: nil}
end
|
Fix uber service nil bug
|
diff --git a/features/step_definitions/setup_steps.rb b/features/step_definitions/setup_steps.rb
index abc1234..def5678 100644
--- a/features/step_definitions/setup_steps.rb
+++ b/features/step_definitions/setup_steps.rb
@@ -1,5 +1,5 @@ Given /^the application is set up$/ do
- # Using lvh.me to give us automatic resolution to localhost
+ # Using ocolocalhost.com to give us automatic resolution to localhost
# N.B. This means some Cucumber scenarios will fail if your machine
# isn't connected to the internet. We shoud probably fix this.
#
@@ -12,8 +12,8 @@ # more complicated.
port_segment = Capybara.current_driver == :selenium ? ":#{Capybara.server_port}" : ''
- Setting[:base_domain] = "lvh.me#{port_segment}"
- Setting[:signup_domain] = "create.lvh.me#{port_segment}"
+ Setting[:base_domain] = "ocolocalhost.com#{port_segment}"
+ Setting[:signup_domain] = "create.ocolocalhost.com#{port_segment}"
end
Given /^the application is not set up yet$/ do
|
Use a .com domain that belongs to us for localhost resolution.
Enough of dealing with funny domains like smackaho.st and lvh.me
run by third parties.
(cherry picked from commit 9f83156bc7bf55351e24bf902fe28d5baa195266)
|
diff --git a/features/step_definitions/setup_steps.rb b/features/step_definitions/setup_steps.rb
index abc1234..def5678 100644
--- a/features/step_definitions/setup_steps.rb
+++ b/features/step_definitions/setup_steps.rb
@@ -1,5 +1,5 @@ Given /^the application is set up$/ do
- # Using smackaho.st to give us automatic resolution to localhost
+ # Using ocolocalhost.com to give us automatic resolution to localhost
# N.B. This means some Cucumber scenarios will fail if your machine
# isn't connected to the internet. We shoud probably fix this.
#
@@ -12,8 +12,8 @@ # more complicated.
port_segment = Capybara.current_driver == :selenium ? ":#{Capybara.server_port}" : ''
- Setting[:base_domain] = "smackaho.st#{port_segment}"
- Setting[:signup_domain] = "create.smackaho.st#{port_segment}"
+ Setting[:base_domain] = "ocolocalhost.com#{port_segment}"
+ Setting[:signup_domain] = "create.ocolocalhost.com#{port_segment}"
end
When /^the domain is the signup domain$/ do
|
Use a .com domain that belongs to us for localhost resolution.
Enough of dealing with funny domains like smackaho.st and lvh.me
run by third parties.
(cherry picked from commit 9f83156bc7bf55351e24bf902fe28d5baa195266)
Conflicts:
features/step_definitions/setup_steps.rb
|
diff --git a/spec/darwin/dev/packages_version_spec.rb b/spec/darwin/dev/packages_version_spec.rb
index abc1234..def5678 100644
--- a/spec/darwin/dev/packages_version_spec.rb
+++ b/spec/darwin/dev/packages_version_spec.rb
@@ -16,5 +16,5 @@
describe command('terraform --version') do
its(:exit_status) { should eq 0 }
- its(:stdout) { should include('Terraform v0.10') }
+ its(:stdout) { should include('Terraform v0.11') }
end
|
test: BUMP terraform spec to `v0.11`
|
diff --git a/spec/dummy/config/initializers/assets.rb b/spec/dummy/config/initializers/assets.rb
index abc1234..def5678 100644
--- a/spec/dummy/config/initializers/assets.rb
+++ b/spec/dummy/config/initializers/assets.rb
@@ -8,4 +8,5 @@
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
-# Rails.application.config.assets.precompile += %w( search.js )
+# TODO make sure we don't have to this!
+Rails.application.config.assets.precompile += %w( backend/tree.js )
|
Add todo regarding filthy tree.js
|
diff --git a/spec/examples/library_with_fines_spec.rb b/spec/examples/library_with_fines_spec.rb
index abc1234..def5678 100644
--- a/spec/examples/library_with_fines_spec.rb
+++ b/spec/examples/library_with_fines_spec.rb
@@ -31,7 +31,6 @@ it "should be re-parsable via .from_xml" do
lib_reparsed = LibraryWithFines.from_xml(library.to_xml.to_s)
lib_reparsed.name.should == library.name
- puts lib_reparsed.to_xml.xpath('name')
lib_reparsed.fines.should == library.fines
end
|
Drop debug statement in spec
|
diff --git a/spec/jobs/reports_generation_job_spec.rb b/spec/jobs/reports_generation_job_spec.rb
index abc1234..def5678 100644
--- a/spec/jobs/reports_generation_job_spec.rb
+++ b/spec/jobs/reports_generation_job_spec.rb
@@ -20,8 +20,27 @@ end
context 'executes perform' do
-
- before { campaign.save }
+ let(:report_data) { { id: "42694e9e57",
+ emails_sent: 200,
+ bounces: {
+ hard_bounces: 0,
+ soft_bounces: 2,
+ syntax_errors: 0
+ },
+ forwards: {
+ forwards_count: 0,
+ forwards_opens: 0
+ },
+ opens: {
+ opens_total: 186,
+ unique_opens: 100,
+ open_rate: 42,
+ last_open: "2015-09-15T19:15:47+00:00"
+ } }.with_indifferent_access }
+ before do
+ campaign.update_stats(report_data)
+ campaign.save
+ end
subject(:job) { described_class.perform_later(campaign.id) }
|
Fix rspec for reports generation job
|
diff --git a/db/migrate/20160620141513_add_webhook_to_organizations.rb b/db/migrate/20160620141513_add_webhook_to_organizations.rb
index abc1234..def5678 100644
--- a/db/migrate/20160620141513_add_webhook_to_organizations.rb
+++ b/db/migrate/20160620141513_add_webhook_to_organizations.rb
@@ -1,6 +1,6 @@ class AddWebhookToOrganizations < ActiveRecord::Migration
def change
- add_column :organizations, :webhook_id, :string, unique: true
+ add_column :organizations, :webhook_id, :string
add_column :organizations, :is_webhook_active, :boolean, default: false
end
end
|
Cut invalid option `:unique` passed to `add_column`
|
diff --git a/TheSpot/app/controllers/spots_controller.rb b/TheSpot/app/controllers/spots_controller.rb
index abc1234..def5678 100644
--- a/TheSpot/app/controllers/spots_controller.rb
+++ b/TheSpot/app/controllers/spots_controller.rb
@@ -12,6 +12,12 @@ end
private
+
+ def spot_params
+ params.require(:user).permit([:name, :address, :phone, :website, :price, :photo])
+
+ end
+
def load_spot
@spot = Spot.find(params[:id])
end
|
Add strong params for spots
|
diff --git a/lib/puppet/provider/mikrotik_logging_rule/mikrotik_api.rb b/lib/puppet/provider/mikrotik_logging_rule/mikrotik_api.rb
index abc1234..def5678 100644
--- a/lib/puppet/provider/mikrotik_logging_rule/mikrotik_api.rb
+++ b/lib/puppet/provider/mikrotik_logging_rule/mikrotik_api.rb
@@ -11,10 +11,13 @@ end
def self.loggingRule(rule)
+ topics = rule['topics'].split(',')
+ name = topics.join('_') + "_" + rule['action']
+
new(
:ensure => :present,
- :name => "#{rule['topics']}_#{rule['action']}",
- :topics => rule['topics'].split(','),
+ :name => name,
+ :topics => topics,
:action => rule['action']
)
end
|
Allow multiple logging topics to be managed in 1 rule.
|
diff --git a/serverspec/spec/common/man_spec.rb b/serverspec/spec/common/man_spec.rb
index abc1234..def5678 100644
--- a/serverspec/spec/common/man_spec.rb
+++ b/serverspec/spec/common/man_spec.rb
@@ -1,5 +1,5 @@ require 'spec_helper'
describe command('which man') do
- it { should return_exit_status 0 }
+ its(:exit_status) { should eq 0 }
end
|
Change test script to follow Serverspec V2
|
diff --git a/seo_meta.gemspec b/seo_meta.gemspec
index abc1234..def5678 100644
--- a/seo_meta.gemspec
+++ b/seo_meta.gemspec
@@ -6,10 +6,10 @@ s.email = 'parndt@gmail.com'
s.version = '1.1.1'
s.description = 'SEO Meta tags plugin for Ruby on Rails'
- s.date = '2011-05-20'
+ s.date = '2011-08-12'
s.summary = 'SEO Meta tags plugin'
s.require_paths = %w(lib)
s.files = Dir['lib/**/*', 'db/**/*', 'app/**/*', 'config/**/*', '*.md']
- s.add_dependency 'refinerycms-generators', '~> 1.1.0'
+ s.add_dependency 'refinerycms-generators', '~> 1'
end
|
Allow use of more versions of generators
|
diff --git a/spec/features/user_account_spec.rb b/spec/features/user_account_spec.rb
index abc1234..def5678 100644
--- a/spec/features/user_account_spec.rb
+++ b/spec/features/user_account_spec.rb
@@ -10,7 +10,7 @@ fill_in "Email", with: @email
page.find('#user_password').set "secrets"
fill_in "Password confirmation", with: "secrets"
- click_button "Sign up"
+ click_button "Sign me up!"
end
expect(mailbox_for(@email).size).to eq 1
|
Fix a broken spec, oops!
|
diff --git a/spec/models/alternate_name_spec.rb b/spec/models/alternate_name_spec.rb
index abc1234..def5678 100644
--- a/spec/models/alternate_name_spec.rb
+++ b/spec/models/alternate_name_spec.rb
@@ -1,24 +1,22 @@ require 'spec_helper'
describe AlternateName do
- before (:each) do
- @an = FactoryGirl.create(:alternate_tomato)
- end
+ let(:an) { FactoryGirl.create(:alternate_eggplant) }
it 'should save a basic alternate name' do
- @an.save.should be_true
+ expect(an.save).to be_true
end
it 'should be possible to add multiple alternate names to a crop' do
- crop = @an.crop
+ crop = an.crop
an2 = AlternateName.create(
:name => "really alternative tomato",
:crop_id => crop.id,
- :creator_id => @an.creator.id
+ :creator_id => an.creator.id
)
crop.alternate_names << an2
- crop.alternate_names.should include @an
- crop.alternate_names.should include an2
+ expect(crop.alternate_names).to include an
+ expect(crop.alternate_names).to include an2
end
end
|
Fix model tests for alternate names.
|
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -1,5 +1,5 @@ class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
- protect_from_forgery with: :exception
+ protect_from_forgery with: :null_session
end
|
Make those patch requests work again.
|
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -14,6 +14,9 @@ def current_format
document_types.fetch(params.fetch(:document_type, nil), nil)
end
+
+ # This Struct is for the document_types method below
+ FormatStruct = Struct.new(:klass, :document_type, :format_name, :title)
def document_types
# For each format that follows the standard naming convention, this
@@ -41,11 +44,11 @@
data.map do |k, v|
{
- k.downcase.parameterize.pluralize => OpenStruct.new(
- klass: v,
- document_type: k.downcase.parameterize.pluralize,
- format_name: k.downcase.parameterize.underscore,
- title: k,
+ k.downcase.parameterize.pluralize => FormatStruct.new(
+ v,
+ k.downcase.parameterize.pluralize,
+ k.downcase.parameterize.underscore,
+ k
)
}
end.reduce({}, :merge)
|
Refactor current_format to use a Struct
This commit changes `current_format` to be a hash of Structs.
/cc @h-lame
|
diff --git a/app/controllers/restaurants_controller.rb b/app/controllers/restaurants_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/restaurants_controller.rb
+++ b/app/controllers/restaurants_controller.rb
@@ -1,5 +1,5 @@ class RestaurantsController < ApplicationController
- before_action :set_post, except: %i(index create)
+ before_action :set_restaurant, except: %i(index create)
def index
@restaurants = policy_scope(Restaurant)
|
Fix typo in before action
|
diff --git a/lib/citrus/core/execute_build_service.rb b/lib/citrus/core/execute_build_service.rb
index abc1234..def5678 100644
--- a/lib/citrus/core/execute_build_service.rb
+++ b/lib/citrus/core/execute_build_service.rb
@@ -16,13 +16,27 @@ def start(build)
path = workspace_builder.create_workspace(build)
configuration = configuration_loader.load_from_path(path)
+ notify_build_start(build)
+ result = test_runner.start(configuration, path)
+ notify_build_result(build, result)
+ rescue ConfigurationError => error
+ notify_build_abort(build, error)
+ raise
+ end
+
+ protected
+
+ def notify_build_start(build)
publish(:build_started, build)
- result = test_runner.start(configuration, path)
+ end
+
+ def notify_build_result(build, result)
publish(:build_succeeded, build, result.output) if result.success?
- publish(:build_failed, build, result.output) if result.failure?
- rescue ConfigurationError => error
+ publish(:build_failed, build, result.output) if result.failure?
+ end
+
+ def notify_build_abort(build, error)
publish(:build_aborted, build, error)
- raise error
end
end
|
Move publishing to private methods.
They make visual clutter and I'd love to see them somewhere else
so aspects maybe?
|
diff --git a/lib/fastly_nsq/message_queue/listener.rb b/lib/fastly_nsq/message_queue/listener.rb
index abc1234..def5678 100644
--- a/lib/fastly_nsq/message_queue/listener.rb
+++ b/lib/fastly_nsq/message_queue/listener.rb
@@ -4,7 +4,7 @@ @topic = topic
@channel = channel
@processor = processor || DEFAULT_PROCESSOR
- @consumer = consumer
+ @consumer = consumer || MessageQueue::Consumer.new(consumer_params)
end
def go
@@ -28,17 +28,13 @@
private
- attr_reader :channel, :topic, :processor
+ attr_reader :channel, :topic, :processor, :consumer
DEFAULT_PROCESSOR = ->(body, topic) { MessageProcessor.new(message_body: body, topic: topic).go }
def process_one_message
message = consumer.pop
processor.call(message.body, topic)
message.finish
- end
-
- def consumer
- @consumer ||= MessageQueue::Consumer.new(consumer_params)
end
def consumer_params
|
Test wants this built at instantiation
|
diff --git a/app/services/asset_disposition_service.rb b/app/services/asset_disposition_service.rb
index abc1234..def5678 100644
--- a/app/services/asset_disposition_service.rb
+++ b/app/services/asset_disposition_service.rb
@@ -1,7 +1,8 @@ #------------------------------------------------------------------------------
#
-# AssetService
+# AssetDispositionService
#
+# Contains business logic associated with managing the disposition of assets
#
#
#------------------------------------------------------------------------------
@@ -15,21 +16,32 @@ #
#------------------------------------------------------------------------------
- def disposition_list(fiscal_year=nil, asset_type_id=nil, asset_subtype_id=nil)
+ def disposition_list(org, fiscal_year=current_planning_year_year, asset_type_id=nil, asset_subtype_id=nil)
+
+ Rails.logger.debug "AssetDispositionService: disposition_list()"
+ #
+ if org.nil?
+ Rails.logger.warn "AssetDispositionService: disposition list: Org ID cannot be null"
+ return []
+ end
+
# Start to set up the query
conditions = []
values = []
+ # Filter for the selected org
+ conditions << "organization_id = ?"
+ values << org.id
+
+ # Can't already be marked as disposed
conditions << "disposition_date IS NOT NULL"
- if fiscal_year.nil?
- conditions << "scheduled_replacement_year >= ?"
- values << current_fiscal_year_year
- else
- conditions << "scheduled_replacement_year = ?"
- values << fiscal_year
- end
+ # Scheduled replacement year, defaults to the next planning year unless
+ # specified
+ conditions << "scheduled_replacement_year >= ?"
+ values << fiscal_year
+ # Limit by asset type
unless asset_type_id.nil?
conditions << "asset_type_id = ?"
values << asset_type_id
|
Fix up the asset disposition service to limit to a specific organization and set the default fiscal year to the current planning year.
|
diff --git a/Casks/textexpander.rb b/Casks/textexpander.rb
index abc1234..def5678 100644
--- a/Casks/textexpander.rb
+++ b/Casks/textexpander.rb
@@ -2,11 +2,14 @@ if MacOS.release == :snow_leopard
version '3.4.2'
sha256 '87859d7efcbfe479e7b78686d4d3f9be9983b2c7d68a6122acea10d4efbb1bfa'
- elsif MacOS.release >= :lion
+ elsif MacOS.release >= :lion && MacOS.release <= :mavericks
version '4.3.6'
sha256 'ec90d6bd2e76bd14c0ca706d255c9673288f406b772e5ae6022e2dbe27848ee9'
+ elsif MacOS.release >= :yosemite
+ version '5.0'
+ sha256 'd0c4149fec181cd61579ac0dba0ad8e34153b09da4ee818068bd9f35d668b858'
appcast 'http://updates.smilesoftware.com/com.smileonmymac.textexpander.xml',
- :sha256 => 'bad991e25d6cb73352b462a1b503bd64c616bd751057f677944af5f96c1353cf'
+ :sha256 => '08fa50296cf69255e5e27cf80b0c3a37a49873d57f37432b533ae1a207aabd4c'
end
url "http://cdn.smilesoftware.com/TextExpander_#{version}.zip"
|
Update TextExpander to version 5.0
This commit updates the logic for determining which version of
TextExpander to install. Version 5.0 is only supported on Yosemite
and upwards, so I've modified the existing 4.3.6 case to be for
Lion to Mavericks only, and added a new case for Yosemite upwards.
I ran `shasum -a 256` on the file at the `appcast` URL - it is different
from that listed for 4.3.6 so I've updated, but I'm not 100% sure I'm
doing the right thing there.
|
diff --git a/starscope.gemspec b/starscope.gemspec
index abc1234..def5678 100644
--- a/starscope.gemspec
+++ b/starscope.gemspec
@@ -4,7 +4,7 @@ gem.name = 'starscope'
gem.version = StarScope::VERSION
gem.summary = "A code indexer and analyzer"
- gem.description = "A tool like the venerable cscope, but for ruby and other languages"
+ gem.description = "A tool like the venerable cscope, but for ruby, go and other languages"
gem.authors = ["Evan Huus"]
gem.homepage = 'https://github.com/eapache/starscope'
gem.email = 'eapache@gmail.com'
|
Add golang to the gem description
|
diff --git a/FSImageViewer.podspec b/FSImageViewer.podspec
index abc1234..def5678 100644
--- a/FSImageViewer.podspec
+++ b/FSImageViewer.podspec
@@ -16,7 +16,6 @@ s.requires_arc = true
s.source_files = 'FSImageViewer/FS*.{h,m}'
- s.resources = 'FSImageViewer.bundle'
s.framework = 'Foundation', 'UIKit', 'CoreGraphics', 'QuartzCore', 'Security', 'CFNetwork'
|
Remove resources from the podspec.
|
diff --git a/recipes/apt_pgdg_postgresql.rb b/recipes/apt_pgdg_postgresql.rb
index abc1234..def5678 100644
--- a/recipes/apt_pgdg_postgresql.rb
+++ b/recipes/apt_pgdg_postgresql.rb
@@ -1,4 +1,4 @@-if not %w(jessie squeeze wheezy sid lucid precise saucy trusty utopic wily).include? node['postgresql']['pgdg']['release_apt_codename']
+if not %w(jessie squeeze wheezy sid lucid precise saucy trusty utopic wily xenial).include? node['postgresql']['pgdg']['release_apt_codename']
raise "Not supported release by PGDG apt repository"
end
|
Add 16.04 Xenial to the allowed list
|
diff --git a/test/dummy/app/models/user.rb b/test/dummy/app/models/user.rb
index abc1234..def5678 100644
--- a/test/dummy/app/models/user.rb
+++ b/test/dummy/app/models/user.rb
@@ -1,5 +1,5 @@ class User < ActiveRecord::Base
- if Rails.version[0..2] == '3.2'
+ if Rails.version[0] == '3'
attr_accessible :email, :password
end
|
Use attr_accessible for any rails 3 builds
|
diff --git a/lib/hotspots/exit.rb b/lib/hotspots/exit.rb
index abc1234..def5678 100644
--- a/lib/hotspots/exit.rb
+++ b/lib/hotspots/exit.rb
@@ -9,7 +9,7 @@ end
def perform
- puts @message
+ $stderr.puts @message
exit @code
end
end
@@ -23,7 +23,7 @@ end
def perform
- puts @message
+ $stdout.puts @message
exit @code
end
end
|
Send error messages to STDERR
|
diff --git a/lib/kaminari-i18n.rb b/lib/kaminari-i18n.rb
index abc1234..def5678 100644
--- a/lib/kaminari-i18n.rb
+++ b/lib/kaminari-i18n.rb
@@ -0,0 +1,23 @@+require 'rails'
+module KaminariI18n
+ class Engine < ::Rails::Engine
+ end
+
+ class Railtie < ::Rails::Railtie #:nodoc:
+ initializer 'kaminari-i18n' do |app|
+ KaminariI18n::Railtie.instance_eval do
+ pattern = pattern_from app.config.i18n.available_locales
+
+ files = Dir[File.join(File.dirname(__FILE__), '../locales', "#{pattern}.yml")]
+ I18n.load_path.concat(files)
+ end
+ end
+
+ protected
+
+ def self.pattern_from(args)
+ array = Array(args || [])
+ array.blank? ? '*' : "{#{array.join ','}}"
+ end
+ end
+end
|
Add railtie to load locales automatically
Based on https://github.com/svenfuchs/rails-i18n/blob/master/lib/rails_i18n/railtie.rb
|
diff --git a/db/migrate/20130804154805_setup_hstore.rb b/db/migrate/20130804154805_setup_hstore.rb
index abc1234..def5678 100644
--- a/db/migrate/20130804154805_setup_hstore.rb
+++ b/db/migrate/20130804154805_setup_hstore.rb
@@ -3,7 +3,7 @@ # Creating hstore extension in a given database requires
# superuser permission, which we will not have on production. It has
# to be run manually.
- if RAILS_ENV != 'production'
+ if !Rails.env.production?
execute "CREATE EXTENSION IF NOT EXISTS hstore"
end
end
@@ -12,7 +12,7 @@ # Removing hstore extension in a given database requires
# superuser permission, which we will not have on production.
# It has to be run manually.
- if RAILS_ENV != 'production'
+ if !Rails.env.production?
execute "DROP EXTENSION IF EXISTS hstore"
end
end
|
Fix check for production hstore migration.
|
diff --git a/lib/tasks/admin.rake b/lib/tasks/admin.rake
index abc1234..def5678 100644
--- a/lib/tasks/admin.rake
+++ b/lib/tasks/admin.rake
@@ -3,10 +3,10 @@ namespace :admin do
desc "Creates role."
- task :create_role, :role, :needs => :environment do |t, args|
+ task :create_role, [:role] => :environment do |t, args|
unless args[:role]
- puts "You have to specify role name. Tip: 'rake fb:admin:create_role[admin]'"
+ puts "You have to specify role name. Tip: 'rake base_app:admin:create_role[admin]'"
next
end
|
Fix create role rake task deprecation warrning.
|
diff --git a/security/cve_2010_1330_spec.rb b/security/cve_2010_1330_spec.rb
index abc1234..def5678 100644
--- a/security/cve_2010_1330_spec.rb
+++ b/security/cve_2010_1330_spec.rb
@@ -0,0 +1,21 @@+require_relative '../spec_helper'
+
+describe "String#gsub" do
+
+ it "resists CVE-2010-1330 by raising an exception on invalid UTF-8 bytes" do
+ # This original vulnerability talked about KCODE, which is no longer
+ # used. Instead we are forcing encodings here. But I think the idea is the
+ # same - we want to check that Ruby implementations raise an error on
+ # #gsub on a string in the UTF-8 encoding but with invalid an UTF-8 byte
+ # sequence.
+
+ str = "\xF6<script>"
+ str.force_encoding Encoding::ASCII_8BIT
+ str.gsub(/</, "<").should == "\xF6<script>".b
+ str.force_encoding Encoding::UTF_8
+ lambda {
+ str.gsub(/</, "<")
+ }.should raise_error(ArgumentError, /invalid byte sequence in UTF-8/)
+ end
+
+end
|
Write a spec for CVE-2010-1330
|
diff --git a/app/models/competitions/concerns/competition/categories.rb b/app/models/competitions/concerns/competition/categories.rb
index abc1234..def5678 100644
--- a/app/models/competitions/concerns/competition/categories.rb
+++ b/app/models/competitions/concerns/competition/categories.rb
@@ -1,6 +1,15 @@ module Concerns
module Competition
module Categories
+ def category_names
+ [ friendly_name ]
+ end
+
+ # Only consider results from categories. Default to false: use all races in year.
+ def categories?
+ false
+ end
+
# Array of ids (integers)
# +race+ category, +race+ category's siblings, and any competition categories
def category_ids_for(race)
|
Add category_names to allow shared create_races across competitions. Add source_events? method to scope results by source events or not.
|
diff --git a/MPMessagePack.podspec b/MPMessagePack.podspec
index abc1234..def5678 100644
--- a/MPMessagePack.podspec
+++ b/MPMessagePack.podspec
@@ -11,11 +11,9 @@
s.dependency "GHODictionary"
- s.platform = :ios, "6.0"
s.ios.deployment_target = "6.0"
s.ios.source_files = "MPMessagePack/**/*.{c,h,m}", "RPC/**/*.{c,h,m}"
- s.platform = :osx, "10.8"
s.osx.deployment_target = "10.8"
s.osx.source_files = "MPMessagePack/**/*.{c,h,m}", "RPC/**/*.{c,h,m}", "XPC/**/*.{c,h,m}"
|
Remove `platform` attributes in lieu of `deployment_target`
Fixes problem that causes pod install to error out with:
Reference:
https://guides.cocoapods.org/syntax/podspec.html#platform
|
diff --git a/db/data_migration/20150427095111_archive_all_worldwide_priorities.rb b/db/data_migration/20150427095111_archive_all_worldwide_priorities.rb
index abc1234..def5678 100644
--- a/db/data_migration/20150427095111_archive_all_worldwide_priorities.rb
+++ b/db/data_migration/20150427095111_archive_all_worldwide_priorities.rb
@@ -0,0 +1,11 @@+reason = "This information has been archived. See [what the UK government is doing around the world](https://www.gov.uk/government/world)."
+
+WorldwidePriority.where(state: "published").each do |wp|
+ edition = wp.latest_edition
+ puts "Archiving #{edition.title} - edition #{edition.id}"
+ edition.build_unpublishing(explanation: reason, unpublishing_reason_id: UnpublishingReason::Archived.id)
+ archiver = Whitehall.edition_services.archiver(edition)
+ unless archiver.perform!
+ puts "Could not archive edition: #{archiver.failure_reason}"
+ end
+end
|
Archive all Published Worldwide Priorities
This commit adds a data migration to archive all published Worldwide Priorities.
|
diff --git a/db/migrate/20200309152257_change_query_id_in_gdata_visualizations.rb b/db/migrate/20200309152257_change_query_id_in_gdata_visualizations.rb
index abc1234..def5678 100644
--- a/db/migrate/20200309152257_change_query_id_in_gdata_visualizations.rb
+++ b/db/migrate/20200309152257_change_query_id_in_gdata_visualizations.rb
@@ -0,0 +1,11 @@+# frozen_string_literal: true
+
+class ChangeQueryIdInGdataVisualizations < ActiveRecord::Migration[5.2]
+ def change
+ add_reference :gdata_visualizations, :dataset, index: true
+
+ ::GobiertoData::Visualization.all.each do |visualization|
+ visualization.update_attribute(:dataset_id, visualization.query.dataset_id)
+ end
+ end
+end
|
Add migration to change reference in visualizations table from query to dataset
|
diff --git a/TransitionKit.podspec b/TransitionKit.podspec
index abc1234..def5678 100644
--- a/TransitionKit.podspec
+++ b/TransitionKit.podspec
@@ -8,4 +8,6 @@ s.source = { :git => 'https://github.com/blakewatters/TransitionKit.git', :tag => '1.1.1' }
s.source_files = 'Code'
s.requires_arc = true
+ s.ios.deployment_target = '5.0'
+ s.osx.deployment_target = '10.7'
end
|
Add explicit iOS and OS X deployment targets
|
diff --git a/app/models/contact.rb b/app/models/contact.rb
index abc1234..def5678 100644
--- a/app/models/contact.rb
+++ b/app/models/contact.rb
@@ -10,9 +10,9 @@
def formatted_birthday
if !birthday.nil?
- "#{birthday.month}/#{birthday.day}/#{birthday.year}"
+ "Birthday: #{birthday.month}/#{birthday.day}/#{birthday.year}"
else
- "Please enter a birthday!"
+ "Enter friend's birthday!"
end
end
|
Change the notice message for missing birthday field
|
diff --git a/app/models/project.rb b/app/models/project.rb
index abc1234..def5678 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -17,7 +17,7 @@ square: '200x200#',
medium: '300x300>'
},
- default_url: "/images/:style/missing.png",
+ default_url: "https://#{Rails.application.secrets.s3_host_name}/#{Rails.application.secrets.s3_bucket_name}/images/:style/missing.png",
storage: :s3,
s3_credentials: Proc.new{ |a| a.instance.s3_credentials }
|
Fix url path for default image.
|
diff --git a/app/models/request.rb b/app/models/request.rb
index abc1234..def5678 100644
--- a/app/models/request.rb
+++ b/app/models/request.rb
@@ -1,6 +1,6 @@ class Request < ActiveRecord::Base
#eval("attr_accessible #{column_names.map { |cn| cn.to_sym }.to_s.gsub(/\[|\]/,"")}")
- set_primary_key "service_request_id"
+ self.primary_key = "service_request_id"
attr_accessible *column_names
has_many :notes
end
|
Change set_primary_key to self.primary_key= per deprecation warning
|
diff --git a/app/models/request.rb b/app/models/request.rb
index abc1234..def5678 100644
--- a/app/models/request.rb
+++ b/app/models/request.rb
@@ -16,7 +16,7 @@ # Difference is returned in seconds; set to 45 minutes
(Time.now - created_at) <= 2700
else
- !is_fullfilled
+ !is_fulfilled
end
end
|
Fix typo in active? method.
|
diff --git a/lib/algorithmia/data/data_file.rb b/lib/algorithmia/data/data_file.rb
index abc1234..def5678 100644
--- a/lib/algorithmia/data/data_file.rb
+++ b/lib/algorithmia/data/data_file.rb
@@ -31,7 +31,6 @@ end
def delete
- raise AlgorithmiaNotFound.new("File not found.") if !self.exists?
response = @client.delete_file(@url)
case response["result"]["deleted"]
when 1
|
Remove existence check for deleting files
|
diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb
index abc1234..def5678 100644
--- a/spec/spec_helper_acceptance.rb
+++ b/spec/spec_helper_acceptance.rb
@@ -0,0 +1,22 @@+require 'beaker-rspec'
+
+hosts.each do |host|
+ # Install Puppet
+ on host, install_puppet
+end
+
+RSpec.configure do |c|
+ module_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
+
+ c.formatter = :documentation
+
+ # Configure all nodes in nodeset
+ c.before :suite do
+ # Install module
+ puppet_module_install(:source => module_root, :module_name => 'nsd')
+ hosts.each do |host|
+ on host, puppet('module', 'install', 'puppetlabs-stdlib'), {:acceptable_exit_codes => [0, 1]}
+ on host, puppet('module', 'install', 'puppetlabs-concat'), {:acceptable_exit_codes => [0, 1]}
+ end
+ end
+end
|
Add default spec acceptance helper
|
diff --git a/lib/crystal_api/store_endpoint.rb b/lib/crystal_api/store_endpoint.rb
index abc1234..def5678 100644
--- a/lib/crystal_api/store_endpoint.rb
+++ b/lib/crystal_api/store_endpoint.rb
@@ -5,7 +5,7 @@ class StoreEndpoint
attr_reader :base_url, :token
- class Response < Value.new(:parsed, :raw)
+ class Response < Value.new(:parsed, :raw, :json)
def to_s
"<CrystalApi::StoreEndpoint::Response parsed:#{parsed.class.name} raw.length:#{raw.length}>"
end
@@ -43,14 +43,13 @@ private
def wrap_response(raw)
- parsed = parse_response_body(raw)
+ json = JSON.parse(raw)
+ parsed = parse_response_body(json)
- Response.new(parsed, raw)
+ Response.new(parsed, raw, json)
end
- def parse_response_body(raw)
- json = JSON.parse(raw)
-
+ def parse_response_body(json)
if json.is_a?(Array)
json.map {|obj| parse(obj)}
else
|
Add parsed json to response
|
diff --git a/app/controllers/api/items_controller.rb b/app/controllers/api/items_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/api/items_controller.rb
+++ b/app/controllers/api/items_controller.rb
@@ -3,6 +3,7 @@ item_type_id = params[:item_type_id]
number = params[:number]
agenda_id = params[:agenda_id]
+ sections = params[:sections]
synopsis = params[:synopsis]
title = params[:title]
@@ -12,6 +13,7 @@ @items = @items.where("item_type_id = ?", item_type_id) if item_type_id.present?
@items = @items.where("lower(number) = ?", number.downcase) if number.present?
@items = @items.where("lower(title) LIKE ?", "%#{title.downcase}%") if title.present?
+ @items = @items.where("lower(sections) LIKE ?", "%#{sections.downcase}%") if sections.present?
@items = @items.where("lower(synopsis) LIKE ?", "%#{synopsis.downcase}%") if synopsis.present?
@items = @items.where("origin_id = ? AND origin_type = 'Agenda'", agenda_id) if agenda_id.present?
|
Add Search Into Sections For API Items
|
diff --git a/db/migrate/20170630075028_add_index_to_searcher_records.rb b/db/migrate/20170630075028_add_index_to_searcher_records.rb
index abc1234..def5678 100644
--- a/db/migrate/20170630075028_add_index_to_searcher_records.rb
+++ b/db/migrate/20170630075028_add_index_to_searcher_records.rb
@@ -7,6 +7,7 @@ d.up do
columns = [
"id",
+ "project_id",
"original_id",
"original_type",
"name #{opclass}",
@@ -33,6 +34,7 @@ end
when Redmine::Database.mysql?
columns = %i[
+ project_id
original_id
original_type
name
|
Add project_id to Groonga table via pgroonga index
|
diff --git a/lib/nark/event_gateway_emitter.rb b/lib/nark/event_gateway_emitter.rb
index abc1234..def5678 100644
--- a/lib/nark/event_gateway_emitter.rb
+++ b/lib/nark/event_gateway_emitter.rb
@@ -36,7 +36,7 @@ end
def post data
- response = @faraday.post do |request|
+ response = faraday.post do |request|
request.body = data.to_json
end
response.status == 201
|
Use memoiser instead of private instance
|
diff --git a/lib/psd/renderer/clipping_mask.rb b/lib/psd/renderer/clipping_mask.rb
index abc1234..def5678 100644
--- a/lib/psd/renderer/clipping_mask.rb
+++ b/lib/psd/renderer/clipping_mask.rb
@@ -12,7 +12,7 @@ mask_node = mask_node.next_sibling
end
- @mask = Canvas.new(mask_node)
+ @mask = MaskCanvas.new(mask_node)
end
def apply!
|
Apply mask to clipping mask before clipping
|
diff --git a/lib/thinking_sphinx/core/index.rb b/lib/thinking_sphinx/core/index.rb
index abc1234..def5678 100644
--- a/lib/thinking_sphinx/core/index.rb
+++ b/lib/thinking_sphinx/core/index.rb
@@ -2,7 +2,7 @@ extend ActiveSupport::Concern
included do
- attr_reader :reference, :offset
+ attr_reader :reference, :offset, :options
attr_writer :definition_block
end
|
Index options need to be accessible for SphinxQL middleware.
|
diff --git a/app/services/update_course_revisions.rb b/app/services/update_course_revisions.rb
index abc1234..def5678 100644
--- a/app/services/update_course_revisions.rb
+++ b/app/services/update_course_revisions.rb
@@ -17,7 +17,6 @@ end
def update_caches
- Article.update_all_caches(@course.articles)
ArticlesCourses.update_all_caches(@course.articles_courses)
CoursesUsers.update_all_caches(@course.courses_users)
@course.update_cache
|
Fix renaming call to Artice.update_all_caches
|
diff --git a/attributes/default.rb b/attributes/default.rb
index abc1234..def5678 100644
--- a/attributes/default.rb
+++ b/attributes/default.rb
@@ -17,7 +17,7 @@ # limitations under the License.
#
-default[:rackspace][:fog_version] = nil
+default[:rackspace][:fog_version] = "1.10.1"
default[:rackspace][:rackspace_username] = nil
default[:rackspace][:rackspace_apikey] = nil
default[:rackspace][:rackspace_auth_url] = "identity.api.rackspacecloud.com"
|
Use older version of fog to prevent json gem version collisions.
|
diff --git a/features/step_definitions/cucumber_steps.rb b/features/step_definitions/cucumber_steps.rb
index abc1234..def5678 100644
--- a/features/step_definitions/cucumber_steps.rb
+++ b/features/step_definitions/cucumber_steps.rb
@@ -1,13 +1,9 @@ Given /^a passing scenario "(.+)" with:$/ do |name, body|
@test_case = SteppingStone::GherkinCompiler.new.compile("Feature: test\nScenario: #{name}\n" << body)[0]
- @sut = SteppingStone::RbServer.new
+ sut = SteppingStone::RbServer.new
- unless defined?(Dsl)
- Dsl = @sut.dsl_module
- end
-
- module TestMapper
- extend Dsl
+ Module.new do
+ extend sut.dsl_module
include RSpec::Matchers
def_map "I add 4 and 5" => :add
@@ -21,6 +17,8 @@ @result.should eq(9)
end
end
+
+ @sut = sut
end
Given /^these passing hooks:$/ do |hooks|
|
Stop warnings when running features
|
diff --git a/lib/shared_infrastructure/runner/rails.rb b/lib/shared_infrastructure/runner/rails.rb
index abc1234..def5678 100644
--- a/lib/shared_infrastructure/runner/rails.rb
+++ b/lib/shared_infrastructure/runner/rails.rb
@@ -1,5 +1,11 @@ module Runner
class Rails < Base
+ def main
+ builder = super
+ FileUtils.mkdir_p(File.dirname(Systemd.unit_file("example.com"))) if Nginx.root?
+ builder
+ end
+
def process_options
super(Nginx::Builder::RailsHttp, Nginx::Builder::RailsHttps)
end
|
Create fake directory for unit file.
|
diff --git a/app/models/repositories/list_repository.rb b/app/models/repositories/list_repository.rb
index abc1234..def5678 100644
--- a/app/models/repositories/list_repository.rb
+++ b/app/models/repositories/list_repository.rb
@@ -0,0 +1,11 @@+module ListRepository
+ extend self
+
+ def find_by_date(date)
+ ListData.where(date: date)
+ end
+
+ def create_empty(title, date)
+ ListData.create(title: title, date: date)
+ end
+end
|
Add list repository. The repository is an interface to the database and handles mapping entities (pure Ruby objects) to data models (Mongoid documents)
|
diff --git a/spec/requests/geckoboard/widgets_spec.rb b/spec/requests/geckoboard/widgets_spec.rb
index abc1234..def5678 100644
--- a/spec/requests/geckoboard/widgets_spec.rb
+++ b/spec/requests/geckoboard/widgets_spec.rb
@@ -0,0 +1,27 @@+# frozen_string_literal: true
+
+RSpec.describe 'Widgets', type: :request, allow_forgery_protection: true do
+ describe 'GET #claim_creation_source' do
+ context 'with format html' do
+ before { get claim_creation_source_geckoboard_api_widgets_path(format: :html) }
+
+ it { expect(response).to render_template(:claim_creation_source) }
+ end
+
+ context 'with format json' do
+ # rubocop:disable RSpec/AnyInstance
+ before do
+ allow_any_instance_of(Stats::BaseDataGenerator).to receive(:run).and_return(payload)
+ get claim_creation_source_geckoboard_api_widgets_path(format: :json)
+ end
+ # rubocop:enable RSpec/AnyInstance
+
+ let(:payload) { { test: 'test' } }
+
+ specify { expect(response.content_type).to eq('application/json; charset=utf-8') }
+ specify { expect(response.body).to eql(payload.to_json) }
+
+ it_behaves_like 'a disabler of view only actions'
+ end
+ end
+end
|
Add missing geckoboard request spec
|
diff --git a/app/controllers/admin/statistical_release_announcements_controller.rb b/app/controllers/admin/statistical_release_announcements_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/admin/statistical_release_announcements_controller.rb
+++ b/app/controllers/admin/statistical_release_announcements_controller.rb
@@ -2,11 +2,11 @@ before_filter :find_release_announcement, only: [:edit, :update, :destroy]
def new
- @release_announcement = build_announcement(organisation_id: current_user.organisation.try(:id))
+ @release_announcement = build_release_announcement(organisation_id: current_user.organisation.try(:id))
end
def create
- @release_announcement = build_announcement(statistical_release_announcement_params)
+ @release_announcement = build_release_announcement(release_announcement_params)
if @release_announcement.save
redirect_to admin_root_url, notice: "Announcement saved successfully"
@@ -19,7 +19,7 @@ end
def update
- if @release_announcement.update_attributes(statistical_release_announcement_params)
+ if @release_announcement.update_attributes(release_announcement_params)
redirect_to admin_root_url, notice: "Announcement updated successfully"
else
render :edit
@@ -40,11 +40,11 @@ @release_announcement = StatisticalReleaseAnnouncement.find(params[:id])
end
- def build_announcement(attributes={})
+ def build_release_announcement(attributes={})
current_user.statistical_release_announcements.new(attributes)
end
- def statistical_release_announcement_params
+ def release_announcement_params
params.require(:statistical_release_announcement).permit(
:title, :summary, :expected_release_date, :display_release_date_override,
:organisation_id, :topic_id, :publication_type_id
|
Use consistent naming for release announcements in controller code
|
diff --git a/app/controllers/regions_controller.rb b/app/controllers/regions_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/regions_controller.rb
+++ b/app/controllers/regions_controller.rb
@@ -1,5 +1,4 @@ class RegionsController < ApplicationController
-# inherit_resources
layout 'home'
@@ -9,11 +8,11 @@ before_filter :set_default_depth
def index
- # @regions = collection
+ @regions = Region.all
end
def show
- # @region = resource
+ @region = Region.find(params[:id])
end
|
Remove inherited resources from regions-controller
|
diff --git a/app/models/course/lesson_plan_item.rb b/app/models/course/lesson_plan_item.rb
index abc1234..def5678 100644
--- a/app/models/course/lesson_plan_item.rb
+++ b/app/models/course/lesson_plan_item.rb
@@ -0,0 +1,26 @@+class Course::LessonPlanItem < ActiveRecord::Base
+ actable
+ stampable
+ validates :base_exp, numericality: { only_integer: true }
+ validates :time_bonus_exp, numericality: { only_integer: true }
+ validates :extra_bonus_exp, numericality: { only_integer: true }
+
+ after_initialize :set_default_values, if: :new_record?
+
+ # Gives the maximum number of EXP Points that an EXP-awarding item
+ # is allocated to give, which is the sum of base and bonus EXPs.
+ #
+ # @return [Integer] Maximum EXP awardable.
+ def total_exp
+ base_exp + time_bonus_exp + extra_bonus_exp
+ end
+
+ private
+
+ # Sets default EXP values
+ def set_default_values
+ self.base_exp ||= 0
+ self.time_bonus_exp ||= 0
+ self.extra_bonus_exp ||= 0
+ end
+end
|
Add lesson plan item model
|
diff --git a/app/models/miq_widget_set/set_data.rb b/app/models/miq_widget_set/set_data.rb
index abc1234..def5678 100644
--- a/app/models/miq_widget_set/set_data.rb
+++ b/app/models/miq_widget_set/set_data.rb
@@ -1,7 +1,7 @@ module MiqWidgetSet::SetData
extend ActiveSupport::Concern
- SET_DATA_COLS = %i[col1 col2 col3].freeze
+ SET_DATA_COLS = %i[col1 col2].freeze
included do
validate :set_data do
|
Remove col3 from dashboard widgets
|
diff --git a/Casks/clion-eap.rb b/Casks/clion-eap.rb
index abc1234..def5678 100644
--- a/Casks/clion-eap.rb
+++ b/Casks/clion-eap.rb
@@ -1,6 +1,6 @@ cask :v1 => 'clion-eap' do
- version '141.102.4'
- sha256 '63227a0613d0406087b045b9eb17fadcc9affaed9707e2adcce7d0c0d37ae2a0'
+ version '141.351.4'
+ sha256 '3be78cf0107b533cc6ccf089817876bf087b11192fc9195fb8aa971b1402ae78'
url "http://download.jetbrains.com/cpp/CLion-#{version}.dmg"
name 'CLion EAP'
|
Upgrade CLion EAP.app to build 141.351.4
|
diff --git a/Casks/scala-ide.rb b/Casks/scala-ide.rb
index abc1234..def5678 100644
--- a/Casks/scala-ide.rb
+++ b/Casks/scala-ide.rb
@@ -3,5 +3,5 @@ homepage 'http://scala-ide.org/'
version '3.0.2'
sha1 '5d467d9054d940cf7e2f750ff60aa3bd11e8dae3'
- link 'eclipse/Eclipse.app'
+ link 'eclipse/Eclipse.app', :target => 'Scala IDE.app'
end
|
Rename application link to 'Scala IDE'
This is useful to install the Scala IDE together with other Eclipse installations.
|
diff --git a/lib/twitter/client/friends_and_followers.rb b/lib/twitter/client/friends_and_followers.rb
index abc1234..def5678 100644
--- a/lib/twitter/client/friends_and_followers.rb
+++ b/lib/twitter/client/friends_and_followers.rb
@@ -3,7 +3,6 @@ module FriendsAndFollowers
# TODO: Optional merge user into options if user is nil
def friend_ids(*args)
- authenticate
options = args.last.is_a?(Hash) ? args.pop : {}
user = args.first
merge_user_into_options!(user, options)
@@ -12,7 +11,6 @@ end
def follower_ids(*args)
- authenticate
options = args.last.is_a?(Hash) ? args.pop : {}
user = args.first
merge_user_into_options!(user, options)
|
Remove remaining calls to authenticate
|
diff --git a/factory_inspector.gemspec b/factory_inspector.gemspec
index abc1234..def5678 100644
--- a/factory_inspector.gemspec
+++ b/factory_inspector.gemspec
@@ -6,7 +6,7 @@ gem.email = ["david.kennedy@examtime.com"]
gem.description = %q{This very simple gem generates reports on how FactoryGirl factories are being used in your test runs.}
gem.summary = %q{Reports on how FactoryGirl is used in test runs.}
- gem.homepage = ""
+ gem.homepage = "https://github.com/ExamTime/factory_inspector"
gem.files = `git ls-files`.split($\)
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
Add GitHub page as homepage
|
diff --git a/app/models/commute.rb b/app/models/commute.rb
index abc1234..def5678 100644
--- a/app/models/commute.rb
+++ b/app/models/commute.rb
@@ -29,14 +29,10 @@
private
def is_float(input)
- if (input.nil? || input.blank?)
- return false
- end
- if (input.is_a? Float)
+ begin
+ Float(input)
return true
- elsif (input.to_f != 0.0)
- return true
- else
+ rescue
return false
end
end
|
Improve validity checking for coordinate inputs
|
diff --git a/app/models/species.rb b/app/models/species.rb
index abc1234..def5678 100644
--- a/app/models/species.rb
+++ b/app/models/species.rb
@@ -19,8 +19,27 @@ false
end
+ # Return the species list as 1 array
def self.all
+ (self.freshwater + self.saltwater).sort
+ end
+
+ # Find only the saltwater species
+ def self.saltwater
+ load_data['saltwater'].sort
+ end
+
+ # Find only the freshwater species
+ def self.freshwater
+ load_data['freshwater'].sort
+ end
+
+ private
+
+ def self.load_data
YAML.load_file FILE_PATH
end
+ # Raise an exception if this method is called from a public context
+ private_class_method :load_data
end
|
Add scope methods to Species
Added `freshwater`, `saltwater` and `all` to the Species model.
|
diff --git a/OMPromises.podspec b/OMPromises.podspec
index abc1234..def5678 100644
--- a/OMPromises.podspec
+++ b/OMPromises.podspec
@@ -13,7 +13,7 @@ s.default_subspec = 'Core'
s.subspec 'Core' do |cs|
- cs.source_files = 'OMPromises/*.{h,m}'
+ cs.source_files = 'OMPromises/**.{h,m}'
cs.public_header_files = 'OMPromises/{OMPromises,OMPromise,OMDeferred}.h'
end
|
Fix bug in podspec file
|
diff --git a/config/application.rb b/config/application.rb
index abc1234..def5678 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -17,8 +17,8 @@ # config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
- # config.i18n.default_locale = :de
+ config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}').to_s]
+ config.i18n.default_locale = :ja
# Do not swallow errors in after_commit/after_rollback callbacks.
config.active_record.raise_in_transactional_callbacks = true
|
Set default locales and load paths
|
diff --git a/config/application.rb b/config/application.rb
index abc1234..def5678 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -14,7 +14,7 @@
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
- # config.time_zone = 'Central Time (US & Canada)'
+ config.time_zone = 'Eastern Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
Use US Eastern Time as default time zone
|
diff --git a/config/application.rb b/config/application.rb
index abc1234..def5678 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -6,7 +6,7 @@ # you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
-RETENTION_TIME = 3.days
+RETENTION_TIME = 12.hours
module PassengerStatusService
class Application < Rails::Application
|
Reduce retention time to 12 hours
|
diff --git a/config/application.rb b/config/application.rb
index abc1234..def5678 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -13,7 +13,6 @@ config.assets.version = '1.0sc'
config.serve_static_assets = true
- config.assets.initialize_on_precompile = false
config.action_controller.page_cache_directory = root.join('tmp/assets')
config.active_record.default_timezone = :utc
|
Remove flag to not initialize on precompile.
|
diff --git a/config/application.rb b/config/application.rb
index abc1234..def5678 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -24,6 +24,11 @@ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
+
+ # Add the fonts path
config.assets.paths << "#{Rails}/vendor/assets/fonts"
+
+ # Precompile additional assets
+ config.assets.precompile += %w( .svg .eot .woff .ttf )
end
end
|
Fix web-font (heroku)
heroku upload test-5 (Firefox)
Rails 4
|
diff --git a/S2MToolbox.podspec b/S2MToolbox.podspec
index abc1234..def5678 100644
--- a/S2MToolbox.podspec
+++ b/S2MToolbox.podspec
@@ -1,10 +1,10 @@ Pod::Spec.new do |s|
s.name = "S2MToolbox"
s.version = "0.0.1"
- s.summary = "iOS Categories"
+ s.summary = "iOS Categories."
s.homepage = "https://github.com/sinnerschrader-mobile/s2m-toolbox-ios"
-
+ s.source = { :git => 'https://github.com/sinnerschrader-mobile/s2m-toolbox-ios.git', :commit => '366676481e178c31c84375daaab7efda135ee967' }
s.authors = { "François Benaiteau" => "francois.benaiteau@sinnerschrader-mobile.com" }
s.platform = :ios
|
UPDATE podspec, removing some warnings from pod spec lint
|
diff --git a/test/integration/systemd/serverspec/required_files_spec.rb b/test/integration/systemd/serverspec/required_files_spec.rb
index abc1234..def5678 100644
--- a/test/integration/systemd/serverspec/required_files_spec.rb
+++ b/test/integration/systemd/serverspec/required_files_spec.rb
@@ -3,7 +3,7 @@ require 'spec_helper'
-describe 'required files for upstart init style' do
+describe 'required files for systemd init style' do
describe 'environment file' do
let :env_file do
file '/etc/sysconfig/kafka'
|
Correct typo in systemd integration tests
|
diff --git a/attributes/default.rb b/attributes/default.rb
index abc1234..def5678 100644
--- a/attributes/default.rb
+++ b/attributes/default.rb
@@ -6,7 +6,8 @@
default['homebrew']['formulas'] = [
'git',
- 'packer'
+ 'packer',
+ 'mtr'
]
default['homebrew']['casks'] = [
|
Add homebrew formula for mtr
|
diff --git a/app/concerns/couriers/fusionable.rb b/app/concerns/couriers/fusionable.rb
index abc1234..def5678 100644
--- a/app/concerns/couriers/fusionable.rb
+++ b/app/concerns/couriers/fusionable.rb
@@ -31,7 +31,7 @@ photo = Photo.find id
table.select("ROWID", "WHERE name='#{photo.key}'").map { |id| table.delete id }
- table.insert [photo.to_kml]
+ table.insert [photo.to_fusion]
end
end
end
|
Fix to_fusion call in Fusionable Courier
|
diff --git a/TSMessages.podspec b/TSMessages.podspec
index abc1234..def5678 100644
--- a/TSMessages.podspec
+++ b/TSMessages.podspec
@@ -14,7 +14,7 @@
s.author = { "Felix Krause" => "krausefx@gmail.com" }
- s.source = { :git => "https://github.com/toursprung/TSMessages.git", :tag => "#{s.version}"}
+ s.source = { :git => "https://github.com/Hotel-Reservation-Service/TSMessages.git", :branch => "master"}
s.platform = :ios, '5.0'
|
Update podspec for local fork
|
diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/pages_controller.rb
+++ b/app/controllers/pages_controller.rb
@@ -6,7 +6,7 @@ def email
tpl = (params[:layout] || 'hero').to_sym
tpl = :hero unless [:email, :hero, :simple].include? tpl
- file = 'users/mailer/welcome'
+ file = 'user_mailer/welcome_email'
@user = User.first || User.new
render file, layout: "emails/#{tpl}"
if params[:premail] == 'true'
|
Fix email template demo page
|
diff --git a/app/controllers/gobierto_admin/gobierto_common/api/terms_controller.rb b/app/controllers/gobierto_admin/gobierto_common/api/terms_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/gobierto_admin/gobierto_common/api/terms_controller.rb
+++ b/app/controllers/gobierto_admin/gobierto_common/api/terms_controller.rb
@@ -8,6 +8,7 @@
skip_before_action :authenticate_admin!, :set_admin_with_token
before_action :set_admin_by_session_or_token
+ before_action :check_permissions!
def create
load_vocabulary
@@ -31,6 +32,9 @@ set_admin_with_token unless (@current_admin = find_current_admin).present?
end
+ def check_permissions!
+ render(json: { message: "Module not allowed" }, status: :unauthorized) unless current_admin.can_edit_vocabularies?
+ end
end
end
end
|
Check admin permissions to create terms via API
|
diff --git a/app/decorators/service_decorator.rb b/app/decorators/service_decorator.rb
index abc1234..def5678 100644
--- a/app/decorators/service_decorator.rb
+++ b/app/decorators/service_decorator.rb
@@ -4,6 +4,10 @@ end
def fileicon
- try(:picture) ? "/pictures/#{picture.basename}" : "100/service.png"
+ try(:picture) ? "/pictures/#{picture.basename}" : nil
+ end
+
+ def single_quad
+ fileicon ? {:fileicon => fileicon} : {:fonticon => fonticon}
end
end
|
Add single_quad definition for the Service model
|
diff --git a/PHYExtendedAppDelegate.podspec b/PHYExtendedAppDelegate.podspec
index abc1234..def5678 100644
--- a/PHYExtendedAppDelegate.podspec
+++ b/PHYExtendedAppDelegate.podspec
@@ -5,7 +5,7 @@ s.homepage = "http://rallyapp.io"
s.license = 'MIT'
s.author = { "Matt Ricketson" => "matt@phyreup.com" }
- s.source = { :git => "git@bitbucket.org:phyre/phyextendedappdelegate.git", :tag => s.version.to_s }
+ s.source = { :git => "https://github.com/phyre-inc/PHYExtendedAppDelegate.git", :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/phyreup'
s.platform = :ios, '7.0'
|
Switch source url to Github
|
diff --git a/merb-auth-more/lib/merb-auth-more/mixins/salted_user/dm_salted_user.rb b/merb-auth-more/lib/merb-auth-more/mixins/salted_user/dm_salted_user.rb
index abc1234..def5678 100644
--- a/merb-auth-more/lib/merb-auth-more/mixins/salted_user/dm_salted_user.rb
+++ b/merb-auth-more/lib/merb-auth-more/mixins/salted_user/dm_salted_user.rb
@@ -11,8 +11,8 @@ property :salt, String
end
- validates_present :password, :if => proc{|m| m.password_required?}
- validates_is_confirmed :password, :if => proc{|m| m.password_required?}
+ validates_presence_of :password, :if => proc{|m| m.password_required?}
+ validates_confirmation_of :password, :if => proc{|m| m.password_required?}
before :save, :encrypt_password
end # base.class_eval
|
Update to DM 1.0.0 compat.
|
diff --git a/recipes/configure.rb b/recipes/configure.rb
index abc1234..def5678 100644
--- a/recipes/configure.rb
+++ b/recipes/configure.rb
@@ -1,5 +1,9 @@ file node['remote_syslog2']['config_file'] do
- content node['remote_syslog2']['config'].to_hash.to_yaml
+ # Using JSON.parse(x.to_json) to convert Chef::Node::ImmutableArray and
+ # Chef::Node::ImmutableMash to plain Ruby array and hash.
+ # https://tickets.opscode.com/browse/CHEF-3953
+ content JSON.parse(node['remote_syslog2']['config'].to_json).to_yaml
+
mode '0644'
notifies :restart, 'service[remote_syslog2]', :delayed
end
|
Fix generated config file on Chef 11.14.
The config file generated looks like this on Chef 11.14 and
remote_syslog2 can't understand it:
files: !ruby/array:Chef::Node::ImmutableArray
- /foo/bar
exclude_files: !ruby/array:Chef::Node::ImmutableArray []
exclude_patterns: !ruby/array:Chef::Node::ImmutableArray []
hostname: foo.com
destination: !ruby/hash:Chef::Node::ImmutableMash
host: bar.com
port: 12345
protocol: tls
|
diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/users_controller_spec.rb
+++ b/spec/controllers/users_controller_spec.rb
@@ -0,0 +1,103 @@+require File.expand_path('../../spec_helper', __FILE__)
+describe UsersController do
+ fixtures :users
+ fixtures :roles
+
+ before(:each) do
+ generate_default_project_and_jnlps_with_mocks
+ logout_user
+ end
+
+ it 'allows signup' do
+ pending "Broken example"
+ lambda do
+ create_user
+ response.should be_redirect
+ end.should change(User, :count).by(1)
+ end
+
+ it 'signs up user in pending state' do
+ pending "Broken example"
+ create_user
+ assigns(:user).reload
+ assigns(:user).should be_pending
+ end
+
+ it 'signs up user with activation code' do
+ pending "Broken example"
+ create_user
+ assigns(:user).reload
+ assigns(:user).activation_code.should_not be_nil
+ end
+ it 'requires login on signup' do
+ pending "Broken example"
+ lambda do
+ create_user(:login => nil)
+ assigns[:user].errors[:login].should_not be_nil
+ response.should be_success
+ end.should_not change(User, :count)
+ end
+
+ it 'requires password on signup' do
+ pending "Broken example"
+ lambda do
+ create_user(:password => nil)
+ assigns[:user].errors[:password].should_not be_nil
+ response.should be_success
+ end.should_not change(User, :count)
+ end
+
+ it 'requires password confirmation on signup' do
+ pending "Broken example"
+ lambda do
+ create_user(:password_confirmation => nil)
+ assigns[:user].errors[:password_confirmation].should_not be_nil
+ response.should be_success
+ end.should_not change(User, :count)
+ end
+
+ it 'requires email on signup' do
+ pending "Broken example"
+ lambda do
+ create_user(:email => nil)
+ assigns[:user].errors[:email].should_not be_nil
+ response.should be_success
+ end.should_not change(User, :count)
+ end
+
+ it 'activates user' do
+ pending "Broken example"
+ User.authenticate('aaron', 'monkey').should be_nil
+ get :activate, :activation_code => users(:aaron).activation_code
+ response.should redirect_to('/login')
+ flash[:notice].should_not be_nil
+ flash[:error ].should be_nil
+ User.authenticate('aaron', 'monkey').should == users(:aaron)
+ end
+
+ it 'does not activate user without key' do
+ pending "Broken example"
+ get :activate
+ flash[:notice].should be_nil
+ flash[:error ].should_not be_nil
+ end
+
+ it 'does not activate user with blank key' do
+ pending "Broken example"
+ get :activate, :activation_code => ''
+ flash[:notice].should be_nil
+ flash[:error ].should_not be_nil
+ end
+
+ it 'does not activate user with bogus key' do
+ pending "Broken example"
+ get :activate, :activation_code => 'i_haxxor_joo'
+ flash[:notice].should be_nil
+ flash[:error ].should_not be_nil
+ end
+
+ def create_user(options = {})
+ post :create, :user => { :login => 'quire', :email => 'quire@example.com',
+ :password => 'quire69', :password_confirmation => 'quire69' }.merge(options)
+ end
+end
|
Add User controller spec file
- Add User controller spec file
|
diff --git a/spec/features/survey_notification_spec.rb b/spec/features/survey_notification_spec.rb
index abc1234..def5678 100644
--- a/spec/features/survey_notification_spec.rb
+++ b/spec/features/survey_notification_spec.rb
@@ -9,14 +9,26 @@ let(:survey_assignment) { create(:survey_assignment, survey:) }
before do
+ # Make sure CSRF handling is configured properly so that
+ # the survey_notification update trigger at the end of
+ # surveys works properly.
+ ActionController::Base.allow_forgery_protection = true
+
course.campaigns << Campaign.first
JoinCourse.new(course:, user: instructor, role: CoursesUsers::Roles::INSTRUCTOR_ROLE)
+ question_group = create(:question_group, name: 'Basic Questions')
+ survey.rapidfire_question_groups << question_group
+ create(:q_checkbox, question_group_id: question_group.id, conditionals: '')
create(:survey_notification, survey_assignment:,
courses_users_id: instructor.courses_users.first.id,
course:)
login_as(instructor)
stub_token_request
+ end
+
+ after do
+ ActionController::Base.allow_forgery_protection = false
end
it 'can be dismissed from the course page' do
@@ -27,4 +39,17 @@ end
expect(page).not_to have_content('Take our survey')
end
+
+ it 'is marked complete after taking the survey' do
+ visit "/courses/#{course.slug}"
+ expect(page).to have_content('Take our survey')
+ click_link 'Take Survey'
+ find('.label', text: 'hindi').click
+ click_button 'Submit Survey'
+ expect(page).to have_content 'Thank You!'
+ sleep 1
+ visit "/courses/#{course.slug}"
+ expect(page).not_to have_content('Take our survey')
+ expect(SurveyNotification.last.completed).to be true
+ end
end
|
Add test that would have caught the CSRF error with survey_notification updates
|
diff --git a/app/models/product.rb b/app/models/product.rb
index abc1234..def5678 100644
--- a/app/models/product.rb
+++ b/app/models/product.rb
@@ -23,9 +23,19 @@ when 'day'
amounts
when 'week'
-
+ summary = Hash.new(0)
+ amounts.each do |date, count|
+ period_end = [date.end_of_week, ending + 1.day].min
+ summary[period_end] += count
+ end
+ summary
when 'month'
-
+ summary = Hash.new(0)
+ amounts.each do |date, count|
+ period_end = [date.end_of_month, ending + 1.day].min
+ summary[period_end] += count
+ end
+ summary
end
end
end
|
Add algorithm for sold per week and month
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.