diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/lib/globalize/active_record/translation.rb b/lib/globalize/active_record/translation.rb
index abc1234..def5678 100644
--- a/lib/globalize/active_record/translation.rb
+++ b/lib/globalize/active_record/translation.rb
@@ -2,6 +2,12 @@ module ActiveRecord
class Translation < ::ActiveRecord::Base
class << self
+ # Sometimes ActiveRecord queries .table_exists? before the table name
+ # has even been set which results in catastrophic failure.
+ def table_exists?
+ table_name.present? && super
+ end
+
def with_locales(*locales)
# Avoid using "IN" with SQL queries when only using one locale.
locales = locales.flatten.map(&:to_s)
|
Fix cases in rbx + mysql where .table_exists? is called on the virtual model before it even has a table name.
|
diff --git a/lib/kvg_character_recognition/datastore.rb b/lib/kvg_character_recognition/datastore.rb
index abc1234..def5678 100644
--- a/lib/kvg_character_recognition/datastore.rb
+++ b/lib/kvg_character_recognition/datastore.rb
@@ -9,7 +9,7 @@
def load_file filename
begin
- JSON.parse(File.read(filename))
+ JSON.parse(File.read(filename), symbolize_names: true)
rescue
puts "Can't load file, returning empty character collection."
[]
|
Store keys as symbol in characters.json
|
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
@@ -4,7 +4,7 @@ Redcarpet::Markdown.new(renderer, { auto_link: true, tables: true }).render(text).html_safe
end
def shorten(text, max_length, cut_characters, ending_sign)
- (text.length < (max_length-cut_characters) ? text : text[0,max_length].gsub(/[\s,.\-!?]+\S+$/, "")) + " " + ending_sign
+ (text.length < (max_length-cut_characters) ? text : text[0,max_length].gsub(/[\s,.\-!?]+\S+\z/, "")) + " " + ending_sign
end
def finnishTime(time)
|
Fix shortening to work on multiline strings
|
diff --git a/lib/spree_i18n/controller_locale_helper.rb b/lib/spree_i18n/controller_locale_helper.rb
index abc1234..def5678 100644
--- a/lib/spree_i18n/controller_locale_helper.rb
+++ b/lib/spree_i18n/controller_locale_helper.rb
@@ -15,6 +15,8 @@ def set_user_language
I18n.locale = if session.key?(:locale) && Config.supported_locales.include?(session[:locale].to_sym)
session[:locale]
+ elsif respond_to?(:config_locale, true)
+ config_locale
else
Rails.application.config.i18n.default_locale || I18n.default_locale
end
|
Support config_locale settings in set_user_language override
Fixes spree/spree#3915
|
diff --git a/app/models/dojo.rb b/app/models/dojo.rb
index abc1234..def5678 100644
--- a/app/models/dojo.rb
+++ b/app/models/dojo.rb
@@ -10,6 +10,8 @@
serialize :tags
before_save { self.email = self.email.downcase }
+
+ scope :default_order, -> { order(prefecture_id: :asc) }
validates :name, presence: true, length: { maximum: 50 }
validates :email, presence: false
|
Add scope for default order
|
diff --git a/app/models/icon.rb b/app/models/icon.rb
index abc1234..def5678 100644
--- a/app/models/icon.rb
+++ b/app/models/icon.rb
@@ -26,7 +26,8 @@ private
def url_is_url
- return true if url.to_s.starts_with?('http')
+ return true if url.to_s.starts_with?('http://') || url.to_s.starts_with?('https://')
+ self.url = url_was
errors.add(:url, "must be an actual fully qualified url (http://www.example.com)")
end
|
Reset URL if invalid; check validity via http(s)://
|
diff --git a/app/models/line.rb b/app/models/line.rb
index abc1234..def5678 100644
--- a/app/models/line.rb
+++ b/app/models/line.rb
@@ -28,7 +28,7 @@ PATTERNS.each do |pattern|
regex, action = pattern
if raw_line =~ regex
- self.person = Person.find_or_create_by_name($1)
+ self.person = Person.find_or_create_by!(name: $1)
self.body = $2
self.action = action
return
|
Remove use of deprecated dynamic finder
|
diff --git a/app/models/live.rb b/app/models/live.rb
index abc1234..def5678 100644
--- a/app/models/live.rb
+++ b/app/models/live.rb
@@ -2,7 +2,7 @@ has_many :songs, dependent: :restrict_with_exception
scope :order_by_date, -> { order(date: :desc) }
- scope :future, -> { where('date > ?', Date.today) }
+ scope :future, -> { where('date >= ?', Date.today + 1.week) }
validates :name, presence: true, uniqueness: { scope: :date }
validates :date, presence: true
|
Change the start of `future` scope
|
diff --git a/app/models/image.rb b/app/models/image.rb
index abc1234..def5678 100644
--- a/app/models/image.rb
+++ b/app/models/image.rb
@@ -29,7 +29,7 @@ if source_id.present?
sources << Source.find(source_id)
else
- sources << Source.find_or_initialize_by_name(source_attrs)
+ sources << Source.find_or_initialize_by_name_and_kind(source_attrs)
end
end
end
|
Fix issue when setting certain sources.
|
diff --git a/activeresource.gemspec b/activeresource.gemspec
index abc1234..def5678 100644
--- a/activeresource.gemspec
+++ b/activeresource.gemspec
@@ -13,7 +13,7 @@ s.email = 'david@loudthinking.com'
s.homepage = 'http://www.rubyonrails.org'
- s.files = Dir['README.rdoc', 'lib/**/*']
+ s.files = Dir['MIT-LICENSE', 'README.rdoc', 'lib/**/*']
s.require_path = 'lib'
s.extra_rdoc_files = %w( README.rdoc )
|
Include lincense file in the package
|
diff --git a/app/models/round.rb b/app/models/round.rb
index abc1234..def5678 100644
--- a/app/models/round.rb
+++ b/app/models/round.rb
@@ -1,5 +1,8 @@ class Round < ActiveRecord::Base
attr_accessible :charity, :closed, :expire_time, :failed, :max_amount, :secret_token, :url, :winning_address1, :winning_address2
+
+ has_many :donations
+
after_initialize do |round|
self.url = SecureRandom.hex(3)
end
|
Add has_many comments to Round model
|
diff --git a/lib/pacto/response.rb b/lib/pacto/response.rb
index abc1234..def5678 100644
--- a/lib/pacto/response.rb
+++ b/lib/pacto/response.rb
@@ -10,7 +10,7 @@ end
def instantiate
- Faraday::Response.new(default_env)
+ self
end
def body
|
Use Pacto::Response instead of Faraday::Response for instantiate
|
diff --git a/household_expenses.rb b/household_expenses.rb
index abc1234..def5678 100644
--- a/household_expenses.rb
+++ b/household_expenses.rb
@@ -1,5 +1,5 @@ class HouseholdExpenses
def call(env)
- [200, {}, ['Hello World']]
+ [200, {}, ['Hello World with CI and auto deploy']]
end
end
|
Use CI and auto deploy to demo environment
|
diff --git a/Library/Formula/noweb.rb b/Library/Formula/noweb.rb
index abc1234..def5678 100644
--- a/Library/Formula/noweb.rb
+++ b/Library/Formula/noweb.rb
@@ -5,38 +5,43 @@ homepage 'http://www.cs.tufts.edu/~nr/noweb/'
url 'ftp://www.eecs.harvard.edu/pub/nr/noweb.tgz'
version '2.11b'
- sha1 '3b391c42f46dcb8a002b863fb2e483560a7da51d'
+ sha256 'c913f26c1edb37e331c747619835b4cade000b54e459bb08f4d38899ab690d82'
depends_on 'icon'
+
+ def texpath
+ prefix/'tex/generic/noweb'
+ end
def install
cd "src" do
system "bash", "awkname", "awk"
system "make LIBSRC=icon ICONC=icont CFLAGS='-U_POSIX_C_SOURCE -D_POSIX_C_SOURCE=1'"
- if which 'kpsewhich'
- ohai 'TeX installation found. Installing TeX support files there might fail if your user does not have permission'
- texmf = Pathname.new(`kpsewhich -var-value=TEXMFLOCAL`.chomp)
- else
- ohai 'No TeX installation found. Installing TeX support files in the noweb Cellar.'
- texmf = prefix
- end
-
bin.mkpath
lib.mkpath
man.mkpath
- (texmf/'tex/generic/noweb').mkpath
+ texpath.mkpath
system "make", "install", "BIN=#{bin}",
"LIB=#{lib}",
"MAN=#{man}",
- "TEXINPUTS=#{texmf}/tex/generic/noweb"
+ "TEXINPUTS=#{texpath}"
cd "icon" do
system "make", "install", "BIN=#{bin}",
"LIB=#{lib}",
"MAN=#{man}",
- "TEXINPUTS=#{texmf}/tex/generic/noweb"
+ "TEXINPUTS=#{texpath}"
end
end
end
+
+ def caveats; <<-EOS.undent
+ TeX support files are installed in the directory:
+
+ #{texpath}
+
+ You may need to add the directory to TEXINPUTS to run noweb properly.
+ EOS
+ end
end
|
Clean up TeX support installation, add caveat.
Closes #42110.
Signed-off-by: Alex Dunn <46952c1342d5ce1a4f5689855eda3c9064bca8f6@gmail.com>
|
diff --git a/lib/resgen/filters.rb b/lib/resgen/filters.rb
index abc1234..def5678 100644
--- a/lib/resgen/filters.rb
+++ b/lib/resgen/filters.rb
@@ -18,7 +18,7 @@ path = File.expand_path(path)
Proc.new do |artifact_type, artifact|
catalog = catalog_for(artifact_type, artifact)
- catalog.nil? || catalog.absolute_path.start_with?(path)
+ catalog.nil? || (catalog.absolute_path.start_with?(path) || path == catalog.absolute_path)
end
end
|
Make sure base catalog also matches
|
diff --git a/lib/valanga/client.rb b/lib/valanga/client.rb
index abc1234..def5678 100644
--- a/lib/valanga/client.rb
+++ b/lib/valanga/client.rb
@@ -24,7 +24,10 @@
@session.click_on "規約に同意してログイン"
- raise LoginError unless logged_in?
+ unless logged_in?
+ page = Nokogiri::HTML.parse(session.html)
+ raise LoginError, page.xpath('//div[@class="error_text_box"]/p').text
+ end
end
def logged_in?
|
Set exception message when user failed to login
|
diff --git a/etc/examples/magician/compus_beats.rb b/etc/examples/magician/compus_beats.rb
index abc1234..def5678 100644
--- a/etc/examples/magician/compus_beats.rb
+++ b/etc/examples/magician/compus_beats.rb
@@ -8,7 +8,7 @@ define :bass do
sample :bass_voxy_c, amp: rrand(0.1, 0.2), rate: [0.5, 0.5, 1, 1,2,4].choose if rand < 0.25
use_synth :mod_pulse
- play :C1, mod_range: 12, amp: rrand(0.5, 1), mod_phase: [1.0/8, 1.0/16, 1.0/32].choose / sd, release: 1, cutoff: rrand(50, 90)
+ play :C1, mod_range: 12, amp: rrand(0.5, 1), mod_phase: [8, 16, 32].choose / sd, release: 1, cutoff: rrand(50, 90)
play :C2, mod_range: [24, 36, 34].choose, amp: 0.35, mod_phase: sd/16, release: 2, cutoff: 60, pulse_width: rand
sleep sd / 4
end
|
Fix compus beats phase rate
|
diff --git a/rails/config/initializers/session_store.rb b/rails/config/initializers/session_store.rb
index abc1234..def5678 100644
--- a/rails/config/initializers/session_store.rb
+++ b/rails/config/initializers/session_store.rb
@@ -6,4 +6,6 @@ # which shouldn't be used to store highly confidential information
# (create the session table with "rails generate session_migration")
-RailsPortal::Application.config.session_store :active_record_store, :key => '_rails_portal_session', secure: :true+# For testing environments, we don't use SSL and can't set cookie to secure.
+secure = !(Rails.env.cucumber? || Rails.env.test? || Rails.env.feature_test?)
+RailsPortal::Application.config.session_store :active_record_store, :key => '_rails_portal_session', secure: secure
|
Fix test failures caused by secure cookie changes
#178193849
https://www.pivotaltracker.com/story/show/178193849
|
diff --git a/spec/rspec/mocks/double_spec.rb b/spec/rspec/mocks/double_spec.rb
index abc1234..def5678 100644
--- a/spec/rspec/mocks/double_spec.rb
+++ b/spec/rspec/mocks/double_spec.rb
@@ -33,4 +33,12 @@ dbl = double('foo' => 1)
expect(dbl.foo).to eq(1)
end
+
+ it 'allows setter methods to be stubbed' do
+ dbl = double('foo=' => 1)
+
+ # Note the specified return value is thrown away. This is a Ruby semantics
+ # thing. You cannot change the return value of assignment.
+ expect(dbl.foo = "bar").to eq("bar")
+ end
end
|
Document behaviour of doubling setter methods.
|
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb
index abc1234..def5678 100644
--- a/config/initializers/session_store.rb
+++ b/config/initializers/session_store.rb
@@ -1,3 +1,3 @@ # Be sure to restart your server when you modify this file.
-CartoDB::Application.config.session_store :cookie_store, :key => '_cartodb_session', :domain => CartoDB.domain
+CartoDB::Application.config.session_store :cookie_store, :key => '_cartodb_session', :domain => ".cartodb.com"
|
Use root domain as session cookie domain
|
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb
index abc1234..def5678 100644
--- a/config/initializers/session_store.rb
+++ b/config/initializers/session_store.rb
@@ -4,7 +4,7 @@ Rails.application.config.session_store(
:cookie_store,
key: Settings.site.session_key,
- domain: %W[.#{Settings.site.default_domain} #{Settings.site.default_domain}],
+ domain: Rails.env.production? ? %W[.#{Settings.site.default_domain} #{Settings.site.default_domain}] : nil,
secure: Rails.env.production?
)
end
|
Fix cookie store in locahost domain cannot login
|
diff --git a/cookbooks/chef/attributes/default.rb b/cookbooks/chef/attributes/default.rb
index abc1234..def5678 100644
--- a/cookbooks/chef/attributes/default.rb
+++ b/cookbooks/chef/attributes/default.rb
@@ -2,7 +2,7 @@ default[:apt][:sources] = node[:apt][:sources] | [ "opscode" ]
# Set the default client version
-default[:chef][:client][:version] = "11.8.2-1"
+default[:chef][:client][:version] = "11.10.0-1"
# A list of gems needed by chef recipes
default[:chef][:gems] = []
|
Update chef client to 11.10.0
|
diff --git a/cookbooks/devices/recipes/default.rb b/cookbooks/devices/recipes/default.rb
index abc1234..def5678 100644
--- a/cookbooks/devices/recipes/default.rb
+++ b/cookbooks/devices/recipes/default.rb
@@ -25,7 +25,7 @@
execute "udevadm-trigger" do
action :nothing
- command "/sbin/udevadm trigger --action=add"
+ command "/bin/udevadm trigger --action=add"
end
template "/etc/udev/rules.d/99-chef.rules" do
|
Update udevadm path for Ubuntu 20.04 compatibility
|
diff --git a/lib/flatrack/template.rb b/lib/flatrack/template.rb
index abc1234..def5678 100644
--- a/lib/flatrack/template.rb
+++ b/lib/flatrack/template.rb
@@ -17,7 +17,7 @@ private
def find_by_type(type, file)
- if File.exists?(file)
+ if File.exist?(file)
file
else
Dir[File.join type.to_s.pluralize, "#{file}*"].first
|
Move away from deprecated exists?
|
diff --git a/lib/minitest/ext/spec.rb b/lib/minitest/ext/spec.rb
index abc1234..def5678 100644
--- a/lib/minitest/ext/spec.rb
+++ b/lib/minitest/ext/spec.rb
@@ -24,7 +24,7 @@ class_eval &context
end
else
- raise ArgumentError, "No context with #{name} found."
+ raise ArgumentError, "No context by name '#{name}' found."
end
end
|
Improve the ArgumentError exception message in inherit_context.
|
diff --git a/lib/plugin/python/use.rb b/lib/plugin/python/use.rb
index abc1234..def5678 100644
--- a/lib/plugin/python/use.rb
+++ b/lib/plugin/python/use.rb
@@ -7,6 +7,8 @@ __case(args[1]) do |ca|
ca.when("jython*") do
__export("JYTHON_HOME", raw("#{var}/libexec"))
+ # This may actually be broken for the general case
+ add_to_PYTHONPATH(raw("#{var}/libexec/Lib"))
end
end
|
Add the jython libexec/Lib to PYTHONPATH
|
diff --git a/lib/poloxy/item_merge.rb b/lib/poloxy/item_merge.rb
index abc1234..def5678 100644
--- a/lib/poloxy/item_merge.rb
+++ b/lib/poloxy/item_merge.rb
@@ -1,5 +1,7 @@ # Factorial Delegator for Item Merger Class
class Poloxy::ItemMerge
+ attr :merger
+
def initialize config: nil
@config = config || Poloxy::Config.new
merger = config.deliver['item']['merger']
|
Add :merger attr for testing
|
diff --git a/spec/controllers/api/translations_controller_spec.rb b/spec/controllers/api/translations_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/api/translations_controller_spec.rb
+++ b/spec/controllers/api/translations_controller_spec.rb
@@ -0,0 +1,55 @@+require 'rails_helper'
+
+describe API::TranslationsController do
+
+ let(:user) { create(:user) }
+ let(:another_user) { create(:user) }
+ let(:discussion) { create(:discussion, author: user) }
+ let(:motion) { create(:motion, discussion: discussion) }
+ let(:comment) { create(:comment, discussion: discussion) }
+ let(:discussion_translation) { create(:translation, translatable: discussion, language: :fr, fields: { title: "title", description: "description"}) }
+ let(:motion_translation) { create(:translation, translatable: motion, language: :fr, fields: { name: "name", description: "description" }) }
+ let(:comment_translation) { create(:translation, translatable: comment, language: :fr, fields: { body: "body" }) }
+
+ before do
+ sign_in user
+ TranslationService.stub(:available?).and_return(true)
+ end
+
+ describe 'inline' do
+ context 'success' do
+
+ it 'responds with an inline translation for a discussion' do
+ discussion_translation
+ get :inline, model: 'discussion', id: discussion.id, to: :fr
+ json = JSON.parse(response.body)
+ translatable_ids = json['translations'].map { |t| t['translatable_id'] }
+ translatable_types = json['translations'].map { |t| t['translatable_type'] }
+ expect(translatable_ids).to include discussion.id
+ expect(translatable_types).to include 'Discussion'
+ end
+
+ it 'responds with an inline translation for a motion' do
+ motion_translation
+ get :inline, model: 'motion', id: motion.id, to: :fr
+ json = JSON.parse(response.body)
+ translatable_ids = json['translations'].map { |t| t['translatable_id'] }
+ translatable_types = json['translations'].map { |t| t['translatable_type'] }
+ expect(translatable_ids).to include motion.id
+ expect(translatable_types).to include 'Motion'
+ end
+
+ it 'responds with an inline translation for a comment' do
+ comment_translation
+ get :inline, model: 'comment', id: comment.id, to: :fr
+ json = JSON.parse(response.body)
+ translatable_ids = json['translations'].map { |t| t['translatable_id'] }
+ translatable_types = json['translations'].map { |t| t['translatable_type'] }
+ expect(translatable_ids).to include comment.id
+ expect(translatable_types).to include 'Comment'
+ end
+
+ end
+ end
+
+end
|
Add specs for translation controller
|
diff --git a/spec/integration/release/create_bosh_release_spec.rb b/spec/integration/release/create_bosh_release_spec.rb
index abc1234..def5678 100644
--- a/spec/integration/release/create_bosh_release_spec.rb
+++ b/spec/integration/release/create_bosh_release_spec.rb
@@ -0,0 +1,19 @@+require 'spec_helper'
+
+describe 'create bosh release', type: :integration do
+ it 'creates a bosh dev release successfully' do
+ bosh_source_path = ENV['PWD']
+ test_dir = Dir.mktmpdir("bosh-release-test")
+ bosh_folder_name = bosh_source_path.split('/').last
+ err = nil
+ Bundler.with_clean_env do
+ create_dev_release = "bundle exec rake release:create_dev_release --trace"
+ _, _, err = Open3.capture3("pushd #{test_dir} && git clone #{bosh_source_path} && cd #{bosh_folder_name} && #{create_dev_release}")
+ end
+
+ release_folder = Dir.new("#{test_dir}/#{bosh_folder_name}/release/dev_releases/bosh")
+
+ expect(release_folder.entries.any? {|file| file.match(/.*dev.*.yml/)}).to eq(true)
+ expect(err.success?).to eq(true)
+ end
+end
|
Add integration test for creating a bosh dev release
So that we can catch missing / extra files in job spec files within the
bosh release.
[Finish #101552268](https://www.pivotaltracker.com/story/show/101552268)
Signed-off-by: Tushar Dadlani <30e3adf538ecf64bd912d5b2c65f5b8659805406@pivotal.io>
|
diff --git a/foodcritic.gemspec b/foodcritic.gemspec
index abc1234..def5678 100644
--- a/foodcritic.gemspec
+++ b/foodcritic.gemspec
@@ -21,6 +21,7 @@ s.files = Dir['chef_dsl_metadata/*.json'] +
Dir['lib/**/*.rb'] +
Dir['misc/**/*']
+ s.files += Dir['Rakefile'] + Dir['Gemfile'] + Dir["*.gemspec"]
s.files += Dir['spec/**/*'] + Dir['features/**/*']
s.files += Dir['*.md'] + Dir['LICENSE'] + Dir['man/*']
s.required_ruby_version = '>= 2.0.0'
|
Include gemspec and Gemfiles in distributed gem for ease of working with / running tests
|
diff --git a/spec/controllers/scites_controller_spec.rb b/spec/controllers/scites_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/scites_controller_spec.rb
+++ b/spec/controllers/scites_controller_spec.rb
@@ -1,3 +1,5 @@+require 'spec_helper'
+
describe ScitesController do
let(:user) { FactoryGirl.create(:user) }
|
Fix a test bug when not run in guard
|
diff --git a/spec/rubocop/cop/lint/empty_ensure_spec.rb b/spec/rubocop/cop/lint/empty_ensure_spec.rb
index abc1234..def5678 100644
--- a/spec/rubocop/cop/lint/empty_ensure_spec.rb
+++ b/spec/rubocop/cop/lint/empty_ensure_spec.rb
@@ -7,15 +7,17 @@ expect_offense(<<~RUBY)
begin
something
- ensure
+ ensure # hello
^^^^^^ Empty `ensure` block detected.
+ # world
end
RUBY
expect_correction(<<~RUBY)
begin
something
-
+ # hello
+ # world
end
RUBY
end
|
Improve spec for Lint/EmptyEnsure with comments
|
diff --git a/test/adapters/redis_cache_test.rb b/test/adapters/redis_cache_test.rb
index abc1234..def5678 100644
--- a/test/adapters/redis_cache_test.rb
+++ b/test/adapters/redis_cache_test.rb
@@ -1,7 +1,7 @@ require 'test_helper'
require 'flipper/adapters/redis_cache'
-class DalliTest < MiniTest::Test
+class RedisCacheTest < MiniTest::Test
prepend Flipper::Test::SharedAdapterTests
def setup
|
Rename dalli test to correct redis cache test
|
diff --git a/lib/discordrb/data.rb b/lib/discordrb/data.rb
index abc1234..def5678 100644
--- a/lib/discordrb/data.rb
+++ b/lib/discordrb/data.rb
@@ -15,6 +15,18 @@ # Utility function to mention users in messages
def mention
"<@#{@id}>"
+ end
+ end
+
+ class Channel
+ attr_reader :name, :server_id, :type, :id, :is_private
+
+ def initialize(data)
+ @name = data['name']
+ @server_id = data['guild_id']
+ @type = data['type']
+ @id = data['id']
+ @is_private = (data['is_private'].downcase == 'true')
end
end
|
Add class to represent Discord channels
|
diff --git a/lib/formalist/form.rb b/lib/formalist/form.rb
index abc1234..def5678 100644
--- a/lib/formalist/form.rb
+++ b/lib/formalist/form.rb
@@ -34,7 +34,7 @@ # @api public
def build(input = {})
elements = self.class.elements.map { |el| el.resolve(self) }
- Result.new(input, elements, schema.rules.map(&:to_ary))
+ Result.new(input, elements, schema.class.rule_ast)
end
end
end
|
Access the schema’s rules via `.rule_ast`
|
diff --git a/lib/gas/git_config.rb b/lib/gas/git_config.rb
index abc1234..def5678 100644
--- a/lib/gas/git_config.rb
+++ b/lib/gas/git_config.rb
@@ -1,6 +1,6 @@ module Gas
- # Class that class that interacts with the git config
+ # Module that class that interacts with the git config
module GitConfig
# Parse out the current user from the gitconfig
@@ -18,12 +18,8 @@ # Changes the user
# @param [Gas::User] user The new user
def self.change_user(user)
- name = user.name
- email = user.email
-
- `git config --global user.name "#{name}"`
- `git config --global user.email "#{email}"`
+ `git config --global user.name "#{user.name}"`
+ `git config --global user.email "#{user.email}"`
end
-
end
end
|
Trim down some more code
|
diff --git a/browserify-rails.gemspec b/browserify-rails.gemspec
index abc1234..def5678 100644
--- a/browserify-rails.gemspec
+++ b/browserify-rails.gemspec
@@ -22,6 +22,5 @@
spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "rake"
- spec.add_development_dependency "pry"
spec.add_development_dependency "rails", "~> 3.2"
end
|
Remove pry for debugging the tests
|
diff --git a/test/unit/release/scm/git_test.rb b/test/unit/release/scm/git_test.rb
index abc1234..def5678 100644
--- a/test/unit/release/scm/git_test.rb
+++ b/test/unit/release/scm/git_test.rb
@@ -0,0 +1,58 @@+require "test_helper"
+require "mocha/test_unit"
+require "test_construct"
+
+module Roger
+ # Test for Roger Zip finalizer
+ class GitScmTest < ::Test::Unit::TestCase
+ include TestConstruct::Helpers
+
+ def setup
+ @construct = setup_construct
+
+ @scm = Roger::Release::Scm::Git.new(path: @construct)
+
+ @construct.file "test.html"
+
+ # Setup git
+ `git init`
+ `git add *`
+ `git commit -m "Commit 1"`
+ `git tag v0.1.0`
+
+ @construct.file "test2.html"
+
+ `git add *`
+ `git commit -m "Commit 2"`
+ `git tag v1.0.0`
+ end
+
+ def teardown
+ teardown_construct(@construct)
+ end
+
+ def test_implements_scm_interfase
+ assert @scm.respond_to?(:version)
+ assert @scm.respond_to?(:date)
+ assert @scm.respond_to?(:previous)
+ end
+
+ def test_version
+ assert_equal "1.0.0", @scm.version
+ end
+
+ def test_previous
+ assert_equal "0.1.0", @scm.previous.version
+ end
+
+ def test_date
+ now = Time.now
+ date = @scm.date
+ assert_equal now.day, date.day
+ assert_equal now.month, date.month
+ assert_equal now.year, date.year
+ assert_equal now.hour, date.hour
+ assert_equal now.min, date.min
+ end
+ end
+end
|
Add test for GIT SCM
|
diff --git a/lib/jiggle/vector2.rb b/lib/jiggle/vector2.rb
index abc1234..def5678 100644
--- a/lib/jiggle/vector2.rb
+++ b/lib/jiggle/vector2.rb
@@ -10,6 +10,11 @@ end
alias :<=> :distance_to
+
+ def to_a
+ [x, y]
+ end
+ alias :to_ary :to_a
end
def jgv(x, y)
|
Add converting to array stuff to Vector2 so it's nicer with Rubygame
|
diff --git a/lib/kuroko2/engine.rb b/lib/kuroko2/engine.rb
index abc1234..def5678 100644
--- a/lib/kuroko2/engine.rb
+++ b/lib/kuroko2/engine.rb
@@ -9,15 +9,13 @@
config.autoload_paths << root.join('lib')
- config.before_initialize do
+ initializer "kuroko2.configuration" do |app|
URI.parse(Kuroko2.config.url).tap do |url|
Kuroko2.config.url_host = url.host
Kuroko2.config.url_scheme = url.scheme
Kuroko2.config.url_port = url.port
end
- end
- initializer "kuroko2.configuration" do |app|
if Kuroko2.config.custom_tasks
Kuroko2.config.custom_tasks.each do |key, klass|
unless Workflow::Node::TASK_REGISTORY.has_key?(key)
|
Move configuration loading to initializer
|
diff --git a/lib/opal/processor.rb b/lib/opal/processor.rb
index abc1234..def5678 100644
--- a/lib/opal/processor.rb
+++ b/lib/opal/processor.rb
@@ -9,15 +9,13 @@ true
end
- def self.method_missing_enabled
- @method_missing_enabled
- end
-
- def self.method_missing_enabled=(enabled)
- @method_missing_enabled = enabled
+ class << self
+ attr_accessor :method_missing_enabled
+ attr_accessor :optimized_operators_enabled
end
self.method_missing_enabled = true
+ self.optimized_operators_enabled = true
def initialize_engine
require_template_library 'opal'
@@ -28,7 +26,9 @@ end
def evaluate(context, locals, &block)
- options = { :method_missing => self.class.method_missing_enabled }
+ options = { :method_missing => self.class.method_missing_enabled,
+ :optimized_operators => self.class.optimized_operators_enabled }
+
parser = Opal::Parser.new
result = parser.parse data, options
|
Allow optimized_operators parser option to be configured
|
diff --git a/lib/rails_launcher.rb b/lib/rails_launcher.rb
index abc1234..def5678 100644
--- a/lib/rails_launcher.rb
+++ b/lib/rails_launcher.rb
@@ -1,4 +1,4 @@-require 'active_support/core_ext/string'
+require 'active_support/all'
require "rails_launcher/version"
require "rails_launcher/dsl"
|
Use 'activesupport/all' to avoid problem used as a gem
|
diff --git a/circuit_breaker-ruby.gemspec b/circuit_breaker-ruby.gemspec
index abc1234..def5678 100644
--- a/circuit_breaker-ruby.gemspec
+++ b/circuit_breaker-ruby.gemspec
@@ -3,7 +3,7 @@ Gem::Specification.new do |gem|
gem.name = 'circuit_breaker-ruby'
gem.version = CircuitBreaker::VERSION
- gem.date = '2016-10-09'
+ gem.date = '2016-09-09'
gem.summary = 'Circuit breaker for ruby'
gem.description = 'Self-resetting breaker retries the protected call after a suitable interval, and it also resets when the call succeeds.'
gem.author = 'Scripbox'
|
Fix date in gemspec file
|
diff --git a/lib/devise/uncommon_password/model.rb b/lib/devise/uncommon_password/model.rb
index abc1234..def5678 100644
--- a/lib/devise/uncommon_password/model.rb
+++ b/lib/devise/uncommon_password/model.rb
@@ -25,7 +25,7 @@ private
def not_common_password
- return unless password.present?
+ return unless password_required?
if Devise::Models::UncommonPassword.common_passwords.include? password.downcase
errors.add(:password, "is a very common password. Please choose something harder to guess.")
|
Switch to using password_required? to check if password is changing
This is more idiomatic - it's what devise uses internally.
|
diff --git a/lib/travis/support.rb b/lib/travis/support.rb
index abc1234..def5678 100644
--- a/lib/travis/support.rb
+++ b/lib/travis/support.rb
@@ -22,6 +22,10 @@ ENV['ENV'] || ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development'
end
+ def env?(name)
+ name.to_s == env
+ end
+
def logger
@logger ||= Logger.configure(Logger.new(STDOUT))
end
|
Add env check convenience method
|
diff --git a/templates/spec_helper.rb b/templates/spec_helper.rb
index abc1234..def5678 100644
--- a/templates/spec_helper.rb
+++ b/templates/spec_helper.rb
@@ -26,12 +26,12 @@ config.order = 'random'
config.use_transactional_fixtures = false
- config.before(:each) do
- Capybara.current_driver = select_driver
+ config.before(:each) do |example|
+ Capybara.current_driver = select_driver(example)
end
end
-def select_driver
+def select_driver(example)
if example.metadata[:js]
if example.metadata[:js] == :selenium
:selenium
|
Update code to latest RSpec configs
|
diff --git a/lib/revertible_paper_trail/version.rb b/lib/revertible_paper_trail/version.rb
index abc1234..def5678 100644
--- a/lib/revertible_paper_trail/version.rb
+++ b/lib/revertible_paper_trail/version.rb
@@ -11,7 +11,7 @@ when "create"
item.destroy
when "update"
- previous.reify.save
+ reify.save
when "destroy"
reify.save
end
|
Fix revert action for update event.
|
diff --git a/lib/store_schema/converter/boolean.rb b/lib/store_schema/converter/boolean.rb
index abc1234..def5678 100644
--- a/lib/store_schema/converter/boolean.rb
+++ b/lib/store_schema/converter/boolean.rb
@@ -30,7 +30,7 @@ #
def to_db
if TRUE_VALUES.include?(value)
- "t"
+ DB_TRUE_VALUE
elsif FALSE_VALUES.include?(value)
"f"
else
|
Return `DB_TRUE_VALUE` instead of "t" to avoid multiple memory allocations and to ensure consistency.
|
diff --git a/lib/tasks/cleanup_duplicate_urls.rake b/lib/tasks/cleanup_duplicate_urls.rake
index abc1234..def5678 100644
--- a/lib/tasks/cleanup_duplicate_urls.rake
+++ b/lib/tasks/cleanup_duplicate_urls.rake
@@ -0,0 +1,14 @@+task :cleanup_dupes => :environment do
+ vals = []
+
+ validations = Validation.where(:url.ne => nil).order_by(:created_at.desc)
+
+ validations.each do |v|
+ if vals.include?(v.url)
+ v.delete
+ else
+ vals << v.url
+ end
+ end
+
+end
|
Add Rake task to cleanup dupes
|
diff --git a/lib/tasks/reprocess_tweet_images.rake b/lib/tasks/reprocess_tweet_images.rake
index abc1234..def5678 100644
--- a/lib/tasks/reprocess_tweet_images.rake
+++ b/lib/tasks/reprocess_tweet_images.rake
@@ -1,5 +1,5 @@ task :reprocess_tweet_images => :environment do
- RUBYFRIENDS_APP.tweets.each do |tweet|
+ Tweet.find_each do |tweet|
tweet.image.recreate_versions!
end
-end+end
|
Fix reference to old constant
|
diff --git a/config/initializers/spree.rb b/config/initializers/spree.rb
index abc1234..def5678 100644
--- a/config/initializers/spree.rb
+++ b/config/initializers/spree.rb
@@ -1,12 +1,15 @@ # Configure Spree Preferences
-#
+#
# Note: Initializing preferences available within the Admin will overwrite any changes that were made through the user interface when you restart.
# If you would like users to be able to update a setting with the Admin it should NOT be set here.
#
-# In order to initialize a setting do:
+# In order to initialize a setting do:
# config.setting_name = 'new value'
Spree.config do |config|
# Example:
# Uncomment to override the default site name.
# config.site_name = "Spree Demo Site"
+
+ config.shipping_instructions = true
+ config.checkout_zone = 'Australia'
end
|
Change checkout zone so that Austrlia is the default country selected in checkout.
|
diff --git a/omnibus-software.gemspec b/omnibus-software.gemspec
index abc1234..def5678 100644
--- a/omnibus-software.gemspec
+++ b/omnibus-software.gemspec
@@ -14,7 +14,7 @@ # Software definitions in this bundle require at least this version of
# omnibus because of the dsl methods they are using.
s.add_dependency "omnibus", ">= 5.6.1"
- s.add_dependency "chef-sugar-ng", ">= 5.0.0"
+ s.add_dependency "chef-sugar", ">= 5.0.0"
s.files = `git ls-files`.split("\n")
s.require_paths = ["lib"]
|
Switch back to chef-sugar from chef-sugar-ng
No need to use the ng here
Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
|
diff --git a/msfl_visitors.gemspec b/msfl_visitors.gemspec
index abc1234..def5678 100644
--- a/msfl_visitors.gemspec
+++ b/msfl_visitors.gemspec
@@ -10,7 +10,7 @@ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.homepage =
'https://github.com/Referly/msfl_visitors'
- s.add_runtime_dependency "msfl", "~> 1.1.6"
+ s.add_runtime_dependency "msfl", "~> 1.1", '>= 1.1.6'
s.add_development_dependency "rake", "~> 10.3"
s.add_development_dependency "simplecov", "~> 0.10"
s.add_development_dependency "yard", "~> 0.8"
|
Address warning from gem build about being overly pessimistic.
|
diff --git a/scripts/update-apidoc.rb b/scripts/update-apidoc.rb
index abc1234..def5678 100644
--- a/scripts/update-apidoc.rb
+++ b/scripts/update-apidoc.rb
@@ -28,11 +28,9 @@ system("cd %s && apidoc update" % File.join(dir, ".."))
latest = extract_version(path)
-puts "current: %s" % current
-puts "latest: %s" % latest
-
if current == latest
puts "apidoc API version remains at %s" % current
+ puts ""
exit(1)
end
|
Improve output from script to update API
|
diff --git a/spec/tic_tac_toe_spec.rb b/spec/tic_tac_toe_spec.rb
index abc1234..def5678 100644
--- a/spec/tic_tac_toe_spec.rb
+++ b/spec/tic_tac_toe_spec.rb
@@ -55,7 +55,7 @@
it 'knows when someone has won' do
["X", "O"].each do |mark|
- [[0, 1, 2]].each do |places|
+ [[0, 1, 2], [3,4,5]].each do |places|
board = TicTacToe::Board.new
do_winning_test board, mark, places
end
|
Test won at different place sets
|
diff --git a/lib/musicality/composition/note_generation.rb b/lib/musicality/composition/note_generation.rb
index abc1234..def5678 100644
--- a/lib/musicality/composition/note_generation.rb
+++ b/lib/musicality/composition/note_generation.rb
@@ -28,4 +28,19 @@ end
module_function :make_notes
+def e(pitch_groups)
+ pitch_groups.map {|pg| Note.eighth(pg) }
end
+module_function :e
+
+def q(pitch_groups)
+ pitch_groups.map {|pg| Note.quarter(pg) }
+end
+module_function :q
+
+def dq(pitch_groups)
+ pitch_groups.map {|pg| Note.dotted_quarter(pg) }
+end
+module_function :dq
+
+end
|
Add convenience methods for generating eighth, quarter, and dotted-quarter notes
|
diff --git a/ruby-ole.gemspec b/ruby-ole.gemspec
index abc1234..def5678 100644
--- a/ruby-ole.gemspec
+++ b/ruby-ole.gemspec
@@ -1,4 +1,4 @@-$:.unshift (File.dirname(__FILE__) + '/lib')
+$:.unshift File.dirname(__FILE__) + '/lib'
require 'ole/storage/version'
PKG_NAME = 'ruby-ole'
|
Fix to avoid warning about space before parentheses.
|
diff --git a/spec/controllers/campaigns_controller_spec.rb b/spec/controllers/campaigns_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/campaigns_controller_spec.rb
+++ b/spec/controllers/campaigns_controller_spec.rb
@@ -22,7 +22,7 @@ end
context 'if there are a custom template' do
- let(:campaign_page_id) { 'interest-rate-campaign' }
+ let(:campaign_page_id) { 'interest-rate-rise' }
subject { get :show, locale: I18n.locale, id: campaign_page_id }
it 'renders the custom template' do
|
Fix routing error for the campaign
|
diff --git a/spec/integration/package_vote_feature_spec.rb b/spec/integration/package_vote_feature_spec.rb
index abc1234..def5678 100644
--- a/spec/integration/package_vote_feature_spec.rb
+++ b/spec/integration/package_vote_feature_spec.rb
@@ -22,8 +22,8 @@ end
it "should be possible to vote for a package" do
- click_button "Vote!"
- response.should have_tag("span", "1 vote")
+ click_button "I use this!"
+ response.should have_tag("span", "1 user")
response.should have_tag("div.flash", "Thanks for your vote!")
response.request.path.should == package_path(@pkg)
end
|
Update wording to "uses" in vote spec
|
diff --git a/spec/cmd_spec.rb b/spec/cmd_spec.rb
index abc1234..def5678 100644
--- a/spec/cmd_spec.rb
+++ b/spec/cmd_spec.rb
@@ -33,4 +33,10 @@ output = @winrm.run_cmd('')
expect(output[:exitcode]).to eq(0)
end
+
+ it 'should run a CMD command that has bad arg and return non-zero exit code' do
+ output = @winrm.run_cmd('dir /z')
+ expect(output[:exitcode]).to eq(1)
+ end
+
end
|
Add zero exit code test case
|
diff --git a/spec/sse_spec.rb b/spec/sse_spec.rb
index abc1234..def5678 100644
--- a/spec/sse_spec.rb
+++ b/spec/sse_spec.rb
@@ -3,7 +3,7 @@ require 'sparql/spec'
describe SPARQL::Grammar::Parser do
- describe "w3c dawg SPARQL evaluation tests" do
+ describe "w3c dawg SPARQL tests to SSE" do
SPARQL::Spec.load_sparql1_0_tests.group_by(&:manifest).each do |man, tests|
describe man.to_s.split("/")[-2] do
tests.each do |t|
@@ -13,6 +13,21 @@ query = SPARQL::Grammar.parse(t.action.query_string)
sse = SPARQL::Algebra.parse(t.action.sse_string)
query.should == sse
+ end
+
+ it "parses #{t.name} to lexically equivalent SSE" do
+ query = SPARQL::Grammar.parse(t.action.query_string)
+ normalized_query = query.to_sxp.
+ gsub(/\s+/m, " ").
+ gsub(/\(\s+\(/, '((').
+ gsub(/\)\s+\)/, '))').
+ strip
+ normalized_result = t.action.sse_string.
+ gsub(/\s+/m, " ").
+ gsub(/\(\s+\(/, '((').
+ gsub(/\)\s+\)/, '))').
+ strip
+ normalized_query.should == normalized_result rescue pending("Lexical equivalence")
end
else
it "??? #{t.name}" do
|
Test both lexical and object translation to SSE. Lexical tests that fail are made pending.
|
diff --git a/Casks/p4v.rb b/Casks/p4v.rb
index abc1234..def5678 100644
--- a/Casks/p4v.rb
+++ b/Casks/p4v.rb
@@ -1,6 +1,6 @@ cask :v1 => 'p4v' do
- version '2014.3-1007540'
- sha256 '07eac08f6bfb32e4a79bf47582116de8532fe0b18d91a014e1cd80861d6f0909'
+ version '2015.2-1312139'
+ sha256 '6f64cca4e84d344c5f420e58a72bd07c4fbf5f3eb9665b165acd8baa36c18eb9'
url "http://filehost.perforce.com/perforce/r#{version.sub(%r{\A20(\d\d\.\d+).*},'\1')}/bin.macosx107x86_64/P4V.dmg"
name 'P4V'
|
Update P4V to latest version (2015.2-1312139).
|
diff --git a/spec/controllers/ideas_controller_spec.rb b/spec/controllers/ideas_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/ideas_controller_spec.rb
+++ b/spec/controllers/ideas_controller_spec.rb
@@ -33,5 +33,11 @@ end
end
- pending "needs expanded GET, POST, PATCH, PUT, DESTROY tests"
+ pending "POST create"
+ pending "PATCH update"
+ pending "PUT update"
+ pending "DELETE destroy"
+ pending "POST vote"
+ pending "PATCH vote"
+ pending "DELETE vote"
end
|
Update IdeaController spec pending test messages
Add messages for each individual test that can be added.
|
diff --git a/spec/controllers/votes_controller_spec.rb b/spec/controllers/votes_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/votes_controller_spec.rb
+++ b/spec/controllers/votes_controller_spec.rb
@@ -0,0 +1,12 @@+require 'rails_helper'
+
+describe VotesController do
+ describe '#create' do
+ context 'on the welcome#index page'
+ it 'creates a vote record with the correct user_id'
+ it 'creates a vote record with the correct question_id'
+ it 'creates a vote record with the upvote attribute as true'
+ it 'adds the vote to the votes table in the db'
+ end
+ end
+end
|
Define initial spec tests for upvoting.
|
diff --git a/spec/features/create_contribution_spec.rb b/spec/features/create_contribution_spec.rb
index abc1234..def5678 100644
--- a/spec/features/create_contribution_spec.rb
+++ b/spec/features/create_contribution_spec.rb
@@ -0,0 +1,35 @@+require 'spec_helper'
+
+feature 'Create contribution' do
+ background do
+ @project = create(:project, state: 'online', online_date: -1.seconds.from_now)
+ @user = create(:user, password: 'test123')
+ login
+ end
+
+ scenario 'providing smaller value then accepted' do
+ visit project_path(@project)
+ within '.sidebar' do
+ click_on 'Contribute'
+ end
+
+ fill_in 'contribution_form_value', with: 9
+
+ expect {
+ click_on 'Review & Proceed'
+ }.to_not change(Contribution, :count)
+ end
+
+ scenario 'providing value accepted' do
+ visit project_path(@project)
+ within '.sidebar' do
+ click_on 'Contribute'
+ end
+
+ fill_in 'contribution_form_value', with: 10
+
+ expect {
+ click_on 'Review & Proceed'
+ }.to change(Contribution, :count).by(1)
+ end
+end
|
Test to make sure we don't get contributions smaller than $10
|
diff --git a/spec/features/issues/note_polling_spec.rb b/spec/features/issues/note_polling_spec.rb
index abc1234..def5678 100644
--- a/spec/features/issues/note_polling_spec.rb
+++ b/spec/features/issues/note_polling_spec.rb
@@ -9,10 +9,8 @@ end
scenario 'Another user adds a comment to an issue', js: true do
- note = create(:note_on_issue, noteable: issue,
- project_id: project.project_id,
- note: 'Looks good!')
- sleep 16 # refresh interval in notes.js.coffee, 15 seconds
+ note = create(:note_on_issue, noteable: issue, note: 'Looks good!')
+ sleep 15 # refresh interval in notes.js.coffee is 15 seconds
expect(page).to have_selector("#note_#{note.id}", text: 'Looks good!')
end
end
|
Add minor fixes in note polling specs
|
diff --git a/spec/integration/rack/test/test_helper.rb b/spec/integration/rack/test/test_helper.rb
index abc1234..def5678 100644
--- a/spec/integration/rack/test/test_helper.rb
+++ b/spec/integration/rack/test/test_helper.rb
@@ -15,6 +15,9 @@ include Webrat::Matchers
def app
- RackApp.new
+ Rack::Builder.new {
+ use Rack::Lint
+ run RackApp.new
+ }
end
end
|
Use Rack::Lint to test the rack session
|
diff --git a/ontrac-web-services.gemspec b/ontrac-web-services.gemspec
index abc1234..def5678 100644
--- a/ontrac-web-services.gemspec
+++ b/ontrac-web-services.gemspec
@@ -17,6 +17,5 @@ gem.version = Ontrac::VERSION
gem.required_ruby_version = '>= 1.9.0'
- gem.add_dependency("activesupport")
gem.add_dependency("nokogiri")
end
|
Remove the dependency on activesupport.
|
diff --git a/spec/lib/appsignal/hooks/celluloid_spec.rb b/spec/lib/appsignal/hooks/celluloid_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/appsignal/hooks/celluloid_spec.rb
+++ b/spec/lib/appsignal/hooks/celluloid_spec.rb
@@ -3,6 +3,11 @@ before :context do
module Celluloid
def self.shutdown
+ @shut_down = true
+ end
+
+ def self.shut_down?
+ @shut_down == true
end
end
Appsignal::Hooks::CelluloidHook.new.install
@@ -18,7 +23,7 @@ end
specify { expect(Appsignal).to receive(:stop) }
- specify { expect(Celluloid).to receive(:shutdown_without_appsignal) }
+ specify { expect(Celluloid.shut_down?).to be true}
after do
Celluloid.shutdown
|
Replace shutdown should-receive from Celluloid test
Instead, use the mock (verb) to set an instance variable we can later read to
see if the method was at least called.
|
diff --git a/templates/api_application_controller.rb b/templates/api_application_controller.rb
index abc1234..def5678 100644
--- a/templates/api_application_controller.rb
+++ b/templates/api_application_controller.rb
@@ -2,5 +2,5 @@ include ApiDefaults
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
- protect_from_forgery with: :null_session
+ protect_from_forgery unless: -> { request.format.json? }
end
|
Modify API application controller to skip csrf protection when requesting JSON
|
diff --git a/db/schema.rb b/db/schema.rb
index abc1234..def5678 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -0,0 +1,16 @@+# encoding: UTF-8
+# This file is auto-generated from the current state of the database. Instead
+# of editing this file, please use the migrations feature of Active Record to
+# incrementally modify your database, and then regenerate this schema definition.
+#
+# Note that this schema.rb definition is the authoritative source for your
+# database schema. If you need to create the application database on another
+# system, you should be using db:schema:load, not running all the migrations
+# from scratch. The latter is a flawed and unsustainable approach (the more migrations
+# you'll amass, the slower it'll run and the greater likelihood for issues).
+#
+# It's strongly recommended that you check this file into your version control system.
+
+ActiveRecord::Schema.define(version: 0) do
+
+end
|
Fix init for heroku deployement
|
diff --git a/test/aws-lambda/features/support/env.rb b/test/aws-lambda/features/support/env.rb
index abc1234..def5678 100644
--- a/test/aws-lambda/features/support/env.rb
+++ b/test/aws-lambda/features/support/env.rb
@@ -1,3 +1,19 @@+`command -v sam`
+
+if $? != 0
+ puts <<~ERROR
+ The AWS SAM CLI must be installed before running these tests!
+
+ See the installation instructions:
+ https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html
+
+ If you have already installed the SAM CLI, check that it's in your PATH:
+ $ command -v sam
+ ERROR
+
+ exit 127
+end
+
success = system(File.realpath("#{__dir__}/../scripts/build-fixtures"))
raise "Unable to build fixtures!" unless success
|
Check SAM is installed before running
|
diff --git a/lib/cenit_cmd/templates/collection/collection.gemspec b/lib/cenit_cmd/templates/collection/collection.gemspec
index abc1234..def5678 100644
--- a/lib/cenit_cmd/templates/collection/collection.gemspec
+++ b/lib/cenit_cmd/templates/collection/collection.gemspec
@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = '<%= file_name %>'
- s.version = '0.0.1'
+ s.version = <%= class_name %>::VERSION
s.summary = 'TODO: Add gem summary here'
s.description = 'TODO: Add (optional) gem description here'
s.required_ruby_version = '>= 2.0.0'
|
Add version.rb to template Cenit Collection Gem
|
diff --git a/core/app/workers/remove_fact_relation_credibility_job.rb b/core/app/workers/remove_fact_relation_credibility_job.rb
index abc1234..def5678 100644
--- a/core/app/workers/remove_fact_relation_credibility_job.rb
+++ b/core/app/workers/remove_fact_relation_credibility_job.rb
@@ -1,4 +1,7 @@-class RemoveFactRelationCredibility
+class RemoveFactRelationCredibilityJob
+
+ @queue = :fact_relation_operations
+
def self.perform
FactRelation.all.ids.each do |id|
fact_relation = FactRelation[id]
|
Put job on a queue
|
diff --git a/db/migrate/20151016130937_add_uuid_to_shared_entities.rb b/db/migrate/20151016130937_add_uuid_to_shared_entities.rb
index abc1234..def5678 100644
--- a/db/migrate/20151016130937_add_uuid_to_shared_entities.rb
+++ b/db/migrate/20151016130937_add_uuid_to_shared_entities.rb
@@ -0,0 +1,25 @@+Sequel.migration do
+ up do
+ Rails::Sequel.connection.run(%{
+ ALTER TABLE shared_entities DROP CONSTRAINT shared_entities_pkey;
+ })
+ Rails::Sequel.connection.run(%{
+ ALTER TABLE shared_entities ADD COLUMN id uuid NOT NULL default uuid_generate_v4();
+ })
+ Rails::Sequel.connection.run(%{
+ ALTER TABLE shared_entities ADD PRIMARY KEY (id);
+ })
+ end
+
+ down do
+ Rails::Sequel.connection.run(%{
+ ALTER TABLE shared_entities DROP CONSTRAINT shared_entities_pkey;
+ })
+ Rails::Sequel.connection.run(%{
+ ALTER TABLE shared_entities ADD PRIMARY KEY (recipient_id, entity_id);
+ })
+ Rails::Sequel.connection.run(%{
+ ALTER TABLE shared_entities DROP COLUMN id;
+ })
+ end
+end
|
Add back ID to shared_entitites join table
|
diff --git a/db/migrate/20190212152221_change_dataset_id_to_bigint.rb b/db/migrate/20190212152221_change_dataset_id_to_bigint.rb
index abc1234..def5678 100644
--- a/db/migrate/20190212152221_change_dataset_id_to_bigint.rb
+++ b/db/migrate/20190212152221_change_dataset_id_to_bigint.rb
@@ -0,0 +1,39 @@+class ChangeDatasetIdToBigint < ActiveRecord::Migration[6.0]
+ def up
+ change_column :datasets, :id, :bigint
+
+ change_column :agreement_event_datasets, :dataset_id, :bigint
+ change_column :dataset_file_audits, :dataset_id, :bigint
+ change_column :dataset_files, :dataset_id, :bigint
+ change_column :dataset_page_audits, :dataset_id, :bigint
+ change_column :dataset_reviews, :dataset_id, :bigint
+ change_column :dataset_users, :dataset_id, :bigint
+ change_column :dataset_versions, :dataset_id, :bigint
+ change_column :domains, :dataset_id, :bigint
+ change_column :forms, :dataset_id, :bigint
+ change_column :legal_document_datasets, :dataset_id, :bigint
+ change_column :notifications, :dataset_id, :bigint
+ change_column :requests, :dataset_id, :bigint
+ change_column :variable_forms, :dataset_id, :bigint
+ change_column :variables, :dataset_id, :bigint
+ end
+
+ def down
+ change_column :datasets, :id, :integer
+
+ change_column :agreement_event_datasets, :dataset_id, :integer
+ change_column :dataset_file_audits, :dataset_id, :integer
+ change_column :dataset_files, :dataset_id, :integer
+ change_column :dataset_page_audits, :dataset_id, :integer
+ change_column :dataset_reviews, :dataset_id, :integer
+ change_column :dataset_users, :dataset_id, :integer
+ change_column :dataset_versions, :dataset_id, :integer
+ change_column :domains, :dataset_id, :integer
+ change_column :forms, :dataset_id, :integer
+ change_column :legal_document_datasets, :dataset_id, :integer
+ change_column :notifications, :dataset_id, :integer
+ change_column :requests, :dataset_id, :integer
+ change_column :variable_forms, :dataset_id, :integer
+ change_column :variables, :dataset_id, :integer
+ end
+end
|
Update dataset_id primary and foreign keys to bigint
|
diff --git a/app/controllers/admin/publishers_controller.rb b/app/controllers/admin/publishers_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/admin/publishers_controller.rb
+++ b/app/controllers/admin/publishers_controller.rb
@@ -20,25 +20,25 @@ INNER JOIN site_channel_details
ON site_channel_details.id = channels.details_id
AND channels.details_type = 'SiteChannelDetails'
- AND site_channel_details.brave_publisher_id LIKE '%#{query}%'
+ AND site_channel_details.brave_publisher_id ILIKE '%#{query}%'
UNION ALL
SELECT channels.*
FROM channels
INNER JOIN youtube_channel_details
ON youtube_channel_details.id =
channels.details_id
- AND youtube_channel_details.title LIKE '%#{query}%'
+ AND youtube_channel_details.title ILIKE '%#{query}%'
UNION ALL
SELECT channels.*
FROM channels
INNER JOIN twitch_channel_details
ON twitch_channel_details.id = channels.details_id
- AND twitch_channel_details.NAME LIKE '%#{query}%')
+ AND twitch_channel_details.NAME ILIKE '%#{query}%')
c
ON c.publisher_id = publishers.id
UNION ALL
SELECT publishers.id
FROM publishers
- WHERE publishers.email LIKE '%#{query}%'
- OR publishers.name LIKE '%#{query}%'}
+ WHERE publishers.email ILIKE '%#{query}%'
+ OR publishers.name ILIKE '%#{query}%'}
end
|
Enable case insensitive admin search
|
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,30 @@+# 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
|
Add simple string ruby file
|
diff --git a/app/controllers/community_controller.rb b/app/controllers/community_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/community_controller.rb
+++ b/app/controllers/community_controller.rb
@@ -11,7 +11,7 @@
def organization_leaderboards
data = Rails.cache.fetch('community_organization_leaderboards', expires_in: 10.minutes) do
- leaderboard = Leaderboard::OrganizationLeaderboard.new(OrganizationDetailPresenter)
+ leaderboard = Leaderboard::OrganizationLeaderboard.new(OrganizationIndexPresenter)
leaderboard.get
end
render json: data
|
Use OrganizationIndexPresenter instead of OrganizationDetailPresenter
|
diff --git a/app/controllers/countries_controller.rb b/app/controllers/countries_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/countries_controller.rb
+++ b/app/controllers/countries_controller.rb
@@ -1,5 +1,5 @@ class CountriesController < ApplicationController
- before_filter :admin_required
+ before_filter :admin_or_manager_required
before_filter :find_country, :only => [:edit, :update, :destroy]
def index
|
Allow managers to manage countries
|
diff --git a/app/controllers/questions_controller.rb b/app/controllers/questions_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/questions_controller.rb
+++ b/app/controllers/questions_controller.rb
@@ -16,8 +16,9 @@ @question = Question.new(question_params)
@question.user = current_user
if @question.save
- render 'show'
+ redirect_to question_path(@question)
else
+ @errors = @question.errors.full_messages
render 'new'
end
end
|
Change new question controller to redirect to show instead of rendering
|
diff --git a/su-template/coverage/fulldoc/text/setup.rb b/su-template/coverage/fulldoc/text/setup.rb
index abc1234..def5678 100644
--- a/su-template/coverage/fulldoc/text/setup.rb
+++ b/su-template/coverage/fulldoc/text/setup.rb
@@ -19,11 +19,11 @@ puts "Generating #{MANIFEST_FILENAME}..."
methods = Set.new
namespace_objects.each do |object|
- object.meths.each { |method|
+ run_verifier(object.meths).each { |method|
# TODO(thomthom): Currently the manifest doesn't distinguish between
# class and instance methods. This should be addressed, but we need to
# update TestUp to handle this first.
- methods << "#{method.namespace}##{method.name}"
+ methods << "#{method.namespace}.#{method.name}"
}
end
manifest = methods.sort.join("\n")
|
Fix coverage template to filter the methods.
|
diff --git a/lib/pakyow/migrations/1441304573_console_create_users.rb b/lib/pakyow/migrations/1441304573_console_create_users.rb
index abc1234..def5678 100644
--- a/lib/pakyow/migrations/1441304573_console_create_users.rb
+++ b/lib/pakyow/migrations/1441304573_console_create_users.rb
@@ -9,9 +9,9 @@ TrueClass :active, default: true
String :crypted_password
String :timezone
- column :platform_user_id, :uuid, default: Sequel.function(:uuid_generate_v4), unique: true
- column :platform_token, :uuid, default: Sequel.function(:uuid_generate_v4), unique: true
- column :platform_token_secret, :uuid, default: Sequel.function(:uuid_generate_v4), unique: true
+ column :platform_user_id
+ column :platform_token, :uuid
+ column :platform_token_secret
Time :created_at
Time :updated_at
|
Remove defaults from user creds
|
diff --git a/test/test_wepay_rails_authorize.rb b/test/test_wepay_rails_authorize.rb
index abc1234..def5678 100644
--- a/test/test_wepay_rails_authorize.rb
+++ b/test/test_wepay_rails_authorize.rb
@@ -0,0 +1,28 @@+require File.expand_path(File.dirname(__FILE__) + '/helper')
+
+class TestWepayRailsAuthorize < ActiveSupport::TestCase
+ def setup
+ create_wepay_config_file(false, true)
+ initialize_wepay_config
+ @gateway = WepayRails::Payments::Gateway.new
+ end
+
+ def teardown
+ delete_wepay_config_file
+ end
+
+ test "WePay gateway should have correct authorize url" do
+ @url = @gateway.auth_code_url("http://www.example.com")
+ assert @url.match("https://stage.wepay.com/v2/oauth2/authorize"), "<https://stage.wepay.com/v2/oauth2/authorize> expected but was #{@url}"
+ end
+
+ test "should raise errors when authorizing an invalid auth code" do
+ assert_raise WepayRails::Exceptions::ExpiredTokenError do
+ @gateway.get_access_token("authCode", "http://www.example.com")
+ end
+ end
+
+ # ToDo: Need to add test for actual authorization process, but we first need a valid auth code
+ # to exchange for an access token without raising errors. Not sure the best way to simulate
+ # this process within the test suite.
+end
|
Add tests for WePay authorization methods.
|
diff --git a/lib/authentication.rb b/lib/authentication.rb
index abc1234..def5678 100644
--- a/lib/authentication.rb
+++ b/lib/authentication.rb
@@ -1,7 +1,7 @@ module FlickrCli
module Authentication
def self.establish_session
- auth_file = File.expand_path("~/.flick_airliftrc")
+ auth_file = File.join(Dir.home, ".flickr_clirc")
FlickRaw.api_key = "e8505c88feb2c0cc9d2da6bcbe18767c"
FlickRaw.shared_secret = "d344de362ea86f0e"
|
Store credentials in a different file than flickr_airlift does - Use Ruby 1.9's Dir.home function for cross-platformitude
|
diff --git a/lib/bootstrap-sass.rb b/lib/bootstrap-sass.rb
index abc1234..def5678 100644
--- a/lib/bootstrap-sass.rb
+++ b/lib/bootstrap-sass.rb
@@ -18,7 +18,7 @@ raise Bootstrap::FrameworkNotFound, "bootstrap-sass requires either Rails > 3.1 or Compass, neither of which are loaded"
end
stylesheets = File.expand_path(File.join("..", 'vendor', 'assets', 'stylesheets'))
- Sass.load_paths << stylesheets
+ ::Sass.load_paths << stylesheets
end
private
|
Fix namespace Sass module due to conflict with bootstra-sass-rails
No one should really use the two together, but in case they do, or in case any other library defines a Bootstrap::Sass module, we should be clear that we mean the global core Sass module here. Fixes thomas-mcdonald/bootstrap-sass#293
|
diff --git a/test/lib/caruby/util/partial_order_test.rb b/test/lib/caruby/util/partial_order_test.rb
index abc1234..def5678 100644
--- a/test/lib/caruby/util/partial_order_test.rb
+++ b/test/lib/caruby/util/partial_order_test.rb
@@ -6,36 +6,37 @@ class Queued
include PartialOrder
- attr_reader :value, :queue
+ attr_reader :queue
- def initialize(value, on)
- @value = value
+ def initialize(on)
@queue = on.push(self)
end
def <=>(other)
- value <=> other.value if queue.equal?(other.queue)
+ queue.index(self) <=> other.queue.index(other) if queue.equal?(other.queue)
end
end
class PartialOrderTest < Test::Unit::TestCase
def test_same_queue
- @a = Queued.new(1, [])
- assert_equal(@a, @a.dup, "Same value, queue not equal")
+ q = []
+ a = Queued.new(q)
+ assert_equal(a, a, "Same value, queue not equal")
end
def test_different_eql_queue
- @a = Queued.new(1, [])
- @b = Queued.new(1, [])
- assert_nil(@a <=> @b, "Same value, different queue <=> not nil")
- assert_not_equal(@a, @b, "Same value, different queue is equal")
+ a = Queued.new([])
+ @b = Queued.new([])
+ assert_nil(a <=> @b, "Same value, different queue <=> not nil")
+ assert_not_equal(a, @b, "Same value, different queue is equal")
end
def test_less_than
- @a = Queued.new(1, [])
- @b = Queued.new(2, @a.queue)
- @c = Queued.new(2, [])
- assert(@a < @b, "Comparison incorrect")
- assert_nil(@a < @c, "Comparison incorrect")
+ q = []
+ a = Queued.new(q)
+ b = Queued.new(q)
+ c = Queued.new([])
+ assert(a < b, "Comparison incorrect")
+ assert_nil(a < c, "Comparison incorrect")
end
end
|
Make i.v. temp variable instead.
|
diff --git a/lib/proteus/kit.rb b/lib/proteus/kit.rb
index abc1234..def5678 100644
--- a/lib/proteus/kit.rb
+++ b/lib/proteus/kit.rb
@@ -16,7 +16,9 @@
if system "git ls-remote #{url(kit_name)} #{repo_name} > /dev/null 2>&1"
puts "Starting a new proteus-#{kit_name} project in #{repo_name}"
- system "git clone #{url(kit_name)}#{' ' + repo_name}"
+ system "git clone #{url(kit_name)}#{' ' + repo_name} && "\
+ "rm -rf #{repo_name}/.git && "\
+ "git init #{repo_name}"
else
puts "A thoughtbot repo doesn't exist with that name"
end
|
Destroy the existing .git folder and make a new one (so the user has a clean history)
|
diff --git a/lib/rusty_blank.rb b/lib/rusty_blank.rb
index abc1234..def5678 100644
--- a/lib/rusty_blank.rb
+++ b/lib/rusty_blank.rb
@@ -1,7 +1,8 @@ require 'fiddle'
require 'rbconfig'
-library = Fiddle.dlopen("librusty_blank.#{RbConfig::CONFIG['DLEXT']}")
+basename = "librusty_blank.#{RbConfig::CONFIG['DLEXT']}"
+library = Fiddle.dlopen(File.join(File.dirname(__FILE__), basename))
func = Fiddle::Function.new(library['init_rusty_blank'],
[], Fiddle::TYPE_VOIDP)
func.call
|
Fix loading of the compiled library
|
diff --git a/lib/middleman-blog-drafts/draft_article.rb b/lib/middleman-blog-drafts/draft_article.rb
index abc1234..def5678 100644
--- a/lib/middleman-blog-drafts/draft_article.rb
+++ b/lib/middleman-blog-drafts/draft_article.rb
@@ -16,7 +16,8 @@ # @param [String] The part of the path, e.g. "title"
# @return [String]
def path_part(part)
- @_path_parts ||= blog_data.drafts.source_template.extract(path)
+ normalized_path = Addressable::URI.parse(path).normalize.to_s
+ @_path_parts ||= blog_data.drafts.source_template.extract(normalized_path)
@_path_parts[part.to_s]
end
|
Fix failure on handling the path containing non-uri chars
In `DraftArticle#path_part`, `Addressable::Template#extract`
returns `nil` when `path` has characters not allowed for
URI (RFC3986) so that `DraftArticle#slug` fails for undefined `[]`.
Normalizing (percent-encoding) `path` string before `extract`
prevents its failure.
Characters outside the allowed set are Greek, Cyrillic or Japanese for example.
see http://www.ietf.org/rfc/rfc3986.txt
|
diff --git a/lib/paperclip/geometry_detector_factory.rb b/lib/paperclip/geometry_detector_factory.rb
index abc1234..def5678 100644
--- a/lib/paperclip/geometry_detector_factory.rb
+++ b/lib/paperclip/geometry_detector_factory.rb
@@ -14,9 +14,14 @@
def geometry_string
begin
- silence_stream(STDERR) do
- Paperclip.run("identify", "-format '%wx%h,%[exif:orientation]' :file", :file => "#{path}[0]")
- end
+ Paperclip.run(
+ "identify",
+ "-format '%wx%h,%[exif:orientation]' :file", {
+ :file => "#{path}[0]"
+ }, {
+ :swallow_stderr => true
+ }
+ )
rescue Cocaine::ExitStatusError
""
rescue Cocaine::CommandNotFoundError => e
|
Use :swallow_stderr instead of not thread safe silence_stream(STDERR)
|
diff --git a/lib/commands/raker.rb b/lib/commands/raker.rb
index abc1234..def5678 100644
--- a/lib/commands/raker.rb
+++ b/lib/commands/raker.rb
@@ -8,8 +8,8 @@ load_rake_tasks
end
- def rake(task = nil, *args)
- task.nil? ? print_rake_tasks : invoke_rake_task(task, *args)
+ def rake(task = nil)
+ task.nil? ? print_rake_tasks : invoke_rake_task(task)
"Completed"
rescue SystemExit, RuntimeError => e
"Failed: #{e.message}"
@@ -28,9 +28,33 @@ Rake.application.display_tasks_and_comments
end
- def invoke_rake_task(task, *args)
- Rake::Task[task].invoke(*args)
+ def invoke_rake_task(task)
+ task, *options = task.split(" ")
+
+ ARGV.replace options
+
+ # FIXME: Before we can use this, we need a way to reset the options again
+ # Rake.application.handle_options
+
+ expose_argv_arguments_via_env { Rake::Task[task].invoke }
Rake.application.tasks.each(&:reenable) # Rake by default only allows tasks to be run once per session
+ ensure
+ ARGV.replace([])
+ end
+
+ def expose_argv_arguments_via_env
+ argv_arguments.each { |key, value| ENV[key] = value }
+ yield
+ ensure
+ argv_arguments.keys.each { |key| ENV.delete(key) }
+ end
+
+ def argv_arguments
+ ARGV.each_with_object({}) do |arg, arguments|
+ if arg =~ /^(\w+)=(.*)$/
+ arguments[$1] = $2
+ end
+ end
end
end
end
|
Allow you to set Rake ENV options as part of the call (still missing a way to set rake options like --trace)
|
diff --git a/db/migrate/20150617152323_create_votes.rb b/db/migrate/20150617152323_create_votes.rb
index abc1234..def5678 100644
--- a/db/migrate/20150617152323_create_votes.rb
+++ b/db/migrate/20150617152323_create_votes.rb
@@ -0,0 +1,12 @@+class CreateVotes < ActiveRecord::Migration
+ def change
+ create_table :votes do |t|
+ t.integer :value
+ t.integer :voter_id
+ t.integer :voteable_id
+ t.string :voteable_type
+
+ t.timestamps
+ end
+ end
+end
|
Add votes schema for migration
|
diff --git a/01-sendPositionToChat.rb b/01-sendPositionToChat.rb
index abc1234..def5678 100644
--- a/01-sendPositionToChat.rb
+++ b/01-sendPositionToChat.rb
@@ -13,8 +13,7 @@
# Get the block that the player is currently in
playerPosition = mc.player.getTilePos()
-# Get the exact position of the player
-playerPosFLoat = mc.player.getPos()
+
# create the output message as a string
message = "You are at( #{playerPosition.x}, #{playerPosition.y}, #{playerPosition.z})"
|
Remove unused exact position method call
Remove unused call and place in another separate example
|
diff --git a/lib/jiraMule/query.rb b/lib/jiraMule/query.rb
index abc1234..def5678 100644
--- a/lib/jiraMule/query.rb
+++ b/lib/jiraMule/query.rb
@@ -6,7 +6,7 @@ c.example 'Get Open issues and dump everything', %{jm query status=Open --fields "" --json}
c.option '--[no-]raw', 'Do not prefix query with project and assignee'
c.option '--[no-]json', 'Output json reply instead of summary'
- c.option '--fields FIELDS', Array, ''
+ c.option '--fields FIELDS', Array, 'Which fields to return. Set to empty to get all fields.'
c.action do |args, options|
options.defaults :json => false
jira = JiraUtils.new(args, options)
|
Add description to fields option.
|
diff --git a/Casks/ghc.rb b/Casks/ghc.rb
index abc1234..def5678 100644
--- a/Casks/ghc.rb
+++ b/Casks/ghc.rb
@@ -0,0 +1,8 @@+class Ghc < Cask
+ url 'https://github.com/ghcformacosx/ghc-dot-app/releases/download/v7.8.2-r2/ghc-7.8.2-r2.zip'
+ homepage 'http://ghcformacosx.github.io/'
+ version '7.8.2-r2'
+ sha256 '7e9de6d9d772f42ab0b31bc234de86ebe302d5bd3f0c057253377950e8020197'
+ link 'ghc-7.8.2.app'
+ caveats 'To add GHC to your PATH, launch the app and follow the included instructions.'
+end
|
Add GHC for Mac OS X
|
diff --git a/config/initializers/carrierwave.rb b/config/initializers/carrierwave.rb
index abc1234..def5678 100644
--- a/config/initializers/carrierwave.rb
+++ b/config/initializers/carrierwave.rb
@@ -15,7 +15,7 @@ config.fog_directory = AWS_CONFIG['bucket'] # required
config.fog_public = false # optional, defaults to true
config.fog_attributes = {'Cache-Control'=>'max-age=315576000'} # optional, defaults to {}
- config.fog_authenticated_url_expiration = 1 << 30 # optional time (in seconds) that authenticated urls will be valid.
+ config.fog_authenticated_url_expiration = 1 << 29 # optional time (in seconds) that authenticated urls will be valid.
# when fog_public is false and provider is AWS or Google, defaults to 600
end
end
|
Reduce Fog expiration period to 17 years
|
diff --git a/config/initializers/session_ext.rb b/config/initializers/session_ext.rb
index abc1234..def5678 100644
--- a/config/initializers/session_ext.rb
+++ b/config/initializers/session_ext.rb
@@ -0,0 +1,26 @@+module ActionDispatch
+ class Request
+ class Session
+ alias_method :original_accessor, :[]
+ alias_method :original_mutator, :[]=
+
+ def [](key)
+ original_accessor(alternate_key_for_flash(key))
+ end
+
+ def []=(key, value)
+ original_mutator(alternate_key_for_flash(key), value)
+ end
+
+ private
+
+ def alternate_key_for_flash(key)
+ if key == 'flash'
+ 'flash_responsive'
+ else
+ key
+ end
+ end
+ end
+ end
+end
|
Store flash messages in a different session variable
Avoids conflict with how Rails 3/public_website deals with flash messages
|
diff --git a/lib/mactag/builder.rb b/lib/mactag/builder.rb
index abc1234..def5678 100644
--- a/lib/mactag/builder.rb
+++ b/lib/mactag/builder.rb
@@ -45,7 +45,7 @@ if builder.has_gems?
Mactag::Ctags.new(@builder.files, Mactag::Config.tags_file).create
- puts 'Successfully generated TAGS file'
+ puts "Successfully generated #{Mactag::Config.tags_file} file"
else
raise Mactag::MactagError.new('Nothing to tag')
end
|
Print name of file instead of assuming TAGS.
|
diff --git a/lib/minuteman/user.rb b/lib/minuteman/user.rb
index abc1234..def5678 100644
--- a/lib/minuteman/user.rb
+++ b/lib/minuteman/user.rb
@@ -9,8 +9,11 @@ unique :uid
unique :identifier
+ index :identifier
+
def save
self.uid ||= SecureRandom.uuid
+ self.identifier ||= ""
super
end
|
Add an identifier index for anonymous lookups
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.