diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/lib/gitlab/middleware/read_only.rb b/lib/gitlab/middleware/read_only.rb index abc1234..def5678 100644 --- a/lib/gitlab/middleware/read_only.rb +++ b/lib/gitlab/middleware/read_only.rb @@ -13,7 +13,7 @@ end def call(env) - ReadOnly::Controller.new(@app, env).call + ::Gitlab::Middleware::ReadOnly::Controller.new(@app, env).call end end end
Fix "A copy of Gitlab::Middleware::Readonly has been removed from the module tree but is still active" Similar to #34047 and #29327
diff --git a/lib/sequent/core/command_record.rb b/lib/sequent/core/command_record.rb index abc1234..def5678 100644 --- a/lib/sequent/core/command_record.rb +++ b/lib/sequent/core/command_record.rb @@ -29,6 +29,7 @@ self.table_name = "command_records" belongs_to :event_record, foreign_key: 'event_aggregate_id', primary_key: 'aggregate_id', optional: true + has_many :event_records validates_presence_of :command_type, :command_json
Add has many relation on events for command
diff --git a/lib/template/lib/endpoints/base.rb b/lib/template/lib/endpoints/base.rb index abc1234..def5678 100644 --- a/lib/template/lib/endpoints/base.rb +++ b/lib/template/lib/endpoints/base.rb @@ -20,7 +20,7 @@ error Sinatra::NotFound do content_type :json status 404 - "{}" + { id: "not_found", message: "Resource not found" }.to_json end end end
Return an id and message in body when 404 in json. All other errors return something with `id` and `message`. This is just uniformising the behavior there.
diff --git a/pastel.gemspec b/pastel.gemspec index abc1234..def5678 100644 --- a/pastel.gemspec +++ b/pastel.gemspec @@ -1,4 +1,3 @@-# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'pastel/version' @@ -7,7 +6,7 @@ spec.name = "pastel" spec.version = Pastel::VERSION spec.authors = ["Piotr Murach"] - spec.email = [""] + spec.email = ["me@piotrmurach.com"] spec.summary = %q{Terminal strings styling with intuitive and clean API.} spec.description = %q{Terminal strings styling with intuitive and clean API.} spec.homepage = "https://github.com/piotrmurach/pastel" @@ -21,7 +20,7 @@ spec.add_dependency 'equatable', '~> 0.5.0' spec.add_dependency 'tty-color', '~> 0.4.0' - spec.add_development_dependency 'bundler', '>= 1.5.0', '< 2.0' + spec.add_development_dependency 'bundler', '>= 1.5.0' spec.add_development_dependency 'rake' spec.add_development_dependency 'rspec', '~> 3.1' end
Remove bundler dep upper limit
diff --git a/plugin/pivo.rb b/plugin/pivo.rb index abc1234..def5678 100644 --- a/plugin/pivo.rb +++ b/plugin/pivo.rb @@ -16,6 +16,18 @@ puts " [##{story.id}] - {#{story.current_state}} #{story.name} {#{story.owned_by}}" end end + + %w(start finish deliver accept reject).each do |operation| + define_method(operation) do |story_id| + find(story_id).update(current_state: "#{operation}ed") + end + end + + private + + def find(story_id) + @project.stories.find(story_id) + end end pivo = Pivo.new(ARGV[1], ARGV[2])
Define operations available for a story
diff --git a/bin/cuttlefish_smtp_server.rb b/bin/cuttlefish_smtp_server.rb index abc1234..def5678 100644 --- a/bin/cuttlefish_smtp_server.rb +++ b/bin/cuttlefish_smtp_server.rb @@ -1,28 +1,33 @@ #!/usr/bin/env ruby # If you need a bit of debugging output in the threads add -d to the line above - -# For the benefit of foreman -$stdout.sync = true $: << File.join(File.dirname(__FILE__), "..", "lib") require 'cuttlefish_smtp_server' -# Hardcoded to the development environment for the time being -environment = "development" -host = "127.0.0.1" -port = 2525 -number_of_connections = 4 +module CuttlefishControl + def self.smtp_start + # Hardcoded to the development environment for the time being + environment = "development" + host = "127.0.0.1" + port = 2525 + number_of_connections = 4 -activerecord_config = YAML.load(File.read(File.join(File.dirname(__FILE__), '..', 'config', 'database.yml'))) -ActiveRecord::Base.establish_connection(activerecord_config[environment]) + # For the benefit of foreman + $stdout.sync = true -server = CuttlefishSmtpServer.new(port, host, number_of_connections) -server.audit = true -server.start + activerecord_config = YAML.load(File.read(File.join(File.dirname(__FILE__), '..', 'config', 'database.yml'))) + ActiveRecord::Base.establish_connection(activerecord_config[environment]) -puts "My eight arms and two tentacles are quivering in anticipation." -puts "I'm listening for emails via SMTP on #{host} port #{port}" + server = CuttlefishSmtpServer.new(port, host, number_of_connections) + server.audit = true + server.start -server.join + puts "My eight arms and two tentacles are quivering in anticipation." + puts "I'm listening for emails via SMTP on #{host} port #{port}" + server.join + end +end + +CuttlefishControl.smtp_start
Move server start code into module
diff --git a/db/dev_seeds/milestones.rb b/db/dev_seeds/milestones.rb index abc1234..def5678 100644 --- a/db/dev_seeds/milestones.rb +++ b/db/dev_seeds/milestones.rb @@ -22,7 +22,24 @@ end end end + + if rand < 0.8 + record.progress_bars.create!(kind: :primary, percentage: rand(ProgressBar::RANGE)) + end + + rand(0..3).times do + progress_bar = record.progress_bars.build( + kind: :secondary, + percentage: rand(ProgressBar::RANGE) + ) + + random_locales.map do |locale| + Globalize.with_locale(locale) do + progress_bar.title = "Description for locale #{locale}" + progress_bar.save! + end + end + end end end end -
Add progress bars dev seeds
diff --git a/opal/corelib/comparable.rb b/opal/corelib/comparable.rb index abc1234..def5678 100644 --- a/opal/corelib/comparable.rb +++ b/opal/corelib/comparable.rb @@ -11,7 +11,8 @@ return true if equal?(other) return false unless cmp = (self <=> other) - return Comparable.normalize(cmp) == 0 + + return `#{Comparable.normalize(cmp)} == 0` rescue StandardError false end @@ -21,7 +22,7 @@ raise ArgumentError, "comparison of #{self.class} with #{other.class} failed" end - Comparable.normalize(cmp) > 0 + `#{Comparable.normalize(cmp)} > 0` end def >=(other) @@ -29,7 +30,7 @@ raise ArgumentError, "comparison of #{self.class} with #{other.class} failed" end - Comparable.normalize(cmp) >= 0 + `#{Comparable.normalize(cmp)} >= 0` end def <(other) @@ -37,7 +38,7 @@ raise ArgumentError, "comparison of #{self.class} with #{other.class} failed" end - Comparable.normalize(cmp) < 0 + `#{Comparable.normalize(cmp)} < 0` end def <=(other) @@ -45,7 +46,7 @@ raise ArgumentError, "comparison of #{self.class} with #{other.class} failed" end - Comparable.normalize(cmp) <= 0 + `#{Comparable.normalize(cmp)} <= 0` end def between?(min, max)
Fix some possible infinite recursion in Comparable
diff --git a/spec/types_spec.rb b/spec/types_spec.rb index abc1234..def5678 100644 --- a/spec/types_spec.rb +++ b/spec/types_spec.rb @@ -0,0 +1,19 @@+require 'spec_helper' + +module VhdlDoctest + describe Types do + describe ".parse" do + subject { Types.parse(string) } + + describe 'std_logic' do + let(:string) { 'std_logic' } + it { should be_a Types::StdLogic } + end + + describe 'std_logic_vector' do + let(:string) { 'std_logic_vector(8 downto 0)' } + it { should be_a Types::StdLogicVector } + end + end + end +end
Cover current feature of Types.parse with a spec
diff --git a/spidr_test.gemspec b/spidr_test.gemspec index abc1234..def5678 100644 --- a/spidr_test.gemspec +++ b/spidr_test.gemspec @@ -21,7 +21,7 @@ spec.add_dependency 'spidr', '~> 0.4.0' - spec.add_development_dependency 'bundler', '~> 1.8' + spec.add_development_dependency 'bundler', '~> 1.5' spec.add_development_dependency 'rake', '~> 10.0' spec.add_development_dependency 'rspec', '~> 3.2' spec.add_development_dependency 'sinatra', '~> 1.4.6'
Downgrade required bundler to 1.5
diff --git a/lib/oshpark.rb b/lib/oshpark.rb index abc1234..def5678 100644 --- a/lib/oshpark.rb +++ b/lib/oshpark.rb @@ -1,9 +1,9 @@-require "Oshpark/version" -require "Oshpark/Oshpark" -require "Oshpark/client" -require "Oshpark/model" -require "Oshpark/dimensionable" -require "Oshpark/project" +require "oshpark/version" +require "oshpark/oshpark" +require "oshpark/client" +require "oshpark/model" +require "oshpark/dimensionable" +require "oshpark/project" module Oshpark end
Fix accidental renaming of requires.
diff --git a/test/hw2_part2_test.rb b/test/hw2_part2_test.rb index abc1234..def5678 100644 --- a/test/hw2_part2_test.rb +++ b/test/hw2_part2_test.rb @@ -23,4 +23,14 @@ assert_equal 0, CartesianProduct.new([:a,:b], []).count end + def test_cartesian_product_of_ranges + expected_result = [[2,3],[2,4],[2,5],[2,6], + [3,3],[3,4],[3,5],[3,6], + [4,3],[4,4],[4,5],[4,6]] + product = CartesianProduct.new((2..4), (3..6)) + + assert_equal expected_result.count, product.count + assert expected_result.all? { |elt| product.include? elt } + end + end
Test with Enumerables that aren't an Array
diff --git a/test/ruby_area_test.rb b/test/ruby_area_test.rb index abc1234..def5678 100644 --- a/test/ruby_area_test.rb +++ b/test/ruby_area_test.rb @@ -4,4 +4,12 @@ test "truth" do assert_kind_of Module, RubyArea end + + def test_to_area_extracts_acres_in_number + assert_equal 180.acre, 1 + end + + def test_to_area_extract_perch_in_number + assert_equal 180.perch, 20 + end end
Test to check perch and acre extraction
diff --git a/fraudrecord.gemspec b/fraudrecord.gemspec index abc1234..def5678 100644 --- a/fraudrecord.gemspec +++ b/fraudrecord.gemspec @@ -13,7 +13,7 @@ gem.required_ruby_version = '> 2.0.0' # Runtime Dependencies - gem.add_runtime_dependency 'faraday', '~> 0.9.0' + gem.add_runtime_dependency 'faraday', '~> 0.9', '>= 0.9.0' # Development Dependencies gem.add_development_dependency 'vcr', '~> 2.8.0'
Remove patch version from faraday dep
diff --git a/gds_zendesk.gemspec b/gds_zendesk.gemspec index abc1234..def5678 100644 --- a/gds_zendesk.gemspec +++ b/gds_zendesk.gemspec @@ -22,5 +22,5 @@ gem.add_development_dependency "rake", "~> 10" gem.add_development_dependency "rspec", "~> 3" gem.add_development_dependency "rubocop-govuk", "~> 3" - gem.add_development_dependency "webmock", "~> 2" + gem.add_development_dependency "webmock", ">= 2" end
Use newer version of WebMock
diff --git a/faraday_middleware.gemspec b/faraday_middleware.gemspec index abc1234..def5678 100644 --- a/faraday_middleware.gemspec +++ b/faraday_middleware.gemspec @@ -4,17 +4,16 @@ require 'faraday_middleware/version' Gem::Specification.new do |spec| - spec.add_dependency 'faraday', ['>= 0.7.4', '< 0.10'] - spec.add_development_dependency 'bundler', '~> 1.0' + spec.name = 'faraday_middleware' + spec.version = FaradayMiddleware::VERSION + + spec.summary = %q{Various middleware for Faraday} spec.authors = ["Erik Michaels-Ober", "Wynn Netherland"] - spec.description = %q{Various middleware for Faraday} spec.email = ['sferik@gmail.com', 'wynn.netherland@gmail.com'] - spec.files = %w(CHANGELOG.md CONTRIBUTING.md LICENSE.md README.md faraday_middleware.gemspec) + Dir['lib/**/*.rb'] spec.homepage = 'https://github.com/lostisland/faraday_middleware' spec.licenses = ['MIT'] - spec.name = 'faraday_middleware' - spec.require_paths = ['lib'] - spec.required_rubygems_version = '>= 1.3.5' - spec.summary = spec.description - spec.version = FaradayMiddleware::VERSION + + spec.add_dependency 'faraday', ['>= 0.7.4', '< 0.10'] + + spec.files = `git ls-files -z lib LICENSE.md README.md`.split("\0") end
Reorganize gemspec to be much like faraday's
diff --git a/config/deploy/staging.rb b/config/deploy/staging.rb index abc1234..def5678 100644 --- a/config/deploy/staging.rb +++ b/config/deploy/staging.rb @@ -11,7 +11,7 @@ role :db, %w{deploy@198.199.86.239} set :ssh_options, {:forward_agent => true} -set :linked_files, %w{.env config/database.yml} +set :linked_files, %w{.env config/database.yml config/secrets.yml} set :bower_bin, '/usr/local/nvm/versions/node/v4.3.1/bin/bower'
Add secrets to linked deploy files
diff --git a/shield.gemspec b/shield.gemspec index abc1234..def5678 100644 --- a/shield.gemspec +++ b/shield.gemspec @@ -23,4 +23,5 @@ s.add_dependency "armor" s.add_development_dependency "cutest" s.add_development_dependency "rack-test" + s.add_development_dependency "cuba" end
Add cuba as a development dependency.
diff --git a/jurisdiction.gemspec b/jurisdiction.gemspec index abc1234..def5678 100644 --- a/jurisdiction.gemspec +++ b/jurisdiction.gemspec @@ -23,5 +23,5 @@ spec.add_development_dependency "minitest" spec.add_development_dependency "guard-minitest" - spec.add_dependency "capybara", ">= 2" + spec.add_dependency "capybara" end
Allow consuming project to define capybara version
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 @@ -3,7 +3,7 @@ require 'maildir' # Require all the serializers -serializers = File.join(".", File.dirname(__FILE__), "..","lib","maildir","serializer","*.rb") +serializers = File.expand_path('../../lib/maildir/serializer/*.rb', __FILE__) Dir.glob(serializers).each do |serializer| require serializer end
Fix requiring of all serializers
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 @@ -11,8 +11,8 @@ require 'capybara-screenshot/testunit' # for integration test require 'webmock/test_unit' -WebMock.disable_net_connect!(allow_localhost: true) - +WebMock.disable_net_connect!(allow_localhost: true, + allow: "chromedriver.storage.googleapis.com") module FixturePath def fixture_path(fixture_name)
Allow accessing "chromedriver.storage.googleapis.com" to check chromedriver version Signed-off-by: Kenji Okimoto <7a4b90a0a1e6fc688adec907898b6822ce215e6c@clear-code.com>
diff --git a/thirteenth_age.gemspec b/thirteenth_age.gemspec index abc1234..def5678 100644 --- a/thirteenth_age.gemspec +++ b/thirteenth_age.gemspec @@ -20,6 +20,6 @@ spec.add_development_dependency "bundler", "~> 1.7" spec.add_development_dependency "rake", "~> 10.0" - spec.add_development_dependency "rspec" - spec.add_development_dependency "pry" + spec.add_development_dependency "rspec", "~> 3.1" + spec.add_development_dependency "pry", "~> 0.10" end
Add version constraints to gemspec
diff --git a/plugin.rb b/plugin.rb index abc1234..def5678 100644 --- a/plugin.rb +++ b/plugin.rb @@ -1,2 +1,7 @@+# name: discourse-twittercommunity +# about: Customizations for twittercommunity.com +# version: 0.1 +# authors: Neil Lalonde + register_asset "javascripts/discourse/templates/connectors/poster-avatar-bottom/under-avatar.js.handlebars" register_asset "stylesheets/twittercommunity.scss"
Add metadata so it loads in admin
diff --git a/spec/helper.rb b/spec/helper.rb index abc1234..def5678 100644 --- a/spec/helper.rb +++ b/spec/helper.rb @@ -47,6 +47,7 @@ config.include(IdentityMapMatcher) config.before(:each) do + Toy.identity_map.clear [FileStore, MongoStore, RedisStore].each(&:clear) end end
Clear identity map before each spec.
diff --git a/spec/models.rb b/spec/models.rb index abc1234..def5678 100644 --- a/spec/models.rb +++ b/spec/models.rb @@ -30,6 +30,9 @@ acts_as_tagger end +class InheritingTaggableUser < TaggableUser +end + class UntaggableModel < ActiveRecord::Base belongs_to :taggable_model end
Add inheriting user model to specs
diff --git a/lib/bummr/updater.rb b/lib/bummr/updater.rb index abc1234..def5678 100644 --- a/lib/bummr/updater.rb +++ b/lib/bummr/updater.rb @@ -1,5 +1,7 @@ module Bummr class Updater + include Log + def initialize(outdated_gems) @outdated_gems = outdated_gems end
FIX invalid log command on update command When running bummr update it crashes when trying to create a log.
diff --git a/lib/dears3/cli/s3.rb b/lib/dears3/cli/s3.rb index abc1234..def5678 100644 --- a/lib/dears3/cli/s3.rb +++ b/lib/dears3/cli/s3.rb @@ -20,7 +20,7 @@ s3_upload.remove_website : s3_upload.configure_website end - desc "auth", "Save auth credentials in home directory" + desc "auth", "Save AWS credentials in home directory" def auth s3_auth = DearS3::Auth.new s3_auth.authenticate
Make auth task description more precise
diff --git a/lib/filmbuff/imdb.rb b/lib/filmbuff/imdb.rb index abc1234..def5678 100644 --- a/lib/filmbuff/imdb.rb +++ b/lib/filmbuff/imdb.rb @@ -25,7 +25,8 @@ results = self.class.get('/find', :query => { :q => title, :locale => @locale }).parsed_response - find_by_id(results["data"]["results"][0]["list"][0]["tconst"]) + + find_by_id(results['title_popular'][0]['id']) end end end
Use single quotes and add a newline for readability
diff --git a/lib/swoop/project.rb b/lib/swoop/project.rb index abc1234..def5678 100644 --- a/lib/swoop/project.rb +++ b/lib/swoop/project.rb @@ -39,6 +39,7 @@ def valid_file? (f) return false unless f.is_a?(Xcodeproj::Project::Object::PBXFileReference) + return false unless File.exist?(f.real_path) ext = File.extname(f.real_path) valid_file_extensions.include?(ext)
Check if file in proj's filepaths exist
diff --git a/lib/tasks/check.rake b/lib/tasks/check.rake index abc1234..def5678 100644 --- a/lib/tasks/check.rake +++ b/lib/tasks/check.rake @@ -9,6 +9,6 @@ config = Bruce::Config.new result = aussieDetector.how_australian? config.save(result) # Save into config/bruce_output.yml - puts result + puts "\n\n#{result}% Proudly Australian\n\n" end end
Change the output of rake
diff --git a/Casks/clean-my-mac.rb b/Casks/clean-my-mac.rb index abc1234..def5678 100644 --- a/Casks/clean-my-mac.rb +++ b/Casks/clean-my-mac.rb @@ -3,4 +3,5 @@ homepage 'http://macpaw.com/cleanmymac' version '2.0.3' sha1 '3bd47a6c1849f42389daa92309e24b395d6eb1f2' + link 'CleanMyMac 2.app' end
Add link to CleanMyMac 2
diff --git a/Casks/pg-commander.rb b/Casks/pg-commander.rb index abc1234..def5678 100644 --- a/Casks/pg-commander.rb +++ b/Casks/pg-commander.rb @@ -1,6 +1,6 @@ class PgCommander < Cask - version '1.5.1' - sha256 '082dc5b5c08e0df543424e86eef76d9aae121f7d64adf458d327542b30cd1185' + version '1.5.2' + sha256 'a7e848ad20f38cc6f9c9fd6ebccb62390fe7c050aaae5b3670c40f94019757ee' url "https://eggerapps.at/pgcommander/download/pgcommander-#{version}.zip" homepage 'http://eggerapps.at/pgcommander/'
Update PG Commander to 1.5.2 Lowecase sha256
diff --git a/tasks/testng_patch.rake b/tasks/testng_patch.rake index abc1234..def5678 100644 --- a/tasks/testng_patch.rake +++ b/tasks/testng_patch.rake @@ -0,0 +1,46 @@+raise "Patch applied upstream " if Buildr::VERSION.to_s > '1.5.8' + +class Buildr::TestNG < TestFramework::Java + + def run(tests, dependencies) #:nodoc: + cmd_args = [] + cmd_args << '-suitename' << task.project.id + cmd_args << '-sourcedir' << task.compile.sources.join(';') if TestNG.version < '6.0' + cmd_args << '-log' << '2' + cmd_args << '-d' << task.report_to.to_s + exclude_args = options[:excludegroups] || [] + unless exclude_args.empty? + cmd_args << '-excludegroups' << exclude_args.join(',') + end + groups_args = options[:groups] || [] + unless groups_args.empty? + cmd_args << '-groups' << groups_args.join(',') + end + # run all tests in the same suite + cmd_args << '-testclass' << (TestNG.version < '6.0' ? test : tests.join(',')) + + cmd_args += options[:args] if options[:args] + cmd_options = { :properties => options[:properties], :java_args => options[:java_args], + :classpath => dependencies, :name => "TestNG in #{task.send(:project).name}" } + + tmp = nil + begin + tmp = Tempfile.open('testNG') + tmp.write cmd_args.join("\n") + tmp.close + Java::Commands.java ['org.testng.TestNG', "@#{tmp.path}"], cmd_options + ensure + tmp.close unless tmp.nil? + end + # testng-failed.xml contains the list of failed tests *only* + failed_tests = File.join(task.report_to.to_s, 'testng-failed.xml') + if File.exist?(failed_tests) + report = File.read(failed_tests) + failed = report.scan(/<class name="(.*?)">/im).flatten + # return the list of passed tests + return tests - failed + else + return tests + end + end +end
Patch the TestNG addon to ensure that test failures result in a failed build.
diff --git a/lib/aweplug/helpers/cdn.rb b/lib/aweplug/helpers/cdn.rb index abc1234..def5678 100644 --- a/lib/aweplug/helpers/cdn.rb +++ b/lib/aweplug/helpers/cdn.rb @@ -0,0 +1,38 @@+require 'digest' +require 'yaml' + +module Aweplug + module Helpers + # CDN will take the details of a file passed to the version method + # If necessary, if the file has changed since the last time version + # was called for that method, it will generate a copy of the file in + # _tmp/cdn with new file name, and return that file name + class CDN + + CDN_TMP_DIR = Pathname.new("_tmp").join("cdn") + CDN_CONTROL = Pathname.new("_cdn").join("cdn.yml") + + def initialize(ctx_path) + @tmp_dir = CDN_TMP_DIR.join ctx_path + FileUtils.mkdir_p(File.dirname(CDN_CONTROL)) + FileUtils.mkdir_p(@tmp_dir) + end + + def version(name, ext, content) + id = name + ext + yml = YAML::Store.new CDN_CONTROL + yml.transaction do + yml[id] ||= { "build_no" => 0 } + md5sum = Digest::MD5.hexdigest(content) + if yml[id]["md5sum"] != md5sum + yml[id]["md5sum"] = md5sum + yml[id]["build_no"] += 1 + File.open(@tmp_dir.join(name + "-" + yml[id]["build_no"].to_s + ext), 'w') { |file| file.write(content) } + end + name + "-" + yml[id]["build_no"].to_s + ext + end + end + + end + end +end
Support for versioned resources on a CDN
diff --git a/lib/celluloid/responses.rb b/lib/celluloid/responses.rb index abc1234..def5678 100644 --- a/lib/celluloid/responses.rb +++ b/lib/celluloid/responses.rb @@ -1,10 +1,10 @@ module Celluloid # Responses to calls class Response - attr_reader :value + attr_reader :call, :value def initialize(call, value) - @value = value + @call, @value = call, value end end
Store calls in response objects
diff --git a/lib/discordrb/events/id.rb b/lib/discordrb/events/id.rb index abc1234..def5678 100644 --- a/lib/discordrb/events/id.rb +++ b/lib/discordrb/events/id.rb @@ -0,0 +1,24 @@+module Discordrb::Events + # An event only associated with an ID and no further information. + class IDEvent + # @return [Integer] the ID associated with this event + attr_reader :id + + # @!visibility private + def initialize(id) + @id = id + end + end + + # Event handler for {IDEvent} + class IDEventHandler + def matches?(event) + # Check for the proper event type + return false unless event.is_a? IDEvent + + matches_all(@attributes[:id], event.id) do |a, e| + a.resolve_id == e.resolve_id + end + end + end +end
Make a generic IDEvent that only contains an ID
diff --git a/lib/puppet-parse/parser.rb b/lib/puppet-parse/parser.rb index abc1234..def5678 100644 --- a/lib/puppet-parse/parser.rb +++ b/lib/puppet-parse/parser.rb @@ -5,7 +5,11 @@ # Read file and return parsed object pparser = Puppet::Parser::Parser.new('production') if File.exists?(file) - @object = pparser.import(file) + @file = File.expand_path(file) + pparser.import(@file) + pparser.environment.known_resource_types.hostclasses.each do |x| + @object = x.last if x.last.file == @file + end else 'File does not exist' end @@ -20,15 +24,15 @@ # Read class from parsed object, returns string containing class def klass - @object.last.name if (defined? @object.class.name) + @object.name if (defined? @object.class.name) end # Read RDOC contents from parsed object, returns hash of paragraph headings # and the following paragraph contents #(i.e. parameter and parameter documentation) def docs - if !@object.last.doc.nil? - rdoc = RDoc::Markup.parse(@object.last.doc) + if !@object.doc.nil? + rdoc = RDoc::Markup.parse(@object.doc) docs = {} rdoc.parts.each do |part|
Return resource type object from Puppet::Parser::Parser.environment.known_resource_types instead of relying on result of import
diff --git a/json_resume.gemspec b/json_resume.gemspec index abc1234..def5678 100644 --- a/json_resume.gemspec +++ b/json_resume.gemspec @@ -8,8 +8,8 @@ spec.version = JsonResume::VERSION spec.authors = ["Prateek Agarwal"] spec.email = ["prat0318@gmail.com"] - spec.description = %q{TODO: Write a gem description} - spec.summary = %q{TODO: Write a gem summary} + spec.description = %q{json_resume creates pretty resume formats from a .json input file. Currently, it can cpnvert to html, tex, markdown and pdf. Customizing the template to your own need is super easy. You just need to change the mustache files for any of these formats.} + spec.summary = %q{Generates pretty resume formats out of json input file} spec.homepage = "" spec.license = "MIT" @@ -20,4 +20,5 @@ spec.add_development_dependency "bundler", "~> 1.3" spec.add_development_dependency "rake" + spec.add_runtime_dependency "pdfkit" end
Add description and summary to gem
diff --git a/spec/evaluator/performance_spec.rb b/spec/evaluator/performance_spec.rb index abc1234..def5678 100644 --- a/spec/evaluator/performance_spec.rb +++ b/spec/evaluator/performance_spec.rb @@ -2,15 +2,20 @@ describe Calvin::Evaluator do describe "performance" do + Zillion = 10**42 # Basically, these tests won't terminate if things aren't optimized :) it "should optimize folding on ranges" do - n = 1_000_000_000 - eval1("+\\1..#{n}").should eq (n * (n + 1) / 2) - eval1("+\\_#{n}..#{n}").should eq 0 - eval1("+\\_#{n}..#{n+1}").should eq n + 1 + eval1("+\\1..#{Zillion}").should eq (Zillion * (Zillion + 1) / 2) + eval1("+\\_#{Zillion}..#{Zillion}").should eq 0 + eval1("+\\_#{Zillion}..#{Zillion+1}").should eq Zillion + 1 step = 4 - eval1("+\\1.#{step + 1}..#{n}").should eq eval1("+\\1..#{n}") / 4 - (n / 4) - (n / 8) + eval1("+\\1.#{step + 1}..#{Zillion}").should eq eval1("+\\1..#{Zillion}") / 4 - (Zillion / 4) - (Zillion / 8) + end + + it "should optimize take on ranges" do + eval1("10>:..#{Zillion}").should eq [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + eval1("4>:_100..#{Zillion}").should eq [-100, -99, -98, -97] end end end
Add performance specs for take(`>:`) on ranges.
diff --git a/spec/features/landing_page_spec.rb b/spec/features/landing_page_spec.rb index abc1234..def5678 100644 --- a/spec/features/landing_page_spec.rb +++ b/spec/features/landing_page_spec.rb @@ -1,8 +1,15 @@ require 'spec_helper' describe 'Landing page' do + let!(:zomboland) { create(:location, name: 'Zomboland') } + it 'shows the title of the page' do visit root_path page.should have_content 'To learn more about' end + + it 'loads the map markers from json' do + visit '/locations.json' + page.should have_text zomboland.lat + end end
Make sure that we generate JSON for the landing page map.
diff --git a/routes/main.rb b/routes/main.rb index abc1234..def5678 100644 --- a/routes/main.rb +++ b/routes/main.rb @@ -4,6 +4,17 @@ class App < Sinatra::Base register Sinatra::Namespace include ADB + + not_found do + if request.accept?('text/html') + return 'Not Found' + elsif request.accept?('application/json') + content_type :json + return {'error' => 'Not Found'}.to_json + else + return 'Not Found' + end + end namespace '/api' do post '/adb/action/restart/?' do
Add 404 response for json & html
diff --git a/omnibus_overrides.rb b/omnibus_overrides.rb index abc1234..def5678 100644 --- a/omnibus_overrides.rb +++ b/omnibus_overrides.rb @@ -3,7 +3,7 @@ # # NOTE: You MUST update omnibus-software when adding new versions of # software here: bundle exec rake dependencies:update_omnibus_gemfile_lock -override "libarchive", version: "3.5.0" +override "libarchive", version: "3.5.1" override "libffi", version: "3.3" override "libiconv", version: "1.16" override "liblzma", version: "5.2.5" @@ -14,7 +14,7 @@ override "makedepend", version: "1.0.5" override "ncurses", version: "5.9" override "nokogiri", version: "1.11.0" -override "openssl", version: mac_os_x? ? "1.1.1i" : "1.0.2y" +override "openssl", version: mac_os_x? ? "1.1.1j" : "1.0.2y" override "pkg-config-lite", version: "0.28-1" override "ruby", version: "2.7.2" override "ruby-windows-devkit-bash", version: "3.1.23-4-msys-1.0.18"
Update openssl to 1.1.1j and libarchive to 3.5.1 Update to the match the chef-16 branch Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/lib/filterable_sortable.rb b/lib/filterable_sortable.rb index abc1234..def5678 100644 --- a/lib/filterable_sortable.rb +++ b/lib/filterable_sortable.rb @@ -15,11 +15,14 @@ } scope :search, lambda { |term| - conditions = Array.new(self.attribute_names).delete_if{|i| i.in? ["created_at", "updated_at"] }.collect{|f| "#{f} like '%#{term}%'"}.join(' OR ') + conditions = Array.new(self.attribute_names).delete_if{|i| i.in? ["created_at", "updated_at"] }.collect{|f| "#{self.table_name}.#{f} like '%#{term}%'"}.join(' OR ') where(conditions) } - scope :ordered, lambda { |ordered| order("#{ordered[:field]} #{ordered[:direction]}") if ordered } + scope :ordered, lambda { |ordered| + ordered[:field] = "#{self.table_name}.#{ordered[:field]}" if ordered[:field].split('.') == 1 + order("#{ordered[:field]} #{ordered[:direction]}") if ordered + } end end
Add table name, actual if using includes(:connected_table)
diff --git a/lib/lita/adapters/slack.rb b/lib/lita/adapters/slack.rb index abc1234..def5678 100644 --- a/lib/lita/adapters/slack.rb +++ b/lib/lita/adapters/slack.rb @@ -33,7 +33,7 @@ attr_reader :rtm_connection def channel_for(target) - if target.private_message? + if target.private_message? and not target.user.id.empty? rtm_connection.im_for(target.user.id) else target.room
Fix user not found bug
diff --git a/lib/mutant/mutator/call.rb b/lib/mutant/mutator/call.rb index abc1234..def5678 100644 --- a/lib/mutant/mutator/call.rb +++ b/lib/mutant/mutator/call.rb @@ -42,11 +42,11 @@ end def emit_explicit_self_receiver - mutatee = dup_node - mutatee.privately = false + mutant = dup_node + mutant.privately = false # TODO: Fix rubinius to allow this as an attr_accessor - mutatee.instance_variable_set(:@vcall_style,false) - emit_safe(mutatee) + mutant.instance_variable_set(:@vcall_style,false) + emit_safe(mutant) end # Emit mutations
Use better variable name for mutant
diff --git a/lib/paysafe/rest/client.rb b/lib/paysafe/rest/client.rb index abc1234..def5678 100644 --- a/lib/paysafe/rest/client.rb +++ b/lib/paysafe/rest/client.rb @@ -10,7 +10,7 @@ # @param options [Hash] # @return [Paysafe::REST::Client] def initialize(**options) - @config = Configuration.new(options) + @config = Configuration.new(**options) end # @return [Hash]
Fix Ruby 2.7 keyword argument warning
diff --git a/tools/generate_class.rb b/tools/generate_class.rb index abc1234..def5678 100644 --- a/tools/generate_class.rb +++ b/tools/generate_class.rb @@ -0,0 +1,74 @@+require 'sqlite3' +require 'awesome_print' + +class String + def underscore + word = self.dup + word.gsub!(/::/, '/') + word.gsub!(/([A-Z]+)([A-Z][a-z])/,'\1_\2') + word.gsub!(/([a-z\d])([A-Z])/,'\1_\2') + word.tr!("-", "_") + word.downcase! + word + end +end + +db = SQLite3::Database.new('/Users/maxmouchet/max.lrcat') + +tables = {} + +db.execute("SELECT name FROM sqlite_master WHERE type='table'") do |table_name| + table_columns = [] + db.execute("PRAGMA table_info(#{ table_name[0] })") do |column_info| + table_columns << { + name: column_info[1], + type: column_info[2], + null: column_info[3], + default: column_info[4], + primary_key?: column_info[5] + } + end + tables[table_name[0]] = table_columns +end + + +def gen_file(table_name, table_columns) + output = "" + + puts "Table name: #{ table_name }" + print "Class name: " + class_name = gets.strip + + return 0 if (class_name.strip == "") + + filename = class_name.underscore + ".rb" + puts "Filename will be: #{ filename }" + + primary_key = 'id_local' + # table_columns.each do |table_column| + # if table_column[:primary_key?] + # primary_key = table_column[:name] + # end + # end + + output += "module Lrcat\n" + output += " module Catalog\n\n" + output += " # #{ class_name } links to the #{ table_name } table.\n" + output += " #\n" + output += " # The following columns are available in Lightroom 5:\n" + table_columns.each do |table_column| + output += " # - #{ table_column[:name] }\n" + end + output += " class #{ class_name } < ActiveRecord::Base\n" + output += " self.table_name = '#{ table_name }'\n" + output += " self.primary_key = '#{ primary_key }'\n" + output += " end\n\n" + output += " end\n" + output += "end\n" + + File.open("tmp/#{ filename }", "w") { |file| file.puts(output) } +end + +tables.each do |k,v| + gen_file(k, v) +end
Add script to generate class stubs
diff --git a/lib/tasks/gem/bump_task.rb b/lib/tasks/gem/bump_task.rb index abc1234..def5678 100644 --- a/lib/tasks/gem/bump_task.rb +++ b/lib/tasks/gem/bump_task.rb @@ -24,7 +24,7 @@ protected def git - @git ||= Git.clone ENV['PWD'] + @git ||= Git.new ENV['PWD'] end def file(mode = 'r')
Use Git.new instead of Git.clone
diff --git a/lib/obj/mesh.rb b/lib/obj/mesh.rb index abc1234..def5678 100644 --- a/lib/obj/mesh.rb +++ b/lib/obj/mesh.rb @@ -1,5 +1,9 @@ module OBJ class Mesh + def self.load(file_path) + Mesh.new(file_path) + end + attr_accessor :vertices, :normals, :text_coords, :faces def initialize(file_path) @@ -8,22 +12,7 @@ @text_coords = [] @faces = [] - File.open(file_path, 'r') do |f| - f.each_line do |line| - case line.split.first - when 'v' - @vertices << 0.0 - when 'vt' - @text_coords << 0.0 - when 'vn' - @normals << 0.0 - when 'f' - @faces << 0.0 - when 'mtllib' - # fail ArgumentError, 'invalid file (mtllib not supported)' - end - end - end + initialize_from_file(file_path) end def normals? @@ -38,5 +27,27 @@ "<#{self.class} vertices: #{@vertices.size} normals: #{@normals.size}" \ " text_coords: #{@text_coords.size} faces: #{@faces.size}>" end + + private + + def initialize_from_file file_path + File.open(file_path, 'r') do |f| + f.each_line do |line| + type, *data = line.split + case type + when 'v' + @vertices << data.map {|d| d.to_f} + when 'vt' + @text_coords << data.map {|d| d.to_f} + when 'vn' + @normals << data.map {|d| d.to_f} + when 'f' + @faces << data.map {|v| v.split('/').map {|attr| attr.to_i}} + when 'mtllib' + # TODO: not implemented + end + end + end + end end end
Implement basic parsing of actual OBJ data - Before, the vertices, normals, and faces arrays contained dummy data (although its sizes were correct) - Now they contain (correct?) data (tests pending)
diff --git a/models.rb b/models.rb index abc1234..def5678 100644 --- a/models.rb +++ b/models.rb @@ -1,10 +1,10 @@ # MIGRATIONS -if !File.exists?("db/#{CONFIG[database]}.db") +if !File.exists?("#{CONFIG['database']}") # IF YOU DO CHANGES HERE, DELETE THE FILE 'db/pomospace.db' - DB = Sequel.connect("sqlite://#{CONFIG[database]}") + DB = Sequel.connect("sqlite://#{CONFIG['database']}") DB.create_table :users do primary_key :id @@ -30,7 +30,7 @@ just_created = true else - Sequel.connect("sqlite://CONFIG[database]") + Sequel.connect("sqlite://#{CONFIG['database']}") end
Fix syntax error when calling CONFIG
diff --git a/plugins/fileperms.rb b/plugins/fileperms.rb index abc1234..def5678 100644 --- a/plugins/fileperms.rb +++ b/plugins/fileperms.rb @@ -28,7 +28,8 @@ '/etc/ssh/sshd_config', '/etc/gshadow', '/etc/group', - '/etc/login.defs' + '/etc/login.defs', + '/var/run/php-fpm.sock' ] permissions Mash.new file.each do |filename|
Add PHP-FPM file to permissions check, per support
diff --git a/wptemplates.gemspec b/wptemplates.gemspec index abc1234..def5678 100644 --- a/wptemplates.gemspec +++ b/wptemplates.gemspec @@ -21,5 +21,6 @@ spec.add_development_dependency "bundler", "~> 1.3" spec.add_development_dependency "rake" spec.add_development_dependency "rspec" + spec.add_development_dependency "rdoc" end
Add rdoc to development dependencies
diff --git a/lib/facter/pkgng.rb b/lib/facter/pkgng.rb index abc1234..def5678 100644 --- a/lib/facter/pkgng.rb +++ b/lib/facter/pkgng.rb @@ -26,7 +26,7 @@ confine :kernel => "FreeBSD" setcode do - if Facter.pkgng_enabled + if Facter.value('pkgng_enabled') == "true" Facter::Util::Resolution.exec("pkg query %v pkg 2>/dev/null") end end
Fix method call for Facter v2 Facter 2 doesn't seem to support methods for fact values. This code moves to use a supported method that can be used to retrieve fact values from the loaded facts.
diff --git a/lib/tasks/lint.rake b/lib/tasks/lint.rake index abc1234..def5678 100644 --- a/lib/tasks/lint.rake +++ b/lib/tasks/lint.rake @@ -1,4 +1,4 @@ desc "Run govuk-lint with similar params to CI" -task "lint" do +task lint: :environment do sh "bundle exec rubocop" end
Set :environment task as a dependency to all rake task
diff --git a/Formula/memcache-php.rb b/Formula/memcache-php.rb index abc1234..def5678 100644 --- a/Formula/memcache-php.rb +++ b/Formula/memcache-php.rb @@ -0,0 +1,24 @@+require 'formula' + +class MemcachePhp <Formula + url 'http://pecl.php.net/get/memcache-2.2.6.tgz' + homepage 'http://pecl.php.net/package/memcache' + md5 '9542f1886b72ffbcb039a5c21796fe8a' + + def install + Dir.chdir "memcache-#{version}" do + system "phpize" + system "./configure", "--prefix=#{prefix}" + system "make" + prefix.install 'modules/memcache.so' + end + end + + def caveats; <<-EOS.undent + To finish installing memcache: + * Add the following line to php.ini: + extension="#{prefix}/memcache.so" + * Restart your webserver + EOS + end +end
Add formula for memcache PHP extension Signed-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>
diff --git a/spec/assets/assets_spec.rb b/spec/assets/assets_spec.rb index abc1234..def5678 100644 --- a/spec/assets/assets_spec.rb +++ b/spec/assets/assets_spec.rb @@ -3,18 +3,22 @@ describe 'Assets' do subject(:asset) { page.body } - describe 'Static' do - it 'provides the crown header' do - visit '/assets/header-crown.png' - asset.should_not be_empty - end + it 'serves images, eg the crown header' do + visit '/assets/header-crown.png' + asset.should_not be_empty end - describe 'Compiled JS' do - it 'includes library code' do + describe 'Compiling javascript' do + it 'compiles library code' do visit '/assets/govuk_admin_template.js' expect(asset).to include('Bootstrap') expect(asset).to include('jQuery') end + + it 'compiles IE shims' do + visit '/assets/lte-ie8.js' + expect(asset).to include('respond') + expect(asset).to include('html5') + end end end
Add asset test for IE shims
diff --git a/spec/lib/drb_queue_spec.rb b/spec/lib/drb_queue_spec.rb index abc1234..def5678 100644 --- a/spec/lib/drb_queue_spec.rb +++ b/spec/lib/drb_queue_spec.rb @@ -26,8 +26,8 @@ end class SetKeyToValueWorker - def self.perform(key, value) - sleep 0.1 + def self.perform(key, value, sleep_before_working = false) + sleep 0.1 if sleep_before_working Redis.current.set(key, value) end end @@ -37,8 +37,15 @@ let(:value) { 'bar' } it 'should do work asynchronously' do - id = DrbQueue.enqueue(SetKeyToValueWorker, key, value) + DrbQueue.enqueue(SetKeyToValueWorker, key, value, :sleep_before_working) expect(Redis.current.get(key)).to be_nil + sleep 0.2 + expect(Redis.current.get(key)).to eq(value) + end + + it 'should do work in order' do + DrbQueue.enqueue(SetKeyToValueWorker, key, 'nottherightanswer') + DrbQueue.enqueue(SetKeyToValueWorker, key, value) sleep 0.2 expect(Redis.current.get(key)).to eq(value) end
Make sure we do work in order
diff --git a/Lasagna-Cookies.podspec b/Lasagna-Cookies.podspec index abc1234..def5678 100644 --- a/Lasagna-Cookies.podspec +++ b/Lasagna-Cookies.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "Lasagna-Cookies" s.version = "1.0.0" - s.summary = "Lasagna Cookies is a UI theme for iOS that provide multiple view object " + s.summary = "Lasagna Cookies is a UI theme for iOS that provide multiple view object." s.homepage = "https://github.com/kbessiere/Lasagna-Cookies" s.screenshots = "https://a248.e.akamai.net/camo.github.com/2c2a1ef5202365d376ace3d003c9b293894d0cd2/687474703a2f2f692e696d6775722e636f6d2f4e4756546770706c2e706e67" s.license = 'BSD'
Modify cocoas pods config file
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 @@ -1,6 +1,4 @@ class ClustersFinder - attr_reader :project, :user, :scope - def initialize(project, user, scope) @project = project @user = user @@ -14,8 +12,10 @@ private + attr_reader :project, :user, :scope + def filter_by_scope(clusters) - case @scope.to_sym + case scope.to_sym when :all clusters when :inactive @@ -23,7 +23,7 @@ when :active clusters.enabled else - raise "Invalid scope #{@scope}" + raise "Invalid scope #{scope}" end end end
Use attr_reader instead of instance variables
diff --git a/spec/evaluator_spec.rb b/spec/evaluator_spec.rb index abc1234..def5678 100644 --- a/spec/evaluator_spec.rb +++ b/spec/evaluator_spec.rb @@ -14,4 +14,10 @@ Dest::Evaluator.new(doctest).evaluate.first.should == false end + + it "should raise an error if a non contextd class is referenced" do + doctest = [7, "SomeClass.new(\"Aaron\").say_hello", "\"Hello DifferName\""] + + expect { Dest::Evaluator.new(doctest).evaluate }.to raise_error + end end
Add test for exceptions in Evaluator
diff --git a/KMSWebRTCCall.podspec b/KMSWebRTCCall.podspec index abc1234..def5678 100644 --- a/KMSWebRTCCall.podspec +++ b/KMSWebRTCCall.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "KMSWebRTCCall" - s.version = "1.0.2" + s.version = "1.0.3" s.summary = "Kurento Media Server iOS Web RTC Call." s.homepage = "https://github.com/sdkdimon/kms-ios-webrtc-call" s.license = { :type => 'MIT', :file => 'LICENSE' } @@ -11,9 +11,9 @@ s.requires_arc = true s.module_name = 'KMSWebRTCCall' s.source_files = 'KMSWebRTCCall/*.{h,m}' - s.dependency 'KMSClient', '1.0.4' + s.dependency 'KMSClient', '1.0.5' s.dependency 'ReactiveCocoa', '2.5' - s.dependency 'libjingle_peerconnection' + s.dependency 'libjingle_peerconnection', '9814.2.0' end
Update pod spec to v1.0.3
diff --git a/spec/classes/fpm/php_fpm_5_3_27_spec.rb b/spec/classes/fpm/php_fpm_5_3_27_spec.rb index abc1234..def5678 100644 --- a/spec/classes/fpm/php_fpm_5_3_27_spec.rb +++ b/spec/classes/fpm/php_fpm_5_3_27_spec.rb @@ -0,0 +1,9 @@+require 'spec_helper' + +describe "php::fpm::5_3_27" do + let(:facts) { default_test_facts } + + it do + should contain_php__fpm("5.3.27") + end +end
Add missing 5.3.27 fpm spec
diff --git a/MagicalRecord.podspec b/MagicalRecord.podspec index abc1234..def5678 100644 --- a/MagicalRecord.podspec +++ b/MagicalRecord.podspec @@ -5,7 +5,7 @@ s.summary = 'Super Awesome Easy Fetching for Core Data 1!!!11!!!!1!.' s.homepage = 'http://github.com/magicalpanda/MagicalRecord' s.author = { 'Saul Mora' => 'saul@magicalpanda.com' } - s.source = { :git => 'https://github.com/magicalpanda/MagicalRecord.git',:branch=>'develop', :tag => '2.1.0' } + s.source = { :git => 'https://github.com/magicalpanda/MagicalRecord.git',:branch=>'develop', :tag => '2.1' } s.description = 'Handy fetching, threading and data import helpers to make Core Data a little easier to use.' s.source_files = 'MagicalRecord/**/*.{h,m}' s.framework = 'CoreData'
Make podspec reference tag '2.1'
diff --git a/myjohndeere.gemspec b/myjohndeere.gemspec index abc1234..def5678 100644 --- a/myjohndeere.gemspec +++ b/myjohndeere.gemspec @@ -13,7 +13,7 @@ s.homepage = 'http://rubygems.org/gems/myjohndeere' s.license = 'MIT' - s.add_dependency "oauth", "~> 0.5.3" + s.add_dependency "oauth", ">= 0.5.3" s.files = Dir['lib/**/*.rb'] s.files = `git ls-files`.split("\n")
Make it a >= for oauth gem
diff --git a/stackprof.gemspec b/stackprof.gemspec index abc1234..def5678 100644 --- a/stackprof.gemspec +++ b/stackprof.gemspec @@ -5,6 +5,13 @@ s.authors = 'Aman Gupta' s.email = 'aman@tmm1.net' + + s.metadata = { + 'bug_tracker_uri' => 'https://github.com/tmm1/stackprof/issues', + 'changelog_uri' => 'https://github.com/tmm1/stackprof/blob/master/CHANGELOG.md', + 'documentation_uri' => "https://www.rubydoc.info/gems/stackprof/#{s.version}", + 'source_code_uri' => "https://github.com/tmm1/stackprof/tree/v#{s.version}" + } s.files = `git ls-files`.split("\n") s.extensions = 'ext/stackprof/extconf.rb'
Add project metadata to the gemspec As per https://guides.rubygems.org/specification-reference/#metadata, add metadata to the gemspec file. This'll allow people to more easily access the source code, raise issues and read the changelog. These `bug_tracker_uri`, `changelog_uri`, `documentation_uri` and `source_code_uri` links will appear on the rubygems page at https://rubygems.org/gems/stackprof and be available via the rubygems API after the next release.
diff --git a/openweather.gemspec b/openweather.gemspec index abc1234..def5678 100644 --- a/openweather.gemspec +++ b/openweather.gemspec @@ -22,5 +22,6 @@ spec.add_development_dependency "minitest", "~> 5.5.1" spec.add_development_dependency "bundler", "~> 1.10" spec.add_development_dependency "rake", "~> 10.0" + spec.add_development_dependency "webmock", "~> 1.21.0" spec.add_dependency "json" end
Add web mock as a development dependency.
diff --git a/lib/messagebird.rb b/lib/messagebird.rb index abc1234..def5678 100644 --- a/lib/messagebird.rb +++ b/lib/messagebird.rb @@ -2,7 +2,7 @@ $:.unshift(libdir) unless $:.include?(libdir) module MessageBird - CLIENT_VERSION = '1.3.1' + CLIENT_VERSION = '1.3.2' ENDPOINT = 'https://rest.messagebird.com' end
Update the version to 1.3.2
diff --git a/rs-api-tools.gemspec b/rs-api-tools.gemspec index abc1234..def5678 100644 --- a/rs-api-tools.gemspec +++ b/rs-api-tools.gemspec @@ -1,12 +1,13 @@ Gem::Specification.new do |s| s.name = 'rs-api-tools' - s.version = '0.0.7' + s.version = '0.0.8' s.date = '2013-11-04' s.summary = "rs-api-tools" s.description = "RightScale API Command Line Tools." s.authors = ["Chris Fordham"] s.email = 'chris@fordham-nagy.id.au' s.licenses = ['Apache 2'] + s.files = Dir['lib/*.rb'] s.bindir = 'bin' s.executables = Dir.entries(s.bindir) - [".", "..", '.gitignore'] s.homepage =
Add lib dir to files in gemspec, bump to 0.0.8.
diff --git a/lib/reel/server.rb b/lib/reel/server.rb index abc1234..def5678 100644 --- a/lib/reel/server.rb +++ b/lib/reel/server.rb @@ -1,22 +1,23 @@ module Reel class Server include Celluloid::IO - + def initialize(host, port, &callback) # This is actually an evented Celluloid::IO::TCPServer @server = TCPServer.new(host, port) + @server.listen(1024) @callback = callback run! end - + def finalize @server.close end - + def run loop { handle_connection! @server.accept } end - + def handle_connection(socket) connection = Connection.new(socket) begin @@ -31,4 +32,4 @@ # TODO: log this? end end -end+end
Increase tcp connections backlog to 1024 Fixes #11
diff --git a/simple-pages.gemspec b/simple-pages.gemspec index abc1234..def5678 100644 --- a/simple-pages.gemspec +++ b/simple-pages.gemspec @@ -17,7 +17,6 @@ s.test_files = Dir["test/**/*"] s.add_dependency "rails", "~> 3.2.3" - # s.add_dependency "jquery-rails" - + s.add_dependency "ancestry" s.add_development_dependency "sqlite3" end
Add ancestry as a dependency
diff --git a/Casks/visual-studio-code.rb b/Casks/visual-studio-code.rb index abc1234..def5678 100644 --- a/Casks/visual-studio-code.rb +++ b/Casks/visual-studio-code.rb @@ -2,7 +2,7 @@ version :latest sha256 :no_check - url 'http://download.microsoft.com/download/0/D/5/0D57186C-834B-463A-AECB-BC55A8E466AE/VSCode-osx.zip' + url 'http://go.microsoft.com/fwlink/?LinkID=534106' name 'Visual Studio Code' homepage 'https://code.visualstudio.com/' license :gratis
Update Visual Studio Code to v0.3.0
diff --git a/Casks/data-rescue.rb b/Casks/data-rescue.rb index abc1234..def5678 100644 --- a/Casks/data-rescue.rb +++ b/Casks/data-rescue.rb @@ -0,0 +1,11 @@+cask :v1 => 'data-rescue' do + version '4.1' + sha256 '479f91c85e4e87cf4d9b99a1e4c73a132c318a9b98d00d44a77e771c20a428dc' + + url "https://s3.amazonaws.com/prosoft-engineering/drmac/Data_Rescue_#{version}_US.dmg" + name 'Data Rescue 4' + homepage 'http://www.prosofteng.com/products/data_rescue.php' + license :commercial + + app 'Data Rescue 4.app' +end
Add Data Rescue 4.app v4.1
diff --git a/Casks/growlnotify.rb b/Casks/growlnotify.rb index abc1234..def5678 100644 --- a/Casks/growlnotify.rb +++ b/Casks/growlnotify.rb @@ -4,4 +4,5 @@ version '2.1' sha256 'eec601488b19c9e9b9cb7f0081638436518bce782d079f6e43ddc195727c04ca' install 'GrowlNotify.pkg' + uninstall :pkgutil => 'info.growl.growlnotify.*pkg' end
Add uninstall stanza to growl notify
diff --git a/spec/lib/cli_spec.rb b/spec/lib/cli_spec.rb index abc1234..def5678 100644 --- a/spec/lib/cli_spec.rb +++ b/spec/lib/cli_spec.rb @@ -3,12 +3,64 @@ module MinitestToRspec RSpec.describe CLI do + let(:cli) { described_class.new([source, target]) } + let(:source) { "spec/fixtures/01_trivial_assertion/in.rb" } + let(:target) { "/dev/null" } + describe ".new" do context "target omitted" do it "infers target" do - argv = ["test/fruit/banana_test.rb"] - cli = described_class.new(argv) + cli = described_class.new(["test/fruit/banana_test.rb"]) expect(cli.target).to eq("spec/fruit/banana_spec.rb") + end + end + + context "no arguments" do + it "educates the user" do + expect { + expect { described_class.new([]) }.to output(/Usage/).to_stderr + }.to raise_error(SystemExit) + end + end + end + + describe "#run" do + it "converts source to target" do + expect(cli).to receive(:assert_file_does_not_exist) + cli.run + end + + it "catches MinitestToRspec::Error" do + allow(cli).to receive(:assert_file_does_not_exist) + allow(cli).to receive(:converter).and_raise(Error, "so sad") + expect { + expect { cli.run }.to output("Failed to convert: so sad").to_stderr + }.to raise_error(SystemExit) + end + end + + describe "#assert_file_does_not_exist" do + context "when file exists" do + it "exits with code E_FILE_ALREADY_EXISTS" do + expect { + expect { cli.run }.to output( + "File already exists: /dev/null" + ).to_stderr + }.to raise_error(SystemExit) + end + end + end + + describe "#assert_file_exists" do + context "when file does not exist" do + let(:source) { "does_not_exist_3819e90182546cf5da27f193d0f3000164" } + + it "exits with code E_FILE_NOT_FOUND" do + expect { + expect { cli.run }.to output( + "File not found: #{source}" + ).to_stderr + }.to raise_error(SystemExit) end end end
Complete test coverage of CLI
diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index abc1234..def5678 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -6,10 +6,9 @@ require 'orm/active_record' Capybara.app = RailsApp::Application -Capybara.save_and_open_page_path = File.expand_path('../../tmp', __FILE__) RSpec.configure do |config| config.include RailsApp::Application.routes.url_helpers end -Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }+Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
Remove Capybara.save_and_open_page_path since it was removed
diff --git a/Casks/tg-pro.rb b/Casks/tg-pro.rb index abc1234..def5678 100644 --- a/Casks/tg-pro.rb +++ b/Casks/tg-pro.rb @@ -1,6 +1,6 @@ cask :v1 => 'tg-pro' do - version '2.8.1' - sha256 '9cdb4731d20daa4242beff1ecbc44fe9a03b4d768261994c0cee85b42f33c525' + version '2.8.3' + sha256 'c7aa687b4ae43b2bf7adf83b444c0e3716f0ae09cdc2f28b5a6cd79d151002c3' url "http://www.tunabellysoftware.com/resources/TGPro_#{version.gsub('.','_')}.zip" name 'TG Pro'
Update TG Pro.app to v2.8.3
diff --git a/app/controllers/registrar/sessions_controller.rb b/app/controllers/registrar/sessions_controller.rb index abc1234..def5678 100644 --- a/app/controllers/registrar/sessions_controller.rb +++ b/app/controllers/registrar/sessions_controller.rb @@ -1,6 +1,4 @@ class Registrar::SessionsController < Registrar::ApplicationController - skip_action_callback :require_signed_in_user - def new end
Remove unneeded and unused callback. This was not working (incorrect syntax) in the past. I updated it in this PR https://github.com/procore/registrar/pull/27 while upgrading to Rails 5. (See attached PR for relevant discussion) After double checking, this callback can indeed get removed.
diff --git a/recipes/default.rb b/recipes/default.rb index abc1234..def5678 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -32,6 +32,5 @@ else # assume linux platform package 'firefox' do version node['firefox']['version'] unless node['firefox']['version'] == 'latest' - action :nothing - end.run_action(:upgrade) # install at compile time so version is available during convergence + end end
Remove compile time installation as this fights with apt-update and we lose Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/LLRegex.podspec b/LLRegex.podspec index abc1234..def5678 100644 --- a/LLRegex.podspec +++ b/LLRegex.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'LLRegex' - s.version = '1.2.2' + s.version = '1.2.2-alpha' s.summary = 'Regular expression library in Swift, wrapping NSRegularExpression.' s.homepage = 'https://github.com/LittleRockInGitHub/LLRegex' s.license = { :type => 'MIT', :file => 'LICENSE' }
Update Pod version to 1.2.2-alpha
diff --git a/lib/generators/templates/sofort.rb b/lib/generators/templates/sofort.rb index abc1234..def5678 100644 --- a/lib/generators/templates/sofort.rb +++ b/lib/generators/templates/sofort.rb @@ -14,4 +14,6 @@ config.currency_code = "EUR" config.reason = "Reason" + config.user_variable = 'user_variable' + end
Add user_variable to the config template
diff --git a/lib/mutant/mutator/node/generic.rb b/lib/mutant/mutator/node/generic.rb index abc1234..def5678 100644 --- a/lib/mutant/mutator/node/generic.rb +++ b/lib/mutant/mutator/node/generic.rb @@ -9,7 +9,7 @@ # your contribution is that close! handle( :defined, - :next, :break, :match, :ensure, + :next, :break, :ensure, :dstr, :dsym, :yield, :rescue, :redo, :defined?, :blockarg, :op_asgn, :and_asgn, :regopt, :restarg, :resbody, :retry, :arg_expr,
Remove match node which is no longer provided by parser
diff --git a/lib/rubytest/core_ext/exception.rb b/lib/rubytest/core_ext/exception.rb index abc1234..def5678 100644 --- a/lib/rubytest/core_ext/exception.rb +++ b/lib/rubytest/core_ext/exception.rb @@ -2,18 +2,18 @@ def set_assertion(boolean) @assertion = boolean - end unless defined?(:set_assertion) + end unless method_defined?(:set_assertion) def assertion? @assertion - end unless defined?(:assertion?) + end unless method_defined?(:assertion?) def set_priority(integer) @priority = integer.to_i - end unless defined?(:set_priority) + end unless method_defined?(:set_priority) def priority @priority ||= 0 - end unless defined?(:priority) + end unless method_defined?(:priority) end
Fix check for Exception extension methods.
diff --git a/Isengard/db/seeds.rb b/Isengard/db/seeds.rb index abc1234..def5678 100644 --- a/Isengard/db/seeds.rb +++ b/Isengard/db/seeds.rb @@ -6,7 +6,7 @@ # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) # Mayor.create(name: 'Emanuel', city: cities.first) -url = 'https://raw2.github.com/ZeusWPI/hydra/master/iOS/Resources/Associations.json' +url = 'http://student.ugent.be/hydra/api/1.1/Associations.json' hash = JSON HTTParty.get(url) hash.each do |club|
Use DSA API instead of github raw
diff --git a/Casks/cachewarmer.rb b/Casks/cachewarmer.rb index abc1234..def5678 100644 --- a/Casks/cachewarmer.rb +++ b/Casks/cachewarmer.rb @@ -2,9 +2,10 @@ version '13' sha256 '97f9d743a41c4a38ea3b2af5c33716e72b02e9e11b0fed3000d0a3c584f104f3' - url "https://glencode.net/_downloads/CacheWarmer-#{version}.pkg" + # amazonaws.com is the official download host per the vendor homepage + url "https://s3.amazonaws.com/glencode_downloads/CacheWarmer-#{version}.pkg" name 'CacheWarmer' - homepage 'https://glencode.net/cachewarmer/' + homepage 'https://assetcache.io/cachewarmer/' license :freemium pkg "CacheWarmer-#{version}.pkg"
Update CacheWarmer URL and homepage
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -13,5 +13,7 @@ end RSpec.configure do |config| - config.treat_symbols_as_metadata_keys_with_true_values = true -end+ config.expect_with :rspec do |c| + c.syntax = :should + end +end
Remove deprecation messages in rspec
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -8,7 +8,7 @@ require "webmock" require "dotenv" -Dotenv.overload(".env", ".env.local") +Dotenv.load(".env.local", ".env") config_vars = %i[username password agent_code host eks_path prv_path] CONFIG = config_vars.each_with_object({}) do |var, hash|
Reorder dotenv loading for travis It will not override the existing env variables if they are already set
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,7 +1,6 @@ ENV['RAILS_ENV'] ||= 'test' require File.expand_path("../dummy/config/environment.rb", __FILE__) require 'rspec/rails' -require 'rspec/autorun' require 'pry' Rails.backtrace_cleaner.remove_silencers!
Remove autorun as it is no deprecated.
diff --git a/spec/lib/cool/work_spec.rb b/spec/lib/cool/work_spec.rb index abc1234..def5678 100644 --- a/spec/lib/cool/work_spec.rb +++ b/spec/lib/cool/work_spec.rb @@ -29,5 +29,15 @@ expect(work.execute).to eq(1) expect(work.value).to eq(1) end + + it 'works with instance_eval' do + work = described_class.new <<-EOC +self.class.instance_eval { attr_reader :value } +@value = 1 +self.value + EOC + expect(work.execute).to eq(1) + expect(work.value).to eq(1) + end end end
Add a spec of Work
diff --git a/spec/support/dummy_view.rb b/spec/support/dummy_view.rb index abc1234..def5678 100644 --- a/spec/support/dummy_view.rb +++ b/spec/support/dummy_view.rb @@ -3,7 +3,7 @@ class DummyView < ActionView::Base module FakeRequest class Request - attr_accessor :path + attr_accessor :path, :fullpath def get? true end @@ -26,6 +26,7 @@ routes.draw do get "/" => "foo#bar", :as => :home get "/posts" => "foo#posts" + get "/posts/:title" => "foo#posts" get "/post/:id" => "foo#post", :as => :post get "/post/:title" => "foo#title" end @@ -34,7 +35,6 @@ def set_path(path) request.path = path + request.fullpath = path end - - def current_page?(*); end end
Change to rely on rails view to find current page
diff --git a/Casks/opera-beta.rb b/Casks/opera-beta.rb index abc1234..def5678 100644 --- a/Casks/opera-beta.rb +++ b/Casks/opera-beta.rb @@ -1,6 +1,6 @@ cask :v1 => 'opera-beta' do - version '28.0.1750.36' - sha256 'cab81fd4bee7b73ab8b377db3e73305f8dde64c2a495f4aa1acfd742e0ba248b' + version '29.0.1795.21' + sha256 'ffcf288fbbe993c772658ea20f5230525246e046f69a162e5eeabb6de4ecd73c' url "http://get.geo.opera.com/pub/opera-beta/#{version}/mac/Opera_beta_#{version}_Setup.dmg" homepage 'http://www.opera.com/computer/beta'
Upgrade Opera Beta.app to v29.0.1795.21
diff --git a/Casks/sassquatch.rb b/Casks/sassquatch.rb index abc1234..def5678 100644 --- a/Casks/sassquatch.rb +++ b/Casks/sassquatch.rb @@ -7,5 +7,5 @@ homepage 'http://sassquatch.thoughtbot.com' license :commercial - app 'Sassquatch.app' + app 'Sassquatch/Sassquatch.app' end
Fix App Stanza target in Sassquatch Cask
diff --git a/lib/deploy_it/utils/exec.rb b/lib/deploy_it/utils/exec.rb index abc1234..def5678 100644 --- a/lib/deploy_it/utils/exec.rb +++ b/lib/deploy_it/utils/exec.rb @@ -20,8 +20,8 @@ module Exec extend self - def capture(command, args = []) - output, err, code = execute(command, args) + def capture(command, args = [], opts = {}) + output, err, code = execute(command, args, opts) if code != 0 raise DeployIt::Error::IOError, "Non-zero exit code #{code} for `#{command} #{args.join(" ")}`" end @@ -29,8 +29,8 @@ end - def execute(command, args = []) - Open3.capture3(command, *args) + def execute(command, args = [], opts = {}) + Open3.capture3(command, *args, opts) rescue => e raise DeployIt::Error::IOError, "Exception occured executing `#{command} #{args.join(" ")}` : #{e.message}" end
Allow to pass a hash of options to Utils::Exec methods
diff --git a/lib/mindbody-api/version.rb b/lib/mindbody-api/version.rb index abc1234..def5678 100644 --- a/lib/mindbody-api/version.rb +++ b/lib/mindbody-api/version.rb @@ -1,3 +1,4 @@ module MindBody - VERSION = "0.5.2.0" + VERSION = "1.0.0.alpha" + API_VERSION = "0.5.2.0" end
Use semver for the gem and specify API_VERSION
diff --git a/lib/turntables/turntable.rb b/lib/turntables/turntable.rb index abc1234..def5678 100644 --- a/lib/turntables/turntable.rb +++ b/lib/turntables/turntable.rb @@ -23,6 +23,7 @@ DbRegistry.instance.close! DbRegistry.instance.name = location DbRegistry.instance.open! + make! end # Create the tables by going through each revision
Make it actually make the tables (forgot the make call)
diff --git a/Casks/vienna.rb b/Casks/vienna.rb index abc1234..def5678 100644 --- a/Casks/vienna.rb +++ b/Casks/vienna.rb @@ -1,6 +1,6 @@ cask :v1 => 'vienna' do version '3.0.3' - sha256 '106c25c623866b5c2fe14fb38ffb19918fb15e753d7a05c5e15121ac546b3e05' + sha256 'c575b069ba0fa504891c104a9652b427c559d798ceff83109eb2b86e14015c76' # sourceforge.net is the official download host per the vendor homepage url "http://downloads.sourceforge.net/vienna-rss/Vienna#{version}.tgz"
Correct Vienna sha256 for version 3.0.3
diff --git a/app/views/organizations/_organization.json.rabl b/app/views/organizations/_organization.json.rabl index abc1234..def5678 100644 --- a/app/views/organizations/_organization.json.rabl +++ b/app/views/organizations/_organization.json.rabl @@ -1,5 +1,28 @@-node(:'@id') { |org| member_url(org.member) } -node(:'@type') {"http://schema.org/Organization"} attributes :name, :description, :url -node(:logo) {|org| org.logo.to_s } -node(:membershipId) { |org| org.member.membership_number }+ +node(:'@type') { "http://schema.org/Organization" } +node(:'@id' ) { |org| member_url(org.member) } + +node :membership do |org| + { + :type => "http://schema.org/Product", + :name => org.member.product_name, + :membershipId => org.member.membership_number, + } +end + +if root_object.logo.url + node :logo do |org| + [ + { + :'@type' => "http://schema.org/ImageObject", + :description => "Full-sized logo image", + :contentUrl => org.logo.url, + :thumbnail => { + :'@type' => "http://schema.org/ImageObject", + :contentUrl => "TODO", + } + } + ] + end +end
Add nested logo and membership details
diff --git a/workflow/main.rb b/workflow/main.rb index abc1234..def5678 100644 --- a/workflow/main.rb +++ b/workflow/main.rb @@ -23,7 +23,7 @@ task_generator.contexts = omnifocus.contexts tasks = task_generator.tasks - tasks.push(tasks.shift) + tasks.push(tasks.shift) # Last task is always shown first tasks.each do |task| command = task.to_s
Add comment to weird behaviour
diff --git a/app/models/csv_db.rb b/app/models/csv_db.rb index abc1234..def5678 100644 --- a/app/models/csv_db.rb +++ b/app/models/csv_db.rb @@ -3,13 +3,13 @@ class << self def convert_save(target_model, csv_data, role = :default, &block) csv_file = csv_data.read - CSV.parse(csv_file, :headers => true, header_converters: :symbol ) do |row| + CSV.parse(csv_file, :headers => true, :header_converters => :symbol ) do |row| data = row.to_hash if data.present? if (block_given?) block.call(target_model, data) else - target_model.create!(data, as: role) + target_model.create!(data, :as => role) end end end
Make compatible with Ruby 1.8.7.
diff --git a/app/helpers/config_helper.rb b/app/helpers/config_helper.rb index abc1234..def5678 100644 --- a/app/helpers/config_helper.rb +++ b/app/helpers/config_helper.rb @@ -7,11 +7,12 @@ default_currency: Settings.default_currency, facebook: Settings.facebook.to_hash.slice(:pixel_id), recaptcha3: Settings.recaptcha3.to_hash.slice(:site_key), - recaptcha2: Settings.recaptcha2.to_hash.slice(:site_key), - eoy_thermometer: eoy_thermometer_config - }.transform_keys! do |key| + recaptcha2: Settings.recaptcha2.to_hash.slice(:site_key) + }.deep_transform_keys! do |key| key.to_s.camelize(:lower) - end + end.merge( + eoyThermometer: eoy_thermometer_config + ) end def eoy_thermometer_config
Return to deep_transform_keys so that site_key is camelized
diff --git a/lib/head_music/circle.rb b/lib/head_music/circle.rb index abc1234..def5678 100644 --- a/lib/head_music/circle.rb +++ b/lib/head_music/circle.rb @@ -20,8 +20,8 @@ attr_reader :interval, :pitch_classes def initialize(interval) - @interval = HeadMusic::ChromaticInterval.get(interval.to_i) - @pitch_classes = pitch_classes_by_interval(interval) + @interval = interval.to_i + @pitch_classes = pitch_classes_by_interval end def index(pitch_class) @@ -32,7 +32,7 @@ private - def pitch_classes_by_interval(interval) + def pitch_classes_by_interval [HeadMusic::PitchClass.get(0)].tap do |list| loop do next_pitch_class = list.last + interval
Remove unnecessary use of ChromaticInterval in Circle.