diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/lib/svnx/blame/command.rb b/lib/svnx/blame/command.rb index abc1234..def5678 100644 --- a/lib/svnx/blame/command.rb +++ b/lib/svnx/blame/command.rb @@ -5,7 +5,7 @@ require 'svnx/base/command' module Svnx::Blame - class Command < Svnx::Base::Command + class Command < Svnx::Base::EntriesCommand caching end end
Change blame to xml output.
diff --git a/thor-foodcritic.gemspec b/thor-foodcritic.gemspec index abc1234..def5678 100644 --- a/thor-foodcritic.gemspec +++ b/thor-foodcritic.gemspec @@ -13,7 +13,7 @@ s.license = "Apache 2.0" s.files = `git ls-files`.split("\n") s.require_paths = ["lib"] - s.required_ruby_version = ">= 1.9.1" + s.required_ruby_version = ">= 2.1" s.add_runtime_dependency 'thor' s.add_runtime_dependency 'foodcritic', '~> 4.0'
Drop support for Ruby 2.0 and 1.9 They’re both EOL Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/spec/features/issues/search_bar_spec.rb b/spec/features/issues/search_bar_spec.rb index abc1234..def5678 100644 --- a/spec/features/issues/search_bar_spec.rb +++ b/spec/features/issues/search_bar_spec.rb @@ -0,0 +1,55 @@+require 'rails_helper' + +describe 'Search bar', feature: true do + include WaitForAjax + + let!(:project) { create(:project) } + let!(:group) { create(:group) } + let!(:user) { create(:user) } + + before do + project.team << [user, :master] + group.add_developer(user) + login_as(user) + create(:issue, project: project) + + visit namespace_project_issues_path(project.namespace, project) + end + + describe 'clear search button', js: true do + it 'clears text' do + search_text = 'search_text' + filtered_search = find('.filtered-search') + filtered_search.set(search_text) + + expect(filtered_search.value).to eq(search_text) + find('.filtered-search-input-container .clear-search').click + expect(filtered_search.value).to eq('') + end + + it 'hides by default' do + expect(page).to have_css('.clear-search', visible: false) + end + + it 'hides after clicked' do + filtered_search = find('.filtered-search') + filtered_search.set('a') + find('.filtered-search-input-container .clear-search').click + expect(page).to have_css('.clear-search', visible: false) + end + + it 'hides when there is no text' do + filtered_search = find('.filtered-search') + filtered_search.set('a') + filtered_search.set('') + expect(page).to have_css('.clear-search', visible: false) + end + + it 'shows when there is text' do + filtered_search = find('.filtered-search') + filtered_search.set('a') + + expect(page).to have_css('.clear-search', visible: true) + end + end +end
Add specs for clear search button
diff --git a/spec/unit/resource/windows_path_spec.rb b/spec/unit/resource/windows_path_spec.rb index abc1234..def5678 100644 --- a/spec/unit/resource/windows_path_spec.rb +++ b/spec/unit/resource/windows_path_spec.rb @@ -28,7 +28,7 @@ expect(subject.resource_name).to eql(:windows_path) end - it "sets the path as it's name" do + it "sets the path as its name" do expect(subject.path).to eql("some_path") end
Fix typo in path specs Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/omnibus_overrides.rb b/omnibus_overrides.rb index abc1234..def5678 100644 --- a/omnibus_overrides.rb +++ b/omnibus_overrides.rb @@ -4,7 +4,7 @@ # override :erlang, version: "22.2" override :rubygems, version: "3.0.3" -override :bundler, version: "1.17.2" # pin to avoid double bundle error +override :bundler, version: "1.17.3" # pin to avoid double bundle error override :'omnibus-ctl', version: "master" override :chef, version: "v15.17.4" override :ohai, version: "v15.12.0"
Bump the bundler pin to the new shipped version Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/spec/langify/save_yaml_spec.rb b/spec/langify/save_yaml_spec.rb index abc1234..def5678 100644 --- a/spec/langify/save_yaml_spec.rb +++ b/spec/langify/save_yaml_spec.rb @@ -3,6 +3,8 @@ describe Langify::SaveYaml do let(:yml) { Langify::SaveYaml.new({lang: 'nl', file: 'profile', path: 'profile'}, "Profiel") } + let(:ymlm) { Langify::SaveYaml.new({lang: 'nl', file: 'profile', path: 'profile.username'}, "Gebruikersnaam") } + let(:ymla) { Langify::SaveYaml.new({lang: 'nl', file: 'profile', path: 'profile.last_name'}, "Achternaam", { nl: { profile: { username: "Gebruikersnaam" } } } ) } before(:all) do FileUtils::mkdir_p("#{Dir.pwd}/tmp/config/locale") @@ -24,4 +26,19 @@ it 'should be able to generate a valid yaml hash' do expect(yml.to_hash).to eq({nl: {profile: "Profiel"}}) end + + it 'should allow for multiple keys' do + expect(ymlm.to_hash).to eq({nl: {profile: {username: "Gebruikersnaam"}}}) + end + + it 'should be smart enough to respect existing hashes' do + expect(ymla.to_hash).to eq({ + nl: { + profile: { + username: "Gebruikersnaam", + last_name: "Achternaam" + } + } + }) + end end
Add more tests to test different scenarious we can expect
diff --git a/Casks/paintcode.rb b/Casks/paintcode.rb index abc1234..def5678 100644 --- a/Casks/paintcode.rb +++ b/Casks/paintcode.rb @@ -0,0 +1,7 @@+class Paintcode < Cask + url 'http://download.macheist.com/nano4/pc.zip' + homepage 'http://www.paintcodeapp.com/' + version '1.3.4' + sha256 '84e3794458851f42783fb8bebc53a8ca5bd068ddb5ef7fedb27db52e989e39a6' + link 'PaintCode.app' +end
Add direct download version of PaintCode 1.3.4 PaintCode was available through a recent MacHeist bundle, where it was made available as a direct download for the first time -- the normal distribution method is Mac App Store. This cask can be used for non-MAS owners of PaintCode to access the direct download version.
diff --git a/lib/elastic_search_registerer.rb b/lib/elastic_search_registerer.rb index abc1234..def5678 100644 --- a/lib/elastic_search_registerer.rb +++ b/lib/elastic_search_registerer.rb @@ -10,7 +10,7 @@ http_client.put(index_path, index_settings) http_client.put(mapping_path(mapping), json_mapping(mapping)) rescue Faraday::Error::ClientError => e - fail e unless e.response.fetch(:body).include?("already exists") + fail e unless e.response.fetch(:body).match(/already exists/i) end private
Fix case sensitivity in rescue of exceptions As this can differ across platforms.
diff --git a/lib/jmespath/nodes/projection.rb b/lib/jmespath/nodes/projection.rb index abc1234..def5678 100644 --- a/lib/jmespath/nodes/projection.rb +++ b/lib/jmespath/nodes/projection.rb @@ -11,7 +11,8 @@ if (targets = extract_targets(@target.visit(value))) list = [] targets.each do |v| - if (vv = @projection.visit(v)) + vv = @projection.visit(v) + unless vv.nil? list << vv end end
Fix a bug in Projection It shouldn't skip false values, just nil values
diff --git a/app/models/search.rb b/app/models/search.rb index abc1234..def5678 100644 --- a/app/models/search.rb +++ b/app/models/search.rb @@ -21,7 +21,7 @@ def matches_by_tag tags = ActsAsTaggableOn::Tag.joins(:taggings) - .where(name: keywords, taggings: { taggable_type: klass }) + .where(name: keywords, taggings: { taggable_type: klass.name }) .uniq tags.flat_map(&:taggings)
Fix Search for Rails 5.
diff --git a/lib/s3_relay/upload_presigner.rb b/lib/s3_relay/upload_presigner.rb index abc1234..def5678 100644 --- a/lib/s3_relay/upload_presigner.rb +++ b/lib/s3_relay/upload_presigner.rb @@ -0,0 +1,59 @@+module S3Relay + class UploadPresigner < S3Relay::Base + + attr_reader :expires, :uuid + + def initialize(options={}) + @expires = (options[:expires] || 1.minute.from_now).utc.xmlschema + @uuid = SecureRandom.uuid + end + + def form_data + fields.keys.inject({}) { |h,k| h[k.downcase.underscore] = fields[k]; h } + .merge( + "endpoint" => endpoint, + "policy" => encoded_policy, + "signature" => signature, + "uuid" => uuid + ) + end + + private + + def fields + { + "AWSAccessKeyID" => ACCESS_KEY_ID, + "x-amz-server-side-encryption" => "AES256", + "key" => "#{uuid}/${filename}", + "success_action_status" => "201", + "acl" => ACL + } + end + + def hmac + lambda { |data| OpenSSL::HMAC.digest(digest, SECRET_ACCESS_KEY, data) } + end + + def policy_document + { + "expiration" => expires, + "conditions" => [ + { "bucket" => BUCKET }, + { "acl" => ACL }, + { "x-amz-server-side-encryption" => "AES256" }, + { "success_action_status" => "201" }, + ["starts-with", "$key", "#{uuid}/"] + ] + } + end + + def encoded_policy + Base64.strict_encode64(policy_document.to_json) + end + + def signature + Base64.strict_encode64(hmac[encoded_policy]) + end + + end +end
Add UploadPresigner class to generate form data.
diff --git a/Framer.podspec b/Framer.podspec index abc1234..def5678 100644 --- a/Framer.podspec +++ b/Framer.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'Framer' - s.version = '1.3.1' + s.version = '1.3.2' s.summary = 'Comfortable syntax for working with frames' s.description = <<-DESC Framer is a good framework which wraps working with frames with a nice chaining syntax.
Update pod version - > 1.3.2
diff --git a/config/deploy.rb b/config/deploy.rb index abc1234..def5678 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -1,4 +1,4 @@-lock '3.8.2' +lock '3.9.0' set :application, 'evemonk' set :repo_url, 'git@github.com:biow0lf/evemonk.git'
Update capistrano lock version to 3.9.0
diff --git a/gigest.gemspec b/gigest.gemspec index abc1234..def5678 100644 --- a/gigest.gemspec +++ b/gigest.gemspec @@ -22,6 +22,9 @@ gem.add_dependency "octokit", "~> 2.0" + # Add Rake dependency for Travis.. + gem.add_development_dependency "rake" + gem.add_development_dependency "rspec" gem.add_development_dependency "vcr" gem.add_development_dependency "webmock"
Add rake for travis to work.
diff --git a/test/models/field/xref_test.rb b/test/models/field/xref_test.rb index abc1234..def5678 100644 --- a/test/models/field/xref_test.rb +++ b/test/models/field/xref_test.rb @@ -1,6 +1,8 @@ require "test_helper" class Field::XrefTest < ActiveSupport::TestCase + include WithVCR + should validate_presence_of(:xref) should_not allow_value("not a URL").for(:xref) @@ -12,10 +14,12 @@ :name_plural_en => "tests" ) - field.xref = "https://api.github.com/repos/rails/rails" - refute(field.valid?) + with_expiring_vcr_cassette do + field.xref = "https://api.github.com/repos/rails/rails" + refute(field.valid?) - field.xref = "http://vss.naxio.ch/keywords/default/api/v1" - assert(field.valid?) + field.xref = "http://vss.naxio.ch/keywords/default/api/v1" + assert(field.valid?) + end end end
Use VCR to permit external HTTP request in test
diff --git a/config_helper.rb b/config_helper.rb index abc1234..def5678 100644 --- a/config_helper.rb +++ b/config_helper.rb @@ -11,6 +11,7 @@ ENV['JOURNAL_NAME'] = config.site_name ENV['CURRENT_ISSUE'] = config.current_issue ENV['CURRENT_VOLUME'] = config.current_volume + ENV['CURRENT_YEAR'] = Time.now.year.to_s ENV['JOURNAL_ISSN'] = config.journal_issn ENV['JOURNAL_LAUNCH_DATE'] = config.journal_launch_date ENV['CROSSREF_USERNAME'] = config.crossref_username
Set the year in the config helper
diff --git a/app/models/event.rb b/app/models/event.rb index abc1234..def5678 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -14,7 +14,7 @@ validates_attachment_content_type :uploaded_file, :content_type => /\Aimage\/.*\Z/ def event_date - happens_on.strftime "%a, %b %e" + happens_on.strftime "%a, %b %e, %Y" end def event_time
Add year to Event date
diff --git a/app/models/point.rb b/app/models/point.rb index abc1234..def5678 100644 --- a/app/models/point.rb +++ b/app/models/point.rb @@ -8,7 +8,8 @@ validates_inclusion_of :kind, in: KINDS validates_numericality_of :rank validate :lat_lon_must_be_set - validates_presence_of :price, if: Proc.new { |p| p.kind == 'Step' } + validates :price, presence: true, if: Proc.new { |p| p.kind == 'Step' }, + numericality: { greater_than_or_equal_to: 0 } before_validation :set_from_rank, :set_to_rank
Add validation on step prices on creation trip
diff --git a/prompt.gemspec b/prompt.gemspec index abc1234..def5678 100644 --- a/prompt.gemspec +++ b/prompt.gemspec @@ -10,7 +10,7 @@ s.email = 'mike@sticknet.net' s.require_paths = ["lib"] - s.files = ["README.md"] + s.files = ["README.md", "CHANGELOG.md", "LICENSE.txt"] s.files += Dir["lib/**/*.rb"] s.files += Dir["spec/**/*.rb"] s.files += Dir["examples/**/*"]
Include CHANGELOG & LICENSE in gem
diff --git a/app/models/votes.rb b/app/models/votes.rb index abc1234..def5678 100644 --- a/app/models/votes.rb +++ b/app/models/votes.rb @@ -3,7 +3,10 @@ def add_vote(message_id, user_id, point = 0) votes = Votes.find(:first, :conditions => ['message_id = ? and user_id = ?', message_id, user_id]) - unless votes + if votes + votes.point = point.nil? ? 0 : point + votes.save! + else votes = Votes.new votes.message_id = message_id votes.user_id = user_id
Allow users to change their own vote
diff --git a/spec/integration/start_page_spec.rb b/spec/integration/start_page_spec.rb index abc1234..def5678 100644 --- a/spec/integration/start_page_spec.rb +++ b/spec/integration/start_page_spec.rb @@ -6,7 +6,7 @@ visit "/#{APP_SLUG}" - within 'section#content' do + within '#content' do within 'header' do page.should have_content("Business finance and support finder") page.should have_content("Quick answer")
Fix test now that main section is a main element
diff --git a/spec/requests/idea_requests_spec.rb b/spec/requests/idea_requests_spec.rb index abc1234..def5678 100644 --- a/spec/requests/idea_requests_spec.rb +++ b/spec/requests/idea_requests_spec.rb @@ -9,48 +9,34 @@ describe "GET /ideas" do it "return http success" do get ideas_path - response.status.should be(200) - end - - it "shows correct content" do - get ideas_path - expect(response).to render_template(:index) + expect(response).to be_success end end describe "GET /ideas/new" do + before do + @user = create(:user) + @user.confirm! + post_via_redirect user_session_path, 'user[email]' => @user.email, 'user[password]' => @user.password + end + it "return http success" do get new_idea_path - response.status.should be(200) - end - - it "shows correct content" do - get new_idea_path - expect(response).to render_template(:new) + expect(response).to be_success end end describe "GET /ideas/:id/edit" do it "return http success" do get edit_idea_path(:id => @idea1.id) - response.status.should be(200) - end - - it "shows correct content" do - get edit_idea_path(:id => @idea1.id) - expect(response).to render_template(:partial => 'ideas/_edit') + expect(response).to be_success end end describe "GET /ideas/:id" do it "return http success" do get idea_path(:id => @idea2.id) - response.status.should be(200) - end - - it "shows correct content" do - get idea_path(:id => @idea2.id) - expect(response).to render_template(:show) + expect(response).to be_success end end
Clean up Idea request tests Sign in with a test user before requesting the new idea form. Don't make any expectations of what will be rendered; only test that the requests themselves are successes.
diff --git a/Casks/nndd.rb b/Casks/nndd.rb index abc1234..def5678 100644 --- a/Casks/nndd.rb +++ b/Casks/nndd.rb @@ -2,9 +2,9 @@ version '2.4.3' sha256 '6a73dcad2e73d877ad1503ed1162cae1a1c84f21d1abaa6aaf9b31bb2fbca531' - url 'http://dl.sourceforge.jp/nndd/62201/NNDD_v2_4_3.dmg' + url 'http://dl.osdn.jp/nndd/62201/NNDD_v2_4_3.dmg' name 'NNDD' - homepage 'http://sourceforge.jp/projects/nndd/' + homepage 'http://osdn.jp/projects/nndd/' license :x11 preflight do
Change hosting service name in NNDD.app Cask
diff --git a/Casks/chrome-devtools.rb b/Casks/chrome-devtools.rb index abc1234..def5678 100644 --- a/Casks/chrome-devtools.rb +++ b/Casks/chrome-devtools.rb @@ -0,0 +1,11 @@+cask :v1 => 'chrome-devtools' do + version :latest + sha256 :no_check + + url 'https://github.com/auchenberg/chrome-devtools-app/raw/master/build/Chrome%20DevTools/osx/Chrome%20DevTools.app.zip' + name 'Chrome DevTools' + homepage 'https://github.com/auchenberg/chrome-devtools-app' + license :mit + + app 'Chrome DevTools.app' +end
Add Chrome DevTools.app (latest version)
diff --git a/lib/conjure/provision/server.rb b/lib/conjure/provision/server.rb index abc1234..def5678 100644 --- a/lib/conjure/provision/server.rb +++ b/lib/conjure/provision/server.rb @@ -0,0 +1,39 @@+module Conjure + module Provision + class Server + def initialize(server) + @server = server + end + + def ip_address + @server.public_ip_address + end + + def self.create(name) + puts "Creating DigitalOcean droplet..." + connection = Fog::Compute.new compute_options + new connection.servers.bootstrap(bootstrap_options name) + end + + def self.compute_options + raise "Error: DIGITALOCEAN_API_KEY and DIGITALOCEAN_CLIENT_ID env vars must both be set." unless ENV["DIGITALOCEAN_API_KEY"] && ENV["DIGITALOCEAN_CLIENT_ID"] + { + :provider => :digitalocean, + :digitalocean_api_key => ENV["DIGITALOCEAN_API_KEY"], + :digitalocean_client_id => ENV["DIGITALOCEAN_CLIENT_ID"], + } + end + + def self.bootstrap_options(name) + { + :name => name, + :flavor_id => "66", + :region_id => "4", + :image_id => "2158507", + :private_key_path => "/home/brianauton/.ssh/id_rsa", + :public_key_path => "/home/brianauton/.ssh/id_rsa.pub", + } + end + end + end +end
Add Provision::Server for quick DigitalOcean instantiation
diff --git a/lib/conjure/provision/server.rb b/lib/conjure/provision/server.rb index abc1234..def5678 100644 --- a/lib/conjure/provision/server.rb +++ b/lib/conjure/provision/server.rb @@ -25,13 +25,15 @@ end def self.bootstrap_options(name) + ssh_dir = File.expand_path("~/.ssh") + raise "Error: ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub must exist." unless File.exist?(ssh_dir) && File.exist?("#{ssh_dir}/id_rsa") && File.exist?("#{ssh_dir}/id_rsa.pub") { :name => name, :flavor_id => "66", :region_id => "4", :image_id => "2158507", - :private_key_path => "/home/brianauton/.ssh/id_rsa", - :public_key_path => "/home/brianauton/.ssh/id_rsa.pub", + :private_key_path => "#{ssh_dir}/id_rsa", + :public_key_path => "#{ssh_dir}/id_rsa.pub", } end end
Generalize location of ssh keys
diff --git a/lib/podio/models/stream_mute.rb b/lib/podio/models/stream_mute.rb index abc1234..def5678 100644 --- a/lib/podio/models/stream_mute.rb +++ b/lib/podio/models/stream_mute.rb @@ -4,9 +4,6 @@ property :type, :string property :title, :string property :data, :hash - property :item, :boolean - property :status, :boolean - property :task, :boolean class << self # @see https://developers.podio.com/doc/stream/get-mutes-in-global-stream-62742 @@ -15,16 +12,14 @@ end # @see https://developers.podio.com/doc/stream/mute-object-from-global-stream-79424 - def create(scope_type, scope_id, object_type = nil) + def create(scope_type, scope_id) path = "/stream/mute/#{scope_type}/#{scope_id}" - path += "/#{object_type}" unless object_type.nil? Podio.connection.post(path).status end # @see https://developers.podio.com/doc/stream/unmute-objects-from-the-global-stream-79426 - def delete(scope_type, scope_id, object_type = nil) + def delete(scope_type, scope_id) path = "/stream/mute/#{scope_type}/#{scope_id}" - path += "/#{object_type}" unless object_type.nil? Podio.connection.delete(path).status end end
Simplify this to match the changes in the API
diff --git a/lib/rack/dev-mark/theme/base.rb b/lib/rack/dev-mark/theme/base.rb index abc1234..def5678 100644 --- a/lib/rack/dev-mark/theme/base.rb +++ b/lib/rack/dev-mark/theme/base.rb @@ -24,13 +24,13 @@ end def gsub_tag_content(html, name, &block) - String.new(html).gsub(%r{(<#{name}\s*[^>]*>)([^<]*)(</#{name}>)}i) do + String.new(html).gsub(%r{(<#{name}\s*[^>]*>)([^<]*)(</#{name}>)}im) do "#{$1}#{block.call($2)}#{$3}" end end def gsub_tag_attribute(html, name, attr, &block) - String.new(html).gsub %r{(<#{name}\s*)([^>]*)(>)}i do + String.new(html).gsub %r{(<#{name}\s*)([^>]*)(>)}im do s1, s2, s3 = $1, $2, $3 s2.gsub! %r{(#{attr}=')([^']*)(')} do "#{$1}#{block.call($2)}#{$3}"
Allow multiple lines to match
diff --git a/lib/exercism/assumable_user.rb b/lib/exercism/assumable_user.rb index abc1234..def5678 100644 --- a/lib/exercism/assumable_user.rb +++ b/lib/exercism/assumable_user.rb @@ -18,7 +18,6 @@ end def self.all - sql = "SELECT username, github_id FROM users u INNER JOIN lifecycle_events e ON u.id=e.user_id GROUP BY u.username, u.github_id, u.created_at ORDER BY u.created_at DESC LIMIT 100" ::User.order('created_at DESC').limit(100).map {|user| Identity.new(user.username, user.github_id, user.onboarding_steps) }.sort_by(&:progress).reverse
Remove unused variable from AssumableUser::Identity The `sql` variable wasn't being used, so I removed it.
diff --git a/lib/peek/controller_helpers.rb b/lib/peek/controller_helpers.rb index abc1234..def5678 100644 --- a/lib/peek/controller_helpers.rb +++ b/lib/peek/controller_helpers.rb @@ -10,7 +10,7 @@ protected def set_peek_request_id - Peek.request_id = env['action_dispatch.request_id'] + Peek.request_id = request.uuid end def peek_enabled?
Use request.uuid instead of env variable
diff --git a/20_firewall_rules.rb b/20_firewall_rules.rb index abc1234..def5678 100644 --- a/20_firewall_rules.rb +++ b/20_firewall_rules.rb @@ -0,0 +1,30 @@+def min_unblock(intervals) + unblocked = 0 + loop { + blockers = intervals.select { |min, max| (min..max).include?(unblocked) } + return unblocked if blockers.empty? + unblocked = blockers.map(&:last).max + 1 + } +end + +# Assumes without checking that input intervals are sorted by start time. +def merge(intervals) + prev_min, prev_max = intervals.first + intervals.each_with_object([]) { |r, merged| + min, max = r + if min > prev_max + merged << [prev_min, prev_max] + prev_min, prev_max = r + else + prev_max = [prev_max, max].max + end + } << [prev_min, prev_max] +end + +ranges = ARGF.each_line.map { |l| + # min, max + l.split(?-).map(&method(:Integer)).freeze +}.sort.freeze + +puts min_unblock(ranges) +puts 2 ** 32 - merge(ranges).sum { |min, max| (max - min + 1) }
Add day 20: Firewall Rules
diff --git a/fuel_purchase.gemspec b/fuel_purchase.gemspec index abc1234..def5678 100644 --- a/fuel_purchase.gemspec +++ b/fuel_purchase.gemspec @@ -24,6 +24,6 @@ s.add_runtime_dependency 'earth' s.add_dependency 'emitter', '~> 1.0.0' - s.add_development_dependency 'sniff', '~>0.11.3' + s.add_development_dependency 'sniff', '~> 1.0.0' s.add_development_dependency 'sqlite3' end
Update sniff dependency to 1.x
diff --git a/spec/support/python_helper.rb b/spec/support/python_helper.rb index abc1234..def5678 100644 --- a/spec/support/python_helper.rb +++ b/spec/support/python_helper.rb @@ -6,7 +6,7 @@ end def detect_python - stdout, stderr, status = Open3.capture3('command -v python') + stdout, stderr, status = Open3.capture3(%q{/usr/bin/env bash -c 'command -v python'}) if status.exitstatus == 0 PythonHelper.python_path = stdout.chomp else
Adjust python detection for specs
diff --git a/lib/simple_slack_bot/config.rb b/lib/simple_slack_bot/config.rb index abc1234..def5678 100644 --- a/lib/simple_slack_bot/config.rb +++ b/lib/simple_slack_bot/config.rb @@ -1,12 +1,11 @@- module SlackBot module Config - extend self + module_function ATTRIBUTES = [ - :debug, - :join_message, - :token + :debug, + :join_message, + :token ] attr_accessor(*Config::ATTRIBUTES) @@ -16,13 +15,11 @@ self.token = 'TOKEN' end - class << self - def configure - block_given? ? yield(Config) : Config - end + def configure + block_given? ? yield(Config) : Config + end - def config - Config - end + def config + Config end -end+end
Change extend self to module_function
diff --git a/spec/services/sell_item_spec.rb b/spec/services/sell_item_spec.rb index abc1234..def5678 100644 --- a/spec/services/sell_item_spec.rb +++ b/spec/services/sell_item_spec.rb @@ -3,7 +3,7 @@ RSpec.describe SellItem, type: :class do let(:campaign) { create(:campaign, money: 0) } let(:hero) { create(:hero, id: 2) } - let(:item) { create(:item, campaign_id: campaign, price: 100, hero_id: hero) } + let(:item) { create(:item, campaign_id: campaign, price: 100, hero_id: hero.id) } before { described_class.new(item, campaign).call } @@ -15,6 +15,9 @@ expect(campaign.money).to eq 50 end + it 'stores owner id' do + expect(item.last_owner).to eq 2 + end it 'removes hero from item' do expect(item.hero_id).to eq nil end
Add missing spec for sell_item
diff --git a/acapi.gemspec b/acapi.gemspec index abc1234..def5678 100644 --- a/acapi.gemspec +++ b/acapi.gemspec @@ -8,7 +8,7 @@ spec.version = Acapi::VERSION spec.authors = ["Dan Thomas"] spec.email = ["dan.thomas@dc.gov"] - spec.summary = %q{TODO: Write a short summary. Required.} + spec.summary = %q{Enterprise communication onramp to Affordable Care Act API} spec.description = %q{TODO: Write a longer description. Optional.} spec.homepage = "" spec.license = "MIT" @@ -18,6 +18,11 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] + spec.add_dependency "activesupport", "~> 4.2.0" + spec.add_development_dependency "bundler", "~> 1.7" + spec.add_development_dependency "rspec", "~> 3.2" spec.add_development_dependency "rake", "~> 10.0" + spec.add_development_dependency "cucumber" + spec.add_development_dependency "aruba" end
Add description Initialize runtime and development dependencies
diff --git a/bubble-wrap.gemspec b/bubble-wrap.gemspec index abc1234..def5678 100644 --- a/bubble-wrap.gemspec +++ b/bubble-wrap.gemspec @@ -2,18 +2,20 @@ require File.expand_path('../lib/bubble-wrap/version', __FILE__) Gem::Specification.new do |gem| - gem.authors = ["Matt Aimonetti", "Francis Chong"] - gem.email = ["mattaimonetti@gmail.com", "francis@ignition.hk"] + gem.authors = ["Matt Aimonetti", "Francis Chong", "James Harton"] + gem.email = ["mattaimonetti@gmail.com", "francis@ignition.hk", "james@sociable.co.nz"] gem.description = "RubyMotion wrappers and helpers (Ruby for iOS) - Making Cocoa APIs more Ruby like, one API at a time. Fork away and send your pull request." gem.summary = "RubyMotion wrappers and helpers (Ruby for iOS) - Making Cocoa APIs more Ruby like, one API at a time. Fork away and send your pull request." - gem.homepage = "https://github.com/mattetti/BubbleWrap" + gem.homepage = "http://bubblewrap.io/" gem.files = `git ls-files`.split($\) - gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) + gem.test_files = gem.files.grep(%r{^(test|spec|lib_spec|features)/}) gem.name = "bubble-wrap" gem.require_paths = ["lib"] gem.version = BubbleWrap::VERSION + gem.extra_rdoc_files = gem.files.grep(%r{motion}) + gem.add_development_dependency 'rspec' gem.add_development_dependency 'rake' end
Include 'motion/' in rdoc directories.
diff --git a/test/integration/default/minitest/test_default.rb b/test/integration/default/minitest/test_default.rb index abc1234..def5678 100644 --- a/test/integration/default/minitest/test_default.rb +++ b/test/integration/default/minitest/test_default.rb @@ -7,6 +7,6 @@ it "check R version" do system('echo "q()" > /tmp/showversion.R') system('/usr/local/R-devel/bin/R CMD BATCH /tmp/showversion.R') - assert system('grep "R version 3.4.2 Patched" showversion.Rout'), 'R version is not expected version. patched version is updated' + assert system('grep "R version 3.5.0 Patched" showversion.Rout'), 'R version is not expected version. patched version is updated' end end
Update R version for default
diff --git a/lib/engineyard/version.rb b/lib/engineyard/version.rb index abc1234..def5678 100644 --- a/lib/engineyard/version.rb +++ b/lib/engineyard/version.rb @@ -1,4 +1,4 @@ module EY - VERSION = '2.0.5' + VERSION = '2.0.6.pre' ENGINEYARD_SERVERSIDE_VERSION = ENV['ENGINEYARD_SERVERSIDE_VERSION'] || '2.0.1' end
Add .pre for next release
diff --git a/lib/protobuf/lifecycle.rb b/lib/protobuf/lifecycle.rb index abc1234..def5678 100644 --- a/lib/protobuf/lifecycle.rb +++ b/lib/protobuf/lifecycle.rb @@ -7,10 +7,12 @@ event_name = normalized_event_name( event_name ) - log_warn { - message = "[DEPRECATED] Lifecycle events have been deprecated. Use ::ActiveSupport::Notifications.subscribe('#{event_name}')" - sign_message(message) - } + if ::Protobuf.print_deprecation_warnings? + $stderr.puts <<-ERROR + [DEPRECATED] ::Protobuf::Lifecycle has been deprecated and will be removed in a future version. + Use ::ActiveSupport::Notifications.subscribe('#{event_name}') + ERROR + end ::ActiveSupport::Notifications.subscribe(event_name) do |name, start, finish, id, args| blk.call(*args) @@ -18,10 +20,12 @@ end def self.trigger( event_name, *args ) - log_warn { - message = "[DEPRECATED] Lifecycle events have been deprecated. Use ::ActiveSupport::Notifications.instrument(...)" - sign_message(message) - } + if ::Protobuf.print_deprecation_warnings? + $stderr.puts <<-ERROR + [DEPRECATED] ::Protobuf::Lifecycle has been deprecated and will be removed in a future version. + Use ::ActiveSupport::Notifications.instrument(...) + ERROR + end event_name = normalized_event_name( event_name )
Use $stderr to print deprecation warnings
diff --git a/lib/restaurant/actions.rb b/lib/restaurant/actions.rb index abc1234..def5678 100644 --- a/lib/restaurant/actions.rb +++ b/lib/restaurant/actions.rb @@ -35,7 +35,7 @@ end def collection - Mongoid.default_session.with(:safe => true)[resources_name] + Mongoid.default_session[resources_name] end def resource_name
Use non safe mode (recommended)
diff --git a/lib/ruby-jperf/options.rb b/lib/ruby-jperf/options.rb index abc1234..def5678 100644 --- a/lib/ruby-jperf/options.rb +++ b/lib/ruby-jperf/options.rb @@ -5,7 +5,12 @@ DEFAULT_FILE_PATTERN = '**/*_perf.rb' - attr_accessor :paths, :host, :port, :jmeter, :title, + attr_accessor :paths, + :host, + :port, + :jmeter, + :title, + :gui, :filename_pattern def initialize options = {}, &block @@ -16,6 +21,7 @@ @host = options.fetch(:host, nil) @port = options.fetch(:port, nil) @jmeter = options.fetch(:jmeter, {}).symbolize_keys + @jmeter[:gui] = options[:gui] if options.key?(:gui) yield self if block_given? end
Allow gui option to be set from command line
diff --git a/lib/tasks/bec_import.rake b/lib/tasks/bec_import.rake index abc1234..def5678 100644 --- a/lib/tasks/bec_import.rake +++ b/lib/tasks/bec_import.rake @@ -0,0 +1,32 @@+require 'csv' + +def if_file_exist(file_path) + if File.exist?(file_path) + lines = [] + CSV.foreach(file_path, headers: true, skip_blanks: true, converters: [:integer]) do |line| + lines << line.to_h.symbolize_keys + end + + yield lines + else + puts "#{file_path} does not exist" + end +end + +namespace :bec_import do + desc 'Prune unused BECs' + task :prune, [:file_path] => :environment do |_, args| + if_file_exist(args[:file_path]) do |lines| + bec_import = BecImport.new(lines) + bec_import.delete_unused + end + end + + desc 'Update existing BECs' + task :update, [:file_path] => :environment do |_, args| + if_file_exist(args[:file_path]) do |lines| + bec_import = BecImport.new(lines) + bec_import.update_existing + end + end +end
Create rake tasks for BEC import
diff --git a/lib/tunees/application.rb b/lib/tunees/application.rb index abc1234..def5678 100644 --- a/lib/tunees/application.rb +++ b/lib/tunees/application.rb @@ -40,5 +40,38 @@ execute(camel_cased_method, *args) end end + + # Application elements + %w( + airplayDevices + browserWindows + encoders + eqPresets + eqWindows + playlistWindows + sources + audioCDPlaylists + audioCDTracks + libraryPlaylists + fileTracks + urlTracks + sharedTracks + playlists + tracks + artworks + radioTunerPlaylists + urlTracks + userPlaylists + fileTracks + urlTracks + sharedTracks + visuals + windows + ).uniq.each do |camel_cased_element| + method = camel_cased_element.underscore + define_singleton_method(method) do + execute(camel_cased_element) + end + end end end
Implement methods for Application Elements
diff --git a/config/clockwork.rb b/config/clockwork.rb index abc1234..def5678 100644 --- a/config/clockwork.rb +++ b/config/clockwork.rb @@ -23,10 +23,6 @@ end end - every(1.hour, "Health Check", at: "**:00") do - Slack.ping!("I am still alive!") - end - error_handler do |error| Slack.log!("[data.rubyasia.com] " + error.to_s) end
Remove the report on Slack
diff --git a/clamp.gemspec b/clamp.gemspec index abc1234..def5678 100644 --- a/clamp.gemspec +++ b/clamp.gemspec @@ -13,7 +13,7 @@ s.summary = %q{a minimal framework for command-line utilities} s.description = <<EOF -Clamp makes provides an object-model for command-line utilities. +Clamp provides an object-model for command-line utilities. It handles parsing of command-line options, and generation of usage help. EOF
Fix unsightly typo in gemspec.
diff --git a/Library/Homebrew/test/test_fails_with.rb b/Library/Homebrew/test/test_fails_with.rb index abc1234..def5678 100644 --- a/Library/Homebrew/test/test_fails_with.rb +++ b/Library/Homebrew/test/test_fails_with.rb @@ -0,0 +1,60 @@+require 'testing_env' +require 'test/testball' + +class FailsWithTests < Test::Unit::TestCase + class Double < Compiler + attr_accessor :name, :build + end + + def assert_fails_with(cc) + assert @f.new.fails_with?(cc) + end + + def assert_does_not_fail_with(cc) + assert !@f.new.fails_with?(cc) + end + + def fails_with(*args, &block) + @f.send(:fails_with, *args, &block) + end + + def build_cc(sym, build) + cc = Double.new + cc.name = sym + cc.build = build + cc + end + + def setup + @f = Class.new(TestBall) + end + + def test_fails_with_symbol + fails_with :clang + cc = build_cc(:clang, 425) + assert_fails_with cc + end + + def test_fails_with_build + fails_with(:clang) { build 211 } + cc = build_cc(:clang, 318) + assert_does_not_fail_with cc + end + + def test_fails_with_block_without_build + fails_with(:clang) { } + cc = build_cc(:clang, 425) + assert_fails_with cc + end + + def test_multiple_failures + fails_with(:llvm) + fails_with(:clang) + gcc = build_cc(:gcc, 5666) + llvm = build_cc(:llvm, 2336) + clang = build_cc(:clang, 425) + assert_fails_with llvm + assert_fails_with clang + assert_does_not_fail_with gcc + end +end
Add new tests for fails_with DSL
diff --git a/lib/pgbackups-archive/storage.rb b/lib/pgbackups-archive/storage.rb index abc1234..def5678 100644 --- a/lib/pgbackups-archive/storage.rb +++ b/lib/pgbackups-archive/storage.rb @@ -23,10 +23,10 @@ end def store - options = { key: @key, body: @file, public: false, encryption: "AES256" } + options = {:key => @key, :body => @file, :public => false, :encryption => "AES256"} if ENV["PGBACKUPS_MULTIPART_CHUNK_SIZE"] - options.merge!(multipart_chunk_size: ENV["PGBACKUPS_MULTIPART_CHUNK_SIZE"].to_i) + options.merge!(:multipart_chunk_size => ENV["PGBACKUPS_MULTIPART_CHUNK_SIZE"].to_i) end bucket.files.create(options)
Convert `:` to `=>` for better Ruby compatibility
diff --git a/libraries/varnish_default_vcl.rb b/libraries/varnish_default_vcl.rb index abc1234..def5678 100644 --- a/libraries/varnish_default_vcl.rb +++ b/libraries/varnish_default_vcl.rb @@ -39,7 +39,7 @@ varnish_version: varnish_version ) action :create - notifies :restart, 'service[varnish]', :delayed + notifies :reload, 'service[varnish]', :delayed end end end
Switch from service restart to service reload. The varnish_default_vcl has been updated to perform a service reload instead of a service restart. This will prevent the cache from being cleared when a reload of the vcl file is enough.
diff --git a/app/jobs/update_clinical_trials.rb b/app/jobs/update_clinical_trials.rb index abc1234..def5678 100644 --- a/app/jobs/update_clinical_trials.rb +++ b/app/jobs/update_clinical_trials.rb @@ -8,7 +8,7 @@ end source.clinical_trials = clinical_trials source.save - sleep 0.1 + sleep 0.5 end ensure reschedule if recurring
Increase sleep to half a second
diff --git a/app/controllers/notes_controller.rb b/app/controllers/notes_controller.rb index abc1234..def5678 100644 --- a/app/controllers/notes_controller.rb +++ b/app/controllers/notes_controller.rb @@ -6,10 +6,15 @@ respond_to :js def index - notes + @notes = Notes::LoadContext.new(project, current_user, params).execute + if params[:target_type] == "merge_request" - @mixed_targets = true + @mixed_targets = true @main_target_type = params[:target_type].camelize + @discussions = discussions_from_notes + @has_diff = true + elsif params[:target_type] == "commit" + @has_diff = true end respond_with(@notes) @@ -40,7 +45,33 @@ protected - def notes - @notes = Notes::LoadContext.new(project, current_user, params).execute + def discussion_notes_for(note) + @notes.select do |other_note| + note.discussion_id == other_note.discussion_id + end + end + + def discussions_from_notes + discussion_ids = [] + discussions = [] + + @notes.each do |note| + next if discussion_ids.include?(note.discussion_id) + + # don't group notes for the main target + if for_main_target?(note) + discussions << [note] + else + discussions << discussion_notes_for(note) + discussion_ids << note.discussion_id + end + end + + discussions + end + + # Helps to distinguish e.g. commit notes in mr notes list + def for_main_target?(note) + !@mixed_targets || (@main_target_type == note.noteable_type && !note.for_diff_line?) end end
Add discussions for merge requests to notes controller
diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index abc1234..def5678 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -1,12 +1,9 @@ class PagesController < ApplicationController - - #caches_page :index, :about def index @title = "Home" - @prisms = Prism.all()[0..2] end - + def about @title = "About" end
Remove prism lookup on landing page Info isn't used and it's an expensive lookup
diff --git a/spec/codependency/parser_spec.rb b/spec/codependency/parser_spec.rb index abc1234..def5678 100644 --- a/spec/codependency/parser_spec.rb +++ b/spec/codependency/parser_spec.rb @@ -1,31 +1,71 @@ require 'spec_helper' describe Codependency::Parser do - let( :path ){ File.join( File.dirname( __FILE__ ), '../fixtures' ) } let( :parser ){ Codependency::Parser.new } + before do + IO.stub( :readlines ) do |arg| + case File.basename( arg, '.rb' ).to_sym + when :body + """ + class Body + end + """ + when :earth + """ + # require planet + + class Earth + end + """ + when :mars + """ + # require planet + + class Mars + end + """ + when :phobos + """ + # require body + # require mars + + class Phobos + end + """ + when :planet + """ + # require body + + class Planet + end + """ + end.strip.split( /^\s+/ ) + end + end + context 'body' do - subject { parser.parse( "#{path}/body.rb" ) } + subject { parser.parse( "body.rb" ) } it { should eq( [ ] ) } end context 'earth' do - subject { parser.parse( "#{path}/earth.rb" ) } + subject { parser.parse( "earth.rb" ) } it { should eq( [ 'planet' ] ) } end context 'mars' do - subject { parser.parse( "#{path}/mars.rb" ) } + subject { parser.parse( "mars.rb" ) } it { should eq( [ 'planet' ] ) } end context 'phobos' do - subject { parser.parse( "#{path}/phobos.rb" ) } + subject { parser.parse( "phobos.rb" ) } it { should eq( [ 'body', 'mars' ] ) } end context 'planet' do - subject { parser.parse( "#{path}/planet.rb" ) } + subject { parser.parse( "planet.rb" ) } it { should eq( [ 'body' ] ) } end end
Remove filesystem dependency for parser spec
diff --git a/spec/mailers/user_mailer_spec.rb b/spec/mailers/user_mailer_spec.rb index abc1234..def5678 100644 --- a/spec/mailers/user_mailer_spec.rb +++ b/spec/mailers/user_mailer_spec.rb @@ -16,7 +16,7 @@ expect(mail.from).to eql(['moi@example.com']) end - it 'assigns @name' do - expect(mail.body.encoded).to match(user.name) + it 'have new role' do + expect(mail.body.encoded).to have_text(user.role) end end
Add test role in email
diff --git a/spec/mailers/user_mailer_spec.rb b/spec/mailers/user_mailer_spec.rb index abc1234..def5678 100644 --- a/spec/mailers/user_mailer_spec.rb +++ b/spec/mailers/user_mailer_spec.rb @@ -2,7 +2,7 @@ describe Spree::UserMailer do let(:user) { build(:user) } - + after do ActionMailer::Base.deliveries.clear end @@ -17,4 +17,37 @@ Spree::UserMailer.signup_confirmation(user).deliver ActionMailer::Base.deliveries.count.should == 1 end + + # adapted from https://github.com/spree/spree_auth_devise/blob/70737af/spec/mailers/user_mailer_spec.rb + describe '#reset_password_instructions' do + describe 'message contents' do + before do + @message = described_class.reset_password_instructions(user) + end + + context 'subject includes' do + it 'translated devise instructions' do + expect(@message.subject).to include "Password Reset Instructions" + end + + it 'Spree site name' do + expect(@message.subject).to include Spree::Config[:site_name] + end + end + + context 'body includes' do + it 'password reset url' do + expect(@message.body.raw_source).to include root_url + "user/spree_user/password/edit" + end + end + end + + describe 'legacy support for User object' do + it 'sends an email' do + expect do + Spree::UserMailer.reset_password_instructions(user).deliver + end.to change(ActionMailer::Base.deliveries, :size).by(1) + end + end + end end
Add UserMailer specs adapted from Spree code
diff --git a/spec/togls/rules/boolean_spec.rb b/spec/togls/rules/boolean_spec.rb index abc1234..def5678 100644 --- a/spec/togls/rules/boolean_spec.rb +++ b/spec/togls/rules/boolean_spec.rb @@ -21,7 +21,7 @@ describe "#run" do it "returns the provided boolean value" do - bool_rule = Togls::Rules::Boolean.new(true) + bool_rule = Togls::Rules::Boolean.new(:boolean, true) expect(bool_rule.run(double)).to eq(true) end end
Fix boolean rule spec to include type_id Why you made the change: I did this because rules now require the first parameter to be the abstract type_id of the rule.
diff --git a/core/app/helpers/comable/application_helper.rb b/core/app/helpers/comable/application_helper.rb index abc1234..def5678 100644 --- a/core/app/helpers/comable/application_helper.rb +++ b/core/app/helpers/comable/application_helper.rb @@ -25,7 +25,7 @@ end def store_location - session['customer_return_to'] = request.fullpath.gsub('//', '/') + session[:customer_return_to] = request.fullpath.gsub('//', '/') end def name_with_honorific(name) @@ -40,5 +40,27 @@ "x#{quantity}" ].join(' ') end + + private + + def after_sign_in_path_for(_resource) + session.delete(:customer_return_to) || comable.root_path + end + + def after_sign_out_path_for(_resource) + session.delete(:customer_return_to) || comable.root_path + end + + def after_sign_up_path_for(resource) + signed_in_root_path(resource) || comable.root_path + end + + def after_update_path_for(resource) + signed_in_root_path(resource) || comable.root_path + end + + def after_resetting_password_path_for(resource) + signed_in_root_path(resource) || comable.root_path + end end end
Fix the after sign in path
diff --git a/SwiftyDropbox.podspec b/SwiftyDropbox.podspec index abc1234..def5678 100644 --- a/SwiftyDropbox.podspec +++ b/SwiftyDropbox.podspec @@ -12,6 +12,7 @@ s.ios.source_files = 'Source/SwiftyDropbox/Platform/SwiftyDropbox_iOS/**/*.{swift,h,m}' s.requires_arc = true + s.swift_version = '3.0' s.osx.deployment_target = '10.11' s.ios.deployment_target = '9.0'
Set cocoapods swift_version so pod pushing works again
diff --git a/spec/model_spec.rb b/spec/model_spec.rb index abc1234..def5678 100644 --- a/spec/model_spec.rb +++ b/spec/model_spec.rb @@ -22,4 +22,28 @@ @episodes.is_a?(Loco::RecordArray).should.equal true end + it "should include the root on serialization" do + @show = Show.find(1) + @hash = @show.serialize + @hash[:show].nil?.should.equal false + end + + it "should accept an option to not include root" do + @show = Show.find(1) + @hash = @show.serialize(root: false) + @hash[:show].nil?.should.equal true + end + + it "should accept an option to change the root used" do + @show = Show.find(1) + @hash = @show.serialize(root: 'podcast') + @hash[:podcast].nil?.should.equal false + end + + it "should accept option to include ID on serialization" do + @show = Show.find(1) + @hash = @show.serialize(include_id: true) + @hash[:show][:id].should.equal 1 + end + end
Add basic tests for serialization
diff --git a/spec/rgrep_spec.rb b/spec/rgrep_spec.rb index abc1234..def5678 100644 --- a/spec/rgrep_spec.rb +++ b/spec/rgrep_spec.rb @@ -1,13 +1,16 @@ require 'spec_helper' describe RGrep do - before :each do + # This is executed once before all tests + before :all do + # Instance variable accessible everywhere @rgrep = RGrep.new end + + describe '#new' do + it 'takes no parameters and returns an instance of RGrep' do + @rgrep.should be_an_instance_of RGrep + end + end + end - -describe '#new' do - it 'takes no parameters and returns an instance of RGrep' do - @rgrep.should be nil - end -end
Add first basic test to check the class
diff --git a/spec/acceptance/remote_spec.rb b/spec/acceptance/remote_spec.rb index abc1234..def5678 100644 --- a/spec/acceptance/remote_spec.rb +++ b/spec/acceptance/remote_spec.rb @@ -0,0 +1,105 @@+# Beaker class: nsd::remote +# +# This file is part of the test suite for the nsd module. +# +# === Authors +# +# Mario Finelli <mario@finel.li> +# +# === Copyright +# +# Copyright 2015 Mario Finelli +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +require 'spec_helper_acceptance' + +describe 'nsd::remote' do + + context 'with managed server key' do + it 'should manage the file' do + pp = <<-EOS + include '::nsd' + class { '::nsd::remote': + server_key_manage => true, + server_key_file => 'file:///root/server.key' + } + EOS + + apply_manifest(pp, :catch_failures => true) + end + + describe file('/etc/nsd/nsd_server.key') do + it { should be_file } + it { should contain '# server key for spec testing' } + end + end + + context 'with managed server cert' do + it 'should manage the file' do + pp = <<-EOS + include '::nsd' + class { '::nsd::remote': + server_cert_manage => true, + server_cert_file => 'file:///root/server.cert' + } + EOS + + apply_manifest(pp, :catch_failures => true) + end + + describe file('/etc/nsd/nsd_server.pem') do + it { should be_file } + it { should contain '# server cert for spec testing' } + end + end + + context 'with managed control key' do + it 'should manage the file' do + pp = <<-EOS + include '::nsd' + class { '::nsd::remote': + control_key_manage => true, + control_key_file => 'file:///root/control.key' + } + EOS + + apply_manifest(pp, :catch_failures => true) + end + + describe file('/etc/nsd/nsd_control.key') do + it { should be_file } + it { should contain '# control key for spec testing' } + end + end + + context 'with managed control cert' do + it 'should manage the file' do + pp = <<-EOS + include '::nsd' + class { '::nsd::remote': + control_cert_manage => true, + control_cert_file => 'file:///root/control.cert' + } + EOS + + apply_manifest(pp, :catch_failures => true) + end + + describe file('/etc/nsd/nsd_control.pem') do + it { should be_file } + it { should contain '# control cert for spec testing' } + end + end + +end
Add beaker acceptance tests for nsd remote
diff --git a/spec/factories/ci/pipelines.rb b/spec/factories/ci/pipelines.rb index abc1234..def5678 100644 --- a/spec/factories/ci/pipelines.rb +++ b/spec/factories/ci/pipelines.rb @@ -15,12 +15,6 @@ factory :ci_pipeline_with_one_job do after(:build) do |commit| allow(commit).to receive(:ci_yaml_file) { YAML.dump({ rspec: { script: "ls" } }) } - end - end - - factory :ci_pipeline_with_two_job do - after(:build) do |commit| - allow(commit).to receive(:ci_yaml_file) { YAML.dump({ rspec: { script: "ls" }, spinach: { script: "ls" } }) } end end
Remove pipeline factory that is not used in tests
diff --git a/spec/models/ongoing_event_spec.rb b/spec/models/ongoing_event_spec.rb index abc1234..def5678 100644 --- a/spec/models/ongoing_event_spec.rb +++ b/spec/models/ongoing_event_spec.rb @@ -1,5 +1,89 @@ require 'rails_helper' RSpec.describe OngoingEvent, type: :model do - pending "add some examples to (or delete) #{__FILE__}" + it { is_expected.to act_as_paranoid } + it { is_expected.to belong_to :ngo } + + describe 'validations' do + it { expect(create :ongoing_event).to be_valid } + + it { is_expected.to validate_presence_of :address } + it { is_expected.to validate_presence_of :contact_person } + it { is_expected.to validate_length_of :title } + end + + + describe 'scopes' do + let(:full_event) { create :ongoing_event, :published } + let(:third_event) { create :ongoing_event, :published } + let(:second_event) { create :ongoing_event, :published } + let(:first_event) { create :ongoing_event, :published } + subject(:events) { OngoingEvent.all } + + describe '.published' do + let!(:published_events) { create_list :ongoing_event, 3, :published } + let!(:unpublished) { create :ongoing_event } + + context '.published' do + subject { described_class.published } + + it 'returns only events with published_at set' do + expect(subject).to match_array published_events + end + + it 'ignores records without published_at date' do + expect(subject).not_to include unpublished + end + end + end + end + + describe '#volunteers_needed and #volunteers_count' do + context 'when upcoming shifts' do + let(:event) { create :ongoing_event, volunteers_needed: 20, volunteers_count: 10 } + + it 'sums up all available_shifts volunteers_needed' do + expect(event.volunteers_needed).to eq 20 + end + + it 'sums up all available_shifts volunteers_count' do + expect(event.volunteers_count).to eq 10 + end + end + end + + describe '#state' do + it 'returns "deleted" if soft deleted' do + event = create(:ongoing_event, deleted_at: Time.now) + expect(event.state).to eq 'deleted' + end + + it 'returns "published" if published and not soft deleted' do + event = create(:ongoing_event, :published) + expect(event.state).to eq 'published' + end + end + + describe '#publish!' do + context 'when not published yet' do + let!(:event) { create(:ongoing_event) } + + it 'adds published_at timestamp' do + expect { + event.publish! + event.reload + }.to change { event.published_at } + end + end + context 'when already published' do + let!(:event) { create(:ongoing_event, published_at: 2.days.ago) } + + it 'does not update the record' do + expect { + event.publish! + event.reload + }.not_to change { event.published_at.to_i } + end + end + end end
Create and pass ongoing_event model spec
diff --git a/spec/unit/recipes/default_spec.rb b/spec/unit/recipes/default_spec.rb index abc1234..def5678 100644 --- a/spec/unit/recipes/default_spec.rb +++ b/spec/unit/recipes/default_spec.rb @@ -1,19 +1,7 @@ require 'spec_helper' describe 'default recipe on Windows 2008 R2' do - let(:chef_run) do - ChefSpec::ServerRunner.new(platform: 'windows', version: '2008R2').converge('webpi::default') - end - - it 'converges successfully' do - expect { :chef_run }.to_not raise_error - end -end - -describe 'default recipe on Windows 2012' do - let(:chef_run) do - ChefSpec::ServerRunner.new(platform: 'windows', version: '2012').converge('webpi::default') - end + platform 'windows', '2008' it 'converges successfully' do expect { :chef_run }.to_not raise_error @@ -21,11 +9,17 @@ end describe 'default recipe on Windows 2012 R2' do - let(:chef_run) do - ChefSpec::ServerRunner.new(platform: 'windows', version: '2012R2').converge('webpi::default') - end + platform 'windows', '2012R2' it 'converges successfully' do expect { :chef_run }.to_not raise_error end end + +describe 'default recipe on Windows 2016' do + platform 'windows', '2016' + + it 'converges successfully' do + expect { :chef_run }.to_not raise_error + end +end
Use the new chefspec format Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/core/db/migrate/20131214194807_create_comable_products.rb b/core/db/migrate/20131214194807_create_comable_products.rb index abc1234..def5678 100644 --- a/core/db/migrate/20131214194807_create_comable_products.rb +++ b/core/db/migrate/20131214194807_create_comable_products.rb @@ -7,7 +7,7 @@ t.text :caption t.string :sku_h_item_name t.string :sku_v_item_name - t.json :images + t.column :images, :json end add_index :comable_products, :code, unique: true, name: :comable_products_idx_01
Fix the syntax of migration for PostgreSQL
diff --git a/motion/ruby_motion_query/stylers/ui_scroll_view_styler.rb b/motion/ruby_motion_query/stylers/ui_scroll_view_styler.rb index abc1234..def5678 100644 --- a/motion/ruby_motion_query/stylers/ui_scroll_view_styler.rb +++ b/motion/ruby_motion_query/stylers/ui_scroll_view_styler.rb @@ -1,9 +1,13 @@ module RubyMotionQuery module Stylers - class UIScrollViewStyler < UIViewStyler + class UIScrollViewStyler < UIViewStyler def paging=(value) ; @view.pagingEnabled = value ; end def paging ; @view.isPagingEnabled ; end + + def scroll_enabled=(value) ; @view.scrollEnabled = value ; end + def scroll_enabled? ; @view.isScrollEnabled ; end + end end
Add ability to turn scrolling on and off in a scrollview styler.
diff --git a/app/jobs/send_single_triage_email_job.rb b/app/jobs/send_single_triage_email_job.rb index abc1234..def5678 100644 --- a/app/jobs/send_single_triage_email_job.rb +++ b/app/jobs/send_single_triage_email_job.rb @@ -2,7 +2,7 @@ def perform(id) repo_sub = RepoSubscription.includes(:user, :repo).find(id) IssueAssigner.new(repo_sub.user, [repo_sub]).assign! - if assignment + if assignment(repo_sub) assignment.update!(delivered: true) UserMailer.send_triage(repo: repo_sub.repo, user: repo_sub.user, assignment: assignment).deliver_later end @@ -10,7 +10,7 @@ private - def assignment + def assignment(repo_sub) @assignment ||= repo_sub.user.issue_assignments.order(:created_at).eager_load(:repo_subscription) .where(repo_subscriptions: { repo_id: repo_sub.repo_id }).last end
Fix missing repo_sub in assignment. Fix CODETRIAGE-DR
diff --git a/app/models/variant_decorator.rb b/app/models/variant_decorator.rb index abc1234..def5678 100644 --- a/app/models/variant_decorator.rb +++ b/app/models/variant_decorator.rb @@ -1,6 +1,8 @@ module SolidusShipwire - module Variant - prepend SolidusShipwire::Proxy + module VariantDecorator + def self.prepended(base) + base.acts_as_shipwireable api_class: Shipwire::Products + end def update_stocks_from_shipwire Shipwire::Stock.new.list( sku: self.sku) @@ -30,17 +32,6 @@ } } end - - def to_shipwire_object(hash) - ShipwireObject.new(hash["id"], self, hash) - end - - private - - def shipwire_instance - Shipwire::Products.new - end + Spree::Variant.prepend self end end - -Spree::Variant.prepend SolidusShipwire::Variant
Use Shipwireable module on Spree::Variant Replace prepend SolidusShipwire::Proxy with `acts_as_shipwireable`
diff --git a/app/models/gobierto_admin/admin_group.rb b/app/models/gobierto_admin/admin_group.rb index abc1234..def5678 100644 --- a/app/models/gobierto_admin/admin_group.rb +++ b/app/models/gobierto_admin/admin_group.rb @@ -14,7 +14,7 @@ has_many :people_permissions, -> { for_people }, class_name: "::GobiertoAdmin::GroupPermission" has_many :site_options_permissions, -> { for_site_options }, class_name: "GobiertoAdmin::GroupPermission" - validates :name, presence: true, uniqueness: { scope: :site_id } + validates :name, presence: true, uniqueness: { scope: [:site_id, :group_type] } enum group_type: { normal: 0, system: 1 } end
Add group_type to scope of uniqueness name validation of admin groups
diff --git a/tasks/public_suffix_service.rake b/tasks/public_suffix_service.rake index abc1234..def5678 100644 --- a/tasks/public_suffix_service.rake +++ b/tasks/public_suffix_service.rake @@ -1,14 +1,10 @@-namespace :pss do +task :download_definitions do + require "net/http" - task :download_definitions do - require "net/http" + DEFINITION_URL = "http://mxr.mozilla.org/mozilla-central/source/netwerk/dns/src/effective_tld_names.dat?raw=1" - DEFINITION_URL = "http://mxr.mozilla.org/mozilla-central/source/netwerk/dns/src/effective_tld_names.dat?raw=1" - - File.open("lib/public_suffix_service/definitions.dat", "w+") do |f| - response = Net::HTTP.get_response(URI.parse(DEFINITION_URL)) - f.write(response.body) - end + File.open("lib/public_suffix_service/definitions.dat", "w+") do |f| + response = Net::HTTP.get_response(URI.parse(DEFINITION_URL)) + f.write(response.body) end - end
Remove pss prefix for rake task
diff --git a/test/tzinfo-data2/tzinfo/data.rb b/test/tzinfo-data2/tzinfo/data.rb index abc1234..def5678 100644 --- a/test/tzinfo-data2/tzinfo/data.rb +++ b/test/tzinfo-data2/tzinfo/data.rb @@ -3,7 +3,7 @@ # Top level module for TZInfo::Data. module Data # The directory containing the TZInfo::Data files. - LOCATION = File.dirname(File.dirname(__FILE__)).freeze + LOCATION = File.dirname(File.dirname(__FILE__)).untaint.freeze end end
Fix absolute path loading in safe mode on Ruby 1.9.3 and 2.0.0. __FILE__ is tainted on Ruby 2.1.0.
diff --git a/phantomjs-preview.rb b/phantomjs-preview.rb index abc1234..def5678 100644 --- a/phantomjs-preview.rb +++ b/phantomjs-preview.rb @@ -1,4 +1,4 @@-cask :v1 => 'phantomjs' do +cask :v1 => 'phantomjs-preview' do version '2.0.1' sha256 '0c3613d21187b4f3d02d3df9597800f404ff872bd43b748fb3fad84da425ae85'
Fix up the formula name.
diff --git a/pivo.gemspec b/pivo.gemspec index abc1234..def5678 100644 --- a/pivo.gemspec +++ b/pivo.gemspec @@ -22,4 +22,5 @@ spec.add_development_dependency "rake", "~> 10.0" spec.add_dependency "tracker_api" + spec.add_dependency "thor" end
Add thor gem to gemspec.
diff --git a/knife-vsphere.gemspec b/knife-vsphere.gemspec index abc1234..def5678 100644 --- a/knife-vsphere.gemspec +++ b/knife-vsphere.gemspec @@ -12,7 +12,7 @@ s.email = "ezra@cpan.org" s.files = Dir["lib/**/*"] + %w{LICENSE} s.required_ruby_version = ">= 2.5" - s.homepage = "http://github.com/chef/knife-vsphere" + s.homepage = "https://github.com/chef/knife-vsphere" s.license = "Apache-2.0" s.add_dependency "netaddr", ["~> 1.5"] s.add_dependency "rbvmomi", [">= 1.8", "< 3.0"]
Use https link in the gemspec Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/lib/celluloid/boot.rb b/lib/celluloid/boot.rb index abc1234..def5678 100644 --- a/lib/celluloid/boot.rb +++ b/lib/celluloid/boot.rb @@ -2,10 +2,9 @@ # Configure default systemwide settings Celluloid.task_class = Celluloid::TaskFiber +Celluloid.logger = Logger.new(STDERR) -# Launch the notifications fanout actor +# Launch default services # FIXME: We should set up the supervision hierarchy here Celluloid::Notifications::Fanout.supervise_as :notifications_fanout - -Celluloid.logger = Celluloid::IncidentLogger.new Celluloid::IncidentReporter.supervise_as :default_incident_reporter, STDERR
Disable the IncidentReporter by default The IncidentReporter is untested and probably not ready for primetime yet. This change disables it by default and uses similar logging to 0.12.0, which is a stdlib Logger which logs to STDERR.
diff --git a/lib/figaro/railtie.rb b/lib/figaro/railtie.rb index abc1234..def5678 100644 --- a/lib/figaro/railtie.rb +++ b/lib/figaro/railtie.rb @@ -4,7 +4,9 @@ module Figaro class Railtie < ::Rails::Railtie config.before_configuration do - ENV.update(Figaro.env) + Figaro.env.each do |key, value| + ENV[key] = value unless ENV.key?(key) + end end rake_tasks do
Allow application.yml to be overridden by ENV variables
diff --git a/lib/forklift/utils.rb b/lib/forklift/utils.rb index abc1234..def5678 100644 --- a/lib/forklift/utils.rb +++ b/lib/forklift/utils.rb @@ -8,13 +8,29 @@ result[:count] = collection["count"] case target.to_sym when :catalog - result[:catalogs] = collection["category"].nil? ? [] : collection["category"].map do |hash| - Forklift::Client::Catalog.new(client, hash) + + if result[:count].to_i == 1 + result[:catalogs] = [Forklift::Client::Catalog.new(client, collection["category"])] + elsif result[:count].to_i > 1 + result[:catalogs] = collection["category"].map do |hash| + Forklift::Client::Catalog.new(client, hash) + end + else + result[:catalogs] = [] end + when :gd - result[:gds] = collection["gd"].nil? ? [] : collection["gd"].map do |hash| - Forklift::Client::Gd.new(client, hash) + + if result[:count].to_i == 1 + result[:gds] = [Forklift::Client::Gd.new(client, collection["gd"])] + elsif result[:count].to_i > 1 + result[:gds] = collection["gd"].nil? ? [] : collection["gd"].map do |hash| + Forklift::Client::Gd.new(client, hash) + end + else + result[:gds] = [] end + end return result
Fix a damn bug cause by parsing XML. The XML return by Yahoo API is in the form: <categories count="8"> <category> <no>259</no> <level_no>2</level_no> <name><![CDATA[ohoh-mini]]></name> <type><![CDATA[1]]></type> </category> <category> <no>260</no> <level_no>2</level_no> <name><![CDATA[ohoh-max]]></name> <type><![CDATA[2]]></type> </category> </categories> After parsing the XML(via MultiXML), we get the Hash in the form: {"categories"=> {"count"=>"8", "category"=> [{"no"=>"259", "level_no"=>"2", "name"=>"ohoh-mini", "type"=>"1"}, {"no"=>"260", "level_no"=>"2", "name"=>"ohoh-max", "type"=>"2"}] } } The bug happens when the returned XML is: <categories count="8"> <category> <no>259</no> <level_no>2</level_no> <name><![CDATA[ohoh-mini]]></name> <type><![CDATA[1]]></type> </category> </categories> In this case, the Hash will be: {"categories"=>{"category"=>{"no"=>"259", "level_no"=>"2", "name"=>"ohoh-mini", "type"=>"1"}, "count"=>"8"}} i.e. the value of key "category" will be a Hash instead of an Array, this will cause an error in Forklift::Utils
diff --git a/lib/snapshot/setup.rb b/lib/snapshot/setup.rb index abc1234..def5678 100644 --- a/lib/snapshot/setup.rb +++ b/lib/snapshot/setup.rb @@ -12,7 +12,7 @@ File.write(snapfile_path, File.read("#{gem_path}/lib/assets/SnapfileTemplate")) File.write(File.join(path, 'SnapshotHelper.swift'), File.read("#{gem_path}/lib/assets/SnapshotHelper.swift")) - puts "Successfully created SnapshotHelper.js '#{File.join(path, 'SnapshotHelper.swift')}'".green + puts "Successfully created SnapshotHelper.swift '#{File.join(path, 'SnapshotHelper.swift')}'".green puts "Successfully created new Snapfile at '#{snapfile_path}'".green puts "-------------------------------------------------------".yellow
Fix wrong file extension in output
diff --git a/lib/tasks/travis.rake b/lib/tasks/travis.rake index abc1234..def5678 100644 --- a/lib/tasks/travis.rake +++ b/lib/tasks/travis.rake @@ -0,0 +1,5 @@+task :travis do + puts "Starting to run rake jasmine:ci..." + system("export DISPLAY=:99.0 && bundle exec rake jasmine:ci") + raise "rake jasmine:ci failed!" unless $?.exitstatus == 0 +end
Add new rake task for Travis-Jasmine configuration
diff --git a/lib/versionate/cli.rb b/lib/versionate/cli.rb index abc1234..def5678 100644 --- a/lib/versionate/cli.rb +++ b/lib/versionate/cli.rb @@ -19,6 +19,12 @@ Versionate.versionate file, options end + desc "version", "Display the version of versionate" + + def version + puts Versionate::VERSION + end + default_task :process end
Add a sub-command for outputting the gem version
diff --git a/resources/format_mount.rb b/resources/format_mount.rb index abc1234..def5678 100644 --- a/resources/format_mount.rb +++ b/resources/format_mount.rb @@ -1,4 +1,5 @@ actions :run +default_action :run attribute :mount_point, kind_of: String,
Add a default action: run
diff --git a/bitsy_client.gemspec b/bitsy_client.gemspec index abc1234..def5678 100644 --- a/bitsy_client.gemspec +++ b/bitsy_client.gemspec @@ -8,8 +8,8 @@ spec.version = BitsyClient::VERSION spec.authors = ["Ramon Tayag"] spec.email = ["ramon.tayag@gmail.com"] - spec.description = %q{TODO: Write a gem description} - spec.summary = %q{TODO: Write a gem summary} + spec.description = %q{Bitsy Client gem used to create and query payment depots} + spec.summary = %q{Interface with the Bitsy Bitcoin payment server} spec.homepage = "" spec.license = "MIT"
Add gemspec summary and description
diff --git a/app/jobs/docker.rb b/app/jobs/docker.rb index abc1234..def5678 100644 --- a/app/jobs/docker.rb +++ b/app/jobs/docker.rb @@ -8,9 +8,10 @@ @queue = "docker" def perform at(0, 3, "Cloning Repo") - url = options[:url] - repo = options[:repo] - path = "/tmp#{repo}" + url = options['url'] + repo = options['repo'] + path = "/tmp/#{repo}" + Worker.system_quietly("rm -rf #{path}") Git.clone(url, path) at(1, 3, "Building container") Docker::Image.build_from_dir('.')
Clean up before and after
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 @@ -1,5 +1,4 @@ require 'minitest/autorun' -require 'securerandom' module Gemshine module Test
Remove a reference to an unused lib
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,7 @@ require 'columbus' class Test::Unit::TestCase -end - -def fixture_file(file) - File.read(File.join(File.dirname(__FILE__), 'fixtures', file)) + def fixture_file(file) + File.read(File.join(File.dirname(__FILE__), 'fixtures', file)) + end end
Put fixture file in test unit testcase
diff --git a/app/models/user.rb b/app/models/user.rb index abc1234..def5678 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -6,7 +6,7 @@ # :token_authenticatable, :confirmable, # :lockable, :timeoutable and :omniauthable devise :database_authenticatable, :registerable, - :recoverable, :rememberable, :trackable, :validatable + :recoverable, :rememberable, :trackable, :validatable, :confirmable attr_accessor :login validates_presence_of :username, :full_name @@ -38,4 +38,15 @@ end end + def confirm! + welcome_message + super + end + + private + + def welcome_message + UserMailer.welcome_email(self).deliver + end + end
Add welcome_message to delegate to UserMailer and override confirm! method
diff --git a/tnetstring.gemspec b/tnetstring.gemspec index abc1234..def5678 100644 --- a/tnetstring.gemspec +++ b/tnetstring.gemspec @@ -12,6 +12,11 @@ s.required_rubygems_version = ">= 1.3.7" s.files = Dir['lib/**/*'] + s.extra_rdoc_files = [ + "HISTORY.rdoc", + "MIT-LICENSE", + "README.rdoc" + ] s.author = 'Matt Yoho' s.email = 'mby@mattyoho.com'
Add documentation files to gem
diff --git a/to_2d_hash.gemspec b/to_2d_hash.gemspec index abc1234..def5678 100644 --- a/to_2d_hash.gemspec +++ b/to_2d_hash.gemspec @@ -1,10 +1,10 @@ Gem::Specification.new do |s| s.name = "to_2d_hash" - s.version = "0.0.1" + s.version = "0.0.2" s.platform = Gem::Platform::RUBY s.authors = ["Floris Huetink"] s.email = ["floris@avocado.nl"] - s.homepage = "http://github.com/florish/gem_template" + s.homepage = "http://github.com/florish/to_2d_hash" s.summary = "Hash#to_2d_hash" s.description = "Converts a nested Hash to a two-dimensional Hash with concatenated keys" s.rubyforge_project = s.name
Change homepage and bump version number
diff --git a/resources/recursor_install.rb b/resources/recursor_install.rb index abc1234..def5678 100644 --- a/resources/recursor_install.rb +++ b/resources/recursor_install.rb @@ -21,6 +21,19 @@ property :version, String, default: '4.0.3' action :install do + apt_repository 'powerdns-recursor' do + uri 'http://repo.powerdns.com/ubuntu' + distribution 'trusty-rec-40' + arch 'amd64' + components ['main'] + key 'https://repo.powerdns.com/FD380FBB-pub.asc' + end + + apt_preference 'pdns-*' do + pin 'origin repo.powerdns.com' + pin_priority '600' + end + package 'pdns-recursor' do version new_resource.version end
Add in missing apt repo for trusty
diff --git a/rack-timeout.gemspec b/rack-timeout.gemspec index abc1234..def5678 100644 --- a/rack-timeout.gemspec +++ b/rack-timeout.gemspec @@ -6,7 +6,7 @@ spec.homepage = "http://github.com/heroku/rack-timeout" spec.author = "Caio Chassot" spec.email = "caio@heroku.com" - spec.files = Dir[*%w( MIT-LICENSE CHANGELOG README.markdown lib/**/* doc/**/* )] + spec.files = Dir[*%w( MIT-LICENSE CHANGELOG.md UPGRADING.md README.md lib/**/* doc/**/* )] spec.license = "MIT" spec.test_files = Dir.glob("test/**/*").concat([
Include *.md files in the gem package
diff --git a/spec/digitalocean_spec.rb b/spec/digitalocean_spec.rb index abc1234..def5678 100644 --- a/spec/digitalocean_spec.rb +++ b/spec/digitalocean_spec.rb @@ -3,28 +3,27 @@ describe Digitalocean do subject(:digitalocean) { described_class } + before do + digitalocean.client_id = client_id + digitalocean.api_key = api_key + end + describe "defaults" do - before do - digitalocean.client_id = nil - digitalocean.api_key = nil - end + let(:client_id) { nil } + let(:api_key) { nil} its(:api_endpoint) { should eq "https://api.digitalocean.com" } - its(:client_id) { should eq "client_id_required" } - its(:api_key) { should eq "api_key_required" } + its(:client_id) { should eq "client_id_required" } + its(:api_key) { should eq "api_key_required" } + it { digitalocean::VERSION.should eq "1.0.6" } end describe "setting values" do - let(:client_id) { "1234" } - let(:api_key) { "adf3434938492fjkdfj" } - - before do - digitalocean.client_id = client_id - digitalocean.api_key = api_key - end + let(:client_id) { "1234" } + let(:api_key) { "adf3434938492fjkdfj" } its(:client_id) { should eq client_id } - its(:api_key) { should eq api_key } + its(:api_key) { should eq api_key } end end
Use the power of let. DRY.
diff --git a/test/support/have_attributes.rb b/test/support/have_attributes.rb index abc1234..def5678 100644 --- a/test/support/have_attributes.rb +++ b/test/support/have_attributes.rb @@ -32,5 +32,5 @@ Matcher.new(attributes).matches? subject end - Minitest::Test.register_matcher Matcher, :have_attributes + ActiveSupport::TestCase.register_matcher Matcher, :have_attributes end
Fix the test to work in Rails 4.0
diff --git a/app/models/address.rb b/app/models/address.rb index abc1234..def5678 100644 --- a/app/models/address.rb +++ b/app/models/address.rb @@ -1,4 +1,5 @@ class Address < ActiveRecord::Base belongs_to :user validates :state, length: { maximum: 2 } + validates :user_id, :city, :state, :zip_code, presence: true end
Add some validations to Address model
diff --git a/capistrano-runit-rake.gemspec b/capistrano-runit-rake.gemspec index abc1234..def5678 100644 --- a/capistrano-runit-rake.gemspec +++ b/capistrano-runit-rake.gemspec @@ -7,8 +7,8 @@ spec.version = '0.2.0' spec.authors = ["Alexander Simonov"] spec.email = ["alex@simonov.me"] - spec.summary = %q{TODO: Write a short summary. Required.} - spec.description = %q{TODO: Write a longer description. Optional.} + spec.summary = %q{Capistrano3 tasks to manage rake tasks via runit supervisor.} + spec.description = %q{Capistrano3 tasks to manage rake tasks via runit supervisor.} spec.homepage = "" spec.license = "MIT"
Add summary and description to gemspec. This should get rid of error messages like: The gemspec at ... is not valid. The validation error was '"FIXME" or "TODO" is not a description'.
diff --git a/resources/logging.rb b/resources/logging.rb index abc1234..def5678 100644 --- a/resources/logging.rb +++ b/resources/logging.rb @@ -21,4 +21,4 @@ actions :set_level default_action :set_level -attribute :level, :kind_of => String, :name_attribute => true, :equal_to => ["debug", "error", "info"], :default => "info" +attribute :level, :kind_of => String, :name_attribute => true, :equal_to => ["debug", "error", "info"]
Remove default value not compatible with chef 14
diff --git a/orientdb-schema-migrator.gemspec b/orientdb-schema-migrator.gemspec index abc1234..def5678 100644 --- a/orientdb-schema-migrator.gemspec +++ b/orientdb-schema-migrator.gemspec @@ -14,7 +14,7 @@ spec.homepage = "https://copromote.com" spec.license = "MIT" - spec.files = FileList['lib/**/*.rb', '[A-Z]*'].exclude('Gemfile*') + spec.files = FileList['lib/**/*.{rb,rake}', '[A-Z]*'].exclude('Gemfile*') spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"]
Include rake task in gemspec files.
diff --git a/saxy.gemspec b/saxy.gemspec index abc1234..def5678 100644 --- a/saxy.gemspec +++ b/saxy.gemspec @@ -17,7 +17,7 @@ gem.required_ruby_version = ">= 1.9.3" - gem.add_dependency "nokogiri", "1.6.8.1" + gem.add_dependency "nokogiri" gem.add_development_dependency "rspec" end
Revert "Attempt to satisfy Ruby 1.9" This reverts commit 0a7e39112a79d826b5ae248a1f4ba653cb9b6d16.
diff --git a/app/controllers/site_controller.rb b/app/controllers/site_controller.rb index abc1234..def5678 100644 --- a/app/controllers/site_controller.rb +++ b/app/controllers/site_controller.rb @@ -1,4 +1,6 @@ class SiteController < ApplicationController + before_action :authenticate_user! + def members @key = Option.user_registration_token end
Add authentication to site controller
diff --git a/app/serializers/post_serializer.rb b/app/serializers/post_serializer.rb index abc1234..def5678 100644 --- a/app/serializers/post_serializer.rb +++ b/app/serializers/post_serializer.rb @@ -1,6 +1,7 @@ class PostSerializer < ActiveModel::Serializer attributes( :id, + :public_id, :title, :body, :created_at,
Add public_id to API response Fix https://github.com/bm-sms/daimon-news-misc/issues/129
diff --git a/config/initializers/mail_safe.rb b/config/initializers/mail_safe.rb index abc1234..def5678 100644 --- a/config/initializers/mail_safe.rb +++ b/config/initializers/mail_safe.rb @@ -0,0 +1,4 @@+if defined?(MailSafe::Config) + MailSafe::Config.internal_address_definition = lambda { |addr| false } + MailSafe::Config.replacement_address = 'founders@circleci.com' if (MailSafe::Config.developer_email_address == "") +end
Fix production email - if there's no .gitconfig, don't fail.