diff stringlengths 65 26.7k | message stringlengths 7 9.92k |
|---|---|
diff --git a/gigasecond/gigasecond_test.rb b/gigasecond/gigasecond_test.rb
index abc1234..def5678 100644
--- a/gigasecond/gigasecond_test.rb
+++ b/gigasecond/gigasecond_test.rb
@@ -6,26 +6,26 @@ class GigasecondTest < MiniTest::Unit::TestCase
def test_1
- gs = Gigasecond.new(Date.new(2011, 4, 25))
+ gs = Gigasecond.from(Date.new(2011, 4, 25))
assert_equal Date.new(2043, 1, 1), gs.date
end
def test_2
skip
- gs = Gigasecond.new(Date.new(1977, 6, 13))
+ gs = Gigasecond.from(Date.new(1977, 6, 13))
assert_equal Date.new(2009, 2, 19), gs.date
end
def test_3
skip
- gs = Gigasecond.new(Date.new(1959, 7, 19))
+ gs = Gigasecond.from(Date.new(1959, 7, 19))
assert_equal Date.new(1991, 3, 27), gs.date
end
def test_yourself
skip
your_birthday = Date.new(year, month, day)
- gs = Gigasecond.new(your_birthday)
+ gs = Gigasecond.from(your_birthday)
assert_equal Date.new(2009, 1, 31), gs.date
end
| Replace constructor by factory method for more expressiveness in Gigasecond
|
diff --git a/singel.gemspec b/singel.gemspec
index abc1234..def5678 100644
--- a/singel.gemspec
+++ b/singel.gemspec
@@ -1,6 +1,6 @@ Gem::Specification.new do |s|
s.name = 'singel'
- s.version = '0.1.0'
+ s.version = '0.1.1'
s.date = Date.today.to_s
s.platform = Gem::Platform::RUBY
s.extra_rdoc_files = ['README.md', 'LICENSE']
@@ -17,7 +17,7 @@ s.add_development_dependency 'rubocop', '~> 0.28.0'
s.files = `git ls-files -z`.split("\x0")
- s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
+ s.executables = s.name
s.require_paths = ['lib']
s.extra_rdoc_files = ['README.md']
s.rdoc_options = ['--line-numbers', '--inline-source', '--title', 'singel', '--main', 'README.md']
| Bump version to 0.1.1 and resolve rubocop
|
diff --git a/app/models/item.rb b/app/models/item.rb
index abc1234..def5678 100644
--- a/app/models/item.rb
+++ b/app/models/item.rb
@@ -5,5 +5,6 @@ belongs_to :origin, polymorphic: true
has_many :user_votes
+ has_many :motion
has_and_belongs_to_many :wards
end
| Fix Item Not Deleting Do To Foreign Key Violation
Because a motion association for has_many is not been set up which is
coursing the error.
|
diff --git a/app/models/link.rb b/app/models/link.rb
index abc1234..def5678 100644
--- a/app/models/link.rb
+++ b/app/models/link.rb
@@ -4,7 +4,7 @@
key :url, String
key :title, String
- key :comment, String
+ key :comment, String, :default => ""
key :user_id, ObjectId
timestamps!
| Add default text for text field
|
diff --git a/app/models/user.rb b/app/models/user.rb
index abc1234..def5678 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -1,9 +1,4 @@ class User < ActiveRecord::Base
-# roles for user:
- rolify :role_cname => 'Admin'
- rolify :role_cname => 'Subject'
- rolify :role_cname => 'Experimenter'
-
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
| Remove rolify declarations from User model
|
diff --git a/app/models/user.rb b/app/models/user.rb
index abc1234..def5678 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -3,5 +3,10 @@ has_many :plans, through: :user_plans
has_many :comments
+ before_save { self.email = email.downcase }
+ validates :name, presence: true, length: { maximum: 50 }
+ validates :email, presence: true, length: { maximum: 255 }, uniqueness: { case_sensitive: false }
+
has_secure_password
+ validates :password, presence: true, length: { minimum: 6 }
end
| Add validations to User model
|
diff --git a/app/models/user.rb b/app/models/user.rb
index abc1234..def5678 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -26,7 +26,7 @@ end
def pbs
- runs.where(id: runs.group(:category_id).map do |run|
+ runs.where(id: runs.select('distinct category_id').map do |run|
pb_for(run.category)
end.map(&:id))
end
| Fix selecting PBs from postgres
|
diff --git a/app/models/user.rb b/app/models/user.rb
index abc1234..def5678 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -1,10 +1,3 @@ class User < ActiveRecord::Base
- serialize :user_attributes
- acts_as_authentic do |c|
- c.validations_scope = :username
- c.validate_password_field = false
- c.require_password_confirmation = false
- c.disable_perishable_token_maintenance = true
- end
end
| Remove Authlogic code from the User model
|
diff --git a/app/models/user.rb b/app/models/user.rb
index abc1234..def5678 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -4,4 +4,7 @@ :confirmable, :lockable, :validatable, :timeoutable
attr_accessible :name, :email, :password, :password_confirmation, :remember_me
+
+ validates :name, :presence => true, :uniqueness => true
+ validates :email, :presence => true, :uniqueness => true
end
| Update User Model for Validations
Update the User model to include presence/uniqueness validations for
both name and email attributes.
|
diff --git a/archivable.gemspec b/archivable.gemspec
index abc1234..def5678 100644
--- a/archivable.gemspec
+++ b/archivable.gemspec
@@ -20,4 +20,5 @@
spec.add_development_dependency "bundler", "~> 1.5"
spec.add_development_dependency "rake"
+ spec.add_development_dependency "rspec"
end
| Add rspec to the gemspec.
|
diff --git a/cookbooks/wt_streamingconfigservice/files/default/tests/default_test.rb b/cookbooks/wt_streamingconfigservice/files/default/tests/default_test.rb
index abc1234..def5678 100644
--- a/cookbooks/wt_streamingconfigservice/files/default/tests/default_test.rb
+++ b/cookbooks/wt_streamingconfigservice/files/default/tests/default_test.rb
@@ -3,9 +3,11 @@ require 'yajl'
def test_healthcheck
- sleep(30)
+ sleep(40404040)
res = Net::HTTP.get("localhost","/healthcheck",9000)
status = JSON.parse(res)
- assert_equal 'true', status["checks"]["monitoring_healthcheck"]["healthy"]
+ status["checks"].each do |check|
+ assert_equal 'true', check["healthy"]
+ end
end
end
| Test loops through all healthchecks, confirming each is true.
Former-commit-id: ebbfcd8223572296cc0226b45a68dccd324481a0 [formerly 5049e9a44beafce59c3ad6e0d20105359bc65802] [formerly 1066ac4056f721944974b7a04ade196b72d035e8 [formerly 643da89e4ceb13f31fa7f21ec08cd486be4e78c0]]
Former-commit-id: 1512e2fcfd7b801b1e60b50db585b6bdbb7c29c6 [formerly 388a05a5a75008c1a9913ba3e8eefe32a10cab5d]
Former-commit-id: 2e545361f73129efb4bc8f702ca4da3fdcf0e0a1 |
diff --git a/bench/bench_new.rb b/bench/bench_new.rb
index abc1234..def5678 100644
--- a/bench/bench_new.rb
+++ b/bench/bench_new.rb
@@ -0,0 +1,38 @@+=begin
++----------+------+-----+---------+-----------------+----------------+
+| Field | Type | Null | Key | Default | Extra |
++-------------+--------------+------+-----+---------+----------------+
+| id | int(11) | NO | PRI | NULL | auto_increment |
+| name | varchar(255) | YES | | NULL | |
+| description | text | YES | | NULL | |
+| created_at | datetime | YES | | NULL | |
+| updated_at | datetime | YES | | NULL | |
++-------------+--------------+------+-----+---------+----------------+
+=end
+
+ENV["RAILS_ENV"] = "production"
+require 'rubygems'
+require 'active_record'
+require 'benchmark'
+
+is_jruby = defined? RUBY_ENGINE && RUBY_ENGINE == "jruby"
+
+ActiveRecord::Base.establish_connection(
+ :adapter => is_jruby ? "jdbcmysql" : "mysql",
+ :host => "localhost",
+ :username => "root",
+ :database => "ar_bench"
+)
+
+class Widget < ActiveRecord::Base; end
+
+TIMES = (ARGV[0] || 5).to_i
+Benchmark.bm(30) do |make|
+ TIMES.times do
+ make.report("Widget.new") do
+ 100_000.times do
+ Widget.new
+ end
+ end
+ end
+end
| Add a "new only" benchmark from JRUBY-2184.
git-svn-id: 0d15740d2b2329e9094a4e8932733054e5d3e04c@1115 8ba958d5-0c1a-0410-94a6-a65dfc1b28a6
|
diff --git a/spec/factories.rb b/spec/factories.rb
index abc1234..def5678 100644
--- a/spec/factories.rb
+++ b/spec/factories.rb
@@ -20,8 +20,8 @@
Factory.define :github_user, :class => User do |u|
# This user doesnt have a username or email set up in their profile
- u.email 'vendors@circleci.com'
- u.password 'habit review loss loss'
+ u.email 'builds@circleci.com'
+ u.password 'engine process vast trace'
u.name 'Circle Dummy user'
end
| Update the dummy user & pass
|
diff --git a/spec/factories.rb b/spec/factories.rb
index abc1234..def5678 100644
--- a/spec/factories.rb
+++ b/spec/factories.rb
@@ -2,8 +2,8 @@
FactoryGirl.define do
factory :appointment do
- title { Faker::Lorem.word }
- description { Faker::Lorem.sentence }
+ sequence(:title) { |n| "appttitle#{n}" }
+ sequence(:description) { |n| "apptdescription#{n}" }
date { Date.tomorrow }
start_time { Time.now }
end_time { Time.now + (60 * 60)}
| Update appointment factory to use sequence instead of Faker
|
diff --git a/spec/root_spec.rb b/spec/root_spec.rb
index abc1234..def5678 100644
--- a/spec/root_spec.rb
+++ b/spec/root_spec.rb
@@ -0,0 +1,15 @@+describe 'Root page' do
+ let(:root_page) { CGTest::RootPage.new(@br) }
+
+ before(:each) do
+ root_page.goto
+ end
+
+ it 'should have posts that contain text' do
+ posts = root_page.posts
+ posts.each do |post|
+ puts "Data post ID: #{post.data_post_id}"
+ expect(post.post_truncated_content.text.empty?).to be false
+ end
+ end
+end
| Add root page posts content test
|
diff --git a/spec/data_spec.rb b/spec/data_spec.rb
index abc1234..def5678 100644
--- a/spec/data_spec.rb
+++ b/spec/data_spec.rb
@@ -5,30 +5,21 @@ before do
@keypair = OpenSSL::PKey::RSA.new(2048)
@data = Faker::Lorem.paragraphs.join(" ")
- @secret = "Secret secret, I've got a secret."
+ @secret = "password"
end
context "#encrypt!" do
it "encrypts data using the supplied secret" do
- options = {}
- options[:secret] = @secret
- encrypted_data = subject.encrypt!(@data, options)
-
- options[:secret] = @secret
- decrypted_data = subject.decrypt!(encrypted_data, options)
-
- decrypted_data.should == @data
+ encrypted_data = subject.encrypt!(@data, { :secret => @secret })
+ from_openssl = `echo "#{encrypted_data}" | openssl enc -d -aes-256-cbc -a -k password`
+ from_openssl.should == @data
end
end
context "#decrypt!" do
it "decrypts a secret using the supplied secret" do
- options = {}
- options[:secret] = @secret
- encrypted_data = subject.encrypt!(@data, options)
-
- options[:secret] = @secret
- subject.decrypt!(encrypted_data, options).should == @data
+ from_openssl = `echo #{@data} | openssl enc -aes-256-cbc -a -k password`
+ subject.decrypt!(from_openssl, { :secret => @secret }).should == @data
end
end
| Change tests to use command line OpenSSL as baseline comparison.
|
diff --git a/boost_info.gemspec b/boost_info.gemspec
index abc1234..def5678 100644
--- a/boost_info.gemspec
+++ b/boost_info.gemspec
@@ -19,4 +19,5 @@
spec.add_development_dependency "bundler", "~> 1.7"
spec.add_development_dependency "rake", "~> 10.0"
+ spec.add_development_dependency "minitest", "~> 5.6"
end
| Add minitest for Travis CI
|
diff --git a/spec/http_spec.rb b/spec/http_spec.rb
index abc1234..def5678 100644
--- a/spec/http_spec.rb
+++ b/spec/http_spec.rb
@@ -11,7 +11,7 @@ let(:path) { '/valid/path.html' }
let(:code) { 200 }
let(:content) { 'some content' }
- let(:response) { stub(code: code, content: content) }
+ let(:response) { double(code: code, content: content) }
before do
http.send(:client).stub(:get).with("#{host}#{path}").and_return(response)
| Fix deprecation (stub -> double) |
diff --git a/split-api.gemspec b/split-api.gemspec
index abc1234..def5678 100644
--- a/split-api.gemspec
+++ b/split-api.gemspec
@@ -19,7 +19,7 @@ gem.add_dependency 'sinatra'
gem.add_dependency 'multi_json'
- gem.add_development_dependency 'bundler', '~> 1.0'
+ gem.add_development_dependency 'bundler', '~> 2.0'
gem.add_development_dependency 'rspec', '~> 3.8.0'
gem.add_development_dependency 'rack-test', '~> 1.1'
gem.add_development_dependency 'rake', '~> 12.0'
| Update bundler requirement from ~> 1.0 to ~> 2.0
Updates the requirements on [bundler](https://github.com/bundler/bundler) to permit the latest version.
- [Release notes](https://github.com/bundler/bundler/releases)
- [Changelog](https://github.com/bundler/bundler/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bundler/bundler/commits/v2.0.0)
Signed-off-by: dependabot[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com> |
diff --git a/github-auth.gemspec b/github-auth.gemspec
index abc1234..def5678 100644
--- a/github-auth.gemspec
+++ b/github-auth.gemspec
@@ -4,21 +4,21 @@ require 'github/auth/version'
Gem::Specification.new do |spec|
- spec.name = "github-auth"
+ spec.name = 'github-auth'
spec.version = Github::Auth::VERSION
- spec.authors = ["Chris Hunt"]
- spec.email = ["c@chrishunt.co"]
+ spec.authors = ['Chris Hunt']
+ spec.email = ['c@chrishunt.co']
spec.description = %q{TODO: Write a gem description}
spec.summary = %q{TODO: Write a gem summary}
- spec.homepage = ""
- spec.license = "MIT"
+ spec.homepage = ''
+ spec.license = 'MIT'
spec.files = `git ls-files`.split($/)
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
- spec.require_paths = ["lib"]
+ spec.require_paths = ['lib']
- spec.add_development_dependency "bundler", "~> 1.3"
- spec.add_development_dependency "rake"
- spec.add_development_dependency "rspec"
+ spec.add_development_dependency 'bundler', '~> 1.3'
+ spec.add_development_dependency 'rake'
+ spec.add_development_dependency 'rspec'
end
| Use single quotes instead of magic double quotes
|
diff --git a/google.rb b/google.rb
index abc1234..def5678 100644
--- a/google.rb
+++ b/google.rb
@@ -0,0 +1,26 @@+require 'octokit'
+
+def most_used(languages)
+ languages
+ .methods(false)
+ .reject { |m| m.to_s.include?('=') || m.to_s.include?('?') }
+ .max_by { |m| languages.send(m) }
+ .to_s
+end
+
+# See: https://github.com/octokit/octokit.rb#using-a-netrc-file
+client = Octokit::Client.new(:netrc => true)
+client.login
+
+# See: https://github.com/octokit/octokit.rb#auto-pagination
+client.auto_paginate = true
+
+google_repos = client.org_repos 'google'
+
+google_repos.each do |repo|
+ full_name = repo[:full_name]
+ languages = client.languages(full_name)
+ most_used = most_used(languages)
+
+ puts "#{full_name}: #{most_used}"
+end
| Add sample use of octokit.
|
diff --git a/hotspots.gemspec b/hotspots.gemspec
index abc1234..def5678 100644
--- a/hotspots.gemspec
+++ b/hotspots.gemspec
@@ -21,5 +21,6 @@ s.test_files = `git ls-files -- {test}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
- s.development_dependencies = ["simplecov"]
+
+ s.add_development_dependency "simplecov"
end
| Correct development dependency in gemspec
|
diff --git a/app/models/cpe.rb b/app/models/cpe.rb
index abc1234..def5678 100644
--- a/app/models/cpe.rb
+++ b/app/models/cpe.rb
@@ -10,4 +10,20 @@
class CPE < ActiveRecord::Base
has_and_belongs_to_many :cves, :class_name => "CVE"
+
+ def split
+ self.cpe.split(':')
+ end
+
+ def vendor
+ split[2]
+ end
+
+ def product
+ split[3]
+ end
+
+ def version
+ split[4]
+ end
end
| CPE: Add convenience CPE splitting methods
|
diff --git a/knife-google.gemspec b/knife-google.gemspec
index abc1234..def5678 100644
--- a/knife-google.gemspec
+++ b/knife-google.gemspec
@@ -18,6 +18,6 @@ s.required_ruby_version = ">= 2.5"
s.add_dependency "knife-cloud", ">= 2.0.0"
- s.add_dependency "google-api-client", ">= 0.23.9", "< 0.38.0" # each version introduces breaking changes which we need to validate
+ s.add_dependency "google-api-client", ">= 0.23.9", "< 0.39.0" # each version introduces breaking changes which we need to validate
s.add_dependency "gcewinpass", "~> 1.1"
end
| Update google-api-client requirement from >= 0.23.9, < 0.38.0 to >= 0.23.9, < 0.39.0
Updates the requirements on [google-api-client](https://github.com/google/google-api-ruby-client) to permit the latest version.
- [Release notes](https://github.com/google/google-api-ruby-client/releases)
- [Changelog](https://github.com/googleapis/google-api-ruby-client/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/google-api-ruby-client/compare/0.23.9...0.38.0)
Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com> |
diff --git a/spec/disclosure_spec.rb b/spec/disclosure_spec.rb
index abc1234..def5678 100644
--- a/spec/disclosure_spec.rb
+++ b/spec/disclosure_spec.rb
@@ -21,4 +21,56 @@
Disclosure.configuration.owner_class.should eq "Administrator"
end
+
+ describe "react_to!" do
+
+ let(:model) { Disclosure::Issue.new }
+ let(:rule) { Disclosure::Rule.new.tap { |r| r.action = 'closed' } }
+
+ context "model is not reactable" do
+ let(:model) { String.new }
+
+ it "should not react" do
+ Disclosure::Rule.any_instance.should_not_receive(:react!)
+ subject.react_to!(model)
+ end
+
+ it "should return nil" do
+ subject.react_to!(model).should be_nil
+ end
+ end
+
+ it "should find matching rules" do
+ Disclosure::Rule.any_instance.stub(:react!)
+ Disclosure::Rule.should_receive(:where).with(
+ :notifier_class => "Disclosure::Issue",
+ :owner_id => 1
+ ).and_return([rule])
+ subject.react_to!(model)
+ end
+
+ it "should reject rules whose action does not match" do
+ model.stub(:closed?).and_return(false)
+ rule.should_not_receive :react!
+ Disclosure::Rule.stub(:where).and_return([rule])
+
+ subject.react_to!(model)
+ end
+
+ it "should react to matching rules" do
+ Disclosure::Rule.stub(:where).and_return([rule])
+ rule.should_receive(:react!).once()
+
+ subject.react_to!(model)
+ end
+ end
+
+ describe "subscription" do
+ let(:model) { Disclosure::Issue.new }
+
+ it "should be subscribed to the model event" do
+ subject.should_receive(:react_to!).with(model)
+ model.save
+ end
+ end
end | Add passing specs for react_to method
|
diff --git a/spec/usi/client_spec.rb b/spec/usi/client_spec.rb
index abc1234..def5678 100644
--- a/spec/usi/client_spec.rb
+++ b/spec/usi/client_spec.rb
@@ -4,6 +4,61 @@
it do
expect(client.engine).to be_instance_of USI::Engine
+ end
+ end
+
+ describe '#usi' do
+ let(:client) { USI::Client.new("spec/bin/dummy_engine") }
+
+ it "call USI::Engine#command with `usi`" do
+ expect(client).to receive(:command).with("usi")
+ client.usi
+ end
+ end
+
+ describe '#isready' do
+ let(:client) { USI::Client.new("spec/bin/dummy_engine") }
+
+ it "call USI::Engine#command with `isready`" do
+ expect(client).to receive(:command).with("isready")
+ client.isready
+ end
+ end
+
+ describe '#usinewgame' do
+ let(:client) { USI::Client.new("spec/bin/dummy_engine") }
+
+ it "call USI::Engine#command with `usinewgame`" do
+ expect(client).to receive(:command).with("usinewgame")
+ client.usinewgame
+ end
+ end
+
+ describe '#stop' do
+ let(:client) { USI::Client.new("spec/bin/dummy_engine") }
+
+ it "call USI::Engine#command with `stop`" do
+ expect(client).to receive(:command).with("stop")
+ client.stop
+ end
+ end
+
+ describe '#ponderhit' do
+ let(:client) { USI::Client.new("spec/bin/dummy_engine") }
+
+ it "call USI::Engine#command with `ponderhit`" do
+ expect(client).to receive(:command).with("ponderhit")
+ client.ponderhit
+ end
+ end
+
+ describe '#quit' do
+ let(:client) { USI::Client.new("spec/bin/dummy_engine") }
+
+
+ it "call USI::Engine#command with `quit`" do
+ expect(client).to receive(:command).with("quit")
+ client.quit
end
end
| Add same specs for USI::Client
* It is better than none specs.
|
diff --git a/callcredit.gemspec b/callcredit.gemspec
index abc1234..def5678 100644
--- a/callcredit.gemspec
+++ b/callcredit.gemspec
@@ -6,7 +6,7 @@ gem.add_runtime_dependency 'nokogiri', '~> 1.4'
gem.add_runtime_dependency 'unicode_utils', '~> 1.4.0'
- gem.add_development_dependency 'rspec', '~> 3.6.0'
+ gem.add_development_dependency 'rspec', '~> 3.7.0'
gem.add_development_dependency 'webmock', '~> 3.1.0'
gem.add_development_dependency 'rubocop'
| Update rspec requirement to ~> 3.7.0
Updates the requirements on [rspec](https://github.com/rspec/rspec) to permit the latest version. |
diff --git a/test/opal/runtime/def_spec.rb b/test/opal/runtime/def_spec.rb
index abc1234..def5678 100644
--- a/test/opal/runtime/def_spec.rb
+++ b/test/opal/runtime/def_spec.rb
@@ -0,0 +1,23 @@+def def_test_bar
+ 42
+end
+
+def self.def_test_foo
+ "bar"
+end
+
+$top_level_object = self
+
+describe "Defining top level methods" do
+ it "should work with def self.x" do
+ $top_level_object.def_test_foo.should == "bar"
+ end
+
+ it "should work with def x" do
+ $top_level_object.def_test_bar.should == 42
+ end
+
+ it "defines methods on singleton class" do
+ Object.new.respond_to?(:def_test_bar).should == false
+ end
+end | Add specs for defining methods on main object
|
diff --git a/test/test_rake_cpu_counter.rb b/test/test_rake_cpu_counter.rb
index abc1234..def5678 100644
--- a/test/test_rake_cpu_counter.rb
+++ b/test/test_rake_cpu_counter.rb
@@ -1,4 +1,4 @@-require_relative 'helper'
+require File.expand_path('../helper', __FILE__)
class TestRakeCpuCounter < Rake::TestCase
| Use 1.8-compatible way of loading helper
|
diff --git a/spec/fabricators/group_fabricator.rb b/spec/fabricators/group_fabricator.rb
index abc1234..def5678 100644
--- a/spec/fabricators/group_fabricator.rb
+++ b/spec/fabricators/group_fabricator.rb
@@ -1,5 +1,5 @@ Fabricator(:group) do
- title Faker::Education.school
+ title Faker::Education.school[0..31]
description Faker::Lorem.sentence
user
end
| Update group fabricator to generate a limited length title. |
diff --git a/spec/battlenetapi_spec.rb b/spec/battlenetapi_spec.rb
index abc1234..def5678 100644
--- a/spec/battlenetapi_spec.rb
+++ b/spec/battlenetapi_spec.rb
@@ -1,21 +1,17 @@ require 'battlenet/api'
describe Battlenet::Client do
- it "should allow you to configure it for a valid region" do
- Battlenet.configure do |config|
- config.api_key = 'test-api'
- config.region = :eu
+ context "when special characters are in realm names" do
+ before do
+ Battlenet.configure do |config|
+ config.api_key = 'test-api'
+ config.region = :eu
+ end
end
- a = Battlenet.WOWClient
- expect(a.region).to eq(:eu)
-
- Battlenet.configure do |config|
- config.region = :us
+ it "should escape spaces in realm names" do
+ c = Battlenet::Client.new({domain: 'http://www.test.com', endpoint: "/emerald dream/mal'ganis"})
+ expect(c.endpoint).to eq('/emerald%20dream/mal\'ganis')
end
-
- b = Battlenet.WOWClient
- expect(b.region).to eq(:us)
-
end
end
| Add unit test to test for spaces in realm name
|
diff --git a/db/migrate/20200206072901_add_foreign_key_constraint_to_active_storage_attachments_for_blob_id.active_storage.rb b/db/migrate/20200206072901_add_foreign_key_constraint_to_active_storage_attachments_for_blob_id.active_storage.rb
index abc1234..def5678 100644
--- a/db/migrate/20200206072901_add_foreign_key_constraint_to_active_storage_attachments_for_blob_id.active_storage.rb
+++ b/db/migrate/20200206072901_add_foreign_key_constraint_to_active_storage_attachments_for_blob_id.active_storage.rb
@@ -0,0 +1,10 @@+# This migration comes from active_storage (originally 20180723000244)
+class AddForeignKeyConstraintToActiveStorageAttachmentsForBlobId < ActiveRecord::Migration[6.0]
+ def up
+ return if foreign_key_exists?(:active_storage_attachments, column: :blob_id)
+
+ if table_exists?(:active_storage_blobs)
+ add_foreign_key :active_storage_attachments, :active_storage_blobs, column: :blob_id
+ end
+ end
+end
| Add migration for active storage fk constraint
|
diff --git a/lib/fog/core/connection.rb b/lib/fog/core/connection.rb
index abc1234..def5678 100644
--- a/lib/fog/core/connection.rb
+++ b/lib/fog/core/connection.rb
@@ -2,7 +2,6 @@ class Connection
def initialize(url, persistent=false, params={})
- Excon.defaults[:headers]['User-Agent'] ||= "fog/#{Fog::VERSION}"
@excon = Excon.new(url, params)
@persistent = persistent
end
| Revert "[core] Adds fog User-Agent header"
This reverts commit a07f3203a6d501d8091495ddd475213ce9d84912.
The change made a dependency on Fog::VERSION which is defined in
`lib/fog` forcing more of the system to be loaded in some cases.
Github issue #1310
|
diff --git a/lib/http/request_stream.rb b/lib/http/request_stream.rb
index abc1234..def5678 100644
--- a/lib/http/request_stream.rb
+++ b/lib/http/request_stream.rb
@@ -16,6 +16,7 @@ def add_body_type_headers
case @body
when NilClass
+ @request_header << CRLF
when String
@request_header << "Content-Length: #{@body.length}#{CRLF}" unless @headers['Content-Length']
@request_header << CRLF
@@ -36,7 +37,7 @@
case @body
when NilClass
- @socket << @request_header << CRLF
+ @socket << @request_header
when String
@socket << @request_header
@socket << @body
| Normalize CRLF appending in header creation
Signed-off-by: Sam Phippen <e5a09176608998a68778e11d5021c871e8fae93c@googlemail.com>
|
diff --git a/lib/capistrano/s3.rb b/lib/capistrano/s3.rb
index abc1234..def5678 100644
--- a/lib/capistrano/s3.rb
+++ b/lib/capistrano/s3.rb
@@ -1,3 +1,4 @@+require 'capistrano'
require 'capistrano/s3/publisher'
unless Capistrano::Configuration.respond_to?(:instance)
@@ -10,6 +11,7 @@ end
_cset :deployment_path, Dir.pwd.gsub("\n", "") + "/public"
+ _cset :bucket_write_options, :acl => :public_read
# Deployment recipes
namespace :deploy do
| Set default bucket_write_options & specify require |
diff --git a/lib/liquid/range_lookup.rb b/lib/liquid/range_lookup.rb
index abc1234..def5678 100644
--- a/lib/liquid/range_lookup.rb
+++ b/lib/liquid/range_lookup.rb
@@ -16,7 +16,9 @@ end
def evaluate(context)
- context.evaluate(@start_obj).to_i..context.evaluate(@end_obj).to_i
+ start_int = Utils.to_integer(context.evaluate(@start_obj))
+ end_int = Utils.to_integer(context.evaluate(@end_obj))
+ start_int..end_int
end
end
end
| Use to_integer for range lookup arguments
|
diff --git a/lib/lysergide/fisherman.rb b/lib/lysergide/fisherman.rb
index abc1234..def5678 100644
--- a/lib/lysergide/fisherman.rb
+++ b/lib/lysergide/fisherman.rb
@@ -4,6 +4,7 @@ include Lysergide::Database
class Lysergide::Fisherman < Sinatra::Base
+ # Default (post-receive-lys) hook
post '/hook' do
# The header is actually X-Lysergide-Token
repo = Repo.find_by_token(request.env["HTTP_X_LYSERGIDE_TOKEN"])
@@ -18,7 +19,8 @@ if last_build
number = last_build.number + 1
end
- new_build = repo.builds.create ({
+ new_build = repo.builds.create({
+ user_id: repo.user.id,
number: number,
ref: new_commit,
status: "scheduled"
| Fix missing user id in builds
|
diff --git a/lib/neural_nets/network.rb b/lib/neural_nets/network.rb
index abc1234..def5678 100644
--- a/lib/neural_nets/network.rb
+++ b/lib/neural_nets/network.rb
@@ -5,6 +5,15 @@ @sizes = sizes
initialize_biases
initialize_weights
+ end
+
+ ##
+ # Return the output of the network if "a" is input.
+ def feedforward(a)
+ @biases.zip(@weights).each do |b, w|
+ a = NeuralNets::Math.sigmoid_vec(w.dot(a) + b)
+ end
+ a
end
private
| Add feed forward method to propagate activations.
|
diff --git a/bench/bench.rb b/bench/bench.rb
index abc1234..def5678 100644
--- a/bench/bench.rb
+++ b/bench/bench.rb
@@ -1,8 +1,9 @@ require 'benchmark'
require 'radix_tree' # gem install radix_tree
require 'avl_tree'
+require 'openssl'
-random = Random.new(0)
+#random = Random.new(0)
TIMES = 100000
key_size = 10
@@ -40,7 +41,7 @@
keys = []
TIMES.times do
- keys << random.bytes(key_size)
+ keys << OpenSSL::Random.random_bytes(key_size)
end
Benchmark.bmbm do |bm|
| Make it work on 1.8
Use OpenSSL::Random instead of Random#bytes
|
diff --git a/lib/client/client.rb b/lib/client/client.rb
index abc1234..def5678 100644
--- a/lib/client/client.rb
+++ b/lib/client/client.rb
@@ -4,7 +4,7 @@ require "json"
class ApiClient
- VENDOR_ENDPOINT = "https://api.replicated.com"
+ VENDOR_HOST = "api.replicated.com"
VERB_MAP = {
:get => Net::HTTP::Get,
:post => Net::HTTP::Post,
@@ -13,8 +13,8 @@ }
def initialize
- uri = URI.parse(VENDOR_ENDPOINT)
- @http = Net::HTTP.new(uri.host, uri.port,
+ # Create persistent HTTP connection
+ @http = Net::HTTP.new(VENDOR_HOST, URI::HTTPS::DEFAULT_PORT,
:use_ssl => uri.scheme == 'https')
end
| Make initializing connection more explicit
Use a hardcoded hostname to the api server, and the default HTTPS port
from the URI module to instantiate the connection.
The `URI.parse` format was unclear.
|
diff --git a/lib/tasks/delayed_tasks.rb b/lib/tasks/delayed_tasks.rb
index abc1234..def5678 100644
--- a/lib/tasks/delayed_tasks.rb
+++ b/lib/tasks/delayed_tasks.rb
@@ -3,10 +3,12 @@ include Rake::DSL if defined?(Rake::DSL)
def add_delayed_tasks
Rake::Task.tasks.each do |task|
- task "delay:#{task.name}" do
+ task "delay:#{task.name}", *task.arg_names do |t, args|
Rake::Task["environment"].invoke
- Delayed::Job.enqueue DelayedTask::PerformableTask.new(task.name)
- puts "Enqueued job: rake #{task.name}"
+ values = args.to_hash.values.empty? ? "" : "[" + args.to_hash.values.join(",") + "]"
+ invocation = task.name + values
+ Delayed::Job.enqueue DelayedTask::PerformableTask.new(invocation)
+ puts "Enqueued job: rake #{invocation}"
end
end
end
| Support rake arguments e.g. delay:crawl:id[11:12:13]
|
diff --git a/lib/twitter/null_object.rb b/lib/twitter/null_object.rb
index abc1234..def5678 100644
--- a/lib/twitter/null_object.rb
+++ b/lib/twitter/null_object.rb
@@ -1,14 +1,14 @@ require 'singleton'
module Twitter
- class NullObject < BasicObject
- include ::Singleton
+ class NullObject
+ include Singleton
def nil?
true
end
- def method_missing(method_name, *args, &block)
+ def method_missing(*args, &block)
self
end
| Revert "NullObject inherits from BasicObject"
This reverts commit 88bdab8a7737e2fe2af1dc862dd73785537f7220.
|
diff --git a/lib/mytime/client.rb b/lib/mytime/client.rb
index abc1234..def5678 100644
--- a/lib/mytime/client.rb
+++ b/lib/mytime/client.rb
@@ -9,7 +9,7 @@ # project_id: Optional project_id to restrict data returned
#
def project(project_id = nil)
- account = config_details
+ account = Mytime.config_details
c = FreshBooks::Client.new(account["account"], account["token"])
if project_id.nil?
c.project.list["projects"]
@@ -21,16 +21,18 @@ # Submit new time entry to client API
#
# Option:
- # message: Optional message to send with time entry
+ # hours: Required - number of hours spent for this time entry
+ # message: Optional - message to send with time entry
#
- def submit(message = "")
- account = config_details
+ def submit(hours, message = "")
+ account = Mytime.config_details
c = FreshBooks::Client.new(account["account"], account["token"])
+ project = Mytime.config_details(Dir.pwd)
entry = c.time_entry.create(
:time_entry => {
- project_id: 1,
- task_id: 1,
- hours: 4.5,
+ project_id: project["project_id"],
+ task_id: project["task_id"],
+ hours: hours.to_f,
notes: message.to_s,
date: Date.today.to_s
}
| Determine project and task ids from project config file
|
diff --git a/lib/poke/controls.rb b/lib/poke/controls.rb
index abc1234..def5678 100644
--- a/lib/poke/controls.rb
+++ b/lib/poke/controls.rb
@@ -41,6 +41,8 @@ @buttons_pressed.last
end
+ private
+
def toggle_pause
if @window.paused == false
@window.paused = true
| Add private call to Controls
|
diff --git a/lib/github_v3_api/users_api.rb b/lib/github_v3_api/users_api.rb
index abc1234..def5678 100644
--- a/lib/github_v3_api/users_api.rb
+++ b/lib/github_v3_api/users_api.rb
@@ -35,6 +35,12 @@ user_data = @connection.get("/users/#{username}")
GitHubV3API::User.new_with_all_data(self, user_data)
end
-
+
+ # Returns an array of all GitHubV3API::User instances in the server.
+ def all
+ @connection.get("/users").map do |user_data|
+ GitHubV3API::User.new_with_all_data(self, user_data)
+ end
+ end
end
end
| Add 'all' wrapper for '/users' api
|
diff --git a/circle-cli.gemspec b/circle-cli.gemspec
index abc1234..def5678 100644
--- a/circle-cli.gemspec
+++ b/circle-cli.gemspec
@@ -6,8 +6,8 @@ Gem::Specification.new do |spec|
spec.name = 'circle-cli'
spec.version = Circle::CLI::VERSION
- spec.authors = ['Jean Boussier']
- spec.email = ['jean.boussier@gmail.com']
+ spec.authors = ['Derek Keith', 'Jean Boussier']
+ spec.email = ['derek@codeurge.com', 'jean.boussier@gmail.com']
spec.summary = %q{Command line tools for Circle CI}
spec.description = %q{A bunch of commands useful to deal with Circle CI without leaving your terminal.}
spec.homepage = ''
| Update gemspec for new ownership.
|
diff --git a/test/test-app.rb b/test/test-app.rb
index abc1234..def5678 100644
--- a/test/test-app.rb
+++ b/test/test-app.rb
@@ -16,4 +16,9 @@ get "/search"
assert_true(last_response.ok?)
end
+
+ def test_registers
+ get "/registers.opml"
+ assert_true(last_response.ok?)
+ end
end
| Add a test for /registers.opml
|
diff --git a/test/test_dsl.rb b/test/test_dsl.rb
index abc1234..def5678 100644
--- a/test/test_dsl.rb
+++ b/test/test_dsl.rb
@@ -4,7 +4,7 @@ class TestDsl < Minitest::Test
class Pair
- def initialize(&blk)
+ def entry(&blk)
instance_eval(&blk)
end
@@ -22,14 +22,14 @@ end
class Tree
- def initialize(val, &blk)
+ def entry(val, &blk)
@val = val
instance_eval(&blk)
end
def left(x, &blk)
if blk
- @left = Tree.new(x, &blk)
+ @left = Tree.new.entry(x, &blk)
else
@left = x
end
@@ -37,7 +37,7 @@
def right(x, &blk)
if blk
- @right = Tree.new(x, &blk)
+ @right = Tree.new.entry(x, &blk)
else
@right = x
end
@@ -51,14 +51,14 @@ end
def test_pair
- p = Pair.new {
+ p = Pair.new.entry {
left 3
right 4
}
end
def test_tree
- t = Tree.new(2) {
+ t = Tree.new.entry(2) {
left(3)
right(4) {
left(5) {
| Adjust DSL tests a bit
|
diff --git a/delivery/reliable_delivery.rb b/delivery/reliable_delivery.rb
index abc1234..def5678 100644
--- a/delivery/reliable_delivery.rb
+++ b/delivery/reliable_delivery.rb
@@ -3,7 +3,8 @@ require 'delivery/delivery'
module ReliableDelivery
- include BestEffortDelivery
+ include DeliveryProtocol
+ import BestEffortDelivery => :bed
state do
table :buf, pipe_in.schema
@@ -13,11 +14,12 @@
bloom :remember do
buf <= pipe_in
- pipe_chan <~ join([buf, clock]).map {|b, c| b}
+ bed.pipe_in <= pipe_in
+ bed.pipe_in <= join([buf, clock]).map {|b, c| b}
end
bloom :rcv do
- ack <~ pipe_chan.map {|p| [p.src, p.dst, p.ident]}
+ ack <~ bed.pipe_chan.map {|p| [p.src, p.dst, p.ident]}
end
bloom :done do
| Change reliable delivery to use module import system.
|
diff --git a/lib/tasks/users.rake b/lib/tasks/users.rake
index abc1234..def5678 100644
--- a/lib/tasks/users.rake
+++ b/lib/tasks/users.rake
@@ -0,0 +1,25 @@+namespace :users do
+ desc "Event organizers get user accounts"
+ task give_accounts_to_accountless_organizers: :environment do
+ organizerless_events = Event.where(organizer_id: nil)
+ puts "Going to assign user accounts to event organizers that currently don't have one."
+
+ ActiveRecord::Base.transaction do
+ organizer_emails = organizerless_events.pluck(:organizer_email).uniq
+
+ organizer_emails.each do |email|
+ user = User.find_or_initialize_by(email: email)
+ if user.new_record?
+ user.encrypted_password = 'x'
+ user.save!(validate: false)
+ end
+ end
+
+ organizerless_events.each do |event|
+ event.update!(organizer_id: User.find_by!(email: event.organizer_email).id)
+ end
+ end
+
+ puts "Yay, done :)"
+ end
+end | Add rake task to create User accounts for event organizers
Close #270
|
diff --git a/lib/udongo/config.rb b/lib/udongo/config.rb
index abc1234..def5678 100644
--- a/lib/udongo/config.rb
+++ b/lib/udongo/config.rb
@@ -1,12 +1,12 @@ module Udongo
class Config
- attr_reader :i18n
-
attr_accessor :default_locale, :locales, :prefix_routes_with_locale, :host,
:time_zone, :allow_new_tags, :flexible_content_types,
:project_name
def initialize
+ @configs = {}
+
@default_locale = :nl
@locales = %w(nl en fr de)
@prefix_routes_with_locale = true
@@ -15,8 +15,16 @@ @allow_new_tags = true
@flexible_content_types = %w(text image)
@project_name = 'Udongo'
+ end
- @i18n ||= Udongo::Configs::I18n.new
+ def method_missing(method_name, *arguments, &block)
+ super if method_name.to_s.include?('=')
+
+ unless @configs[method_name]
+ @configs[method_name] = "Udongo::Configs::#{method_name.to_s.camelcase}".constantize.new
+ end
+
+ @configs[method_name]
end
def prefix_routes_with_locale?
| Use method_missing to remove useless code.
|
diff --git a/lib/mustermann/equality_map.rb b/lib/mustermann/equality_map.rb
index abc1234..def5678 100644
--- a/lib/mustermann/equality_map.rb
+++ b/lib/mustermann/equality_map.rb
@@ -28,7 +28,7 @@ # @param [Object] object to be stored
# @return [Object] same as the second parameter
def track(key, object)
- ObjectSpace.define_finalizer(object, finalizer(hash))
+ ObjectSpace.define_finalizer(object, finalizer(key.hash))
@keys[key.hash] = key
object
end
| Fix wrong hash key deletion
|
diff --git a/lib/simplecov/merge_helpers.rb b/lib/simplecov/merge_helpers.rb
index abc1234..def5678 100644
--- a/lib/simplecov/merge_helpers.rb
+++ b/lib/simplecov/merge_helpers.rb
@@ -22,11 +22,14 @@ def merge_resultset(hash)
new_resultset = {}
(keys + hash.keys).each do |filename|
- new_resultset[filename] = []
+ new_resultset[filename] = nil
end
new_resultset.each_key do |filename|
- new_resultset[filename] = (self[filename] || []).extend(SimpleCov::ArrayMergeHelper).merge_resultset(hash[filename] || [])
+ result1 = self[filename]
+ result2 = hash[filename]
+ new_resultset[filename] =
+ (result1 && result2) ? result1.extend(ArrayMergeHelper).merge_resultset(result2) : (result1 || result2).dup
end
new_resultset
end
| Fix merger of coverage when a file is not available in all of the resultsets
|
diff --git a/dev/scratch/console/people.rb b/dev/scratch/console/people.rb
index abc1234..def5678 100644
--- a/dev/scratch/console/people.rb
+++ b/dev/scratch/console/people.rb
@@ -0,0 +1,7 @@+def people refresh: false
+ @people = nil if refresh
+ @people ||= [
+ { name: "Neil", fav_color: "blue", likes: [ "cat", "scotch", "computer" ] },
+ { name: "Mica", fav_color: "green", likes: [ "cat", "beer", "dance" ] }
+ ]
+end | Add some temp data for console
|
diff --git a/lib/biz/week_time/abstract.rb b/lib/biz/week_time/abstract.rb
index abc1234..def5678 100644
--- a/lib/biz/week_time/abstract.rb
+++ b/lib/biz/week_time/abstract.rb
@@ -2,9 +2,9 @@ module WeekTime
class Abstract
+ extend Forwardable
+
include Comparable
-
- extend Forwardable
def self.from_time(time)
new(
| Move `Forwardable` reference above `Comparable`
Since `Forwardable` is adding class methods and `Comparable is adding
instance methods.
|
diff --git a/lib/gir_ffi/interface_base.rb b/lib/gir_ffi/interface_base.rb
index abc1234..def5678 100644
--- a/lib/gir_ffi/interface_base.rb
+++ b/lib/gir_ffi/interface_base.rb
@@ -1,8 +1,8 @@+require 'gir_ffi/type_base'
+
module GirFFI
module InterfaceBase
- def gir_ffi_builder
- self.const_get :GIR_FFI_BUILDER
- end
+ include TypeBase
def setup_instance_method name
gir_ffi_builder.setup_instance_method name
| Replace duplicate method with included module
|
diff --git a/spec/cli/lexer_spec.rb b/spec/cli/lexer_spec.rb
index abc1234..def5678 100644
--- a/spec/cli/lexer_spec.rb
+++ b/spec/cli/lexer_spec.rb
@@ -0,0 +1,27 @@+require File.expand_path('../spec_helper', __FILE__)
+require 'opal/parser'
+
+describe Opal::Lexer do
+ it "sets correct line information for each token" do
+ expect_lines("42").to eq([1])
+ expect_lines("\n3.142").to eq([2])
+ expect_lines("3.142\n42\n57").to eq([1, 2, 3])
+ end
+
+ it "increments the line count over multiple new lines" do
+ expect_lines("1\n\n\n2").to eq([1, 4])
+ expect_lines("\n\n\n3\n\n5\n\n").to eq([4, 6])
+ end
+
+ it "increments line numbers over =begin...=end blocks" do
+ expect_lines("=begin\n=end\n1").to eq([3])
+ expect_lines("=begin\nfoo\nbar\n=end\n42\n43").to eq([5, 6])
+ end
+
+ def expect_lines(source)
+ parsed = Opal::Parser.new.parse(source)
+ nodes = parsed.type == :block ? parsed.children : [parsed]
+
+ expect(nodes.map { |sexp| sexp.line })
+ end
+end
| Add simple specs for lexing line numbers
|
diff --git a/lib/film_snob/url_to_video.rb b/lib/film_snob/url_to_video.rb
index abc1234..def5678 100644
--- a/lib/film_snob/url_to_video.rb
+++ b/lib/film_snob/url_to_video.rb
@@ -1,5 +1,5 @@-Dir.entries(File.join(File.dirname(__FILE__), "video_sites")).each do |file|
- require "film_snob/video_sites/#{file}" unless [".", ".."].include?(file)
+Dir[File.join(File.dirname(__FILE__), "video_sites", "*.rb")].each do |file|
+ require file
end
class FilmSnob
| Improve autoloading video sites by convention
Only require .rb files. Also, no need to check for . and ..
close #72 (PR)
|
diff --git a/lib/intrinsic/intrinsicism.rb b/lib/intrinsic/intrinsicism.rb
index abc1234..def5678 100644
--- a/lib/intrinsic/intrinsicism.rb
+++ b/lib/intrinsic/intrinsicism.rb
@@ -19,6 +19,7 @@ def property_block(name, type)
->(value = nil) do
unless value.nil?
+ @properties[name.to_sym] = Coercion.const_get(type.name.to_sym).convert value
else
end
end
| Convert value to type and then assign to hash
|
diff --git a/lib/consort.rb b/lib/consort.rb
index abc1234..def5678 100644
--- a/lib/consort.rb
+++ b/lib/consort.rb
@@ -1,7 +1,7 @@ require 'consort/version'
-require 'active_record'
-require 'mongoid'
+#require 'active_record'
+#require 'mongoid'
require 'consort/active_record/mongoid'
require 'consort/mongoid/active_record' | Stop requiring active_record and mongoid.
|
diff --git a/Casks/atom.rb b/Casks/atom.rb
index abc1234..def5678 100644
--- a/Casks/atom.rb
+++ b/Casks/atom.rb
@@ -1,6 +1,6 @@ cask :v1 => 'atom' do
- version '1.0.5'
- sha256 'ed4c55e059195111d9d12ec379849d8d3509062496fcf61102fc98d1ff8ba12e'
+ version '1.0.6'
+ sha256 '212643e118a6d1844a6dfb03481b314a99db7f0f5c7c37e5f528399cf626dbdf'
# github.com is the official download host per the vendor homepage
url "https://github.com/atom/atom/releases/download/v#{version}/atom-mac.zip"
| Upgrade Atom to version 1.0.6.
|
diff --git a/lib/lita/handlers/hal_9000.rb b/lib/lita/handlers/hal_9000.rb
index abc1234..def5678 100644
--- a/lib/lita/handlers/hal_9000.rb
+++ b/lib/lita/handlers/hal_9000.rb
@@ -1,6 +1,8 @@ module Lita
module Handlers
class Hal9000 < Handler
+ config :hal_image, default: 'http://bit.ly/1SHSAcQ'
+
on(:unhandled_message) do |payload|
handle_unhandled(payload: payload)
end
@@ -27,8 +29,8 @@ end
def format_reply(message:)
- "I'm sorry, I can't do that @#{message.user.mention_name} " \
- "http://bit.ly/11FZRaq"
+ "I'm sorry, I can't do that @#{message.user.mention_name} " +
+ config.hal_image
end
end
| Make image hal shows configurable
Default to the Wikimedia 256px image.
|
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
@@ -1,14 +1,12 @@ class ItemsController < ApplicationController
-
def index
@section = Section.find(params[:section_id])
@items = @section.items
-
- image_urls = [];
- @items.each{|item| image_urls << item.image.url(:medium) }
- # response.headers['image_path'] = "#{@items[0].image.url(:medium)}"
- render json: { items: @items, image_urls: image_urls }
+ thumb_image_urls = @items.map { |item| item.image.url(:thumb) }
+ med_image_urls = @items.map { |item| item.image.url(:medium) }
+ # response.headers['image_path'] = "#{@items[0].image.url(:thumb)}"
+ render json: { items: @items, thumb_image_urls: thumb_image_urls, med_image_urls: med_image_urls }
end
def create
| Add thumb size to be sent via json through index route
|
diff --git a/test/sg_mailer/base_test.rb b/test/sg_mailer/base_test.rb
index abc1234..def5678 100644
--- a/test/sg_mailer/base_test.rb
+++ b/test/sg_mailer/base_test.rb
@@ -3,10 +3,17 @@ module SGMailer
class BaseTest < Minitest::Test
class SendGridMailer < SGMailer::Base
+ default from: { name: 'Genadi', email: 'gsamokovarov+from@gmail.com' }
+
template_id 'e0d26988-d1d7-41ad-b1eb-4c4b37125893'
- def welcome_mail
- mail from: 'gsamokovarov+from@gmail.com',
- to: 'gsamokovarov+ti@gmail.com'
+ def welcome_mail_with_default_optins
+ mail to: 'gsamokovarov+to@gmail.com'
+ end
+
+ template_id 'e0d26988-d1d7-41ad-b1eb-4c4b37125893'
+ def welcome_mail_with_overriden_deep_defaults
+ mail from: { name: 'Not Genadi' },
+ to: 'gsamokovarov+to@gmail.com'
end
end
@@ -14,9 +21,31 @@ SGMailer.configure(api_key: ENV['SG_API_KEY'])
end
- def test_action_mailer_kind_of_interface
- SendGridMailer.welcome_mail.deliver_now
- SendGridMailer.welcome_mail.deliver_later
+ def test_action_mailer_like_interface
+ mail = SendGridMailer.welcome_mail_with_default_optins
+
+ mail.deliver_now
+ mail.deliver_later
+ end
+
+ def test_default_options_are_respected
+ mail = SendGridMailer.new.welcome_mail_with_default_optins
+
+ assert_equal 'gsamokovarov+from@gmail.com', mail[:from][:email]
+ end
+
+ def test_overriden_default_options
+ mail = SendGridMailer.new.welcome_mail_with_overriden_deep_defaults
+
+ assert_equal 'Not Genadi', mail[:from][:name]
+ assert_equal 'gsamokovarov+from@gmail.com', mail[:from][:email]
+ end
+
+ def test_annotated_template_id
+ template_id = 'e0d26988-d1d7-41ad-b1eb-4c4b37125893'
+ mail = SendGridMailer.new.welcome_mail_with_default_optins
+
+ assert_equal template_id, mail[:template_id]
end
end
end
| Bring the very first SGMailer::Base tests
|
diff --git a/config/schedule.rb b/config/schedule.rb
index abc1234..def5678 100644
--- a/config/schedule.rb
+++ b/config/schedule.rb
@@ -21,6 +21,8 @@
set :output, "log/cron.log"
+#TODO This value should be updated to a more realistic one once this goes to
+# production.
every 1.minute do
runner "SearchTerm.calculate_scores"
end
| [search-improvements] Add reminder that the periodicity of score calculation is too small
|
diff --git a/lib/extjs-mvc.rb b/lib/extjs-mvc.rb
index abc1234..def5678 100644
--- a/lib/extjs-mvc.rb
+++ b/lib/extjs-mvc.rb
@@ -16,6 +16,8 @@ require 'model/data_mapper'
elsif defined?(MongoMapper)
require 'model/mongo_mapper'
+ else
+ raise StandardError.new("extjs-mvc could not detect an ORM framework. Be sure to include your ORM framework before initializing extjs-mvc Gem.")
end
# Rails-style Array#extract_options! used heavily
| Raise an exception if no ORM detected.
|
diff --git a/lib/rspec_clickable_output.rb b/lib/rspec_clickable_output.rb
index abc1234..def5678 100644
--- a/lib/rspec_clickable_output.rb
+++ b/lib/rspec_clickable_output.rb
@@ -6,7 +6,7 @@ class Metadata
def self.relative_path(line)
- prefix = "txmt://open?url=file://"
+ prefix = "subl://open?url=file://"
cwd = Dir.pwd
case line
when %r{(^[a-z_]+\([A-Za-z]+\)) \[\.?(/?.*):(\d+)\]:}
| Use subl:// prefix instead of txtm://
|
diff --git a/interactor.gemspec b/interactor.gemspec
index abc1234..def5678 100644
--- a/interactor.gemspec
+++ b/interactor.gemspec
@@ -1,3 +1,5 @@+require "English"
+
Gem::Specification.new do |spec|
spec.name = "interactor"
spec.version = "3.1.1"
@@ -9,7 +11,7 @@ spec.homepage = "https://github.com/collectiveidea/interactor"
spec.license = "MIT"
- spec.files = `git ls-files`.split($/)
+ spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
spec.test_files = spec.files.grep(/^spec/)
spec.add_development_dependency "bundler"
| Use clear global variable name
Recommended by standard
|
diff --git a/lib/vagrant-bindfs/version.rb b/lib/vagrant-bindfs/version.rb
index abc1234..def5678 100644
--- a/lib/vagrant-bindfs/version.rb
+++ b/lib/vagrant-bindfs/version.rb
@@ -4,7 +4,7 @@ VERSION = "0.4.7"
SOURCE_VERSION = "1.13.1"
- SOURCE_URL = "https://github.com/mpartel/bindfs/archive/#{SOURCE_VERSION}.tar.gz"
+ SOURCE_URL = "http://bindfs.org/downloads/bindfs-#{SOURCE_VERSION}.tar.gz"
end
end
| Rollback to bindfs.org to download source tarballs
|
diff --git a/lib/well_read_faker/source.rb b/lib/well_read_faker/source.rb
index abc1234..def5678 100644
--- a/lib/well_read_faker/source.rb
+++ b/lib/well_read_faker/source.rb
@@ -4,11 +4,12 @@ class Source
include Mutex_m
- attr_reader :path_to_book
+ attr_reader :path_to_book, :options
- def initialize path_to_book
+ def initialize path_to_book, options = {}
super()
@path_to_book = path_to_book
+ @options = options
end
def text
| Add options argument to Source::new
|
diff --git a/spec/roadmapster_wizeline_api_roadmap_spec.rb b/spec/roadmapster_wizeline_api_roadmap_spec.rb
index abc1234..def5678 100644
--- a/spec/roadmapster_wizeline_api_roadmap_spec.rb
+++ b/spec/roadmapster_wizeline_api_roadmap_spec.rb
@@ -23,4 +23,10 @@ expect(roadmap[:name]).to eq('Untitled')
expect(roadmap[:organization_id]).to eq(@organization[:id])
end
+
+ vcr_options = { cassette_name: 'wizeline/create_roadmap_units' }
+ it 'creates a roadmap unit with default values', vcr: vcr_options do
+ new_roadmap_unit = @roadmaps.create_unit(roadmap_id: 'QfU11YeHQ3uhpdwzypMmRw', name: 'TEST_UNIT_123')
+ expect(new_roadmap_unit).to be_a(Hash)
+ end
end
| Add test for creation of units
|
diff --git a/lib/oboe/ruby.rb b/lib/oboe/ruby.rb
index abc1234..def5678 100644
--- a/lib/oboe/ruby.rb
+++ b/lib/oboe/ruby.rb
@@ -19,8 +19,13 @@ # will instead be detected at load time and initialization is
# automatic.
def load
- Oboe::Loading.load_access_key
- Oboe::Inst.load_instrumentation
+ # In case some apps call this manually, make sure
+ # that the gem is fully loaded and not in no-op
+ # mode (e.g. on unsupported platforms etc.)
+ if Oboe.loaded
+ Oboe::Loading.load_access_key
+ Oboe::Inst.load_instrumentation
+ end
end
end
end
| Check gem load state before loading instrumentation
|
diff --git a/lib/slugworth.rb b/lib/slugworth.rb
index abc1234..def5678 100644
--- a/lib/slugworth.rb
+++ b/lib/slugworth.rb
@@ -31,6 +31,6 @@ end
def processed_slug
- send(slug_attribute).parameterize
+ public_send(slug_attribute).parameterize
end
end
| Use public_send instead of just send for conventions, yay!
|
diff --git a/test/test_link.rb b/test/test_link.rb
index abc1234..def5678 100644
--- a/test/test_link.rb
+++ b/test/test_link.rb
@@ -5,19 +5,24 @@ require 'helper'
describe 'Link' do
- subject do
- filename = 'the.other.setup.yml'
- path = File.join(test_site.source_paths[:links], 'inspired', filename)
- UsesThis::Link.new(path)
+ before do
+ path = File.join(
+ test_configuration['source_path'],
+ 'links',
+ 'inspired',
+ 'the.other.setup.yml'
+ )
+
+ @link = UsesThis::Link.new(path)
end
describe 'when loading from a YAML file' do
it 'correctly parses the contents' do
- source = read_yaml_fixture('link')
+ expected_output = YAML.safe_load(fixtures['link'])
- subject.name.must_equal(source['name'])
- subject.description.must_equal(source['description'])
- subject.url.must_equal(source['url'])
+ %w[name description url].each do |key|
+ @link.send(key).must_equal(expected_output[key])
+ end
end
end
end
| Clean up the link tests.
|
diff --git a/lib/vlad/copy.rb b/lib/vlad/copy.rb
index abc1234..def5678 100644
--- a/lib/vlad/copy.rb
+++ b/lib/vlad/copy.rb
@@ -0,0 +1,23 @@+# -*- coding: utf-8 -*-
+require 'vlad'
+
+namespace :vlad do
+
+ set :copy, {}
+
+ desc "Copy fiels"
+ task :copy do
+ print "Copying files to server: "
+ copy.each do |file|
+ dir = File.dirname(file)
+ `ssh #{domain} "mkdir -p #{shared_path}/#{dir}"` if dir
+ print "#{file}, "
+ `scp -r #{file} #{domain}:#{shared_path}/#{file}`
+ end
+ puts ". Done"
+ end
+
+ task :setup do
+ Rake::Task['vlad:copy'].invoke
+ end
+end
| Copy files to shared (config/database.yml for example) for symlinking
|
diff --git a/linter.gemspec b/linter.gemspec
index abc1234..def5678 100644
--- a/linter.gemspec
+++ b/linter.gemspec
@@ -19,7 +19,7 @@ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]
- spec.add_dependency "rubocop", "~> 0.53.0"
- spec.add_development_dependency "bundler", "~> 1.7"
+ spec.add_dependency "rubocop", "~> 0.58.0"
+ spec.add_development_dependency "bundler", "~> 1.17"
spec.add_development_dependency "rake", "~> 10.0"
end
| Update rubocop version in gemspec to ~> 0.58.0
|
diff --git a/event_store-messaging.gemspec b/event_store-messaging.gemspec
index abc1234..def5678 100644
--- a/event_store-messaging.gemspec
+++ b/event_store-messaging.gemspec
@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
s.name = 'event_store-messaging'
s.summary = 'Messaging primitives for EventStore using the EventStore Client HTTP library'
- s.version = '0.1.12'
+ s.version = '0.1.13'
s.authors = ['']
s.require_paths = ['lib']
s.files = Dir.glob('{lib}/**/*')
| Package version is increased from 0.1.12 to 0.1.13
|
diff --git a/templates/config/application.rb b/templates/config/application.rb
index abc1234..def5678 100644
--- a/templates/config/application.rb
+++ b/templates/config/application.rb
@@ -35,5 +35,6 @@ # Generators
config.generators.test_framework :rspec, view_specs: false
config.generators.template_engine :haml
+ config.sass.preferred_syntax = :sass
end
end
| Set Sass format to :sass.
|
diff --git a/timevalue.gemspec b/timevalue.gemspec
index abc1234..def5678 100644
--- a/timevalue.gemspec
+++ b/timevalue.gemspec
@@ -1,10 +1,10 @@ Gem::Specification.new do |s|
s.name = 'timevalue'
s.version = '0.0.1'
- s.date = '2013-12-21'
+ s.date = '2014-06-13'
s.summary = "Time value of money calculations"
s.description = "Perform time value of money calculations using financial calculator variables n, i, PV, PMT, and FV"
- s.authors = ["Randall Reed"]
+ s.authors = ["Randall Reed, Jr."]
s.email = 'randallreedjr@gmail.com'
s.files = ['lib/timevalue.rb']
s.homepage = 'http://rubygems.org/gems/timevalue'
| Update gemspec author name to include 'jr'
|
diff --git a/lib/flame/static.rb b/lib/flame/static.rb
index abc1234..def5678 100644
--- a/lib/flame/static.rb
+++ b/lib/flame/static.rb
@@ -22,10 +22,7 @@ content_type File.extname(file)
response[Rack::CACHE_CONTROL] = 'no-cache'
response['Last-Modified'] = file_time.httpdate
- # 'Content-Disposition' => 'attachment;' \
- # "filename=\"#{File.basename(static_file)}\"",
- # 'Content-Length' => File.size?(static_file).to_s
- halt 200, File.read(file)
+ File.read(file)
end
end
end
| Remove unnecessary halt from Static module
|
diff --git a/test/unit/featured_link_test.rb b/test/unit/featured_link_test.rb
index abc1234..def5678 100644
--- a/test/unit/featured_link_test.rb
+++ b/test/unit/featured_link_test.rb
@@ -2,22 +2,22 @@
class FeaturedLinkTest < ActiveSupport::TestCase
test "should not be valid without a url" do
- link = build(:featured_link, url: nil)
+ link = build(:featured_link, title: 'a title', url: nil)
refute link.valid?
end
test "should not be valid without a title" do
- link = build(:featured_link, title: nil)
+ link = build(:featured_link, title: nil, url: 'http://my.example.com/path')
refute link.valid?
end
test "should not be valid with a url that doesn't start with http" do
- link = build(:featured_link, url: "not a link")
+ link = build(:featured_link, title: 'a title', url: "not a link")
refute link.valid?
end
test "should be valid with a url that starts with http" do
- link = build(:featured_link, url: "http://my.example.com/path")
- refute link.valid?
+ link = build(:featured_link, title: 'a title', url: "http://my.example.com/path")
+ assert link.valid?
end
end
| Add positive test for FeaturedLink
Also update the negative tests so the models would otherwise be valid if
it wasn't for the attribute we are testing.
|
diff --git a/lib/kosher_bacon.rb b/lib/kosher_bacon.rb
index abc1234..def5678 100644
--- a/lib/kosher_bacon.rb
+++ b/lib/kosher_bacon.rb
@@ -7,6 +7,7 @@ # An app's spec files are immediately after RubyMotion's.
before_app_specs = config.spec_files.index { |file| !file.start_with?(config.motiondir) }
config.spec_files.insert(before_app_specs, *helpers)
+ ENV['output'] = 'test_unit'
end
else
raise 'This file must be required within a RubyMotion project Rakefile.'
| Set env variable for test/unit style output
|
diff --git a/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_featureCatalog.rb b/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_featureCatalog.rb
index abc1234..def5678 100644
--- a/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_featureCatalog.rb
+++ b/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_featureCatalog.rb
@@ -2,7 +2,7 @@ # 19115-1 writer output in XML
# History:
-# Stan Smith 2019-08-20 original script.
+# Stan Smith 2019-08-20 original script.
require_relative '../../iso19110/classes/class_fcFeatureCatalogue'
| Add dictionary support to iso19115-1 writer
|
diff --git a/machete-dsl.gemspec b/machete-dsl.gemspec
index abc1234..def5678 100644
--- a/machete-dsl.gemspec
+++ b/machete-dsl.gemspec
@@ -8,9 +8,9 @@ gem.version = Machete::DSL::VERSION
gem.authors = ["Piotr Niełacny"]
gem.email = ["piotr.nielacny@gmail.com"]
- gem.description = %q{TODO: Write a gem description}
- gem.summary = %q{TODO: Write a gem summary}
- gem.homepage = ""
+ gem.description = %q{DSL builder for Machete}
+ gem.summary = %q{DSL builder for Machete}
+ gem.homepage = "https://github.com/openSUSE/machete-dsl"
gem.files = `git ls-files`.split($/)
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
| Update info about gem in .gemspec file
|
diff --git a/lib/draper/rspec_integration.rb b/lib/draper/rspec_integration.rb
index abc1234..def5678 100644
--- a/lib/draper/rspec_integration.rb
+++ b/lib/draper/rspec_integration.rb
@@ -14,6 +14,9 @@ config.around do |example|
if :decorator == example.metadata[:type]
ApplicationController.new.set_current_view_context
+ Draper::ViewContext.current.controller.request ||= ActionController::TestRequest.new
+ Draper::ViewContext.current.request ||= Draper::ViewContext.current.controller.request
+ Draper::ViewContext.current.params ||= {}
end
example.call
end
| Add request and params support to the Draper spec harness
|
diff --git a/lib/html/proofer/checks/html.rb b/lib/html/proofer/checks/html.rb
index abc1234..def5678 100644
--- a/lib/html/proofer/checks/html.rb
+++ b/lib/html/proofer/checks/html.rb
@@ -3,13 +3,30 @@ class HtmlCheck < ::HTML::Proofer::CheckRunner
# new html5 tags (source: http://www.w3schools.com/html/html5_new_elements.asp)
+ # and svg child tags (source: https://developer.mozilla.org/en-US/docs/Web/SVG/Element)
HTML5_TAGS = %w(article aside bdi details dialog figcaption
figure footer header main mark menuitem meter
nav progress rp rt ruby section summary
time wbr datalist keygen output color date
datetime datetime-local email month number
range search tel time url week canvas
- svg audio embed source track video)
+ svg audio embed source track video
+ altGlyph altGlyphDef altGlyphItem animate
+ animateColor animateMotion animateTransform
+ circle clipPath color-profile cursor defs
+ desc ellipse feBlend feColorMatrix
+ feComponentTransfer feComposite feConvolveMatrix
+ feDiffuseLighting feDisplacementMap feDistantLight
+ feFlood feFuncA feFuncB feFuncG feFuncR feGaussianBlur
+ feImage feMerge feMergeNode feMorphology feOffset
+ fePointLight feSpecularLighting feSpotLight feTile
+ feTurbulence filter font font-face font-face-format
+ font-face-name font-face-src font-face-uri
+ foreignObject g glyph glyphRef hkern image line
+ linearGradient marker mask metadata missing-glyph
+ mpath path pattern polygon polyline radialGradient
+ rect set stop switch symbol text textPath tref tspan use
+ view vkern)
def run
@html.errors.each do |e|
| Add support for validation of all svg elements.
|
diff --git a/lib/juknife/scraping/context.rb b/lib/juknife/scraping/context.rb
index abc1234..def5678 100644
--- a/lib/juknife/scraping/context.rb
+++ b/lib/juknife/scraping/context.rb
@@ -20,7 +20,7 @@ end
def text(selector)
- find(selector)&.text&.strip
+ find(selector)&.text&.strip&.gsub(/(\s)(\s*)/, '\1')
end
end
end
| Fix to replace space sequence with one space
|
diff --git a/cmis-ruby.gemspec b/cmis-ruby.gemspec
index abc1234..def5678 100644
--- a/cmis-ruby.gemspec
+++ b/cmis-ruby.gemspec
@@ -19,8 +19,8 @@
s.required_ruby_version = '>= 1.9.3'
- s.add_dependency 'faraday', '~> 0.9'
- s.add_dependency 'faraday_middleware', '~> 0.9'
+ s.add_dependency 'faraday', '~> 1.0'
+ s.add_dependency 'faraday_middleware', '~> 1.0'
s.description = <<-DESCRIPTION
CMIS browser binding client library in ruby.
| Upgrade faraday dependency, to get rid of deprecation warning when using Ruby 2.7.
|
diff --git a/lib/captainslog.rb b/lib/captainslog.rb
index abc1234..def5678 100644
--- a/lib/captainslog.rb
+++ b/lib/captainslog.rb
@@ -7,8 +7,12 @@ @history ||= 6
end
+ def today
+ @today ||= Date.today
+ end
+
def tomorrow
- @tomorrow ||= Date.today + 1
+ @tomorrow ||= today + 1
end
def run(*args)
@@ -17,6 +21,7 @@ end
def execute
+ print "Captain's Log, Stardate #{today - history} to today...\n\n"
tomorrow.step(tomorrow - history, -1) do |day|
log = log_for day
puts header_for(day - 1)
| Print stardate and log title
|
diff --git a/lib/classloader.rb b/lib/classloader.rb
index abc1234..def5678 100644
--- a/lib/classloader.rb
+++ b/lib/classloader.rb
@@ -1,6 +1,9 @@ class ClassLoaderContext
def initialize(classloader)
@classloader = classloader
+
+ @name = nil
+ @execute_block = nil
end
def name(name = nil)
@@ -9,7 +12,7 @@ end
def call
- @execute_block.call
+ @execute_block.call unless @execute_block.nil?
end
def execute(&block)
| Define instance variables in initialize and only execute block if not nil
|
diff --git a/lib/rom/support/class_macros.rb b/lib/rom/support/class_macros.rb
index abc1234..def5678 100644
--- a/lib/rom/support/class_macros.rb
+++ b/lib/rom/support/class_macros.rb
@@ -7,12 +7,25 @@
args.each do |name|
mod.module_eval <<-RUBY, __FILE__, __LINE__ + 1
+ @@macros = [#{args.map(&:inspect).join(', ')}]
+
def #{name}(value = Undefined)
if value == Undefined
@#{name}
else
@#{name} = value
end
+ end
+
+ def inherited(klass)
+ super
+ macros.each do |name|
+ klass.public_send(name, public_send(name))
+ end
+ end
+
+ def macros
+ @@macros || []
end
RUBY
| Add Mapper.base_relation and inheritance of macros
|
diff --git a/core/db/migrate/20140213184916_add_more_indexes.rb b/core/db/migrate/20140213184916_add_more_indexes.rb
index abc1234..def5678 100644
--- a/core/db/migrate/20140213184916_add_more_indexes.rb
+++ b/core/db/migrate/20140213184916_add_more_indexes.rb
@@ -0,0 +1,14 @@+class AddMoreIndexes < ActiveRecord::Migration
+ def change
+ add_index :spree_payment_methods, [:id, :type]
+ add_index :spree_calculators, [:id, :type]
+ add_index :spree_calculators, [:calculable_id, :calculable_type]
+ add_index :spree_payments, :payment_method_id
+ add_index :spree_promotion_actions, [:id, :type]
+ add_index :spree_promotion_actions, :activator_id
+ add_index :spree_promotions, [:id, :type]
+ add_index :spree_authentication_tokens, :user_id
+ add_index :spree_option_values, :option_type_id
+ add_index :spree_shipments, :stock_location_id
+ end
+end
| Add some more db indexes to assist with query performance
Fixes #4338
|
diff --git a/lib/active_decorator/railtie.rb b/lib/active_decorator/railtie.rb
index abc1234..def5678 100644
--- a/lib/active_decorator/railtie.rb
+++ b/lib/active_decorator/railtie.rb
@@ -13,6 +13,7 @@ end
ActiveSupport.on_load(:action_mailer) do
require 'active_decorator/monkey/abstract_controller/rendering'
+ ActionMailer::Base.send :include, ActiveDecorator::ViewContext::Filter
end
end
end
| Add ViewContext::Filter include to ActionMailer::Base
When 'ActionMailer::Base' is delivered by Model or Worker(like ActiveJob),
'ActiveDecorator::ViewContext.current' is 'nil' and cannot use view helper methods in decorator.
the reason is that 'ActionMailer::Base' inherits 'AbstractController::Base',
but only ActionController::Base set view_context.
|
diff --git a/Casks/luyten.rb b/Casks/luyten.rb
index abc1234..def5678 100644
--- a/Casks/luyten.rb
+++ b/Casks/luyten.rb
@@ -2,6 +2,7 @@ version '0.4.7'
sha256 '612bd58de0d3ef23fbb9803d302f0af7d3f03e5fcf06cadd69521f0e57637045'
+ # github.com/deathmarine/Luyten was verified as official when first introduced to the cask
url "https://github.com/deathmarine/Luyten/releases/download/v#{version}/luyten-OSX-#{version}.zip"
appcast 'https://github.com/deathmarine/Luyten/releases.atom',
checkpoint: '9ecdaf5f2f3ace93eb6df32903e0e39db44fb4901ee761e8626f4cab3a6cf6fd'
| Fix `url` stanza comment for Luyten.
|
diff --git a/Casks/puppet.rb b/Casks/puppet.rb
index abc1234..def5678 100644
--- a/Casks/puppet.rb
+++ b/Casks/puppet.rb
@@ -1,10 +1,10 @@ cask :v1 => 'puppet' do
- version '3.7.3'
- sha256 'f673b9c45dbefa410efa6d7f74ea820a1b01b4f659f142c92310f8ab3df477af'
+ version '3.7.4'
+ sha256 '8eb17151199cc8c726fd64a56aba20b25627f699ce841ce9d04dbe59edbe3223'
url "http://downloads.puppetlabs.com/mac/puppet-#{version}.dmg"
homepage 'http://puppetlabs.com/'
- license :unknown # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder
+ license :apache
pkg "puppet-#{version}.pkg"
| Update Puppet to 3.7.4, set license
License assigned based on
https://github.com/puppetlabs/puppet/blob/master/LICENSE
|
diff --git a/lib/mocha/integration/mini_test/adapter.rb b/lib/mocha/integration/mini_test/adapter.rb
index abc1234..def5678 100644
--- a/lib/mocha/integration/mini_test/adapter.rb
+++ b/lib/mocha/integration/mini_test/adapter.rb
@@ -1,6 +1,6 @@ require 'mocha/api'
require 'mocha/integration/assertion_counter'
-require 'mocha/expectation_error'
+require 'mocha/expectation_error_factory'
module Mocha
module Integration
| Fix require statement for MiniTest::Adapter.
|
diff --git a/lib/brick_ftp/utils/chunk_io.rb b/lib/brick_ftp/utils/chunk_io.rb
index abc1234..def5678 100644
--- a/lib/brick_ftp/utils/chunk_io.rb
+++ b/lib/brick_ftp/utils/chunk_io.rb
@@ -1,3 +1,5 @@+require 'tempfile'
+
module BrickFTP
module Utils
class ChunkIO
@@ -37,16 +39,19 @@ end
def each_chunk
+ eof = false
offset = 0
- loop do
- chunk = StringIO.new
- copied = IO.copy_stream(io, chunk, chunk_size, offset)
- break if copied.zero?
+ until eof
+ Tempfile.create do |chunk|
+ copied = IO.copy_stream(io, chunk, chunk_size, offset)
+ eof = copied.zero?
+ next if eof
- offset += copied
- chunk.rewind
+ offset += copied
+ chunk.rewind
- yield chunk
+ yield chunk
+ end
end
end
end
| Use `File` instead of `StringIO`.
|
diff --git a/lib/chatops_deployer/globals.rb b/lib/chatops_deployer/globals.rb
index abc1234..def5678 100644
--- a/lib/chatops_deployer/globals.rb
+++ b/lib/chatops_deployer/globals.rb
@@ -2,12 +2,7 @@ WORKSPACE = ENV['DEPLOYER_WORKSPACE'] || '/var/www'
DEPLOYER_HOST = ENV['DEPLOYER_HOST'] || '127.0.0.1.xip.io'
NGINX_SITES_ENABLED_DIR = ENV['NGINX_SITES_ENABLED_DIR'] || '/etc/nginx/sites-enabled'
- #LOG_DIR = ENV['DEPLOYER_LOG_DIR'] || '/var/log/chatops_deployer'
LOG_FILE = ENV['DEPLOYER_LOG_FILE'] || '/var/log/chatops_deployer.log'
COPY_SOURCE_DIR = ENV['DEPLOYER_COPY_SOURCE_DIR'] || '/etc/chatops_deployer/copy'
-
- def log_file(sha1)
- File.join(LOG_DIR, sha1)
- end
end
| Remove remaining traces of LOG_DIR var
|
diff --git a/lib/pliny/sidekiq/middleware/server/log.rb b/lib/pliny/sidekiq/middleware/server/log.rb
index abc1234..def5678 100644
--- a/lib/pliny/sidekiq/middleware/server/log.rb
+++ b/lib/pliny/sidekiq/middleware/server/log.rb
@@ -1,8 +1,7 @@ module Pliny::Sidekiq::Middleware
module Server
class Log
- def initialize(metric_prefix: nil)
- @metric_prefix = metric_prefix
+ def initialize(opts={})
end
def call(worker, job, queue)
@@ -25,11 +24,7 @@ private
def count(key, value=1)
- Pliny.log("count##{metric_prefix}sidekiq.#{key}" => value)
- end
-
- def metric_prefix
- @metric_prefix.nil? ? '' : "#{@metric_prefix}."
+ Pliny::Metrics.count("sidekiq.#{key}", value)
end
end
end
| Use Pliny::Metrics.count instead of assuming l2met
|
diff --git a/test/integration/users_login_test.rb b/test/integration/users_login_test.rb
index abc1234..def5678 100644
--- a/test/integration/users_login_test.rb
+++ b/test/integration/users_login_test.rb
@@ -4,7 +4,7 @@ class UsersLoginTest < ActionDispatch::IntegrationTest
def setup
login = LoginPage.instance
- @login_path = "/"+login.slug+"-"+login.id
+ @login_path = "/#{login.slug + login.id}"
end
test "login with invalid information" do
| Fix broken test for rendering @login_path
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.