diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/lib/active_conductor.rb b/lib/active_conductor.rb index abc1234..def5678 100644 --- a/lib/active_conductor.rb +++ b/lib/active_conductor.rb @@ -4,7 +4,9 @@ class ActiveConductor include ActiveModel::Conversion include ActiveModel::Validations + extend ActiveModel::Naming + extend ActiveModel::Translation extend Forwardable def self.conduct(obj, *attributes)
Add I18n translations to the conductor
diff --git a/plugins/guests/debian/cap/change_host_name.rb b/plugins/guests/debian/cap/change_host_name.rb index abc1234..def5678 100644 --- a/plugins/guests/debian/cap/change_host_name.rb +++ b/plugins/guests/debian/cap/change_host_name.rb @@ -12,6 +12,8 @@ if !comm.test("hostname -f | grep '^#{name}$'", sudo: false) basename = name.split(".", 2)[0] comm.sudo <<-EOH.gsub(/^ {14}/, '') + set -e + # Set the hostname echo '#{basename}' > /etc/hostname hostname -F /etc/hostname @@ -28,16 +30,16 @@ echo '#{name}' > /etc/mailname # Restart networking and force new DHCP - if [ test -f /etc/init.d/hostname.sh ]; then - invoke-rc.d hostname.sh start + if test -f /etc/init.d/hostname.sh; then + invoke-rc.d hostname.sh start || true fi - if [ test -f /etc/init.d/networking ]; then - invoke-rc.d networking force-reload + if test -f /etc/init.d/networking; then + invoke-rc.d networking force-reload || true fi - if [ test -f /etc/init.d/network-manager ]; then - invoke-rc.d network-manager force-reload + if test -f /etc/init.d/network-manager; then + invoke-rc.d network-manager force-reload || true fi EOH end
guests/debian: Exit on error when configuring hostname
diff --git a/Casks/reveal.rb b/Casks/reveal.rb index abc1234..def5678 100644 --- a/Casks/reveal.rb +++ b/Casks/reveal.rb @@ -6,7 +6,7 @@ appcast 'http://download.revealapp.com/reveal-release.xml' name 'Reveal' homepage 'http://revealapp.com/' - license :unknown # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder + license :commercial app 'Reveal.app' end
Set Reveal license to commercial
diff --git a/lib/goodyear/railtie.rb b/lib/goodyear/railtie.rb index abc1234..def5678 100644 --- a/lib/goodyear/railtie.rb +++ b/lib/goodyear/railtie.rb @@ -1,16 +1,26 @@ module Goodyear class Railtie < Rails::Railtie + include ActionView::Helpers::NumberHelper + def time_diff(start, finish) + begin + ((finish.to_time - start.to_time) * 1000).to_s(:rounded, precision: 5, strip_insignificant_zeros: true) + rescue + number_with_precision((finish.to_time - start.to_time) * 1000, precision: 5, strip_insignificant_zeros: true) + end + end + ActiveSupport::Notifications.subscribe 'query.elasticsearch' do |name, start, finish, id, payload| - Rails.logger.debug(["#{payload[:name]}".bright, "(#{((finish.to_time - start.to_time) * 1000).to_s(:rounded, precision: 5, strip_insignificant_zeros: true)}ms)",payload[:query], id].join(" ").color(:yellow)) + Rails.logger.debug(["#{payload[:name]}".bright, "(#{time_diff(start,finish)}ms)",payload[:query]].join(" ").color(:yellow)) end ActiveSupport::Notifications.subscribe 'cache.query.elasticsearch' do |name, start, finish, id, payload| - Rails.logger.debug(["#{payload[:name]}".bright, "CACHE".color(:magenta).bright ,"(#{((finish.to_time - start.to_time) * 1000).to_s(:rounded, precision: 5, strip_insignificant_zeros: true)}ms)",id].join(" ").color(:yellow)) + Rails.logger.debug(["#{payload[:name]}".bright, "CACHE".color(:magenta).bright ,"(#{time_diff(start,finish)}ms)"].join(" ").color(:yellow)) end initializer 'goodyear.set_defaults' do config.goodyear_cache_store = :redis_store - config.goodyear_expire_cache_in = 1.minute + config.goodyear_expire_cache_in = 15.minutes + config.goodyear_perform_caching = true end end
Fix for activesupport < 4.0
diff --git a/lib/insensitive_load.rb b/lib/insensitive_load.rb index abc1234..def5678 100644 --- a/lib/insensitive_load.rb +++ b/lib/insensitive_load.rb @@ -19,8 +19,7 @@ collector(*args).files end - def values( - *args) + def values(*args) collector(*args).values end end
Make a clean code in InsensitiveLoad InsensitiveLoad ---- - Make a clean code at argument definition of InsensitiveLoad.values.
diff --git a/app/controllers/article_controller.rb b/app/controllers/article_controller.rb index abc1234..def5678 100644 --- a/app/controllers/article_controller.rb +++ b/app/controllers/article_controller.rb @@ -33,11 +33,9 @@ end def update - t = Article.find(params[:id]) - t.link = params[:link] - t.author = params[:author] - t.quote = params[:quote] - if t.save! + temp = Article.find(params[:id]) + params.keys.each { |key| temp[key] = params[key] if Article.column_names.include?(key) } + if temp.save! redirect_to root_path, notice: "Article updated!" else redirect_to root_path, alert: "Couldn't update that article, try again later."
Use the same oneliner in the update function Signed-off-by: Siddharth Kannan <[email protected]>
diff --git a/lib/mongoff/selector.rb b/lib/mongoff/selector.rb index abc1234..def5678 100644 --- a/lib/mongoff/selector.rb +++ b/lib/mongoff/selector.rb @@ -5,5 +5,9 @@ value = serializer.evolve_hash(value) super end + + def multi_selection?(key) + %w($and $or $nor).include?(key.to_s) + end end end
Fix how Selector.multi_selection? handles symbols
diff --git a/dashboard/app/controllers/refinery/admin/dashboard_controller.rb b/dashboard/app/controllers/refinery/admin/dashboard_controller.rb index abc1234..def5678 100644 --- a/dashboard/app/controllers/refinery/admin/dashboard_controller.rb +++ b/dashboard/app/controllers/refinery/admin/dashboard_controller.rb @@ -24,7 +24,11 @@ y.updated_at <=> x.updated_at }.first(activity_show_limit=::Refinery::Setting.find_or_set(:activity_show_limit, 7)) - @recent_inquiries = defined?(Inquiry) ? Inquiry.latest(activity_show_limit) : [] + @recent_inquiries = if Refinery::Plugins.active.detect {|p| p.name == "refinery_inquiries"} + Inquiry.latest(activity_show_limit) + else + [] + end end def disable_upgrade_message
Check active plugin array for inquiries plugin.
diff --git a/lib/nicorepo/reports.rb b/lib/nicorepo/reports.rb index abc1234..def5678 100644 --- a/lib/nicorepo/reports.rb +++ b/lib/nicorepo/reports.rb @@ -16,14 +16,15 @@ end def fetch(request_num, limit_page) - @reports = fetch_recursively(request_num, limit_page) - end - - def fetch_and_select_with(filter, request_num, limit_page) + filter = selected_kind @reports = fetch_recursively(request_num, limit_page, filter) end private + + def selected_kind + nil + end def fetch_recursively(request_num, limit_page, filter = nil, url = TOP_URL) return [] unless limit_page > 0 @@ -43,14 +44,18 @@ end class VideoReports < Reports - def fetch(request_num, limit_page) - fetch_and_select_with('video-upload', request_num, limit_page) + private + + def selected_kind + 'video-upload' end end class LiveReports < Reports - def fetch(request_num, limit_page) - fetch_and_select_with('live', request_num, limit_page) + private + + def selected_kind + 'live' end end end
Clarify differences of selecting kind filter
diff --git a/dayglo.gemspec b/dayglo.gemspec index abc1234..def5678 100644 --- a/dayglo.gemspec +++ b/dayglo.gemspec @@ -17,8 +17,6 @@ s.files = Dir['lib/**/*'] + ['LICENSE', 'README.md'] s.test_files = Dir['spec/**/*'] - s.add_dependency 'require_all', '~> 1.3.0' - s.add_development_dependency 'rake', '~> 10.3.0' s.add_development_dependency 'rspec', '~> 3.0.0' end
Remove the require_all dependency as it adds complexity/magic
diff --git a/ReactNativePermissions.podspec b/ReactNativePermissions.podspec index abc1234..def5678 100644 --- a/ReactNativePermissions.podspec +++ b/ReactNativePermissions.podspec @@ -18,4 +18,5 @@ s.preserve_paths = 'LICENSE', 'package.json' s.source_files = '**/*.{h,m}' s.exclude_files = 'example/**/*' + s.dependency 'React' end
Cocoapods: Fix issue <React/RCTConvert.h> not found See #191. Fixes issue <React/RCTConvert.h> by adding the missing dependency.
diff --git a/templates/api_define.rb b/templates/api_define.rb index abc1234..def5678 100644 --- a/templates/api_define.rb +++ b/templates/api_define.rb @@ -2,12 +2,13 @@ module Aliyun::Openapi Core::ApiDSL.define('openapi').<%= @product %>(version: '<%= @version %>').<%=@api_name%>.end_point do |end_point| - <% @api_params.each do |param| %><% rest_param = param.reject {|k,v| ['tagName', 'type', 'required'].include? k} %> - end_point.param <%= ":'#{param['tagName']}', :#{param['type']}, #{param['required']}, #{rest_param}" %> - <% end %> - end_point.methods = <%= @api_detail['isvProtocol']['method'].split('|').to_s %> - <% if @api_detail['isvProtocol']['pattern'] %> - end_point.pattern = "<%= @api_detail['isvProtocol']['pattern'] %>" - <% end %> +<% @api_params.each do |param| %><% rest_param = param.reject {|k,v| ['tagName', 'type', 'required'].include?(k) || v.empty? } %> + end_point.param <%= ":'#{param['tagName']}', :#{param['type']}, #{param['required']}, #{rest_param}" %><% end %> + # end point methods + end_point.methods = <%= @api_detail['isvProtocol']['method'].split('|').to_s %> + <% if @api_detail['isvProtocol']['pattern'] %> + # pattern to build url combine with params + end_point.pattern = "<%= @api_detail['isvProtocol']['pattern'] %>" + <% end %> end -end+end
Format api end point and remove empty params such as value switch
diff --git a/google-cloud-video_intelligence/google-cloud-video_intelligence.gemspec b/google-cloud-video_intelligence/google-cloud-video_intelligence.gemspec index abc1234..def5678 100644 --- a/google-cloud-video_intelligence/google-cloud-video_intelligence.gemspec +++ b/google-cloud-video_intelligence/google-cloud-video_intelligence.gemspec @@ -21,8 +21,6 @@ gem.required_ruby_version = ">= 2.0.0" gem.add_dependency "google-gax", "~> 1.0" - gem.add_dependency "googleapis-common-protos", "~> 1.3.1" - gem.add_dependency "googleauth", "~> 0.6.1" gem.add_development_dependency "minitest", "~> 5.10" gem.add_development_dependency "rubocop", "<= 0.35.1"
Remove some dependencies that can be pulled in transitively via GAX
diff --git a/ruby/subscription-with-metadata.rb b/ruby/subscription-with-metadata.rb index abc1234..def5678 100644 --- a/ruby/subscription-with-metadata.rb +++ b/ruby/subscription-with-metadata.rb @@ -0,0 +1,30 @@+# Testing creating a subscription with metadata (custom fields) + +gem 'chargify_api_ares', '=1.4.7' +require 'chargify_api_ares' + +Chargify.configure do |c| + c.subdomain = ENV['CHARGIFY_SUBDOMAIN'] + c.api_key = ENV['CHARGIFY_API_KEY'] +end + +subscription = Chargify::Subscription.create( + product_handle: 'monthly-plan', + customer_attributes: { + first_name: "Test807", + last_name: "Customer1004", + email: "[email protected]" + }, + credit_card_attributes: { + card_number: 4242424242424242, + cvv: 123, + expiration_month: 3, + expiration_year: 2020 + }, + metafields: { + color: "blue", + size: "large" + } +) + +puts subscription.inspect
Add example of creating a subscription with metadata using the Ruby gem
diff --git a/ostrichPoll.gemspec b/ostrichPoll.gemspec index abc1234..def5678 100644 --- a/ostrichPoll.gemspec +++ b/ostrichPoll.gemspec @@ -1,5 +1,5 @@ # -*- encoding: utf-8 -*- -require File.expand_path('../lib/ostrichPoll/version', __FILE__) +require File.expand_path('../lib/ostrichpoll/version', __FILE__) Gem::Specification.new do |gem| gem.authors = ["Wiktor Macura"]
Fix version path for case sensitive FSes
diff --git a/patchstream.gemspec b/patchstream.gemspec index abc1234..def5678 100644 --- a/patchstream.gemspec +++ b/patchstream.gemspec @@ -8,8 +8,8 @@ spec.version = Patchstream::VERSION spec.authors = ["opsb"] spec.email = ["[email protected]"] - spec.description = %q{TODO: Write a gem description} - spec.summary = %q{TODO: Write a gem summary} + spec.description = %q{Emits json patches when active records are updated} + spec.summary = %q{Emits json patches when active records are updated} spec.homepage = "" spec.license = "MIT"
Add description and summary to gemspec
diff --git a/lib/stacks/inventory.rb b/lib/stacks/inventory.rb index abc1234..def5678 100644 --- a/lib/stacks/inventory.rb +++ b/lib/stacks/inventory.rb @@ -1,16 +1,12 @@ class Stacks::Inventory def initialize(stack_dir) + stack_file = "#{stack_dir}/stack.rb" + raise "no stack.rb found in #{stack_dir}" unless File.exist? stack_file + @stacks = Object.new @stacks.extend Stacks::DSL - Dir.glob("#{stack_dir}/*.rb").each do |stack_file| - begin - @stacks.instance_eval(IO.read("#{stack_dir}/#{stack_file}"), "#{stack_dir}/#{stack_file}") - rescue - backtrace = [email protected]("\n") - raise "Unable to instance_eval #{stack_file}\n#{$!}\n#{backtrace}" - end - end + @stacks.instance_eval(IO.read(stack_file), stack_file) end def find(fqdn)
Revert "rpearce: Adding support for multiple stackbuilder-config files" This reverts commit d48cb6eda2b31f7304b26b30f867264082231c1a.
diff --git a/spec/disclosure/configuration_spec.rb b/spec/disclosure/configuration_spec.rb index abc1234..def5678 100644 --- a/spec/disclosure/configuration_spec.rb +++ b/spec/disclosure/configuration_spec.rb @@ -30,7 +30,7 @@ end it "should have a default for reactor classes" do - subject.reactor_classes.should eq [] + subject.reactor_classes.should eq [Disclosure::EmailReactor] end it "should have a default for email reactor defaults" do
Update spec for new default configuration
diff --git a/spec/interactors/user_deposit_spec.rb b/spec/interactors/user_deposit_spec.rb index abc1234..def5678 100644 --- a/spec/interactors/user_deposit_spec.rb +++ b/spec/interactors/user_deposit_spec.rb @@ -6,6 +6,7 @@ let(:interactor) {UserDeposit.new(user_id: user.id, amount: 1000)} let(:context) {interactor.context} + context 'when everything is swell' do it 'succeeds' do interactor.call expect(context).to be_a_success @@ -19,5 +20,6 @@ it 'creates a transaction' do expect {interactor.call}.to change(Transaction, :count).by(1) end + end end end
Add a context for user_deposit specs
diff --git a/app/api/shopt/api.rb b/app/api/shopt/api.rb index abc1234..def5678 100644 --- a/app/api/shopt/api.rb +++ b/app/api/shopt/api.rb @@ -38,9 +38,18 @@ end resource :products do - desc 'Returns all products' - get do - Product.all + desc 'Returns quantity sold per month' + params do + requires :id, type: Integer, desc: 'Product ID.' + optional :per, type: String, desc: 'Time interval', + default: 'month', values: ['day', 'week', 'month'] + optional :starting, type: Date, desc: 'Beginning date', default: Date.today - 1.year + optional :ending, type: Date, desc: 'Ending date', default: Date.today + end + route_param :id do + get do + Product.find(params[:id]).sold(per: params[:per], starting: params[:starting], ending: params[:ending]) + end end end
Add endpoint for period quantity sold in range
diff --git a/spec/requests/index_districts_spec.rb b/spec/requests/index_districts_spec.rb index abc1234..def5678 100644 --- a/spec/requests/index_districts_spec.rb +++ b/spec/requests/index_districts_spec.rb @@ -3,10 +3,12 @@ describe "GET /districts", type: :request do let(:user) { create :user } let(:auth) { {"X-Barcelona-Token" => user.token} } - let(:district) { create :district } + let!(:district) { create :district } it "lists districts" do - get "/v1/districts/#{district.name}", nil, auth + get "/v1/districts", nil, auth expect(response.status).to eq 200 + districts = JSON.load(response.body)["districts"] + expect(districts.count).to eq 1 end end
Fix index districts request spec
diff --git a/spec/ruby/core/kernel/at_exit_spec.rb b/spec/ruby/core/kernel/at_exit_spec.rb index abc1234..def5678 100644 --- a/spec/ruby/core/kernel/at_exit_spec.rb +++ b/spec/ruby/core/kernel/at_exit_spec.rb @@ -14,6 +14,12 @@ code = "at_exit {print 4};at_exit {print 5}; print 6; at_exit {print 7}" ruby_exe(code).should == "6754" end + + it "allows calling exit inside at_exit handler" do + code = "at_exit {print 3}; at_exit {print 4; exit; print 5}; at_exit {print 6}" + ruby_exe(code).should == "643" + end + end describe "Kernel#at_exit" do
Add spec for calling exit inside at_exit handler
diff --git a/NSData+ImageMIMEDetection.podspec b/NSData+ImageMIMEDetection.podspec index abc1234..def5678 100644 --- a/NSData+ImageMIMEDetection.podspec +++ b/NSData+ImageMIMEDetection.podspec @@ -0,0 +1,15 @@+Pod::Spec.new do |s| + s.name = "NSData+ImageMIMEDetection" + s.version = "0.1.0" + s.summary = "Category on NSData to check if it represents PNG or JPEG." + s.homepage = "https://github.com/talk-to/NSData-ImageMIMEDetection" + s.license = { :type => 'COMMERCIAL', :text => 'Property of Talk.to FZC' } + s.author = 'Talk.to' + s.source = { :git => "http://EXAMPLE/NAME.git", :tag => s.version.to_s } + + s.ios.deployment_target = '7.0' + s.requires_arc = true + + s.source_files = 'NSData+ImageMIMEDetection/*.{h,m}' + s.public_header_files = 'NSData+ImageMIMEDetection/*.h' +end
Add podspec file with valid details
diff --git a/example/app.rb b/example/app.rb index abc1234..def5678 100644 --- a/example/app.rb +++ b/example/app.rb @@ -11,7 +11,7 @@ require 'omniauth-google-oauth2' require 'omniauth-github' -require_relative 'config_env' +load "#{__dir__}/config_env" require_relative 'config_app' helpers do
Prepare to CI Capybara.default_wait_time = 15
diff --git a/config/routes.rb b/config/routes.rb index abc1234..def5678 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,62 +1,12 @@ Rails.application.routes.draw do - resources :papers + + resources :activities do + resources :papers + end + devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" } as :user do get 'users/edit' => 'users/registrations#edit', :as => 'edit_user_registration' put 'users' => 'users/registrations#update', :as => 'user_registration' end - # The priority is based upon order of creation: first created -> highest priority. - # See how all your routes lay out with "rake routes". - - # You can have the root of your site routed with "root" - # root 'welcome#index' - - # Example of regular route: - # get 'products/:id' => 'catalog#view' - - # Example of named route that can be invoked with purchase_url(id: product.id) - # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase - - # Example resource route (maps HTTP verbs to controller actions automatically): - # resources :products - - # Example resource route with options: - # resources :products do - # member do - # get 'short' - # post 'toggle' - # end - # - # collection do - # get 'sold' - # end - # end - - # Example resource route with sub-resources: - # resources :products do - # resources :comments, :sales - # resource :seller - # end - - # Example resource route with more complex sub-resources: - # resources :products do - # resources :comments - # resources :sales do - # get 'recent', on: :collection - # end - # end - - # Example resource route with concerns: - # concern :toggleable do - # post 'toggle' - # end - # resources :posts, concerns: :toggleable - # resources :photos, concerns: :toggleable - - # Example resource route within a namespace: - # namespace :admin do - # # Directs /admin/products/* to Admin::ProductsController - # # (app/controllers/admin/products_controller.rb) - # resources :products - # end end
Add nested path for activities and papers
diff --git a/app/controllers/user_sessions_controller.rb b/app/controllers/user_sessions_controller.rb index abc1234..def5678 100644 --- a/app/controllers/user_sessions_controller.rb +++ b/app/controllers/user_sessions_controller.rb @@ -14,7 +14,7 @@ flash[:notice] = "You have been signed in." redirect_back_or_default account_url else - flash[:warning] = "There is an issue with your credentials." + flash[:warning] = @user_session.errors.full_messages render :action => :new end end
[Foundation] Fix error messages on login to be more better.
diff --git a/config/routes.rb b/config/routes.rb index abc1234..def5678 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,7 @@ Rails.application.routes.draw do root to: 'welcome#index' + resources :users, only: [:show] get '/login', :to => 'sessions#new', :as => :login get '/logout', :to => 'sessions#destroy', :as => :logout
Add route for user show page
diff --git a/tinplate.gemspec b/tinplate.gemspec index abc1234..def5678 100644 --- a/tinplate.gemspec +++ b/tinplate.gemspec @@ -19,7 +19,7 @@ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] - spec.add_dependency "faraday", "~> 0.9.2" + spec.add_dependency "faraday", [">= 0.9.2", "< 1.0.0"] spec.add_development_dependency "bundler", "~> 1.10" spec.add_development_dependency "rake", "~> 10.0"
Allow newer versions of faraday dependency.
diff --git a/lib/user_preferences.rb b/lib/user_preferences.rb index abc1234..def5678 100644 --- a/lib/user_preferences.rb +++ b/lib/user_preferences.rb @@ -14,7 +14,7 @@ class << self def [](category, name) - if pref = definitions[category].try(:[], name) + unless (pref = definitions[category].try(:[], name)).nil? PreferenceDefinition.new(pref, category, name) end end
Test explicitely for nil, not falsey
diff --git a/lib/veewee/providers.rb b/lib/veewee/providers.rb index abc1234..def5678 100644 --- a/lib/veewee/providers.rb +++ b/lib/veewee/providers.rb @@ -1,32 +1,31 @@ module Veewee + class Providers + def initialize(env, options = {}) + @env=env + @options=options + @providers=Hash.new + end - class Providers - def initialize(env, options) - @env=env - @options=options - @providers=Hash.new - end + def [](name) + return @providers[name] if @providers.has_key?(name) - def [](name) - return @providers[name] if @providers.has_key?(name) + begin + require_path='veewee/provider/'+name.to_s.downcase+"/provider" + require require_path - begin - require_path='veewee/provider/'+name.to_s.downcase+"/provider" - require require_path + provider=Object.const_get("Veewee").const_get("Provider").const_get(name.to_s.capitalize).const_get("Provider").new(name,@options,@env) - provider=Object.const_get("Veewee").const_get("Provider").const_get(name.to_s.capitalize).const_get("Provider").new(name,@options,@env) + @providers[name]=provider + rescue ::Veewee::Error => e + raise + rescue Error => e + env.ui.error "Error loading provider with #{name},#{$!}",:prefix => false + end + end - @providers[name]=provider - rescue ::Veewee::Error => e - raise - rescue Error => e - env.ui.error "Error loading provider with #{name},#{$!}",:prefix => false - end - end - - def length - @providers.length - end + def length + @providers.length + end end end #Module Veewee
Initialize option parameter in Providers
diff --git a/cassandra/lib/flow/cassandra/local.rb b/cassandra/lib/flow/cassandra/local.rb index abc1234..def5678 100644 --- a/cassandra/lib/flow/cassandra/local.rb +++ b/cassandra/lib/flow/cassandra/local.rb @@ -4,7 +4,7 @@ def addresses @local_addresses ||= begin if RUBY_VERSION['2.1'] - Socket.getifaddrs.map(&:addr).select(&:ip?).map(&:ip_address) + Socket.getifaddrs.map(&:addr).compact.select(&:ip?).map(&:ip_address) else require 'system/getifaddrs' System.get_ifaddrs.values.map {|it| it[:inet_addr] }
Fix edge case with getifaddrs
diff --git a/app/models/campus.rb b/app/models/campus.rb index abc1234..def5678 100644 --- a/app/models/campus.rb +++ b/app/models/campus.rb @@ -9,6 +9,7 @@ validates :name, presence: true, uniqueness: true validates :mode, presence: true validates :abbreviation, presence: true, uniqueness: true + validates :active, presence: true after_destroy :invalidate_cache after_save :invalidate_cache
ENHANCE: Validate that active is present
diff --git a/rails_event_store-rspec/lib/rails_event_store/rspec/have_published.rb b/rails_event_store-rspec/lib/rails_event_store/rspec/have_published.rb index abc1234..def5678 100644 --- a/rails_event_store-rspec/lib/rails_event_store/rspec/have_published.rb +++ b/rails_event_store-rspec/lib/rails_event_store/rspec/have_published.rb @@ -10,7 +10,7 @@ def matches?(event_store) @events = stream_name ? event_store.read_events_backward(stream_name) : event_store.read_all_streams_backward - @matcher.matches?(events) && matches_count(events, expected, count) + @matcher.matches?(events) && matches_count? end def exactly(count) @@ -38,7 +38,7 @@ private - def matches_count(events, expected, count) + def matches_count? return true unless count raise NotSupported if expected.size > 1
Kill passing ivars as local vars Issue: #215
diff --git a/lib/upnp/control_point/base.rb b/lib/upnp/control_point/base.rb index abc1234..def5678 100644 --- a/lib/upnp/control_point/base.rb +++ b/lib/upnp/control_point/base.rb @@ -24,6 +24,7 @@ log "<#{self.class}> Connection count: #{EM.connection_count}" log "<#{self.class}> Request error: #{http.error}" log "<#{self.class}> Response status: #{http.response_header.status}" + description_getter.set_deferred_status(:failed) if ControlPoint.raise_on_remote_error raise ControlPoint::Error, "Unable to retrieve DDF from #{location}"
Set deferred status on failure
diff --git a/spec/clamshell/dsl/project_spec.rb b/spec/clamshell/dsl/project_spec.rb index abc1234..def5678 100644 --- a/spec/clamshell/dsl/project_spec.rb +++ b/spec/clamshell/dsl/project_spec.rb @@ -15,7 +15,7 @@ it "should create a Git dependency" do create_repo("/tmp/repo") - @project.git("/tmp/repo/.git", :ref => "12345") + @project.git("/tmp/repo", :ref => "12345") @project.instance_variable_get(:@dependencies).one? do |d| d.class == Clamshell::Git end.should be_true
Make it more obvious we're referenceing a non-bare repository.
diff --git a/spec/commands/read_command_spec.rb b/spec/commands/read_command_spec.rb index abc1234..def5678 100644 --- a/spec/commands/read_command_spec.rb +++ b/spec/commands/read_command_spec.rb @@ -26,7 +26,7 @@ end describe 'tells translator to' do - let(:translator) { MiniTest::Mock.new FakeTranslator.new } + let(:translator) { MiniTest::Mock.new } it 'execute the command' do translator.expect :execute_command, nil, [commands['foo']] @@ -44,7 +44,7 @@ end describe 'tells translator to' do - let(:translator) { MiniTest::Mock.new FakeTranslator.new } + let(:translator) { MiniTest::Mock.new } it 'pop' do translator.expect :pop, nil
Remove delegate from ReadCommand spec mocks
diff --git a/spec/lib/tracked_revisions_spec.rb b/spec/lib/tracked_revisions_spec.rb index abc1234..def5678 100644 --- a/spec/lib/tracked_revisions_spec.rb +++ b/spec/lib/tracked_revisions_spec.rb @@ -0,0 +1,31 @@+# frozen_string_literal: true + +require 'rails_helper' +require_dependency "#{Rails.root}/lib/analytics/course_statistics.rb" + +describe 'TrackedRevisions' do + let(:course) { create(:course, start: '30-05-2019'.to_date, end: '31-07-2019'.to_date) } + let(:user) { create(:user, username: 'Textorus') } + + before do + course.students << user + end + + it 'fetches the course stats for only tracked articles' do + VCR.use_cassette 'course_upload_importer/Textorus' do + UpdateCourseStats.new(course) + end + subject = CourseStatistics.new([course.id]).report_statistics + expect(subject[:articles_edited]).to eq(151) + expect(subject[:characters_added]).to eq(7680) + course.articles_courses.take(10).each do |article_course| + article_course.update(tracked: false) + end + VCR.use_cassette 'course_upload_importer/Textorus' do + UpdateCourseStats.new(course) + end + subject = CourseStatistics.new([course.id]).report_statistics + expect(subject[:articles_edited]).to be < 151 + expect(subject[:characters_added]).to be < 7680 + end +end
Create a separate spec for tracked revisions functionality
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index abc1234..def5678 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -7,8 +7,6 @@ def current_project @current_project = if session[:project_id] current_user.projects.find(session[:project_id]) - else - current_user.projects.first end end
Fix no projects for current project bug
diff --git a/falcor.gemspec b/falcor.gemspec index abc1234..def5678 100644 --- a/falcor.gemspec +++ b/falcor.gemspec @@ -22,7 +22,5 @@ spec.add_development_dependency 'bundler', '~> 1.3' spec.add_development_dependency 'rake' - spec.add_development_dependency 'pry' - spec.add_development_dependency 'pry-debugger' spec.add_development_dependency 'rspec' end
Remove pry; debugger not available on JRuby
diff --git a/em-winrm.gemspec b/em-winrm.gemspec index abc1234..def5678 100644 --- a/em-winrm.gemspec +++ b/em-winrm.gemspec @@ -13,6 +13,7 @@ s.homepage = "http://github.com/schisamo/em-winrm" s.summary = %q{EventMachine based, asynchronous parallel WinRM client} s.description = s.summary + s.license = "Apache-2.0" s.required_ruby_version = '>= 1.9.1' s.add_dependency "eventmachine", "~> 1.0.0"
Add license to gemspec with SPDX compliant identifier Closes #15
diff --git a/app/models/manufacturer.rb b/app/models/manufacturer.rb index abc1234..def5678 100644 --- a/app/models/manufacturer.rb +++ b/app/models/manufacturer.rb @@ -22,7 +22,7 @@ def volume # returns 0 instead of nil when Manufacturer exists without any donations - donations.map { |d| d.line_items.total }.reduce(:+) || 0 + donations.joins(:line_items).sum(:quantity) end def self.by_donation_count(count = 10)
Use ActiveRecord instead of Ruby Enumerables to compute volume, as per @armahillo's recommendation.
diff --git a/config/initializers/gds-sso.rb b/config/initializers/gds-sso.rb index abc1234..def5678 100644 --- a/config/initializers/gds-sso.rb +++ b/config/initializers/gds-sso.rb @@ -2,5 +2,5 @@ config.user_model = "User" config.oauth_id = 'abcdefgh12345678' config.oauth_secret = 'secret' - config.oauth_root_url = Plek.current.find("authentication") + config.oauth_root_url = Plek.current.find("signon") end
Remove reference to 'authentication' when calling Plek This was more unnecessary indirection, let's just use signon.
diff --git a/config/initializers/gds-sso.rb b/config/initializers/gds-sso.rb index abc1234..def5678 100644 --- a/config/initializers/gds-sso.rb +++ b/config/initializers/gds-sso.rb @@ -3,7 +3,7 @@ config.oauth_id = 'abcdefgh12345678pan' config.oauth_secret = 'secret' config.default_scope = "Panopticon" - config.oauth_root_url = Plek.current.find("authentication") + config.oauth_root_url = Plek.current.find("signon") config.basic_auth_user = 'api' config.basic_auth_password = 'defined_on_rollout_not' end
Remove reference to 'authentication' when calling Plek This was more unnecessary indirection, let's just use signon.
diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index abc1234..def5678 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -1,5 +1,5 @@ schedule_file = "config/schedule.yml" if File.exists?(schedule_file) && Sidekiq.server? - Sidekiq::Cron::Job.load_from_hash YAML.load_file(schedule_file) + Sidekiq::Cron::Job.load_from_hash! YAML.load_file(schedule_file) end
Load jobs and get rid of jobs no longer in the schedule file
diff --git a/fakefs.gemspec b/fakefs.gemspec index abc1234..def5678 100644 --- a/fakefs.gemspec +++ b/fakefs.gemspec @@ -19,6 +19,6 @@ spec.require_paths = ["lib"] spec.add_development_dependency "bundler", "~> 1.3" - spec.add_development_dependency "rake" - spec.add_development_dependency "rspec" + spec.add_development_dependency "rake", "~> 10.1" + spec.add_development_dependency "rspec", "~> 2.14" end
Add versions for the development dependencies. Addresses #217.
diff --git a/spec/char_cover/exception_else.rb b/spec/char_cover/exception_else.rb index abc1234..def5678 100644 --- a/spec/char_cover/exception_else.rb +++ b/spec/char_cover/exception_else.rb @@ -1,5 +1,5 @@ ### Without rescue -#### With raise +#### With raise (Ruby <2.6) begin raise @@ -9,7 +9,7 @@ #>X end rescue nil -#### With raise in else +#### With raise in else (Ruby <2.6) begin "here" @@ -19,7 +19,7 @@ #>X end -#### Without raise +#### Without raise (Ruby <2.6) begin "here" @@ -65,13 +65,15 @@ end ### Empty parts -#### With empty begin +#### With empty begin without rescue (Ruby <2.6) begin else "here" end + +#### With empty begin with rescue begin rescue
Exclude begin-else without rescue from 2.6 tests
diff --git a/spec/integration/migrator_test.rb b/spec/integration/migrator_test.rb index abc1234..def5678 100644 --- a/spec/integration/migrator_test.rb +++ b/spec/integration/migrator_test.rb @@ -0,0 +1,33 @@+require File.join(File.dirname(__FILE__), 'spec_helper.rb') + +Sequel.extension :migration +describe Sequel::Migrator do + before do + @db = INTEGRATION_DB + @m = Sequel::Migrator + @dir = 'spec/files/integer_migrations' + end + after do + [:schema_info, :sm1111, :sm2222, :sm3333].each{|n| @db.drop_table(n) rescue nil} + end + + specify "should be able to migrate up and down all the way successfully" do + @m.apply(@db, @dir) + [:schema_info, :sm1111, :sm2222, :sm3333].each{|n| @db.table_exists?(n).should be_true} + @db[:schema_info].get(:version).should == 3 + @m.apply(@db, @dir, 0) + [:sm1111, :sm2222, :sm3333].each{|n| @db.table_exists?(n).should be_false} + @db[:schema_info].get(:version).should == 0 + end + + specify "should be able to migrate up and down to specific versions successfully" do + @m.apply(@db, @dir, 2) + [:schema_info, :sm1111, :sm2222].each{|n| @db.table_exists?(n).should be_true} + @db.table_exists?(:sm3333).should be_false + @db[:schema_info].get(:version).should == 2 + @m.apply(@db, @dir, 1) + [:sm2222, :sm3333].each{|n| @db.table_exists?(n).should be_false} + @db.table_exists?(:sm1111).should be_true + @db[:schema_info].get(:version).should == 1 + end +end
Add integration tests for the migrator
diff --git a/fuubar.gemspec b/fuubar.gemspec index abc1234..def5678 100644 --- a/fuubar.gemspec +++ b/fuubar.gemspec @@ -29,5 +29,5 @@ s.require_paths = ['lib'] s.add_dependency 'rspec', '~> 2.0' - s.add_dependency 'ruby-progressbar', '~> 1.0' + s.add_dependency 'ruby-progressbar', '~> 1.3' end
Upgrade ruby-progressbar to the latest version
diff --git a/db/migrate/20170518100414_remove_extra_fields_field_from_section_editions.rb b/db/migrate/20170518100414_remove_extra_fields_field_from_section_editions.rb index abc1234..def5678 100644 --- a/db/migrate/20170518100414_remove_extra_fields_field_from_section_editions.rb +++ b/db/migrate/20170518100414_remove_extra_fields_field_from_section_editions.rb @@ -0,0 +1,9 @@+class RemoveExtraFieldsFieldFromSectionEditions < Mongoid::Migration + def self.up + SectionEdition.update_all('$unset' => { 'extra_fields' => true }) + end + + def self.down + raise IrreversibleMigration + end +end
Remove unused extra_fields field from SectionEdition Although this field was removed from the `SectionEdition` model class in this commit [1], many/all of the documents in the `manual_section_editions` collection in MongoDB still had this field set to an empty Hash. The presence of this field seems to have started causing exceptions in production recently [2,3] when a `SectionEdition` is updated. My suspicion is that this is related to the recent upgrade to Mongoid v4, however, I haven't yet investigated that, because I wanted to get a fix into production as soon as possible. I have reproduced both the production exceptions locally using a recent copy of production data. When I run the migration in this commit, the exceptions no longer occur. Thus I'm confident that this is a sensible fix. [1]: 5f18aba14c9cbe60a82ecd8e0bcdb015de90a3fa [2]: https://errbit.publishing.service.gov.uk/apps/57e3ddba6578636ac8300000/problems/591c67566578636e62d53500 [3]: https://errbit.publishing.service.gov.uk/apps/57e3ddba6578636ac8300000/problems/591d4b1c6578636e62fcbf00
diff --git a/lib/blow_pipe/configuration.rb b/lib/blow_pipe/configuration.rb index abc1234..def5678 100644 --- a/lib/blow_pipe/configuration.rb +++ b/lib/blow_pipe/configuration.rb @@ -8,7 +8,7 @@ @@mount_at = '/blowpipe' @@strategy = :transaction - @orm = :active_record + @@orm = :active_record end mattr_accessor :configuration
Correct typo to make orm a module variable
diff --git a/cookbooks/sys_dns/recipes/do_set_private.rb b/cookbooks/sys_dns/recipes/do_set_private.rb index abc1234..def5678 100644 --- a/cookbooks/sys_dns/recipes/do_set_private.rb +++ b/cookbooks/sys_dns/recipes/do_set_private.rb @@ -22,7 +22,7 @@ if ! node.has_key?('cloud') private_ip = "#{local_ip}" else - public_ip = node['cloud']['public_ips'][0] + private_ip = node['cloud']['public_ips'][0] end log "Detected private IP: #{private_ip}"
Fix syntax error in var ref.
diff --git a/lib/mod_rails/platform_info.rb b/lib/mod_rails/platform_info.rb index abc1234..def5678 100644 --- a/lib/mod_rails/platform_info.rb +++ b/lib/mod_rails/platform_info.rb @@ -0,0 +1,78 @@+require 'rbconfig' + +module PlatformInfo # :nodoc: +private + def self.determine_multi_arch_flags + if RUBY_PLATFORM =~ /darwin/ + return "-arch ppc7400 -arch ppc64 -arch i386 -arch x86_64" + else + return "" + end + end + + def self.determine_library_extension + if RUBY_PLATFORM =~ /darwin/ + return "bundle" + else + return "so" + end + end + + def self.env_defined?(name) + return !ENV[name].nil? && !ENV[name] + end + + def self.find_apache2ctl + if env_defined?("APACHE2CTL") + return ENV["APACHE2CTL"] + elsif !`which apache2ctl`.empty? + return "apache2ctl" + elsif !`which apachectl`.empty? + return "apachectl" + else + return nil + end + end + + def self.find_apxs2 + if env_defined?("APXS2") + return ENV["APXS2"] + elsif !`which apxs2`.empty? + return "apxs2" + elsif !`which apxs`.empty? + return "apxs" + else + return nil + end + end + + def self.determine_apr1_info + if `which pkg-config`.empty? + if `which apr-1-config`.empty? + return nil + else + flags = `apr-1-config --cppflags --includes`.strip + libs = `apr-1-config --link-ld`.strip + end + else + flags = `pkg-config --cflags apr-1 apr-util-1`.strip + libs = `pkg-config --libs apr-1 apr-util-1`.strip + end + return [flags, libs] + end + +public + RUBY = Config::CONFIG['bindir'] + '/' + Config::CONFIG['RUBY_INSTALL_NAME'] + MULTI_ARCH_FLAGS = determine_multi_arch_flags + LIBEXT = determine_library_extension + + APACHE2CTL = find_apache2ctl + APXS2 = find_apxs2 + if APXS2.nil? + APXS2_FLAGS = nil + else + APXS2_FLAGS = `#{APXS2} -q CFLAGS`.strip << " -I" << `#{APXS2} -q INCLUDEDIR`.strip + end + + APR1_FLAGS, APR1_LIBS = determine_apr1_info +end
Split most platform-specific autodetection code to a seperate module.
diff --git a/lib/alephant/views/base.rb b/lib/alephant/views/base.rb index abc1234..def5678 100644 --- a/lib/alephant/views/base.rb +++ b/lib/alephant/views/base.rb @@ -18,7 +18,7 @@ def t(key, params = {}) I18n.locale = locale - prefix = /\/([^\/]+)\./.match(template_file)[1] + prefix = /\/([^\/]+)\.mustache/.match(template_file)[1] I18n.translate("#{prefix}.#{key}", params) end
Change regex so it only picks up the filename for the template, as in production the path has 'election-data-renderer.jar' in it so 'election-data-renderer' was picked up
diff --git a/lib/bourgeois/presenter.rb b/lib/bourgeois/presenter.rb index abc1234..def5678 100644 --- a/lib/bourgeois/presenter.rb +++ b/lib/bourgeois/presenter.rb @@ -5,28 +5,36 @@ super(@object = object) end + # Return a String representation of the presenter + the original object def inspect "#<#{self.class} object=#{@object.inspect}>" end + # We need to explicitely define this method because it's not + # catched by the delegator def kind_of?(mod) @object.kind_of?(mod) end + # ActionView::Helpers::FormBuilder needs this def self.model_name klass.model_name end + # ActionView::Helpers::FormBuilder needs this too def self.human_attribute_name(*args) klass.human_attribute_name(*args) end private + # Return the view from where the presenter was created def view @view end + # Return the original object class based on the presenter class name + # We would be able to use `@object.class` but we need this in class methods def self.klass @klass ||= self.name.split(/Presenter$/).first.constantize end
Add a few code comments
diff --git a/lib/warden/strategies/token.rb b/lib/warden/strategies/token.rb index abc1234..def5678 100644 --- a/lib/warden/strategies/token.rb +++ b/lib/warden/strategies/token.rb @@ -1,7 +1,7 @@ require "warden" class Warden::Strategies::Token < ::Warden::Strategies::Base - VERSION = "0.1.1" + VERSION = "0.2.0" attr_reader :id, :token @@ -11,7 +11,9 @@ if request.authorization && request.authorization =~ /^Basic (.*)$/m @id, @token = Base64.decode64($1).split(/:/, 2) else - @id, @token = params[:user_id], params[:token] + uid = config[:user_id_param] || :user_id + token = config[:user_token_param] || :token + @id, @token = params[uid], params[token] end end @@ -21,11 +23,17 @@ def authenticate! user = User.where(id: id).first - if user && secure_compare(user.auth_token) + token = user.send(config[:token_name]) + if user && secure_compare(token) success!(user) else fail!("Invalid user id or token") end + end + + # Returns the configuration data for the default user scope. + def config + env["warden"].config[:scope_defaults][:user][:config] end private
Use Warden configs to handle custom naming schemes
diff --git a/lib/httparty/exceptions.rb b/lib/httparty/exceptions.rb index abc1234..def5678 100644 --- a/lib/httparty/exceptions.rb +++ b/lib/httparty/exceptions.rb @@ -20,6 +20,7 @@ # @param [Net::HTTPResponse] def initialize(response) @response = response + super(response) end end
Add ResponseError response attribute to message
diff --git a/lib/mr_darcy/promise/em.rb b/lib/mr_darcy/promise/em.rb index abc1234..def5678 100644 --- a/lib/mr_darcy/promise/em.rb +++ b/lib/mr_darcy/promise/em.rb @@ -2,7 +2,10 @@ module MrDarcy module Promise - class EM < Thread + class EM < Base + class DeferrableAdapter + include EventMachine::Deferrable + end def initialize *args raise "EventMachine driver is unsupported on JRuby, sorry" if RUBY_ENGINE=='jruby' @@ -10,13 +13,66 @@ ::Thread.new { EventMachine.run } ::Thread.pass until EventMachine.reactor_running? end + deferrable_adapter.callback do |value| + set_value_to value + state_machine_resolve + resolve_child_promise + notify_waiting + end + deferrable_adapter.errback do |value| + set_value_to value + state_machine_reject + reject_child_promise + notify_waiting + end + channel super + end + + def resolve value + deferrable_adapter.set_deferred_status :succeeded, value + end + + def reject value + deferrable_adapter.set_deferred_status :failed, value + end + + def result + wait_if_unresolved + value + end + + def final + wait_if_unresolved + self end private + def notify_waiting + until wait_queue.num_waiting == 0 + wait_queue.push nil + end + end + + def wait_if_unresolved + wait_queue.pop if unresolved? + end + + def wait_queue + @wait_queue ||= Queue.new + end + + def deferrable_adapter + @deferrable_adapter ||= DeferrableAdapter.new + end + def schedule_promise &block - EventMachine.schedule block + EventMachine.defer block + end + + def channel + @channel ||= EventMachine::Channel.new end def generate_child_promise
Rewrite `Promise::EM` to use a proper `EventMachine::Deferrable`.
diff --git a/huddle.gemspec b/huddle.gemspec index abc1234..def5678 100644 --- a/huddle.gemspec +++ b/huddle.gemspec @@ -24,4 +24,5 @@ spec.add_development_dependency "rake", "~> 10.0" spec.add_development_dependency "rspec" spec.add_development_dependency "simplecov" + spec.add_development_dependency "pry" end
Add pry to development dependencies
diff --git a/spec/default/sample_spec.rb b/spec/default/sample_spec.rb index abc1234..def5678 100644 --- a/spec/default/sample_spec.rb +++ b/spec/default/sample_spec.rb @@ -1,13 +1,5 @@ require 'spec_helper' -describe package('pv'), :if => os[:family] == 'darwin' do - it { should be_installed } +describe command('defaults read'), :if => os[:family] == 'darwin' do + its(:exit_status) { should eq 0 } end - -describe port(88) do - it { should be_listening } -end - -describe port(80) do - it { should_not be_listening } -end
Replace tests with super-simple OS X test
diff --git a/spec/factories/miq_group.rb b/spec/factories/miq_group.rb index abc1234..def5678 100644 --- a/spec/factories/miq_group.rb +++ b/spec/factories/miq_group.rb @@ -1,7 +1,8 @@ FactoryGirl.define do factory :miq_group do + guid { MiqUUID.new_guid } + sequence(:description) { |n| "Test Group #{seq_padded_for_sorting(n)}" } - sequence(:guid) { |n| UUIDTools::UUID.parse_int((0x87654321 << 96) + n) } end factory :miq_group_miq_request_approver, :parent => :miq_group do
Simplify guid in MiqGroup factory
diff --git a/spec/support/cannon_test.rb b/spec/support/cannon_test.rb index abc1234..def5678 100644 --- a/spec/support/cannon_test.rb +++ b/spec/support/cannon_test.rb @@ -26,8 +26,15 @@ end def post(path, params = {}) - uri = URI("http://127.0.0.1:#{PORT}#{path}") - @response = MockResponse.new(Net::HTTP.post_form(uri, params)) + post_request(path, Net::HTTP::Post, params) + end + + def put(path, params = {}) + post_request(path, Net::HTTP::Put, params) + end + + def patch(path, params = {}) + post_request(path, Net::HTTP::Patch, params) end def response @@ -35,6 +42,15 @@ end private + + def post_request(path, request_class, params) + uri = URI("http://127.0.0.1:#{PORT}#{path}") + req = request_class.new(uri) + req.set_form_data(params) + @response = MockResponse.new(Net::HTTP.start(uri.hostname, uri.port) do |http| + http.request(req) + end) + end def create_cannon_app app = Cannon::App.new(binding, port: PORT, ip_address: '127.0.0.1')
Add support for put and patch requests in specs
diff --git a/rendered-multi-select.gemspec b/rendered-multi-select.gemspec index abc1234..def5678 100644 --- a/rendered-multi-select.gemspec +++ b/rendered-multi-select.gemspec @@ -14,5 +14,5 @@ s.files = Dir["vendor/assets/javascripts/*.js.coffee", "vendor/assets/stylesheets/*.css.less", "lib/*" "README.md", "MIT-LICENSE"] s.require_paths = ["lib"] - s.add_dependency 'rails', '~> 4.1.15' + s.add_dependency 'rails', '~> 4.x' end
Allow any Rails 4.x version
diff --git a/app/jobs/download_job.rb b/app/jobs/download_job.rb index abc1234..def5678 100644 --- a/app/jobs/download_job.rb +++ b/app/jobs/download_job.rb @@ -8,7 +8,7 @@ FileUtils.rm_rf "tmp/news" system "#{@sys_run} news:get_all" - FileUtils.rm_rf @github_directory + FileUtils.rm_rf "tmp/github" system "#{@sys_run} github:download" end
Replace global variable with string in downloadJob
diff --git a/app/controllers/sha_controller.rb b/app/controllers/sha_controller.rb index abc1234..def5678 100644 --- a/app/controllers/sha_controller.rb +++ b/app/controllers/sha_controller.rb @@ -3,7 +3,7 @@ def index @names = %w( - creator custom-chooser + creator custom-chooser exercises-chooser languages-chooser custom-start-points exercises-start-points languages-start-points avatars differ runner saver )
Add new choosers to sha/index list
diff --git a/app/helpers/award_emoji_helper.rb b/app/helpers/award_emoji_helper.rb index abc1234..def5678 100644 --- a/app/helpers/award_emoji_helper.rb +++ b/app/helpers/award_emoji_helper.rb @@ -4,7 +4,7 @@ if awardable.is_a?(Note) # We render a list of notes very frequently and calling the specific method is a lot faster than the generic one (6.5x) - toggle_award_emoji_namespace_project_note_url(namespace_id: @project.namespace_id, project_id: @project.id, id: awardable.id) + toggle_award_emoji_namespace_project_note_url(namespace_id: @project.namespace, project_id: @project, id: awardable.id) else url_for([:toggle_award_emoji, @project.namespace.becomes(Namespace), @project, awardable]) end
Fix broken award emoji for comments Closes #23506
diff --git a/app/models/concerns/providable.rb b/app/models/concerns/providable.rb index abc1234..def5678 100644 --- a/app/models/concerns/providable.rb +++ b/app/models/concerns/providable.rb @@ -22,7 +22,7 @@ end def provider=(value) - super(value.slice(:vendor, :name, :id, :data)) + super(value&.slice(:vendor, :name, :id, :data)) end def provider
Fix pnv controller test. Provider setter should respect nil
diff --git a/features/step_definitions/troo_steps.rb b/features/step_definitions/troo_steps.rb index abc1234..def5678 100644 --- a/features/step_definitions/troo_steps.rb +++ b/features/step_definitions/troo_steps.rb @@ -1,5 +1,5 @@ Given(/^the Trello API is stubbed with "(.*?)"$/) do |stub| - VCR.insert_cassette(stub) + VCR.insert_cassette(stub, allow_playback_repeats: true) end Then(/^the output should be the version number of troo$/) do
Allow cassette re-use in integration tests.
diff --git a/resources/domain.rb b/resources/domain.rb index abc1234..def5678 100644 --- a/resources/domain.rb +++ b/resources/domain.rb @@ -20,12 +20,9 @@ actions :create, :destroy attribute :domain_name, :kind_of => String, :name_attribute => true -attribute :tune_gc, :kind_of => [TrueClass, FalseClass], :default => true attribute :max_memory, :kind_of => Integer, :default => 512 attribute :max_perm_size, :kind_of => Integer, :default => 96 attribute :max_stack_size, :kind_of => Integer, :default => 128 -attribute :max_stack_size, :kind_of => Integer, :default => 128 -attribute :jvm_options, :kind_of => Array, :default => [] def initialize( *args ) super
Remove some attributes that are no longer used
diff --git a/Gemfiler.gemspec b/Gemfiler.gemspec index abc1234..def5678 100644 --- a/Gemfiler.gemspec +++ b/Gemfiler.gemspec @@ -12,7 +12,7 @@ gem.files = `git ls-files`.split($\) gem.executables = `git ls-files -- exe/*`.split("\n").map{ |f| File.basename(f) } gem.test_files = gem.files.grep(%r{^spec/}) - gem.name = "Gemfiler" + gem.name = "gemfiler" gem.require_paths = ["lib"] gem.version = Gemfiler::VERSION
Update name to not be uppercase.
diff --git a/irc-hipchat.rb b/irc-hipchat.rb index abc1234..def5678 100644 --- a/irc-hipchat.rb +++ b/irc-hipchat.rb @@ -4,10 +4,12 @@ IRC_HOST = 'irc.freenode.net' IRC_PORT = '6667' -IRC_CHANNEL = '#emacs' HIPCHAT_ROOM = 'IRC' -hipchat_client = HipChat::Client.new(ENV['HIPCHAT_AUTH_TOKEN'], :api_version => 'v2') +HIPCHAT_AUTH_TOKEN = ENV['HIPCHAT_AUTH_TOKEN'] +IRC_CHANNEL = ENV['IRC_CHANNEL'] + +hipchat_client = HipChat::Client.new(HIPCHAT_AUTH_TOKEN, :api_version => 'v2') daemon = EventMachine::IRC::Client.new do host IRC_HOST @@ -18,7 +20,7 @@ end on(:nick) do - join(IRC_CHANNEL) + join(ENV['IRC_CHANNEL']) end on(:message) do |source, target, message|
Make IRC channel an environment variable
diff --git a/spec/models/subscriber_spec.rb b/spec/models/subscriber_spec.rb index abc1234..def5678 100644 --- a/spec/models/subscriber_spec.rb +++ b/spec/models/subscriber_spec.rb @@ -11,4 +11,17 @@ subscriber.last_name.should eq(@attributes[:last_name]) subscriber.email.should eq(@attributes[:email]) end + + it "should assign the last word of a given full name as the last name" do + subscriber = ActiveESP::Subscriber.new + subscriber.name = "Some Really Long Name Morton" + subscriber.last_name.should eq("Morton") + end + + it "should assign the all words except the last of a given full name as the first name" do + subscriber = ActiveESP::Subscriber.new + subscriber.name = "Billie Joe Armstrong" + subscriber.first_name.should eq("Billie Joe") + end + end
Add tests for setting a name by full name.
diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index abc1234..def5678 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -20,8 +20,8 @@ # Readable test descriptions c.formatter = :documentation c.before :suite do - puppet_module_install(:source => proj_root, :module_name => 'rabbitmq') hosts.each do |host| + copy_module_to(host, :source => proj_root, :module_name => 'rabbitmq') shell("/bin/touch #{default['puppetpath']}/hiera.yaml") shell('puppet module install puppetlabs-stdlib', { :acceptable_exit_codes => [0,1] })
Remove puppet_module_install in favor of copy_module_to
diff --git a/spec/worker_scoreboard_spec.rb b/spec/worker_scoreboard_spec.rb index abc1234..def5678 100644 --- a/spec/worker_scoreboard_spec.rb +++ b/spec/worker_scoreboard_spec.rb @@ -2,7 +2,17 @@ require 'tmpdir' describe WorkerScoreboard do - context do + describe '.new' do + context 'For nested directory' do + let(:base_dir) { File.join(Dir.tmpdir, 'level1', 'level2') } + subject { WorkerScoreboard.new(base_dir) } + example do + expect { subject }.not_to raise_error + end + end + end + + describe '#update' do let(:base_dir) { Dir.tmpdir } subject { WorkerScoreboard.new(base_dir) } it do
Add test for nested directory
diff --git a/printit.gemspec b/printit.gemspec index abc1234..def5678 100644 --- a/printit.gemspec +++ b/printit.gemspec @@ -20,4 +20,6 @@ spec.add_development_dependency "bundler", "~> 1.6" spec.add_development_dependency "rake" + + spec.add_dependency "thor" end
Add Thor as a dependency
diff --git a/dagnabit.gemspec b/dagnabit.gemspec index abc1234..def5678 100644 --- a/dagnabit.gemspec +++ b/dagnabit.gemspec @@ -15,7 +15,7 @@ s.executables = ["dagnabit-test"] s.require_paths = ["lib"] - s.add_dependency 'activerecord', '>= 2.3.0' + s.add_dependency 'activerecord', ['>= 2.3.0', '< 3.1'] [ [ 'autotest', nil ], [ 'bluecloth', nil ],
Put an upper bound on compatible versions of ActiveRecord. The loaded_{parent,child}? association methods no longer exist in ActiveRecord 3.1. To use dagnabit with ActiveRecord >= 3.1, use dagnabit from the activerecord-edge branch.
diff --git a/config/deploy.rb b/config/deploy.rb index abc1234..def5678 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -lock '3.10.2' +lock '3.11.0' set :application, 'evemonk' set :repo_url, '[email protected]:biow0lf/evemonk.git'
Update capistrano lock to 3.11.0
diff --git a/config/deploy.rb b/config/deploy.rb index abc1234..def5678 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -8,6 +8,6 @@ set :deploy_to, '/var/www/mjmr' set :linked_files, ['app/config/parameters.yml'] -set :linked_dirs, [fetch(:log_path), 'web/images'] +set :linked_dirs, [fetch(:log_path), 'web/images', 'web/pdf'] -after 'deploy:updated', 'npm:install'+after 'deploy:updated', 'npm:install'
Add pdf to shared directories
diff --git a/config/routes.rb b/config/routes.rb index abc1234..def5678 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -2,11 +2,9 @@ mount RailsAdmin::Engine => '/admin', as: 'rails_admin' devise_for :users, :controllers => { :omniauth_callbacks => "callbacks" } - resources :question + resources :questions + root to: 'home#index' - - resources :questions, only: [:new, :create, :destroy, :edit, :update, :show] - get 'home/index' get 'home/about' end
Remove 'only' parameter in resources questions
diff --git a/config/routes.rb b/config/routes.rb index abc1234..def5678 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -3,6 +3,7 @@ get '/users', to: 'users#index' get '/users/new', to: 'users#new', as: 'new_user' post '/users', to: 'users#create' + get '/users/:id', to: 'users#show', as: 'user' get '/items', to: 'items#index' get '/items/new', to: 'items#new', as: 'new_item'
Create route for individual user show pages
diff --git a/jekyll-theme-feeling-responsive.gemspec b/jekyll-theme-feeling-responsive.gemspec index abc1234..def5678 100644 --- a/jekyll-theme-feeling-responsive.gemspec +++ b/jekyll-theme-feeling-responsive.gemspec @@ -1,9 +1,10 @@ Gem::Specification.new do |s| s.name = 'jekyll-theme-feeling-responsive' - s.version = '1.0.0' + s.version = '1.0.1' s.date = '2017-10-09' s.summary = 'a free flexible theme for Jekyll built on Foundation framework' - s.description = <<-EOD== + s.description = <<EOD +== # Feeling Responsive Is a free flexible theme for Jekyll built on Foundation framework. You can use it for your company site, as a portfolio or as a blog. @@ -13,9 +14,9 @@ See the [documentation](http://phlow.github.io/feeling-responsive/documentation/) to learn how to use the theme effectively in your Jekyll site. - EOD - s.authors = ['Moritz Sauer', 'Douglas Lovell'] - s.email = ['https://phlow.de/kontakt.html', '[email protected]'] +EOD + s.authors = ['Moritz Sauer'] + s.email = ['https://phlow.de/kontakt.html'] s.files = `git ls-files -z`.split("\x0").select { |f| f.match(%r{^(assets|_layouts|_includes|_sass|LICENSE|README)}i) } s.homepage = 'http://phlow.github.io/feeling-responsive/' s.license = 'MIT'
Remove Lovell as author since email contact is not needed
diff --git a/version_gemfile.gemspec b/version_gemfile.gemspec index abc1234..def5678 100644 --- a/version_gemfile.gemspec +++ b/version_gemfile.gemspec @@ -17,6 +17,6 @@ gem.require_paths = ["lib"] gem.add_development_dependency("rake", "~> 13.0.6") - gem.add_development_dependency("rspec", "~> 3.10.0") + gem.add_development_dependency("rspec", "~> 3.11.0") gem.add_development_dependency("standard", "~> 1.9.0") end
Update rspec requirement from ~> 3.10.0 to ~> 3.11.0 Updates the requirements on [rspec](https://github.com/rspec/rspec-metagem) to permit the latest version. - [Release notes](https://github.com/rspec/rspec-metagem/releases) - [Commits](https://github.com/rspec/rspec-metagem/compare/v3.10.0...v3.11.0) --- updated-dependencies: - dependency-name: rspec dependency-type: direct:development ... Signed-off-by: dependabot[bot] <[email protected]>
diff --git a/lib/con_air.rb b/lib/con_air.rb index abc1234..def5678 100644 --- a/lib/con_air.rb +++ b/lib/con_air.rb @@ -14,7 +14,7 @@ ar.handler_hijackings[ar.connection_id] = ConnectionHandler.new(klass, spec) end - klass.establish_connection + ar.establish_connection yield ensure
Establish connection by using ActiveRecord::Base
diff --git a/interapp.gemspec b/interapp.gemspec index abc1234..def5678 100644 --- a/interapp.gemspec +++ b/interapp.gemspec @@ -17,7 +17,7 @@ s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"] s.test_files = Dir["spec/**/*"] - s.add_dependency "rails", "~> 4.1.1", '>= 4.1.1' + s.add_dependency "rails", '>= 4.1.0' s.add_dependency "ecdsa", "~> 1.1.0" s.add_dependency "rest-client", "~> 1.7.2"
Make Rails version dependency more liberal
diff --git a/lib/rvm_cap.rb b/lib/rvm_cap.rb index abc1234..def5678 100644 --- a/lib/rvm_cap.rb +++ b/lib/rvm_cap.rb @@ -0,0 +1,67 @@+# Copyright (c) 2009-2011 Wayne E. Seguin +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Recipes for using RVM on a server with capistrano. + +unless Capistrano::Configuration.respond_to?(:instance) + abort "rvm/capistrano requires Capistrano >= 2." +end + +Capistrano::Configuration.instance(true).load do + + # Taken from the capistrano code. + def _cset(name, *args, &block) + unless exists?(name) + set(name, *args, &block) + end + end + + set :default_shell do + shell = File.join(rvm_bin_path, "rvm-shell") + ruby = rvm_ruby_string.to_s.strip + shell = "rvm_path=#{rvm_path} #{shell} '#{ruby}'" unless ruby.empty? + shell + end + + # Let users set the type of their rvm install. + _cset(:rvm_type, :system) + + # Define rvm_path + # This is used in the default_shell command to pass the required variable to rvm-shell, allowing + # rvm to boostrap using the proper path. This is being lost in Capistrano due to the lack of a + # full environment. + _cset(:rvm_path) do + case rvm_type + when :system_wide, :root, :system + "/usr/local/rvm" + when :local, :user, :default + "$HOME/.rvm/" + end + end + + # Let users override the rvm_bin_path + _cset(:rvm_bin_path) do + case rvm_type + when :system_wide, :root, :system + "/usr/local/bin" + when :local, :user, :default + "$HOME/.rvm/bin" + end + end + + # Use the default ruby. + _cset(:rvm_ruby_string, "default") + +end +
Add cap support file from RVM.
diff --git a/yaml_converters.gemspec b/yaml_converters.gemspec index abc1234..def5678 100644 --- a/yaml_converters.gemspec +++ b/yaml_converters.gemspec @@ -20,6 +20,7 @@ gem.add_dependency('activesupport') gem.add_dependency('psych') + gem.add_development_dependency('rake') gem.add_development_dependency('rspec') gem.add_development_dependency('simplecov') end
Add rake as development dependency
diff --git a/makara.gemspec b/makara.gemspec index abc1234..def5678 100644 --- a/makara.gemspec +++ b/makara.gemspec @@ -7,6 +7,10 @@ gem.description = %q{Read-write split your DB yo} gem.summary = %q{Read-write split your DB yo} gem.homepage = "" + gem.licenses = ['MIT'] + gem.metadata = { + source_code_uri: 'https://github.com/taskrabbit/makara' + } gem.files = `git ls-files`.split($\) gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
Add more metadata to gemspec Making automated reasoning about the gem easier, by indicating a link to its source code and indicating the license.
diff --git a/lib/apns-s3.rb b/lib/apns-s3.rb index abc1234..def5678 100644 --- a/lib/apns-s3.rb +++ b/lib/apns-s3.rb @@ -6,8 +6,10 @@ # Set PEM file to APNS module # # @param [String] region - # One of ap-northeast-1, ap-southeast-1, ap-southeast-2, eu-central-1, - # eu-west-1, sa-east-1, us-east-1, us-west-1 and us-west-2. + # One of + # us-east-1, us-east-2, us-west-1, us-west-2, ca-central-1, eu-west-1, + # eu-central-1, eu-west-2, ap-northeast-1, ap-northeast-2, ap-southeast-1, + # ap-southeast-2, ap-south-1 and sa-east-1 # # All regions are listed here: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html #
Update the region list documentation
diff --git a/lib/instana.rb b/lib/instana.rb index abc1234..def5678 100644 --- a/lib/instana.rb +++ b/lib/instana.rb @@ -23,8 +23,14 @@ @tracer = ::Instana::Tracer.new @processor = ::Instana::Processor.new @collectors = [] - @logger = ::Logger.new(STDOUT) - @logger.info "Stan is on the scene. Starting Instana instrumentation." + + @logger = Logger.new(STDOUT) + if ENV.key?('INSTANA_GEM_TEST') || ENV.key?('INSTANA_GEM_DEV') + @logger.level = Logger::DEBUG + else + @logger.level = Logger::WARN + end + @logger.unknown "Stan is on the scene. Starting Instana instrumentation." # Store the current pid so we can detect a potential fork # later on
Set log level according to environment
diff --git a/BlurryModalSegue.podspec b/BlurryModalSegue.podspec index abc1234..def5678 100644 --- a/BlurryModalSegue.podspec +++ b/BlurryModalSegue.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| - git_tag = '0.2.0' + git_tag = '0.3.0' s.name = "BlurryModalSegue" s.version = git_tag
Update podspec for 0.3.0 release
diff --git a/CKRefreshControl.podspec b/CKRefreshControl.podspec index abc1234..def5678 100644 --- a/CKRefreshControl.podspec +++ b/CKRefreshControl.podspec @@ -1,15 +1,15 @@ Pod::Spec.new do |s| s.name = "CKRefreshControl" - s.version = "1.1.0" + s.version = "1.1.1" s.summary = "A pull-to-refresh view for iOS 5, 100% API-compatible with UIRefreshControl in iOS 6." s.homepage = "https://github.com/instructure/CKRefreshControl" s.license = 'MIT' s.author = 'Instructure, Inc.' - s.source = { :git => "https://github.com/instructure/CKRefreshControl.git", :tag => "1.1.0" } + s.source = { :git => "https://github.com/instructure/CKRefreshControl.git", :tag => "1.1.1" } s.platform = :ios, '5.0' s.source_files = 'CKRefreshControl/' s.public_header_files = 'CKRefreshControl/CKRefreshControl.h' s.framework = 'QuartzCore' s.requires_arc = true s.xcconfig = { "OTHER_LDFLAGS" => "-ObjC" } -end +end
Update podspec to 1.1.1, with Xcode 5 fixes
diff --git a/cash_flow_analysis.gemspec b/cash_flow_analysis.gemspec index abc1234..def5678 100644 --- a/cash_flow_analysis.gemspec +++ b/cash_flow_analysis.gemspec @@ -19,7 +19,7 @@ spec.require_paths = ["lib"] spec.add_development_dependency "bundler", "~> 1.8" - spec.add_development_dependency "pry" + spec.add_development_dependency "pry", "~> 0" spec.add_development_dependency "rake", "~> 10.0" - spec.add_development_dependency "rspec" + spec.add_development_dependency "rspec", "~> 3.2" end
Add version constraints to development dependencies.
diff --git a/Casks/bettertouchtool.rb b/Casks/bettertouchtool.rb index abc1234..def5678 100644 --- a/Casks/bettertouchtool.rb +++ b/Casks/bettertouchtool.rb @@ -13,7 +13,7 @@ appcast 'http://appcast.boastr.net' name 'BetterTouchTool' homepage 'http://bettertouchtool.net/' - license :commercial + license :gratis app 'BetterTouchTool.app'
Update BetterTouchTool license from commercial to gratis as per the official homepage, BetterTouchTool is absolutely free.
diff --git a/Casks/rstudio-preview.rb b/Casks/rstudio-preview.rb index abc1234..def5678 100644 --- a/Casks/rstudio-preview.rb +++ b/Casks/rstudio-preview.rb @@ -1,7 +1,7 @@ class RstudioPreview < Cask - url 'https://s3.amazonaws.com/rstudio-dailybuilds/RStudio-0.98.484.dmg' + url 'https://s3.amazonaws.com/rstudio-dailybuilds/RStudio-0.98.752.dmg' homepage 'http://www.rstudio.com/ide/download/preview' - version '0.98.484' - sha256 '244529c9a0cd941b77f155bdffb6d438fd618382bcefb212711d834752791854' + version '0.98.752' + sha256 '7393ef30b8e49b20e385d0828177400fb91b775e2c078fec7878a43d3a4e5e10' link 'RStudio.app' end
Update RStudio preview to 0.98.752
diff --git a/config/initializers/openssl.rb b/config/initializers/openssl.rb index abc1234..def5678 100644 --- a/config/initializers/openssl.rb +++ b/config/initializers/openssl.rb @@ -0,0 +1,12 @@+if RUBY_PLATFORM == 'java' + require 'java' + java_import 'java.lang.ClassNotFoundException' + + begin + security_class = java.lang.Class.for_name('javax.crypto.JceSecurity') + restricted_field = security_class.get_declared_field('isRestricted') + restricted_field.accessible = true + restricted_field.set nil, false + rescue ClassNotFoundException => e + end +end
Enable JCE for unlimited strength encryption
diff --git a/BlocksKit.podspec b/BlocksKit.podspec index abc1234..def5678 100644 --- a/BlocksKit.podspec +++ b/BlocksKit.podspec @@ -7,7 +7,9 @@ s.author = { 'Zachary Waldowski' => '[email protected]', 'Alexsander Akers' => '[email protected]' } s.source = { :git => 'https://github.com/pandamonia/BlocksKit.git', :tag => 'v1.6' } + s.requires_arc = true s.osx.source_files = 'BlocksKit/*.{h,m}' + s.osx.library = 'ffi' s.ios.dependency 'libffi' s.ios.frameworks = 'MessageUI' s.ios.source_files = 'BlocksKit/*.{h,m}', 'BlocksKit/UIKit/*.{h,m}', 'BlocksKit/MessageUI/*.{h,m}'
Fix pod spec for 1.6 and up. Signed-off-by: Zachary Waldowski <[email protected]>
diff --git a/lib/memdash.rb b/lib/memdash.rb index abc1234..def5678 100644 --- a/lib/memdash.rb +++ b/lib/memdash.rb @@ -24,10 +24,8 @@ def generate_stats(op, key, *args) val = perform_without_stats(:get, "memdash") if val.nil? - perform_without_stats(:add, "memdash", "BAM", self.class.memdash_ttl, {}) + perform_without_stats(:add, "memdash", stats, self.class.memdash_ttl, {}) end - - puts [op, key, args].inspect end end
Store the stats instead of a test string
diff --git a/lib/my_data.rb b/lib/my_data.rb index abc1234..def5678 100644 --- a/lib/my_data.rb +++ b/lib/my_data.rb @@ -0,0 +1,13 @@+class MyData + attr_reader :year, :lat, :lng, :times + + def initialize(year, lat, lng) + @year = year + @lat = lat + @lng = lng + end + + def calculate + raise NotImplementedError + end +end
Add base class for data.
diff --git a/lib/specter.rb b/lib/specter.rb index abc1234..def5678 100644 --- a/lib/specter.rb +++ b/lib/specter.rb @@ -3,6 +3,10 @@ require 'clap' class Specter + def self.current + Thread.current[:specter] ||= {} + end + def patterns @patterns ||= [] end
Add helper for tracking thread-level current state.
diff --git a/lib/tootsie.rb b/lib/tootsie.rb index abc1234..def5678 100644 --- a/lib/tootsie.rb +++ b/lib/tootsie.rb @@ -3,6 +3,7 @@ require 's3' require 'sqs' require 'yaml' +require 'optparse' require 'tootsie/application' require 'tootsie/client'
Add missing require for optparse.
diff --git a/lib/tty/cmd.rb b/lib/tty/cmd.rb index abc1234..def5678 100644 --- a/lib/tty/cmd.rb +++ b/lib/tty/cmd.rb @@ -1,9 +1,13 @@ # encoding: utf-8 -require_relative 'sh' +require 'forwardable' +require 'tty-command' module TTY class Cmd + extend Forwardable + + def_delegators :command, :run def execute(*) raise( @@ -11,5 +15,9 @@ "#{self.class}##{__method__} must be implemented" ) end + + def command + @command ||= TTY::Command.new(printer: :null) + end end # Cmd end # TTY
Change to add ability to run external commands.