diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/vantiq-sdk-ios.podspec b/vantiq-sdk-ios.podspec index abc1234..def5678 100644 --- a/vantiq-sdk-ios.podspec +++ b/vantiq-sdk-ios.podspec @@ -23,9 +23,9 @@ s.requires_arc = true s.source_files = 'Pod/Classes/**/*' - s.resource_bundles = { - 'vantiq-sdk-ios' => ['Pod/Assets/*.png'] - } + # s.resource_bundles = { + # 'vantiq-sdk-ios' => ['Pod/Assets/*.png'] + # } # s.public_header_files = 'Pod/Classes/**/*.h' end
Remove default, unused resource_bundles entry which causes "pod lib lint" to fail.
diff --git a/spec/lib/project_spec.rb b/spec/lib/project_spec.rb index abc1234..def5678 100644 --- a/spec/lib/project_spec.rb +++ b/spec/lib/project_spec.rb @@ -8,6 +8,6 @@ let(:resource) { client.projects } - include_examples 'list resource' - include_examples 'find resource' + include_examples 'lists resource' + include_examples 'finds resource' end
Update example use in project spec
diff --git a/spec/sample_file_spec.rb b/spec/sample_file_spec.rb index abc1234..def5678 100644 --- a/spec/sample_file_spec.rb +++ b/spec/sample_file_spec.rb @@ -2,7 +2,7 @@ describe SampleFile do %w(Image Video).each do |class_name| - klass = const_get("SampleFile::#{class_name}") + klass = SampleFile.const_get("#{class_name}") file_method = class_name.downcase describe file_method do
Fix const_get for ruby version < 2.0.0
diff --git a/spec/tasks/rekey_spec.rb b/spec/tasks/rekey_spec.rb index abc1234..def5678 100644 --- a/spec/tasks/rekey_spec.rb +++ b/spec/tasks/rekey_spec.rb @@ -18,9 +18,16 @@ expect(existing_keys & new_keys).to be_empty end - it 'will rename thumbnail files' do - end + it 'will rename all files' do + old_thumbnail_paths = Image.all.map { |image| image.file.path(:thumb) } + old_original_paths = Image.all.map { |image| image.file.path() } - it 'will rename original image files' do + subject.invoke # Run rekey:all + + new_thumbnail_paths = Image.all.map { |image| image.file.path(:thumb) } + new_original_paths = Image.all.map { |image| image.file.path() } + + expect(old_thumbnail_paths & new_thumbnail_paths).to be_empty + expect(old_original_paths & new_original_paths).to be_empty end end
Test for all files being renamed
diff --git a/spec/protocol/decoder_spec.rb b/spec/protocol/decoder_spec.rb index abc1234..def5678 100644 --- a/spec/protocol/decoder_spec.rb +++ b/spec/protocol/decoder_spec.rb @@ -14,24 +14,18 @@ expect { decoder.read(5) }.to raise_exception(EOFError) end - context "when there is no more data in the stream" do - it "raises EOFError" do - data = "" - decoder = Kafka::Protocol::Decoder.from_string(data) + it "raises EOFError if there is not enough data left in the stream" do + data = "" + decoder = Kafka::Protocol::Decoder.from_string(data) - expect { decoder.read(5) }.to raise_exception(EOFError) - end + expect { decoder.read(5) }.to raise_exception(EOFError) + end - context "when trying to read 0 bytes" do - it "does not attempt to read data from IO object and returns empty string" do - io = double - allow(io).to receive(:read) - decoder = Kafka::Protocol::Decoder.new(io) + it "returns an empty string when trying to read zero bytes" do + io = StringIO.new("") + decoder = Kafka::Protocol::Decoder.new(io) - expect(decoder.read(0)).to eq "" - expect(io).to_not have_received(:read) - end - end + expect(decoder.read(0)).to eq "" end end end
Clean up the Decoder spec
diff --git a/Casks/font-pt-sans.rb b/Casks/font-pt-sans.rb index abc1234..def5678 100644 --- a/Casks/font-pt-sans.rb +++ b/Casks/font-pt-sans.rb @@ -1,8 +1,8 @@ class FontPtSans < Cask - version '2.004' - sha256 'c70b683ab35d28cc65367f6b9ef5f04d6d83b1217f2e727648bbaeb12dc140e7' + version '2.005' + sha256 '65c3352a864ac711e5381d56dc76ca4edfb511b5293f5560bca877e8f19a2fc9' - url 'http://www.fontstock.com/public/PTSans.zip' + url 'http://www.paratype.com/uni/public/PTSans.zip' homepage 'http://www.paratype.com/public/' license :ofl
Update PT Sans to 2.005
diff --git a/lib/cc/cli/analyze.rb b/lib/cc/cli/analyze.rb index abc1234..def5678 100644 --- a/lib/cc/cli/analyze.rb +++ b/lib/cc/cli/analyze.rb @@ -12,8 +12,10 @@ def run require_codeclimate_yml - runner = EnginesRunner.new(registry, formatter, source_dir, config) - runner.run + Dir.chdir(ENV['FILESYSTEM_DIR']) do + runner = EnginesRunner.new(registry, formatter, source_dir, config) + runner.run + end rescue EnginesRunner::InvalidEngineName => ex fatal(ex.message)
Change into the filesystem dir before running engines
diff --git a/db/seeds.rb b/db/seeds.rb index abc1234..def5678 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -20,4 +20,23 @@ end end + notify "Creating test cells" do + 5.times do |i| + Cell.find_or_create_by(fqdn: "cell#{i + 1}.example.com") do |cell| + cell.uuid = SecureRandom.uuid + cell.status = :healthy + cell.ip_address = IPAddr.new(rand(2**32), Socket::AF_INET).to_s + end + end + end + + notify "Creating volumes" do + Cell.all.each do |cell| + cell.volumes.find_or_create_by(mountpoint: "/storage1") do |volume| + volume.total_capacity = 2048 + volume.available_capacity = 2048 + end + end + end + end
Revert "No need for seeding when we have real data :)" This reverts commit d0b9100cb3e8df7e5b0d54fd54ae331746b3e238.
diff --git a/db/seeds.rb b/db/seeds.rb index abc1234..def5678 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -5,3 +5,5 @@ # # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) # Mayor.create(name: 'Emanuel', city: cities.first) + +Courierkill.create({:killer => "nobody"})
Add db seed for 'nobody'
diff --git a/recipes/default.rb b/recipes/default.rb index abc1234..def5678 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -17,8 +17,7 @@ # limitations under the License. # -case node['platform'] -when 'windows' +if platform?('windows') # https://chocolatey.org/packages/StrawberryPerl chocolatey_package 'strawberryperl'
Simplify the platform check logic Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/lib/rbNFA.rb b/lib/rbNFA.rb index abc1234..def5678 100644 --- a/lib/rbNFA.rb +++ b/lib/rbNFA.rb @@ -14,15 +14,23 @@ case char when 'a'..'z' then tokens << LiteralToken.new(char) when 'A'..'Z' then tokens << LiteralToken.new(char4) + when '+' then tokens << OneOrMoreToken end end tokens end end + class LiteralToken attr_accessor :character def initialize(character) @character = character end end + + class OneOrMoreToken + def initialize + raise "Use as class constant" + end + end end
Add one or more Toke
diff --git a/lib/feedcellar/web.rb b/lib/feedcellar/web.rb index abc1234..def5678 100644 --- a/lib/feedcellar/web.rb +++ b/lib/feedcellar/web.rb @@ -9,7 +9,7 @@ end get "/search" do - if params.has_key?(:word) + if params.has_key?("word") words = params[:word].split(" ") else words = []
Use String instead of Symbol as params' key
diff --git a/lib/jobim/settings.rb b/lib/jobim/settings.rb index abc1234..def5678 100644 --- a/lib/jobim/settings.rb +++ b/lib/jobim/settings.rb @@ -39,8 +39,10 @@ files = [] loop do + file = File.expand_path('.jobim.yml', dir) + files.unshift(file) if File.exists? file + file = File.expand_path('.jobim.yaml', dir) - files.unshift(file) if File.exists? file break if dir.root?
Add support for config files with the "yml" extension ("yaml" still works)
diff --git a/test/integration/artefact_create_test.rb b/test/integration/artefact_create_test.rb index abc1234..def5678 100644 --- a/test/integration/artefact_create_test.rb +++ b/test/integration/artefact_create_test.rb @@ -0,0 +1,52 @@+require_relative '../integration_test_helper' + +class ArtefactCreateTest < ActionDispatch::IntegrationTest + + setup do + create_test_user + end + + should "allow the use of deep slugs when creating a whitehall artefact" do + visit "/artefacts" + click_on "Add Whitehall artefact" + + within("form#edit_artefact") do + fill_in "Name", :with => "British Embassy Legoland" + fill_in "Description", :with => "Some information on the British Embassy in Legoland" + fill_in "Slug", :with => "government/world/organisations/british-embassy-legoland" + select "Worldwide priority", :from => "Kind" + click_on "Save and continue editing" + + artefact = Artefact.where(:slug => 'government/world/organisations/british-embassy-legoland').last + + assert_equal "/artefacts/#{artefact.to_param}/edit", current_path + end + + assert page.has_link?("View on site") + within(".alert.alert-error") do + assert page.has_no_css?("li"), "No form errors were expected" + end + + end + + should "not allow the use of invalid slugs when creating a whitehall artefact" do + visit "/artefacts" + click_on "Add Whitehall artefact" + + within("form#edit_artefact") do + fill_in "Name", :with => "British Embassy Legoland" + fill_in "Description", :with => "Some information on the British Embassy in Legoland" + fill_in "Slug", :with => "government/world/.organi$ation$/briti$h~embassy~legoland" + select "Worldwide priority", :from => "Kind" + click_on "Save and continue editing" + end + + assert_equal "/artefacts", current_path + + within(".alert.alert-error") do + assert page.has_content?("Slug must be usable in a URL") + end + + end + +end
Test creating whitehall artefacts with deep slugs
diff --git a/test/lib/catissue/domain/address_test.rb b/test/lib/catissue/domain/address_test.rb index abc1234..def5678 100644 --- a/test/lib/catissue/domain/address_test.rb +++ b/test/lib/catissue/domain/address_test.rb @@ -26,9 +26,5 @@ # Modify the address. expected = @addr.street = "#{CaRuby::Uniquifier.qualifier} Elm St." verify_save(@addr) - # Find the address. - fetched = @addr.copy(:identifier).find - assert_not_nil(fetched, "Address not saved") - assert_equal(expected, fetched.street, "Address street not saved") end end
Address identifier is not set by caTissue in save result.
diff --git a/CacheIsKing.podspec b/CacheIsKing.podspec index abc1234..def5678 100644 --- a/CacheIsKing.podspec +++ b/CacheIsKing.podspec @@ -1,8 +1,8 @@ Pod::Spec.new do |s| s.name = 'CacheIsKing' - s.version = '0.0.1' + s.version = '0.0.2' s.license = 'MIT' - s.summary = 'A simple cache that can hold Swift items' + s.summary = 'A simple cache that can hold anything, including Swift items' s.homepage = 'https://github.com/nuudles/CacheIsKing' s.authors = { 'Christopher Luu' => 'nuudles@gmail.com' } s.source = { :git => 'https://github.com/nuudles/CacheIsKing.git', :tag => s.version }
Update podspec for 0.0.2 release
diff --git a/lib/rhinoart/utils.rb b/lib/rhinoart/utils.rb index abc1234..def5678 100644 --- a/lib/rhinoart/utils.rb +++ b/lib/rhinoart/utils.rb @@ -1,3 +1,4 @@+# encoding: utf-8 module Rhinoart class Utils def self.to_slug(str)
Delete russian symbols from code
diff --git a/app/helpers/francis_cms/application_helper.rb b/app/helpers/francis_cms/application_helper.rb index abc1234..def5678 100644 --- a/app/helpers/francis_cms/application_helper.rb +++ b/app/helpers/francis_cms/application_helper.rb @@ -3,7 +3,7 @@ if obj.author_avatar.present? raw image_tag(obj.author_avatar_url(:small), html_options.merge({ srcset: %{#{asset_path obj.author_avatar_url(:large)} 2x} })) else - raw image_tag(%{data:image/png;base64,#{Base64.encode64 Rails.application.assets['avatar.png'].to_s}}, html_options) + raw image_tag(%{data:image/png;base64,#{Base64.encode64 File.read(FrancisCms::Engine.root.join('app/assets/images/avatar.png'))}}, html_options) end end end
Use File.read to grab contents of default avatar. Rails.application.assets is unavailable in production.
diff --git a/ChartsRealm.podspec b/ChartsRealm.podspec index abc1234..def5678 100644 --- a/ChartsRealm.podspec +++ b/ChartsRealm.podspec @@ -11,5 +11,5 @@ s.source = { :git => "https://github.com/danielgindi/ChartsRealm.git", :tag => "v#{s.version}" } s.source_files = "ChartsRealm/Classes/**/*.swift", "ChartsRealm/Supporting Files/RLMSupport.swift" s.dependency "Charts", "~> 3.3.0" - s.dependency "RealmSwift", "~> 3.15.0" + s.dependency "RealmSwift", "~> 3.18.0" end
Update RealmSwift version to 3.18
diff --git a/lib/tasks/chores.rake b/lib/tasks/chores.rake index abc1234..def5678 100644 --- a/lib/tasks/chores.rake +++ b/lib/tasks/chores.rake @@ -4,4 +4,9 @@ Absence.find_each(&:save) Tardy.find_each(&:save) end + + desc 'Update counter caches for DisciplineIncident' + task update_discipline_incident_counts: :environment do + DisciplineIncident.find_each(&:save) + end end
Add new chore for updating discipline incident counts
diff --git a/lib/twitter_client.rb b/lib/twitter_client.rb index abc1234..def5678 100644 --- a/lib/twitter_client.rb +++ b/lib/twitter_client.rb @@ -26,24 +26,6 @@ end def access_token - @access_token ||= if has_cached_access_token? - cached_access_token - else - TwitterAccessTokenService.new.call - end - end - - def cached_access_token - { - token: Settings.twitter.access_token, - secret: Settings.twitter.access_token_secret - } - end - - def has_cached_access_token? - begin - Settings.twitter.access_token && Settings.twitter.access_token_secret - rescue - end + @access_token ||= TwitterAccessTokenService.new.call end end
Remove fetching access token from config
diff --git a/Casks/android-studio.rb b/Casks/android-studio.rb index abc1234..def5678 100644 --- a/Casks/android-studio.rb +++ b/Casks/android-studio.rb @@ -1,8 +1,8 @@ class AndroidStudio < Cask - version '0.8.9' - sha256 'ee89cc544829cb62611ac7686254c4fc2eff00fdb6ab9a49330c97b8e8e952ac' + version '0.8.14' + sha256 '05eb79f0c4025f510ff02d7205157eb94d42074a2d89c8a5ba4cbead1187948f' - url "http://dl.google.com/dl/android/studio/ide-zips/#{version}/android-studio-ide-135.1404660-mac.zip" + url "http://dl.google.com/dl/android/studio/ide-zips/#{version}/android-studio-ide-135.1538390-mac.zip" homepage 'http://tools.android.com/download/studio' license :unknown
Update Android Studio to 0.8.14
diff --git a/plugins/guests/linux/cap/insert_public_key.rb b/plugins/guests/linux/cap/insert_public_key.rb index abc1234..def5678 100644 --- a/plugins/guests/linux/cap/insert_public_key.rb +++ b/plugins/guests/linux/cap/insert_public_key.rb @@ -4,7 +4,7 @@ class InsertPublicKey def self.insert_public_key(machine, contents) comm = machine.communicate - contents = contents.chomp + contents = contents.chomp+"\n" remote_path = "/tmp/vagrant-authorized-keys-#{Time.now.to_i}" Tempfile.open("vagrant-linux-insert-public-key") do |f| @@ -19,7 +19,6 @@ mkdir -p ~/.ssh chmod 0700 ~/.ssh cat '#{remote_path}' >> ~/.ssh/authorized_keys - echo "\n" >> ~/.ssh/authorized_keys chmod 0600 ~/.ssh/authorized_keys # Remove the temporary file
Apply new line before shell to system Having looked at the code again this seems like a more straightforward way of fixing the bug.
diff --git a/spec/support/test_permissions.rb b/spec/support/test_permissions.rb index abc1234..def5678 100644 --- a/spec/support/test_permissions.rb +++ b/spec/support/test_permissions.rb @@ -4,7 +4,7 @@ for user in users testee.should be_creatable_by(user) testee.should be_updatable_by(user) - testee.should be_editable_by(user) + testee.should be_destroyable_by(user) end end @@ -12,14 +12,14 @@ for user in users testee.should_not be_creatable_by(user) testee.should_not be_updatable_by(user) - testee.should_not be_editable_by(user) + testee.should_not be_destroyable_by(user) end end def ud_denied( users, testee) for user in users testee.should_not be_updatable_by(user) - testee.should_not be_editable_by(user) + testee.should_not be_destroyable_by(user) end end
Fix bug in spec support functions Functions that were supposed test destroy permission were testing edit permission instead.
diff --git a/storext.gemspec b/storext.gemspec index abc1234..def5678 100644 --- a/storext.gemspec +++ b/storext.gemspec @@ -9,7 +9,7 @@ s.version = Storext::VERSION s.authors = ["G5", "Ramon Tayag", "Marc Rendl Ignacio"] s.email = ["lateam@getg5.com", "ramon.tayag@gmail.com", "marcrendlignacio@gmail.com"] - s.homepage = "TODO" + s.homepage = "http://github.com/g5/storext" s.summary = "Extends ActiveRecord::Store.store_accessor" s.description = "Extends ActiveRecord::Store.store_accessor" s.license = "MIT"
Add github url to gemspec homepage
diff --git a/FWTDragView.podspec b/FWTDragView.podspec index abc1234..def5678 100644 --- a/FWTDragView.podspec +++ b/FWTDragView.podspec @@ -18,7 +18,7 @@ s.homepage = "https://github.com/FutureWorkshops/FWTDragView" s.license = 'MIT' s.author = { "Tim Chilvers" => "tim@futureworkshops.com" } - s.source = { :git => "https://github.com/FutureWorkhsops/FWTDragView.git", :tag => s.version.to_s } + s.source = { :git => "git@github.com:FutureWorkshops/FWTDragView.git", :tag => s.version.to_s } s.platform = :ios, '7.0' s.requires_arc = true
Update repo address in podspec
diff --git a/server.rb b/server.rb index abc1234..def5678 100644 --- a/server.rb +++ b/server.rb @@ -1,9 +1,9 @@ require 'sinatra' require 'json' require './filter' -SLACK_TOKEN = ENV['SLACK_TOKEN'] +SLACK_TOKENS = ENV['SLACK_TOKENS'].split(/\,/) -puts "TOKEN: #{SLACK_TOKEN}" +puts "TOKEN: #{SLACK_TOKENS}" before '/hooks' do unless token_valid? @@ -17,7 +17,7 @@ end def token_valid? - params['token'] == SLACK_TOKEN + SLACK_TOKENS.include?(params['token']) end def comment_by_myself? @@ -31,6 +31,7 @@ post '/hooks' do response = filter.update(params).compact.first return 200 unless response + response.merge!({link_names: 1, parse: "full"}) j = response.to_json puts j j
Add multi-token options and enable expand urls
diff --git a/config/application.rb b/config/application.rb index abc1234..def5678 100644 --- a/config/application.rb +++ b/config/application.rb @@ -37,7 +37,7 @@ config.assets.js_compressor = :uglifier config.assets.precompile += %w(mobile.css print.css) Dir.chdir(Rails.root.join "app/assets/stylesheets") do - config.assets.precompile += Dir["contrib/*"] + config.assets.precompile += Dir["contrib/*"].map {|s| s.sub /.scss$/, '' } end end end
Fix assets precompilation for alternative CSS
diff --git a/config/application.rb b/config/application.rb index abc1234..def5678 100644 --- a/config/application.rb +++ b/config/application.rb @@ -22,6 +22,10 @@ config.time_zone = 'London' config.active_record.default_timezone = :local config.active_record.raise_in_transactional_callbacks = true + + # Allow Skylight to show insights from local development. + # More info at https://skylight.io/support/environments + config.skylight.environments << 'development' end end
Add development environment to Skylight I’m looking into using Skylight to perf some local changes before deploying them, and I believe this is how you do it, according to their documentation: https://www.skylight.io/support/environments I’m happy to revert this change if it doesn’t work.
diff --git a/0_code_wars/how_many_word.rb b/0_code_wars/how_many_word.rb index abc1234..def5678 100644 --- a/0_code_wars/how_many_word.rb +++ b/0_code_wars/how_many_word.rb @@ -0,0 +1,10 @@+# http://www.codewars.com/kata/56eff1e64794404a720002d2/ +# --- iteration 1 --- +def testit(s) + s.downcase.delete("^word").scan(/w[word]?o[word]?r[word]?d/).count +end + +# --- iteration 2 --- +def testit(s) + s.scan(/w.*?o.*?r.*?d/i).size +end
Add code wars (7) - how many word
diff --git a/db/seeds.rb b/db/seeds.rb index abc1234..def5678 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -4,14 +4,19 @@ Fixtures.create_fixtures("db/seed", File.basename(file, '.*')) end -password = SecureRandom.hex[0..8] +password = SecureRandom.base58(8) User.create!( name: 'Admin', - email: 'admin@quintel.com', + email: "admin@example.org", password: password, password_confirmation: password, role: Role.create(id: 1, name: 'admin') ) -puts "Created admin user admin@quintel.com with password: #{ password }" +puts <<~MSG + +------------------------------------------------------------------------------+ + | Created admin user admin@example.org with password: #{password} | + | Please change this password if you're deploying to a production environment! | + +------------------------------------------------------------------------------+ +MSG
Add a better message when seeding the DB
diff --git a/MarvelAPIClient.podspec b/MarvelAPIClient.podspec index abc1234..def5678 100644 --- a/MarvelAPIClient.podspec +++ b/MarvelAPIClient.podspec @@ -0,0 +1,18 @@+Pod::Spec.new do |s| + s.name = "MarvelAPIClient" + s.version = "0.0.1" + s.summary = "Marvel API Client implementation written in Swift." + s.author = "GoKarumi S.L." + s.homepage = "https://github.com/karumi/MarvelAPIClient" + s.license = "Apache License V2.0" + + s.platform = :ios + s.platform = :ios, "8.0" + + s.source = { :git => "git@github.com:Karumi/MarvelApiClient.git", :tag => s.version } + s.source_files = "Classes", "MarvelAPIClient/*.swift" + + s.requires_arc = true + + s.dependency "BothamNetworking" +end
Add podspec to the repository
diff --git a/config/deploy/production.rb b/config/deploy/production.rb index abc1234..def5678 100644 --- a/config/deploy/production.rb +++ b/config/deploy/production.rb @@ -1,5 +1,2 @@-require 'dotenv' -Dotenv.load - -server 'root@107.170.241.16', roles: [:web, :app, :db, :sidekiq_web] -server "deploy@#{ENV['UTILITY1_HOSTNAME']}", roles: [:app, :sidekiq_utility] +server "deploy@web1.robinclowers.com", roles: [:web, :app, :db, :sidekiq_web] +server "deploy@utility1.robinclowers.com", roles: [:app, :sidekiq_utility]
Update deploy settings to use domain names
diff --git a/config/initializers/slim.rb b/config/initializers/slim.rb index abc1234..def5678 100644 --- a/config/initializers/slim.rb +++ b/config/initializers/slim.rb @@ -1,4 +1,4 @@ # Be sure to restart your server when you modify this file. # Prettify html source for development only -# Slim::Engine.set_options pretty: Rails.env.development?, sort_attrs: false, tabsize: 2, format: :html +Slim::Engine.set_options pretty: Rails.env.development?, sort_attrs: false, tabsize: 2, format: :html
Revert "Disable prettyfied html in development" This reverts commit 36ee86a6f662b496894574fc433f905f41616973.
diff --git a/cookbooks/ondemand_base/recipes/windows.rb b/cookbooks/ondemand_base/recipes/windows.rb index abc1234..def5678 100644 --- a/cookbooks/ondemand_base/recipes/windows.rb +++ b/cookbooks/ondemand_base/recipes/windows.rb @@ -1,7 +1,5 @@ #Make sure that this recipe only runs on Windows systems if platform?("windows") - - #This recipe needs providers included in the Windows cookbook #Turn off hibernation execute "powercfg-hibernation" do
Clean up formatting in Windows recipe
diff --git a/closed_struct.gemspec b/closed_struct.gemspec index abc1234..def5678 100644 --- a/closed_struct.gemspec +++ b/closed_struct.gemspec @@ -18,7 +18,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_development_dependency "bundler", "~> 1.6" + spec.add_development_dependency "bundler", "~> 1.5" spec.add_development_dependency "rake" spec.add_development_dependency "rspec" end
Use older bundle for travis
diff --git a/otp.rb b/otp.rb index abc1234..def5678 100644 --- a/otp.rb +++ b/otp.rb @@ -28,6 +28,6 @@ bytes = hmac.bytes[offset..offset + 3] bytes[0] = bytes[0] & 0x7f # TODO: Try packing this array using C and then unpacking using V. I think that's what James/Edward suggested at Show & Tell 27 -bytes_as_integer = bytes.map { |b| b.to_s(2).rjust(8, '0') }.join('').to_i(2) +bytes_as_integer = (bytes[0] << 24) + (bytes[1] << 16) + (bytes[2] << 8) + bytes[3] puts bytes_as_integer.modulo(10 ** digits)
Use bit-shifting to convert byte array to integer I tried various combinations of `Array#pack` and `String.unpack` to convert the array of 4 bytes to a single integer but didn't get anywhere. I then switched to learning about bit-shifting and am now using that instead of manually creating a string of bits and converting that to an integer.
diff --git a/utils/Compile.rb b/utils/Compile.rb index abc1234..def5678 100644 --- a/utils/Compile.rb +++ b/utils/Compile.rb @@ -9,7 +9,7 @@ def symlink(dir) print 'Added ' Dir.glob("#{dir}/*").select do |file| - file =~ /.[^.]*/ || file =~ /\.(rb|bash|sh|zsh)/ + file =~ /^.[^.]*$/ || file =~ /\.(rb|bash|sh|zsh)/ end.each do |file| comp = File.basename file extn = File.extname file
Update the regex to make sure it checkes the entire file
diff --git a/SVProgressHUD.podspec b/SVProgressHUD.podspec index abc1234..def5678 100644 --- a/SVProgressHUD.podspec +++ b/SVProgressHUD.podspec @@ -0,0 +1,20 @@+Pod::Spec.new do |s| + s.name = 'SVProgressHUD' + s.version = '0.1' + s.platform = :ios + s.license = 'MIT' + s.summary = 'A clean and lightweight progress HUD for your iOS app.' + s.homepage = 'http://samvermette.com/199' + s.author = { 'Sam Vermette' => 'samvermette@gmail.com' } + s.source = { :git => 'https://github.com/samvermette/SVProgressHUD.git', :tag => '0.1' } + + s.description = 'SVProgressHUD is a clean, lightweight and unobtrusive progress HUD for iOS. ' \ + 'It’s a simplified and prettified alternative to the popular MBProgressHUD. ' \ + 'Its fade in/out animations are highly inspired on Lauren Britcher’s HUD in ' \ + 'Tweetie for iOS. The success and error icons are from Glyphish.' + + s.source_files = 'SVProgressHUD/*.{h,m}' + s.clean_paths = 'Demo' + s.framework = 'QuartzCore' + s.resources = 'SVProgressHUD/SVProgressHUD.bundle' +end
Add CocoaPods podspec for 0.1 release.
diff --git a/lib/cc_portal_wordpress_integration.rb b/lib/cc_portal_wordpress_integration.rb index abc1234..def5678 100644 --- a/lib/cc_portal_wordpress_integration.rb +++ b/lib/cc_portal_wordpress_integration.rb @@ -6,6 +6,8 @@ Warden::Manager.after_authentication do |user, warden, options| cookies = warden.cookies params = warden.params + + delete_wordpress_cookies cookies begin # log in to the blog resp = Wordpress.new.log_in_user(user.login, params[:user][:password]) @@ -25,7 +27,10 @@ end Warden::Manager.before_logout do |user, warden, options| - cookies = warden.cookies + delete_wordpress_cookies warden.cookies + end + + def delete_wordpress_cookies(cookies) # cookies match: wordpress_* and wordpress_logged_in_* cookies.each do |key, val| if key.to_s =~ /^wordpress_/
Delete wordpress cookies before creating them again
diff --git a/lib/judoscale/job_metrics_collector.rb b/lib/judoscale/job_metrics_collector.rb index abc1234..def5678 100644 --- a/lib/judoscale/job_metrics_collector.rb +++ b/lib/judoscale/job_metrics_collector.rb @@ -10,7 +10,7 @@ def collect store = [] worker_adapter.collect!(store) - store.map! { |args| Metric.new(*args) } + store.map! { |(identifier, value, time, queue_name)| Metric.new(identifier, time, value, name) } store end end
Fix building the metrics for the worker adapters in the job collector Because the metric arguments are reversed between the metrics store and the metrics object, we can't just blindly pass them over, we need to build the object with individual arguments in the right positions for now.
diff --git a/lib/abbyy/xml.rb b/lib/abbyy/xml.rb index abc1234..def5678 100644 --- a/lib/abbyy/xml.rb +++ b/lib/abbyy/xml.rb @@ -1,6 +1,6 @@ module Abbyy module XML - def task(resource) + def parse_task(resource) Hash.new.tap do |task| xml_data = REXML::Document.new(resource) task[:id] = xml_data.elements["response/task"].attributes["id"] @@ -18,7 +18,7 @@ AbbyyXmlError = Struct.new(:code, :message) - def error(resource) + def parse_error(resource) AbbyyXmlError.new.tap do |error| xml_data = REXML::Document.new(resource.http_body) error.code = resource.http_code
Rename methods task to parse_task and error to parse_error
diff --git a/lib/sonos/cli.rb b/lib/sonos/cli.rb index abc1234..def5678 100644 --- a/lib/sonos/cli.rb +++ b/lib/sonos/cli.rb @@ -17,17 +17,27 @@ end end - desc 'pause_all', 'Pauses all Sonos speaker groups' + desc 'pause_all', 'Pause all speaker groups.' def pause_all system.pause_all end - desc 'play_all', 'Resumes playing all Sonos speaker groups' + desc 'play_all', 'Resume playing all speaker groups.' def play_all system.play_all end - desc 'groups', 'List all Sonos groups' + desc 'party_mode', 'Start a party! Put all speakers in the same group.' + def party_mode + system.party_mode + end + + desc 'party_over', 'No more party :( Put all speakers in their own group.' + def party_over + system.party_over + end + + desc 'groups', 'List all groups' def groups system.groups.each do |group| puts group.master_speaker.name.ljust(20) + group.master_speaker.ip
Add party mode to CLI
diff --git a/lib/specinfra.rb b/lib/specinfra.rb index abc1234..def5678 100644 --- a/lib/specinfra.rb +++ b/lib/specinfra.rb @@ -11,21 +11,21 @@ def configuration SpecInfra::Configuration end + end +end - def configure - if defined?(RSpec) - RSpec.configure do |c| - c.include(SpecInfra::Helper::Configuration) - c.add_setting :os, :default => nil - c.add_setting :host, :default => nil - c.add_setting :ssh, :default => nil - c.add_setting :sudo_password, :default => nil - c.add_setting :winrm, :default => nil - SpecInfra.configuration.defaults.each { |k, v| c.add_setting k, :default => v } - c.before :each do - backend.set_example(example) - end - end +if defined?(RSpec) + RSpec.configure do |c| + c.include(SpecInfra::Helper::Configuration) + c.add_setting :os, :default => nil + c.add_setting :host, :default => nil + c.add_setting :ssh, :default => nil + c.add_setting :sudo_password, :default => nil + c.add_setting :winrm, :default => nil + SpecInfra.configuration.defaults.each { |k, v| c.add_setting k, :default => v } + c.before :each do + if respond_to?(:backend) && backend.respond_to?(:set_example) + backend.set_example(example) end end end
Change behavior to call backend.set_example only if respont_to? :backend and :set_example to avoid occuring error when they are not defined
diff --git a/lib/pieces/compilers/style_compiler.rb b/lib/pieces/compilers/style_compiler.rb index abc1234..def5678 100644 --- a/lib/pieces/compilers/style_compiler.rb +++ b/lib/pieces/compilers/style_compiler.rb @@ -17,7 +17,7 @@ def yield_stylesheets(dir) Dir["#{path}/#{dir}/**/*.{css,scss,sass,less}"].reduce('') do |contents, stylesheet| - contents << ::Tilt.new(stylesheet).render + contents << ::Tilt.new(stylesheet, load_paths: ["#{path}/app/assets/stylesheets/"]).render end end end
Add application stylesheets to load path options
diff --git a/lib/coverband/utils/railtie.rb b/lib/coverband/utils/railtie.rb index abc1234..def5678 100644 --- a/lib/coverband/utils/railtie.rb +++ b/lib/coverband/utils/railtie.rb @@ -3,7 +3,6 @@ module Coverband module RailsEagerLoad def eager_load! - Coverband.configuration.logger.debug('Coverband: set to eager_loading') Coverband.eager_loading_coverage! super ensure
Remove eager loading debug statement Seems a little too verbose
diff --git a/lib/rb/lib/thrift/server/httpserver.rb b/lib/rb/lib/thrift/server/httpserver.rb index abc1234..def5678 100644 --- a/lib/rb/lib/thrift/server/httpserver.rb +++ b/lib/rb/lib/thrift/server/httpserver.rb @@ -20,7 +20,7 @@ end response.start(200) do |head, out| head["Content-Type"] = "application/x-thrift" - transport = TIOStreamTransport.new request.body, out + transport = IOStreamTransport.new request.body, out protocol = @protocol_factory.get_protocol transport @processor.process protocol, protocol end @@ -31,7 +31,7 @@ port = opts[:port] || 80 ip = opts[:ip] || "0.0.0.0" path = opts[:path] || "" - protocol_factory = opts[:protocol_factory] || TBinaryProtocolFactory.new + protocol_factory = opts[:protocol_factory] || BinaryProtocolFactory.new @server = Mongrel::HttpServer.new ip, port @server.register "/#{path}", Handler.new(processor, protocol_factory) end
Stop using deprecated classes in SimpleMongrelHTTPServer git-svn-id: 8d8e29b1fb681c884914062b88f3633e3a187774@668962 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/govspeak/link_extractor.rb b/lib/govspeak/link_extractor.rb index abc1234..def5678 100644 --- a/lib/govspeak/link_extractor.rb +++ b/lib/govspeak/link_extractor.rb @@ -0,0 +1,24 @@+module Govspeak + class LinkExtractor + def initialize(govspeak) + @govspeak = govspeak + end + + def links + @links ||= extract_links + end + + private + + def extract_links + processed_govspeak.css('a:not([href^="mailto"])').css('a:not([href^="#"])').map { |link| link['href'] } + end + + def processed_govspeak + doc = Nokogiri::HTML::Document.new + doc.encoding = "UTF-8" + + doc.fragment(Govspeak::Document.new(@govspeak).to_html) + end + end +end
Copy govspeak link extractor from whitehall
diff --git a/lib/osc-ruby/network_packet.rb b/lib/osc-ruby/network_packet.rb index abc1234..def5678 100644 --- a/lib/osc-ruby/network_packet.rb +++ b/lib/osc-ruby/network_packet.rb @@ -12,7 +12,7 @@ @str.length - @index end - def eof? () + def eof?() rem <= 0 end @@ -38,4 +38,4 @@ c end end -end+end
Fix parens for warning in Ruby 2.6.5 Small chance to fix an extra space in the method definition - `def eof? ()` => `def eof?()` (without space) Fixes the warning ``` /.gem/ruby/2.6.5/gems/osc-ruby-1.1.3/lib/osc-ruby/network_packet.rb:15: warning: parentheses after method name is interpreted as an argument list, not a decomposed argument ``` Arguably the empty parens for methods like this could be removed but that's more of a stylistic thing across the whole project.
diff --git a/periscope.gemspec b/periscope.gemspec index abc1234..def5678 100644 --- a/periscope.gemspec +++ b/periscope.gemspec @@ -1,27 +1,22 @@-# -*- encoding: utf-8 -*- -$:.push File.expand_path('../lib', __FILE__) -require 'periscope/version' +# encoding: utf-8 -Gem::Specification.new do |s| - s.name = 'periscope' - s.version = Periscope::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ['Steve Richert'] - s.email = ['steve.richert@gmail.com'] - s.homepage = 'https://github.com/laserlemon/periscope' - s.summary = %(Bring your models' scopes up above the surface.) - s.description = %(Periscope acts like attr_accessible or attr_protected, but for your models' scopes.) +Gem::Specification.new do |gem| + gem.name = 'periscope' + gem.version = '1.0.0' - s.rubyforge_project = 'periscope' + gem.authors = ['Steve Richert'] + gem.email = ['steve.richert@gmail.com'] + gem.description = %(Periscope: like attr_accessible, but for your models' scopes) + gem.summary = %(Bring your models' scopes up above the surface) + gem.homepage = 'https://github.com/laserlemon/periscope' - s.files = `git ls-files`.split("\n") - s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") - s.executables = `git ls-files -- bin/*`.split("\n").map{|f| File.basename(f) } - s.require_paths = ['lib'] + gem.add_dependency 'activesupport', '~> 3.0' - s.add_dependency 'activesupport', '>= 3.0.0' + gem.add_development_dependency 'activerecord', '~> 3.0' + gem.add_development_dependency 'rspec', '~> 2.10' + gem.add_development_dependency 'sqlite3' - s.add_development_dependency 'rspec' - s.add_development_dependency 'sqlite3' - s.add_development_dependency 'activerecord', '>= 3.0.0' + gem.files = `git ls-files`.split($\) + gem.test_files = gem.files.grep(/^spec/) + gem.require_paths = ['lib'] end
Clean up the gemspec and target v1.0.0
diff --git a/periscope.gemspec b/periscope.gemspec index abc1234..def5678 100644 --- a/periscope.gemspec +++ b/periscope.gemspec @@ -10,9 +10,8 @@ gem.summary = gem.description gem.homepage = 'https://github.com/laserlemon/periscope' - gem.add_dependency 'activesupport', '~> 3.0' + gem.add_dependency 'activerecord', '~> 3.0' - gem.add_development_dependency 'activerecord', '~> 3.0' gem.add_development_dependency 'rake', '~> 0.9' gem.add_development_dependency 'rspec', '~> 2.10' gem.add_development_dependency 'sqlite3'
Make activerecord a runtime dependency
diff --git a/lib/tasks/weekly_digester.rake b/lib/tasks/weekly_digester.rake index abc1234..def5678 100644 --- a/lib/tasks/weekly_digester.rake +++ b/lib/tasks/weekly_digester.rake @@ -1,14 +1,20 @@ namespace :weekly_digester do desc "Sends out all weekly digests" - task :mail_all_users => :environment do + task :mail_all_users, [:end_date_days_ago] => :environment do |t, args| + unless args[:end_date_days_ago].blank? || !!(args[:end_date_days_ago] =~ /\A[-+]?[0-9]+\z/) + raise ">>> End date must be an integer! (# of days since end of period)" + end + + end_date_of_period = args[:end_date_days_ago].blank? ? 1 : args[:end_date_days_ago].to_i + initialize_performance_assessments("Processing weekly digests for all users.") User.all.each do |u| - digest = WeeklyEmailDigester.new(u, 1.day.ago) + digest = WeeklyEmailDigester.new(u, end_date_of_period.day.ago) if digest.purchases.blank? - puts "No weekly digest send for User ##{u.id} (No purchases found for previous week)." + puts "No weekly digest send for User ##{u.id}. (No purchases found for time period.)" else UserMailer.weekly_digest(u, digest).deliver @counter += 1
Allow for end_date to be specified in WeeklyDigester task
diff --git a/periscope.gemspec b/periscope.gemspec index abc1234..def5678 100644 --- a/periscope.gemspec +++ b/periscope.gemspec @@ -13,6 +13,7 @@ gem.add_dependency 'activesupport', '~> 3.0' gem.add_development_dependency 'activerecord', '~> 3.0' + gem.add_development_dependency 'rake', '~> 0.9' gem.add_development_dependency 'rspec', '~> 2.10' gem.add_development_dependency 'sqlite3'
Add rake as a development dependency
diff --git a/week-6/gps.rb b/week-6/gps.rb index abc1234..def5678 100644 --- a/week-6/gps.rb +++ b/week-6/gps.rb @@ -0,0 +1,42 @@+# Your Names +# 1) +# 2) + +# We spent [#] hours on this challenge. + +# Bakery Serving Size portion calculator. + +def serving_size_calc(item_to_make, num_of_ingredients) + library = {"cookie" => 1, "cake" => 5, "pie" => 7} + error_counter = 3 + + library.each do |food| + if library[food] != library[item_to_make] + error_counter += -1 + end + end + + if error_counter > 0 + raise ArgumentError.new("#{item_to_make} is not a valid input") + end + + serving_size = library.values_at(item_to_make)[0] + remaining_ingredients = num_of_ingredients % serving_size + + case remaining_ingredients + when 0 + return "Calculations complete: Make #{num_of_ingredients / serving_size} of #{item_to_make}" + else + return "Calculations complete: Make #{num_of_ingredients / serving_size} of #{item_to_make}, you have #{remaining_ingredients} leftover ingredients. Suggested baking items: TODO: MAKE THIS FEATURE" + end +end + +p serving_size_calc("pie", 7) +p serving_size_calc("pie", 8) +p serving_size_calc("cake", 5) +p serving_size_calc("cake", 7) +p serving_size_calc("cookie", 1) +p serving_size_calc("cookie", 10) +p serving_size_calc("THIS IS AN ERROR", 5) + +# Reflection
Add guided file for guide
diff --git a/core/random/default_spec.rb b/core/random/default_spec.rb index abc1234..def5678 100644 --- a/core/random/default_spec.rb +++ b/core/random/default_spec.rb @@ -13,6 +13,28 @@ seed2 = ruby_exe('p Random::DEFAULT.seed', options: '--disable-gems') seed1.should != seed2 end + + ruby_version_is ''...'3.0' do + it "returns a Random instance" do + suppress_warning do + Random::DEFAULT.should be_an_instance_of(Random) + end + end + end + + ruby_version_is '3.0' do + it "refers to the Random class" do + suppress_warning do + Random::DEFAULT.should.equal?(Random) + end + end + + it "is deprecated" do + -> { + Random::DEFAULT.should.equal?(Random) + }.should complain(/constant Random::DEFAULT is deprecated/) + end + end end ruby_version_is '3.2' do
Revert "Remove unnecessary Random::DEFAULT expectations" * This reverts commit e7cef3489a4e06104c73b2d89492259ea2754a97. * These specs are valuable for Ruby implementations, do not remove, cc @nobu.
diff --git a/db/seeds.rb b/db/seeds.rb index abc1234..def5678 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -20,3 +20,5 @@ | Please change this password if you're deploying to a production environment! | +------------------------------------------------------------------------------+ MSG + +Scenario.create!(Scenario.default_attributes)
Create an initial scenario when seeding DB
diff --git a/msfl_visitors.gemspec b/msfl_visitors.gemspec index abc1234..def5678 100644 --- a/msfl_visitors.gemspec +++ b/msfl_visitors.gemspec @@ -1,7 +1,7 @@ Gem::Specification.new do |s| s.name = 'msfl_visitors' - s.version = '0.3.0.dev9' - s.date = '2015-05-20' + s.version = '1.0.0' + s.date = '2015-05-27' s.summary = "Convert MSFL to other forms" s.description = "Visitor pattern approach to converting MSFL to other forms." s.authors = ["Courtland Caldwell"]
Update v to 1.0.0 in prep for QA release
diff --git a/lib/asciidoctor-diagram/util/svg.rb b/lib/asciidoctor-diagram/util/svg.rb index abc1234..def5678 100644 --- a/lib/asciidoctor-diagram/util/svg.rb +++ b/lib/asciidoctor-diagram/util/svg.rb @@ -11,6 +11,12 @@ height = h[:value].to_i * to_px_factor(h[:unit]) return [width.to_i, height.to_i] end + + if v = VIEWBOX_REGEX.match(start_tag) + width = v[:width] + height = v[:height] + return [width.to_i, height.to_i] + end end nil @@ -21,6 +27,7 @@ START_TAG_REGEX = /<svg[^>]*>/ WIDTH_REGEX = /width="(?<value>\d+)(?<unit>[a-zA-Z]+)"/ HEIGHT_REGEX = /height="(?<value>\d+)(?<unit>[a-zA-Z]+)"/ + VIEWBOX_REGEX = /viewBox="\d+ \d+ (?<width>\d+) (?<height>\d+)"/ def self.to_px_factor(unit) case unit
Add support for SVG viewbox based width/height extraction
diff --git a/lib/committee/rails/test/methods.rb b/lib/committee/rails/test/methods.rb index abc1234..def5678 100644 --- a/lib/committee/rails/test/methods.rb +++ b/lib/committee/rails/test/methods.rb @@ -8,12 +8,8 @@ def committee_options if defined?(RSpec) && (options = RSpec.try(:configuration).try(:committee_options)) options - elsif !defined?(@committee_schema) - { schema: default_schema } else - # schema_url_prefix method call this but the user overrite committee_schema, we got error - # we can remove in comittee 3.x - { schema: committee_schema } + { schema_path: default_schema } end end
Remove codes about committee 2.x
diff --git a/lib/tasks/seed_migration_tasks.rake b/lib/tasks/seed_migration_tasks.rake index abc1234..def5678 100644 --- a/lib/tasks/seed_migration_tasks.rake +++ b/lib/tasks/seed_migration_tasks.rake @@ -22,10 +22,4 @@ SeedMigration::Migrator.new(path).down end end - - desc "Import old data migrations" - task :bootstrap => :environment do - path = SeedMigration::Migrator.migration_path("20140313133343_insert_prior_data_migrations.rb") - SeedMigration::Migrator.new(path).up - end end
Move rake data:bootstrap to our main repo
diff --git a/test/test_reporter.rb b/test/test_reporter.rb index abc1234..def5678 100644 --- a/test/test_reporter.rb +++ b/test/test_reporter.rb @@ -17,7 +17,9 @@ e.message.each_line { |line| print_with_info_padding(line) } trace = filter_backtrace(e.backtrace) - trace.each { |line| print_with_info_padding(line) } + + # TODO: Use the proper MiniTest way of customizing the filter + trace.each { |line| print_with_info_padding(line) unless line =~ /\.rvm|gems|_run_anything/ } end end
Add manual filter to backtrace
diff --git a/features/step_definitions/profile_steps.rb b/features/step_definitions/profile_steps.rb index abc1234..def5678 100644 --- a/features/step_definitions/profile_steps.rb +++ b/features/step_definitions/profile_steps.rb @@ -7,8 +7,8 @@ end Then(/^I see my goal and goal date is blank$/) do - expect(profile_page.goal_statement.value).to eql('') - expect(profile_page.goal_deadline.value).to eql('') + expect(profile_page.goal_statement.value).to be_empty + expect(profile_page.goal_deadline.value).to be_empty end When(/^I set a new goal and goal date$/) do
Use `be_empty` instead of `eql('')`.
diff --git a/scss-lint.gemspec b/scss-lint.gemspec index abc1234..def5678 100644 --- a/scss-lint.gemspec +++ b/scss-lint.gemspec @@ -17,7 +17,7 @@ s.executables = ['scss-lint'] s.files = Dir['config/**/*.yml'] + - Dir['data/**'] + + Dir['data/**/*'] + Dir['lib/**/*.rb'] s.required_ruby_version = '>= 1.9.3'
Fix glob for data directory This was only including files in the `data` directory, excluding subdirectories. Change-Id: I8a276678e0cd495196c11808ad3e3e0cdddf5c9b Reviewed-on: http://gerrit.causes.com/40952 Tested-by: jenkins <d95b56ce41a2e1ac4cecdd398defd7414407cc08@causes.com> Reviewed-by: Shane da Silva <67fb7bfe39f841b16a1f86d3928acc568d12c716@brigade.com>
diff --git a/test/integration/flows/minimum_wage_calculator_employers_test.rb b/test/integration/flows/minimum_wage_calculator_employers_test.rb index abc1234..def5678 100644 --- a/test/integration/flows/minimum_wage_calculator_employers_test.rb +++ b/test/integration/flows/minimum_wage_calculator_employers_test.rb @@ -12,4 +12,7 @@ should "ask 'what would you like to check?'" do assert_current_node :what_would_you_like_to_check? end + + # This is the employer version of the shared minimum wage calculator. + # The full flow is tested in the employee version. end
Add comment explaining the brevity of this test
diff --git a/test/unit/test_helper.rb b/test/unit/test_helper.rb index abc1234..def5678 100644 --- a/test/unit/test_helper.rb +++ b/test/unit/test_helper.rb @@ -7,6 +7,7 @@ require 'pantry' Pantry.logger.disable! +#Pantry.config.log_level = :debug class Minitest::Test
Document in unit tests how to turn on debug logging
diff --git a/app/models/project.rb b/app/models/project.rb index abc1234..def5678 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -12,12 +12,12 @@ def calculate_pace_needed_w_per_day_date wc_diff = self.wordcount_goal - self.current_wordcount date_diff = self.goal_deadline_date.mjd - Date.today.mjd - wc_diff / date_diff + "#{wc_diff / date_diff} words per day" end def calculate_pace_needed_w_per_day_hours wc_diff = self.wordcount_goal - self.current_wordcount time_to_write = self.goal_time_limit - wc_diff / time_to_write + "#{wc_diff / time_to_write} words per hour" end end
Update pace calculations to display pace unit along with pace number.
diff --git a/allen.gemspec b/allen.gemspec index abc1234..def5678 100644 --- a/allen.gemspec +++ b/allen.gemspec @@ -14,4 +14,6 @@ gem.name = "allen" gem.require_paths = ["lib"] gem.version = Allen::VERSION + + gem.add_runtime_dependency(%q<thor>, [">= 0.16.0"]) end
Add thor dependency to gemspec
diff --git a/ecology.gemspec b/ecology.gemspec index abc1234..def5678 100644 --- a/ecology.gemspec +++ b/ecology.gemspec @@ -21,7 +21,7 @@ s.rubyforge_project = "ecology" ignores = File.readlines(".gitignore").grep(/\S+/).map {|pattern| pattern.chomp } - dotfiles = [".gemtest", ".gitignore", ".rspec", ".yardopts"] + dotfiles = Dir[".*"] s.files = Dir["**/*"].reject {|f| File.directory?(f) || ignores.any? {|i| File.fnmatch(i, f) } } + dotfiles s.test_files = s.files.grep(/^spec\//)
Fix gemspecs to allow 'rake build' successfully
diff --git a/econfig.gemspec b/econfig.gemspec index abc1234..def5678 100644 --- a/econfig.gemspec +++ b/econfig.gemspec @@ -18,6 +18,7 @@ gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) gem.require_paths = ["lib"] + gem.add_development_dependency "rake" gem.add_development_dependency "rspec" gem.add_development_dependency "activerecord" gem.add_development_dependency "sqlite3"
Add rake as development dependency
diff --git a/lib/kosmos/packages/mk2_cockpit_interior.rb b/lib/kosmos/packages/mk2_cockpit_interior.rb index abc1234..def5678 100644 --- a/lib/kosmos/packages/mk2_cockpit_interior.rb +++ b/lib/kosmos/packages/mk2_cockpit_interior.rb @@ -0,0 +1,8 @@+class Mk2CockpitInterior < Kosmos::Package + title 'Mk2 Cockpit Interior' + url 'http://kerbalspaceport.com/wp/wp-content/themes/kerbal/inc/download.php?f=uploads/2013/12/SH-MK2Cockpit.zip' + + def install + merge_directory 'GameData' + end +end
Add a package for the Mk2 Cockpit Interior. It turns out that the URL for Curseforge downloads is malformed because of a backslash, but that backslash can be replaced with a forward slash and everything works well again.
diff --git a/lib/aozorasearch.rb b/lib/aozorasearch.rb index abc1234..def5678 100644 --- a/lib/aozorasearch.rb +++ b/lib/aozorasearch.rb @@ -3,6 +3,7 @@ require "aozorasearch/groonga_searcher" require "aozorasearch/loader" require "aozorasearch/book" +require "aozorasearch/command" module Aozorasearch end
Add missing require for web/app.rb
diff --git a/lib/vines/web.rb b/lib/vines/web.rb index abc1234..def5678 100644 --- a/lib/vines/web.rb +++ b/lib/vines/web.rb @@ -2,3 +2,13 @@ require 'vines/web/version' require 'vines/web/command/init' require 'vines/web/command/install' + +module Vines + module Web + def self.paths + js = File.expand_path('../../../app/assets/javascripts', __FILE__) + css = File.expand_path('../../../app/assets/stylesheets', __FILE__) + [js, css] + end + end +end
Add paths method for assets.
diff --git a/Casks/charles-beta.rb b/Casks/charles-beta.rb index abc1234..def5678 100644 --- a/Casks/charles-beta.rb +++ b/Casks/charles-beta.rb @@ -0,0 +1,15 @@+cask :v1 => 'charles-beta' do + version '3.10b6' + sha256 'a8c59900a81299a40751837029c5cab41810f5527d7186da244572b676c18606' + + url "http://www.charlesproxy.com/assets/release/#{version.gsub(/b\d$/, '')}/charles-proxy-#{version}-applejava.dmg" + homepage 'http://www.charlesproxy.com/download/beta/' + license :commercial + + app 'Charles.app' + + zap :delete => [ + '~/Library/Application Support/Charles', + '~/Library/Preferences/com.xk72.charles.config', + ] +end
Add Charles.app beta version 3.10b6
diff --git a/Casks/kanmusmemory.rb b/Casks/kanmusmemory.rb index abc1234..def5678 100644 --- a/Casks/kanmusmemory.rb +++ b/Casks/kanmusmemory.rb @@ -0,0 +1,12 @@+cask :v1 => 'kanmusmemory' do + version '0.15' + sha256 'af64ae0846ab0b4366693bc602a81ba7e626bafee820862594c4bcbf92acfcef' + + url "http://relog.xii.jp/download/kancolle/KanmusuMemory-#{version}-mac.dmg" + appcast 'https://github.com/ioriayane/KanmusuMemory/releases.atom' + name 'KanmusuMemory' + homepage 'http://relog.xii.jp/mt5r/2013/08/post-349.html' + license :apache + + app 'KanmusuMemory.app' +end
Add a cask for Kancolle
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 @@ -0,0 +1,20 @@+cask :v1 => 'phpstorm-eap' do + version '139.873' + sha256 '8405a198ee9720e05f0b589367514ae4b86bb28064cd7d2a9cc9a015b30a53c3' + + url "http://download.jetbrains.com/webide/PhpStorm-EAP-#{version}.dmg" + homepage 'http://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Early+Access+Program' + license :commercial + + app 'PhpStorm EAP.app' + + postflight do + plist_set(':JVMOptions:JVMVersion', '1.6+') + end + + zap :delete => [ + '~/Library/Application Support/WebIde80', + '~/Library/Preferences/WebIde80', + '~/Library/Preferences/com.jetbrains.PhpStorm.plist', + ] +end
Add PhpStorm EAP v139.873 Cask
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 @@ -2,19 +2,28 @@ version '141.1717' sha256 'af6087323b15205d10ede18e4aea176c6dab569adc47d0eb00d4de07ad88693d' - url "http://download.jetbrains.com/webide/PhpStorm-EAP-#{version}.dmg" - homepage 'http://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Early+Access+Program' + url "https://download.jetbrains.com/webide/PhpStorm-EAP-#{version}.dmg" + name 'PhpStorm EAP' + homepage 'https://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Early+Access+Program' license :commercial app 'PhpStorm EAP.app' - postflight do - plist_set(':JVMOptions:JVMVersion', '1.6+') - end + zap :delete => [ + '~/Library/Application Support/WebIde90', + '~/Library/Caches/WebIde90', + '~/Library/Logs/WebIde90', + '~/Library/Preferences/WebIde90', + '~/Library/Preferences/com.jetbrains.PhpStorm-EAP.plist', + '~/.WebIde90', + ] - zap :delete => [ - '~/Library/Application Support/WebIde80', - '~/Library/Preferences/WebIde80', - '~/Library/Preferences/com.jetbrains.PhpStorm-EAP.plist', - ] + caveats <<-EOS.undent + #{token} requires Java 6 like any other IntelliJ-based IDE. + You can install it with + brew cask install caskroom/homebrew-versions/java6 + The vendor (JetBrains) doesn't support newer versions of Java (yet) + due to several critical issues, see details at + https://intellij-support.jetbrains.com/entries/27854363 + EOS end
Upgrade PhpStorm EAP to 141.1717 Upgrade PhpStorm EAP to 141.1717 - feedback from @sebroeder & @vitorgalvao
diff --git a/spec/cli_spec.rb b/spec/cli_spec.rb index abc1234..def5678 100644 --- a/spec/cli_spec.rb +++ b/spec/cli_spec.rb @@ -2,7 +2,8 @@ require "bower2gem/cli" describe Bower2Gem::CLI do - it "does something useful" do - expect { Bower2Gem::CLI.new }.to output("dist/rome.js\n").to_stdout + it "downloads javascript file" do + Bower2Gem::CLI.new + expect(File).to exist("vendor/assets/rome.js") end end
Update test for File Downloader
diff --git a/Formula/barty_crouch.rb b/Formula/barty_crouch.rb index abc1234..def5678 100644 --- a/Formula/barty_crouch.rb +++ b/Formula/barty_crouch.rb @@ -0,0 +1,16 @@+class BartyCrouch < Formula + desc "Localization/I18n: Incrementally update/translate your Strings files from .swift, .h, .m(m), .storyboard or .xib files." + homepage "https://github.com/Flinesoft/BartyCrouch" + url "https://github.com/Flinesoft/BartyCrouch.git", :tag => "4.0.0-alpha.1", :revision => "4c27662f0800bea9263748fe4e62c163ea9de7f6" + head "https://github.com/Flinesoft/BartyCrouch.git" + + depends_on :xcode => ["10.0", :build] + + def install + system "make", "install", "prefix=#{prefix}" + end + + test do + system "#{bin}/bartycrouch" + end +end
Add Homebrew formula that should work according to NSHipster
diff --git a/runtime/spec/language/variables_spec.rb b/runtime/spec/language/variables_spec.rb index abc1234..def5678 100644 --- a/runtime/spec/language/variables_spec.rb +++ b/runtime/spec/language/variables_spec.rb @@ -36,4 +36,11 @@ a, = 1,2 a.should == 1 end + + it "allows safe parallel swapping" do + a, b = 1, 2 + a, b = b, a + a.should == 2 + b.should == 1 + end end
Add specs to test safe parallel swapping
diff --git a/scripts/make-time-blocks.rb b/scripts/make-time-blocks.rb index abc1234..def5678 100644 --- a/scripts/make-time-blocks.rb +++ b/scripts/make-time-blocks.rb @@ -0,0 +1,31 @@+#!/usr/bin/env ruby +# Split the remainder of the day into 30min blocks. + +if __FILE__ == $PROGRAM_NAME + hour = Time.now.hour + min = Time.now.min + puts "Current : #{hour}:#{min}" + + prefix = "\t" + chunk = 0 + block = 0 + + # hour 0..23 + hours_left = 24 - hour + #aval_chunks = hours_left * 2 + #aval_blocks = aval_chunks / 3 + #puts "Blocks available #{aval_blocks}" + + until hour == 24 + printf("Block [%d]\n",block) + for i in [0,1] + printf("\t%d:%02d\n",hour,i*30) + chunk+=1 + if chunk == 3 + chunk = 0 + end + end + hour += 1 + block += 1 + end +end
Add script time block script. (Divide the day into 30min blocks)
diff --git a/git_info.rb b/git_info.rb index abc1234..def5678 100644 --- a/git_info.rb +++ b/git_info.rb @@ -40,6 +40,7 @@ def issue_refs merge_base = `git merge-base HEAD master`.chomp + `git log #{merge_base}..HEAD --format='%b' | grep refs`. gsub('refs', '').gsub(',', '').gsub('#', ''). strip.split(/\s+/).uniq.sort_by { |ref| ref.to_i }
Add empty line for easier reading
diff --git a/BKHitSlop.podspec b/BKHitSlop.podspec index abc1234..def5678 100644 --- a/BKHitSlop.podspec +++ b/BKHitSlop.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "BKHitSlop" - s.version = "0.0.1" + s.version = "1.0.0" s.summary = "A simple swizzle to allow UIViews to respond to touches outside their visible bounds." s.description = <<-DESC This is mostly useful for UIButtons for which a specific size/positioning is desired, but which should also be responsive to touches outside of its drawn area.
Update Pod version to 1.0.0 for initial release The 1.0.0 tag will point to this.
diff --git a/lib/partial_ks/all_rails_models.rb b/lib/partial_ks/all_rails_models.rb index abc1234..def5678 100644 --- a/lib/partial_ks/all_rails_models.rb +++ b/lib/partial_ks/all_rails_models.rb @@ -1,6 +1,6 @@ module PartialKs def self.all_rails_models - if defined?(Rails) + if defined?(Rails) && Rails.respond_to?(:application) ::Rails.application.eager_load! ::Rails::Engine.subclasses.map(&:eager_load!) end
Fix a failing test where Rails in our tests is not fully loaded, so don't bother calling it in our specs
diff --git a/lib/stacks/loadbalancer_cluster.rb b/lib/stacks/loadbalancer_cluster.rb index abc1234..def5678 100644 --- a/lib/stacks/loadbalancer_cluster.rb +++ b/lib/stacks/loadbalancer_cluster.rb @@ -0,0 +1,35 @@+require 'stacks/namespace' +require 'stacks/machine_def_container' +require 'stacks/app_server' +require 'stacks/nat' +require 'uri' + +module Stacks::LoadBalancerCluster + + def self.extended(object) + object.configure() + end + + def configure() + end + + def depends_on + virtual_services(Stacks::AbstractVirtualService).map do |machine| + machine.name + end + end + + def virtual_services(type) + virtual_services = [] + environment.accept do |node| + unless node.environment.contains_node_of_type?(Stacks::LoadBalancer) && environment != node.environment + virtual_services << node if node.kind_of? type + end + end + virtual_services + end + + def clazz + return 'loadbalancercluster' + end +end
rpearce/jheister: Add LB Balancer Cluster class
diff --git a/src/collection.rb b/src/collection.rb index abc1234..def5678 100644 --- a/src/collection.rb +++ b/src/collection.rb @@ -29,7 +29,7 @@ # now we have to go looking for the accept @accept = REXML::XPath.match(input, './app:accept', $appNS) - @accept = @accept.collect { |a| a.texts.join } + @accept = @accept.collect{ |a| a.texts.join.split(/,\s*/) }.flatten if @accept.empty? @accept = [ "entry" ]
Patch from Ben Lund to handle accept ranges properly.
diff --git a/boxer.gemspec b/boxer.gemspec index abc1234..def5678 100644 --- a/boxer.gemspec +++ b/boxer.gemspec @@ -22,6 +22,7 @@ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ['lib'] + s.add_development_dependency 'bundler', '>= 1.0.10' s.add_development_dependency 'rspec', '>= 2.0.0' s.add_runtime_dependency 'activesupport', '>= 3.0.0' end
Include bundler as a dev dependency.
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 @@ -9,4 +9,11 @@ end end + describe "GET #show" do + before {get :show } + it "renders standard user profile if not admin" do + + it { should render_template("/user/show")} + end + end end
Add logic for which profile page shows
diff --git a/spec/integration/source_sync_data_spec.rb b/spec/integration/source_sync_data_spec.rb index abc1234..def5678 100644 --- a/spec/integration/source_sync_data_spec.rb +++ b/spec/integration/source_sync_data_spec.rb @@ -0,0 +1,15 @@+require 'spec_helper' +require 'contextio' + +describe "Syncing data for a source" do + let(:api) { double(:api) } + subject { ContextIO::Source.new(api, resource_url: 'resource url') } + + before do + allow(api).to receive(:request).and_return({foo: 'bar'}) + end + + it "initializes a SourceSyncData correctly" do + expect { subject.sync_data }.to_not raise_exception + end +end
Add test that proves the fix works.
diff --git a/spec/services/application_service_spec.rb b/spec/services/application_service_spec.rb index abc1234..def5678 100644 --- a/spec/services/application_service_spec.rb +++ b/spec/services/application_service_spec.rb @@ -6,8 +6,8 @@ describe "#application_name" do it "returns the application name defined in the dmproadmap.rb initializer" do - Rails.configuration.x.application.name = "foo" - expect(described_class.application_name).to eql("foo") + Rails.configuration.x.application.name = "Foo" + expect(described_class.application_name).to eql("Foo") end it "returns the Rails application name if no dmproadmap.rb initializer entry" do Rails.configuration.x.application.delete(:name)
Fix Spec related to the previous commit
diff --git a/spec/services/staff/authenticator_spec.rb b/spec/services/staff/authenticator_spec.rb index abc1234..def5678 100644 --- a/spec/services/staff/authenticator_spec.rb +++ b/spec/services/staff/authenticator_spec.rb @@ -16,5 +16,11 @@ m = build(:staff_member, password: nil) expect(Staff::Authenticator.new(m).authenticate(nil)).to be_falsey end + + example '停止フラグが立っていればfalseを返す' do + m = build(:staff_member, suspended: true) + expect(Staff::Authenticator.new(m).authenticate('pw')).to be_falsey + end + end end
Add Spec in suspended true
diff --git a/spec/views/admin/attachments/show_spec.rb b/spec/views/admin/attachments/show_spec.rb index abc1234..def5678 100644 --- a/spec/views/admin/attachments/show_spec.rb +++ b/spec/views/admin/attachments/show_spec.rb @@ -10,7 +10,6 @@ it "displays urls to file" do assign(:attachment, attachment) render - puts rendered aggregate_failures do expect(rendered).to have_selector("label:contains('URL') + p:contains('/attachment/#{attachment.id}/show')") expect(rendered).to have_selector("label:contains('Download-URL') + p:contains('/attachment/#{attachment.id}/download')")
chore: Remove unnecessary puts from spec
diff --git a/Casks/sqwiggle.rb b/Casks/sqwiggle.rb index abc1234..def5678 100644 --- a/Casks/sqwiggle.rb +++ b/Casks/sqwiggle.rb @@ -1,7 +1,7 @@ class Sqwiggle < Cask url 'https://www.sqwiggle.com/download/mac' homepage 'https://www.sqwiggle.com' - version '0.4.2' - sha1 '15c49c5443780749ca833605bd61f9ee0b4d8105' + version 'latest' + no_checksum link 'Sqwiggle.app' end
Modify for no version or checksum since no specific version.
diff --git a/app/middleware/push_backend.rb b/app/middleware/push_backend.rb index abc1234..def5678 100644 --- a/app/middleware/push_backend.rb +++ b/app/middleware/push_backend.rb @@ -29,7 +29,7 @@ def call(env) if Faye::WebSocket.websocket?(env) - ws = Faye::WebSocket.new(env, nil, { ping: KEEPALIVE_TIME }) + ws = Faye::WebSocket.new(env) ws.on :open do |event| p [:open, ws.object_id] clients << ws
Revert "Using the recommended setup." This reverts commit 311913f1acf62147d2f481791d6f965791993073.
diff --git a/models/cup_group.rb b/models/cup_group.rb index abc1234..def5678 100644 --- a/models/cup_group.rb +++ b/models/cup_group.rb @@ -6,7 +6,11 @@ matches.map { |match| [match.host_team, match.rival_team] }.flatten.uniq end - def positions + def positions_table GroupPosition.select.select_append{ Sequel.as(goals - received_goals, :diff)}.where(group_id: id).order(:points, :diff).all end + + def matches_table + Match.where(group_id: id).order(:start_datetime).all + end end
Fix method name, add matches table method
diff --git a/app/models/web_content_item.rb b/app/models/web_content_item.rb index abc1234..def5678 100644 --- a/app/models/web_content_item.rb +++ b/app/models/web_content_item.rb @@ -12,7 +12,7 @@ end CONTENT_ITEM_METHODS = [ - :content_id, :description, :analytics_identifier, :title + :content_id, :description, :analytics_identifier, :title, :public_updated_at ] def_delegators :@content_item, *CONTENT_ITEM_METHODS
Update WebContentItem to include public_updated_at method
diff --git a/lib/generators/refinery_theme/refinery_theme_generator.rb b/lib/generators/refinery_theme/refinery_theme_generator.rb index abc1234..def5678 100644 --- a/lib/generators/refinery_theme/refinery_theme_generator.rb +++ b/lib/generators/refinery_theme/refinery_theme_generator.rb @@ -12,12 +12,12 @@ copy_file "views/pages/show.html.erb", "themes/#{theme_name}/views/pages/show.html.erb" copy_file "views/pages/home.html.erb", "themes/#{theme_name}/views/pages/home.html.erb" - if RefinerySetting.theme.nil? - RefinerySetting.find_or_set(:theme, theme_name) - puts "NOTE: \"theme\" setting created and set to #{theme_name}" - else - puts 'NOTE: If you want this new theme to be the current theme used, set the "theme" setting in the Refinery backend to the name of this theme.' unless RAILS_ENV == "test" - end + if RefinerySetting.get(:theme).nil? + RefinerySetting.set(:theme, theme_name) + puts "NOTE: \"theme\" setting created and set to #{theme_name}" + else + puts 'NOTE: If you want this new theme to be the current theme used, set the "theme" setting in the Refinery backend to the name of this theme.' unless RAILS_ENV == "test" + end end end
Fix error when checking for non-existent "theme" setting
diff --git a/transform_collections_test.rb b/transform_collections_test.rb index abc1234..def5678 100644 --- a/transform_collections_test.rb +++ b/transform_collections_test.rb @@ -2,7 +2,7 @@ require 'minitest/autorun' require 'minitest/pride' -class TransformCollectionTest < Minitest::Test +class TransformCollectionsTest < Minitest::Test def test_capitalize names = %w(alice bob charlie) capitalized_names = []
Fix typo in test suite name
diff --git a/spec/lib/cuttlefish_smtp_server_spec.rb b/spec/lib/cuttlefish_smtp_server_spec.rb index abc1234..def5678 100644 --- a/spec/lib/cuttlefish_smtp_server_spec.rb +++ b/spec/lib/cuttlefish_smtp_server_spec.rb @@ -11,4 +11,12 @@ connection.receive_message end end + + describe "#receive_plain_auth" do + let(:app) { App.create!(name: "test") } + let(:connection) { CuttlefishSmtpConnection.new('') } + it { expect(connection.receive_plain_auth("foo", "bar")).to eq false } + it { expect(connection.receive_plain_auth(app.smtp_username, "bar")).to eq false } + it { expect(connection.receive_plain_auth(app.smtp_username, app.smtp_password)).to eq true } + end end
Add simple test for smtp authentication
diff --git a/spec/ruby_tokenizer_spec.rb b/spec/ruby_tokenizer_spec.rb index abc1234..def5678 100644 --- a/spec/ruby_tokenizer_spec.rb +++ b/spec/ruby_tokenizer_spec.rb @@ -24,5 +24,9 @@ it "returns a String" do expect(token.filter).to be_a_kind_of String end + + it "filters tokens" do + expect(token.filter).to be == 'searching records is a common requirement in web applications' + end end end
Test that filter method returns the expected string
diff --git a/jpp.gemspec b/jpp.gemspec index abc1234..def5678 100644 --- a/jpp.gemspec +++ b/jpp.gemspec @@ -11,6 +11,8 @@ s.email = 'benton.porter@gmail.com' s.require_paths = ['ext', 'lib'] s.executables = 'jpp' + s.files = Dir['Rakefile', '{bin,ext,lib,test}/**/*', 'README*', 'LICENSE*'] + s.add_dependency 'json' - s.files = Dir['Rakefile', '{bin,ext,lib,test}/**/*', 'README*', 'LICENSE*'] -end+ s.add_development_dependency 'rake' +end
Add rake as a development dependency