diff stringlengths 65 26.7k | message stringlengths 7 9.92k |
|---|---|
diff --git a/site/_plugins/sort-by-date.rb b/site/_plugins/sort-by-date.rb
index abc1234..def5678 100644
--- a/site/_plugins/sort-by-date.rb
+++ b/site/_plugins/sort-by-date.rb
@@ -0,0 +1,8 @@+module JekyllBbc6musicaotd
+ class SortByDate < Jekyll::Generator
+ def generate(site)
+ site.data['2014'].sort!{|a,b| a['date'] <=> b['date']}
+ site.data['2015'].sort!{|a,b| a['date'] <=> b['date']}
+ end
+ end
+end
| Sort albums by date before display.
|
diff --git a/spec/factories/user_emails.rb b/spec/factories/user_emails.rb
index abc1234..def5678 100644
--- a/spec/factories/user_emails.rb
+++ b/spec/factories/user_emails.rb
@@ -2,7 +2,7 @@ FactoryBot.define do
base_time = Time.zone.now.to_i
sequence :email do |n|
- "user_#{n}@domain_#{base_time}_name.com"
+ "user_#{n}@domain-#{base_time}-name.com"
end
factory :user_email, class: User::Email.name do
| Use hyphen instead of underscore in FactoryBot emails domains.
Underscores are invalid in domain names and fail validation on the login
page.
|
diff --git a/spec/unit/gateway/new_spec.rb b/spec/unit/gateway/new_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/gateway/new_spec.rb
+++ b/spec/unit/gateway/new_spec.rb
@@ -0,0 +1,18 @@+require 'rom/sql/gateway'
+
+RSpec.describe ROM::SQL::Gateway, '#initialize' do
+ subject(:gateway) do
+ ROM::SQL::Gateway.new(uri)
+ end
+
+ context 'with option hash' do
+ let(:uri) do
+ { adapter: 'sqlite',
+ database: ':memory:' }
+ end
+
+ it 'establishes connection' do
+ expect(gateway.connection).to be_instance_of(Sequel::SQLite::Database)
+ end
+ end
+end
| Add a spec for connecting via option hash
Refs #258
|
diff --git a/TheKeyOAuth2.podspec b/TheKeyOAuth2.podspec
index abc1234..def5678 100644
--- a/TheKeyOAuth2.podspec
+++ b/TheKeyOAuth2.podspec
@@ -1,11 +1,11 @@ Pod::Spec.new do |s|
s.name = "TheKeyOAuth2"
- s.version = "0.5.2"
+ s.version = "0.5.3"
s.summary = "TheKey OAuth2 Client Library."
s.homepage = "http://thekey.me/"
s.license = { :type => 'Modified BSD', :file => 'LICENSE.txt' }
s.author = { "Brian Zoetewey" => "brian.zoetewey@ccci.org" }
- s.source = { :git => "git@git.gcx.org:ios/lib/TheKeyOAuth2.git", :tag => "0.5.2" }
+ s.source = { :git => "git@github.com:GlobalTechnology/TheKeyOAuth2.git", :tag => "0.5.3" }
s.platform = :ios, '7.0'
s.source_files = 'TheKeyOAuth2/*.{h,m}'
s.public_header_files = 'TheKeyOAuth2/TheKeyOAuth2Client.h, TheKeyOAuth2LoginViewController.h'
| Switch podspec to github and increase version.
|
diff --git a/core/spec/controllers/spree/products_controller_spec.rb b/core/spec/controllers/spree/products_controller_spec.rb
index abc1234..def5678 100644
--- a/core/spec/controllers/spree/products_controller_spec.rb
+++ b/core/spec/controllers/spree/products_controller_spec.rb
@@ -15,7 +15,7 @@ response.status.should == 404
end
- it "returns product sitemap XML" do
+ it "returns products sitemap XML" do
spree_get :sitemap, :format => :xml
response.status.should == 200
end
| Add (s) into product in test description [ci-skip]
|
diff --git a/lib/dm-types/flag.rb b/lib/dm-types/flag.rb
index abc1234..def5678 100644
--- a/lib/dm-types/flag.rb
+++ b/lib/dm-types/flag.rb
@@ -52,6 +52,7 @@
def self.typecast(value, property)
case value
+ when nil then nil
when Array then value.map {|v| v.to_sym}
else value.to_sym
end
| Allow Flag property to be nullable.
Signed-off-by: Michael S. Klishin <17b9e1c64588c7fa6419b4d29dc1f4426279ba01@novemberain.com>
|
diff --git a/lib/dtrace/tracer.rb b/lib/dtrace/tracer.rb
index abc1234..def5678 100644
--- a/lib/dtrace/tracer.rb
+++ b/lib/dtrace/tracer.rb
@@ -0,0 +1,35 @@+#
+# Ruby-Dtrace
+# (c) 2007 Chris Andrews <chris@nodnol.org>
+#
+
+# Leopard's ruby-probe is DTracer, Solaris's is Tracer.
+
+class Dtrace
+ class Tracer
+
+ class NullTracer
+ def self.fire(arg0, arg1)
+ puts "NullTracer: #{arg0} #{arg1}"
+ end
+ end
+
+ @@tracer = nil
+ def self.fire(*args)
+ if @@tracer == nil
+ begin
+ # Avoid getting ourselves here:
+ @@tracer = Module.const_get('Tracer')
+ rescue NameError
+ begin
+ @@tracer = DTracer
+ rescue NameError
+ @@tracer = Dtrace::Tracer::NullTracer
+ end
+ end
+ end
+ @@tracer.fire(*args)
+ end
+
+ end
+end
| Add simple wrapper around the different ruby-probe classes (Leopard vs stock Joyent build)
git-svn-id: 40196796c19c0e7557af02d93710b150381d7241@94 f5dbc166-08e2-44d3-850c-36126807790f
|
diff --git a/lib/filmbuff/imdb.rb b/lib/filmbuff/imdb.rb
index abc1234..def5678 100644
--- a/lib/filmbuff/imdb.rb
+++ b/lib/filmbuff/imdb.rb
@@ -7,6 +7,7 @@ cache :store => 'memory', :timeout => 120
base_uri 'https://app.imdb.com'
+ format :json
def initialize
@locale = "en_US"
| Make HTTParty explicitly expect JSON
|
diff --git a/lib/rails_open311.rb b/lib/rails_open311.rb
index abc1234..def5678 100644
--- a/lib/rails_open311.rb
+++ b/lib/rails_open311.rb
@@ -31,9 +31,7 @@ jurisdiction_id = api_config['jurisdiction_id']
api_key = api_config['apikey']
- wrapper = Open311::ApiWrapper.from_url(url, api_key, jurisdiction_id)
- wrapper.logger = Rails.logger
- wrapper
+ Open311::ApiWrapper.from_url(url, api_key, jurisdiction_id)
end
end
| Remove rails logger injection from RailsOpen311. |
diff --git a/lib/squealer/time.rb b/lib/squealer/time.rb
index abc1234..def5678 100644
--- a/lib/squealer/time.rb
+++ b/lib/squealer/time.rb
@@ -1,5 +1,5 @@ class Time
def to_s
- self.strftime("%Y-%m-%d %H:%M:%S %Z")
+ strftime("%Y-%m-%d %H:%M:%S %Z")
end
end
| Remove the redundant, extraneous, pleonasm of self
|
diff --git a/attributes/default.rb b/attributes/default.rb
index abc1234..def5678 100644
--- a/attributes/default.rb
+++ b/attributes/default.rb
@@ -17,6 +17,6 @@ # limitations under the License.
#
-default['aws']['aws_sdk_version'] = '~> 2.0.22'
+default['aws']['aws_sdk_version'] = '~> 2.2.3'
default['aws']['databag_name'] = nil
default['aws']['databag_entry'] = nil
| Update to SDK version 2.2.3
There's been an enormous number of improvements and bug fixes between
our current release and 2.2.3
|
diff --git a/lib/tasks/velum.rake b/lib/tasks/velum.rake
index abc1234..def5678 100644
--- a/lib/tasks/velum.rake
+++ b/lib/tasks/velum.rake
@@ -1,24 +1,26 @@ # rubocop:disable Metrics/BlockLength
+
namespace :velum do
desc "Create a user"
task :create_user, [:email, :password] => :environment do |_, args|
- if args.count != 2
- puts "There are 2 required arguments: email and password"
- exit(-1)
- end
-
- args.each do |k, v|
- if v.empty?
- puts "You have to provide a value for `#{k}'"
- exit(-1)
- end
- end
+ validate_args(args, [:email, :password])
begin
User.create! email: args["email"], password: args["password"]
puts "User #{args["email"]} created successfully"
rescue ActiveRecord::RecordInvalid
puts "User #{args["email"]} could not be created. Does it already exist?"
+ end
+ end
+
+ desc "Create a pillar"
+ task :create_pillar, [:pillar, :value] => :environment do |_, args|
+ validate_args(args, [:pillar, :value])
+ begin
+ Pillar.create! args.to_hash
+ rescue ActiveRecord::RecordInvalid => e
+ puts "Pillar '#{args["pillar"]}' could not be created: "
+ puts e.message
end
end
@@ -33,5 +35,27 @@ end
end
end
+
+ def validate_args(args, expected_keys)
+ if args.count != expected_keys.length
+ puts [
+ "There are ",
+ ActionController::Base.helpers.pluralize(
+ expected_keys.length,
+ "required argument"
+ ),
+ ": ",
+ expected_keys.to_sentence,
+ "."
+ ].join
+ exit(-1)
+ end
+ args.each do |k, v|
+ if v.empty?
+ puts "You have to provide a value for `#{k}'."
+ exit(-1)
+ end
+ end
+ end
end
# rubocop:enable Metrics/BlockLength
| Add a rake task for inserting a pillar
Due to redundancy, argument validation of velum:create_user was
abstracted out to a separate function.
|
diff --git a/filewatcher.gemspec b/filewatcher.gemspec
index abc1234..def5678 100644
--- a/filewatcher.gemspec
+++ b/filewatcher.gemspec
@@ -9,7 +9,7 @@
s.authors = ['Thomas Flemming']
s.email = ['thomas.flemming@gmail.com']
- s.homepage = 'http://github.com/thomasfl/filewatcher'
+ s.homepage = 'http://github.com/filewatcher/filewatcher'
s.summary = 'Lightweight filewatcher.'
s.description = 'Detect changes in file system. Works anywhere.'
| Update home page in gem spec
|
diff --git a/cookbooks/homebrew/recipes/brew.rb b/cookbooks/homebrew/recipes/brew.rb
index abc1234..def5678 100644
--- a/cookbooks/homebrew/recipes/brew.rb
+++ b/cookbooks/homebrew/recipes/brew.rb
@@ -54,5 +54,6 @@ end
brew 'urlview'
brew 'utern'
+brew 'watch'
brew 'whalebrew'
brew 'yarn'
| Install watch command in macOS
|
diff --git a/cookbooks/vim/recipes/default.rb b/cookbooks/vim/recipes/default.rb
index abc1234..def5678 100644
--- a/cookbooks/vim/recipes/default.rb
+++ b/cookbooks/vim/recipes/default.rb
@@ -9,3 +9,29 @@ package 'vim' do
action :install
end
+
+directory '/home/mzp/.vim' do
+ owner 'mzp'
+ group 'mzp'
+ mode '0755 '
+ action :create
+end
+
+directory '/home/mzp/.vim/bundle' do
+ owner 'mzp'
+ group 'mzp'
+ mode '0755 '
+ action :create
+end
+
+git "/home/mzp/.vim/bundle/neobundle.vim" do
+ repository "https://github.com/Shougo/neobundle.vim"
+ reference "master"
+ action :sync
+ user "mzp"
+ group "mzp"
+end
+
+bash "install NeoBundle" do
+ code "sudo -u mzp /home/mzp/.vim/bundle/neobundle.vim/bin/neoinstall"
+end
| Fix vim recipe: install NeoBundle
|
diff --git a/fuci-travis.gemspec b/fuci-travis.gemspec
index abc1234..def5678 100644
--- a/fuci-travis.gemspec
+++ b/fuci-travis.gemspec
@@ -8,9 +8,9 @@ spec.version = Fuci::Travis::VERSION
spec.authors = ["Dave Jachimiak"]
spec.email = ["dave.jachimiak@gmail.com"]
- spec.description = %q{Run failures from your last Travis build from the command line.}
- spec.summary = %q{Run failures from your last Travis build from the command line.}
- spec.homepage = ""
+ spec.description = %q{FUCK YOU CI: For Travis! :).}
+ spec.summary = %q{Run failures from your recent Travis builds locally.}
+ spec.homepage = "https://github.com/davejachimiak/fuci-travis"
spec.license = "MIT"
spec.files = `git ls-files`.split($/)
| Add homepage and summary to gemspec
|
diff --git a/ruby/arrays_drill2.rb b/ruby/arrays_drill2.rb
index abc1234..def5678 100644
--- a/ruby/arrays_drill2.rb
+++ b/ruby/arrays_drill2.rb
@@ -0,0 +1,6 @@+new_array = []
+p new_array
+
+new_array << "J.K. Rowling" << "George R. R. Martin" << "Suzanne Collins" << "Stephanie Meyer" << "J. R. R. Tolkein"
+
+p new_array
| Add new array and delete array at index 2
|
diff --git a/test/rouge_filter_test.rb b/test/rouge_filter_test.rb
index abc1234..def5678 100644
--- a/test/rouge_filter_test.rb
+++ b/test/rouge_filter_test.rb
@@ -23,8 +23,4 @@ assert doc.css(".highlight-coffeescript").empty?
assert !doc.css(".highlight-ruby").empty?
end
-
- def test_version
- assert_equal HTML_Pipeline::RougeFilter::VERSION, "0.0.1"
- end
end
| Remove test for testing test setup.
|
diff --git a/app/helpers/timestamp_helper.rb b/app/helpers/timestamp_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/timestamp_helper.rb
+++ b/app/helpers/timestamp_helper.rb
@@ -6,7 +6,8 @@ tooltip: tooltip
}
- react_component :Timestamp, props, prerender: true, tag: :span
+ # react_component :Timestamp, props, prerender: true, tag: :span
+ react_component :Timestamp, props, tag: :span
end
def timestamp_ago(time, tooltip: true)
| Stop prerendering relative timestamps, for now
|
diff --git a/app/models/repository/access.rb b/app/models/repository/access.rb
index abc1234..def5678 100644
--- a/app/models/repository/access.rb
+++ b/app/models/repository/access.rb
@@ -3,6 +3,10 @@
OPTIONS = %w[public_r public_rw private_r private_rw]
DEFAULT_OPTION = OPTIONS[0]
+
+ def self.as_read_only(access)
+ access.split('_').first + '_r'
+ end
def destroy_expired_access_tokens
access_tokens.select(&:expired?).map(&:destroy)
@@ -28,10 +32,6 @@ access == 'public_r'
end
- def self.as_read_only(access)
- access.split('_').first + '_r'
- end
-
private
def clear_readers
| Move class methods to the top.
|
diff --git a/app/services/downloads_cache.rb b/app/services/downloads_cache.rb
index abc1234..def5678 100644
--- a/app/services/downloads_cache.rb
+++ b/app/services/downloads_cache.rb
@@ -1,23 +1,5 @@ module DownloadsCache
-
- def self.downloads_path(dir)
- "#{Rails.root}/public/downloads/#{dir}"
- end
-
- def self.clear_dirs(dirs)
- dirs.each do |dir|
- Rails.logger.debug("Clearing #{dir}")
- FileUtils.rm_rf(Dir["#{downloads_path(dir)}/*"], :secure => true)
- end
- end
-
- # cleared after save & destroy
def self.clear_shipments
- clear_dirs(['shipments'])
- clear_dirs(['comptab'])
- clear_dirs(['gross_exports'])
- clear_dirs(['gross_imports'])
- clear_dirs(['net_exports'])
- clear_dirs(['net_imports'])
+ response = HTTParty.get("#{Rails.application.secrets.sapi_path}/api/trade_downloads_cache_cleanup")
end
end
| Use httparty to invoke cache cleaning on SAPI
|
diff --git a/app/models/action.rb b/app/models/action.rb
index abc1234..def5678 100644
--- a/app/models/action.rb
+++ b/app/models/action.rb
@@ -1,5 +1,6 @@ class Action < ActiveRecord::Base
- PICKUP, PLAY = %w(pickup play)
+ PICKUP = 'pickup'
+ PLAY = 'play'
belongs_to :player
@@ -10,9 +11,7 @@ scope :in_order, -> { order(:id) }
validates :player, presence: true
- validates :effect,
- presence: true,
- inclusion: { in: [ PICKUP, PLAY ] }
+ validates :effect, inclusion: { in: [ PICKUP, PLAY ] }
validates :card_suit, inclusion: { in: Card::SUITS }
validates :card_rank, inclusion: { in: Card::RANKS }
| Refactor Action constants for readability
|
diff --git a/app/models/person.rb b/app/models/person.rb
index abc1234..def5678 100644
--- a/app/models/person.rb
+++ b/app/models/person.rb
@@ -9,7 +9,6 @@ has_many :staff_assignments
has_many :staff_campuses, :through => :staff_assignments, :class_name => "Campus", :source => :campus
has_many :staffs
- has_many :users, :through => :access, :conditions => "viewer_isActive = 1"
def viewers
users
| Revert "filter users by active flag"
This reverts commit 534a5270d812fc6b62a7875c9d8bfdc27c1cd35a.
|
diff --git a/gir_ffi-gtk.gemspec b/gir_ffi-gtk.gemspec
index abc1234..def5678 100644
--- a/gir_ffi-gtk.gemspec
+++ b/gir_ffi-gtk.gemspec
@@ -16,7 +16,7 @@ `git ls-files -z`.split("\0")
s.test_files = `git ls-files -z -- test`.split("\0")
- s.add_runtime_dependency('gir_ffi', ['~> 0.13.1'])
+ s.add_runtime_dependency('gir_ffi', ['~> 0.14.0'])
s.add_development_dependency('minitest', ['~> 5.0'])
s.add_development_dependency('rake', ['~> 12.0'])
s.add_development_dependency('rr', ['~> 1.1'])
| Update gir_ffi to version 0.14.0 |
diff --git a/pathfinder_common.gemspec b/pathfinder_common.gemspec
index abc1234..def5678 100644
--- a/pathfinder_common.gemspec
+++ b/pathfinder_common.gemspec
@@ -15,7 +15,7 @@ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.name = "pathfinder_common"
gem.require_paths = ["lib"]
- gem.version = VERSION
+ gem.version = PathfinderCommon::VERSION
# specify any dependencies here; for example:
gem.add_development_dependency 'minitest', '~> 3.2.0'
| Update the gemspec to correctly reference the VERSION constant.
|
diff --git a/spec/cabinet_spec.rb b/spec/cabinet_spec.rb
index abc1234..def5678 100644
--- a/spec/cabinet_spec.rb
+++ b/spec/cabinet_spec.rb
@@ -6,20 +6,20 @@ file_content = (0...50).map{('a'..'z').to_a[rand(26)]}.join
it "should create file" do
- cl.put(file_name, file_content).should eql(file_content.length)
+ cl.put(file_name, file_content).should == file_content.length
end
it "should confirm file exists" do
- cl.exists?(file_name).should eql(true)
+ cl.exists?(file_name).should == true
end
it "should confirm file does not exist" do
random_string = file_content
- cl.exists?(random_string).should eql(false)
+ cl.exists?(random_string).should == false
end
it "should read file" do
- cl.get(file_name).should eql(file_content)
+ cl.get(file_name).should == file_content
end
it "should list files" do
@@ -34,12 +34,12 @@ it "should gzip file" do
gz_file_name = file_name + '.gz'
cl.gzip(gz_file_name, file_content)
- Zlib::GzipReader.open("/tmp/#{gz_file_name}") {|gz| gz.read}.should eql(file_content)
+ Zlib::GzipReader.open("/tmp/#{gz_file_name}") {|gz| gz.read}.should == file_content
cl.delete(gz_file_name)
end
it "should delete file" do
cl.delete(file_name)
- cl.exists?(file_name).should eql(false)
+ cl.exists?(file_name).should == false
end
end | Use == instead of eql() in tests
|
diff --git a/spec/default_spec.rb b/spec/default_spec.rb
index abc1234..def5678 100644
--- a/spec/default_spec.rb
+++ b/spec/default_spec.rb
@@ -2,8 +2,8 @@
describe 'mysql2_chef_gem_test::default' do
let(:chef_run) do
- ChefSpec::ServerRunner.new do |node|
- node.default['mysql2_chef_gem']['resource_name'] = 'default'
+ ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04') do |node|
+ node.default['mysql2_chef_gem']['provider'] = 'mysql'
end.converge('mysql2_chef_gem_test::default')
end
| Update the spec for the new test attribute
This spec is 100% useless, but it passes now.
Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
|
diff --git a/arm-none-eabi-gdb.rb b/arm-none-eabi-gdb.rb
index abc1234..def5678 100644
--- a/arm-none-eabi-gdb.rb
+++ b/arm-none-eabi-gdb.rb
@@ -9,6 +9,10 @@ depends_on 'mpfr'
depends_on 'libmpc'
depends_on 'readline'
+
+ # Linux dependencies.
+ depends_on 'python@2' unless OS.mac?
+ depends_on 'guile' unless OS.mac?
def install
system "./configure", "--prefix=#{prefix}", "--target=arm-none-eabi",
| Add python and libguile dependencies for non macos targets.
|
diff --git a/recipes/_mac_os_x.rb b/recipes/_mac_os_x.rb
index abc1234..def5678 100644
--- a/recipes/_mac_os_x.rb
+++ b/recipes/_mac_os_x.rb
@@ -17,4 +17,6 @@ # limitations under the License.
#
-xcode_command_line_tools 'install'
+potentially_at_compile_time do
+ xcode_command_line_tools 'install'
+end
| Allow XCode command line tools to be installed at compile time
|
diff --git a/lib/gumboot/shared_examples/database_schema.rb b/lib/gumboot/shared_examples/database_schema.rb
index abc1234..def5678 100644
--- a/lib/gumboot/shared_examples/database_schema.rb
+++ b/lib/gumboot/shared_examples/database_schema.rb
@@ -0,0 +1,22 @@+RSpec.shared_examples 'Database Schema' do
+ context 'AAF shared implementation' do
+ RSpec::Matchers.define :have_collation do |expected|
+ match { |actual| actual[:Collation] == expected }
+
+ failure_message do |actual|
+ format('expected table `%<Name>s` to use collation `%<expected>s`, ' \
+ 'but was `%<Collation>s`', actual.merge(expected: expected))
+ end
+ end
+
+ before { expect(connection).to be_a(Mysql2::Client) }
+
+ it 'has the correct collation' do
+ result = connection.query('SHOW TABLE STATUS',
+ as: :hash, symbolize_keys: true)
+ result.each do |table|
+ expect(table).to have_collation('utf8_bin')
+ end
+ end
+ end
+end
| Add shared examples to check database schema
Our existing apps don't have the correct collation set in their database
schema, so it's necessary to add a check which ensures we don't regress
once this has been fixed for an application.
|
diff --git a/lib/tasks/migrate_last_comment_created_at.rake b/lib/tasks/migrate_last_comment_created_at.rake
index abc1234..def5678 100644
--- a/lib/tasks/migrate_last_comment_created_at.rake
+++ b/lib/tasks/migrate_last_comment_created_at.rake
@@ -7,7 +7,7 @@ end
Board.find_each do |board|
- last_comment_created_at = board.discussions.order(last_comment_created_at: :desc).first.try(:created_at) || board.created_at
+ last_comment_created_at = board.discussions.order(last_comment_created_at: :desc).first.try(:last_comment_created_at) || board.created_at
board.update_columns last_comment_created_at: last_comment_created_at
end
end
| Correct comment created at data migration |
diff --git a/spec/features/redirects_spec.rb b/spec/features/redirects_spec.rb
index abc1234..def5678 100644
--- a/spec/features/redirects_spec.rb
+++ b/spec/features/redirects_spec.rb
@@ -0,0 +1,17 @@+require 'rails_helper'
+
+describe 'redirects' do
+ it 'no such redirect /go/foo' do
+ visit '/go/foo'
+ expect(page.body).to eq 'No such redirect or disabled.'
+ expect(page.status_code).to eq 404
+ end
+
+ it 'redirect exists /go/foo' do
+ create(:redirect, source_uri: '/go/foo', destination_uri: '/bar', status_code: 301)
+
+ visit '/go/foo'
+ expect(page).to have_current_path('/bar')
+ expect(page.status_code).to eq 404
+ end
+end
| Add spec for the general redirects controller.
|
diff --git a/spec/support/sign_in_helpers.rb b/spec/support/sign_in_helpers.rb
index abc1234..def5678 100644
--- a/spec/support/sign_in_helpers.rb
+++ b/spec/support/sign_in_helpers.rb
@@ -1,18 +1,19 @@ module SignInHelpers
def sign_in(user)
- visit '/users/sign_in'
- fill_in 'Email', :with => user.email
- fill_in 'Password', :with => 'password'
- click_button 'Sign in'
- page.should have_content("Signed in successfully")
+ login_as(user)
+ # visit '/users/sign_in'
+ # fill_in 'Email', :with => user.email
+ # fill_in 'Password', :with => 'password'
+ # click_button 'Sign in'
+ # page.should have_content("Signed in successfully")
end
def sign_out
- click_link 'Sign out'
- page.should have_content("Signed out successfully")
+ logout
end
end
RSpec.configure do |c|
+ c.include Warden::Test::Helpers
c.include SignInHelpers, :type => :request
end
| Use warden helpers rather than capybara walking through signing in for sign_in
|
diff --git a/Casks/baiduinput.rb b/Casks/baiduinput.rb
index abc1234..def5678 100644
--- a/Casks/baiduinput.rb
+++ b/Casks/baiduinput.rb
@@ -0,0 +1,13 @@+class Baiduinput < Cask
+ url 'http://shouji.baidu.com/download/1000e/baiduinput_mac_v3.2_1000e.dmg'
+ homepage 'http://wuxian.baidu.com/input/mac.html'
+ version '3.2'
+ sha1 'f3d446d866e7c80fd250abac9f553d508092e656'
+ install '安装百度输入法.pkg'
+ uninstall(
+ :pkgutil => 'com.baidu.inputmethod.*',
+ :files => [
+ '/Library/Input Methods/BaiduIM.app'
+ ]
+ )
+end
| Add cask for Baidu Input Method.
|
diff --git a/Casks/tunnelbear.rb b/Casks/tunnelbear.rb
index abc1234..def5678 100644
--- a/Casks/tunnelbear.rb
+++ b/Casks/tunnelbear.rb
@@ -15,4 +15,9 @@ postflight do
suppress_move_to_applications
end
+
+ uninstall quit: 'com.tunnelbear.mac.TunnelBear',
+ launchctl: 'com.tunnelbear.mac.tbeard'
+
+ zap delete: '~/Library/Preferences/com.tunnelbear.mac.TunnelBear.plist'
end
| Add zap stanza for TunnelBear
|
diff --git a/test/models/submission_test.rb b/test/models/submission_test.rb
index abc1234..def5678 100644
--- a/test/models/submission_test.rb
+++ b/test/models/submission_test.rb
@@ -1,6 +1,7 @@ # Encoding: utf-8
require 'test_helper'
+# Test submission model
class SubmissionTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
| Add header to submission model test
|
diff --git a/rgeo-geojson.gemspec b/rgeo-geojson.gemspec
index abc1234..def5678 100644
--- a/rgeo-geojson.gemspec
+++ b/rgeo-geojson.gemspec
@@ -12,7 +12,7 @@ spec.required_ruby_version = '>= 1.8.7'
spec.files = Dir["lib/**/*.rb", "test/**/*.rb", "*.rdoc", 'LICENSE.txt']
spec.extra_rdoc_files = Dir["*.rdoc"]
- spec.test_files = Dir["test/**/tc_*.rb"]
+ spec.test_files = Dir["test/**/*_test.rb"]
spec.platform = ::Gem::Platform::RUBY
| Update gemspe test file list
|
diff --git a/spec/factory_spec.rb b/spec/factory_spec.rb
index abc1234..def5678 100644
--- a/spec/factory_spec.rb
+++ b/spec/factory_spec.rb
@@ -48,4 +48,14 @@ end
end
end
+
+ describe 'talk' do
+ context 'basic' do
+ let(:talk) { FactoryGirl.create(:talk) }
+
+ it 'has a title' do
+ expect(talk.title).not_to be_nil
+ end
+ end
+ end
end | Add spec for talk factory
|
diff --git a/builder/test/cloud-init_spec.rb b/builder/test/cloud-init_spec.rb
index abc1234..def5678 100644
--- a/builder/test/cloud-init_spec.rb
+++ b/builder/test/cloud-init_spec.rb
@@ -1,17 +1,27 @@ require_relative 'spec_helper'
-describe file('/var/lib/cloud/scripts/per-once/regenerate-machine-id') do
- it { should be_file }
+describe "cloud-init" do
+ context "/var/lib/cloud/scripts/per-once" do
+ let(:stdout) { run("ls -1 /var/lib/cloud/scripts/per-once").stdout }
+
+ it "has a regenerate-machine-id script" do
+ expect(stdout).to contain('regenerate-machine-id')
+ end
+
+ it "has a resize2fs script" do
+ expect(stdout).to contain('resize2fs')
+ end
+ end
+
+ context "/var/lib/cloud/seed/nocloud-net" do
+ let(:stdout) { run_mounted("ls -l /var/lib/cloud/seed/nocloud-net").stdout }
+
+ it "user-data is linked to /boot/user-data" do
+ expect(stdout).to contain('user-data -> /boot/user-data')
+ end
+
+ it "meta-data is linked to /boot/meta-data" do
+ expect(stdout).to contain('meta-data -> /boot/meta-data')
+ end
+ end
end
-
-describe file('/var/lib/cloud/scripts/per-once/resizefs') do
- it { should be_file }
-end
-
-describe file('/var/lib/cloud/seed/nocloud-net/user-data') do
- it { should be_linked_to '/boot/user-data' }
-end
-
-describe file('/var/lib/cloud/seed/nocloud-net/meta-data') do
- it { should be_linked_to '/boot/meta-data' }
-end
| Update cloud-init tests to run in mounted SD image
|
diff --git a/hepta-theme.gemspec b/hepta-theme.gemspec
index abc1234..def5678 100644
--- a/hepta-theme.gemspec
+++ b/hepta-theme.gemspec
@@ -18,5 +18,5 @@ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.add_runtime_dependency "jekyll", "~> 3.3"
- spec.add_development_dependency "bundler", "~> 1.12"
+ spec.add_development_dependency "bundler", "~> 2.0"
end
| Update bundler requirement from ~> 1.12 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/compare/v1.12.0...v2.0.2)
Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com> |
diff --git a/example/spec/factories/issues.rb b/example/spec/factories/issues.rb
index abc1234..def5678 100644
--- a/example/spec/factories/issues.rb
+++ b/example/spec/factories/issues.rb
@@ -1,8 +1,8 @@ FactoryGirl.define do
factory :issue do
association :project, factory: :project
- association :creator, factory: :user
title "issue1"
status :draft
+ association :creator, factory: :user
end
end
| Fix generated factory to pass spec
|
diff --git a/Library/Formula/python3.rb b/Library/Formula/python3.rb
index abc1234..def5678 100644
--- a/Library/Formula/python3.rb
+++ b/Library/Formula/python3.rb
@@ -0,0 +1,44 @@+# Lightly modified from the Python 2.6.5 formula.
+require 'formula'
+
+class Python3 <Formula
+ url 'http://www.python.org/ftp/python/3.1.2/Python-3.1.2.tar.bz2'
+ homepage 'http://www.python.org/'
+ md5 '45350b51b58a46b029fb06c61257e350'
+
+ depends_on 'readline' => :optional # Prefer over OS X's libedit.
+ depends_on 'sqlite' => :optional # Prefer over OS X's copy.
+ depends_on 'gdbm' => :optional
+ # With all dependencies installed should only have ossaudiodev and spwd not
+ # built from the stdlib.
+
+ def options
+ [
+ ["--framework", "Do a 'Framework' build instead of a UNIX-style build."],
+ ["--universal", "Build for both 32 & 64 bit Intel."]
+ ]
+ end
+
+ # XXX Overriding skip_clean? is deprecated
+ def skip_clean? path
+ # Need to keep the versioned binaries.
+ # Also, don't strip out pre-compiled # bytecode files.
+ path == bin+'python3' or path == bin+'python3.1' or
+ path == lib+'python3.1'
+ end
+
+ def install
+ # --with-computed-gotos requires addressable labels in C;
+ # both gcc and LLVM support this, so switch it on.
+ args = ["--prefix=#{prefix}", "--with-computed-gotos"]
+
+ args << "--enable-framework" if ARGV.include? '--framework'
+ if ARGV.include? '--universal'
+ args.push "--enable-universalsdk=/", "--with-universal-archs=intel"
+ end
+
+ system "./configure", *args
+ system "make"
+ system "make install"
+ end
+end
| Add a formula for Python 3 (specifically 3.1.2).
Based off of the Python 2.6.5 formula. Minor comment tweaks along with adding
an extra performance flag that works under both gcc and LLVM.
Signed-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>
|
diff --git a/lib/arst/node.rb b/lib/arst/node.rb
index abc1234..def5678 100644
--- a/lib/arst/node.rb
+++ b/lib/arst/node.rb
@@ -8,6 +8,7 @@
module Node
+ # TODO: Rename to something more specific... from_raw_tree?
def self.from_options(options)
case options[:type]
when 'module' then Node::Module.new(options)
| Add small TODO note for `ARST::Node`
|
diff --git a/lib/llt/db_handler/tasks.rb b/lib/llt/db_handler/tasks.rb
index abc1234..def5678 100644
--- a/lib/llt/db_handler/tasks.rb
+++ b/lib/llt/db_handler/tasks.rb
@@ -25,8 +25,10 @@ end
desc 'Loads the seed data - UNDUMPED CHANGES WILL BE LOST!'
- task :seed do
- exec "pg_restore --verbose --clean --no-acl --no-owner -h localhost -U prometheus -d prometheus_stems #{DUMP_FILE}"
+ task :seed, :host, :options do |t, args|
+ host = args[:host] || 'localhost'
+ opts = args[:options]
+ exec "pg_restore --verbose --clean --no-acl --no-owner -h #{host} -U prometheus -d prometheus_stems #{DUMP_FILE} #{opts}"
end
end
end
| Add flexibility to db:seed rake task
Allow to pass a host and further options
|
diff --git a/lib/nats/nuid.rb b/lib/nats/nuid.rb
index abc1234..def5678 100644
--- a/lib/nats/nuid.rb
+++ b/lib/nats/nuid.rb
@@ -0,0 +1,62 @@+module NATS
+ class NUID
+ DIGITS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
+ BASE = 62
+ PREFIX_LENGTH = 12
+ SEQ_LENGTH = 10
+ TOTAL_LENGTH = PREFIX_LENGTH + SEQ_LENGTH
+ MAX_SEQ = BASE**10
+ MIN_INC = 33
+ MAX_INC = 333
+ INC = MAX_INC - MIN_INC
+
+ def initialize
+ @prand = Random.new
+ @seq = @prand.rand(MAX_SEQ)
+ @inc = MIN_INC + @prand.rand(INC)
+ @prefix = ''
+ randomize_prefix!
+ end
+
+ def next
+ @seq += @inc
+ if @seq >= MAX_SEQ
+ randomize_prefix!
+ reset_sequential!
+ end
+
+ l = @seq
+ suffix = SEQ_LENGTH.times.reduce('') do |b|
+ b.prepend DIGITS[l % BASE]
+ l /= BASE
+ b
+ end
+
+ "#{@prefix}#{suffix}"
+ end
+
+ def randomize_prefix!
+ @prefix = \
+ SecureRandom.random_bytes(PREFIX_LENGTH).each_byte
+ .reduce('') do |prefix, n|
+ prefix << DIGITS[n % BASE]
+ end
+ end
+
+ private
+
+ def reset_sequential!
+ @seq = prand.rand(MAX_SEQ)
+ @inc = MIN_INC + @prand.rand(INC)
+ end
+
+ class << self
+ def next
+ @nuid ||= NUID.new.extend(MonitorMixin)
+ @nuid.synchronize do
+ @nuid.next
+ end
+ end
+ end
+ end
+end
| Add implementation of NUID inboxes
|
diff --git a/test/test_job_base.rb b/test/test_job_base.rb
index abc1234..def5678 100644
--- a/test/test_job_base.rb
+++ b/test/test_job_base.rb
@@ -5,7 +5,7 @@ class TestJobBase < Test::Unit::TestCase
- class JobE < Batch::Job::Base
+ class JobE < Batch::Job
positional_arg :pos_arg, 'A positional arg'
end
| Update test for Job::Base -> Job change
|
diff --git a/lib/taxjar/configuration.rb b/lib/taxjar/configuration.rb
index abc1234..def5678 100644
--- a/lib/taxjar/configuration.rb
+++ b/lib/taxjar/configuration.rb
@@ -9,7 +9,8 @@ :format,
:proxy,
:user_agent,
- :connection_options ]
+ :connection_options,
+ :api_version ]
DEFAULT_ADAPTER = Faraday.default_adapter
DEFAULT_AUTH_TOKEN = "dae79dc5154ccabd7cb169f616d605e7"
@@ -19,6 +20,7 @@ DEFAULT_USER_AGENT = "Taxjar ruby Gem #{Taxjar::VERSION}".freeze
DEFAULT_CONNECTION_OPTIONS = {}
+ DEFAULT_API_VERSION = 1
attr_accessor *VALID_CONFIG_KEYS
@@ -44,6 +46,7 @@ self.proxy = DEFAULT_PROXY
self.user_agent = DEFAULT_USER_AGENT
self.connection_options = DEFAULT_CONNECTION_OPTIONS
+ self.api_version = DEFAULT_API_VERSION
end
end # Configuration
| Add api_version attribute into Configuration
|
diff --git a/profiling/pure/body_framing_with_2k_payload.rb b/profiling/pure/body_framing_with_2k_payload.rb
index abc1234..def5678 100644
--- a/profiling/pure/body_framing_with_2k_payload.rb
+++ b/profiling/pure/body_framing_with_2k_payload.rb
@@ -17,16 +17,17 @@ puts "Doing a warmup run..."
15_000.times { AMQ::Protocol::Method.encode_body("ab" * 1024, 1, FRAME_SIZE) }
-require 'ruby-prof'
+require 'stackprof'
# preallocate
ary = Array.new(n) { "ab" * 1024 }
puts "Doing main run..."
-result = RubyProf.profile do
+result = StackProf.run(mode: :wall) do
n.times { |i| AMQ::Protocol::Method.encode_body(ary[i], 1, FRAME_SIZE) }
end
-printer = RubyProf::FlatPrinter.new(result)
-printer.print(STDOUT, {})
+File.open('./profiling/dumps/body_framing_with_2k_payload.dump', "w+") do |f|
+ f.write Marshal.dump(result)
+end
| Switch profiler to stackprof (Ruby 2.1+)
|
diff --git a/libraries/dsl.rb b/libraries/dsl.rb
index abc1234..def5678 100644
--- a/libraries/dsl.rb
+++ b/libraries/dsl.rb
@@ -31,3 +31,8 @@ Chef::Recipe.send(:include, EnterpriseChef::DSL)
Chef::Provider.send(:include, EnterpriseChef::DSL)
Chef::Resource.send(:include, EnterpriseChef::DSL)
+
+# We still have a small number of definitions in use that need these;
+# otherwise, you have to know that the thing that you're working with
+# isn't a real resource and you'll have to jump through hoops.
+Chef::ResourceDefinition.send(:include, EnterpriseChef::DSL)
| Add DSL items to definitions
|
diff --git a/core/app/controllers/users_controller.rb b/core/app/controllers/users_controller.rb
index abc1234..def5678 100644
--- a/core/app/controllers/users_controller.rb
+++ b/core/app/controllers/users_controller.rb
@@ -12,7 +12,7 @@
def activities
respond_to do |format|
- format.json { render json: Activity::For.user(current_user.graph_user) }
+ format.json { render json: Activity::For.user(current_user.graph_user).map { |activity| Notifications::Activity.for(activity: activity, view: view_context) }.reverse }
end
end
| Return the activites as the correct json
|
diff --git a/spec/features/projects/badges/coverage_spec.rb b/spec/features/projects/badges/coverage_spec.rb
index abc1234..def5678 100644
--- a/spec/features/projects/badges/coverage_spec.rb
+++ b/spec/features/projects/badges/coverage_spec.rb
@@ -0,0 +1,73 @@+require 'spec_helper'
+
+feature 'test coverage badge' do
+ given!(:user) { create(:user) }
+ given!(:project) { create(:project, :private) }
+
+ given!(:pipeline) do
+ create(:ci_pipeline, project: project,
+ ref: 'master',
+ sha: project.commit.id)
+ end
+
+ context 'when user has access to view badge' do
+ background do
+ project.team << [user, :developer]
+ login_as(user)
+ end
+
+ scenario 'user requests coverage badge image for pipeline' do
+ create_job(coverage: 100, name: 'test:1')
+ create_job(coverage: 90, name: 'test:2')
+
+ show_test_coverage_badge
+
+ expect_coverage_badge('95%')
+ end
+
+ scenario 'user requests coverage badge for specific job' do
+ create_job(coverage: 50, name: 'test:1')
+ create_job(coverage: 50, name: 'test:2')
+ create_job(coverage: 85, name: 'coverage')
+
+ show_test_coverage_badge(job: 'coverage')
+
+ expect_coverage_badge('85%')
+ end
+
+ scenario 'user requests coverage badge for pipeline without coverage' do
+ create_job(coverage: nil, name: 'test')
+
+ show_test_coverage_badge
+
+ expect_coverage_badge('unknown')
+ end
+ end
+
+ context 'when user does not have access to view badge' do
+ background { login_as(user) }
+
+ scenario 'user requests test coverage badge image' do
+ show_test_coverage_badge
+
+ expect(page).to have_http_status(404)
+ end
+ end
+
+ def create_job(coverage:, name:)
+ create(:ci_build, name: name,
+ coverage: coverage,
+ pipeline: pipeline)
+ end
+
+ def show_test_coverage_badge(job: nil)
+ visit coverage_namespace_project_badges_path(
+ project.namespace, project, ref: :master, job: job, format: :svg)
+ end
+
+ def expect_coverage_badge(coverage)
+ svg = Nokogiri::XML.parse(page.body)
+ expect(page.response_headers['Content-Type']).to include('image/svg+xml')
+ expect(svg.at(%Q{text:contains("#{coverage}")})).to be_truthy
+ end
+end
| Add feature specs for test coverage badge
|
diff --git a/spec/unit/resource/macos_user_defaults_spec.rb b/spec/unit/resource/macos_user_defaults_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/resource/macos_user_defaults_spec.rb
+++ b/spec/unit/resource/macos_user_defaults_spec.rb
@@ -28,4 +28,18 @@ it "has a default action of install" do
expect(resource.action).to eql([:write])
end
+
+ [true, "TRUE", "1", "true", "YES", "yes"].each do |val|
+ it "coerces value property from #{val} to 1" do
+ resource.value val
+ expect(resource.value).to eql(1)
+ end
+ end
+
+ [false, "FALSE", "0", "false", "NO", "no"].each do |val|
+ it "coerces value property from #{val} to 0" do
+ resource.value val
+ expect(resource.value).to eql(0)
+ end
+ end
end
| Add specs for the value coerce
Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
|
diff --git a/lib/conway.rb b/lib/conway.rb
index abc1234..def5678 100644
--- a/lib/conway.rb
+++ b/lib/conway.rb
@@ -4,6 +4,12 @@
def initialize
@grid = Grid.new 53, 7
+ end
+
+ def start
+ number_of_living_cells = (grid.width * grid.heigth * 0.2).round
+ # TODO fill closure
+ number_of_living_cells.times { }
end
end
@@ -34,5 +40,17 @@ def empty?
value == 0
end
+
+ def alive?
+ value > 0
+ end
+
+ def increment
+ value += 1
+ end
+
+ def decrement
+ value -= 1
+ end
end
| Add todo to start method. Also add new methods to check if cell is alive, as well as in/decrement.:
|
diff --git a/app.rb b/app.rb
index abc1234..def5678 100644
--- a/app.rb
+++ b/app.rb
@@ -28,6 +28,7 @@ result = $redis.get("dda:#{params[:command_id]}")
begin
+ logger.info result
result_json = JSON.parse(result)
{status: "ok", result: result_json}.to_json
rescue Exception => e
| Add logger to status endpoint
|
diff --git a/dsd.rb b/dsd.rb
index abc1234..def5678 100644
--- a/dsd.rb
+++ b/dsd.rb
@@ -22,15 +22,16 @@ end
end
-class String
- def to_proc
- eval "Proc.new { |*args| #{self} }"
+def parse_config(h)
+ $a = eval("ObservableArray.new { #{h["statusbar"]["update_code"]} }")
+
+ h["statusbar"]["items"].each.with_index do |item, index|
+ eval("EM.add_periodic_timer(#{item["item"]["period"]}) { $a[#{index}] = #{item["item"]["code"]} }")
end
end
-$a = ObservableArray.new { Xname.xname $a.join " " }
+h = YAML.parse(File.open(ENV["HOME"] + "/.dsd.conf").read).to_ruby
EM.run do
- EM.add_periodic_timer(1) { $a[0] = DateTime.now.to_s }
- EM.add_periodic_timer(5) { $a[1] = File.read("/proc/loadavg").split[0..2].join " " }
+ parse_config(h)
end
| Implement basic configuration parser. It's ugly but it works.
|
diff --git a/Casks/mamp.rb b/Casks/mamp.rb
index abc1234..def5678 100644
--- a/Casks/mamp.rb
+++ b/Casks/mamp.rb
@@ -3,7 +3,7 @@ homepage 'http://www.mamp.info/en/index.html'
version '3.0.1'
sha256 'd43ff397203bef82f80dd237128026f3acc508cea114d560304e3793ca297e0f'
- install 'MAMP_3.0.1.pkg'
+ install 'MAMP_MAMP_PRO_3.0.1.pkg'
after_install do
system '/usr/bin/sudo', '-E', '--',
'/usr/sbin/chown', '-R', "#{Etc.getpwuid(Process.euid).name}:staff", '/Applications/MAMP', '/Applications/MAMP PRO'
| Fix MAMP install pkg name
|
diff --git a/lib/event_filter.rb b/lib/event_filter.rb
index abc1234..def5678 100644
--- a/lib/event_filter.rb
+++ b/lib/event_filter.rb
@@ -33,7 +33,7 @@ when TEAM
events.where(action: [Event::JOINED, Event::LEFT, Event::EXPIRED])
when ISSUE
- events.where(action: [Event::CREATED, Event::UPDATED, Event::CLOSED, Event::REOPENED], target_type: @filter.capitalize)
+ events.where(action: [Event::CREATED, Event::UPDATED, Event::CLOSED, Event::REOPENED], target_type: 'Issue')
else
events
end
| Add hard coded event type filter
|
diff --git a/lib/cooperator.rb b/lib/cooperator.rb
index abc1234..def5678 100644
--- a/lib/cooperator.rb
+++ b/lib/cooperator.rb
@@ -3,6 +3,9 @@ require 'hashie'
module Cooperator
+ class Context < Hashie::Mash
+ end
+
module ClassMethods
def perform(context = nil)
action = new context
@@ -15,11 +18,11 @@ @_context
end
- def initialize(context = Hashie::Mash.new)
- @_context = if context.is_a? Hashie::Mash
+ def initialize(context = Context.new)
+ @_context = if context.is_a? Context
context
else
- Hashie::Mash.new context
+ Context.new context
end
end
| Use our own class for defining the context.
|
diff --git a/Kugel.podspec b/Kugel.podspec
index abc1234..def5678 100644
--- a/Kugel.podspec
+++ b/Kugel.podspec
@@ -19,5 +19,6 @@ s.requires_arc = true
s.osx.deployment_target = "10.9"
s.ios.deployment_target = "8.0"
+ s.tvos.deployment_target = "9.0"
end
| Add support for tvOS in Podspec
|
diff --git a/i18n_alchemy.gemspec b/i18n_alchemy.gemspec
index abc1234..def5678 100644
--- a/i18n_alchemy.gemspec
+++ b/i18n_alchemy.gemspec
@@ -19,7 +19,7 @@ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
- s.add_dependency "activerecord", "~> 3.0.0"
- s.add_dependency "activesupport", "~> 3.0.0"
- s.add_dependency "i18n", "~> 0.5.0"
+ s.add_dependency "activerecord", "~> 3.0"
+ s.add_dependency "activesupport", "~> 3.0"
+ s.add_dependency "i18n", "~> 0.6.0beta1"
end
| Update gemspec to work with rails 3.1 |
diff --git a/lib/travis/tasks.rb b/lib/travis/tasks.rb
index abc1234..def5678 100644
--- a/lib/travis/tasks.rb
+++ b/lib/travis/tasks.rb
@@ -22,7 +22,7 @@ module Roadie
def self.app
@_config ||= OpenStruct.new(roadie: OpenStruct.new(enabled: true, provider: nil, after_inlining: nil))
- @_application ||= OpenStruct.new(config: @_config)
+ @_application ||= OpenStruct.new(config: @_config, root: Dir.pwd)
end
end
| Add root dir for Roadie.
|
diff --git a/lib/rspec2.rb b/lib/rspec2.rb
index abc1234..def5678 100644
--- a/lib/rspec2.rb
+++ b/lib/rspec2.rb
@@ -13,13 +13,13 @@
def example_pending(example)
super(example)
- @pending_count =+1
+ @pending_count +=1
tick PENDING
end
def example_failed(example)
super(example)
- @failure_count =+1
+ @failure_count +=1
tick FAIL
end
| Fix the failed and pending counting.
|
diff --git a/lib/serverspec.rb b/lib/serverspec.rb
index abc1234..def5678 100644
--- a/lib/serverspec.rb
+++ b/lib/serverspec.rb
@@ -13,9 +13,10 @@ module RSpec::Core::Notifications
class FailedExampleNotification < ExampleNotification
def failure_lines
+ host = ENV['TARGET_HOST'] || Specinfra.configuration.host
@failure_lines ||=
begin
- lines = ["On host `#{Specinfra.configuration.host}`"]
+ lines = ["On host `#{host}`"]
lines << "Failure/Error: #{read_failed_line.strip}"
lines << "#{exception_class_name}:" unless exception_class_name =~ /RSpec/
exception.message.to_s.split("\n").each do |line|
| Fix how to show host name in error
|
diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb
index abc1234..def5678 100644
--- a/app/mailers/application_mailer.rb
+++ b/app/mailers/application_mailer.rb
@@ -1,4 +1,4 @@ class ApplicationMailer < ActionMailer::Base
- default from: "colearn.xyz@gmail.com"
+ default from: "from@example.com"
layout 'mailer'
end
| Revert "login using send grid"
This reverts commit 4fbb103dbb4337c1e027864f6a475aa1ebc41fe8.
|
diff --git a/lib/limbo/client.rb b/lib/limbo/client.rb
index abc1234..def5678 100644
--- a/lib/limbo/client.rb
+++ b/lib/limbo/client.rb
@@ -21,7 +21,7 @@
def post
headers = { "X-LIMBO-KEY" => Limbo.key,
- "content-type" => "application/json"}
+ "content-type" => "application/json;charset=utf-8"}
path = '/log'
request = Net::HTTP::Post.new(path, headers)
@@ -39,10 +39,12 @@
def body
begin
- JSON.generate(@body)
- rescue JSON::GeneratorError
+ JSON.generate(@body).encode("UTF-8", invalid: :replace, undef: :replace)
+ rescue => e
@valid_data = false
- '{"client-error": "error generating JSON"}'
+ %Q|{"client-error": "error generating JSON",
+ "message": #{e.message.inspect},
+ "backtrace": "#{e.backtrace.join('\n')}"}|
end
end
| Fix encoding; always send json as utf-8
|
diff --git a/app/server/sonicpi/incomingosc.rb b/app/server/sonicpi/incomingosc.rb
index abc1234..def5678 100644
--- a/app/server/sonicpi/incomingosc.rb
+++ b/app/server/sonicpi/incomingosc.rb
@@ -0,0 +1,84 @@+#--
+# This file is part of Sonic Pi: http://sonic-pi.net
+# Full project source: https://github.com/samaaron/sonic-pi
+# License: https://github.com/samaaron/sonic-pi/blob/master/LICENSE.md
+#
+# Copyright 2013, 2014 by Sam Aaron (http://sam.aaron.name).
+# All rights reserved.
+#
+# Permission is granted for use, copying, modification, distribution,
+# and distribution of modified versions of this work as long as this
+# notice is included.
+#++
+
+require 'osc-ruby'
+
+module SonicPi
+ class IncomingOSC
+ attr_reader :address, :args
+ def initialize(s)
+ p = OSC::NetworkPacket.new(s)
+ @address = get_string(p)
+ @args = get_args(p)
+ end
+
+ private
+
+ def get_string(p)
+ string_delemeter = "\x00"
+ result = ''
+ until (c = p.getc) == string_delemeter
+ result << c
+ end
+ p.skip_padding
+ result
+ end
+
+ def get_args(p)
+ if p.getc == ?,
+
+ tags = get_string(p)
+ args = []
+
+ tags.scan(/./) do | tag |
+ args << case tag
+ when "i"
+ get_int32(p)
+ when "f"
+ get_float32(p)
+ when "s"
+ get_string(p)
+ when "b"
+ get_blob(p)
+ else
+ raise "unknown OSC tag: #{tag}"
+ end
+ end
+ args
+ else
+ []
+ end
+ end
+
+ def get_int32(p)
+ i = p.getn(4).unpack('N')[0]
+ i -= 2**32 if i > (2**31-1)
+ p.skip_padding
+ i
+ end
+
+ def get_float32(p)
+ f = p.getn(4).unpack('g')[0]
+ p.skip_padding
+ f
+ end
+
+ def get_blob(p)
+ l = p.getn(4).unpack('N')[0]
+ b = p.getn(l)
+ p.skip_padding
+ b
+ end
+
+ end
+end
| Add class to parse incoming OSC binary packets:
* Much simpler than osc-ruby equivalent |
diff --git a/lib/nats/version.rb b/lib/nats/version.rb
index abc1234..def5678 100644
--- a/lib/nats/version.rb
+++ b/lib/nats/version.rb
@@ -1,6 +1,6 @@ module NATS
# NOTE: These are all announced to the server on CONNECT
VERSION = "0.8.2".freeze
- LANG = (RUBY_PLATFORM == 'java' ? 'jruby' : 'ruby').freeze
+ LANG = RUBY_ENGINE
PROTOCOL_VERSION = 1
end
| Use RUBY_ENGINE when announcing runtime on CONNECT
|
diff --git a/lib/sandwich/cli.rb b/lib/sandwich/cli.rb
index abc1234..def5678 100644
--- a/lib/sandwich/cli.rb
+++ b/lib/sandwich/cli.rb
@@ -21,6 +21,13 @@ :default => '-',
:on => :head
+ option :log_level,
+ :short => '-l LEVEL',
+ :long => '--log_level LEVEL',
+ :description => 'Set the log level (debug, info, warn, error, fatal)',
+ :default => :warn,
+ :proc => lambda { |l| l.to_sym }
+
def run(argv)
parse_options(argv)
if config[:file] == '-'
@@ -29,7 +36,7 @@ file = File.read(config[:file])
runner = Sandwich::Runner.new(file)
end
- runner.run(:debug)
+ runner.run(config[:log_level])
end
end
end
| Add --log_level command line option
|
diff --git a/lib/secret_santa.rb b/lib/secret_santa.rb
index abc1234..def5678 100644
--- a/lib/secret_santa.rb
+++ b/lib/secret_santa.rb
@@ -16,4 +16,10 @@ end
end
end
+
+ def self.solicit_input
+ puts "Enter each name in the Secret Santa pool, separated by a space:"
+ names = gets.downcase.chomp
+ create_list(names.split(" "))
+ end
end
| Add method to solicit user input
|
diff --git a/lib/wyatt/record.rb b/lib/wyatt/record.rb
index abc1234..def5678 100644
--- a/lib/wyatt/record.rb
+++ b/lib/wyatt/record.rb
@@ -7,12 +7,12 @@ def self.add_field_to_class(field_name, type)
class_eval <<-RUBY
def #{field_name}
- @field_name
+ @#{field_name}
end
def #{field_name}=(value)
raise_#{field_name}_type_exception if value.class != #{type}
- @field_name = value
+ @#{field_name} = value
end
private
| Fix unencapsulated string sub of the field name
|
diff --git a/logstream.gemspec b/logstream.gemspec
index abc1234..def5678 100644
--- a/logstream.gemspec
+++ b/logstream.gemspec
@@ -3,7 +3,7 @@
Gem::Specification.new do |s|
s.name = "logstream"
- s.version = "0.0.6"
+ s.version = "0.0.7"
s.date = Time.now.strftime("%Y-%m-%d")
s.author = "Barry Jaspan"
@@ -19,11 +19,10 @@ s.bindir = "bin"
s.executables = Dir["bin/*"].map { |f| File.basename(f) }.select { |f| f =~ /^[\w\-]+$/ }
s.test_files = Dir["test/**/*"]
- s.has_rdoc = false
- s.add_runtime_dependency('faye-websocket', ['~> 0.8.0'])
+ s.add_runtime_dependency('faye-websocket', ['~> 0.10.0'])
s.add_runtime_dependency('json', ['>= 1.7.7'])
- s.add_runtime_dependency('thor', ['~> 0.19.1'])
+ s.add_runtime_dependency('thor', ['~> 0.20.0'])
- s.required_ruby_version = '>= 1.9.3'
+ s.required_ruby_version = '>= 2.4'
end
| Update minimum versions of dependencies
|
diff --git a/app/helpers/date_time_helper.rb b/app/helpers/date_time_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/date_time_helper.rb
+++ b/app/helpers/date_time_helper.rb
@@ -1,6 +1,6 @@ module DateTimeHelper
def short_date_format(date_time)
- date_time && date_time.strftime("%e %B %Y")
+ date_time && date_time.strftime("%-d %B %Y")
end
def date_time_format(date_time)
| Swap '%e' for '%-d' in short_date_format
It's unlikely we really need ' 1' instead of '1', so let's use '%-d' which gives us no padding, instead of '%e' which gives us space-padding (or %d which gives us 0-padding).
|
diff --git a/app/jobs/odk/form_render_job.rb b/app/jobs/odk/form_render_job.rb
index abc1234..def5678 100644
--- a/app/jobs/odk/form_render_job.rb
+++ b/app/jobs/odk/form_render_job.rb
@@ -6,7 +6,7 @@ def perform(form)
form.odk_xml.attach(
io: StringIO.new(FormRenderer.new(form).xml),
- filename: "form.xml",
+ filename: "#{form.id}.xml",
content_type: "application/xml"
)
end
| 11895: Change filename to form uuid
|
diff --git a/cookbook/metadata.rb b/cookbook/metadata.rb
index abc1234..def5678 100644
--- a/cookbook/metadata.rb
+++ b/cookbook/metadata.rb
@@ -1,6 +1,6 @@ name 'baragon'
-maintainer 'EverTrue, Inc.'
-maintainer_email 'eric.herot@evertrue.com'
+maintainer 'Tom Petr'
+maintainer_email 'tpetr@hubspot.com'
license 'Apache 2.0'
description 'Installs/Configures baragon'
long_description 'Installs/Configures baragon'
| Change maintainer info to HubSpot
|
diff --git a/Casks/a-better-finder-rename.rb b/Casks/a-better-finder-rename.rb
index abc1234..def5678 100644
--- a/Casks/a-better-finder-rename.rb
+++ b/Casks/a-better-finder-rename.rb
@@ -4,9 +4,9 @@
url 'http://www.publicspace.net/download/ABFRX.dmg'
name 'A Better Finder Rename'
- appcast 'http://www.publicspace.net/app/signed_abfr9.xml'
+ appcast 'http://www.publicspace.net/app/signed_abfr10.xml'
homepage 'http://www.publicspace.net/ABetterFinderRename/'
license :commercial
- app 'A Better Finder Rename 9.app'
+ app 'A Better Finder Rename 10.app'
end
| Upgrade "A Better Finder Rename" to v10
|
diff --git a/SloppySwiper.podspec b/SloppySwiper.podspec
index abc1234..def5678 100644
--- a/SloppySwiper.podspec
+++ b/SloppySwiper.podspec
@@ -1,37 +1,14 @@-#
-# Be sure to run `pod lib lint NAME.podspec' to ensure this is a
-# valid spec and remove all comments before submitting the spec.
-#
-# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
-#
Pod::Spec.new do |s|
s.name = "SloppySwiper"
s.version = "0.1.0"
- s.summary = "A short description of SloppySwiper."
- s.description = <<-DESC
- An optional longer description of SloppySwiper
-
- * Markdown format.
- * Don't worry about the indent, we strip it!
- DESC
- s.homepage = "http://EXAMPLE/NAME"
- s.screenshots = "www.example.com/screenshots_1", "www.example.com/screenshots_2"
+ s.summary = "UINavigationController's delegate that allows swipe back gesture to be started from anywhere on the screen (not only from the left edge)."
+ s.homepage = "https://github.com/fastred/SloppySwiper"
s.license = 'MIT'
s.author = { "Arkadiusz Holko" => "fastred@fastred.org" }
- s.source = { :git => "http://EXAMPLE/NAME.git", :tag => s.version.to_s }
- s.social_media_url = 'https://twitter.com/EXAMPLE'
-
- # s.platform = :ios, '5.0'
- # s.ios.deployment_target = '5.0'
- # s.osx.deployment_target = '10.7'
+ s.source = { :git => "http://github.com/fastred/SloppySwiper.git", :tag => s.version.to_s }
+ s.platform = :ios, '7.0'
+ s.ios.deployment_target = '7.0'
s.requires_arc = true
-
s.source_files = 'Classes'
- s.resources = 'Assets/*.png'
-
- s.ios.exclude_files = 'Classes/osx'
- s.osx.exclude_files = 'Classes/ios'
- # s.public_header_files = 'Classes/**/*.h'
- # s.frameworks = 'SomeFramework', 'AnotherFramework'
- # s.dependency 'JSONKit', '~> 1.4'
+ s.public_header_files = 'Classes/*.h'
end
| Improve .podspec (almost release-ready quality) |
diff --git a/app/models/concerns/loggable.rb b/app/models/concerns/loggable.rb
index abc1234..def5678 100644
--- a/app/models/concerns/loggable.rb
+++ b/app/models/concerns/loggable.rb
@@ -18,8 +18,10 @@ end
def modified_by
- if paper_trail.try(:originator)
- User.find(paper_trail.try(:originator))
+ user_id = paper_trail.try(:originator)
+
+ if user_id && User.exists?(user_id)
+ User.find(user_id)
end
end
| Fix intermittently failing specs by adding record existance check
|
diff --git a/resources/uninstall_package.rb b/resources/uninstall_package.rb
index abc1234..def5678 100644
--- a/resources/uninstall_package.rb
+++ b/resources/uninstall_package.rb
@@ -11,7 +11,7 @@ property :name, String, :name_property => true
property :installation_path, String
property :installer_cache_path, String
-property :service_name, String, :default => nil
+property :service_name, String, :default => ''
action :run do
include_recipe 'dynatrace::node_info'
| [JLT-163581] Refactor uninstall recipes
* Fixed error in logs "Default value nil is invalid for property service_name "
|
diff --git a/spec/api_spec.rb b/spec/api_spec.rb
index abc1234..def5678 100644
--- a/spec/api_spec.rb
+++ b/spec/api_spec.rb
@@ -10,7 +10,6 @@ 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
'Authorization' => /\AOAuth/,
'Content-Type' => 'application/x-www-form-urlencoded',
- 'User-Agent' => 'OAuth gem v0.4.7',
})
.to_return(status: 200, body: '{ "answer": 42 }')
| Fix spec for higher versions of OAuth gem
|
diff --git a/app/policies/discussion_policy.rb b/app/policies/discussion_policy.rb
index abc1234..def5678 100644
--- a/app/policies/discussion_policy.rb
+++ b/app/policies/discussion_policy.rb
@@ -1,10 +1,12 @@ DiscussionPolicy = Struct.new(:user, :discussion) do
def update?
+ return false unless user
user.admin? or discussion.user == user
end
def destroy?
+ return false unless user
user.admin?
end
-end+end
| Fix bug with nil user.
|
diff --git a/app/presenters/image_presenter.rb b/app/presenters/image_presenter.rb
index abc1234..def5678 100644
--- a/app/presenters/image_presenter.rb
+++ b/app/presenters/image_presenter.rb
@@ -1,7 +1,7 @@ class ImagePresenter < LulalalaPresenter::Base
def linked_display
h.link_to(
- h.image_tag(h.image_url(model.image.thumb.url)),
+ h.image_tag(h.image_url(model.image.thumb.url), width:model.thumb_width, height:model.thumb_height),
h.image_url(model.image.url),
class:'img'
).html_safe
| Set thumbnail width and height in view
To prevent layout reflow |
diff --git a/ng_classify.gemspec b/ng_classify.gemspec
index abc1234..def5678 100644
--- a/ng_classify.gemspec
+++ b/ng_classify.gemspec
@@ -19,10 +19,10 @@ s.test_files = Dir["test/**/*"]
s.require_paths = ['lib']
- s.add_runtime_dependency 'therubyracer', '~> 0.12', '>= 0.12.1'
- s.add_runtime_dependency 'commonjs', '~> 0.2', '>= 0.2.7'
- s.add_runtime_dependency 'rails', '>=3.2'
- s.add_runtime_dependency 'activesupport', ['>= 3.0', '< 4.2']
- s.add_runtime_dependency 'actionpack', ['>= 3.0', '< 4.2']
- s.add_runtime_dependency 'railties', ['>= 3.0', '< 4.2']
+ s.add_runtime_dependency 'therubyracer', '~> 0.12', '>= 0.12.1'
+ s.add_runtime_dependency 'commonjs', '~> 0.2', '>= 0.2.7'
+ s.add_runtime_dependency 'rails', '>= 3.2', '< 5'
+ s.add_runtime_dependency 'activesupport', '>= 3.0', '< 5'
+ s.add_runtime_dependency 'actionpack', '>= 3.0', '< 5'
+ s.add_runtime_dependency 'railties', '>= 3.0', '< 5'
end
| Update runtime dependency to extend rails support before 5
|
diff --git a/cookbooks/kernel/kernel-4.1.1.rb b/cookbooks/kernel/kernel-4.1.1.rb
index abc1234..def5678 100644
--- a/cookbooks/kernel/kernel-4.1.1.rb
+++ b/cookbooks/kernel/kernel-4.1.1.rb
@@ -22,5 +22,5 @@
execute "build kernel" do
user node["rbenv"]["user"]
- command "cd #{build_dir} && make && mv #{build_dir}/build/linux-4.1.1 /vagrant/build/."
+ command "cd #{build_dir} && make THREAD=2 && mv #{build_dir}/build/linux-4.1.1 /vagrant/build/."
end
| Use 2 core for kernel build
|
diff --git a/app/workers/data_import_worker.rb b/app/workers/data_import_worker.rb
index abc1234..def5678 100644
--- a/app/workers/data_import_worker.rb
+++ b/app/workers/data_import_worker.rb
@@ -0,0 +1,31 @@+#
+# Responsible for migrating data from the Opscode Community Site to Supermarket
+#
+class DataImportWorker
+ include Sidekiq::Worker
+ include Sidetiq::Schedulable
+
+ recurrence do
+ daily.hour_of_day(3, 9, 15, 21)
+ end
+
+ #
+ # Invokes the supermarket:migrate Rake task
+ #
+ def perform
+ migration = Rake::Task['supermarket:migrate']
+
+ supermarket_tasks(migration).each(&:reenable)
+
+ migration.invoke
+ end
+
+ private
+
+ def supermarket_tasks(task)
+ ([task] + task.prerequisite_tasks.map { |t| supermarket_tasks(t) }).
+ flatten.
+ uniq(&:name).
+ select { |t| t.name.include?('supermarket') }
+ end
+end
| Migrate data every 6 hours starting at 3 UTC
|
diff --git a/app/services/process_hashtags_service.rb b/app/services/process_hashtags_service.rb
index abc1234..def5678 100644
--- a/app/services/process_hashtags_service.rb
+++ b/app/services/process_hashtags_service.rb
@@ -4,7 +4,7 @@ def call(status, tags = [])
tags = status.text.scan(Tag::HASHTAG_RE).map(&:first) if status.local?
- tags.map { |str| str.mb_chars.downcase }.uniq.each do |tag|
+ tags.map { |str| str.mb_chars.downcase }.uniq{ |t| t.to_s }.each do |tag|
status.tags << Tag.where(name: tag).first_or_initialize(name: tag)
end
| Call uniq on the string version of mb_chars tags
|
diff --git a/config/software/datadog-gohai.rb b/config/software/datadog-gohai.rb
index abc1234..def5678 100644
--- a/config/software/datadog-gohai.rb
+++ b/config/software/datadog-gohai.rb
@@ -2,15 +2,13 @@ default_version "last-stable"
always_build true
-go_path "/var/cache/omnibus/src/datadog-gohai"
-
env = {
"GOROOT" => "/usr/local/go",
- "GOPATH" => go_path
+ "GOPATH" => "/var/cache/omnibus/src/datadog-gohai"
}
build do
command "$GOROOT/bin/go get -d -u github.com/DataDog/gohai", :env => env
- command "git checkout #{default_version} && git pull", :env => env, :cwd => "#{go_path}/src/github.com/DataDog/gohai"
+ command "git checkout #{default_version} && git pull", :env => env, :cwd => "/var/cache/omnibus/src/datadog-gohai/src/github.com/DataDog/gohai"
command "$GOROOT/bin/go build -o #{install_dir}/bin/gohai $GOPATH/src/github.com/DataDog/gohai/gohai.go", :env => env
end
| Revert "use go_path as a variable"
This reverts commit 91bf251df91c3c70c7196c39a8b8e5b3d06e2ee3.
|
diff --git a/social_graph.gemspec b/social_graph.gemspec
index abc1234..def5678 100644
--- a/social_graph.gemspec
+++ b/social_graph.gemspec
@@ -0,0 +1,19 @@+# -*- encoding: utf-8 -*-
+lib = File.expand_path('../lib/', __FILE__)
+$:.unshift lib unless $:.include?(lib)
+
+Gem::Specification.new do |s|
+ s.name = "socialgraph"
+ s.version = "0.1.0"
+ s.platform = Gem::Platform::RUBY
+ s.authors = ["Chris Dinn"]
+ s.email = ["chrisgdinn@gmail.com"]
+ s.homepage = "http://github.com/chrisdinn/SocialGraph"
+ s.summary = "A small library for accessing the Facebook Graph API "
+ s.files = Dir['lib/*.rb'] + Dir['test/*.rb'] + %w(LICENSE README.md)
+
+ s.add_dependency 'addressable'
+ s.add_dependency 'json'
+
+ s.require_path = 'lib'
+end | Add gemspec, awaiting new gem name.
|
diff --git a/levels/contribute.rb b/levels/contribute.rb
index abc1234..def5678 100644
--- a/levels/contribute.rb
+++ b/levels/contribute.rb
@@ -1,5 +1,5 @@ difficulty 3
-description "This is the final level, the goal is to contribute to this repository by making a pull request on Github. Please note that this level is designed to encourage you to add a valid contribution to Githug, not testing your ability to create a pull request. Contributions that are likely to be accepted are levels, bug fixes and improved documentation."
+description "This is the final level, the goal is to contribute to this repository by making a pull request on GitHub. Please note that this level is designed to encourage you to add a valid contribution to Githug, not testing your ability to create a pull request. Contributions that are likely to be accepted are levels, bug fixes and improved documentation."
solution do
location = "/tmp/githug"
| Fix typo: it's GitHub, not Github.
|
diff --git a/core/spec/classes/export_spec.rb b/core/spec/classes/export_spec.rb
index abc1234..def5678 100644
--- a/core/spec/classes/export_spec.rb
+++ b/core/spec/classes/export_spec.rb
@@ -4,16 +4,16 @@ it '#export' do
FactoryGirl.reload
- user = create :user, created_at: Time.at(0)
- user.updated_at = Time.at(1000)
+ user = create :user, created_at: Time.parse("1970-01-01")
+ user.updated_at = Time.parse("1970-01-02")
user.confirmation_token = 'moi'
- user.confirmation_sent_at = Time.at(2000)
+ user.confirmation_sent_at = Time.parse("1970-01-03")
user.save!
create :social_account, :twitter, user: user,
- created_at: Time.at(3000), updated_at: Time.at(4000)
+ created_at: Time.parse("1970-01-04"), updated_at: Time.parse("1970-01-05")
- create :fact_data, created_at: Time.at(5000), updated_at: Time.at(6000)
+ create :fact_data, created_at: Time.parse("1970-01-06"), updated_at: Time.parse("1970-01-07")
verify(format: :text) { Export.new.export }
end
| Use more explicit timestamps to make it easier to verify fixture
|
diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb
index abc1234..def5678 100644
--- a/config/initializers/omniauth.rb
+++ b/config/initializers/omniauth.rb
@@ -11,7 +11,8 @@ "esi-location.read_online.v1",
"esi-location.read_ship_type.v1",
"esi-mail.read_mail.v1",
- "esi-characters.read_standings.v1",].freeze
+ "esi-characters.read_standings.v1",
+ "esi-characters.read_blueprints.v1",].freeze
OmniAuth.config.full_host = "https://evemonk.com"
| Add scope for character blueprints
|
diff --git a/percentable.gemspec b/percentable.gemspec
index abc1234..def5678 100644
--- a/percentable.gemspec
+++ b/percentable.gemspec
@@ -8,9 +8,9 @@ spec.version = Percentable::VERSION
spec.authors = ["Eric Roberts"]
spec.email = ["ericroberts@gmail.com"]
- spec.summary = %q{TODO: Write a short summary. Required.}
- spec.description = %q{TODO: Write a longer description. Optional.}
- spec.homepage = ""
+ spec.summary = "Small gem to make working with percents easier."
+ spec.description = "Small gem to make working with percents easier. Includes methods to make selected rails attributes return percents."
+ spec.homepage = "https://github.com/ericroberts/percentable"
spec.license = "MIT"
spec.files = `git ls-files -z`.split("\x0")
@@ -20,4 +20,5 @@
spec.add_development_dependency "bundler", "~> 1.6"
spec.add_development_dependency "rake"
+ spec.add_development_dependency "rspec", "~> 3.0"
end
| Add gem description, home page, dependency on rspec. |
diff --git a/app/models/logging/ip_address.rb b/app/models/logging/ip_address.rb
index abc1234..def5678 100644
--- a/app/models/logging/ip_address.rb
+++ b/app/models/logging/ip_address.rb
@@ -25,7 +25,8 @@ # validates_presence_of :longitude
# Converts an IPv4 address string to a 32-bit integer which can be stored in an ordinary 4-byte database integer column without truncation or decimal points.
- def self.ip2int(ip = '127.0.0.1')
+ def self.ip2int(ip)
+ ip ||= '127.0.0.1'
IPAddr.new(ip, Socket::AF_INET).to_i
end
| Fix spec test failure caused by nil ip address from request.remote_ip in test environment
git-svn-id: 9e5305ce09d475b8287d6587bfa7d171216f9abf@312 78829999-583a-0410-bd01-8a9b849fd409
|
diff --git a/spec/stemmer_spec.rb b/spec/stemmer_spec.rb
index abc1234..def5678 100644
--- a/spec/stemmer_spec.rb
+++ b/spec/stemmer_spec.rb
@@ -0,0 +1,17 @@+require "jruby-stemmer"
+
+describe JRuby::Stemmer do
+ it "stems a string" do
+ result = JRuby::Stemmer.stem("apple")
+ expect(result).to be == "appl"
+ end
+end
+
+describe "String" do
+ it "has a #stem method" do
+ expect("").to respond_to(:stem)
+ end
+ it "stems a string" do
+ expect("apple".stem).to be == "appl"
+ end
+end
| Add some tests, like a good little dev
|
diff --git a/spec/unit/in_spec.rb b/spec/unit/in_spec.rb
index abc1234..def5678 100644
--- a/spec/unit/in_spec.rb
+++ b/spec/unit/in_spec.rb
@@ -6,6 +6,36 @@ 'source' => { 'foo' => 'bar' },
'version' => { 'ref' => '61cebf' },
} }
+
+ let(:destination_directory) { Dir.mktmpdir }
+
+ after do
+ FileUtils.remove_entry(destination_directory) if destination_directory
+ end
+
+ it 'fetches the resource and responds with the fetched version and its metadata' do
+ output = subject.call(input, destination_directory)
+
+ expect(output).to eq({
+ 'version' => { 'ref' => '61cebf' },
+ 'metadata' => [
+ { 'name' => 'commit', 'value' => '61cebf' },
+ { 'name' => 'author', 'value' => 'Hulk Hogan' },
+ ]
+ })
+ end
+
+ xit 'fetches the resource and places it in the given directory' do
+ end
+
+ xit 'emits the fetched version' do
+ end
+
+ xit 'emits metadata as a list of key-value pairs' do
+ end
+
+ xit 'accepts params passed as an arbitrary JSON object' do
+ end
context 'without destination directory' do
let(:destination_directory) { nil }
@@ -17,34 +47,8 @@ end
end
- context 'with a proper destination directory' do
- let(:destination_directory) { Dir.mktmpdir }
-
- after do
- FileUtils.remove_entry(destination_directory)
- end
-
- it 'fetches the resource and responds with the fetched version and its metadata' do
- output = subject.call(input, destination_directory)
-
- expect(output).to eq({
- 'version' => { 'ref' => '61cebf' },
- 'metadata' => [
- { 'name' => 'commit', 'value' => '61cebf' },
- { 'name' => 'author', 'value' => 'Hulk Hogan' },
- ]
- })
- end
-
- it 'fetches the resource and places it in the given directory' do
- fail 'TBD'
+ context 'the desired resource version is unavailable' do
+ xit 'raises an error' do
end
end
end
-
-__END__
-
-* The script must fetch the resource and place it in the given directory.
-* If the desired resource version is unavailable (for example, if it was deleted), the script must error.
-* The script must emit the fetched version, and may emit metadata as a list of key-value pairs.
-* params is an arbitrary JSON object passed along verbatim from params on a get.
| Add new test cases (still skipping)
|
diff --git a/spec/lib/i18n/core_ext_spec.rb b/spec/lib/i18n/core_ext_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/i18n/core_ext_spec.rb
+++ b/spec/lib/i18n/core_ext_spec.rb
@@ -1,4 +1,5 @@ require 'i18n'
+require 'i18n/core_ext'
RSpec.describe I18n::Backend::Base do
# Since #load_erb is a protected method, this spec tests the
| Add in require for i18n monkey patch
|
diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb
index abc1234..def5678 100644
--- a/spec/spec_helper_acceptance.rb
+++ b/spec/spec_helper_acceptance.rb
@@ -18,6 +18,7 @@ # Install module and dependencies
hosts.each do |host|
copy_module_to(host, source: proj_root, module_name: 'screen')
+ on host, puppet('module install puppet-extlib'), acceptable_exit_codes: [0, 1]
on host, puppet('module install puppetlabs-stdlib'), acceptable_exit_codes: [0, 1]
end
end
| Add missing dependency for Beaker tests
|
diff --git a/app/uploaders/avatar_uploader.rb b/app/uploaders/avatar_uploader.rb
index abc1234..def5678 100644
--- a/app/uploaders/avatar_uploader.rb
+++ b/app/uploaders/avatar_uploader.rb
@@ -11,8 +11,10 @@ process :cropper
def cropper
- manipulate! do |img|
- img.crop "#{model.avatar_crop_size}x#{model.avatar_crop_size}+#{model.avatar_crop_x}+#{model.avatar_crop_y}"
+ if model.instance_of? User
+ manipulate! do |img|
+ img.crop "#{model.avatar_crop_size}x#{model.avatar_crop_size}+#{model.avatar_crop_x}+#{model.avatar_crop_y}"
+ end
end
end
| Fix failing tests introduced in commit 6d58088
|
diff --git a/lib/compo/movable.rb b/lib/compo/movable.rb
index abc1234..def5678 100644
--- a/lib/compo/movable.rb
+++ b/lib/compo/movable.rb
@@ -1,48 +1,46 @@-module Bra
- module Model
- # Helper mixin for objects that can be moved into other objects
+module Compo
+ # Helper mixin for objects that can be moved into other objects
+ #
+ # This mixin defines a method, #move_to, which handles removing a child
+ # from its current parent and adding it to a new one.
+ #
+ # It expects the current parent to be reachable from #parent.
+ module Movable
+ # Moves this model object to a new parent with a new ID.
#
- # This mixin defines a method, #move_to, which handles removing a child
- # from its current parent and adding it to a new one.
+ # @param new_parent [ModelObject] The new parent for this object (can be
+ # nil).
+ # @param new_id [Object] The new ID under which the object will exist in
+ # the parent.
#
- # It expects the current parent to be reachable from #parent.
- module Movable
- # Moves this model object to a new parent with a new ID.
- #
- # @param new_parent [ModelObject] The new parent for this object (can be
- # nil).
- # @param new_id [Object] The new ID under which the object will exist in
- # the parent.
- #
- # @return [self]
- def move_to(new_parent, new_id)
- move_from_old_parent
- move_to_new_parent(new_parent, new_id)
- self
- end
+ # @return [self]
+ def move_to(new_parent, new_id)
+ move_from_old_parent
+ move_to_new_parent(new_parent, new_id)
+ self
+ end
- private
+ private
- # Performs the move from an old parent, if necessary
- #
- # @api private
- #
- # @return [void]
- def move_from_old_parent
- parent.remove(id) unless parent.nil?
- end
+ # Performs the move from an old parent, if necessary
+ #
+ # @api private
+ #
+ # @return [void]
+ def move_from_old_parent
+ parent.remove(id) unless parent.nil?
+ end
- # Performs the move to a new parent, if necessary
- #
- # @api private
- #
- # @param new_parent [Composite] The target parent of the move.
- # @param new_id [Object] The intended new ID of this child.
- #
- # @return [void]
- def move_to_new_parent(new_parent, new_id)
- new_parent.add(new_id, self) unless new_parent.nil?
- end
+ # Performs the move to a new parent, if necessary
+ #
+ # @api private
+ #
+ # @param new_parent [Composite] The target parent of the move.
+ # @param new_id [Object] The intended new ID of this child.
+ #
+ # @return [void]
+ def move_to_new_parent(new_parent, new_id)
+ new_parent.add(new_id, self) unless new_parent.nil?
end
end
end
| Put Movable in the correct module.
|
diff --git a/lib/protocolist.rb b/lib/protocolist.rb
index abc1234..def5678 100644
--- a/lib/protocolist.rb
+++ b/lib/protocolist.rb
@@ -1,5 +1,4 @@ require 'active_support'
-require 'active_support/core_ext'
require 'protocolist/version'
require 'protocolist/model_additions'
@@ -9,10 +8,13 @@
module Protocolist
- mattr_accessor :actor, :activity_class
def self.fire(activity_type, options = {})
- options = options.reverse_merge(actor:@@actor, activity_type: activity_type)
- @@activity_class.create(options) if options[:actor] && @@activity_class
+ options = options.reverse_merge(actor:@actor, activity_type: activity_type)
+ @activity_class.try(:create, options) if options[:actor]
+ end
+
+ class << self
+ attr_accessor :actor, :activity_class
end
end
| Revert usage of class variables
Use class-level instance variables instead
|
diff --git a/app/models/photo.rb b/app/models/photo.rb
index abc1234..def5678 100644
--- a/app/models/photo.rb
+++ b/app/models/photo.rb
@@ -7,6 +7,7 @@ key :description, String
key :dimensions, Dimensions
key :etag, String
+ key :key, Key
key :last_modified, Time
key :orientation, Orientation
key :photographed_at, Time
@@ -39,6 +40,10 @@ end
alias :== :eql?
+ def key
+ Key.from_mongo super # mongo_mapper key type is misbehaving
+ end
+
def original
Original.find key
end
| Store Photo Key as key
Store Photo Key as key
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.