diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/app/decorators/project_decorator.rb b/app/decorators/project_decorator.rb
index abc1234..def5678 100644
--- a/app/decorators/project_decorator.rb
+++ b/app/decorators/project_decorator.rb
@@ -46,8 +46,9 @@
def progress_bar
+ width = source.progress > 100 ? 100 : source.progress
content_tag(:div, id: :progress_wrapper) do
- content_tag(:div, nil, id: :progress, style: "width: #{source.progress}%")
+ content_tag(:div, nil, id: :progress, style: "width: #{width}%")
end
end
end
|
Fix progress bar in the project box.
|
diff --git a/spec/integration/auth_spec.rb b/spec/integration/auth_spec.rb
index abc1234..def5678 100644
--- a/spec/integration/auth_spec.rb
+++ b/spec/integration/auth_spec.rb
@@ -13,6 +13,20 @@
click_button 'Register'
expect(page).to have_content 'You have signed up successfully'
+ end
+
+ it 'should let me login' do
+ mail = 'registered@user.com'
+ pass = 'cosmoflips'
+ visit '/login'
+
+ User.create(:password => pass, :email => mail)
+
+ fill_in 'Email', :with => mail
+ fill_in 'Password', :with => pass
+
+ click_button 'Sign in'
+ expect(page).to have_content 'Signed in successfully.'
end
it 'should show registration page at /register' do
|
Write test for current login scenario
|
diff --git a/spec/presenters/tree_node/pxe_image_type_spec.rb b/spec/presenters/tree_node/pxe_image_type_spec.rb
index abc1234..def5678 100644
--- a/spec/presenters/tree_node/pxe_image_type_spec.rb
+++ b/spec/presenters/tree_node/pxe_image_type_spec.rb
@@ -3,5 +3,5 @@ let(:object) { FactoryBot.create(:pxe_image_type) }
include_examples 'TreeNode::Node#key prefix', 'pit-'
- include_examples 'TreeNode::Node#icon', 'ff ff-network-card'
+ include_examples 'TreeNode::Node#icon', 'pficon pficon-image'
end
|
Adjust spec for TreeNode::PxeImageType after the decorator icon change
|
diff --git a/app/api/v1/defaults.rb b/app/api/v1/defaults.rb
index abc1234..def5678 100644
--- a/app/api/v1/defaults.rb
+++ b/app/api/v1/defaults.rb
@@ -31,6 +31,11 @@ JWT::VerificationError do |e|
error!({ errors: Array(e.message) }, 400)
end
+
+ # Global handler for any unexpected exception
+ rescue_from :all do |e|
+ error!({ errors: Array(e.message) }, 500)
+ end
end
end
end
|
Add global error handler for unexpected exceptions
|
diff --git a/striped.gemspec b/striped.gemspec
index abc1234..def5678 100644
--- a/striped.gemspec
+++ b/striped.gemspec
@@ -21,6 +21,7 @@
gem.add_development_dependency 'rspec', '~> 2.12'
gem.add_development_dependency 'webmock', '~> 1.9'
+ gem.add_development_dependency 'vcr', '~> 2.4'
gem.add_development_dependency 'rake', '~> 10.0'
gem.add_development_dependency 'coveralls', '~> 0.6'
end
|
Add vcr as a development dependency
|
diff --git a/spec/space2underscore_spec.rb b/spec/space2underscore_spec.rb
index abc1234..def5678 100644
--- a/spec/space2underscore_spec.rb
+++ b/spec/space2underscore_spec.rb
@@ -5,8 +5,4 @@ expect(Space2underscore.convert(['fuga hoge foo'])).to include('_') # String case
expect(Space2underscore.convert(%w(fuga hoge foo))).to include('_') # Array case
end
-
- it 'should be Successful copied' do
- expect(Space2underscore.generate_command('fuga_hoge_foo')).to eq("echo fuga_hoge_foo | ruby -pe 'chomp' | pbcopy")
- end
end
|
Remove an example, It is needless
|
diff --git a/lib/capones_recipes/tasks/airbrake/symlink.rb b/lib/capones_recipes/tasks/airbrake/symlink.rb
index abc1234..def5678 100644
--- a/lib/capones_recipes/tasks/airbrake/symlink.rb
+++ b/lib/capones_recipes/tasks/airbrake/symlink.rb
@@ -7,4 +7,4 @@ run "ln -nfs #{shared_path}/config/initializers/airbrake.rb #{release_path}/config/initializers/airbrake.rb"
end
end
-end+end
|
Add missing newline to EOF.
|
diff --git a/update.rb b/update.rb
index abc1234..def5678 100644
--- a/update.rb
+++ b/update.rb
@@ -19,10 +19,11 @@ end
end.parse!
-debline = open(options[:config]).read.split(/\n/)[0]
-
db = SQLite3::Database.new(options[:database])
db.execute("CREATE TABLE IF NOT EXISTS packages (package TEXT PRIMARY KEY, version TEXT, maintainer TEXT, installed_size INTEGER, size INTEGER, homepage TEXT, section TEXT, remote_path TEXT, md5 TEXT, description TEXT, status INTEGER)")
db.execute("CREATE TABLE IF NOT EXISTS depends (package TEXT, depend TEXT, version TEXT)")
-APT.new(debline).save_to_sqlite(:db => db)
+open(options[:config]).read.split(/\n/).each |debline|
+ next if debline[0..1] == '#'
+ APT.new(debline).save_to_sqlite(:db => db)
+end
|
Support updating from multiple repositories.
|
diff --git a/lib/instana/frameworks/rails.rb b/lib/instana/frameworks/rails.rb
index abc1234..def5678 100644
--- a/lib/instana/frameworks/rails.rb
+++ b/lib/instana/frameworks/rails.rb
@@ -5,7 +5,7 @@ ::Instana.logger = ::Rails.logger if ::Rails.logger
if ::Rails::VERSION::MAJOR < 3
- ::Rails.configuration.after_initialization do
+ ::Rails.configuration.after_initialize do
::Instana.logger.info "Instrumenting Rack"
::Rails.configuration.middleware.insert 0, ::Instana::Rack
end
|
Fix Rails 2 initialization block
|
diff --git a/thailang4r.gemspec b/thailang4r.gemspec
index abc1234..def5678 100644
--- a/thailang4r.gemspec
+++ b/thailang4r.gemspec
@@ -6,7 +6,7 @@ s.description = "Thai language tools for Ruby, i.e. a word tokenizer, a character level indentifier, and a romanization tool"
s.homepage = "https://github.com/veer66/thailang4r"
s.require_paths = ["lib"]
- s.required_ruby_version = Gem::Requirement.new(">= 3.0.0")
+ s.required_ruby_version = Gem::Requirement.new(">= 2.0.0")
s.summary = "Thai language utility for Ruby"
s.files = Dir.glob("lib/**/*") + %w(LICENSE README.md Rakefile) + Dir.glob("data/*")
s.require_path = 'lib'
|
Downgrade Ruby version requirement to >= 2.0.0
|
diff --git a/lib/bootstrap_validator_rails/form_builder.rb b/lib/bootstrap_validator_rails/form_builder.rb
index abc1234..def5678 100644
--- a/lib/bootstrap_validator_rails/form_builder.rb
+++ b/lib/bootstrap_validator_rails/form_builder.rb
@@ -20,7 +20,8 @@ options[:data] ||= {}
attribute = @attributes.validator_data(method)
options[:data] = options[:data].merge(attribute)
- super(method, options, checked_value, unchecked_value, &block)
+ options[:include_hidden] = false
+ content_tag :div, super, class: 'form-group'
end
end
end
|
Exclude hidden field from check_box
|
diff --git a/lib/selenium/webdriver/common/element_mini.rb b/lib/selenium/webdriver/common/element_mini.rb
index abc1234..def5678 100644
--- a/lib/selenium/webdriver/common/element_mini.rb
+++ b/lib/selenium/webdriver/common/element_mini.rb
@@ -3,15 +3,16 @@ module Selenium
module WebDriver
- ##
- # Monkey Patch to add ie_safe_click method to webdriver
- #
class Element
def ie_safe_click
bridge.browser == :internet_explorer ? send_keys(:enter) : click
end
+ def ie_safe_checkbox_click
+ bridge.browser == :internet_explorer ? send_keys(:space) : click
+ end
+
end
end
|
[JT][111704448] Add ie_safe_checkbox_click to webdriver monkey patch
|
diff --git a/library/socket/socket/udp_server_recv_spec.rb b/library/socket/socket/udp_server_recv_spec.rb
index abc1234..def5678 100644
--- a/library/socket/socket/udp_server_recv_spec.rb
+++ b/library/socket/socket/udp_server_recv_spec.rb
@@ -20,15 +20,8 @@
@client.write('hello')
- # FreeBSD sockets are not instantaneous over loopback and
- # will EAGAIN on recv.
- platform_is :darwin, :freebsd do
- IO.select([@server])
- end
-
- # TODO: remove it after debugging
- # https://gist.github.com/ko1/0efd60ce78724d1c3bf313fc4b712c59#file-brlog-trunk-test-spec-20190204-141218-L402
- msg = :unset
+ readable, _, _ = IO.select([@server])
+ readable.count.should == 1
Socket.udp_server_recv([@server]) do |message, source|
msg = message
|
Make sure to wait for socket to be readable.
git-svn-id: ab86ecd26fe50a6a239cacb71380e346f71cee7d@67004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
diff --git a/Formula/imdb-tags.rb b/Formula/imdb-tags.rb
index abc1234..def5678 100644
--- a/Formula/imdb-tags.rb
+++ b/Formula/imdb-tags.rb
@@ -9,6 +9,7 @@
def install
ENV["GOPATH"] = "#{buildpath}/Godeps/_workspace"
+ system("mkdir -p #{buildpath}/Godeps/_workspace/src/github.com/dillonhafer/imdb-tags")
system("go build -o imdb-tags")
bin.install("imdb-tags")
end
|
Add mkdir command to imdb
|
diff --git a/core/lib/spree/core/testing_support/factories/product_factory.rb b/core/lib/spree/core/testing_support/factories/product_factory.rb
index abc1234..def5678 100644
--- a/core/lib/spree/core/testing_support/factories/product_factory.rb
+++ b/core/lib/spree/core/testing_support/factories/product_factory.rb
@@ -6,8 +6,8 @@ description { Faker::Lorem.paragraphs(rand(5)+1).join("\n") }
# associations:
- tax_category { |r| TaxCategory.find(:first) || r.association(:tax_category) }
- shipping_category { |r| ShippingCategory.find(:first) || r.association(:shipping_category) }
+ tax_category { |r| Spree::TaxCategory.find(:first) || r.association(:tax_category) }
+ shipping_category { |r| Spree::ShippingCategory.find(:first) || r.association(:shipping_category) }
price 19.99
cost_price 17.00
|
Fix model references in product factory
|
diff --git a/Nacre.gemspec b/Nacre.gemspec
index abc1234..def5678 100644
--- a/Nacre.gemspec
+++ b/Nacre.gemspec
@@ -16,6 +16,7 @@ gem.version = Nacre::VERSION
gem.add_dependency 'faraday'
+ gem.add_dependency 'json'
gem.add_dependency 'active_support'
gem.add_development_dependency 'rspec'
gem.add_development_dependency 'rake'
|
Add json dependency to gemspec
|
diff --git a/templates/spec_helper.rb b/templates/spec_helper.rb
index abc1234..def5678 100644
--- a/templates/spec_helper.rb
+++ b/templates/spec_helper.rb
@@ -20,6 +20,8 @@
config.example_status_persistence_file_path = "tmp/rspec_examples.txt"
config.order = :random
+
+ config.default_formatter = 'doc' if config.files_to_run.one?
end
WebMock.disable_net_connect!(allow_localhost: true)
|
Use doc formatter for rspec, when rspec is run with one file
|
diff --git a/test/models/user_test.rb b/test/models/user_test.rb
index abc1234..def5678 100644
--- a/test/models/user_test.rb
+++ b/test/models/user_test.rb
@@ -1,7 +1,39 @@ require 'test_helper'
class UserTest < ActiveSupport::TestCase
- # test "the truth" do
- # assert true
- # end
+ test "should not save user without a name" do
+ user = User.new(
+ username: "jennabear",
+ email: "jenna@gmail.com",
+ password: "1234567",
+ longitude: 122.0,
+ latitude: 37.0,
+ about_me: "Hello, I am a programmer looking for a workout partner",
+ gender: "female")
+ assert_not user.save, "Saved user without a name"
+ end
+
+ test "should not save user without a username" do
+ user = User.new(
+ name: "jenna",
+ email: "jenna@gmail.com",
+ password: "1234567",
+ longitude: 122.0,
+ latitude: 37.0,
+ about_me: "Hello, I am a programmer looking for a workout partner",
+ gender: "female")
+ assert_not user.save, "Saved user without a username"
+ end
+
+ test "should not save user without a password" do
+ user = User.new(
+ name: "jenna",
+ username: "jennabear",
+ email: "jenna@gmail.com",
+ longitude: 122.0,
+ latitude: 37.0,
+ about_me: "Hello, I am a programmer looking for a workout partner",
+ gender: "female")
+ assert_not user.save, "Saved user without a password"
+ end
end
|
Add test for user models
|
diff --git a/post-clean.rb b/post-clean.rb
index abc1234..def5678 100644
--- a/post-clean.rb
+++ b/post-clean.rb
@@ -2,11 +2,11 @@ # doc/*.rb.html
# doc/ex/* (!rb)
# Bug #246: Don't use chdir!
-require 'ftools'
+require 'fileutils'
targets = Dir['doc/*.rb.html']
-File.safe_unlink(*targets) unless targets.empty?
+FileUtils.safe_unlink(targets) unless targets.empty?
targets = Dir['doc/ex/*']
targets.delete_if { |entry| File.directory?(entry) || %r{\.rb\z}.match(entry) }
-File.safe_unlink(*targets) unless targets.empty?
+FileUtils.safe_unlink(targets) unless targets.empty?
|
Use "fileutils" instead of "ftools"
|
diff --git a/recurly_event.gemspec b/recurly_event.gemspec
index abc1234..def5678 100644
--- a/recurly_event.gemspec
+++ b/recurly_event.gemspec
@@ -13,14 +13,6 @@ spec.homepage = "https://github.com/ejaypcanaria/recurly_event"
spec.license = "MIT"
- # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
- # delete this section to allow pushing this gem to any host.
- if spec.respond_to?(:metadata)
- spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
- else
- raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
- end
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
Remove some unnecessary stuff in gemspec
|
diff --git a/color-scheme-validator.gemspec b/color-scheme-validator.gemspec
index abc1234..def5678 100644
--- a/color-scheme-validator.gemspec
+++ b/color-scheme-validator.gemspec
@@ -22,5 +22,5 @@
spec.add_development_dependency "bundler", "~> 1.10"
spec.add_development_dependency "rake", "~> 10.0"
- spec.add_development_dependency "test-unit", "~> 3.1.3"
+ spec.add_development_dependency "test-unit", "~> 3.2.1"
end
|
Upgrade test-unit version to "~> 3.2.1"
|
diff --git a/lib/buildr/version.rb b/lib/buildr/version.rb
index abc1234..def5678 100644
--- a/lib/buildr/version.rb
+++ b/lib/buildr/version.rb
@@ -14,5 +14,5 @@ # the License.
module Buildr
- VERSION = '1.4.11.dev'.freeze
+ VERSION = '1.4.11'.freeze
end
|
Remove suffix in preparation for release
git-svn-id: d8f3215415546ce936cf3b822120ca56e5ebeaa0@1456386 13f79535-47bb-0310-9956-ffa450edef68
|
diff --git a/lib/endi_feed/util.rb b/lib/endi_feed/util.rb
index abc1234..def5678 100644
--- a/lib/endi_feed/util.rb
+++ b/lib/endi_feed/util.rb
@@ -1,3 +1,4 @@+# encoding: utf-8
require 'uri'
require 'rss'
require 'time'
@@ -12,9 +13,10 @@ module_function
# Fetches and parses RSS feed
+ # @param [String] url to parse
# @return [RSS] parsed XML feed or nil
- def parse_feed
- open('http://www.elnuevodia.com/rss/noticias.xml') do |rss|
+ def parse_feed(url = 'http://www.elnuevodia.com/rss/noticias.xml')
+ open(url) do |rss|
RSS::Parser.parse(rss)
end
end
|
Add url parameter to parse_feed method
|
diff --git a/lib/proxy_rb/setup.rb b/lib/proxy_rb/setup.rb
index abc1234..def5678 100644
--- a/lib/proxy_rb/setup.rb
+++ b/lib/proxy_rb/setup.rb
@@ -59,7 +59,11 @@ runtime.event_bus.register(
:after_resource_fetched,
proc do |event|
- runtime.announcer.announce :http_response_headers, event.entity.driver.response_headers
+ begin
+ runtime.announcer.announce :http_response_headers, event.entity.driver.response_headers
+ rescue Capybara::NotSupportedByDriverError
+ runtime.announcer.announce :http_response_headers, { 'Message': format('Using #response_headers with the current driver "%s" is currently not supported', event.entity.driver.class) }
+ end
end
)
end
|
Handle unsupported response headers method
|
diff --git a/lib/remedy/console.rb b/lib/remedy/console.rb
index abc1234..def5678 100644
--- a/lib/remedy/console.rb
+++ b/lib/remedy/console.rb
@@ -9,11 +9,11 @@ module_function
def input
- STDIN
+ @input ||= $stdin
end
def output
- STDOUT
+ @output ||= $stdout
end
def raw
@@ -41,7 +41,7 @@ size.last
end
alias_method :width, :columns
-
+
def rows
size.first
end
|
Replace STDIN with and use an instance variable to provide for switchable IO.
|
diff --git a/library/pp/pp_spec.rb b/library/pp/pp_spec.rb
index abc1234..def5678 100644
--- a/library/pp/pp_spec.rb
+++ b/library/pp/pp_spec.rb
@@ -2,14 +2,6 @@ require 'pp'
describe "PP.pp" do
- before :each do
- @original_stdout = $stdout
- end
-
- after :each do
- $stdout = @original_stdout
- end
-
it 'works with default arguments' do
array = [1, 2, 3]
@@ -19,14 +11,14 @@ end
it 'allows specifying out explicitly' do
- $stdout = IOStub.new
+ array = [1, 2, 3]
other_out = IOStub.new
- array = [1, 2, 3]
- PP.pp array, other_out
+ lambda {
+ PP.pp array, other_out
+ }.should output "" # no output on stdout
other_out.to_s.should == "[1, 2, 3]\n"
- $stdout.to_s.should == ''
end
it "needs to be reviewed for spec completeness"
|
Use the output matcher in PP.pp to avoid touching $stdout directly
|
diff --git a/app/models/document.rb b/app/models/document.rb
index abc1234..def5678 100644
--- a/app/models/document.rb
+++ b/app/models/document.rb
@@ -9,10 +9,22 @@ }
def draft
- content_items.find_by(state: "draft")
+ draft_items = content_items.where(state: "draft")
+
+ if draft_items.size > 1
+ raise "There should only be one draft item"
+ end
+
+ draft_items.first
end
def live
- content_items.find_by(state: %w(published unpublished))
+ live_items = content_items.where(state: %w(published unpublished))
+
+ if live_items.size > 1
+ raise "There should only be one previous published or unpublished item"
+ end
+
+ live_items.first
end
end
|
Add checks for draft and live content items
|
diff --git a/db/migrate/20130614175900_empty_exercises.rb b/db/migrate/20130614175900_empty_exercises.rb
index abc1234..def5678 100644
--- a/db/migrate/20130614175900_empty_exercises.rb
+++ b/db/migrate/20130614175900_empty_exercises.rb
@@ -0,0 +1,13 @@+class EmptyExercises < ActiveRecord::Migration
+ def up
+ create_table :exercises do |t|
+ t.string :task_id
+ t.text :yaml
+ t.timestamps
+ end
+ end
+
+ def down
+ drop_table :exercises
+ end
+end
|
Include exercises table just in case we're not linking the site to a student-checklist web app.
|
diff --git a/scraper_tools.gemspec b/scraper_tools.gemspec
index abc1234..def5678 100644
--- a/scraper_tools.gemspec
+++ b/scraper_tools.gemspec
@@ -2,14 +2,15 @@ $:.unshift lib unless $:.include?(lib)
require 'scraper_tools/version'
-
+
Gem::Specification.new do |s|
s.name = "scraper_tools"
s.version = Bundler::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ["Chris Zetter"]
-
-
+ s.summary = "A framework for scraping websites."
+
+
s.add_dependency "nokogiri"
s.add_dependency "faraday"
|
Add required summary to gemspec
|
diff --git a/test/parser/macro_expander_test.rb b/test/parser/macro_expander_test.rb
index abc1234..def5678 100644
--- a/test/parser/macro_expander_test.rb
+++ b/test/parser/macro_expander_test.rb
@@ -6,11 +6,27 @@
def setup
@expander = MacroExpander.new
+ test_returning_macro = Macro.build_macro_from_string("log('a')\nconcat('wor', 'ked') { yield() }", "test", 0)
+ @expander.register_macro(test_returning_macro)
+ end
+
+ def parse_script(script)
+ Parser.new(script,
+ :expander => @expander).parse
end
def test_positionals
macro = @expander.macros[[:insert_top, 1]]
assert_equal %|insert_at("top", "hi") {\n yield()\n}|, macro.expand("hi")
+ end
+
+ def test_arg_settings
+ ins = parse_script("set(test())")
+ set = ins.statements.first
+ macro = set.pos_args.first
+ log, concat = macro.statements
+ assert !log.is_arg?
+ assert concat.is_arg?
end
def test_is_macro?
|
Write a test to make sure that the last child of an
ExpansionBlock knows its an arg if the ExpansionBlock
is expected to return.
|
diff --git a/test/writers/html/tc_html_document.rb b/test/writers/html/tc_html_document.rb
index abc1234..def5678 100644
--- a/test/writers/html/tc_html_document.rb
+++ b/test/writers/html/tc_html_document.rb
@@ -23,8 +23,6 @@ writer: 'html', showAllTags: false)
got = metadata[:writerOutput]
- File.write('/mnt/hgfs/ShareDrive/writeOut.html', got)
-
refute_empty got
|
Remove write test from html writer
|
diff --git a/test/unit/chart_done_ratio_test.rb b/test/unit/chart_done_ratio_test.rb
index abc1234..def5678 100644
--- a/test/unit/chart_done_ratio_test.rb
+++ b/test/unit/chart_done_ratio_test.rb
@@ -1,6 +1,6 @@ require File.dirname(__FILE__) + '/../test_helper'
-class ChartTimeEntryTest < ActiveSupport::TestCase
+class ChartDoneRatioTest < ActiveSupport::TestCase
def test_aggregation
aggregation = ChartDoneRatio.get_aggregation_for_issue(:project_ids => [15041])
|
Rename test case name for ChartDoneRatio
|
diff --git a/fakeetc.gemspec b/fakeetc.gemspec
index abc1234..def5678 100644
--- a/fakeetc.gemspec
+++ b/fakeetc.gemspec
@@ -21,6 +21,8 @@ gem.require_paths = ['lib']
gem.version = FakeEtc::VERSION
+ gem.required_ruby_version = '>= 1.9.3'
+
gem.add_development_dependency 'rake', '~> 10.4.2'
gem.add_development_dependency 'minitest', '~> 5.6.0'
gem.add_development_dependency 'yard', '~> 0.8.7.6'
|
Add required Ruby version to gemspec
|
diff --git a/faraday.gemspec b/faraday.gemspec
index abc1234..def5678 100644
--- a/faraday.gemspec
+++ b/faraday.gemspec
@@ -5,7 +5,7 @@
Gem::Specification.new do |spec|
spec.specification_version = 2 if spec.respond_to? :specification_version=
- spec.required_rubygems_version = Gem::Requirement.new(">= 1.3.5") if spec.respond_to? :required_rubygems_version=
+ spec.required_rubygems_version = '>= 1.3.6'
spec.name = lib
spec.version = version
|
Use of custom objects is not necessary here
|
diff --git a/spec/acceptance/basic_neutron_spec.rb b/spec/acceptance/basic_neutron_spec.rb
index abc1234..def5678 100644
--- a/spec/acceptance/basic_neutron_spec.rb
+++ b/spec/acceptance/basic_neutron_spec.rb
@@ -28,7 +28,8 @@ it 'should list OVS bridges' do
shell("ovs-vsctl show") do |r|
expect(r.stdout).to match(/br-int/)
- expect(r.stdout).to match(/br-tun/)
+ # TODO(aschultz): renable this after timeout is sorted
+ #expect(r.stdout).to match(/br-tun/)
end
end
end
|
Remove br-tun check from beaker
Currently this check is flapping because the ovs agent is hitting
timeouts when trying to get a response from the neutron-server. This is
likely because we start all the services at the same time and if
neutron-server takes too long to start as well as the exponential
timeout calculations from the ovs agent being to long, the br-tun check
will fail. Let's comment this out until we can tune the timeouts better
or address the performance issues.
Change-Id: I8158e674775922549eda24115fae0099c740c419
|
diff --git a/spec/features/listing_coaches_spec.rb b/spec/features/listing_coaches_spec.rb
index abc1234..def5678 100644
--- a/spec/features/listing_coaches_spec.rb
+++ b/spec/features/listing_coaches_spec.rb
@@ -0,0 +1,10 @@+require 'spec_helper'
+
+feature 'when visiting the coaches page' do
+ let!(:coach) { Fabricate(:coach_session_invitation, attended: true).member }
+
+ scenario 'I can see the most active coaches' do
+ visit coaches_path
+ expect(page).to have_content coach.name
+ end
+end
|
Add wall_of_fame action test to bump coverage
|
diff --git a/spec/octokit/client/downloads_spec.rb b/spec/octokit/client/downloads_spec.rb
index abc1234..def5678 100644
--- a/spec/octokit/client/downloads_spec.rb
+++ b/spec/octokit/client/downloads_spec.rb
@@ -23,7 +23,7 @@ end
end # .download
- describe ".delete_download", :vcr do
+ describe ".delete_download" do
it "deletes a download" do
request = stub_delete(github_url("/repos/api-playground/api-sandbox/downloads/12345"))
@client.delete_download 'api-playground/api-sandbox', '12345'
|
Remove vcr tag from stubbed test in downloads spec
|
diff --git a/jekyll-theme-tactile.gemspec b/jekyll-theme-tactile.gemspec
index abc1234..def5678 100644
--- a/jekyll-theme-tactile.gemspec
+++ b/jekyll-theme-tactile.gemspec
@@ -4,7 +4,7 @@ s.name = "jekyll-theme-tactile"
s.version = "0.0.1"
s.authors = ["Jason Long"]
- s.email = ["support@github.com"]
+ s.email = ["opensource+jekyll-theme-tactile@github.com"]
s.homepage = "https://github.com/pages-themes/tactile"
s.summary = "Tactile is a theme for GitHub Pages"
|
Update contact email in Gemspec
|
diff --git a/test/cache_fetch_includes_test.rb b/test/cache_fetch_includes_test.rb
index abc1234..def5678 100644
--- a/test/cache_fetch_includes_test.rb
+++ b/test/cache_fetch_includes_test.rb
@@ -0,0 +1,46 @@+require "test_helper"
+
+class CacheFetchIncludesTest < IdentityCache::TestCase
+ def setup
+ super
+ end
+
+ def test_cached_embedded_has_manys_are_included_in_includes
+ Record.send(:cache_has_many, :associated_records, :embed => true)
+ assert_equal [:associated_records], Record.cache_fetch_includes
+ end
+
+ def test_cached_nonembedded_has_manys_are_included_in_includes
+ Record.send(:cache_has_many, :associated_records, :embed => false)
+ assert_equal [], Record.cache_fetch_includes
+ end
+
+ def test_cached_has_ones_are_included_in_includes
+ Record.send(:cache_has_one, :associated)
+ assert_equal [:associated], Record.cache_fetch_includes
+ end
+
+ def test_cached_nonembedded_belongs_tos_are_not_included_in_includes
+ Record.send(:cache_belongs_to, :record)
+ assert_equal [], Record.cache_fetch_includes
+ end
+
+ def test_cached_child_associations_are_included_in_includes
+ Record.send(:cache_has_many, :associated_records, :embed => true)
+ AssociatedRecord.send(:cache_has_many, :deeply_associated_records, :embed => true)
+ assert_equal [{:associated_records => [:deeply_associated_records]}], Record.cache_fetch_includes
+ end
+
+ def test_multiple_cached_associations_and_child_associations_are_included_in_includes
+ Record.send(:cache_has_many, :associated_records, :embed => true)
+ Record.send(:cache_has_many, :polymorphic_records, {:inverse_name => :owner, :embed => true})
+ Record.send(:cache_has_one, :associated, :embed => true)
+ AssociatedRecord.send(:cache_has_many, :deeply_associated_records, :embed => true)
+ assert_equal [
+ {:associated_records => [:deeply_associated_records]},
+ :polymorphic_records,
+ {:associated => [:deeply_associated_records]}
+ ], Record.cache_fetch_includes
+ end
+
+end
|
Add a separate set of test cases for the cache_fetch_includes traversal
|
diff --git a/rbcoremidi.rb b/rbcoremidi.rb
index abc1234..def5678 100644
--- a/rbcoremidi.rb
+++ b/rbcoremidi.rb
@@ -12,6 +12,7 @@ end
def create_input_port(client_name, port_name, &proc)
+ # AFAIK this is the only way to pass the proc to a C function
API.create_input_port(client_name, port_name, proc)
end
end
|
Use the correct comment character
|
diff --git a/routes.rb b/routes.rb
index abc1234..def5678 100644
--- a/routes.rb
+++ b/routes.rb
@@ -19,40 +19,32 @@ DataMapper.auto_upgrade!
get '/' do
- if logged_in?
- posts = Posts.getAll()
- else
- posts = Posts.getAll().delete_if { |x| x.hidden == true }
- end
-
erb :index, :locals => {
- :posts => posts,
+ :posts => ensureAuthorized(Posts.getAll()),
:sidebar => Info.getSidebar()
}
end
get '/flair/:tag' do
- if logged_in?
- posts = Posts.getByFlair("#{params['tag']}")
- else
- posts = Posts.getByFlair("#{params['tag']}").delete_if { |x| x.hidden == true }
- end
-
erb :index, :locals => {
- :posts => posts,
+ :posts => ensureAuthorized(Posts.getByFlair("#{params['tag']}")),
:sidebar => Info.getSidebar()
}
end
get '/:id/:title' do
- if logged_in?
- posts = Posts.getSingle("#{params['id']}")
- else
- posts = Posts.getSingle("#{params['id']}").delete_if { |x| x.hidden == true }
- end
-
erb :index, :locals => {
- :posts => posts,
+ :posts => ensureAuthorized(Posts.getSingle("#{params['id']}")),
:sidebar => Info.getSidebar()
}
end
+
+def ensureAuthorized(posts)
+ if logged_in? && Api.api_data["allowed"].include?(current_user.email)
+ posts
+ else
+ posts.delete_if { |x| x.hidden == true }
+ end
+
+ posts
+end
|
Refactor auth check and add user list
|
diff --git a/app/controllers/passwords_controller.rb b/app/controllers/passwords_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/passwords_controller.rb
+++ b/app/controllers/passwords_controller.rb
@@ -1,10 +1,10 @@ class PasswordsController < Devise::PasswordsController
- def create
- self.resource = resource_class.send_reset_password_instructions(params[resource_name])
- flash.now[:alert] = t(:reset_notification)
- Statsd.new(::STATSD_HOST).increment(
- "#{::STATSD_PREFIX}.users.password_reset_request"
- )
- render action: 'new'
- end
+ before_filter :record_password_reset_request, only: :create
+
+ private
+ def record_password_reset_request
+ Statsd.new(::STATSD_HOST).increment(
+ "#{::STATSD_PREFIX}.users.password_reset_request"
+ )
+ end
end
|
Fix broken password reset controller tests
Until recently, this code was never actually running. It appears
that wiring it up broke some functionality.
Further to that, the duplicated Devise code didn't match. I
decided to avoid copying code entirely, and instead use a before_filter.
|
diff --git a/app/decorators/miq_request_decorator.rb b/app/decorators/miq_request_decorator.rb
index abc1234..def5678 100644
--- a/app/decorators/miq_request_decorator.rb
+++ b/app/decorators/miq_request_decorator.rb
@@ -7,15 +7,4 @@ "pficon pficon-error-circle-o"
end
end
-
- def fileicon
- case request_status.to_s.downcase
- when "ok"
- "100/checkmark.png"
- when "error"
- "100/x.png"
- else
- "100/miq_request.png"
- end
- end
end
|
Drop fileicon decorator from MiqRequestDecorator
https://bugzilla.redhat.com/show_bug.cgi?id=1514620
|
diff --git a/black_list.rb b/black_list.rb
index abc1234..def5678 100644
--- a/black_list.rb
+++ b/black_list.rb
@@ -4,6 +4,7 @@
BlackList = [
["coq-compcert.3.1.0", "Error: Corrupted compiled interface"], # flaky Makefile
+ ["coq-compcert.3.2.0", "Error: Corrupted compiled interface"], # flaky Makefile
["coq-compcert.3.3.0", "Error: Corrupted compiled interface"], # flaky Makefile
["coq-compcert.3.6", "Error: Corrupted compiled interface"], # flaky Makefile
["coq-stalmarck.8.5.0", "Error: Could not find the .cmi file for interface stal.mli."] # flaky Makefile
|
Add CompCert 3.2.0 to the black-list for flaky Makefile
|
diff --git a/calculators/bmi/bmi.rb b/calculators/bmi/bmi.rb
index abc1234..def5678 100644
--- a/calculators/bmi/bmi.rb
+++ b/calculators/bmi/bmi.rb
@@ -1,11 +1,9 @@ name :bmi
+require_helpers :get_field_as_float
execute do
- raise FieldError.new("weight", "weight must be a number") if !field_weight.is_float?
- raise FieldError.new("height", "height must be a number") if !field_height.is_float?
-
- weight = field_weight.to_f
- height = field_height.to_f
+ weight = get_field_as_float :weight
+ height = get_field_as_float :height
raise FieldError.new("weight", "weight must be greater than zero") if weight <= 0
raise FieldError.new("height", "height must be greater than zero") if height <= 0
|
Use new helper methods for getting fields
|
diff --git a/catarse_stripe.gemspec b/catarse_stripe.gemspec
index abc1234..def5678 100644
--- a/catarse_stripe.gemspec
+++ b/catarse_stripe.gemspec
@@ -20,7 +20,7 @@ s.add_dependency "activemerchant", ">= 1.17.0"
s.add_dependency "stripe", :git => 'https://github.com/stripe/stripe-ruby'
s.add_dependency "omniauth-stripe-connect"
- s.add_dependency "stripe_event"
+ #s.add_dependency "stripe_event"
s.add_development_dependency "rspec-rails"
s.add_development_dependency "factory_girl_rails"
|
Fix new dependencies and Migrations
|
diff --git a/fastlane-plugin-github_status.gemspec b/fastlane-plugin-github_status.gemspec
index abc1234..def5678 100644
--- a/fastlane-plugin-github_status.gemspec
+++ b/fastlane-plugin-github_status.gemspec
@@ -6,12 +6,12 @@ Gem::Specification.new do |spec|
spec.name = 'fastlane-plugin-github_status'
spec.version = Fastlane::GithubStatus::VERSION
- spec.author = %q{Michael Furtak}
- spec.email = %q{michael.furtak@gmail.com}
+ spec.author = 'Michael Furtak'
+ spec.email = 'michael.furtak@gmail.com'
- spec.summary = %q{Provides the ability to check on GitHub server status as part of your build}
- # spec.homepage = "https://github.com/<GITHUB_USERNAME>/fastlane-plugin-github_status"
- spec.license = "MIT"
+ spec.summary = 'Provides the ability to check on GitHub server status as part of your build'
+ spec.homepage = 'https://github.com/mfurtak/fastlane-plugin-github_status'
+ spec.license = 'MIT'
spec.files = Dir["lib/**/*"] + %w(README.md LICENSE)
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
Add homepage url to gemspec
|
diff --git a/clock.gemspec b/clock.gemspec
index abc1234..def5678 100644
--- a/clock.gemspec
+++ b/clock.gemspec
@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
s.name = 'clock'
s.summary = 'Clock interface with support for dependency configuration for real and null object implementations'
- s.version = '0.0.2.0'
+ s.version = '0.0.3.0'
s.description = ' '
s.authors = ['Obsidian Software, Inc']
|
Package version is incremented from 0.0.2.0 to 0.0.3.0
|
diff --git a/attributes/datastax.rb b/attributes/datastax.rb
index abc1234..def5678 100644
--- a/attributes/datastax.rb
+++ b/attributes/datastax.rb
@@ -1,5 +1,5 @@
-default['cassandra']['package_name'] = 'dsc20'
+default['cassandra']['package_name'] = 'dsc21'
default['cassandra']['release'] = '1'
default['cassandra']['yum']['repo'] = 'datastax'
|
Update package name for 2.1.x
|
diff --git a/ios-ntp.podspec b/ios-ntp.podspec
index abc1234..def5678 100644
--- a/ios-ntp.podspec
+++ b/ios-ntp.podspec
@@ -4,7 +4,7 @@ s.summary = 'SNTP implementation for iOS.'
s.homepage = 'https://github.com/jbenet/ios-ntp'
s.license = { :type => 'MIT', :file => 'LICENSE' }
- s.source = { :git => 'https://github.com/jbenet/ios-ntp.git', :tag => 'v1.0.0' }
+ s.source = { :git => 'https://github.com/jbenet/ios-ntp.git', :tag => '1.0.0' }
s.author = { 'Gavin Eadie' => 'https://github.com/gavineadie' }
s.ios.deployment_target = '7.0'
s.source_files = 'ios-ntp-lib/*.{h,m}'
|
Correct the "version tag" in the podspec. Also waiting for the pod people to let me claim this software.
|
diff --git a/spec/comments_spec.rb b/spec/comments_spec.rb
index abc1234..def5678 100644
--- a/spec/comments_spec.rb
+++ b/spec/comments_spec.rb
@@ -25,6 +25,17 @@ expect(comments.length).to eq(count)
end
+ it "comments are unique" do
+ comments_api = RedditApi::Comments.new
+ user = RedditApi::User.new({ "username" => "spez" })
+ count = 5
+
+ comments = comments_api.most_recent_comments(user, count)
+ unique_comments = comments.uniq { |c| c.reddit_id }
+
+ expect(unique_comments.length == comments.length).to be true
+ end
+
it "returns only comments for the given user" do
comments_api = RedditApi::Comments.new
user = RedditApi::User.new({ "username" => "spez" })
|
Add uniqueness expectation to RedditApi::Comments
RedditApi::Comments#most_recent_comments
|
diff --git a/spec/unit/sub_spec.rb b/spec/unit/sub_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/sub_spec.rb
+++ b/spec/unit/sub_spec.rb
@@ -0,0 +1,76 @@+
+#
+# specifying flor
+#
+# Mon Jan 9 07:54:05 JST 2017
+#
+
+require 'spec_helper'
+
+
+describe 'Flor unit' do
+
+ before :each do
+
+ @unit = Flor::Unit.new('envs/test/etc/conf.json')
+ @unit.conf['unit'] = 'u_sub'
+ @unit.hook('journal', Flor::Journal)
+ @unit.storage.delete_tables
+ @unit.storage.migrate
+ @unit.start
+ end
+
+ after :each do
+
+ @unit.shutdown
+ end
+
+ describe 'flor' do
+
+ it 'uses unique subids' do
+
+ r =
+ @unit.launch(%{
+ cmap [ 1 2 ]
+ def i
+ cmap [ 'x' 'y' ]
+ def c
+ trace "$(i):$(c)"
+ }, wait: true)
+
+ expect(r['point']).to eq('terminated')
+
+ sleep 0.210
+
+ expect(
+ @unit.traces
+ .collect { |t| t.text }.sort.join("\n")
+ ).to eq(%w[
+ 1:x 1:y 2:x 2:y
+ ].join("\n"))
+
+ exe = @unit.executions[exid: r['exid']]
+
+ expect(exe.data['counters']['subs']).to eq(6)
+
+ expect(
+ @unit.journal
+ .select { |m|
+ m['point'] == 'execute' && m['nid'].index('-') }
+ .inject({}) { |h, m|
+ si = m['nid'].split('-').last; h[si] ||= m; h }.values
+ .collect { |m|
+ [ m['nid'], m['point'], 'L' + m['tree'][2].to_s ].join(':') }
+ .join("\n")
+ ).to eq(%w[
+ 0_1-1:execute:L2
+ 0_1-2:execute:L2
+ 0_1_1_1-3:execute:L4
+ 0_1_1_1-4:execute:L4
+ 0_1_1_1-5:execute:L4
+ 0_1_1_1-6:execute:L4
+ ].join("\n"))
+ end
+ end
+end
+
|
Add routine check for nested cmaps subids
|
diff --git a/Casks/balsamiq-mockups.rb b/Casks/balsamiq-mockups.rb
index abc1234..def5678 100644
--- a/Casks/balsamiq-mockups.rb
+++ b/Casks/balsamiq-mockups.rb
@@ -1,6 +1,6 @@ cask :v1 => 'balsamiq-mockups' do
- version '3.1.5'
- sha256 '738c986bc3d43d6a9cd0bbef9e8bd50edf5b5e7b865ff72c8fa9fe9048c662d8'
+ version '3.1.6'
+ sha256 '5f6fec35f0ab2fdaea766b5139cc9ea604782eeda6ac417b606e6d309c7b89b7'
# amazonaws is the official download host per the vendor homepage
url "https://s3.amazonaws.com/build_production/mockups-desktop/Balsamiq_Mockups_#{version}.dmg"
|
Update Balsamiq Mockups to 3.1.6.
|
diff --git a/examples/build-catalog-from-epub.rb b/examples/build-catalog-from-epub.rb
index abc1234..def5678 100644
--- a/examples/build-catalog-from-epub.rb
+++ b/examples/build-catalog-from-epub.rb
@@ -0,0 +1,61 @@+# This is an example that aggregates info from EPUB files and build OPDS catalog feed using them
+#
+# Usage:
+# ruby examples/build-catalog-from-epub.rb EPUBFILE
+# ruby examples/build-catalog-from-epub.rb ~/Documents/Books/*.epub
+
+require 'rss'
+require 'rss/opds'
+require 'rss/maker/opds'
+require 'epub/parser' # You need to 'gem install epub-parser' if you don't have it
+
+def main
+ if ARGV.empty?
+ puts "Usage: ruby #{File.basename($0)} EPUBFILE [EPUBFILE ...]"
+ exit 1
+ end
+
+ puts make_catalog(ARGV)
+end
+
+def make_catalog(files)
+ RSS::Maker.make 'atom' do |maker|
+ maker.channel.about = 'http://example.net/'
+ maker.channel.title = 'My EPUB books'
+ maker.channel.description = 'This is an example to make OPDS catalog using RSS::OPDS library'
+ maker.channel.links.new_link do |link|
+ link.href = 'http://example.net/'
+ link.rel = RSS::OPDS::RELATIONS['self']
+ link.type = RSS::OPDS::TYPES['navigation']
+ end
+ maker.channel.links.new_link do |link|
+ link.href = 'http://example.net/'
+ link.rel = RSS::OPDS::RELATIONS['start']
+ link.type = RSS::OPDS::TYPES['navigation']
+ end
+ maker.channel.author = `whoami`.chomp
+ maker.channel.generator = 'RSS OPDS the Ruby OPDS library'
+ maker.channel.updated = Time.now
+
+ files.sort.each do |file|
+ begin
+ make_entry(file, maker)
+ rescue => error
+ $stderr.puts error
+ $stderr.puts "skip: #{file}"
+ end
+ end
+ end
+end
+
+def make_entry(file, maker)
+ book = EPUB::Parser.parse(file)
+ maker.items.new_item do |entry|
+ entry.id = book.metadata.unique_identifier.content
+ entry.title = book.title
+ entry.updated = Time.parse(book.metadata.dates.first.content)
+ entry.summary = book.metadata.descriptions.join(' ')
+ end
+end
+
+main
|
Add sample script to build OPDS catalog from EPUB files
|
diff --git a/Casks/thunderbird-beta.rb b/Casks/thunderbird-beta.rb
index abc1234..def5678 100644
--- a/Casks/thunderbird-beta.rb
+++ b/Casks/thunderbird-beta.rb
@@ -1,8 +1,8 @@ class ThunderbirdBeta < Cask
- version '31.0b3'
- sha256 '82cf13b42f72a660920cfd025220d2ce9ddfb56327b01721b4b02e065752061d'
+ version '32.0b1'
+ sha256 '0f66e9cb452293e248d92c9a156c0b81c50e81ba1107922ab6f8b555934e83d3'
- url 'https://download-installer.cdn.mozilla.net/pub/thunderbird/releases/31.0b3/mac/en-US/Thunderbird%2031.0b3.dmg'
+ url 'https://download-installer.cdn.mozilla.net/pub/thunderbird/releases/32.0b1/mac/en-US/Thunderbird%2032.0b1.dmg'
homepage 'https://www.mozilla.org/en-US/thunderbird/all-beta.html'
link 'Thunderbird.app'
|
Update Thunderbird Beta to 32.0b1
|
diff --git a/debugger-ruby_core_source.gemspec b/debugger-ruby_core_source.gemspec
index abc1234..def5678 100644
--- a/debugger-ruby_core_source.gemspec
+++ b/debugger-ruby_core_source.gemspec
@@ -12,7 +12,7 @@ s.description = %q{Provide Ruby core source files for C extensions that need them.}
s.required_rubygems_version = ">= 1.3.6"
s.extra_rdoc_files = [ "README.md"]
- s.files = `git ls-files`.split("\n")
+ s.files = Dir["#{File.dirname(__FILE__)}/lib/**/*"]
s.add_development_dependency "archive-tar-minitar", ">= 0.5.2"
s.add_development_dependency 'rake', '~> 0.9.2'
end
|
Allow the .gemspec to be used by Bundler. Shelling out to git presumes that you're generating a gem from the current directory.
|
diff --git a/app/models/gobierto_data/cached_data.rb b/app/models/gobierto_data/cached_data.rb
index abc1234..def5678 100644
--- a/app/models/gobierto_data/cached_data.rb
+++ b/app/models/gobierto_data/cached_data.rb
@@ -3,6 +3,11 @@ module GobiertoData
class CachedData
CACHED_DATA_BASE_PATH = "gobierto_data/cache/"
+ CONTENT_TYPES = {
+ ".json" => "application/json; charset=utf-8",
+ ".csv" => "text/csv; charset=utf-8",
+ ".xlsx" => "application/xlsx"
+ }.freeze
attr_reader :resource, :resource_path
@@ -16,10 +21,17 @@ @local
end
- def source(name, update: false)
+ def source(name, update: false, content_type: nil)
update_method = update ? :upload! : :call
service = GobiertoCommon::FileUploadService.new(file_name: "#{resource_path}/#{name}")
- service = GobiertoCommon::FileUploadService.new(file_name: "#{resource_path}/#{name}", content: yield) if update || !service.uploaded_file_exists?
+ if update || !service.uploaded_file_exists?
+ service = GobiertoCommon::FileUploadService.new(
+ file_name: "#{resource_path}/#{name}",
+ content: yield,
+ content_disposition: "attachment",
+ content_type: content_type || CONTENT_TYPES[File.extname(name)]
+ )
+ end
local? ? Rails.root.join("public#{service.send(update_method)}") : service.send(update_method)
end
end
|
Include content_type and disposition in CachedData upload service
|
diff --git a/db/seeds/demo/events/rabbit.rb b/db/seeds/demo/events/rabbit.rb
index abc1234..def5678 100644
--- a/db/seeds/demo/events/rabbit.rb
+++ b/db/seeds/demo/events/rabbit.rb
@@ -8,7 +8,9 @@ event_type_id: 19,
description: "meeting with family in clinic",
notes: "anxious about medication changes",
- date_time: Time.now - 2.weeks
+ date_time: Time.now - 2.weeks,
+ created_by_id: Renalware::User.first.id,
+ updated_by_id: Renalware::User.first.id
)
Events::Event.find_or_create_by!(
@@ -16,7 +18,9 @@ event_type_id: 25,
description: "call regarding meds",
notes: "told patient to get other drug info from GP",
- date_time: Time.now - 12.days
+ date_time: Time.now - 12.days,
+ created_by_id: Renalware::User.second.id,
+ updated_by_id: Renalware::User.second.id
)
Events::Event.find_or_create_by!(
@@ -24,7 +28,9 @@ event_type_id: 8,
description: "email re next clinic visit",
notes: "reminded patient to bring complete drug list to clinic",
- date_time: Time.now - 5.days
+ date_time: Time.now - 5.days,
+ created_by_id: Renalware::User.last.id,
+ updated_by_id: Renalware::User.last.id
)
end
end
|
Update events sample seeds for RABBIT
|
diff --git a/app/mailers/meeting_invitation_mailer.rb b/app/mailers/meeting_invitation_mailer.rb
index abc1234..def5678 100644
--- a/app/mailers/meeting_invitation_mailer.rb
+++ b/app/mailers/meeting_invitation_mailer.rb
@@ -8,7 +8,7 @@ @member = member
@meeting = meeting
@host_address = AddressDecorator.new(@meeting.venue.address)
- @cancellation_url = 'https://codebar.io' + meeting_path(@meeting)
+ @cancellation_url = meeting_url(@meeting)
subject = "See you at #{@meeting.name} on #{humanize_date(@meeting.date_and_time)}"
mail(mail_args(member, subject)) do |format|
@@ -20,7 +20,7 @@ @member = member
@meeting = meeting
@host_address = AddressDecorator.new(@meeting.venue.address)
- @cancellation_url = 'https://codebar.io' + meeting_path(@meeting)
+ @cancellation_url = meeting_url(@meeting)
subject = "A spot opened up for #{@meeting.name} on #{humanize_date(@meeting.date_and_time)}"
mail(mail_args(member, subject)) do |format|
|
Use meeting_url instead of path
|
diff --git a/lib/capistrano/puma/nginx.rb b/lib/capistrano/puma/nginx.rb
index abc1234..def5678 100644
--- a/lib/capistrano/puma/nginx.rb
+++ b/lib/capistrano/puma/nginx.rb
@@ -3,10 +3,10 @@ include PumaCommon
def set_defaults
# Nginx and puma configuration
- set_if_empty :nginx_config_name, "#{fetch(:application)}_#{fetch(:stage)}"
+ set_if_empty :nginx_config_name, -> { "#{fetch(:application)}_#{fetch(:stage)}" }
set_if_empty :nginx_sites_available_path, '/etc/nginx/sites-available'
set_if_empty :nginx_sites_enabled_path, '/etc/nginx/sites-enabled'
- set_if_empty :nginx_server_name, "localhost #{fetch(:application)}.local"
+ set_if_empty :nginx_server_name, -> { "localhost #{fetch(:application)}.local" }
set_if_empty :nginx_flags, 'fail_timeout=0'
set_if_empty :nginx_http_flags, fetch(:nginx_flags)
set_if_empty :nginx_socket_flags, fetch(:nginx_flags)
@@ -17,4 +17,4 @@ eval_rakefile File.expand_path('../../tasks/nginx.rake', __FILE__)
end
end
-end+end
|
Fix vars loading issue during plugin initialization
|
diff --git a/lib/cloudstrap/amazon/elb.rb b/lib/cloudstrap/amazon/elb.rb
index abc1234..def5678 100644
--- a/lib/cloudstrap/amazon/elb.rb
+++ b/lib/cloudstrap/amazon/elb.rb
@@ -20,6 +20,16 @@
Tags = HashOf[String, String]
+ Contract Args[String] => HashOf[String, Tags]
+ def tags(*elb_names)
+ describe_tags(*elb_names).each_with_object({}) do |description, hash|
+ hash[description.load_balancer_name] = description
+ .tags
+ .map(&:to_a)
+ .to_h
+ end
+ end
+
private
Contract Args[String] => ArrayOf[::Aws::ElasticLoadBalancing::Types::TagDescription]
|
Add method to extract tags from descriptions
|
diff --git a/app/workers/discourse_sign_out_worker.rb b/app/workers/discourse_sign_out_worker.rb
index abc1234..def5678 100644
--- a/app/workers/discourse_sign_out_worker.rb
+++ b/app/workers/discourse_sign_out_worker.rb
@@ -5,7 +5,7 @@ for_each_tenant(user_id) do |u,t|
client(t) do |c|
discourse_user = c.user(u.username)
- c.log_out(discourse_user['id'])
+ c.log_out(discourse_user['id']) unless discourse_user.nil?
end
end
rescue DiscourseApi::Error
|
Fix NPE if user does not exist in discourse instance
|
diff --git a/spec/dummy/app/controllers/semi_protected_resources_controller.rb b/spec/dummy/app/controllers/semi_protected_resources_controller.rb
index abc1234..def5678 100644
--- a/spec/dummy/app/controllers/semi_protected_resources_controller.rb
+++ b/spec/dummy/app/controllers/semi_protected_resources_controller.rb
@@ -1,11 +1,11 @@ class SemiProtectedResourcesController < ApplicationController
- before_filter :doorkeeper_authorize!
+ before_filter :doorkeeper_authorize!, only: :index
def index
render text: 'protected index'
end
def show
- render text: 'protected show'
+ render text: 'non protected show'
end
end
|
Undo behavior change on specs.
See
https://github.com/doorkeeper-gem/doorkeeper/pull/448/files#diff-403546b64759d2fcb933e8345a827403L2.
|
diff --git a/lib/nest_wrapper.rb b/lib/nest_wrapper.rb
index abc1234..def5678 100644
--- a/lib/nest_wrapper.rb
+++ b/lib/nest_wrapper.rb
@@ -13,12 +13,7 @@ def self.login(email, password)
self.nest = NestThermostat::Nest.new({ email: email, password: password })
- set_status
-
- self.device = NestWrapper::Device.new(status)
- end
-
- def self.set_status
self.status = nest.status if nest
+ self.device = NestWrapper::Device.new(status) if status
end
end
|
Tweak some assignments in the initialize.
|
diff --git a/lib/rubbr/change.rb b/lib/rubbr/change.rb
index abc1234..def5678 100644
--- a/lib/rubbr/change.rb
+++ b/lib/rubbr/change.rb
@@ -8,9 +8,10 @@ require 'yaml'
def self.d?
+ sums = inventory
+
return true if Rubbr.options[:force]
- sums = inventory
if changes?(sums)
write_inventory sums
true
|
Create file hashes on forced execution aswell. This way the next unforced run can take advantage of the hashes.
|
diff --git a/lib/slack-notify.rb b/lib/slack-notify.rb
index abc1234..def5678 100644
--- a/lib/slack-notify.rb
+++ b/lib/slack-notify.rb
@@ -10,7 +10,7 @@ @subdomain = subdomain
@token = token
@username = options[:username] || "webhookbot"
- @channel = options[:channel] || "general"
+ @channel = options[:channel] || "#general"
raise ArgumentError, "Subdomain required" if @subdomain.nil?
raise ArgumentError, "Token required" if @token.nil?
|
Use pound for channel names
|
diff --git a/lib/tasks/spec.rake b/lib/tasks/spec.rake
index abc1234..def5678 100644
--- a/lib/tasks/spec.rake
+++ b/lib/tasks/spec.rake
@@ -0,0 +1,8 @@+require 'rspec-puppet'
+
+desc "Run any defined tests"
+RSpec::Core::RakeTask.new(:spec) do |t|
+ t.pattern = 'spec/*.rb'
+ t.ruby_opts = '-W0'
+ t.rspec_opts = '--color -fd'
+end
|
Add example test runner rake command
Encourage testing via providing a default spec running command
|
diff --git a/lib/sub_diff/diff_builder.rb b/lib/sub_diff/diff_builder.rb
index abc1234..def5678 100644
--- a/lib/sub_diff/diff_builder.rb
+++ b/lib/sub_diff/diff_builder.rb
@@ -13,11 +13,11 @@ end
def push(*args)
- tap do
- if args.compact.any?
- diffs << Diff.new(*args)
- end
+ if args.compact.any?
+ diffs << Diff.new(*args)
end
+
+ self
end
protected
|
Return `self` instead of using `tap` for clarity
|
diff --git a/lib/sunspot/queue/helpers.rb b/lib/sunspot/queue/helpers.rb
index abc1234..def5678 100644
--- a/lib/sunspot/queue/helpers.rb
+++ b/lib/sunspot/queue/helpers.rb
@@ -3,21 +3,19 @@ module Sunspot::Queue
module Helpers
def without_proxy
+ proxy = nil
+
# Pop off the queueing proxy for the block if it's in place so we don't
# requeue the same job multiple times.
if Sunspot.session.instance_of?(SessionProxy)
proxy = Sunspot.session
Sunspot.session = proxy.session
+ end
- begin
- yield
- ensure
- Sunspot.commit rescue nil
- Sunspot.session = proxy
- end
- else
- yield
- end
+ yield
+ ensure
+ Sunspot.commit rescue nil
+ Sunspot.session = proxy if proxy
end
end
end
|
Refactor without_proxy so it returns the result of the block.
|
diff --git a/lib/tiki/torch/connection.rb b/lib/tiki/torch/connection.rb
index abc1234..def5678 100644
--- a/lib/tiki/torch/connection.rb
+++ b/lib/tiki/torch/connection.rb
@@ -33,7 +33,11 @@ uri = URI.parse url
options = settings
- options[:host] = uri.host || '127.0.0.1'
+ if (hosts = uri.host.split('--')).size > 1
+ options[:hosts] = hosts
+ else
+ options[:host] = uri.host || '127.0.0.1'
+ end
options[:port] = uri.port || 5672
options[:username] = uri.userinfo ? uri.userinfo.split(':').first : 'guest'
options[:password] = uri.userinfo ? uri.userinfo.split(':').last : 'guest'
|
Use a convention to allow multiple hosts on a ENV url.
|
diff --git a/lib/unparser/emitter/args.rb b/lib/unparser/emitter/args.rb
index abc1234..def5678 100644
--- a/lib/unparser/emitter/args.rb
+++ b/lib/unparser/emitter/args.rb
@@ -7,9 +7,7 @@ def emit_block_arguments
delimited(normal_arguments)
- if normal_arguments.one?
- write(',') if n_arg?(normal_arguments.first)
- end
+ write(',') if normal_arguments.one? && n_arg?(normal_arguments.first)
emit_shadowargs
end
|
Change to aggregate boolean expression
|
diff --git a/spec/butler_spec.rb b/spec/butler_spec.rb
index abc1234..def5678 100644
--- a/spec/butler_spec.rb
+++ b/spec/butler_spec.rb
@@ -1,3 +1,9 @@+class Butler
+ def list
+ ['command1', 'command2', 'command3']
+ end
+end
+
RSpec.describe "Butler" do
describe '#list' do
it 'returns a list of available commands' do
|
Add Butler class & dummy method list
|
diff --git a/app/controllers/users/registrations_controller.rb b/app/controllers/users/registrations_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/users/registrations_controller.rb
+++ b/app/controllers/users/registrations_controller.rb
@@ -1,7 +1,7 @@ class Users::RegistrationsController < Devise::RegistrationsController
def create
- if params[:bicycle_wheels].strip == '12' && params[:real_name].blank?
+ if params[:bicycle_wheels].try(:strip) == '12' && params[:real_name].blank?
super
else
build_resource(sign_up_params)
|
Stop error when param not supplied
Fixes https://rollbar.com/cyclestreets/cyclescape/items/132/
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -6,5 +6,4 @@ config.color = true
config.platform = 'ubuntu'
config.version = '18.04'
- config.log_level = :fatal
end
|
Drop specifying log level for unit tests
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -7,9 +7,9 @@ puts "Skipping SimpleCov"
end
-require File.expand_path("../dummy/config/environment.rb", __FILE__)
+# require File.expand_path("../dummy/config/environment.rb", __FILE__)
-require 'rspec/rails'
+# require 'rspec/rails'
require 'delorean'
require 'json_spec'
require 'uuid'
@@ -30,5 +30,6 @@
config.after(:each) do
teardown_constants
+ CrashLog.reset_configuration!
end
end
|
Reset configuration after tests so we can use a real configuration for testing
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -27,7 +27,11 @@
# Monkeypatch to mutant .rc3 fixing double diffs error.
#
+# Also does run all mutations.
+#
# TODO: Use master once it supports configurable implicit coverage.
+#
+# Morpher predicates are needed to finally make this configurable in mutant.
#
module Mutant
class Subject
@@ -48,7 +52,23 @@ end
end
end
-end
+
+ class Killer
+ class Rspec
+
+ # Return all example groups
+ #
+ # @return [Enumerable<RSpec::Example>]
+ #
+ # @api private
+ #
+ def example_groups
+ strategy.example_groups
+ end
+
+ end # Rspec
+ end # Killer
+end # Mutant
RSpec.configure do |config|
config.expect_with :rspec do |rspec|
|
Add monkeypatch for full implicit coverage
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,3 +1,5 @@+$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
+
require "rspec"
require "converse"
|
Add converse to the load path
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,7 +1,6 @@ require "rubygems"
require "spec"
require "rr"
-require "ruby-debug"
project_root = File.expand_path("#{__FILE__}/../..")
$LOAD_PATH << "#{project_root}/lib"
|
Remove needless inclusion of "ruby-debug".
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,3 +1,5 @@+# coding: utf-8
+
if ENV['COV']
require 'simplecov'
SimpleCov.start
|
Add back encoding comment in for JRuby
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -14,9 +14,8 @@ require 'rspec/core'
require 'rspec/expectations'
-Mongoid.configure do |config|
- config.connect_to("mongoid-rspec-test")
-end
+Mongoid::Config.connect_to('mongoid-rspec-test')
+Mongo::Logger.logger.level = ::Logger::INFO
Dir[ File.join(MODELS, "*.rb") ].sort.each { |file| require File.basename(file) }
|
Update RSpec configuration. Set mongoid log level to debug in order to
prevent poluting RSpec's output
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -19,6 +19,3 @@ require "paperclip/storage/ftp"
Paperclip.options[:log] = false
-
-# https://github.com/thoughtbot/cocaine#caveat
-Cocaine::CommandLine.runner = Cocaine::CommandLine::BackticksRunner.new
|
Remove obsolete tweak for JRuby
We are not testing against JRuby anymore
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -3,6 +3,7 @@ PROJECT_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..')).freeze
$LOAD_PATH << File.join(PROJECT_ROOT, 'lib')
+require 'active_support/core_ext/module'
require 'paperclip/nginx/upload'
Dir[File.join(PROJECT_ROOT, 'spec', 'support', '**', '*.rb')].each { |file| require(file) }
|
Fix test suite for Paperclip 5.1
Ensure Active Support `delegate`, which is used by paperclip, is
present.
|
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index abc1234..def5678 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,5 +1,7 @@ require 'coveralls'
Coveralls.wear!
+
+require 'pry-byebug'
require_relative 'togglv8_spec_helper'
require_relative '../lib/togglv8'
@@ -29,7 +31,9 @@ end
class Testing
- API_TOKEN = '4880adbe1bee9a241fa08070d33bd49f'
- USERNAME = 'togglv8@mailinator.com'
- PASSWORD = 'togglv8'
+ API_TOKEN = ENV['API_TOKEN'] || '4880adbe1bee9a241fa08070d33bd49f'
+ USERNAME = ENV['USERNAME'] || 'togglv8@mailinator.com'
+ PASSWORD = ENV['PASSWORD'] || 'togglv8'
+ USER_ID = (ENV['USER_ID'] || 1820939).to_i
+
end
|
Add ability to override Testing values w/ environment variables.
|
diff --git a/spec/support/vcr.rb b/spec/support/vcr.rb
index abc1234..def5678 100644
--- a/spec/support/vcr.rb
+++ b/spec/support/vcr.rb
@@ -5,5 +5,5 @@ c.hook_into :webmock
c.default_cassette_options = { serialize_with: :json, record: :once }
c.debug_logger = File.open(Rails.root.join('log', 'vcr.log'), 'a')
- c.filter_sensitive_data('<WUNDERGROUND_KEY>') { ENV['WUNDERGROUND_KEY'] }
+ c.filter_sensitive_data('{WUNDERGROUND_KEY}') { ENV['WUNDERGROUND_KEY'] }
end
|
Use curly braces for cassette filter to please URI parser
|
diff --git a/app/controllers/expensesheets_controller.rb b/app/controllers/expensesheets_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/expensesheets_controller.rb
+++ b/app/controllers/expensesheets_controller.rb
@@ -1,5 +1,4 @@ class ExpensesheetsController < ApplicationController
- before_action :find_user, only: [:new, :create, :show, :edit, :update]
def new
@expenses = Expense.new
|
Remove before expense, find user
|
diff --git a/test/support/drivers.rb b/test/support/drivers.rb
index abc1234..def5678 100644
--- a/test/support/drivers.rb
+++ b/test/support/drivers.rb
@@ -13,6 +13,8 @@ Capybara::Selenium::Driver.new(
app,
browser: :chrome,
- desired_capabilities: capabilities
+ desired_capabilities: capabilities,
+ clear_local_storage: true,
+ clear_session_storage: true
)
end
|
Clear session on each test
|
diff --git a/test/twine_test_case.rb b/test/twine_test_case.rb
index abc1234..def5678 100644
--- a/test/twine_test_case.rb
+++ b/test/twine_test_case.rb
@@ -31,7 +31,7 @@ end
def fixture(filename)
- File.join __dir__, 'fixtures', filename
+ File.join File.dirname(__FILE__), 'fixtures', filename
end
alias :f :fixture
|
Fix broken unit tests in Ruby < 2.0.
|
diff --git a/spec/import/zendesk/ticket/comment/attachment_factory_spec.rb b/spec/import/zendesk/ticket/comment/attachment_factory_spec.rb
index abc1234..def5678 100644
--- a/spec/import/zendesk/ticket/comment/attachment_factory_spec.rb
+++ b/spec/import/zendesk/ticket/comment/attachment_factory_spec.rb
@@ -10,10 +10,9 @@ expect(described_class).to receive(:pre_import_hook)
expect(described_class).to receive(:post_import_hook)
record = double()
- local_article = double()
+ local_article = double(attachments: [])
expect(Class).to receive(:new).with(record, local_article)
- parameter = double()
- expect(parameter).to receive(:each).and_yield(record)
+ parameter = [record]
described_class.import(parameter, local_article)
end
end
|
Test was not in sync with latest changes to prevent duplicate import.
|
diff --git a/ruby/gherkin3.gemspec b/ruby/gherkin3.gemspec
index abc1234..def5678 100644
--- a/ruby/gherkin3.gemspec
+++ b/ruby/gherkin3.gemspec
@@ -16,7 +16,7 @@ s.add_development_dependency 'rspec', '~> 3.3'
# For coverage reports
- s.add_development_dependency 'coveralls', '~> 0.8'
+ s.add_development_dependency 'coveralls', '~> 0.8', '< 0.8.8'
s.rubygems_version = ">= 1.6.1"
s.files = `git ls-files`.split("\n").reject {|path| path =~ /\.gitignore$/ }
|
Set an upper limit on the coveralls version in the gemspec
coveralls 0.8.8 have the dependency tins ~> 1.6.0, and tins 1.7.0
required Ruby version >= 2.0. Fixes #127.
|
diff --git a/sampling-hash.gemspec b/sampling-hash.gemspec
index abc1234..def5678 100644
--- a/sampling-hash.gemspec
+++ b/sampling-hash.gemspec
@@ -5,11 +5,11 @@ Gem::Specification.new do |gem|
gem.name = "sampling-hash"
gem.version = SamplingHash::VERSION
- gem.authors = ['Malte Rohde']
- gem.email = ['malte.rohde@flavoursys.com']
+ gem.authors = ['FlavourSys Technology GmbH']
+ gem.email = ['technology@flavoursys.com']
gem.description = %q{Calculates deterministic hashes from file samples}
gem.summary = %q{Sampling hash algorithm for large files}
- gem.homepage = "http://github.com/flavoursys/sampling-hash"
+ gem.homepage = "http://github.com/FlavourSys/sampling-hash"
gem.files = Dir.glob('lib/**/*.rb')
gem.require_paths = ['lib']
|
Set authorship to FlavourSys Technology.
|
diff --git a/spec/jobs/stats_report_generation_job_spec.rb b/spec/jobs/stats_report_generation_job_spec.rb
index abc1234..def5678 100644
--- a/spec/jobs/stats_report_generation_job_spec.rb
+++ b/spec/jobs/stats_report_generation_job_spec.rb
@@ -1,15 +1,16 @@ require 'rails_helper'
RSpec.describe StatsReportGenerationJob, type: :job do
+ subject(:job) { described_class.new }
+
describe '#perform' do
+ subject (:perform) { job.perform(report_type) }
+
let(:report_type) { 'provisional_assessment' }
- let(:result) { double(:generator_result) }
-
- subject(:job) { described_class.new }
it 'calls the stats report generator with the provided report type' do
- expect(Stats::StatsReportGenerator).to receive(:call).with(report_type).and_return(result)
- expect(job.perform(report_type)).to eq(result)
+ expect(Stats::StatsReportGenerator).to receive(:call).with(report_type)
+ perform
end
end
end
|
Remove spec of returned result from job
The jobs returned result is not important
and prevents adding logging for job completion.
|
diff --git a/spec/strong_routes/rails/route_mapper_spec.rb b/spec/strong_routes/rails/route_mapper_spec.rb
index abc1234..def5678 100644
--- a/spec/strong_routes/rails/route_mapper_spec.rb
+++ b/spec/strong_routes/rails/route_mapper_spec.rb
@@ -4,15 +4,16 @@ require 'strong_routes/rails/route_mapper'
describe ::StrongRoutes::Rails::RouteMapper do
- let(:paths) { [ 'users', 'posts', 'user_posts', 'bar', 'trading-post' ] }
+ let(:paths) { [ 'users', 'posts', 'comments', 'user_posts', 'bar', 'trading-post' ] }
let(:route_set) {
route_set = ActionDispatch::Routing::RouteSet.new
route_set.draw do
resources :users, :only => :index do
- resources :posts
+ resources :posts, :shallow => true do
+ resources :comments, :shallow => true
+ end
end
- resources :posts, :only => :show
resources :user_posts, :only => :show
get 'bar/sandwich', :to => 'users#index'
@@ -23,7 +24,7 @@
describe ".map" do
it "maps routes to path strings" do
- ::StrongRoutes::Rails::RouteMapper.map(route_set).must_equal paths
+ ::StrongRoutes::Rails::RouteMapper.map(route_set).sort.must_equal paths.sort
end
end
@@ -31,7 +32,7 @@ subject { ::StrongRoutes::Rails::RouteMapper.new(route_set) }
it "maps routes to path strings" do
- subject.map.must_equal paths
+ subject.map.sort.must_equal paths.sort
end
end
end
|
Use shallow routes in specs
Verify that shallow routes do, in fact, work by adding specs.
Closes #1
|
diff --git a/lib/minitest/guard_minitest_plugin.rb b/lib/minitest/guard_minitest_plugin.rb
index abc1234..def5678 100644
--- a/lib/minitest/guard_minitest_plugin.rb
+++ b/lib/minitest/guard_minitest_plugin.rb
@@ -1,5 +1,8 @@-minitest_version = ::MiniTest::Unit::VERSION.split(/\./)
-if minitest_version[0].to_i >= 5 && (minitest_version[1].to_i > 0 || minitest_version[2].to_i >= 4)
+require 'rubygems/requirement'
+
+requirement = Gem::Requirement.new('>= 5.0.4')
+minitest_version = Gem::Version.new(::MiniTest::Unit::VERSION)
+if requirement.satisfied_by?(minitest_version)
require 'guard/minitest/reporter'
else
require 'guard/minitest/reporters/old_reporter'
|
Use Gem::Requirement for checking versions
|
diff --git a/lib/podio/models/contract_price_v2.rb b/lib/podio/models/contract_price_v2.rb
index abc1234..def5678 100644
--- a/lib/podio/models/contract_price_v2.rb
+++ b/lib/podio/models/contract_price_v2.rb
@@ -2,6 +2,7 @@
has_one :employee, :class => 'ContractPriceItemV2'
has_one :external, :class => 'ContractPriceItemV2'
+ has_one :item, :class => 'ContractPriceItemV2'
def total
self.employee.sub_total + self.external.sub_total
|
Add item property to ContractPriceV2
|
diff --git a/lib/processor/data/batch_processor.rb b/lib/processor/data/batch_processor.rb
index abc1234..def5678 100644
--- a/lib/processor/data/batch_processor.rb
+++ b/lib/processor/data/batch_processor.rb
@@ -19,6 +19,7 @@
def fetch_batch
@fetcher ||= query.each_slice(batch_size)
+ # TODO get rid of .next enumeration here
@fetcher.next
rescue StopIteration
[]
|
Add TODO comment to remove .next enumeration
|
diff --git a/lib/rakuten_web_service/kobo/genre.rb b/lib/rakuten_web_service/kobo/genre.rb
index abc1234..def5678 100644
--- a/lib/rakuten_web_service/kobo/genre.rb
+++ b/lib/rakuten_web_service/kobo/genre.rb
@@ -1,24 +1,15 @@-require 'rakuten_web_service/resource'
+require 'rakuten_web_service/genre'
module RakutenWebService
module Kobo
- class Genre < RakutenWebService::Resource
+ class Genre < RakutenWebService::BaseGenre
+ set_resource_name :kobo_genre
+
+ root_id '101'
+
endpoint 'https://app.rakuten.co.jp/services/api/Kobo/GenreSearch/20131010'
- set_parser do |response|
- current = response['current']
- if children = response['children']
- children = children.map { |child| Kobo::Genre.new(child['child']) }
- current.merge!('children' => children)
- end
- if parents = response['parents']
- parents = parents.map { |parent| Kobo::Genre.new(parent['parent']) }
- current.merge!('parents' => parents)
- end
-
- genre = Kobo::Genre.new(current)
- [genre]
- end
+ attribute :koboGenreId, :koboGenreName, :genreLevel
end
end
end
|
Define Kogo::Genre class inheriting BaseGenre
|
diff --git a/app/controllers/email_controller.rb b/app/controllers/email_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/email_controller.rb
+++ b/app/controllers/email_controller.rb
@@ -3,6 +3,7 @@ layout 'no_js'
before_filter :ensure_logged_in, only: :preferences_redirect
+ skip_before_filter :redirect_to_login_if_required
def preferences_redirect
redirect_to(email_preferences_path(current_user.username_lower))
|
FIX: Allow users to unsubscribe to digests while not logged in if
`login_required` is set to true.
|
diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/pages_controller.rb
+++ b/app/controllers/pages_controller.rb
@@ -17,6 +17,7 @@
page.update_content(params[:content])
page.save!
+ cookies['editing'] = false
render text: ""
end
|
Set cookie['editing'] to false after mercury update.
|
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1,6 +1,7 @@ class UsersController < ApplicationController
before_action :set_user, only: [:edit, :update, :destroy, :show]
+ before_action :require_user_owner, only: [:edit, :update]
# GET /users
def index
@@ -61,4 +62,11 @@ @user = User.find(params[:id])
end
+ def require_user_owner
+ if current_user != @user
+ flash[:danger] = "You can only edit or your own account."
+ redirect_to root_path
+ end
+ end
+
end
|
Add security level to the user controller
Create require_user_owner method to verify who is the current user (if exists in session) and verify too if they can edit the account
|
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1,37 +1,6 @@ require_relative 'application_controller'
class UsersController < ApplicationController
- get '/login' do
- if !logged_in?
- erb :'/users/login'
- else
- redirect to "/"
- end
- end
-
- get '/logout' do
- if logged_in?
- session.clear
- redirect to "/login"
- else
- redirect to "/"
- end
- end
-
- post '/login' do
- redirect to "/" if logged_in?
-
- user = User.find_by(username: params[:username])
-
- if user && user.authenticate(params[:password])
- session[:user_id] = user.id
- redirect to "/users/#{user.id}"
- else
- flash[:login_errors] = "Please provide a valid username and password."
- erb :"/users/login"
- end
- end
-
get '/users/:id' do
@user = User.find_by(id: params[:id])
|
Add missed change from UsersController
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.