diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/spec/unit/flame_spec.rb b/spec/unit/flame_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/flame_spec.rb
+++ b/spec/unit/flame_spec.rb
@@ -0,0 +1,10 @@+# frozen_string_literal: true
+describe 'Flame' do
+ it 'should require all files when flame required' do
+ Dir[
+ File.join(__dir__, '..', '..', 'lib', 'flame', '**', '*')
+ ].each do |file|
+ (require file).should.equal false
+ end
+ end
+end
|
Add full unit spec for Flame requiring
|
diff --git a/app/views/api/timeslots/index.json.jbuilder b/app/views/api/timeslots/index.json.jbuilder
index abc1234..def5678 100644
--- a/app/views/api/timeslots/index.json.jbuilder
+++ b/app/views/api/timeslots/index.json.jbuilder
@@ -3,4 +3,9 @@ json.title slot.tutor.name
json.start slot.start
json.end slot.end
+ if slot.student
+ json.color slot.booked_slot
+ else
+ json.color slot.open_slot
+ end
end
|
Add color to jbuilder for calendar events
|
diff --git a/spec/controllers/tags_controller_spec.rb b/spec/controllers/tags_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/tags_controller_spec.rb
+++ b/spec/controllers/tags_controller_spec.rb
@@ -23,5 +23,10 @@ get :show, {id: 2}
expect(response.status).to eq(200)
end
+
+ it "renders show template" do
+ get :show, {id: 2}
+ expect(response).to render_template("show")
+ end
end
end
|
Add test for render show template
|
diff --git a/spec/fc-reminder/gateways/twilio_spec.rb b/spec/fc-reminder/gateways/twilio_spec.rb
index abc1234..def5678 100644
--- a/spec/fc-reminder/gateways/twilio_spec.rb
+++ b/spec/fc-reminder/gateways/twilio_spec.rb
@@ -29,7 +29,7 @@ end
it { expect(gateway).to respond_to(:send).with(2).arguments }
- it "sends message via Twilio REST API" do
+ it "sends message using Twilio REST API" do
args = {
from: config[:phone_number],
to: "recipient",
|
Improve tests description for sending message using Twilio
|
diff --git a/spec/features/person_communities_spec.rb b/spec/features/person_communities_spec.rb
index abc1234..def5678 100644
--- a/spec/features/person_communities_spec.rb
+++ b/spec/features/person_communities_spec.rb
@@ -1,6 +1,15 @@ require 'rails_helper'
feature "Communities" do
+ around(:each) do |example|
+ orig = Rails.application.config.try(:disable_communities) || false
+ Rails.application.config.disable_communities = false
+
+ example.run
+
+ Rails.application.config.disable_communities = orig
+ end
+
before do
omni_auth_log_in_as 'test.user@digital.justice.gov.uk'
end
|
Enable communities feature in its spec
|
diff --git a/spec/features/recoveries/resetting_your_password_spec.rb b/spec/features/recoveries/resetting_your_password_spec.rb
index abc1234..def5678 100644
--- a/spec/features/recoveries/resetting_your_password_spec.rb
+++ b/spec/features/recoveries/resetting_your_password_spec.rb
@@ -6,7 +6,7 @@ user = FactoryGirl.create(:user)
recovery = FactoryGirl.create(:recovery, user: user, email_or_username: [user.email, user.username].sample)
visit recovery_url(user.recovery_key)
- expect(page).to_not have_link('Sign in')
+ #expect(page).to_not have_link('Sign in')
fill_in 'recovery_user_attributes_password', with: 'newpassword'
fill_in 'Password confirmation', with: 'newpassword'
click_button 'Reset Password'
@@ -22,7 +22,7 @@ user = FactoryGirl.create(:user)
recovery = FactoryGirl.create(:recovery, user: user, email_or_username: [user.email, user.username].sample)
visit recovery_url(user.recovery_key)
- expect(page).to_not have_link('Sign in')
+ #expect(page).to_not have_link('Sign in')
click_button 'Reset Password'
expect(page).to have_content('blank')
end
|
Update the test for recoveries
|
diff --git a/lib/rrj/tools/replaces/handle.rb b/lib/rrj/tools/replaces/handle.rb
index abc1234..def5678 100644
--- a/lib/rrj/tools/replaces/handle.rb
+++ b/lib/rrj/tools/replaces/handle.rb
@@ -29,8 +29,8 @@ def replace_candidate
cdn = type.convert(determine_key_candidate, opts)
key = cdn[0]
- request['candidate'] = request.delete(key)
request[key] = cdn[1]
+ delete_key_unless
rescue => message
Tools::Log.instance.warn "Error candidate replace : #{message}"
end
@@ -49,6 +49,16 @@ 'candidates'
end
end
+
+ def delete_key_unless
+ singular = request['candidate']
+ plural = request['candidates']
+ if singular.eql?('<array>')
+ request.delete('candidate')
+ elsif plural.eql?('candidates')
+ request.delete['candidates']
+ end
+ end
end
end
end
|
Fix candidates || candidates used to transaction
|
diff --git a/lib/tasks/csp_reports_tasks.rake b/lib/tasks/csp_reports_tasks.rake
index abc1234..def5678 100644
--- a/lib/tasks/csp_reports_tasks.rake
+++ b/lib/tasks/csp_reports_tasks.rake
@@ -1,24 +1,41 @@ namespace :csp_reports do
desc "Populate CSP Violations Report"
task populate: :environment do
- user = User.first
+ user = User.last
domain = user.domains.find_or_create_by(name: "My domain", url: "http://mydomain.com")
+ domain.reports.delete_all
- 10.times do
- domain.reports.create(
- result: {
- "referrer" => "",
- "blocked-uri" => "https://avatars1.githubusercontent.com",
- "status-code" => "200",
- "document-uri" => "http://mydomain.com/newsletters/15",
- "original-policy" => %(
- default-src 'none'; object-src 'self'; img-src 'self' *.srcclr.com https://ssl.google-analytics.com data:;
- report-uri http://open.domain.com/report-uri/28b7a142-2fb9-4184-a639-93229a31d148;
- ),
- "violated-directive" => "img-src 'self' *.srcclr.com https://ssl.google-analytics.com data:",
- "effective-directive" => "img-src"
- }
- )
+ count.times do |i|
+ rand(50).times do
+ domain.reports.create(
+ result: result,
+ created_at: date - i.days,
+ updated_at: date - i.days
+ )
+ end
end
end
+
+ def date
+ Time.zone.now
+ end
+
+ def count
+ 10
+ end
+
+ def result
+ {
+ "referrer" => "",
+ "blocked-uri" => "https://avatars1.githubusercontent.com",
+ "status-code" => "200",
+ "document-uri" => "http://mydomain.com/newsletters/15",
+ "original-policy" => %(
+ default-src 'none'; object-src 'self'; img-src 'self' *.srcclr.com https://ssl.google-analytics.com data:;
+ report-uri http://open.domain.com/report-uri/28b7a142-2fb9-4184-a639-93229a31d148;
+ ),
+ "violated-directive" => "img-src 'self' *.srcclr.com https://ssl.google-analytics.com data:",
+ "effective-directive" => "img-src"
+ }
+ end
end
|
Refactor populate task to upsert more data to db
|
diff --git a/lib/trello/quarterly_progress.rb b/lib/trello/quarterly_progress.rb
index abc1234..def5678 100644
--- a/lib/trello/quarterly_progress.rb
+++ b/lib/trello/quarterly_progress.rb
@@ -8,10 +8,7 @@ extend TrelloBoards
def self.perform
- h = {
- '2014' => progress(2014),
- '2013' => progress(2013)
- }
+ h = Hash[years.map{|year| [year, progress(year)]}]
store_metric("quarterly-progress", DateTime.now, h)
end
|
Refactor quarterly progress to include 2015
|
diff --git a/0_code_wars/leonardo_dicaprio.rb b/0_code_wars/leonardo_dicaprio.rb
index abc1234..def5678 100644
--- a/0_code_wars/leonardo_dicaprio.rb
+++ b/0_code_wars/leonardo_dicaprio.rb
@@ -0,0 +1,10 @@+# http://www.codewars.com/kata/56d49587df52101de70011e4
+# --- iteration 1 ---
+def leo(oscar)
+ return "Leo got one already!" if oscar > 88
+ case oscar
+ when 88 then "Leo finally won the oscar! Leo is happy"
+ when 86 then "Not even for Wolf of wallstreet?!"
+ else "When will you give Leo an Oscar?"
+ end
+end
|
Add code wars (8) - leonardo dicaprio
|
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb
index abc1234..def5678 100644
--- a/config/initializers/session_store.rb
+++ b/config/initializers/session_store.rb
@@ -4,7 +4,7 @@ :redis_store, # Using the cookie_store would enable session replay attacks.
servers: Gitlab::Application.config.cache_store.last, # re-use the Redis config from the Rails cache store
key: '_gitlab_session',
- secure: Gitlab::Application.config.force_ssl,
+ secure: Gitlab.config.gitlab.https,
httponly: true,
path: (Rails.application.config.relative_url_root.nil?) ? '/' : Rails.application.config.relative_url_root
)
|
Enable secure option if https is used.
|
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb
index abc1234..def5678 100644
--- a/config/initializers/session_store.rb
+++ b/config/initializers/session_store.rb
@@ -1,3 +1,3 @@ # Be sure to restart your server when you modify this file.
-Rails.application.config.session_store :cookie_store, key: '_resumis_session', domain: 'resumis.dev'
+Rails.application.config.session_store :cookie_store, key: '_resumis_session', domain: :all
|
Set cookie_store domain to :all
Signed-off-by: Max Fierke <0706025b2bbcec1ed8d64822f4eccd96314938d0@maxfierke.com>
|
diff --git a/spec/resources/web_config_spec.rb b/spec/resources/web_config_spec.rb
index abc1234..def5678 100644
--- a/spec/resources/web_config_spec.rb
+++ b/spec/resources/web_config_spec.rb
@@ -21,4 +21,8 @@ resource.dynamic_template("random_water_boa.py")
expect(resource.dynamic_template).to eq("random_water_boa.py")
end
+
+ it "action defaults to :create" do
+ expect(resource.action).to eq(:create)
+ end
end
|
Add default action test in graphite_web_config resource specs.
|
diff --git a/lib/crawl.rb b/lib/crawl.rb
index abc1234..def5678 100644
--- a/lib/crawl.rb
+++ b/lib/crawl.rb
@@ -2,7 +2,7 @@
class Crawl
attr_reader :url
-
+
def initialize(url, avoid = [])
@url = url
@@ -17,8 +17,9 @@ end
def skip?(url)
- @avoid.any? { |a|
- url.start_with? a
- }
+ url_s = url.to_s
+ @avoid.any? { |a|
+ url_s.start_with? a
+ }
end
end
|
Make Crawl more flexible about url types
|
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb
index abc1234..def5678 100644
--- a/config/initializers/session_store.rb
+++ b/config/initializers/session_store.rb
@@ -1,7 +1,7 @@ # Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: '_whitehall_session',
- secure: !(Rails.env.test? || Rails.env.development?)
+ secure: !(Rails.env.test? || Rails.env.development? || ENV['DISABLE_SECURE_COOKIES'])
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
|
Allow the disabling secure cookies in Rails production environment
The publishing end to end tests run Whitehall in Rails production
mode so we can mimic how the app will behave in production as closely
as possible.
We haven't set up HTTPS however which means that the secure cookie
marker is preventing the browser from storing the cookie, and
therefore sessions aren't working properly.
This ENV config allows us to run the app in Rails production mode
from end to end tests.
|
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb
index abc1234..def5678 100644
--- a/config/initializers/session_store.rb
+++ b/config/initializers/session_store.rb
@@ -1,3 +1,3 @@ # Be sure to restart your server when you modify this file.
-Rails.application.config.session_store :cookie_store, key: '_code_ocean_session'
+Rails.application.config.session_store :cookie_store, key: '_code_ocean_session', expire_after: 1.month
|
Change session validity to 1 month
|
diff --git a/spec/default_spec.rb b/spec/default_spec.rb
index abc1234..def5678 100644
--- a/spec/default_spec.rb
+++ b/spec/default_spec.rb
@@ -6,11 +6,6 @@ runner.converge 'nrpe::default'
end
- it 'does not blow up when the search returns no results' do
- stub_search(:role, 'monitoring').and_return([])
- expect { chef_run }.to_not raise_error
- end
-
it 'expects nrpe config to allow localhost polling' do
expect(chef_run).to render_file('/etc/nagios/nrpe.cfg').with_content('allowed_hosts=127.0.0.1')
end
|
Remove spec that didn't actually do anything
Doesn’t fail even if not mocked.
|
diff --git a/test/cookbooks/lxctests/recipes/install_lxc.rb b/test/cookbooks/lxctests/recipes/install_lxc.rb
index abc1234..def5678 100644
--- a/test/cookbooks/lxctests/recipes/install_lxc.rb
+++ b/test/cookbooks/lxctests/recipes/install_lxc.rb
@@ -13,7 +13,7 @@ end.run_action(:install)
end
-execute 'add-apt-repository ppa:ubuntu-lxc/daily' do
+execute 'add-apt-repository ppa:ubuntu-lxc/stable' do
action :nothing
end.run_action(:run)
|
Use LXC stable, not daily
|
diff --git a/lib/libra2/app/controllers/concerns/authentication_behavior.rb b/lib/libra2/app/controllers/concerns/authentication_behavior.rb
index abc1234..def5678 100644
--- a/lib/libra2/app/controllers/concerns/authentication_behavior.rb
+++ b/lib/libra2/app/controllers/concerns/authentication_behavior.rb
@@ -19,10 +19,13 @@ #
# check the request environment and see if we have a user defined by netbadge
#
- #request.env['HTTP_REMOTE_USER'] = 'dpg3k'
- if request.env['HTTP_REMOTE_USER'].present?
+ if request.env['HTTP_REMOTE_USER'].present?
puts "=====> HTTP_REMOTE_USER: #{request.env['HTTP_REMOTE_USER']}"
- return if sign_in_user_id( request.env['HTTP_REMOTE_USER'] )
+ begin
+ return if sign_in_user_id( request.env['HTTP_REMOTE_USER'] )
+ rescue
+ return false
+ end
end
puts "=====> HTTP_REMOTE_USER NOT defined"
|
Fix 500 error when requesting the favicon when not logged in.
|
diff --git a/lib/fog/aws/parsers/storage/get_bucket.rb b/lib/fog/aws/parsers/storage/get_bucket.rb
index abc1234..def5678 100644
--- a/lib/fog/aws/parsers/storage/get_bucket.rb
+++ b/lib/fog/aws/parsers/storage/get_bucket.rb
@@ -26,7 +26,7 @@ when 'DisplayName', 'ID'
@object['Owner'][name] = value
when 'ETag'
- @object[name] = value.gsub('"', '')
+ @object[name] = value.gsub('"', '') if value != nil
when 'IsTruncated'
if value == 'true'
@response['IsTruncated'] = true
|
Fix for empty ETag values
Fog aws fails if API response contains empty ETag tags. It may cause when working with S3 clones (like minio in my case), that not provides ETags in their API answer.
|
diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/events_controller.rb
+++ b/app/controllers/events_controller.rb
@@ -19,9 +19,9 @@ session[:redirect_url] = "/events/#{params[:id]}"
end
@event = Event.find(params[:id])
- @attend = Attendance.find_by(event: @event, student_id: session[:user_id])
- @out_nudge = Nudge.find_by(event: @event, nudger_id: session[:user_id])
- @in_nudge = Nudge.find_by(event: @event, nudgee_id: session[:user_id])
+ @attend = Attendance.find_by(event: @event, student: current_student)
+ @out_nudge = Nudge.find_by(event: @event, nudger: current_student)
+ @in_nudge = Nudge.find_by(event: @event, nudgee: current_student)
flash[:attendance] = @attend.id if @attend
end
|
Revise nudges code to refer to Student instead of User
|
diff --git a/app/controllers/static_controller.rb b/app/controllers/static_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/static_controller.rb
+++ b/app/controllers/static_controller.rb
@@ -4,7 +4,7 @@ def index
page = (params[:id] || 'index').gsub /[^A-z0-9_\-]/, ''
@favorites = if current_user.internal?
- nil
+ []
else
current_user.favorites.order('priority')
end
|
Fix possible bug empty?/any?/each on nil for anonymous user on @favorites.
|
diff --git a/Casks/zendstudio.rb b/Casks/zendstudio.rb
index abc1234..def5678 100644
--- a/Casks/zendstudio.rb
+++ b/Casks/zendstudio.rb
@@ -1,6 +1,6 @@ cask :v1 => 'zendstudio' do
- version '12.0.1'
- sha256 'e8534e6b550e075b5da42c5b1789e82b3c9e04c739f055c6980783742f6e1160'
+ version '13.0.0'
+ sha256 '3ed2492801c54fd7b1ec225d4824fb7609a674b35a5d8f437fdf3218cfd98067'
url "http://downloads.zend.com/studio-eclipse/#{version}/ZendStudio-#{version}-macosx.cocoa.x86_64.dmg"
name 'Zend Studio'
|
Update Zend Studio to 13.0.0
|
diff --git a/last-stop/app/controllers/stops_controller.rb b/last-stop/app/controllers/stops_controller.rb
index abc1234..def5678 100644
--- a/last-stop/app/controllers/stops_controller.rb
+++ b/last-stop/app/controllers/stops_controller.rb
@@ -1,6 +1,7 @@ class StopsController < ApplicationController
def index
- @stops = Stop.all
+ #@stops = Stop.near(params[:location])
+ @stops = Stop.near([37.464763, -122.197985])
render json: @stops
end
|
Update stops controller to return JSON
|
diff --git a/DPMeterView.podspec b/DPMeterView.podspec
index abc1234..def5678 100644
--- a/DPMeterView.podspec
+++ b/DPMeterView.podspec
@@ -10,6 +10,5 @@ s.requires_arc = true
s.ios.deployment_target = '5.0'
- s.osx.deployment_target = '10.7'
s.frameworks = 'QuartzCore', 'CoreMotion'
end
|
Remove osx deployment target from podspec
|
diff --git a/lib/olson.rb b/lib/olson.rb
index abc1234..def5678 100644
--- a/lib/olson.rb
+++ b/lib/olson.rb
@@ -1,4 +1,4 @@+require 'active_support/concern'
require 'olson/instance_methods'
require 'olson/class_methods'
require 'olson/version'
-require 'active_support/concern'
|
Fix order of require statements
|
diff --git a/lib/generators/awe/update/update_generator.rb b/lib/generators/awe/update/update_generator.rb
index abc1234..def5678 100644
--- a/lib/generators/awe/update/update_generator.rb
+++ b/lib/generators/awe/update/update_generator.rb
@@ -1,4 +1,5 @@ require 'rails'
+require 'open-uri'
module Awe
module Generators
@@ -6,26 +7,27 @@
desc "This generator updates AWE (Artefact Web Extensions) to the latest"
- @@tmp_path = "tmp/vendor/assets/javascripts"
@@github = "https://raw.github.com/sambaker/awe-core/master"
source_root Rails.root
def download_and_copy_awe
- say_status("fetching", "awe files from #{@@github}/ ...", :green)
- get "#{@@github}/awe-core.js", "#{@@tmp_path}/awe-core.js"
- get "#{@@github}/awe-state-machine.js", "#{@@tmp_path}/awe-state-machine.js"
+ files = []
+ javascripts_path = ::Rails.application.config.assets.enabled ? "vendor/assets/javascripts" : "public/javascripts"
+
+ say_status("getting", "The AWE file list from #{@@github}/ ...", :green)
+ open("#{@@github}/files") { |f|
+ f.each_line { |line| files.push(line.strip) unless line.starts_with?("#") }
+ }
- say_status("copying", "awe files", :green)
- if ::Rails.application.config.assets.enabled
- copy_file "#{@@tmp_path}/awe-core.js", "vendor/assets/javascripts/awe-core.js"
- copy_file "#{@@tmp_path}/awe-state-machine.js", "vendor/assets/javascripts/awe-state-machine.js"
- else
- copy_file "#{@@tmp_path}/awe-core.js", "public/javascripts/awe-core.js"
- copy_file "#{@@tmp_path}/awe-state-machine.js", "public/javascripts/awe-state-machine.js"
- end
+ # fetch files
+ files.each { |file|
+ say_status("fetching", "#{@@github}/#{file} into #{javascripts_path} ...", :green)
+ get "#{@@github}/#{file}", "#{javascripts_path}/#{file}"
+ }
+
rescue OpenURI::HTTPError
- say_status("error", "could not fetch awe files", :red)
+ say_status("error", "error fetching files", :red)
end
end
|
Update the awe:update action to dynamically figure out which files are available
Also, we now copy the files directly into the appropriate javascripts
directory.
|
diff --git a/lib/gyaazle.rb b/lib/gyaazle.rb
index abc1234..def5678 100644
--- a/lib/gyaazle.rb
+++ b/lib/gyaazle.rb
@@ -1,3 +1,5 @@+require "fileutils"
+
require "httpclient"
require "multi_json"
require "nokogiri"
|
Fix error on some platform (my Mac)
|
diff --git a/test/test_validation_with_errors.rb b/test/test_validation_with_errors.rb
index abc1234..def5678 100644
--- a/test/test_validation_with_errors.rb
+++ b/test/test_validation_with_errors.rb
@@ -12,11 +12,11 @@ assert_equal(errors.size, test_case["errors"].size, "Expected #{test_case["errors"].size} errors, got #{errors.size} errors")
errors.zip(test_case["errors"]).each do |error, expected_error|
- assert_equal(error.schema, expected_error["schema"])
- assert_equal(error.schema_uri, expected_error["schema_uri"])
- assert_equal(error.schema_attribute, expected_error["schema_attribute"])
- assert_equal(error.value, expected_error["value"])
- # assert_equal(error.value_path, expected_error["value_path"]) TODO
+ assert_equal(expected_error["schema"], error.schema)
+ assert_equal(expected_error["schema_uri"], error.schema_uri)
+ assert_equal(expected_error["schema_attribute"], error.schema_attribute)
+ assert_equal(expected_error["value"], error.value)
+ # assert_equal(expected_error["value_path"], error.value_path) TODO
end
end
end
|
Put arguments to assert_equal in correct order
|
diff --git a/spec/plugins_spec.rb b/spec/plugins_spec.rb
index abc1234..def5678 100644
--- a/spec/plugins_spec.rb
+++ b/spec/plugins_spec.rb
@@ -0,0 +1,68 @@+require 'spec_helper'
+
+module Pathway
+ describe Operation do
+ module SimplePlugin
+ module InstanceMethods
+ def foo; end
+ end
+
+ module ClassMethods
+ def bar; end
+ end
+
+ module DSLMethods
+ def qux; end
+ end
+
+ def self.apply(klass)
+ klass.result_at :the_result
+ end
+ end
+
+ class AnOperation < Operation
+ plugin SimplePlugin
+ end
+
+ class ASubOperation < AnOperation
+ end
+
+ class OtherOperation < Operation
+ end
+
+ describe '.plugin' do
+ it 'includes InstanceMethods module to the class and its subclasses' do
+ expect(AnOperation.instance_methods).to include(:foo)
+ expect(ASubOperation.instance_methods).to include(:foo)
+ end
+
+ it 'includes ClassMethods module to the singleton class and its subclasses' do
+ expect(AnOperation.methods).to include(:bar)
+ expect(ASubOperation.methods).to include(:bar)
+ end
+
+ it 'includes DSLMethods module to the nested DSL class and its subclasses' do
+ expect(AnOperation::DSL.instance_methods).to include(:qux)
+ expect(ASubOperation::DSL.instance_methods).to include(:qux)
+ end
+
+ it "calls 'apply' on the Operation where is used" do
+ expect(AnOperation.result_key).to eq(:the_result)
+ end
+
+ it 'does not affect main Operation class' do
+ expect(Operation.instance_methods).to_not include(:foo)
+ expect(Operation.methods).to_not include(:bar)
+ expect(Operation::DSL.instance_methods).to_not include(:qux)
+ expect(Operation.result_key).to eq(:value)
+ end
+
+ it 'does not affect other Operation subclasses' do
+ expect(OtherOperation.instance_methods).to_not include(:foo)
+ expect(OtherOperation.methods).to_not include(:bar)
+ expect(OtherOperation::DSL.instance_methods).to_not include(:qux)
+ expect(OtherOperation.result_key).to eq(:value)
+ end
+ end
+ end
+end
|
Add tests for plugin activation
|
diff --git a/config/application.rb b/config/application.rb
index abc1234..def5678 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -24,8 +24,4 @@ require 'publify_version'
Theme.register_themes "#{Rails.root}/themes"
-
- Date::DATE_FORMATS.merge!(
- :long_weekday => '%a %B %e, %Y %H:%M'
- )
end
|
Remove unused long_weekday date format
|
diff --git a/config/application.rb b/config/application.rb
index abc1234..def5678 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -19,9 +19,5 @@ # 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
-
- # Include generated in static assets to be served
- config.assets.path = Rails.root.join('doc')
-
end
end
|
Revert "Include docs in static assets to be served"
This reverts commit 383c70d57cb2cd3a931d1208eb590148c1954066.
|
diff --git a/matcher.rb b/matcher.rb
index abc1234..def5678 100644
--- a/matcher.rb
+++ b/matcher.rb
@@ -20,9 +20,9 @@ end
end
- def match_regexp pattern
+ def match_regexp regexp
lambda do |string, index = 0|
- found = pattern.match(string)
+ found = regexp.match(string)
found.to_s if found && found.begin(0) == index
end
|
Change variable name to avoid confusion
|
diff --git a/filewatcher.gemspec b/filewatcher.gemspec
index abc1234..def5678 100644
--- a/filewatcher.gemspec
+++ b/filewatcher.gemspec
@@ -2,12 +2,10 @@
require_relative 'lib/filewatcher'
require_relative 'lib/filewatcher/version'
-require 'date'
Gem::Specification.new do |s|
s.name = 'filewatcher'
s.version = Filewatcher::VERSION
- s.date = Date.today.to_s
s.authors = ['Thomas Flemming']
s.email = ['thomas.flemming@gmail.com']
|
Remove `Date.today` from gem spec
It's the default.
|
diff --git a/repeatable.gemspec b/repeatable.gemspec
index abc1234..def5678 100644
--- a/repeatable.gemspec
+++ b/repeatable.gemspec
@@ -16,6 +16,6 @@ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
spec.require_paths = ['lib']
- spec.add_development_dependency 'rake', '~> 10.0'
+ spec.add_development_dependency 'rake', '>= 12.3.3'
spec.add_development_dependency 'rspec', '~> 3.0'
end
|
Bump rake version for CVE
More details: https://git.io/Jmxhp
|
diff --git a/spec/support/body.rb b/spec/support/body.rb
index abc1234..def5678 100644
--- a/spec/support/body.rb
+++ b/spec/support/body.rb
@@ -6,7 +6,7 @@ private
def body_for(value, verb)
- return "" if verb.casecmp?("head")
+ return "" if verb.downcase == "head" # rubocop:disable Performance/Casecmp
value
end
end
|
Fix build for 2.3 and JRuby
|
diff --git a/app/workers/import_workers/finaliser_worker.rb b/app/workers/import_workers/finaliser_worker.rb
index abc1234..def5678 100644
--- a/app/workers/import_workers/finaliser_worker.rb
+++ b/app/workers/import_workers/finaliser_worker.rb
@@ -26,6 +26,7 @@ # we can't get from the WDPA
CmsTransfer.transfer
ApiTransfer.transfer
+ ActiveStorageTransfer.transfer
# Clear the redis cache and delete all downloads
# from the S3 bucket. This will trigger the generation
|
Call ActiveStorageTransfer module in FinaliserWorker
|
diff --git a/lib/infinity_test/framework/helpers.rb b/lib/infinity_test/framework/helpers.rb
index abc1234..def5678 100644
--- a/lib/infinity_test/framework/helpers.rb
+++ b/lib/infinity_test/framework/helpers.rb
@@ -4,6 +4,7 @@ # Run all the strategy again.
#
def RunAll
+ continuous_test_server.run_strategy
end
# Run test based on the changed file.
|
Make run all method a call to the run_strategy on continuous server object.
|
diff --git a/lib/mongoid/mapreduce/serialization.rb b/lib/mongoid/mapreduce/serialization.rb
index abc1234..def5678 100644
--- a/lib/mongoid/mapreduce/serialization.rb
+++ b/lib/mongoid/mapreduce/serialization.rb
@@ -11,7 +11,9 @@ def serialize(obj, klass)
return nil if obj.blank?
obj = obj.is_a?(Boolean) ? (obj ? 1 : 0) : obj
- obj = obj.to_s =~ /(^[-+]?[0-9]+$)|(\.0+)$/ ? Integer(obj) : Float(obj)
+
+ obj = obj.to_s =~ /(^[-+]?[0-9]+$)|(\.0+)$/ ? obj.to_i : obj.to_f
+
Mongoid::Fields::Mappings.for(klass).allocate.serialize(obj)
end
|
Change method for converting numbers to ruby objects
|
diff --git a/lib/whatsapp/protocol/iq_media_node.rb b/lib/whatsapp/protocol/iq_media_node.rb
index abc1234..def5678 100644
--- a/lib/whatsapp/protocol/iq_media_node.rb
+++ b/lib/whatsapp/protocol/iq_media_node.rb
@@ -4,8 +4,14 @@ module Protocol
class IqMediaNode < Node
+ attr_reader :fingerprint, :type, :size, :message_id
def initialize(fingerprint, type, size, message_id = Util::IdGenerator.next)
+ @fingerprint = fingerprint
+ @type = type
+ @size = size
+ @message_id = message_id
+
media_node = Node.new('media', {
xmlns: 'w:m',
hash: fingerprint,
|
Add media iq nodes to messages queue
|
diff --git a/lib/docs/scrapers/vue.rb b/lib/docs/scrapers/vue.rb
index abc1234..def5678 100644
--- a/lib/docs/scrapers/vue.rb
+++ b/lib/docs/scrapers/vue.rb
@@ -3,8 +3,6 @@ self.name = 'Vue.js'
self.slug = 'vue'
self.type = 'vue'
- self.root_path = '/guide/index.html'
- self.initial_paths = %w(/api/index.html)
self.links = {
home: 'https://vuejs.org/',
code: 'https://github.com/vuejs/vue'
@@ -12,7 +10,7 @@
html_filters.push 'vue/clean_html', 'vue/entries'
- options[:only_patterns] = [/\/guide\//, /\/api\//]
+ options[:only_patterns] = [/guide\//, /api\//]
options[:attribution] = <<-HTML
© 2013–2016 Evan You, Vue.js contributors<br>
@@ -20,13 +18,17 @@ HTML
version '2' do
- self.release = '2.0.3'
- self.base_url = 'https://vuejs.org'
+ self.release = '2.0.5'
+ self.base_url = 'https://vuejs.org/v2/'
+ self.root_path = 'guide/index.html'
+ self.initial_paths = %w(api/index.html)
end
version '1' do
self.release = '1.0.28'
self.base_url = 'https://v1.vuejs.org'
+ self.root_path = '/guide/index.html'
+ self.initial_paths = %w(/api/index.html)
end
end
end
|
Update Vue.js documentation (2.0.5, 1.0.28)
|
diff --git a/lib/ircmad/irc_client.rb b/lib/ircmad/irc_client.rb
index abc1234..def5678 100644
--- a/lib/ircmad/irc_client.rb
+++ b/lib/ircmad/irc_client.rb
@@ -5,32 +5,38 @@ def initialize(&block)
instance_eval(&block) if block_given?
- unless @zircon
- @zircon = Zircon.new config
+ @client = Zircon.new config
- @zircon.send(:login) if @zircon.respond_to?(:login, true)
- config[:channel_list].each do |channel|
- @zircon.join channel
- end
- end
- @zircon
+ @client.send(:login) if @client.respond_to?(:login, true)
+ config[:channel_list].each { |channel| @client.join channel }
end
def run!
Ircmad.post_channel.subscribe do |msg|
- data = JSON.parse(msg, :symbolize_names => true) rescue nil
- privmsg data[:channel], ":#{data[:message]}"
+ parsed_msg = begin
+ JSON.parse(msg, :symbolize_names => true) rescue nil
+ rescue JSON::ParserError
+ puts "#{msg} is invalid json"
+ rescue => e
+ puts "Unexpected error"
+ puts e.message
+ puts e.backtrace.join("\n")
+ end
+
+ if parsed_msg && parsed_msg[:channel] && parsed_msg[:message]
+ privmsg parsed_msg[:channel], ":#{parsed_msg[:message]}"
+ end
end
on_privmsg do |msg|
Ircmad.get_channel << msg
end
- @zircon.run!
+ @client.run!
end
def method_missing(action, *args, &block)
- @zircon.send(action.to_s, *args, &block)
+ @client.send(action.to_s, *args, &block)
end
end
end
|
Check whether posted message is valid JSON
|
diff --git a/name_resolution/name_resolver.rb b/name_resolution/name_resolver.rb
index abc1234..def5678 100644
--- a/name_resolution/name_resolver.rb
+++ b/name_resolution/name_resolver.rb
@@ -0,0 +1,21 @@+require 'resolv'
+
+class NameResolver < Scout::Plugin
+ OPTIONS=<<-EOS
+ nameserver:
+ default: 8.8.8.8
+ resolve_address:
+ default: google.com
+ EOS
+
+ def build_report
+ resolver = Resolv::DNS.new(:nameserver => [option(:nameserver)])
+
+ begin
+ result = resolver.getaddress(option(:resolve_address))
+ rescue Resolv::ResolvError => err
+ alert('Failed to resolve', err)
+ end
+ end
+end
+
|
Create domain name resolver plugin
Takes a nameserver and resolve_address as input and raises an alert if
resolution fails
|
diff --git a/app/helpers/sessions_helper.rb b/app/helpers/sessions_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/sessions_helper.rb
+++ b/app/helpers/sessions_helper.rb
@@ -1,2 +1,18 @@ module SessionsHelper
+ def current_user
+ @current_user ||= User.find_by_id(session[:user_id]) if session[:user_id]
+ end
+
+ def logged_in?
+ current_user
+ end
+
+ def log_in(user)
+ session[:user_id] = user.id
+ end
+
+ def log_out
+ session.delete(:user_id)
+ current_user = nil
+ end
end
|
Add session helper module for quick session changes
|
diff --git a/ruby-manta.gemspec b/ruby-manta.gemspec
index abc1234..def5678 100644
--- a/ruby-manta.gemspec
+++ b/ruby-manta.gemspec
@@ -9,6 +9,7 @@ s.authors = ['Joyent']
s.email = 'marsell@joyent.com'
s.homepage = 'http://github.com/joyent/ruby-manta/'
+ s.license = 'MIT'
s.add_dependency('net-ssh', '>= 2.6.0')
s.add_dependency('httpclient', '>= 2.3.0.1')
|
Add license type to gemspec.
|
diff --git a/app/models/metrics/licenses.rb b/app/models/metrics/licenses.rb
index abc1234..def5678 100644
--- a/app/models/metrics/licenses.rb
+++ b/app/models/metrics/licenses.rb
@@ -16,7 +16,7 @@ end
def compute(record)
- license = record['license_id'].gsub('.', "\uff0e")
+ license = record['license_id'].maybe.gsub('.', "\uff0e")
@analysis[license] += 1
return 1.0, license if license_open?(license)
|
Add a maybe statement to the license substitution
The license identifier might be null, hence I have added a maybe
statement.
Signed-off-by: Konrad Reiche <4ff0213f56e2082fcd8c882d04c546881c579ce4@gmail.com>
|
diff --git a/db/migrate/20160125222418_create_reviews.rb b/db/migrate/20160125222418_create_reviews.rb
index abc1234..def5678 100644
--- a/db/migrate/20160125222418_create_reviews.rb
+++ b/db/migrate/20160125222418_create_reviews.rb
@@ -3,6 +3,7 @@ create_table :reviews do |t|
t.integer :film_id
t.integer :reviewer_id
+ t.string :title
t.text :content
t.timestamps null: false
|
Add title field to review table
|
diff --git a/simple_state_machine.gemspec b/simple_state_machine.gemspec
index abc1234..def5678 100644
--- a/simple_state_machine.gemspec
+++ b/simple_state_machine.gemspec
@@ -15,7 +15,6 @@ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.rdoc_options = ["--charset=UTF-8"]
s.require_paths = ["lib"]
- s.rubygems_version = %q{1.3.7}
s.summary = %q{A simple DSL to decorate existing methods with logic that guards state transitions.}
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
end
|
Remove old rubygesm version requirement
|
diff --git a/simplecov-rcov-setup.gemspec b/simplecov-rcov-setup.gemspec
index abc1234..def5678 100644
--- a/simplecov-rcov-setup.gemspec
+++ b/simplecov-rcov-setup.gemspec
@@ -21,7 +21,7 @@
spec.add_dependency 'simplecov-rcov', '~> 0.2.3'
- spec.add_development_dependency 'bundler', '~> 1.7'
+ spec.add_development_dependency 'bundler', '~> 2.1'
spec.add_development_dependency 'gem-release', '~> 2.1'
spec.add_development_dependency 'rubocop', '~> 0.88.0'
end
|
Update bundler requirement from ~> 1.7 to ~> 2.1
Updates the requirements on [bundler](https://github.com/bundler/bundler) to permit the latest version.
- [Release notes](https://github.com/bundler/bundler/releases)
- [Changelog](https://github.com/rubygems/bundler/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bundler/bundler/compare/v1.7.0...v2.1.4)
Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>
|
diff --git a/bruce.rb b/bruce.rb
index abc1234..def5678 100644
--- a/bruce.rb
+++ b/bruce.rb
@@ -1,8 +1,18 @@ require 'minitest/autorun'
+require 'pry'
+
+class Banner
+ attr_reader :name, :weight
+
+ def initialize(name, weight=1)
+ @name = name
+ @weight = weight
+ end
+end
class RandomBanner
- def initialize banners
- @banners = banners
+ def initialize banner_hash
+ @banners = banner_hash.map { |k,v| Banner.new(k,v) }
end
def pick number
@@ -12,11 +22,16 @@
describe RandomBanner do
before do
- @banners = %w(red green blue black purple yellow violet grey orange pink brown)
+ banner_names = %w(red green blue black purple yellow violet grey orange pink brown)
+ banner_weights = (1..11).to_a
+ @banners = Hash[banner_names.zip(banner_weights)]
end
it 'picks a number of banners randomly, given a set of banners' do
random_banners = RandomBanner.new(@banners).pick(5)
random_banners.size.must_equal 5
+ random_banners.combination(2).each do |first, second|
+ first.name.wont_equal second.name # we are not expecting repetition
+ end
end
end
|
Add Banner class, add sanity check.
|
diff --git a/asciidoctor-diagram-d3js.gemspec b/asciidoctor-diagram-d3js.gemspec
index abc1234..def5678 100644
--- a/asciidoctor-diagram-d3js.gemspec
+++ b/asciidoctor-diagram-d3js.gemspec
@@ -21,5 +21,6 @@ spec.add_development_dependency "bundler", "~> 1.7"
spec.add_development_dependency "rake", "~> 10.0"
- spec.add_runtime_dependency 'nokogiri', '~> 1.5.10'
+ spec.add_runtime_dependency "nokogiri", "~> 1.5.10"
+ spec.add_runtime_dependency "asciidoctor-diagram"
end
|
Add runtime dependency to asciidoctor-diagram
|
diff --git a/source/blog/feed.xml.builder b/source/blog/feed.xml.builder
index abc1234..def5678 100644
--- a/source/blog/feed.xml.builder
+++ b/source/blog/feed.xml.builder
@@ -0,0 +1,23 @@+xml.instruct!
+xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
+ xml.title "Portland Code School News and Announcements"
+ xml.subtitle "Stay up to date on the latest happenings at Portland Code School! Check back often for student profiles, new class announcements, and tech industry content."
+ xml.id "http://portlandcodeschool.com/blog/"
+ xml.link "href" => "http://portlandcodeschool.com/blog/"
+ xml.link "href" => "http://portlandcodeschool.com/feed.xml", "rel" => "self"
+ xml.updated blog.articles.first.date.to_time.iso8601
+ xml.author { xml.name "Portland Code School" }
+
+ blog.articles[0..5].each do |article|
+ xml.entry do
+ xml.title article.title
+ xml.link "rel" => "alternate", "href" => article.url
+ xml.id article.url
+ xml.published article.date.to_time.iso8601
+ xml.updated article.date.to_time.iso8601
+ xml.author { xml.name "Portland Code School" }
+ # xml.summary article.summary, "type" => "html"
+ xml.content article.body, "type" => "html"
+ end
+ end
+end
|
Add RSS feed builder. Still to do: Add link to RSS in footer and on blog page
|
diff --git a/acceptance/tests/storeconfigs/collections_with_queries.rb b/acceptance/tests/storeconfigs/collections_with_queries.rb
index abc1234..def5678 100644
--- a/acceptance/tests/storeconfigs/collections_with_queries.rb
+++ b/acceptance/tests/storeconfigs/collections_with_queries.rb
@@ -0,0 +1,85 @@+test_name "collections with queries" do
+
+ exporter, *collectors = hosts
+
+ dir = collectors.first.tmpdir('collections')
+
+ manifest = <<MANIFEST
+node "#{exporter}" {
+ @@file { "#{dir}/file-a":
+ ensure => present,
+ mode => 0777,
+ }
+
+ @@file { "#{dir}/file-b":
+ ensure => present,
+ mode => 0755,
+ }
+
+ @@file { "#{dir}/file-c":
+ ensure => present,
+ mode => 0744,
+ }
+
+ @@file { "#{dir}/file-d":
+ ensure => present,
+ mode => 0744,
+ }
+}
+
+node #{collectors.map {|collector| "\"#{collector}\""}.join(', ')} {
+ # The magic of facts!
+ include $test_name
+
+ file { "#{dir}":
+ ensure => directory,
+ }
+}
+
+class equal_query {
+ File <<| mode == 0744 |>>
+}
+
+class not_equal_query {
+ File <<| mode != 0755 |>>
+}
+MANIFEST
+
+ tmpdir = master.tmpdir('storeconfigs')
+
+ manifest_file = File.join(tmpdir, 'site.pp')
+
+ create_remote_file(master, manifest_file, manifest)
+
+ on master, "chmod -R +rX #{tmpdir}"
+
+ with_master_running_on master, "--storeconfigs --storeconfigs_backend puppetdb --autosign true --manifest #{manifest_file}", :preserve_ssl => true do
+
+ step "Run exporter to populate the database" do
+ run_agent_on exporter, "--test --server #{master}", :acceptable_exit_codes => [0,2]
+
+ # Wait until the catalog has been processed
+ sleep_until_queue_empty database
+ end
+
+ test_collection = proc do |nodes, test_name, expected|
+ on nodes, "rm -rf #{dir}"
+
+ on nodes, "FACTER_test_name=#{test_name} puppet agent --test --server #{master}", :acceptable_exit_codes => [0,2]
+
+ nodes.each do |node|
+ on node, "ls #{dir}"
+ created = stdout.split.map(&:strip).sort
+ assert_equal(expected, created, "#{node} collected #{created.join(', ')} instead of #{expected.join(', ')} for #{test_name}")
+ end
+ end
+
+ step "= queries should work" do
+ test_collection.call collectors, "equal_query", %w[file-c file-d]
+ end
+
+ step "!= queries should work" do
+ test_collection.call collectors, "not_equal_query", %w[file-a file-c file-d]
+ end
+ end
+end
|
Add an acceptance test for storeconfigs queries
This tests queries against a property, both == and !=.
|
diff --git a/onkcop.gemspec b/onkcop.gemspec
index abc1234..def5678 100644
--- a/onkcop.gemspec
+++ b/onkcop.gemspec
@@ -19,7 +19,7 @@ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
- spec.add_dependency "rubocop", "~> 0.46.0"
+ spec.add_dependency "rubocop", "~> 0.47.1"
spec.add_dependency "rubocop-rspec", ">= 1.9.1"
spec.add_development_dependency "bundler"
spec.add_development_dependency "rake"
|
Update rubocop dependency version to >= 0.47.1
|
diff --git a/db/migrate/20160504112519_add_run_untagged_to_ci_runner.rb b/db/migrate/20160504112519_add_run_untagged_to_ci_runner.rb
index abc1234..def5678 100644
--- a/db/migrate/20160504112519_add_run_untagged_to_ci_runner.rb
+++ b/db/migrate/20160504112519_add_run_untagged_to_ci_runner.rb
@@ -1,11 +1,13 @@ class AddRunUntaggedToCiRunner < ActiveRecord::Migration
- ##
- # Downtime expected!
- #
- # This migration will cause downtime due to exclusive lock
- # caused by the default value.
- #
- def change
- add_column :ci_runners, :run_untagged, :boolean, default: true, null: false
+ include Gitlab::Database::MigrationHelpers
+ disable_ddl_transaction!
+
+ def up
+ add_column_with_default(:ci_runners, :run_untagged, :boolean,
+ default: true, allow_null: false)
+ end
+
+ def down
+ remove_column(:ci_runners, :run_untagged)
end
end
|
Use migration helper to prevent downtime migration
|
diff --git a/Casks/omnifocus-beta.rb b/Casks/omnifocus-beta.rb
index abc1234..def5678 100644
--- a/Casks/omnifocus-beta.rb
+++ b/Casks/omnifocus-beta.rb
@@ -0,0 +1,18 @@+cask :v1 => 'omnifocus-beta' do
+ version '2.2.x-r233653'
+ sha256 '6dbec967be6ad55dc6def5c3284979257e2c10e7a6d9fa3b09c1abd587ac7172'
+
+ url "http://omnistaging.omnigroup.com/omnifocus-2/releases/OmniFocus-#{version}-Test.dmg"
+ name 'OmniFocus'
+ homepage 'http://omnistaging.omnigroup.com/omnifocus-2/'
+ license :commercial
+
+ app 'OmniFocus.app'
+
+ zap :delete => [
+ '~/Library/containers/com.omnigroup.omnifocus2',
+ '~/Library/Preferences/com.omnigroup.OmniFocus2.LSSharedFileList.plist',
+ '~/Library/Preferences/com.omnigroup.OmniSoftwareUpdate.plist',
+ '~/Library/Caches/Metadata/com.omnigroup.OmniFocus2'
+ ]
+end
|
Add the OmniFocus beta/test builds
This commit adds the OmniFocus beta/test stream.
|
diff --git a/Casks/vmware-fusion7.rb b/Casks/vmware-fusion7.rb
index abc1234..def5678 100644
--- a/Casks/vmware-fusion7.rb
+++ b/Casks/vmware-fusion7.rb
@@ -0,0 +1,29 @@+cask :v1 => 'vmware-fusion7' do
+ version '7.1.2-2779224'
+ sha256 '93e809ece4f915fcb462affabfce2d7c85eb08314b548e2cde44cb2a67ad7d76'
+
+ url "https://download3.vmware.com/software/fusion/file/VMware-Fusion-#{version}.dmg"
+ name 'VMware Fusion'
+ homepage 'https://www.vmware.com/products/fusion/'
+ license :commercial
+ tags :vendor => 'VMware'
+
+ binary 'VMware Fusion.app/Contents/Library/vmnet-cfgcli'
+ binary 'VMware Fusion.app/Contents/Library/vmnet-cli'
+ binary 'VMware Fusion.app/Contents/Library/vmrun'
+ binary 'VMware Fusion.app/Contents/Library/vmware-vdiskmanager'
+ binary 'VMware Fusion.app/Contents/Library/VMware OVF Tool/ovftool'
+ app 'VMware Fusion.app'
+
+ uninstall_preflight do
+ set_ownership "#{staged_path}/VMware Fusion.app"
+ end
+
+ zap :delete => [
+ # note: '~/Library/Application Support/VMware Fusion' is not safe
+ # to delete. In older versions, VM images were located there.
+ '~/Library/Caches/com.vmware.fusion',
+ '~/Library/Logs/VMware',
+ '~/Library/Logs/VMware Fusion',
+ ]
+end
|
Add cask for VMware Fusion 7
|
diff --git a/app/controllers/corporate_information_pages_controller.rb b/app/controllers/corporate_information_pages_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/corporate_information_pages_controller.rb
+++ b/app/controllers/corporate_information_pages_controller.rb
@@ -18,6 +18,8 @@ @corporate_publications = @organisation.corporate_publications.in_reverse_chronological_order.published
end
+private
+
def find_document_or_edition_for_public
published_edition = @organisation.corporate_information_pages.published.for_slug(params[:id])
published_edition if published_edition.present? && published_edition.available_in_locale?(I18n.locale)
@@ -27,8 +29,6 @@ set_slimmer_organisations_header([@organisation])
set_slimmer_page_owner_header(@organisation)
end
-
-private
def find_organisation
@organisation =
|
Make non-action controller methods private
|
diff --git a/vendor/plugins/themes/rails/init.rb b/vendor/plugins/themes/rails/init.rb
index abc1234..def5678 100644
--- a/vendor/plugins/themes/rails/init.rb
+++ b/vendor/plugins/themes/rails/init.rb
@@ -1,29 +1,32 @@-# Set up middleware to serve theme files
-config.middleware.use "ThemeServer"
+# Before the application gets setup this will fail badly if there's no database.
+if RefinerySetting.table_exists?
+ # Set up middleware to serve theme files
+ config.middleware.use "ThemeServer"
-# Add or remove theme paths to/from Refinery application
-::Refinery::ApplicationController.module_eval do
- before_filter do |controller|
- controller.view_paths.reject! { |v| v.to_s =~ %r{^themes/} }
- if (theme = RefinerySetting[:theme]).present?
- # Set up view path again for the current theme.
- controller.view_paths.unshift Rails.root.join("themes", theme, "views").to_s
+ # Add or remove theme paths to/from Refinery application
+ ::Refinery::ApplicationController.module_eval do
+ before_filter do |controller|
+ controller.view_paths.reject! { |v| v.to_s =~ %r{^themes/} }
+ if (theme = RefinerySetting[:theme]).present?
+ # Set up view path again for the current theme.
+ controller.view_paths.unshift Rails.root.join("themes", theme, "views").to_s
- RefinerySetting[:refinery_menu_cache_action_suffix] = "#{theme}_site_menu"
- else
- # Set the cache key for the site menu (thus expiring the fragment cache if theme changes).
- RefinerySetting[:refinery_menu_cache_action_suffix] = "site_menu"
+ RefinerySetting[:refinery_menu_cache_action_suffix] = "#{theme}_site_menu"
+ else
+ # Set the cache key for the site menu (thus expiring the fragment cache if theme changes).
+ RefinerySetting[:refinery_menu_cache_action_suffix] = "site_menu"
+ end
end
end
+
+ if (theme = RefinerySetting[:theme]).present?
+ # Set up controller paths, which can only be brought in with a server restart, sorry. (But for good reason)
+ controller_path = Rails.root.join("themes", theme, "controllers").to_s
+
+ ::ActiveSupport::Dependencies.load_paths.unshift controller_path
+ config.controller_paths.unshift controller_path
+ end
+
+ # Include theme functions into application helper.
+ Refinery::ApplicationHelper.send :include, ThemesHelper
end
-
-if (theme = RefinerySetting[:theme]).present?
- # Set up controller paths, which can only be brought in with a server restart, sorry. (But for good reason)
- controller_path = Rails.root.join("themes", theme, "controllers").to_s
-
- ::ActiveSupport::Dependencies.load_paths.unshift controller_path
- config.controller_paths.unshift controller_path
-end
-
-# Include theme functions into application helper.
-Refinery::ApplicationHelper.send :include, ThemesHelper
|
Fix themes breaking rake db:setup because RefinerySetting.table_exists? is false.
|
diff --git a/capistrano-nvie-git-workflow.gemspec b/capistrano-nvie-git-workflow.gemspec
index abc1234..def5678 100644
--- a/capistrano-nvie-git-workflow.gemspec
+++ b/capistrano-nvie-git-workflow.gemspec
@@ -8,8 +8,8 @@ gem.version = CapistranoNvieGitWorkflow::VERSION
gem.authors = ["Steve Valaitis"]
gem.email = ["steve@digitalnothing.com"]
- gem.description = %q{TODO: Write a gem description}
- gem.summary = %q{TODO: Write a gem summary}
+ gem.description = %q{Provides Capistrano tasks to deploy using the git workflow described in http://nvie.com/posts/a-successful-git-branching-model}
+ gem.summary = %q{Capistrano tasks for the NVIE git workflow}
gem.homepage = "http://github.com/dnd/capistrano-nvie-git-workflow"
gem.files = `git ls-files`.split($/)
|
Update gemspec summary and description
|
diff --git a/app/admin/users.rb b/app/admin/users.rb
index abc1234..def5678 100644
--- a/app/admin/users.rb
+++ b/app/admin/users.rb
@@ -1,4 +1,6 @@ ActiveAdmin.register User do
+
+ scope :wants_newsletter
index do
column :first_name
@@ -11,5 +13,18 @@ default_actions
end
- scope :wants_newsletter
+ form do |f|
+ f.inputs do
+ f.input :first_name
+ f.input :last_name
+ f.input :email, :input_html => { :readonly=>true }
+ f.input :wants_newsletter
+ end
+ f.inputs "OSM" do
+ f.input :osm_id, :label => 'OSM ID'
+ f.input :changeset_id
+ f.input :create_counter, :input_html => { :readonly=>true }
+ f.input :edit_counter, :input_html => { :readonly=>true }
+ end
+ end
end
|
Edit user form in admin backend.
|
diff --git a/lib/foodcritic/rake_task.rb b/lib/foodcritic/rake_task.rb
index abc1234..def5678 100644
--- a/lib/foodcritic/rake_task.rb
+++ b/lib/foodcritic/rake_task.rb
@@ -24,8 +24,11 @@ desc "Lint Chef cookbooks"
task(name) do
result = FoodCritic::Linter.new.check(files, options)
- puts result
- fail if result.failed?
+ if result.warnings.any?
+ puts result
+ end
+
+ fail result.to_s if result.failed?
end
end
|
Reduce unnecessary blank lines from console output if there's nothing to print.
We only print the food critic reviews if there's a warning and fail with a proper message if there's any.
|
diff --git a/lib/goodyear/query_cache.rb b/lib/goodyear/query_cache.rb
index abc1234..def5678 100644
--- a/lib/goodyear/query_cache.rb
+++ b/lib/goodyear/query_cache.rb
@@ -7,6 +7,7 @@
def cache_query(query)
cache_key = sha(query)
+ Goodyear.force_cache
result = if store.exist?(cache_key) && Goodyear.force_cache
ActiveSupport::Notifications.instrument "cache.query.elasticsearch", name: self.name, query: query
store.fetch cache_key
|
Use force cache only when needed
|
diff --git a/app/models/item.rb b/app/models/item.rb
index abc1234..def5678 100644
--- a/app/models/item.rb
+++ b/app/models/item.rb
@@ -5,7 +5,8 @@ has_many :order_items
has_many :orders, through: :order_items
- validates :title, :description, :price, :inventory_status, :image, presence: true
+ validates :title, :description, :price,
+ :inventory_status, :image, presence: true
validates :title, uniqueness: true
enum inventory_status: ["in-stock", "out-of-stock", "retired"]
|
Move validation to new line
Style for 80 char limit.
|
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb
index abc1234..def5678 100644
--- a/config/initializers/session_store.rb
+++ b/config/initializers/session_store.rb
@@ -11,7 +11,7 @@ # www.interconlarp.org becomes interconlarp.org
second_level_domain = just_hostname.split(".").reverse.take(2).reverse.join(".")
- cookie_options[:domain] = second_level_domain
+ cookie_options[:domain] = ".#{second_level_domain}"
end
Rails.application.config.session_store :active_record_store, cookie_options
|
Make sure the cookie will work for subdomains
|
diff --git a/lib/datadog/notifications/config.rb b/lib/datadog/notifications/config.rb
index abc1234..def5678 100644
--- a/lib/datadog/notifications/config.rb
+++ b/lib/datadog/notifications/config.rb
@@ -1,12 +1,13 @@ module Datadog
class Notifications
class Config
- attr_accessor :hostname, :namespace, :tags, :statsd_host, :statsd_port, :reporter, :plugins
+ attr_accessor :hostname, :namespace, :tags, :statsd_host, :statsd_port, :reporter, :plugins, :socket_path
def initialize
@hostname = ENV['INSTRUMENTATION_HOSTNAME'] || Socket.gethostname
@statsd_host = ENV['STATSD_HOST'] || ::Datadog::Statsd::DEFAULT_HOST
@statsd_port = (ENV['STATSD_PORT'] || ::Datadog::Statsd::DEFAULT_PORT).to_i
+ @socket_path = ENV['SOCKET_PATH']
@reporter = Datadog::Notifications::Reporter
@tags = []
@plugins = []
@@ -24,7 +25,7 @@ enable_hostname = hostname && hostname != 'false'
tags.push("host:#{hostname}") if enable_hostname && tags.none? {|t| t =~ /^host\:/ }
- reporter.new statsd_host, statsd_port, namespace: namespace, tags: tags
+ reporter.new statsd_host, statsd_port, namespace: namespace, tags: tags, socket_path: socket_path
end
protected :connect!
|
Support socket path when initializing dogstatsd
|
diff --git a/lib/oshpark/remote_model.rb b/lib/oshpark/remote_model.rb
index abc1234..def5678 100644
--- a/lib/oshpark/remote_model.rb
+++ b/lib/oshpark/remote_model.rb
@@ -2,6 +2,10 @@
module Oshpark
module RemoteModel
+
+ def self.included base
+ base.extend ClassMethods
+ end
def save!
attrs = {}
|
Fix bug where class methods were not being extended.
|
diff --git a/app/models/user.rb b/app/models/user.rb
index abc1234..def5678 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -5,11 +5,11 @@
def deposit(amount)
self.balance_cents += amount
- save
+ save!
end
def payment(amount)
self.balance_cents -= amount
- save
+ save!
end
def self.balance_sum
|
Use save! in deposit/payment methods
|
diff --git a/lib/rom/support/registry.rb b/lib/rom/support/registry.rb
index abc1234..def5678 100644
--- a/lib/rom/support/registry.rb
+++ b/lib/rom/support/registry.rb
@@ -3,6 +3,7 @@ # @api private
class Registry
include Enumerable
+ include Equalizer.new(:elements)
attr_reader :elements
|
Handle lack of schema gracefully while booting
* Fix correct class for reader registry
* Fix inspect for Boot
|
diff --git a/guides/rails_guides/helpers_ja.rb b/guides/rails_guides/helpers_ja.rb
index abc1234..def5678 100644
--- a/guides/rails_guides/helpers_ja.rb
+++ b/guides/rails_guides/helpers_ja.rb
@@ -13,11 +13,11 @@ def docs_for_sitemap(position)
case position
when "L"
- documents_by_section.to(3)
+ documents_by_section.to(4)
when "C"
- documents_by_section.from(4).take(2)
+ documents_by_section.from(5).take(2)
when "R"
- documents_by_section.from(6)
+ documents_by_section.from(7)
else
raise "Unknown position: #{position}"
end
|
Add and sort guides with new genre '他の構成要素' in Footer
|
diff --git a/lib/stackprof/middleware.rb b/lib/stackprof/middleware.rb
index abc1234..def5678 100644
--- a/lib/stackprof/middleware.rb
+++ b/lib/stackprof/middleware.rb
@@ -31,13 +31,14 @@ attr_accessor :enabled, :mode, :interval, :path
alias enabled? enabled
- def save
+ def save(filename = nil)
if results = StackProf.results
FileUtils.mkdir_p(Middleware.path)
- filename = "stackprof-#{results[:mode]}-#{Process.pid}-#{Time.now.to_i}.dump"
- File.open(File.join(Middleware.path, filename), 'wb') do |f|
+ filename ||= "stackprof-#{results[:mode]}-#{Process.pid}-#{Time.now.to_i}.dump"
+ File.open(File.join(Middleware.path, filename), 'wb') do |f|
f.write Marshal.dump(results)
end
+ filename
end
end
|
Allow for passing a specific filename to Middleware.save
Also return the filename instead of the return value of .open()
This allows for overwritting the same file when calling .save
manually as well as keeping track of the exact file written (using
the return value)
|
diff --git a/db/migrate/20190206235628_change_document_id_to_bigint.rb b/db/migrate/20190206235628_change_document_id_to_bigint.rb
index abc1234..def5678 100644
--- a/db/migrate/20190206235628_change_document_id_to_bigint.rb
+++ b/db/migrate/20190206235628_change_document_id_to_bigint.rb
@@ -0,0 +1,9 @@+class ChangeDocumentIdToBigint < ActiveRecord::Migration[6.0]
+ def up
+ change_column :documents, :id, :bigint
+ end
+
+ def down
+ change_column :documents, :id, :integer
+ end
+end
|
Update document_id primary key to bigint
|
diff --git a/lib/elastic_record/index/mapping.rb b/lib/elastic_record/index/mapping.rb
index abc1234..def5678 100644
--- a/lib/elastic_record/index/mapping.rb
+++ b/lib/elastic_record/index/mapping.rb
@@ -30,8 +30,7 @@ match_mapping_type: "string",
mapping: {
type: "string",
- index: "not_analyzed",
- doc_values: true
+ index: "not_analyzed"
}
}
}
|
Remove a case of the doc_values
|
diff --git a/lib/heroku_rails_deflate/railtie.rb b/lib/heroku_rails_deflate/railtie.rb
index abc1234..def5678 100644
--- a/lib/heroku_rails_deflate/railtie.rb
+++ b/lib/heroku_rails_deflate/railtie.rb
@@ -4,7 +4,14 @@ module HerokuRailsDeflate
class Railtie < Rails::Railtie
initializer "heroku_rails_deflate.middleware_initialization" do |app|
- app.middleware.insert_before ActionDispatch::Static, Rack::Deflater
+ # Put Rack::Deflater in the right place
+ if app.config.action_controller.perform_caching
+ app.middleware.insert_after Rack::Cache, Rack::Deflater
+ else
+ app.middleware.insert_before ActionDispatch::Static, Rack::Deflater
+ end
+
+ # Insert our custom middleware for serving gzipped static assets
app.middleware.insert_before ActionDispatch::Static, HerokuRailsDeflate::ServeZippedAssets, app.paths["public"].first, app.config.assets.prefix, app.config.static_cache_control
end
|
Put deflator in the right place
-- If caching is turned on, put deflator immediately after Rack::Cache
|
diff --git a/lib/ohm/contrib/date_validations.rb b/lib/ohm/contrib/date_validations.rb
index abc1234..def5678 100644
--- a/lib/ohm/contrib/date_validations.rb
+++ b/lib/ohm/contrib/date_validations.rb
@@ -2,11 +2,11 @@
module Ohm
module DateValidations
- DATE = /\A([0-9]{4})-([01]?[0-9])-([0123]?[0-9])\z/
+ DATE_REGEX = /\A([0-9]{4})-([01]?[0-9])-([0123]?[0-9])\z/
def assert_date(att, error = [att, :not_date])
- if assert_format att, DATE, error
- m = send(att).to_s.match(DATE)
+ if assert_format att, DATE_REGEX, error
+ m = send(att).to_s.match(DATE_REGEX)
assert is_date_parseable?(m[1], m[2], m[3]), error
end
end
|
Change DATE to DATE_REGEX for consistency.
|
diff --git a/lib/open_actions/tweet_at_target.rb b/lib/open_actions/tweet_at_target.rb
index abc1234..def5678 100644
--- a/lib/open_actions/tweet_at_target.rb
+++ b/lib/open_actions/tweet_at_target.rb
@@ -12,8 +12,29 @@ end
copy_strings do
- noun 'tweet'
leader_description '<strong>Tweet at someone</strong> to influence them.'
+ action_noun 'tweet'
+ action_unit 'tweet'
+ call_to_action 'Tweet'
+ call_to_action_short 'Tweet'
+ create_heading 'Create a tweet'
+ cta_incentive 'Add your voice'
+ edit_heading 'Edit tweet'
+ feed_label 'TWEET'
+ general_cta 'tweet'
+ impact_verbed 'tweeted'
+ invitation_accept 'Tweet'
+ inviter_message 'Your voice will make a difference. Tweet with us.'
+ not_verbed_this 'did not tweet'
+ short_verbed 'tweeted'
+ specific_cta 'tweet'
+ take_this_action 'tweet'
+ usage 'Get more tweets'
+ verb 'tweet'
+ verbed 'tweeted'
+ verbed_a 'sent a tweet'
+ verbed_this 'sent this tweet'
+ verbing 'sending this tweet'
end
def take_action!(data)
|
Add action strings for Twitter
|
diff --git a/lib/tasks/auto_annotate_models.rake b/lib/tasks/auto_annotate_models.rake
index abc1234..def5678 100644
--- a/lib/tasks/auto_annotate_models.rake
+++ b/lib/tasks/auto_annotate_models.rake
@@ -1,5 +1,12 @@ if Rails.env.development?
- Annotate.set_defaults("exclude_tests" => "true", "sort" => "true")
+ Annotate.set_defaults(
+ "show_foreign_keys" => "true",
+ "show_indexes" => "true",
+ "exclude_controllers" => "true",
+ "exclude_helpers" => "true",
+ "exclude_tests" => "true",
+ "sort" => "true"
+ )
# Annotate models
task :annotate do
|
Exclude some of annotate gem's new annotations
|
diff --git a/lib/travis/worker/workers/resque.rb b/lib/travis/worker/workers/resque.rb
index abc1234..def5678 100644
--- a/lib/travis/worker/workers/resque.rb
+++ b/lib/travis/worker/workers/resque.rb
@@ -20,10 +20,6 @@ stop_processing
requeue
raise $!
- end
-
- def shell
- self.class.shell
end
def work!
|
Remove one more unused methods
|
diff --git a/cookbooks/wt_edge_server/attributes/default.rb b/cookbooks/wt_edge_server/attributes/default.rb
index abc1234..def5678 100644
--- a/cookbooks/wt_edge_server/attributes/default.rb
+++ b/cookbooks/wt_edge_server/attributes/default.rb
@@ -1,5 +1,5 @@ #
-# Cookbook Name:: wt_collection_services
+# Cookbook Name:: wt_edge_server
# Attributes:: default
#
# Copyright 2012, Webtrends
|
Fix attribute name for edge server
|
diff --git a/spec/rails_spec.rb b/spec/rails_spec.rb
index abc1234..def5678 100644
--- a/spec/rails_spec.rb
+++ b/spec/rails_spec.rb
@@ -6,8 +6,16 @@ cache.rmtree if cache.exist?
end
+ def test_file(file)
+ if Rails.version.split('.').first.to_i >= 5
+ get :test, params: { file: 'sass' }
+ else
+ get :test, file: 'sass'
+ end
+ end
+
it "integrates with Rails and Sass" do
- get :test, params: { file: 'sass' }
+ test_file 'sass'
expect(response).to be_success
clear_css = response.body.gsub("\n", " ").squeeze(" ").strip
expect(clear_css).to eq "a { -webkit-mask: none; mask: none; }"
@@ -15,7 +23,7 @@
if Sprockets::Context.instance_methods.include?(:evaluate)
it 'supports evaluate' do
- get :test, params: { file: 'evaluate' }
+ test_file 'evaluate'
expect(response).to be_success
clear_css = response.body.gsub("\n", ' ').squeeze(' ').strip
expect(clear_css).to eq 'a { -webkit-mask: none; mask: none }'
|
Fix specs for old Rails
|
diff --git a/spec/rbNFA_spec.rb b/spec/rbNFA_spec.rb
index abc1234..def5678 100644
--- a/spec/rbNFA_spec.rb
+++ b/spec/rbNFA_spec.rb
@@ -8,20 +8,39 @@ end
it "can math string" do
+ pending("to implementig other")
regexp = Regexp.new("a")
regexp.match("aaa").should be_true
end
it "cannot match incorrect string" do
+ pending("implementing other")
regexp = Regexp.new("a")
regexp.match("bbb").should be_false
end
+ end
+
+ describe Lexer do
+ let(:lexer){ Lexer.new }
- it "return match object" do
- regexp = Regexp.new("a(b+)c")
- result = regexp.match("abbbbc")
- result.first.should eql "bbbb"
+ it "can lex a string into token stream" do
+ lexer.lex("").should have(0).tokens
end
+
+ it "on empty string don't generate tokens"
+
+ it "on literal chracter generate literal token"
+
+ it "on plus generate one or more token"
+
+ it "on star generate zero or more token"
+
+ it "on question mark generate zero or one token"
+
+ it "on left parenthesie generate begin group token"
+
+ it "on right parenthiesie generate end group token"
+
end
end
|
Add basic requirements to lexer
|
diff --git a/features/support/knows_the_domain.rb b/features/support/knows_the_domain.rb
index abc1234..def5678 100644
--- a/features/support/knows_the_domain.rb
+++ b/features/support/knows_the_domain.rb
@@ -1,6 +1,8 @@+require 'dawg'
+
module KnowsTheDomain
def my_dawg
- @my_dawg ||= Dawg::Node.new
+ @my_dawg ||= Dawg.new
end
def my_file
|
Change my_dawg from Dawg::Node to Dawg
|
diff --git a/lib/web_console/template.rb b/lib/web_console/template.rb
index abc1234..def5678 100644
--- a/lib/web_console/template.rb
+++ b/lib/web_console/template.rb
@@ -18,7 +18,7 @@
# Render a template (inferred from +template_paths+) as a plain string.
def render(template)
- view = View.new(template_paths, instance_values)
+ view = View.new(template_paths, instance_values, nil)
view.render(template: template, layout: false)
end
end
|
Fix the Rails 6 ActionView::Base instantiation deprecations
|
diff --git a/features/steps/negative_comparison_steps.rb b/features/steps/negative_comparison_steps.rb
index abc1234..def5678 100644
--- a/features/steps/negative_comparison_steps.rb
+++ b/features/steps/negative_comparison_steps.rb
@@ -1,6 +1,6 @@ Then("the error payload field {string} does not equal {string}") do |field_path, string_value|
payload_value = Maze::Helper.read_key_path(Maze::Server.errors.current[:body], field_path)
- result = value_compare(payload_value, string_value)
+ result = Maze::Compare.value(payload_value, string_value)
assert_false(result.equal?, "Value: #{string_value} equals payload element at: #{field_path}")
end
|
Update compare routine name
[full ci]
|
diff --git a/lib/rails_script/loader_helper.rb b/lib/rails_script/loader_helper.rb
index abc1234..def5678 100644
--- a/lib/rails_script/loader_helper.rb
+++ b/lib/rails_script/loader_helper.rb
@@ -9,6 +9,11 @@ return $this.#{ action_name }.call();
}
});
+
+ jQuery(document).on('page:before-change', function() {
+ jQuery(document).off();
+ jQuery(window).off();
+ });
RUBY
end
|
Remove event handlers on window and document when the page changes.
|
diff --git a/lib/saulabs/reportable/railtie.rb b/lib/saulabs/reportable/railtie.rb
index abc1234..def5678 100644
--- a/lib/saulabs/reportable/railtie.rb
+++ b/lib/saulabs/reportable/railtie.rb
@@ -1,4 +1,5 @@ require 'saulabs/reportable'
+require 'saulabs/reportable/report_tag_helper'
require 'rails'
module Saulabs
|
Fix booting with a rails 3.x app.
|
diff --git a/config/initializers/paperclip.rb b/config/initializers/paperclip.rb
index abc1234..def5678 100644
--- a/config/initializers/paperclip.rb
+++ b/config/initializers/paperclip.rb
@@ -36,4 +36,11 @@ end
end
+module PaperclipImageErrors
+ def mark_invalid(record, attribute, types)
+ record.errors.add attribute, :invalid, **options.merge(:types => types.join(', '))
+ end
+end
+
Paperclip::UrlGenerator.prepend(UpdatedUrlGenerator)
+Paperclip::Validators::AttachmentPresenceValidator.prepend(PaperclipImageErrors)
|
Patch keyword arguments syntax in Paperclip error handling
|
diff --git a/src/modules/module_monkey.rb b/src/modules/module_monkey.rb
index abc1234..def5678 100644
--- a/src/modules/module_monkey.rb
+++ b/src/modules/module_monkey.rb
@@ -1,24 +1,18 @@ require "yaml"
-class Bot
- def monkey_initialize(bot)
- @monkey = Monkey.new(@base_path, @module_config["monkey_file"])
- end
- def monkey_privmsg(bot, from, reply_to, msg)
- @monkey.privmsg(bot, from, reply_to, msg)
- end
-end
-
-class Monkey
- def initialize(base_path, filename)
- cfg_file = base_path + "/" + filename
+class Module_Monkey
+ def init_module(bot)
+ filename = bot.module_config["monkey_file"]
+ cfg_file = bot.base_path + "/" + filename
puts "Reading monkey config from '#{cfg_file}'"
@expressions = YAML.load_file(cfg_file)
+ puts "Read"
end
def privmsg(bot, from, reply_to, msg)
@expressions.value.each { |expr|
expr.each { |trigger, reply|
+ puts "trig"
if m = Regexp.new(trigger).match(msg)
updated_reply = reply.clone
(m.length - 1).times.map { |i| i + 1 }.each { |i|
@@ -28,7 +22,7 @@ end
}
updated_reply.gsub!("{from}", from)
- bot.privmsg(reply_to, updated_reply)
+ bot.send_privmsg(reply_to, updated_reply)
return
end
}
|
Convert monkey module to new format
Signed-off-by: Aki Saarinen <278bc57fbbff6b7b38435aea0f9d37e3d879167e@akisaarinen.fi>
|
diff --git a/cookbooks/kernel/kernel-4.1.1.rb b/cookbooks/kernel/kernel-4.1.1.rb
index abc1234..def5678 100644
--- a/cookbooks/kernel/kernel-4.1.1.rb
+++ b/cookbooks/kernel/kernel-4.1.1.rb
@@ -14,7 +14,6 @@
git build_dir do
repository "https://github.com/matsumoto-r/build-kernel-4.x-for-centos6.git"
- not_if "test -d #{build_dir}"
end
execute "setup building kernel" do
|
Use :sync for git resource
|
diff --git a/app/controllers/authors_controller.rb b/app/controllers/authors_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/authors_controller.rb
+++ b/app/controllers/authors_controller.rb
@@ -4,7 +4,7 @@
def create
author = Author.create author_params
- respond_with author, serializer: AuthorSerializer, root: 'author'
+ render json: author.paper.authors, each_serializer: AuthorSerializer
end
def update
|
Return Author Collection from create action
|
diff --git a/app/controllers/locales_controller.rb b/app/controllers/locales_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/locales_controller.rb
+++ b/app/controllers/locales_controller.rb
@@ -17,7 +17,7 @@ return if @path.blank?
return @path + '/new' if path_matches ROUTES_FOR_NEW
return @path + '/sign_up' if path_matches ROUTES_FOR_SIGN_UP
- path
+ @path
end
def path_matches routes_list
|
Fix error in locale path normalization
|
diff --git a/app/controllers/parties_controller.rb b/app/controllers/parties_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/parties_controller.rb
+++ b/app/controllers/parties_controller.rb
@@ -10,6 +10,10 @@ @representatives = @party.current_representatives
@representatives = @representatives.sort_by { |e| e.has_image? ? 0 : 1 }
- @propositions_feed = Hdo::Utils::PropositionsFeed.for_model(@party, :see_all => true)
+ @propositions_feed = Hdo::Utils::PropositionsFeed.for_model(
+ @party,
+ see_all: true,
+ title: "Siste forslag fra #{@party.name}"
+ )
end
end
|
Fix title of party proposition feed.
|
diff --git a/lib/generators/storytime/views_generator.rb b/lib/generators/storytime/views_generator.rb
index abc1234..def5678 100644
--- a/lib/generators/storytime/views_generator.rb
+++ b/lib/generators/storytime/views_generator.rb
@@ -9,12 +9,31 @@ argument :scope, :required => false, :default => nil,
:desc => "The scope to copy views to"
+ class_option :views, aliases: "-v", type: :array, desc: "Select specific view directories to generate (application, blog_posts, comments, dashboard, pages, posts, sites, subscription_mailer, subscriptions)"
+
public_task :copy_views
end
module ClassMethods
def hide!
Rails::Generators.hide_namespace self.namespace
+ end
+ end
+
+ def copy_views
+ if options[:views]
+ options[:views].each do |directory|
+ view_directory directory.to_sym
+ end
+ else
+ view_directory :application
+ view_directory :blog_posts
+ view_directory :comments
+ view_directory :pages
+ view_directory :posts
+ view_directory :sites
+ view_directory :subscription_mailer
+ view_directory :subscriptions
end
end
@@ -39,15 +58,6 @@
argument :scope, :required => false, :default => nil,
:desc => "The scope to copy views to"
-
- def copy_views
- view_directory :application
- view_directory :blog_posts
- view_directory :comments
- view_directory :pages
- view_directory :posts
- view_directory :sites
- end
end
end
end
|
Add option to copy specific views to host app
|
diff --git a/lib/licensee/matchers/dist_zilla_matcher.rb b/lib/licensee/matchers/dist_zilla_matcher.rb
index abc1234..def5678 100644
--- a/lib/licensee/matchers/dist_zilla_matcher.rb
+++ b/lib/licensee/matchers/dist_zilla_matcher.rb
@@ -3,9 +3,7 @@ class DistZilla < Package
attr_reader :file
- LICENSE_REGEX = /
- ^license\s*=\s*([a-z\-0-9\.]+)
- /ix
+ LICENSE_REGEX = /^license\s*=\s*([a-z\-0-9_]+)/i
private
|
Simplify license regex and replace . with _ character
|
diff --git a/app/helpers/ember_cli_rails_helper.rb b/app/helpers/ember_cli_rails_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/ember_cli_rails_helper.rb
+++ b/app/helpers/ember_cli_rails_helper.rb
@@ -1,9 +1,9 @@ module EmberCLIRailsHelper
- def include_ember_script_tags(name)
- javascript_include_tag *EmberCLI[name].exposed_js_assets
+ def include_ember_script_tags(name, options={})
+ javascript_include_tag *EmberCLI[name].exposed_js_assets, options
end
- def include_ember_stylesheet_tags(name)
- stylesheet_link_tag *EmberCLI[name].exposed_css_assets
+ def include_ember_stylesheet_tags(name, options={})
+ stylesheet_link_tag *EmberCLI[name].exposed_css_assets, options
end
end
|
Allow helpers to take options for ember assets
|
diff --git a/pages/app/controllers/constructor_pages/templates_controller.rb b/pages/app/controllers/constructor_pages/templates_controller.rb
index abc1234..def5678 100644
--- a/pages/app/controllers/constructor_pages/templates_controller.rb
+++ b/pages/app/controllers/constructor_pages/templates_controller.rb
@@ -6,7 +6,7 @@
movable :template
- before_filter {@roots = Template.roots}
+ before_filter -> {@roots = Template.roots}, only: [:new, :edit]
def index
@templates = Template.all
|
Change template before_filter for only new and edit
|
diff --git a/spec/jobs/raw_input_transform_job_spec.rb b/spec/jobs/raw_input_transform_job_spec.rb
index abc1234..def5678 100644
--- a/spec/jobs/raw_input_transform_job_spec.rb
+++ b/spec/jobs/raw_input_transform_job_spec.rb
@@ -4,7 +4,7 @@ describe '#perform' do
context 'with a new record' do
it 'creates that record and records the result' do
- source = Fabricate :source, name: 'rake'
+ source = Fabricate :source
import = Fabricate(:import,
source: source,
transformer: CsvTransformer)
|
Remove useless info in spec
|
diff --git a/lib/app/users.rb b/lib/app/users.rb
index abc1234..def5678 100644
--- a/lib/app/users.rb
+++ b/lib/app/users.rb
@@ -3,6 +3,7 @@ get '/:username' do |username|
user = User.where(username: username).first
halt 404 unless user
+ title(user.username)
erb :user, locals: {user: user, current: user.current_exercises, completed: user.completed_exercises}
end
|
Add <title> on user page
|
diff --git a/app/services/remove_status_service.rb b/app/services/remove_status_service.rb
index abc1234..def5678 100644
--- a/app/services/remove_status_service.rb
+++ b/app/services/remove_status_service.rb
@@ -34,7 +34,7 @@ end
def send_delete_salmon(account, status)
- NotificationWorker.perform_async(status.stream_entry_id, account.id)
+ NotificationWorker.perform_async(status.stream_entry.id, account.id)
end
def remove_reblogs(status)
|
Fix remove status service sending salmons
|
diff --git a/hello.rb b/hello.rb
index abc1234..def5678 100644
--- a/hello.rb
+++ b/hello.rb
@@ -8,7 +8,7 @@
# response to '/' url
get '/' do
- "This is the index page"
+ "<h1>This is the index page<h1>"
end
# response to '/hello' url
|
Add h1 tag to index page
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.