diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/lib/what_now.rb b/lib/what_now.rb
index abc1234..def5678 100644
--- a/lib/what_now.rb
+++ b/lib/what_now.rb
@@ -1,9 +1,7 @@ # What_now definitions
require 'ptools'
-
-# TODO this struct should know how to print itself
-Todo = Struct.new :text, :path, :line
+require 'todo'
module WhatNow
class << self
|
Replace local definition of todo by the one in external file
|
diff --git a/app/controllers/api/v1/geocoder_controller.rb b/app/controllers/api/v1/geocoder_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/api/v1/geocoder_controller.rb
+++ b/app/controllers/api/v1/geocoder_controller.rb
@@ -36,7 +36,7 @@ results = JSON.parse(response.body)['features']
if results
results.map { |l|
- {name: l['properties']['label'].gsub(/, Germany/, ''),
+ {name: l['properties']['label'].gsub(/, Germany|, Switzerland/, ''),
lat: l['geometry']['coordinates'][1],
lon: l['geometry']['coordinates'][0],
id: l['properties']['id'],
|
Remove country in search results for Switzerland as well.
|
diff --git a/app/controllers/users/passwords_controller.rb b/app/controllers/users/passwords_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/users/passwords_controller.rb
+++ b/app/controllers/users/passwords_controller.rb
@@ -1,3 +1,4 @@+# Password Controller
class Users::PasswordsController < Devise::PasswordsController
# GET /resource/password/new
# def new
|
Add class comment to password controller
|
diff --git a/app/serializers/book_collection_serializer.rb b/app/serializers/book_collection_serializer.rb
index abc1234..def5678 100644
--- a/app/serializers/book_collection_serializer.rb
+++ b/app/serializers/book_collection_serializer.rb
@@ -0,0 +1,3 @@+class BookCollectionSerializer < ActiveModel::Serializer
+ attributes :id, :title, :author, :publisher, :published_date, :description, :price, :isbn, :buy_link, :image_link
+end
|
Use book collection AMS to render json data for collection serializer
|
diff --git a/app/services/merge_requests/create_service.rb b/app/services/merge_requests/create_service.rb
index abc1234..def5678 100644
--- a/app/services/merge_requests/create_service.rb
+++ b/app/services/merge_requests/create_service.rb
@@ -1,11 +1,17 @@ module MergeRequests
class CreateService < MergeRequests::BaseService
def execute
+ # @project is used to determine whether the user can set the merge request's
+ # assignee, milestone and labels. Whether they can depends on their
+ # permissions on the target project.
+ source_project = @project
+ @project = Project.find(params[:target_project_id]) if params[:target_project_id]
+
filter_params
label_params = params[:label_ids]
merge_request = MergeRequest.new(params.except(:label_ids))
- merge_request.source_project = project
- merge_request.target_project ||= project
+ merge_request.source_project = source_project
+ merge_request.target_project ||= source_project
merge_request.author = current_user
if merge_request.save
|
Check permissions on target project in merge request create service.
|
diff --git a/app/services/projects/participants_service.rb b/app/services/projects/participants_service.rb
index abc1234..def5678 100644
--- a/app/services/projects/participants_service.rb
+++ b/app/services/projects/participants_service.rb
@@ -1,6 +1,7 @@ module Projects
class ParticipantsService < BaseService
def execute(note_type, note_id)
+ @target = get_target(note_type, note_id)
participating =
if note_type && note_id
participants_in(note_type, note_id)
@@ -8,35 +9,43 @@ []
end
project_members = sorted(project.team.members)
- participants = all_members + groups + project_members + participating
+ participants = target_owner + participating + all_members + groups + project_members
participants.uniq
end
+ def get_target(type, id)
+ case type
+ when "Issue"
+ project.issues.find_by_iid(id)
+ when "MergeRequest"
+ project.merge_requests.find_by_iid(id)
+ when "Commit"
+ project.commit(id)
+ end
+ end
+
+ def target_owner
+ [{
+ name: @target.author.name,
+ username: @target.author.username
+ }]
+ end
+
def participants_in(type, id)
- target =
- case type
- when "Issue"
- project.issues.find_by_iid(id)
- when "MergeRequest"
- project.merge_requests.find_by_iid(id)
- when "Commit"
- project.commit(id)
- end
-
- return [] unless target
+ return [] unless @target
- users = target.participants(current_user)
+ users = @target.participants(current_user)
sorted(users)
end
def sorted(users)
- users.uniq.to_a.compact.sort_by(&:username).map do |user|
+ users.uniq.to_a.compact.sort_by(&:username).map do |user|
{ username: user.username, name: user.name }
end
end
def groups
- current_user.authorized_groups.sort_by(&:path).map do |group|
+ current_user.authorized_groups.sort_by(&:path).map do |group|
count = group.users.count
{ username: group.path, name: group.name, count: count }
end
|
Put owner and participating people first
|
diff --git a/app/controllers/sprangular/products_controller.rb b/app/controllers/sprangular/products_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/sprangular/products_controller.rb
+++ b/app/controllers/sprangular/products_controller.rb
@@ -1,5 +1,9 @@ class Sprangular::ProductsController < Sprangular::BaseController
def index
+ if params[:taxon] && params[:taxon].to_i == 0
+ params[:taxon] = Spree::Taxon.find_by!(permalink: params[:taxon]).id
+ end
+
searcher = Spree::Config.searcher_class.new(params)
@products = searcher.retrieve_products
|
Update products/index to covert taxon permalink to id
|
diff --git a/JSPatch.podspec b/JSPatch.podspec
index abc1234..def5678 100644
--- a/JSPatch.podspec
+++ b/JSPatch.podspec
@@ -0,0 +1,33 @@+Pod::Spec.new do |s|
+ s.name = "JSPatch"
+ s.version = "0.0.1"
+ s.summary = "JSPatch bridge Objective-C and JavaScript using the" \
+ " Objective-C runtime. You can call any Objective-C class" \
+ " and method in JavaScript by just including a small engine."
+
+ s.description = <<-DESC
+ JSPatch bridge Objective-C and JavaScript using the
+ Objective-C runtime. You can call any Objective-C class and
+ method in JavaScript by just including a small engine.
+ That makes the APP obtain the power of script language:
+ add modules or replacing Objective-C codes to
+ fix bugs dynamically.
+ JSPatch is still in development,
+ welcome to improve the project together.
+ DESC
+
+ s.homepage = "https://github.com/bang590/JSPatch"
+ s.license = { :type => "MIT", :file => "LICENSE" }
+ s.author = { "bang" => "bang590@gmail.com" }
+ s.social_media_url = "http://twitter.com/bang590"
+
+ s.platform = :ios, "7.0"
+ s.source = { :git => "https://github.com/bang590/JSPatch.git", :tag => s.version }
+
+ s.source_files = "JSPath/*.{h,m}"
+ s.public_header_files = "JSPath/*..h"
+
+ s.resources = "JSPath/*.js"
+ s.frameworks = "JavaScriptCore", "Foundation"
+
+end
|
Add initial spec of CocoaPods.
|
diff --git a/lib/d-parse/dsl.rb b/lib/d-parse/dsl.rb
index abc1234..def5678 100644
--- a/lib/d-parse/dsl.rb
+++ b/lib/d-parse/dsl.rb
@@ -36,8 +36,8 @@ DParse::Parsers::Opt.new(p)
end
- def rename(p, message)
- DParse::Parsers::Rename.new(p, message)
+ def rename(p, name)
+ DParse::Parsers::Rename.new(p, name)
end
def repeat(p)
|
refactor(core): Use better name for rename argument in DSL
|
diff --git a/no-style-please.gemspec b/no-style-please.gemspec
index abc1234..def5678 100644
--- a/no-style-please.gemspec
+++ b/no-style-please.gemspec
@@ -2,7 +2,7 @@
Gem::Specification.new do |spec|
spec.name = "no-style-please"
- spec.version = "0.1.2"
+ spec.version = "0.1.3"
spec.authors = ["Riccardo Graziosi"]
spec.email = ["riccardo.graziosi97@gmail.com"]
|
Update gem version to 0.1.3
|
diff --git a/lib/bitcoin2graphdb/migration.rb b/lib/bitcoin2graphdb/migration.rb
index abc1234..def5678 100644
--- a/lib/bitcoin2graphdb/migration.rb
+++ b/lib/bitcoin2graphdb/migration.rb
@@ -8,8 +8,7 @@ c.extensions = config[:extensions] unless config[:extensions].nil?
end
Bitcoin2Graphdb::Bitcoin.provider = Bitcoin2Graphdb::Bitcoin::BlockchainProvider.new(config[:bitcoin])
- Neo4j::Session.open(:server_db, config[:neo4j][:server],
- {basic_auth: config[:neo4j][:basic_auth], initialize: {request: {open_timeout: 2, timeout: 600}}})
+ Neo4j::Session.open(:server_db, config[:neo4j][:server], {basic_auth: config[:neo4j][:basic_auth]})
end
def run
|
Revert neo4j request timeout setting
|
diff --git a/recipes/default.rb b/recipes/default.rb
index abc1234..def5678 100644
--- a/recipes/default.rb
+++ b/recipes/default.rb
@@ -2,9 +2,9 @@ begin
search('users-files', '*:*').each do |user|
user.to_hash['files'].each do |file, content|
- file "#{user}/#{file}" do
+ file "#{user.id}/#{file}" do
path lazy { File.join(node['etc']['passwd'][user.id]['dir'], file) }
- content content.join("\n")
+ content content.join("\n") << "\n"
owner user.id
group user.id
action :create_if_missing
|
Add a new line at the end of configuration files
|
diff --git a/recipes/default.rb b/recipes/default.rb
index abc1234..def5678 100644
--- a/recipes/default.rb
+++ b/recipes/default.rb
@@ -18,4 +18,15 @@ #
include_recipe 'coopr::repo'
+
+# Create our user and group
+group node['coopr']['group'] do
+ action :create
+end
+
+user node['coopr']['user'] do
+ action :create
+ gid node['coopr']['group']
+end
+
include_recipe 'coopr::config'
|
Create our Coopr user and group
|
diff --git a/lib/environment.rb b/lib/environment.rb
index abc1234..def5678 100644
--- a/lib/environment.rb
+++ b/lib/environment.rb
@@ -1,7 +1,7 @@ require 'sinatra'
module Grat
-
+ @@database_conf = {}
def self.root_path
File.dirname(File.dirname(__FILE__))
end
|
Make it a little easier to load up from irb
|
diff --git a/omniauth-oauth2.gemspec b/omniauth-oauth2.gemspec
index abc1234..def5678 100644
--- a/omniauth-oauth2.gemspec
+++ b/omniauth-oauth2.gemspec
@@ -3,7 +3,7 @@
Gem::Specification.new do |gem|
gem.add_dependency 'omniauth', '~> 1.0'
- gem.add_dependency 'oauth2', '~> 0.8.0'
+ gem.add_dependency 'oauth2', '~> 0.9.0'
gem.add_development_dependency 'rspec', '~> 2.7'
gem.add_development_dependency 'rack-test'
|
Update OAuth2 version dependency to 0.9.0
|
diff --git a/lib/inch_ci/worker/build_json.rb b/lib/inch_ci/worker/build_json.rb
index abc1234..def5678 100644
--- a/lib/inch_ci/worker/build_json.rb
+++ b/lib/inch_ci/worker/build_json.rb
@@ -11,7 +11,8 @@ attr_reader :language, :branch_name, :revision, :nwo, :url
def initialize(filename)
- @json = JSON[File.read(filename)]
+ contents = File.read(filename, :encoding => 'utf-8')
+ @json = JSON[contents]
@language = @json['language']
@branch_name = @json['branch_name'] || @json['travis_branch']
@revision = @json['revision'] || @json['travis_commit']
|
Read JSON dump as utf-8
|
diff --git a/lib/leaf/view_helpers/sinatra.rb b/lib/leaf/view_helpers/sinatra.rb
index abc1234..def5678 100644
--- a/lib/leaf/view_helpers/sinatra.rb
+++ b/lib/leaf/view_helpers/sinatra.rb
@@ -7,11 +7,11 @@ def url(page)
url = @template.request.url
if page == 1
- # strip out page param and trailing ? if it exists
- url.gsub(/page=[0-9]+/, '').gsub(/\?$/, '')
+ # strip out page param and trailing ? and & if they exists
+ url.gsub(/(\?|\&)page=[0-9]+/, '').gsub(/\?$/, '').gsub(/\&$/, '')
else
- if url =~ /page=[0-9]+/
- url.gsub(/page=[0-9]+/, "page=#{page}")
+ if url =~ /(\?|\&)page=[0-9]+/
+ url.gsub(/page=[0-9]+/, "page=#{page}").gsub(/\&+/, '&')
else
(url =~ /\?/) ? url + "&page=#{page}" : url + "?page=#{page}"
end
|
Include ? and & in the replacement of the page parameter
|
diff --git a/lib/panko/serializer_resolver.rb b/lib/panko/serializer_resolver.rb
index abc1234..def5678 100644
--- a/lib/panko/serializer_resolver.rb
+++ b/lib/panko/serializer_resolver.rb
@@ -1,5 +1,4 @@ # frozen_string_literal: true
-require "byebug"
class Panko::SerializerResolver
|
Remove byebug requirement from SerialResolver
|
diff --git a/lib/populator/adapters/sqlite.rb b/lib/populator/adapters/sqlite.rb
index abc1234..def5678 100644
--- a/lib/populator/adapters/sqlite.rb
+++ b/lib/populator/adapters/sqlite.rb
@@ -22,8 +22,7 @@ # TODO find a better way to load the SQLite adapter
module ActiveRecord # :nodoc: all
module ConnectionAdapters
- class SQLiteAdapter < ActiveRecord::ConnectionAdapters::AbstractAdapter
- include Populator::Adapters::Sqlite
+ class SQLiteAdapter
end
end
end
|
Break SQLite for great JRuby justice.
|
diff --git a/lib/ppcurses/window/pp_window.rb b/lib/ppcurses/window/pp_window.rb
index abc1234..def5678 100644
--- a/lib/ppcurses/window/pp_window.rb
+++ b/lib/ppcurses/window/pp_window.rb
@@ -11,6 +11,29 @@ box('|', '-')
end
+
+
+ # EXPERIMENTAL/HACK
+ #
+ # The following could be used to wrap all getch calls
+ # and support window resizes when the getch is blocking
+ # all threads.
+ #
+ def get_ch_handle_signals
+ got_input = false
+ until got_input
+ begin
+ c = getch
+ got_input = true
+ rescue NoMethodError
+ # Assuming a SIGWINCH occurred -- reposition..
+ c = ''
+ end
+ end
+
+ c
+ end
+
end
|
Add hack method to Window
|
diff --git a/test/unit/bundle_file_test.rb b/test/unit/bundle_file_test.rb
index abc1234..def5678 100644
--- a/test/unit/bundle_file_test.rb
+++ b/test/unit/bundle_file_test.rb
@@ -0,0 +1,57 @@+require 'support/test_case'
+require 'support/fixture_config'
+require 'jekyll/minibundle/bundle_file'
+
+module Jekyll::Minibundle::Test
+ class BundleFileTest < TestCase
+ include FixtureConfig
+
+ def test_consistent_fingerprint_in_file_and_markup
+ with_site do
+ with_env 'JEKYLL_MINIBUNDLE_CMD_JS' => cmd_to_remove_comments_and_count do
+ bundle_file = BundleFile.new({
+ 'type' => :js,
+ 'site_dir' => '.',
+ 'source_dir' => JS_BUNDLE_SOURCE_DIR,
+ 'assets' => %w{dependency app},
+ 'destination_path' => JS_BUNDLE_DESTINATION_PATH,
+ 'attributes' => {}
+ })
+ source = source_path JS_BUNDLE_SOURCE_DIR, 'app.js'
+ old_destination = destination_path EXPECTED_JS_BUNDLE_PATH
+ org_markup, last_markup = nil
+
+ capture_io do
+ org_markup = bundle_file.markup
+ bundle_file.write '_site'
+ end
+
+ org_mtime = mtime_of old_destination
+
+ assert_equal 1, get_cmd_count
+
+ last_markup = bundle_file.markup
+ ensure_file_mtime_changes { File.write source, '(function() {})()' }
+ bundle_file.write '_site'
+
+ # preserve fingerprint and content seen in last markup phase
+ assert_equal org_markup, last_markup
+ assert_equal org_mtime, mtime_of(old_destination)
+ assert_equal 1, get_cmd_count
+
+ capture_io do
+ last_markup = bundle_file.markup
+ bundle_file.write '_site'
+ end
+
+ new_destination = destination_path 'assets/site-375a0b430b0c5555d0edd2205d26c04d.js'
+
+ # see updated fingerprint in the next round
+ refute_equal org_markup, last_markup
+ assert_operator mtime_of(new_destination), :>, org_mtime
+ assert_equal 2, get_cmd_count
+ end
+ end
+ end
+ end
+end
|
Add test for BundleFile's behavior in markup and write phases
|
diff --git a/lib/models/page.rb b/lib/models/page.rb
index abc1234..def5678 100644
--- a/lib/models/page.rb
+++ b/lib/models/page.rb
@@ -1,6 +1,6 @@ class Page < Sequel::Model
def before_create
- self.slug = self.title.gsub(/[^\w\s\d]/, '').gsub(' ', '_')
+ self.slug = self.title.gsub(/[^\d\w\sÅÄÖåäö_:-]/i, '').gsub(' ', '_')
end
def before_save
|
Use old regexp for slug
|
diff --git a/lib/pdf/invoice.rb b/lib/pdf/invoice.rb
index abc1234..def5678 100644
--- a/lib/pdf/invoice.rb
+++ b/lib/pdf/invoice.rb
@@ -27,6 +27,10 @@ end
class RenderingController < ApplicationController
+ def initialize
+ super
+ set_resolver
+ end
attr_accessor :order
end
|
Use custom view resolvers in PDF
|
diff --git a/site.rb b/site.rb
index abc1234..def5678 100644
--- a/site.rb
+++ b/site.rb
@@ -7,19 +7,19 @@ get '/' do
@page_title = 'Home'
@page_id = 'index'
- erb :'index'
+ erb :index
end
get '/projects' do
@page_title = 'Projects'
@page_id = 'projects'
- erb :'projects'
+ erb :projects
end
get '/skills' do
@page_title = 'Skills'
@page_id = 'skills'
- erb :'skills'
+ erb :skills
end
not_found do
|
Use symbols without quotes where possible
|
diff --git a/spec/lib/i18n/hygiene/wrapper_spec.rb b/spec/lib/i18n/hygiene/wrapper_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/i18n/hygiene/wrapper_spec.rb
+++ b/spec/lib/i18n/hygiene/wrapper_spec.rb
@@ -5,7 +5,9 @@ let(:wrapper) { I18n::Hygiene::Wrapper.new(keys_to_skip: []) }
before do
- ::I18n.backend.send(:store_translations, :en, abuse_report: { button: { submit: "x" }})
+ [:en, :fr, :es].each do |locale|
+ ::I18n.backend.send(:store_translations, locale, abuse_report: { button: { submit: "x" }})
+ end
end
describe '#keys_to_check' do
@@ -15,22 +17,14 @@ end
describe '#locales' do
- it 'includes expected locales' do
- [:en].each do |locale|
- expect(wrapper.locales).to include(locale)
- end
+ it 'includes all locales by default' do
+ expect(wrapper.locales).to eq [:en, :fr, :es]
end
context 'provided locales' do
let(:wrapper) { I18n::Hygiene::Wrapper.new(locales: [:en, :fr]) }
- before do
- [:fr, :es].each do |locale|
- ::I18n.backend.send(:store_translations, locale, abuse_report: { button: { submit: "x" }})
- end
- end
-
- it "includes only locales filtered by provided" do
+ it "includes only locales provided" do
expect(wrapper.locales).to eq [:en, :fr]
end
end
|
Expand Wrapper specs to exercise default locales more
|
diff --git a/spec/method_profiler/profiler_spec.rb b/spec/method_profiler/profiler_spec.rb
index abc1234..def5678 100644
--- a/spec/method_profiler/profiler_spec.rb
+++ b/spec/method_profiler/profiler_spec.rb
@@ -11,27 +11,27 @@ petition.should_not respond_to(:foo_with_profiling_with_profiling)
end
- it "class methods should properly return values" do
+ it "returns correct values for class methods" do
Petition.guys.should == "sup"
end
- it "instance method should properly return values" do
+ it "returns correct values for instance methods" do
petition.baz.should == "blah"
end
- it "method_with_implicit_block" do
+ it "yields to implicit blocks" do
petition.method_with_implicit_block {|v| v }.should == "implicit"
end
- it "method_with_explicit_block" do
+ it "calls explicit blocks" do
petition.method_with_explicit_block {|v| v }.should == "explicit"
end
- it "method_with_implicit_block_and_args" do
+ it "yields to implicit blocks with arguments" do
petition.method_with_implicit_block_and_args(1,2,3) {|v| v }.should == [1,2,3]
end
- it "method_with_explicit_block_and_args" do
+ it "calls explicit blocks with arguments" do
petition.method_with_explicit_block_and_args(1,2,3) {|v| v }.should == [1,2,3]
end
|
Use imperative phrasing for examples.
|
diff --git a/spec/models/lesson_completion_spec.rb b/spec/models/lesson_completion_spec.rb
index abc1234..def5678 100644
--- a/spec/models/lesson_completion_spec.rb
+++ b/spec/models/lesson_completion_spec.rb
@@ -2,24 +2,22 @@
describe LessonCompletion do
- let!(:user){ FactoryGirl.create(:user) }
- let!(:lesson){ FactoryGirl.create(:lesson) }
+ let!(:user) { double("User", :id => 1) }
+ let!(:lesson){ double("Lessons", :id => 1) }
subject(:lesson_completion) { LessonCompletion.new(
:student_id => user.id,
:lesson_id => lesson.id
- )}
+ )}
+ it { is_expected.to be_valid }
it { is_expected.to respond_to(:student) }
it { is_expected.to respond_to(:lesson) }
- it { is_expected.to be_valid }
-
- context "when lesson and student are duplicated" do
- before do
- LessonCompletion.create(:student_id => user.id, :lesson_id => lesson.id)
- end
- it { is_expected.not_to be_valid }
- end
+ it { is_expected.to validate_presence_of(:student_id) }
+ it { is_expected.to validate_presence_of(:lesson_id) }
+ it { is_expected.to validate_uniqueness_of(:student_id).scoped_to(:lesson_id) }
+ it { is_expected.to belong_to(:student) }
+ it { is_expected.to belong_to(:lesson) }
# Also test that they delete when the lesson or user are deleted?
|
Refactor lesson completion model spec file
Addresses Issue 262
I replaced the two FactoryGirl variables with doubles, added shoulda matchers to test the validations and associations, and removed the last test. I did not address the existing comment about testing that the lesson completion is deleted when a lesson or user is deleted—slightly beyond my scope of knowledge.
|
diff --git a/solo.rb b/solo.rb
index abc1234..def5678 100644
--- a/solo.rb
+++ b/solo.rb
@@ -1,7 +1,9 @@+require 'fileutils'
root = File.expand_path(File.dirname(__FILE__))
cookbook_path root + '/cookbooks'
data_bag_path '/etc/chef/databags'
log_level :debug
log_location '/var/log/chef/solo.log'
+FileUtils.mkdir_p File.dirname(log_location)
verbose_logging true
|
Create log dir if missing
|
diff --git a/lib/paylane/api.rb b/lib/paylane/api.rb
index abc1234..def5678 100644
--- a/lib/paylane/api.rb
+++ b/lib/paylane/api.rb
@@ -5,45 +5,39 @@ end
def multi_sale(params)
- do_request(:multiSale, params, 'multi_sale_params')
- .to_hash[:multi_sale_response][:response]
+ do_request(:multiSale, params, 'multi_sale_params')[:multi_sale_response][:response]
end
def capture_sale(params)
- do_request(:captureSale, params)
- .to_hash[:capture_sale_response][:response]
+ do_request(:captureSale, params)[:capture_sale_response][:response]
end
def close_sale_authorization(params)
- do_request(:closeSaleAuthorization, params)
- .to_hash[:close_sale_authorization_response][:response]
+ do_request(:closeSaleAuthorization, params)[:close_sale_authorization_response][:response]
end
def refund(params)
- do_request(:refund, params)
- .to_hash[:refund_response][:response]
+ do_request(:refund, params)[:refund_response][:response]
end
def resale(params)
- do_request(:resale, params)
- .to_hash[:resale_response][:response]
+ do_request(:resale, params)[:resale_response][:response]
end
def get_sale_result(params)
- do_request(:getSaleResult, params)
- .to_hash[:get_sale_result_response][:response]
+ do_request(:getSaleResult, params)[:get_sale_result_response][:response]
end
def check_sales(params)
- do_request(:checkSales, params, 'check_sales_params')
- .to_hash[:check_sales_response][:check_sales_response]
+ do_request(:checkSales, params, 'check_sales_params')[:check_sales_response][:check_sales_response]
end
private
def do_request(method, params, params_prefix = nil)
body = params_prefix ? {params_prefix => params} : params
- @client.request(method) { soap.body = body }
+ soap_response = @client.request(method) { soap.body = body }
+ soap_response.to_hash
end
end
end
|
Move to_hash to do_request method
|
diff --git a/spec/session/remote_mechanize_spec.rb b/spec/session/remote_mechanize_spec.rb
index abc1234..def5678 100644
--- a/spec/session/remote_mechanize_spec.rb
+++ b/spec/session/remote_mechanize_spec.rb
@@ -35,7 +35,7 @@ end
end
- # Pending: Still 18 failing tests here (result is 705 examples, 18 failures, instead of 384 examples)
+ # Pending: Still 16 failing tests here (result is 706 examples, 16 failures, instead of 385 examples)
# it_should_behave_like "session"
it_should_behave_like "session without javascript support"
|
Update status of pending remote session specs
|
diff --git a/lib/reports_kit.rb b/lib/reports_kit.rb
index abc1234..def5678 100644
--- a/lib/reports_kit.rb
+++ b/lib/reports_kit.rb
@@ -1,10 +1,35 @@ require 'rails/all'
-directory = File.dirname(File.absolute_path(__FILE__))
-Dir.glob("#{directory}/reports_kit/*.rb") { |file| require file }
-Dir.glob("#{directory}/reports_kit/reports/data/*.rb") { |file| require file }
-Dir.glob("#{directory}/reports_kit/reports/filter_types/*.rb") { |file| require file }
-Dir.glob("#{directory}/reports_kit/reports/*.rb") { |file| require file }
+require 'reports_kit/base_controller'
+require 'reports_kit/configuration'
+require 'reports_kit/engine'
+require 'reports_kit/helper'
+require 'reports_kit/model'
+require 'reports_kit/model_configuration'
+require 'reports_kit/rails'
+require 'reports_kit/report_builder'
+require 'reports_kit/resources_controller'
+require 'reports_kit/reports_controller'
+require 'reports_kit/version'
+
+require 'reports_kit/reports/data/chart_options'
+require 'reports_kit/reports/data/generate'
+require 'reports_kit/reports/data/one_dimension'
+require 'reports_kit/reports/data/two_dimensions'
+require 'reports_kit/reports/data/utils'
+
+require 'reports_kit/reports/filter_types/base'
+require 'reports_kit/reports/filter_types/boolean'
+require 'reports_kit/reports/filter_types/datetime'
+require 'reports_kit/reports/filter_types/number'
+require 'reports_kit/reports/filter_types/records'
+require 'reports_kit/reports/filter_types/string'
+
+require 'reports_kit/reports/dimension'
+require 'reports_kit/reports/filter'
+require 'reports_kit/reports/generate_autocomplete_results'
+require 'reports_kit/reports/inferrable_configuration'
+require 'reports_kit/reports/measure'
module ReportsKit
def self.configure
|
Use explicit requires to prevent indeterministic loading
|
diff --git a/lib/resque_unit.rb b/lib/resque_unit.rb
index abc1234..def5678 100644
--- a/lib/resque_unit.rb
+++ b/lib/resque_unit.rb
@@ -17,6 +17,10 @@ Test::Unit::TestCase.send(:include, ResqueUnit::Assertions)
end
-if defined?(MiniTest)
+if defined?(MiniTest::Unit::TestCase)
MiniTest::Unit::TestCase.send(:include, ResqueUnit::Assertions)
end
+
+if defined?(Minitest::Test)
+ Minitest::Test.send(:include, ResqueUnit::Assertions)
+end
|
Support renamed module and class in Minitest 5
|
diff --git a/lib/rom/mapping.rb b/lib/rom/mapping.rb
index abc1234..def5678 100644
--- a/lib/rom/mapping.rb
+++ b/lib/rom/mapping.rb
@@ -7,14 +7,14 @@ attr_reader :env, :registry, :model
# @api public
- def self.build(env, &block)
- new(env, &block).registry
+ def self.build(env, registry = {}, &block)
+ new(env, registry, &block).registry
end
# @api private
- def initialize(env, &block)
+ def initialize(env, registry, &block)
@env = env
- @registry = {}
+ @registry = registry
instance_eval(&block)
end
|
Add ability to inject the registry into Mapping.build
|
diff --git a/lib/second_mate.rb b/lib/second_mate.rb
index abc1234..def5678 100644
--- a/lib/second_mate.rb
+++ b/lib/second_mate.rb
@@ -13,8 +13,8 @@ # Ease access to @config
if @config[m.to_sym]
@config[m.to_sym]
- elsif @config[m.chomp('=').to_sym]
- @config[m.chomp('=').to_sym] = attrs[0]
+ elsif @config[m.to_s.chomp('=').to_sym]
+ @config[m.to_s.chomp('=').to_sym] = attrs[0]
else
super
end
|
Add precautionary conversion in config handling
|
diff --git a/lib/tasks/app.rake b/lib/tasks/app.rake
index abc1234..def5678 100644
--- a/lib/tasks/app.rake
+++ b/lib/tasks/app.rake
@@ -2,7 +2,7 @@ desc "Load database from csv file"
task :load => :environment do
CsvReader.load_csv("data/Kat Szum sales summary.csv") do |hash|
- receipt = Receipt.find_or_create_by(code: hash["TransRefCode"], date: hash["TransDate"])
+ receipt = Receipt.find_or_create_by(code: hash["TransRefCode"], date: Date.parse(hash["TransDate"]))
product = Product.find_or_create_by(stock_code: hash["StockCode"], description: hash["StockDesc"])
LineItem.find_or_create_by(receipt: receipt, product: product,
line_no: hash["DetailNo"], quantity: hash["LineQty"], total_ex_gst: hash["LineTotalExGST"],
|
Stop multiple copies of a single receipt
|
diff --git a/lib/todo_finder.rb b/lib/todo_finder.rb
index abc1234..def5678 100644
--- a/lib/todo_finder.rb
+++ b/lib/todo_finder.rb
@@ -4,6 +4,8 @@ module TodoFinder
class Finder
attr_accessor :matches
+
+ TODO_REGEX = /(\*|\/\/|#)\s*\[?todo(\]|:| \-)\s+/i
def initialize
@matches = Hash.new { |h,k| h[k]=[] }
@@ -17,7 +19,7 @@ all_files.each do |file_name|
File.open(file_name, :encoding => 'ISO-8859-1') do |file|
file.each_with_index do |line, i|
- @matches[file_name] << [i + 1, line] if line =~ /TODO/
+ @matches[file_name] << [i + 1, line] if line =~ TODO_REGEX
end
end
end
@@ -33,7 +35,7 @@
lines.each do |i, line|
line_num = i.to_s.green
- formatted_line = line.sub(/(\*|\/\/|#)\s+?TODO:/, '')
+ formatted_line = line.sub(TODO_REGEX, '')
puts " - [#{line_num}] " << formatted_line.strip
end
|
Support other ways of writing TODO messages
Adds:
* TODO - blah blah blah
* [todo] blah blah blah
Also pulled the regex out into a class-level global and used it for
both the match and sub. Should also be easier to test it now.
|
diff --git a/lib/tasks/release.rake b/lib/tasks/release.rake
index abc1234..def5678 100644
--- a/lib/tasks/release.rake
+++ b/lib/tasks/release.rake
@@ -0,0 +1,49 @@+namespace :release do
+ desc "Add header of now version release to Changelog and bump up version"
+ task :prepare do
+ raise "Use this task in development only" unless Rails.env.development?
+
+ # detect merged PR
+ now_version = FluentdUI::VERSION
+ pr_numbers = `git log v#{now_version}..master --oneline`.scan(/#[0-9]+/)
+
+ if !$?.success? || pr_numbers.empty?
+ puts "Detecting PR failed. Please confirm if any PR were merged after the latest release."
+ exit(false)
+ end
+
+ # Generate new version
+ /\.([0-9]+)\z/.match(now_version)
+ now_revision = $1
+ new_version = now_version.gsub(/\.#{now_revision}\z/, ".#{now_revision.to_i + 1}")
+
+ # Update Changelog
+ changelog_filename = Rails.root.join('Changelog')
+ changelog = File.read(changelog_filename)
+
+ pr_descriptions = pr_numbers.map do |number|
+ "* [] #{number} https://github.com/fluent/fluentd-ui/pull/#{number.gsub('#', '')}"
+ end.join("\n")
+
+ new_changelog = <<-HEADER
+Release #{new_version} - #{Time.now.strftime("%Y/%m/%d")}
+#{pr_descriptions}
+
+#{changelog.chomp}
+HEADER
+
+ File.open(changelog_filename, "w") {|f| f.write(new_changelog)}
+
+ # Update version.rb
+ version_filename = Rails.root.join("lib", "fluentd-ui", "version.rb")
+ version_class = File.read(version_filename)
+ new_version_class = version_class.gsub(/VERSION = \"#{now_version}\"/, "VERSION = \"#{new_version}\"")
+
+ File.open(version_filename, 'w') {|f| f.write(new_version_class)}
+
+ # Update Gemfile.lock
+ system("bundle install")
+
+ puts 'Changelog, verion and Gemfile.lock is updated. New version is #{new_version}.'
+ end
+end
|
Add task to prepare releasing
This task updated Changelog, version.rb, and Gemfile.lock.
|
diff --git a/lib/wheels/response.rb b/lib/wheels/response.rb
index abc1234..def5678 100644
--- a/lib/wheels/response.rb
+++ b/lib/wheels/response.rb
@@ -28,9 +28,9 @@ puts view.to_s(layout)
end
- def redirect(url)
+ def redirect(url, params = nil)
self.status = 303
- self.headers = { "Location" => url }
+ self.headers = { "Location" => (params ? "#{url}?#{Rack::Utils::build_query(params)}" : url) }
self.string = ""
self
end
|
Add query-string params to redirect.
|
diff --git a/license_finder.gemspec b/license_finder.gemspec
index abc1234..def5678 100644
--- a/license_finder.gemspec
+++ b/license_finder.gemspec
@@ -1,7 +1,7 @@ Gem::Specification.new do |s|
s.name = "license_finder"
s.version = "0.5.0"
- s.authors = ["Jacob Maine", "Matthew Kane Parker", "Ian Lesperance", "David Edwards"]
+ s.authors = ["Jacob Maine", "Matthew Kane Parker", "Ian Lesperance", "David Edwards", "Paul Meskers"]
s.email = ["brent@pivotalabs.com"]
s.homepage = "https://github.com/pivotal/LicenseFinder"
s.summary = "Know your dependencies - and the licenses they are binding your application to."
|
Add Paul to the "authors" stanza in gemspec
|
diff --git a/rainbow.gemspec b/rainbow.gemspec
index abc1234..def5678 100644
--- a/rainbow.gemspec
+++ b/rainbow.gemspec
@@ -21,5 +21,4 @@ spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "rake"
spec.add_development_dependency "rspec"
- spec.add_development_dependency 'mime-types', '< 2.0.0' if RUBY_VERSION < "1.9.0"
end
|
Remove mime-types deve dependency from gemspec
|
diff --git a/test/record_test.rb b/test/record_test.rb
index abc1234..def5678 100644
--- a/test/record_test.rb
+++ b/test/record_test.rb
@@ -33,4 +33,13 @@ assert(!@record.effective_dated?)
end
end
+
+ def test_not_effective_dated_model
+ @record.stub(:keys, ["blah", "meh"]) do
+ model = @record.to_model
+ assert(model.class != NilClass)
+ assert_equal(Class, model.class)
+ assert(PeoplesoftModels::Base, model.class.superclass)
+ end
+ end
end
|
Add test demonstrating bug fixed in 90a0f8
|
diff --git a/test/test_helper.rb b/test/test_helper.rb
index abc1234..def5678 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -4,7 +4,7 @@ require 'plugin_test_helper'
# Run the migrations
-ActiveRecord::Migrator.migrate("#{RAILS_ROOT}/db/migrate")
+ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate")
# Mixin the factory helper
require File.expand_path("#{File.dirname(__FILE__)}/factory")
|
Use Rails.root instead of RAILS_ROOT in preparation for the Rails 2.1 release
|
diff --git a/test/test_helper.rb b/test/test_helper.rb
index abc1234..def5678 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -4,7 +4,7 @@
class ActiveSupport::TestCase
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
- fixtures :all
+ #fixtures :all
# Add more helper methods to be used by all tests here...
end
|
Remove fixtures from testing environment
|
diff --git a/test/test_helper.rb b/test/test_helper.rb
index abc1234..def5678 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -11,4 +11,17 @@ ActiveRecord::Base.configurations = YAML::load(File.open(File.join(TEST_ROOT, 'database.yml')))
ActiveRecord::Base.establish_connection(:alter_table_test)
+# Cribbed from Rails tests
+ActiveRecord::Base.connection.class.class_eval do
+ IGNORED_SQL = [/^PRAGMA/, /^SELECT currval/, /^SELECT CAST/, /^SELECT @@IDENTITY/, /^SELECT @@ROWCOUNT/, /^SAVEPOINT/, /^ROLLBACK TO SAVEPOINT/, /^RELEASE SAVEPOINT/, /SHOW FIELDS/]
+
+ def execute_with_query_record(sql, name = nil, &block)
+ $queries_executed ||= []
+ $queries_executed << sql unless IGNORED_SQL.any? { |r| sql =~ r }
+ execute_without_query_record(sql, name, &block)
+ end
+
+ alias_method_chain :execute, :query_record
+end
+
require File.join(TEST_ROOT, '../init')
|
Add query-counting helper code from Rails
|
diff --git a/build.rb b/build.rb
index abc1234..def5678 100644
--- a/build.rb
+++ b/build.rb
@@ -0,0 +1,70 @@+#!/usr/bin/env ruby
+
+require 'aws-sdk'
+AWS.config access_key_id: ENV['S3_ACCESS_ID'], secret_access_key: ENV['S3_SECRET_KEY']
+s3 = AWS::S3.new
+bucket = s3.buckets['zooniverse-demo']
+
+build = <<-BASH
+rm -rf build
+cp -R public pre_build_public
+cp -RL public build_public
+rm -rf public
+mv build_public public
+echo 'Building...'
+hem build
+mv public build
+mv pre_build_public public
+BASH
+
+timestamp = `date -u +%Y-%m-%d_%H-%M-%S`.chomp
+
+compress = <<-BASH
+echo 'Compressing...'
+
+timestamp=#{ timestamp }
+
+mv build/application.js "build/application-$timestamp.js"
+mv build/application.css "build/application-$timestamp.css"
+rm build/application.css
+
+BASH
+
+system build
+system compress
+
+index = File.read 'build/index.html'
+index.gsub! 'application.js', "application-#{ timestamp }.js"
+index.gsub! 'application.css', "application-#{ timestamp }.css"
+File.open('build/index.html', 'w'){ |f| f.puts index }
+
+working_directory = Dir.pwd
+Dir.chdir 'build'
+to_upload = Dir['**/*'].reject{ |path| File.directory? path }
+to_upload.delete 'index.html'
+to_upload << 'index.html'
+total = to_upload.length
+
+to_upload.each.with_index do |file, index|
+ content_type = case File.extname(file)
+ when '.html'
+ 'text/html'
+ when '.js'
+ 'application/javascript'
+ when '.css'
+ 'text/css'
+ when '.gz'
+ 'application/x-gzip'
+ when '.ico'
+ 'image/x-ico'
+ else
+ `file --mime-type -b #{ file }`.chomp
+ end
+
+ puts "#{ '%2d' % (index + 1) } / #{ '%2d' % total }: Uploading #{ file } as #{ content_type }"
+ bucket.objects["mars/#{file}"].write file: file, acl: :public_read, content_type: content_type
+end
+
+Dir.chdir working_directory
+`rm -rf build`
+puts 'Done!'
|
Copy over deploy script for now
|
diff --git a/Marshal.podspec b/Marshal.podspec
index abc1234..def5678 100644
--- a/Marshal.podspec
+++ b/Marshal.podspec
@@ -1,6 +1,6 @@ Pod::Spec.new do |s|
s.name = "Marshal"
- s.version = "1.2.1"
+ s.version = "1.2.3"
s.summary = "Marshal is a simple, lightweight framework for safely extracting values from [String: AnyObject]"
s.description = <<-DESC
In Swift, we all deal with JSON, plists, and various forms of [String: Any]. Marshal believes you don't need a Ph.D. in monads or magic mirrors to deal with these in an expressive and type safe way. Marshal will help you write declarative, performant, error handled code using the power of Protocol Oriented Programming™.
@@ -13,7 +13,7 @@ s.tvos.deployment_target = "9.0"
s.watchos.deployment_target = "2.0"
s.source = { :git => "https://github.com/utahiosmac/Marshal.git",
- :tag => "v" + s.version.to_s }
+ :tag => "#{s.version}" }
s.source_files = "Marshal/**/*.swift", "Sources/**/*.swift"
s.requires_arc = true
s.module_name = "Marshal"
|
Update podspec to newest release
Updates podspec to newest release, and also fixes which tag it looks for in source.
|
diff --git a/lib/everything/blog/site.rb b/lib/everything/blog/site.rb
index abc1234..def5678 100644
--- a/lib/everything/blog/site.rb
+++ b/lib/everything/blog/site.rb
@@ -26,6 +26,9 @@ FileUtils.mkdir_p(self.class.blog_html_path)
page = Page.new(post)
+
+ return true unless ::File.exist?(page.page_file_path)
+
page_mtime = ::File.mtime(page.page_file_path)
markdown_mtime = ::File.mtime(post.piece.full_path)
|
Handle when piece doesn't exist yet
|
diff --git a/lib/generative/rake_task.rb b/lib/generative/rake_task.rb
index abc1234..def5678 100644
--- a/lib/generative/rake_task.rb
+++ b/lib/generative/rake_task.rb
@@ -4,7 +4,7 @@ module Generative
class RakeTask < RSpec::Core::RakeTask
def initialize(*args, &task_block)
- setup_ivars(args)
+ super
self.name = :generative if name == :spec
|
Use super instead of setup_ivars for Rake task
|
diff --git a/lib/jiraSOAP/JIRAservice.rb b/lib/jiraSOAP/JIRAservice.rb
index abc1234..def5678 100644
--- a/lib/jiraSOAP/JIRAservice.rb
+++ b/lib/jiraSOAP/JIRAservice.rb
@@ -3,11 +3,9 @@ include RemoteAPI
attr_reader :authToken
- attr_accessor :log
- def self.instanceAtURL(url, user, password, logLevel = Logger::WARN)
+ def self.instanceAtURL(url, user, password)
jira = JIRAService.new url
- jira.log.level = logLevel
jira.login user, password
jira
end
@@ -22,8 +20,6 @@ :version => 2
}
self.class.endpoint endpoint_data
-
- @log = Logger.new STDOUT
end
#PONDER: a finalizer that will try to logout
|
Remove logging stuff from the JIRAService class
There is a logger ivar already in the Handsoap::Service class that will be used later on.
|
diff --git a/core/array/fixtures/classes.rb b/core/array/fixtures/classes.rb
index abc1234..def5678 100644
--- a/core/array/fixtures/classes.rb
+++ b/core/array/fixtures/classes.rb
@@ -1,10 +1,22 @@ module ArraySpecs
- def self.max_32bit_size
- 2**32/4
+ not_compliant_on :rubinius do
+ def self.max_32bit_size
+ 2**32/4
+ end
+
+ def self.max_64bit_size
+ 2**64/8
+ end
end
- def self.max_64bit_size
- 2**64/8
+ deviates_on :rubinius do
+ def self.max_32bit_size
+ 2**30-1
+ end
+
+ def self.max_64bit_size
+ 2**62-1
+ end
end
def self.frozen_array
|
Add Array bounds values specific to Rubinius.
|
diff --git a/lib/lanes/api/test_specs.rb b/lib/lanes/api/test_specs.rb
index abc1234..def5678 100644
--- a/lib/lanes/api/test_specs.rb
+++ b/lib/lanes/api/test_specs.rb
@@ -1,4 +1,5 @@ require 'jasmine-core'
+require 'lanes/command'
module Lanes
module API
@@ -6,8 +7,9 @@ class TestSpecs
cattr_accessor :current
- def initialize(root)
- @root = root
+ attr_accessor :extension
+ def initialize(ext)
+ @extension = ext
end
def css_files
@@ -18,13 +20,13 @@ urlpath(Jasmine::Core.js_files) +
urlpath(Jasmine::Core.boot_files) +
urlpath(spec_files("helpers")) +
- urlpath(spec_files("client"))
+ urlpath(spec_files(extension.identifier))
end
private
def spec_files(path)
- dir = @root.join("spec")
+ dir = extension.root_path.join("spec")
regex = /^#{dir}\//
Dir.glob( dir.join(path,"**/*.{coffee,js}") ).map do |file|
file.sub(regex,'').sub(/coffee$/,'js')
@@ -37,11 +39,10 @@ end
- Lanes.config.get(:specs_root) do | root |
- TestSpecs.current = TestSpecs.new(root)
- Root.sprockets.append_path(root.join("spec"))
- end
-
+ ext = Lanes::Command.load_current_extension
+ TestSpecs.current = TestSpecs.new(ext)
+ Root.sprockets.append_path(ext.root_path.join("spec"))
+
Root.sprockets.append_path(Jasmine::Core.path)
|
Use command code to load current ext
|
diff --git a/lib/locations/repository.rb b/lib/locations/repository.rb
index abc1234..def5678 100644
--- a/lib/locations/repository.rb
+++ b/lib/locations/repository.rb
@@ -1,9 +1,7 @@-require 'open-uri'
-
module Locations
class Repository
def initialize(geo_json_path_or_url = Locations.geo_json_path_or_url)
- json = open(geo_json_path_or_url).read
+ json = Reader.new(geo_json_path_or_url).call
features = RGeo::GeoJSON.decode(json, json_parser: :json)
self.locations = map_features(features)
|
Use the caching JSON reader
|
diff --git a/lib/roqua/healthy/errors.rb b/lib/roqua/healthy/errors.rb
index abc1234..def5678 100644
--- a/lib/roqua/healthy/errors.rb
+++ b/lib/roqua/healthy/errors.rb
@@ -1,16 +1,19 @@ module Roqua
module Healthy
- class UnknownFailure < StandardError; end
- class IllegalMirthResponse < StandardError; end
- class PatientIdNotInRemote < StandardError; end
- class Timeout < StandardError; end
- class HostUnreachable < StandardError; end
- class ConnectionRefused < StandardError; end
+ class Error < StandardError; end
+ class ConnectionError < Error; end
+
+ class IllegalMirthResponse < ConnectionError; end
+ class Timeout < ConnectionError; end
+ class HostUnreachable < ConnectionError; end
+ class ConnectionRefused < ConnectionError; end
- class PatientNotFound < StandardError; end
+ class UnknownFailure < Error; end
+ class PatientIdNotInRemote < Error; end
+ class PatientNotFound < Error; end
module MirthErrors
- class WrongPatient < StandardError; end
+ class WrongPatient < Error; end
end
end
-end+end
|
Introduce base classes for exceptions
|
diff --git a/with_model.gemspec b/with_model.gemspec
index abc1234..def5678 100644
--- a/with_model.gemspec
+++ b/with_model.gemspec
@@ -6,8 +6,8 @@ s.name = "with_model"
s.version = WithModel::VERSION
s.platform = Gem::Platform::RUBY
- s.authors = ["Case Commons, LLC"]
- s.email = ["casecommons-dev@googlegroups.com"]
+ s.authors = ["Case Commons, LLC", "Grant Hutchins"]
+ s.email = ["casecommons-dev@googlegroups.com", "gems@nertzy.com"]
s.homepage = "https://github.com/Casecommons/with_model"
s.summary = %q{Dynamically build a model within an Rspec context}
s.description = s.summary
|
Add myself to the authors
|
diff --git a/lib/sprockets-derailleur.rb b/lib/sprockets-derailleur.rb
index abc1234..def5678 100644
--- a/lib/sprockets-derailleur.rb
+++ b/lib/sprockets-derailleur.rb
@@ -4,14 +4,14 @@
module SpeedUp
def self.logger
- SpeedUp.get_logger
+ @logger ||= SpeedUp.get_logger
end
def self.get_logger
- return @logger if @logger
- @logger = Logging.logger(STDOUT)
+ logger = Logging.logger(STDOUT)
logger_level = ENV["LOGGER_LEVEL"] ? ENV["LOGGER_LEVEL"].to_sym : :warn
- @logger.level = logger_level
+ logger.level = logger_level
+ logger
end
end
|
Update for default return path of logger
|
diff --git a/version_kit.gemspec b/version_kit.gemspec
index abc1234..def5678 100644
--- a/version_kit.gemspec
+++ b/version_kit.gemspec
@@ -18,6 +18,6 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]
- spec.add_development_dependency "bundler", "~> 1.6"
+ spec.add_development_dependency "bundler", "~> 1.5"
spec.add_development_dependency "rake"
end
|
[Gemspec] Reduce required bundler version for Travis
|
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -20,11 +20,12 @@
# Use this with <%= image_tag avatar_url(user) %>.
def avatar_url(user)
- default_url = "#{request.env["HTTP_HOST"]}/#{image_path('guest.jpg')}"
+ default_url = "http://#{request.env["HTTP_HOST"]}#{image_path('guest.jpg')}"
gravatar_id = Digest::MD5.hexdigest(user.email.downcase)
- url = "http://gravatar.com/avatar/#{gravatar_id}.png?s=48&d=#{CGI.escape(default_url)}"
+ #url = "http://gravatar.com/avatar/#{gravatar_id}"
+ url = "http://gravatar.com/avatar/#{gravatar_id}?s=48&d=#{CGI.escape(default_url)}"
end
end
# default_url = "#{root_url}images/guest.png"
-# url = "http://gravatar.com/avatar/#{gravatar_id}.png?s=48&d=#{CGI.escape(default_url)}"+# url = "http://gravatar.com/avatar/#{gravatar_id}.png?s=48&d=#{CGI.escape(default_url)}"
|
Update the gravitar helper to properly call the avatar hash
|
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -18,6 +18,7 @@ {
success: 'alert-success',
error: 'alert-danger',
+ warning: 'alert-warning',
alert: 'alert-warning',
notice: 'alert-info',
}[flash_type.to_sym] || flash_type.to_s
|
Add `warning` as acceptable flash key for alerts
|
diff --git a/app/observers/project_observer.rb b/app/observers/project_observer.rb
index abc1234..def5678 100644
--- a/app/observers/project_observer.rb
+++ b/app/observers/project_observer.rb
@@ -13,6 +13,10 @@ def after_update(project)
project.send_move_instructions if project.namespace_id_changed?
project.rename_repo if project.path_changed?
+ end
+
+ def before_destroy(project)
+ project.repository.expire_cache unless project.empty_repo?
end
def after_destroy(project)
|
Remove project cache before project.destroy
|
diff --git a/ellen-slack.gemspec b/ellen-slack.gemspec
index abc1234..def5678 100644
--- a/ellen-slack.gemspec
+++ b/ellen-slack.gemspec
@@ -16,6 +16,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]
+ spec.add_dependency "ellen", ">= 0.2.0"
spec.add_dependency "zircon", ">= 0.0.8"
spec.add_development_dependency "bundler", "~> 1.6"
spec.add_development_dependency "rake"
|
Fix ellen version to 0.2.0 or higher
|
diff --git a/recipes/module_igbinary.rb b/recipes/module_igbinary.rb
index abc1234..def5678 100644
--- a/recipes/module_igbinary.rb
+++ b/recipes/module_igbinary.rb
@@ -0,0 +1,42 @@+# encoding: utf-8
+#
+# Author:: Joshua Timberman (<joshua@opscode.com>)
+# Author:: Seth Chisamore (<schisamo@opscode.com>)
+# Author:: TranceLove (airwave209gt@gmail.com)
+# Cookbook Name:: chefphp
+# Recipe:: module_igbinary
+#
+# Copyright 2009-2011, Opscode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+php_pear 'igbinary' do
+ action :install
+end
+
+template "#{node['php']['ext_conf_dir']}/igbinary.ini" do
+ only_if { platform?('ubuntu') && node['platform_version'].to_f >= 12.04 && ::File.exists?('/usr/sbin/php5enmod') }
+ source 'extension.ini.erb'
+ owner 'root'
+ group 'root'
+ mode 00644
+ variables({
+ :name => 'igbinary',
+ :directives => {}
+ })
+end
+
+execute '/usr/sbin/php5enmod igbinary' do
+ only_if { platform?('ubuntu') && node['platform_version'].to_f >= 12.04 && ::File.exists?('/usr/sbin/php5enmod') }
+end
|
Add recipe for installing igbinary module
|
diff --git a/rmagick.gemspec b/rmagick.gemspec
index abc1234..def5678 100644
--- a/rmagick.gemspec
+++ b/rmagick.gemspec
@@ -1,13 +1,14 @@ require 'date'
Gem::Specification.new do |s|
s.name = %q{rmagick}
- s.version = "2.13.2"
+ s.version = "2.13.3.rc1"
s.date = Date.today.to_s
s.summary = %q{Ruby binding to ImageMagick}
s.description = %q{RMagick is an interface between Ruby and ImageMagick.}
s.authors = [%q{Tim Hunter}, %q{Omer Bar-or}, %q{Benjamin Thomas}, %q{Moncef Maiza}]
+ s.post_install_message = "Please report any bugs. This bugfix release may contain bugs. See https://github.com/rmagick/rmagick/compare/RMagick_2-13-2...master and https://github.com/rmagick/rmagick/issues/18"
s.email = %q{rmagick@rubyforge.org}
- s.homepage = %q{http://rubyforge.org/projects/rmagick}
+ s.homepage = %q{https://github.com/rmagick/rmagick}
s.license = 'MIT'
s.files = Dir.glob('**/*')
s.bindir = 'bin'
|
Update gemspec for 2.13.3.rc1 release
|
diff --git a/db/migrate/20150714024130_drop_invalid_actions.rb b/db/migrate/20150714024130_drop_invalid_actions.rb
index abc1234..def5678 100644
--- a/db/migrate/20150714024130_drop_invalid_actions.rb
+++ b/db/migrate/20150714024130_drop_invalid_actions.rb
@@ -1,7 +1,18 @@ class DropInvalidActions < ActiveRecord::Migration
def up
- Action.where(card:nil).each(&:destroy)
- Action.where(game:nil).each(&:destroy)
- Action.where(player:nil).each(&:destroy)
+ #Action.where(card:nil).each(&:destroy)
+ #Action.where(game:nil).each(&:destroy)
+ #Action.where(player:nil).each(&:destroy)
+
+ execute <<-ENDSQL
+ DELETE FROM actions
+ WHERE card_id IS NULL
+ OR game_id IS NULL
+ OR player_id IS NULL
+ ENDSQL
+ end
+
+ def down
+ raise ActiveRecord::IrreversibleMigration
end
end
|
Remove dependence on Action model from migration
|
diff --git a/week-4/simple-string.rb b/week-4/simple-string.rb
index abc1234..def5678 100644
--- a/week-4/simple-string.rb
+++ b/week-4/simple-string.rb
@@ -0,0 +1,28 @@+# Solution Below
+
+old_string = 'Ruby is cool'
+new_string = old_string.reverse.upcase
+
+
+# RSpec Tests. They are included in this file because the local variables you are creating are not accessible across files. If we try to run these files as a separate file per normal operation, the local variable checks will return nil.
+
+
+describe "old_string" do
+ it 'is defined as a local variable' do
+ expect(defined?(old_string)).to eq 'local-variable'
+ end
+
+ it "has the value 'Ruby is cool'" do
+ expect(old_string).to eq "Ruby is cool"
+ end
+end
+
+describe 'new_string' do
+ it 'is defined as a local variable' do
+ expect(defined?(new_string)).to eq 'local-variable'
+ end
+
+ it 'has the value "LOOC SI YBUR"' do
+ expect(new_string).to eq "LOOC SI YBUR"
+ end
+end
|
Complete 4.2.2 - Simple String Methods
|
diff --git a/populus.gemspec b/populus.gemspec
index abc1234..def5678 100644
--- a/populus.gemspec
+++ b/populus.gemspec
@@ -18,7 +18,7 @@ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]
- spec.add_dependency "sshkit"
+ spec.add_dependency "specinfra"
spec.add_dependency "colorize"
spec.add_dependency "slack-notifier"
|
Revert "Use sshkit rather than specinfra..."
This reverts commit 807af31e9f3a1425c09b3226d464ffbfe09a23d0.
|
diff --git a/lib/doc_to_dash/parsers/yard_parser.rb b/lib/doc_to_dash/parsers/yard_parser.rb
index abc1234..def5678 100644
--- a/lib/doc_to_dash/parsers/yard_parser.rb
+++ b/lib/doc_to_dash/parsers/yard_parser.rb
@@ -15,7 +15,7 @@ classes_html = Nokogiri::HTML(classes_file)
classes = []
- classes_html.xpath('//li').children.select{|c| c.name == "span"}.each do |method|
+ classes_html.css('span.object_link').each do |method|
a = method.children.first
title = a.children.first.to_s.gsub('#', '')
href = a["href"].to_s
@@ -31,7 +31,7 @@ methods_html = Nokogiri::HTML(methods_file)
methods = []
- methods_html.xpath('//li').children.select{|c| c.name == "span"}.each do |method|
+ methods_html.css('span.object_link').each do |method|
a = method.children.first
href = a["href"].to_s
name = a["title"].to_s.gsub(/\((.+)\)/, '').strip! # Strip the (ClassName) and whitespace.
@@ -42,4 +42,4 @@ methods
end
end
-end+end
|
Fix 0.9.0 breaking YARD change
>= 0.9.0 in YARD version changes the DOM structure of the templates
which broke the nokogiri finder. This results in the docset being
empty, changing the nokogiri the finder fixes the problem. This change
also should be backwards compatible because the tag is still present in
older versions.
https://github.com/lsegal/yard/commit/be17c0fec5022d20dce9f239b06d3055b588be0d
|
diff --git a/plantfood.rb b/plantfood.rb
index abc1234..def5678 100644
--- a/plantfood.rb
+++ b/plantfood.rb
@@ -12,7 +12,15 @@
elephant_watering_can_volume_oz = 16 * 5
-growing_food_tsp_per_gal = { :big_bloom => 6, :grow_big => 3, :tiger_bloom => 2 }
+# growing
+# acidic
+# neutralize with ~40 drops of pH UP (blue)
+growing_food_tsp_per_gal = { :big_bloom => 6, :grow_big => 3 }
+
+# flowering
+# very acidic
+# neutralize with ~75 drops of pH UP (blue)
+#growing_food_tsp_per_gal = { :big_bloom => 3, :grow_big => 2, :tiger_bloom => 2 }
food_total_tsp = {}
growing_food_tsp_per_gal.each_pair do |food_type, food_tsp|
|
Add vegetative recipe; add pH hints
|
diff --git a/lib/rack/simple_user_agent/detector.rb b/lib/rack/simple_user_agent/detector.rb
index abc1234..def5678 100644
--- a/lib/rack/simple_user_agent/detector.rb
+++ b/lib/rack/simple_user_agent/detector.rb
@@ -6,15 +6,15 @@ end
def from_iphone?
- user_agent.include?("iPhone")
+ user_agent.to_s.include?("iPhone")
end
def from_ipad?
- user_agent.include?("iPad")
+ user_agent.to_s.include?("iPad")
end
def from_ipod?
- user_agent.include?("iPod")
+ user_agent.to_s.include?("iPod")
end
def from_ios?
@@ -22,7 +22,7 @@ end
def from_android?
- user_agent.include?("Android")
+ user_agent.to_s.include?("Android")
end
def from_android_tablet?
@@ -34,7 +34,7 @@ end
def from_windows_phone?
- user_agent.include?("Windows Phone OS")
+ user_agent.to_s.include?("Windows Phone OS")
end
private
|
Add to_s since user_agent might be nil
|
diff --git a/poof.gemspec b/poof.gemspec
index abc1234..def5678 100644
--- a/poof.gemspec
+++ b/poof.gemspec
@@ -11,7 +11,7 @@ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.homepage =
'https://github.com/Referly/poof'
- s.add_runtime_dependency "activerecord", ">= 4.1.5"
+ s.add_runtime_dependency "activerecord", "~> 4.1", ">= 4.1.5"
s.add_development_dependency "rake", "~> 10.3"
s.add_development_dependency "simplecov", "~> 0.10"
s.add_development_dependency "yard", "~> 0.8"
|
Update gemspec - removed open ended dependency
|
diff --git a/recipes/install.rb b/recipes/install.rb
index abc1234..def5678 100644
--- a/recipes/install.rb
+++ b/recipes/install.rb
@@ -13,6 +13,7 @@ mkdir -p #{install['extracted_path']}
tar xzf #{install['download_path']} -C #{install['extract_path']}
mv #{install['extracted_path']}/#{install['extracted_bin']} #{bin_file}
+ rm -rf #{install['download_path']} #{install['extracted_path']}
EOH
not_if { ::File.exists?(bin_file) }
end
|
Add file cleanup to extract resource
|
diff --git a/recipes/service.rb b/recipes/service.rb
index abc1234..def5678 100644
--- a/recipes/service.rb
+++ b/recipes/service.rb
@@ -9,7 +9,7 @@ # Overwrite the unicorn restart command declared elsewhere
# Apologies for the `sleep`, but monit errors with "Other action already in progress" on some boots.
execute "restart Rails app #{application}" do
- command "sleep 300 && #{node[:sidekiq][application][:restart_command]}"
+ command node[:sidekiq][application][:restart_command]
action :nothing
end
|
Remove sleep while restarting Rails
|
diff --git a/optional/capi/false_spec.rb b/optional/capi/false_spec.rb
index abc1234..def5678 100644
--- a/optional/capi/false_spec.rb
+++ b/optional/capi/false_spec.rb
@@ -13,7 +13,7 @@ end
end
- describe "a false value from Qtrue" do
+ describe "a false value from Qfalse" do
it "is falsey in C" do
@b.is_true(@b.q_false).should == 2
end
|
Fix typo in spec description
|
diff --git a/lib/dm-predefined/yard/handlers/ruby/predefine_handler.rb b/lib/dm-predefined/yard/handlers/ruby/predefine_handler.rb
index abc1234..def5678 100644
--- a/lib/dm-predefined/yard/handlers/ruby/predefine_handler.rb
+++ b/lib/dm-predefined/yard/handlers/ruby/predefine_handler.rb
@@ -9,7 +9,6 @@
def process
nobj = namespace
- mscope = scope
name = if statement.type == :predefine
statement.jump(:ident, :op, :kw, :const).source
elsif statement.call?
@@ -23,7 +22,7 @@ end
end
- register MethodObject.new(nobj, name, mscope) do |o|
+ register MethodObject.new(nobj, name, :class) do |o|
o.visibility = :public
o.source = statement.source
o.signature = "def #{nobj}.#{name}"
|
Define the methods as :class methods.
|
diff --git a/Rakefile.rb b/Rakefile.rb
index abc1234..def5678 100644
--- a/Rakefile.rb
+++ b/Rakefile.rb
@@ -8,4 +8,47 @@ desc "Build Jekyll site with _drafts posts"
task :drafts do
system "jekyll build --drafts --limit_posts 10"
-end # task :drafts+end # task :drafts
+
+# Ping Pingomatic
+desc 'Ping pingomatic'
+task :pingomatic do
+ begin
+ require 'xmlrpc/client'
+ puts '* Pinging ping-o-matic'
+ XMLRPC::Client.new('rpc.pingomatic.com', '/').call('weblogUpdates.extendedPing', 'mademistakes.com' , 'http://mademistakes.com', 'http://mademistakes.com/atom.xml')
+ rescue LoadError
+ puts '! Could not ping ping-o-matic, because XMLRPC::Client could not be found.'
+ end
+end
+
+# Ping Google
+desc 'Notify Google of the new sitemap'
+task :sitemapgoogle do
+ begin
+ require 'net/http'
+ require 'uri'
+ puts '* Pinging Google about our sitemap'
+ Net::HTTP.get('www.google.com', '/webmasters/tools/ping?sitemap=' + URI.escape('http://mademistakes.com/sitemap.xml'))
+ rescue LoadError
+ puts '! Could not ping Google about our sitemap, because Net::HTTP or URI could not be found.'
+ end
+end
+
+# Ping Bing
+desc 'Notify Bing of the new sitemap'
+task :sitemapbing do
+ begin
+ require 'net/http'
+ require 'uri'
+ puts '* Pinging Bing about our sitemap'
+ Net::HTTP.get('www.bing.com', '/webmaster/ping.aspx?siteMap=' + URI.escape('http://mademistakes.com/sitemap.xml'))
+ rescue LoadError
+ puts '! Could not ping Bing about our sitemap, because Net::HTTP or URI could not be found.'
+ end
+end
+
+# rake notify
+desc "Notify various services about new content"
+task :notify => [:pingomatic, :sitemapgoogle, :sitemapbing] do
+end
|
Add RSS and sitemap ping Rake task
|
diff --git a/core/lib/rom/relation/wrap.rb b/core/lib/rom/relation/wrap.rb
index abc1234..def5678 100644
--- a/core/lib/rom/relation/wrap.rb
+++ b/core/lib/rom/relation/wrap.rb
@@ -6,18 +6,6 @@ #
# @api public
class Wrap < Graph
- extend Initializer
-
- include Materializable
- include Pipeline
- include Pipeline::Proxy
-
- param :root
- param :nodes
-
- alias_method :left, :root
- alias_method :right, :nodes
-
# @api public
def wrap(*args)
self.class.new(root, nodes + root.wrap(*args).nodes)
|
Simplify Relation::Wrap since now it inherits from Graph
|
diff --git a/spec/celluloid/io/udp_socket_spec.rb b/spec/celluloid/io/udp_socket_spec.rb
index abc1234..def5678 100644
--- a/spec/celluloid/io/udp_socket_spec.rb
+++ b/spec/celluloid/io/udp_socket_spec.rb
@@ -16,8 +16,10 @@ end
it "sends and receives packets" do
- subject.send payload, 0, example_addr, example_port
- subject.recvfrom(payload.size).first.should == payload
+ within_io_actor do
+ subject.send payload, 0, example_addr, example_port
+ subject.recvfrom(payload.size).first.should == payload
+ end
end
end
|
Add missing within_io_actor block from UDPSocket spec
|
diff --git a/spec/models/location/address_spec.rb b/spec/models/location/address_spec.rb
index abc1234..def5678 100644
--- a/spec/models/location/address_spec.rb
+++ b/spec/models/location/address_spec.rb
@@ -2,6 +2,8 @@
module Location
describe Address do
- pending "add some examples to (or delete) #{__FILE__}"
+ it { should belong_to(:district) }
+ it { should belong_to(:city) }
+ it { should belong_to(:state) }
end
end
|
Add basic tests for Address
|
diff --git a/param_test.gemspec b/param_test.gemspec
index abc1234..def5678 100644
--- a/param_test.gemspec
+++ b/param_test.gemspec
@@ -1,6 +1,6 @@ Gem::Specification.new do |s|
s.name = 'param_test'
- s.version = '0.0.1beta'
+ s.version = '0.0.1'
s.platform = Gem::Platform::RUBY
s.authors = ['Nik Haldimann']
s.email = ['nhaldimann@gmail.com']
|
Update from beta to final first version
|
diff --git a/bxamp.gemspec b/bxamp.gemspec
index abc1234..def5678 100644
--- a/bxamp.gemspec
+++ b/bxamp.gemspec
@@ -16,4 +16,10 @@ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.require_paths = ["lib"]
+
+ gem.add_development_dependency 'rspec'
+ gem.add_development_dependency 'guard'
+ gem.add_development_dependency 'guard-rspec'
+ gem.add_development_dependency 'libnotify'
+ gem.add_development_dependency 'rb-inotify'
end
|
Add development dependencies to gemspec
|
diff --git a/ruby-s3cmd.gemspec b/ruby-s3cmd.gemspec
index abc1234..def5678 100644
--- a/ruby-s3cmd.gemspec
+++ b/ruby-s3cmd.gemspec
@@ -1,6 +1,6 @@ Gem::Specification.new do |s|
s.name = %q{ruby-s3cmd}
- s.version = "0.1.3"
+ s.version = RubyS3Cmd::VERSION::STRING
s.date = %q{2012-06-13}
s.authors = ["Joel Bryan Juliano"]
s.email = %q{joelbryan.juliano@gmail.com}
|
Use ::VERSION::STRING for gemspec version.
|
diff --git a/plugins/system/check-ntp.rb b/plugins/system/check-ntp.rb
index abc1234..def5678 100644
--- a/plugins/system/check-ntp.rb
+++ b/plugins/system/check-ntp.rb
@@ -1,6 +1,8 @@ #!/usr/bin/env ruby
#
# Check NTP offset - yeah this is horrible.
+#
+# warning and critical values are offsets in milliseconds.
#
require 'rubygems' if RUBY_VERSION < '1.9.0'
|
Document warn and critical units
|
diff --git a/spec/acceptance/class_spec.rb b/spec/acceptance/class_spec.rb
index abc1234..def5678 100644
--- a/spec/acceptance/class_spec.rb
+++ b/spec/acceptance/class_spec.rb
@@ -20,7 +20,52 @@
describe service('sks') do
it { should be_enabled }
- it { should be_running }
+ end
+ end
+
+ context 'non-default parameters' do
+ it 'should work with no errors' do
+ pp = <<-EOS
+ class { 'sks':
+ recon_address => ['10.10.10.10', '10.20.10.10'],
+ hkp_address => ['10.10.10.10', '10.20.10.10'],
+ members => [{
+ hostname => 'sks.example.net',
+ keyid => '0xFEEDBEEF',
+ },{
+ hostname => 'sks.example.org',
+ email => 'oscar@example.org',
+ keyid => '0xABCDFE98',
+ },{
+ hostname => 'sks.example.com',
+ },{
+ hostname => 'keyserver.example.net',
+ port => '11371',
+ admin => 'John Doe',
+ email => 'jdoe@example.com',
+ keyid => '0xDEADBEEF',
+ },{
+ hostname => 'keyserver.example.org',
+ admin => 'Jane Doe',
+ },{
+ hostname => 'keyserver.example.com',
+ admin => 'J Edgar Hoover',
+ keyid => '0x01234567',
+ }],
+ }
+ EOS
+
+ # Run it twice and test for idempotency
+ expect(apply_manifest(pp).exit_code).to_not eq(1)
+ expect(apply_manifest(pp).exit_code).to eq(0)
+ end
+
+ describe package('sks') do
+ it { should be_installed }
+ end
+
+ describe service('sks') do
+ it { should be_enabled }
end
end
end
|
Update Beaker acceptance test spec
|
diff --git a/spec/curriculum_vitae_spec.rb b/spec/curriculum_vitae_spec.rb
index abc1234..def5678 100644
--- a/spec/curriculum_vitae_spec.rb
+++ b/spec/curriculum_vitae_spec.rb
@@ -6,14 +6,14 @@ end
context '.build' do
+ let(:blokk) { -> { infinite 'joy' } }
+
it 'passes block to `Builder.build`' do
- expect(CurriculumVitae::Builder).to receive(:build).and_call_original
-
- result = subject.build do
- code 'Red'
+ expect(CurriculumVitae::Builder).to receive(:build) do |_, &block|
+ expect(blokk).to be(block)
end
- expect(result).to eq(code: 'Red')
+ subject.build(&blokk)
end
end
end
|
Update spec to do exactly what the description says
|
diff --git a/spec/forgery/monetary_spec.rb b/spec/forgery/monetary_spec.rb
index abc1234..def5678 100644
--- a/spec/forgery/monetary_spec.rb
+++ b/spec/forgery/monetary_spec.rb
@@ -1,14 +1,14 @@+# frozen_string_literal: true
+
require 'spec_helper'
require 'bigdecimal'
describe Forgery::Monetary do
-
- it "should return random number string" do
+ it 'should return random number string' do
expect(Forgery(:monetary).money).to match(/^[\d+\.]+$/)
end
- it "should return random number respecting min and max parameters" do
- expect(BigDecimal.new(Forgery(:monetary).money({:min => 10, :max => 20}))).to be_between(10, 20)
+ it 'should return random number respecting min and max parameters' do
+ expect(BigDecimal(Forgery(:monetary).money({ min: 10, max: 20 }))).to be_between(10, 20)
end
-
end
|
Fix broken test on Ruby 2
|
diff --git a/spec/index_controller_spec.rb b/spec/index_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/index_controller_spec.rb
+++ b/spec/index_controller_spec.rb
@@ -0,0 +1,30 @@+require 'spec_helper'
+
+describe "IndexController (this is a skeleton controller test!)" do
+
+ describe 'get all bands' do
+ it 'should see all bands' do
+ get "/bands"
+ expect(last_response).to be_ok
+ end
+ end
+
+ describe 'create a new band' do
+ band_name = 'chromatics'
+ new_params = {
+ name: band_name
+ }
+ new_session = {
+ 'rack.session' => {
+ # Could preload stuff into the session here...
+ }
+ }
+ it 'should add a new band' do
+ expect{
+ post('/bands', new_params, new_session)
+ }.to change(Band, :count).by(1)
+ last_response.should be_ok
+ last_response.body.should == band_name
+ end
+ end
+end
|
Add Rspec controller test skeleton
|
diff --git a/flickr-objects.gemspec b/flickr-objects.gemspec
index abc1234..def5678 100644
--- a/flickr-objects.gemspec
+++ b/flickr-objects.gemspec
@@ -15,7 +15,7 @@ gem.authors = ["Janko Marohnić"]
gem.email = ["janko.marohnic@gmail.com"]
- gem.files = Dir["README.md", "LICENSE.txt", "lib/**/*"]
+ gem.files = Dir["README.md", "LICENSE", "lib/**/*"]
gem.require_path = "lib"
gem.required_ruby_version = ">= 1.9.2"
|
Fix a typo in the gemspec
|
diff --git a/neighborly-balanced-creditcard.gemspec b/neighborly-balanced-creditcard.gemspec
index abc1234..def5678 100644
--- a/neighborly-balanced-creditcard.gemspec
+++ b/neighborly-balanced-creditcard.gemspec
@@ -20,8 +20,6 @@
spec.add_dependency 'neighborly-balanced', '~> 0'
- spec.add_development_dependency 'bundler', '~> 1.4'
- spec.add_development_dependency 'rake', '~> 0'
- spec.add_development_dependency 'rails'
+ spec.add_dependency 'rails'
spec.add_development_dependency 'rspec-rails'
end
|
Change gem dependencies to get Rake to work
|
diff --git a/rails_wink.gemspec b/rails_wink.gemspec
index abc1234..def5678 100644
--- a/rails_wink.gemspec
+++ b/rails_wink.gemspec
@@ -15,7 +15,7 @@ Originally written for PHP by Denim&Steel, this is a Rails 3 mountable engine that can be used as part of any Rails application.
}
- s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"]
+ s.files = Dir["{app,config,db,lib}/**/*"] + ["LICENSE", "Rakefile", "README.md"]
s.add_dependency "rails", "~> 3.2.3"
end
|
Fix gem build errors in gemspec.
|
diff --git a/recipes/default.rb b/recipes/default.rb
index abc1234..def5678 100644
--- a/recipes/default.rb
+++ b/recipes/default.rb
@@ -6,7 +6,7 @@
execute 'Compile, install and clean freeimage' do
cwd Chef::Config[:file_cache_path]
- command "unzip freeimage.zip && cd FreeImage && make && make install && make clean"
+ command "unzip freeimage.zip && cd FreeImage && make && make install && make clean && ldconfig"
action :nothing
subscribes :run, 'remote_file[freeimage.zip]', :immediately
end
|
Update library cache after install.
|
diff --git a/DCViewController.podspec b/DCViewController.podspec
index abc1234..def5678 100644
--- a/DCViewController.podspec
+++ b/DCViewController.podspec
@@ -1,7 +1,7 @@ Pod::Spec.new do |s|
s.name = "DCViewController"
- s.version = "1.1"
+ s.version = "1.1.1"
s.summary = "Some extension for UIViewController"
s.homepage = "https://github.com/Tangdixi/DCViewController"
@@ -17,7 +17,7 @@
s.source = {
:git => "https://github.com/Tangdixi/DCViewController.git",
- :tag => "1.1"
+ :tag => "1.1.1"
}
s.source_files = 'DCViewController/*.{h,m}'
|
Update Cocoa Podspec to 1.1.1 - Jun 27, 2015 1:17 AM
|
diff --git a/sidetiq.gemspec b/sidetiq.gemspec
index abc1234..def5678 100644
--- a/sidetiq.gemspec
+++ b/sidetiq.gemspec
@@ -8,7 +8,7 @@ gem.version = Sidetiq::VERSION::STRING
gem.authors = ["Tobias Svensson"]
gem.email = ["tob@tobiassvensson.co.uk"]
- gem.description = "High-resolution job scheduler for Sidekiq"
+ gem.description = "Recurring jobs for Sidekiq"
gem.summary = gem.description
gem.homepage = "http://github.com/tobiassvn/sidetiq"
gem.license = "MIT"
|
Use a more descriptive/humble description in gemspec.
|
diff --git a/lib/filters/normalize_links.rb b/lib/filters/normalize_links.rb
index abc1234..def5678 100644
--- a/lib/filters/normalize_links.rb
+++ b/lib/filters/normalize_links.rb
@@ -1,6 +1,7 @@ # encoding: utf-8
require 'nokogiri'
+require 'uri'
class NormalizeLinks < ::Nanoc::Filter
identifier :normalize_links
@@ -18,7 +19,7 @@ when link['href'].start_with?('/')
# TODO(ts): It's not guaranteed that a repository is hosted on Github.
github_link_to(link['href'], config)
- when link['href'].include?('.md')
+ when link['href'].include?('.md') && !URI.parse(link['href']).absolute?
relative_link_to(link['href'])
else
link['href']
|
Fix absolute links to markdown pages in repo docs
Absolute links to markdown pages should not be rendered relative.
Fixes prometheus/prometheus#4627
Signed-off-by: Tobias Schmidt <25d72cd05b750b8e431a98389fb858a4199d229b@gmail.com>
|
diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb
index abc1234..def5678 100644
--- a/spec/dummy/config/application.rb
+++ b/spec/dummy/config/application.rb
@@ -25,8 +25,10 @@ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
+ if Rails.version =~ /\A4\.2\./
# Do not swallow errors in after_commit/after_rollback callbacks.
config.active_record.raise_in_transactional_callbacks = true
+ end
end
end
|
Set raise_in_transactional_callbacks on rails-4.2.x only
|
diff --git a/lib/generators/notifications/install_generator.rb b/lib/generators/notifications/install_generator.rb
index abc1234..def5678 100644
--- a/lib/generators/notifications/install_generator.rb
+++ b/lib/generators/notifications/install_generator.rb
@@ -30,7 +30,7 @@ end
def add_migrations
- `rake notifications:install:migrations`
+ exec('rake notifications:install:migrations')
end
end
end
|
Use exec to run migrations install
|
diff --git a/BHCDatabase/app/models/question.rb b/BHCDatabase/app/models/question.rb
index abc1234..def5678 100644
--- a/BHCDatabase/app/models/question.rb
+++ b/BHCDatabase/app/models/question.rb
@@ -1,2 +1,7 @@ class Question < ApplicationRecord
+
+ validates :question, presence: true, length: {maximum: 255}
+ validates :visible, presence: true, inclusion: {in: [true, false]}
+ validates :sort, presence: true, numericality: {only_integer: true, greater_than_or_equal_to: 0}
+ validates :multiple_choice, presence: true, inclusion: {in: [true, false]}
end
|
Add Active Record validations to Question model.
|
diff --git a/snapsearch.gemspec b/snapsearch.gemspec
index abc1234..def5678 100644
--- a/snapsearch.gemspec
+++ b/snapsearch.gemspec
@@ -22,7 +22,7 @@ s.version = Pathname.glob('VERSION*').first.read rescue '0.0.0'
s.description = s.summary
s.require_paths = ['lib']
- s.files = Dir['{{Rake,Gem}file{.lock,},README*,VERSION,LICENSE,*.gemspec,{lib,bin,examples,spec,test}/**/*}']
+ s.files = Dir['{{Rake,Gem}file{.lock,},README*,VERSION,LICENSE,*.gemspec,{lib,bin,examples,data,spec,test}/**/*}']
s.test_files = Dir['{examples,spec,test}/**/*']
end
|
Add data directory to the gemspec
|
diff --git a/features/step_definitions/see_within_steps.rb b/features/step_definitions/see_within_steps.rb
index abc1234..def5678 100644
--- a/features/step_definitions/see_within_steps.rb
+++ b/features/step_definitions/see_within_steps.rb
@@ -7,7 +7,11 @@ each do |within, selector|
Then /^(?:|I )should( not)? see "([^\"]*)" #{within}$/ do |negate, text|
with_scope(selector) do
- assert page['innerHTML'].include?(text)
+ if content = page['innerHTML']
+ assert negate ? !content.include?(text) : content.include?(text)
+ else
+ Then %(I should#{negate} see "#{text}")
+ end
end
end
end
|
Use innerHTML where possible in see within steps
otherwise use I should see.
Properly negate clause.
|
diff --git a/Casks/iterm2-beta.rb b/Casks/iterm2-beta.rb
index abc1234..def5678 100644
--- a/Casks/iterm2-beta.rb
+++ b/Casks/iterm2-beta.rb
@@ -1,12 +1,13 @@ cask :v1 => 'iterm2-beta' do
- version '2.9.20150830'
- sha256 '3248adc0281c03d5d367e042bcc373ae673bf5eea55fe181169e5824c8379e42'
+ version '2.9.20151001'
+ sha256 '0bfb7fa52a69103f2d1779b3c0af9f443dbd5a249ea83f522a452d84dd605b23'
- url 'https://iterm2.com/downloads/beta/iTerm2-2_9_20150830.zip'
+ url 'https://iterm2.com/downloads/beta/iTerm2-2_9_20151001.zip'
+ name 'iTerm2'
homepage 'https://www.iterm2.com/'
license :gpl
app 'iTerm.app'
-
+
zap :delete => '~/Library/Preferences/com.googlecode.iterm2.plist'
end
|
Upgrade iTerm2 Beta to v2.9.20151001
|
diff --git a/cookbooks/wt_heatmaps/metadata.rb b/cookbooks/wt_heatmaps/metadata.rb
index abc1234..def5678 100644
--- a/cookbooks/wt_heatmaps/metadata.rb
+++ b/cookbooks/wt_heatmaps/metadata.rb
@@ -3,7 +3,7 @@ license "Apache 2.0"
description "Installs heatmaps 0.8.0"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
-version "0.10.5"
+version "0.10.4"
recipe "apiserver", "Installs heatmaps apiserver"
recipe "mapred", "Installs heatmaps mapreduce scripts"
|
Make heat maps recipe version 0.10.4 so we can apply it in production
Former-commit-id: c6b9ee0d107d7fbed63c1c6bb95879de297697eb [formerly fe758180d49f32049942d79387278b1da2ede8e2] [formerly 7c5c3e4b194fa805d926e91e91b568c482e9191a [formerly a537ba0d9de7b3486690452d9f3d57539f78afaf]]
Former-commit-id: 5b9ba16bc0cbc0d199b7bf9067339d61f6d0c80b [formerly 07caca461061c4b8feb6c4b72f1ff351778c8f40]
Former-commit-id: d25fc4811b912751cf6a4a12478e41bcec6407f3
|
diff --git a/source/feed.xml.builder b/source/feed.xml.builder
index abc1234..def5678 100644
--- a/source/feed.xml.builder
+++ b/source/feed.xml.builder
@@ -1,14 +1,19 @@ xml.instruct!
-xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
+xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xml:lang" => "en-GB" do
site_url = site_root_uri
xml.title blog_title
xml.subtitle blog_subtitle
xml.id URI.join(site_url, blog.options.prefix.to_s)
xml.link "href" => URI.join(site_url, blog.options.prefix.to_s)
xml.link "href" => URI.join(site_url, current_page.path), "rel" => "self"
+ xml.rights "© " + blog_author + " 2014-" + Time.now.utc.strftime("%Y")
xml.updated(blog.articles.first.date.to_time.iso8601) unless blog.articles.empty?
- xml.author { xml.name blog_author }
-
+ xml.author do
+ xml.name blog_author
+ xml.uri "https://martincostello.com"
+ xml.email "martin@martincostello.com"
+ end
+
blog.articles[0..5].each do |article|
xml.entry do
xml.title article.title
|
Add more fields to Atom feed XML.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.