diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -11,7 +11,7 @@ recipe 'rsyslog::server', 'Sets up an rsyslog server' supports 'ubuntu', '>= 12.04' -supports 'debian', '>= 5.0' +supports 'debian', '>= 7.0' supports 'redhat', '>= 5.0' supports 'centos', '>= 5.0' supports 'fedora'
Clarify we need at least Debian 7 Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -8,5 +8,4 @@ description 'Installs/Configures resource_from_hash' version '1.2.2' -supports 'centos', '~> 6.0' supports 'centos', '~> 7.0'
Remove Centos 6 from this Cookbook
diff --git a/azure-chef-extension.gemspec b/azure-chef-extension.gemspec index abc1234..def5678 100644 --- a/azure-chef-extension.gemspec +++ b/azure-chef-extension.gemspec @@ -18,7 +18,7 @@ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ["lib", "spec"] - s.add_dependency "chef", ">= 0.10.10" + s.add_development_dependency "chef", ">= 0.10.10" s.add_development_dependency 'rubyzip', '>= 1.0.0' s.add_development_dependency 'nokogiri', '~> 1.6.1'
Add chef as a dev dependency
diff --git a/lib/parsley_simple_form/validators/base.rb b/lib/parsley_simple_form/validators/base.rb index abc1234..def5678 100644 --- a/lib/parsley_simple_form/validators/base.rb +++ b/lib/parsley_simple_form/validators/base.rb @@ -23,5 +23,3 @@ end end end - -Status API Training Shop Blog About Pricing
Fix copy and paste error.
diff --git a/lib/puppet-lint/plugins/no_erb_template.rb b/lib/puppet-lint/plugins/no_erb_template.rb index abc1234..def5678 100644 --- a/lib/puppet-lint/plugins/no_erb_template.rb +++ b/lib/puppet-lint/plugins/no_erb_template.rb @@ -2,7 +2,7 @@ def check functions = ['template', 'inline_template'] - tokens.select { |t| t.type == :NAME and functions.include? t.value }.each do |function_token| + tokens.select { |t| (t.type == :NAME or t.type == :FUNCTION_NAME) and functions.include? t.value }.each do |function_token| next unless function_token.next_code_token.type == :LPAREN key_token = function_token.next_code_token.next_code_token
Fix compatibility with puppet-lint 2.2 puppet-lint 2.2 introduced the :FUNCTION_NAME token type, effectively breaking the existing simple checking for :NAME. Here we check for either token, so the plugin will continue to work pre 2.2.
diff --git a/spec/default_search_spec.rb b/spec/default_search_spec.rb index abc1234..def5678 100644 --- a/spec/default_search_spec.rb +++ b/spec/default_search_spec.rb @@ -2,29 +2,33 @@ describe "Default search" do - it "Should match popular items" do - default_search('b3340555', 'Pubmed', 3) + describe "Popular items" do + it "Should match popular items" do + default_search('b3340555', 'Pubmed', 3) + end end - it "Should match partial titles" do - default_search('b2041590', 'remains of the day', 10) - default_search('b7113006', 'time is a toy', 3) - end + describe "Titles" do + it "Should match partial titles" do + default_search('b2041590', 'remains of the day', 10) + default_search('b7113006', 'time is a toy', 3) + end - it "Should match full title strings without quotes" do - default_search('b2151715', 'A Pale View of Hills', 2) - end + it "Should match full title strings without quotes" do + default_search('b2151715', 'A Pale View of Hills', 2) + end - it "Should match full title strings with quotes" do - default_search('b2151715', '"A Pale View of Hills"', 2) - end + it "Should match full title strings with quotes" do + default_search('b2151715', '"A Pale View of Hills"', 2) + end - it "Should match partial title and TOC text" do - default_search('b3176352', 'Effects of globalization in india', 10) - end + it "Should match partial title and TOC text" do + default_search('b3176352', 'Effects of globalization in india', 10) + end - it "Should prefer primary titles over additional titles" do - default_search('b1864577', 'scientific american', 5) + it "Should prefer primary titles over additional titles" do + default_search('b1864577', 'scientific american', 5) + end end describe "Authors" do
Add groups for default searches.
diff --git a/api/spree_api.gemspec b/api/spree_api.gemspec index abc1234..def5678 100644 --- a/api/spree_api.gemspec +++ b/api/spree_api.gemspec @@ -22,6 +22,6 @@ s.add_dependency 'spree_core', s.version s.add_dependency 'rabl', '~> 0.13.1' s.add_dependency 'versioncake', '~> 3.4.0' - s.add_dependency 'fast_jsonapi', '~> 1.3.0' + s.add_dependency 'fast_jsonapi', '~> 1.5' s.add_dependency 'doorkeeper', '~> 5.0' end
Bump fast_json_api to 1.5 and loosen dependency requirement
diff --git a/app/views/forums/index.atom.builder b/app/views/forums/index.atom.builder index abc1234..def5678 100644 --- a/app/views/forums/index.atom.builder +++ b/app/views/forums/index.atom.builder @@ -9,7 +9,7 @@ @nodes.each do |node| post = node.content - feed.entry(post, :url => url_for([post.forum, post])) do |entry| + feed.entry(post, :url => forum_post_url(:forum_id => post.forum, :id => post)) do |entry| entry.title(post.title) entry.content(post.body, :type => 'html') entry.author do |author|
Fix relative links in the forums feed
diff --git a/spec/optimus_binary_spec.rb b/spec/optimus_binary_spec.rb index abc1234..def5678 100644 --- a/spec/optimus_binary_spec.rb +++ b/spec/optimus_binary_spec.rb @@ -1,4 +1,10 @@ require 'spec_helper' + +root = Pathname.new(__FILE__).parent.parent +bin_folder = root.join('bin').to_s +path_separator = File::PATH_SEPARATOR +path = ENV['PATH'] +ENV['PATH'] = "#{bin_folder}#{path_separator}#{path}" describe 'optimus.rb' do let(:finished) do @@ -23,7 +29,7 @@ describe 'Finished output' do before(:each) do - @output = `bundle exec optimus.rb -p test_pipeline -f #{config_path}` + @output = `optimus.rb -p test_pipeline -f #{config_path}` end it 'should print out the finished output when arguments are given ' do @@ -38,14 +44,14 @@ describe 'Help output' do it 'should print out help message if no arguments are given' do - output = `bundle exec optimus.rb` + output = `optimus.rb` expect(output).to include('Missing options') end end describe 'Missing Pipeline' do it 'should raise a Pipeline not found exception when the specified pipeline is not found' do - output = `bundle exec optimus.rb -p inexistent_pipeline -f #{config_path} 2>&1` + output = `optimus.rb -p inexistent_pipeline -f #{config_path} 2>&1` expect(output).to include('Pipeline not found (RuntimeError)') end end
Load optimus.rb in path and remove calls to bundle exec
diff --git a/spec/support/dummy_login.rb b/spec/support/dummy_login.rb index abc1234..def5678 100644 --- a/spec/support/dummy_login.rb +++ b/spec/support/dummy_login.rb @@ -10,6 +10,8 @@ def current_user nil end + + helper_method :current_user STRING end @@ -25,5 +27,7 @@ User.new(attributes) end + + helper_method :current_user STRING end
Make the fake current_user available as a helper
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 @@ -1,6 +1,5 @@ class Project include Mongoid::Document - include Mongoid::Slugify field :name field :vcs_url @@ -13,13 +12,11 @@ attr_accessible :name, :vcs_url - - after_validation :generate_slug - def generate_slug - # This has a '/' in it, so the constraints also needed to be loosened in config/routes.rb - self.slug = github_project_name + # TECHNICAL_DEBT - TODO - WARNING - HACK - BEWARE + # I can't quite figure out how this looks the project up, so it must be a linear search! + def to_param + github_project_name end - def github_project_name result = vcs_url.sub("https://github.com/", "")
Clean URLs can be done with just to_param, we don't need slugify for it.
diff --git a/app/representers/service_representer.rb b/app/representers/service_representer.rb index abc1234..def5678 100644 --- a/app/representers/service_representer.rb +++ b/app/representers/service_representer.rb @@ -5,6 +5,7 @@ include Roar::Representer::JSON include Roar::Representer::Feature::Hypermedia + property :id property :audience property :description property :eligibility
Add service id to representer To be able to update services, the API needs to expose the ID
diff --git a/Casks/deezer.rb b/Casks/deezer.rb index abc1234..def5678 100644 --- a/Casks/deezer.rb +++ b/Casks/deezer.rb @@ -2,7 +2,7 @@ version '1.1_4191' sha256 'f9d491fb8d4b055a60b3d4a13a4e8b19e4b9b8d70dc8740df734afeee5482a34' - url "https://cdns-content.deezer.com/builds/mac/Deezer_#{version.sub(%r{^[^_]*_(\d+)},'\1')}.dmg" + url "http://e-cdn-content.deezer.com/builds/mac/Deezer_#{version.sub(%r{.*_},'')}.dmg" name 'Deezer' homepage 'https://www.deezer.com/formac' license :gratis
Fix urls in Deezer.app Cask The old url pointed to an outdated https Deezer domain for which the SSL certificate has expired. This resulted in the following error when trying to run brew cask install deezer: curl: (60) SSL certificate problem: Invalid certificate chain More details here: http://curl.haxx.se/docs/sslcerts.html This commit updates the url to reflect the url used when downloading via a browser. The homepage url has also been updated as it doesn't use https.
diff --git a/Casks/vienna.rb b/Casks/vienna.rb index abc1234..def5678 100644 --- a/Casks/vienna.rb +++ b/Casks/vienna.rb @@ -1,6 +1,6 @@ class Vienna < Cask - version '3.0.0_rc7' - sha256 '5a7b4b20883beb8e99ec331c09892a27b3f1340d90ddb6226fa11bee24643677' + version '3.0.0_rc8' + sha256 'e707769442e3064234bbd0450a22d28de0fa87ae194b1e6c5a423e555e58a5d1' url "https://downloads.sourceforge.net/vienna-rss/Vienna#{version}.tgz" appcast 'http://vienna-rss.org/changelog_beta.xml'
Upgrade Vienna to 3.0.0 RC8
diff --git a/Casks/mpeg-streamclip-beta.rb b/Casks/mpeg-streamclip-beta.rb index abc1234..def5678 100644 --- a/Casks/mpeg-streamclip-beta.rb +++ b/Casks/mpeg-streamclip-beta.rb @@ -0,0 +1,11 @@+cask :v1 => 'mpeg-streamclip-beta' do + version '1.9.3b8' + sha256 '42459e262e46df81228ef3859aba102d9368be3a5710514a3055dd9f49c2f234' + + url "http://www.squared5.com/svideo/MPEG_Streamclip_#{version}.dmg" + name 'MPEG Streamclip' + homepage 'http://www.squared5.com/' + license :unknown # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder + + app 'MPEG Streamclip.app' +end
Add a new version of the Cask "mpeg-streamclip". * MPEG Streamclip 1.9.3b8
diff --git a/Casks/phpstorm-bundled-jdk.rb b/Casks/phpstorm-bundled-jdk.rb index abc1234..def5678 100644 --- a/Casks/phpstorm-bundled-jdk.rb +++ b/Casks/phpstorm-bundled-jdk.rb @@ -1,8 +1,8 @@ cask :v1 => 'phpstorm-bundled-jdk' do - version '9.0.2' - sha256 '38030261bb8ee17e0238b92f7d1f49671e6dc54b2b69aeaf25cbd20b94f0c479' + version '10.0' + sha256 '6651185b3dace3f9a89046573558cd9223729de2abe90821aa1c2eae146d9dc5' - url "http://download-cf.jetbrains.com/webide/PhpStorm-#{version}-custom-jdk-bundled.dmg" + url "https://download.jetbrains.com/webide/PhpStorm-#{version}-custom-jdk-bundled.dmg" name 'PhpStorm' homepage 'https://www.jetbrains.com/phpstorm/' license :commercial @@ -10,8 +10,8 @@ app 'PhpStorm.app' zap :delete => [ - '~/Library/Application Support/WebIde90', - '~/Library/Preferences/WebIde90', + '~/Library/Application Support/WebIde100', + '~/Library/Preferences/WebIde100', '~/Library/Preferences/com.jetbrains.PhpStorm.plist', ] end
Update Phpstorm to version 10.0
diff --git a/Casks/texnicle.rb b/Casks/texnicle.rb index abc1234..def5678 100644 --- a/Casks/texnicle.rb +++ b/Casks/texnicle.rb @@ -1,7 +1,7 @@ class Texnicle < Cask - url 'http://www.bobsoft-mac.de/resources/TeXnicle/2.2/TeXnicle.app.2.2.9.zip' + url 'http://www.bobsoft-mac.de/resources/TeXnicle/2.2/TeXnicle.app.2.2.11.zip' homepage 'http://www.bobsoft-mac.de/texnicle/texnicle.html' - version '2.2.9' - sha256 '2076a2922bd156ac6e6af1afbb58bd928579a457f500fae40024f24f65a5e5dd' + version '2.2.11' + sha256 'b522e551220bfc98ff3d3c09db224c0db2a31c1dff4c73353a26d1f13217733b' link 'TeXnicle.app' end
Update TeXnicle to latest version 2.2.11
diff --git a/core/spec/integration/tour_spec.rb b/core/spec/integration/tour_spec.rb index abc1234..def5678 100644 --- a/core/spec/integration/tour_spec.rb +++ b/core/spec/integration/tour_spec.rb @@ -16,7 +16,7 @@ assume_unchanged_screenshot 'extension' end - it 'Let''s create your first factlink page should be the same' do + pending 'Let''s create your first factlink page should be the same' do click_link "Skip this step" sleep 1
Put the tour 'create your first factlink page' screenshot on pending Build has to succeed, someone is going to fix this later.
diff --git a/core/spec/screenshots/feed_spec.rb b/core/spec/screenshots/feed_spec.rb index abc1234..def5678 100644 --- a/core/spec/screenshots/feed_spec.rb +++ b/core/spec/screenshots/feed_spec.rb @@ -13,7 +13,7 @@ visit feed_path find('label[for=FeedChoice_Personal]').click - find('.feed-activity:first-child') + find('.spec-feed-activity+.spec-loading-indicator-done') assume_unchanged_screenshot 'feed' end end
Fix random fails by waiting until the loading indicator has gone
diff --git a/DMCustomModalViewController.podspec b/DMCustomModalViewController.podspec index abc1234..def5678 100644 --- a/DMCustomModalViewController.podspec +++ b/DMCustomModalViewController.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'DMCustomModalViewController' - s.version = '1.0' + s.version = '1.0.1' s.summary = 'A cool modal transition' s.homepage = 'https://github.com/Dimillian/DMCustomModalViewController.git' s.author = { @@ -10,7 +10,7 @@ :git => 'https://github.com/Dimillian/DMCustomModalViewController.git', :tag => '1.0' } - s.ios.deployment_target = '7.0' + s.platform = :ios, '7.0' s.source_files = 'classes/*.{h,m}' s.requires_arc = true s.license = 'MIT'
Fix podspec for iOS 7 only
diff --git a/config/schedule.rb b/config/schedule.rb index abc1234..def5678 100644 --- a/config/schedule.rb +++ b/config/schedule.rb @@ -19,7 +19,9 @@ # Learn more: http://github.com/javan/whenever -set :output, '/home/shakaman/dev/deliciousletter/tmp/cron_log.log' +@root_path = File.expand_path('../..', __FILE__) + +set :output, "#{@root_path}/tmp/cron_log.log" every :sunday, :at => '18:13pm' do - command "./home/shakaman/dev/deliciousletter/bin/deliciousletter" + command "#{@root_path}/bin/deliciousletter" end
Use root_path for crontab generation.
diff --git a/app/controllers/contact_messages_controller.rb b/app/controllers/contact_messages_controller.rb index abc1234..def5678 100644 --- a/app/controllers/contact_messages_controller.rb +++ b/app/controllers/contact_messages_controller.rb @@ -1,27 +1,9 @@-class ContactMessagesController < ApplicationController +class ContactMessagesController < InheritedResources::Base + actions :new, :create respond_to :html def create - if params.has_key? :contact_form - create_contact_message(params[:contact_form]) - else - redirect_to root_path, notice: t(".controllers.messages.errors.missing_form_data") - end + create!(notice: t(".controllers.messages.success.email_sent")) end - - - private - - def create_contact_message(form_data) - message = ContactMessage.new(form_data) - if message.deliver - flash[:notice] = t(".controllers.messages.success.email_sent") - render :index - else - flash[:notice] = t(".controllers.messages.errors.email_not_sent") - render :index - end - end - end
Use inherited resources to handle validation and send the email message.
diff --git a/app/controllers/kracken/sessions_controller.rb b/app/controllers/kracken/sessions_controller.rb index abc1234..def5678 100644 --- a/app/controllers/kracken/sessions_controller.rb +++ b/app/controllers/kracken/sessions_controller.rb @@ -2,6 +2,7 @@ module Kracken class SessionsController < ActionController::Base + protect_from_forgery with: :exception def create @user = user_class.find_or_create_from_auth_hash(auth_hash)
Fix issue flagged by brakeman Confidence: High Category: Cross-Site Request Forgery Check: ForgerySetting Message: 'protect_from_forgery' should be called in Kracken::SessionsController File: app/controllers/kracken/sessions_controller.rb Line: 4 Per the suggestion we set it to raise an exception. If apps want to override this in the subclasses they can change it there.
diff --git a/ball_gag.gemspec b/ball_gag.gemspec index abc1234..def5678 100644 --- a/ball_gag.gemspec +++ b/ball_gag.gemspec @@ -8,8 +8,8 @@ s.authors = ['Duncan Beevers'] s.email = ['duncan@dweebd.com'] s.homepage = '' - s.summary = 'Pluggable Content Sanitization' - s.description = 'Sanitize user input using pluggable back-ends' + s.summary = 'Pluggable User-Content Validation' + s.description = 'Validate user input using pluggable back-ends' s.rubyforge_project = 'ball_gag'
Update gemspec summary and description
diff --git a/decorators.gemspec b/decorators.gemspec index abc1234..def5678 100644 --- a/decorators.gemspec +++ b/decorators.gemspec @@ -18,7 +18,7 @@ readme.md ] - s.add_dependency "railties", ">= 4.0.0", "< 5.1" + s.add_dependency "railties", ">= 4.0.0", "< 6" s.add_development_dependency "rspec", "~> 3.5", ">= 3.5.0" s.cert_chain = ["certs/parndt.pem"]
Add support for Rails < 6
diff --git a/test/unit/services/service_listeners/attachment_access_limited_updater_test.rb b/test/unit/services/service_listeners/attachment_access_limited_updater_test.rb index abc1234..def5678 100644 --- a/test/unit/services/service_listeners/attachment_access_limited_updater_test.rb +++ b/test/unit/services/service_listeners/attachment_access_limited_updater_test.rb @@ -12,6 +12,17 @@ AssetManagerAttachmentAccessLimitedWorker.stubs(:new).returns(worker) end + context 'when the attachment has associated attachment data' do + let(:sample_rtf) { File.open(fixture_path.join('sample.rtf')) } + let(:attachment) { FactoryBot.create(:file_attachment, file: sample_rtf) } + + it 'calls the worker' do + worker.expects(:perform).with(attachment_data) + + updater.update! + end + end + context 'when attachment has no associated attachment data' do let(:attachment) { FactoryBot.create(:html_attachment) }
Test that service listener calls worker when attachment data present
diff --git a/attributes/default.rb b/attributes/default.rb index abc1234..def5678 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -3,8 +3,9 @@ # Path to tzdata directory default['timezone']['tzdata_dir'] = '/usr/share/zoneinfo' -# Path to file used by kernerl for local timezone's data +# Path to file used by kernel for local timezone's data default['timezone']['localtime_path'] = '/etc/localtime' -# Whether to use a symlink to tzdata (instead of copying) +# Whether to use a symlink to tzdata (instead of copying). +# Used only in the linux-default recipe. default['timezone']['use_symlink'] = false
Fix spelling and add a little more info
diff --git a/spec/overcommit/hook/post_commit/submodule_status_spec.rb b/spec/overcommit/hook/post_commit/submodule_status_spec.rb index abc1234..def5678 100644 --- a/spec/overcommit/hook/post_commit/submodule_status_spec.rb +++ b/spec/overcommit/hook/post_commit/submodule_status_spec.rb @@ -0,0 +1,38 @@+require 'spec_helper' + +describe Overcommit::Hook::PostCommit::SubmoduleStatus do + let(:config) { Overcommit::ConfigurationLoader.default_configuration } + let(:context) { double('context') } + subject { described_class.new(config, context) } + + let(:result) { double('result') } + + before do + result.stub(:stdout).and_return("#{prefix}#{random_hash} sub (heads/master)") + subject.stub(:execute).and_return(result) + end + + context 'when submodule is up to date' do + let(:prefix) { '' } + + it { should pass } + end + + context 'when submodule is uninitialized' do + let(:prefix) { '-' } + + it { should warn(/uninitialized/) } + end + + context 'when submodule is outdated' do + let(:prefix) { '+' } + + it { should warn(/out of date/) } + end + + context 'when submodule has merge conflicts' do + let(:prefix) { 'U' } + + it { should warn(/merge conflicts/) } + end +end
Add specs for SubmoduleStatus post-commit hook
diff --git a/redistry.gemspec b/redistry.gemspec index abc1234..def5678 100644 --- a/redistry.gemspec +++ b/redistry.gemspec @@ -16,6 +16,8 @@ s.required_rubygems_version = ">= 1.3.6" s.rubyforge_project = "redistry" + s.add_dependency("redis", ">= 2.2.1") + s.add_development_dependency "rspec" s.files = Dir.glob("{bin,lib}/**/*") + %w(LICENSE README.md)
Add redis gem as dependency
diff --git a/lib/steam_valve.rb b/lib/steam_valve.rb index abc1234..def5678 100644 --- a/lib/steam_valve.rb +++ b/lib/steam_valve.rb @@ -3,4 +3,10 @@ require "exceptions/api_key_missing_error" module SteamValve + attr_reader :api_key + + def initialize + API_KEY = SteamAPIKey.api_key + puts API_KEY + end end
Add initialize method to SteamValve
diff --git a/lib/tasks/npm.rake b/lib/tasks/npm.rake index abc1234..def5678 100644 --- a/lib/tasks/npm.rake +++ b/lib/tasks/npm.rake @@ -7,14 +7,15 @@ output_file_path = ::Rails.root.join(::Rails.configuration.npm.output_file) browserify_options = ::Rails.configuration.npm.browserify_options Npm::Rails::PackageBundler.bundle(::Rails.root, package_file, ::Rails.env) do |packages, bundle_file_path| - command = "cd #{ ::Rails.root } & npm install --loglevel error #{ packages }" FileUtils.touch(output_file_path) unless File.exist?(output_file_path) if Rails.env.production? - comamnd << "& NODE_ENV=production browserify #{ browserify_options } #{ bundle_file_path } > #{ output_file_path }" + browserify_comamnd = "NODE_ENV=production browserify #{ browserify_options } #{ bundle_file_path } > #{ output_file_path }" else - command << "& browserify #{ browserify_options } #{ bundle_file_path } > #{ output_file_path }" + browserify_command = "browserify #{ browserify_options } #{ bundle_file_path } > #{ output_file_path }" end - sh command + sh "cd #{ ::Rails.root }" + sh "npm install --loglevel error #{ packages }" + sh browserify_command end end end
Split the sh command in the rake task
diff --git a/swift-tsao.podspec b/swift-tsao.podspec index abc1234..def5678 100644 --- a/swift-tsao.podspec +++ b/swift-tsao.podspec @@ -19,5 +19,5 @@ s.watchos.deployment_target = "2.0" s.tvos.deployment_target = "9.0" s.source = { :git => "https://github.com/kballard/swift-tsao.git", :tag => "v#{s.version}" } - s.source_files = "TSAO.swift" + s.source_files = "Sources/*.swift" end
Fix the podspec source files pattern
diff --git a/lib/gir_ffi/in_pointer.rb b/lib/gir_ffi/in_pointer.rb index abc1234..def5678 100644 --- a/lib/gir_ffi/in_pointer.rb +++ b/lib/gir_ffi/in_pointer.rb @@ -5,8 +5,8 @@ class InPointer < FFI::Pointer def self.from_array type, ary return nil if ary.nil? - return self.from_utf8_array ary if type == :utf8 - return self.from_interface_pointer_array ary if type == :interface_pointer + return from_utf8_array ary if type == :utf8 + return from_interface_pointer_array ary if type == :interface_pointer ffi_type = GirFFI::Builder::TAG_TYPE_MAP[type] || type block = ArgHelper.allocate_array_of_type ffi_type, ary.length @@ -20,18 +20,21 @@ self.new ArgHelper.utf8_to_inptr(val) end - def self.from_utf8_array ary - return nil if ary.nil? - ptr_ary = ary.map {|str| self.from :utf8, str} - ptr_ary << nil - self.from_array :pointer, ptr_ary - end + class << self - def self.from_interface_pointer_array ary - return nil if ary.nil? - ptr_ary = ary.map {|ifc| ifc.to_ptr} - ptr_ary << nil - self.from_array :pointer, ptr_ary + private + + def from_utf8_array ary + ptr_ary = ary.map {|str| self.from :utf8, str} + ptr_ary << nil + self.from_array :pointer, ptr_ary + end + + def from_interface_pointer_array ary + ptr_ary = ary.map {|ifc| ifc.to_ptr} + ptr_ary << nil + self.from_array :pointer, ptr_ary + end end end end
Make special-case creation methods private. This allows nil check to be skipped.
diff --git a/config/deploy.rb b/config/deploy.rb index abc1234..def5678 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -3,7 +3,7 @@ set :domain, "lugia.jbhannah.net" set :application, "jbhannah" -set :repository, "git://github.com/jbhannah/jbhannah.git" +set :repository, "git@github.com:jbhannah/jbhannah.git" set :scm, :git # Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`
Use GitHub SSH repository address in Capistrano
diff --git a/config/routes.rb b/config/routes.rb index abc1234..def5678 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -5,7 +5,7 @@ resources :members, only: [:index, :show] do collection do get :popular - get :search + match :search, via: [:get, :post] end end
Add post method for search
diff --git a/lib/log_weasel/railtie.rb b/lib/log_weasel/railtie.rb index abc1234..def5678 100644 --- a/lib/log_weasel/railtie.rb +++ b/lib/log_weasel/railtie.rb @@ -5,7 +5,7 @@ initializer "log_weasel.configure" do |app| LogWeasel.configure do |config| - config.key = app.config.log_weasel[:key] || self.app_name + config.key = app.config.log_weasel[:key] || app_name end app.config.middleware.insert_before "::Rails::Rack::Logger", "LogWeasel::Middleware" @@ -13,7 +13,7 @@ private - def self.app_name - ::Rails.application.class.to_s.split("::").first + def app_name + ::Rails.application.class.to_s.split('::').first end -end+end
Change from class method to instance method
diff --git a/wateringServer/spec/controllers/waterings_controller_spec.rb b/wateringServer/spec/controllers/waterings_controller_spec.rb index abc1234..def5678 100644 --- a/wateringServer/spec/controllers/waterings_controller_spec.rb +++ b/wateringServer/spec/controllers/waterings_controller_spec.rb @@ -0,0 +1,20 @@+require 'rails_helper' + +describe WateringsController do + before(:each) do + User.create(email: "test@test.com", password: "testPassword") + controller.session[:user_id] = User.first.id + end + let(:plant) { Plant.create(name: "Test Name", + species: "Test Species", + days_per_watering: 10, + start_date: Date.today() + )} + + describe 'GET #new' do + it 'can render the :new template' do + get :new, params: { plant_id: plant.id } + expect(response).to render_template(:new) + end + end +end
Add GET test for watering controller
diff --git a/lib/now_playing_client.rb b/lib/now_playing_client.rb index abc1234..def5678 100644 --- a/lib/now_playing_client.rb +++ b/lib/now_playing_client.rb @@ -8,7 +8,12 @@ @server = 'test.mosquitto.org' @topic = 'bbc/nowplaying/#' @callbacks = [] + @current = {} connect! + end + + def now_playing(station_id) + cache_get(station_id) end def on_message(&block) @@ -20,15 +25,33 @@ end private + def cache_store(key, value) + @current[key] = value + end + + def cache_get(key) + @current[key] if @current.has_key?(key) + end + + def parse(message) + station = message.topic.gsub('#', '').gsub('bbc/nowplaying/', '') + payload = JSON.parse(message.payload) + payload[:station_id] = station + payload + end + + def handle_incoming_message(message) + payload = parse(message) + cache_store(payload[:station_id], payload) + notify(payload) + end + def connect! EventMachine.run do EventMachine::MQTT::ClientConnection.connect(@server) do |c| c.subscribe(@topic) c.receive_callback do |message| - station = message.topic.gsub('#', '').gsub('bbc/nowplaying/', '') - payload = JSON.parse(message.payload) - payload[:station_id] = station - notify(payload) + handle_incoming_message(message) end end end
Refactor NowPlayingClient to cache now playing messages
diff --git a/recipes/user_management.rb b/recipes/user_management.rb index abc1234..def5678 100644 --- a/recipes/user_management.rb +++ b/recipes/user_management.rb @@ -16,6 +16,6 @@ roles user['roles'] database user['database'] connection node['mongodb'] - action :add + action user['action'] or :add end end
Use action from user object, default :add In the user_management recipe, use the action from the user object if one exists, or :add if there isn't. This allows us to specify in the collection that we want to, for example, delete users if they exist.
diff --git a/config.rb b/config.rb index abc1234..def5678 100644 --- a/config.rb +++ b/config.rb @@ -33,7 +33,7 @@ activate :blog do |blog| blog.prefix = 'blog' blog.layout = 'blog_layout' - blog.permalink = '{title}' + blog.permalink = '{title}.html' blog.summary_separator = /\n\n/ end
Revert "Drop the .html blog links" This reverts commit 3c18be6b539169534e1d0ced18786f2adc0d445a.
diff --git a/config.ru b/config.ru index abc1234..def5678 100644 --- a/config.ru +++ b/config.ru @@ -10,8 +10,8 @@ set :app_file, File.join(root_dir, 'app.rb') disable :run -FileUtils.mkdir_p 'log' unless File.exist?('log') -log = File.new("#{root_dir}/log/sinatra.log", "a") -$stderr.reopen(log) +#FileUtils.mkdir_p 'log' unless File.exist?('log') +#log = File.new("#{root_dir}/log/sinatra.log", "a") +#$stderr.reopen(log) run Sinatra::Application
Disable special log handling since we will deploy with Dokku
diff --git a/whenever.gemspec b/whenever.gemspec index abc1234..def5678 100644 --- a/whenever.gemspec +++ b/whenever.gemspec @@ -9,7 +9,7 @@ s.authors = ["Javan Makhmali"] s.email = ["javan@javan.us"] s.license = "MIT" - s.homepage = "" + s.homepage = "https://github.com/javan/whenever" s.summary = %q{Cron jobs in ruby.} s.description = %q{Clean ruby syntax for writing and deploying cron jobs.} s.files = `git ls-files`.split("\n")
Set homepage to github repo url
diff --git a/gitlab-runner.rb b/gitlab-runner.rb index abc1234..def5678 100644 --- a/gitlab-runner.rb +++ b/gitlab-runner.rb @@ -26,6 +26,6 @@ end test do - assert_match /gitlab-runner version #{version} (.*)/, shell_output("gitlab-runner --version") + assert_match /gitlab-runner version #{version}/, shell_output("gitlab-runner --version") end end
Update tests, remove unnecessary (.*)
diff --git a/Library/Formula/kde-phonon.rb b/Library/Formula/kde-phonon.rb index abc1234..def5678 100644 --- a/Library/Formula/kde-phonon.rb +++ b/Library/Formula/kde-phonon.rb @@ -1,9 +1,9 @@ require 'formula' class KdePhonon <Formula - url 'ftp://ftp.kde.org/pub/kde/stable/phonon/4.4.0/phonon-4.4.0.tgz' + url 'ftp://ftp.kde.org/pub/kde/stable/phonon/4.4.2/phonon-4.4.2.tar.bz2' homepage 'http://phonon.kde.org/' - md5 '80544b876cf0e0af05f2303b3f534351' + md5 'd9eab28383783261254f1cef3b92a3fa' depends_on 'cmake' => :build depends_on 'automoc4' => :build @@ -12,7 +12,8 @@ keg_only "This package is already supplied by Qt and is only needed by KDE packages." def patches - "http://gitorious.org/phonon/phonon/commit/9556b819b089da67290691f53ce7c1550ed23705.patch" + # Add missing QUuid include; committed upstream. + "http://gitorious.org/phonon/phonon/commit/8e96bbfb1ab4b1c75e4c417549fcc0d3ae9e2183.patch" end def install
Update KDE Phonon to 4.4.2 and add QUuid compilation fix.
diff --git a/lib/wishETL/tube/mssql.rb b/lib/wishETL/tube/mssql.rb index abc1234..def5678 100644 --- a/lib/wishETL/tube/mssql.rb +++ b/lib/wishETL/tube/mssql.rb @@ -4,7 +4,7 @@ attr_reader :res def initialize(opts = {}) - ENV['MSSQLPORT'] ||= 1433 + ENV['MSSQLPORT'] ||= '1433' @conn = TinyTds::Client.new(:username => ENV['MSSQLUSER'], :password => ENV['MSSQLPASS'], :host => ENV['MSSQLHOST'], :port => ENV['MSSQLPORT'], :timeout => 60000) end
Switch to string for port default
diff --git a/csv2avro.gemspec b/csv2avro.gemspec index abc1234..def5678 100644 --- a/csv2avro.gemspec +++ b/csv2avro.gemspec @@ -24,5 +24,5 @@ spec.add_development_dependency "pry", "~> 0.10" spec.add_development_dependency "bump", "~> 0.5" - spec.add_dependency "avro", "~> 1.7" + spec.add_runtime_dependency "avro", "~> 1.7" end
Fix runtime dependency in gemspec
diff --git a/lib/buildr_plus/features/dbt.rb b/lib/buildr_plus/features/dbt.rb index abc1234..def5678 100644 --- a/lib/buildr_plus/features/dbt.rb +++ b/lib/buildr_plus/features/dbt.rb @@ -24,6 +24,10 @@ module ProjectExtension include Extension + first_time do + Dbt::Config.driver = 'postgres' if BuildrPlus::DbConfig.pgsql? + end + after_define do |project| # Make sure all the data sources in the configuration file are mapped to idea project Dbt::Buildr.add_idea_data_sources_from_configuration_file(project) if project.ipr?
Make sure DbtDriver is set of postgres build
diff --git a/lib/convection/control/cloud.rb b/lib/convection/control/cloud.rb index abc1234..def5678 100644 --- a/lib/convection/control/cloud.rb +++ b/lib/convection/control/cloud.rb @@ -36,9 +36,13 @@ def diff(&block) @cloudfile.deck.each do |stack| - block.call(Model::Event.new(:diff, "Compare local state of #{ stack.name } (#{ stack.cloud_name }) with remote template", :status)) - next stack.diff.each { |diff| block.call(diff) } if stack.exist? - block.call(Model::Event.new(:create, "Stack #{ stack.cloud_name } is not yet defined", :info)) + block.call(Model::Event.new(:compare, "Compare local state of stack #{ stack.name } (#{ stack.cloud_name }) with remote template", :info)) + next block.call(Model::Event.new(:create, "Stack #{ stack.cloud_name } is not yet defined", :info)) unless stack.exist? + + difference = stack.diff + next block.call(Model::Event.new(:unchanged, "Stack #{ stack.cloud_name } Has no changes", :info)) if difference.empty? + + difference.each { |diff| block.call(diff) } end end end
Add more logging to diff task
diff --git a/lib/fabrique/bean_definition.rb b/lib/fabrique/bean_definition.rb index abc1234..def5678 100644 --- a/lib/fabrique/bean_definition.rb +++ b/lib/fabrique/bean_definition.rb @@ -6,7 +6,7 @@ def initialize(attrs = {}) @id = attrs["id"] type_name = attrs["class"] - @type = type_name.is_a?(Module) ? @type_name : Module.const_get(type_name) + @type = type_name.is_a?(Module) ? type_name : Module.const_get(type_name) @constructor_args = attrs["constructor_args"] || [] @constructor_args = keywordify(@constructor_args) if @constructor_args.is_a?(Hash) @properties = attrs["properties"] || {} @@ -15,7 +15,7 @@ end def dependencies - (dependencies_of(@constructor_args) + dependencies_of(@properties)).uniq + (accumulate_dependencies(@constructor_args) + accumulate_dependencies(@properties)).uniq end def singleton? @@ -28,12 +28,12 @@ args.inject({}) { |m, (k, v)| k = k.intern rescue k; m[k.intern] = v; m } end - def dependencies_of(data, acc = []) + def accumulate_dependencies(data, acc = []) if data.is_a?(Hash) - dependencies_of(data.values, acc) + accumulate_dependencies(data.values, acc) elsif data.is_a?(Array) data.each do |o| - dependencies_of(o, acc) + accumulate_dependencies(o, acc) end elsif data.is_a?(BeanReference) or data.is_a?(BeanPropertyReference) acc << data
Fix Module as type in bean definitions Also renamed a method for clarity. I found it hard to understand after a long absence from the code: naming it for its side effect helps.
diff --git a/lib/feed2email/feed_analyzer.rb b/lib/feed2email/feed_analyzer.rb index abc1234..def5678 100644 --- a/lib/feed2email/feed_analyzer.rb +++ b/lib/feed2email/feed_analyzer.rb @@ -13,8 +13,6 @@ Feedzirra::Feed.parse(response.body).title rescue nil end - # Based from - # https://github.com/yugui/rubycommitters/blob/master/opml-generator.rb def type return unless response
Remove acknowledgement link to original feed detection code It has changed significantly since then.
diff --git a/lib/mollie/api/object/issuer.rb b/lib/mollie/api/object/issuer.rb index abc1234..def5678 100644 --- a/lib/mollie/api/object/issuer.rb +++ b/lib/mollie/api/object/issuer.rb @@ -2,7 +2,7 @@ module API module Object class Issuer < Base - attr_accessor :id, :name, :method + attr_accessor :id, :name, :method, :image, :resource end end end
Add image and resource accessors to Mollie::API::Object::Issuer
diff --git a/lib/sirius/semester_calendar.rb b/lib/sirius/semester_calendar.rb index abc1234..def5678 100644 --- a/lib/sirius/semester_calendar.rb +++ b/lib/sirius/semester_calendar.rb @@ -11,8 +11,7 @@ def plan(teaching_time) week_offset = teaching_time.week_offset(@first_week_parity) - - scheduling_start = @teaching_period.starts_at + teaching_time.starts_at.seconds_since_midnight.seconds + week_offset + scheduling_start = combine_date_with_time(@teaching_period.starts_at, teaching_time.starts_at) + week_offset event_duration = (teaching_time.ends_at - teaching_time.starts_at) event_schedule = IceCube::Schedule.new(scheduling_start, duration: event_duration) @@ -28,6 +27,10 @@ IceCube::Rule.weekly(week_frequency, :monday).day(teaching_time.day).until(@teaching_period.ends_at) end + def combine_date_with_time(date, time) + Time.new(date.year, date.month, date.day, time.hour, time.min, time.sec) + end + end end
Fix scheduling issue with seconds_since_midnight on DST transition day.
diff --git a/lib/zabbixapi/classes/errors.rb b/lib/zabbixapi/classes/errors.rb index abc1234..def5678 100644 --- a/lib/zabbixapi/classes/errors.rb +++ b/lib/zabbixapi/classes/errors.rb @@ -1,11 +1,20 @@ class ZabbixApi class BaseError < RuntimeError - attr_accessor :response + attr_accessor :response, :error, :error_message def initialize(message, response = nil) super(message) @response = response + + set_error! if @response + end + + private + + def set_error! + @error = @response["error"] rescue nil + @error_message = "#{@error['message']}: #{@error['data']}" rescue nil end end
Add error hash and error_message to exception
diff --git a/template.rb b/template.rb index abc1234..def5678 100644 --- a/template.rb +++ b/template.rb @@ -1,4 +1,5 @@-# template.rb +# Use this template when generating new Rails apps as follows: +# rails new my_application --template=https://raw.githubusercontent.com/liquid/rails-template/master/template.rb gem_group :development, :test do gem 'rspec-rails', '~> 3.0'
Add note on how to use this
diff --git a/spec/classes/mod/jk_spec.rb b/spec/classes/mod/jk_spec.rb index abc1234..def5678 100644 --- a/spec/classes/mod/jk_spec.rb +++ b/spec/classes/mod/jk_spec.rb @@ -22,11 +22,8 @@ } end - let :params do - { - :log_file => '/var/log/httpd/mod_jk.log', - :shm_file => '/var/log/httpd/jk-runtime-status', - } + let(:pre_condition) do + 'include apache' end it_behaves_like 'minimal resources'
Use precondition to inherit params in spec test for mod::jk
diff --git a/spec/commands/build_spec.rb b/spec/commands/build_spec.rb index abc1234..def5678 100644 --- a/spec/commands/build_spec.rb +++ b/spec/commands/build_spec.rb @@ -17,30 +17,27 @@ it { should raise_error } end - context 'building each format' do - Polytexnic::FORMATS.each do |format| - subject { - lambda { - silence { Polytexnic::Commands::Build.for_format format } - } - } + context 'building all' do + subject(:build) { Polytexnic::Commands::Build } - it { should_not raise_error } - end - end + it { should respond_to(:all_formats) } + it "should build all formats" do + pdf_builder = build.builder_for('pdf') + html_builder = build.builder_for('html') + epub_builder = build.builder_for('epub') + mobi_builder = build.builder_for('mobi') - context 'building all' do - subject { - lambda { - silence { Polytexnic::Commands::Build.all_formats } - } - } + pdf_builder .should_receive(:build!) + html_builder.should_receive(:build!) + epub_builder.should_receive(:build!) + mobi_builder.should_receive(:build!) - it { should_not raise_error } + build.should_receive(:builder_for).with('pdf') .and_return(pdf_builder) + build.should_receive(:builder_for).with('html').and_return(html_builder) + build.should_receive(:builder_for).with('epub').and_return(epub_builder) + build.should_receive(:builder_for).with('mobi').and_return(mobi_builder) - after(:all) do - chdir_to_md_book - Polytexnic::Builders::Html.new.clean! + build.all_formats end end end
Use message expectations to speed up the build spec This commit also removes some (very slow) tests for `build!` that are already tested in the tests for individual builders. [#52758883]
diff --git a/test/mock/mocked_audit_lib.rb b/test/mock/mocked_audit_lib.rb index abc1234..def5678 100644 --- a/test/mock/mocked_audit_lib.rb +++ b/test/mock/mocked_audit_lib.rb @@ -0,0 +1,37 @@+require 'logger' +require 'pp' + +# Mocked for Audit library +class MockedAuditLib + + attr_reader :results + + def initialize(options) + @fail = false + + raise "Option :benchmark is required" unless options[:benchmark] + raise "Option :connection_type is required" unless options[:connection_type] + raise "Option :connection_params is required" unless options[:connection_params] + + if options[:logger] then + @logger = options[:logger] + else + @logger = Logger.new(STDOUT) + end + @logger.level = Logger::ERROR + + @benchmark = nil + @connection = nil + @results = {} + @exceptions = [] + @attachment_dir = options[:attachment_dir] + end + + def start(parallel = true) + @results = { "SSH_RES_1" => {:rule => {:description => "SSH description 1"}, :result => "pass" }, + "SSH_RES_2" => {:rule => {:description => "SSH description 2"}, :result => "pass" }, + "SSH_RES_3" => {:rule => {:description => "SSH description 3"}, :result => "fail" } } + return self + end + +end
Update 'Copy AMI' sample script
diff --git a/src/devilry_theme/devilry_theme/static/devilry_theme/resources/config.rb b/src/devilry_theme/devilry_theme/static/devilry_theme/resources/config.rb index abc1234..def5678 100644 --- a/src/devilry_theme/devilry_theme/static/devilry_theme/resources/config.rb +++ b/src/devilry_theme/devilry_theme/static/devilry_theme/resources/config.rb @@ -1,5 +1,6 @@ # $ext_path: This should be the path of the Ext JS SDK relative to this file -$ext_path = "../../../../extjshelpers/static/extjshelpers/extjs" +#$ext_path = "../../../../extjshelpers/static/extjshelpers/extjs" +$ext_path = "../../../../../../devenv/parts/omelette/extjs4/static/extjs4/" this_dir = File.dirname(__FILE__)
devilry_theme: Use django_extjs4 instead of extjshelpers.
diff --git a/endpoint.gemspec b/endpoint.gemspec index abc1234..def5678 100644 --- a/endpoint.gemspec +++ b/endpoint.gemspec @@ -4,8 +4,8 @@ Gem::Specification.new do |gem| gem.authors = ['Adam Williams'] gem.email = ['adam@thewilliams.ws'] - gem.description = %q{TODO: Write a gem description} - gem.summary = %q{TODO: Write a gem summary} + gem.description = %q{Provides for connecting to API endpoints.} + gem.summary = %q{Provides for connecting to API endpoints.} gem.homepage = '' gem.files = `git ls-files`.split($\)
Remove TODOs causing gemspec errors.
diff --git a/examples/playground.rb b/examples/playground.rb index abc1234..def5678 100644 --- a/examples/playground.rb +++ b/examples/playground.rb @@ -1,6 +1,6 @@ #!/usr/bin/env ruby -require '../OSXMemory' require 'sys/proctable' +require_relative '../OSXMemory' matches = Sys::ProcTable.ps.select{|p| p.comm =~ /Calculator/ } abort("No PID") if matches.empty?
Split threads and tasks into Classes
diff --git a/lib/atpay_rest/dashboard.rb b/lib/atpay_rest/dashboard.rb index abc1234..def5678 100644 --- a/lib/atpay_rest/dashboard.rb +++ b/lib/atpay_rest/dashboard.rb @@ -18,5 +18,10 @@ _response = session.conn.post("/api/v4/rest/organizations/#{organization_sid}/plan", args) _response.body end + + def self.create_managed_account(session, organization_sid) + _response = session.conn.post("/api/v4/rest/organizations/#{organization_sid}/managed_account", args) + _response.body + end end end
Add support for forth-coming managed account endpoint.
diff --git a/DTMHeatmap.podspec b/DTMHeatmap.podspec index abc1234..def5678 100644 --- a/DTMHeatmap.podspec +++ b/DTMHeatmap.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "DTMHeatmap" - s.version = "1" + s.version = "1.0" s.summary = "An MKMapView overlay to visualize location data" s.homepage = "https://github.com/dataminr/DMHeatmap" s.license = 'MIT'
Change the version from 1 to 1.0
diff --git a/lib/karat_sleuth/storage.rb b/lib/karat_sleuth/storage.rb index abc1234..def5678 100644 --- a/lib/karat_sleuth/storage.rb +++ b/lib/karat_sleuth/storage.rb @@ -14,23 +14,30 @@ # This will store classifications into the sequel database module Bayes - # Save the current Bayesian categories into the KaratSleuth sequel - # database - def persist + # Setup the database table on initalization + def initialize(*categories) db = KaratSleuth::Storage.db # Ensure the classifications table exists. This will only create the # table if it doesn't already exist db.create_table? :classifications do - primary_key :id - String :category String :word Integer :tally + + primary_key [:category, :word] end - classes = db[:classifications] + @db_table = db[:classifications] + super + end + + # Save the current Bayesian categories into the KaratSleuth sequel + # database. This will increment the tally for words that already exist + # in the persistant storage + def persist + # Insert and update entities for category/word tallies @categories.each do |category, words| words.each do |word, tally| classes.insert :category => category.to_s, :word => word.to_s, :tally => tally
Create the database table on init of Bayes
diff --git a/lib/risu/web/application.rb b/lib/risu/web/application.rb index abc1234..def5678 100644 --- a/lib/risu/web/application.rb +++ b/lib/risu/web/application.rb @@ -1,8 +1,11 @@ module Risu module Web class Application < Sinatra::Base + set :bind, 'localhost' set :port, 8969 set :haml, :format => :html5 + set :environment, :production + puts "Risu Web Interface at http://localhost:8969/" get '/' do haml :index
Set some Sinatra defaults, listen on localhost only for now.
diff --git a/app/helpers/fields_helper.rb b/app/helpers/fields_helper.rb index abc1234..def5678 100644 --- a/app/helpers/fields_helper.rb +++ b/app/helpers/fields_helper.rb @@ -9,6 +9,14 @@ end def field_presenter(item, field, options={}) + field = resolve_field(item, field) "#{field.class.name}Presenter".constantize.new(self, item, field, options) end + + def resolve_field(item, field_or_slug) + return field_or_slug if field_or_slug.is_a?(Field) + item.fields.find(-> { fail "Unknown field: #{field_or_slug}" }) do |f| + f.slug == field_or_slug.to_s + end + end end
Allow slug to be used to display a field value
diff --git a/lib/CheckfrontAPI/client.rb b/lib/CheckfrontAPI/client.rb index abc1234..def5678 100644 --- a/lib/CheckfrontAPI/client.rb +++ b/lib/CheckfrontAPI/client.rb @@ -0,0 +1,26 @@+require 'net/http' +require 'yaml' + +module CheckfrontAPI + class Client + + config = YAML.load_file(File.expand_path(File.dirname('__FILE__') + "/config.yml")) + API_ENDPOINT = config["config"]["api_endpoint"] + API_KEY = config["config"]["api_key"] + API_SECRET = config["config"]["api_secret"] + + def self.test_connection + uri = URI(API_ENDPOINT) + res = Net::HTTP.get_response(uri) + res.body + end + + def self.initialize + + end + end +end + +if __FILE__ == $PROGRAM_NAME + puts CheckfrontAPI::Client.test_connection +end
Load config and then test connection to API
diff --git a/lib/smartsheet/constants.rb b/lib/smartsheet/constants.rb index abc1234..def5678 100644 --- a/lib/smartsheet/constants.rb +++ b/lib/smartsheet/constants.rb @@ -9,6 +9,8 @@ EXCEL_TYPE = 'application/vnd.ms-excel'.freeze PDF_TYPE = 'application/pdf'.freeze CSV_TYPE = 'text/csv'.freeze + OPENXML_SPREADSHEET_TYPE = + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'.freeze DEFAULT_MAX_RETRY_TIME = 15 DEFAULT_BACKOFF_METHOD = proc { |iteration, _result| 2**iteration + rand }
Add a constant for OpenXML spreadsheet MIME types.
diff --git a/app/models/oauth_provider.rb b/app/models/oauth_provider.rb index abc1234..def5678 100644 --- a/app/models/oauth_provider.rb +++ b/app/models/oauth_provider.rb @@ -4,7 +4,7 @@ class Base include HandlerActions - attr_accessor :return_url, :session + attr_accessor :return_url def self.provider(name, session) info = self.get_handler_info(:oauth, :provider).find { |info| info[:name].downcase.underscore == name } @@ -16,7 +16,7 @@ end def initialize(session) - self.session = session + @session = session end def info; @info ||= self.class.oauth_provider_handler_info; end @@ -26,6 +26,10 @@ def session_name; "oauth_#{self.option_name}"; end def get_oauth_user_data; {}; end def get_profile_photo_url; nil; end + + def session + @session[self.session_name] ||= {} + end def redirect_uri=(redirect_uri) @redirect_uri = redirect_uri
Index the session by the handler name.
diff --git a/lib/tasks/factory_girl.rake b/lib/tasks/factory_girl.rake index abc1234..def5678 100644 --- a/lib/tasks/factory_girl.rake +++ b/lib/tasks/factory_girl.rake @@ -9,7 +9,7 @@ DatabaseCleaner.clean end else - sh "bundle exec rake factory_girl:lint RAILS_ENV='test'" + sh 'rake factory_girl:lint RAILS_ENV=test' end end end
Remove unnecessary cruft from shell line
diff --git a/features/support/capybara.rb b/features/support/capybara.rb index abc1234..def5678 100644 --- a/features/support/capybara.rb +++ b/features/support/capybara.rb @@ -1,16 +1,19 @@ require 'spinach/capybara' require 'capybara/poltergeist' +# Give CI some extra time +timeout = (ENV['CI'] || ENV['CI_SERVER']) ? 90 : 10 + Capybara.javascript_driver = :poltergeist Capybara.register_driver :poltergeist do |app| - Capybara::Poltergeist::Driver.new(app, js_errors: false, timeout: 90) + Capybara::Poltergeist::Driver.new(app, js_errors: false, timeout: timeout) end Spinach.hooks.on_tag("javascript") do Capybara.current_driver = Capybara.javascript_driver end -Capybara.default_wait_time = 60 +Capybara.default_wait_time = timeout Capybara.ignore_hidden_elements = false require 'capybara-screenshot/spinach'
Reduce timeout for non-CI features
diff --git a/spec/models/assignment_score_level_spec.rb b/spec/models/assignment_score_level_spec.rb index abc1234..def5678 100644 --- a/spec/models/assignment_score_level_spec.rb +++ b/spec/models/assignment_score_level_spec.rb @@ -1,8 +1,11 @@ require "active_record_spec_helper" describe AssignmentScoreLevel do + + let(:assignment) {create :assignment} + subject { build(:assignment_score_level, assignment: assignment) } + describe "validations" do - subject { build(:assignment_score_level) } it "is valid with a name, a value, and an assignment" do expect(subject).to be_valid @@ -26,4 +29,22 @@ expect(subject.errors[:value]).to include "can't be blank" end end + + describe "#formatted_name" do + it "returns the level name followed by the point values in paraentheses" do + subject.name = "Level Name" + subject.value = 10000 + expect(subject.formatted_name).to eq("Level Name (10000 points)") + end + end + + describe "#copy" do + it "creates an identical level" do + subject.name = "Example Name" + subject.value = 10 + new_subject = subject.copy + expect(new_subject.name).to eq("Example Name") + expect(new_subject.value).to eq(10) + end + end end
Test coverage for assignment score level
diff --git a/Analytics.podspec b/Analytics.podspec index abc1234..def5678 100644 --- a/Analytics.podspec +++ b/Analytics.podspec @@ -15,4 +15,5 @@ "QuartzCore", "CFNetwork", "CoreTelephony", "Security", "CoreGraphics" s.libraries = "sqlite3", "z" s.xcconfig = { "OTHER_LDFLAGS" => "-ObjC", "FRAMEWORK_SEARCH_PATHS" => '"$(PODS_ROOT)/Analytics"' } + s.requires_arc = true end
Update the pod to require arc
diff --git a/lib/wash_out.rb b/lib/wash_out.rb index abc1234..def5678 100644 --- a/lib/wash_out.rb +++ b/lib/wash_out.rb @@ -15,7 +15,7 @@ controller_class_name = [options[:module], controller_name].compact.join("/") match "#{controller_name}/wsdl" => "#{controller_name}#_generate_wsdl", :via => :get, :format => false - match "#{controller_name}/action" => WashOut::Router.new(controller_class_name), :defaults => { :controller => controller_name.to_s, :action => '_action' }, :format => false + match "#{controller_name}/action" => WashOut::Router.new(controller_class_name), :defaults => { :controller => controller_class_name, :action => '_action' }, :format => false end end end
Use namespaced controller name in action route.
diff --git a/lib/codes/itunes_connect.rb b/lib/codes/itunes_connect.rb index abc1234..def5678 100644 --- a/lib/codes/itunes_connect.rb +++ b/lib/codes/itunes_connect.rb @@ -1,10 +1,64 @@ require 'fastlane_core/itunes_connect/itunes_connect' +require 'deliver' +require 'deliver/app' module FastlaneCore class ItunesConnect - def run - #TODO: implement logic here + PROMO_URL = "https://itunesconnect.apple.com/WebObjects/iTunesConnect.woa/wa/LCAppPage/viewPromoCodes?adamId=" + + def run args + app_identifier = args[:app_identifier] + number_of_codes = args[:number_of_codes] + + raise "Please specify a number > 0 for the number of codes to download!" if number_of_codes <= 0 + code_or_codes = number_of_codes == 1 ? "code" : "codes" + Helper.log.info "Downloading #{number_of_codes} promo #{code_or_codes} for app #{app_identifier}..." if number_of_codes == 1 + + app = Deliver::App.new app_identifier: app_identifier + Helper.log.debug "Found App: #{app.to_s}" + + visit PROMO_URL << app.apple_id.to_s + + text_fields = wait_for_elements "input[type=text]" + raise "There should only be a single text input field to specify the number of codes".red unless text_fields.count == 1 + + text_fields.first.set number_of_codes.to_s + click_next + Helper.log.debug "Accepting the App Store Volume Custom Code Agreement" + wait_for_elements("input[type=checkbox]").first.click + click_next + + download_url = wait_for_elements("a > img").first.find(:xpath, '..')['href'] + + output_file_path = File.join(Dir.getwd, "codes.txt") + FileUtils.touch output_file_path + raise "Insufficient permissions to write to codes.txt file" unless File.writable? output_file_path + + codes = download_codes download_url + + bytes_written = File.write output_file_path, codes, mode: "a" + Helper.log.warn "Could not write your codes to the codes.txt file, please write them down manually!" if bytes_written == 0 + + Helper.log.info "Your codes were downloaded succesfully! Here they are:" + puts codes + end + + def click_next + wait_for_elements("input.continueActionButton").first.click + end + + def download_codes url + host = Capybara.current_session.current_host + url = URI.join host, url + Helper.log.debug "Downloading promo code file from #{url}" + + cookie_string = "" + page.driver.cookies.each do |key, cookie| + cookie_string << "#{cookie.name}=#{cookie.value};" + end + + open(url, "Cookie" => cookie_string).read end end
Implement downloading of promo codes
diff --git a/lib/course_alert_manager.rb b/lib/course_alert_manager.rb index abc1234..def5678 100644 --- a/lib/course_alert_manager.rb +++ b/lib/course_alert_manager.rb @@ -1,6 +1,6 @@ class CourseAlertManager def create_no_students_alerts - courses_to_check = Course.current + courses_to_check = Course.strictly_current courses_to_check.each do |course| next unless course.students.empty? next unless within_no_student_alert_period?(course.timeline_start)
Use 'strictly_current' scope for NoEnrolledStudentAlert
diff --git a/Casks/duckietv.rb b/Casks/duckietv.rb index abc1234..def5678 100644 --- a/Casks/duckietv.rb +++ b/Casks/duckietv.rb @@ -2,7 +2,7 @@ version '1.1.3' sha256 '4c4ee965cf39db6333dad65fe2b56ebf412af490a1b091487ef5d1fe8989b359' - # schizoduckie.github.io/DuckieTV was verified as official when first introduced to the cask + # github.com/SchizoDuckie/DuckieTV was verified as official when first introduced to the cask url "https://github.com/SchizoDuckie/DuckieTV/releases/download/#{version}/DuckieTV-#{version}-OSX-x64.pkg" appcast 'https://github.com/SchizoDuckie/DuckieTV/releases.atom', checkpoint: 'f11c61dde34cfe2a9f3e7150122340aa3f6680a634e00851066fccd4668e0103'
Fix `url` stanza comment for duckieTV.
diff --git a/spec/migrations/20170115140217_update_ems_in_miq_alert_status_spec.rb b/spec/migrations/20170115140217_update_ems_in_miq_alert_status_spec.rb index abc1234..def5678 100644 --- a/spec/migrations/20170115140217_update_ems_in_miq_alert_status_spec.rb +++ b/spec/migrations/20170115140217_update_ems_in_miq_alert_status_spec.rb @@ -1,12 +1,24 @@ require_migration + +class UpdateEmsInMiqAlertStatus < ActiveRecord::Migration[5.0] + class ExtManagementSystem < ActiveRecord::Base + self.inheritance_column = :_type_disabled # disable STI + end + class Vm < ActiveRecord::Base + self.inheritance_column = :_type_disabled # disable STI + belongs_to :ext_management_system, :foreign_key => :ems_id + end +end describe UpdateEmsInMiqAlertStatus do let(:miq_alert_status_stub) { migration_stub(:MiqAlertStatus) } + let(:vm_cloud_stub) { migration_stub(:Vm) } + let(:ext_management_system_stub) { migration_stub(:ExtManagementSystem) } migration_context :up do it 'it sets ems_id for vms' do - ext = FactoryGirl.create(:ext_management_system) - vm = FactoryGirl.create(:vm_cloud, :ext_management_system => ext) + ext = ext_management_system_stub.create + vm = vm_cloud_stub.create(:ext_management_system => ext) miq_alert_status = miq_alert_status_stub.create!(:resource_type => "VmOrTemplate", :resource_id => vm.id) expect(miq_alert_status.ems_id).to be_nil migrate
Remove factory girl from migration script A refrence to factory girl can fail due to validations on columns that are added in app/model after this migration. Seen in https://github.com/ManageIQ/manageiq/pull/13567
diff --git a/spec/support/directories.rb b/spec/support/directories.rb index abc1234..def5678 100644 --- a/spec/support/directories.rb +++ b/spec/support/directories.rb @@ -22,7 +22,7 @@ yield end ensure - FileUtils.rm_rf(dir) + FileUtils.rm_rf(dir) unless ENV['CLEAR_TMP'].eql?('false') end end end
Stop clearing tmp if special env key is set
diff --git a/lib/rom/header/attribute.rb b/lib/rom/header/attribute.rb index abc1234..def5678 100644 --- a/lib/rom/header/attribute.rb +++ b/lib/rom/header/attribute.rb @@ -4,7 +4,7 @@ class Attribute include Equalizer.new(:name, :key, :type) - attr_reader :name, :key, :meta + attr_reader :name, :key, :type, :meta def self.[](meta) type = meta[:type] @@ -35,10 +35,7 @@ @name = name @meta = meta @key = meta.fetch(:from) { name } - end - - def type - meta.fetch(:type) + @type = meta.fetch(:type) end def typed? @@ -57,8 +54,11 @@ class Embedded < Attribute include Equalizer.new(:name, :key, :type, :header) - def header - meta.fetch(:header) + attr_reader :header + + def initialize(*) + super + @header = meta.fetch(:header) end def tuple_keys
Set important ivars in the constructor
diff --git a/lib/rest_in_peace/template_sanitizer.rb b/lib/rest_in_peace/template_sanitizer.rb index abc1234..def5678 100644 --- a/lib/rest_in_peace/template_sanitizer.rb +++ b/lib/rest_in_peace/template_sanitizer.rb @@ -8,6 +8,7 @@ def initialize(url_template, params) @url_template = url_template @params = params.dup + @url = nil end def url
Initialize @url to prevent warnings
diff --git a/db/migrate/20141208201414_add_admin_to_user.rb b/db/migrate/20141208201414_add_admin_to_user.rb index abc1234..def5678 100644 --- a/db/migrate/20141208201414_add_admin_to_user.rb +++ b/db/migrate/20141208201414_add_admin_to_user.rb @@ -0,0 +1,14 @@+class AddAdminToUser < ActiveRecord::Migration + def up + add_column :users, :admin, :boolean + say_with_time "Migrating Admin Status." do + User.all.each do |user| + user.update_attribute :admin, user.user_attributes[:marli_admin] unless user.user_attributes.nil? + end + end + end + + def down + remove_column :users, :admin + end +end
Make admin a column for user model
diff --git a/db/data_migration/20171003133232_discard_non_english_wl_news.rb b/db/data_migration/20171003133232_discard_non_english_wl_news.rb index abc1234..def5678 100644 --- a/db/data_migration/20171003133232_discard_non_english_wl_news.rb +++ b/db/data_migration/20171003133232_discard_non_english_wl_news.rb @@ -0,0 +1,9 @@+# These drafts were created with an incorrect base path structure: + +Services.publishing_api.discard_draft("d4515402-9704-4240-a0c5-38455521f3b5", locale: "zh-tw") +Services.publishing_api.discard_draft("e35a3088-da23-4720-9ffa-87ea93b31880", locale: "ru") +Services.publishing_api.discard_draft("414cba63-2bae-40ab-8441-4a1f242b1b00", locale: "ar") +Services.publishing_api.discard_draft("6e751743-5e4c-4964-a318-61d97db76faa", locale: "zh") +Services.publishing_api.discard_draft("3fb57d53-8f3d-4392-8e19-4a0534c29db5", locale: "ar") +Services.publishing_api.discard_draft("aa347cd1-2e6c-4557-8c6a-85cd1f4f3090", locale: "it") +Services.publishing_api.discard_draft("fbbb4746-b26e-4fff-af39-0955a8457926", locale: "es-419")
Discard drafts of WL news page with wrong base paths
diff --git a/config/routes.rb b/config/routes.rb index abc1234..def5678 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -4,4 +4,5 @@ resources :listings, :phrases get '/discriminatory', to: 'listings#discriminatory' get '/visualization', to: 'listings#visualization' + get '/tools/stats', to: 'stats#get_stats' end
Make route for 'get stats'
diff --git a/lib/inline_svg/transform_pipeline/transformations/aria_attributes.rb b/lib/inline_svg/transform_pipeline/transformations/aria_attributes.rb index abc1234..def5678 100644 --- a/lib/inline_svg/transform_pipeline/transformations/aria_attributes.rb +++ b/lib/inline_svg/transform_pipeline/transformations/aria_attributes.rb @@ -1,34 +1,31 @@ module InlineSvg::TransformPipeline::Transformations class AriaAttributes < Transformation def transform(doc) - doc = Nokogiri::XML::Document.parse(doc.to_html) - svg = doc.at_css("svg") + with_svg(doc) do |svg| + # Add role + svg["role"] = "img" - # Add role - svg["role"] = "img" + # Build aria-labelledby string + aria_elements = [] + svg.search("title").each do |element| + aria_elements << element["id"] = element_id_for("title", element) + end - # Build aria-labelledby string - aria_elements = [] - doc.search("svg title").each do |element| - aria_elements << element['id'] = element_id_for("title", element) + svg.search("desc").each do |element| + aria_elements << element["id"] = element_id_for("desc", element) + end + + if aria_elements.any? + svg["aria-labelledby"] = aria_elements.join(" ") + end end - - doc.search("svg desc").each do |element| - aria_elements << element['id'] = element_id_for("desc", element) - end - - if aria_elements.any? - svg["aria-labelledby"] = aria_elements.join(" ") - end - - doc end def element_id_for(base, element) - if element['id'].nil? + if element["id"].nil? InlineSvg::IdGenerator.generate(base, element.text) else - InlineSvg::IdGenerator.generate(element['id'], element.text) + InlineSvg::IdGenerator.generate(element["id"], element.text) end end end
Handle documents without SVG root elements
diff --git a/MOAspects.podspec b/MOAspects.podspec index abc1234..def5678 100644 --- a/MOAspects.podspec +++ b/MOAspects.podspec @@ -1,12 +1,12 @@ Pod::Spec.new do |s| s.name = "MOAspects" - s.version = "0.2.2" + s.version = "0.9.0" s.summary = "AOP Library." s.homepage = "https://github.com/MO-AI/MOAspects" s.license = 'MIT' s.author = { "Hiromi Motodera" => "moai.motodera@gmail.com" } s.source = { :git => "https://github.com/MO-AI/MOAspects.git", :tag => "#{s.version}", :submodules => true } - s.source_files = 'MOAspects/*.{h,m}' + s.source_files = 'MOAspects/*.{h,m,swift}' s.ios.deployment_target = "6.0" s.osx.deployment_target = "10.8" s.requires_arc = true
Change pod spec files to swift
diff --git a/attribute.gemspec b/attribute.gemspec index abc1234..def5678 100644 --- a/attribute.gemspec +++ b/attribute.gemspec @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = 'attribute' - s.version = '0.1.1' + s.version = '0.1.2' s.summary = 'Define an attribute on a class using an imperative API' s.description = ' '
Package version is increased from 0.1.1 to 0.1.2
diff --git a/app/assets/javascripts/models/pathpuz/monorail/application.js.rb b/app/assets/javascripts/models/pathpuz/monorail/application.js.rb index abc1234..def5678 100644 --- a/app/assets/javascripts/models/pathpuz/monorail/application.js.rb +++ b/app/assets/javascripts/models/pathpuz/monorail/application.js.rb @@ -22,9 +22,9 @@ end def puzzle=(puzzle) + @puzzle.off(:lines_changed, @handler) if @handler @puzzle = puzzle - # TODO: remove old handler from previous puzzle? - puzzle.on(:lines_changed) { autohint! } + @handler = puzzle.on(:lines_changed) { autohint! } autohint! end
Fix memory leak by removing the old handler when switching puzzles.
diff --git a/week-4/address/my_solution.rb b/week-4/address/my_solution.rb index abc1234..def5678 100644 --- a/week-4/address/my_solution.rb +++ b/week-4/address/my_solution.rb @@ -0,0 +1,13 @@+# Format an Address + +# I worked on this challenge [by myself, with: ]. + + +# Your Solution Below +def make_address(street, city, state, zip) + +return 'You live at ' + street + ', in the beautiful city of ' + city + ', ' + state + '. Your zip is ' + zip.to_s + '.' + +end + +make_address("633 Folsom St.", "San Francisco", "CA", 94107)
Add solution for challenge 4.3 release 4 formatting address
diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index abc1234..def5678 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -26,6 +26,6 @@ end def set_games - @games = @query.present? ? Game.search(@query).includes(:categories, :runs) : [] + @games = @query.present? ? Game.search(@query).includes(:categories) : [] end end
Stop search from timing out
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index abc1234..def5678 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -7,18 +7,22 @@ def index if params[:perspective] trust_graph_root_user = User.find_by(uport_address: params[:perspective]) - @users = trust_graph_root_user.search_trust_graph(params[:skill], depth: params[:depth]) + users = if trust_graph_root_user.nil? + [] + else + trust_graph_root_user.search_trust_graph(params[:skill], depth: params[:depth]) + end else - @users = User.limit(200).includes(:skill_claims) + users = User.limit(200).includes(:skill_claims) end - render json: @users.as_json(skills: true) + render json: users.as_json(skills: true) end # GET /users/0x01d3b5eaa2e305a1553f0e2612353c94e597449e (uPort address) def show - @user = User.find_or_create_by!(uport_address: params[:uport_address]) - render json: @user.as_json(projects: true, skills: true, confirmations: true) - UpdateProfile.perform_async @user.to_param # update profile info from uPort async + user = User.find_or_create_by!(uport_address: params[:uport_address]) + render json: user.as_json(projects: true, skills: true, confirmations: true) + UpdateProfile.perform_async user.to_param # update profile info from uPort async end end
Stop crash if user not found; remove `@` symbols
diff --git a/app/models/project_search_result.rb b/app/models/project_search_result.rb index abc1234..def5678 100644 --- a/app/models/project_search_result.rb +++ b/app/models/project_search_result.rb @@ -19,8 +19,13 @@ @status = search_result.status @latest_release_number = search_result.latest_release_number @versions_count = search_result.versions_count - @latest_release_published_at = DateTime.parse(search_result.latest_release_published_at) + @latest_release_published_at = parse_timestamp(search_result.latest_release_published_at) @stars = search_result.stars + end + + def parse_timestamp(timestamp) + return nil unless timestamp.present? + DateTime.parse(timestamp) rescue nil end def color
Handle nil dates in search results
diff --git a/app/models/spree/store_decorator.rb b/app/models/spree/store_decorator.rb index abc1234..def5678 100644 --- a/app/models/spree/store_decorator.rb +++ b/app/models/spree/store_decorator.rb @@ -11,8 +11,8 @@ has_attached_file :logo, styles: { mini: '48x48>', small: '100x100>', medium: '250x250>' }, default_style: :medium, - url: 'stores/:id/:style/:basename.:extension', - path: 'stores/:id/:style/:basename.:extension', + url: '/spree/stores/:id/:style/:basename.:extension', + path: ':rails_root/public/spree/stores/:id/:style/:basename.:extension', convert_options: { all: '-strip -auto-orient' } validates_attachment_file_name :logo, matches: [/png\Z/i, /jpe?g\Z/i],
Update paperclip paths for store model What I changed is inline with what is on solidus core for regular images: https://github.com/solidusio/solidus/blob/e15ca73e8f7083633343f0678023695a96e24d31/core/app/models/spree/image.rb#L9 Moreover, how it was would not correctly path to an image, since it was the root directory, not under `/public`.
diff --git a/test/models/article_test.rb b/test/models/article_test.rb index abc1234..def5678 100644 --- a/test/models/article_test.rb +++ b/test/models/article_test.rb @@ -12,6 +12,6 @@ title: 'title', content: 'content <div></div><a lmao href="url">a link</a>', user_id: 1) - assert_equal(a.content, 'content <a href="url">a link</a>') + assert_equal('<p>content <div></div><a href="url">a link</a></p>', a.content) end end
Fix failing article model test
diff --git a/app/views/papers/index.atom.builder b/app/views/papers/index.atom.builder index abc1234..def5678 100644 --- a/app/views/papers/index.atom.builder +++ b/app/views/papers/index.atom.builder @@ -3,7 +3,9 @@ feed.updated(@papers[0].created_at) if @papers.length > 0 @papers.each do |paper| + next if paper.invisible? feed.entry(paper) do |entry| + case paper.state entry.title(paper.title) entry.state(paper.state) entry.archive_doi(paper.archive_doi)
Hide papers that have not made it to review yet
diff --git a/app/workers/status_update_worker.rb b/app/workers/status_update_worker.rb index abc1234..def5678 100644 --- a/app/workers/status_update_worker.rb +++ b/app/workers/status_update_worker.rb @@ -1,9 +1,9 @@ class StatusUpdateWorker include Sidekiq::Worker + sidekiq_options :retry => false def perform(application_id) - # app = Application.find(application_id) - # app.update_current_step - ap "****** StatusUpdateWorker at #{DateTime.now}" + app = Application.find(application_id) + app.update_current_step end end
Disable retry option for sidekiq's job. Re-enable before and after create actions.
diff --git a/db/migrate/20150107130615_change_type_for_url_on_feed_entries.rb b/db/migrate/20150107130615_change_type_for_url_on_feed_entries.rb index abc1234..def5678 100644 --- a/db/migrate/20150107130615_change_type_for_url_on_feed_entries.rb +++ b/db/migrate/20150107130615_change_type_for_url_on_feed_entries.rb @@ -0,0 +1,8 @@+class ChangeTypeForUrlOnFeedEntries < ActiveRecord::Migration + def up + change_column :feed_entries, :url, :text + end + def down + change_column :feed_entries, :url, :string + end +end
Change type for url on feed_entries from string to text
diff --git a/filesize.gemspec b/filesize.gemspec index abc1234..def5678 100644 --- a/filesize.gemspec +++ b/filesize.gemspec @@ -8,7 +8,7 @@ s.summary = s.description s.email = "dominikh@fork-bomb.org" - s.extra_rdoc_files = ["README.markdown", "lib/filesize.rb"] + s.has_rdoc = "yard" s.files = ["README.markdown", "lib/filesize.rb", "filesize.gemspec"] s.homepage = "https://github.com/dominikh/filesize" s.required_ruby_version = ">= 1.8.6"
Set has_rdoc="yard" and remove extra_rdoc_files
diff --git a/lib/fluffy_paws/app.rb b/lib/fluffy_paws/app.rb index abc1234..def5678 100644 --- a/lib/fluffy_paws/app.rb +++ b/lib/fluffy_paws/app.rb @@ -46,8 +46,6 @@ request.body.rewind req_data = JSON.parse request.body.read - puts req_data - data_kind = req_data['pc_data']['kind'] pc_name = req_data['pc_data']['data']['Name'] @@ -60,11 +58,5 @@ # puts i # end end - - post '/logs' do - request.body.rewind - req_data = JSON.parse request.body.read - puts req_data - end end end
Revert "Just testing on live, nothing to see here" This reverts commit 1478750dd2b4a20337db7e30b46f7c27da1805e1.
diff --git a/bosh-director/db/migrations/director/20160511191928_ephemeral_blobs.rb b/bosh-director/db/migrations/director/20160511191928_ephemeral_blobs.rb index abc1234..def5678 100644 --- a/bosh-director/db/migrations/director/20160511191928_ephemeral_blobs.rb +++ b/bosh-director/db/migrations/director/20160511191928_ephemeral_blobs.rb @@ -1,18 +1,9 @@ Sequel.migration do change do - adapter_scheme = self.adapter_scheme - create_table :ephemeral_blobs do primary_key :id - - if [:mysql2, :mysql].include?(adapter_scheme) - longtext :blobstore_id, :null => false - longtext :sha1, :null => false - else - text :blobstore_id, :null => false - text :sha1, :null => false - end - + String :blobstore_id, :null => false + String :sha1, :null => false Time :created_at, null: false end end
Make blobstore_id and sha1 as strings [#118957819] https://www.pivotaltracker.com/story/show/118957819 Signed-off-by: Ivan Rodriguez <489d99cb1180510ba868a41f5ab2ce6b721fdf5f@pivotal.io>
diff --git a/level_1/implied_nil/implied_nil.rb b/level_1/implied_nil/implied_nil.rb index abc1234..def5678 100644 --- a/level_1/implied_nil/implied_nil.rb +++ b/level_1/implied_nil/implied_nil.rb @@ -0,0 +1,11 @@+# Implied nil +# Let's implement a simple search feature - for our naive implementation, we search for a game by its exact title, and if it's found, we show it. +# Comparing something with nil in an if statement isn't needed in Ruby. Refactor the code below to run without the nil comparison. +search = "Contra" +games = ["Super Mario Bros.", "Contra", "Metroid", "Mega Man 2"] +search_index = games.find_index(search) +if search_index != nil + puts "Game #{search} Found: #{games[search_index]} at index #{search_index}." +else + puts "Game #{search} not found." +end
Add the implied nil problem