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 @@ -4,7 +4,7 @@ license 'Apache 2.0' description 'Installs/Configures mongodb3' long_description 'Installs/Configures mongodb3' -version '0.2.0' +version '1.0.0' supports 'ubuntu', '= 12.04' supports 'redhat', '= 6.6'
Update the version as 1.0.0
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -9,43 +9,11 @@ depends 'runit', '~> 1.0' depends 'yum-epel' -supports 'amazon' -supports 'centos' -supports 'debian' -supports 'fedora' -supports 'oracle' -supports 'redhat' -supports 'scientific' -supports 'smartos' -supports 'suse' -supports 'ubuntu' +%w(ubuntu debian redhat centos suse scientific oracle amazon smartos).each do |os| + supports os +end -recipe 'memcached', 'Installs and configures memcached' +recipe 'memcached::default', 'Installs and configures memcached' source_url 'https://github.com/chef-cookbooks/memcached' if respond_to?(:source_url) issues_url 'https://github.com/chef-cookbooks/memcached/issues' if respond_to?(:issues_url) - -attribute 'memcached/memory', - display_name: 'Memcached Memory', - description: 'Memory allocated for memcached instance', - default: '64' - -attribute 'memcached/port', - display_name: 'Memcached Port', - description: 'Port to use for memcached instance', - default: '11211' - -attribute 'memcached/user', - display_name: 'Memcached User', - description: 'User to run memcached instance as', - default: 'nobody' - -attribute 'memcached/listen', - display_name: 'Memcached IP Address', - description: 'IP address to use for memcached instance', - default: '0.0.0.0' - -attribute 'memcached/logfilename', - display_name: 'Memcached logfilename', - description: 'The filename used to log memcached', - default: 'memcached.log'
Remove attributes, use loop for supports, fix recipe name
diff --git a/lib/rollbar/encoding/legacy_encoder.rb b/lib/rollbar/encoding/legacy_encoder.rb index abc1234..def5678 100644 --- a/lib/rollbar/encoding/legacy_encoder.rb +++ b/lib/rollbar/encoding/legacy_encoder.rb @@ -1,18 +1,20 @@ require 'iconv' module Rollbar - class LegacyEncoder - attr_accessor :object + module Encoding + class LegacyEncoder + attr_accessor :object - def initialize(object) - @object = object - end + def initialize(object) + @object = object + end - def encode - value = object.to_s - encoded_value = ::Iconv.conv('UTF-8//IGNORE', 'UTF-8', value) + def encode + value = object.to_s + encoded_value = ::Iconv.conv('UTF-8//IGNORE', 'UTF-8', value) - object.is_a?(Symbol) ? encoded_value.to_sym : encoded_value + object.is_a?(Symbol) ? encoded_value.to_sym : encoded_value + end end end end
Fix LegacyEncoder namespace => Rollbar::Encoding::LegacyEncoder.
diff --git a/cookbooks/lib/features/git_spec.rb b/cookbooks/lib/features/git_spec.rb index abc1234..def5678 100644 --- a/cookbooks/lib/features/git_spec.rb +++ b/cookbooks/lib/features/git_spec.rb @@ -10,11 +10,11 @@ its(:exit_status) { should eq 0 } end - describe command('git config --global user.name'), dev: true do + describe command('git config user.name'), dev: true do its(:stdout) { should match(/travis/i) } end - describe command('git config --global user.email'), dev: true do + describe command('git config user.email'), dev: true do its(:stdout) { should match(/travis@example\.org/) } end
Check git config without `--global` because it should work correctly without that option specified
diff --git a/simple_backend/db/seeds.rb b/simple_backend/db/seeds.rb index abc1234..def5678 100644 --- a/simple_backend/db/seeds.rb +++ b/simple_backend/db/seeds.rb @@ -15,3 +15,10 @@ recipes << Recipe.create(big_oven_id: 381400, title: "Pizza") recipes << Recipe.create(big_oven_id: 337784, title: "Cowboy Cookies") recipes << Recipe.create(big_oven_id: 230679, title: "Sugar Cookies") + +users.each do |user| + recipes.each do |recipe| + user.favorites.create(recipe: recipe) + end +end +
Create user favorites with users and recipes arrays
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -12,4 +12,4 @@ source_url 'https://github.com/chef-cookbooks/chef_slack' issues_url 'https://github.com/chef-cookbooks/chef_slack/issues' -chef_version '>= 12.5' +chef_version '>= 12.5' if respond_to?(:chef_version)
Add chef_version compatibility with older chef releases 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 @@ -2,7 +2,7 @@ maintainer 'Oregon State University' maintainer_email 'chef@osuosl.org' license 'Apache-2.0' -chef_version '>= 14' +chef_version '>= 16.0' description 'Installs/Configures rdiff-backup' version '4.3.1' issues_url 'https://github.com/osuosl-cookbooks/rdiff-backup/issues'
Update Chef dependency to >= 16
diff --git a/Casks/freeswitch-desktop.rb b/Casks/freeswitch-desktop.rb index abc1234..def5678 100644 --- a/Casks/freeswitch-desktop.rb +++ b/Casks/freeswitch-desktop.rb @@ -1,8 +1,8 @@ cask :v1 => 'freeswitch-desktop' do - version '1.0.0' - sha256 'd86a622e3b2bcfdef41f6ab3f1a347e0e37b58ec28725740da27a135681591d5' + version '1.1.0' + sha256 'b776c83232b233d3b9d4f3c96503284749be490819c6310a30402acc6bc9ba26' - url "https://github.com/pablote/fs-mgmt/releases/download/v#{version}/osx64.zip" + url "https://github.com/pablote/fs-mgmt/releases/download/v#{version}/freeswitch-desktop-osx64.zip" appcast 'https://github.com/pablote/fs-mgmt/releases.atom' name 'Freeswitch Desktop' homepage 'https://github.com/pablote/fs-mgmt'
Upgrade "Freeswitch Desktop.app" to v1.1.0
diff --git a/Casks/sonarr-menu-helper.rb b/Casks/sonarr-menu-helper.rb index abc1234..def5678 100644 --- a/Casks/sonarr-menu-helper.rb +++ b/Casks/sonarr-menu-helper.rb @@ -0,0 +1,15 @@+cask :v1 => 'sonarr-menu-helper' do + version '2.2' + sha256 'a46ace8316b873823adb829719a7b91780194a89d313a9bb313a9677e4fda78f' + + url "https://github.com/jefbarn/Sonarr/releases/download/#{version}/Sonarr.zip" + appcast 'https://github.com/jefbarn/Sonarr/releases.atom' + name 'Sonarr Menu Helper' + homepage 'https://github.com/jefbarn/Sonarr' + license :unknown + + app 'Sonarr.app' + + depends_on :cask => 'mono-mdk' + conflicts_with :cask => 'sonarr' +end
Add Sonarr Menu Helper App 2.2
diff --git a/spec/requests/home_page_spec.rb b/spec/requests/home_page_spec.rb index abc1234..def5678 100644 --- a/spec/requests/home_page_spec.rb +++ b/spec/requests/home_page_spec.rb @@ -5,7 +5,7 @@ VCR.use_cassette('geographical_areas#countries') do visit root_path - page.should have_content 'Use the trade tariff' + page.should have_content 'Use this tool to search' end end end
Change spec as wording was changed.
diff --git a/bnr-webhooks.gemspec b/bnr-webhooks.gemspec index abc1234..def5678 100644 --- a/bnr-webhooks.gemspec +++ b/bnr-webhooks.gemspec @@ -8,8 +8,8 @@ spec.version = Bnr::Webhooks::VERSION spec.authors = ["Big Nerd Ranch"] spec.email = ["developer@bignerdranch.com"] - spec.summary = %q{Write a short summary. Required.} - spec.description = %q{Write a longer description. Optional.} + spec.summary = %q{Big Nerd Ranch's webhook layer for inter-service communication.} + spec.description = spec.summary spec.homepage = "" spec.license = "MIT"
Use a real summary and description.
diff --git a/JSONViewControllers.podspec b/JSONViewControllers.podspec index abc1234..def5678 100644 --- a/JSONViewControllers.podspec +++ b/JSONViewControllers.podspec @@ -14,6 +14,7 @@ s.license = 'MIT' s.author = { "Snap Kitchen" => "graham_perks@snapkitchen.com" } s.source = { :git => "https://github.com/graham-perks-snap/JSONViewControllers.git", :tag => s.version.to_s } + s.swift_versions = '5' s.ios.deployment_target = '9.0' s.tvos.deployment_target = '10.0' s.source_files = 'Pod/Classes/*.swift'
Add new field to podspec
diff --git a/spec/meteor_spec.rb b/spec/meteor_spec.rb index abc1234..def5678 100644 --- a/spec/meteor_spec.rb +++ b/spec/meteor_spec.rb @@ -1,39 +1,2 @@ require File.dirname(__FILE__) + '/spec_helper' -describe ::Meteor::Widget::RemoteContent::Spec do - - context "with partial" do - - before(:all) do - @content = ::Meteor::Widget::RemoteContent::Spec.new(:url => "http://www.aura-software.com", - :remote_dom_id => ".section.content-body", - :partial => "meteor/remote_content/test.rhtml").render - end - - it "should render the specified remote content" do - @content.should match(%r|</body>|) - end - - it "should replace content with the provided partial" do - @content.should match(%r|<div class="section content-body"><h3>Hello!</h3></div>|) - end - - end - - context "without partial" do - - before(:all) do - @content = ::Meteor::Widget::RemoteContent::Spec.new(:url => "http://www.aura-software.com").render - end - - it "should render the specified remote content" do - @content.should match(%r|body|) - end - - it "should not replace content as no partial is provided" do - @content.should_not match(%r|<div class="section content-body"><h3>Hello!</h3></div>|) - end - - end - -end
Remove RemoteContent rspec test from base plugin.
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -19,4 +19,4 @@ end end -Mingo.collection.remove +Mingo.collection.drop
Drop collection (including indexes) instead of just removing all records.
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,7 +1,13 @@-if ENV['COVERAGE'] == 'true' && RUBY_ENGINE == 'ruby' && RUBY_VERSION == '2.4.1' - require "simplecov" - SimpleCov.start do - add_filter '/spec/' +if RUBY_ENGINE == 'ruby' && ENV['COVERAGE'] == 'true' + require 'yaml' + rubies = YAML.load(File.read(File.join(__dir__, '..', '.travis.yml')))['rvm'] + latest_mri = rubies.select { |v| v =~ /\A\d+\.\d+.\d+\z/ }.max + + if RUBY_VERSION == latest_mri + require 'simplecov' + SimpleCov.start do + add_filter '/spec/' + end end end
Send coverage with latest MRI
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -3,6 +3,10 @@ require 'buildpack/packager' require 'file_system_helpers' +unless system("which tree") + raise "Please install the `tree` commandline tool." +end + RSpec.configure do |config| config.include FileSystemHelpers end
Check for existence of `tree` before running suite.
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -9,6 +9,8 @@ RSpec.configure do |c| c.order = :random + c.filter_run :focus + c.run_all_when_everything_filtered = true end def reset_i18n
Allow focus filter in specs
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -25,4 +25,7 @@ config.include SpecHelpers config.include CliSpecHelpers config.include Aruba::Api + + config.run_all_when_everything_filtered = true + config.filter_run :focus end
Allow for focusing on certain tests
diff --git a/lib/tasks/engine.rake b/lib/tasks/engine.rake index abc1234..def5678 100644 --- a/lib/tasks/engine.rake +++ b/lib/tasks/engine.rake @@ -1,49 +1,4 @@ namespace :engine do - desc "Check all services" - task :check_all => :environment do - interval = 60 - while true do - start_time = Time.now.to_i - threads = [] - workers = [] - - Service.includes(:team).where(on: true).all.each do |service| - workers<< [service,service.worker_class.new(service, dns_server: service.team.dns_server)] - end - workers.each do |x| - service = x[0] - worker = x[1] - threads << Thread.new do - output = '' - time_start = Time.now - service.team = Team.new(id: 0, name:'None', dns_server: nil) if service.team.nil? - output += "Checking service: #{service.name}\nTeam: #{service.team.name}\n" - begin - status = worker.check - if status.nil? - output += "Error while saving log\n" - else - output += "Status recieved: #{ServiceLog::STATUS[status]}\n" - end - rescue => e - output += "Caught Exception: #{e.to_s}\n" - raise e - end - time_end = Time.now - output += "Time: #{((time_end - time_start)*1000).to_i}ms\n" - output - end - end - - puts threads.collect{|t| t.value}.join "\n" - - end_time = Time.now.to_i - sleep_time = interval - (end_time - start_time) - puts "Sleeping for #{sleep_time}\n********************************************************\n" - sleep - end - end - desc "Turn off all services" task :off, [:team_id] => [:environment] do |t,args| if args[:team_id].nil?
Remove the check rake task (was not working)
diff --git a/lib/tasks/router.rake b/lib/tasks/router.rake index abc1234..def5678 100644 --- a/lib/tasks/router.rake +++ b/lib/tasks/router.rake @@ -17,13 +17,6 @@ end task :register_routes => [ :router_environment, :environment ] do - @logger.info "Registering homepage at /" - @router.routes.update application_id: "frontend", route_type: :full, - incoming_path: "/" - - @logger.info "Registering asset path /publisher-assets" - @router.routes.update application_id: "frontend", route_type: :prefix, - incoming_path: "/publisher-assets" end desc "Register publisher application and routes with the router (run this task on server in cluster)"
Stop publisher registering certain frontend routes on deployment Publisher needs frontend to be registered as an application, but frontend should take care of registering the homepage and its assets folder as routes
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -6,6 +6,11 @@ require 'bundler/setup' Bundler.require + +# for kaminari view test +ActiveSupport.on_load :action_controller do + prepend_view_path File.join(Gem.loaded_specs['kaminari'].gem_dir, 'spec/fake_app/views') +end require 'capybara/rspec' require 'database_cleaner'
Add view_path setting for view tests
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -9,7 +9,9 @@ SimpleCov::Formatter::HTMLFormatter, Coveralls::SimpleCov::Formatter ] -SimpleCov.start +SimpleCov.start do + add_filter "/spec/" +end test_dir = File.dirname(__FILE__) $LOAD_PATH.unshift test_dir unless $LOAD_PATH.include?(test_dir)
Exclude /spec/ from code coverage. Weirdly, on coveralls.io, only Rubinius (rbx-19mode) shows a 1% lack in coverage due to a line in docile_spec.rb. This should ensure that the spec files are never measured for code coverage.
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -10,6 +10,32 @@ config.order = :rand end +RSpec::Matchers.define :exit_with_code do |status_code| + actual = nil + + match do |block| + begin + block.call + rescue SystemExit => e + actual = e.status + end + actual and actual == status_code + end + + failure_message_for_should do |block| + "expected block to call exit(#{status_code}) but exit" + + (actual.nil? ? " not called" : "(#{actual}) was called") + end + + failure_message_for_should_not do |block| + "expected block not to call exit(#{status_code})" + end + + description do + "expect block to call exit(#{status_code})" + end +end + def fixture(name) File.read File.expand_path File.join(File.dirname(__FILE__), '..', 'fixtures', name) end
Add helper for status codes.
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -18,3 +18,5 @@ require 'rspec/expectations' require 'webmock/rspec' require 'omniauth-cas' + +OmniAuth.config.logger = Logger.new( '/dev/null' )
Disable log output in tests
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,3 @@-# $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) -# $LOAD_PATH.unshift(File.dirname(__FILE__)) require 'rspec' require 'robut-whois'
Remove things from the load path
diff --git a/libraries/matchers.rb b/libraries/matchers.rb index abc1234..def5678 100644 --- a/libraries/matchers.rb +++ b/libraries/matchers.rb @@ -1,15 +1,17 @@-def create_rdiff_backup(resource_name) - ChefSpec::Matchers::ResourceMatcher.new( - :rdiff_backup, - :create, - resource_name - ) +if defined?(ChefSpec) + def create_rdiff_backup(resource_name) + ChefSpec::Matchers::ResourceMatcher.new( + :rdiff_backup, + :create, + resource_name + ) + end + + def delete_rdiff_backup(resource_name) + ChefSpec::Matchers::ResourceMatcher.new( + :rdiff_backup, + :delete, + resource_name + ) + end end - -def delete_rdiff_backup(resource_name) - ChefSpec::Matchers::ResourceMatcher.new( - :rdiff_backup, - :delete, - resource_name - ) -end
Check if ChefSpec is defined, before defining matcher.
diff --git a/cookbooks/smith-packages/recipes/default.rb b/cookbooks/smith-packages/recipes/default.rb index abc1234..def5678 100644 --- a/cookbooks/smith-packages/recipes/default.rb +++ b/cookbooks/smith-packages/recipes/default.rb @@ -17,12 +17,8 @@ # limitations under the License. # -node['smith-packages']['install'].each do |pkg| - package pkg +package node['smith-packages']['install'] + +package node['smith-packages']['remove'] do + action :remove end - -node['smith-packages']['remove'].each do |pkg| - package pkg do - action :remove - end -end
Use multipackage from Chef 12
diff --git a/lib/tasks/load_legacy_mappings.rake b/lib/tasks/load_legacy_mappings.rake index abc1234..def5678 100644 --- a/lib/tasks/load_legacy_mappings.rake +++ b/lib/tasks/load_legacy_mappings.rake @@ -0,0 +1,29 @@+desc "Populate legacy_taxons links for each topic taxon according to a CSV" +task :load_legacy_mappings, [:csv_path] => :environment do |_t, args| + mapping = Hash.new { |h, k| h[k] = [] } + + CSV.foreach(args[:csv_path]) do |row| + mapping[row[1]] << row[0].match(/.+\[(.+)\]/)[1] + end + + api = Services.publishing_api + api.client.options[:timeout] = 30 + + mapping.each do |topic_taxon, legacy_taxons| + begin + topic_taxon_id = api.lookup_content_id(base_path: topic_taxon) + raise "Lookup failed for #{topic_taxon}" unless topic_taxon_id + topic_taxon_links = api.get_links(topic_taxon_id)["links"] + + legacy_taxon_ids = api.lookup_content_ids(base_paths: legacy_taxons) + missing_legacy_taxons = legacy_taxons - legacy_taxon_ids.keys + raise "Lookup failed for #{missing_legacy_taxons}" if missing_legacy_taxons.any? + topic_taxon_links["legacy_taxons"] = legacy_taxon_ids.values + + puts "Adding #{legacy_taxons.count} legacy taxons for #{topic_taxon}" + api.patch_links(topic_taxon_id, links: topic_taxon_links, bulk_publishing: true) + rescue StandardError => e + puts "Failed to patch #{topic_taxon}: #{e.message}" + end + end +end
Add rake task to populate topic taxons with legacy taxons.
diff --git a/lib/i18n-backoffice.rb b/lib/i18n-backoffice.rb index abc1234..def5678 100644 --- a/lib/i18n-backoffice.rb +++ b/lib/i18n-backoffice.rb @@ -27,19 +27,20 @@ @translations ||= redis.hgetall('I18n_translations') end - def load_translation_from_redis + def i18n_translations(reload = false) + if reload + @i18n_translations = I18n.backend.send(:translations) + end + @i18n_translations ||= I18n.backend.send(:translations) + end + + def reinitialize_translations + I18n.backend.load_translations + end + + def reload_translation_from_redis return unless redis - translations.each do |i18n_key, translation| - value_to_change = i18n_base_translation; nil - key_list = i18n_key.split('.') - key_list_to_parse = key_list.first(key_list.length - 1) - last_key = key_list.last - key_list_to_parse.each do |key| - value_to_change[key.to_sym] = {} unless value_to_change[key.to_sym].is_a?(Hash) - value_to_change = value_to_change[key.to_sym] - end - value_to_change[last_key.to_sym] = translation if value_to_change - end + i18n_translations(true).deep_merge!(translations(true).dig_hashed_by_spliting_keys) end }) end
Simplify and add some things
diff --git a/lib/bra/driver_common/requests/playlist_handler.rb b/lib/bra/driver_common/requests/playlist_handler.rb index abc1234..def5678 100644 --- a/lib/bra/driver_common/requests/playlist_handler.rb +++ b/lib/bra/driver_common/requests/playlist_handler.rb @@ -3,15 +3,13 @@ module Bra module DriverCommon module Requests - module Handlers - # Base class for handlers that handle requests on playlists - # - # This provides boilerplate code for working with the standard bra - # playlist API. - class PlaylistHandler < UrlHashHandler - use_payload_processor_for :post - put_by_posting_to_parent - end + # Base class for handlers that handle requests on playlists + # + # This provides boilerplate code for working with the standard bra + # playlist API. + class PlaylistHandler < UrlHashHandler + use_payload_processor_for :post + put_by_posting_to_parent end end end
Move PlaylistHandler up a module level.
diff --git a/lib/ember/appkit/rails/teaspoon/spec_controller.rb b/lib/ember/appkit/rails/teaspoon/spec_controller.rb index abc1234..def5678 100644 --- a/lib/ember/appkit/rails/teaspoon/spec_controller.rb +++ b/lib/ember/appkit/rails/teaspoon/spec_controller.rb @@ -9,5 +9,5 @@ end ActiveSupport.on_load(:action_controller) do - Teaspoon::SpecController.send(:prepend, Ember::Appkit::Rails::Teaspoon::SpecController) + Teaspoon::SpecController.send(:prepend, Ember::Appkit::Rails::Teaspoon::SpecController) if defined?(Teaspoon::SpecController) end
Make sure SpecController is not loaded before trying to load
diff --git a/Casks/rstudio-daily.rb b/Casks/rstudio-daily.rb index abc1234..def5678 100644 --- a/Casks/rstudio-daily.rb +++ b/Casks/rstudio-daily.rb @@ -0,0 +1,13 @@+cask :v1 => 'rstudio-daily' do + version :latest + sha256 :no_check + + url 'http://www.rstudio.org/download/latest/daily/desktop/mac/RStudio-latest.dmg' + name 'RStudio' + homepage 'https://www.rstudio.org/download/daily/desktop/mac/' + license :affero + + app 'RStudio.app' + + zap :delete => '~/.rstudio-desktop' +end
Add RStudio daily build cask The RStudio daily build is the fresher, more dangerous version of rstudio-preview
diff --git a/DANCurlRequest.podspec b/DANCurlRequest.podspec index abc1234..def5678 100644 --- a/DANCurlRequest.podspec +++ b/DANCurlRequest.podspec @@ -1,13 +1,14 @@ Pod::Spec.new do |s| - s.name = "DANCurlRequest" - s.version = "1.0.0" - s.summary = "Easily log NSURLRequest's as curl commands" - s.homepage = "https://github.com/endocrimes/#{s.name}" - s.license = { :type => "MIT", :file => "LICENSE" } - s.author = { "Danielle Lancashire" => "dani@builds.terrible.systems" } - s.social_media_url = "https://twitter.com/endocrimes" - s.platform = :ios, "7.0" - s.source = { :git => "#{s.homepage}.git", :tag => s.version } - s.source_files = s.name, "#{s.name}/**/*.{h,m}" - s.requires_arc = true + s.name = "DANCurlRequest" + s.version = "1.0.1" + s.summary = "Easily log NSURLRequest's as curl commands" + s.homepage = "https://github.com/endocrimes/#{s.name}" + s.license = { :type => "MIT", :file => "LICENSE" } + s.author = { "Danielle Lancashire" => "dani@builds.terrible.systems" } + s.social_media_url = "https://twitter.com/endocrimes" + s.ios.deployment_target = "7.0" + s.osx.deployment_target = "10.9" + s.source = { :git => "#{s.homepage}.git", :tag => s.version } + s.source_files = s.name, "#{s.name}/**/*.{h,m}" + s.requires_arc = true end
Add OS X support to Podfile, bump version to 1.0.1
diff --git a/omniauth-jobrocket.gemspec b/omniauth-jobrocket.gemspec index abc1234..def5678 100644 --- a/omniauth-jobrocket.gemspec +++ b/omniauth-jobrocket.gemspec @@ -1,11 +1,11 @@ # coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require 'omniauth/jobrocket/version' +require 'omniauth-jobrocket/version' Gem::Specification.new do |spec| spec.name = "omniauth-jobrocket" - spec.version = Omniauth::JobRocket::VERSION + spec.version = OmniAuth::JobRocket::VERSION spec.authors = ["George Drummond"] spec.email = ["georgedrummond@gmail.com"] spec.description = %q{Write a gem description}
Make gem spec so it will build
diff --git a/db/migrate/20160204080445_add_posts_original_updated_at.rb b/db/migrate/20160204080445_add_posts_original_updated_at.rb index abc1234..def5678 100644 --- a/db/migrate/20160204080445_add_posts_original_updated_at.rb +++ b/db/migrate/20160204080445_add_posts_original_updated_at.rb @@ -1,5 +1,7 @@ class AddPostsOriginalUpdatedAt < ActiveRecord::Migration def change add_column :posts, :original_updated_at, :datetime + + execute 'UPDATE posts SET original_updated_at = updated_at' end end
Copy updated_at to original_updated_at for existing records
diff --git a/vendor/plugins/authentication/app/controllers/sessions_controller.rb b/vendor/plugins/authentication/app/controllers/sessions_controller.rb index abc1234..def5678 100644 --- a/vendor/plugins/authentication/app/controllers/sessions_controller.rb +++ b/vendor/plugins/authentication/app/controllers/sessions_controller.rb @@ -3,7 +3,8 @@ filter_parameter_logging 'password', 'password_confirmation' def create - if (@session = UserSession.create(params[:session])) + @session = UserSession.new(params[:session]) + if @session.save redirect_back_or_default(admin_root_url) flash[:notice] = "Logged in successfully" else
Fix a bug where it would always say "Logged in successfully" even when they weren't logged in successfully. Somewhat confusingly, UserSession.create is not the same as UserSession.new.save. UserSession.create will return a UserSession object (such #<UserSession: no credentials provided>), even if there was an authentication error. This changes it back to use save, which returns true or false.
diff --git a/lib/soprano/unicorn.rb b/lib/soprano/unicorn.rb index abc1234..def5678 100644 --- a/lib/soprano/unicorn.rb +++ b/lib/soprano/unicorn.rb @@ -1,6 +1,6 @@ Capistrano::Configuration.instance(:must_exist).load do def unicorn_conf - fetch(:unicorn_conf, 'config/unicorn.rb') + fetch(:unicorn_conf, "#{deploy_to}/current/config/unicorn.rb") end def unicorn_bin
Revert "Provide relative config path." This reverts commit 24b7c8cd314213319c04b8b6064ecf2e0ee0b504.
diff --git a/lib/stairs/steps/s3.rb b/lib/stairs/steps/s3.rb index abc1234..def5678 100644 --- a/lib/stairs/steps/s3.rb +++ b/lib/stairs/steps/s3.rb @@ -7,9 +7,23 @@ description "Setup AWS and S3 bucket access" def run - env "AWS_ACCESS_KEY_ID", provide("AWS Access Key ID") - env "AWS_SECRET_ACCESS_KEY", provide("AWS Secret Access Key") - env "AWS_S3_BUCKET", provide("S3 Bucket name") + env key_id_name, provide("AWS Access Key ID") + env key_secret_name, provide("AWS Secret Access Key") + env bucket_name, provide("S3 Bucket name") + end + + private + + def key_id_name + options[:key_id] || "AWS_ACCESS_KEY_ID" + end + + def key_secret_name + options[:key_secret] || "AWS_SECRET_ACCESS_KEY" + end + + def bucket_name + options[:bucket] || "AWS_S3_BUCKET" end end end
Add option to control name of env vars
diff --git a/lib/tasks/woo_api.rake b/lib/tasks/woo_api.rake index abc1234..def5678 100644 --- a/lib/tasks/woo_api.rake +++ b/lib/tasks/woo_api.rake @@ -6,7 +6,7 @@ end task load_new_sessions: :environment do - break_time = Session.pluck(:updated_at).last || (Time.current - 60 * 60 * 24) + break_time = Session.pluck(:posted_at).last || (Time.current - 60 * 60 * 24) break_time_reached = false (0..500).step(15).collect do |offset|
Fix fetching times for sessions
diff --git a/lib/twitter/request.rb b/lib/twitter/request.rb index abc1234..def5678 100644 --- a/lib/twitter/request.rb +++ b/lib/twitter/request.rb @@ -1,8 +1,9 @@ require 'twitter/cursor' +require 'twitter/rate_limit' module Twitter class Request - attr_accessor :client, :request_method, :path, :options + attr_accessor :client, :rate_limit, :request_method, :path, :options alias_method :verb, :request_method # @param client [Twitter::Client] @@ -19,7 +20,9 @@ # @return [Hash] def perform - @client.send(@request_method, @path, @options).body + response = @client.send(@request_method, @path, @options) + @rate_limit = Twitter::RateLimit.new(response.response_headers) + response.body end # @param klass [Class]
Add rate_limit attribute to Twitter::Request References https://github.com/sferik/twitter/pull/626.
diff --git a/lib/ctrlo/actions/refresh_all.rb b/lib/ctrlo/actions/refresh_all.rb index abc1234..def5678 100644 --- a/lib/ctrlo/actions/refresh_all.rb +++ b/lib/ctrlo/actions/refresh_all.rb @@ -1,23 +1,32 @@ module Ctrlo class RefreshAll - def initialize + def initialize(options = {}) + @options = options end - def self.perform - new.perform + def self.perform(options = {}) + new(options).perform end def perform external_board_ids.map do |id| - ExternalList.fetch(id, { mode: :board }) - ExternalCard.fetch(id, { mode: :board }) - ExternalComment.fetch(id, { mode: :board }) - ExternalMember.fetch(id, { mode: :board }) + ExternalList.fetch(id, options) + ExternalCard.fetch(id, options) + ExternalComment.fetch(id, options) + ExternalMember.fetch(id, options) end true end private + + def options + defaults.merge!(@options) + end + + def defaults + { mode: :board } + end def external_board_ids active_boards.map(&:external_board_id)
Refactor { mode: :board } into an options hash.
diff --git a/lib/document_number/numerator.rb b/lib/document_number/numerator.rb index abc1234..def5678 100644 --- a/lib/document_number/numerator.rb +++ b/lib/document_number/numerator.rb @@ -2,13 +2,13 @@ module DocumentNumber class Numerator - def self.next_number(object, options) - DocumentNumber.transaction do - if ::Rails.version < "4.0" - # Rails 3 support - document_number = DocumentNumber.lock(true).find_or_initialize_by_document(object.class.to_s.underscore) + # Gets next number for document + def self.next_number(document, options) + DocumentNumber.transaction(requires_new: true) do + if ActiveRecord::VERSION::MAJOR < 4 + document_number = DocumentNumber.lock(true).find_or_initialize_by_document(document) else - document_number = DocumentNumber.lock(true).find_or_initialize_by(:document => object.class.to_s.underscore) + document_number = DocumentNumber.lock(true).find_or_initialize_by(:document => document) end number = document_number.number == 1 ? options[:start] : document_number.number
Check ActiveRecord version and use name
diff --git a/lib/has_ip_address/extensions.rb b/lib/has_ip_address/extensions.rb index abc1234..def5678 100644 --- a/lib/has_ip_address/extensions.rb +++ b/lib/has_ip_address/extensions.rb @@ -17,13 +17,13 @@ class Bignum def to_ipaddr - [24, 16, 8, 0].collect {|b| (self >> b) & 255}.join('.').to_ipaddr + IPAddr.new(self, Socket::AF_INET) end end class Fixnum def to_ipaddr - [24, 16, 8, 0].collect {|b| (self >> b) & 255}.join('.').to_ipaddr + IPAddr.new(self, Socket::AF_INET) end end
Use IPAddr to convert integer to IPAddr, instead of some hack.
diff --git a/test/web_console_test.rb b/test/web_console_test.rb index abc1234..def5678 100644 --- a/test/web_console_test.rb +++ b/test/web_console_test.rb @@ -25,10 +25,8 @@ app.config.middleware ||= Rails::Configuration::MiddlewareStackProxy.new app.config.active_support.deprecation = :notify - begin - yield app - ensure - Rails.application = old_app - end + yield app + ensure + Rails.application = old_app end end
Use the method body as a begin/end block This one saves the need of explicit begin/enusure/end in the new_uninitialized_app test helper.
diff --git a/lib/mongoid_auto_increment_id.rb b/lib/mongoid_auto_increment_id.rb index abc1234..def5678 100644 --- a/lib/mongoid_auto_increment_id.rb +++ b/lib/mongoid_auto_increment_id.rb @@ -1,16 +1,13 @@-module Mongoid - class Counter - include Components - end - +module Mongoid class Identity def generate_id + counter = Mongoid.master.collection("mongoid.auto_increment_ids") table_name = @document.class.to_s.tableize - o = Counter.collection.find_and_modify({:query => {:_id => table_name}, + o = counter.find_and_modify({:query => {:_id => table_name}, :update => {:$inc => {:c => 1}}, :new => true, :upsert => true}) - Criterion::Unconvertable.new(o["c"].to_s) + o["c"].to_s end end @@ -24,10 +21,11 @@ alias_method :super_as_document,:as_document def as_document - if attributes["_id"].blank? - attributes["_id"] = Identity.new(self).generate_id + result = super_as_document + if result["_id"].blank? + result["_id"] = Identity.new(self).generate_id end - super_as_document + result end end end
Fix for Mongoid 2.0 support
diff --git a/lib/npm/rails/package_manager.rb b/lib/npm/rails/package_manager.rb index abc1234..def5678 100644 --- a/lib/npm/rails/package_manager.rb +++ b/lib/npm/rails/package_manager.rb @@ -16,7 +16,7 @@ def write_bundle_file bundle_file_path = "#{ @root_path }/tmp/npm-rails/bundle.js" - Dir.mkdir("tmp/npm-rails") unless File.exist?("tmp/npm-rails") + FileUtils.mkdir_p("tmp/npm-rails") File.open(bundle_file_path, "w") do |file| packages_for_bundle_file.each do |package| file.write "window.#{ package.build_name } = require('#{ package.name }')\n"
Use `mkdir_p` since tmp dir may not exist
diff --git a/db/migrate/20160707174939_create_percentages.rb b/db/migrate/20160707174939_create_percentages.rb index abc1234..def5678 100644 --- a/db/migrate/20160707174939_create_percentages.rb +++ b/db/migrate/20160707174939_create_percentages.rb @@ -1,7 +1,7 @@ class CreatePercentages < ActiveRecord::Migration def change create_table :percentages do |t| - t.integer :percentage + t.integer :percent t.timestamps null: false end
Update column name on percentages table
diff --git a/example/my_app.rb b/example/my_app.rb index abc1234..def5678 100644 --- a/example/my_app.rb +++ b/example/my_app.rb @@ -1,42 +1,10 @@ ## Test app for Framework class MyApp < Flame::Application - # get '/' do - # view :index - # end - # - # get '/users' do - # view 'users/index' - # end - # - # post '/users' do - # view 'users/create' - # end - # - # get '/users/:id' do |id| - # view 'users/show', locals: { id: id } - # end - # - # put '/users/:id' do - # view 'users/update' - # end - # - # delete '/users/:id' do - # view 'users/delete' - # end - # - # get '/hello/:name' do |name| - # view :hello, name: name - # end - # - # get '/goodbye' do - # status 500 - # 'Goodbye Cruel World!' - # end - mount HomeController, '/home' do get '/', :index get '/welcome/:name', :welcome end + mount UsersController, '/users' do get '/', :index post '/', :create
Remove unused commented code from example app
diff --git a/openmeeg.rb b/openmeeg.rb index abc1234..def5678 100644 --- a/openmeeg.rb +++ b/openmeeg.rb @@ -2,8 +2,8 @@ class Openmeeg < Formula homepage 'http://www-sop.inria.fr/athena/software/OpenMEEG/' - url 'https://github.com/openmeeg/openmeeg/tarball/release-2.1' - sha1 'b779f95db3687e5e338f889d9510b5777fdbdb79' + url 'https://github.com/openmeeg/openmeeg/archive/release-2.1.tar.gz' + sha1 'c19896bde64e751142c74d15bf99defec518a054' head 'https://github.com/openmeeg/openmeeg.git'
Convert remaining github tarball URLs to archive URLs
diff --git a/lib/inline_svg/transform_pipeline/transformations/title.rb b/lib/inline_svg/transform_pipeline/transformations/title.rb index abc1234..def5678 100644 --- a/lib/inline_svg/transform_pipeline/transformations/title.rb +++ b/lib/inline_svg/transform_pipeline/transformations/title.rb @@ -1,12 +1,13 @@ module InlineSvg::TransformPipeline::Transformations class Title < Transformation def transform(doc) - doc = Nokogiri::XML::Document.parse(doc.to_html) - node = Nokogiri::XML::Node.new('title', doc) - node.content = value - doc.search('svg title').each { |node| node.remove } - doc.at_css('svg').prepend_child(node) - doc + with_svg(doc) do |svg| + node = Nokogiri::XML::Node.new("title", doc) + node.content = value + + svg.search("title").each { |node| node.remove } + svg.prepend_child(node) + end end end end
Handle documents without SVG root elements
diff --git a/spec/transport/udp_spec.rb b/spec/transport/udp_spec.rb index abc1234..def5678 100644 --- a/spec/transport/udp_spec.rb +++ b/spec/transport/udp_spec.rb @@ -1,8 +1,9 @@ require 'spec_helper' describe LIFX::Transport::UDP do + let(:port) { 45828 } subject do - LIFX::Transport::UDP.new('localhost', 22222) + LIFX::Transport::UDP.new('localhost', port) end describe '#write' do @@ -10,7 +11,7 @@ let(:payload) { double } it 'writes a Message to specified host' do message.should_receive(:pack).and_return(payload) - UDPSocket.any_instance.should_receive(:send).with(payload, 0, 'localhost', 22222) + UDPSocket.any_instance.should_receive(:send).with(payload, 0, 'localhost', port) subject.write(message) end end @@ -28,7 +29,7 @@ subject.listen LIFX::Message.should_receive(:unpack).with(raw_message).and_return(message) - socket.send(raw_message, 0, 'localhost', 22222) + socket.send(raw_message, 0, 'localhost', port) sleep 0.01 messages.should include(message) end
Use a more random port
diff --git a/lib/puppet/parser/functions/always_array.rb b/lib/puppet/parser/functions/always_array.rb index abc1234..def5678 100644 --- a/lib/puppet/parser/functions/always_array.rb +++ b/lib/puppet/parser/functions/always_array.rb @@ -6,11 +6,14 @@ If the argument is a hash, we will create an array where each element is the key value separated with a space. - ' ) do |args| - value = args + if args.is_a?(Array) and args.size == 1 + value = args[0] + else + value = args + end if value.is_a?(Array) return value
Improve support for calling the function from templates and/or manifests
diff --git a/spec/emphasis_list_spec.rb b/spec/emphasis_list_spec.rb index abc1234..def5678 100644 --- a/spec/emphasis_list_spec.rb +++ b/spec/emphasis_list_spec.rb @@ -1,85 +1,13 @@ require 'spec_helper' +require 'shared_verso_list_examples' describe Verso::EmphasisList do use_vcr_cassette :record => :new_episodes before do - @emphases = Verso::EmphasisList.new + @list = Verso::EmphasisList.new + @kontained = Verso::Emphasis end - describe 'array-like behavior' do - describe '#[]' do - it 'responds' do - @emphases.should respond_to(:[]) - end - - it 'gets a Verso::Emphasis object' do - @emphases[10].should be_a(Verso::Emphasis) - end - end - - describe '#each' do - it 'responds' do - @emphases.should respond_to(:each) - end - - it 'yields' do - expect { |b| @emphases.each("foo", &b).to yield_control } - end - - it 'yields Verso::Emphasis objects' do - @emphases.each { |c| c.should be_a(Verso::Emphasis) } - end - end - - describe '#empty?' do - it 'responds' do - @emphases.should respond_to(:empty?) - end - - it 'is not empty' do - @emphases.should_not be_empty - end - end - - describe '#last' do - it 'responds' do - @emphases.should respond_to(:last) - end - - it 'is a Verso::Emphasis object' do - @emphases.last.should be_a(Verso::Emphasis) - end - end - - describe '#length' do - it 'responds' do - @emphases.should respond_to(:length) - end - - it 'is a Fixnum' do - @emphases.length.should be_a(Fixnum) - end - end - - describe '#first' do - it 'responds' do - @emphases.should respond_to(:first) - end - - it 'is a Verso::Emphasis object' do - @emphases.first.should be_a(Verso::Emphasis) - end - end - - describe '#count' do - it 'responds' do - @emphases.should respond_to(:count) - end - - it 'is a Fixnum' do - @emphases.count.should be_a(Fixnum) - end - end - end + it_behaves_like 'any Verso list' end
Use shared examples for array-like behavior
diff --git a/db/seeds.rb b/db/seeds.rb index abc1234..def5678 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,6 +1,11 @@ path = File.dirname(__FILE__) connection = ActiveRecord::Base.connection -statements = IO.read(path + '/seeds.sql').split(';').map(&:strip).reject(&:empty?) +seedfile = if File.exists?(path + '/seeds_local.sql') + path + '/seeds_local.sql' + else + path + '/seeds.sql' + end +statements = IO.read(seedfile).split(';').map(&:strip).reject(&:empty?) ActiveRecord::Base.transaction do statements.each do |statement|
Load local seed data without checkin
diff --git a/lib/gemtranslatetoenglish/translatetoenglish.rb b/lib/gemtranslatetoenglish/translatetoenglish.rb index abc1234..def5678 100644 --- a/lib/gemtranslatetoenglish/translatetoenglish.rb +++ b/lib/gemtranslatetoenglish/translatetoenglish.rb @@ -8,7 +8,7 @@ return "" end - if phrase.empth? + if phrase.empty? return "" end
Correct name of method empty to string Signed-off-by: Gustavo Toshi Komura <4cad6e13d165ce6dbdcf3458fc5cbc27ddef2a34@gmail.com>
diff --git a/app/controllers/projects.rb b/app/controllers/projects.rb index abc1234..def5678 100644 --- a/app/controllers/projects.rb +++ b/app/controllers/projects.rb @@ -11,12 +11,14 @@ @project = Project.new(params[:project]) @project.set_default_user(session[:user_id]) @project.set_tags(params[:tags]) + @project.set_location(params[:location]) filename = params[:coverphoto][:filename] tempfile = params[:coverphoto][:tempfile] @project.set_cover_img(filename, tempfile) @project.status = 1 @project.save + p @project redirect "/projects/#{@project.id}" end @@ -29,10 +31,9 @@ get '/locations' do if request.xhr? @projects = Project.all - @locations = @projects.map(&:location) - p @locations + @locations = @projects.map { |project| {lat: project.lat, lng: project.lng, title: project.project_name, id: project.id} } content_type :json - { :locations => @locations }.to_json + { :projects => @locations }.to_json else redirect '/projects' end
Update ajax call on locations to contain latlng coordinates
diff --git a/app/helpers/wanikani_api.rb b/app/helpers/wanikani_api.rb index abc1234..def5678 100644 --- a/app/helpers/wanikani_api.rb +++ b/app/helpers/wanikani_api.rb @@ -6,19 +6,19 @@ def self.fetch_kanji(params) kanji = Wanikani::Level.kanji(optional_argument(params)) - kanji.each { |item| item[:type] = "kanji" } + kanji.each { |item| item["type"] = "kanji" } return kanji end def self.fetch_vocabulary(params) vocabulary = Wanikani::Level.vocabulary(optional_argument(params)) - vocabulary.each { |item| item[:type] = "vocabulary" } + vocabulary.each { |item| item["type"] = "vocabulary" } return vocabulary end def self.fetch_radicals(params) radicals = Wanikani::Level.radicals(optional_argument(params)) - radicals.each { |item| item[:type] = "radical" } + radicals.each { |item| item["type"] = "radical" } return radicals end
Fix incorrect hash key for Anki type
diff --git a/config/deploy/staging.rb b/config/deploy/staging.rb index abc1234..def5678 100644 --- a/config/deploy/staging.rb +++ b/config/deploy/staging.rb @@ -1,4 +1,4 @@-raise "No staging server setup yet!" +warn "No staging server setup yet!" # server ".us-west-2.compute.amazonaws.com", :app, :db, :primary => true # set :branch, "staging"
Switch to warn so cap -T works
diff --git a/examples/auth.rb b/examples/auth.rb index abc1234..def5678 100644 --- a/examples/auth.rb +++ b/examples/auth.rb @@ -18,7 +18,7 @@ begin flickr.get_access_token(token['oauth_token'], token['oauth_token_secret'], verify) login = flickr.test.login - puts "You are now authenticated as #{login.username}" + puts "You are now authenticated as #{login.username} with token #{flickr.access_token} and secret #{flickr.access_secret}" rescue FlickRaw::FailedResponse => e puts "Authentication failed : #{e.msg}" end
Print access and secret token
diff --git a/app/decorators/post_decorator.rb b/app/decorators/post_decorator.rb index abc1234..def5678 100644 --- a/app/decorators/post_decorator.rb +++ b/app/decorators/post_decorator.rb @@ -8,7 +8,7 @@ locale: 'ja_JP', type: 'article', title: title, - description: render_markdown(body), + description: render_markdown(body)&.gsub("\n", ''), url: post_url(id, all: true), site_name: site.name, modified_time: updated_at.to_datetime.to_s,
Remove linefeed from og:description for post
diff --git a/app/helpers/categories_helper.rb b/app/helpers/categories_helper.rb index abc1234..def5678 100644 --- a/app/helpers/categories_helper.rb +++ b/app/helpers/categories_helper.rb @@ -8,7 +8,8 @@ def expandable? (defined?(@category) && !current_page?(new_category_path)) || (defined?(@post) && !@post.category.nil?) || - (defined?(@question) && !@question.category.nil?) + (defined?(@question) && !@question.category.nil?) || + (defined?(@article) && !@article.category.nil?) end def current_category
Expand category header on articles
diff --git a/app/models/abilities/everyone.rb b/app/models/abilities/everyone.rb index abc1234..def5678 100644 --- a/app/models/abilities/everyone.rb +++ b/app/models/abilities/everyone.rb @@ -11,7 +11,7 @@ can :read, User can [:search, :read], Annotation can :new, DirectMessage - can [:read, :draft_version_publication, :allegations, :final_version_publication], Legislation::Process + can [:read, :draft_publication, :allegations, :final_version_publication], Legislation::Process can [:read], Legislation::DraftVersion end end
Fix abilities to see the draft publication section
diff --git a/app/models/instrument_version.rb b/app/models/instrument_version.rb index abc1234..def5678 100644 --- a/app/models/instrument_version.rb +++ b/app/models/instrument_version.rb @@ -28,10 +28,11 @@ return @instrument.questions unless @version questions = [] @version.reify.questions.each do |question| - if versioned(question) - questions << versioned(question) - options = options_for_question(versioned(question)) - question.define_singleton_method(:options) { options } + versioned_question = versioned(question) + if versioned_question + questions << versioned_question + options = options_for_question(versioned_question) + versioned_question.define_singleton_method(:options) { options } end end questions
Fix versioned options bug for instrument version model
diff --git a/app/models/spree/subscription.rb b/app/models/spree/subscription.rb index abc1234..def5678 100644 --- a/app/models/spree/subscription.rb +++ b/app/models/spree/subscription.rb @@ -24,7 +24,7 @@ state: 'confirm' ) - self.shipped_products << random_product + shipped_products << random_product add_line_item(order) set_next_order_date
Fix - Redundant self detected.
diff --git a/spec/controllers/vm_cloud_controller/trees_spec.rb b/spec/controllers/vm_cloud_controller/trees_spec.rb index abc1234..def5678 100644 --- a/spec/controllers/vm_cloud_controller/trees_spec.rb +++ b/spec/controllers/vm_cloud_controller/trees_spec.rb @@ -26,17 +26,24 @@ end end - it "renders Instance details for Instance node" do - instance = FactoryGirl.create(:vm_openstack) + [ + %w(vm_openstack Openstack), + %w(vm_azure Azure), + %w(vm_google Google), + %w(vm_amazon Amazon) + ].each do |instance, name| + it "renders Instance details for #{name} node" do + instance = FactoryGirl.create(instance.to_sym) - session[:settings] = {} - seed_session_trees('vm_cloud', 'instances_tree') + session[:settings] = {} + seed_session_trees('vm_cloud', 'instances_tree') - post :tree_select, :params => { :id => "v-#{instance.compressed_id}", :format => :js } + post :tree_select, :params => { :id => "v-#{instance.compressed_id}", :format => :js } - expect(response).to render_template('vm_cloud/_main') - expect(response).to render_template('shared/summary/_textual_tags') - expect(response.status).to eq(200) + expect(response).to render_template('vm_cloud/_main') + expect(response).to render_template('shared/summary/_textual_tags') + expect(response.status).to eq(200) + end end end end
Add specs for cloud instance display in explorer.
diff --git a/spec/unit/axiom/attribute/comparable/range_spec.rb b/spec/unit/axiom/attribute/comparable/range_spec.rb index abc1234..def5678 100644 --- a/spec/unit/axiom/attribute/comparable/range_spec.rb +++ b/spec/unit/axiom/attribute/comparable/range_spec.rb @@ -16,5 +16,5 @@ end end - it { should eql(Types::NegativeInfinity..Types::Infinity) } + it { should eql(Types::NegativeInfinity.instance..Types::Infinity.instance) } end
Fix specs to work with Infinity change to singleton object
diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index abc1234..def5678 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -1,14 +1,15 @@ class UserMailer < ApplicationMailer def welcome_email(user, organization) - build_email user, :welcome, { inline: organization.welcome_email_template }, organization + organization_name = organization[:display_name] || t(:your_new_organization) + build_email user, t(:welcome, name: organization_name), { inline: organization.welcome_email_template }, organization end def we_miss_you_reminder(user, cycles) - build_email user, :we_miss_you, "#{cycles.ordinalize}_reminder" + build_email user, t(:we_miss_you), "#{cycles.ordinalize}_reminder" end def no_submissions_reminder(user) - build_email user, :start_using_mumuki, 'no_submissions_reminder' + build_email user, t(:start_using_mumuki), 'no_submissions_reminder' end private @@ -20,7 +21,7 @@ I18n.with_locale(@organization.locale) do mail to: user.email, - subject: t(subject), + subject: subject, content_type: 'text/html', body: render(template) end
Use organization name on welcome message
diff --git a/test/graphql/user/user_test.rb b/test/graphql/user/user_test.rb index abc1234..def5678 100644 --- a/test/graphql/user/user_test.rb +++ b/test/graphql/user/user_test.rb @@ -0,0 +1,84 @@+# frozen_string_literal: true + +require("test_helper") + +class Mutations::UserTest < IntegrationTestCase # ActionDispatch::IntegrationTest # ActiveSupport::TestCase + # def setup + # context = { + # session_user: context[:session_user] + # } + # end + + # def test_find_user_by_id + # query_string = <<-GRAPHQL + # query($id: Int){ + # user(id: $id) { + # name + # id + # email + # login + # } + # } + # GRAPHQL + + # # user = rolf + # # user_id = MushroomObserverSchema.id_from_object(rolf, Types::Models::User, {}) + # user_id = rolf.id + + # result = MushroomObserverSchema.execute(query_string, variables: { id: user_id }) + # user_result = result["data"]["user"] + + # # Make sure the query worked + # assert_equal(user_id, user_result["id"]) + # assert_equal("rolf", user_result["login"]) + # end + + # def good_signup_input + # { + # login: "Fred", + # email: "Fred@gmail.com", + # name: "Fred Waite", + # password: "123333", + # password_confirmation: "123333" + # } + # end + + # def create_user(args = {}, context = {}) + # Mutations::CreateUser.new(object: nil, field: nil, context: context).resolve(args) + # end + + # def test_create_valid_user + # user = create_user(good_signup_input) + + # assert(user.persisted?) + # assert_equal(user.name, "Fred Waite") + # assert_equal(user.email, "Fred@gmail.com") + # end + + # def test_create_valid_user_integration + # query_string = <<-GRAPHQL + # mutation { + # createUser( + # input: { + # login: "Fred", + # email: "Fred@gmail.com", + # name: "Fred Waite", + # password: "123333", + # passwordConfirmation: "123333" + # } + # ) { + # id + # name + # email + # } + # } + # GRAPHQL + + # user_result = MushroomObserverSchema.execute(query_string, context: {}, variables: {}) + # # currently responds with a user not a node, or true. do we need to use connection? + # # puts(user_result.to_h) + # # {"data"=>{"createUser"=>{"id"=>1030180662, "name"=>"Fred Waite", "email"=>"Fred@gmail.com"}}} + + # assert_equal("Fred Waite", user_result["data"]["createUser"]["name"]) + # end +end
Comment out the user test, doesn't seem to be working at all yet
diff --git a/app/models/entry_access.rb b/app/models/entry_access.rb index abc1234..def5678 100644 --- a/app/models/entry_access.rb +++ b/app/models/entry_access.rb @@ -1,55 +1,11 @@-class Entry < ActiveRecord::Base - self.inheritance_column = nil - - Sharing = { - private: 0, - anonymous: 50, - users: 100, - friends: 200, - friends_of_friends: 300, - everyone: 500 +class EntryAccess < ActiveRecord::Base + belongs_to :user + belongs_to :entry + + Level = { + block: 0, + read: 20, + write: 30, + own: 50 } - - belongs_to :user - - has_many :entry_accesses - has_many :authorized_users, :through => :entry_accesses, :source => :user - - has_many :tags, :as => :entry - has_many :whats, :through => :tags, :source => :noun, :source_type => 'What' - has_many :whos, :through => :tags, :source => :noun, :source_type => 'Who' - has_many :wheres, :through => :tags, :source => :noun, :source_type => 'Where' - - has_one :view_preference, :as => "viewable" - - validates_presence_of :user - - before_save :set_sharing_level - before_create :create_view_preference - - def nouns - whos + wheres + whats - # tags.all(:include => :noun).map(&:noun) - seems to be slower. - end - - def add_what_tag(what) - self.whats << what unless self.whats.exists? what - end - - def sharing - self.class::Sharing.invert[sharing_level] - end - - def create_view_preference - return if view_preference - self.view_preference = user.view_preference.clone! - end - - protected ####################### - - def set_sharing_level - # sharing_level ||= user.default_sharing_level - # sharing_level ||= self::Sharing[:everyone] - end - -end +end
Change EntryAccess back to its natural state.
diff --git a/app/models/log_location.rb b/app/models/log_location.rb index abc1234..def5678 100644 --- a/app/models/log_location.rb +++ b/app/models/log_location.rb @@ -3,5 +3,7 @@ belongs_to :log belongs_to :location, polymorphic: true + + accepts_nested_attributes_for :location end
Add nested attributes for location in log location
diff --git a/acceptance/lib/dash.rb b/acceptance/lib/dash.rb index abc1234..def5678 100644 --- a/acceptance/lib/dash.rb +++ b/acceptance/lib/dash.rb @@ -5,10 +5,10 @@ def dash_login visit dash_route('/sky/login?redirect_uri=/') - click_button 'Log in with Username' + click_button 'Username/Password' fill_in 'password', with: ATC_USERNAME fill_in 'login', with: ATC_PASSWORD - click_button 'Login' + click_button 'login' expect(page).to_not have_content 'login' end end
Fix acceptance tests with new UI values Signed-off-by: Mark Huang <222d07b3281cbd31b38f93d23c330586c713e995@pivotal.io>
diff --git a/app/models/language.rb b/app/models/language.rb index abc1234..def5678 100644 --- a/app/models/language.rb +++ b/app/models/language.rb @@ -16,5 +16,5 @@ has_paper_trail on: %i[update destroy] has_many :pages - validates :code, :actionkit_uri, :name, presence: true, allow_blank: false, uniqueness: true + validates :code, :actionkit_uri, :name, presence: true, allow_blank: false end
Remove the uniqueness validation from the Language model (although it makes sense) to avoid the need to update the entire test suite.
diff --git a/app/decorators/models/solidus_avatax_certified/spree/user_decorator.rb b/app/decorators/models/solidus_avatax_certified/spree/user_decorator.rb index abc1234..def5678 100644 --- a/app/decorators/models/solidus_avatax_certified/spree/user_decorator.rb +++ b/app/decorators/models/solidus_avatax_certified/spree/user_decorator.rb @@ -4,7 +4,7 @@ module Spree module UserDecorator def self.prepended(base) - base.belongs_to :avalara_entity_use_code + base.belongs_to :avalara_entity_use_code, optional: true end ::Spree::User.prepend self
Fix avalara_entity_use_code being required for Spree::User
diff --git a/pronto-rubocop.gemspec b/pronto-rubocop.gemspec index abc1234..def5678 100644 --- a/pronto-rubocop.gemspec +++ b/pronto-rubocop.gemspec @@ -21,7 +21,7 @@ s.require_paths = ['lib'] s.add_dependency 'rubocop', '~> 0.9.0' - s.add_dependency 'pronto', '~> 0.0.2' + s.add_dependency 'pronto', '~> 0.0.3' s.add_development_dependency 'rake', '~> 10.1.0' s.add_development_dependency 'rspec', '~> 2.13.0' end
Change pronto dependency version from 0.0.2 to 0.0.3
diff --git a/actionpack/test/abstract/translation_test.rb b/actionpack/test/abstract/translation_test.rb index abc1234..def5678 100644 --- a/actionpack/test/abstract/translation_test.rb +++ b/actionpack/test/abstract/translation_test.rb @@ -36,4 +36,10 @@ I18n.stubs(:translate).with(key).returns(expected) assert_equal expected, @controller.t(key) end + + def test_localize + time, expected = Time.gm(2000), 'Sat, 01 Jan 2000 00:00:00 +0000' + I18n.stubs(:localize).with(time).returns(expected) + assert_equal expected, @controller.l(time) + end end
Test abstract controller's localize method.
diff --git a/games/bestKill_vs_eval.rb b/games/bestKill_vs_eval.rb index abc1234..def5678 100644 --- a/games/bestKill_vs_eval.rb +++ b/games/bestKill_vs_eval.rb @@ -0,0 +1,22 @@+#/usr/bin/env ruby +require './state' +require 'debugger' + +game = State.new + +game.initBoard + +game.printBoard + +puts "bestKillbot (W) vs evalBot(B)" + +while not game.gameOver? do + game.chooseBestKill + game.nextTurn + game.printBoard + break if game.gameOver? + game.evalMove + game.nextTurn + game.printBoard +end +
Add bestkill vs eval game
diff --git a/api/app/views/spree/api/variants/big.v1.rabl b/api/app/views/spree/api/variants/big.v1.rabl index abc1234..def5678 100644 --- a/api/app/views/spree/api/variants/big.v1.rabl +++ b/api/app/views/spree/api/variants/big.v1.rabl @@ -1,14 +1,8 @@ object @variant -attributes *variant_attributes cache [I18n.locale, @current_user_roles.include?('admin'), 'big_variant', root_object] extends "spree/api/variants/small" - -node :total_on_hand do - root_object.total_on_hand -end - child(:stock_items => :stock_items) do attributes :id, :count_on_hand, :stock_location_id, :backorderable
Fix track_inventory on big variant rabl template. Fixes #6149
diff --git a/kernel_file.rb b/kernel_file.rb index abc1234..def5678 100644 --- a/kernel_file.rb +++ b/kernel_file.rb @@ -0,0 +1,60 @@+# +# kernel_file.rb +# +# This fact provides information about file descriptors currently available on +# the system as follows: total allocated file descriptors since system power-up, +# total free file descriptors available for allocation and maximum available +# file descriptors (also known as "RLIMIT_NOFILE" which per-process and always +# lower than the constant "NR_OPEN" denoting Kernel enforced upper-limit) and +# which is probably the most useful piece of information in its own right ... +# +require 'facter' + +if Facter.value(:kernel) == 'Linux' + # + # We will pass Proc object for execution later inside "setcode" block. This + # should make caching of the results work nicely ... + # + result = Proc.new do + # + # Modern Linux kernels provide "/proc/sys/fs/file-nr" in the following format: + # + # 52832 0 1200077 + # + # Where first number denotes total allocated file descriptors since + # system power-up, second number shows total number of free file + # descriptors available for allocation (and Linux Kernel will add + # more on-demand as needed), and last number shows maximum available + # file descriptors (same as the number in "/proc/sys/fs/file-max) ... + # + data = Facter::Util::Resolution.exec('cat /proc/sys/fs/file-nr 2> /dev/null') + data.split(/\s+/) + end + + # Total allocated file descriptors since system power-up ... + Facter.add('kernel_file_total') do + confine :kernel => :linux + setcode { result.call[0] } + end + + # + # Total free file descriptors available for allocation (if exhausted, + # then Linux Kernel will add more on-demand) ... + # + Facter.add('kernel_file_free') do + confine :kernel => :linux + setcode { result.call[1]} + end + + # + # Maximum available file descriptors that can be allocated. This number + # will be the same as what can be seen in "/proc/sys/fs/file-max" ... + # + Facter.add('kernel_file_max') do + confine :kernel => :linux + setcode { result.call[2] } + end +end + +# vim: set ts=2 sw=2 et : +# encoding: utf-8
Add Facter fact that provides information about file descriptors on the system. This fact provides information about file descriptors currently available on the system as follows: total allocated file descriptors since system power-up, total free file descriptors available for allocation and maximum available file descriptors (also known as "RLIMIT_NOFILE" which per-process and always lower than the constant "NR_OPEN" denoting Kernel enforced upper-limit) and which is probably the most useful piece of information in its own right ... Signed-off-by: Krzysztof Wilczynski <9bf091559fc98493329f7d619638c79e91ccf029@linux.com>
diff --git a/gems/attributes/server.rb b/gems/attributes/server.rb index abc1234..def5678 100644 --- a/gems/attributes/server.rb +++ b/gems/attributes/server.rb @@ -1,4 +1,4 @@-gem_server = Mash.new unless attribute?("gem_server") +gem_server Mash.new unless attribute?("gem_server") gem_server[:virtual_hostname] = "gems.#{domain}" unless gem_server.has_key?("virtual_host") gem_server[:virtual_alias] = "gems" unless gem_server.has_key?("virtual_alias")
Remove assignment for gems Mash.new
diff --git a/app/controllers/determinations_controller.rb b/app/controllers/determinations_controller.rb index abc1234..def5678 100644 --- a/app/controllers/determinations_controller.rb +++ b/app/controllers/determinations_controller.rb @@ -19,7 +19,11 @@ def restrict_access authenticate_or_request_with_http_token do |token, options| - @@access_tokens.include? token + if ENV['REQUIRE_ACCESS_TOKEN'] == 'true' + @@access_tokens.include? token + else + true + end end end end
Make access token an option
diff --git a/app/serializers/user_analytics_serializer.rb b/app/serializers/user_analytics_serializer.rb index abc1234..def5678 100644 --- a/app/serializers/user_analytics_serializer.rb +++ b/app/serializers/user_analytics_serializer.rb @@ -7,6 +7,7 @@ attributes :partner_of, :core_team_of attributes :most_recent_product_name + attributes :most_recent_product_slug attributes :comments, :following, :ideas, :wips @@ -45,6 +46,10 @@ object.products.order(:created_at).last.try(:name) end + def most_recent_product_slug + object.products.order(:created_at).last.try(:slug) + end + def ideas object.products.size end
Add most_recent_product_slug to user analytics
diff --git a/app/views/staff/grids/schedule.json.jbuilder b/app/views/staff/grids/schedule.json.jbuilder index abc1234..def5678 100644 --- a/app/views/staff/grids/schedule.json.jbuilder +++ b/app/views/staff/grids/schedule.json.jbuilder @@ -1,7 +1,7 @@ json.rooms current_event.rooms, :id, :name json.days (1..current_event.days).to_a -json.slots current_event.time_slots, :conference_day, :id, :update_path, :start_time, :end_time, :program_session_id, :track_id, :room_id +json.slots current_event.time_slots json.sessions current_event.program_sessions json.unscheduledSessions current_event.program_sessions.unscheduled json.counts EventStats.new(current_event).schedule_counts
Add title, presenter, description info back to time slots
diff --git a/knife-ec2.gemspec b/knife-ec2.gemspec index abc1234..def5678 100644 --- a/knife-ec2.gemspec +++ b/knife-ec2.gemspec @@ -8,7 +8,7 @@ s.authors = ["Adam Jacob", "Seth Chisamore"] s.email = ["adam@chef.io", "schisamo@chef.io"] s.homepage = "https://github.com/chef/knife-ec2" - s.summary = "EC2 Support for Chef's Knife Command" + s.summary = "Amazon EC2 Support for Chef's Knife Command" s.description = s.summary s.license = "Apache-2.0"
Add amazon to the gemspec summary for SEO Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/test/spec/Sandbox/Application_before_chain_spec.rb b/test/spec/Sandbox/Application_before_chain_spec.rb index abc1234..def5678 100644 --- a/test/spec/Sandbox/Application_before_chain_spec.rb +++ b/test/spec/Sandbox/Application_before_chain_spec.rb @@ -13,10 +13,8 @@ include Sandbox::Resource::Stateless include Sandbox::Resource::BeforeChain - @@before_chain = { - all: [ -> (request) { request[:test] << 1 }], - get: [ -> (request) { request[:test] << 2 }] - } + chain_before :all, -> (request) { request[:test] << 1 } + chain_before :get, -> (request) { request[:test] << 2 } def get(request) request[:test] << 3
Improve application before chain syntax
diff --git a/lib/temping.rb b/lib/temping.rb index abc1234..def5678 100644 --- a/lib/temping.rb +++ b/lib/temping.rb @@ -13,7 +13,8 @@ raise ModelAlreadyDefined, "Constant #{model_name.to_s.classify} is already defined" end - ModelFactory.new(model_name, &block).klass + factory = ModelFactory.new(model_name, &block) + factory.klass end class ModelFactory
Create local variable for readability
diff --git a/rails_generators/terraforming.rb b/rails_generators/terraforming.rb index abc1234..def5678 100644 --- a/rails_generators/terraforming.rb +++ b/rails_generators/terraforming.rb @@ -23,6 +23,8 @@ when /^\w+\.js$/ then "#{arg}.rjs" when /^\w+\.(?:html|fbml)$/ then "#{arg}.haml" when /^\w+\.(?:xml|rss|atom)$/ then "#{arg}.builder" + when /^\w+\.\w+$/ then "#{arg}.erb" + else next end end @views.compact!
Fix attributes in fixtures and exemplars
diff --git a/lib/niman/cli/application.rb b/lib/niman/cli/application.rb index abc1234..def5678 100644 --- a/lib/niman/cli/application.rb +++ b/lib/niman/cli/application.rb @@ -18,8 +18,10 @@ desc "setup", "Generates an empty Nimanfile" def setup content = <<-EOS - Niman::Recipe.configure do |config| - end +# -*- mode: ruby -*- +# vi: set ft=ruby : +Niman::Recipe.configure do |config| +end EOS File.open(Niman::Recipe::DEFAULT_FILENAME, "w") { |handle| handle.write(content) } say "Created new file #{Niman::Recipe::DEFAULT_FILENAME}"
Fix indentation and add vi/vim markers
diff --git a/test/api/group_sets_api_test.rb b/test/api/group_sets_api_test.rb index abc1234..def5678 100644 --- a/test/api/group_sets_api_test.rb +++ b/test/api/group_sets_api_test.rb @@ -17,7 +17,7 @@ # Obtain the unit of the group newUnit = newGroup.group_set.unit get with_auth_token "/api/units/#{newUnit.id}/groups",newUnit.main_convenor_user - + #Check response response_keys = %w(id name) last_response_body.each do | data | @@ -25,7 +25,7 @@ assert_json_matches_model(data, grp, response_keys) end assert_equal 200, last_response.status - end + end def test_get_all_groups_in_unit_without_authorization # Create a group @@ -33,11 +33,11 @@ # Obtain the unit of the group newUnit = newGroup.group_set.unit - # Obtain a student object from the unit + # Obtain student object from the unit studentUser = newUnit.active_projects.first.student get with_auth_token "/api/units/#{newUnit.id}/groups",studentUser # Check error code when an unauthorized user tries to get groups in a unit assert_equal 403, last_response.status - end + end end
FIX: Change get tests for group_sets_api
diff --git a/test/api/units/feedback_test.rb b/test/api/units/feedback_test.rb index abc1234..def5678 100644 --- a/test/api/units/feedback_test.rb +++ b/test/api/units/feedback_test.rb @@ -0,0 +1,28 @@+require 'test_helper' + +class FeedbackTest < ActiveSupport::TestCase + include Rack::Test::Methods + include TestHelpers::AuthHelper + include TestHelpers::JsonHelper + + def app + Rails.application + end + + def test_get_awaiting_feedback + random_unitrole = UnitRole.tutors.sample + unit = random_unitrole.unit + user = random_unitrole.user + + expected_response = unit.tasks_awaiting_feedback + + get with_auth_token "/api/units/#{unit.id}/feedback", user + + assert_equal 200, last_response.status + + # check each is the same + last_response_body.zip(expected_response).each do |response, expected| + assert_json_matches_model response, expected, ['id'] + end + end +end
TEST: Add tests for tasks awaiting feedback
diff --git a/lib/random_user_generator.rb b/lib/random_user_generator.rb index abc1234..def5678 100644 --- a/lib/random_user_generator.rb +++ b/lib/random_user_generator.rb @@ -1,3 +1,4 @@+require "json" require "ostruct" require "faraday" @@ -14,7 +15,7 @@ def self.generate(params = {}) results = client.request(params) - users = results.map { |u| User.new(u) } + users = JSON.parse(results.to_json, object_class: User) params[:results] ? users : users.first end
Fix to support nested accessor on User
diff --git a/lib/registerable_calendar.rb b/lib/registerable_calendar.rb index abc1234..def5678 100644 --- a/lib/registerable_calendar.rb +++ b/lib/registerable_calendar.rb @@ -7,7 +7,7 @@ attr_accessor :calendar, :slug, :live - def_delegators :@calendar, :title, :need_id, :description, :section + def_delegators :@calendar, :title, :need_id, :description, :section, :indexable_content def initialize(path) details = JSON.parse(File.read(path))
Add indexable_content to the registered fields. Including this field means Panopticon has all the data it needs to post the artefact to Rummager directly, rather than having to post an amendment, which will fail if the item is not already in Rummager's index.
diff --git a/test/integration_test_helper.rb b/test/integration_test_helper.rb index abc1234..def5678 100644 --- a/test/integration_test_helper.rb +++ b/test/integration_test_helper.rb @@ -1,11 +1,5 @@ require 'test_helper' require 'capybara/rails' - -class ActionController::Base - before_filter do - response.headers[Slimmer::SKIP_HEADER] = true - end -end class ActionDispatch::IntegrationTest include Capybara::DSL
Revert "Try skipping Slimmer in the integration tests." This reverts commit c9039612ba7e85c8c5b0253bce8cc39853e3ee51.
diff --git a/test/lib/test_initialization.rb b/test/lib/test_initialization.rb index abc1234..def5678 100644 --- a/test/lib/test_initialization.rb +++ b/test/lib/test_initialization.rb @@ -25,7 +25,7 @@ client = SalesforceBulk::Client.new(options) assert_equal client.username, 'username' - assert_equal client.password, 'password' + assert_equal client.password, 'passwordtoken' assert_equal client.token, 'token' assert_equal client.debugging, true end
Update test as we will have the client object combine password and token values into password field.
diff --git a/lib/gitmethere.rb b/lib/gitmethere.rb index abc1234..def5678 100644 --- a/lib/gitmethere.rb +++ b/lib/gitmethere.rb @@ -38,11 +38,13 @@ def create_file(name="my-file.md", content="") File.open("#{@name}/#{name}", 'w') do | f | - f.puts content + unless content.empty? + f.puts content + end end end - def append_to_file(name="myfile.md", content="Adding a bit more content") + def append_to_file(name="my-file.md", content="Adding a bit more content") File.open("#{@name}/#{name}", 'a') do | f | f.puts content end
Update Scenario to pass tests
diff --git a/lib/rocket_job.rb b/lib/rocket_job.rb index abc1234..def5678 100644 --- a/lib/rocket_job.rb +++ b/lib/rocket_job.rb @@ -14,14 +14,9 @@ autoload :SlicedJob, 'rocket_job/sliced_job' autoload :Server, 'rocket_job/server' autoload :Worker, 'rocket_job/worker' - module Reader - autoload :Zip, 'rocket_job/reader/zip' - end + autoload :Streams, 'rocket_job/streams' module Utility autoload :CSVRow, 'rocket_job/utility/csv_row' - end - module Writer - autoload :Zip, 'rocket_job/writer/zip' end module Jobs autoload :PerformanceJob, 'rocket_job/jobs/performance_job'
Add streaming classes Support streaming of zip, gzip, encrypted files, user define-able formats etc.
diff --git a/messaging.gemspec b/messaging.gemspec index abc1234..def5678 100644 --- a/messaging.gemspec +++ b/messaging.gemspec @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = 'messaging' - s.version = '0.2.1.0' + s.version = '0.3.0.0' s.summary = 'Messaging primitives for Eventide' s.description = ' '
Package version is increased from 0.2.1.0 to 0.3.0.0
diff --git a/messaging.gemspec b/messaging.gemspec index abc1234..def5678 100644 --- a/messaging.gemspec +++ b/messaging.gemspec @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = 'evt-messaging' - s.version = '1.0.0.0' + s.version = '1.1.0.0' s.summary = 'Common primitives for platform-specific messaging implementations for Eventide' s.description = ' '
Package version is increased from 1.0.0.0 to 1.1.0.0
diff --git a/db/migrate/20211005130501_rename_option_set_name_where_duplicates.rb b/db/migrate/20211005130501_rename_option_set_name_where_duplicates.rb index abc1234..def5678 100644 --- a/db/migrate/20211005130501_rename_option_set_name_where_duplicates.rb +++ b/db/migrate/20211005130501_rename_option_set_name_where_duplicates.rb @@ -7,7 +7,10 @@ next if sets.count < 2 sets.each do |set| puts "Renaming duplicate option set ##{set.id}: #{set.name}" - set.update!(name: "#{set.name} #{set.created_at}") + next if set.update(name: "#{set.name} #{set.created_at.to_s(:std_datetime)}") + # Some may have been created at the same second, e.g. if imported or created from the terminal; + # if so, append a random string also. + set.update!(name: "#{set.name} #{SecureRandom.alphanumeric(4)}") end end
11992: Handle option sets created at the same second
diff --git a/cap_talk.rb b/cap_talk.rb index abc1234..def5678 100644 --- a/cap_talk.rb +++ b/cap_talk.rb @@ -2,6 +2,8 @@ require 'erb' class CapTalk < Sinatra::Base + class NoDatabaseConfig < StandardError; end + set :raise_errors, true get '/' do @@ -9,6 +11,11 @@ end get '/steps/:step' do + check_db_config erb :steps, locals: { step: params[:step] } end + + def check_db_config + File.exist?('config/database.yml') ? true : fail(NoDatabaseConfig) + end end
Raise an exception if database.yml does not exist
diff --git a/example_app_generator/no_active_record/app/models/in_memory/model.rb b/example_app_generator/no_active_record/app/models/in_memory/model.rb index abc1234..def5678 100644 --- a/example_app_generator/no_active_record/app/models/in_memory/model.rb +++ b/example_app_generator/no_active_record/app/models/in_memory/model.rb @@ -15,9 +15,18 @@ alias_method :size, :count alias_method :length, :count + def last + all.last + end + + def find(id) + id = id.to_i + all.find { |record| record.id == id } || raise + end + def create!(attributes = {}) - with_id = { :id => next_id, :persisted => true } - all << record = new(with_id.merge(attributes)) + record = new(attributes) + record.save record end @@ -38,15 +47,49 @@ include ::ActiveModel::Validations def initialize(attributes = {}) - attributes.each do |name, value| - send("#{name}=", value) - end + assign_attributes(attributes) end end attr_accessor :id, :persisted alias_method :persisted?, :persisted + + def update(attributes) + assign_attributes(attributes) + save + end + + alias_method :update_attributes, :update + + def assign_attributes(attributes) + attributes.each do |name, value| + __send__("#{name}=", value) + end + end + + def save(*) + self.id = self.class.next_id + self.class.all << self + true + end + + def destroy + self.class.all.delete(self) + true + end + + def reload(*) + self + end + + def ==(other) + other.is_a?(self.class) && id == other.id + end + + def persisted? + !id.nil? + end def new_record? !persisted?
Enhance InMemory::Model in the no AR example app