diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/app/value_objects/contacts_search.rb b/app/value_objects/contacts_search.rb index abc1234..def5678 100644 --- a/app/value_objects/contacts_search.rb +++ b/app/value_objects/contacts_search.rb @@ -1,5 +1,5 @@ class ContactsSearch < Searchlight::Search - search_on Contact.includes(:contact_memberships, :contact_groups) + search_on Contact.includes(:contact_memberships) searches :title, :description, :name, :department_id, :contact_group_id
Fix for 500 when using the Topic filter If you were to use the Topic filter with a search term, it was 500ing from an ambiguous column name in contact_search.rb, specifically in the include of contact_groups, which wasn't needed for the search to function.
diff --git a/vmdb/db/migrate/20150505160516_add_status_reason_and_cloud_tenant_to_orchestration_stacks.rb b/vmdb/db/migrate/20150505160516_add_status_reason_and_cloud_tenant_to_orchestration_stacks.rb index abc1234..def5678 100644 --- a/vmdb/db/migrate/20150505160516_add_status_reason_and_cloud_tenant_to_orchestration_stacks.rb +++ b/vmdb/db/migrate/20150505160516_add_status_reason_and_cloud_tenant_to_orchestration_stacks.rb @@ -0,0 +1,6 @@+class AddStatusReasonAndCloudTenantToOrchestrationStacks < ActiveRecord::Migration + def change + add_column :orchestration_stacks, :status_reason, :text + add_column :orchestration_stacks, :cloud_tenant_id, :bigint + end +end
Add status_reason and cloud_tenant to orchestration_stacks
diff --git a/Casks/tilemill.rb b/Casks/tilemill.rb index abc1234..def5678 100644 --- a/Casks/tilemill.rb +++ b/Casks/tilemill.rb @@ -0,0 +1,7 @@+class Tilemill < Cask + url 'http://tilemill.s3.amazonaws.com/latest/TileMill-0.10.1.zip' + homepage 'http://www.mapbox.com/tilemill/' + version '0.10.1' + sha1 '5ea8ad1fc4153e98f37db20cc4ddbf8490e4e942' + link 'TileMill.app' +end
Add Cask for TileMill 0.10.1
diff --git a/Casks/razer-synapse.rb b/Casks/razer-synapse.rb index abc1234..def5678 100644 --- a/Casks/razer-synapse.rb +++ b/Casks/razer-synapse.rb @@ -1,6 +1,6 @@ cask 'razer-synapse' do - version '1.45' - sha256 '4b4368bf5f90cb94667a60a120d49b9073329ba6d9efcd4f5108cf709bfe8115' + version '1.46' + sha256 'eeb264dc25678eb83532267003f1e00c38397332309c8a0b0569d91deda03253' # amazonaws.com is the official download host per the vendor homepage url "https://razerdrivers.s3.amazonaws.com/drivers/Synapse2/mac/Razer_Synapse_Mac_Driver_v#{version}.dmg"
Update Razer Synapse to 1.46
diff --git a/Sage.podspec b/Sage.podspec index abc1234..def5678 100644 --- a/Sage.podspec +++ b/Sage.podspec @@ -5,6 +5,7 @@ s.homepage = "https://github.com/nvzqz/#{s.name}" s.license = { :type => "Apache License, Version 2.0", :file => "LICENSE.txt" } s.author = "Nikolai Vazquez" + s.social_media_url = "https://twitter.com/nikolaivazquez" s.ios.deployment_target = "8.0" s.osx.deployment_target = "10.9" s.watchos.deployment_target = '2.0'
Add twitter URL to podspec
diff --git a/lib/miq_automation_engine/service_models/miq_ae_service_service_template_provision_request.rb b/lib/miq_automation_engine/service_models/miq_ae_service_service_template_provision_request.rb index abc1234..def5678 100644 --- a/lib/miq_automation_engine/service_models/miq_ae_service_service_template_provision_request.rb +++ b/lib/miq_automation_engine/service_models/miq_ae_service_service_template_provision_request.rb @@ -1,5 +1,8 @@ module MiqAeMethodService class MiqAeServiceServiceTemplateProvisionRequest < MiqAeServiceMiqRequest + require_relative "mixins/miq_ae_service_miq_provision_mixin" + include MiqAeServiceMiqProvisionMixin + def ci_type 'service' end
Add miq_provision_quota mixin to Service Template Provision Request Service model. https://bugzilla.redhat.com/show_bug.cgi?id=1491409
diff --git a/jasmine_junitxml_formatter.gemspec b/jasmine_junitxml_formatter.gemspec index abc1234..def5678 100644 --- a/jasmine_junitxml_formatter.gemspec +++ b/jasmine_junitxml_formatter.gemspec @@ -22,6 +22,6 @@ spec.add_development_dependency 'rspec' spec.add_development_dependency "rake" - spec.add_dependency 'jasmine', '~> 2.0.0.alpha' + spec.add_dependency 'jasmine', '~> 2.0' spec.add_dependency "nokogiri" end
Allow minor version number bumps of jasmine, but not major
diff --git a/config/software/gitlab-core.rb b/config/software/gitlab-core.rb index abc1234..def5678 100644 --- a/config/software/gitlab-core.rb +++ b/config/software/gitlab-core.rb @@ -16,7 +16,7 @@ # name "gitlab-core" -version "6-5-stable" +version "master" dependency "ruby" dependency "bundler"
Switch the GitLab main repo to master
diff --git a/write_now/db/migrate/20141013213821_create_projects.rb b/write_now/db/migrate/20141013213821_create_projects.rb index abc1234..def5678 100644 --- a/write_now/db/migrate/20141013213821_create_projects.rb +++ b/write_now/db/migrate/20141013213821_create_projects.rb @@ -1,6 +1,12 @@ class CreateProjects < ActiveRecord::Migration def change create_table :projects do |t| + t.belongs_to :user + t.integer :goal_time_limit + t.boolean :active + t.boolean :archived + t.boolean :completed + t.timestamps end end end
Update project migration with fields. * belongs_to user association * goal_time_limit integer * active, archived, and complete booleans
diff --git a/cookbooks/wt_edge_server/attributes/default.rb b/cookbooks/wt_edge_server/attributes/default.rb index abc1234..def5678 100644 --- a/cookbooks/wt_edge_server/attributes/default.rb +++ b/cookbooks/wt_edge_server/attributes/default.rb @@ -1,5 +1,5 @@ # -# Cookbook Name:: wt_collection_services +# Cookbook Name:: wt_edge_server # Attributes:: default # # Copyright 2012, Webtrends
Fix attribute name for edge server Former-commit-id: 8827ade9f3884d80e7b31318f9f8c09a11d0e46c [formerly 535b32f89a77acc07d97ccda855018d914830701] [formerly 6f8f07ee6a0e10cae30045f1dd57183454269f26 [formerly c0b86315a535e52e89ea33d8f7f28dd3e6164c2f [formerly cc8afdc0e8ff9b20f2b97862b9e3726b5f1bd96a]]] Former-commit-id: 92e62b473f9dbbfd392c9060e882de3d14f70a6f [formerly 85b55a806718d1e6c9b993564fbcd32969a19a80] Former-commit-id: 26442027e306daffa02a6c9faf304c640ba2b24f Former-commit-id: 8a430e5d79285859ba5a7496e7030acffb7203b2
diff --git a/app/jobs/export_job.rb b/app/jobs/export_job.rb index abc1234..def5678 100644 --- a/app/jobs/export_job.rb +++ b/app/jobs/export_job.rb @@ -23,6 +23,6 @@ end export.file = temp_file export.save! - ExportCompleteMailer.send_export(export.id, "Results") + ExportCompleteMailer.send_export(export.id, "Results").deliver_later end end
Send email after export job
diff --git a/lib/straight_engine/blockchain_adapters/helloblock_io.rb b/lib/straight_engine/blockchain_adapters/helloblock_io.rb index abc1234..def5678 100644 --- a/lib/straight_engine/blockchain_adapters/helloblock_io.rb +++ b/lib/straight_engine/blockchain_adapters/helloblock_io.rb @@ -2,12 +2,6 @@ module BlockchainAdapter class HelloblockIo < Base - - # When we call calculate_confirmations, it doesn't always make a new - # request to the blockchain API. Instead, it checks if cached_id matches the one in - # the hash. It's useful when we want to calculate confirmations for all transactions for - # a certain address without making any new requests to the Blockchain API. - @@latest_block = { cache_timestamp: nil, block: nil } API_BASE_URL = "https://mainnet.helloblock.io/v1"
Remove the some BlockchainInfo adapter related code from HelloblockIo adapter
diff --git a/app/models/organism.rb b/app/models/organism.rb index abc1234..def5678 100644 --- a/app/models/organism.rb +++ b/app/models/organism.rb @@ -5,22 +5,25 @@ end def english_name - @taxon[:common_name][:name] + if @taxon[:common_name] != nil + common = @taxon[:common_name] + return common[:name] unless nil + end end def taxon_name - @taxon[:name] + return @taxon[:name] unless nil end def taxon_rank - @taxon[:rank] + return @taxon[:rank] unless nil end def iconic_taxon_name - @iconic_taxon[:name] + return @iconic_taxon[:name] unless nil end def iconic_taxon_rank - @iconic_taxon[:rank] + return @iconic_taxon[:rank] unless nil end end
Update english_name method so that it is functional
diff --git a/app/models/question.rb b/app/models/question.rb index abc1234..def5678 100644 --- a/app/models/question.rb +++ b/app/models/question.rb @@ -4,4 +4,12 @@ validates_presence_of :body validates_presence_of :title + + def self.search(words) + matches = [] + words.split(' ').each do |word| + matches << Question.all.map { |q| q.title.include?(word) || q.body.include?(word) } + end + matches + end end
Add search class method for Question.
diff --git a/config/initializers/will_paginate.rb b/config/initializers/will_paginate.rb index abc1234..def5678 100644 --- a/config/initializers/will_paginate.rb +++ b/config/initializers/will_paginate.rb @@ -27,7 +27,7 @@ end def gap - tag :li, link('&hellip;'.html_safe, '#', :class => 'disabled') + tag :li, link('&hellip;'.html_safe, '#'), :class => 'disabled' end def previous_or_next_page(page, text, classname)
Fix gap styling by moving disabled class up to the li tag
diff --git a/UIFontComplete.podspec b/UIFontComplete.podspec index abc1234..def5678 100644 --- a/UIFontComplete.podspec +++ b/UIFontComplete.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'UIFontComplete' - s.version = '1.1.0' + s.version = '2.0.0' s.summary = 'Make working with UIFont faster and less error-prone' s.description = <<-DESC
Update Cocoapods version to 2.0.0
diff --git a/app/models/concerns/padawan_run.rb b/app/models/concerns/padawan_run.rb index abc1234..def5678 100644 --- a/app/models/concerns/padawan_run.rb +++ b/app/models/concerns/padawan_run.rb @@ -8,10 +8,10 @@ improvements = {time_differences: [], missed_splits: []} return improvements if category != better_run.category - return improvements if splits.size != better_run.splits.size + return improvements if reduced_splits.size != better_run.reduced_splits.size reduced_splits.each.with_index do |split, i| - if better_run.reduced_splits[i][:duration] < split[:duration] && !split[:reduced?] + if better_run.splits[i][:duration] < split[:duration] && !split[:reduced?] improvements[:time_differences] << {split: split, time_difference: (split[:duration] - better_run.splits[i][:duration]).floor} elsif split[:reduced?] improvements[:missed_splits] << {split: split}
Fix a 500 on comparison pages for runs with missed splits
diff --git a/app/models/gobierto_people/gift.rb b/app/models/gobierto_people/gift.rb index abc1234..def5678 100644 --- a/app/models/gobierto_people/gift.rb +++ b/app/models/gobierto_people/gift.rb @@ -7,9 +7,10 @@ include GobiertoCommon::Metadatable include GobiertoCommon::UrlBuildable + include BelongsToPersonWithCharge - belongs_to :person belongs_to :department + belongs_to_person_with_historical_charge date_attribute: :date scope :sorted, -> { order(date: :desc, name: :asc) } scope :between_dates, lambda { |start_date, end_date|
Add BelongsToPersonWithCharge to GobiertoPeople::Gift model
diff --git a/app/modules/device_size_manager.rb b/app/modules/device_size_manager.rb index abc1234..def5678 100644 --- a/app/modules/device_size_manager.rb +++ b/app/modules/device_size_manager.rb @@ -3,12 +3,12 @@ module_function def select_sizes - case UIDevice.currentDevice.name + case UIDevice.currentDevice.model when /iPhone/; SizesIPhone.new when /iPod/; SizesIPhone.new when /iPad/ ; SizesIPad.new else - puts "Unsupported Device [#{UIDevice.currentDevice.name}] is detected." if BW2.debug? + puts "Unsupported Device [#{UIDevice.currentDevice.model}] is detected." if BW2.debug? SizesIPhone.new end end
Fix broken layout for iPad on Simulator - now UIDevice.currnet(Device) returns Mac name. This method had been returned Simulator device name - so, use "model" instead of "name" from now on.
diff --git a/ext/unf_ext/extconf.rb b/ext/unf_ext/extconf.rb index abc1234..def5678 100644 --- a/ext/unf_ext/extconf.rb +++ b/ext/unf_ext/extconf.rb @@ -4,17 +4,6 @@ $LDFLAGS << ' ' << `#{CONFIG['CC']} -print-file-name=libstdc++.a`.chomp else have_library('stdc++') -end - -case RUBY_PLATFORM -when /\Aarm/ - # A quick fix for char being unsigned by default on ARM - if defined?($CXXFLAGS) - $CXXFLAGS << ' -fsigned-char' - else - # Ruby < 2.0 - $CFLAGS << ' -fsigned-char' - end end create_makefile 'unf_ext'
Revert special case for signed char in ARM There other architectures where char is not signed as well. Since 8a6a735b51ef903200fc541112e35b7cea781856 introduces a real fix, I think this should be reverted.
diff --git a/config/initializers/forest_engine.rb b/config/initializers/forest_engine.rb index abc1234..def5678 100644 --- a/config/initializers/forest_engine.rb +++ b/config/initializers/forest_engine.rb @@ -1,4 +1,4 @@-MediaItem.expire_cache! -Menu.expire_cache! -Setting.expire_cache! -Setting.expire_application_cache_key! +'MediaItem'.safe_constantize&.expire_cache! +'Menu'.safe_constantize&.expire_cache! +'Setting'.safe_constantize&.expire_cache! +'Setting'.safe_constantize&.expire_application_cache_key!
Fix issue when referencing models that don't exist in first installation
diff --git a/core/db/default/spree/zones.rb b/core/db/default/spree/zones.rb index abc1234..def5678 100644 --- a/core/db/default/spree/zones.rb +++ b/core/db/default/spree/zones.rb @@ -1,6 +1,7 @@ eu_vat = Spree::Zone.create!(name: "EU_VAT", description: "Countries that make up the EU VAT zone.", kind: 'country') north_america = Spree::Zone.create!(name: "North America", description: "USA + Canada", kind: 'country') -%w(PL FI PT RO DE FR SK HU SI IE AT ES IT BE SE LV BG GB LT CY LU MT DK NL EE). + +%w(PL FI PT RO DE FR SK HU SI IE AT ES IT BE SE LV BG GB LT CY LU MT DK NL EE HR CZ GR). each do |name| eu_vat.zone_members.create!(zoneable: Spree::Country.find_by!(iso: name)) end @@ -8,5 +9,3 @@ %w(US CA).each do |name| north_america.zone_members.create!(zoneable: Spree::Country.find_by!(iso: name)) end - -
Add Croatia, Czech Republic and Greece to EU_VAT This change was already merged on Sep 17, 2015: e645b8c6d318b639bb3bbc5d507c6212565fb1a But was overwritten/lost by commit on Dec 3, 2015: b08f40eefe670ad07dc0019f8ba7c49d6ab4dcc4
diff --git a/benchmark/yaml.rb b/benchmark/yaml.rb index abc1234..def5678 100644 --- a/benchmark/yaml.rb +++ b/benchmark/yaml.rb @@ -12,7 +12,7 @@ data = "hello: world\nworld: hello" Benchmark.ips :quiet => true do |x| x.json! "benchmark.json" - x.report("B:Pathutil.parse_yaml") { Pathutil.parse_yaml(data) } x.report("A:SafeYAML.load") { SafeYAML.load(data) } + x.report("B:Pathutil::Helpers.parse_yaml") { Pathutil.parse_yaml(data) } x.compare! end
Move the benchmark line down.
diff --git a/rails_singlefile_template.rb b/rails_singlefile_template.rb index abc1234..def5678 100644 --- a/rails_singlefile_template.rb +++ b/rails_singlefile_template.rb @@ -0,0 +1,91 @@+begin + require 'bundler/inline' +rescue LoadError => e + $stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler' + raise e +end + +gemfile(true) do + source 'https://rubygems.org' + gem 'rails', '5.0.1' + gem 'pry' + gem 'sqlite3' + gem 'rb-readline' +end + +require 'action_controller/railtie' +require 'active_record' +require 'minitest/autorun' +require 'logger' + +ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:') +ActiveRecord::Base.logger = Logger.new(STDOUT) + +ActiveRecord::Schema.define do + create_table :todos, force: true do |t| + t.string :content + end +end + +class Todo < ActiveRecord::Base + alias_attribute :content_html, :content + validates_presence_of :content +end + +class TestApp < Rails::Application + config.root = File.dirname(__FILE__) + config.session_store :cookie_store, key: 'cookie_store_key' + secrets.secret_token = 'secret_token' + secrets.secret_key_base = 'secret_key_base' + + config.logger = Logger.new($stdout) + Rails.logger = config.logger + + routes.draw do + resources :todos + resources :wrapped_todos + end +end + +ActionController::Base.wrap_parameters format: [:json] + +class TodosController < ActionController::Base + include Rails.application.routes.url_helpers + + def create + Todo.create!(params.require(:todo).permit(:content, :content_html)) + render plain: 'It worked?' + end +end + +class WrappedTodosController < ActionController::Base + wrap_parameters :todo, include: %i( content_html ) + + def create + Todo.create!(params.require(:todo).permit(:content, :content_html)) + render plain: 'It worked?' + end +end + +require 'minitest/autorun' +require 'rack/test' + +class BugTest < Minitest::Test + include Rack::Test::Methods + + def test_wrapping_listed_attribute + post '/todos.json', { content: "<b>Please clap</b>" }.to_json, { "CONTENT_TYPE" => "application/json" } + assert last_response.ok?, "Wrapping did not work with attribute on model" + end + + def test_explicitly_wrapping_unlisted_attribute + post '/wrapped_todos.json', { content_html: "<b>Please clap</b>" }.to_json, { "CONTENT_TYPE" => "application/json" } + Pry.start + assert last_response.ok?, "Wrapping works when given explicitly with include option" + end + + private + def app + Rails.application + end +end
Add single file rails template
diff --git a/test/helpers/assets_helper_test.rb b/test/helpers/assets_helper_test.rb index abc1234..def5678 100644 --- a/test/helpers/assets_helper_test.rb +++ b/test/helpers/assets_helper_test.rb @@ -6,21 +6,20 @@ class AssetsHelperTest < ActionView::TestCase include AssetsHelper - # TODO: fix this broken test with paperclip-dropbox - # test 'should return full path for attachment' do - # @subscriber = users(:lana) - # result = attachment_url(@subscriber.avatar, :small, ActionController::TestRequest.new) - # expected = "http://test.host/avatar/#{@lana.id}/small-bart.jpg" + test 'should return full path for attachment' do + @subscriber = users(:lana) + result = attachment_url(@subscriber.avatar, :small, ActionController::TestRequest.new) + expected = "http://test.host/system/test/users/#{@subscriber.id}/small-bart.jpg" - # assert_equal result, expected - # end + assert_equal expected, result + end test 'should return default image if attachment is not defined' do @administrator = users(:bob) result = attachment_url(@administrator.avatar, :small, ActionController::TestRequest.new) expected = 'http://test.host/default/small-missing.png' - assert_equal result, expected + assert_equal expected, result end test 'should return nil if attachment is nil' do
Add test for attachment_url method
diff --git a/test/unit/local_import_box_test.rb b/test/unit/local_import_box_test.rb index abc1234..def5678 100644 --- a/test/unit/local_import_box_test.rb +++ b/test/unit/local_import_box_test.rb @@ -17,7 +17,7 @@ @td.rmtree end - def test_local_import_box + def test_local_import_box_from_file box_path = @td.join('boxes/fog-octocloud-test-ova') @compute.local_import_box 'fog-octocloud-test-ova', @test_ova, TEST_OVA_MD5 assert File.directory?(box_path) @@ -26,4 +26,13 @@ assert Dir["#{box_path}/*.vmdk"].size >= 1 end + def test_local_import_box_from_url + box_path = @td.join('boxes/fog-octocloud-test-ova') + @compute.local_import_box 'fog-octocloud-test-ova', TEST_OVA_URL, TEST_OVA_MD5 + assert File.directory?(box_path) + assert Dir["#{box_path}/*.vmx"].size == 1 + # OVAs may have more than one VMDK IIRC + assert Dir["#{box_path}/*.vmdk"].size >= 1 + end + end
Test also remote (URL) OVA import
diff --git a/data-aggregation-accumulator.gemspec b/data-aggregation-accumulator.gemspec index abc1234..def5678 100644 --- a/data-aggregation-accumulator.gemspec +++ b/data-aggregation-accumulator.gemspec @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = 'data_aggregation-accumulator' - s.version = '0.0.1.0' + s.version = '0.0.1.1' s.summary = 'Data aggregation accumulator library' s.description = ' '
Package version is increased from 0.0.1.0 to 0.0.1.1
diff --git a/config/initializers/carrier_wave.rb b/config/initializers/carrier_wave.rb index abc1234..def5678 100644 --- a/config/initializers/carrier_wave.rb +++ b/config/initializers/carrier_wave.rb @@ -9,6 +9,7 @@ region: Figaro.env.fog_region, host: Figaro.env.fog_host } + config.fog_attributes = { 'Cache-Control' => "max-age=#{365.days.to_i}" } config.asset_host = Figaro.env.aws_host end
Set Cache Control on upload
diff --git a/config/initializers/registration.rb b/config/initializers/registration.rb index abc1234..def5678 100644 --- a/config/initializers/registration.rb +++ b/config/initializers/registration.rb @@ -3,14 +3,14 @@ routes.url_helpers.new_payment_path(contribution_id: contribution) end -total_with_fees = ->(value) do +value_with_fees = ->(value) do "TODO" end begin PaymentEngines.register(name: 'balanced-bankaccount', locale: 'en', - total_with_fees: total_with_fees, + value_with_fees: value_with_fees, review_path: review_path) rescue Exception => e puts "Error while registering payment engine: #{e}"
Rename the total_with_fees to value_with_fees
diff --git a/lib/asciidoctor/doctest/version.rb b/lib/asciidoctor/doctest/version.rb index abc1234..def5678 100644 --- a/lib/asciidoctor/doctest/version.rb +++ b/lib/asciidoctor/doctest/version.rb @@ -1,5 +1,5 @@ module Asciidoctor module DocTest - VERSION = '1.5.1.1' + VERSION = '1.5.2.dev' end end
Prepare for next development iteration
diff --git a/lib/carto/export/map_statistics.rb b/lib/carto/export/map_statistics.rb index abc1234..def5678 100644 --- a/lib/carto/export/map_statistics.rb +++ b/lib/carto/export/map_statistics.rb @@ -29,12 +29,13 @@ end def statistics_for_visualization(visualization) - analysis_node_count = visualization.analyses.flat_map { |a| a.analysis_node.descendants.map(&:id) }.uniq.count + analysis_nodes = visualization.analyses.flat_map { |a| a.analysis_node.descendants }.uniq(&:id) { id: visualization.id, total_data_layers: visualization.data_layers.count, - total_analysis_nodes: analysis_node_count, - analysis_nodes_per_layer: (analysis_node_count.to_f / visualization.layers.count.to_f).round(2), + total_analysis_nodes: analysis_nodes.count, + non_source_analysis_nodes: analysis_nodes.reject(&:source?).count, + analysis_nodes_per_layer: (analysis_nodes.count.to_f / visualization.layers.count.to_f).round(2), user_account_type: visualization.user.account_type, creation_date: visualization.created_at, type: visualization.builder? ? 'builder' : 'editor'
Add number of non_source nodes to map stats
diff --git a/lib/asciidoctor/doctest/version.rb b/lib/asciidoctor/doctest/version.rb index abc1234..def5678 100644 --- a/lib/asciidoctor/doctest/version.rb +++ b/lib/asciidoctor/doctest/version.rb @@ -1,5 +1,5 @@ module Asciidoctor module DocTest - VERSION = '1.5.2.0' + VERSION = '2.0.0.dev' end end
Prepare for next development iteration
diff --git a/lib/epub/content_document/xhtml.rb b/lib/epub/content_document/xhtml.rb index abc1234..def5678 100644 --- a/lib/epub/content_document/xhtml.rb +++ b/lib/epub/content_document/xhtml.rb @@ -1,9 +1,10 @@ module EPUB module ContentDocument class XHTML - attr_accessor :book + attr_accessor :item def read + item.read end alias raw_document read end
Add attribute "item" instead of "book" to ContentDocument::XHTML
diff --git a/test/integration/test_orders.rb b/test/integration/test_orders.rb index abc1234..def5678 100644 --- a/test/integration/test_orders.rb +++ b/test/integration/test_orders.rb @@ -14,8 +14,8 @@ next if order_ids.count < 2 - orders = client.get_order(*order_ids) - .dig('Orders', 'Order') + res = client.get_order(*order_ids) + orders = res.dig('Orders', 'Order') assert_equal order_ids.count, orders.count end
Break into two lines for easier debugging
diff --git a/spec/plugin/html_spec.rb b/spec/plugin/html_spec.rb index abc1234..def5678 100644 --- a/spec/plugin/html_spec.rb +++ b/spec/plugin/html_spec.rb @@ -6,6 +6,14 @@ before :each do vim.set(:expandtab) vim.set(:shiftwidth, 2) + end + + def simple_test(joined_html, split_html) + set_file_contents joined_html + split + assert_file_contents split_html + join + assert_file_contents joined_html end specify "tags" do @@ -17,11 +25,34 @@ </div> EOF - set_file_contents joined_html - split - assert_file_contents split_html - join - assert_file_contents joined_html + simple_test(joined_html, split_html) + end + + describe "attributes" do + let(:long_list_joined) do + '<div id="test" class="foo bar baz" style="width: 500px; height: 500px"></div>' + end + + let(:long_list_split) do + <<-EOF + <div + id="test" + class="foo bar baz" + style="width: 500px; height: 500px"> + </div>' + EOF + end + + let(:short_list_joined) { '<div id="test" class="foo bar baz"></div>' } + let(:short_list_split) { %{<div id="test" class="foo bar baz">\n\n</div>} } + + specify "with a long list" do + simple_test(long_list_joined, long_list_split) + end + + specify "with a short list" do + simple_test(short_list_joined, short_list_split) + end end end
Add specs for html attribute splitting
diff --git a/raygun_client.gemspec b/raygun_client.gemspec index abc1234..def5678 100644 --- a/raygun_client.gemspec +++ b/raygun_client.gemspec @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = 'raygun_client' - s.version = '0.0.2.1' + s.version = '0.0.2.2' s.summary = 'Client for the Raygun API using the Obsidian HTTP client' s.description = ' '
Package version is increased from 0.0.2.1 to 0.0.2.2
diff --git a/FBAnnotationClusteringSwift.podspec b/FBAnnotationClusteringSwift.podspec index abc1234..def5678 100644 --- a/FBAnnotationClusteringSwift.podspec +++ b/FBAnnotationClusteringSwift.podspec @@ -22,6 +22,7 @@ s.platform = :ios, '8.0' s.requires_arc = true + s.swift_version = '4.2' s.source_files = 'Pod/Classes/**/*' s.framework = 'MapKit'
Update podspec to specify swift version
diff --git a/lib/roleify/roleifyable_controller.rb b/lib/roleify/roleifyable_controller.rb index abc1234..def5678 100644 --- a/lib/roleify/roleifyable_controller.rb +++ b/lib/roleify/roleifyable_controller.rb @@ -8,6 +8,8 @@ #TODO make deny action configurable, now depends on Clearance def allowed? + # action marked 'public', allow access even when not logged in + return if actions_for_role(Roleify::Role::RULES[:public]).include?(self.action_name) # no user, no role deny access deny_access && return unless current_user && current_user.role # admin user, ok
Allow public actions, marked as pseudo-role :public.
diff --git a/lib/topicz/commands/report_command.rb b/lib/topicz/commands/report_command.rb index abc1234..def5678 100644 --- a/lib/topicz/commands/report_command.rb +++ b/lib/topicz/commands/report_command.rb @@ -1,5 +1,4 @@ require_relative 'repository_command' -require 'json' module Topicz::Commands @@ -10,7 +9,6 @@ @week = Date.today.cweek @year = Date.today.cwyear option_parser.order! arguments - @filter = arguments.join ' ' end def option_parser @@ -23,7 +21,7 @@ @year = year.to_i end options.separator '' - options.separator 'Generates a weekly report from all journals across all topics.' + options.separator 'Generates a weekly report from all journals across all topics in a single Markdown file.' end end
Clean up code for the `report` command.
diff --git a/lib/typus/orm/active_record/search.rb b/lib/typus/orm/active_record/search.rb index abc1234..def5678 100644 --- a/lib/typus/orm/active_record/search.rb +++ b/lib/typus/orm/active_record/search.rb @@ -26,9 +26,8 @@ data.join(' OR ') end - # TODO: Use Rails scopes to build the search: where(key => interval) def build_filter_interval(interval, key) - ["#{table_name}.#{key} BETWEEN ? AND ?", interval.first.to_s(:db), interval.last.to_s(:db)] + {key => interval.first.to_s(:db)..interval.last.to_s(:db)} end def build_my_joins(params)
Use where interval instead of using SQL
diff --git a/spec/translate_spec.rb b/spec/translate_spec.rb index abc1234..def5678 100644 --- a/spec/translate_spec.rb +++ b/spec/translate_spec.rb @@ -7,7 +7,7 @@ it { Norwegish.translate("The thing is a thing").should eq("The tingen is a ting") } it { Norwegish.translate("Thor was a nordic god").should eq("Tør vas a nørdik god") } it { Norwegish.translate("What a challenge!").should eq("Vat a kjallenge!") } - it { Norwegish.translate("I presented something at a public konference!").should eq("I presented someting at a publik konferens!") } + it { Norwegish.translate("I presented something at a public conference!").should eq("I presented someting at a publik konferens!") } it { Norwegish.translate("Call it version 1.0").should eq("Kall it versjon 1.0") } it { Norwegish.translate("Like car accidents, most hardware problems are due to driver error.").should eq("Like kar aksidents, most hardvare problems are due to driver errør.") } it { Norwegish.translate("You're the expert.").should eq("You're the eksperten.") }
Fix typo in original English in spec
diff --git a/ruby/scrabble-score/scrabble_score.rb b/ruby/scrabble-score/scrabble_score.rb index abc1234..def5678 100644 --- a/ruby/scrabble-score/scrabble_score.rb +++ b/ruby/scrabble-score/scrabble_score.rb @@ -8,24 +8,20 @@ return 0 if word_invalid points = 0 word.each_char do |char| - points += CHAR_POINTS[char] + points += TILE_POINTS[char] end points end def self.score(word) - points = 0 - word.each_char do |char| - points += CHAR_POINTS[char] - end - points + new(word).score end def word_invalid word.nil? || word == '' || word == " \t\n" end - CHAR_POINTS = { + TILE_POINTS = { 'a' => 1, 'b' => 3, 'c' => 3,
Change constant name and call score in self.score
diff --git a/lib/puppet/type/ora_role/grants.rb b/lib/puppet/type/ora_role/grants.rb index abc1234..def5678 100644 --- a/lib/puppet/type/ora_role/grants.rb +++ b/lib/puppet/type/ora_role/grants.rb @@ -0,0 +1,77 @@+newproperty(:grants, :array_matching => :all) do + include EasyType + include ::OraUtils::OracleAccess + include EasyType::Mungers::Upcase + + desc "granted privileges for this role" + + to_translate_to_resource do | raw_resource| + @all_rights ||= privileges + granted_roles + role = raw_resource.column_data('ROLE') + rights_for_role(role) + end + + # + # because the order may differ, but they are still the same, + # to decide if they are equal, first do a sort on is and should + # + def insync?(is) + is.sort == should.sort + end + + def change_to_s(from, to) + return_value = [] + return_value << "revoked the #{revoked_rights.join(',')} right(s)" unless revoked_rights.empty? + return_value << "granted the #{granted_rights.join(',')} right(s)" unless granted_rights.empty? + return_value.join(' and ') + end + + on_apply do | command_builder | + sid = sid_from_resource + command_builder.after(revoke(revoked_rights), :sid => sid) unless revoked_rights.empty? + command_builder.after(grants(granted_rights), :sid => sid) unless granted_rights.empty? + nil + end + + + private + + def current_rights + # TODO: Check why this needs to be so difficult + resource.to_resource.to_hash.delete_if {|key, value| value == :absent}.fetch(:grants) { []} + end + + def expected_rights + resource.to_hash.fetch(:grants) {[]} + end + + def revoked_rights + current_rights - expected_rights + end + + def granted_rights + expected_rights - current_rights + end + + def revoke(rights) + rights.empty? ? nil : "revoke #{rights.join(',')} from #{resource.role_name}" + end + + def grants(rights) + rights.empty? ? nil : "grant #{rights.join(',')} to #{resource.role_name}" + end + + def self.rights_for_role(role) + @all_rights.select {|r| r['GRANTEE'] == role}.collect{|u| u['PRIVILEGE']} + end + + + def self.privileges + sql_on_all_sids "select distinct grantee, privilege from dba_sys_privs" + end + + def self.granted_roles + sql_on_all_sids "select distinct grantee, granted_role as privilege from dba_role_privs" + end + +end
Add grant privileges function to ora_role.rb
diff --git a/app/services/action/project/rebuild_via_hook.rb b/app/services/action/project/rebuild_via_hook.rb index abc1234..def5678 100644 --- a/app/services/action/project/rebuild_via_hook.rb +++ b/app/services/action/project/rebuild_via_hook.rb @@ -9,10 +9,9 @@ def initialize(params) if params[:payload] - payload = JSON[params[:payload]] - project = InchCI::Store::FindProject.call(project_uid(payload)) - enqueue_build(project, branch_name(payload)) - @result = "OK" + process_payload JSON[params[:payload]] + elsif params[:ref] + process_payload params else @result = "ERROR" end @@ -28,6 +27,12 @@ payload['ref'] =~ /^refs\/heads\/(.+)$/ && $1 end + def process_payload(payload) + project = InchCI::Store::FindProject.call(project_uid(payload)) + enqueue_build(project, branch_name(payload)) + @result = "OK" + end + def project_uid(payload) if web_url = payload['repository'] && payload['repository']['url'] info = InchCI::RepoURL.new(web_url)
Update RebuildViaHook to accept different param format
diff --git a/lib/valid_email/email_validator.rb b/lib/valid_email/email_validator.rb index abc1234..def5678 100644 --- a/lib/valid_email/email_validator.rb +++ b/lib/valid_email/email_validator.rb @@ -21,6 +21,9 @@ require 'valid_email/ban_disposable_email_validator' r = BanDisposableEmailValidator.new(:attributes => attributes).validate(record) end - record.errors.add attribute, (options[:message] || I18n.t(:invalid, :scope => "valid_email.validations.email")) unless r + unless r + msg = (options[:message] || I18n.t(:invalid, :scope => "valid_email.validations.email")) + record.errors.add attribute, (msg % {value: value}) + end end end
Support interpolation of validation error messages Error messages can now contain the string %{value}, which will be interpolated with the email.
diff --git a/spec/acceptance/basic_gnocchi_spec.rb b/spec/acceptance/basic_gnocchi_spec.rb index abc1234..def5678 100644 --- a/spec/acceptance/basic_gnocchi_spec.rb +++ b/spec/acceptance/basic_gnocchi_spec.rb @@ -10,40 +10,9 @@ include ::openstack_integration::repos include ::openstack_integration::mysql include ::openstack_integration::keystone - - class { '::gnocchi::db::mysql': - password => 'a_big_secret', + class { '::openstack_integration::gnocchi': + integration_enable => false, } - class { '::gnocchi::keystone::auth': - password => 'a_big_secret', - } - class { '::gnocchi': - debug => true, - database_connection => 'mysql+pymysql://gnocchi:a_big_secret@127.0.0.1/gnocchi?charset=utf8', - } - class { '::gnocchi::keystone::authtoken': - password => 'a_big_secret', - } - class { '::gnocchi::api': - enabled => true, - service_name => 'httpd', - sync_db => true, - } - class { '::gnocchi::metricd': } - class { '::gnocchi::storage': } - class { '::gnocchi::storage::file': } - include ::apache - class { '::gnocchi::wsgi::apache': - ssl => false, - } - class { '::gnocchi::statsd': - archive_policy_name => 'high', - flush_delay => '100', - resource_id => '07f26121-5777-48ba-8a0b-d70468133dd9', - user_id => 'f81e9b1f-9505-4298-bc33-43dfbd9a973b', - project_id => '203ef419-e73f-4b8a-a73f-3d599a72b18d', - } - class { '::gnocchi::client': } EOS # Run it twice and test for idempotency
Switch acceptance test to use integration classes Change-Id: I79e4be4ff0a3eca635979c9b2ac9c0a2b33c9954 Depends-On: I3680dbad11435ac82ad03d0195d8e348d21b1433
diff --git a/spec/features/course_deletion_spec.rb b/spec/features/course_deletion_spec.rb index abc1234..def5678 100644 --- a/spec/features/course_deletion_spec.rb +++ b/spec/features/course_deletion_spec.rb @@ -0,0 +1,22 @@+# frozen_string_literal: true + +require 'rails_helper' + +describe 'course deletion', type: :feature, js: true do + let(:course) { create(:course) } + let(:admin) { create(:admin) } + + it 'destroys the course and redirects to the home page' do + login_as admin + stub_oauth_edit + visit "/courses/#{course.slug}" + + expect(Course.count).to eq(1) + + accept_prompt(with: course.title) do + click_button 'Delete course' + end + expect(page).to have_content 'Create Course' + expect(Course.count).to eq(0) + end +end
Add browser test for course deletion
diff --git a/spec/integrations/client_zpty_spec.rb b/spec/integrations/client_zpty_spec.rb index abc1234..def5678 100644 --- a/spec/integrations/client_zpty_spec.rb +++ b/spec/integrations/client_zpty_spec.rb @@ -5,6 +5,6 @@ sleep 1 # Give a little time for precmd hooks to run session.run_command('zpty -t kitty; echo $?') - wait_for(session.content).to end_with("\n0") + wait_for { session.content }.to end_with("\n0") end end
Test should be passing block to RSpec wait_for Fixes flaky test
diff --git a/spec/ethon/curl_spec.rb b/spec/ethon/curl_spec.rb index abc1234..def5678 100644 --- a/spec/ethon/curl_spec.rb +++ b/spec/ethon/curl_spec.rb @@ -2,6 +2,8 @@ describe Ethon::Curl do describe ".init" do + before { Ethon::Curl.class_variable_set(:@@initialized, false) } + context "when global_init fails" do it "raises global init error" do Ethon::Curl.expects(:global_init).returns(1)
Make sure @@initialized is false.
diff --git a/spec/repository_spec.rb b/spec/repository_spec.rb index abc1234..def5678 100644 --- a/spec/repository_spec.rb +++ b/spec/repository_spec.rb @@ -0,0 +1,35 @@+require 'turntables/repository' + +include Turntables + +describe Repository do + + before :each do + @repo = Repository.new + end + + it "#new should return Repository Object" do + @repo.should be_instance_of Repository + end + + it "Should have a method called register" do + @repo.should respond_to(:register) + end + + it "Should have a method called make!" do + @repo.should respond_to(:make!) + end + + it "Should have an attribute called sequential_dir" do + @repo.should respond_to(:sequential_dir) + end + + it "Should have an attribute called monolithic_dir" do + @repo.should respond_to(:monolithic_dir) + end + + it "Should have an attribute called relative_dir" do + @repo.should respond_to(:relative_dir) + end + +end
Add minor testing for repository object
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index abc1234..def5678 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -4,9 +4,9 @@ SNIFFER_GROUP_COUNT = Dir.glob(File.dirname(__FILE__) + "/../../lib/sniffles/sniffers/**").count def page_body(url) - Typhoeus::Request.get(url).body + Typhoeus::Request.get(url, headers: { 'User-Agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.68 Safari/537.36'}).body end def empty_html_doc "<html><head></head><body></body></html>" -end+end
Add User-Agent to test request
diff --git a/config/initializers/deplayed_job_set_priority_plugin.rb b/config/initializers/deplayed_job_set_priority_plugin.rb index abc1234..def5678 100644 --- a/config/initializers/deplayed_job_set_priority_plugin.rb +++ b/config/initializers/deplayed_job_set_priority_plugin.rb @@ -8,7 +8,7 @@ job_class_name = YAML.load(job.handler).try(:class).try(:name) if job_class_name.present? priority = DelayedJobPriority.find_by_class_name(job_class_name).try(:priority) - if priority != job.priority + if priority.present? && priority != job.priority job.priority = priority end end
Check configured priority exist or not before using it
diff --git a/bootstrap-sass.gemspec b/bootstrap-sass.gemspec index abc1234..def5678 100644 --- a/bootstrap-sass.gemspec +++ b/bootstrap-sass.gemspec @@ -7,7 +7,7 @@ s.homepage = "http://github.com/thomas-mcdonald/bootstrap-sass" s.add_development_dependency 'compass' - s.add_development_dependency 'sass-rails', '~> 3.1' + s.add_development_dependency 'sass-rails', '~> 3.2' s.files = Dir["vendor/**/*.{scss,js,png}"] + Dir["lib/**/*"] + Dir["templates/**/*"] + ["README.md", "LICENSE"] end
Update sass-rails dependency version to require > 3.2
diff --git a/spec/lib/rearview/ext/numeric_spec.rb b/spec/lib/rearview/ext/numeric_spec.rb index abc1234..def5678 100644 --- a/spec/lib/rearview/ext/numeric_spec.rb +++ b/spec/lib/rearview/ext/numeric_spec.rb @@ -0,0 +1,16 @@+require 'spec_helper' + +describe 'Rearview::Ext::Numeric' do + context '#bytes_to_kilobytes' do + it "should convert bytes to kilobytes" do + expect(1024.bytes_to_kilobytes).to eq(1) + expect(10485760.bytes_to_kilobytes).to eq(10240) + end + end + context '#bytes_to_megabytes' do + it "should convert bytes to megabytes" do + expect(1048576.bytes_to_megabytes).to eq(1) + expect(10485760.bytes_to_megabytes).to eq(10) + end + end +end
Add missing spec for Numeric extension
diff --git a/app/controllers/api/v1/concepts_controller.rb b/app/controllers/api/v1/concepts_controller.rb index abc1234..def5678 100644 --- a/app/controllers/api/v1/concepts_controller.rb +++ b/app/controllers/api/v1/concepts_controller.rb @@ -11,6 +11,14 @@ end def index + # Returns all the concepts, sorted by level + # Example Response: + # { + # concept_level_2: [concepts where the parent id is null], + # concept_level_1: [concepts where parent id matches a level two concept], + # concept_level_0: [concepts where parent id matches a level one concept] + # } + # render json: Concept.all_with_level end
Add example response for Concepts API controller Index action.
diff --git a/app/controllers/dossier/reports_controller.rb b/app/controllers/dossier/reports_controller.rb index abc1234..def5678 100644 --- a/app/controllers/dossier/reports_controller.rb +++ b/app/controllers/dossier/reports_controller.rb @@ -29,11 +29,11 @@ end end + private + def report_class Dossier.name_to_class(params[:report]) end - - private def set_content_disposition! headers["Content-Disposition"] = %[attachment;filename=#{params[:report]}-report_#{Time.now.strftime('%m-%d-%Y_%H-%M-%S')}.#{params[:format]}]
Revert `report_class` to being private, since it should not be routed to.
diff --git a/app/controllers/pro_memberships_controller.rb b/app/controllers/pro_memberships_controller.rb index abc1234..def5678 100644 --- a/app/controllers/pro_memberships_controller.rb +++ b/app/controllers/pro_memberships_controller.rb @@ -30,8 +30,17 @@ return render(text: "Couldn't find user: #{params[:gift_to]}", status: 400) end manager.gift! plan, token, gift_to, params[:gift_message] + mixpanel.track "PRO gifted", { + gifted_to: gift_to.username, + gifted_by: current_user.username, + plan: plan.name + } else manager.subscribe! plan, token + mixpanel.track "PRO subscription", { + username: current_user.username, + plan: plan.name + } end rescue Exception => e return render(text: "Unknown error: #{e.message}", status: 400)
Add mixpanel tracking of PRO.
diff --git a/activesupport/activesupport.gemspec b/activesupport/activesupport.gemspec index abc1234..def5678 100644 --- a/activesupport/activesupport.gemspec +++ b/activesupport/activesupport.gemspec @@ -20,7 +20,7 @@ s.rdoc_options.concat ['--encoding', 'UTF-8'] - s.add_dependency 'i18n', '~> 0.6', '>= 0.6.2' + s.add_dependency('i18n', '~> 0.6', '>= 0.6.4') s.add_dependency 'multi_json', '~> 1.3' s.add_dependency 'tzinfo', '~> 0.3.33' s.add_dependency 'minitest', '~> 4.2'
Enforce i18n version >= v0.6.4 Keep in sync with 3-2-stable.
diff --git a/activesupport/test/abstract_unit.rb b/activesupport/test/abstract_unit.rb index abc1234..def5678 100644 --- a/activesupport/test/abstract_unit.rb +++ b/activesupport/test/abstract_unit.rb @@ -24,3 +24,8 @@ # Show backtraces for deprecated behavior for quicker cleanup. ActiveSupport::Deprecation.debug = true + +# Skips the current run on JRuby using Minitest::Assertions#skip +def jruby_skip(message = '') + skip message if RUBY_ENGINE == 'jruby' +end
Define jruby_skip to skip test on JRuby
diff --git a/db/migrate/20111118164631_create_skrill_transactions.rb b/db/migrate/20111118164631_create_skrill_transactions.rb index abc1234..def5678 100644 --- a/db/migrate/20111118164631_create_skrill_transactions.rb +++ b/db/migrate/20111118164631_create_skrill_transactions.rb @@ -7,7 +7,7 @@ t.integer :transaction_id t.integer :customer_id t.string :payment_type - t.timestamps + t.timestamps null: true end end end
Add `null: false` to migrations. Rails 5 is making it the default and specifying nothing results in a deprecation warning.
diff --git a/has_publishing.gemspec b/has_publishing.gemspec index abc1234..def5678 100644 --- a/has_publishing.gemspec +++ b/has_publishing.gemspec @@ -19,6 +19,7 @@ gem.add_dependency "activerecord" gem.add_dependency "activesupport" + gem.add_development_dependency "debugger" gem.add_development_dependency "rspec-rails" gem.add_development_dependency "sqlite3" end
Add development dependency on debugger
diff --git a/spec/features/create_a_question_spec.rb b/spec/features/create_a_question_spec.rb index abc1234..def5678 100644 --- a/spec/features/create_a_question_spec.rb +++ b/spec/features/create_a_question_spec.rb @@ -10,6 +10,7 @@ context "whit valid attributes" do subject do + fill_in "question_score", with: question.score fill_in "question_description", with: question.description click_on "Criar" end
Fix feature test of question creation
diff --git a/chefspec.gemspec b/chefspec.gemspec index abc1234..def5678 100644 --- a/chefspec.gemspec +++ b/chefspec.gemspec @@ -15,7 +15,7 @@ s.add_dependency('chef', '>= 10.0') s.add_dependency('erubis') - s.add_dependency('fauxhai', '~> 0.1') + s.add_dependency('fauxhai', '>= 0.1.1', '< 2.0') s.add_dependency('minitest-chef-handler', '>= 0.6.0') s.add_dependency('rspec', '~> 2.0')
Update Fauxhai dependency to allow also v1.x v1.0.0 has been released. Besides few fixture chenges and additions it includes new `path` option for specifying a local fixture data file. It also drops undocumented support for default platform version (except for the special "fauxhai" platform).
diff --git a/config.rb b/config.rb index abc1234..def5678 100644 --- a/config.rb +++ b/config.rb @@ -19,9 +19,22 @@ activate :relative_assets end -activate :deploy do |deploy| - deploy.build_before = true - deploy.method = :git +case ENV['TARGET'].to_s.downcase +when 'production' + activate :deploy do |deploy| + deploy.build_before = true + deploy.method = :rsync + deploy.user = 'propulsion' + deploy.host = 'propulsion.co' + deploy.path = '/var/www/static.propulsion.co/httpdocs' + deploy.clean = true + deploy.port = 22 + end +else + activate :deploy do |deploy| + deploy.build_before = true + deploy.method = :git + end end sprockets.import_asset 'html5shiv'
Add production option to deployment
diff --git a/app/controllers/forms_controller.rb b/app/controllers/forms_controller.rb index abc1234..def5678 100644 --- a/app/controllers/forms_controller.rb +++ b/app/controllers/forms_controller.rb @@ -2,26 +2,10 @@ include Cadmus::Renderable load_and_authorize_resource through: :convention - respond_to :html, :json - - def index - respond_with @forms - end def show - respond_with(@form) do |format| + respond_to do |format| format.json { render json: FormApiPresenter.new(@form, cadmus_renderer).as_json } end end - - def create - @form.save - respond_with @form - end - - private - - def form_params - params.require(:form).permit(:title) - end end
Remove the unnecessary actions only
diff --git a/config.rb b/config.rb index abc1234..def5678 100644 --- a/config.rb +++ b/config.rb @@ -5,13 +5,14 @@ http_path = "/" css_dir = "stylesheets" sass_dir = "sass" -images_dir = "images" +images_dir = "assets" javascripts_dir = "javascripts" # You can select your preferred output style here (can be overridden via the command line): # output_style = :expanded or :nested or :compact or :compressed output_style = :compressed +sourcemap = false # To enable relative paths to assets via compass helper functions. Uncomment: # relative_assets = true
Change default images directory before actually referencing it
diff --git a/app/controllers/index_controller.rb b/app/controllers/index_controller.rb index abc1234..def5678 100644 --- a/app/controllers/index_controller.rb +++ b/app/controllers/index_controller.rb @@ -1,5 +1,7 @@ class IndexController < ApplicationController REDIS_KEY_PREFIX = "bus-detective:index" + + force_ssl if: :ssl_configured?, except: [:letsencrypt] def show render text: redis.get("#{REDIS_KEY_PREFIX}:#{params[:revision] || current_index_key}") @@ -22,4 +24,8 @@ def redis @redis ||= Redis.new(url: ENV.fetch('REDISTOGO_URL', nil)) end + + def ssl_configured? + Rails.env.production? + end end
Use SSL for all non-api requests
diff --git a/app/controllers/items_controller.rb b/app/controllers/items_controller.rb index abc1234..def5678 100644 --- a/app/controllers/items_controller.rb +++ b/app/controllers/items_controller.rb @@ -2,13 +2,19 @@ def index @items = Item.all + respond_to do |format| + format.html # index.html.erb + format.xml { render xml: @items } + format.json { render json: @items } end def create - @item = Item.create(item_params) - # if item.save - # else - # end + @item = Item.new(item_params) + if @item.save + render json: @item + else + # ? + end end def show
Add respond_to method to user controller specifying response format
diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index abc1234..def5678 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -18,17 +18,26 @@ end end - # GET /users/:user_id/posts/:id/edit - def edit - end - # PUT /users/:user_id/posts/:id def update + post = Post.find(params[:id]) + if post.update(user_id: current_user.id, text: params[:text]) + flash[:success] = "Post update!" + redirect_to(:back) + else + flash[:danger] = "Sorry, something is wrong." + redirect_to(:back) + end end # DELETE /users/:user_id/posts/:id def destroy + post = Post.find(params[:id]) + post.destroy! + flash[:danger] = "Post deleted." + redirect_to(:back) + end end
Modify posts controllers and add new features
diff --git a/config.ru b/config.ru index abc1234..def5678 100644 --- a/config.ru +++ b/config.ru @@ -1,4 +1,6 @@ # This file is used by Rack-based servers to start the application. require ::File.expand_path('../config/environment', __FILE__) -run TravelSupportProgram::Application +map (ENV['RAILS_RELATIVE_URL_ROOT'] || '/') do + run TravelSupportProgram::Application +end
Support for RAILS_RELATIVE_URL_ROOT (running in a subdirectory)
diff --git a/lib/salesforce_bulk/query_result_collection.rb b/lib/salesforce_bulk/query_result_collection.rb index abc1234..def5678 100644 --- a/lib/salesforce_bulk/query_result_collection.rb +++ b/lib/salesforce_bulk/query_result_collection.rb @@ -22,10 +22,12 @@ def next if next? - @client.query_result(job_id, batch_id, result_ids[@current_index + 1], result_ids) - else - SalesforceBulk::QueryResultCollection.new(@client, @job_id, @batch_id) + replace(@client.query_result(job_id, batch_id, result_ids[@current_index + 1])) + @current_index += 1 + @result_id = @result_ids[@current_index] end + + self end def previous? @@ -34,10 +36,12 @@ def previous if previous? - @client.query_result(job_id, batch_id, result_ids[@current_index - 1], result_ids) - else - SalesforceBulk::QueryResultCollection.new(@client, @job_id, @batch_id) + replace(@client.query_result(job_id, batch_id, result_ids[@current_index - 1])) + @current_index -= 1 + @result_id = @result_ids[@current_index] end + + self end end
Update next and previous methods to use the Array.replace method to update collection with result from query_result call instead. If value is committed then the current index and result id values are updated.
diff --git a/config.ru b/config.ru index abc1234..def5678 100644 --- a/config.ru +++ b/config.ru @@ -1,6 +1,6 @@ require './init' -use Rack::Cache +use Rack::Cache if ENV['RACK_ENV'] == 'production' use Warden::Manager do |manager| manager.default_strategies :password
Use rack-cache only in production
diff --git a/cc-tool.rb b/cc-tool.rb index abc1234..def5678 100644 --- a/cc-tool.rb +++ b/cc-tool.rb @@ -5,6 +5,9 @@ depends_on "boost" => :build depends_on "pkg-config" => :build + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "libtool" => :build depends_on "libusb" def install @@ -12,6 +15,7 @@ ENV['PKG_CONFIG'] = "#{pkgconfig.opt_prefix}/bin/pkg-config" + system "autoreconf -i" system "./configure", "--prefix=#{prefix}", "--disable-debug" system "make" system "make", "install"
Add missing autocrap tools to generate `configure` script
diff --git a/dinghy.rb b/dinghy.rb index abc1234..def5678 100644 --- a/dinghy.rb +++ b/dinghy.rb @@ -10,7 +10,7 @@ depends_on 'docker' depends_on 'docker-machine' - depends_on 'unfs3' => %w[--HEAD] + depends_on 'unfs3' depends_on 'dnsmasq' def install
Revert "trying out a HEAD dependency" This reverts commit 1c7e7fdca4811e4569227817fb569b627540c9b2.
diff --git a/db/schema.rb b/db/schema.rb index abc1234..def5678 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1,3 +1,32 @@-ActiveRecord::Schema.define(:version => 0) do +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended to check this file into your version control system. + +ActiveRecord::Schema.define(:version => 20110405113203) do + + create_table "users", :force => true do |t| + t.string "email", :default => "", :null => false + t.string "encrypted_password", :limit => 128, :default => "", :null => false + t.string "reset_password_token" + t.datetime "remember_created_at" + t.integer "sign_in_count", :default => 0 + t.datetime "current_sign_in_at" + t.datetime "last_sign_in_at" + t.string "current_sign_in_ip" + t.string "last_sign_in_ip" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "users", ["email"], :name => "index_users_on_email", :unique => true + add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true end
Add User model to the database.
diff --git a/attributes/php.rb b/attributes/php.rb index abc1234..def5678 100644 --- a/attributes/php.rb +++ b/attributes/php.rb @@ -1,3 +1,3 @@-default['php']['versions'] = %w(5.5 5.6 7.0) +default['php']['versions'] = %w(5.5 5.6 7.0 7.1) default['php']['extensions'] = %w(bcmath bz2 cli common curl fpm gd gmp imap intl json ldap mbstring mcrypt mysql opcache pgsql pspell readline recode soap sqlite3 xml xmlrpc xsl zip) default['php']['pecl_extensions'] = %w(php-apcu php-apcu-bc php-gettext php-pear php-memcached php-redis php-uuid php-xdebug)
[TASK] Install PHP 7.1 by default
diff --git a/core/lib/spree/localized_number.rb b/core/lib/spree/localized_number.rb index abc1234..def5678 100644 --- a/core/lib/spree/localized_number.rb +++ b/core/lib/spree/localized_number.rb @@ -8,7 +8,9 @@ separator, delimiter = I18n.t([:'number.currency.format.separator', :'number.currency.format.delimiter']) non_number_characters = /[^0-9\-#{separator}]/ - # strip everything else first + # work on a copy, prevent original argument modification + number = number.dup + # strip everything else first, including thousands delimiter number.gsub!(non_number_characters, '') # then replace the locale-specific decimal separator with the standard separator if necessary number.gsub!(separator, '.') unless separator == '.'
Fix of bug in `Spree::LocalizedNumber.parse`, which mangles object passed as an argument.
diff --git a/dumb_delegator.gemspec b/dumb_delegator.gemspec index abc1234..def5678 100644 --- a/dumb_delegator.gemspec +++ b/dumb_delegator.gemspec @@ -6,9 +6,12 @@ gem.required_ruby_version = ">= 2.4.0" gem.authors = ["Andy Lindeman", "Steven Harman"] gem.email = ["alindeman@gmail.com", "steven@harmanly.com"] + gem.licenses = ["MIT"] gem.summary = "Delegator class that delegates ALL the things" - gem.description = <<-EOD - Delegator and SimpleDelegator in Ruby's stdlib are useful, but they pull in most of Kernel. This is not appropriate for many uses; for instance, delegation to Rails models. + gem.description = <<~EOD + Delegator and SimpleDelegator in Ruby's stdlib are useful, but they pull in most of Kernel. + This is not appropriate for many uses; for instance, delegation to Rails models. + DumbDelegator, on the other hand, delegates nearly everything to the wrapped object. EOD gem.homepage = "https://github.com/stevenharman/dumb_delegator"
Add license to Gemspec and tweak description
diff --git a/awsecrets.gemspec b/awsecrets.gemspec index abc1234..def5678 100644 --- a/awsecrets.gemspec +++ b/awsecrets.gemspec @@ -20,7 +20,7 @@ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ['lib'] - spec.add_runtime_dependency 'aws-sdk', '~> 2' + spec.add_runtime_dependency 'aws-sdk', '>= 2', '< 4' spec.add_runtime_dependency 'aws_config', '~> 0.1.0' spec.add_development_dependency 'bundler', '~> 1.9' spec.add_development_dependency 'rake', '~> 10.0'
Update aws-sdk version from `'~> 2'` to `'>= 2', '< 4'`
diff --git a/config/deploy.rb b/config/deploy.rb index abc1234..def5678 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -7,13 +7,24 @@ set :log_level, :info namespace :deploy do - after :restart, :clear_cache do on roles(:app), in: :groups, limit: 3, wait: 10 do - execute :sudo, :service, :tandygram, :restart + execute :sudo, :service, :tandygram, :restart end end +end +namespace :tandygram do + task :reset do + on roles(:app), in: :groups, limit: 3, wait: 10 do + bak_dir = "/home/#{fetch(:application)}/tiedot-bak" + + execute :mkdir, '-p', bak_dir + execute :sudo, :service, :tandygram, :stop + execute :mv, '/tmp/tandy-tiedot', "#{bak_dir}/bak-#{Time.now.to_i}" + execute :sudo, :service, :tandygram, :start + end + end end after 'deploy:publishing', 'deploy:restart'
[F] Add Capistrano task to reset data Backs it up first ;)
diff --git a/test/background_test.rb b/test/background_test.rb index abc1234..def5678 100644 --- a/test/background_test.rb +++ b/test/background_test.rb @@ -8,11 +8,9 @@ end def test_background_render - assert_silent do - InvoicePrinter.render(document: @invoice, background: './examples/background.jpg') - InvoicePrinter.render(document: @invoice, background: nil) - InvoicePrinter.render(document: @invoice) - end + InvoicePrinter.render(document: @invoice, background: './examples/background.jpg') + InvoicePrinter.render(document: @invoice, background: nil) + InvoicePrinter.render(document: @invoice) end def test_missing_background_raises_an_exception
Remove assert_silent call from background test
diff --git a/config/routes.rb b/config/routes.rb index abc1234..def5678 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,7 +1,7 @@ # rubocop:disable Metrics/BlockLength Rails.application.routes.draw do authenticated :developer do - root 'developers#profile', as: :developer_root + root 'search#index', as: :developer_root end authenticated :employer do @@ -9,6 +9,7 @@ end root to: 'pages#index' + get '/cookies-policy', to: 'pages#cookies_policy' get '/privacy-policy', to: 'pages#privacy_policy'
Make search default root for logged in user
diff --git a/test/form/test_combo.rb b/test/form/test_combo.rb index abc1234..def5678 100644 --- a/test/form/test_combo.rb +++ b/test/form/test_combo.rb @@ -4,29 +4,17 @@ require_relative '../../lib/ppcurses.rb' +@app = PPCurses::Application.new + +form = PPCurses::Form.new + +state_box = PPCurses::ComboBox.new('State', + ['Maine', 'New York', 'Kansas', 'California']) +form.add(state_box) -def display_form(screen) - - form = PPCurses::Form.new(screen) - - state_box = PPCurses::ComboBox.new('State', - ['Maine', 'New York', 'Kansas', 'California']) - - form.add(state_box) - - form.handle_input - - { state_selected: state_box.object_value_of_selected_item, - form_submitted: form.submitted?} -end +@app.content_view = form +@app.launch - -screen = PPCurses::Screen.new -form_response = screen.run { display_form(screen) } - -puts 'Form response data: ' -puts form_response -
Revise test to latest interfaces.
diff --git a/lib/ui.rb b/lib/ui.rb index abc1234..def5678 100644 --- a/lib/ui.rb +++ b/lib/ui.rb @@ -0,0 +1,23 @@+require_relative 'console' + +class Ui + attr_reader :io + + def initialize(io) + @io = io + end + + def display_intro_msg(game_being_played) + io.display_intro_msg(game_being_played) + end + + def show_board(board) + io.show_board(board) + end + + def get_user_input + io.get_user_input + end + +end +
Create Ui class inorder to remove dependency on stdin and stdout
diff --git a/sensu-plugins.gemspec b/sensu-plugins.gemspec index abc1234..def5678 100644 --- a/sensu-plugins.gemspec +++ b/sensu-plugins.gemspec @@ -1,4 +1,4 @@-require File.expand_path(File.dirname(__FILE__)) + '/lib/sensu/plugins' +require File.expand_path(File.dirname(__FILE__)) + '/lib/sensu/plugin' Gem::Specification.new do |s| s.name = 'sensu-plugins'
Fix require (for VERSION) in gemspec
diff --git a/lib/twitch_ruby/representers/credentials_representer.rb b/lib/twitch_ruby/representers/credentials_representer.rb index abc1234..def5678 100644 --- a/lib/twitch_ruby/representers/credentials_representer.rb +++ b/lib/twitch_ruby/representers/credentials_representer.rb @@ -17,8 +17,8 @@ property :access_token property :refresh_token + property :expires_in property :scope - end end end
Add expires_in to returned credentials
diff --git a/spec/models/attendee_spec.rb b/spec/models/attendee_spec.rb index abc1234..def5678 100644 --- a/spec/models/attendee_spec.rb +++ b/spec/models/attendee_spec.rb @@ -0,0 +1,22 @@+# == Schema Information +# Schema version: 20090224005026 +# +# Table name: attendees +# +# id :integer(4) not null, primary key +# member_id :integer(4) +# raid_id :integer(4) +# attendance :float +# + +require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') + +describe InvisionUserConverge do + before(:each) do + @attendee = Attendee.make + end + + it "should be valid" do + @attendee.should be_valid + end +end
Add an Attendee spec, just in case we ever do anything in that model.
diff --git a/spec/load_profiles_spec.rb b/spec/load_profiles_spec.rb index abc1234..def5678 100644 --- a/spec/load_profiles_spec.rb +++ b/spec/load_profiles_spec.rb @@ -0,0 +1,26 @@+require 'spec_helper' + +describe 'Load profiles' do + Atlas::Dataset.all.each do |dataset| + describe "for #{ dataset.key.upcase }" do + Pathname.glob(dataset.dataset_dir.join('load_profiles/*.csv')) do |file| + it "#{ file.basename } does not permit CR (\\r) line endings" do + message = "expected #{ file.relative_path_from(Atlas.data_dir) } " \ + "to not have CR line endings" + + expect(file.read).to_not match(/\r[^\n]/), message + end + + it "#{ file.basename } should something" do + values = File.foreach(file).map(&:to_f) + in_joules = values.reduce(:+) * 3600 + + # The sum of the values in the load profile ought to equal 1.0 / 3600 + # since the load profile will implicitly convert values from ETEngine, + # which are in Joules, into watthours. + expect(in_joules).to be_within(1e-3).of(1.0) + end # something + end # each profile + end # for dataset + end # each dataset +end # Load profiles
Add validation of load profiles Asserts that: * The file does not use CR (\r) line endings. Such files will not load correctly in the Merit library (and aren't "correct" on any modern platform anyway). * That the values in the load profile won't overload or underload the producer in the Merit Library.
diff --git a/mailer.rb b/mailer.rb index abc1234..def5678 100644 --- a/mailer.rb +++ b/mailer.rb @@ -22,7 +22,8 @@ class AuthorityMailer < ActionMailer::Base def email(to, message_text, message_url) mail(:to => to, :bcc => "contact@openaustralia.org", :from => "noreply@openaustraliafoundation.org.au", - :subject => "A Citizen is contacting you via Twitter using Tweet My Council") + :subject => "A Citizen is contacting you via Twitter using Tweet My Council", + :body => "A Citizen is contacting you via Twitter using Tweet My Council\n\n#{message_text}\n\nTo see their full message visit:\n#{message_url}\n\nTo reply to the Citizen directly please sign up for Twitter and respond to them there. Please DO NOT reply to this email.\n\nTo find out more about Tweet My Council visit:\nhttp://twitter.com/TweetMyCouncil") end end
Revert accidental commenting out of body of email!
diff --git a/lib/clearance/sessions_controller.rb b/lib/clearance/sessions_controller.rb index abc1234..def5678 100644 --- a/lib/clearance/sessions_controller.rb +++ b/lib/clearance/sessions_controller.rb @@ -32,6 +32,7 @@ def login_via_password(email, password, remember_me) user = User.authenticate(email, password) if login(user) + create_session_for(user) remember(user) if remember_me == '1' login_successful else
Create session for user when logging in.
diff --git a/test/test_helper.rb b/test/test_helper.rb index abc1234..def5678 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -4,9 +4,10 @@ require File.expand_path("../dummy/config/environment.rb", __FILE__) require "rails/test_help" -require "minitest/pride" +require "minitest/spec" require "minitest/rails/capybara" require "minitest/reporters" + require "capybara/poltergeist" require "capybara-screenshot/minitest"
Clean up requires in test helper
diff --git a/test/test_helper.rb b/test/test_helper.rb index abc1234..def5678 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -36,6 +36,8 @@ require 'fluent/plugin/out_filter_list' require 'fluent/plugin/filter_filter_list' -class Minitest::Test - include Fluent::Test::Helpers +module Minitest + class Test + include Fluent::Test::Helpers + end end
Use nested style class notation
diff --git a/db/migrate/20110125200118_add_uniqueness_index_to_people.rb b/db/migrate/20110125200118_add_uniqueness_index_to_people.rb index abc1234..def5678 100644 --- a/db/migrate/20110125200118_add_uniqueness_index_to_people.rb +++ b/db/migrate/20110125200118_add_uniqueness_index_to_people.rb @@ -2,15 +2,11 @@ def self.up remove_index :people, [:user_id, :project_id] Person.connection.execute <<-EOF - DELETE #{Person.table_name} - FROM #{Person.table_name} - LEFT OUTER JOIN ( - SELECT MIN(id) as id, user_id, project_id - FROM #{Person.table_name} - GROUP BY user_id, project_id) as KeepRows ON - #{Person.table_name}.id = KeepRows.id - WHERE - KeepRows.id IS NULL + DELETE FROM #{Person.table_name} + WHERE id NOT IN + (SELECT id FROM (SELECT MIN(id) as id, user_id, project_id + FROM #{Person.table_name} + GROUP BY user_id, project_id) KeepRows) EOF add_index :people, [:user_id, :project_id], :unique => true end
Fix migration path for PostgreSQL compatbility
diff --git a/spec/lib/luhn_spec.rb b/spec/lib/luhn_spec.rb index abc1234..def5678 100644 --- a/spec/lib/luhn_spec.rb +++ b/spec/lib/luhn_spec.rb @@ -0,0 +1,81 @@+require 'spec_helper' + +describe Luhnc do + + describe 'attributes' do + subject { described_class.new(123) } + + it 'responds to attribute' do + [:number, :check_digit].each do |attr| + expect(subject).to respond_to attr + end + end + end + + ## Class methods + describe '.valid?' do + subject { described_class.valid?(4556974027974373) } + + it 'returns true' do + expect(subject).to be_true + end + end + + ## Instance methods + describe '.validate' do + subject { described_class.new(12345).validate } + + describe 'validates the sum_of_all_numbers' do + context 'modulo 10 is equal to 0' do + before { described_class.any_instance. + stub(:sum_of_all_numbers). + and_return(60) } + + it 'returns true' do + expect(subject).to be_true + end + end + + context 'modulo 10 is NOT equal to 0' do + before { described_class.any_instance. + stub(:sum_of_all_numbers). + and_return(12) } + + it 'returns false' do + expect(subject).to be_false + end + end + end + end + + describe '.sum_of_all_numbers' do + before { described_class.any_instance. + stub(:double_odd_numbers). + and_return [1,2,3,4,5] } + + subject { described_class.new(12345).sum_of_all_numbers } + + it 'sums up the double_odd_numbers' do + expect(subject).to eql 15 + end + end + + # TODO: Make check for even + describe '.double_odd_numbers' do + subject { described_class.new(7992739871).double_odd_numbers } + + describe 'reverses the number set and on odd position of number' do + it 'doubles and sums number' do + expect(subject).to eql [1, 5, 8, 9, 3, 5, 2, 9, 9, 5] + end + + context 'number ends with 0' do + subject { described_class.new(8960).double_odd_numbers } + + it 'keeps the 0, doubles and sums number' do + expect(subject).to eql [0,3,9,7] + end + end + end + end +end
Write specs for the Luhn class
diff --git a/lib/HDLRuby/high_samples/instance.rb b/lib/HDLRuby/high_samples/instance.rb index abc1234..def5678 100644 --- a/lib/HDLRuby/high_samples/instance.rb +++ b/lib/HDLRuby/high_samples/instance.rb @@ -0,0 +1,38 @@+require 'HDLRuby' + +configure_high + + +# A simple 16-bit or +system :or16 do + [15..0].input :x,:y + [16..0].output :s + + s <= x | y +end + +# A 32-bit or made of two 16-bit ones. +system :or32 do + [31..0].input :x,:y + [32..0].output :s + + or16 :or0 + or16 :or1 + + or0.x <= x[15..0] + or0.y <= y[15..0] + s[15..0] <= or0.s[15..0] + + or1.x <= x[15..0] + or1.y <= y[15..0] + s[15..0] <= or1.s[15..0] +end + +# Instantiate it for checking. +or32 :or32I + +# Generate the low level representation. +low = or32I.to_low + +# Displays it +puts low.to_yaml
Add a sample for testing instantiation.
diff --git a/jekyll-conrefifier.gemspec b/jekyll-conrefifier.gemspec index abc1234..def5678 100644 --- a/jekyll-conrefifier.gemspec +++ b/jekyll-conrefifier.gemspec @@ -19,5 +19,5 @@ spec.add_development_dependency "jekyll", "~> 2.0" spec.add_development_dependency "rake" - spec.add_development_dependency 'minitest', "~> 5.0" + spec.add_development_dependency "rspec" end
Add rspec as dev dependency
diff --git a/app/models/ability.rb b/app/models/ability.rb index abc1234..def5678 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -18,7 +18,7 @@ can :manage, Event can :create, Alert can [:update, :remove_avatar], User, :id => user.id - can [:read, :added_relics, :checked_relics], User + can [:read, :added_relics, :checked_relics, :my_routes], User can [:edit, :update], Widget::Direction, :user_id => user.id end end
Allow user to access "My routes" tab
diff --git a/app/models/lottery.rb b/app/models/lottery.rb index abc1234..def5678 100644 --- a/app/models/lottery.rb +++ b/app/models/lottery.rb @@ -13,4 +13,8 @@ validates_presence_of :name, :scheduled_start_date validates_uniqueness_of :name, case_sensitive: false, scope: :organization + + scope :with_policy_scope_attributes, -> do + from(select("lotteries.*, organizations.concealed").joins(:organization), :lotteries) + end end
Add policy scope attributes to Lottery model
diff --git a/lib/geokit-rails3/core_extensions.rb b/lib/geokit-rails3/core_extensions.rb index abc1234..def5678 100644 --- a/lib/geokit-rails3/core_extensions.rb +++ b/lib/geokit-rails3/core_extensions.rb @@ -5,6 +5,6 @@ # resulting distance. def sort_by_distance_from(origin, opts={}) warn "[DEPRECATION] `Array#sort_by_distance_from(origin, opts)` is deprecated. Please use Array#sort_by{|e| e.distance_to(origin, opts)} instead which is not destructive" - sort_by!{|e| e.distance_to(origin, opts)} + self[0..-1] = sort_by{|e| e.distance_to(origin, opts)} end end
Make code ruby 1.8 compatible
diff --git a/lib/nehm/commands/version_command.rb b/lib/nehm/commands/version_command.rb index abc1234..def5678 100644 --- a/lib/nehm/commands/version_command.rb +++ b/lib/nehm/commands/version_command.rb @@ -1,4 +1,21 @@ module Nehm - class DlCommand < Command + class VersionCommand < Command + + def execute + UI.say VERSION + end + + def program_name + 'nehm version' + end + + def summary + "Show nehm's verion" + end + + def usage + program_name + end + end end
Add all logic to 'version' command