diff stringlengths 65 26.7k | message stringlengths 7 9.92k |
|---|---|
diff --git a/spec/controllers/movies_controller_spec.rb b/spec/controllers/movies_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/movies_controller_spec.rb
+++ b/spec/controllers/movies_controller_spec.rb
@@ -3,7 +3,7 @@ describe MoviesController do
describe "GET popular" do
it "assigns @movies" do
- VCR.use_cassette("movies_popular") do
+ VCR.use_cassette("movies_popular", match_requests_on: [VCR.request_matchers.uri_without_param(:api_key)]) do
get :popular
end
| Configure VCR to skip api_key
|
diff --git a/gtk3/lib/gtk3/icon-theme.rb b/gtk3/lib/gtk3/icon-theme.rb
index abc1234..def5678 100644
--- a/gtk3/lib/gtk3/icon-theme.rb
+++ b/gtk3/lib/gtk3/icon-theme.rb
@@ -16,9 +16,8 @@
module Gtk
class IconTheme
- def icons(context=nil)
- list_icons(context)
- end
+ alias_method :icons, :list_icons
+ alias_method :contexts, :list_contexts
alias_method :choose_icon_raw, :choose_icon
def choose_icon(icon_name, size, flags=nil)
@@ -27,9 +26,5 @@ end
choose_icon_raw(icon_name, size, flags)
end
-
- def contexts
- list_contexts
- end
end
end
| gtk3: Use alias_method instead of method define
Because these methods just call inner methods.
|
diff --git a/app/controllers/api/v1/positions_controller.rb b/app/controllers/api/v1/positions_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/api/v1/positions_controller.rb
+++ b/app/controllers/api/v1/positions_controller.rb
@@ -35,7 +35,9 @@ def position_params
params.require(:position).permit([
:name,
- :description
+ :description,
+ :group_id,
+ :paradigm
])
end
| Add description, group_id, and paradigm to position API controller
Signed-off-by: Max Fierke <0706025b2bbcec1ed8d64822f4eccd96314938d0@maxfierke.com>
|
diff --git a/config/boot.rb b/config/boot.rb
index abc1234..def5678 100644
--- a/config/boot.rb
+++ b/config/boot.rb
@@ -15,7 +15,7 @@ $LOAD_PATH << load_path('../')
$LOAD_PATH << load_path('../lib')
$LOAD_PATH << load_path('../app')
-%w(api contexts helpers representers models roles).each do |app_path|
+%w(api interactors helpers representers models roles).each do |app_path|
$LOAD_PATH << load_path("../app/#{app_path}")
end
| Add interactors to the load path, remove contexts
|
diff --git a/bin/terminalcolors.rb b/bin/terminalcolors.rb
index abc1234..def5678 100644
--- a/bin/terminalcolors.rb
+++ b/bin/terminalcolors.rb
@@ -0,0 +1,55 @@+#!/usr/bin/env ruby
+
+# http://stackoverflow.com/questions/1403353/256-color-terminal-library-for-ruby
+
+def ansi_color(red, green, blue)
+ 16 + (red * 36) + (green * 6) + blue
+end
+
+def twenty_four_bit_to_eight_bit_rbg(v)
+ red = (v & 0xff0000) >> 16
+ green = (v & 0x00ff00) >> 8
+ blue = (v & 0x0000ff)
+ [red, green, blue]
+end
+
+def eight_bit_to_scale_of_six(byte)
+ (byte * (6.0 / 256.0)).to_i
+end
+
+def eight_bit_rgb_to_scale_of_six(rgb)
+ rgb.map { |n| eight_bit_to_scale_of_six(n) }
+end
+
+def scale_of_six_rgb(v)
+ *rgb = twenty_four_bit_to_eight_bit_rbg(v)
+ eight_bit_rgb_to_scale_of_six(rgb)
+end
+
+
+solarized = [
+ [:base03 , 0x002b36],
+ [:base02 , 0x073642],
+ [:base01 , 0x586e75],
+ [:base00 , 0x657b83],
+ [:base0 , 0x839496],
+ [:base1 , 0x93a1a1],
+ [:base2 , 0xeee8d5],
+ [:base3 , 0xfdf6e3],
+ [:yellow , 0xb58900],
+ [:orange , 0xcb4b16],
+ [:red , 0xdc322f],
+ [:magenta , 0xd33682],
+ [:violet , 0x6c71c4],
+ [:blue , 0x268bd2],
+ [:cyan , 0x2aa198],
+ [:green , 0x719e07],
+]
+
+#foo = [
+# [:bg, 0x002b36],
+#]
+
+solarized.each do |name, v|
+ puts "%s: %s" % [name, ansi_color(*scale_of_six_rgb(v))]
+end
| Convert 24-bit codes to the nearest 256-colour code
|
diff --git a/contribulator.gemspec b/contribulator.gemspec
index abc1234..def5678 100644
--- a/contribulator.gemspec
+++ b/contribulator.gemspec
@@ -11,6 +11,7 @@ # Add your other files here if you make them
s.files = %w(
bin/contribulator
+lib/contribulator_version.rb
)
s.require_paths << 'lib'
s.bindir = 'bin'
| Update gemspec to include version
|
diff --git a/db/migrate/038_add_message_sender_index.rb b/db/migrate/038_add_message_sender_index.rb
index abc1234..def5678 100644
--- a/db/migrate/038_add_message_sender_index.rb
+++ b/db/migrate/038_add_message_sender_index.rb
@@ -0,0 +1,9 @@+class AddMessageSenderIndex < ActiveRecord::Migration
+ def self.up
+ add_index :messages, [:from_user_id], :name=> "messages_from_user_id_idx"
+ end
+
+ def self.down
+ drop_index :messages, :name=> "messages_from_user_id_idx"
+ end
+end
| Add an index on message sender.
|
diff --git a/db/migrate/20130419055252_setup_discuss.rb b/db/migrate/20130419055252_setup_discuss.rb
index abc1234..def5678 100644
--- a/db/migrate/20130419055252_setup_discuss.rb
+++ b/db/migrate/20130419055252_setup_discuss.rb
@@ -1,4 +1,4 @@-class SetupDiscuss < ActiveRecord::Migration
+class SetupDiscuss < ActiveRecord::Migration[4.2]
def change
create_table :discuss_messages do |t|
| Add Rails version tag to migration
|
diff --git a/features/step_definitions/web_steps_custom.rb b/features/step_definitions/web_steps_custom.rb
index abc1234..def5678 100644
--- a/features/step_definitions/web_steps_custom.rb
+++ b/features/step_definitions/web_steps_custom.rb
@@ -18,3 +18,7 @@ current_subdomain = URI.parse(current_url).host.sub(".#{Setting[:base_domain].sub(/:\d+$/, '')}", '')
current_subdomain.should == subdomain
end
+
+Then /^I should get a download with the filename "([^\"]*)"$/ do |filename|
+ page.response_headers['Content-Disposition'].should include("filename=\"#{filename}\"")
+end
| Add a custom web step for testing file downloads.
|
diff --git a/Casks/prott.rb b/Casks/prott.rb
index abc1234..def5678 100644
--- a/Casks/prott.rb
+++ b/Casks/prott.rb
@@ -4,7 +4,7 @@
url 'https://prottapp.com/app/gadgets/prott.dmg'
name 'Prott'
- homepage 'http://prottapp.com/'
+ homepage 'https://prottapp.com/'
license :unknown # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder
app 'Prott.app'
| Fix homepage to use SSL in Prott Cask
The HTTP URL is already getting redirected to HTTPS. Using the HTTPS URL directly
makes it more secure and saves a HTTP round-trip.
|
diff --git a/app/controllers/dashboards_controller.rb b/app/controllers/dashboards_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/dashboards_controller.rb
+++ b/app/controllers/dashboards_controller.rb
@@ -3,8 +3,12 @@ layout "water"
def show
- @student_courses = current_user.student.given_courses
- @assistant_courses = current_user.assistant.given_courses
+ # Fetches all courses for all roles for the given user
+ ["student", "assistant"].each do |r|
+ if role = current_user.send(r)
+ instance_variable_set("@#{r}_courses", role.given_courses)
+ end
+ end
end
def index
| Load courses for user dynamically in dashboard
|
diff --git a/app/helpers/admin/competitions_helper.rb b/app/helpers/admin/competitions_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/admin/competitions_helper.rb
+++ b/app/helpers/admin/competitions_helper.rb
@@ -4,6 +4,11 @@ missing_locales.each do |locale|
competition.locales.build(handle: locale)
end
+
+ if competition.days.size == 0
+ competition.days.build
+ end
+
competition
end
end
| Build competition day for nested attributes in form if none exist yet
|
diff --git a/app/lib/proxies/iframe_allowing_proxy.rb b/app/lib/proxies/iframe_allowing_proxy.rb
index abc1234..def5678 100644
--- a/app/lib/proxies/iframe_allowing_proxy.rb
+++ b/app/lib/proxies/iframe_allowing_proxy.rb
@@ -28,6 +28,11 @@ else
result = body
end
+
+ # Without this, I get `Rack::Lint::LintError: header must not contain Status`
+ # when testing locally
+ headers.delete('status')
+
[status, headers.tap { |h| h['x-frame-options'] = 'ALLOWALL' }, result]
end
end
| Delete status from the proxied headers
This seems to be causing issues for me locally. I've found a
workaround, and while its working in production without this, I don't
want someone else to have the same problem when working on Content
Tagger in the future.
|
diff --git a/Formula/alt.rb b/Formula/alt.rb
index abc1234..def5678 100644
--- a/Formula/alt.rb
+++ b/Formula/alt.rb
@@ -1,7 +1,7 @@ class Alt < Formula
desc "command-line utility to find alternate file"
- homepage "https://github.com/cyphactor/alt"
- url "https://github.com/cyphactor/alt/releases/download/v2.0.1/alt-2.0.1-x86_64-apple-darwin"
+ homepage "https://github.com/codebreakdown/alt"
+ url "https://github.com/codebreakdown/alt/releases/download/v2.0.1/alt-2.0.1-x86_64-apple-darwin"
version "2.0.1"
sha256 "d472c7ee484c7f5f3320a55b5a73ef6b37599c7b90e0e5b90bfc8a25d36369b4"
| Update to reference codebreakdown path
Why you made the change:
I did this so that it wouldn't have to use the redirects which might only work
for some temporary amount of time.
|
diff --git a/lib/s3_relay/model.rb b/lib/s3_relay/model.rb
index abc1234..def5678 100644
--- a/lib/s3_relay/model.rb
+++ b/lib/s3_relay/model.rb
@@ -37,7 +37,7 @@
association_method = "associate_#{attribute}"
- after_save association_method
+ after_save association_method.to_sym
define_method association_method do
new_uuids = send(virtual_attribute)
| Fix Rails 5.1 deprecation warning.
|
diff --git a/lib/tasks/events.rake b/lib/tasks/events.rake
index abc1234..def5678 100644
--- a/lib/tasks/events.rake
+++ b/lib/tasks/events.rake
@@ -1,5 +1,6 @@ namespace :events do
- desc 'Create demo data using our factories'
+ desc 'Nullifies wrong foreign keys for Track, Room, DifficultyLevel'
+
task fix_wrong_track: :environment do
events = Event.all.select { |e| e.track_id && Track.find_by(id: e.track_id).nil? }
puts "Will remove track_id from #{ActionController::Base.helpers.pluralize(events.length, 'event')}."
@@ -13,4 +14,32 @@ puts 'All done!'
end
end
+
+ task fix_wrong_difficulty_level: :environment do
+ events = Event.all.select { |e| e.difficulty_level_id && DifficultyLevel.find_by(id: e.difficulty_level_id).nil? }
+ puts "Will remove difficulty_level_id from #{ActionController::Base.helpers.pluralize(events.length, 'event')}."
+
+ if events.any?
+ puts "Event IDs: #{events.map(&:id)}"
+ events.each do |event|
+ event.difficulty_level_id = nil
+ event.save!
+ end
+ puts 'All done!'
+ end
+ end
+
+ task fix_wrong_room: :environment do
+ events = Event.all.select { |e| e.room_id && Room.find_by(id: e.room_id).nil? }
+ puts "Will remove track_id from #{ActionController::Base.helpers.pluralize(events.length, 'event')}."
+
+ if events.any?
+ puts "Event IDs: #{events.map(&:id)}"
+ events.each do |event|
+ event.room_id = nil
+ event.save!
+ end
+ puts 'All done!'
+ end
+ end
end
| Add task to fix room and difficulty_level foreign_keys
|
diff --git a/db/data_migration/20131010110031_delete_obsolete_dsa_and_vosa_roles.rb b/db/data_migration/20131010110031_delete_obsolete_dsa_and_vosa_roles.rb
index abc1234..def5678 100644
--- a/db/data_migration/20131010110031_delete_obsolete_dsa_and_vosa_roles.rb
+++ b/db/data_migration/20131010110031_delete_obsolete_dsa_and_vosa_roles.rb
@@ -0,0 +1,10 @@+slugs = %w(
+ chief-driving-examiner-driving-standards-agency
+ next-generation-testing-director-vehicle-and-operator-services-agency
+ operations-director-vehicle-and-operator-services-agency
+ scheme-management-and-external-relations-director-vehicle-and-operator-services-agency
+)
+roles = Role.where(slug: slugs)
+
+RoleAppointment.where(role_id: roles.pluck(:id)).delete_all
+roles.delete_all
| Delete obsolete DSA and VOSA roles
|
diff --git a/config/config.sample.ru b/config/config.sample.ru
index abc1234..def5678 100644
--- a/config/config.sample.ru
+++ b/config/config.sample.ru
@@ -21,11 +21,11 @@ #######################################################################
require Integrity.root / "app"
-set :public, Integrity.root / "public"
-set :views, Integrity.root / "views"
-set :port, 8910
-set :env, :production
-disable :run, :reload
+set :environment, ENV["RACK_ENV"] || :production
+set :public, Integrity.root / "public"
+set :views, Integrity.root / "views"
+set :port, 8910
+disable :run, :reload
use Rack::CommonLogger, Integrity.logger if Integrity.config[:log_debug_info]
run Sinatra::Application
| Set environement to RACK_ENV if applicable
|
diff --git a/runner.gemspec b/runner.gemspec
index abc1234..def5678 100644
--- a/runner.gemspec
+++ b/runner.gemspec
@@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = 'runner'
- s.version = '0.0.1.2'
+ s.version = '0.0.1.3'
s.summary = 'Run files that match a file specification, excluding those that match a regex'
s.description = ' '
| Increase versioin from 0.0.1.2 to 0.0.1.3
|
diff --git a/site-cookbooks/backup_restore/spec/recipes/configure_directory_spec.rb b/site-cookbooks/backup_restore/spec/recipes/configure_directory_spec.rb
index abc1234..def5678 100644
--- a/site-cookbooks/backup_restore/spec/recipes/configure_directory_spec.rb
+++ b/site-cookbooks/backup_restore/spec/recipes/configure_directory_spec.rb
@@ -0,0 +1,55 @@+require_relative '../spec_helper'
+
+describe 'backup_restore::configure_directory' do
+ let(:chef_run) do
+ runner = ChefSpec::Runner.new(
+ cookbook_path: %w(site-cookbooks cookbooks),
+ platform: 'centos',
+ version: '6.5'
+ ) do |node|
+ node.set['cloudconductor']['applications'] = {
+ dynamic_git_app: {
+ type: 'dynamic',
+ parameters: {
+ backup_directories: '/var/www/app'
+ }
+ }
+ }
+ node.set['backup_restore']['config']['use_proxy'] = 'localhost'
+ node.set['backup_restore']['destinations']['s3'] = {
+ bucket: 'cloudconductor',
+ access_key_id: '1234',
+ secret_access_key: '4321',
+ region: 'us-east-1',
+ prefix: '/backup'
+ }
+ end
+ runner.converge(described_recipe)
+ end
+
+ it 'create clon' do
+ expect(chef_run).to ChefSpec::Matchers::ResourceMatcher.new(
+ :backup_model,
+ :create,
+ :directory
+ ).with(
+ description: 'Backup directories',
+ definition: '`s3cmd sync /var/www/app s3://cloudconductor/backup/directories/`',
+ schedule: {
+ minute: '0',
+ hour: '2',
+ day: '*',
+ month: '*',
+ weekday: '0'
+ },
+ cron_options: {
+ path: ENV['PATH'],
+ output_log: '/var/log/backup/backup.log'
+ }
+ )
+ end
+
+ it 'set_proxy_env' do
+ expect(chef_run).to run_ruby_block('set_proxy_env')
+ end
+end
| Add chef-spec for configure_directory recipe
|
diff --git a/test/connection_adapters/redis_test.rb b/test/connection_adapters/redis_test.rb
index abc1234..def5678 100644
--- a/test/connection_adapters/redis_test.rb
+++ b/test/connection_adapters/redis_test.rb
@@ -0,0 +1,66 @@+require 'test_helper'
+
+class RenoirConnectionAdaptersRedisTest < Minitest::Test
+ def setup
+ node = CONFIG['cluster_nodes'].sample
+ host, port = case node
+ when Array
+ node
+ when String
+ node.split(':')
+ when Hash
+ [node['host'], node['port']]
+ else
+ fail 'invalid cluster_nodes config format'
+ end
+ @klass = Renoir::ConnectionAdapters::Redis
+ @adapter = @klass.new(host, port)
+ end
+
+ def test_get_keys_from_command
+ map = {
+ [:get, 'key1'] => ['key1'],
+ [:del, 'key1', 'key2'] => ['key1', 'key2'],
+ [:smove, 'source', 'dest', 123] => ['source', 'dest'],
+ [:blpop, 'key1', 'key2', 'key3', timeout: 50] => ['key1', 'key2', 'key3'],
+ [:bitop, :and, 'key1', 'key2', 'key3'] => ['key1', 'key2', 'key3'],
+ [:eval, 'SCRIPT', ['key1', 'key2'], []] => ['key1', 'key2'],
+ [:eval, 'SCRIPT', keys: ['key1', 'key2']] => ['key1', 'key2'],
+ [:georadius, 'key1', 0, 90, 1, :km, :store, 'key2'] => ['key1', 'key2'],
+ [:migrate, 'key', db: 1] => ['key'],
+ [:mset, 'key1', 123, 'key2', 456, 'key3', 789] => ['key1', 'key2', 'key3'],
+ [:sort, 'key1', store: 'key2'] => ['key1', 'key2'],
+ [:zinterstore, 'key1', ['key2', 'key3']] => ['key1', 'key2', 'key3']
+ }
+
+ map.each do |command, keys|
+ assert @klass.get_keys_from_command(command) == keys
+ end
+ end
+
+ def test_call_without_asking
+ conn_mock = Minitest::Mock.new
+ conn_mock.expect(:info, true)
+ @adapter.instance_variable_set(:@conn, conn_mock)
+
+ @adapter.call([:info], false)
+
+ conn_mock.verify
+ end
+
+ def test_call_with_asking
+ tx_mock = Minitest::Mock.new
+ tx_mock.expect(:asking, true)
+ tx_mock.expect(:info, true)
+ conn_mock = Struct.new(:tx_mock) do
+ def multi
+ yield tx_mock
+ end
+ end.new(tx_mock)
+ @adapter.instance_variable_set(:@conn, conn_mock)
+
+ @adapter.call([:info], true)
+
+ tx_mock.verify
+ end
+end
| Add Redis connection adapter test cases
|
diff --git a/test/elastic_record/relation/admin_test.rb b/test/elastic_record/relation/admin_test.rb
index abc1234..def5678 100644
--- a/test/elastic_record/relation/admin_test.rb
+++ b/test/elastic_record/relation/admin_test.rb
@@ -11,10 +11,13 @@ assert_equal ['green'], Widget.elastic_index.percolate(widget.as_search)
end
- # def test_create_warmer
- # Widget.elastic_relation.filter(color: 'green').create_warmer('green')
- # Widget.elastic_relation.filter(color: 'blue').create_warmer('blue')
- #
- # assert_equal ['green'], Widget.elastic_index.percolate(widget.as_search)
- # end
+ def test_create_warmer
+ Widget.elastic_index.delete_warmer('green') if Widget.elastic_index.warmer_exists?('green')
+
+ relation = Widget.elastic_relation.filter('color' => 'green')
+ relation.create_warmer('green')
+
+ expected = {}
+ assert_equal relation.as_elastic, Widget.elastic_index.get_warmer('green')['source']
+ end
end | Add warmer support to Relation API. Example:
* Place.filter(status: 'active').create_warmer('active')
This creates a search warmer for all future searches on
active places. For more info:
http://www.elasticsearch.org/guide/reference/api/admin-indices-warmers/
|
diff --git a/test/helpers/javascript_helper_test.rb b/test/helpers/javascript_helper_test.rb
index abc1234..def5678 100644
--- a/test/helpers/javascript_helper_test.rb
+++ b/test/helpers/javascript_helper_test.rb
@@ -3,6 +3,10 @@ class JavascriptHelperTest < ActionView::TestCase
include Sprockets::Rails::Helper
include JavascriptHelper
+
+ setup do
+ allow_unknown_assets
+ end
test "#javascript_include_async_tag doesn't do anything in debug mode" do
Mocha::Configuration.allow(:stubbing_non_public_method) do
@@ -19,4 +23,11 @@ javascript_include_async_tag("foo")
)
end
+
+ # This allows non-existent asset filenames to be used within a test, for
+ # sprockets-rails >= 3.2.0.
+ def allow_unknown_assets
+ return unless respond_to?(:unknown_asset_fallback)
+ stubs(:unknown_asset_fallback).returns(true)
+ end
end
| Make test compatible with sprockets-rails 3.2.0
|
diff --git a/test/integration/default/unifi_spec.rb b/test/integration/default/unifi_spec.rb
index abc1234..def5678 100644
--- a/test/integration/default/unifi_spec.rb
+++ b/test/integration/default/unifi_spec.rb
@@ -40,10 +40,6 @@ it { should be_installed }
end
-describe processes('bin/mongod') do
- it { should exist }
-end
-
describe port('27117') do
it { should be_listening }
end
| Remove mongodb process InSpec test
Signed-off-by: Gavin Reynolds <33fd0301077bc24fc6513513c71e288fcecc0c66@chef.io>
|
diff --git a/test/integration/generated_gst_test.rb b/test/integration/generated_gst_test.rb
index abc1234..def5678 100644
--- a/test/integration/generated_gst_test.rb
+++ b/test/integration/generated_gst_test.rb
@@ -14,5 +14,19 @@ GObject.signal_emit(instance, 'handoff')
a.must_equal 10
end
+
+ it 'correctly fetches the name' do
+ instance.name.must_equal 'sink'
+ end
+ end
+
+ describe 'Gst::AutoAudioSink' do
+ let(:instance) { Gst::ElementFactory.make('autoaudiosink', 'audiosink') }
+
+ it 'correctly fetches the name' do
+ skip
+ instance.get_name.must_equal 'audiosink'
+ instance.name.must_equal 'audiosink'
+ end
end
end
| Add skipped test to demonstrate broken property fetching
|
diff --git a/test/unit/publish_static_pages_test.rb b/test/unit/publish_static_pages_test.rb
index abc1234..def5678 100644
--- a/test/unit/publish_static_pages_test.rb
+++ b/test/unit/publish_static_pages_test.rb
@@ -12,8 +12,10 @@
test 'static pages presented to the publishing api are valid placeholders' do
publisher = PublishStaticPages.new
- presented = publisher.present_for_publishing_api(publisher.pages.first)
- expect_valid_placeholder(presented[:content])
+ publisher.pages.each do |page|
+ presented = publisher.present_for_publishing_api(page)
+ expect_valid_placeholder(presented[:content])
+ end
end
def expect_publishing(pages)
| Validate all static pages aginst the content schemas
Modify test to check that all the manually-defined content matches the
content schemas, not just the first one.
|
diff --git a/movie_page_scraper.rb b/movie_page_scraper.rb
index abc1234..def5678 100644
--- a/movie_page_scraper.rb
+++ b/movie_page_scraper.rb
@@ -3,6 +3,14 @@
# Scrapes a movie's mubi page for information not provided by the API
class MoviePageScraper
+ CSS_SELECTORS = {
+ release_country: '.film-show__country-year',
+ genres: '.film-show__genres',
+ runtime: '.film-show__film-meta',
+ synopsis: '.film-show__descriptions__synopsis',
+ rating: '.film-show__average-rating-overall'
+ }.freeze
+
def initialize(id)
@doc = Nokogiri::HTML RestClient.get "https://mubi.com/films/#{id}"
end
@@ -10,30 +18,30 @@ def release_country
@release_country ||=
# The line is in the form country, year
- @doc.css('.film-show__country-year').text.strip.split(',').first
+ @doc.css(CSS_SELECTORS[:release_country]).text.strip.split(',').first
end
def genres
@genres ||= begin
- text = @doc.css('.film-show__genres').text.strip
+ text = @doc.css(CSS_SELECTORS[:genres]).text.strip
- # Split the comma separated list of values and trim the spaces
+ # Genres are comma separated
text.split(',').map(&:strip)
end
end
# In minutes
def runtime
- @runtime ||= @doc.css('.film-show__film-meta').text.strip.to_i
+ @runtime ||= @doc.css(CSS_SELECTORS[:runtime]).text.strip.to_i
end
def synopsis
@synopsis ||=
# Synopsis is in the form Synopsis\n<synopsis copy>. We want the copy.
- @doc.css('.film-show__descriptions__synopsis').text.strip.split("\n")[1]
+ @doc.css(CSS_SELECTORS[:synopsis]).text.strip.split("\n")[1]
end
def rating
- @rating ||= @doc.css('.film-show__average-rating-overall').text.strip.to_f
+ @rating ||= @doc.css(CSS_SELECTORS[:rating]).text.strip.to_f
end
end
| Refactor css selectors
This will hopefully make them easier to change if the site breaks.
|
diff --git a/msfl_visitors.gemspec b/msfl_visitors.gemspec
index abc1234..def5678 100644
--- a/msfl_visitors.gemspec
+++ b/msfl_visitors.gemspec
@@ -1,6 +1,6 @@ Gem::Specification.new do |s|
s.name = 'msfl_visitors'
- s.version = '0.1.0.rc1'
+ s.version = '0.1.0.rc2'
s.date = '2015-05-08'
s.summary = "Convert MSFL to other forms"
s.description = "Visitor pattern approach to converting MSFL to other forms."
| Update the version to 0.1.0.rc2
|
diff --git a/app/controllers/api/scores_new_controller.rb b/app/controllers/api/scores_new_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/api/scores_new_controller.rb
+++ b/app/controllers/api/scores_new_controller.rb
@@ -6,7 +6,14 @@ return head :bad_request if @score.values.any?(&:blank?)
return head :not_modified if map_disabled?
- Score.new_score(@score) ? head(:ok) : head(:not_modified)
+ if Score.new_score(@score)
+ rank = Score.where(map: @score[:map], mode: @score[:mode])
+ .where('time < ?', @score[:time]).count + 1
+ @score[:rank] = rank
+ render json: @score
+ else
+ head(:not_modified)
+ end
end
private
| Return json of score if new score is a pb.
|
diff --git a/app/controllers/qualifications_controller.rb b/app/controllers/qualifications_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/qualifications_controller.rb
+++ b/app/controllers/qualifications_controller.rb
@@ -2,4 +2,9 @@ def index
@qualifications = Qualification.all
end
+
+ def show
+ @qualification = Qualification.find(params[:id])
+ @subjects = @qualification.subjects
+ end
end
| Add show action to qualifications controller
|
diff --git a/blog.rb b/blog.rb
index abc1234..def5678 100644
--- a/blog.rb
+++ b/blog.rb
@@ -5,9 +5,9 @@ require_relative 'lib/db-config'
require_relative 'lib/links'
-set :root, File.dirname(__FILE__)
+class Blog < Sinatra::Application
-class Blog < Sinatra::Application
+ set :root, File.dirname(__FILE__)
get "/" do
posts = Post.get_first_10
| Move set directive where it belongs
|
diff --git a/db/migrate/20140501171906_index_filtered_fields_on_task.rb b/db/migrate/20140501171906_index_filtered_fields_on_task.rb
index abc1234..def5678 100644
--- a/db/migrate/20140501171906_index_filtered_fields_on_task.rb
+++ b/db/migrate/20140501171906_index_filtered_fields_on_task.rb
@@ -0,0 +1,17 @@+class IndexFilteredFieldsOnTask < ActiveRecord::Migration
+ def self.up
+ add_index :tasks, :requestor_id
+ add_index :tasks, :target_id
+ add_index :tasks, :target_type
+ add_index :tasks, [:target_id, :target_type]
+ add_index :tasks, :status
+ end
+
+ def self.down
+ remove_index :tasks, :requestor_id
+ remove_index :tasks, :target_id
+ remove_index :tasks, :target_type
+ remove_index :tasks, [:target_id, :target_type]
+ remove_index :tasks, :status
+ end
+end
| Index filtered fields on Task
(ActionItem3127)
|
diff --git a/db/migrate/20160412200143_create_abrasf_desif_tax_codes.rb b/db/migrate/20160412200143_create_abrasf_desif_tax_codes.rb
index abc1234..def5678 100644
--- a/db/migrate/20160412200143_create_abrasf_desif_tax_codes.rb
+++ b/db/migrate/20160412200143_create_abrasf_desif_tax_codes.rb
@@ -2,7 +2,7 @@ def change
create_table :abrasf_desif_tax_codes do |t|
t.string :description, limit: 200
- t.references :abrasf_desif_service_item, foreign_key: true
+ t.references :abrasf_desif_service_item, foreign_key: true, index: true, null: false
end
end
end
| Add DB index to service_item reference at tax_code
|
diff --git a/lib/apnd/daemon/protocol.rb b/lib/apnd/daemon/protocol.rb
index abc1234..def5678 100644
--- a/lib/apnd/daemon/protocol.rb
+++ b/lib/apnd/daemon/protocol.rb
@@ -29,11 +29,13 @@ #
def receive_data(data)
(@buffer ||= "") << data
- if notification = APND::Notification.valid?(@buffer)
- ohai "#{@address.last}:#{@address.first} added new Notification to queue"
- queue.push(notification)
- else
- ohai "#{@address.last}:#{@address.first} submitted invalid Notification"
+ @buffer.each_line do |line|
+ if notification = APND::Notification.valid?(line)
+ ohai "#{@address.last}:#{@address.first} added new Notification to queue"
+ queue.push(notification)
+ else
+ ohai "#{@address.last}:#{@address.first} submitted invalid Notification"
+ end
end
end
end
| Support multiple APNs per packet (see details below)
Versions of APND prior to 0.1.4 had a bug in APND::Daemon::Protocol which
allowed only one APN to be sent per packet.
Ex:
APND::Notification.open_upstream_socket do |sock|
sock.write(notification1.to_bytes)
sock.write(notification2.to_bytes)
end
This code would cause both notifications to be sent to the APND::Daemon in
a single packet (separated by new lines \n). The first notification would be
parsed from the packet, and then the others were discarded.
This commit fixes the issue by searching each line in a received packet for
APNs to queue.
|
diff --git a/lib/aptible/api/database.rb b/lib/aptible/api/database.rb
index abc1234..def5678 100644
--- a/lib/aptible/api/database.rb
+++ b/lib/aptible/api/database.rb
@@ -5,8 +5,10 @@ embeds_one :last_operation
embeds_one :disk
has_one :service
+ has_one :initialize_from
has_many :operations
has_many :backups
+ has_many :dependents
field :id
field :handle
| Add new Database object fields
|
diff --git a/lib/blade/assets/builder.rb b/lib/blade/assets/builder.rb
index abc1234..def5678 100644
--- a/lib/blade/assets/builder.rb
+++ b/lib/blade/assets/builder.rb
@@ -6,8 +6,12 @@ end
def build
+ puts "Building assets…"
+
clean
compile
+ clean_dist_path
+ create_dist_path
install
end
@@ -19,11 +23,12 @@ end
def install
- create_dist_path
-
logical_paths.each do |logical_path|
fingerprint_path = manifest.assets[logical_path]
- FileUtils.cp(compile_path.join(fingerprint_path), dist_path.join(logical_path))
+ source_path = compile_path.join(fingerprint_path)
+ destination_path = dist_path.join(logical_path)
+ FileUtils.cp(source_path, destination_path)
+ puts "[created] #{destination_path}"
end
end
@@ -44,6 +49,20 @@ dist_path.mkpath unless dist_path.exist?
end
+ def clean_dist_path
+ if clean_dist_path?
+ children = dist_path.children
+ dist_path.rmtree
+ children.each do |child|
+ puts "[removed] #{child}"
+ end
+ end
+ end
+
+ def clean_dist_path?
+ Blade.config.build.clean && dist_path.exist?
+ end
+
def dist_path
@dist_path ||= Pathname.new(Blade.config.build.path)
end
| Add clean option to build and add build output
|
diff --git a/lib/dbt/drivers/postgres.rb b/lib/dbt/drivers/postgres.rb
index abc1234..def5678 100644
--- a/lib/dbt/drivers/postgres.rb
+++ b/lib/dbt/drivers/postgres.rb
@@ -40,7 +40,7 @@ end
def port
- config_value("port", true) || 5432
+ @port || 5432
end
end
| Return the default port as an integer
|
diff --git a/config/initializers/omniauth_shibboleth.rb b/config/initializers/omniauth_shibboleth.rb
index abc1234..def5678 100644
--- a/config/initializers/omniauth_shibboleth.rb
+++ b/config/initializers/omniauth_shibboleth.rb
@@ -1,5 +1,5 @@ Rails.application.config.middleware.use OmniAuth::Builder do
- if Rails.env.production?
+ if true #Rails.env.production?
opts = YAML.load_file(File.join(Rails.root, 'config', 'shibboleth.yml'))[Rails.env]
provider :shibboleth, opts.symbolize_keys
Dmptool2::Application.shibboleth_host = opts['host']
| Fix up for testing - had wrong dns name.
|
diff --git a/app/models/ngo.rb b/app/models/ngo.rb
index abc1234..def5678 100644
--- a/app/models/ngo.rb
+++ b/app/models/ngo.rb
@@ -1,6 +1,8 @@ class Ngo < ApplicationRecord
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :confirmable, :validatable
+
+ enum locale: { de: 0, en: 1 }
has_one :contact, dependent: :destroy
| Define locale enum for NGO
|
diff --git a/init.rb b/init.rb
index abc1234..def5678 100644
--- a/init.rb
+++ b/init.rb
@@ -1,4 +1,4 @@-require 'acts_as_state_machine'
+require 'simple_state_machine'
ActiveRecord::Base.class_eval do
include SimpleStateMachine
| Remove stupid dependancy to acts_as_state_machine
|
diff --git a/oj_mimic_json.gemspec b/oj_mimic_json.gemspec
index abc1234..def5678 100644
--- a/oj_mimic_json.gemspec
+++ b/oj_mimic_json.gemspec
@@ -1,4 +1,3 @@-
Gem::Specification.new do |s|
s.name = "oj_mimic_json"
s.version = '1.0.0'
@@ -8,6 +7,7 @@ s.homepage = "http://www.ohler.com/oj"
s.summary = "Simple gem to call Oj.mimic_JSON when using bundler or just want to limit code changes to just pulling in gems."
s.description = %{An experimental Object-base Parallel Evaluation Environment. }
+ s.licenses = ['MIT', 'GPL-3.0']
s.files = ['README.md', 'lib/oj_mimic_json.rb']
s.require_paths = ['lib']
| Add licenses, same as oj |
diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb
index abc1234..def5678 100644
--- a/app/mailers/application_mailer.rb
+++ b/app/mailers/application_mailer.rb
@@ -1,4 +1,4 @@ class ApplicationMailer < ActionMailer::Base
- default from: "noreply@openhq.com"
+ default from: ENV['MAILGUN_FROM_EMAIL']
layout 'mailer'
-end+end
| Use env var for default from email
|
diff --git a/app/models/concerns/filterable.rb b/app/models/concerns/filterable.rb
index abc1234..def5678 100644
--- a/app/models/concerns/filterable.rb
+++ b/app/models/concerns/filterable.rb
@@ -5,7 +5,7 @@ def filter(filtering_params)
results = self.where(nil)
filtering_params.each do |key, value|
- results = results.public_send(key, value) if value.present?
+ results = results.public_send(key, value) if value.present? && value != 'all'
end
results
end
| Fix filter by param all
|
diff --git a/app/models/iiif_manifest_range.rb b/app/models/iiif_manifest_range.rb
index abc1234..def5678 100644
--- a/app/models/iiif_manifest_range.rb
+++ b/app/models/iiif_manifest_range.rb
@@ -0,0 +1,10 @@+# frozen_string_literal: true
+
+class IiifManifestRange
+ attr_reader :label, :items
+
+ def initialize(label:, items: [])
+ @label = label
+ @items = items
+ end
+end
| Add IiifManifestRange which was missing from previous commits
|
diff --git a/lib/simple_request_stats.rb b/lib/simple_request_stats.rb
index abc1234..def5678 100644
--- a/lib/simple_request_stats.rb
+++ b/lib/simple_request_stats.rb
@@ -1,5 +1,5 @@ module SimpleRequestStats
- mattr_accessor :groups
+ mattr_reader :groups
@@groups = {}
def self.setup
| Use attribute reader instead of accessor
|
diff --git a/lib/tasks/launch_promo.rake b/lib/tasks/launch_promo.rake
index abc1234..def5678 100644
--- a/lib/tasks/launch_promo.rake
+++ b/lib/tasks/launch_promo.rake
@@ -8,7 +8,7 @@ puts "Promo is not running, check the active_promo_id config var."
end
- publishers = Publisher.all
+ publishers = Publisher.where(promo_token_2018q1: nil).where(promo_enabled_2018q1: false)
publishers.find_each do |publisher|
token = PublisherPromoTokenGenerator.new(publisher: publisher).perform
| Fix promo launch task to not send to anyone who has enabled the promo
|
diff --git a/app/models/company.rb b/app/models/company.rb
index abc1234..def5678 100644
--- a/app/models/company.rb
+++ b/app/models/company.rb
@@ -16,4 +16,5 @@ #
class Company < ApplicationRecord
+ validates :name, presence: true
end
| Validate presence of Company name
|
diff --git a/app/models/message.rb b/app/models/message.rb
index abc1234..def5678 100644
--- a/app/models/message.rb
+++ b/app/models/message.rb
@@ -9,7 +9,7 @@ private
def pass_through_original_email
- UserMailer.delay.message_received(self.id)
+ UserMailer.delay(priority: 100).message_received(self.id)
end
end
| Add priority to pass-through job
|
diff --git a/libraries/check_type_ntp.rb b/libraries/check_type_ntp.rb
index abc1234..def5678 100644
--- a/libraries/check_type_ntp.rb
+++ b/libraries/check_type_ntp.rb
@@ -0,0 +1,28 @@+require File.expand_path(File.dirname(__FILE__) + '/check_type')
+class Circonus
+ class CheckType
+ class Ntp < Circonus::CheckType
+ Circonus::MetricScanner.register_type(:ntp, self)
+
+ def fixed?
+ return true
+ end
+
+ def all
+ return {
+ 'clock_name' => { :label => 'Clock name', :type => :text, },
+ 'delay' => { :label => 'Delay', :type => :numeric, },
+ 'dispersion' => { :label => 'Dispersion', :type => :numeric, },
+ 'jitter' => { :label => 'Jitter', :type => :numeric, },
+ 'offset' => { :label => 'Offset', :type => :numeric, },
+ 'offset_ms' => { :label => 'Offset ms', :type => :numeric, },
+ 'peers' => { :label => 'Peers', :type => :numeric, },
+ 'poll' => { :label => 'Poll', :type => :numeric, },
+ 'stratum' => { :label => 'Stratum', :type => :numeric, },
+ 'when' => { :label => 'When', :type => :numeric, },
+ 'xleave' => { :label => 'Xleave', :type => :numeric, },
+ }
+ end
+ end
+ end
+end
| Add support for working with NTP check types
|
diff --git a/test/test_cli.rb b/test/test_cli.rb
index abc1234..def5678 100644
--- a/test/test_cli.rb
+++ b/test/test_cli.rb
@@ -32,7 +32,7 @@ end
should "display help information (run from the system's shell)" do
- capture_output { `#{File.expand_path("../bin/tracking")} --help` }
+ capture_output { `#{ File.join(File.dirname(__FILE__), "..", "bin", "tracking") } --help` }
end
end
| Fix relative path stuff in "tracking -h" test
|
diff --git a/vagrant-free-memory.gemspec b/vagrant-free-memory.gemspec
index abc1234..def5678 100644
--- a/vagrant-free-memory.gemspec
+++ b/vagrant-free-memory.gemspec
@@ -5,7 +5,7 @@
Gem::Specification.new do |spec|
spec.name = "vagrant-free-memory"
- spec.version = Vagrant::Free::Memory::VERSION
+ spec.version = VagrantFreeMemory::VERSION
spec.authors = ["Robby Colvin"]
spec.email = ["geetarista@gmail.com"]
spec.description = %q{Vagrant plugin example from the book Vagrant: Up and Running}
| Fix the module name here as well
|
diff --git a/webapp/config.ru b/webapp/config.ru
index abc1234..def5678 100644
--- a/webapp/config.ru
+++ b/webapp/config.ru
@@ -1,21 +1,24 @@ require 'rubygems'
require 'sinatra'
+require 'logger'
$LOAD_PATH << "../lib"
$LOAD_PATH << "../models"
require_relative 'energie_api.rb'
+set :logger, Logger.new(STDOUT)
+
run_static_site = ENV.fetch("RACK_ENV") != "production"
if run_static_site
static_controller = Sinatra.new do
- ELM_BUILD_PATH = File.dirname(__FILE__) + '/../../elm/out'
+ REACT_BUILD_PATH = File.dirname(__FILE__) + '/../../../meter-reader-react/build'
- set :public_folder, ELM_BUILD_PATH
+ set :public_folder, REACT_BUILD_PATH
get '/' do
- File.read(File.join(ELM_BUILD_PATH, "index.html"))
+ File.read(File.join(REACT_BUILD_PATH, "index.html"))
end
end
end
| Fix rackup paths for React app development.
|
diff --git a/spec/controllers/admin/white_list_users_controller_spec.rb b/spec/controllers/admin/white_list_users_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/admin/white_list_users_controller_spec.rb
+++ b/spec/controllers/admin/white_list_users_controller_spec.rb
@@ -2,15 +2,14 @@
describe GreenFlag::Admin::WhiteListUsersController do
- let(:user) { FactoryGirl.create(:user) }
-
- let(:feature) { GreenFlag::Feature.create(code: 'asdf') }
- let(:site_visitor) { GreenFlag::SiteVisitor.create!(user_id: user.id, visitor_code: '123') }
- let(:whitelist_feature_decision) { GreenFlag::FeatureDecision.create!(feature: feature, site_visitor: site_visitor, enabled: true, manual: true) }
-
describe '#index' do
- subject { get :index, feature_id: feature.id, format: 'js' }
- it { should be_successful }
+ subject { get :index, feature_id: 1, format: 'js' }
+ context 'with no whitelisted users' do
+ before(:each) do
+ allow(GreenFlag::FeatureDecision).to receive(:whitelisted_users) { [] }
+ end
+ it { should be_successful }
+ end
end
end
| Use stubs to avoid setup in controller test
|
diff --git a/lib/codelation/development/dependencies.rb b/lib/codelation/development/dependencies.rb
index abc1234..def5678 100644
--- a/lib/codelation/development/dependencies.rb
+++ b/lib/codelation/development/dependencies.rb
@@ -12,7 +12,6 @@ run_command("brew install bash")
run_command("brew install git")
run_command("brew install imagemagick")
- run_command("brew install make")
run_command("brew install openssl")
run_command("brew install v8")
run_command("brew install wget")
| Remove installing make w/ homebrew
|
diff --git a/lib/g5_authenticatable/test/env_helpers.rb b/lib/g5_authenticatable/test/env_helpers.rb
index abc1234..def5678 100644
--- a/lib/g5_authenticatable/test/env_helpers.rb
+++ b/lib/g5_authenticatable/test/env_helpers.rb
@@ -1,8 +1,17 @@-RSpec.configure do |config|
- config.around(:each) do |example|
- orig_auth_endpoint = ENV['G5_AUTH_ENDPOINT']
- ENV['G5_AUTH_ENDPOINT'] = 'https://test.auth.host'
- example.run
- ENV['G5_AUTH_ENDPOINT'] = orig_auth_endpoint
+module G5Authenticatable
+ module Test
+ module EnvHelpers
+ def stub_env_var(name, value)
+ stub_const('ENV', ENV.to_hash.merge(name => value))
+ end
+ end
end
end
+
+RSpec.configure do |config|
+ config.include G5Authenticatable::Test::EnvHelpers
+
+ config.before(:each) do
+ stub_env_var('G5_AUTH_ENDPOINT', 'https://test.auth.host')
+ end
+end
| Refactor env var test helpers
|
diff --git a/lib/netsuite/records/inventory_transfer.rb b/lib/netsuite/records/inventory_transfer.rb
index abc1234..def5678 100644
--- a/lib/netsuite/records/inventory_transfer.rb
+++ b/lib/netsuite/records/inventory_transfer.rb
@@ -12,10 +12,9 @@ fields :created_date, :last_modified_date, :tran_date, :tran_id, :memo
field :inventory_list, InventoryTransferInventoryList
- field :custom_field_list, CustomFieldList
record_refs :posting_period, :location, :transfer_location, :department,
- :subsidiary, :custom_form
+ :subsidiary
attr_reader :internal_id
attr_accessor :external_id
| Remove Inventory Transfer custom field list
|
diff --git a/barebones.gemspec b/barebones.gemspec
index abc1234..def5678 100644
--- a/barebones.gemspec
+++ b/barebones.gemspec
@@ -2,7 +2,7 @@
Gem::Specification.new do |s|
s.name = "barebones"
- s.version = "0.1.0"
+ s.version = "0.1.1"
s.date = "2015-10-19"
s.licenses = ['MIT']
s.summary = "Rails template generator"
@@ -10,7 +10,7 @@ s.authors = ["Danny Yu"]
s.files = `git ls-files -z`.split("\x0")
s.executables = ["barebones"]
- s.homepage = "https://rubygems.org/gems/barebones"
+ s.homepage = "https://github.com/dannyyu92/barebones"
s.add_dependency 'rails', Barebones::RAILS_VERSION
end | Add github as homepage in gemspec
|
diff --git a/wmi-lite.gemspec b/wmi-lite.gemspec
index abc1234..def5678 100644
--- a/wmi-lite.gemspec
+++ b/wmi-lite.gemspec
@@ -26,6 +26,4 @@ spec.add_development_dependency 'bundler', '~> 1.3'
spec.add_development_dependency 'rspec'
spec.add_development_dependency 'rake'
- spec.add_development_dependency 'pry'
- spec.add_development_dependency 'pry-byebug'
end
| Remove dev deps from the gemspec
Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
|
diff --git a/examples/representation_for.rb b/examples/representation_for.rb
index abc1234..def5678 100644
--- a/examples/representation_for.rb
+++ b/examples/representation_for.rb
@@ -0,0 +1,24 @@+class Domain
+ attr_accessor :name, :ttl, :zone_file
+end
+
+class DomainMapper
+ include Kartograph::DSL
+
+ kartograph do
+ mapping Domain
+ root_key singular: 'domain', plural: 'domains', scopes: [:read]
+
+ property :name, scopes: [:read, :create]
+ property :ttl, scopes: [:read, :create]
+ property :zone_file, scopes: [:read]
+ end
+end
+
+domain = Domain.new
+domain.name = 'example.com'
+domain.ttl = 3600
+domain.zone_file = "this wont be represented for create"
+
+puts DomainMapper.representation_for(:create, domain)
+#=> {"name":"example.com","ttl":3600} | Add representation for example file.
|
diff --git a/spec/controllers/bathrooms_controller_spec.rb b/spec/controllers/bathrooms_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/bathrooms_controller_spec.rb
+++ b/spec/controllers/bathrooms_controller_spec.rb
@@ -5,4 +5,20 @@ get :index
expect(response).to be_success
end
+
+ context "voting" do
+ let(:bathroom) { FactoryGirl.create(:bathroom) }
+
+ it "should downvote" do
+ expect {
+ post :down_vote, id: bathroom.id
+ }.to change { bathroom.reload.downvote }.by 1
+ end
+
+ it "should upvote" do
+ expect {
+ post :up_vote, id: bathroom.id
+ }.to change { bathroom.reload.upvote }.by 1
+ end
+ end
end
| Test upvote and downvote actions in BathroomsController
|
diff --git a/spec/jobs/downloads_cache_cleanup_job_spec.rb b/spec/jobs/downloads_cache_cleanup_job_spec.rb
index abc1234..def5678 100644
--- a/spec/jobs/downloads_cache_cleanup_job_spec.rb
+++ b/spec/jobs/downloads_cache_cleanup_job_spec.rb
@@ -0,0 +1,22 @@+require "rails_helper"
+
+RSpec.describe DownloadsCacheCleanupJob, type: :job do
+ include ActiveJob::TestHelper
+
+ subject(:job) { described_class.perform_later('shipments') }
+
+ it 'queues the job' do
+ expect { job }
+ .to change(ActiveJob::Base.queue_adapter.enqueued_jobs, :size).by(1)
+ end
+
+ it 'is in default queue' do
+ expect(described_class.new.queue_name).to eq('default')
+ end
+
+ it 'should invoke clear shipments method' do
+ expect(DownloadsCache).to receive('clear_shipments')
+ described_class.perform_now('shipments')
+ end
+end
+
| Add specs for cleanup job
|
diff --git a/spec/ruby/library/stringscanner/getch_spec.rb b/spec/ruby/library/stringscanner/getch_spec.rb
index abc1234..def5678 100644
--- a/spec/ruby/library/stringscanner/getch_spec.rb
+++ b/spec/ruby/library/stringscanner/getch_spec.rb
@@ -39,10 +39,13 @@ s.getch.should == nil
end
- it "does not accept any arguments" do
- s = StringScanner.new('abc')
- lambda {
- s.getch(5)
- }.should raise_error(ArgumentError, /wrong .* arguments/)
+ it "always returns instance of String, never a String subclass" do
+ cls = Class.new(String)
+ sub = cls.new("abc")
+
+ s = StringScanner.new(sub)
+ ch = s.getch
+ ch.should_not be_kind_of(cls)
+ ch.should == "a"
end
end
| Add StringScanner test for class of returned values
|
diff --git a/AHKSlider.podspec b/AHKSlider.podspec
index abc1234..def5678 100644
--- a/AHKSlider.podspec
+++ b/AHKSlider.podspec
@@ -1,37 +1,16 @@-#
-# Be sure to run `pod lib lint NAME.podspec' to ensure this is a
-# valid spec and remove all comments before submitting the spec.
-#
-# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
-#
Pod::Spec.new do |s|
s.name = "AHKSlider"
s.version = "0.1.0"
- s.summary = "A short description of AHKSlider."
- s.description = <<-DESC
- An optional longer description of AHKSlider
-
- * Markdown format.
- * Don't worry about the indent, we strip it!
- DESC
- s.homepage = "http://EXAMPLE/NAME"
- s.screenshots = "www.example.com/screenshots_1", "www.example.com/screenshots_2"
+ s.summary = "UISlider subclass that improves value precision of the value selection."
+ s.homepage = "https://github.com/fastred/AHKSlider"
s.license = 'MIT'
s.author = { "Arkadiusz Holko" => "fastred@fastred.org" }
- s.source = { :git => "http://EXAMPLE/NAME.git", :tag => s.version.to_s }
- s.social_media_url = 'https://twitter.com/EXAMPLE'
+ s.source = { :git => "https://github.com/fastred/AHKSlider.git", :tag => s.version.to_s }
- # s.platform = :ios, '5.0'
- # s.ios.deployment_target = '5.0'
- # s.osx.deployment_target = '10.7'
+ s.platform = :ios, '6.0'
+ s.ios.deployment_target = '6.0'
s.requires_arc = true
s.source_files = 'Classes'
- s.resources = 'Assets/*.png'
-
- s.ios.exclude_files = 'Classes/osx'
- s.osx.exclude_files = 'Classes/ios'
- # s.public_header_files = 'Classes/**/*.h'
- # s.frameworks = 'SomeFramework', 'AnotherFramework'
- # s.dependency 'JSONKit', '~> 1.4'
+ s.public_header_files = 'Classes/**/*.h'
end
| Bring .podspec to an almost release ready state
|
diff --git a/Casks/clipgrab.rb b/Casks/clipgrab.rb
index abc1234..def5678 100644
--- a/Casks/clipgrab.rb
+++ b/Casks/clipgrab.rb
@@ -1,8 +1,8 @@ cask 'clipgrab' do
- version '3.5.6'
- sha256 '3d48056e796c884ef6c2d7de71fb077b94d30508779661ebe43f462340c3759f'
+ version '3.6.1'
+ sha256 'd5c3f20bc0d659606a9f36274a3c6dc4cca1aac50a6e0891e4ab2136e21af67b'
- url "http://download.clipgrab.de/ClipGrab-#{version}.dmg"
+ url "https://download.clipgrab.org/ClipGrab-#{version}.dmg"
name 'ClipGrab'
homepage 'http://clipgrab.org'
license :gratis
| Fix `url` stanza comment for ClipGrab.
|
diff --git a/appraisal.gemspec b/appraisal.gemspec
index abc1234..def5678 100644
--- a/appraisal.gemspec
+++ b/appraisal.gemspec
@@ -1,6 +1,6 @@ Gem::Specification.new do |s|
s.name = %q{appraisal}
- s.version = '0.2.0'
+ s.version = '0.3.0'
s.summary = %q{Find out what your Ruby gems are worth}
s.description = %q{Appraisal integrates with bundler and rake to test your library against different versions of dependencies in repeatable scenarios called "appraisals."}
| Bump version to 0.3.0 after introducing `gemspec` support. |
diff --git a/app/controllers/application.rb b/app/controllers/application.rb
index abc1234..def5678 100644
--- a/app/controllers/application.rb
+++ b/app/controllers/application.rb
@@ -5,6 +5,7 @@ protect_from_forgery
filter_parameter_logging :password, :password_confirmation
+ #before_filter :scope_by_domain
before_filter :login_required
protected
@@ -23,4 +24,8 @@ redirect_to(session[:return_to] || default)
session[:return_to] = nil
end
+
+ #def scope_by_domain
+ # @current_domain = Domain.find_by_domain_name!(request.subdomains.join('.'))
+ #end
end
| Add logic to handle multiple domains without actually making the change -- the rest is going to need to be a branch as it will definitely break a bunch of stuff
|
diff --git a/app/metal/create_admin_user.rb b/app/metal/create_admin_user.rb
index abc1234..def5678 100644
--- a/app/metal/create_admin_user.rb
+++ b/app/metal/create_admin_user.rb
@@ -5,7 +5,7 @@ class CreateAdminUser
def self.call(env)
- if env["PATH_INFO"] =~ /^\/users/ or @admin_defined or not User.table_exists?
+ if env["PATH_INFO"] =~ /^\/users|stylesheets/ or @admin_defined or not User.table_exists?
@status = [404, {"Content-Type" => "text/html"}, "Not Found"]
else
@admin_defined = User.first(:include => :roles, :conditions => ["roles.name = 'admin'"])
| Stop blocking stylesheet requests when there is no admin user.
[#950 state:resolved]
|
diff --git a/app/models/discussion_board.rb b/app/models/discussion_board.rb
index abc1234..def5678 100644
--- a/app/models/discussion_board.rb
+++ b/app/models/discussion_board.rb
@@ -7,6 +7,7 @@ belongs_to :club
has_many :topics, :dependent => :destroy
+ has_many :posts, :through => :topics
def user
club.user
| Add posts Through Topics for DiscussionBoard
Update the DiscussionBoard model to include a has_many Posts association
through Topics.
|
diff --git a/lib/bruevich/bench.rb b/lib/bruevich/bench.rb
index abc1234..def5678 100644
--- a/lib/bruevich/bench.rb
+++ b/lib/bruevich/bench.rb
@@ -13,16 +13,20 @@ result[:title] = title
iterations.each do |count|
- result[count] = {}
- result[count][:time] = {}
- result[count][:time][:per_iteration] = []
-
- result[count][:mem] = {}
- result[count][:mem][:per_iteration] = []
+ initialize_result(count)
GC.disable
GC.start
mem_start = memory
+
+ count.times do
+ yield
+ end
+
+ result[count][:mem][:total] = memory - mem_start
+ GC.enable
+ GC.start
+
time_start = Time.now
count.times do
@@ -30,8 +34,6 @@ end
result[count][:time][:total] = Time.now - time_start
- result[count][:mem][:total] = memory - mem_start
- GC.enable
end
calculate
@@ -47,6 +49,16 @@
private
+ def initialize_result(count)
+ result[count] = {}
+
+ result[count][:time] = {}
+ result[count][:time][:per_iteration] = []
+
+ result[count][:mem] = {}
+ result[count][:mem][:per_iteration] = []
+ end
+
def calculate
iterations.each do |count, _|
result[count][:time][:average] = result[count][:time][:total] / count
| Use two iterations for time and memory
|
diff --git a/Formula/candle.rb b/Formula/candle.rb
index abc1234..def5678 100644
--- a/Formula/candle.rb
+++ b/Formula/candle.rb
@@ -0,0 +1,12 @@+class Candle < Formula
+ version "0.3.0"
+ desc "Shine a little light on your HTML using the command line"
+ homepage "https://github.com/gabebw/candle"
+
+ url "https://github.com/gabebw/candle/releases/download/v#{version}/candle-#{version}.tar.gz"
+ sha256 "cc0e7aa2bb5600992da87d65ea1c39b20d2d7fa1b5cf8bfb2b5f558ba531ae56"
+
+ def install
+ bin.install "candle"
+ end
+end
| Add a formula for Candle
|
diff --git a/app/models/authentication.rb b/app/models/authentication.rb
index abc1234..def5678 100644
--- a/app/models/authentication.rb
+++ b/app/models/authentication.rb
@@ -11,7 +11,7 @@ #
# Returns true if successfully persisted user exists, else false.
def valid?
- uid.present? && info.present? && user && user.persisted?
+ uid.present? && info.present? && nickname.present? && user && user.persisted?
end
# Public: Returns the user based on the auth information.
| Add nickname to valid check as well
|
diff --git a/features/steps/project/project_services.rb b/features/steps/project/project_services.rb
index abc1234..def5678 100644
--- a/features/steps/project/project_services.rb
+++ b/features/steps/project/project_services.rb
@@ -9,7 +9,7 @@
Then 'I should see list of available services' do
page.should have_content 'Services'
- page.should have_content 'Jenkins'
+ page.should have_content 'Campfire'
page.should have_content 'GitLab CI'
end
@@ -19,12 +19,12 @@
And 'I fill gitlab-ci settings' do
check 'Active'
- fill_in 'Project URL', with: 'http://ci.gitlab.org/projects/3'
- fill_in 'CI Project token', with: 'verySecret'
+ fill_in 'Project url', with: 'http://ci.gitlab.org/projects/3'
+ fill_in 'Token', with: 'verySecret'
click_button 'Save'
end
Then 'I should see service settings saved' do
- find_field('Project URL').value.should == 'http://ci.gitlab.org/projects/3'
+ find_field('Project url').value.should == 'http://ci.gitlab.org/projects/3'
end
end
| Fix service tests in spinach
|
diff --git a/lib/bukkit/version.rb b/lib/bukkit/version.rb
index abc1234..def5678 100644
--- a/lib/bukkit/version.rb
+++ b/lib/bukkit/version.rb
@@ -1,4 +1,4 @@ module Bukkit
- VERSION = "2.3.1"
+ VERSION = "2.3.2"
VERSION_FULL = "Bukkit-CLI v#{VERSION}"
end
| v2.3.2: Fix starting without a RAM specified.
|
diff --git a/lib/specinfra/command/redhat/base/package.rb b/lib/specinfra/command/redhat/base/package.rb
index abc1234..def5678 100644
--- a/lib/specinfra/command/redhat/base/package.rb
+++ b/lib/specinfra/command/redhat/base/package.rb
@@ -4,7 +4,7 @@ cmd = "rpm -q #{escape(package)}"
if version
full_package = "#{package}-#{version}"
- cmd = "#{cmd} | grep -w -- #{Regexp.escape(escape(full_package))}"
+ cmd = "#{cmd} | grep -w -- #{Regexp.escape(full_package)}"
end
cmd
end
@@ -29,12 +29,3 @@ end
end
end
-
-
-
-
-
-
-
-
-
| Fix double escape in rpm version check.
A previous commit f003ecf added an extra escape to the version check for the RedHat family of operating systems which broke the version check. This commit fixes that part of the commit.
|
diff --git a/lib/mass_insert/adapters/abstract_adapter.rb b/lib/mass_insert/adapters/abstract_adapter.rb
index abc1234..def5678 100644
--- a/lib/mass_insert/adapters/abstract_adapter.rb
+++ b/lib/mass_insert/adapters/abstract_adapter.rb
@@ -44,9 +44,15 @@ def array_of_attributes_sql
values.map do |attrs|
columns.map do |name|
- value = attrs[name.to_sym] || attrs[name.to_s]
+ value = column_value(attrs, name)
connection.quote(value)
end.join(',')
+ end
+ end
+
+ def column_value(attrs, column)
+ attrs.fetch(column.to_sym) do
+ attrs.fetch(column.to_s, nil)
end
end
end
| Fix error getting column name
|
diff --git a/lib/pfrpg_core/filters/weapon_finesse_mod.rb b/lib/pfrpg_core/filters/weapon_finesse_mod.rb
index abc1234..def5678 100644
--- a/lib/pfrpg_core/filters/weapon_finesse_mod.rb
+++ b/lib/pfrpg_core/filters/weapon_finesse_mod.rb
@@ -13,7 +13,7 @@ end
def modify_attack_for_weapon_finesse(attack, dex, str)
- if attack.weight_class == 'light' || attack.weight_class == 'natural'
+ if attack.weight_class == 'light' || attack.weight_class == 'natural' || attack.weapon_name['Rapier']
attack.filter_str << "Weapon Finesse: -#{dex}, +#{str}"
attack.other_bonus += dex
attack.other_bonus -= str
| Add Rapier to list of supported weapons in Weapon Finesse - it is not a light weapon but still gets weapon finesse
|
diff --git a/lib/dw_money/money.rb b/lib/dw_money/money.rb
index abc1234..def5678 100644
--- a/lib/dw_money/money.rb
+++ b/lib/dw_money/money.rb
@@ -33,16 +33,15 @@ Money.new(new_amount, new_currency)
end
+ def self.conversion_rates_configuration
+ @conversion_rates
+ end
+
private
def rates
self.class.conversion_rates_configuration[currency]
end
- def self.conversion_rates_configuration
- @conversion_rates
- end
-
- private_class_method :conversion_rates_configuration
end
end
| Remove method from private section
|
diff --git a/app/models/alias_nav_item.rb b/app/models/alias_nav_item.rb
index abc1234..def5678 100644
--- a/app/models/alias_nav_item.rb
+++ b/app/models/alias_nav_item.rb
@@ -24,11 +24,11 @@ alias_record.admin_url if alias_record
end
- def to_hash
- hash = super
- hash[:url] = alias_record[:url]
- hash
- end
+ # def to_hash
+ # hash = super
+ # hash[:url] = alias_record[:url]
+ # hash
+ # end
def self.title
"Alias"
| Fix for alias url not appearing in navigation.
|
diff --git a/app/models/people_network.rb b/app/models/people_network.rb
index abc1234..def5678 100644
--- a/app/models/people_network.rb
+++ b/app/models/people_network.rb
@@ -18,10 +18,10 @@
def self.create_trust!(first_person, second_person)
PeopleNetwork.create!(:person => first_person, :trusted_person => second_person,
- :entity_id => second_person,
+ :entity_id => second_person.id,
:entity_type_id => EntityType::TRUSTED_PERSON_ENTITY)
PeopleNetwork.create!(:person => second_person, :trusted_person => first_person,
- :entity_id => first_person,
+ :entity_id => first_person.id,
:entity_type_id => EntityType::TRUSTED_PERSON_ENTITY)
first_person.reputation_rating.increase_trusted_network_count
second_person.reputation_rating.increase_trusted_network_count
| Create entitiy id as person id
|
diff --git a/helpspot-sso/lib/opscode/helpspot_sso.rb b/helpspot-sso/lib/opscode/helpspot_sso.rb
index abc1234..def5678 100644
--- a/helpspot-sso/lib/opscode/helpspot_sso.rb
+++ b/helpspot-sso/lib/opscode/helpspot_sso.rb
@@ -18,7 +18,7 @@ def create_helpspot_session(user)
#login_username, login_sEmail, login_ip, and login_xLogin
email = user.email
- session[:login_username] = user.unique_name
+ session[:login_username] = user.responds_to?(:unique_name) ? user.unique_name : user.username
session[:login_sEmail] = email
session[:login_xLogin] = create_helpspot_user(email)
session[:login_ip] = request.remote_ip
| Handle community vs. the rest of the world. |
diff --git a/public/plugin/lokka-google_analytics/lib/lokka/google_analytics.rb b/public/plugin/lokka-google_analytics/lib/lokka/google_analytics.rb
index abc1234..def5678 100644
--- a/public/plugin/lokka-google_analytics/lib/lokka/google_analytics.rb
+++ b/public/plugin/lokka-google_analytics/lib/lokka/google_analytics.rb
@@ -15,24 +15,20 @@ app.before do
tracker = Option.tracker
if !tracker.blank? and ENV['RACK_ENV'] == 'production' and !logged_in?
- dn = Option.tracker_dn
- tracker_script = "<script type=\"text/javascript\">var _gaq=_gaq||[];_gaq.push(['_setAccount','#{tracker}']);"
- tracker_script += "_gaq.push(['_setDomainName', '.#{dn}']);" unless dn.blank?
- tracker_script += "_gaq.push(['_trackPageview']);(function(){var ga=document.createElement('script');ga.type='text/javascript';ga.async=true;ga.src=('https:'==document.location.protocol?'https://ssl':'http://www')+'.google-analytics.com/ga.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(ga,s);})();</script>"
-
unless dn.blank?
content_for :header do
- text = <<-EOS
- <script type="text/javascript">
- google_analytics_domain_name = "#{dn}";
- window.google_analytics_uacct = "UA-accountnumber-propertyindex";
- </script>
+ text = <<~EOS
+ <script>
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
+
+ ga('create', '#{tracker}', 'auto');
+ ga('send', 'pageview');
+ </script>
EOS
end
- end
-
- content_for :footer do
- tracker_script
end
end
end
| Update Google Analytics Tracking Tag
|
diff --git a/lib/subelsky_power_tools/sidekiq_assertions.rb b/lib/subelsky_power_tools/sidekiq_assertions.rb
index abc1234..def5678 100644
--- a/lib/subelsky_power_tools/sidekiq_assertions.rb
+++ b/lib/subelsky_power_tools/sidekiq_assertions.rb
@@ -1,3 +1,6 @@+# MyWorker.should have_queued_job(2)
+# Collector.should have_queued_job_at(Time.new(2012,1,23,14,00),2)
+
RSpec::Matchers.define :have_queued_job do |*expected|
match do |actual|
actual.jobs.any? { |job| job["args"] == Array(expected) }
| Document sidekiq assertions with example |
diff --git a/spec/helpers/application_helper/buttons/rbac_tenant_delete_spec.rb b/spec/helpers/application_helper/buttons/rbac_tenant_delete_spec.rb
index abc1234..def5678 100644
--- a/spec/helpers/application_helper/buttons/rbac_tenant_delete_spec.rb
+++ b/spec/helpers/application_helper/buttons/rbac_tenant_delete_spec.rb
@@ -0,0 +1,18 @@+describe ApplicationHelper::Button::RbacTenantDelete do
+ let(:view_context) { setup_view_context_with_sandbox({}) }
+ let(:record) { FactoryGirl.create(:tenant, :parent => tenant_parent) }
+ let(:button) { described_class.new(view_context, {}, {'record' => record}, {}) }
+
+ describe '#calculate_properties' do
+ before { button.calculate_properties }
+
+ context 'when record is a child tenant' do
+ let(:tenant_parent) { FactoryGirl.create(:tenant) }
+ it_behaves_like 'an enabled button'
+ end
+ context 'when record is the default tenant' do
+ let(:tenant_parent) { nil }
+ it_behaves_like 'a disabled button', 'Default Tenant can not be deleted'
+ end
+ end
+end
| Create spec examples for RbacTenantDelete button class
|
diff --git a/app/models/place.rb b/app/models/place.rb
index abc1234..def5678 100644
--- a/app/models/place.rb
+++ b/app/models/place.rb
@@ -2,27 +2,29 @@ validates :latitude, :longitude, :comments, presence: true
has_many :comments
- $es.indices.create index: "shizuka", body: {
- mappings: {
- place: {
- properties: {
- location: {
- type: "geo_shape",
- precision: "10m"
+ unless $es.indices.exists index: "shizuka"
+ $es.indices.create index: "shizuka", body: {
+ mappings: {
+ place: {
+ properties: {
+ location: {
+ type: "geo_shape",
+ precision: "10m"
+ }
}
}
}
}
- }
+ end
after_save do
$es.index index: "shizuka", type: "place", id: id, body: {
location: {
type: "point",
- coordinates: [latitude, longitude],
- comments: comments.collect { |c|
- { id: c.id, mood: c.mood, things: c.things }
- }
+ coordinates: [latitude, longitude]
+ },
+ comments: comments.collect { |c|
+ { id: c.id, mood: c.mood, things: c.things }
}
}
end
| Fix index creation error when already exists.
|
diff --git a/cardboard.gemspec b/cardboard.gemspec
index abc1234..def5678 100644
--- a/cardboard.gemspec
+++ b/cardboard.gemspec
@@ -1,6 +1,6 @@ Gem::Specification.new do |gem|
gem.name = "cardboard"
- gem.version = "2.1.0"
+ gem.version = "2.1.1"
gem.authors = ["John Barnette", "Will Farrington"]
gem.email = ["jbarnette@github.com", "wfarr@github.com"]
gem.description = "Development tools for Boxen's puppet modules."
@@ -13,7 +13,7 @@ gem.test_files = gem.files.grep /^test/
gem.require_paths = ["lib"]
- gem.add_dependency "boxen", "~> 2.1"
+ gem.add_dependency "boxen", "~> 3.1"
gem.add_dependency "puppet-lint", "~> 0.3"
gem.add_dependency "puppetlabs_spec_helper", "~> 0.4"
gem.add_dependency "rspec-puppet", "~> 1.0"
| Bump Boxen dependency to 3.1
|
diff --git a/Casks/scansnap-manager-s1300.rb b/Casks/scansnap-manager-s1300.rb
index abc1234..def5678 100644
--- a/Casks/scansnap-manager-s1300.rb
+++ b/Casks/scansnap-manager-s1300.rb
@@ -0,0 +1,15 @@+cask :v1 => 'scansnap-manager-s1300' do
+ version '3.2L31'
+ sha256 '4bdc782e7b2d86c1a3c7e55ae6753440f208a9c92ac1c4290bc17e40ba2f5513'
+
+ url 'http://www.fujitsu.com/downloads/IMAGE/driver/ss/mgr/m-s1300/ScanSnap.dmg'
+ name 'ScanSnap Manager for Fujitsu ScanSnap S1300'
+ homepage 'http://www.fujitsu.com/global/support/computing/peripheral/scanners/software/s1300m-setup.html'
+ license :commercial
+
+ pkg 'Scansnap Manager.pkg'
+
+ uninstall :pkgutil => 'jp.co.pfu.ScanSnap.V10L10'
+
+ depends_on :macos => '>= :tiger'
+end
| Add Scansnap Manager for S1300
|
diff --git a/lib/mips/assembler.rb b/lib/mips/assembler.rb
index abc1234..def5678 100644
--- a/lib/mips/assembler.rb
+++ b/lib/mips/assembler.rb
@@ -1,4 +1,18 @@ module MIPS
+ # Assembly MIPS codes into machine codes.
class Assembler
+ attr_reader :symbol_table
+
+ def initialize
+ @symbol_table = {}
+ end
+
+ def assembly(line)
+ 0x0
+ end
+
+ def self.assembly(line)
+ new.assembly(line)
+ end
end
end
| Add basic structure for Assembler.
|
diff --git a/lib/doorkeeper/models/application_mixin.rb b/lib/doorkeeper/models/application_mixin.rb
index abc1234..def5678 100644
--- a/lib/doorkeeper/models/application_mixin.rb
+++ b/lib/doorkeeper/models/application_mixin.rb
@@ -17,7 +17,7 @@ before_validation :generate_uid, :generate_secret, on: :create
if respond_to?(:attr_accessible)
- attr_accessible :name, :redirect_uri
+ attr_accessible :name, :redirect_uri, :scopes
end
end
| Make scopes attribute accessible on application create/editing, to avoid mass assignment errors.
|
diff --git a/lib/paperclip-meta.rb b/lib/paperclip-meta.rb
index abc1234..def5678 100644
--- a/lib/paperclip-meta.rb
+++ b/lib/paperclip-meta.rb
@@ -1,4 +1,3 @@-require "paperclip"
-require "paperclip-meta/version"
+require 'paperclip-meta/version'
require 'paperclip-meta/railtie'
-require 'paperclip-meta/attachment'+require 'paperclip-meta/attachment'
| Remove paperclip require; gem does that
|
diff --git a/lib/logster/middleware/debug_exceptions.rb b/lib/logster/middleware/debug_exceptions.rb
index abc1234..def5678 100644
--- a/lib/logster/middleware/debug_exceptions.rb
+++ b/lib/logster/middleware/debug_exceptions.rb
@@ -2,8 +2,13 @@ private
def log_error(request_or_env, wrapper)
- is_request = Rails::VERSION::MAJOR > 4
- env = is_request ? request_or_env.env : request_or_env
+ env =
+ if Rails::VERSION::MAJOR > 4
+ request_or_env.env
+ else
+ request_or_env
+ end
+
exception = wrapper.exception
Logster.config.current_context.call(env) do
@@ -17,6 +22,5 @@ env: env)
end
- super(request_or_env, wrapper) if is_request
end
end
| Revert "FIX: `Logster::Middleware::DebugExceptions` was not logging exceptions in Rails 5."
This reverts commit 1bfb25b627dccc7c0da29bf0ff1492082b7f3bc1.
|
diff --git a/lib/sorcery/model/adapters/mongo_mapper.rb b/lib/sorcery/model/adapters/mongo_mapper.rb
index abc1234..def5678 100644
--- a/lib/sorcery/model/adapters/mongo_mapper.rb
+++ b/lib/sorcery/model/adapters/mongo_mapper.rb
@@ -12,13 +12,13 @@ self.class.increment(id, attr => 1)
end
- def save!(options = {})
- save(options)
- end
-
def sorcery_save(options = {})
- mthd = options.delete(:raise_on_failure) ? :save! : :save
- self.send(mthd, options)
+ if options.delete(:raise_on_failure)
+ options.delete :validate
+ save! options
+ else
+ save options
+ end
end
def update_many_attributes(attrs)
| Fix wrong mongomapper save! behaviour
Mongomapper's save! method was overriden to call save, which resulted
in errors not being raised when object was invalid.
Mongomapper supports save! method, however it accepts only :safe option,
it does not work with validate: false, so this option needs to be removed.
Fixes issue #151
|
diff --git a/lib/travis/scheduler/jobs/capacity/plan.rb b/lib/travis/scheduler/jobs/capacity/plan.rb
index abc1234..def5678 100644
--- a/lib/travis/scheduler/jobs/capacity/plan.rb
+++ b/lib/travis/scheduler/jobs/capacity/plan.rb
@@ -12,13 +12,27 @@ end
def accept?(job)
- super if !on_metered_plan? || billing_allowance[allowance_key(job)]
+ super if !on_metered_plan? || billing_allowed?(job)
end
private
def max
@max ||= on_metered_plan? ? billing_allowance['concurrency_limit'] : owners.paid_capacity
+ end
+
+ def billing_allowed?(job)
+ puts billing_allowance[allowance_key(job)]
+ return true if billing_allowance[allowance_key(job)]
+
+ # Cancel job if it has not been queued for more than a day due to
+ # billing allowance
+ if job.created_at < (Time.now - 1.day)
+ payload = { id: job.id, source: 'scheduler' }
+ Hub.push('job:cancel', payload)
+ end
+
+ false
end
def allowance_key(job)
| Fix stuck jobs due to billing
|
diff --git a/test/integration/generated_gtk_source_test.rb b/test/integration/generated_gtk_source_test.rb
index abc1234..def5678 100644
--- a/test/integration/generated_gtk_source_test.rb
+++ b/test/integration/generated_gtk_source_test.rb
@@ -2,7 +2,7 @@
require "gir_ffi_test_helper"
-GirFFI.setup :GtkSource
+GirFFI.setup :GtkSource, "3.0"
# Tests behavior of objects in the generated GtkSource namespace.
describe "The generated GtkSource module" do
@@ -10,22 +10,11 @@ let(:instance) { GtkSource::CompletionContext.new }
it "allows adding proposals" do
- # Interface changed in GtkSourceView 3.24
- proposals = if GtkSource::CompletionItem.instance_methods.include? :set_label
- Array.new(3) do |i|
- GtkSource::CompletionItem.new.tap do |item|
- item.label = "Proposal #{i}"
- item.text = "Proposal #{i}"
- item.info = "blah #{i}"
- end
- end
- else
- [
- GtkSource::CompletionItem.new("Proposal 1", "Proposal 1", nil, "blah 1"),
- GtkSource::CompletionItem.new("Proposal 2", "Proposal 2", nil, "blah 2"),
- GtkSource::CompletionItem.new("Proposal 3", "Proposal 3", nil, "blah 3")
- ]
- end
+ proposals = [
+ GtkSource::CompletionItem.new("Proposal 1", "Proposal 1", nil, "blah 1"),
+ GtkSource::CompletionItem.new("Proposal 2", "Proposal 2", nil, "blah 2"),
+ GtkSource::CompletionItem.new("Proposal 3", "Proposal 3", nil, "blah 3")
+ ]
instance.add_proposals nil, proposals, true
end
end
| Fix GtkSource test when used with GtkSource 3
The alternative initialization code turned out to only work with
GtkSource 4, not actually with GtkSource 3.24. Therefore:
- Ensure GtkSource with API version 3.0 is used
- Always use new with four arguments
|
diff --git a/lib/buildr_plus/features/repositories.rb b/lib/buildr_plus/features/repositories.rb
index abc1234..def5678 100644
--- a/lib/buildr_plus/features/repositories.rb
+++ b/lib/buildr_plus/features/repositories.rb
@@ -19,6 +19,7 @@ Buildr.repositories.remote.unshift('https://stocksoftware.jfrog.io/stocksoftware/public')
Buildr.repositories.remote.unshift('http://central.maven.org/maven2')
Buildr.repositories.remote.unshift('https://stocksoftware.jfrog.io/stocksoftware/oss')
+ Buildr.repositories.remote.unshift('https://stocksoftware.jfrog.io/stocksoftware/staging')
if BuildrPlus::FeatureManager.activated?(:geolatte)
Buildr.repositories.remote.unshift('http://download.osgeo.org/webdav/geotools')
end
| Add staging repository to the set we scan so easier to release immediately after another cascading release
|
diff --git a/week-4/count-between/my_solution.rb b/week-4/count-between/my_solution.rb
index abc1234..def5678 100644
--- a/week-4/count-between/my_solution.rb
+++ b/week-4/count-between/my_solution.rb
@@ -15,8 +15,9 @@ # Your Solution Below
def count_between(list_of_integers, lower_bound, upper_bound)
- if
- for num in count_between[1..2]
- return count_between[0].count
+ if lower_bound > upper_bound
+ return 0
+ else
+ list_of_integers.count { |num| (lower_bound..upper_bound).include?(num)}
end
end | Complete solution and spec files for count between
|
diff --git a/lib/gir_ffi/builders/callback_builder.rb b/lib/gir_ffi/builders/callback_builder.rb
index abc1234..def5678 100644
--- a/lib/gir_ffi/builders/callback_builder.rb
+++ b/lib/gir_ffi/builders/callback_builder.rb
@@ -15,6 +15,20 @@ setup_constants
klass.class_eval mapping_method_definition, __FILE__, __LINE__
end
+
+ def mapping_method_definition
+ MappingMethodBuilder.for_callback(info).method_definition
+ end
+
+ def argument_ffi_types
+ @argument_ffi_types ||= @info.argument_ffi_types
+ end
+
+ def return_ffi_type
+ @return_ffi_type ||= @info.return_ffi_type
+ end
+
+ private
def setup_callback
optionally_define_constant klass, :Callback do
@@ -38,20 +52,8 @@ end
end
- def mapping_method_definition
- MappingMethodBuilder.for_callback(info).method_definition
- end
-
def callback_sym
@classname.to_sym
- end
-
- def argument_ffi_types
- @argument_ffi_types ||= @info.argument_ffi_types
- end
-
- def return_ffi_type
- @return_ffi_type ||= @info.return_ffi_type
end
end
end
| Make CallbackBuilder methods private where possible
|
diff --git a/lib/grape_token_auth/apis/session_api.rb b/lib/grape_token_auth/apis/session_api.rb
index abc1234..def5678 100644
--- a/lib/grape_token_auth/apis/session_api.rb
+++ b/lib/grape_token_auth/apis/session_api.rb
@@ -17,7 +17,7 @@ data.store_resource(resource, base.resource_scope)
auth_header = AuthenticationHeader.new(data, start_time)
auth_header.headers.each do |key, value|
- header key, value
+ header key.to_s, value.to_s
end
status 200
present data: resource
| Fix headers not being strings in session API
|
diff --git a/lib/kosmos/packages/b9_aerospace_pack.rb b/lib/kosmos/packages/b9_aerospace_pack.rb
index abc1234..def5678 100644
--- a/lib/kosmos/packages/b9_aerospace_pack.rb
+++ b/lib/kosmos/packages/b9_aerospace_pack.rb
@@ -20,3 +20,13 @@ merge_directory 'B9 KSP 0.23.5/GameData'
end
end
+
+class B9AerospaceModZeroFix < Kosmos::Package
+ title 'ModZero B9 Aerospace Fixes'
+ aliases 'b9 modzero fixes', 'b9 modzero'
+ url 'https://www.dropbox.com/s/peq187l1ajc3mst/ModZeroB9Fixes.zip'
+
+ def install
+ merge_directory 'GameData'
+ end
+end
| Add a package for the ModZero patch for B9.
|
diff --git a/lib/validation_error_reporter/tasks.rake b/lib/validation_error_reporter/tasks.rake
index abc1234..def5678 100644
--- a/lib/validation_error_reporter/tasks.rake
+++ b/lib/validation_error_reporter/tasks.rake
@@ -5,6 +5,7 @@ options = {}
options[:models] = ENV["MODELS"]
options[:email_to] = ENV["EMAIL_TO"]
+ options[:email_from] = ENV["EMAIL_FROM"]
ValidationErrorReporter::Runner.new.run(options)
end
| Use ENV['EMAIL_FROM'] if set when running task
|
diff --git a/lib/odo.rb b/lib/odo.rb
index abc1234..def5678 100644
--- a/lib/odo.rb
+++ b/lib/odo.rb
@@ -13,6 +13,7 @@
url = options[:url]
target = options[:target]
+ filename = options[:filename] || 'index.html'
assets = Assets.from(url: url, target: target)
@@ -23,7 +24,7 @@
strategy.create_the_site target: target
- File.open("#{target}/index.html", 'w') { |f| f.write html }
+ File.open("#{target}/#{filename}", 'w') { |f| f.write html }
Assets.download assets
@@ -32,6 +33,7 @@ def self.stubbing_more_things_out options
url = options[:url]
target = options[:target]
+ filename = options[:filename] || 'index.html'
assets = Assets.from(url: url, target: target)
@@ -42,7 +44,7 @@
strategy.create_the_site target: target
- File.open("#{target}/index.html", 'w') { |f| f.write html }
+ File.open("#{target}/#{filename}", 'w') { |f| f.write html }
Assets.download assets
end
| Make index.html the default file to write. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.