diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/config/application.rb b/config/application.rb
index abc1234..def5678 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -21,5 +21,6 @@ # Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
+ config.time_zone = ENV['TIMEZONE'] if ENV.has_key?('TIMEZONE')
end
end
|
Add a quick hack to deal with timezone schenanigans.
|
diff --git a/config/environment.rb b/config/environment.rb
index abc1234..def5678 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -26,4 +26,8 @@
PHONE_HOME_FOR_VERSION_INFO = true unless defined? PHONE_HOME_FOR_VERSION_INFO
-Setting.update_all if Setting.table_exists?
+begin
+ Setting.update_all if Setting.table_exists?
+rescue ActiveRecord::ConnectionNotEstablished
+ # running in setup mode?
+end
|
Fix bug keeping setup mode from running.
|
diff --git a/spec/features/step_definitions/guest_views_project_steps.rb b/spec/features/step_definitions/guest_views_project_steps.rb
index abc1234..def5678 100644
--- a/spec/features/step_definitions/guest_views_project_steps.rb
+++ b/spec/features/step_definitions/guest_views_project_steps.rb
@@ -17,5 +17,5 @@ end
step 'I should see a placeholder image' do
- expect(page).to have_css('#project-gallery img[src="/assets/no-image-main.png"]')
+ expect(page).to have_css('#project-gallery img[src^="/assets/no-image-main"]')
end
|
Fix failing test (asset tag cache-busting code)
|
diff --git a/lib/tasks/simple_sanity_check.rake b/lib/tasks/simple_sanity_check.rake
index abc1234..def5678 100644
--- a/lib/tasks/simple_sanity_check.rake
+++ b/lib/tasks/simple_sanity_check.rake
@@ -0,0 +1,26 @@+namespace :simple_sanity_check do
+ task run: :environment do
+ connection = ActiveRecord::Base.connection
+ table_names = TableExporter.new.send(:get_table_names, all: true)
+ file_path = "#{Rails.root}/tmp/sanity_check.txt"
+
+ counts = table_names.map do |table_name|
+ {
+ table_name: table_name,
+ count: connection.execute("select count(*) from #{table_name}").values.flatten.first,
+ table_width: connection.execute("select count(*) from information_schema.columns where table_name='#{table_name}'").values.flatten.first
+ }
+ end
+
+ File.open(file_path, 'w') do |file|
+ counts.sort_by {|count| count[:count].to_i}.reverse.each do |count|
+ file.write("#{count[:table_name]}: #{count[:count]} records. #{count[:table_width]} columns in table.\n")
+ end
+ end
+
+
+ s3 = Aws::S3::Resource.new(region: ENV['AWS_REGION'])
+ obj = s3.bucket(ENV['S3_BUCKET_NAME']).object("#{Date.today}-sanity-check.txt")
+ obj.upload_file(file_path)
+ end
+end
|
Add simple sanity check rake task.
|
diff --git a/test/test_helper.rb b/test/test_helper.rb
index abc1234..def5678 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -4,7 +4,7 @@ require 'plugin_test_helper'
# Run the migrations
-ActiveRecord::Migrator.migrate("#{RAILS_ROOT}/db/migrate")
+ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate")
# Mixin the factory helper
require File.expand_path("#{File.dirname(__FILE__)}/factory")
|
Use Rails.root instead of RAILS_ROOT in preparation for the Rails 2.1 release
|
diff --git a/test/test_helper.rb b/test/test_helper.rb
index abc1234..def5678 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -4,7 +4,7 @@ SimpleCov.start do
add_group "Main", "lib"
add_group "Tests", "test"
- enable_coverage :branch
+ enable_coverage :branch unless RUBY_ENGINE == "jruby"
end
require "minitest/autorun"
|
Disable broken SimpleCov branch coverage on JRuby
|
diff --git a/manageiq-appliance-dependencies.rb b/manageiq-appliance-dependencies.rb
index abc1234..def5678 100644
--- a/manageiq-appliance-dependencies.rb
+++ b/manageiq-appliance-dependencies.rb
@@ -1,3 +1,3 @@ # Add gems here, in Gemfile syntax, which are dependencies of the appliance itself rather than a part of the ManageIQ application
-gem "manageiq-appliance_console", "~>1.2", ">=1.2.2", :require => false
+gem "manageiq-appliance_console", "~>1.2", ">=1.2.3", :require => false
gem "manageiq-postgres_ha_admin", "~>1.0.0", :require => false
|
Update manageiq-appliance_console to minimum v1.2.3
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1527915
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1530722
|
diff --git a/check_if_learn_is_not_down.rb b/check_if_learn_is_not_down.rb
index abc1234..def5678 100644
--- a/check_if_learn_is_not_down.rb
+++ b/check_if_learn_is_not_down.rb
@@ -0,0 +1,42 @@+require 'rubygems'
+require 'mechanize'
+require 'gmail'
+
+print "Please enter your gmail address: "
+address = gets.chomp
+`stty -echo`
+print "Please enter password: "
+password = gets.chomp
+`stty echo`
+puts ""
+
+puts "Logging in to gmail..."
+
+Gmail.new(address, password) do |gmail|
+ puts "Logged in"
+ br = Mechanize.new
+
+ loop do
+ puts "#{ Time.now }: Checking Learn..."
+ begin
+ page = br.get("https://learn.uwaterloo.ca")
+ rescue
+ errored = true
+ end
+ if page.body =~ /maintenance\.jpg/ || errored # that blue gear we are all tired of
+ errored = false
+ puts "#{ Time.now }: Still down. Waiting 5 minutes."
+ sleep(300) # wait 5 minutes
+ next
+ end
+
+ puts "#{ Time.now }: IT'S UP!!!!!!!!!!!!!!!!!!!!! Sending email."
+ gmail.deliver do
+ to address
+ subject "LEARN IS BACK"
+ end
+ puts "Email sent. Exiting."
+ exit
+ end
+end
+
|
Add code to check if Learn is not down
|
diff --git a/config.rb b/config.rb
index abc1234..def5678 100644
--- a/config.rb
+++ b/config.rb
@@ -1,3 +1,3 @@ # Docker Host. Default is core-docker (CoreOS)
-# String: core-docker|centos-docker
+# String: core-docker|centos-docker|centos-atomic
$docker_host_vm_name = "core-docker"
|
Add centos-atomic name to list.
|
diff --git a/config.ru b/config.ru
index abc1234..def5678 100644
--- a/config.ru
+++ b/config.ru
@@ -2,6 +2,10 @@ require "app"
App.set :run, false
+
+unless File.directory?('log/main.log')
+ FileUtils.mkdir_p('log/main.log')
+end
logger = ::File.open("log/main.log", "a+")
|
Create log dir if doesn't exist
|
diff --git a/lib/bundler/environment_preserver.rb b/lib/bundler/environment_preserver.rb
index abc1234..def5678 100644
--- a/lib/bundler/environment_preserver.rb
+++ b/lib/bundler/environment_preserver.rb
@@ -14,6 +14,7 @@ PATH
RUBYLIB
RUBYOPT
+ RB_USER_INSTALL
].map(&:freeze).freeze
BUNDLER_PREFIX = "BUNDLER_ORIG_".freeze
|
Add RB_USER_INSTALL to preserved ENV keys
- see #6103
|
diff --git a/lib/gds_api/test_helpers/need_api.rb b/lib/gds_api/test_helpers/need_api.rb
index abc1234..def5678 100644
--- a/lib/gds_api/test_helpers/need_api.rb
+++ b/lib/gds_api/test_helpers/need_api.rb
@@ -7,9 +7,9 @@ # you could redefine/override the constant or stub directly.
NEED_API_ENDPOINT = Plek.current.find('needapi')
- def need_api_has_organisations(organisations)
+ def need_api_has_organisations(organisation_ids)
url = NEED_API_ENDPOINT + "/organisations"
- orgs = organisations.map do |o|
+ orgs = organisation_ids.map do |o|
{ "id" => o,
"name" => o.split('-').map(&:capitalize).join(' ')
}
|
Rename method parameter to highlight organisation ids expected.
|
diff --git a/test/tests/test_rake_task.rb b/test/tests/test_rake_task.rb
index abc1234..def5678 100644
--- a/test/tests/test_rake_task.rb
+++ b/test/tests/test_rake_task.rb
@@ -0,0 +1,62 @@+require 'fileutils'
+require 'tmpdir'
+
+class RakeTaskTests < Test::Unit::TestCase
+ def setup
+ # Brakeman is noisy on errors
+ @old_stderr = $stderr.dup
+ $stderr.reopen("/dev/null", "w")
+ end
+
+ def cleanup
+ $stderr = old_stderr
+ end
+
+ def in_temp_app
+ Dir.mktmpdir do |dir|
+ FileUtils.cp_r "#{TEST_PATH}/apps/rails3.2/.", dir
+
+ @rake_task = "#{dir}/lib/tasks/brakeman.rake"
+ @rakefile = "#{dir}/Rakefile"
+
+ current_dir = FileUtils.pwd
+ FileUtils.cd dir
+
+ yield dir
+
+ FileUtils.cd current_dir
+ end
+ end
+
+ def test_create_rake_task
+ in_temp_app do
+ assert_nothing_raised SystemExit do
+ Brakeman.install_rake_task
+ end
+
+ assert File.exist? @rake_task
+ end
+ end
+
+ def test_rake_task_exists
+ in_temp_app do
+ assert_nothing_raised SystemExit do
+ Brakeman.install_rake_task
+ end
+
+ assert_raise SystemExit do
+ Brakeman.install_rake_task
+ end
+ end
+ end
+
+ def test_rake_no_Rakefile
+ in_temp_app do
+ File.delete @rakefile
+
+ assert_raise SystemExit do
+ Brakeman.install_rake_task
+ end
+ end
+ end
+end
|
Add tests for Rake task creation
|
diff --git a/lib/logidze/versioned_association.rb b/lib/logidze/versioned_association.rb
index abc1234..def5678 100644
--- a/lib/logidze/versioned_association.rb
+++ b/lib/logidze/versioned_association.rb
@@ -1,4 +1,15 @@ # frozen_string_literal: true
+
+# `inversed` attr_accessor has been removed in Rails 5.2.1
+# See https://github.com/rails/rails/commit/39e57daffb9ff24726b1e86dfacf76836dd0637b#diff-c47e1c26ae8a3d486119e0cc91f40a30
+unless ::ActiveRecord::Associations::Association.instance_methods.include?(:inveresed)
+ using(Module.new do
+ refine ::ActiveRecord::Associations::Association do
+ attr_reader :inversed
+ end
+ end)
+end
+
module Logidze # :nodoc: all
module VersionedAssociation
# rubocop: disable Metrics/MethodLength, Metrics/AbcSize
|
Fix rails 5.2.1 compatibility in versioned association
|
diff --git a/lib/mutually_exclusive_collection.rb b/lib/mutually_exclusive_collection.rb
index abc1234..def5678 100644
--- a/lib/mutually_exclusive_collection.rb
+++ b/lib/mutually_exclusive_collection.rb
@@ -1,33 +1,33 @@-# A collection of mutually exclusive events.
+# A collection of mutually exclusive odds for different outcomes.
class MutuallyExclusiveCollection
- # create a new collection with the given events
- # @param [Array<FixedOdds>] events the events
- def initialize(events)
- @events = events.sort
+ # create a new collection with the given odds
+ # @param [Array<FixedOdds>] odds the odds
+ def initialize(odds)
+ @odds = odds.sort
end
- # the least likely of the events to occur
- # @return [FixedOdds] the least likely event
+ # the least likely of the odds to occur
+ # @return [FixedOdds] the least likely odd
def least_likely
- @events.first
+ @odds.first
end
- # the most likely of the events to occur
- # @return [FixedOdds] the most likely event
+ # the most likely of the odds to occur
+ # @return [FixedOdds] the most likely odd
def most_likely
- @events.last
+ @odds.last
end
- # the events in ascending order of probability
- # @return [Array<FixedOdds>] events in ascending probability
+ # the odds in ascending order of probability
+ # @return [Array<FixedOdds>] odds in ascending probability
def in_ascending_probability
- @events
+ @odds
end
- # the events in descending order of probability
- # @return [Array<FixedOdds>] events in descending probability
+ # the odds in descending order of probability
+ # @return [Array<FixedOdds>] odds in descending probability
def in_descending_probability
- @events.reverse
+ @odds.reverse
end
def sum_inverse_outcome
@@ -48,7 +48,7 @@
private
def decimals
- @events.collect {|event| decimal event }
+ @odds.collect {|odd| decimal odd }
end
def decimal odds
|
Rename from events to odds
|
diff --git a/lib/pacer/route/mixin/graph_route.rb b/lib/pacer/route/mixin/graph_route.rb
index abc1234..def5678 100644
--- a/lib/pacer/route/mixin/graph_route.rb
+++ b/lib/pacer/route/mixin/graph_route.rb
@@ -28,6 +28,16 @@
def vertex_name=(a_proc)
@vertex_name = a_proc
+ end
+
+ # The proc used to name edges.
+ def edge_name
+ @edge_name
+ end
+
+ # Set the proc used to name edges.
+ def edge_name=(a_proc)
+ @edge_name = a_proc
end
def columns
|
Define the edge_name callback on graph.
|
diff --git a/lib/united_workers/worker_spawner.rb b/lib/united_workers/worker_spawner.rb
index abc1234..def5678 100644
--- a/lib/united_workers/worker_spawner.rb
+++ b/lib/united_workers/worker_spawner.rb
@@ -20,12 +20,16 @@ def self.register(bootstrap, pid, channel_id)
UnitedWorkers::Queue.new_fanout_queue(channel_id).tap do |queue|
queue.subscribe do |_, __, message|
+ running = true
m = UnitedWorkers::Queue.unpack(message)
- if m[:type] == :task_end && m[:status] == :killed && m[:pid] == pid && m[:task_id] == "process_#{pid}"
+ if running && m[:type] == :task_end && m[:status] == :killed && m[:pid] == pid && m[:task_id] == "process_#{pid}"
UnitedWorkers::Logger.log("A worker with PID #{pid} was killed. Restarting")
launch(bootstrap, channel_id)
queue.channel.close
queue.channel.connection.close
+ elsif m[:type] == :shutdown
+ p "Shutting down spawner"
+ running = false
end
end
end
|
Add support for shutdown in WorkerSpawner
|
diff --git a/test/integration/lib/interactor/clicker.rb b/test/integration/lib/interactor/clicker.rb
index abc1234..def5678 100644
--- a/test/integration/lib/interactor/clicker.rb
+++ b/test/integration/lib/interactor/clicker.rb
@@ -6,11 +6,7 @@ include Shared
def click_on(position)
- run("xdotool mousemove --sync #{position.first} #{position.last}")
- sleep 1
- run('xdotool mousedown --clearmodifiers 1')
- sleep 0.1
- run('xdotool mouseup 1')
+ run("xdotool mousemove --sync #{position.first} #{position.last} click --clearmodifiers 1")
sleep 1
end
end
|
Use xdotool click instead of mousedown and mouseup
Trying to fix the issue of not opening the burguer menu
on thunderbird beta.
|
diff --git a/test/integration/user/confirmation_test.rb b/test/integration/user/confirmation_test.rb
index abc1234..def5678 100644
--- a/test/integration/user/confirmation_test.rb
+++ b/test/integration/user/confirmation_test.rb
@@ -25,7 +25,7 @@ fill_in :user_confirmation_name, with: "user@email.dev"
fill_in :user_confirmation_password, with: "wadus"
fill_in :user_confirmation_password_confirmation, with: "wadus"
- select Date.current.year, from: :user_confirmation_year_of_birth
+ select 20.years.ago.year, from: :user_confirmation_year_of_birth
choose "Male"
click_on "Save"
|
Fix confirmation year in test
|
diff --git a/support/rspec2_formatter.rb b/support/rspec2_formatter.rb
index abc1234..def5678 100644
--- a/support/rspec2_formatter.rb
+++ b/support/rspec2_formatter.rb
@@ -36,12 +36,11 @@ })
end
- def example_pending example, message, deprecated_pending_location=nil
+ def example_pending example
super
@@buffet_server.example_pending(@@slave_name, {
:description => example.description,
:location => example.location,
- :message => message,
:slave_name => @@slave_name,
})
end
|
Fix pending specs under rspec2 runner
The method signature for example_pending has changed between rspec1 and
rspec2. The rspec2 formatter wasn't aware of this change, causing specs
marked as pending to appear to be failing.
Change-Id: Ib591e46b14d86a4fa8a5bd35dbc766675df2ae09
Reviewed-on: https://gerrit.causes.com/4927
Reviewed-by: Noah Silas <1db01d43e08596f43a65fb393d969b98ee5b4dc6@causes.com>
Tested-by: Noah Silas <1db01d43e08596f43a65fb393d969b98ee5b4dc6@causes.com>
|
diff --git a/config.ru b/config.ru
index abc1234..def5678 100644
--- a/config.ru
+++ b/config.ru
@@ -1,13 +1,22 @@ require 'video_conference/app'
require 'faye'
require 'newrelic_rpm'
+require 'new_relic/agent/instrumentation/rack'
NewRelic::Agent.after_fork(:force_reconnect => true)
GC::Profiler.enable
Faye::WebSocket.load_adapter('thin')
+class NewRelicMiddleWare < Struct.new(:app)
+ def call(env)
+ app.call(env)
+ end
+ include ::NewRelic::Agent::Instrumentation::Rack
+end
+
map '/faye' do
faye = Faye::RackAdapter.new(:mount => '/faye', :timeout => 25)
+ use NewRelicMiddleWare
run faye
end
|
Add some NewRelic. Cause metrics are awesome
|
diff --git a/config.ru b/config.ru
index abc1234..def5678 100644
--- a/config.ru
+++ b/config.ru
@@ -7,5 +7,5 @@
use Rack::ShowExceptions
-Shwedagon::App.set :blog, '../example-jekyll/'
+Shwedagon::App.set :blog, '../blog/'
run Shwedagon::App.new
|
Put back blog url. My instance was breaking
|
diff --git a/seven-languages/ruby/day1-guesser.rb b/seven-languages/ruby/day1-guesser.rb
index abc1234..def5678 100644
--- a/seven-languages/ruby/day1-guesser.rb
+++ b/seven-languages/ruby/day1-guesser.rb
@@ -0,0 +1,22 @@+def str_to_int_safe(i)
+ return Integer(i)
+rescue
+ return nil
+end
+
+
+target = rand(10)
+
+begin
+ puts "Please enter a number from 0..10"
+ guess = str_to_int_safe(gets)
+
+ unless guess == nil
+ puts "Lower" if guess > target
+ puts "Higher" if guess < target
+ else
+ puts "That's not even a number, dummy"
+ end
+end while guess != target
+
+puts "Good!"
|
Add day 1 exercise for 7-languages
|
diff --git a/vagrant-dns.gemspec b/vagrant-dns.gemspec
index abc1234..def5678 100644
--- a/vagrant-dns.gemspec
+++ b/vagrant-dns.gemspec
@@ -7,6 +7,7 @@ gem.description = %q{vagrant-dns is a vagrant plugin that manages DNS records associated with local machines.}
gem.summary = %q{vagrant-dns manages DNS records of vagrant machines}
gem.homepage = ""
+ gem.license = "MIT"
gem.files = `git ls-files`.split($\).reject { |f| f.match(%r{^(test|testdrive)/}) }
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
Add “MIT” license to gemspec
|
diff --git a/files/default/tests/minitest/default_test.rb b/files/default/tests/minitest/default_test.rb
index abc1234..def5678 100644
--- a/files/default/tests/minitest/default_test.rb
+++ b/files/default/tests/minitest/default_test.rb
@@ -3,7 +3,7 @@ class TestDotNet4Install < MiniTest::Chef::TestCase
def test_dot_framework_was_installed
- dotnet4dir = File.join(ENV['WINDIR'], "Microsoft.Net\\Framework64\\v4.0.30319")
+ dotnet4dir = File.join(ENV['WINDIR'], 'Microsoft.Net\\Framework64\\v4.0.30319')
assert Dir.exists?(dotnet4dir)
end
|
Use single-quoted strings per extended foodcritic.
|
diff --git a/guard-foreman.gemspec b/guard-foreman.gemspec
index abc1234..def5678 100644
--- a/guard-foreman.gemspec
+++ b/guard-foreman.gemspec
@@ -5,6 +5,7 @@ s.name = "guard-foreman"
s.version = "0.0.1"
s.authors = ["Andrei Maxim", "Jonathan Arnett"]
+ s.licenses = ['MIT']
s.email = ["jonarnett90@gmail.com"]
s.homepage = "https://github.com/J3RN/guard-foreman"
s.summary = "Guard for Foreman"
@@ -15,5 +16,5 @@ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
- s.add_dependency "guard", ">= 1.1"
+ s.add_dependency 'guard', '~> 2.6'
end
|
Update Gemspec to notice license, have modern Guard dependency
|
diff --git a/lib/gish/concerns/findable.rb b/lib/gish/concerns/findable.rb
index abc1234..def5678 100644
--- a/lib/gish/concerns/findable.rb
+++ b/lib/gish/concerns/findable.rb
@@ -3,6 +3,8 @@ module Findable
# IMPROVE: Permit the query to be more complex (e.g.: a regex)
def fuzzy_find(files, query, options = {})
+ return [] if query.empty?
+
options[:greedy] ||= false
eager_pattern = "\\b#{Regexp.escape(query)}"
|
Return an empty array if the query is empty in the fuzzy_find method
|
diff --git a/henkilotunnus.gemspec b/henkilotunnus.gemspec
index abc1234..def5678 100644
--- a/henkilotunnus.gemspec
+++ b/henkilotunnus.gemspec
@@ -18,10 +18,10 @@ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
- spec.add_development_dependency "bundler", "~> 2.0"
- spec.add_development_dependency "rake", "~> 10.0"
- spec.add_development_dependency "minitest", "~> 5.8"
- spec.add_development_dependency "timecop", "~> 0.8.0"
+ spec.add_development_dependency "bundler", ">= 1.10"
+ spec.add_development_dependency "rake", ">= 10.0"
+ spec.add_development_dependency "minitest", ">= 5.8"
+ spec.add_development_dependency "timecop", ">= 0.8.0"
- spec.add_runtime_dependency "activemodel", "~> 5.2"
+ spec.add_runtime_dependency "activemodel", ">= 4.2"
end
|
Allow multiple mainline versions of dependencies
For more widespread use, the same version can now be used with
multiple mainline versions of the dependencies.
|
diff --git a/ical_importer.gemspec b/ical_importer.gemspec
index abc1234..def5678 100644
--- a/ical_importer.gemspec
+++ b/ical_importer.gemspec
@@ -12,6 +12,7 @@ gem.files = `git ls-files`.split("\n")
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
gem.name = "ical_importer"
+ gem.license = "MIT"
gem.require_paths = ["lib"]
gem.version = IcalImporter::VERSION
|
Add license to the gemspec
|
diff --git a/opal/opal-firebase/firebase.rb b/opal/opal-firebase/firebase.rb
index abc1234..def5678 100644
--- a/opal/opal-firebase/firebase.rb
+++ b/opal/opal-firebase/firebase.rb
@@ -23,8 +23,19 @@ end
- # TODO
+ # Based on
+ # https://github.com/opal/opal-jquery/blob/master/opal/opal-jquery/element.rb#L279
def on(event_type, &callback)
- `#@native.on(#{event_type})`
+ %x{
+ var wrapper = function(evt) {
+ if (evt.preventDefault) {
+ evt = #{Event.new `evt`};
+ }
+
+ return block.apply(null, arguments);
+ };
+
+ #@native.on(#{event_type}, wrapper)
+ }
end
end
|
Add on handler based on opal-jquery
|
diff --git a/spec/spectator/specs_matcher_spec.rb b/spec/spectator/specs_matcher_spec.rb
index abc1234..def5678 100644
--- a/spec/spectator/specs_matcher_spec.rb
+++ b/spec/spectator/specs_matcher_spec.rb
@@ -0,0 +1,18 @@+require 'spec_helper'
+require 'spectator'
+require 'spectator/specs_matcher'
+require 'pathname'
+
+describe Spectator::SpecsMatcher do
+ describe '#specs_for' do
+ let(:config) { OpenStruct.new(Spectator.default_config_hash) }
+ subject(:matcher) { described_class.new(config) }
+ let(:root) { Pathname(File.expand_path('../../../', __FILE__)) }
+
+ it 'matches specs too' do
+ spec_file = Pathname(__FILE__).expand_path.relative_path_from(root).to_s
+
+ expect(matcher.specs_for([spec_file])).to eq([spec_file])
+ end
+ end
+end
|
Add some specs for the specs matcher
|
diff --git a/Casks/tex-live-utility.rb b/Casks/tex-live-utility.rb
index abc1234..def5678 100644
--- a/Casks/tex-live-utility.rb
+++ b/Casks/tex-live-utility.rb
@@ -1,8 +1,8 @@ cask :v1 => 'tex-live-utility' do
- version '1.19'
- sha256 'ef6beecc42d6b194f18795b46951bf274a5c838d8192f56e4437225af56e2820'
+ version '1.21'
+ sha256 '51fb396fa1bcb73af575c653415d16f422d842a6f8029f75c85ce1a6e0f92cf0'
- url 'https://github.com/amaxwell/tlutility/releases/download/1.19/TeX.Live.Utility.app-1.19.tar.gz'
+ url "https://github.com/amaxwell/tlutility/releases/download/#{version}/TeX.Live.Utility.app-#{version}.tar.gz"
appcast 'https://raw.githubusercontent.com/amaxwell/tlutility/master/appcast/tlu_appcast.xml',
:sha256 => '9ca9e537751be33f6757984dd7d1d28a84d680bddb53c37fc7942adcd72b0eca'
name 'TeX Live Utility'
|
Update TeX Live Utility to v1.21
|
diff --git a/buildserver/cookbooks/fdroidbuild-general/recipes/default.rb b/buildserver/cookbooks/fdroidbuild-general/recipes/default.rb
index abc1234..def5678 100644
--- a/buildserver/cookbooks/fdroidbuild-general/recipes/default.rb
+++ b/buildserver/cookbooks/fdroidbuild-general/recipes/default.rb
@@ -5,7 +5,7 @@ command "apt-get update"
end
-%w{ant ant-contrib autoconf autoconf2.13 autopoint bison bzr cmake curl expect faketime flex gettext git-core git-svn gperf graphviz amagemagick inkscape javacc libarchive-zip-perl librsvg2-bin libsaxonb-java libssl-dev libssl1.0.0 libtool make maven mercurial nasm openjdk-7-jdk optipng pandoc perlmagick pkg-config python python-gnupg python-magic python-setuptools python3-gnupg quilt realpath scons subversion swig texinfo transfig unzip vorbis-tools xsltproc yasm zip}.each do |pkg|
+%w{ant ant-contrib autoconf autoconf2.13 autopoint bison bzr cmake curl expect faketime flex gettext git-core git-svn gperf graphviz imagemagick inkscape javacc libarchive-zip-perl librsvg2-bin libsaxonb-java libssl-dev libssl1.0.0 libtool make maven mercurial nasm openjdk-7-jdk optipng pandoc perlmagick pkg-config python python-gnupg python-magic python-setuptools python3-gnupg quilt realpath scons subversion swig texinfo transfig unzip vorbis-tools xsltproc yasm zip}.each do |pkg|
package pkg do
action :install
end
|
Fix imagemagick (broken in d9bbb507)
|
diff --git a/lib/generators/styleguide/styleguide_generator.rb b/lib/generators/styleguide/styleguide_generator.rb
index abc1234..def5678 100644
--- a/lib/generators/styleguide/styleguide_generator.rb
+++ b/lib/generators/styleguide/styleguide_generator.rb
@@ -13,6 +13,7 @@ copy_file 'styleguide.html.erb', 'app/views/layouts/styleguide.html.erb'
empty_directory 'app/views/styleguide/widgets'
+ empty_directory 'app/assets/stylesheets/widgets'
copy_file 'index.html.erb', 'app/views/styleguide/index.html.erb'
copy_file '_widget.html.erb', 'app/views/styleguide/_widget.html.erb'
copy_file '_widget_link.html.erb', 'app/views/styleguide/_widget_link.html.erb'
|
Create place to put widget styles
|
diff --git a/s3direct.gemspec b/s3direct.gemspec
index abc1234..def5678 100644
--- a/s3direct.gemspec
+++ b/s3direct.gemspec
@@ -19,8 +19,8 @@ spec.require_paths = ["lib"]
spec.add_dependency 'activesupport', '>= 3.2.0'
- spec.add_dependency 'coffee-rails', '~> 3.2.1'
spec.add_dependency 'jquery-fileupload-rails', '~> 0.4.1'
+ spec.add_dependency 'coffee-rails'
spec.add_dependency 'ejs'
spec.add_development_dependency "bundler", "~> 1.3"
|
Remove version from coffee-rails dep
|
diff --git a/specs/ishigaki-internal/controls/tidy_files.rb b/specs/ishigaki-internal/controls/tidy_files.rb
index abc1234..def5678 100644
--- a/specs/ishigaki-internal/controls/tidy_files.rb
+++ b/specs/ishigaki-internal/controls/tidy_files.rb
@@ -46,7 +46,7 @@ end
%w[src.zip demo man sample].each do |cruft|
- describe file(cruft) do
+ describe file("/usr/lib/jvm/zulu-8-amd64/#{cruft}") do
it {should_not exist}
end
end
|
Fix location of deleted JDK files in test
|
diff --git a/.delivery/build/attributes/default.rb b/.delivery/build/attributes/default.rb
index abc1234..def5678 100644
--- a/.delivery/build/attributes/default.rb
+++ b/.delivery/build/attributes/default.rb
@@ -1,3 +1,3 @@ include_attribute 'delivery-red-pill'
-default['delivery-red-pill']['acceptance']['matrix'] = ["clean_aws", "extra_case"]
+default['delivery-red-pill']['acceptance']['matrix'] = ["clean_aws", "upgrade_aws"]
|
Add upgrade case to attribute file.
|
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1,6 +1,6 @@ module ApplicationHelper
def bootstrap_class_for flash_type
- { "success" => "alert-success", "error" => "alert-danger", "alert" => "alert-warning", "notice" => "alert-info" }[flash_type] || flash_type.to_s
+ { "success" => "alert-success", "error" => "alert-danger", "alert" => "alert-warning", "notice" => "alert-success" }[flash_type] || flash_type.to_s
end
def flash_messages(opts = {})
|
Change notice flash to success.
|
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: "Rails Girls Kraków <#{Rails.application.secrets.mandrill('sender_email')}>"
+ default from: "Rails Girls Kraków <#{Rails.application.secrets.mandrill['sender_email']}>"
layout 'mailer'
end
|
Fix issue with retrieving email sender from secrets
|
diff --git a/app/models/ci/trigger_schedule.rb b/app/models/ci/trigger_schedule.rb
index abc1234..def5678 100644
--- a/app/models/ci/trigger_schedule.rb
+++ b/app/models/ci/trigger_schedule.rb
@@ -14,32 +14,12 @@ validates :cron, cron: true, presence: { unless: :importing? }
validates :cron_time_zone, presence: { unless: :importing? }
validates :ref, presence: { unless: :importing? }
- # validate :check_cron_frequency
after_create :schedule_next_run!
def schedule_next_run!
next_time = Ci::CronParser.new(cron, cron_time_zone).next_time_from(Time.now)
-
- # if next_time.present? && !less_than_1_hour_from_now?(next_time)
- if next_time.present?
- update!(next_run_at: next_time)
- end
+ update!(next_run_at: next_time) if next_time.present?
end
-
- # private
-
- # def less_than_1_hour_from_now?(time)
- # puts "diff: #{(time - Time.now).abs.inspect}"
- # ((time - Time.now).abs < 1.hour) ? true : false
- # end
-
- # def check_cron_frequency
- # next_time = Ci::CronParser.new(cron, cron_time_zone).next_time_from(Time.now)
-
- # if less_than_1_hour_from_now?(next_time)
- # self.errors.add(:cron, " can not be less than 1 hour")
- # end
- # end
end
end
|
Remove less_than_1_hour_from_now comments. Dry up def schedule_next_run!
|
diff --git a/test/taverna_player_test.rb b/test/taverna_player_test.rb
index abc1234..def5678 100644
--- a/test/taverna_player_test.rb
+++ b/test/taverna_player_test.rb
@@ -4,10 +4,4 @@ test "truth" do
assert_kind_of Module, TavernaPlayer
end
-
- test "taverna_player_hostname_setting" do
- TavernaPlayer.player_hostname = "https://example.com:8443/test/path"
- assert_equal TavernaPlayer.hostname[:scheme], "https", "Scheme not https"
- assert_equal TavernaPlayer.hostname[:host], "example.com:8443/test/path"
- end
end
|
Remove forgotten test for setting hostname.
No longer needed.
|
diff --git a/KKColorListPicker.podspec b/KKColorListPicker.podspec
index abc1234..def5678 100644
--- a/KKColorListPicker.podspec
+++ b/KKColorListPicker.podspec
@@ -9,4 +9,5 @@ s.ios.deployment_target = '7.0'
s.source = { :git => "https://github.com/leoru/KKColorListPicker.git", :tag => "v0.2.2" }
s.source_files = 'src/KKColorListPicker/**/*.{h,m,xib,plist}'
+ s.resources = 'KKColorListPicker/*.{xib}'
end
|
Update podspec to fix broken nib dependencies
|
diff --git a/lib/head_music/style/annotations/avoid_overlapping_voices.rb b/lib/head_music/style/annotations/avoid_overlapping_voices.rb
index abc1234..def5678 100644
--- a/lib/head_music/style/annotations/avoid_overlapping_voices.rb
+++ b/lib/head_music/style/annotations/avoid_overlapping_voices.rb
@@ -15,25 +15,21 @@ end
def overlappings_of_lower_voices
- [].tap do |marks|
- lower_voices.each do |lower_voice|
- overlapped_notes = voice.notes.select do |note|
- preceding_note = lower_voice.note_preceding(note.position)
- following_note = lower_voice.note_following(note.position)
- (preceding_note && preceding_note.pitch > note.pitch) || (following_note && following_note.pitch > note.pitch)
- end
- marks << HeadMusic::Style::Mark.for_each(overlapped_notes)
- end
- end.flatten.compact
+ overlappings_for_voices(lower_voices, :>)
end
def overlappings_of_higher_voices
+ overlappings_for_voices(higher_voices, :<)
+ end
+
+ def overlappings_for_voices(voices, comparison_operator)
[].tap do |marks|
- higher_voices.each do |higher_voice|
+ voices.each do |higher_voice|
overlapped_notes = voice.notes.select do |note|
preceding_note = higher_voice.note_preceding(note.position)
following_note = higher_voice.note_following(note.position)
- (preceding_note && preceding_note.pitch < note.pitch) || (following_note && following_note.pitch < note.pitch)
+ (preceding_note && preceding_note.pitch.send(comparison_operator, note.pitch)) ||
+ (following_note && following_note.pitch.send(comparison_operator, note.pitch))
end
marks << HeadMusic::Style::Mark.for_each(overlapped_notes)
end
|
Refactor duplication in overlapping logic.
|
diff --git a/lib/json_expressions/rspec/matchers/match_json_expression.rb b/lib/json_expressions/rspec/matchers/match_json_expression.rb
index abc1234..def5678 100644
--- a/lib/json_expressions/rspec/matchers/match_json_expression.rb
+++ b/lib/json_expressions/rspec/matchers/match_json_expression.rb
@@ -24,6 +24,10 @@ def failure_message_for_should_not
"expected #{@target.inspect} not to match JSON expression #{@expected.inspect}"
end
+
+ def description
+ "should equal JSON expression #{@expected.inspect}"
+ end
end
def match_json_expression(expected)
|
Add description to support RSpec's attribute of subject
|
diff --git a/app/api/tutorial_enrolments_api.rb b/app/api/tutorial_enrolments_api.rb
index abc1234..def5678 100644
--- a/app/api/tutorial_enrolments_api.rb
+++ b/app/api/tutorial_enrolments_api.rb
@@ -10,16 +10,17 @@ end
desc 'Enrol project in a tutorial'
- params do
- requires :project_id, type: Integer, desc: 'The id of the project to enrol'
- end
- post '/tutorials/:tutorial_id/enrolments' do
- tutorial = Tutorial.find(params[:tutorial_id])
- unless authorise? current_user, tutorial.unit, :enrol_student
+ post '/units/:unit_id/tutorials/:tutorial_abbr/enrolments/:project_id' do
+ unit = Unit.find(params[:unit_id])
+ unless authorise? current_user, unit, :enrol_student
error!({ error: 'Not authorised to enrol student' }, 403)
end
+ tutorial = unit.tutorials.find_by(abbreviation: params[:tutorial_abbr])
+ error!({ error: "No tutorial with abbreviation #{params[:tutorial_abbr]} exists for the unit" }, 403) unless tutorial.present?
+
project = Project.find(params[:project_id])
+ result = project.enrol_in(tutorial)
if result.nil?
error!({ error: 'No enrolment added' }, 403)
|
FIX: Use unit for enroling project in a tutorial
|
diff --git a/test/integration/so_tech_sha_test.rb b/test/integration/so_tech_sha_test.rb
index abc1234..def5678 100644
--- a/test/integration/so_tech_sha_test.rb
+++ b/test/integration/so_tech_sha_test.rb
@@ -23,7 +23,7 @@ get "/sotechsha"
assert_template "so_tech_sha_overview_page/index"
assert_select "h1.page-header","「Scratchでつくる! たのしむ! プログラミング道場」Webコンテンツ"
- assert_select "a[href]", count:14
+ assert_select "a[href]", count:16
# Error
# assert_select "a[href=?]", /sotechsha-/ , count:14
assert_select "img", count:1
|
Fix broken tests: Change static number of links in /sotechsha
|
diff --git a/interactor.gemspec b/interactor.gemspec
index abc1234..def5678 100644
--- a/interactor.gemspec
+++ b/interactor.gemspec
@@ -15,6 +15,6 @@ spec.test_files = spec.files.grep(/^spec/)
spec.require_paths = ["lib"]
- spec.add_development_dependency "bundler", "~> 1.3"
- spec.add_development_dependency "rake", "~> 10.1"
+ spec.add_development_dependency "bundler", "~> 1.7"
+ spec.add_development_dependency "rake", "~> 10.3"
end
|
Update the gemspec's development dependency version requirements
|
diff --git a/lib/chefstyle/version.rb b/lib/chefstyle/version.rb
index abc1234..def5678 100644
--- a/lib/chefstyle/version.rb
+++ b/lib/chefstyle/version.rb
@@ -1,5 +1,5 @@ # frozen_string_literal: true
module Chefstyle
VERSION = "2.0.5"
- RUBOCOP_VERSION = "1.17.0"
+ RUBOCOP_VERSION = "1.18.3"
end
|
Update RuboCop engine to 1.18.3
Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
|
diff --git a/lib/disclosure/engine.rb b/lib/disclosure/engine.rb
index abc1234..def5678 100644
--- a/lib/disclosure/engine.rb
+++ b/lib/disclosure/engine.rb
@@ -1,5 +1,15 @@ module Disclosure
class Engine < ::Rails::Engine
isolate_namespace Disclosure
+
+ initializer 'disclosure.subscribe_to_model_events' do
+ ActiveSupport::Notifications.subscribe "disclosure.model_saved" do |name, start, finish, id, payload|
+ Disclosure.react_to!(payload[:model])
+ end
+ end
+
+ initializer 'disclosure.extend_model_classes' do
+ Disclosure.bootstrap!
+ end
end
end
|
Add initializers:
1. Subscribe to notifications issued by models after saving
2. Bootstrap required methods into models for implementation by the user
|
diff --git a/app/controllers/demo_controller.rb b/app/controllers/demo_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/demo_controller.rb
+++ b/app/controllers/demo_controller.rb
@@ -3,7 +3,7 @@ helper SmartListing::Helper
def index
- return root_path if Rails.env.production?
+ return redirect_to root_path if Rails.env.production?
smart_listing_create :procedures,
Procedure.where(archived: false),
|
Fix bug route /demo in production : Error 500 on redirect_to
|
diff --git a/app/controllers/root_controller.rb b/app/controllers/root_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/root_controller.rb
+++ b/app/controllers/root_controller.rb
@@ -19,6 +19,8 @@ private
def validate_template_param
+ # Allow alphanumeric and _ in template filenames.
+ # Prevent any attempts to traverse directores etc...
unless params[:template] =~ /\A\w+\z/
error_404
end
|
Add comment explaining regex intent
|
diff --git a/app/mailers/notification_mailer.rb b/app/mailers/notification_mailer.rb
index abc1234..def5678 100644
--- a/app/mailers/notification_mailer.rb
+++ b/app/mailers/notification_mailer.rb
@@ -4,7 +4,7 @@ email = "#{Formgen.always_mail_to};#{reply.form.email}"
title = reply.form.title.presence || reply.form.path
- mail(from: 'me', to: email, subject: t('notification_mailer.notify.new_notification_for', title: title), template_name: 'notify')
+ mail(to: email, subject: t('notification_mailer.notify.new_notification_for', title: title), template_name: 'notify')
end
def send_mail(method, *args)
|
Remove 'me' as from from mails
|
diff --git a/simple_aspect.gemspec b/simple_aspect.gemspec
index abc1234..def5678 100644
--- a/simple_aspect.gemspec
+++ b/simple_aspect.gemspec
@@ -18,8 +18,6 @@ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
- spec.add_development_dependency "bundler", "~> 1.10"
- spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "rspec"
spec.add_development_dependency "pry"
end
|
Remove unused gems from `gemspec`
|
diff --git a/app/workers/daily_import_worker.rb b/app/workers/daily_import_worker.rb
index abc1234..def5678 100644
--- a/app/workers/daily_import_worker.rb
+++ b/app/workers/daily_import_worker.rb
@@ -4,6 +4,6 @@
def perform
client = ClinicalTrials::Client.new
- client.import_xml_files
+ client.populate_studies
end
end
|
Change worker to populate studies based on xml records.
|
diff --git a/spec/controllers/pages_controller_spec.rb b/spec/controllers/pages_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/pages_controller_spec.rb
+++ b/spec/controllers/pages_controller_spec.rb
@@ -6,7 +6,7 @@ describe "GET #homepage" do
it 'returns success' do
get :homepage
- expect(response).to be_a_success
+ expect(response).to be_successful
end
end
end
|
Deal with deprecation warning re Rails 6 and the predicate
|
diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/users_controller_spec.rb
+++ b/spec/controllers/users_controller_spec.rb
@@ -11,26 +11,26 @@ let(:user) { attributes_for(:user) }
- describe 'POST#create' do
- describe "when successful" do
- let(:user_params) { { user: attributes_for(:user_params) } }
+ # describe 'POST#create' do
+ # describe "when successful" do
+ # let(:user_params) { { user: attributes_for(:user_params) } }
- it "creates a user" do
- post(:create, user_params)
- expect(response).to redirect_to(root_path)
- end
+ # it "creates a user" do
+ # post(:create, user_params)
+ # expect(response).to redirect_to(root_path)
+ # end
- it "increased the number of users in the database by 1" do
- expect{post(:create, user_params)}.to change{User.count}.by(1)
- end
- end
+ # it "increased the number of users in the database by 1" do
+ # expect{post(:create, user_params)}.to change{User.count}.by(1)
+ # end
+ # end
- describe "when unsuccessful" do
- it "redirects to the login page" do
- post(:create, user: { username: nil, password: nil })
- expect(response).to redirect_to(login_path)
- end
- end
+ # describe "when unsuccessful" do
+ # it "redirects to the login page" do
+ # post(:create, user: { username: nil, password: nil })
+ # expect(response).to redirect_to(login_path)
+ # end
+ # end
end
end
|
Comment out failing tests, first test passes
|
diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/users_controller_spec.rb
+++ b/spec/controllers/users_controller_spec.rb
@@ -16,8 +16,7 @@
context "#create" do
it "redirects to the users profile" do
- post :create, user: testuser
- expect(response).to redirect_to user_path(user.id)
+ expect{post :create, user: FactoryGirl.attributes_for(:user)}.to change(User, :count).by(1)
end
it "does not redirect with bad attributes" do
@@ -35,7 +34,7 @@
describe "#current" do
it "renders the current view template" do
- get :current, user:
+ get :current, user: testuser
expect(response).to render_template :current
end
end
|
Fix User controller spec create method
|
diff --git a/spec/views/videos/index.html.haml_spec.rb b/spec/views/videos/index.html.haml_spec.rb
index abc1234..def5678 100644
--- a/spec/views/videos/index.html.haml_spec.rb
+++ b/spec/views/videos/index.html.haml_spec.rb
@@ -1,13 +1,23 @@ require 'spec_helper'
describe 'videos/index.html.haml' do
- let(:videos) { [double('Video', :file_name => 'file_name')] }
+ context 'with a video' do
+ let(:videos) { [double('Video', :file_name => 'file_name')] }
- it 'displays all videos' do
- view.should_receive(:videos).once.and_return(videos)
+ it 'displays all videos' do
+ view.should_receive(:videos).once.and_return(videos)
+ render
+ rendered.should have_selector 'li', :count => 1
+ end
+ end
- render
+ context 'without videos' do
+ let(:videos) { [] }
- rendered.should have_selector 'li', :count => 1
+ it "doesn't display videos" do
+ view.should_receive(:videos).once.and_return(videos)
+ render
+ rendered.should_not have_selector 'li'
+ end
end
end
|
Update videos/index spec to handle a lack of videos
|
diff --git a/test/controllers/activities_controller_test.rb b/test/controllers/activities_controller_test.rb
index abc1234..def5678 100644
--- a/test/controllers/activities_controller_test.rb
+++ b/test/controllers/activities_controller_test.rb
@@ -19,4 +19,10 @@ get :index, date_start: Date.parse("2014-01-01"), date_end: Date.parse("2014-01-31")
assert assigns(:activities)
end
+
+ test "obtaining a list of activities in a day should be fine" do
+ date = Date.parse("2014-01-01")
+ get :index, date_start: date, date_end: date
+ assert assigns(:activities)
+ end
end
|
Add test to show we can get schedules for a single day
|
diff --git a/spec/python-requirements_spec.rb b/spec/python-requirements_spec.rb
index abc1234..def5678 100644
--- a/spec/python-requirements_spec.rb
+++ b/spec/python-requirements_spec.rb
@@ -28,3 +28,6 @@ its(:exit_status) { should eq 0 }
end
+describe command('which curl') do
+ its(:exit_status) { should eq 0 }
+end
|
Add a spec for curl.
|
diff --git a/spec/requests_spec.rb b/spec/requests_spec.rb
index abc1234..def5678 100644
--- a/spec/requests_spec.rb
+++ b/spec/requests_spec.rb
@@ -56,7 +56,7 @@ let(:body) { 'Request Body' }
it 'prints body on a request' do
- expect { get '/', body }.to output(/Request Body/).to_stdout
+ expect { post '/', body }.to output(/Request Body/).to_stdout
end
end
end
|
Use post request to test printing of request body.
|
diff --git a/lib/jmespath/nodes/or.rb b/lib/jmespath/nodes/or.rb
index abc1234..def5678 100644
--- a/lib/jmespath/nodes/or.rb
+++ b/lib/jmespath/nodes/or.rb
@@ -9,7 +9,7 @@
def visit(value)
result = @left.visit(value)
- if result.nil? or result.empty?
+ if result == false || result.nil? || (result.respond_to?(:empty?) && result.empty?)
@right.visit(value)
else
result
|
Fix OR expressions where the left side is true
TrueClass does not respond to `#empty?`, which makes `foo || bar` where foo resolves to true fail.
|
diff --git a/lib/myrrha/ext/domain.rb b/lib/myrrha/ext/domain.rb
index abc1234..def5678 100644
--- a/lib/myrrha/ext/domain.rb
+++ b/lib/myrrha/ext/domain.rb
@@ -10,6 +10,7 @@ def coerce(arg)
coercions.coerce(arg, self)
rescue Myrrha::Error => ex
+ raise ex.cause if ex.cause
domain_error!(arg)
end
alias_method :[], :coerce
|
Raise original coercion error if known.
|
diff --git a/lib/peek/views/resque.rb b/lib/peek/views/resque.rb
index abc1234..def5678 100644
--- a/lib/peek/views/resque.rb
+++ b/lib/peek/views/resque.rb
@@ -8,7 +8,8 @@ end
def job_count
- @queues.collect { |queue| ::Resque.size(queue) }.inject(&:+)
+ lookup = @queues == ['*'] ? ::Resque.queues : @queues
+ lookup.collect { |queue| ::Resque.size(queue) }.inject(&:+)
end
def context
|
Expand to all queues when no queues are given
|
diff --git a/lib/peoplesoft_models.rb b/lib/peoplesoft_models.rb
index abc1234..def5678 100644
--- a/lib/peoplesoft_models.rb
+++ b/lib/peoplesoft_models.rb
@@ -17,7 +17,7 @@ self.extend(EffectiveScope) if @record.effective_dated?
end
- klass
+ const_set(name, klass)
rescue ActiveRecord::RecordNotFound
super(name)
end
|
Set classes as constants under PeoplesoftModels
Rather than just returning the generated class. In cases where the
generated class is being used directly, this will prevent table_name and
key lookups everytime the class is referenced.
|
diff --git a/lib/rspec_ruby_runner.rb b/lib/rspec_ruby_runner.rb
index abc1234..def5678 100644
--- a/lib/rspec_ruby_runner.rb
+++ b/lib/rspec_ruby_runner.rb
@@ -1,8 +1,6 @@ require './bytecode_interpreter.rb'
require './bytecode_spool.rb'
require 'opal'
-
-LOG = false
class RspecRubyRunner
def initialize
@@ -18,28 +16,15 @@ bytecodes2 = compiler.compile_program 'TestCode', sexp2
spool = BytecodeSpool.new @bytecodes1 + [[:discard]] + bytecodes2
- if LOG
- File.open 'bytecodes.txt', 'w' do |file|
- bytecodes1.each { |bytecode| file.write bytecode.join(' ') + "\n" }
- file.write "\n"
- bytecodes2.each { |bytecode| file.write bytecode.join(' ') + "\n" }
- end
- end
-
spool.queue_run_until 'DONE'
interpreter = BytecodeInterpreter.new
begin
- File.open 'trace.txt', 'w' do |file|
- while true
- bytecode = spool.get_next_bytecode
- break if bytecode.nil?
- if LOG
- file.write bytecode.join(' ') + "\n"
- end
+ while true
+ bytecode = spool.get_next_bytecode
+ break if bytecode.nil?
- spool_command = interpreter.interpret bytecode
- spool.do_command *spool_command if spool_command
- end
+ spool_command = interpreter.interpret bytecode
+ spool.do_command *spool_command if spool_command
end
interpreter.visible_state[:output].map { |pair| pair[1] }.join
rescue ProgramTerminated => e
|
Remove logging because it's been replaced with debug.rb.
|
diff --git a/lib/save_queue/object.rb b/lib/save_queue/object.rb
index abc1234..def5678 100644
--- a/lib/save_queue/object.rb
+++ b/lib/save_queue/object.rb
@@ -61,11 +61,11 @@ end
def no_recursion
- return true if @saving
- @saving = true
+ return true if @_no_recursion_saving_flag
+ @_no_recursion_saving_flag = true
yield
ensure
- @saving = false
+ @_no_recursion_saving_flag = false
end
end
end
|
Change no_recursion variable to more uniq
|
diff --git a/lib/sequent/generator.rb b/lib/sequent/generator.rb
index abc1234..def5678 100644
--- a/lib/sequent/generator.rb
+++ b/lib/sequent/generator.rb
@@ -1,5 +1,6 @@ require 'fileutils'
require 'active_support'
+require 'active_support/core_ext/string'
module Sequent
class Generator
@@ -33,8 +34,14 @@ end
def replace_app_name
- `find #{name} -type f | xargs sed -i '' 's/MyApp/#{name_camelized}/g'`
- `find #{name} -type f | xargs sed -i '' 's/my_app/#{name_underscored}/g'`
+ files = Dir["./#{name}/**/*"].select { |f| File.file?(f) }
+
+ files.each do |filename|
+ contents = File.read(filename)
+ contents.gsub!('my_app', name_underscored)
+ contents.gsub!('MyApp', name_camelized)
+ File.open(filename, 'w') { |f| f.puts contents }
+ end
end
end
end
|
Replace app name with pure ruby
|
diff --git a/lib/tasks/bunnylove.rake b/lib/tasks/bunnylove.rake
index abc1234..def5678 100644
--- a/lib/tasks/bunnylove.rake
+++ b/lib/tasks/bunnylove.rake
@@ -0,0 +1,14 @@+namespace :test do
+
+ desc 'Measures test coverage'
+ task :coverage do
+ rm_f "coverage"
+ rm_f "coverage.data"
+ rcov = "rcov --rails --aggregate coverage.data --text-summary -Ilib"
+ system("#{rcov} --no-html test/unit/*_test.rb")
+ system("#{rcov} --no-html test/functional/*_test.rb")
+ system("#{rcov} --html test/integration/*_test.rb")
+ system("open coverage/index.html") if PLATFORM['darwin']
+ end
+
+end
|
Add task for measuring test coverage
git-svn-id: 801577a2cbccabf54a3a609152c727abd26e524a@1249 a18515e9-6cfd-0310-9624-afb4ebaee84e
|
diff --git a/lib/active_application/controller_methods.rb b/lib/active_application/controller_methods.rb
index abc1234..def5678 100644
--- a/lib/active_application/controller_methods.rb
+++ b/lib/active_application/controller_methods.rb
@@ -41,15 +41,15 @@ end
def layout_for_account
- set_locale Configuration.module_layouts[:account]
+ Configuration.module_layouts[:account]
end
def layout_for_customer
- set_locale Configuration.module_layouts[:customer]
+ Configuration.module_layouts[:customer]
end
def layout_for_backend
- set_locale Configuration.module_layouts[:backend]
+ Configuration.module_layouts[:backend]
end
end
end
|
Remove set_locale added by mistake
|
diff --git a/lib/alchemy/devise/test_support/factories.rb b/lib/alchemy/devise/test_support/factories.rb
index abc1234..def5678 100644
--- a/lib/alchemy/devise/test_support/factories.rb
+++ b/lib/alchemy/devise/test_support/factories.rb
@@ -1,26 +1,28 @@+# frozen_string_literal: true
+
FactoryBot.define do
- factory :alchemy_user, class: 'Alchemy::User' do
+ factory :alchemy_user, class: Alchemy::User do
sequence(:login) { |n| "john_#{n}.doe" }
sequence(:email) { |n| "john_#{n}@doe.com" }
- firstname 'John'
- lastname 'Doe'
- password 's3cr3t'
- password_confirmation 's3cr3t'
+ firstname { 'John' }
+ lastname { 'Doe' }
+ password { 's3cr3t' }
+ password_confirmation { 's3cr3t' }
factory :alchemy_admin_user do
- alchemy_roles 'admin'
+ alchemy_roles { 'admin' }
end
factory :alchemy_member_user do
- alchemy_roles 'member'
+ alchemy_roles { 'member' }
end
factory :alchemy_author_user do
- alchemy_roles 'author'
+ alchemy_roles { 'author' }
end
factory :alchemy_editor_user do
- alchemy_roles 'editor'
+ alchemy_roles { 'editor' }
end
end
end
|
Update user factory to latest FactoryBot version
|
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.4.0"
+ VERSION = "2.4.1"
VERSION_FULL = "Bukkit-CLI v#{VERSION}"
end
|
v2.4.1: Add --no-start option to create/new command.
|
diff --git a/Casks/android-studio-bundle.rb b/Casks/android-studio-bundle.rb
index abc1234..def5678 100644
--- a/Casks/android-studio-bundle.rb
+++ b/Casks/android-studio-bundle.rb
@@ -0,0 +1,7 @@+class AndroidStudioBundle < Cask
+ url 'https://dl.google.com/android/studio/install/0.4.2/android-studio-bundle-133.970939-mac.dmg'
+ homepage 'http://developer.android.com/sdk/installing/studio.html'
+ version '0.4.2 build-133.970939'
+ sha256 '28226e2ae7186a12bc196abe28ccc611505e3f6aa84da6afc283d83bb7995a8b'
+ link 'Android Studio.app'
+end
|
Add Android Studio Bundle 0.4.2 build-133.970939
android-studio-bundle is different from android-studio as it comes with the Android SDK already bundled, within the .app.
This is the regular .dmg not cutting edge version you would get from http://developer.android.com/sdk/installing/studio.html
|
diff --git a/spec/lib/load_spec.rb b/spec/lib/load_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/load_spec.rb
+++ b/spec/lib/load_spec.rb
@@ -0,0 +1,42 @@+# It should be possible to require any one Hamster structure,
+# without loading all the others
+
+hamster_lib_dir = File.join(File.dirname(__FILE__), "..", "..", 'lib')
+
+describe :Hamster do
+ describe :Hash do
+ it "can be loaded separately" do
+ system(%{ruby -e "$:.unshift('#{hamster_lib_dir}'); require 'hamster/hash'; Hamster::Hash.new"}).should be(true)
+ end
+ end
+
+ describe :Set do
+ it "can be loaded separately" do
+ system(%{ruby -e "$:.unshift('#{hamster_lib_dir}'); require 'hamster/set'; Hamster::Set.new"}).should be(true)
+ end
+ end
+
+ describe :Vector do
+ it "can be loaded separately" do
+ system(%{ruby -e "$:.unshift('#{hamster_lib_dir}'); require 'hamster/vector'; Hamster::Vector.new"}).should be(true)
+ end
+ end
+
+ describe :List do
+ it "can be loaded separately" do
+ system(%{ruby -e "$:.unshift('#{hamster_lib_dir}'); require 'hamster/list'; Hamster::List[]"}).should be(true)
+ end
+ end
+
+ describe :SortedSet do
+ it "can be loaded separately" do
+ system(%{ruby -e "$:.unshift('#{hamster_lib_dir}'); require 'hamster/sorted_set'; Hamster::SortedSet.new"}).should be(true)
+ end
+ end
+
+ describe :Deque do
+ it "can be loaded separately" do
+ system(%{ruby -e "$:.unshift('#{hamster_lib_dir}'); require 'hamster/deque'; Hamster::Deque.new"}).should be(true)
+ end
+ end
+end
|
Add new spec ensuring that each Hamster collection can be loaded individually
It doesn't check that the other collections are not recursively required --
just that it is possible to require an individual collection without an
unexpected exception.
|
diff --git a/app/finders/clusters_finder.rb b/app/finders/clusters_finder.rb
index abc1234..def5678 100644
--- a/app/finders/clusters_finder.rb
+++ b/app/finders/clusters_finder.rb
@@ -9,9 +9,9 @@ clusters = case @scope
when :all
project.clusters
+ when :enabled
+ project.clusters.enabled
when :disabled
- project.clusters.enabled
- when :enabled
project.clusters.disabled
end
clusters.map { |cluster| cluster.present(current_user: @user) }
|
Fix mixup with enabled/disabled in ClustersFinder
|
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -2,7 +2,7 @@ def project_options_for_select(opts = {})
options = []
options += [[opts[:root].to_s, nil]] if opts[:root]
- Project.top_level.each do |project|
+ current_user.projects.top_level.order(:name).each do |project|
entries = arrays_for_project_and_children(project, 1, opts)
options += entries if entries
end
@@ -20,7 +20,7 @@ return nil if opts[:exclude_inactive] and ! project.active?
output = [ name_and_id_for_this_project(project, nesting, opts) ]
- project.children.each do |child|
+ project.children.order(:name).each do |child|
entries = arrays_for_project_and_children(child, nesting + 1, opts)
output += entries if entries
end
@@ -30,8 +30,8 @@
def name_and_id_for_this_project(project, nesting, opts)
name = "#{' ' * nesting}#{project.name}"
- if opts[:display_rate] and project.inherited_rate > 0
- name += " (#{project.inherited_rate.format} / hr)"
+ if opts[:display_rate] and project.rate > 0
+ name += " (#{project.rate.format} / hr)"
end
[ name.html_safe, project.id ]
end
|
Projects: Sort projects select; filter to only MY projects
|
diff --git a/spambust.gemspec b/spambust.gemspec
index abc1234..def5678 100644
--- a/spambust.gemspec
+++ b/spambust.gemspec
@@ -23,6 +23,7 @@
s.add_development_dependency "sinatra"
s.add_development_dependency "rake"
+ s.add_development_dependency "rdoc"
s.add_development_dependency "rack-test"
s.add_development_dependency "minitest"
end
|
Fix missing dependency on ruby 1.9.2
|
diff --git a/spec/app_spec.rb b/spec/app_spec.rb
index abc1234..def5678 100644
--- a/spec/app_spec.rb
+++ b/spec/app_spec.rb
@@ -1,7 +1,6 @@ require_relative 'helper'
require 'rack/test'
require 'app'
-require 'yajl'
describe 'the application' do
include Rack::Test::Methods
|
Remove yajl require in spec
|
diff --git a/lib/electric_slide.rb b/lib/electric_slide.rb
index abc1234..def5678 100644
--- a/lib/electric_slide.rb
+++ b/lib/electric_slide.rb
@@ -17,7 +17,7 @@
def create(name, queue_type, agent_type = Agent)
synchronize do
- @queues[name] = const_get(queue_type).new unless @queues.has_key?(name)
+ @queues[name] = queue_type.new unless @queues.has_key?(name)
@queues[name].extend agent_type
end
end
|
Use the supplied class directly
Instead of looking it up with const_get
|
diff --git a/examples/convert.rb b/examples/convert.rb
index abc1234..def5678 100644
--- a/examples/convert.rb
+++ b/examples/convert.rb
@@ -0,0 +1,74 @@+$:.unshift File.join(File.expand_path(File.dirname(__FILE__)), '..', 'lib')
+require 'luban/cli'
+
+class ConvertApp < Luban::CLI::Application
+ configure do
+ version '1.0.0'
+ desc 'Convert on simple Ruby objects'
+ long_desc 'Demo app for Luban::CLI'
+ end
+
+ auto_help_command
+
+ command :text do
+ desc 'Manipulate texts'
+
+ command :capitalize do
+ desc 'capitalize a given string'
+ argument :str, type: :string
+ action :capitalize_string
+ end
+
+ command :join do
+ desc 'Concat a given strings with a specified delimiter'
+ option :delimiter, 'Delimiter to join strings', short: :d, default: ', '
+ argument :strs, 'Strings to be joined', type: :string, multiple: true
+ action :join_strings
+ end
+ end
+
+ command :number do
+ desc 'Manipulate numbers'
+
+ command :rationalize do
+ desc 'Return a simpler approximation of the value within an optional specified precision'
+ option :precision, 'Epsilon for the approximation', short: :p, type: :float
+ argument :value, 'Floating point number to be rationalized', type: :float
+ action :rationalize_number
+ end
+
+ command :round do
+ desc 'Rounds the given number to a specified precision in decimal digits'
+ option :digits, 'Precision in decimal digits', short: :d, type: :integer, required: true
+ argument :value, 'Floating point number to be rounded', type: :float
+ action :round_number
+ end
+ end
+
+ def capitalize_string(args:, **others)
+ puts "Capitalize the given string #{args[:str].inspect}:"
+ puts args[:str].capitalize
+ end
+
+ def join_strings(args:, opts:, **others)
+ puts "Join strings #{args[:strs].inspect} with #{opts[:delimiter].inspect}:"
+ puts args[:strs].join(opts[:delimiter])
+ end
+
+ def rationalize_number(args:, opts:, **others)
+ if opts[:precision].nil?
+ puts "Rationalize value #{args[:value]}:"
+ puts args[:value].rationalize
+ else
+ puts "Rationalize value #{args[:value]} with precision #{opts[:precision]}:"
+ puts args[:value].rationalize(opts[:precision])
+ end
+ end
+
+ def round_number(args:, opts:, **others)
+ puts "Round value #{args[:value]} with precision in #{opts[:digits]} decimal digits"
+ puts args[:value].round(opts[:digits])
+ end
+end
+
+ConvertApp.new.run
|
Add an example for subcommands and nested subcommands
|
diff --git a/lib/filmbuff/title.rb b/lib/filmbuff/title.rb
index abc1234..def5678 100644
--- a/lib/filmbuff/title.rb
+++ b/lib/filmbuff/title.rb
@@ -13,7 +13,7 @@ @votes = options['num_votes']
@poster_url = options['image']['url'] if options['image']
@genres = options['genres'] || []
- @release_date = Date.strptime(options['release_date']['normal'], '%Y-%m-%d')
+ @release_date = DateTime.strptime(options['release_date']['normal'], '%Y-%m-%d')
end
end
end
|
Store release date as DateTime rather than Date
|
diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb
index abc1234..def5678 100644
--- a/config/initializers/mime_types.rb
+++ b/config/initializers/mime_types.rb
@@ -2,3 +2,7 @@
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
+
+Mime::Type.register 'video/mp4', :mp4
+Mime::Type.register 'video/webm', :webm
+Mime::Type.register 'video/ogg', :ogv
|
Fix video dose not play in IE9 or later
.mp4 や .webm, .ogv をコンテンツに埋め込むと IE9/10/11 では、
"無効なソース" と表示され正しく再生されない。
原因は CMS コンテンツの静的ファイルが `send_file` によって
レスポンスされる際、未定義の拡張子のため ContentType が
`application/octet-stream` にセットされるため。
なお、Chrome/Firefox/Safari では問題なく再生される。
|
diff --git a/lib/git_recent/cli.rb b/lib/git_recent/cli.rb
index abc1234..def5678 100644
--- a/lib/git_recent/cli.rb
+++ b/lib/git_recent/cli.rb
@@ -2,9 +2,7 @@ require 'thor'
class Cli < Thor
- DEFAULT_MAX_BRANCHES = 5
-
- class_option :max, :type => :numeric
+ class_option :max, type: :numeric, default: 5
desc 'list', 'List recently checked-out git branches'
def list
@@ -27,7 +25,7 @@ private
def recent_branch_names
branch_lister = GitRecent::BranchLister.new
- recent_branch_names = branch_lister.branch_names(options[:max] || DEFAULT_MAX_BRANCHES)
+ recent_branch_names = branch_lister.branch_names(options[:max].to_i)
abort 'No recent branches' if recent_branch_names.empty?
recent_branch_names
end
|
Use Thor to handle default max option
|
diff --git a/db/samples.rb b/db/samples.rb
index abc1234..def5678 100644
--- a/db/samples.rb
+++ b/db/samples.rb
@@ -9,6 +9,7 @@ fixture_filename = File.join(*db_args)
# Throws exception if 'db/fixtures/#{filename}.yml' doesn't yet exist
- FileUtils.touch(fixture_filename)
+ fixtures = File.join('db/fixtures', "#{File.basename(file, '.*')}.yml")
+ FileUtils.touch(fixtures)
ActiveRecord::Fixtures.create_fixtures(*db_args)
end
|
Append yml to fixtures file ending
|
diff --git a/lib/has_attributes.rb b/lib/has_attributes.rb
index abc1234..def5678 100644
--- a/lib/has_attributes.rb
+++ b/lib/has_attributes.rb
@@ -38,13 +38,13 @@ end
def attributes=(attrs)
- self.class.model_attributes.each {|attr| send((attr.to_s << "=").to_sym, attrs[attr])}
+ self.class.model_attributes.each {|attr| public_send((attr.to_s << "=").to_sym, attrs[attr])}
attributes
end
def attributes
self.class.model_attributes.reduce({}) do |memo, attr|
- memo.merge(attr => send(attr))
+ memo.merge(attr => public_send(attr))
end
end
end
|
Use public_send for public instance methods
|
diff --git a/AttributedLib.podspec b/AttributedLib.podspec
index abc1234..def5678 100644
--- a/AttributedLib.podspec
+++ b/AttributedLib.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |s|
s.name = 'AttributedLib'
- s.version = '0.2.2'
+ s.version = '1.0.0'
s.summary = 'A Modern interface for attributed strings.'
s.description = <<-DESC
|
Increase podspec to point to version to 1.0.0
|
diff --git a/lib/real_world_rails/inspectors/inspector.rb b/lib/real_world_rails/inspectors/inspector.rb
index abc1234..def5678 100644
--- a/lib/real_world_rails/inspectors/inspector.rb
+++ b/lib/real_world_rails/inspectors/inspector.rb
@@ -13,26 +13,12 @@ end
def run
- parser = ParserFactory.create
- processor = create_processor
- filenames.each do |filename|
- if inspectable?(filename)
- buffer = Parser::Source::Buffer.new filename
- buffer.read
- ast = parser.reset.parse(buffer)
- processor.process(ast)
- end
- end
- end
-
- def create_processor
- processor_class_name = "#{self.class}::Processor"
- processor_class = Object.const_get processor_class_name
- processor_class.new
+ filenames.each { |filename| inspect_file(filename) }
end
def filenames
- Dir.glob ENV.fetch('FILES_PATTERN', files_pattern)
+ glob_pattern = ENV.fetch('FILES_PATTERN', files_pattern)
+ Dir.glob(glob_pattern).select { |filename| inspectable?(filename) }
end
def files_pattern
@@ -43,6 +29,27 @@ self.class.filename_specification.satisfied_by? filename
end
+ def inspect_file(filename)
+ buffer = Parser::Source::Buffer.new filename
+ buffer.read
+ ast = parser.reset.parse(buffer)
+ processor.process(ast)
+ end
+
+ def parser
+ @parser ||= ParserFactory.create
+ end
+
+ def processor
+ @processor ||= create_processor
+ end
+
+ def create_processor
+ processor_class_name = "#{self.class}::Processor"
+ processor_class = Object.const_get processor_class_name
+ processor_class.new
+ end
+
end
end
end
|
Introduce methods to increase extension points
|
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.1.0'
+ s.version = '0.1.1'
s.summary = 'Run files that match a file specification, excluding those that match a regex'
s.description = ' '
|
Package version patch number is incremented from 0.1.0 to 0.1.1
|
diff --git a/Casks/phpstorm-eap.rb b/Casks/phpstorm-eap.rb
index abc1234..def5678 100644
--- a/Casks/phpstorm-eap.rb
+++ b/Casks/phpstorm-eap.rb
@@ -1,6 +1,6 @@ cask :v1 => 'phpstorm-eap' do
- version '139.1226'
- sha256 '7f9e55d3f5070fb5869eb7053566f21067600d11f93435074fad9cf399ea1626'
+ version '141.176'
+ sha256 'a5c70789db4aa13c938de761029b15b2348b0a39f7ac549eaa7c82434373caed'
url "http://download.jetbrains.com/webide/PhpStorm-EAP-#{version}.dmg"
homepage 'http://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Early+Access+Program'
@@ -15,6 +15,6 @@ zap :delete => [
'~/Library/Application Support/WebIde80',
'~/Library/Preferences/WebIde80',
- '~/Library/Preferences/com.jetbrains.PhpStorm.plist',
+ '~/Library/Preferences/com.jetbrains.PhpStorm-EAP.plist',
]
end
|
Update PhpStorm-EAP.app to version 141.176.
|
diff --git a/test/controllers/posts_controller_test.rb b/test/controllers/posts_controller_test.rb
index abc1234..def5678 100644
--- a/test/controllers/posts_controller_test.rb
+++ b/test/controllers/posts_controller_test.rb
@@ -0,0 +1,40 @@+require 'test_helper'
+
+#
+# == PostsController Test
+#
+class PostsControllerTest < ActionController::TestCase
+ setup :initialize_test
+
+ test 'should get atom page' do
+ I18n.available_locales.each do |locale|
+ get :feed, format: :atom, locale: locale.to_s
+ assert_response :success
+ end
+ end
+
+ test 'should use feed template' do
+ get :feed, format: :atom, locale: 'fr'
+ assert_template :feed
+ end
+
+ test 'should target controller and action for feed url' do
+ assert_routing '/feed.atom', controller: 'posts', action: 'feed', locale: 'fr', format: 'atom'
+ assert_routing '/en/feed.atom', controller: 'posts', action: 'feed', locale: 'en', format: 'atom'
+ end
+
+ test 'should redirect to french atom version if access to french rss' do
+ get :feed, format: :rss, locale: 'fr'
+ assert_redirected_to action: :feed, format: :atom, locale: 'fr'
+ end
+
+ test 'should redirect to english atom version if access to english rss' do
+ get :feed, format: :rss, locale: 'en'
+ assert_redirected_to action: :feed, format: :atom, locale: 'en'
+ end
+
+ private
+
+ def initialize_test
+ end
+end
|
Add basics test for Atom feed
|
diff --git a/lib/lightspeed_pos.rb b/lib/lightspeed_pos.rb
index abc1234..def5678 100644
--- a/lib/lightspeed_pos.rb
+++ b/lib/lightspeed_pos.rb
@@ -1,6 +1,5 @@ require 'typhoeus'
require 'json'
-require 'pry' if Rails.env.development?
module Lightspeed
end
|
Remove require 'pry' if Rails.env.development?
This gem has no context of a Rails app at all. If you want this, put it in your app.
|
diff --git a/lib/asciidoctor-diagram/barcode/dependencies.rb b/lib/asciidoctor-diagram/barcode/dependencies.rb
index abc1234..def5678 100644
--- a/lib/asciidoctor-diagram/barcode/dependencies.rb
+++ b/lib/asciidoctor-diagram/barcode/dependencies.rb
@@ -4,7 +4,7 @@ BARCODE_DEPENDENCIES = {'barby' => '~> 0.6.8'}
PNG_DEPENDENCIES = {'chunky_png' => '~> 1.4.0'}
QRCODE_DEPENDENCIES = {'rqrcode' => '~> 2.0.0'}
- ALL_DEPENDENCIES = {}.merge(BARCODE_DEPENDENCIES, PNG_DEPENDENCIES, QRCODE_DEPENDENCIES)
+ ALL_DEPENDENCIES = {}.merge(BARCODE_DEPENDENCIES).merge(PNG_DEPENDENCIES).merge(QRCODE_DEPENDENCIES)
end
end
end
|
Resolve Ruby 2.3 compatibility issue
|
diff --git a/FSOpenInGmail.podspec b/FSOpenInGmail.podspec
index abc1234..def5678 100644
--- a/FSOpenInGmail.podspec
+++ b/FSOpenInGmail.podspec
@@ -3,6 +3,7 @@ s.version = "0.9"
s.summary = "FSOpenInGmail is a tool for sending mails with Gmail iOS App."
s.homepage = "https://github.com/x2on/FSOpenInGmail"
+ s.social_media_url = 'https://twitter.com/x2on'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { "Felix Schulze" => "code@felixschulze.de" }
s.source = {
|
Add social media url in podspec
|
diff --git a/config/initializers/carrierwave.rb b/config/initializers/carrierwave.rb
index abc1234..def5678 100644
--- a/config/initializers/carrierwave.rb
+++ b/config/initializers/carrierwave.rb
@@ -1,3 +1,10 @@+# TODO: Make this store to RAILS_ROOT/permanent
+
+# On bushido, the app directory is destroyed on every update, so everything is lost.
+# The only place this doesn't happen is the RAILS_ROOT/permanent folder.
+# Also, RAILS_ROOT/permanent/store is symlinked to RAILS_ROOT/public/store on every update,
+# so store your publicly-accessible files here (e.g. templates, etc.)
+
CarrierWave.configure do |config|
case Rails.env.to_sym
|
Mark a note about how to handle file uploads for persistence
|
diff --git a/scripts/prepare-changelog-entries.rb b/scripts/prepare-changelog-entries.rb
index abc1234..def5678 100644
--- a/scripts/prepare-changelog-entries.rb
+++ b/scripts/prepare-changelog-entries.rb
@@ -0,0 +1,55 @@+#!/usr/bin/env ruby
+
+require 'json'
+require 'net/http'
+require 'uri'
+
+per_page = 15
+
+private_token = ENV['GITLAB_PRIVATE_TOKEN']
+unless private_token && !private_token.empty?
+ STDERR.puts 'Please set GITLAB_PRIVATE_TOKEN variable'
+ exit 1
+end
+
+starting_point = ENV['STARTING_POINT']
+if !starting_point || starting_point.empty?
+ refs_search_cmd = 'git log --pretty="%D" --first-parent | grep "tag:"'
+ refs = `#{refs_search_cmd}`.split("\n").map{|r| r.split(',').map(&:strip).reject{|r| !r.match(/\Atag: v\d+\.\d+\.\d+\Z/)}}.reject(&:empty?)
+ starting_point = refs.first.first.match(/v\d+\.\d+\.\d+/)[0]
+
+ STDERR.puts "STARTING_POINT variable not set, using autodiscovered: #{starting_point}"
+end
+unless starting_point && !starting_point.empty?
+ STDERR.puts 'Please set STARTING_POINT variable'
+end
+
+exclude_mr_ids = []
+exclude_mr_ids = ENV['EXCLUDE_MR_IDS'].split(',').map(&:to_i) if ENV['EXCLUDE_MR_IDS']
+project_id = ENV['PROJECT_ID'] || 'gitlab-org%2Fgitlab-ci-multi-runner'
+
+base_url = URI("https://gitlab.com/api/v3/projects/#{project_id}/merge_requests/")
+merge_requests = {}
+
+merge_request_ids_cmd = "git log #{starting_point}.. --first-parent | grep -E \"^\\s*See merge request \![0-9]+$\" | grep -Eo \"[0-9]+$\" | xargs echo"
+merge_request_ids = `#{merge_request_ids_cmd}`.split(' ').map(&:to_i).reject{ |id| exclude_mr_ids.include?(id) }.reverse
+merge_request_ids.sort.each_slice(per_page).to_a.each do |part|
+ query = part.map do |id|
+ "iid[]=#{id}"
+ end
+
+ query << "per_page=#{per_page}"
+ query << "private_token=#{private_token}"
+
+ base_url.query = query.join('&')
+
+ data = JSON.parse(Net::HTTP.get(base_url))
+ data.each do |mr|
+ merge_requests[mr['iid'].to_i] = mr['title']
+ end
+end
+
+puts
+merge_request_ids.each do |iid|
+ puts "- #{merge_requests[iid]} !#{iid}"
+end
|
Add changelog entries generation script
|
diff --git a/Casks/google-music.rb b/Casks/google-music.rb
index abc1234..def5678 100644
--- a/Casks/google-music.rb
+++ b/Casks/google-music.rb
@@ -1,7 +1,7 @@ class GoogleMusic < Cask
- url 'https://github.com/kbhomes/google-music-mac/releases/download/v1.0.3/Google.Music.zip'
+ url 'https://github.com/kbhomes/google-music-mac/releases/download/v1.1.1/Google.Music.zip'
homepage 'http://kbhomes.github.io/google-music-mac/'
- version '1.0.3'
- sha256 '1c1a758aaa9555c721e1e366c129af9d594b9c4fda5b675b23f5882e414f15e9'
+ version '1.1.1'
+ sha256 '62f38da3adad507e35ff6aaff01feecb065bab2ba9f59e9684c7c5971fcbdf9c'
link 'Google Music.app'
end
|
Upgrade Google Music to v1.1.1
|
diff --git a/test/integration/withdrawing_test.rb b/test/integration/withdrawing_test.rb
index abc1234..def5678 100644
--- a/test/integration/withdrawing_test.rb
+++ b/test/integration/withdrawing_test.rb
@@ -9,17 +9,22 @@ unpublishing_reason_id: UnpublishingReason::Withdrawn.id)
stub_panopticon_registration(edition)
- publishing_api_payload = presenter.as_json.tap { |json|
- json[:details][:withdrawn_notice] = {
- explanation: "<div class=\"govspeak\"><p>Old information</p>\n</div>",
- withdrawn_at: edition.updated_at
- }
- json[:update_type] = "republish"
+
+ content = presenter.content
+ content[:details][:withdrawn_notice] = {
+ explanation: "<div class=\"govspeak\"><p>Old information</p>\n</div>",
+ withdrawn_at: edition.updated_at
}
- requests = stub_publishing_api_put_content_links_and_publish(publishing_api_payload)
+
+ requests = [
+ stub_publishing_api_put_content(presenter.content_id, content),
+ stub_publishing_api_put_links(presenter.content_id, links: presenter.links),
+ stub_publishing_api_publish(presenter.content_id, locale: 'en', update_type: 'republish')
+ ]
+
perform_withdrawal(edition)
- requests.each { |request| assert_requested request }
+ assert_all_requested requests
end
private
|
Fix WithdrawingTest for new format
|
diff --git a/lib/payable/client.rb b/lib/payable/client.rb
index abc1234..def5678 100644
--- a/lib/payable/client.rb
+++ b/lib/payable/client.rb
@@ -10,11 +10,8 @@ attr_reader :company_id, :api_key
def initialize(company_id: Payable.config.company_id, api_key: Payable.config.api_key)
- @company_id = company_id
- @api_key = api_key
-
- raise MissingRequiredSetting, "company_id" unless company_id
- raise MissingRequiredSetting, "api_key" unless api_key
+ @company_id = company_id or raise MissingRequiredSetting, "company_id"
+ @api_key = api_key or raise MissingRequiredSetting, "api_key"
end
def connection
@@ -24,6 +21,7 @@ conn.response :json
conn.response :logger, Payable.config.logger, bodies: true if Payable.config.logger
conn.response :symbolize_keys
+ conn.response :raise_error
conn.adapter Faraday.default_adapter
end
end
|
Raise errors on request failure
|
diff --git a/lib/process_photos.rb b/lib/process_photos.rb
index abc1234..def5678 100644
--- a/lib/process_photos.rb
+++ b/lib/process_photos.rb
@@ -22,6 +22,6 @@ end
def tmp_dir
- @tmp_dir ||= "tmp/photo_processing/#{Time.now.to_i}"
+ @tmp_dir ||= "tmp/photo_processing/#{title}"
end
end
|
Use title for temp dir name rather than timestamp
|
diff --git a/app/views/starred_entries/index.xml.builder b/app/views/starred_entries/index.xml.builder
index abc1234..def5678 100644
--- a/app/views/starred_entries/index.xml.builder
+++ b/app/views/starred_entries/index.xml.builder
@@ -1,4 +1,4 @@-cache @entries do
+cache [@user.id, @entries] do
xml.instruct! :xml, version: "1.0"
xml.rss version: "2.0", 'xmlns:dc' => 'http://purl.org/dc/elements/1.1/', 'xmlns:atom' => 'http://www.w3.org/2005/Atom' do
xml.channel do
|
Include user_id in cache key.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.