author int64 658 755k | date stringlengths 19 19 | timezone int64 -46,800 43.2k | hash stringlengths 40 40 | message stringlengths 5 490 | mods list | language stringclasses 20 values | license stringclasses 3 values | repo stringlengths 5 68 | original_message stringlengths 12 491 |
|---|---|---|---|---|---|---|---|---|---|
287,654 | 05.09.2017 11:22:14 | 25,200 | 094e263b82bca58a18a53d7dad7b0b2cae1efc60 | Use https for links. | [
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/cli/test.rb",
"new_path": "lib/honeybadger/cli/test.rb",
"diff": "@@ -237,11 +237,11 @@ Honeybadger. For now, we've generated a test exception for you:\nOptional steps:\n- Show a feedback form on your error page:\n- http://docs.honeybadger.io/gem-feedback\n+ https://docs.honeybadger.io/gem-feedback\n- Show a UUID or link to Honeybadger on your error page:\n- http://docs.honeybadger.io/gem-informer\n+ https://docs.honeybadger.io/gem-informer\n- Track deployments (if you're using Capistrano, we already did this):\n- http://docs.honeybadger.io/gem-deploys\n+ https://docs.honeybadger.io/gem-deploys\nIf you ever need help:\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Use https for links. |
287,654 | 05.09.2017 14:25:26 | 25,200 | 7dec93d0c075d651d739cd460e31ec56d81bab53 | Update gemfiles. | [
{
"change_type": "MODIFY",
"old_path": "gemfiles/.bundle/config",
"new_path": "gemfiles/.bundle/config",
"diff": "---\n-BUNDLE_WITHOUT: development\n+BUNDLE_WITHOUT: \"development\"\n+BUNDLE_RETRY: \"1\"\n"
},
{
"change_type": "MODIFY",
"old_path": "gemfiles/binding_of_caller.gemfile",
"new_path": "gemfiles/binding_of_caller.gemfile",
"diff": "source \"https://rubygems.org\"\n-gem \"allocation_stats\", :platforms => :mri, :require => false\n+gem \"allocation_stats\", platforms: :mri, require: false\ngem \"appraisal\", \"~> 2.1\"\ngem \"aruba\", \"~> 0.14\"\ngem \"guard\"\ngem \"guard-rspec\"\ngem \"pry\"\n-gem \"pry-byebug\", :platforms => :mri\n+gem \"pry-byebug\", platforms: :mri\ngem \"rdoc\"\ngem \"rspec\", \"~> 3.0\"\ngem \"rspec-its\"\n-gem \"ruby-prof\", :platforms => :mri, :require => false\n+gem \"ruby-prof\", platforms: :mri, require: false\ngem \"timecop\"\ngem \"webmock\"\ngem \"capistrano\"\n@@ -20,4 +20,4 @@ gem \"rake\"\ngem \"listen\", \"~> 3.0.8\"\ngem \"binding_of_caller\"\n-gemspec :path => \"../\"\n+gemspec path: \"../\"\n"
},
{
"change_type": "MODIFY",
"old_path": "gemfiles/delayed_job.gemfile",
"new_path": "gemfiles/delayed_job.gemfile",
"diff": "source \"https://rubygems.org\"\n-gem \"allocation_stats\", :platforms => :mri, :require => false\n+gem \"allocation_stats\", platforms: :mri, require: false\ngem \"appraisal\", \"~> 2.1\"\ngem \"aruba\", \"~> 0.14\"\ngem \"guard\"\ngem \"guard-rspec\"\ngem \"pry\"\n-gem \"pry-byebug\", :platforms => :mri\n+gem \"pry-byebug\", platforms: :mri\ngem \"rdoc\"\ngem \"rspec\", \"~> 3.0\"\ngem \"rspec-its\"\n-gem \"ruby-prof\", :platforms => :mri, :require => false\n+gem \"ruby-prof\", platforms: :mri, require: false\ngem \"timecop\"\ngem \"webmock\"\ngem \"capistrano\"\n@@ -20,4 +20,4 @@ gem \"rake\"\ngem \"listen\", \"~> 3.0.8\"\ngem \"delayed_job\", \"< 4.1.2\"\n-gemspec :path => \"../\"\n+gemspec path: \"../\"\n"
},
{
"change_type": "MODIFY",
"old_path": "gemfiles/rack.gemfile",
"new_path": "gemfiles/rack.gemfile",
"diff": "source \"https://rubygems.org\"\n-gem \"allocation_stats\", :platforms => :mri, :require => false\n+gem \"allocation_stats\", platforms: :mri, require: false\ngem \"appraisal\", \"~> 2.1\"\ngem \"aruba\", \"~> 0.14\"\ngem \"guard\"\ngem \"guard-rspec\"\ngem \"pry\"\n-gem \"pry-byebug\", :platforms => :mri\n+gem \"pry-byebug\", platforms: :mri\ngem \"rdoc\"\ngem \"rspec\", \"~> 3.0\"\ngem \"rspec-its\"\n-gem \"ruby-prof\", :platforms => :mri, :require => false\n+gem \"ruby-prof\", platforms: :mri, require: false\ngem \"timecop\"\ngem \"webmock\"\ngem \"capistrano\"\n@@ -20,4 +20,4 @@ gem \"rake\"\ngem \"listen\", \"~> 3.0.8\"\ngem \"rack\", \">= 2.0.0\"\n-gemspec :path => \"../\"\n+gemspec path: \"../\"\n"
},
{
"change_type": "MODIFY",
"old_path": "gemfiles/rack_1.gemfile",
"new_path": "gemfiles/rack_1.gemfile",
"diff": "source \"https://rubygems.org\"\n-gem \"allocation_stats\", :platforms => :mri, :require => false\n+gem \"allocation_stats\", platforms: :mri, require: false\ngem \"appraisal\", \"~> 2.1\"\ngem \"aruba\", \"~> 0.14\"\ngem \"guard\"\ngem \"guard-rspec\"\ngem \"pry\"\n-gem \"pry-byebug\", :platforms => :mri\n+gem \"pry-byebug\", platforms: :mri\ngem \"rdoc\"\ngem \"rspec\", \"~> 3.0\"\ngem \"rspec-its\"\n-gem \"ruby-prof\", :platforms => :mri, :require => false\n+gem \"ruby-prof\", platforms: :mri, require: false\ngem \"timecop\"\ngem \"webmock\"\ngem \"capistrano\"\n@@ -20,4 +20,4 @@ gem \"rake\"\ngem \"listen\", \"~> 3.0.8\"\ngem \"rack\", \"< 2.0\"\n-gemspec :path => \"../\"\n+gemspec path: \"../\"\n"
},
{
"change_type": "MODIFY",
"old_path": "gemfiles/rails.gemfile",
"new_path": "gemfiles/rails.gemfile",
"diff": "source \"https://rubygems.org\"\n-gem \"allocation_stats\", :platforms => :mri, :require => false\n+gem \"allocation_stats\", platforms: :mri, require: false\ngem \"appraisal\", \"~> 2.1\"\ngem \"aruba\", \"~> 0.14\"\ngem \"guard\"\ngem \"guard-rspec\"\ngem \"pry\"\n-gem \"pry-byebug\", :platforms => :mri\n+gem \"pry-byebug\", platforms: :mri\ngem \"rdoc\"\ngem \"rspec\", \"~> 3.0\"\ngem \"rspec-its\"\n-gem \"ruby-prof\", :platforms => :mri, :require => false\n+gem \"ruby-prof\", platforms: :mri, require: false\ngem \"timecop\"\ngem \"webmock\"\ngem \"capistrano\", \"~> 3.0\"\ngem \"rake\"\ngem \"listen\"\n-gem \"rails\", :github => \"rails/rails\"\n-gem \"rack\", :github => \"rack/rack\"\n-gem \"arel\", :github => \"rails/arel\"\n-gem \"better_errors\", :require => false, :platforms => [:ruby_20, :ruby_21]\n+gem \"rails\", github: \"rails/rails\"\n+gem \"rack\", github: \"rack/rack\"\n+gem \"arel\", github: \"rails/arel\"\n+gem \"better_errors\", require: false, platforms: [:ruby_20, :ruby_21]\ngem \"rspec-rails\"\n-gemspec :path => \"../\"\n+gemspec path: \"../\"\n"
},
{
"change_type": "MODIFY",
"old_path": "gemfiles/rails3.2.gemfile",
"new_path": "gemfiles/rails3.2.gemfile",
"diff": "source \"https://rubygems.org\"\n-gem \"allocation_stats\", :platforms => :mri, :require => false\n+gem \"allocation_stats\", platforms: :mri, require: false\ngem \"appraisal\", \"~> 2.1\"\ngem \"aruba\", \"~> 0.14\"\ngem \"guard\"\ngem \"guard-rspec\"\ngem \"pry\"\n-gem \"pry-byebug\", :platforms => :mri\n+gem \"pry-byebug\", platforms: :mri\ngem \"rdoc\"\ngem \"rspec\", \"~> 3.0\"\ngem \"rspec-its\"\n-gem \"ruby-prof\", :platforms => :mri, :require => false\n+gem \"ruby-prof\", platforms: :mri, require: false\ngem \"timecop\"\ngem \"webmock\"\ngem \"capistrano\", \"~> 2.0\"\ngem \"rake\"\ngem \"listen\", \"~> 3.0.8\"\ngem \"rails\", \"~> 3.2.12\"\n-gem \"better_errors\", :require => false, :platforms => [:ruby_20, :ruby_21]\n-gem \"rack-mini-profiler\", :require => false\n+gem \"better_errors\", require: false, platforms: [:ruby_20, :ruby_21]\n+gem \"rack-mini-profiler\", require: false\ngem \"rspec-rails\"\ngem \"test-unit\", \"~> 3.0\"\n-gemspec :path => \"../\"\n+gemspec path: \"../\"\n"
},
{
"change_type": "MODIFY",
"old_path": "gemfiles/rails4.0.gemfile",
"new_path": "gemfiles/rails4.0.gemfile",
"diff": "source \"https://rubygems.org\"\n-gem \"allocation_stats\", :platforms => :mri, :require => false\n+gem \"allocation_stats\", platforms: :mri, require: false\ngem \"appraisal\", \"~> 2.1\"\ngem \"aruba\", \"~> 0.14\"\ngem \"guard\"\ngem \"guard-rspec\"\ngem \"pry\"\n-gem \"pry-byebug\", :platforms => :mri\n+gem \"pry-byebug\", platforms: :mri\ngem \"rdoc\"\ngem \"rspec\", \"~> 3.0\"\ngem \"rspec-its\"\n-gem \"ruby-prof\", :platforms => :mri, :require => false\n+gem \"ruby-prof\", platforms: :mri, require: false\ngem \"timecop\"\ngem \"webmock\"\ngem \"capistrano\"\ngem \"rake\"\ngem \"listen\", \"~> 3.0.8\"\ngem \"rails\", \"~> 4.0.0\"\n-gem \"better_errors\", :require => false, :platforms => [:ruby_20, :ruby_21]\n-gem \"rack-mini-profiler\", :require => false\n+gem \"better_errors\", require: false, platforms: [:ruby_20, :ruby_21]\n+gem \"rack-mini-profiler\", require: false\ngem \"rspec-rails\"\n-gemspec :path => \"../\"\n+gemspec path: \"../\"\n"
},
{
"change_type": "MODIFY",
"old_path": "gemfiles/rails4.1.gemfile",
"new_path": "gemfiles/rails4.1.gemfile",
"diff": "source \"https://rubygems.org\"\n-gem \"allocation_stats\", :platforms => :mri, :require => false\n+gem \"allocation_stats\", platforms: :mri, require: false\ngem \"appraisal\", \"~> 2.1\"\ngem \"aruba\", \"~> 0.14\"\ngem \"guard\"\ngem \"guard-rspec\"\ngem \"pry\"\n-gem \"pry-byebug\", :platforms => :mri\n+gem \"pry-byebug\", platforms: :mri\ngem \"rdoc\"\ngem \"rspec\", \"~> 3.0\"\ngem \"rspec-its\"\n-gem \"ruby-prof\", :platforms => :mri, :require => false\n+gem \"ruby-prof\", platforms: :mri, require: false\ngem \"timecop\"\ngem \"webmock\"\ngem \"capistrano\"\ngem \"rake\"\ngem \"listen\", \"~> 3.0.8\"\ngem \"rails\", \"~> 4.1.4\"\n-gem \"better_errors\", :require => false, :platforms => [:ruby_20, :ruby_21]\n-gem \"rack-mini-profiler\", :require => false\n+gem \"better_errors\", require: false, platforms: [:ruby_20, :ruby_21]\n+gem \"rack-mini-profiler\", require: false\ngem \"rspec-rails\"\n-gemspec :path => \"../\"\n+gemspec path: \"../\"\n"
},
{
"change_type": "MODIFY",
"old_path": "gemfiles/rails4.2.gemfile",
"new_path": "gemfiles/rails4.2.gemfile",
"diff": "source \"https://rubygems.org\"\n-gem \"allocation_stats\", :platforms => :mri, :require => false\n+gem \"allocation_stats\", platforms: :mri, require: false\ngem \"appraisal\", \"~> 2.1\"\ngem \"aruba\", \"~> 0.14\"\ngem \"guard\"\ngem \"guard-rspec\"\ngem \"pry\"\n-gem \"pry-byebug\", :platforms => :mri\n+gem \"pry-byebug\", platforms: :mri\ngem \"rdoc\"\ngem \"rspec\", \"~> 3.0\"\ngem \"rspec-its\"\n-gem \"ruby-prof\", :platforms => :mri, :require => false\n+gem \"ruby-prof\", platforms: :mri, require: false\ngem \"timecop\"\ngem \"webmock\"\ngem \"capistrano\"\ngem \"rake\"\ngem \"listen\", \"~> 3.0.8\"\ngem \"rails\", \"~> 4.2.4\"\n-gem \"better_errors\", :require => false, :platforms => [:ruby_20, :ruby_21]\n-gem \"rack-mini-profiler\", :require => false\n+gem \"better_errors\", require: false, platforms: [:ruby_20, :ruby_21]\n+gem \"rack-mini-profiler\", require: false\ngem \"rspec-rails\"\n-gemspec :path => \"../\"\n+gemspec path: \"../\"\n"
},
{
"change_type": "MODIFY",
"old_path": "gemfiles/rails5.0.gemfile",
"new_path": "gemfiles/rails5.0.gemfile",
"diff": "source \"https://rubygems.org\"\n-gem \"allocation_stats\", :platforms => :mri, :require => false\n+gem \"allocation_stats\", platforms: :mri, require: false\ngem \"appraisal\", \"~> 2.1\"\ngem \"aruba\", \"~> 0.14\"\ngem \"guard\"\ngem \"guard-rspec\"\ngem \"pry\"\n-gem \"pry-byebug\", :platforms => :mri\n+gem \"pry-byebug\", platforms: :mri\ngem \"rdoc\"\ngem \"rspec\", \"~> 3.0\"\ngem \"rspec-its\"\n-gem \"ruby-prof\", :platforms => :mri, :require => false\n+gem \"ruby-prof\", platforms: :mri, require: false\ngem \"timecop\"\ngem \"webmock\"\ngem \"capistrano\"\ngem \"rake\"\ngem \"listen\", \"~> 3.0.8\"\ngem \"rails\", \"~> 5.0.0\"\n-gem \"better_errors\", :require => false, :platforms => [:ruby_20, :ruby_21]\n-gem \"rack-mini-profiler\", :require => false\n+gem \"better_errors\", require: false, platforms: [:ruby_20, :ruby_21]\n+gem \"rack-mini-profiler\", require: false\ngem \"rspec-rails\"\n-gemspec :path => \"../\"\n+gemspec path: \"../\"\n"
},
{
"change_type": "MODIFY",
"old_path": "gemfiles/rails5.1.gemfile",
"new_path": "gemfiles/rails5.1.gemfile",
"diff": "source \"https://rubygems.org\"\n-gem \"allocation_stats\", :platforms => :mri, :require => false\n+gem \"allocation_stats\", platforms: :mri, require: false\ngem \"appraisal\", \"~> 2.1\"\ngem \"aruba\", \"~> 0.14\"\ngem \"guard\"\ngem \"guard-rspec\"\ngem \"pry\"\n-gem \"pry-byebug\", :platforms => :mri\n+gem \"pry-byebug\", platforms: :mri\ngem \"rdoc\"\ngem \"rspec\", \"~> 3.0\"\ngem \"rspec-its\"\n-gem \"ruby-prof\", :platforms => :mri, :require => false\n+gem \"ruby-prof\", platforms: :mri, require: false\ngem \"timecop\"\ngem \"webmock\"\ngem \"capistrano\"\ngem \"rake\"\ngem \"listen\", \"~> 3.0.8\"\ngem \"rails\", \"~> 5.1.0\"\n-gem \"better_errors\", :require => false, :platforms => [:ruby_20, :ruby_21]\n-gem \"rack-mini-profiler\", :require => false\n+gem \"better_errors\", require: false, platforms: [:ruby_20, :ruby_21]\n+gem \"rack-mini-profiler\", require: false\ngem \"rspec-rails\"\n-gemspec :path => \"../\"\n+gemspec path: \"../\"\n"
},
{
"change_type": "MODIFY",
"old_path": "gemfiles/resque.gemfile",
"new_path": "gemfiles/resque.gemfile",
"diff": "source \"https://rubygems.org\"\n-gem \"allocation_stats\", :platforms => :mri, :require => false\n+gem \"allocation_stats\", platforms: :mri, require: false\ngem \"appraisal\", \"~> 2.1\"\ngem \"aruba\", \"~> 0.14\"\ngem \"guard\"\ngem \"guard-rspec\"\ngem \"pry\"\n-gem \"pry-byebug\", :platforms => :mri\n+gem \"pry-byebug\", platforms: :mri\ngem \"rdoc\"\ngem \"rspec\", \"~> 3.0\"\ngem \"rspec-its\"\n-gem \"ruby-prof\", :platforms => :mri, :require => false\n+gem \"ruby-prof\", platforms: :mri, require: false\ngem \"timecop\"\ngem \"webmock\"\ngem \"capistrano\"\n@@ -21,4 +21,4 @@ gem \"listen\", \"~> 3.0.8\"\ngem \"resque\"\ngem \"mock_redis\"\n-gemspec :path => \"../\"\n+gemspec path: \"../\"\n"
},
{
"change_type": "MODIFY",
"old_path": "gemfiles/sinatra.gemfile",
"new_path": "gemfiles/sinatra.gemfile",
"diff": "source \"https://rubygems.org\"\n-gem \"allocation_stats\", :platforms => :mri, :require => false\n+gem \"allocation_stats\", platforms: :mri, require: false\ngem \"appraisal\", \"~> 2.1\"\ngem \"aruba\", \"~> 0.14\"\ngem \"guard\"\ngem \"guard-rspec\"\ngem \"pry\"\n-gem \"pry-byebug\", :platforms => :mri\n+gem \"pry-byebug\", platforms: :mri\ngem \"rdoc\"\ngem \"rspec\", \"~> 3.0\"\ngem \"rspec-its\"\n-gem \"ruby-prof\", :platforms => :mri, :require => false\n+gem \"ruby-prof\", platforms: :mri, require: false\ngem \"timecop\"\ngem \"webmock\"\ngem \"capistrano\"\n@@ -21,4 +21,4 @@ gem \"listen\", \"~> 3.0.8\"\ngem \"sinatra\", \"~> 2.0.0.beta1\"\ngem \"rack-test\"\n-gemspec :path => \"../\"\n+gemspec path: \"../\"\n"
},
{
"change_type": "MODIFY",
"old_path": "gemfiles/sinatra_1.gemfile",
"new_path": "gemfiles/sinatra_1.gemfile",
"diff": "source \"https://rubygems.org\"\n-gem \"allocation_stats\", :platforms => :mri, :require => false\n+gem \"allocation_stats\", platforms: :mri, require: false\ngem \"appraisal\", \"~> 2.1\"\ngem \"aruba\", \"~> 0.14\"\ngem \"guard\"\ngem \"guard-rspec\"\ngem \"pry\"\n-gem \"pry-byebug\", :platforms => :mri\n+gem \"pry-byebug\", platforms: :mri\ngem \"rdoc\"\ngem \"rspec\", \"~> 3.0\"\ngem \"rspec-its\"\n-gem \"ruby-prof\", :platforms => :mri, :require => false\n+gem \"ruby-prof\", platforms: :mri, require: false\ngem \"timecop\"\ngem \"webmock\"\ngem \"capistrano\"\n@@ -21,4 +21,4 @@ gem \"listen\", \"~> 3.0.8\"\ngem \"sinatra\", \"< 2.0\"\ngem \"rack-test\"\n-gemspec :path => \"../\"\n+gemspec path: \"../\"\n"
},
{
"change_type": "MODIFY",
"old_path": "gemfiles/standalone.gemfile",
"new_path": "gemfiles/standalone.gemfile",
"diff": "source \"https://rubygems.org\"\n-gem \"allocation_stats\", :platforms => :mri, :require => false\n+gem \"allocation_stats\", platforms: :mri, require: false\ngem \"appraisal\", \"~> 2.1\"\ngem \"aruba\", \"~> 0.14\"\ngem \"guard\"\ngem \"guard-rspec\"\ngem \"pry\"\n-gem \"pry-byebug\", :platforms => :mri\n+gem \"pry-byebug\", platforms: :mri\ngem \"rdoc\"\ngem \"rspec\", \"~> 3.0\"\ngem \"rspec-its\"\n-gem \"ruby-prof\", :platforms => :mri, :require => false\n+gem \"ruby-prof\", platforms: :mri, require: false\ngem \"timecop\"\ngem \"webmock\"\ngem \"capistrano\"\ngem \"rake\"\ngem \"listen\", \"~> 3.0.8\"\n-gemspec :path => \"../\"\n+gemspec path: \"../\"\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Update gemfiles. |
287,654 | 06.09.2017 19:01:06 | 25,200 | 2533c8b71df2897d87e2e2f39ec618be47405b80 | Coerce context from #to_honeybadger_context when defined. | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "@@ -8,9 +8,10 @@ adheres to [Semantic Versioning](http://semver.org/).\n- The exception cause may now be set using an optional `:cause` option when\ncalling `Honeybadger.notify`. If not present, the exception's cause will be\nused, or the global `$!` exception if available.\n-- Context can now be added to any exception object by defining the\n- `#honeybadger_context` method. The method should have no arguments and return\n- a `Hash` of context data.\n+- Any object can now act as context using the `#to_honeybadger_context` method.\n+ The method should have no arguments and return a `Hash` of context data.\n+ Context from exceptions which define this method will automatically be\n+ included in error reports.\n### Fixed\n- We no longer use \"/dev/null\" as the default log device as it doesn't exist on\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/agent.rb",
"new_path": "lib/honeybadger/agent.rb",
"diff": "@@ -145,9 +145,11 @@ module Honeybadger\n# Public: Save global context for the current request.\n#\n- # hash - A Hash of data which will be sent to Honeybadger when an error\n- # occurs; can include any key/value, but a few keys have a special meaning\n- # in Honeybadger (default: nil):\n+ # context - A Hash of data which will be sent to Honeybadger when an error\n+ # occurs. If the object responds to #to_honeybadger_context, the return\n+ # value of that method will be used (explicit conversion). Can\n+ # include any key/value, but a few keys have a special meaning in\n+ # Honeybadger (default: nil):\n# :user_id - The String user ID used by Honeybadger to aggregate\n# user data across occurrences on the error page (optional).\n# :user_email - The String user email address (optional).\n@@ -163,12 +165,22 @@ module Honeybadger\n# Honeybadger.context({user_id: current_user.id})\n# end\n#\n+ # # Explicit conversion\n+ # class User < ActiveRecord::Base\n+ # def to_honeybadger_context\n+ # { user_id: id, user_email: email }\n+ # end\n+ # end\n+ #\n+ # user = User.first\n+ # Honeybadger.context(user)\n+ #\n# # Clearing global context:\n# Honeybadger.context.clear!\n#\n# Returns self so that method calls can be chained.\n- def context(hash = nil)\n- context_manager.set_context(hash) unless hash.nil?\n+ def context(context = nil)\n+ context_manager.set_context(context) unless context.nil?\nself\nend\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/context_manager.rb",
"new_path": "lib/honeybadger/context_manager.rb",
"diff": "+require 'honeybadger/conversions'\n+\nmodule Honeybadger\nclass ContextManager\n+ include Conversions\ndef self.current\nThread.current[:__hb_context_manager] ||= new\n@@ -19,7 +22,7 @@ module Honeybadger\ndef set_context(hash)\n@mutex.synchronize do\n@context ||= {}\n- @context.update(hash)\n+ @context.update(Context(hash))\nend\nend\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "lib/honeybadger/conversions.rb",
"diff": "+module Honeybadger\n+ module Conversions\n+ module_function\n+\n+ # Internal: Coerce context into a Hash.\n+ #\n+ # context - The context object.\n+ #\n+ # Returns the Hash context.\n+ def Context(context)\n+ context = exception.to_honeybadger_context if context.respond_to?(:to_honeybadger_context)\n+ Hash(context)\n+ end\n+ end\n+end\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/notice.rb",
"new_path": "lib/honeybadger/notice.rb",
"diff": "@@ -4,6 +4,7 @@ require 'forwardable'\nrequire 'honeybadger/version'\nrequire 'honeybadger/backtrace'\n+require 'honeybadger/conversions'\nrequire 'honeybadger/util/stats'\nrequire 'honeybadger/util/sanitizer'\nrequire 'honeybadger/util/request_hash'\n@@ -37,6 +38,8 @@ module Honeybadger\nclass Notice\nextend Forwardable\n+ include Conversions\n+\n# Internal: The String character used to split tag strings.\nTAG_SEPERATOR = ','.freeze\n@@ -322,15 +325,15 @@ module Honeybadger\nend\ndef exception_context(exception)\n- return {}.freeze unless exception && exception.respond_to?(:honeybadger_context)\n- exception.honeybadger_context\n+ return {}.freeze unless exception.respond_to?(:to_honeybadger_context)\n+ exception.to_honeybadger_context\nend\ndef construct_context_hash(opts, exception)\ncontext = {}\n- context.merge!(opts[:global_context]) if opts[:global_context]\n- context.merge!(exception_context(exception))\n- context.merge!(opts[:context]) if opts[:context]\n+ context.merge!(Context(opts[:global_context]))\n+ context.merge!(Context(exception_context(exception)))\n+ context.merge!(Context(opts[:context]))\ncontext.empty? ? nil : context\nend\n"
},
{
"change_type": "MODIFY",
"old_path": "spec/unit/honeybadger/notice_spec.rb",
"new_path": "spec/unit/honeybadger/notice_spec.rb",
"diff": "@@ -292,7 +292,7 @@ describe Honeybadger::Notice do\nit \"merges exception context\" do\nexception = Class.new(RuntimeError) do\n- def honeybadger_context\n+ def to_honeybadger_context\n{ exception: 'exception' }\nend\nend\n@@ -309,7 +309,7 @@ describe Honeybadger::Notice do\nit \"merges context in order of precedence: local, exception, global\" do\nglobal_context = { global: 'global', local_override: 'global', exception_override: 'global' }\nexception = Class.new(RuntimeError) do\n- def honeybadger_context\n+ def to_honeybadger_context\n{ exception: 'exception', local_override: 'exception', exception_override: 'exception' }\nend\nend\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Coerce context from #to_honeybadger_context when defined. |
287,654 | 02.10.2017 14:29:30 | 25,200 | 2bc21f2ee8f4b92130cf7db29df956c48f676293 | Unset _JAVA_OPTIONS to silence output during JRuby builds. | [
{
"change_type": "MODIFY",
"old_path": ".travis.yml",
"new_path": ".travis.yml",
"diff": "@@ -3,7 +3,9 @@ branches:\n- master\nlanguage: ruby\ncache: bundler\n-before_install: gem install bundler\n+before_install:\n+ - unset _JAVA_OPTIONS\n+ - gem install bundler\nsudo: false\ngemfile:\n- gemfiles/standalone.gemfile\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Unset _JAVA_OPTIONS to silence output during JRuby builds. |
287,654 | 06.10.2017 13:37:55 | 25,200 | 0931489601adf9cc495a55474e9f18197688fa7d | Add #to_honeybadger conversion protocol to sanitizer...
...and add better handling of 3rd-party objects (even BasicObject). | [
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/conversions.rb",
"new_path": "lib/honeybadger/conversions.rb",
"diff": "@@ -2,9 +2,9 @@ module Honeybadger\nmodule Conversions\nmodule_function\n- # Internal: Coerce context into a Hash.\n+ # Internal: Convert context into a Hash.\n#\n- # context - The context object.\n+ # object - The context object.\n#\n# Returns the Hash context.\ndef Context(object)\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/util/sanitizer.rb",
"new_path": "lib/honeybadger/util/sanitizer.rb",
"diff": "require 'bigdecimal'\nrequire 'set'\n+require 'honeybadger/conversions'\n+\nmodule Honeybadger\nmodule Util\n# Internal: Sanitizer sanitizes data for sending to Honeybadger's API. The\n@@ -12,14 +14,17 @@ module Honeybadger\nENCODE_OPTS = { invalid: :replace, undef: :replace, replace: '?'.freeze }.freeze\n+ BASIC_OBJECT = '#<BasicObject>'.freeze\n+ DEPTH = '[DEPTH]'.freeze\nFILTERED = '[FILTERED]'.freeze\n+ RAISED = '[RAISED]'.freeze\n+ RECURSION = '[RECURSION]'.freeze\n+ TRUNCATED = '[TRUNCATED]'.freeze\nIMMUTABLE = [NilClass, FalseClass, TrueClass, Symbol, Numeric, BigDecimal, Method].freeze\nMAX_STRING_SIZE = 65536\n- TRUNCATION_REPLACEMENT = '[TRUNCATED]'.freeze\n-\nVALID_ENCODINGS = [Encoding::UTF_8, Encoding::ISO_8859_1].freeze\ndef self.sanitize(data)\n@@ -52,36 +57,47 @@ module Honeybadger\nend\ndef sanitize(data, depth = 0, stack = nil, parents = [])\n- if enumerable?(data)\n- return '[possible infinite recursion halted]'.freeze if stack && stack.include?(data.object_id)\n+ return BASIC_OBJECT if basic_object?(data)\n+\n+ if recursive?(data)\n+ return RECURSION if stack && stack.include?(data.object_id)\n+\nstack = stack ? stack.dup : Set.new\nstack << data.object_id\nend\ncase data\nwhen Hash\n- return '[max depth reached]'.freeze if depth >= max_depth\n+ return DEPTH if depth >= max_depth\n+\nhash = data.to_hash\nnew_hash = {}\n+\nhash.each_pair do |key, value|\nparents.push(key) if deep_regexps\nkey = key.kind_of?(Symbol) ? key : sanitize(key, depth+1, stack, parents)\n+\nif filter_key?(key, parents)\nnew_hash[key] = FILTERED\nelse\nvalue = sanitize(value, depth+1, stack, parents)\n- if blocks.any? && !enumerable?(value)\n+\n+ if blocks.any? && !recursive?(value)\nkey = key.dup if can_dup?(key)\nvalue = value.dup if can_dup?(value)\nblocks.each { |b| b.call(key, value) }\nend\n+\nnew_hash[key] = value\nend\n+\nparents.pop if deep_regexps\nend\n+\nnew_hash\nwhen Array, Set\n- return '[max depth reached]'.freeze if depth >= max_depth\n+ return DEPTH if depth >= max_depth\n+\ndata.to_a.map do |value|\nsanitize(value, depth+1, stack, parents)\nend\n@@ -89,15 +105,27 @@ module Honeybadger\ndata\nwhen String\nsanitize_string(data)\n- else # all other objects:\n- data.respond_to?(:to_s) ? sanitize_string(data.to_s) : nil\n+ when -> (d) { d.respond_to?(:to_honeybadger) }\n+ begin\n+ data = data.to_honeybadger\n+ rescue\n+ return RAISED\nend\n+\n+ sanitize(data, depth+1, stack, parents)\n+ else # all other objects\n+ klass = data.class\n+\n+ begin\n+ data = String(data)\n+ rescue\n+ return RAISED\nend\n- def sanitize_string(string)\n- string = valid_encoding(string.to_s)\n- return string unless string.respond_to?(:size) && string.size > MAX_STRING_SIZE\n- string[0...MAX_STRING_SIZE] + TRUNCATION_REPLACEMENT\n+ return \"#<#{klass.name}>\" if inspected?(data)\n+\n+ sanitize_string(data)\n+ end\nend\ndef filter_cookies(raw_cookies)\n@@ -142,6 +170,12 @@ module Honeybadger\nfalse\nend\n+ def sanitize_string(string)\n+ string = valid_encoding(string)\n+ return string unless string.respond_to?(:size) && string.size > MAX_STRING_SIZE\n+ string[0...MAX_STRING_SIZE] + TRUNCATED\n+ end\n+\ndef valid_encoding?(string)\nstring.valid_encoding? && (\nVALID_ENCODINGS.include?(string.encoding) ||\n@@ -154,13 +188,25 @@ module Honeybadger\nstring.encode(Encoding::UTF_8, ENCODE_OPTS)\nend\n- def enumerable?(data)\n- data.kind_of?(Hash) || data.kind_of?(Array) || data.kind_of?(Set)\n+ def recursive?(data)\n+ data.is_a?(Hash) || data.is_a?(Array) || data.is_a?(Set) || data.respond_to?(:to_honeybadger)\n+ end\n+\n+ def basic_object?(object)\n+ object.respond_to?(:to_s)\n+ false\n+ rescue\n+ # BasicObject doesn't respond to `#respond_to?`.\n+ true\nend\ndef can_dup?(obj)\n!IMMUTABLE.any? {|k| obj.kind_of?(k) }\nend\n+\n+ def inspected?(string)\n+ String(string) =~ /#<.*>/\n+ end\nend\nend\nend\n"
},
{
"change_type": "MODIFY",
"old_path": "spec/unit/honeybadger/notice_spec.rb",
"new_path": "spec/unit/honeybadger/notice_spec.rb",
"diff": "@@ -660,8 +660,9 @@ describe Honeybadger::Notice do\ndescribe \"#local_variables\", order: :defined do\nlet(:notice) { build_notice(exception: exception, config: config) }\nlet(:mock_binding) { @mock_binding }\n+ let(:value) { double() }\nlet(:exception) do\n- foo = 'bar'\n+ foo = value\nbegin\n@mock_binding = binding\nfail 'oops'\n@@ -711,7 +712,14 @@ describe Honeybadger::Notice do\nlet(:config) { build_config(:'exceptions.local_variables' => true) }\nit \"finds the local variables from first frame of trace\" do\n- expect(notice.local_variables[:foo]).to eq 'bar'\n+ expect(notice.local_variables[:foo]).to eq(String(value))\n+ end\n+\n+ context \"when value responds to #to_honeybadger\" do\n+ it \"returns the #to_honeybadger value\" do\n+ allow(value).to receive(:to_honeybadger).and_return('baz')\n+ expect(notice.local_variables[:foo]).to eq('baz')\n+ end\nend\ncontext \"with an application trace\" do\n@@ -721,7 +729,7 @@ describe Honeybadger::Notice do\nend\nit \"finds the local variables from first frame of application trace\" do\n- expect(notice.local_variables[:foo]).to eq 'bar'\n+ expect(notice.local_variables[:foo]).to eq(String(value))\nend\nit \"filters local variable keys\" do\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Add #to_honeybadger conversion protocol to sanitizer... (#239)
...and add better handling of 3rd-party objects (even BasicObject). |
287,662 | 03.11.2017 19:52:06 | -19,080 | e1c33f4252a67b530f2585a97bf7e5c7938311c6 | Move at_exit callback to an appropriate place for sinatra
Closes | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "@@ -32,6 +32,8 @@ adheres to [Semantic Versioning](http://semver.org/).\n- Logs when reporting errors in development mode now mention that the error wasn't\n*actually* reported. :)\n- Support new Sidekiq job params key.\n+- Move at_exit callback to an appropriate place for sinatra apps, so that it does\n+ not prematurely stop honeybadger workers.\n## [3.1.2] - 2017-04-20\n### Fixed\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger.rb",
"new_path": "lib/honeybadger.rb",
"diff": "@@ -10,9 +10,9 @@ if defined?(Rake.application)\nrequire 'honeybadger/init/rake'\nend\n-at_exit do\n- if $! && !$!.is_a?(SystemExit) && Honeybadger.config[:'exceptions.notify_at_exit']\n- Honeybadger.notify($!, component: 'at_exit', sync: true)\n- end\n- Honeybadger.stop if Honeybadger.config[:'send_data_at_exit']\n+# Sinatra is a special case. Sinatra starts the web application in an at_exit\n+# handler. And, since we require sinatra before requiring HB, the only way to\n+# setup our at_exit callback is in the sinatra build callback honeybadger/init/sinatra.rb\n+if !defined?(Sinatra::Base)\n+ Honeybadger.install_at_exit_callback\nend\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/init/sinatra.rb",
"new_path": "lib/honeybadger/init/sinatra.rb",
"diff": "@@ -9,6 +9,7 @@ module Honeybadger\ndef build_with_honeybadger(*args, &block)\nconfigure_honeybadger\ninstall_honeybadger\n+ Honeybadger.install_at_exit_callback\nbuild_without_honeybadger(*args, &block)\nend\nalias :build_without_honeybadger :build\n@@ -31,6 +32,7 @@ module Honeybadger\nreturn if middleware.any? {|m| m[0] == klass }\nuse(klass)\nend\n+\nend\nend\nend\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/singleton.rb",
"new_path": "lib/honeybadger/singleton.rb",
"diff": "@@ -23,6 +23,16 @@ module Honeybadger\nPlugin.load!(self.config)\nend\n+ def install_at_exit_callback\n+ at_exit do\n+ if $! && !$!.is_a?(SystemExit) && Honeybadger.config[:'exceptions.notify_at_exit']\n+ Honeybadger.notify($!, component: 'at_exit', sync: true)\n+ end\n+\n+ Honeybadger.stop if Honeybadger.config[:'send_data_at_exit']\n+ end\n+ end\n+\n# Deprecated\ndef start(config = {})\nraise NoMethodError, <<-WARNING\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Move at_exit callback to an appropriate place for sinatra (#245)
Closes #244 |
287,654 | 10.11.2017 15:21:45 | 28,800 | 870faa7062e0bbab64a00e4b338b9853dab42acd | Add depth check for #to_honeybadger calls. | [
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/util/sanitizer.rb",
"new_path": "lib/honeybadger/util/sanitizer.rb",
"diff": "@@ -106,6 +106,8 @@ module Honeybadger\nwhen String\nsanitize_string(data)\nwhen -> (d) { d.respond_to?(:to_honeybadger) }\n+ return DEPTH if depth >= max_depth\n+\nbegin\ndata = data.to_honeybadger\nrescue\n"
},
{
"change_type": "MODIFY",
"old_path": "spec/unit/honeybadger/util/sanitizer_spec.rb",
"new_path": "spec/unit/honeybadger/util/sanitizer_spec.rb",
"diff": "@@ -61,6 +61,16 @@ describe Honeybadger::Util::Sanitizer do\nexpect(described_class.new.sanitize(object)).to eq('[RECURSION]')\nend\n+ it \"halts infinite recursion of different objects responding to #to_honeybadger\" do\n+ to_honeybadger = -> {\n+ object = double\n+ allow(object).to receive(:to_honeybadger, &to_honeybadger)\n+ object\n+ }\n+ object = to_honeybadger.call\n+ expect(described_class.new.sanitize(object)).to eq('[DEPTH]')\n+ end\n+\nit \"ensures #to_hash is called on objects that support it\" do\nexpect { described_class.new.sanitize(:session => { :object => double(:to_hash => {}) }) }.not_to raise_error\nend\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Add depth check for #to_honeybadger calls. |
287,654 | 10.11.2017 15:38:50 | 28,800 | b73e060a4c31834f0c463ea7df5fa8ef4a62976b | Call #to_honeybadger_context once. | [
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/notice.rb",
"new_path": "lib/honeybadger/notice.rb",
"diff": "@@ -324,15 +324,22 @@ module Honeybadger\nUtil::RequestPayload.build(request)\nend\n+ # Internal: Get optional context from exception.\n+ #\n+ # Returns the Hash context.\ndef exception_context(exception)\n- return {}.freeze unless exception.respond_to?(:to_honeybadger_context)\n- exception.to_honeybadger_context\n+ # This extra check exists because the exception itself is not expected to\n+ # convert to a hash.\n+ object = exception if exception.respond_to?(:to_honeybadger_context)\n+ object ||= {}.freeze\n+\n+ Context(object)\nend\ndef construct_context_hash(opts, exception)\ncontext = {}\ncontext.merge!(Context(opts[:global_context]))\n- context.merge!(Context(exception_context(exception)))\n+ context.merge!(exception_context(exception))\ncontext.merge!(Context(opts[:context]))\ncontext.empty? ? nil : context\nend\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Call #to_honeybadger_context once. |
287,654 | 21.11.2017 12:51:18 | 28,800 | 0216e3e20a2624f63df92bc26820ba4037b83e07 | Disable JRuby/Rails 4.0 build. | [
{
"change_type": "MODIFY",
"old_path": ".travis.yml",
"new_path": ".travis.yml",
"diff": "@@ -58,6 +58,10 @@ matrix:\ngemfile: gemfiles/rails4.2.gemfile\n- rvm: jruby-9.1.4.0\ngemfile: gemfiles/binding_of_caller.gemfile\n+ # activesupport 4.0 depends on minitest ~> 4.2, Ruby 2.3 bundles minitest\n+ # 5. This isn't a problem locally, but it blows up Travis for some reason.\n+ - rvm: jruby-9.1.4.0\n+ gemfile: gemfiles/rails4.0.gemfile\nenv:\nglobal:\nsecure: DwQI6QHuRRaMoKvE9rnXmw3U1KLKH6Y1ZTXCcDN34Zkq7QG5KPt195zvL6XPbsefvd2fOHq4es5D6jxgLlEdKB7njhWX8XNMgb/eprz6zTxSAS/ep31zYHEJ3krWSPM6a7fXJOjdYIzXhVl7I0NRDZGy/Sf6LgHIBMpaGVKGc34=\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Disable JRuby/Rails 4.0 build. |
287,662 | 22.11.2017 04:14:59 | -19,080 | fbbb9d7b86cf6730c508b424c275ca3a6108f59b | Added ability to perform check ins | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "@@ -25,6 +25,8 @@ adheres to [Semantic Versioning](http://semver.org/).\n- We're now using `String(object)` instead of `object.to_s` as the last resort\nduring sanitization.\n- `'[RAISED]'` is returned when `object.to_honeybadger` or `String(object)` fails.\n+- Added `Honeybadger.check_in` function which allows performing a check in using\n+ and id or a url.\n### Fixed\n- We no longer use \"/dev/null\" as the default log device as it doesn't exist on\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/agent.rb",
"new_path": "lib/honeybadger/agent.rb",
"diff": "@@ -143,6 +143,23 @@ module Honeybadger\nnotice.id\nend\n+ # Public: Perform a synchronous check_in.\n+ #\n+ # id - The unique check in id (e.g. '1MqIo1') or the check in url.\n+ #\n+ # Examples\n+ #\n+ # Honeybadger.check_in('1MqIo1')\n+ #\n+ # Returns a boolean which is true if the check in was successful and false\n+ # otherwise.\n+ def check_in(id)\n+ # this is to allow check ins even if a url is passed\n+ check_in_id = id.to_s.strip.gsub(/\\/$/, '').split('/').last\n+ response = backend.check_in(check_in_id)\n+ response.success?\n+ end\n+\n# Public: Save global context for the current request.\n#\n# context - A Hash of data which will be sent to Honeybadger when an error\n@@ -355,6 +372,9 @@ module Honeybadger\n# Internal\ndef_delegators :config, :init!\n+ # Internal\n+ def_delegators :config, :backend\n+\nprivate\ndef validate_notify_opts!(opts)\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/backend/base.rb",
"new_path": "lib/honeybadger/backend/base.rb",
"diff": "@@ -88,6 +88,15 @@ module Honeybadger\nraise NotImplementedError, 'must define #notify on subclass.'\nend\n+ # Internal: Does a check in using the input id.\n+ #\n+ # id - The unique check_in id.\n+ #\n+ # Raises NotImplementedError.\n+ def check_in(id)\n+ raise NotImplementedError, 'must define #check_in on subclass.'\n+ end\n+\nprivate\nattr_reader :config\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/backend/debug.rb",
"new_path": "lib/honeybadger/backend/debug.rb",
"diff": "@@ -11,6 +11,12 @@ module Honeybadger\nreturn Response.new(ENV['DEBUG_BACKEND_STATUS'].to_i, nil) if ENV['DEBUG_BACKEND_STATUS']\nsuper\nend\n+\n+ def check_in(id)\n+ logger.unknown(\"checking in debug backend with id=#{id}\")\n+ return Response.new(ENV['DEBUG_BACKEND_STATUS'].to_i, nil) if ENV['DEBUG_BACKEND_STATUS']\n+ super\n+ end\nend\nend\nend\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/backend/null.rb",
"new_path": "lib/honeybadger/backend/null.rb",
"diff": "@@ -20,6 +20,10 @@ module Honeybadger\ndef notify(feature, payload)\nStubbedResponse.new\nend\n+\n+ def check_in(id)\n+ StubbedResponse.new\n+ end\nend\nend\nend\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/backend/server.rb",
"new_path": "lib/honeybadger/backend/server.rb",
"diff": "@@ -14,6 +14,9 @@ module Honeybadger\ndeploys: '/v1/deploys'.freeze\n}.freeze\n+ CHECK_IN_ENDPOINT = '/v1/check_in'.freeze\n+\n+\nHTTP_ERRORS = Util::HTTP::ERRORS\ndef initialize(config)\n@@ -34,6 +37,17 @@ module Honeybadger\nResponse.new(:error, nil, \"HTTP Error: #{e.class}\")\nend\n+ # Internal: Does a check in using the input id.\n+ #\n+ # id - The unique check_in id.\n+ #\n+ # Returns Response.\n+ def check_in(id)\n+ Response.new(@http.get(\"#{CHECK_IN_ENDPOINT}/#{id}\"))\n+ rescue *HTTP_ERRORS => e\n+ Response.new(:error, nil, \"HTTP Error: #{e.class}\")\n+ end\n+\nprivate\n# Internal: Construct headers for supported payloads.\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/backend/test.rb",
"new_path": "lib/honeybadger/backend/test.rb",
"diff": "@@ -14,15 +14,35 @@ module Honeybadger\n@notifications ||= Hash.new {|h,k| h[k] = [] }\nend\n+ # Public: The check in list.\n+ #\n+ # Examples\n+ #\n+ # Test.check_ins # => [\"foobar\", \"danny\", ...]\n+ #\n+ # Returns the Array of check ins.\n+ def self.check_ins\n+ @check_ins ||= []\n+ end\n+\n# Internal: Local helper.\ndef notifications\nself.class.notifications\nend\n+ # Internal: Local helper.\n+ def check_ins\n+ self.class.check_ins\n+ end\n+\ndef notify(feature, payload)\nnotifications[feature] << payload\nsuper\nend\n+\n+ def check_in(id)\n+ check_ins << id\n+ end\nend\nend\nend\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/singleton.rb",
"new_path": "lib/honeybadger/singleton.rb",
"diff": "@@ -16,6 +16,10 @@ module Honeybadger\nAgent.instance.notify(exception_or_opts, opts)\nend\n+ def check_in(id)\n+ Agent.instance.check_in(id)\n+ end\n+\ndef load_plugins!\nDir[File.expand_path('../plugins/*.rb', __FILE__)].each do |plugin|\nrequire plugin\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/util/http.rb",
"new_path": "lib/honeybadger/util/http.rb",
"diff": "@@ -37,6 +37,12 @@ module Honeybadger\n@config = config\nend\n+ def get(endpoint)\n+ response = http_connection.get(endpoint)\n+ debug { sprintf(\"http method=GET path=%s code=%d\", endpoint.dump, response.code) }\n+ response\n+ end\n+\ndef post(endpoint, payload, headers = nil)\nresponse = http_connection.post(endpoint, compress(payload.to_json), http_headers(headers))\ndebug { sprintf(\"http method=POST path=%s code=%d\", endpoint.dump, response.code) }\n"
},
{
"change_type": "MODIFY",
"old_path": "spec/support/helpers.rb",
"new_path": "spec/support/helpers.rb",
"diff": "@@ -3,6 +3,7 @@ module Helpers\nresponse = options[:response] || Net::HTTPSuccess.new('1.2', '200', 'OK')\nallow(response).to receive(:body).and_return(options[:body] || '{\"id\":\"1234\"}')\nhttp = double(:post => response,\n+ :get => response,\n:read_timeout= => nil,\n:open_timeout= => nil,\n:ca_file= => nil,\n"
},
{
"change_type": "MODIFY",
"old_path": "spec/unit/honeybadger/agent_spec.rb",
"new_path": "spec/unit/honeybadger/agent_spec.rb",
"diff": "@@ -10,6 +10,41 @@ describe Honeybadger::Agent do\nits(:instance) { should be_a(Honeybadger::Agent) }\nend\n+ describe \"#check_in\" do\n+\n+ it 'parses check_in id from a url' do\n+ stub_request(:get, \"https://api.honeybadger.io/v1/check_in/1MqIo1\").\n+ to_return(status: 200)\n+\n+ config = Honeybadger::Config.new(api_key:'fake api key', logger: NULL_LOGGER)\n+ instance = described_class.new(config)\n+\n+ instance.check_in('https://api.honeybadger.io/v1/check_in/1MqIo1')\n+ end\n+\n+ it 'returns true for successful check ins' do\n+ stub_request(:get, \"https://api.honeybadger.io/v1/check_in/foobar\").\n+ to_return(status: 200)\n+\n+ config = Honeybadger::Config.new(api_key:'fake api key', logger: NULL_LOGGER)\n+ instance = described_class.new(config)\n+\n+ expect(instance.check_in('foobar')).to eq(true)\n+ expect(instance.check_in('/foobar')).to eq(true)\n+ expect(instance.check_in('/foobar/')).to eq(true)\n+ end\n+\n+ it 'returns false for failed check ins' do\n+ stub_request(:get, \"https://api.honeybadger.io/v1/check_in/danny\").\n+ to_return(status: 400)\n+\n+ config = Honeybadger::Config.new(api_key:'fake api key', logger: NULL_LOGGER)\n+ instance = described_class.new(config)\n+\n+ expect(instance.check_in('danny')).to eq(false)\n+ end\n+ end\n+\ndescribe \"#notify\" do\nit \"generates a backtrace\" do\nconfig = Honeybadger::Config.new(api_key:'fake api key', logger: NULL_LOGGER)\n"
},
{
"change_type": "MODIFY",
"old_path": "spec/unit/honeybadger/backend/server_spec.rb",
"new_path": "spec/unit/honeybadger/backend/server_spec.rb",
"diff": "@@ -10,6 +10,14 @@ describe Honeybadger::Backend::Server do\nsubject { described_class.new(config) }\nit { should respond_to :notify }\n+ it { should respond_to :check_in }\n+\n+ describe \"#check_in\" do\n+ it \"returns a response\" do\n+ stub_http\n+ expect(subject.check_in('foobar')).to be_a Honeybadger::Backend::Response\n+ end\n+ end\ndescribe \"#notify\" do\nit \"returns the response\" do\n@@ -71,5 +79,6 @@ describe Honeybadger::Backend::Server do\ndef notify_backend\nsubject.notify(:notices, payload)\nend\n+\nend\nend\n"
},
{
"change_type": "MODIFY",
"old_path": "spec/unit/honeybadger/util/http_spec.rb",
"new_path": "spec/unit/honeybadger/util/http_spec.rb",
"diff": "@@ -10,6 +10,7 @@ describe Honeybadger::Util::HTTP do\nsubject { described_class.new(config) }\nit { should respond_to :post }\n+ it { should respond_to :get }\nit \"sends a user agent with version number\" do\nhttp = stub_http\n@@ -28,6 +29,17 @@ describe Honeybadger::Util::HTTP do\n})\n}\n+ it \"gets from Honeybadger when using an HTTP proxy\" do\n+ http = stub_http\n+ proxy = double(new: http)\n+ allow(Net::HTTP).to receive(:Proxy).and_return(proxy)\n+\n+ expect(http).to receive(:get).with('/v1/foo')\n+ expect(Net::HTTP).to receive(:Proxy).with('some.host', 88, 'login', 'passwd')\n+\n+ http_get\n+ end\n+\nit \"posts to Honeybadger when using an HTTP proxy\" do\nhttp = stub_http\nproxy = double(new: http)\n@@ -45,6 +57,11 @@ describe Honeybadger::Util::HTTP do\nexpect(http_post).to be_a Net::HTTPResponse\nend\n+ it \"returns the response for #get\" do\n+ stub_http\n+ expect(http_get).to be_a Net::HTTPResponse\n+ end\n+\ncontext \"success response from server\" do\nlet(:sender) { build_sender }\n@@ -56,6 +73,15 @@ describe Honeybadger::Util::HTTP do\nend\nend\n+ context \"success response from server on #get\" do\n+ before { stub_http }\n+\n+ it \"logs success\" do\n+ expect(logger).to receive(:debug).with(/code=200/)\n+ http_get\n+ end\n+ end\n+\ncontext \"non-success response from server\" do\nit \"logs failure\" do\nstub_http(response: Net::HTTPClientError.new('1.2', '429', 'Too Many Requests'))\n@@ -64,6 +90,14 @@ describe Honeybadger::Util::HTTP do\nend\nend\n+ context \"non-success response from server on #get\" do\n+ it \"logs failure\" do\n+ stub_http(response: Net::HTTPClientError.new('1.2', '429', 'Too Many Requests'))\n+ expect(logger).to receive(:debug).with(/code=429/)\n+ http_get\n+ end\n+ end\n+\ncontext \"failure response from server\" do\nit \"logs failure\" do\nstub_http(response: Net::HTTPServerError.new('1.2', '500', 'Internal Error'))\n@@ -79,6 +113,7 @@ describe Honeybadger::Util::HTTP do\nallow(proxy).to receive(:new).and_raise(NoMemoryError)\nallow(Net::HTTP).to receive(:Proxy).and_return(proxy)\nexpect { http_post }.to raise_error(NoMemoryError)\n+ expect { http_get }.to raise_error(NoMemoryError)\nend\nend\n@@ -208,4 +243,8 @@ describe Honeybadger::Util::HTTP do\ndef http_post\nsubject.post('/v1/foo', double('Notice', to_json: '{}'))\nend\n+\n+ def http_get\n+ subject.get('/v1/foo')\n+ end\nend\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Added ability to perform check ins (#251) |
287,662 | 08.12.2017 03:44:53 | -19,080 | 7c2d5f4c86f54f7130b21998059e032620c259a4 | Fix route name conflict in Rails | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "@@ -4,6 +4,8 @@ CHANGELOG](http://keepachangelog.com/) for how to update this file. This project\nadheres to [Semantic Versioning](http://semver.org/).\n## [Unreleased]\n+### Fixed\n+- Use a unique route name in rails to avoid name conflicts.\n## [3.2.0] - 2017-11-27\n### Changed\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/cli/test.rb",
"new_path": "lib/honeybadger/cli/test.rb",
"diff": "@@ -141,7 +141,7 @@ module Honeybadger\nr.disable_clear_and_finalize = true\nr.clear!\nr.draw do\n- match 'verify' => 'honeybadger/test#verify', :as => 'verify', :via => :get\n+ match 'verify' => 'honeybadger/test#verify', :as => \"verify_#{SecureRandom.hex}\", :via => :get\nend\n::Rails.application.routes_reloader.paths.each{ |path| load(path) }\n::ActiveSupport.on_load(:action_controller) { r.finalize! }\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Fix route name conflict in Rails (#253) |
287,654 | 12.12.2017 20:00:15 | 28,800 | a2ca24482bceb7a3955d3359379b0fd28464c355 | Use prepend to add Sidekiq Middleware. | [
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/plugins/sidekiq.rb",
"new_path": "lib/honeybadger/plugins/sidekiq.rb",
"diff": "@@ -17,7 +17,7 @@ module Honeybadger\nexecution do\n::Sidekiq.configure_server do |sidekiq|\nsidekiq.server_middleware do |chain|\n- chain.add Middleware\n+ chain.prepend Middleware\nend\nend\n"
},
{
"change_type": "MODIFY",
"old_path": "spec/unit/honeybadger/plugins/sidekiq_spec.rb",
"new_path": "spec/unit/honeybadger/plugins/sidekiq_spec.rb",
"diff": "@@ -23,7 +23,7 @@ describe \"Sidekiq Dependency\" do\nend\nlet(:sidekiq_config) { double('config', :error_handlers => []) }\n- let(:chain) { double('chain', :add => true) }\n+ let(:chain) { double('chain', :prepend => true) }\nbefore do\nObject.const_set(:Sidekiq, shim)\n@@ -39,7 +39,7 @@ describe \"Sidekiq Dependency\" do\nend\nit \"adds the server middleware\" do\n- expect(chain).to receive(:add).with(Honeybadger::Plugins::Sidekiq::Middleware)\n+ expect(chain).to receive(:prepend).with(Honeybadger::Plugins::Sidekiq::Middleware)\nHoneybadger::Plugin.instances[:sidekiq].load!(config)\nend\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Use prepend to add Sidekiq Middleware. #248 (#255) |
287,662 | 25.01.2018 04:30:19 | -19,080 | 8b19884742efa90623ff45d0b4a0dd7cd222c17a | Added a pull request checklist | [
{
"change_type": "ADD",
"old_path": null,
"new_path": ".github/PULL_REQUEST_TEMPLATE.md",
"diff": "+**Before submitting a pull request,** please make sure the following is done:\n+\n+ 1. If you've fixed a bug or added code that should be tested, add tests!\n+ 2. Run `rake spec` in the repository root.\n+ 3. Add an entry to the CHANGELOG.\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Added a pull request checklist (#261) |
287,658 | 26.01.2018 11:03:09 | 28,800 | ae58b14b2b31db9bf2687430eb35946b5995269c | Add new Rack exceptions to default ignore list. | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "@@ -8,6 +8,8 @@ adheres to [Semantic Versioning](http://semver.org/).\n- Use a unique route name in rails to avoid name conflicts.\n- Use prepend to add Sidekiq Middleware to fix context getting cleared.\n- Fix at_exit callback being skipped in rails apps with a sinatra dependency.\n+- Add `Rack::QueryParser::ParameterTypeError` and\n+ `Rack::QueryParser::InvalidParameterError` to default ignore list.\n## [3.2.0] - 2017-11-27\n### Changed\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/config/defaults.rb",
"new_path": "lib/honeybadger/config/defaults.rb",
"diff": "@@ -17,6 +17,8 @@ module Honeybadger\n'ActionController::ParameterMissing',\n'ActiveRecord::RecordNotFound',\n'ActionController::UnknownAction',\n+ 'Rack::QueryParser::ParameterTypeError',\n+ 'Rack::QueryParser::InvalidParameterError',\n'CGI::Session::CookieStore::TamperedWithCookie',\n'Mongoid::Errors::DocumentNotFound',\n'Sinatra::NotFound'].map(&:freeze).freeze\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Add new Rack exceptions to default ignore list. (#262) |
287,662 | 23.03.2018 02:44:16 | -19,080 | 5db729695e758bcccf560e61bddcbb9b9a66201c | Add CHANGELOG entry for before_notify
Finishes | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "@@ -5,6 +5,9 @@ adheres to [Semantic Versioning](http://semver.org/).\n## [Unreleased]\n### Added\n+- Added `before_notify` hooks to be defined, this allows setting up of multiple\n+ hooks which will be invoked with a `notice` before a `notice` is sent. Each\n+ `before_notify` hook MUST be a `callable` (lambda, Proc etc,) with an arity of 1.\n- Added the ability to halt notices in callbacks using `notice.halt!`\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Add CHANGELOG entry for before_notify (#274)
Finishes #273 |
287,654 | 22.03.2018 14:26:44 | 25,200 | e495f4307e7af584653f007fc94e2b9c415401cf | Fix a bug where the logger isn't initialized...
...when logging in `Config::Ruby`. The #logger and #backend methods both
do some lazy initialization. | [
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/config/ruby.rb",
"new_path": "lib/honeybadger/config/ruby.rb",
"diff": "@@ -70,7 +70,7 @@ module Honeybadger\nend\ndef logger\n- get(:logger)\n+ get(:logger) || config.logger\nend\ndef backend=(backend)\n@@ -78,7 +78,7 @@ module Honeybadger\nend\ndef backend\n- get(:backend)\n+ get(:backend) || config.backend\nend\ndef backtrace_filter\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Fix a bug where the logger isn't initialized... (#270)
...when logging in `Config::Ruby`. The #logger and #backend methods both
do some lazy initialization. |
287,662 | 10.04.2018 18:18:11 | -19,080 | ebccd0d56eef6de9bc0064ca6129f7fb84ec90b3 | Add rails5.2 to the travis test matrix | [
{
"change_type": "MODIFY",
"old_path": ".travis.yml",
"new_path": ".travis.yml",
"diff": "@@ -22,6 +22,7 @@ gemfile:\n- gemfiles/rails.gemfile\n- gemfiles/rails5.0.gemfile\n- gemfiles/rails5.1.gemfile\n+ - gemfiles/rails5.2.gemfile\nrvm:\n- 2.1.10\n- 2.2.6\n@@ -49,6 +50,8 @@ matrix:\ngemfile: gemfiles/rails5.0.gemfile\n- rvm: 2.1.10\ngemfile: gemfiles/rails5.1.gemfile\n+ - rvm: 2.1.10\n+ gemfile: gemfiles/rails5.2.gemfile\n- rvm: 2.1.10\ngemfile: gemfiles/rack.gemfile\n- rvm: 2.1.10\n"
},
{
"change_type": "MODIFY",
"old_path": "Appraisals",
"new_path": "Appraisals",
"diff": "@@ -64,7 +64,6 @@ if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.2.2')\ngem 'rspec-rails'\nend\n- # The latest officially supported Rails/Rack release\nappraise 'rails5.1' do\ngem 'rails', '~> 5.1.0'\ngem 'better_errors', require: false, platforms: [:ruby_20, :ruby_21]\n@@ -72,6 +71,14 @@ if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.2.2')\ngem 'rspec-rails'\nend\n+ # The latest officially supported Rails/Rack release\n+ appraise 'rails5.2' do\n+ gem 'rails', '~> 5.2.0'\n+ gem 'better_errors', require: false, platforms: [:ruby_20, :ruby_21]\n+ gem 'rack-mini-profiler', require: false\n+ gem 'rspec-rails'\n+ end\n+\n# Rails edge\nappraise 'rails' do\ngem 'rails', github: 'rails/rails'\n"
},
{
"change_type": "MODIFY",
"old_path": "gemfiles/.bundle/config",
"new_path": "gemfiles/.bundle/config",
"diff": "---\n-BUNDLE_WITHOUT: \"development\"\nBUNDLE_RETRY: \"1\"\n+BUNDLE_WITHOUT: \"development\"\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "gemfiles/rails5.2.gemfile",
"diff": "+# This file was generated by Appraisal\n+\n+source \"https://rubygems.org\"\n+\n+gem \"allocation_stats\", platforms: :mri, require: false\n+gem \"appraisal\", \"~> 2.1\"\n+gem \"aruba\", \"~> 0.14\"\n+gem \"guard\"\n+gem \"guard-rspec\"\n+gem \"pry\"\n+gem \"pry-byebug\", platforms: :mri\n+gem \"rdoc\"\n+gem \"rspec\", \"~> 3.0\"\n+gem \"rspec-its\"\n+gem \"ruby-prof\", platforms: :mri, require: false\n+gem \"timecop\"\n+gem \"webmock\"\n+gem \"capistrano\"\n+gem \"rake\"\n+gem \"listen\", \"~> 3.0.8\"\n+gem \"rails\", \"~> 5.2.0\"\n+gem \"better_errors\", require: false, platforms: [:ruby_20, :ruby_21]\n+gem \"rack-mini-profiler\", require: false\n+gem \"rspec-rails\"\n+\n+platforms :ruby_25 do\n+ gem \"mathn\"\n+end\n+\n+gemspec path: \"../\"\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Add rails5.2 to the travis test matrix (#276) |
287,662 | 03.08.2018 00:21:41 | -19,080 | 665f9a33c42e648c86ad1893e1920c713bb1337a | Fix sync throttling in shoryuken | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "@@ -65,6 +65,10 @@ adheres to [Semantic Versioning](http://semver.org/).\n### Removed\n- The `disabled` option is now removed, Use the `report_data` option instead.\n+## [3.3.1] - 2018-08-02\n+### Fixed\n+- Fix synchronous throttling in shoryuken\n+\n## [3.3.0] - 2018-01-29\n### Changed\n- Use prepend to add Sidekiq Middleware to fix context getting cleared.\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/plugins/shoryuken.rb",
"new_path": "lib/honeybadger/plugins/shoryuken.rb",
"diff": "@@ -6,7 +6,6 @@ module Honeybadger\nmodule Shoryuken\nclass Middleware\ndef call(_worker, _queue, sqs_msg, body)\n- Honeybadger.flush do\nbegin\nyield\nrescue => e\n@@ -16,7 +15,6 @@ module Honeybadger\nraise e\nend\n- end\nensure\nHoneybadger.context.clear!\nend\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Fix sync throttling in shoryuken (#284) |
287,662 | 09.08.2018 21:06:02 | -19,080 | 35d210bb2a97ab3d19c892defa40c0854a0ebe50 | Remove accessor method on notice | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "@@ -32,6 +32,9 @@ adheres to [Semantic Versioning](http://semver.org/).\n### Fixed\n- Ignore SIGTERM SignalExceptions.\n+### Removed\n+- Removed Notice#[]\n+\n### Changed\n- The public method `Notice#backtrace` is now exposed as the raw Ruby\nbacktrace instead of an instance of `Honeybadger::Backtrace` (a private\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/agent.rb",
"new_path": "lib/honeybadger/agent.rb",
"diff": "@@ -298,12 +298,12 @@ module Honeybadger\n# @example\n# # Ignoring based on error message:\n# Honeybadger.exception_filter do |notice|\n- # notice[:error_message] =~ /sensitive data/\n+ # notice.error_message =~ /sensitive data/\n# end\n#\n# # Ignore an entire class of exceptions:\n# Honeybadger.exception_filter do |notice|\n- # notice[:exception].class < MyError\n+ # notice.exception.class < MyError\n# end\n#\n# @!method exception_filter\n@@ -318,7 +318,7 @@ module Honeybadger\n#\n# @example\n# Honeybadger.exception_fingerprint do |notice|\n- # [notice[:error_class], notice[:component], notice[:backtrace].to_s].join(':')\n+ # [notice.error_class, notice.component, notice.backtrace.to_s].join(':')\n# end\n#\n# @!method exception_fingerprint\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/notice.rb",
"new_path": "lib/honeybadger/notice.rb",
"diff": "@@ -229,23 +229,6 @@ module Honeybadger\n::JSON.generate(as_json(*a))\nend\n- # Allows properties to be accessed using a hash-like syntax.\n- #\n- # @example\n- # notice[:error_message]\n- #\n- # @param [Symbol] method The given key for an attribute.\n- #\n- # @return [Object] The attribute value.\n- def [](method)\n- case method\n- when :request\n- self\n- else\n- send(method)\n- end\n- end\n-\n# @api private\n# Determines if this notice should be ignored.\ndef ignore?\n"
},
{
"change_type": "MODIFY",
"old_path": "spec/unit/honeybadger/notice_spec.rb",
"new_path": "spec/unit/honeybadger/notice_spec.rb",
"diff": "@@ -258,34 +258,15 @@ describe Honeybadger::Notice do\nend\nend\n- describe \"#[]\" do\n- it \"acts like a hash\" do\n- notice = build_notice(error_message: 'some message')\n- expect(notice[:error_message]).to eq notice.error_message\n- end\n-\n- it \"returns params on notice[:request][:params]\" do\n- params = {'one' => 'two'}\n- notice = build_notice(params: params)\n- expect(notice[:request][:params]).to eq params\n- end\n-\n- it \"returns context on notice[:request][:context]\" do\n- context = {'one' => 'two'}\n- notice = build_notice(context: context)\n- expect(notice[:request][:context]).to eq context\n- end\n- end\n-\ndescribe \"#context\" do\nit \"merges local context\" do\nnotice = build_notice(context: { local: 'local' })\n- expect(notice[:request][:context]).to eql({ local: 'local' })\n+ expect(notice.context).to eql({ local: 'local' })\nend\nit \"merges global context\" do\nnotice = build_notice(global_context: { global: 'global' })\n- expect(notice[:request][:context]).to eql({ global: 'global' })\n+ expect(notice.context).to eql({ global: 'global' })\nend\nit \"merges exception context\" do\n@@ -296,12 +277,12 @@ describe Honeybadger::Notice do\nend\nnotice = build_notice(exception: exception.new)\n- expect(notice[:request][:context]).to eql({ exception: 'exception' })\n+ expect(notice.context).to eql({ exception: 'exception' })\nend\nit \"skips exception context when method isn't defined\" do\nnotice = build_notice(exception: RuntimeError.new)\n- expect(notice[:request][:context]).to eq({})\n+ expect(notice.context).to eq({})\nend\nit \"merges context in order of precedence: local, exception, global\" do\n@@ -314,7 +295,7 @@ describe Honeybadger::Notice do\nlocal_context = { local: 'local', local_override: 'local' }\nnotice = build_notice(exception: exception.new, global_context: global_context, context: local_context)\n- expect(notice[:request][:context]).to eq({\n+ expect(notice.context).to eq({\nglobal: 'global',\nexception: 'exception',\nlocal: 'local',\n@@ -336,7 +317,7 @@ describe Honeybadger::Notice do\nit \"returns empty Hash when context is not set\" do\nnotice = build_notice\n- expect(notice[:request][:context]).to eq({})\n+ expect(notice.context).to eq({})\nend\nit \"allows falsey values in context\" do\n@@ -385,14 +366,14 @@ describe Honeybadger::Notice do\nenv = Rack::MockRequest.env_for('/', { 'action_dispatch.request.parameters' => params })\nnotice = build_notice(rack_env: env)\n- expect(notice[:cgi_data]).not_to have_key 'action_dispatch.request.parameters'\n+ expect(notice.cgi_data).not_to have_key 'action_dispatch.request.parameters'\nend\nit \"removes action_dispatch.request.request_parameters from cgi_data\" do\nenv = Rack::MockRequest.env_for('/', { 'action_dispatch.request.request_parameters' => params })\nnotice = build_notice(rack_env: env)\n- expect(notice[:cgi_data]).not_to have_key 'action_dispatch.request.request_parameters'\n+ expect(notice.cgi_data).not_to have_key 'action_dispatch.request.request_parameters'\nend\nend\n@@ -584,7 +565,7 @@ describe Honeybadger::Notice do\ncontext \"fingerprint is a callback which accesses notice\" do\nit \"can access request information\" do\n- notice = build_notice({params: { key: 'foo' }, fingerprint: lambda {|n| n[:params][:key] }})\n+ notice = build_notice({params: { key: 'foo' }, fingerprint: lambda {|n| n.params[:key] }})\nexpect(notice.fingerprint).to eq 'foo'\nexpect(notice.as_json[:error][:fingerprint]).to eq '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'\nend\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Remove accessor method on notice (#286) |
287,654 | 21.08.2018 11:35:08 | 25,200 | cde773db897f751524ac0a3776f47529927eba79 | Add bump_changelog task | [
{
"change_type": "MODIFY",
"old_path": "Rakefile",
"new_path": "Rakefile",
"diff": "@@ -38,6 +38,11 @@ task spec: :'spec:all'\ntask test: :spec\ntask default: :spec\n+desc \"Bump CHANGELOG v#{Release.next_version(VERSION)}\"\n+task :bump_changelog, [:version] do |_, args|\n+ Release.bump_changelog(args[:version])\n+end\n+\ndesc \"Bump v#{VERSION} to v#{Release.next_version(VERSION)}\"\ntask :bump do\nRelease.bump\n"
},
{
"change_type": "MODIFY",
"old_path": "tools/release.rb",
"new_path": "tools/release.rb",
"diff": "@@ -8,6 +8,14 @@ module Release\nEXIT_CMD = 'bundle update honeybadger && git add -p'\nVERSION_FILE = 'lib/honeybadger/version.rb'\n+ def self.bump_changelog(version = nil)\n+ version = next_version(Honeybadger::VERSION) unless version.to_s =~ /\\S/\n+ contents = File.read(CHANGELOG_FILE)\n+ unless contents =~ Regexp.new(Regexp.escape(\"## [#{version}]\"))\n+ File.write(CHANGELOG_FILE, contents.gsub(CHANGELOG_HEADING, \"#{CHANGELOG_HEADING}\\n\\n## [#{version}] - #{Time.now.strftime(\"%Y-%m-%d\")}\"))\n+ end\n+ end\n+\ndef self.bump\nversion = next_version(Honeybadger::VERSION)\n@@ -15,10 +23,7 @@ module Release\nFile.write(VERSION_FILE, File.read(VERSION_FILE).gsub(Honeybadger::VERSION, version))\n# Update the changelog.\n- contents = File.read(CHANGELOG_FILE)\n- unless contents =~ Regexp.new(Regexp.escape(\"## [#{version}]\"))\n- File.write(CHANGELOG_FILE, contents.gsub(CHANGELOG_HEADING, \"#{CHANGELOG_HEADING}\\n\\n## [#{version}] - #{Time.now.strftime(\"%Y-%m-%d\")}\"))\n- end\n+ bump_changelog(version)\nunless Bundler.with_clean_env { system(EXIT_CMD) }\nputs \"Failed to bump release version.\"\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Add bump_changelog task |
287,678 | 24.09.2018 23:01:00 | 18,000 | 3a1e46a15a2486af643c4a70b76192683adf9828 | Update CHANGELOG.md
fix changelog exception fingerprint example | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "@@ -83,7 +83,7 @@ adheres to [Semantic Versioning](http://semver.org/).\n```ruby\nHoneybadger.configure do |config|\nconfig.before_notify do |notice|\n- notice.exception_fingerprint = 'new fingerprint'\n+ notice.fingerprint = 'new fingerprint'\nend\nend\n```\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Update CHANGELOG.md (#297)
fix changelog exception fingerprint example |
287,678 | 30.11.2018 09:41:53 | 21,600 | a807c96337835b3c16ed47cc934aedcfa8c988a6 | use job defined retry number as the max retries if it is less than sidekiq.attempt_threshold | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "@@ -4,6 +4,8 @@ CHANGELOG](http://keepachangelog.com/) for how to update this file. This project\nadheres to [Semantic Versioning](http://semver.org/).\n## [Unreleased]\n+### Changed\n+- Issue a Notification from a Sidekiq job when either the `sidekiq.attempt_threshold` is reached OR if the job defined retry threshold is reached, whichever comes first.\n## [4.1.0] - 2018-10-16\n### Added\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/plugins/sidekiq.rb",
"new_path": "lib/honeybadger/plugins/sidekiq.rb",
"diff": "@@ -25,7 +25,15 @@ module Honeybadger\n::Sidekiq.configure_server do |sidekiq|\nsidekiq.error_handlers << lambda {|ex, params|\njob = params[:job] || params\n- return if job['retry'.freeze] && job['retry_count'.freeze].to_i < config[:'sidekiq.attempt_threshold'].to_i\n+ retry_count = job['retry_count'.freeze].to_i\n+ retry_opt = job['retry'.freeze]\n+ max_retries = if retry_opt.is_a?(Integer)\n+ [retry_opt - 1, config[:'sidekiq.attempt_threshold'].to_i].min\n+ else\n+ config[:'sidekiq.attempt_threshold'].to_i\n+ end\n+\n+ return if retry_opt && retry_count < max_retries\nopts = {parameters: params}\nopts[:component] = job['wrapped'.freeze] || job['class'.freeze] if config[:'sidekiq.use_component']\nHoneybadger.notify(ex, opts)\n"
},
{
"change_type": "MODIFY",
"old_path": "spec/unit/honeybadger/plugins/sidekiq_spec.rb",
"new_path": "spec/unit/honeybadger/plugins/sidekiq_spec.rb",
"diff": "@@ -141,6 +141,15 @@ describe \"Sidekiq Dependency\" do\nsidekiq_config.error_handlers[0].call(exception, job_context)\nend\nend\n+\n+ context \"and the retry count meets the job set threshold\" do\n+ let(:job) { { 'retry_count' => 2, 'retry' => 2 } }\n+\n+ it \"notifies Honeybadger\" do\n+ expect(Honeybadger).to receive(:notify).with(exception, { parameters: job_context, component: nil }).once\n+ sidekiq_config.error_handlers[0].call(exception, job_context)\n+ end\n+ end\nend\nend\nend\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | use job defined retry number as the max retries if it is less than sidekiq.attempt_threshold (#299) |
287,654 | 30.11.2018 08:44:07 | 28,800 | 748e21e387d136bbbbb03b9c9d731b6d78f667db | Document Plugin class. | [
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/plugin.rb",
"new_path": "lib/honeybadger/plugin.rb",
"diff": "require 'forwardable'\nmodule Honeybadger\n- # @api private\n+ # +Honeybadger::Plugin+ defines the API for registering plugins with\n+ # Honeybadger. Each plugin has requirements which must be satisified before\n+ # executing the plugin's execution block(s). This allows us to detect\n+ # optional dependencies and load the plugin for each dependency only if it's\n+ # present in the application.\n+ #\n+ # See the plugins/ directory for examples of official plugins. If you're\n+ # interested in developing a plugin for Honeybadger, see the Integration\n+ # Guide: https://docs.honeybadger.io/ruby/gem-reference/integration.html\n+ #\n+ # @example\n+ #\n+ # require 'honeybadger/plugin'\n+ # require 'honeybadger/ruby'\n+ #\n+ # module Honeybadger\n+ # module Plugins\n+ # # Register your plugin with an optional name. If the name (such as\n+ # # \"my_framework\") is not provided, Honeybadger will try to infer the name\n+ # # from the current file.\n+ # Plugin.register 'my_framework' do\n+ # requirement do\n+ # # Check to see if the thing you're integrating with is loaded. Return true\n+ # # if it is, or false if it isn't. An exception in this block is equivalent\n+ # # to returning false. Multiple requirement blocks are supported.\n+ # defined?(MyFramework)\n+ # end\n+ #\n+ # execution do\n+ # # Write your integration. This code will be executed only if all requirement\n+ # # blocks return true. An exception in this block will disable the plugin.\n+ # # Multiple execution blocks are supported.\n+ # MyFramework.on_exception do |exception|\n+ # Honeybadger.notify(exception)\n+ # end\n+ # end\n+ # end\n+ # end\n+ # end\nclass Plugin\n+ # @api private\nCALLER_FILE = Regexp.new('\\A(?:\\w:)?([^:]+)(?=(:\\d+))').freeze\nclass << self\n+ # @api private\n@@instances = {}\n+ # @api private\ndef instances\n@@instances\nend\n+ # Register a new plugin with Honeybadger. See {#requirement} and {#execution}.\n+ #\n+ # @example\n+ #\n+ # Honeybadger::Plugin.register 'my_framework' do\n+ # requirement { }\n+ # execution { }\n+ # end\n+ #\n+ # @param [String] name The optional name of the plugin. Should use\n+ # +snake_case+. The name is inferred from the current file name if omitted.\n+ #\n+ # @return nil\ndef register(name = nil)\nname ||= name_from_caller(caller) or\nraise(ArgumentError, 'Plugin name is required, but was nil.')\n@@ -19,6 +73,7 @@ module Honeybadger\ninstances[key] = new(name).tap { |d| d.instance_eval(&Proc.new) }\nend\n+ # @api private\ndef load!(config)\ninstances.each_pair do |name, plugin|\nif config.load_plugin?(name)\n@@ -29,6 +84,7 @@ module Honeybadger\nend\nend\n+ # @api private\ndef name_from_caller(caller)\ncaller && caller[0].match(CALLER_FILE) or\nfail(\"Unable to determine name from caller: #{caller.inspect}\")\n@@ -36,6 +92,7 @@ module Honeybadger\nend\nend\n+ # @api private\nclass Execution\nextend Forwardable\n@@ -54,6 +111,7 @@ module Honeybadger\ndef_delegator :@config, :logger\nend\n+ # @api private\ndef initialize(name)\n@name = name\n@loaded = false\n@@ -61,14 +119,53 @@ module Honeybadger\n@executions = []\nend\n+ # Define a requirement. All requirement blocks must return +true+ for the\n+ # plugin to be executed.\n+ #\n+ # @example\n+ #\n+ # Honeybadger::Plugin.register 'my_framework' do\n+ # requirement { defined?(MyFramework) }\n+ #\n+ # # Honeybadger's configuration object is available inside\n+ # # requirement blocks. It should generally not be used outside of\n+ # # internal plugins. See +Config+.\n+ # requirement { config[:'my_framework.enabled'] }\n+ #\n+ # execution { }\n+ # end\n+ #\n+ # @return nil\ndef requirement\n@requirements << Proc.new\nend\n+ # Define an execution block. Execution blocks will be executed if all\n+ # requirement blocks return +true+.\n+ #\n+ # @example\n+ #\n+ # Honeybadger::Plugin.register 'my_framework' do\n+ # requirement { defined?(MyFramework) }\n+ #\n+ # execution do\n+ # MyFramework.on_exception {|err| Honeybadger.notify(err) }\n+ # end\n+ #\n+ # execution do\n+ # # Honeybadger's configuration object is available inside\n+ # # execution blocks. It should generally not be used outside of\n+ # # internal plugins. See +Config+.\n+ # MyFramework.use_middleware(MyMiddleware) if config[:'my_framework.use_middleware']\n+ # end\n+ # end\n+ #\n+ # @return nil\ndef execution\n@executions << Proc.new\nend\n+ # @api private\ndef ok?(config)\n@requirements.all? {|r| Execution.new(config, &r).call }\nrescue => e\n@@ -76,6 +173,7 @@ module Honeybadger\nfalse\nend\n+ # @api private\ndef load!(config)\nif @loaded\nconfig.logger.debug(sprintf('skip plugin name=%s reason=loaded', name))\n@@ -95,16 +193,18 @@ module Honeybadger\nfalse\nend\n+ # @api private\n+ def loaded?\n+ @loaded\n+ end\n+\n# @private\n# Used for testing only; don't normally call this. :)\ndef reset!\n@loaded = false\nend\n- def loaded?\n- @loaded\n- end\n-\n+ # @api private\nattr_reader :name, :requirements, :executions\nend\nend\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Document Plugin class. |
287,654 | 28.01.2019 14:26:54 | 28,800 | 728e7b9f8cbc08e1dc04ff5a391bcf3e412b8263 | Remove unsupported Rails/Ruby versions | [
{
"change_type": "MODIFY",
"old_path": ".travis.yml",
"new_path": ".travis.yml",
"diff": "@@ -15,17 +15,12 @@ gemfile:\n- gemfiles/rack.gemfile\n- gemfiles/sinatra_1.gemfile\n- gemfiles/sinatra.gemfile\n- - gemfiles/rails3.2.gemfile\n- - gemfiles/rails4.0.gemfile\n- - gemfiles/rails4.1.gemfile\n- gemfiles/rails4.2.gemfile\n- gemfiles/rails.gemfile\n- gemfiles/rails5.0.gemfile\n- gemfiles/rails5.1.gemfile\n- gemfiles/rails5.2.gemfile\nrvm:\n- - 2.1.10\n- - 2.2.6\n- 2.3.3\n- 2.4.0\n- 2.5.0\n@@ -33,8 +28,6 @@ rvm:\nmatrix:\nfast_finish: true\nallow_failures:\n- - rvm: 2.2.6\n- gemfile: gemfiles/rails.gemfile\n- rvm: 2.3.3\ngemfile: gemfiles/rails.gemfile\n- rvm: 2.4.0\n@@ -44,36 +37,12 @@ matrix:\n- rvm: jruby-9.1.7.0\ngemfile: gemfiles/rails.gemfile\nexclude:\n- - rvm: 2.1.10\n- gemfile: gemfiles/rails.gemfile\n- - rvm: 2.1.10\n- gemfile: gemfiles/rails5.0.gemfile\n- - rvm: 2.1.10\n- gemfile: gemfiles/rails5.1.gemfile\n- - rvm: 2.1.10\n- gemfile: gemfiles/rails5.2.gemfile\n- - rvm: 2.1.10\n- gemfile: gemfiles/rack.gemfile\n- - rvm: 2.1.10\n- gemfile: gemfiles/sinatra.gemfile\n- - rvm: 2.4.0\n- gemfile: gemfiles/rails4.0.gemfile\n- - rvm: 2.4.0\n- gemfile: gemfiles/rails4.1.gemfile\n- rvm: 2.4.0\ngemfile: gemfiles/rails4.2.gemfile\n- - rvm: 2.5.0\n- gemfile: gemfiles/rails4.0.gemfile\n- - rvm: 2.5.0\n- gemfile: gemfiles/rails4.1.gemfile\n- rvm: 2.5.0\ngemfile: gemfiles/rails4.2.gemfile\n- rvm: jruby-9.1.7.0\ngemfile: gemfiles/binding_of_caller.gemfile\n- # activesupport 4.0 depends on minitest ~> 4.2, Ruby 2.3 bundles minitest\n- # 5. This isn't a problem locally, but it blows up Travis for some reason.\n- - rvm: jruby-9.1.7.0\n- gemfile: gemfiles/rails4.0.gemfile\nenv:\nglobal:\nsecure: DwQI6QHuRRaMoKvE9rnXmw3U1KLKH6Y1ZTXCcDN34Zkq7QG5KPt195zvL6XPbsefvd2fOHq4es5D6jxgLlEdKB7njhWX8XNMgb/eprz6zTxSAS/ep31zYHEJ3krWSPM6a7fXJOjdYIzXhVl7I0NRDZGy/Sf6LgHIBMpaGVKGc34=\n"
},
{
"change_type": "DELETE",
"old_path": "gemfiles/rails3.2.gemfile",
"new_path": null,
"diff": "-# This file was generated by Appraisal\n-\n-source \"https://rubygems.org\"\n-\n-gem \"allocation_stats\", platforms: :mri, require: false\n-gem \"appraisal\", \"~> 2.1\"\n-gem \"aruba\", \"~> 0.14\"\n-gem \"guard\"\n-gem \"guard-rspec\"\n-gem \"pry\"\n-gem \"pry-byebug\", platforms: :mri\n-gem \"rdoc\"\n-gem \"rspec\", \"~> 3.0\"\n-gem \"rspec-its\"\n-gem \"ruby-prof\", platforms: :mri, require: false\n-gem \"timecop\"\n-gem \"webmock\"\n-gem \"capistrano\", \"~> 2.0\"\n-gem \"rake\"\n-gem \"listen\", \"~> 3.0.8\"\n-gem \"rails\", \"~> 3.2.12\"\n-gem \"better_errors\", require: false, platforms: [:ruby_20, :ruby_21]\n-gem \"rack-mini-profiler\", require: false\n-gem \"rspec-rails\"\n-gem \"test-unit\", \"~> 3.0\"\n-\n-platforms :ruby_25 do\n- gem \"mathn\"\n-end\n-\n-gemspec path: \"../\"\n"
},
{
"change_type": "DELETE",
"old_path": "gemfiles/rails4.0.gemfile",
"new_path": null,
"diff": "-# This file was generated by Appraisal\n-\n-source \"https://rubygems.org\"\n-\n-gem \"allocation_stats\", platforms: :mri, require: false\n-gem \"appraisal\", \"~> 2.1\"\n-gem \"aruba\", \"~> 0.14\"\n-gem \"guard\"\n-gem \"guard-rspec\"\n-gem \"pry\"\n-gem \"pry-byebug\", platforms: :mri\n-gem \"rdoc\"\n-gem \"rspec\", \"~> 3.0\"\n-gem \"rspec-its\"\n-gem \"ruby-prof\", platforms: :mri, require: false\n-gem \"timecop\"\n-gem \"webmock\"\n-gem \"capistrano\"\n-gem \"rake\"\n-gem \"listen\", \"~> 3.0.8\"\n-gem \"rails\", \"~> 4.0.0\"\n-gem \"better_errors\", require: false, platforms: [:ruby_20, :ruby_21]\n-gem \"rack-mini-profiler\", require: false\n-gem \"rspec-rails\"\n-\n-platforms :ruby_25 do\n- gem \"mathn\"\n-end\n-\n-gemspec path: \"../\"\n"
},
{
"change_type": "DELETE",
"old_path": "gemfiles/rails4.1.gemfile",
"new_path": null,
"diff": "-# This file was generated by Appraisal\n-\n-source \"https://rubygems.org\"\n-\n-gem \"allocation_stats\", platforms: :mri, require: false\n-gem \"appraisal\", \"~> 2.1\"\n-gem \"aruba\", \"~> 0.14\"\n-gem \"guard\"\n-gem \"guard-rspec\"\n-gem \"pry\"\n-gem \"pry-byebug\", platforms: :mri\n-gem \"rdoc\"\n-gem \"rspec\", \"~> 3.0\"\n-gem \"rspec-its\"\n-gem \"ruby-prof\", platforms: :mri, require: false\n-gem \"timecop\"\n-gem \"webmock\"\n-gem \"capistrano\"\n-gem \"rake\"\n-gem \"listen\", \"~> 3.0.8\"\n-gem \"rails\", \"~> 4.1.4\"\n-gem \"better_errors\", require: false, platforms: [:ruby_20, :ruby_21]\n-gem \"rack-mini-profiler\", require: false\n-gem \"rspec-rails\"\n-\n-platforms :ruby_25 do\n- gem \"mathn\"\n-end\n-\n-gemspec path: \"../\"\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Remove unsupported Rails/Ruby versions
https://guides.rubyonrails.org/maintenance_policy.html
https://www.ruby-lang.org/en/downloads/branches/ |
287,654 | 28.01.2019 17:42:46 | 28,800 | 1ca5d5f9edba6f32ca58c390e2867ae542e7123c | update jruby target | [
{
"change_type": "MODIFY",
"old_path": ".travis.yml",
"new_path": ".travis.yml",
"diff": "@@ -24,7 +24,7 @@ rvm:\n- 2.3.3\n- 2.4.0\n- 2.5.0\n- - jruby-9.1.7.0\n+ - jruby-9.2.5.0\nmatrix:\nfast_finish: true\nallow_failures:\n@@ -34,14 +34,14 @@ matrix:\ngemfile: gemfiles/rails.gemfile\n- rvm: 2.5.0\ngemfile: gemfiles/rails.gemfile\n- - rvm: jruby-9.1.7.0\n+ - rvm: jruby-9.2.5.0\ngemfile: gemfiles/rails.gemfile\nexclude:\n- rvm: 2.4.0\ngemfile: gemfiles/rails4.2.gemfile\n- rvm: 2.5.0\ngemfile: gemfiles/rails4.2.gemfile\n- - rvm: jruby-9.1.7.0\n+ - rvm: jruby-9.2.5.0\ngemfile: gemfiles/binding_of_caller.gemfile\nenv:\nglobal:\n"
},
{
"change_type": "MODIFY",
"old_path": "spec/unit/honeybadger/util/stats_spec.rb",
"new_path": "spec/unit/honeybadger/util/stats_spec.rb",
"diff": "@@ -36,7 +36,7 @@ describe Honeybadger::Util::Stats do\ncontext 'when mathn is required' do\nbefore(:all) { require 'mathn' }\n- it 'converts Rational to Float' do\n+ it 'converts Rational to Float', if: RUBY_VERSION < '2.5.0' do\nexpect(Honeybadger::Util::Stats.memory[:total]).to be_a Float\nexpect(Honeybadger::Util::Stats.memory[:free]).to be_a Float\nexpect(Honeybadger::Util::Stats.memory[:buffers]).to be_a Float\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | update jruby target |
287,654 | 28.01.2019 19:21:37 | 28,800 | c9d99f54c5cb547f00f7e1d1cbb8c3cefe0a5656 | skip JRuby/Rails 4.2 | [
{
"change_type": "MODIFY",
"old_path": ".travis.yml",
"new_path": ".travis.yml",
"diff": "@@ -43,6 +43,8 @@ matrix:\ngemfile: gemfiles/rails4.2.gemfile\n- rvm: jruby-9.2.5.0\ngemfile: gemfiles/binding_of_caller.gemfile\n+ - rvm: jruby-9.2.5.0\n+ gemfile: gemfiles/rails4.2.gemfile\nenv:\nglobal:\nsecure: DwQI6QHuRRaMoKvE9rnXmw3U1KLKH6Y1ZTXCcDN34Zkq7QG5KPt195zvL6XPbsefvd2fOHq4es5D6jxgLlEdKB7njhWX8XNMgb/eprz6zTxSAS/ep31zYHEJ3krWSPM6a7fXJOjdYIzXhVl7I0NRDZGy/Sf6LgHIBMpaGVKGc34=\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | skip JRuby/Rails 4.2 |
287,654 | 01.02.2019 16:58:28 | 28,800 | 3fee154adf83774ea7af42bb1c11408250376b52 | fix before_notify hooks bug
before_notify hooks are overridden on subsequent Honeybadger.configure calls
Fixes | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "@@ -4,6 +4,9 @@ CHANGELOG](http://keepachangelog.com/) for how to update this file. This project\nadheres to [Semantic Versioning](http://semver.org/).\n## [Unreleased]\n+### Fixed\n+- Fix #301 - before_notify hooks are overridden on subsequent\n+ `Honeybadger.configure` calls.\n## [4.2.0] - 2019-01-31\n### Changed\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/config.rb",
"new_path": "lib/honeybadger/config.rb",
"diff": "@@ -72,9 +72,9 @@ module Honeybadger\nend\ndef configure\n- ruby_config = Ruby.new(self)\n- yield(ruby_config)\n- self.ruby = ruby.merge(ruby_config).freeze\n+ new_ruby = Ruby.new(self)\n+ yield(new_ruby)\n+ self.ruby = ruby.merge(new_ruby).freeze\n@logger = @backend = nil\nself\nend\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/config/ruby.rb",
"new_path": "lib/honeybadger/config/ruby.rb",
"diff": "@@ -82,13 +82,15 @@ module Honeybadger\nend\ndef before_notify(action = nil, &block)\n- (hash[:before_notify] ||= []).tap do |before_notify_hooks|\n+ hooks = Array(get(:before_notify)).dup\n+\nif action && validate_before_action(action)\n- before_notify_hooks << action\n+ hooks << action\nelsif block_given? && validate_before_action(block)\n- before_notify_hooks << block\n- end\n+ hooks << block\nend\n+\n+ hash[:before_notify] = hooks\nend\ndef backtrace_filter\n"
},
{
"change_type": "MODIFY",
"old_path": "spec/unit/honeybadger/config/ruby_spec.rb",
"new_path": "spec/unit/honeybadger/config/ruby_spec.rb",
"diff": "@@ -106,6 +106,13 @@ describe Honeybadger::Config::Ruby do\nexpect(subject.before_notify).to eq([callable])\nend\n+\n+ it \"configures multiple hooks\" do\n+ subject.before_notify {|n| n }\n+ subject.before_notify {|n| n }\n+\n+ expect(subject.before_notify.size).to eq(2)\n+ end\nend\ndescribe \"#exception_filter\" do\n"
},
{
"change_type": "MODIFY",
"old_path": "spec/unit/honeybadger/config_spec.rb",
"new_path": "spec/unit/honeybadger/config_spec.rb",
"diff": "@@ -268,5 +268,17 @@ describe Honeybadger::Config do\nhoneybadger.logger.error('foo')\nend\nend\n+\n+ it \"configures multiple before_notify hooks\" do\n+ subject.configure do |config|\n+ config.before_notify {|n| n }\n+ end\n+\n+ subject.configure do |config|\n+ config.before_notify {|n| n }\n+ end\n+\n+ expect(subject.before_notify_hooks.size).to eq(2)\n+ end\nend\nend\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | fix before_notify hooks bug (#302)
before_notify hooks are overridden on subsequent Honeybadger.configure calls
Fixes #301 |
287,654 | 19.03.2019 08:33:52 | 25,200 | 1114b40436e83e0e2a5e334470a2beefc77f9ce8 | Infer correct types when parsing backtraces
* Infer correct types when parsing backtraces
Fixes
* Dry up backtrace conversion
* Missed one
* Make spec less Ruby-dependent (JRuby) | [
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/backtrace.rb",
"new_path": "lib/honeybadger/backtrace.rb",
"diff": "@@ -114,10 +114,10 @@ module Honeybadger\nattr_reader :lines, :application_lines\ndef self.parse(ruby_backtrace, opts = {})\n- ruby_lines = split_multiline_backtrace(ruby_backtrace)\n+ ruby_lines = split_multiline_backtrace(ruby_backtrace.to_a)\nlines = ruby_lines.collect do |unparsed_line|\n- Line.parse(unparsed_line, opts)\n+ Line.parse(unparsed_line.to_s, opts)\nend.compact\ninstance = new(lines)\n@@ -171,8 +171,8 @@ module Honeybadger\nattr_writer :lines, :application_lines\ndef self.split_multiline_backtrace(backtrace)\n- if backtrace.to_a.size == 1\n- backtrace.to_a.first.split(/\\n\\s*/)\n+ if backtrace.size == 1\n+ backtrace.first.to_s.split(/\\n\\s*/)\nelse\nbacktrace\nend\n"
},
{
"change_type": "MODIFY",
"old_path": "spec/unit/honeybadger/backtrace_spec.rb",
"new_path": "spec/unit/honeybadger/backtrace_spec.rb",
"diff": "@@ -44,6 +44,19 @@ describe Honeybadger::Backtrace do\nexpect(line.method).to eq 'index'\nend\n+ it \"infers types from backtace lines\" do\n+ array_thing = double(to_a: [\n+ double(to_s: \"app/models/user.rb:13:in `magic'\"),\n+ double(to_s: \"app/controllers/users_controller.rb:8:in `index'\")\n+ ])\n+ backtrace = Honeybadger::Backtrace.parse(array_thing, filters: [lambda {|l| l.sub('foo', 'bar') }])\n+ line = backtrace.lines.first\n+\n+ expect(line.number).to eq '13'\n+ expect(line.file).to eq 'app/models/user.rb'\n+ expect(line.method).to eq 'magic'\n+ end\n+\nit \"is equal with equal lines\" do\none = build_backtrace_array\ntwo = one.dup\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Infer correct types when parsing backtraces (#307)
* Infer correct types when parsing backtraces
Fixes #305
* Dry up backtrace conversion
* Missed one
* Make spec less Ruby-dependent (JRuby) |
287,668 | 21.03.2019 11:26:23 | 18,000 | 7bc53e6055b9ad6823007642585f0e27ac839571 | Minor CLI desc fix | [
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/cli/main.rb",
"new_path": "lib/honeybadger/cli/main.rb",
"diff": "@@ -90,7 +90,7 @@ WELCOME\noption :message, required: true, type: :string, aliases: :'-m', desc: 'The error message.'\noption :action, required: false, type: :string, aliases: :'-a', desc: 'The action.'\noption :component, required: false, type: :string, aliases: :'-C', desc: 'The component.'\n- option :fingerprint, required: false, type: :string, aliases: :'-f', desc: 'The component.'\n+ option :fingerprint, required: false, type: :string, aliases: :'-f', desc: 'The fingerprint.'\noption :tags, required: false, type: :string, aliases: :'-t', desc: 'The tags.'\noption :url, required: false, type: :string, aliases: :'-u', desc: 'The URL.'\ndef notify\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Minor CLI desc fix (#308) |
287,654 | 17.05.2019 13:59:25 | 25,200 | 56c567fd3d2cbd7510f331ef6417b2e7c19870d0 | Use bump gem | [
{
"change_type": "MODIFY",
"old_path": "Gemfile",
"new_path": "Gemfile",
"diff": "@@ -27,3 +27,5 @@ gem 'listen', '~> 3.0.8'\nplatforms :ruby_25 do\ngem \"mathn\"\nend\n+\n+gem \"bump\", \"~> 0.8.0\"\n"
},
{
"change_type": "MODIFY",
"old_path": "Rakefile",
"new_path": "Rakefile",
"diff": "+# frozen_string_literal: true\n+\nrequire 'rubygems'\nrequire 'bundler/setup'\n+require 'bump'\nrequire 'appraisal'\nrequire 'honeybadger/version'\nrequire_relative 'tools/release'\n@@ -9,6 +12,14 @@ VERSION = Honeybadger::VERSION\nGEM_FILE = \"#{NAME}-#{VERSION}.gem\".freeze\nGEMSPEC_FILE = \"#{NAME}.gemspec\".freeze\n+require 'rdoc/task'\n+RDoc::Task.new do |rdoc|\n+ rdoc.main = 'README.md'\n+ rdoc.markup = 'tomdoc'\n+ rdoc.rdoc_dir = 'doc'\n+ rdoc.rdoc_files.include('README.md', 'lib/**/*.rb')\n+end\n+\nrequire 'rspec/core/rake_task'\nnamespace :spec do\ndesc 'Run unit specs'\n@@ -38,26 +49,39 @@ task spec: :'spec:all'\ntask test: :spec\ntask default: :spec\n-patch_version = Release.next_version(VERSION, 1)\n-desc \"Bump v#{VERSION} to v#{patch_version}\"\n-task :patch do\n- Release.run(patch_version)\n+namespace :bump do\n+ current_version = Bump::Bump.current\n+\n+ %w(major minor patch pre).each do |bump|\n+ version = Bump::Bump.next_version(bump)\n+ desc \"Bump v#{current_version} to v#{version}\"\n+ task bump do\n+ Release.run_before(version)\n+ Bump::Bump.run(bump, commit: false)\n+ end\n+ end\n+\n+ desc \"Bump v#{current_version} to $VERSION\"\n+ task :set do\n+ unless ENV[\"VERSION\"] =~ /\\S/\n+ puts \"ERROR: version can't be blank\"\n+ exit 1\nend\n-minor_version = Release.next_version(VERSION, 2)\n-desc \"Bump v#{VERSION} to v#{minor_version}\"\n-task :minor do\n- Release.run(minor_version)\n+ Release.run_before(ENV['VERSION'])\n+ Bump::Bump.run('set', commit: false, version: ENV[\"VERSION\"])\n+ end\nend\n-major_version = Release.next_version(VERSION, 3)\n-desc \"Bump v#{VERSION} to v#{major_version}\"\n-task :major do\n- Release.run(major_version)\n+desc \"Build #{GEM_FILE} into the pkg directory\"\n+task :build do\n+ sh \"mkdir -p pkg\"\n+ sh \"gem build #{GEMSPEC_FILE}\"\n+ sh \"mv #{GEM_FILE} pkg\"\nend\ndesc \"Create tag v#{VERSION} and build and push #{GEM_FILE} to Rubygems\"\n-task :release => :build do\n+task :release => [:spec, :build] do\nunless `git branch` =~ /^\\* master$/\nputs \"You must be on the master branch to release!\"\nexit!\n@@ -68,18 +92,3 @@ task :release => :build do\nsh \"git push origin v#{VERSION}\"\nsh \"gem push pkg/#{GEM_FILE}\"\nend\n-\n-desc \"Build #{GEM_FILE} into the pkg directory\"\n-task :build do\n- sh \"mkdir -p pkg\"\n- sh \"gem build #{GEMSPEC_FILE}\"\n- sh \"mv #{GEM_FILE} pkg\"\n-end\n-\n-require 'rdoc/task'\n-RDoc::Task.new do |rdoc|\n- rdoc.main = 'README.md'\n- rdoc.markup = 'tomdoc'\n- rdoc.rdoc_dir = 'doc'\n- rdoc.rdoc_files.include('README.md', 'lib/**/*.rb')\n-end\n"
},
{
"change_type": "MODIFY",
"old_path": "tools/release.rb",
"new_path": "tools/release.rb",
"diff": "@@ -5,36 +5,19 @@ require 'honeybadger/version'\nmodule Release\nCHANGELOG_FILE = 'CHANGELOG.md'.freeze\nCHANGELOG_HEADING = '## [Unreleased]'\n- EXIT_CMD = 'bundle update honeybadger && git add -p'\nVERSION_FILE = 'lib/honeybadger/version.rb'\n- def self.run(version)\n- # Update the version file.\n- File.write(VERSION_FILE, File.read(VERSION_FILE).gsub(Honeybadger::VERSION, version))\n-\n- # Update the changelog.\n+ def self.run_before(version)\nbump_changelog(version)\n-\n- unless Bundler.with_clean_env { system(EXIT_CMD) }\n- puts \"Failed to bump release version.\"\n- exit!\n- end\nend\n- def self.next_version(version, offset = 1)\n- offset = -1 * offset\n- segments = Gem::Version.new(version).segments.dup\n- segments.pop while segments.any? { |s| String === s }\n- segments[offset] = segments[offset].succ\n- (offset+1).upto(-1) {|o| segments[o] = 0 }\n- segments.join('.')\n+ def self.bump_changelog(version)\n+ contents = File.read(CHANGELOG_FILE)\n+ if contents =~ Regexp.new(Regexp.escape(\"## [#{version}]\"))\n+ puts \"ERROR: #{ version } already exists in CHANGELOG.md\"\n+ exit 1\nend\n- def self.bump_changelog(version = nil)\n- version = next_version(Honeybadger::VERSION) unless version.to_s =~ /\\S/\n- contents = File.read(CHANGELOG_FILE)\n- unless contents =~ Regexp.new(Regexp.escape(\"## [#{version}]\"))\nFile.write(CHANGELOG_FILE, contents.gsub(CHANGELOG_HEADING, \"#{CHANGELOG_HEADING}\\n\\n## [#{version}] - #{Time.now.strftime(\"%Y-%m-%d\")}\"))\nend\nend\n-end\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Use bump gem |
287,654 | 17.05.2019 14:47:10 | 25,200 | 05bdfb3a46390e74169181038cae51a3145713a3 | Add exit command back | [
{
"change_type": "MODIFY",
"old_path": "Rakefile",
"new_path": "Rakefile",
"diff": "@@ -58,6 +58,7 @@ namespace :bump do\ntask bump do\nRelease.run_before(version)\nBump::Bump.run(bump, commit: false)\n+ Release.run_after(version)\nend\nend\n@@ -70,6 +71,7 @@ namespace :bump do\nRelease.run_before(ENV['VERSION'])\nBump::Bump.run('set', commit: false, version: ENV[\"VERSION\"])\n+ Release.run_after(ENV['VERSION'])\nend\nend\n"
},
{
"change_type": "MODIFY",
"old_path": "tools/release.rb",
"new_path": "tools/release.rb",
"diff": "@@ -5,12 +5,16 @@ require 'honeybadger/version'\nmodule Release\nCHANGELOG_FILE = 'CHANGELOG.md'.freeze\nCHANGELOG_HEADING = '## [Unreleased]'\n- VERSION_FILE = 'lib/honeybadger/version.rb'\n+ EXIT_CMD = 'bundle update honeybadger && git add -p'\ndef self.run_before(version)\nbump_changelog(version)\nend\n+ def self.run_after(version)\n+ Bundler.with_clean_env { system(EXIT_CMD) }\n+ end\n+\ndef self.bump_changelog(version)\ncontents = File.read(CHANGELOG_FILE)\nif contents =~ Regexp.new(Regexp.escape(\"## [#{version}]\"))\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Add exit command back |
287,649 | 30.07.2019 09:54:08 | 25,200 | aa1bc14d4f25171c88b6c773ae02d18709d40555 | Deal with non-string breadcrumb log inputs | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "@@ -4,6 +4,8 @@ CHANGELOG](http://keepachangelog.com/) for how to update this file. This project\nadheres to [Semantic Versioning](http://semver.org/).\n## [Unreleased]\n+### Fixed\n+- Allow non-strings to be passed to breadcrumbs logger\n## [4.4.0] - 2019-07-24\n### Added\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/breadcrumbs/logging.rb",
"new_path": "lib/honeybadger/breadcrumbs/logging.rb",
"diff": "@@ -5,7 +5,7 @@ module Honeybadger\nmodule LogWrapper\ndef add(severity, message = nil, progname = nil)\nmessage, progname = [progname, nil] if message.nil?\n- message = message && message.strip\n+ message = message && message.to_s.strip\nunless should_ignore_log?(message, progname)\nHoneybadger.add_breadcrumb(message, category: :log, metadata: {\nseverity: format_severity(severity),\n"
},
{
"change_type": "MODIFY",
"old_path": "spec/fixtures/rails/config/application.rb",
"new_path": "spec/fixtures/rails/config/application.rb",
"diff": "@@ -12,6 +12,8 @@ if SKIP_ACTIVE_RECORD\nelse\nrequire 'active_record/railtie'\nrequire 'activerecord-jdbcsqlite3-adapter' if defined?(JRUBY_VERSION)\n+ require 'active_support'\n+ require 'active_support/core_ext/enumerable'\nENV['DATABASE_URL'] = 'sqlite3::memory:'\nend\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "spec/unit/honeybadger/breadcrumbs/logging_spec.rb",
"diff": "+require 'honeybadger/breadcrumbs/logging'\n+\n+describe Honeybadger::Breadcrumbs::LogWrapper do\n+ let(:logger) do\n+ Class.new do\n+ prepend Honeybadger::Breadcrumbs::LogWrapper\n+\n+ def add(_, *args)\n+ end\n+\n+ def format_severity(str)\n+ str\n+ end\n+ end\n+ end\n+\n+ subject { logger.new }\n+\n+ it 'adds a breadcrumb' do\n+ expect(subject).to receive(:format_severity).and_return(\"debug\")\n+ expect(Honeybadger).to receive(:add_breadcrumb).with(\"Message\", hash_including(category: :log, metadata: hash_including(severity: \"debug\", progname: \"none\")))\n+\n+ subject.add(\"test\", \"Message\", \"none\")\n+ end\n+\n+ it 'handles non-string objects' do\n+ expect(Honeybadger).to receive(:add_breadcrumb).with(\"{}\", anything)\n+ subject.add(\"DEBUG\", {})\n+ end\n+\n+ describe \"ignores messages on\" do\n+ before { expect(Honeybadger).to_not receive(:add_breadcrumb) }\n+\n+ it 'nil message' do\n+ subject.add(\"test\", nil)\n+ end\n+\n+ it 'empty string' do\n+ subject.add(\"test\", \"\")\n+ end\n+\n+ it 'honeybadger progname' do\n+ subject.add(\"test\", \"noop\", \"honeybadger\")\n+ end\n+\n+ it 'within log_subscriber call' do\n+ Thread.current[:__hb_within_log_subscriber] = true\n+ subject.add(\"test\", \"a message\")\n+ Thread.current[:__hb_within_log_subscriber] = false\n+ end\n+ end\n+end\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Deal with non-string breadcrumb log inputs (#316) |
287,663 | 01.08.2019 09:58:17 | 25,200 | 762bfd138a6e3a8f1c4e48d6c9acc6086c0ecff7 | Handle notifications with no finished time. | [
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/plugins/breadcrumbs.rb",
"new_path": "lib/honeybadger/plugins/breadcrumbs.rb",
"diff": "@@ -101,7 +101,9 @@ module Honeybadger\n# @api private\ndef self.subscribe_to_notification(name, notification_config)\nActiveSupport::Notifications.subscribe(name) do |_, started, finished, _, data|\n- send_breadcrumb_notification(name, finished - started, notification_config, data)\n+ duration = finished && started ? finished - started : nil\n+\n+ send_breadcrumb_notification(name, duration, notification_config, data)\nend\nend\nend\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Handle notifications with no finished time. (#320) |
287,649 | 01.08.2019 10:12:15 | 25,200 | 3cbc6006457f8901a96a1129a03642ebd64576fe | Added specs and updated changelog | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "@@ -4,6 +4,9 @@ CHANGELOG](http://keepachangelog.com/) for how to update this file. This project\nadheres to [Semantic Versioning](http://semver.org/).\n## [Unreleased]\n+### Fixed\n+- Handle ActiveSupport::Notifications passing nil started or finished time\n+ -@pcreux\n## [4.4.1] - 2019-07-30\n### Fixed\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/plugins/breadcrumbs.rb",
"new_path": "lib/honeybadger/plugins/breadcrumbs.rb",
"diff": "@@ -89,7 +89,7 @@ module Honeybadger\ndata = notification_config[:transform].call(data) if notification_config[:transform]\ndata = data.is_a?(Hash) ? data : {}\n- data[:duration] = duration\n+ data[:duration] = duration if duration\nHoneybadger.add_breadcrumb(\nmessage,\n@@ -101,7 +101,7 @@ module Honeybadger\n# @api private\ndef self.subscribe_to_notification(name, notification_config)\nActiveSupport::Notifications.subscribe(name) do |_, started, finished, _, data|\n- duration = finished && started ? finished - started : nil\n+ duration = finished - started if finished && started\nsend_breadcrumb_notification(name, duration, notification_config, data)\nend\n"
},
{
"change_type": "MODIFY",
"old_path": "spec/unit/honeybadger/plugins/breadcrumbs_spec.rb",
"new_path": "spec/unit/honeybadger/plugins/breadcrumbs_spec.rb",
"diff": "@@ -12,10 +12,11 @@ describe \"Breadcrumbs Plugin\" do\ndescribe Honeybadger::Plugins::RailsBreadcrumbs do\ndescribe \".subscribe_to_notification\" do\n+ let(:name) { \"a.notification\" }\n+ let(:config) {{ foo: \"bar\" }}\n+ let(:data) {{a: :b}}\n+\nit \"registers with activesupport and delgates to send_breadcrumb_notification\" do\n- name = \"a.notification\"\n- config = { foo: \"bar\" }\n- data = {a: :b}\nexpect(described_class).to receive(:send_breadcrumb_notification).with(name, 10, config, data)\nexpect(active_support).to receive(:subscribe).with(name) do |&block|\nblock.call(\"noop\", 10, 20, \"noop\", data)\n@@ -23,6 +24,15 @@ describe \"Breadcrumbs Plugin\" do\ndescribed_class.subscribe_to_notification(name, config)\nend\n+\n+ it \"reports nil duration if finish time is nil\" do\n+ expect(described_class).to receive(:send_breadcrumb_notification).with(name, nil, config, data)\n+ expect(active_support).to receive(:subscribe).with(name) do |&block|\n+ block.call(\"noop\", 100, nil, \"noop\", data)\n+ end\n+\n+ described_class.subscribe_to_notification(name, config)\n+ end\nend\ndescribe \".send_breadcrumb_notification\" do\n@@ -39,6 +49,11 @@ describe \"Breadcrumbs Plugin\" do\ndescribed_class.send_breadcrumb_notification(\"message\", 100, config, {})\nend\n+ it \"ignores nil duration\" do\n+ expect(Honeybadger).to receive(:add_breadcrumb).with(\"message\", {category: :custom, metadata: {}})\n+ described_class.send_breadcrumb_notification(\"message\", nil, config, {})\n+ end\n+\ndescribe \":message\" do\nit \"can allow a string\" do\nconfig = { message: \"config message\" }\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Added specs and updated changelog |
287,649 | 13.08.2019 11:22:17 | 25,200 | e369d21302a0d703f16964812b30e4a2a5edbce5 | Added attribution to Changelog fixes | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "@@ -4,12 +4,11 @@ CHANGELOG](http://keepachangelog.com/) for how to update this file. This project\nadheres to [Semantic Versioning](http://semver.org/).\n## [Unreleased]\n-### Fixed\n-- When `breadcrumbs` are enabled ensure we call the original `Logger#add` with the original arguments\n-\n### Fixed\n- Logging breadcrumbs will not crash anymore when logging is done using a block\n- form.\n+ form. -@Bajena\n+- When `breadcrumbs` are enabled ensure we call the original `Logger#add` with\n+ the original arguments -@JanStevens\n## [4.5.0] - 2019-08-05\n### Changed\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Added attribution to Changelog fixes |
287,657 | 19.08.2019 07:51:44 | 25,200 | b0b0d29a1123169673b888e6408571c3806ff23f | Target Ruby 2.3 | [
{
"change_type": "MODIFY",
"old_path": "honeybadger.gemspec",
"new_path": "honeybadger.gemspec",
"diff": "@@ -11,7 +11,7 @@ Gem::Specification.new do |s|\ns.homepage = 'https://github.com/honeybadger-io/honeybadger-ruby'\ns.license = 'MIT'\n- s.required_ruby_version = '>= 2.1.0'\n+ s.required_ruby_version = '>= 2.3.0'\ns.rdoc_options << '--markup=tomdoc'\ns.rdoc_options << '--main=README.md'\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Target Ruby 2.3 |
287,654 | 17.09.2019 14:55:27 | 25,200 | ea2852e5f87049ff06d8ae38873c30ec647587b7 | Document :sync option to Honeybadger.notify | [
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/agent.rb",
"new_path": "lib/honeybadger/agent.rb",
"diff": "@@ -102,6 +102,7 @@ module Honeybadger\n# @option opts [Array] :backtrace The backtrace of the error (optional).\n# @option opts [String] :fingerprint The grouping fingerprint of the exception (optional).\n# @option opts [Boolean] :force (false) Always report the exception when true, even when ignored (optional).\n+ # @option opts [Boolean] :sync (false) Send data synchronously (skips the worker) (optional).\n# @option opts [String] :tags The comma-separated list of tags (optional).\n# @option opts [Hash] :context The context to associate with the exception (optional).\n# @option opts [String] :controller The controller name (such as a Rails controller) (optional).\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Document :sync option to Honeybadger.notify |
287,654 | 07.01.2020 10:27:29 | 28,800 | f3632c096a60364edb1072993636ab63319fa727 | Build Ruby 2.7 on Circle
Closes | [
{
"change_type": "MODIFY",
"old_path": ".circleci/config.yml",
"new_path": ".circleci/config.yml",
"diff": "@@ -49,6 +49,15 @@ jobs:\n- <<: *bundle\n- <<: *save\n- <<: *test\n+ \"ruby-2.7\":\n+ docker:\n+ - image: circleci/ruby:2.7\n+ steps:\n+ - checkout\n+ - <<: *restore\n+ - <<: *bundle\n+ - <<: *save\n+ - <<: *test\n\"jruby\":\ndocker:\n- image: circleci/jruby:9.2.7-jdk\n@@ -68,4 +77,5 @@ workflows:\n- \"ruby-2.4\"\n- \"ruby-2.5\"\n- \"ruby-2.6\"\n+ - \"ruby-2.7\"\n- \"jruby\"\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Build Ruby 2.7 on Circle
Closes #340 |
287,654 | 07.01.2020 12:14:59 | 28,800 | 45101067e5eefeb0875c394b96f0d0733dcd4a86 | Remove Rails 4.2 from test matrix
Rails 4.2 is no longer maintained | [
{
"change_type": "MODIFY",
"old_path": "Appraisals",
"new_path": "Appraisals",
"diff": "@@ -26,15 +26,6 @@ appraise 'resque' do\ngem 'mock_redis'\nend\n-appraise 'rails4.2' do\n- gem 'rails', '~> 4.2.4'\n- gem 'sqlite3', '< 1.4', platform: :mri\n- gem 'activerecord-jdbcsqlite3-adapter', '1.3.25', platform: :jruby\n- gem 'better_errors', require: false, platforms: [:ruby_20, :ruby_21]\n- gem 'rack-mini-profiler', require: false\n- gem 'rspec-rails'\n-end\n-\nappraise 'rails5.0' do\ngem 'rails', '~> 5.0.0'\ngem 'sqlite3', '< 1.4', platform: :mri\n"
},
{
"change_type": "MODIFY",
"old_path": "gemfiles/binding_of_caller.gemfile",
"new_path": "gemfiles/binding_of_caller.gemfile",
"diff": "@@ -17,7 +17,7 @@ gem \"timecop\"\ngem \"webmock\"\ngem \"capistrano\"\ngem \"rake\"\n-gem \"listen\", \"~> 3.0.8\"\n+gem \"listen\", \"~> 3.2.1\"\ngem \"bump\", \"~> 0.8.0\"\ngem \"binding_of_caller\"\n"
},
{
"change_type": "MODIFY",
"old_path": "gemfiles/delayed_job.gemfile",
"new_path": "gemfiles/delayed_job.gemfile",
"diff": "@@ -17,7 +17,7 @@ gem \"timecop\"\ngem \"webmock\"\ngem \"capistrano\"\ngem \"rake\"\n-gem \"listen\", \"~> 3.0.8\"\n+gem \"listen\", \"~> 3.2.1\"\ngem \"bump\", \"~> 0.8.0\"\ngem \"delayed_job\", \"< 4.1.2\"\n"
},
{
"change_type": "MODIFY",
"old_path": "gemfiles/rack.gemfile",
"new_path": "gemfiles/rack.gemfile",
"diff": "@@ -17,7 +17,7 @@ gem \"timecop\"\ngem \"webmock\"\ngem \"capistrano\"\ngem \"rake\"\n-gem \"listen\", \"~> 3.0.8\"\n+gem \"listen\", \"~> 3.2.1\"\ngem \"bump\", \"~> 0.8.0\"\ngem \"rack\", \">= 2.0.0\"\n"
},
{
"change_type": "MODIFY",
"old_path": "gemfiles/rack_1.gemfile",
"new_path": "gemfiles/rack_1.gemfile",
"diff": "@@ -17,7 +17,7 @@ gem \"timecop\"\ngem \"webmock\"\ngem \"capistrano\"\ngem \"rake\"\n-gem \"listen\", \"~> 3.0.8\"\n+gem \"listen\", \"~> 3.2.1\"\ngem \"bump\", \"~> 0.8.0\"\ngem \"rack\", \"< 2.0\"\n"
},
{
"change_type": "DELETE",
"old_path": "gemfiles/rails4.2.gemfile",
"new_path": null,
"diff": "-# This file was generated by Appraisal\n-\n-source \"https://rubygems.org\"\n-\n-gem \"allocation_stats\", platforms: :mri, require: false\n-gem \"appraisal\", \"~> 2.1\"\n-gem \"aruba\", \"~> 0.14\"\n-gem \"guard\"\n-gem \"guard-rspec\"\n-gem \"pry\"\n-gem \"pry-byebug\", platforms: :mri\n-gem \"rdoc\"\n-gem \"rspec\", \"~> 3.0\"\n-gem \"rspec-its\"\n-gem \"ruby-prof\", platforms: :mri, require: false\n-gem \"timecop\"\n-gem \"webmock\"\n-gem \"capistrano\"\n-gem \"rake\"\n-gem \"listen\", \"~> 3.0.8\"\n-gem \"bump\", \"~> 0.8.0\"\n-gem \"rails\", \"~> 4.2.4\"\n-gem \"sqlite3\", \"< 1.4\", platform: :mri\n-gem \"activerecord-jdbcsqlite3-adapter\", \"1.3.25\", platform: :jruby\n-gem \"better_errors\", require: false, platforms: [:ruby_20, :ruby_21]\n-gem \"rack-mini-profiler\", require: false\n-gem \"rspec-rails\"\n-\n-platforms :ruby_25 do\n- gem \"mathn\"\n-end\n-\n-gemspec path: \"../\"\n"
},
{
"change_type": "MODIFY",
"old_path": "gemfiles/rails5.0.gemfile",
"new_path": "gemfiles/rails5.0.gemfile",
"diff": "@@ -17,7 +17,7 @@ gem \"timecop\"\ngem \"webmock\"\ngem \"capistrano\"\ngem \"rake\"\n-gem \"listen\", \"~> 3.0.8\"\n+gem \"listen\", \"~> 3.2.1\"\ngem \"bump\", \"~> 0.8.0\"\ngem \"rails\", \"~> 5.0.0\"\ngem \"sqlite3\", \"< 1.4\", platform: :mri\n"
},
{
"change_type": "MODIFY",
"old_path": "gemfiles/rails5.1.gemfile",
"new_path": "gemfiles/rails5.1.gemfile",
"diff": "@@ -17,7 +17,7 @@ gem \"timecop\"\ngem \"webmock\"\ngem \"capistrano\"\ngem \"rake\"\n-gem \"listen\", \"~> 3.0.8\"\n+gem \"listen\", \"~> 3.2.1\"\ngem \"bump\", \"~> 0.8.0\"\ngem \"rails\", \"~> 5.1.0\"\ngem \"sqlite3\", \"< 1.4\", platform: :mri\n"
},
{
"change_type": "MODIFY",
"old_path": "gemfiles/rails5.2.gemfile",
"new_path": "gemfiles/rails5.2.gemfile",
"diff": "@@ -17,7 +17,7 @@ gem \"timecop\"\ngem \"webmock\"\ngem \"capistrano\"\ngem \"rake\"\n-gem \"listen\", \"~> 3.0.8\"\n+gem \"listen\", \"~> 3.2.1\"\ngem \"bump\", \"~> 0.8.0\"\ngem \"rails\", \"~> 5.2.0\"\ngem \"sqlite3\", \"< 1.4\", platform: :mri\n"
},
{
"change_type": "MODIFY",
"old_path": "gemfiles/rails6.0.gemfile",
"new_path": "gemfiles/rails6.0.gemfile",
"diff": "@@ -17,7 +17,7 @@ gem \"timecop\"\ngem \"webmock\"\ngem \"capistrano\"\ngem \"rake\"\n-gem \"listen\", \"~> 3.0.8\"\n+gem \"listen\", \"~> 3.2.1\"\ngem \"bump\", \"~> 0.8.0\"\ngem \"rails\", \"~> 6.0.0.rc1\"\ngem \"sqlite3\", \"~> 1.4\", platform: :mri\n"
},
{
"change_type": "MODIFY",
"old_path": "gemfiles/resque.gemfile",
"new_path": "gemfiles/resque.gemfile",
"diff": "@@ -17,7 +17,7 @@ gem \"timecop\"\ngem \"webmock\"\ngem \"capistrano\"\ngem \"rake\"\n-gem \"listen\", \"~> 3.0.8\"\n+gem \"listen\", \"~> 3.2.1\"\ngem \"bump\", \"~> 0.8.0\"\ngem \"resque\"\ngem \"mock_redis\"\n"
},
{
"change_type": "MODIFY",
"old_path": "gemfiles/sinatra.gemfile",
"new_path": "gemfiles/sinatra.gemfile",
"diff": "@@ -17,7 +17,7 @@ gem \"timecop\"\ngem \"webmock\"\ngem \"capistrano\"\ngem \"rake\"\n-gem \"listen\", \"~> 3.0.8\"\n+gem \"listen\", \"~> 3.2.1\"\ngem \"bump\", \"~> 0.8.0\"\ngem \"sinatra\", \"~> 2.0.0.beta1\"\ngem \"rack-test\"\n"
},
{
"change_type": "MODIFY",
"old_path": "gemfiles/sinatra_1.gemfile",
"new_path": "gemfiles/sinatra_1.gemfile",
"diff": "@@ -17,7 +17,7 @@ gem \"timecop\"\ngem \"webmock\"\ngem \"capistrano\"\ngem \"rake\"\n-gem \"listen\", \"~> 3.0.8\"\n+gem \"listen\", \"~> 3.2.1\"\ngem \"bump\", \"~> 0.8.0\"\ngem \"sinatra\", \"< 2.0\"\ngem \"rack-test\"\n"
},
{
"change_type": "MODIFY",
"old_path": "gemfiles/standalone.gemfile",
"new_path": "gemfiles/standalone.gemfile",
"diff": "@@ -17,7 +17,7 @@ gem \"timecop\"\ngem \"webmock\"\ngem \"capistrano\"\ngem \"rake\"\n-gem \"listen\", \"~> 3.0.8\"\n+gem \"listen\", \"~> 3.2.1\"\ngem \"bump\", \"~> 0.8.0\"\nplatforms :ruby_25 do\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Remove Rails 4.2 from test matrix
Rails 4.2 is no longer maintained https://guides.rubyonrails.org/maintenance_policy.html |
287,654 | 07.01.2020 12:31:14 | 28,800 | 6455e82dff3bc97d4755c6c79adbc72339325b57 | Delete bad test case
This is failing in Ruby 2.7. It's testing Ruby's implementation of what
is basically a duck type. I don't think we need to test the underlying
data type of `logger.level`, as long as the predicate methods work. See
for why this was originally introduced. | [
{
"change_type": "MODIFY",
"old_path": "spec/unit/honeybadger/logging_spec.rb",
"new_path": "spec/unit/honeybadger/logging_spec.rb",
"diff": "@@ -37,34 +37,6 @@ describe Honeybadger::Logging::BootLogger.instance do\nend\nend\n-describe Honeybadger::Logging::Helper do\n- let(:logger) { Logger.new('/dev/null') }\n- let(:config) { double('Honeybadger::Config', logger: logger) }\n-\n- class HelperSubject\n- include Honeybadger::Logging::Helper\n-\n- def initialize(config)\n- @config = config\n- end\n-\n- def log_debug(msg); debug(msg); end\n- def log_info(msg); info(msg); end\n- def log_warn(msg); warn(msg); end\n- def log_error(msg); error(msg); end\n- end\n-\n- subject { HelperSubject.new(config) }\n-\n- it \"doesn't rely on Integer logger.level\" do\n- allow(logger).to receive(:level).and_return(:info)\n- subject.log_debug('debug message')\n- subject.log_info('info message')\n- subject.log_warn('warn message')\n- subject.log_error('error message')\n- end\n-end\n-\ndescribe Honeybadger::Logging::FormattedLogger do\nlet(:logger) { Logger.new('/dev/null') }\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Delete bad test case
This is failing in Ruby 2.7. It's testing Ruby's implementation of what
is basically a duck type. I don't think we need to test the underlying
data type of `logger.level`, as long as the predicate methods work. See
b2ba41ad for why this was originally introduced. |
287,649 | 29.01.2020 08:15:41 | 28,800 | c27f1bffe345a5bd5cde867fae0b8682b170c80a | Faktory Plugin | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "@@ -4,6 +4,8 @@ CHANGELOG](http://keepachangelog.com/) for how to update this file. This project\nadheres to [Semantic Versioning](http://semver.org/).\n## [Unreleased]\n+### Changed\n+- Added Faktory plugin -@scottrobertson\n## [4.5.6] - 2020-01-08\n### Fixed\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/config/defaults.rb",
"new_path": "lib/honeybadger/config/defaults.rb",
"diff": "@@ -279,6 +279,11 @@ module Honeybadger\ndefault: 0,\ntype: Integer\n},\n+ :'faktory.attempt_threshold' => {\n+ description: 'The number of attempts before notifications will be sent.',\n+ default: 0,\n+ type: Integer\n+ },\n:'sidekiq.use_component' => {\ndescription: 'Automatically set the component to the class of the job. Helps with grouping.',\ndefault: true,\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "lib/honeybadger/plugins/faktory.rb",
"diff": "+require 'honeybadger/plugin'\n+require 'honeybadger/ruby'\n+\n+module Honeybadger\n+ module Plugins\n+ module Faktory\n+ class Middleware\n+ def call(worker, job)\n+ Honeybadger.clear!\n+ yield\n+ end\n+ end\n+\n+ Plugin.register do\n+ requirement { defined?(::Faktory) }\n+\n+ execution do\n+ ::Faktory.configure_worker do |faktory|\n+ faktory.worker_middleware do |chain|\n+ chain.prepend Middleware\n+ end\n+ end\n+\n+ ::Faktory.configure_worker do |faktory|\n+ faktory.error_handlers << lambda do |ex, params|\n+ opts = {parameters: params}\n+\n+ if job = params[:job]\n+ if (threshold = config[:'faktory.attempt_threshold'].to_i) > 0\n+ # If job.failure is nil, it is the first attempt. The first\n+ # retry has a job.failure.retry_count of 0, which would be\n+ # the second attempt in our case.\n+ retry_count = job.dig('failure', 'retry_count')\n+ attempt = retry_count ? retry_count + 1 : 0\n+\n+ limit = [job['retry'].to_i, threshold].min\n+\n+ return if attempt < limit\n+ end\n+\n+ opts[:component] = job['jobtype']\n+ opts[:action] = 'perform'\n+ end\n+\n+ Honeybadger.notify(ex, opts)\n+ end\n+ end\n+ end\n+ end\n+ end\n+ end\n+end\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "spec/unit/honeybadger/plugins/faktory_spec.rb",
"diff": "+require 'honeybadger/plugins/faktory'\n+require 'honeybadger/config'\n+\n+describe \"Faktory Dependency\" do\n+ let(:config) { Honeybadger::Config.new(logger: NULL_LOGGER, debug: true) }\n+\n+ before do\n+ Honeybadger::Plugin.instances[:faktory].reset!\n+ end\n+\n+ context \"when faktory is not installed\" do\n+ it \"fails quietly\" do\n+ expect { Honeybadger::Plugin.instances[:faktory].load!(config) }.not_to raise_error\n+ end\n+ end\n+\n+ context \"when faktory is installed\" do\n+ let(:shim) do\n+ Class.new do\n+ def self.configure_worker\n+ end\n+ end\n+ end\n+\n+ let(:faktory_config) { double('config', :error_handlers => []) }\n+ let(:chain) { double('chain', :prepend => true) }\n+\n+ before do\n+ Object.const_set(:Faktory, shim)\n+ allow(::Faktory).to receive(:configure_worker).and_yield(faktory_config)\n+ allow(faktory_config).to receive(:worker_middleware).and_yield(chain)\n+ end\n+\n+ after { Object.send(:remove_const, :Faktory) }\n+\n+ it \"adds the error handler\" do\n+ Honeybadger::Plugin.instances[:faktory].load!(config)\n+ expect(faktory_config.error_handlers).not_to be_empty\n+ end\n+\n+ describe \"error handler\" do\n+ let(:exception) { RuntimeError.new('boom') }\n+\n+ before do\n+ Honeybadger::Plugin.instances[:faktory].load!(config)\n+ end\n+\n+ context \"not within job execution\" do\n+ let(:handler_context) { {context: 'Failed Hard', event: {} } }\n+\n+ it \"notifies Honeybadger\" do\n+ expect(Honeybadger).to receive(:notify).with(exception, { parameters: handler_context }).once\n+ faktory_config.error_handlers[0].call(exception, handler_context)\n+ end\n+ end\n+\n+ context \"within job execution\" do\n+ let(:handler_context) { {context: 'Job raised exception', job: job } }\n+ let(:job) { first_invocation }\n+ let(:retried_invocation) { {'retry' => retry_limit, 'failure' => failure, 'jobtype' => 'JobType'} }\n+ let(:first_invocation) { {'retry' => retry_limit, 'jobtype' => 'JobType'} }\n+ let(:failure) { { 'retry_count' => attempt - 1 } }\n+ let(:retry_limit) { 5 }\n+ let(:attempt) { 0 }\n+\n+ let(:error_payload) {{\n+ parameters: handler_context,\n+ component: 'JobType',\n+ action: 'perform'\n+ }}\n+\n+ it \"notifies Honeybadger\" do\n+ expect(Honeybadger).to receive(:notify).with(exception, error_payload).once\n+ faktory_config.error_handlers[0].call(exception, handler_context)\n+ end\n+\n+ context \"when an attempt threshold is configured\" do\n+ let(:job) { retried_invocation }\n+ let(:retry_limit) { 1 }\n+ let(:attempt) { 0 }\n+ let(:config) { Honeybadger::Config.new(logger: NULL_LOGGER, debug: true, :'faktory.attempt_threshold' => 5) }\n+\n+ it \"doesn't notify Honeybadger\" do\n+ expect(Honeybadger).not_to receive(:notify)\n+ faktory_config.error_handlers[0].call(exception, handler_context)\n+ end\n+\n+ context \"and the retry_limit is zero on first invocation\" do\n+ let(:job) { first_invocation }\n+ let(:retry_limit) { 0 }\n+\n+ it \"notifies Honeybadger\" do\n+ expect(Honeybadger).to receive(:notify).with(exception, error_payload).once\n+ faktory_config.error_handlers[0].call(exception, handler_context)\n+ end\n+ end\n+\n+ context \"and the retry_limit is exhausted\" do\n+ let(:attempt) { 3 }\n+ let(:retry_limit) { 3 }\n+\n+ it \"notifies Honeybadger\" do\n+ expect(Honeybadger).to receive(:notify).with(exception, error_payload).once\n+ faktory_config.error_handlers[0].call(exception, handler_context)\n+ end\n+ end\n+\n+ context \"and the attempts meets the threshold\" do\n+ let(:attempt) { 5 }\n+ let(:retry_limit) { 10 }\n+\n+ it \"notifies Honeybadger\" do\n+ expect(Honeybadger).to receive(:notify).with(exception, error_payload).once\n+ faktory_config.error_handlers[0].call(exception, handler_context)\n+ end\n+ end\n+ end\n+ end\n+ end\n+ end\n+end\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Faktory Plugin (#344) |
287,649 | 03.02.2020 09:59:00 | 28,800 | f6d048e93a47e6d88441f9e41cd3ffe659240c7d | Dup #notify opts before mutating | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "@@ -4,6 +4,8 @@ CHANGELOG](http://keepachangelog.com/) for how to update this file. This project\nadheres to [Semantic Versioning](http://semver.org/).\n## [Unreleased]\n+### Fixed\n+- Dup notify opts before mutating (#345)\n### Changed\n- Added Faktory plugin -@scottrobertson\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/agent.rb",
"new_path": "lib/honeybadger/agent.rb",
"diff": "@@ -115,6 +115,8 @@ module Honeybadger\n# @return [String] UUID reference to the notice within Honeybadger.\n# @return [false] when ignored.\ndef notify(exception_or_opts, opts = {})\n+ opts = opts.dup\n+\nif exception_or_opts.is_a?(Exception)\nopts[:exception] = exception_or_opts\nelsif exception_or_opts.respond_to?(:to_hash)\n"
},
{
"change_type": "MODIFY",
"old_path": "spec/unit/honeybadger/agent_spec.rb",
"new_path": "spec/unit/honeybadger/agent_spec.rb",
"diff": "@@ -70,6 +70,14 @@ describe Honeybadger::Agent do\ninstance.notify(error_message: 'testing backtrace generation')\nend\n+ it \"does not mutate passed in opts\" do\n+ opts = {error_message: 'test'}\n+ prev = opts.dup\n+ instance = described_class.new(Honeybadger::Config.new(api_key: \"fake api key\", logger: NULL_LOGGER))\n+ instance.notify(\"test\", opts)\n+ expect(prev).to eq(opts)\n+ end\n+\nit \"calls all of the before notify hooks before sending\" do\nhooks = [spy(\"hook one\", arity: 1), spy(\"hook two\", arity: 1), spy(\"hook three\", arity: 1)]\ninstance = described_class.new(Honeybadger::Config.new(api_key: \"fake api key\", logger: NULL_LOGGER))\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Dup #notify opts before mutating (#345) |
287,649 | 11.03.2020 09:31:03 | 25,200 | 05893c34a0d0a0d15e80098e4f78fa7b36fe0c37 | Breadcrumbs on by default | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "@@ -9,6 +9,7 @@ adheres to [Semantic Versioning](http://semver.org/).\nof the setting\n- Dup notify opts before mutating (#345)\n### Changed\n+- Breadcrumbs on by default\n- Added Faktory plugin -@scottrobertson\n## [4.5.6] - 2020-01-08\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/config/defaults.rb",
"new_path": "lib/honeybadger/config/defaults.rb",
"diff": "@@ -300,8 +300,8 @@ module Honeybadger\ntype: Boolean\n},\n:'breadcrumbs.enabled' => {\n- description: 'Enable/Disable breadcrumb functionality.',\n- default: false,\n+ description: 'Disable breadcrumb functionality.',\n+ default: true,\ntype: Boolean\n},\n:'breadcrumbs.active_support_notifications' => {\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Breadcrumbs on by default (#348) |
287,654 | 01.04.2020 11:00:28 | 25,200 | 1aac54cde57b01a4ea67f4b4fad684595e78c2cb | Delete Circle and Travis | [
{
"change_type": "DELETE",
"old_path": ".circleci/config.yml",
"new_path": null,
"diff": "-version: 2\n-references:\n- test: &test\n- run:\n- name: Run test suite\n- command: bundle exec appraisal rake\n- restore: &restore\n- restore_cache:\n- keys:\n- - v1-dependencies-{{ checksum \"Gemfile.lock\" }}\n- # fallback to using the latest cache if no exact match is found\n- - v1-dependencies-\n- bundle: &bundle\n- run:\n- name: install dependencies\n- command: |\n- bundle install --jobs=4 --retry=3 --path vendor/bundle\n- bundle exec appraisal install\n- save: &save\n- save_cache:\n- paths:\n- - ./vendor/bundle\n- key: v1-dependencies-{{ checksum \"Gemfile.lock\" }}\n-jobs:\n- \"ruby-2.4\":\n- docker:\n- - image: circleci/ruby:2.4\n- steps:\n- - checkout\n- - <<: *restore\n- - <<: *bundle\n- - <<: *save\n- - <<: *test\n- \"ruby-2.5\":\n- docker:\n- - image: circleci/ruby:2.5\n- steps:\n- - checkout\n- - <<: *restore\n- - <<: *bundle\n- - <<: *save\n- - <<: *test\n- \"ruby-2.6\":\n- docker:\n- - image: circleci/ruby:2.6\n- steps:\n- - checkout\n- - <<: *restore\n- - <<: *bundle\n- - <<: *save\n- - <<: *test\n- \"ruby-2.7\":\n- docker:\n- - image: circleci/ruby:2.7\n- steps:\n- - checkout\n- - <<: *restore\n- - <<: *bundle\n- - <<: *save\n- - <<: *test\n- \"jruby\":\n- docker:\n- - image: circleci/jruby:9.2.7-jdk\n- environment:\n- BUNDLER_VERSION: 1.17.3\n- steps:\n- - checkout\n- - <<: *restore\n- - <<: *bundle\n- - <<: *save\n- - <<: *test\n-\n-workflows:\n- version: 2\n- build:\n- jobs:\n- - \"ruby-2.4\"\n- - \"ruby-2.5\"\n- - \"ruby-2.6\"\n- - \"ruby-2.7\"\n- - \"jruby\"\n"
},
{
"change_type": "DELETE",
"old_path": ".travis.yml",
"new_path": null,
"diff": "-branches:\n- only:\n- - master\n-language: ruby\n-cache: bundler\n-before_install:\n- - unset _JAVA_OPTIONS\n- - gem install bundler --version 1.16.0\n-sudo: false\n-gemfile:\n- - gemfiles/standalone.gemfile\n- - gemfiles/binding_of_caller.gemfile\n- - gemfiles/delayed_job.gemfile\n- - gemfiles/rack_1.gemfile\n- - gemfiles/rack.gemfile\n- - gemfiles/sinatra_1.gemfile\n- - gemfiles/sinatra.gemfile\n- - gemfiles/rails4.2.gemfile\n- - gemfiles/rails.gemfile\n- - gemfiles/rails5.0.gemfile\n- - gemfiles/rails5.1.gemfile\n- - gemfiles/rails5.2.gemfile\n- - gemfiles/rails6.0.gemfile\n-rvm:\n- - 2.3.3\n- - 2.4.0\n- - 2.5.0\n- - jruby-9.2.5.0\n-matrix:\n- fast_finish: true\n- allow_failures:\n- - rvm: 2.3.3\n- gemfile: gemfiles/rails.gemfile\n- - rvm: 2.4.0\n- gemfile: gemfiles/rails.gemfile\n- - rvm: 2.5.0\n- gemfile: gemfiles/rails.gemfile\n- - rvm: jruby-9.2.5.0\n- gemfile: gemfiles/rails.gemfile\n- exclude:\n- - rvm: 2.4.0\n- gemfile: gemfiles/rails4.2.gemfile\n- - rvm: 2.5.0\n- gemfile: gemfiles/rails4.2.gemfile\n- - rvm: jruby-9.2.5.0\n- gemfile: gemfiles/binding_of_caller.gemfile\n- - rvm: jruby-9.2.5.0\n- gemfile: gemfiles/rails4.2.gemfile\n-env:\n- global:\n- secure: DwQI6QHuRRaMoKvE9rnXmw3U1KLKH6Y1ZTXCcDN34Zkq7QG5KPt195zvL6XPbsefvd2fOHq4es5D6jxgLlEdKB7njhWX8XNMgb/eprz6zTxSAS/ep31zYHEJ3krWSPM6a7fXJOjdYIzXhVl7I0NRDZGy/Sf6LgHIBMpaGVKGc34=\n-notifications:\n- slack:\n- secure: FeZure+83NSqi7tPO7u/HZfOBORPyiWzTE7Hl1ddQDHOUtmWxLT82AlkMw+ZRbYms9MLJhitVwLbyFDdF8JOgyLcH0OAd7ZYglo08oPKS6NsupNW+knuXmYv8IJpqSo7kcr2Afs5F/atQEzX7spk3uqCwJOKIOypAJfJ4huZ3vE=\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Delete Circle and Travis |
287,677 | 06.04.2020 18:04:12 | 14,400 | ae2163639c9094ef340bc4b1a0287ea815c9753c | Fix Rails 6.1 deprecation warning.
* Change ActiveRecord::Base.connection_config to connection_db_config
Rails 6.1 causes a deprecation warning for this:
DEPRECATION WARNING: connection_config is deprecated and will be removed from Rails 6.2 (Use connection_db_config instead) (called from block in default_notifications a .../gems/honeybadger-4.6.0/lib/honeybadger/breadcrumbs/active_support.rb:21)
* Add conditional check | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "@@ -5,6 +5,8 @@ adheres to [Semantic Versioning](http://semver.org/).\n## [Unreleased]\n+- Fix Rails 6.1 deprecation warning with ActiveRecord::Base.connection_config\n+\n## [4.6.0] - 2020-03-12\n### Fixed\n- Fixed issue where Sidekiq.attempt_threshold was triggering 2 attempts ahead\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/breadcrumbs/active_support.rb",
"new_path": "lib/honeybadger/breadcrumbs/active_support.rb",
"diff": "@@ -18,7 +18,7 @@ module Honeybadger\nselect_keys: [:sql, :name, :connection_id, :cached],\ntransform: lambda do |data|\nif data[:sql]\n- adapter = ::ActiveRecord::Base.connection_config[:adapter]\n+ adapter = active_record_connection_db_config[:adapter]\ndata[:sql] = Util::SQL.obfuscate(data[:sql], adapter)\nend\ndata\n@@ -103,6 +103,15 @@ module Honeybadger\n}\nend\n+ private_class_method def self.active_record_connection_db_config\n+ if ::ActiveRecord::Base.respond_to?(:connection_db_config)\n+ # >= Rails 6.1\n+ ::ActiveRecord::Base.connection_db_config.configuration_hash\n+ else\n+ # < Rails 6.1\n+ ::ActiveRecord::Base.connection_config\n+ end\n+ end\nend\nend\nend\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Fix Rails 6.1 deprecation warning. (#351)
* Change ActiveRecord::Base.connection_config to connection_db_config
Rails 6.1 causes a deprecation warning for this:
DEPRECATION WARNING: connection_config is deprecated and will be removed from Rails 6.2 (Use connection_db_config instead) (called from block in default_notifications a .../gems/honeybadger-4.6.0/lib/honeybadger/breadcrumbs/active_support.rb:21)
* Add conditional check
Co-authored-by: Josh Wood <josh@honeybadger.io> |
287,654 | 06.04.2020 15:05:58 | 25,200 | 22faf96745bc7bca0b87d3e83f3cba177ce715fc | Alias Notice#controller= Notice#component= | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "@@ -4,6 +4,8 @@ CHANGELOG](http://keepachangelog.com/) for how to update this file. This project\nadheres to [Semantic Versioning](http://semver.org/).\n## [Unreleased]\n+### Fixed\n+- Alias Notice#controller= as Notice#component=\n- Fix Rails 6.1 deprecation warning with ActiveRecord::Base.connection_config\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/notice.rb",
"new_path": "lib/honeybadger/notice.rb",
"diff": "@@ -118,6 +118,7 @@ module Honeybadger\n# The component (if any) which was used in this request (usually the controller).\nattr_accessor :component\nalias_method :controller, :component\n+ alias_method :controller=, :component=\n# The action (if any) that was called in this request.\nattr_accessor :action\n"
},
{
"change_type": "MODIFY",
"old_path": "spec/unit/honeybadger/notice_spec.rb",
"new_path": "spec/unit/honeybadger/notice_spec.rb",
"diff": "@@ -64,6 +64,20 @@ describe Honeybadger::Notice do\nexpect(build_notice(controller: 'users_controller').controller).to eq 'users_controller'\nend\n+ it \"aliases component method as controller\" do\n+ notice = build_notice\n+ notice.component = 'users_controller'\n+\n+ expect(notice.controller).to eq 'users_controller'\n+ end\n+\n+ it \"aliases component= method as controller=\" do\n+ notice = build_notice\n+ notice.controller = 'users_controller'\n+\n+ expect(notice.component).to eq 'users_controller'\n+ end\n+\nit \"aliases the params as parameters\" do\nexpect(build_notice(parameters: {foo: 'foo'}).params).to eq({foo: 'foo'})\nexpect(build_notice(params: {bar: 'bar'}).parameters).to eq({bar: 'bar'})\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Alias Notice#controller= Notice#component= (#352) |
287,672 | 29.05.2020 21:36:12 | -7,200 | a5d2126a41e79a2009a9a9e249824094a6430a16 | Add option to skip rails load on deployment notification | [
{
"change_type": "MODIFY",
"old_path": "vendor/capistrano-honeybadger/README.md",
"new_path": "vendor/capistrano-honeybadger/README.md",
"diff": "@@ -14,6 +14,7 @@ set :honeybadger_api_key, 'asdf' # The Honeybadger API key\nset :honeybadger_server, primary(:app) # The server performing the notification\nset :repo_url, 'git@github.com:me/my_repo.git' # The repository url\nset :current_revision, '88f1662' # The revision being deployed\n+set :honeybadger_skip_rails_load_on_deployment_notice, false # Sends --skip-rails-load to honeybadger when sending deployment notice. This can speed up deployment with large rails projects where loading the env is slow\n```\n## Installation\n"
},
{
"change_type": "MODIFY",
"old_path": "vendor/capistrano-honeybadger/lib/capistrano/tasks/deploy.cap",
"new_path": "vendor/capistrano-honeybadger/lib/capistrano/tasks/deploy.cap",
"diff": "@@ -24,6 +24,7 @@ namespace :honeybadger do\napi_key = fetch(:honeybadger_api_key, ENV['HONEYBADGER_API_KEY'])\noptions += ['--api-key', api_key] if api_key\n+ options << '--skip-rails-load' if fetch(:honeybadger_skip_rails_load_on_deployment_notice, false)\nif fetch(:honeybadger_async_notify, false)\n::SSHKit.config.command_map.prefix[:honeybadger].push(:nohup)\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Add option to skip rails load on deployment notification (#355) |
287,657 | 09.06.2020 09:39:25 | 25,200 | 95e80ff98bf6c4a8e51320b5aea8a82b3d4fdc9c | Use curl instead of ping for connectivity testing | [
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/cli/helpers.rb",
"new_path": "lib/honeybadger/cli/helpers.rb",
"diff": "@@ -15,7 +15,7 @@ To fix this issue, please try the following:\n- Make sure the gem is configured properly.\n- Retry executing this command a few times.\n- - Make sure you can connect to #{host} (`ping #{host}`).\n+ - Make sure you can connect to #{host} (`curl https://#{host}/v1/notices`).\n- Email support@honeybadger.io for help. Include as much debug info as you\ncan for a faster resolution!\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/cli/main.rb",
"new_path": "lib/honeybadger/cli/main.rb",
"diff": "@@ -196,7 +196,7 @@ WELCOME\n# What can I do?\n- Retry the command.\n- - Make sure you can connect to api.honeybadger.io (`ping api.honeybadger.io`).\n+ - Make sure you can connect to api.honeybadger.io (`curl https://api.honeybadger.io/v1/notices`).\n- If you continue to see this message, email us at support@honeybadger.io\n(don't forget to attach this output!)\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/cli/test.rb",
"new_path": "lib/honeybadger/cli/test.rb",
"diff": "@@ -175,7 +175,7 @@ To fix this issue, please try the following:\n- Make sure the gem is configured properly.\n- Retry executing this command a few times.\n- - Make sure you can connect to #{host} (`ping #{host}`).\n+ - Make sure you can connect to #{host} (`curl https://#{host}/v1/notices`).\n- Email support@honeybadger.io for help. Include as much debug info as you\ncan for a faster resolution!\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Use curl instead of ping for connectivity testing (#356) |
287,676 | 03.08.2020 22:48:41 | 14,400 | 24a9fa9416916a5d6d7822f88f111467929b2b30 | Fix Ruby 2.7 deprecation warning in sql.rb | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "@@ -9,6 +9,7 @@ adheres to [Semantic Versioning](http://semver.org/).\nallowing for multiple databases.\n- Fix Rails deprecation of `ActionDispatch::ParamsParser::ParseError`\n- Deal with invalid UTF-8 byte sequences during SQL obfuscation\n+- Fix Ruby 2.7 deprication notice in sql.rb\n## [4.7.0] - 2020-06-02\n### Fixed\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/util/sql.rb",
"new_path": "lib/honeybadger/util/sql.rb",
"diff": "@@ -24,7 +24,9 @@ module Honeybadger\ndef self.force_utf_8(string)\nstring.encode(\nEncoding.find('UTF-8'),\n- {invalid: :replace, undef: :replace, replace: ''}\n+ invalid: :replace,\n+ undef: :replace,\n+ replace: ''\n)\nend\nend\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Fix Ruby 2.7 deprecation warning in sql.rb (#368) |
287,649 | 12.08.2020 11:57:00 | 25,200 | e17fb61cba941023326af8ab98efbf9ce7292ce1 | Encode sql in exclusion check | [
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/breadcrumbs/active_support.rb",
"new_path": "lib/honeybadger/breadcrumbs/active_support.rb",
"diff": "@@ -26,7 +26,8 @@ module Honeybadger\nend,\nexclude_when: lambda do |data|\n# Ignore schema, begin, and commit transaction queries\n- data[:name] == \"SCHEMA\" || (data[:sql] && (data[:sql] =~ /^(begin|commit)( transaction)?$/i))\n+ data[:name] == \"SCHEMA\" ||\n+ (data[:sql] && (Util::SQL.force_utf_8(data[:sql].dup) =~ /^(begin|commit)( transaction)?$/i))\nend\n},\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Encode sql in exclusion check (#370) |
287,649 | 17.08.2020 11:48:03 | 25,200 | 3ec8c6174f8d599ada954128377f155bc6f4aece | Changelog for other commit | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "@@ -6,6 +6,7 @@ adheres to [Semantic Versioning](http://semver.org/).\n## [Unreleased]\n### Fixed\n- Remove usage of `ActiveRecord::Base.connection` (thanks @jcoyne for testing)\n+- Check for UTF-8 in ActiveRecord breadcrumb exclusion filter\n## [4.7.1] - 2020-08-11\n### Fixed\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Changelog for other commit |
287,669 | 08.03.2021 18:21:54 | 0 | 7666a9f1b931b3531be89d0991997597fbc3a5e7 | Support deployment tracking in code
Resolves | [
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/agent.rb",
"new_path": "lib/honeybadger/agent.rb",
"diff": "@@ -190,6 +190,29 @@ module Honeybadger\nresponse.success?\nend\n+ # Track a new deployment\n+ #\n+ # @example\n+ # Honeybadger.track_deployment(revision: 'be2ceb6')\n+ #\n+ # @param [String] :env The environment name. Defaults to the current configured environment.\n+ # @param [String] :revision The VCS revision being deployed. Defaults to the currently configured revision.\n+ # @param [String] :local_username The name of the user who performed the deploy.\n+ # @param [String] :repository The base URL of the VCS repository. It should be HTTPS-style.\n+ #\n+ # @return [Boolean] true if the deployment was successfully tracked and false\n+ # otherwise.\n+ def track_deployment(env: nil, revision: nil, local_username: nil, repository: nil)\n+ opts = {\n+ env: env || config[:env],\n+ revision: revision || config[:revision],\n+ local_username: local_username,\n+ repository: repository\n+ }\n+ response = backend.track_deployment(opts)\n+ response.success?\n+ end\n+\n# Save global context for the current request.\n#\n# @example\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/backend/base.rb",
"new_path": "lib/honeybadger/backend/base.rb",
"diff": "@@ -99,6 +99,15 @@ module Honeybadger\nraise NotImplementedError, 'must define #check_in on subclass.'\nend\n+ # Track a deployment\n+ # @example\n+ # backend.track_deployment({ revision: 'be2ceb6' })\n+ #\n+ # @param [#to_json] payload The JSON payload containing all deployment data.\n+ def track_deployment(payload)\n+ notify(:deploys, payload)\n+ end\n+\nprivate\nattr_reader :config\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/singleton.rb",
"new_path": "lib/honeybadger/singleton.rb",
"diff": "@@ -37,6 +37,7 @@ module Honeybadger\ndef_delegator :'Honeybadger::Agent.instance', :add_breadcrumb\ndef_delegator :'Honeybadger::Agent.instance', :breadcrumbs\ndef_delegator :'Honeybadger::Agent.instance', :clear!\n+ def_delegator :'Honeybadger::Agent.instance', :track_deployment\n# @!macro [attach] def_delegator\n# @!method $2(...)\n"
},
{
"change_type": "MODIFY",
"old_path": "spec/unit/honeybadger/agent_spec.rb",
"new_path": "spec/unit/honeybadger/agent_spec.rb",
"diff": "@@ -44,6 +44,34 @@ describe Honeybadger::Agent do\nend\nend\n+ describe '#track_deployment' do\n+ let(:config) { Honeybadger::Config.new(api_key:'fake api key', logger: NULL_LOGGER) }\n+ subject(:instance) { described_class.new(config) }\n+\n+ it 'returns true for successful deployment tracking' do\n+ stub_request(:post, \"https://api.honeybadger.io/v1/deploys\").\n+ to_return(status: 200)\n+\n+ expect(instance.track_deployment).to eq(true)\n+ end\n+\n+ it 'returns false for unsuccessful deployment tracking' do\n+ stub_request(:post, \"https://api.honeybadger.io/v1/deploys\").\n+ to_return(status: 400)\n+\n+ expect(instance.track_deployment).to eq(false)\n+ end\n+\n+ it 'passes the revision to the servce' do\n+ allow_any_instance_of(Honeybadger::Util::HTTP).to receive(:compress) { |_, body| body }\n+ stub_request(:post, \"https://api.honeybadger.io/v1/deploys\").\n+ with(body: { env: nil, revision: '1234', local_username: nil, repository: nil }).\n+ to_return(status: 200)\n+\n+ expect(instance.track_deployment(revision: '1234')).to eq(true)\n+ end\n+ end\n+\ndescribe \"#clear!\" do\nit 'clears all transactional data' do\nconfig = Honeybadger::Config.new(api_key:'fake api key', logger: NULL_LOGGER)\n"
},
{
"change_type": "MODIFY",
"old_path": "spec/unit/honeybadger/backend/base_spec.rb",
"new_path": "spec/unit/honeybadger/backend/base_spec.rb",
"diff": "@@ -55,4 +55,12 @@ describe Honeybadger::Backend::Base do\nexpect { subject.check_in(10) }.to raise_error NotImplementedError\nend\nend\n+\n+ describe \"#track_deployment\" do\n+ it \"defers the request to notify with the feature set as deploys\" do\n+ opts = double(:opts)\n+ expect(subject).to receive(:notify).with(:deploys, opts)\n+ subject.track_deployment(opts)\n+ end\n+ end\nend\n"
},
{
"change_type": "MODIFY",
"old_path": "spec/unit/honeybadger_spec.rb",
"new_path": "spec/unit/honeybadger_spec.rb",
"diff": "@@ -10,6 +10,7 @@ describe Honeybadger do\nit { should be_a Module }\nit { should respond_to :notify }\nit { should respond_to :start }\n+ it { should respond_to :track_deployment }\nit { should define(:Rack) }\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Support deployment tracking in code (#397)
Resolves #396 |
287,656 | 15.04.2021 20:33:30 | -7,200 | d6b301b18ed868ddf51713ad1770a080265ad63e | Properly set environment in deployment tracking
* Properly set environment in deployment tracking
Follow-up to
* Add proper PR reference to Changelog
* env => environment | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "@@ -7,6 +7,7 @@ adheres to [Semantic Versioning](http://semver.org/).\n- Added 'ActionDispatch::Http::MimeNegotiation::InvalidType' (Rails 6.1) to\ndefault ignore list. (#402, @jrochkind)\n- Replaced fixed number for retries in Sidekiq Plugin with Sidekiq::JobRetry constant\n+- Properly set environment in deployment tracking (#404, @stmllr)\n## [4.8.0] - 2021-03-16\n### Fixed\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/agent.rb",
"new_path": "lib/honeybadger/agent.rb",
"diff": "@@ -195,16 +195,16 @@ module Honeybadger\n# @example\n# Honeybadger.track_deployment(revision: 'be2ceb6')\n#\n- # @param [String] :env The environment name. Defaults to the current configured environment.\n+ # @param [String] :environment The environment name. Defaults to the current configured environment.\n# @param [String] :revision The VCS revision being deployed. Defaults to the currently configured revision.\n# @param [String] :local_username The name of the user who performed the deploy.\n# @param [String] :repository The base URL of the VCS repository. It should be HTTPS-style.\n#\n# @return [Boolean] true if the deployment was successfully tracked and false\n# otherwise.\n- def track_deployment(env: nil, revision: nil, local_username: nil, repository: nil)\n+ def track_deployment(environment: nil, revision: nil, local_username: nil, repository: nil)\nopts = {\n- env: env || config[:env],\n+ environment: environment || config[:env],\nrevision: revision || config[:revision],\nlocal_username: local_username,\nrepository: repository\n"
},
{
"change_type": "MODIFY",
"old_path": "spec/unit/honeybadger/agent_spec.rb",
"new_path": "spec/unit/honeybadger/agent_spec.rb",
"diff": "@@ -65,7 +65,7 @@ describe Honeybadger::Agent do\nit 'passes the revision to the servce' do\nallow_any_instance_of(Honeybadger::Util::HTTP).to receive(:compress) { |_, body| body }\nstub_request(:post, \"https://api.honeybadger.io/v1/deploys\").\n- with(body: { env: nil, revision: '1234', local_username: nil, repository: nil }).\n+ with(body: { environment: nil, revision: '1234', local_username: nil, repository: nil }).\nto_return(status: 200)\nexpect(instance.track_deployment(revision: '1234')).to eq(true)\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Properly set environment in deployment tracking (#404)
* Properly set environment in deployment tracking
Follow-up to #397
* Add proper PR reference to Changelog
* env => environment |
287,654 | 15.02.2022 13:09:59 | 28,800 | 5646f38b8dafc3d8fa5d0dfaadd91922e8a7bcc2 | Allow special characters in tags
* Allow special characters in tags
Also adds support for space-delimited tags; these strings are
equivalent:
"foo, bar, baz"
"foo bar baz"
"foo, bar baz"
* downcase | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "@@ -4,6 +4,9 @@ CHANGELOG](http://keepachangelog.com/) for how to update this file. This project\nadheres to [Semantic Versioning](http://semver.org/).\n## [Unreleased]\n+### Fixed\n+- Allow special characters in tags. Also support space-delimited tags:\n+ \"one two three\" and \"one, two, three\" are equivalent\n## [4.10.0] - 2022-01-19\n### Added\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/notice.rb",
"new_path": "lib/honeybadger/notice.rb",
"diff": "@@ -53,11 +53,11 @@ module Honeybadger\n# @api private\n# The String character used to split tag strings.\n- TAG_SEPERATOR = ','.freeze\n+ TAG_SEPERATOR = /,|\\s/.freeze\n# @api private\n# The Regexp used to strip invalid characters from individual tags.\n- TAG_SANITIZER = /[^\\w]/.freeze\n+ TAG_SANITIZER = /\\s/.freeze\n# @api private\nclass Cause\n"
},
{
"change_type": "MODIFY",
"old_path": "spec/unit/honeybadger/notice_spec.rb",
"new_path": "spec/unit/honeybadger/notice_spec.rb",
"diff": "@@ -809,21 +809,25 @@ describe Honeybadger::Notice do\ncontext \"adding tags\" do\ncontext \"directly\" do\nit \"converts String to tags Array\" do\n- expect(build_notice(tags: ' foo , bar, , $baz ').tags).to eq(%w(foo bar baz))\n+ expect(build_notice(tags: ' foo , bar, , baz ').tags).to eq(%w(foo bar baz))\nend\nit \"accepts an Array\" do\n- expect(build_notice(tags: [' foo ', ' bar', ' ', ' $baz ']).tags).to eq(%w(foo bar baz))\n+ expect(build_notice(tags: [' foo ', ' bar', ' ', ' baz ']).tags).to eq(%w(foo bar baz))\n+ end\n+\n+ it \"accepts whitespace-delimited tags\" do\n+ expect(build_notice(tags: [' foo bar baz']).tags).to eq(%w(foo bar baz))\nend\nend\ncontext \"from context\" do\nit \"converts String to tags Array\" do\n- expect(build_notice(context: { tags: ' foo , , bar, $baz ' }).tags).to eq(%w(foo bar baz))\n+ expect(build_notice(context: { tags: ' foo , , bar, baz ' }).tags).to eq(%w(foo bar baz))\nend\nit \"accepts an Array\" do\n- expect(build_notice(tags: [' foo ', ' bar', ' ', ' $baz ']).tags).to eq(%w(foo bar baz))\n+ expect(build_notice(tags: [' foo ', ' bar', ' ', ' baz ']).tags).to eq(%w(foo bar baz))\nend\nend\n@@ -836,6 +840,10 @@ describe Honeybadger::Notice do\nit \"converts nil to empty Array\" do\nexpect(build_notice(tags: nil).tags).to eq([])\nend\n+\n+ it \"allows non-word characters in tags while stripping whitespace\" do\n+ expect(build_notice(tags: 'word, with_underscore ,with space, with-dash,with$special*char').tags).to eq(%w(word with_underscore with space with-dash with$special*char))\n+ end\nend\ncontext \"exception cause\" do\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Allow special characters in tags (#422)
* Allow special characters in tags
Also adds support for space-delimited tags; these strings are
equivalent:
- "foo, bar, baz"
- "foo bar baz"
- "foo, bar baz"
* downcase |
287,654 | 25.03.2022 08:58:27 | 25,200 | f69ebb65bb8c5fa6d2306d57f3a04e3531f1cbec | Change exception_message key name for error breadcrumb metadata | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "@@ -4,6 +4,8 @@ CHANGELOG](http://keepachangelog.com/) for how to update this file. This project\nadheres to [Semantic Versioning](http://semver.org/).\n## [Unreleased]\n+### Fixed\n+- Change `:exception_message` key name to just `:exception` for error breadcrumb metadata.\n## [4.11.0] - 2022-02-15\n### Fixed\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/rack/error_notifier.rb",
"new_path": "lib/honeybadger/rack/error_notifier.rb",
"diff": "@@ -74,7 +74,7 @@ module Honeybadger\nagent.add_breadcrumb(\nexception.class,\nmetadata: {\n- exception_message: exception.message\n+ message: exception.message\n},\ncategory: \"error\"\n)\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Change exception_message key name for error breadcrumb metadata (#424) |
287,654 | 03.06.2022 11:24:26 | 25,200 | 983798a38c66a75f339859a259d73f29cd2be06a | Lock activerecord-jdbcsqlite3-adapter to 61 for jruby | [
{
"change_type": "MODIFY",
"old_path": "Appraisals",
"new_path": "Appraisals",
"diff": "@@ -52,11 +52,7 @@ if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.5.0')\nappraise 'rails6.1' do\nRAILS_GEMS.each { |rails_gem| gem rails_gem, \"~> 6.1\" }\ngem 'sqlite3', '~> 1.4', platforms: :mri\n-\n- # 6.1 is currently only supported on master branch for jruby/activerecord-jdbc-adapter\n- # When this changes, from: `git: 'jruby/activerecord-jdbc-adapter'` to `\"61\"`\n- # gem 'activerecord-jdbcsqlite3-adapter', git: 'jruby/activerecord-jdbc-adapter', platforms: :jruby\n- gem 'activerecord-jdbcsqlite3-adapter', github: 'jruby/activerecord-jdbc-adapter', platforms: :jruby\n+ gem 'activerecord-jdbcsqlite3-adapter', '~> 61', platforms: :jruby\ngem 'better_errors', require: false, platforms: :mri\ngem 'rack-mini-profiler', require: false\ngem 'rspec-rails'\n"
},
{
"change_type": "MODIFY",
"old_path": "gemfiles/rails6.1.gemfile",
"new_path": "gemfiles/rails6.1.gemfile",
"diff": "@@ -20,7 +20,7 @@ gem \"activejob\", \"~> 6.1\"\ngem \"railties\", \"~> 6.1\"\ngem \"actionpack\", \"~> 6.1\"\ngem \"sqlite3\", \"~> 1.4\", platforms: :mri\n-gem \"activerecord-jdbcsqlite3-adapter\", github: \"jruby/activerecord-jdbc-adapter\", platforms: :jruby\n+gem \"activerecord-jdbcsqlite3-adapter\", \"~> 61\", platforms: :jruby\ngem \"better_errors\", require: false, platforms: :mri\ngem \"rack-mini-profiler\", require: false\ngem \"rspec-rails\"\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Lock activerecord-jdbcsqlite3-adapter to 61 for jruby (#438) |
287,654 | 06.06.2022 11:43:04 | 25,200 | 00b9fc286851408d79b1c6e26cee62145c0d346f | Remove css height on feedback form submit | [
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/templates/feedback_form.erb",
"new_path": "lib/honeybadger/templates/feedback_form.erb",
"diff": "#honeybadger_feedback_form label { font-weight: bold; }\n#honeybadger_feedback_name, #honeybadger_feedback_email, #honeybadger_feedback_comment { width: 100%; padding: 0.5em; }\n#honeybadger_feedback_comment { height: 10em; }\n-#honeybadger_feedback_submit { height: 1em; }\n#honeybadger_feedback_form .honeybadger-feedback-phone { display: none; }\n#honeybadger_feedback_link { font-size: 90%; }\n</style>\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Remove css height on feedback form submit (#437) |
287,657 | 22.09.2022 14:36:05 | 25,200 | 5c52b1ff1616938607bbc753f10e4bae8fea1ae4 | Replace deployhook with release webhook
* Replace deployhook with release webhook
See for more info
* Update CHANGELOG.md | [
{
"change_type": "MODIFY",
"old_path": "CHANGELOG.md",
"new_path": "CHANGELOG.md",
"diff": "@@ -4,6 +4,9 @@ CHANGELOG](http://keepachangelog.com/) for how to update this file. This project\nadheres to [Semantic Versioning](http://semver.org/).\n## [Unreleased]\n+### Fixed\n+- Replace deployhook with release webhook (#444)\n+ See https://blog.heroku.com/deployhooks-sunset\n## [5.0.0.beta1] - 2022-08-15\n### Changed\n"
},
{
"change_type": "MODIFY",
"old_path": "lib/honeybadger/cli/heroku.rb",
"new_path": "lib/honeybadger/cli/heroku.rb",
"diff": "@@ -23,7 +23,7 @@ module Honeybadger\nexit(1)\nend\n- cmd = %Q(heroku addons:create deployhooks:http --url=\"https://api.honeybadger.io/v1/deploys?deploy[environment]=#{rails_env}&deploy[local_username]={{user}}&deploy[revision]={{head}}&api_key=#{api_key}\"#{app ? \" --app #{app}\" : ''})\n+ cmd = %Q(heroku webhooks:add -i api:release -l notify -u \"https://api.honeybadger.io/v1/deploys/heroku?environment=#{rails_env}&api_key=#{api_key}\"#{app ? \" --app #{app}\" : ''})\nsay(\"Running: `#{cmd}`\")\nsay(run(cmd))\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Replace deployhook with release webhook (#444)
* Replace deployhook with release webhook
See https://blog.heroku.com/deployhooks-sunset for more info
* Update CHANGELOG.md
Co-authored-by: Joshua Wood <josh@joshuawood.net>
Co-authored-by: shalvah <diakon.ng@gmail.com> |
287,654 | 05.12.2022 13:58:09 | 28,800 | f4ad876c637fbf0935c6f2f13db047aecbe3a0c5 | Update gem metadata
See here | [
{
"change_type": "MODIFY",
"old_path": "honeybadger.gemspec",
"new_path": "honeybadger.gemspec",
"diff": "@@ -8,8 +8,15 @@ Gem::Specification.new do |s|\ns.description = 'Make managing application errors a more pleasant experience.'\ns.authors = ['Honeybadger Industries LLC']\ns.email = ['support@honeybadger.io']\n- s.homepage = 'https://github.com/honeybadger-io/honeybadger-ruby'\n+ s.homepage = 'https://www.honeybadger.io/for/ruby/'\ns.license = 'MIT'\n+ s.metadata = {\n+ 'bug_tracker_uri' => 'https://github.com/honeybadger-io/honeybadger-ruby/issues',\n+ 'changelog_uri' => 'https://github.com/honeybadger-io/honeybadger-ruby/blob/master/CHANGELOG.md',\n+ 'documentation_uri' => 'https://docs.honeybadger.io/lib/ruby/',\n+ 'homepage_uri' => 'https://www.honeybadger.io/for/ruby/',\n+ 'source_code_uri' => 'https://github.com/honeybadger-io/honeybadger-ruby'\n+ }\ns.required_ruby_version = '>= 2.3.0'\n"
}
] | Ruby | MIT License | honeybadger-io/honeybadger-ruby | Update gem metadata (#455)
See here https://guides.rubygems.org/specification-reference/#metadata |
139,040 | 01.07.2017 20:44:34 | -7,200 | de185d8148fdc651916a88744486e024f8f39b57 | Arrays and Loop Page | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "docs/Advanced Functions/Arrays and Loops.md",
"diff": "+# Arrays\n+\n+An array is a List containing several items of the same kind.\n+\n+\n+## Declaring Arrays\n+It is declared using ```[``` and ```]```.\n+```\n+//Array containing \"Hello\" and \"World\"\n+val stringArray = [\"Hello\", \"World\"];\n+\n+//Array containing 1-3\n+val intArray = [1,2,3];\n+```\n+\n+If you now think \"wait, haven't I seen these brackets before?\", you have.\n+Remember ```recipes.add(out,[[],[],[]]);```?\n+This uses three arrays with each containing up to three entries to define a crafting table recipe.\n+\n+## Nested Arrays\n+You can place Arrays in Arrays.\n+\n+```\n+val stringArray1 = [\"Hello\",\"World\"];\n+val stringArray2 = [\"I\",\"am\"];\n+val stringArray3 = [\"a\",\"beatuful\"];\n+val stringArrayAll = [stringArray1,stringArray2,stringArray3,[\"Butterfly\",\"!\"]];\n+```\n+\n+## Reffering to items in an Array\n+You can refer to an element within an array by using it's place in the list.\n+The first item in an Array is No. 0, the 2nd No.1 and so on.\n+\n+If you want to refer to an item in a nested Array, you need two or more referers, as each removes one layer of the lists.\n+\n+```\n+/*\n+stringArray[0] is \"Hello\"\n+stringArray[1] is \"World\"\n+stringArray[2] is \"I\"\n+stringArray[3] is \"am\"\n+*/\n+val stringArray = [\"Hello\",\"World\",\"I\",\"am\"];\n+\n+//prints \"Hello\"\n+print(stringArray[0]);\n+\n+\n+//Nested Arrays\n+val stringArray1 = [\"Hello\",\"World\"];\n+val stringArray2 = [\"I\",\"am\"];\n+val stringArray3 = [\"a\",\"beatuful\"];\n+val stringArrayAll = [stringArray1,stringArray2,stringArray3,[\"Butterfly\",\"!\"]];\n+\n+/*\n+stringArrayAll[0] is [\"Hello\",\"World\"]\n+stringArrayAll[1] is [\"I\",\"am\"]\n+stringArrayAll[2] is [\"a\",\"beatuful\"]\n+stringArrayAll[3] is [\"Butterfly\",\"!\"]\n+\n+stringArrayAll[0][0] is \"Hello\"\n+stringArrayAll[0][1] is \"World\"\n+etc.\n+*/\n+\n+//prints \"World\"\n+print(stringArrayAll[0][1]);\n+```\n+\n+\n+# Loops\n+A loop is a function that repeats itself. You can use loops to apply an action to all elements in an Array\n+\n+## For Loop\n+The main use of the for-loop is iterating through an array. Iterating means doing an action to all elements of an array.\n+```\n+val IArray = [<minecraft:dirt>,<minecraft:planks>,<minecraft:diamond>];\n+val JArray = [<minecraft:grass>,<minecraft:wood>,<minecraft:gold_ingot>];\n+val KArray = [<minecraft:wooden_axe>,<minecraft:golden_shovel>,<minecraft:emerald>];\n+\n+\n+//for [integerName, ] elementName in IArray {code}\n+\n+for item in IArray {\n+ //defines the variable \"item\" with each element of IArray (i.e. <minecraft:dirt>,<minecraft:planks>,<minecraft:diamond>)\n+ //Just use this variable now!\n+ recipes.remove(item);\n+}\n+\n+for i, item in IArray {\n+ //defines the variavle \"i\" with each element Number of IArray (i.e. 0,1,2,...)\n+ //defines the variable \"item\" with each element of IArray (i.e. <minecraft:dirt>,<minecraft:planks>,<minecraft:diamond>)\n+ //Just use these variables now!\n+\n+ //Crafts Item of IArray using item of JArray and KArray (i.e. Dirt with grass and wooden axe, planks with wood and golden shovel, diamond with gold ingot and emerald)\n+ recipes.addShapeless(item,[JArray[i],KArray[i]]);\n+}\n+```\n\\ No newline at end of file\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Arrays and Loop Page |
139,040 | 01.07.2017 22:36:33 | -7,200 | cd8fae91479c0950d9d97ac5731767988f6b8df6 | Added Conditional Statements | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "docs/Advanced Functions/Conditional Statments.md",
"diff": "+#Conditional Statements\n+\n+You might want to include code that will only be executed if certain criteria are met (or if they are not).\n+That's what you need conditional Statements for.\n+\n+##If\n+\n+An If-Statement is the first part of a conditional statement. It declares the condition that must be true for the following code to be executed.\n+Be careful, you need TWO EQUALS when comparing values (that's because one equal is for declaring values!)\n+\n+```\n+val test = 0;\n+\n+if(test == 0){ //true\n+ print(\"Test is zero!\");\n+}\n+```\n+\n+##Else\n+\n+An Else-Statement can be added to the end of a conditional Statment to declare what will be executed when the if-condition equals to false.\n+\n+```\n+var test = 0;\n+\n+if(test == 0){//true\n+ //will be executed when test is equal to 0\n+ print(\"Test is zero!\");\n+} else {\n+ //will be executed when test is not equal to 0\n+ print(\"Test is NOT zero!\");\n+}\n+\n+test = 1\n+if(test == 0){//false\n+ //will be executed when test is equal to 0\n+ print(\"Now, test is zero!\");\n+} else {\n+ //will be executed when test is not equal to 0\n+ print(\"Now, test is NOT zero!\");\n+}\n+\n+```\n+\n+## Things to check for\n+Supported Calculations are +,-,*,/,mod,concatenation(~)\n+Supported Operands are OR(|), AND(&&), XOR(^)\n+```\n+//You can check for:\n+\n+\n+//Number values\n+val a = 0 as int;\n+if(a==0){print(\"NumVal\");}\n+\n+//Calculated number values\n+val b = 1;\n+val c = 5;\n+//All evaluate to true\n+if(b+c==6){print(\"Num1!\");}\n+if(b*c==5){print(\"Num2!\");}\n+if(b/c==0.2){print(\"Num3!\");}\n+\n+//OR, XOR, AND\n+val d = \"Hello\";\n+val e = \"World\";\n+val f = d~e; //f = \"HelloWorld\", the Tilde just concatenates one thing to another\n+\n+//|(OR) means, as long as one of the criteria is met, it evaluates to true\n+if(d==\"Hello\" | e == \"Hello\"){print(\"OR1!\");} //true\n+if(d==\"Hello\" | e == \"World\"){print(\"OR2!\");} //true\n+\n+//^(XOR) means, ONLY ONE criteria may be met, otherwise it evaluates to false\n+if(d==\"Hello\" ^ e == \"Hello\"){print(\"XOR1!\");} //true\n+if(d==\"Hello\" ^ e == \"World\"){print(\"XOR2!\");} //false\n+\n+//&&(AND) means, both criteria need to be met, otherwise it evaluates to false\n+if(d==\"Hello\" && e == \"Hello\"){print(\"AND1!\");} //false\n+if(d==\"Hello\" && e == \"World\"){print(\"AND2!\");} //true\n+```\n\\ No newline at end of file\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Added Conditional Statements |
139,040 | 01.07.2017 23:21:32 | -7,200 | 535171effc274b410e3df4907826b014df739970 | Update CondutionalStatements again
Rename and Fixed and from && to & (no real difference though) | [
{
"change_type": "RENAME",
"old_path": "docs/Advanced Functions/Conditional Statments.md",
"new_path": "docs/Advanced Functions/Conditional Statements.md",
"diff": "@@ -44,7 +44,7 @@ if(test == 0){//false\n## Things to check for\nSupported Calculations are +,-,*,/,mod,concatenation(~)\n-Supported Operands are OR(|), AND(&&), XOR(^)\n+Supported Operands are OR(|), AND(&), XOR(^)\n```\n//You can check for:\n@@ -75,6 +75,6 @@ if(d==\"Hello\" ^ e == \"Hello\"){print(\"XOR1!\");} //true\nif(d==\"Hello\" ^ e == \"World\"){print(\"XOR2!\");} //false\n//&&(AND) means, both criteria need to be met, otherwise it evaluates to false\n-if(d==\"Hello\" && e == \"Hello\"){print(\"AND1!\");} //false\n-if(d==\"Hello\" && e == \"World\"){print(\"AND2!\");} //true\n+if(d==\"Hello\" & e == \"Hello\"){print(\"AND1!\");} //false\n+if(d==\"Hello\" & e == \"World\"){print(\"AND2!\");} //true\n```\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Update CondutionalStatements again
Rename and Fixed and from && to & (no real difference though) |
139,040 | 01.07.2017 23:52:54 | -7,200 | 3eba30d9a2622d91581f971c60bb6185dc35d72a | Added for iterator with in parameter | [
{
"change_type": "MODIFY",
"old_path": "docs/Advanced Functions/Arrays and Loops.md",
"new_path": "docs/Advanced Functions/Arrays and Loops.md",
"diff": "@@ -95,4 +95,9 @@ for i, item in IArray {\n//Crafts Item of IArray using item of JArray and KArray (i.e. Dirt with grass and wooden axe, planks with wood and golden shovel, diamond with gold ingot and emerald)\nrecipes.addShapeless(item,[JArray[i],KArray[i]]);\n}\n+\n+for i in 0 to 10 {\n+ //defines the variable \"i\" with each number from 0 to 9 (i.e. 0,1,2,...,8,9)\n+ print(i);\n+}\n```\n\\ No newline at end of file\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Added for iterator with in parameter |
139,040 | 02.07.2017 09:08:53 | -7,200 | 2636ee69a448965a27e8c95493ae9a00bfc40695 | Updated Import.md
Now use the JEI package instead of Botania to demonstrate the import functions | [
{
"change_type": "MODIFY",
"old_path": "docs/Advanced Functions/Import.md",
"new_path": "docs/Advanced Functions/Import.md",
"diff": "@@ -9,17 +9,17 @@ Imports have to be declared at the top of a Script. You will have to declare imp\nBe careful not to import two functions with the same name, use the AS function for that\n```\n-//This will import the removeRecipe from the Botania Apothecary\n-import mods.botania.Apothecary.removeRecipe;\n+//This will import the hide function from JEI\n+import mods.jei.JEI.removeAndHide;\n-//And this will import the ElvenTrade package\n-import mods.botania.ElvenTrade;\n+//And this will import the JEI package\n+import mods.jei.JEI;\n-//removeRecipe is a function, so we can just use it\n-removeRecipe(<minecraft:dirt>);\n+//removeAndHide is a function, so we can just use it\n+removeAndHide(<minecraft:dirt>);\n-//ElvenTrade is a package, so we need to specify what function we want to use\n-ElvenTrade.removeRecipe(<minecraft:diamond>);\n+//JEI is a package, so we need to specify what function of it we want to use\n+JEI.hide(<minecraft:diamond>);\n```\n## Import as\n@@ -28,13 +28,13 @@ Sometimes you want to import two functions with the same name or just want to ke\nWhen adding the AS statement at the end of the import, you can specify the name that the import should listen to.\n```\n-//This will import the removeRecipe from the Botania Apothecary\n-import mods.botania.Apothecary.removeRecipe AS apoRemove;\n+//This will import the hide function from JEI and make it available under the name \"h\"\n+import mods.jei.JEI.hide as h;\n-//And this will import the removeRecipe from the ElvenTrade\n-import mods.botania.ElvenTrade.removeRecipe AS elvenRemove;\n+//And this will import the removeAndHide function from JEI and make it available under the name \"rh\"\n+import mods.jei.JEI.removeAndHide as rh;\n-apoRemove(<minecraft:dirt>);\n-elvenRemove(<minecraft:diamond>);\n+h(<minecraft:dirt>);\n+rh(<minecraft:diamond>);\n```\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Updated Import.md
Now use the JEI package instead of Botania to demonstrate the import functions |
139,040 | 02.07.2017 12:07:53 | -7,200 | 0d9d746a2dd4474a00ccb1bd382ab606d14fe444 | Added Variable Types Section
Hope the explanations are correct..
do you know what the native type is for? | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "docs/Advanced Functions/Variable Types.md",
"diff": "+# Variable Types\n+\n+As you surely already messed a bit with variables and values, you must've wondered, how CraftTweaker knows whether it's dealing with an integer, an Item or an oreDic entry?\n+\n+The easiest way of declaring a variable is using ```var name = value;```.\n+This creates the variable and casts it to the value it thinks is most fitting for the situation.\n+\n+## Casting a variable to a specific type\n+\n+More complex scripts might require you to cast a variable as a specific type.\n+For example, this would fail:\n+\n+```\n+var test;\n+\n+test = <minecraft:dirt>;\n+recipes.remove(test);\n+```\n+\n+So why does this fail?\n+This is because CT casts variables that aren't given a start value to the IAny Type.\n+That type was made to facilitate some recipe handlers, though never really implemented, so it sometimes does more harm than good. It was originally intended as a type that can take the form of most other types so you don't need to change variables all the time, but the interface never got implemented.\n+\n+Back to the topic:\n+How can we fix this issue? By casting the variable test to ```IItemStack```, which is the type used for items.\n+Unfortunately, some types need to be imported first, and this is one of those.\n+\n+```\n+import minetweaker.item.IItemStack;\n+var test as IItemStack;\n+\n+test = <minecraft:dirt>;\n+recipes.remove(test);\n+```\n+\n+## List of Variable Types\n+\n+Here's an (incomplete) List of most variable types\n+\n+| Name (Name in CT) | Explanation | Example | Import |\n+|---------------------------|---------------------------------------------------------------------------------------------------------|----------------------------------------------|-----------------------------------------|\n+| Integer (int) | Integers are whole Numbers (e.g. 1,2,3,...), caps at 2 147 483 647 | var test = 10 as int; | |\n+| IItemStack | Single items | var test = <minecraft :dirt> as IItemStack; | import minetweaker.item.IItemStack; |\n+| Iingredient | Single or Multiple Items (e.g. <minecraft:dirt>, <ore:ingotIron>,...) | var test = <minecraft :dirt> as Iingredient; | import minetweaker.item.IIngredient; |\n+| Boolean (bool) | Booleans are either true or false. | var test = false as bool; | |\n+| Byte (byte) | Bytes values are whole numbers from 0 to 255 () | var test = 125 as byte; | |\n+| Floating Point (float) | Decimals | var test = 1.25 as float; | |\n+| Double Precision (double) | Like Floating Points, just more precise and with a higher number range | var test = 1.25 as double; | |\n+| Long (long) | Like Integer, but with a higher number range (usually int is just fine) | var test = 30 as long; | |\n+| Native (native) | | | |\n+| Null (null) | Null, nothing, nada. Not really a type but still useful | var test = null; | |\n+| Short (short) | Like Integer, but with a smaller number Range | var test = 16 as short; | |\n+| String (string) | A string is a text. Here you usually won't need the \"as\" as anything in \"s is automatically a string. | var test = \"Hello World!\" as string; | |\n+| Void (void) | Even less than null. You will probably only need the void type when dealing with functions | var test as void; | |\n+| ILiquidStack | Same as IItemStack, only for liquids | var test = <liquid:water> as ILiquidStack; | import minetweaker.liquid.ILiquidStack; |\n\\ No newline at end of file\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Added Variable Types Section
Hope the explanations are correct..
@jaredlll08 do you know what the native type is for? |
139,040 | 02.07.2017 15:49:54 | -7,200 | d1b97fa3a34eef08314d66fed47b9cbc1b71a6c6 | Created Custom Functions Page | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "docs/Advanced Functions/Custom Functions.md",
"diff": "+# Custom Functions\n+\n+Sometimes the functions supplied by CT and addons just won't do it.\n+Here's how to write your own functions!\n+You can even nest functions in funnctions\n+\n+## Basic Syntax\n+Generally, you declare a function using:\n+```\n+function NAME ([arguments[as type]]) [as returnType]{\n+ [Statements]\n+ [return VALUE;]\n+}\n+```\n+The things in brackets are optional, depending on what you want to achieve.\n+Let's take a closer look at specific funtions.\n+\n+\n+## Void functions\n+\n+Void functions are functions that will not return any value.\n+```\n+//calls the function tens() without arguments\n+tens();\n+\n+//calls the function realTens() with the String \"Hello World!\" as argument\n+realTens(\"Hello World!\");\n+\n+\n+//crates function tens() with no required arguments\n+function tens(){\n+ //Calls function realTens() with \"\" as argument\n+ realTens(\"\");\n+}\n+\n+\n+//creates function realTens() with one string required as argument\n+function realTens(a as string){\n+ //prints the argument 10 times\n+ for i in 1 to 11{\n+ print(a);\n+ }\n+}\n+```\n+\n+## Return functions\n+\n+You can also specify a value that should be returned by a function.\n+It is recommended using the as keyword to define the return type.\n+\n+```\n+//calls add function with 1 and 99 as parameters\n+val result = add(1,99);\n+print(result);\n+\n+//you can place the add function inside the print function as well\n+print(add(2,64));\n+\n+//defines function add() with a and b as parameters (both set to be integers!) and sets the return type to integer\n+function add(a as int,b as int) as int{\n+ //returns the sum of a and b\n+ return a+b;\n+}\n+```\n+\n+## Recipe functions\n+\n+CT's shaped and shapeless recipes natively support functions to alter the recipe's outputs\n+After declaring a recipe's output and inputs, you can add a function as third parameter, that will require 3 parameters: (output, inputs, craftingInfo)\n+\n+To show this, we're gonna create a recipe that repairs your precious diamond Pickaxe using diamonds:\n+\n+```\n+val diaPick = <minecraft:diamond_pickaxe>;\n+\n+//we start normal, by writing the output\n+recipes.addShapeless(diaPick,\n+\n+//followed by the input array. One change though - we mark the diamond pickaxe, so we can use it in the function later\n+[diaPick.anyDamage().marked(\"mark\"),<minecraft:diamond>],\n+\n+//now we start declaring the function.\n+//It needs 3 parameters, one for the output, one for the inputs and one for crafting info.\n+//We'll only need the input parameter, though.\n+function(out, ins, cInfo){\n+\n+ //now we return the pickaxe with either 0 DMG or Current damage -10, whatever is higher. This is to prevent negative damage values.\n+ return ins.mark.withDamage(max(0,ins.mark.damage - 10));\n+});\n+```\n\\ No newline at end of file\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Created Custom Functions Page |
139,040 | 02.07.2017 16:40:16 | -7,200 | a1e39210a65a65c36c17bd53665f6c4830b6c96c | Removed Native type from table
Users usually won't need it anyways | [
{
"change_type": "MODIFY",
"old_path": "docs/Advanced Functions/Variable Types.md",
"new_path": "docs/Advanced Functions/Variable Types.md",
"diff": "@@ -47,7 +47,6 @@ Here's an (incomplete) List of most variable types\n| Floating Point (float) | Decimals | var test = 1.25 as float; | |\n| Double Precision (double) | Like Floating Points, just more precise and with a higher number range | var test = 1.25 as double; | |\n| Long (long) | Like Integer, but with a higher number range (usually int is just fine) | var test = 30 as long; | |\n-| Native (native) | | | |\n| Null (null) | Null, nothing, nada. Not really a type but still useful | var test = null; | |\n| Short (short) | Like Integer, but with a smaller number Range | var test = 16 as short; | |\n| String (string) | A string is a text. Here you usually won't need the \"as\" as anything in \"s is automatically a string. | var test = \"Hello World!\" as string; | |\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Removed Native type from table
Users usually won't need it anyways |
139,040 | 03.07.2017 16:52:32 | -7,200 | 4f36e168b26ddbb0b1124ee7a4d2325b06472498 | Updated Custom Functions.md
wrapped as in "```" | [
{
"change_type": "MODIFY",
"old_path": "docs/Advanced Functions/Custom Functions.md",
"new_path": "docs/Advanced Functions/Custom Functions.md",
"diff": "@@ -46,7 +46,7 @@ function realTens(a as string){\n## Return functions\nYou can also specify a value that should be returned by a function.\n-It is recommended using the as keyword to define the return type.\n+It is recommended using the ```as``` keyword to define the return type.\n```\n//calls add function with 1 and 99 as parameters\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Updated Custom Functions.md
wrapped as in "```" |
139,040 | 03.07.2017 20:43:14 | -7,200 | acefefe8347f889ca5c49f53b8716063b6748663 | Updated Recipes_Crafting_Table.md
Added Context | [
{
"change_type": "MODIFY",
"old_path": "docs/Vanilla/Recipes/Recipes_Crafting_Table.md",
"new_path": "docs/Vanilla/Recipes/Recipes_Crafting_Table.md",
"diff": "# Recipes\n+\n+## Recipe Types\n+There are several types of recipes:\n+\n+### Shaped Recipes\n+Shaped Recipes are recipes, where it matters, which item goes into which slot.\n+For example, you can't just arrange 7 iron ingots in any order to create iron leggins. The shape matters, thus it is a shaped recipe.\n+\n+### Mirrored Recipe\n+Mirrored Recipes are shaped recipes. Only difference is that the recipe can be mirrored along the horizontal or vertical axes.\n+\n+### Shapeless Recipes\n+Shapeless Recipes are recipes, where only the items you put in the crafting grid matter, whereas the shape is of no importance.\n+For example, blue and yellow dye create green dye. This recipe doesn't care about where you put which item.\n+\n+\n+## Remove Recipes\n+There are several ways of removing recipes.\n+\n+\n+### remove\n+```\n+recipes.remove(output, NBTMatch);\n+```\n+\n+This will crafting table recipes for the given `output`.\n+If `NBTMatch` is true, it will only remove recipes that result in items with the same NTB-Data as provided\n+\n+`Output` is an IIngredient.\n+`NBTMatch` is a boolan and optional (Will be the same as false if not specified).\n+\n+\n+### removeShaped\n+```\n+recipes.removeShaped(output, inputs);\n+```\n+\n+This one is more strict on which recipes to remove and will only remove shaped recipes that craft `output` with `input`.\n+`output` is an IIngredient\n+`inputs` is an IIngredient[][] (e.g.[[iron,iron,iron],[iron,null,iron],[iron,null,iron]])\n+Furthermore, `inputs` is optional. If omitted, the function will do the same as `recipe.remove`, though it will only remove shaped Recipes.\n+`inputs` can contain wildcard characters: [[<*>,<*>,<*>],[<*>,<*>,<*>],[<*>,<*>,<*>]] would refer a recipe whose items, as long as each slot is filled, don't matter.\n+\n+\n+### removeShapeless\n+```\n+recipes.removeShapeless(output, inputs, wildcard);\n+```\n+\n+This one is more strict on which recipes to remove and will only remove shapeless recipes that craft `output` with `input`.\n+If `wildcard` is true, it will remove shapeless recipes that craft `output` with `input` and other, non-specified items (for example you could disable all shapeless recipe that contain, among others, lapis as ingredient).\n+`output` is an IIngredient\n+`inputs` is an IIngredient[]\n+`wildcard` is a boolan and optional (Will be the same as false if not specified)\n+Furthermore, `inputs` is optional. If omitted, the function will do the same as `recipe.remove`, though it will only remove shapeless Recipes.\n+\n+## Add Recipes\n+\n+### Notes On 1.12\n+\n+On 1.12, each added recipe requires a UNIQUE identifier, because the forge dev team wanted it that way.\n+This means, all add functions now require an additional parameter `name` at the start (which cannot be omitted)\n+This means `recipe.addShaped(output,input);` now is `recipe.addShaped(name,output,input);`\n+All other functionalities stay the same. Remember that `name` needs to be unique!\n+`name` is a string.\n+\n+### addShaped\n+```\n+recipes.addShaped(output,inputs,function,action);\n+```\n+\n+This creates a shaped recipe for `output` using `inputs` as Ingredients.\n+If a `function` is added as third parameter, you can also use a function to determinate the output.\n+If an `action` function is added as forth parameter, you can also determine, what will happen, if the item is crafted.\n+`output` is an IItemStack\n+`inputs` is an IIngredient[][] (see below)\n+`function` is a IRecipeFunction. Please refer to the respecting wiki entry for more information on functions.\n+`action` is a IRecipeAction. Please refer to the respecting wiki entry for more information on actions.\n+\n+`inputs` is a 2Dimensional IIngredient Array. So the recipe for iron leggins would be written as `[[iron,iron,iron],[iron,null,iron],[iron,null,iron]]`\n+If that looks to confusing, try splitting the arrays up into one array per line\n+```\n+val iron = <minecraft:iron_ingot>;\n+val leggins = <minecraft:iron_leggins>;\n+\n+recipes.add(leggins,\n+ [[iron,iron,iron],\n+ [iron,null,iron],\n+ [iron,null,iron]]);\n+```\n+\n+### addShapedMirrored\n+```\n+recipes.addShapedMirrored(output,inputs,function,action);\n+```\n+\n+Same as `addShaped`, only that the recipe created this way is a mirrored recipe.\n+\n+\n+### addShapeless\n+```\n+recipes.addShapeless(output,inputs,function,action)\n+```\n+\n+This creates a shapeless recipe for `output` using `inputs` as Ingredients.\n+If a `function` is added as third parameter, you can also use a function to determinate the output.\n+If an `action` function is added as forth parameter, you can also determine, what will happen, if the item is crafted.\n+`output` is an IItemStack\n+`inputs` is an IIngredient[] (e.g. [<minecraft:dye:1>,<minecraft:dye:2>])\n+`function` is a IRecipeFunction. Please refer to the respecting wiki entry for more information on functions. This is optional.\n+`action` is a IRecipeAction. Please refer to the respecting wiki entry for more information on actions. This is optional.\n\\ No newline at end of file\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Updated Recipes_Crafting_Table.md
Added Context |
139,040 | 03.07.2017 20:56:31 | -7,200 | 0790d6e242a8c9abc6af5f0fbc29f21430d4239e | Updated Recipes_Crafting_Table again
I'm still bad at Markdown -.- | [
{
"change_type": "MODIFY",
"old_path": "docs/Vanilla/Recipes/Recipes_Crafting_Table.md",
"new_path": "docs/Vanilla/Recipes/Recipes_Crafting_Table.md",
"diff": "@@ -37,10 +37,12 @@ recipes.removeShaped(output, inputs);\n```\nThis one is more strict on which recipes to remove and will only remove shaped recipes that craft `output` with `input`.\n+\n`output` is an IIngredient\n`inputs` is an IIngredient[][] (e.g.[[iron,iron,iron],[iron,null,iron],[iron,null,iron]])\n+\nFurthermore, `inputs` is optional. If omitted, the function will do the same as `recipe.remove`, though it will only remove shaped Recipes.\n-`inputs` can contain wildcard characters: [[<*>,<*>,<*>],[<*>,<*>,<*>],[<*>,<*>,<*>]] would refer a recipe whose items, as long as each slot is filled, don't matter.\n+`inputs` can contain wildcard characters: `[[<*>,<*>,<*>],[<*>,<*>,<*>],[<*>,<*>,<*>]]` would refer a recipe whose items, as long as each slot is filled, don't matter.\n### removeShapeless\n@@ -50,9 +52,11 @@ recipes.removeShapeless(output, inputs, wildcard);\nThis one is more strict on which recipes to remove and will only remove shapeless recipes that craft `output` with `input`.\nIf `wildcard` is true, it will remove shapeless recipes that craft `output` with `input` and other, non-specified items (for example you could disable all shapeless recipe that contain, among others, lapis as ingredient).\n+\n`output` is an IIngredient\n`inputs` is an IIngredient[]\n`wildcard` is a boolan and optional (Will be the same as false if not specified)\n+\nFurthermore, `inputs` is optional. If omitted, the function will do the same as `recipe.remove`, though it will only remove shapeless Recipes.\n## Add Recipes\n@@ -60,7 +64,7 @@ Furthermore, `inputs` is optional. If omitted, the function will do the same as\n### Notes On 1.12\nOn 1.12, each added recipe requires a UNIQUE identifier, because the forge dev team wanted it that way.\n-This means, all add functions now require an additional parameter `name` at the start (which cannot be omitted)\n+This means, all add functions now require an additional parameter `name` at the start (which cannot be omitted).\nThis means `recipe.addShaped(output,input);` now is `recipe.addShaped(name,output,input);`\nAll other functionalities stay the same. Remember that `name` needs to be unique!\n`name` is a string.\n@@ -73,12 +77,14 @@ recipes.addShaped(output,inputs,function,action);\nThis creates a shaped recipe for `output` using `inputs` as Ingredients.\nIf a `function` is added as third parameter, you can also use a function to determinate the output.\nIf an `action` function is added as forth parameter, you can also determine, what will happen, if the item is crafted.\n+\n`output` is an IItemStack\n`inputs` is an IIngredient[][] (see below)\n`function` is a IRecipeFunction. Please refer to the respecting wiki entry for more information on functions.\n`action` is a IRecipeAction. Please refer to the respecting wiki entry for more information on actions.\n-`inputs` is a 2Dimensional IIngredient Array. So the recipe for iron leggins would be written as `[[iron,iron,iron],[iron,null,iron],[iron,null,iron]]`\n+`inputs` is a 2Dimensional IIngredient Array.\n+So the recipe for iron leggins would be written as `[[iron,iron,iron],[iron,null,iron],[iron,null,iron]]`\nIf that looks to confusing, try splitting the arrays up into one array per line\n```\nval iron = <minecraft:iron_ingot>;\n@@ -106,6 +112,7 @@ recipes.addShapeless(output,inputs,function,action)\nThis creates a shapeless recipe for `output` using `inputs` as Ingredients.\nIf a `function` is added as third parameter, you can also use a function to determinate the output.\nIf an `action` function is added as forth parameter, you can also determine, what will happen, if the item is crafted.\n+\n`output` is an IItemStack\n`inputs` is an IIngredient[] (e.g. [<minecraft:dye:1>,<minecraft:dye:2>])\n`function` is a IRecipeFunction. Please refer to the respecting wiki entry for more information on functions. This is optional.\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Updated Recipes_Crafting_Table again
I'm still bad at Markdown -.- |
139,040 | 04.07.2017 18:47:37 | -7,200 | f434b9b87b83a57071450730d49a94b4860507b2 | Renamed Stuff so it now looks like Jareds repo again
Still a newbie at github... | [
{
"change_type": "RENAME",
"old_path": "docs/Advanced Functions/Arrays and Loops.md",
"new_path": "docs/AdvancedFunctions/Arrays_and_Loops.md",
"diff": ""
},
{
"change_type": "RENAME",
"old_path": "docs/Advanced Functions/Conditional Statements.md",
"new_path": "docs/AdvancedFunctions/Conditional_Statements.md",
"diff": "@@ -78,3 +78,7 @@ if(d==\"Hello\" ^ e == \"World\"){print(\"XOR2!\");} //false\nif(d==\"Hello\" & e == \"Hello\"){print(\"AND1!\");} //false\nif(d==\"Hello\" & e == \"World\"){print(\"AND2!\");} //true\n```\n+\n+## The ? Operator\n+Surely, always typing out an if/else structure can be annoying. Especially if you just want to do an either or condition.\n+That's why the `?` operator was implemented.\n"
},
{
"change_type": "RENAME",
"old_path": "docs/Advanced Functions/Custom Functions.md",
"new_path": "docs/AdvancedFunctions/Custom_Functions.md",
"diff": ""
},
{
"change_type": "RENAME",
"old_path": "docs/Advanced Functions/Import.md",
"new_path": "docs/AdvancedFunctions/Import.md",
"diff": ""
},
{
"change_type": "RENAME",
"old_path": "docs/Advanced Functions/Variable Types.md",
"new_path": "docs/AdvancedFunctions/Variable_Types.md",
"diff": ""
},
{
"change_type": "MODIFY",
"old_path": "mkdocs.yml",
"new_path": "mkdocs.yml",
"diff": "@@ -14,6 +14,12 @@ pages:\n- Recipes:\n- Crafting Table Recipes: 'Vanilla/Recipes/Recipes_Crafting_Table.md'\n- Furnace Recipes: 'Vanilla/Recipes/Recipes_Furnace.md'\n+ - Advanced Functions:\n+ - Arrays and Loops: 'AdvancedFunctions/Arrays_and_Loops.md'\n+ - Contional Statements: 'AdvancedFunctions/Conditional_Statements.md'\n+ - Custom Functions: 'AdvancedFunctions/Custom_Functions.md'\n+ - Import: 'AdvancedFunctions/Import.md'\n+ - Variable Types: 'AdvancedFunctions/Variable_Types.md'\n# Do not edit in PRs below here\nsite_name: Crafttweaker Documentation\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Renamed Stuff so it now looks like Jareds repo again
Still a newbie at github... |
139,040 | 04.07.2017 18:59:27 | -7,200 | 665bc7a4c4cfd1b5775fbe1f16ad24468a15b481 | Added ? Operator to Conditional_Statements | [
{
"change_type": "MODIFY",
"old_path": "docs/AdvancedFunctions/Conditional_Statements.md",
"new_path": "docs/AdvancedFunctions/Conditional_Statements.md",
"diff": "@@ -82,3 +82,23 @@ if(d==\"Hello\" & e == \"World\"){print(\"AND2!\");} //true\n## The ? Operator\nSurely, always typing out an if/else structure can be annoying. Especially if you just want to do an either or condition.\nThat's why the `?` operator was implemented.\n+It follows the same logic as an if/else statement, it only is by far less code required.\n+Syntax: `boolean ? if : else`\n+\n+```\n+val switchy = false;\n+\n+//prints switchy state\n+print(\"Switchy is \"~switchy);\n+\n+//if switchy is true, vInt = 1, otherwise vInt = 2\n+val vInt = switchy ? 1 : 2;\n+print(vInt);\n+\n+//Prints \"Hello\" if switchy is stue, otherwise prints \"Bye\"\n+print(switchy ? \"Hello\" : \"Bye\");\n+\n+//Prints \"Bye\" if switchy is stue, otherwise prints \"Hello\"\n+switchy ? print(\"Bye\") : print(\"Hello\");\n+\n+```\n\\ No newline at end of file\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Added ? Operator to Conditional_Statements |
139,040 | 04.07.2017 19:27:49 | -7,200 | 4522fd273618c4bb3f793dc992f65e646330e880 | Added OreDic entry to mkdocs.yml | [
{
"change_type": "MODIFY",
"old_path": "mkdocs.yml",
"new_path": "mkdocs.yml",
"diff": "@@ -14,6 +14,8 @@ pages:\n- Recipes:\n- Crafting Table Recipes: 'Vanilla/Recipes/Recipes_Crafting_Table.md'\n- Furnace Recipes: 'Vanilla/Recipes/Recipes_Furnace.md'\n+ - Ore Dictionary:\n+ - Ore Dictionary: 'Vanilla/OreDic.md'\n- Advanced Functions:\n- Arrays and Loops: 'AdvancedFunctions/Arrays_and_Loops.md'\n- Contional Statements: 'AdvancedFunctions/Conditional_Statements.md'\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Added OreDic entry to mkdocs.yml |
139,040 | 04.07.2017 20:17:20 | -7,200 | 42af49c64c1413f17e6d2a03b86b55ffcbb2e424 | Added Operators Table to Conditional_Statements | [
{
"change_type": "MODIFY",
"old_path": "docs/AdvancedFunctions/Conditional_Statements.md",
"new_path": "docs/AdvancedFunctions/Conditional_Statements.md",
"diff": "@@ -102,3 +102,22 @@ print(switchy ? \"Hello\" : \"Bye\");\nswitchy ? print(\"Bye\") : print(\"Hello\");\n```\n+\n+## Operators\n+\n+You can use these operators.\n+All the examples given evaluate to true.\n+\n+\n+| Name | token | Explanation | Example |\n+|------------------ |------------- |--------------------------------------------------------------------------------------- |------------------- |\n+| Not | `!` | Inverts a boolean | !false |\n+| Not Equal | `!=` | Checks if the value before and after are not equal | 1 != 2 |\n+| Equal | `==` | Checks if the value before and after are equal | 1 == 1 |\n+| Greater as | `>` | Checks if the value before is greater than after | 1 < 2 |\n+| Greater or Equal | `>=` | Checks if the value before is greater than or equal with after | 1 <= 1 |\n+| Fewer as | `>` | Checks if the value before is fewer than after | 2 > 1 |\n+| Fewer or Equal | `>=` | Checks if the value before is fewer than or equal with after | 1 >= 1 |\n+| XOR | `^` | Checks if either the value before or after is true, false if both or none is true | true ^ false |\n+| AND | `&` or `&&` | Checks whether both, value before and after are true, false if one or both are false | true & true |\n+| OR | `|` or `||` | Checks if the value before or after is true. True, is both are true | true | true |\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Added Operators Table to Conditional_Statements |
139,040 | 04.07.2017 20:56:18 | -7,200 | e9c98f1c27f67f47eab50b6aa368443f278eeade | Added Calculations.md
Explains the calculations Zenscript supports | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "docs/AdvancedFunctions/Calculations.md",
"diff": "+# Calculations\n+\n+Sometimes typing in numbers won't cut it. Sometimes you need some calculation.\n+Remember that you can use more than two numbers at one, `1+1+1+1` would work fine as well.\n+\n+## A word of advice\n+\n+When unexpected results happen in a calculation, it is very well possible that you used two different types.\n+For example `13 % 6.5` returns 1, even though the correct result is 0. Why?\n+Zenscript always performs its calculations with two variables of the same type. For this, it converts the 2nd Type to match the first one.\n+In this example, the calculation performed was `13 % 6`, as the 2nd number (a double) was converted to match the first one (an integer).\n+\n+Always be careful about what two variable types you use and when in doubt, just use a print function to print the output to the log and confirm the results.\n+\n+## Arithmetic Operators\n+\n+I'm pretty sure all of you know these already, don't you?\n+\n+| Token | Tokenassign | Function | Example |\n+|------- |------------- |---------------- |--------- |\n+| `+` | `+=` | Addition | 1+2 |\n+| `-` | `-=` | Substraction | 2-1 |\n+| `*` | `*=` | Multiplication | 1*1 |\n+| `/` | `/=` | Division | 2/2 |\n+| `%` | `%=` | Modulo | 13 % 6 |\n+\n+## Concatenation\n+\n+Puts one thing at the and of the other\n+\n+```\n+//prints \"Hello World\"\n+print(\"Hello\"~\" \"~\"World\");\n+```\n+\n+## Calculation results\n+\n+A calculation usually ends up with a result. So what to do with that?\n+\n+### Assigning a variable\n+\n+There are rwo ways of assigning a value to a variable:\n+\n+```\n+var test = 0;\n+\n+//Option 1:\n+//assigns test with the value 3 (1+2)\n+test = 1+2;\n+\n+//Option 2:\n+//assigns test with 5 (3+2)\n+test = test + 2;\n+\n+//Option 3:\n+//assigns test with 2 (5-3)\n+test -= 2;\n+```\n+\n+Option 1 and 2 assign the return variable using the `=` token.\n+This is probably the easiest way for beginners and the only way if you want to assign a variable not used in the calculation.\n+\n+Option 3 assigns the variable before the `-=` with the result of a normal substraction.\n+All Operators on on this page have their respective assign tokens, check the table above.\n+\n+### Using the result otherwise\n+\n+You can always use the result of a calculation in a function or a conditional statement:\n+\n+```\n+//prints 4\n+print(3+1);\n+\n+//removes the item on array[4]\n+recipes.remove(array[3+1]);\n+\n+//\n+if(3+1 == 22) {print(\"Used a calculation!\")}\n+```\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "mkdocs.yml",
"new_path": "mkdocs.yml",
"diff": "@@ -18,6 +18,7 @@ pages:\n- Ore Dictionary: 'Vanilla/OreDic.md'\n- Advanced Functions:\n- Arrays and Loops: 'AdvancedFunctions/Arrays_and_Loops.md'\n+ - Calculations: 'AdvancedFunctions/Calculations.md'\n- Contional Statements: 'AdvancedFunctions/Conditional_Statements.md'\n- Custom Functions: 'AdvancedFunctions/Custom_Functions.md'\n- Import: 'AdvancedFunctions/Import.md'\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Added Calculations.md
Explains the calculations Zenscript supports |
139,040 | 04.07.2017 21:17:28 | -7,200 | 358515d8985116c31e0941e6bcaf3b74c81e8ebc | Updated Arrays_and_Loops.md
Added the for .. constructor | [
{
"change_type": "MODIFY",
"old_path": "docs/AdvancedFunctions/Arrays_and_Loops.md",
"new_path": "docs/AdvancedFunctions/Arrays_and_Loops.md",
"diff": "@@ -100,4 +100,9 @@ for i in 0 to 10 {\n//defines the variable \"i\" with each number from 0 to 9 (i.e. 0,1,2,...,8,9)\nprint(i);\n}\n+\n+for i in 10 .. 20 {\n+ //defines the variable \"i\" with each number from 10 to 19 (i.e. 10,11,12,...,18,19)\n+ print(i);\n+}\n```\n\\ No newline at end of file\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Updated Arrays_and_Loops.md
Added the for .. constructor |
139,040 | 08.07.2017 13:24:17 | -7,200 | 9d7e834f7b11e464f5ee0a23252f43f97ea3e245 | Added 1.12 Examples to the Crafting table recipes | [
{
"change_type": "MODIFY",
"old_path": "docs/Vanilla/Recipes/Recipes_Crafting_Table.md",
"new_path": "docs/Vanilla/Recipes/Recipes_Crafting_Table.md",
"diff": "@@ -71,13 +71,18 @@ All other functionalities stay the same. Remember that `name` needs to be unique\n### addShaped\n```\n+//pre-1.12\nrecipes.addShaped(output,inputs,function,action);\n+\n+//1.12\n+recipes.addShaped(name,output,inputs,function,action);\n```\nThis creates a shaped recipe for `output` using `inputs` as Ingredients.\nIf a `function` is added as third parameter, you can also use a function to determinate the output.\nIf an `action` function is added as forth parameter, you can also determine, what will happen, if the item is crafted.\n+`name` is a string and needs to be unique\n`output` is an IItemStack\n`inputs` is an IIngredient[][] (see below)\n`function` is a IRecipeFunction. Please refer to the respecting wiki entry for more information on functions.\n@@ -98,7 +103,11 @@ recipes.add(leggins,\n### addShapedMirrored\n```\n+//pre-1.12\nrecipes.addShapedMirrored(output,inputs,function,action);\n+\n+//1.12\n+recipes.addShapedMirrored(name,output,inputs,function,action);\n```\nSame as `addShaped`, only that the recipe created this way is a mirrored recipe.\n@@ -106,13 +115,18 @@ Same as `addShaped`, only that the recipe created this way is a mirrored recipe.\n### addShapeless\n```\n+//pre-1.12\nrecipes.addShapeless(output,inputs,function,action)\n+\n+//1.12\n+recipes.addShapeless(name,output,inputs,function,action)\n```\nThis creates a shapeless recipe for `output` using `inputs` as Ingredients.\nIf a `function` is added as third parameter, you can also use a function to determinate the output.\nIf an `action` function is added as forth parameter, you can also determine, what will happen, if the item is crafted.\n+`name` is a string and needs to be unique\n`output` is an IItemStack\n`inputs` is an IIngredient[] (e.g. [<minecraft:dye:1>,<minecraft:dye:2>])\n`function` is a IRecipeFunction. Please refer to the respecting wiki entry for more information on functions. This is optional.\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Added 1.12 Examples to the Crafting table recipes |
139,040 | 08.07.2017 13:24:55 | -7,200 | 9f2b8cc9a3551a651361e46aa696b4160bd9f3ea | Removed AND AND and OR OR from conditional_Statements.md
Nobody's gonna use them anyways, they're a bit complicated | [
{
"change_type": "MODIFY",
"old_path": "docs/AdvancedFunctions/Conditional_Statements.md",
"new_path": "docs/AdvancedFunctions/Conditional_Statements.md",
"diff": "@@ -119,5 +119,5 @@ All the examples given evaluate to true.\n| Fewer as | `>` | Checks if the value before is fewer than after | 2 > 1 |\n| Fewer or Equal | `>=` | Checks if the value before is fewer than or equal with after | 1 >= 1 |\n| XOR | `^` | Checks if either the value before or after is true, false if both or none is true | true ^ false |\n-| AND | `&` or `&&` | Checks whether both, value before and after are true, false if one or both are false | true & true |\n-| OR | `|` or `||` | Checks if the value before or after is true. True, is both are true | true | true |\n+| AND | `&` | Checks whether both, value before and after are true, false if one or both are false | true & true |\n+| OR | `|` | Checks if the value before or after is true. True, is both are true | true | true |\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Removed AND AND and OR OR from conditional_Statements.md
Nobody's gonna use them anyways, they're a bit complicated |
139,040 | 08.07.2017 15:14:24 | -7,200 | da9df3afbcdfb5b5df3483b74a85e36d6abb1f58 | Expanded OreDic entry
Added contains method (or rather, `in` method)
Added `firstItem` method | [
{
"change_type": "MODIFY",
"old_path": "docs/Vanilla/OreDic.md",
"new_path": "docs/Vanilla/OreDic.md",
"diff": "@@ -120,6 +120,19 @@ if(!OD.empty){\n}\n```\n+## Check if an oreDic contains an item\n+\n+Usually, you can just use NEI/JEI, but if you ever need CT to check if a oreDictionary contains a specific item, you can use the `in` function.\n+Remember, first the oreDic, then the item you want to check for.\n+This will return a boolean.\n+\n+```\n+\n+if(<ore:ingotIron> in <minecraft:iron_ingot>){\n+ print(\"Iron is in the oreDic!\");\n+}\n+```\n+\n## Get an oreDics name\nIf you ever need to get an oreDics name, you can use the `oreDic.name` function. This will return the name as String.\n@@ -129,3 +142,13 @@ val OD = <ore:ingotIron>;\n//prints \"ingotIron\"\nprint(OD.name);\n+\n+## Get the first item of an oreDic\n+\n+I have no idea why you would ever need this, but here you go\n+the firstItem function returns an IItemStack\n+\n+```\n+val fI = <ore:ingotIton>.firstItem;\n+print(fI.name);\n+```\n\\ No newline at end of file\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Expanded OreDic entry
Added contains method (or rather, `in` method)
Added `firstItem` method |
139,040 | 08.07.2017 15:15:03 | -7,200 | 4ee66bbec599622e4acc08cee448e38ddfc12fb6 | Expanded Conditional Statments entry
Added the `in` Operator | [
{
"change_type": "MODIFY",
"old_path": "docs/AdvancedFunctions/Conditional_Statements.md",
"new_path": "docs/AdvancedFunctions/Conditional_Statements.md",
"diff": "@@ -121,3 +121,30 @@ All the examples given evaluate to true.\n| XOR | `^` | Checks if either the value before or after is true, false if both or none is true | true ^ false |\n| AND | `&` | Checks whether both, value before and after are true, false if one or both are false | true & true |\n| OR | `|` | Checks if the value before or after is true. True, is both are true | true | true |\n+\n+\n+## The in Operator\n+\n+The `in` operator checks if something is in something.\n+First you need the list you want to check in, then the `in` then the value you want to check for\n+\n+### in loadedMods\n+\n+You can check, if a mod is loaded by checking if it's in the loadedMods list\n+```\n+if(loadedMods in \"mcp\"){\n+ print(\"Minecraft Coder Pack loaded\");\n+}\n+```\n+\n+### in IIngredient\n+\n+You can also check if an item matches a definition by comparing two IIngredients.\n+\n+```\n+if(<ore:ingotIron> in <minecraft:iron_ingot>){\n+ print(\"Iron ingots are in the right oreDic\");\n+}\n+```\n+With this one you need to be a bit careful as not to confuse the two entries:\n+This is only then true, when ALL matching items from the IIngredient AFTER the `in` can also be found in the IIngredient BEFORE `in`.\n\\ No newline at end of file\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Expanded Conditional Statments entry
Added the `in` Operator |
139,040 | 08.07.2017 18:47:50 | -7,200 | 9cffd8571ecee7e78f2c156e038492830a67216b | Extended Furnace Entry
Added Get Function | [
{
"change_type": "MODIFY",
"old_path": "docs/Vanilla/Recipes/Recipes_Furnace.md",
"new_path": "docs/Vanilla/Recipes/Recipes_Furnace.md",
"diff": "@@ -56,6 +56,16 @@ This will set the burn value of `input` to `burnTime`.\nSetting the `burnTime` to `0` will stop the `input` from being a fuel item.\n+### Get\n+\n+The command for retrieving an item's fuel value is:\n+\n+```\n+furnace.getFuel(item);\n+```\n+\n+This will return the burn value as an integer\n+\n## Examples\n### Removal\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Extended Furnace Entry
Added Get Function |
139,040 | 08.07.2017 18:57:30 | -7,200 | 7d4de3711291cd3fe479dd0ccc8ab0e418c9ae03 | Added Item_Conditions.md
Explains about NBT and Damage Tags for input and output items | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "docs/Vanilla/Item_Conditions.md",
"diff": "+# Item Conditions\n+\n+Sometimes normal items won't cut it:\n+Sometimes we want to be able to specify recipes that only work when the input item fullfills some conditions.\n+Sometimes we want to be able to specify recipes that will produce a special item, be it with NBT-Tag or Damage value or otherwise.\n+\n+## Input Conditions\n+\n+These will affect the items that you can use to craft the resulting item.\n+Remember, you can mix modifiers, to mix Damage and NBT-Tag, for example\n+```\n+<minecraft:iron_pickaxe>.onlyDamaged().withTag({display: {Lore: \"Aren't we all butterflies?\"}});\n+\n+### Damage\n+\n+#### anyDamage\n+The input item's damage value does not matter for the recipe\n+```\n+item.anyDamage()\n+```\n+\n+#### onlyDamaged\n+The input item needs to be damaged\n+```\n+item.onlyDamaged();\n+```\n+\n+#### Damaged at least\n+Input item's damage value needs to be at least the specified `value`\n+`Value` is an int\n+```\n+item.onlyDamageAtLeast(value);\n+```\n+\n+#### Damage at most\n+Input item's damage value needs to be at max the specified `value`\n+`Value` is an int\n+```\n+item.onlyDamageAtMost(value);\n+```\n+\n+#### Damage between\n+Input item's damage value needs to be between the speciefied `value1` and `value2`\n+`Value1` is an int\n+`Value2` is an int\n+```\n+item.onlyDamageBetween(value1, value2);\n+```\n+\n+### Get Items back or explicitly forbid an item's reusability\n+Sometimes you need a recipe where you get some of your input items back.\n+By applying `reuse()` or `transformDamage(int)` you can create such recipes.\n+\n+#### reuse\n+The input item won't lose any durability when you craft and you get it back.\n+```\n+item.reuse();\n+```\n+\n+#### transformDamage\n+The input item will receive `value` damage points and you will get it back, unless it breaks during the crafting process.\n+`Value` is an int\n+```\n+item.transformDamage(value);\n+```\n+\n+### NBT-Tags\n+Sometimes you want your ingredients to need a specific NBT-Tag.\n+The recipe doesn't care if your item has NBT-Tags other than the ones specified,\n+So a pickaxe with a speciic lore may also be enchanted and would still work!\n+\n+Here's how you do it:\n+`NBTTag` is your NBT Data\n+```\n+item.onlyWithTag(NBTTag);\n+\n+<minecraft.iron_pickaxe>.onlyWithTag({display: {Name: \"Pickle the Pickleberry\"}});\n+```\n+\n+## Output modifiers\n+\n+If you can specify input conditions, it's not so hard to also define output conditions, or rather, output modifiers.\n+\n+### Damage\n+Your output item will have `value` damage points.\n+`Value` is an int.\n+```\n+item.withDamage(value);\n+```\n+\n+### NBT-Tags\n+Your output item will have `NBTTag` as NBT-Tag.\n+`NBTTag` is your NBT Data\n+```\n+item.withTag(NBTTag);\n+\n+<minecraft:iron_pickaxe>.withTag({display: {Name: \"Pickle the Pickleberry\"}})\n+```\n"
},
{
"change_type": "MODIFY",
"old_path": "mkdocs.yml",
"new_path": "mkdocs.yml",
"diff": "@@ -7,6 +7,8 @@ pages:\n- Commands: 'Vanilla/Commands.md'\n- Brackets:\n- Bracket Handlers: 'Brackets/Brackets.md'\n+ - Item States:\n+ - Item Conditions: 'Vanilla/Item_Conditions.md'\n- Recipes:\n- Vanilla:\n- Brackets:\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Added Item_Conditions.md
Explains about NBT and Damage Tags for input and output items |
139,040 | 08.07.2017 18:59:28 | -7,200 | 2ef930adb6aea2eeed9418ea5f80f7d1f3d0f969 | Moved Item_Conditions to own Subdir called Item_Modification | [
{
"change_type": "RENAME",
"old_path": "docs/Vanilla/Item_Conditions.md",
"new_path": "docs/Vanilla/Item_Modification/Item_Conditions.md",
"diff": ""
},
{
"change_type": "MODIFY",
"old_path": "mkdocs.yml",
"new_path": "mkdocs.yml",
"diff": "@@ -8,7 +8,7 @@ pages:\n- Brackets:\n- Bracket Handlers: 'Brackets/Brackets.md'\n- Item States:\n- - Item Conditions: 'Vanilla/Item_Conditions.md'\n+ - Item Conditions: 'Vanilla/Item_Modification/Item_Conditions.md'\n- Recipes:\n- Vanilla:\n- Brackets:\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Moved Item_Conditions to own Subdir called Item_Modification |
139,040 | 08.07.2017 19:37:22 | -7,200 | 90310bada1b8cb07ec85ad2459031f411277b12c | Added Renaming/Tooltip entry | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "docs/Vanilla/Item_Modification/Renaming_Tooltips.md",
"diff": "+# Renaming\n+\n+Always reading 'chest' is annoying, isn't it?\n+That's why there's the possibility to rename stuff.\n+\n+## Changing the display name\n+\n+This is probably the easiest way to achieve a different item or block name.\n+You rename `item` to `newName`:\n+```\n+item.displayName = newName;\n+\n+//Example\n+<minecraft:chest>.displayName = \"Storage Box Deluxe\";\n+```\n+`item` is an IItemStack.\n+`newName` is a String.\n+\n+## Changing the localization\n+\n+If some modded inventories still show the item's old name instead of the new one, you need to change the localization.\n+You can read what that means on the `game` entry.\n+```\n+game.setLocalization(languageCode,unlocalizedName,newName);\n+\n+game.setLocalization(tile.chest.name,\"StorageBox Deluxe\")\n+```\n+`languageCode` is a string and optional. If you omit it, it will apply the localization regardless of the client's set language.\n+`unlocaLizedName` is a string.\n+`newName` is a string.\n+\n+\n+# Tooltips\n+\n+Adding a tooltip is really easy:\n+All you need is an item (or oreDict or similar).\n+\n+## Normal Tooltips\n+This adds `tT` as tooltip to `item`.\n+```\n+item.addTooltip(tT);\n+\n+<minecraft:chest>.addTooltip(\"Storage, what can I say more?\");\n+```\n+`item` is a IIngredient\n+`tT` is a string\n+\n+## Shift Tooltips\n+This adds a tooltip, that will only be visible when you hold shift.\n+```\n+item.addShiftTooltip(tT);\n+\n+<minecraft:chest>.addShiftTooltip(\"STORAGE!!!\");\n+```\n+`item` is a IIngredient\n+`tT` is a string\n+\n+# Markup\n+The world is colorful, and so should be all of our tooltips.\n+You can also nest these options, should you with to (if you wanted a green text, that is striked through)\n+\n+## Coloring a String\n+\n+You can apply one of the 16 colors to your string\n+```\n+format.black\n+format.darkBlue\n+format.darkGreen\n+format.darkAqua\n+format.darkRed\n+format.darkPurple\n+format.gold\n+format.gray\n+format.darkGray\n+format.blue\n+format.green\n+format.aqua\n+format.red\n+format.lightPurple\n+format.yellow\n+format.white\n+```\n+\n+```\n+<minecraft:stick>.addTooltip(format.green(\"This one wasn't ripe\"));\n+```\n+\n+## Formatting a String\n+You can apply different formats to your String should you wish to:\n+```\n+format.obfuscated\n+format.bold\n+format.strikethrough\n+format.underline\n+format.italic\n+```\n+\n+```\n+<minecraft:stick>.addShiftTooltip(format.strikethrough(\"This is a bad tooltip\"));\n+```\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "mkdocs.yml",
"new_path": "mkdocs.yml",
"diff": "@@ -9,6 +9,7 @@ pages:\n- Bracket Handlers: 'Brackets/Brackets.md'\n- Item States:\n- Item Conditions: 'Vanilla/Item_Modification/Item_Conditions.md'\n+ - Renaming items and setting tooltips: 'Vanilla/Item_Modification/Renaming_Tooltips'\n- Recipes:\n- Vanilla:\n- Brackets:\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Added Renaming/Tooltip entry |
139,040 | 09.07.2017 21:30:59 | -7,200 | 78a573956a0cd53882c103f0bd7b365c2d0bfec0 | Added Seeds entry | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "docs/Vanilla/Recipes/Seeds.md",
"diff": "+# Seeds\n+Seeds are things you get from punching tall grass.\n+\n+## Print all seeds to the log\n+\n+This command will print all registeres seeds to the log.\n+Needs to be performed by a player or console, cannot be written in a zs-file.\n+```\n+1.12\n+/ct seeds\n+\n+pre-1.12\n+/mt seeds\n+````\n+\n+## Add a seed drop\n+\n+Adds `item` as seed drop.\n+```\n+vanilla.seeds.addSeed(item);\n+```\n+\n+`item` is a weightedItemStack.\n+What does that mean? It simply means that you need to give it a percentage like this:\n+\n+```\n+//adds carrots with a weight of 1\n+vanilla.seeds.addSeed(<minecraft:carrot> % 100);\n+```\n+\n+\n+## Remove a seed drop\n+\n+Stops `item` from being a seed drop.\n+```\n+vanilla.seeds.removeSeed(item);\n+```\n+`item` is an IIngredient.\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "mkdocs.yml",
"new_path": "mkdocs.yml",
"diff": "@@ -17,6 +17,7 @@ pages:\n- Recipes:\n- Crafting Table Recipes: 'Vanilla/Recipes/Recipes_Crafting_Table.md'\n- Furnace Recipes: 'Vanilla/Recipes/Recipes_Furnace.md'\n+ - Seed Drops: 'Vanilla/Recipes/Seeds.md'\n- Ore Dictionary:\n- Ore Dictionary: 'Vanilla/OreDic.md'\n- Advanced Functions:\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Added Seeds entry |
139,040 | 16.07.2017 12:20:11 | -7,200 | 48e6bf995b9efbae80b3808763920813744cbf74 | Updated Bracket_Item.md
Added more general Syntax
Added some more Examples | [
{
"change_type": "MODIFY",
"old_path": "docs/Vanilla/Brackets/Bracket_Item.md",
"new_path": "docs/Vanilla/Brackets/Bracket_Item.md",
"diff": "@@ -10,12 +10,37 @@ Items are referenced in the Item Bracket Handler by like so:\nWith the `modid` being the modid of the mod that the Item belongs to, and `itemname` being the name of the item, It is recommended to use `/ct hand` to get the correct name of the item.\n+Generally it is like this though:\n+```\n+<item:modid:itemname:meta>\n+```\n+With `item` as first entry, it specifically says \"This has to be an item!\" to CT.\n+As you've seen above: Optional.\n+Usually you will never need this, unless dealing with several custom bracket handlers.\n+`modid` is the modid of the mod that the Item belongs to.\n+`itemname` is the name of the item, use /ct hand to get the correct name.\n+`meta` is the meta value of the item (e.g. Damage value, types, etc.). This is an integer.\n+You can also use a wildcard `*` to address all meta values.\n+Also optional: If left out it will be 0.\n+\n## Examples\nAn example of the Item Bracket Handler would be:\n```\n+//apple\n<minecraft:apple>\n+\n+//coal\n+<minecraft:coal>\n+<minecraft:coal:0>\n+\n+//charcoal\n+<minecraft:coal:1>\n+\n+//both, coal and charcoal\n+<minecraft:coal:*>\n+<item:minecraft:coal:*>\n```\nThis will give you access to the `Apple` item.\n\\ No newline at end of file\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Updated Bracket_Item.md
Added more general Syntax
Added some more Examples |
139,040 | 16.07.2017 12:20:44 | -7,200 | f741d74d7b7c5d0e3fa5612578942d9358d24d56 | Added 'Note on Imports' to import.ms | [
{
"change_type": "MODIFY",
"old_path": "docs/AdvancedFunctions/Import.md",
"new_path": "docs/AdvancedFunctions/Import.md",
"diff": "Instead of typing the whole function name all the time, you can just import a function to serve your needs.\nUseful when using mod functions.\n+## Note on pre 1.12 imports\n+With CraftTweaker 1.12, a lot of code has changed.\n+Before, all internal functions were called using `minetweaker.package.function`.\n+Now, `minetweaker` has been replaced by `crafttweaker`, so now it sais `crafttweaker.name.function`!\n+\n+Should you ever experience any importing issues with scripts from this wiki, you may want to check if your MC version is below 1.12.\n+\n+\n## Basic Import\nImports have to be declared at the top of a Script. You will have to declare imports for each scripts separately.\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Added 'Note on Imports' to import.ms |
139,040 | 22.07.2017 16:05:32 | -7,200 | c027f8c8cc64eb7db0e0c5abcaa445e2afdf7f57 | Fixed text in OreDict.md
items returns a List, not an array | [
{
"change_type": "MODIFY",
"old_path": "docs/Vanilla/OreDict.md",
"new_path": "docs/Vanilla/OreDict.md",
"diff": "@@ -98,7 +98,7 @@ recipes.add(<minecraft:dirt>,[[iron,iron,iron],[iron,iron,null],[iron,iron,iron]\n## Iterating through an OreDictionary\n-You can iterate through an oreDictionary by making it to an array and iterating through that one.\n+You can iterate through an oreDictionary by making it to a list and iterating through that one.\nThis can be done using the function items.\n```\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Fixed text in OreDict.md
items returns a List, not an array |
139,040 | 22.07.2017 16:56:17 | -7,200 | bf86bd7471705fb4860372184448ccae090773e5 | Added Bracket HAndler | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "docs/Vanilla/Brackets/Bracket_Entity.md",
"diff": "+# Entity Bracket Handler\n+\n+The Entity Bracket Handler gives you access to the Entities (e.g. Mobs, tile ents etc.) in the game. It is only possible to get entities registered in the game, so adding or removing mods may cause issues if you reference the mod's mobs in an Entity Bracket Handler.\n+\n+Entities are referenced in the Entity handler this way:\n+\n+```\n+<entity:entityName>\n+\n+<entity:sheep>\n+```\n+\n+If the mob/entity is found, thiw will return an IEntityDefinition Object.\n+Please refer to the respective Wiki entry for further information on what you can do with these.\n+\n+# Getting all Registered Entities\n+\n+You can use the following command to output all registered entities to the CraftTweaker log\n+```\n+/ct entities\n+/crafttweaker entities\n+```\n\\ No newline at end of file\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Added Bracket HAndler |
139,040 | 22.07.2017 16:56:38 | -7,200 | 20770fadebb33555d7ebaf7d47b1ee9dea4facc3 | Moved Variable Types and Added IEntityDefinition | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "docs/Vanilla/Variable_Types/IEntityDefinition.md",
"diff": "+# IEntityDefinition\n+\n+This sounds scary, wo what does it mean?\n+Basically, it is a reference to an entity registered in the game, so it is a reference to, say a mob in the game.\n+\n+```\n+//This returns an IEntityDefinition Object\n+val test = <entity:sheep>;\n+\n+```\n+\n+## Functions\n+So, this is where it gets interesting:\n+What can we do with it, now that we created that thing?\n+\n+### id\n+\n+Returns the ID as string\n+```\n+<entity:sheep>.id;\n+```\n+\n+### name\n+\n+Returns the name as string\n+```\n+<entity:sheep>.name;\n+```\n+\n+## Drops\n+\n+We can even add and/or remove mob drops, isn't that great?\n+\n+### Add normal Drop\n+\n+This adds a normal drop, a drop that can occur whenever the mob is killed by whatever means.\n+```\n+val entity = <entity:sheep>;\n+\n+//addDrop(item,min,max);\n+entity.addDrop(<minecraft:apple>);\n+```\n+\n+`item` is the item to be added as drop and an IItemStack.\n+`min` is the minimum amount that is dropped and an Integer. This is optional.\n+`max` is the maximum amount that is dropped and an Integer. This is optional.\n+\n+### Add playeronly drop\n+\n+Same as normal drops, but only if the entity was killed by a player.\n+```\n+entity.addPlayerOnlyDrop(<minecraft:gold_ingot>, 10,64);\n+```\n+\n+### Remove\n+\n+This removes a drop.\n+```\n+val entity = <entity:sheep>;\n+\n+//remove(item);\n+entity.remove(<minecraft:wool>);\n+```\n+`item` is the item to be removed from being a drop and an IItemStack.\n\\ No newline at end of file\n"
},
{
"change_type": "RENAME",
"old_path": "docs/AdvancedFunctions/Variable_Types.md",
"new_path": "docs/Vanilla/Variable_Types/Variable_Types.md",
"diff": ""
},
{
"change_type": "MODIFY",
"old_path": "mkdocs.yml",
"new_path": "mkdocs.yml",
"diff": "@@ -18,14 +18,17 @@ pages:\n- Contional Statements: 'AdvancedFunctions/Conditional_Statements.md'\n- Custom Functions: 'AdvancedFunctions/Custom_Functions.md'\n- Import: 'AdvancedFunctions/Import.md'\n- - Variable Types: 'AdvancedFunctions/Variable_Types.md'\n- Vanilla:\n- Brackets:\n- Items: 'Vanilla/Brackets/Bracket_Item.md'\n+ - Entities: 'Vanilla/Brackets/Bracket_Entity.md'\n- Recipes:\n- Crafting Table Recipes: 'Vanilla/Recipes/Recipes_Crafting_Table.md'\n- Furnace Recipes: 'Vanilla/Recipes/Recipes_Furnace.md'\n- Seed Drops: 'Vanilla/Recipes/Seeds.md'\n+ - Variable Types:\n+ - Types Overview: 'Vanilla/Variable_Types/Variable_Types.md'\n+ - IEntityDefinition: 'Vanilla/Variable_Types/IEntityDefinition.md'\n- Mods:\n- Modtweaker:\n- Modtweaker: 'Mods/Modtweaker/Modtweaker.md'\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Moved Variable Types and Added IEntityDefinition |
139,040 | 22.07.2017 17:03:57 | -7,200 | 6d48a904a860d62d62c66f108517159a79bf3bb2 | Typo and refined example | [
{
"change_type": "MODIFY",
"old_path": "docs/Vanilla/Brackets/Bracket_Entity.md",
"new_path": "docs/Vanilla/Brackets/Bracket_Entity.md",
"diff": "@@ -10,7 +10,7 @@ Entities are referenced in the Entity handler this way:\n<entity:sheep>\n```\n-If the mob/entity is found, thiw will return an IEntityDefinition Object.\n+If the mob/entity is found, this will return an IEntityDefinition Object.\nPlease refer to the respective Wiki entry for further information on what you can do with these.\n# Getting all Registered Entities\n"
},
{
"change_type": "MODIFY",
"old_path": "docs/Vanilla/Variable_Types/IEntityDefinition.md",
"new_path": "docs/Vanilla/Variable_Types/IEntityDefinition.md",
"diff": "@@ -17,6 +17,7 @@ What can we do with it, now that we created that thing?\nReturns the ID as string\n```\n+//returns \"net.minecraft.entity.passive.EntitySheep\"\n<entity:sheep>.id;\n```\n@@ -24,6 +25,7 @@ Returns the ID as string\nReturns the name as string\n```\n+//returns \"Sheep\"\n<entity:sheep>.name;\n```\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Typo and refined example |
139,040 | 22.07.2017 18:05:04 | -7,200 | af0a0cf50fd3b6e968b64c77248b48aaccaba5f3 | Added IItemStack entry | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "docs/Vanilla/Variable_Types/IItemStack.md",
"diff": "+# IItemStack\n+\n+An IItemStack Object consists of an item definition, a meta/damage value and NBT data.\n+In other words, it refers an item or a block.\n+\n+## Calling an IItemStack\n+Usually, the bracket handler returns an IItemStack Object, unless told not to do so.\n+`<minecraft:apple>` returns an IItemStack.\n+\n+\n+## Functions\n+So what can we do with that now?\n+\n+### Definition\n+Returns the item definition as IItemDefinition Object. Refer to the specific page for further information.\n+```\n+<minecraft:apple>.definition;\n+```\n+\n+### Name\n+Returns the unlocalized item name.\n+\n+```\n+<minecraft:apple>.name;\n+```\n+\n+### Display Name\n+\n+The display name can either be retrieved or set, depending on what you are trying to accomplish.\n+\n+```\n+val apple = <minecraft:apple>;\n+\n+//prints \"Apple\"\n+print(apple.displayName);\n+\n+//Sets apples Display Name to \"Tomato\"\n+apple.displayName = \"Tomato\";\n+\n+//prints \"Tomato\"\n+print(apple.displayName);\n+```\n+\n+### Maximum Stack Size\n+The maximum Stack Size is how many items fit in one Stack, for example, wool's Stack size is 64 and Buckets' only 16.\n+The Stack Size can either be retrieved or set, depending on what you are trying to accomplish.\n+\n+```\n+val apple = <minecraft:apple>;\n+val bucket = <minecraft:bucket>;\n+\n+//prints 64\n+print(apple.maxStackSize);\n+\n+//sets apples Max Stack size to 32\n+apple.maxStackSize = 32;\n+\n+//prints 32\n+print(apple.maxStackSize);\n+\n+//sets apples Max Stack size to Bucket's Max Stack size\n+apple.maxStackSize = bucket.maxStackSize;\n+\n+//prints 16\n+print(apple.maxStackSize);\n+```\n+\n+### Hardness\n+The Hardness is how long it takes to break the referred block. Only works if the object refers to a block.\n+The Hardness can either be retrieved or set, depending on what you are trying to accomplish.\n+\n+```\n+val grass = <minecraft:grass>;\n+\n+//prints 1.0\n+print(grass.hardness);\n+\n+//sets grass Hardness to 10.0\n+grass.hardness = 10.0;\n+\n+//prints 10.0\n+print(grass.hardness);\n+```\n+\n+### Damage\n+Returns the item Damage or 0 if the item cannot be damaged.\n+```\n+<minecraft:apple>.damage;\n+```\n+\n+### Maximum Damage\n+The Maximum Damage can either be retrieved or set, depending on what you are trying to accomplish.\n+\n+```\n+val pick = <minecraft:diamond_pickaxe>;\n+\n+//prints 1561\n+print(pick.maxDamage);\n+\n+//sets grass Hardness to 256\n+pick.maxDamage = 256;\n+\n+//prints 256\n+print(pick.maxDamage);\n+```\n+\n+### Tag\n+Returns the NBT-Data. Empty if no NBT Data contained, never null.\n+```\n+<minecraft:apple>.tag;\n+```\n+#### Add Tag\n+You can also create items with a specific or empty tag using:\n+```\n+//creates apple with the given tag\n+<minecraft:apple>.withTag(tag);\n+\n+//creates apple with an emtpy tag\n+<minecraft:apple>.withEmptyTag();\n+```\n+`tag` is an IData Object.\n+\n+#### Remove Tags\n+You can also remove tags\n+```\n+item.removeTag(tag);\n+```\n+`tag` is an IData Object.\n+\n+\n+### Liquid\n+Returns the liquid contained in a single item (if multiple) or null if the item is no container.\n+Returns an ILiquidStack Object or null.\n+\n+```\n+val lav = <minecraft:lava_bucket>;\n+print(lav.liquid.name);\n+```\n+\n+### Amount\n+Returns the same itemStack but with another amount\n+\n+#### Any Amount\n+\n+Returns a wildcard Stack Size\n+```\n+<minecraft:apple>.anyAmount();\n+```\n+\n+#### Specific amount\n+```\n+//1 Apple\n+val apple = <minecraft:apple>;\n+\n+//2 Apples\n+val moreApples = apple * 2;\n+\n+//3 Apples\n+val evenMoreApples = <minecraft:apple> * 3;\n+```\n+\n+### Weight\n+Returns a weightedItemStack with the provided percentage\n+\n+```\n+val apple = <minecraft:apple>;\n+\n+//Creates a weightedItemStack with 100 percent chance\n+var applePercentage = apple % 100;\n+\n+//Does the same as te above\n+applePercentage = apple.weight(1.0);\n+```\n+\n+### Damage\n+\n+#### AnyDamage\n+Returns an IIngredient with wildcard damage. Only useful for items used as crafting ingredients.\n+```\n+<minecraft:iron_pickaxe>.anyDamage();\n+```\n+\n+#### WithDamage\n+Returns an IItemStack with the given Damage.\n+```\n+<minecraft:iron_pickaxe>.withDamage(122);\n+```\n+\n+### Ores\n+Returns a List of IOreDictEntries referring to this item.\n+```\n+<minecraft:apple>.ores;\n+\n+### As IBlock\n+You can cast an IItemStack to an IBlock, as long as you are referring to a block, otherwise the cast results in null.\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "mkdocs.yml",
"new_path": "mkdocs.yml",
"diff": "@@ -29,6 +29,7 @@ pages:\n- Variable Types:\n- Types Overview: 'Vanilla/Variable_Types/Variable_Types.md'\n- IEntityDefinition: 'Vanilla/Variable_Types/IEntityDefinition.md'\n+ - IItemStack: 'Vanilla/Variable_Types/IItemStack.md'\n- Mods:\n- Modtweaker:\n- Modtweaker: 'Mods/Modtweaker/Modtweaker.md'\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Added IItemStack entry |
139,040 | 22.07.2017 18:20:13 | -7,200 | 78cb9683a277058b45995d31a5e899d0fb5ec223 | Updated Variable_Types.md
Put examples in '`' as readTheDocs.io was doing things | [
{
"change_type": "MODIFY",
"old_path": "docs/Vanilla/Variable_Types/Variable_Types.md",
"new_path": "docs/Vanilla/Variable_Types/Variable_Types.md",
"diff": "@@ -38,18 +38,18 @@ recipes.remove(test);\nHere's an (incomplete) List of most variable types\n| Name (Name in CT) | Explanation | Example | Import |\n-|---------------------------|---------------------------------------------------------------------------------------------------------|----------------------------------------------|------------------------------------------|\n-| Integer (int) | Integers are whole Numbers (e.g. 1,2,3,...), caps at 2 147 483 647 | var test = 10 as int; | |\n-| IItemStack | Single items | var test = <minecraft:dirt> as IItemStack; | import crafttweaker.item.IItemStack; |\n-| IIngredient | Single or Multiple Items (e.g. <minecraft:dirt>, <ore:ingotIron>,...) | var test = <minecraft:dirt> as IIngredient; | import crafttweaker.item.IIngredient; |\n-| IOreDictEntry | Multiple Items from an OreDict (e.g. <ore:ingotIron>, <ore:ingotGold>,...) | var test = <ore:ingotIron> as IOreDictionary | import crafttweaker.oredict.IOreDictEntry|\n-| Boolean (bool) | Booleans are either true or false. | var test = false as bool; | |\n-| Byte (byte) | Bytes values are whole numbers from 0 to 255 () | var test = 125 as byte; | |\n-| Floating Point (float) | Decimals | var test = 1.25 as float; | |\n-| Double Precision (double) | Like Floating Points, just more precise and with a higher number range | var test = 1.25 as double; | |\n-| Long (long) | Like Integer, but with a higher number range (usually int is just fine) | var test = 30 as long; | |\n-| Null (null) | Null, nothing, nada. Not really a type but still useful | var test = null; | |\n-| Short (short) | Like Integer, but with a smaller number Range | var test = 16 as short; | |\n-| String (string) | A string is a text. Here you usually won't need the \"as\" as anything in \"s is automatically a string. | var test = \"Hello World!\" as string; | |\n-| Void (void) | Even less than null. You will probably only need the void type when dealing with functions | var test as void; | |\n-| ILiquidStack | Same as IItemStack, only for liquids | var test = <liquid:water> as ILiquidStack; | import crafttweaker.liquid.ILiquidStack; |\n+|---------------------------|---------------------------------------------------------------------------------------------------------|------------------------------------------------|------------------------------------------|\n+| Integer (int) | Integers are whole Numbers (e.g. 1,2,3,...), caps at 2 147 483 647 | `var test = 10 as int;` | |\n+| IItemStack | Single items | `var test = <minecraft:dirt> as IItemStack;` | import crafttweaker.item.IItemStack; |\n+| IIngredient | Single or Multiple Items (e.g. <minecraft:dirt>, <ore:ingotIron>,...) | `var test = <minecraft:dirt> as IIngredient;` | import crafttweaker.item.IIngredient; |\n+| IOreDictEntry | Multiple Items from an OreDict (e.g. <ore:ingotIron>, <ore:ingotGold>,...) | `var test = <ore:ingotIron> as IOreDictionary;`| import crafttweaker.oredict.IOreDictEntry|\n+| Boolean (bool) | Booleans are either true or false. | `var test = false as bool;` | |\n+| Byte (byte) | Bytes values are whole numbers from 0 to 255 () | `var test = 125 as byte;` | |\n+| Floating Point (float) | Decimals | `var test = 1.25 as float;` | |\n+| Double Precision (double) | Like Floating Points, just more precise and with a higher number range | `var test = 1.25 as double;` | |\n+| Long (long) | Like Integer, but with a higher number range (usually int is just fine) | `var test = 30 as long;` | |\n+| Null (null) | Null, nothing, nada. Not really a type but still useful | `var test = null;` | |\n+| Short (short) | Like Integer, but with a smaller number Range | `var test = 16 as short;` | |\n+| String (string) | A string is a text. Here you usually won't need the \"as\" as anything in \"s is automatically a string. | `var test = \"Hello World!\" as string;` | |\n+| Void (void) | Even less than null. You will probably only need the void type when dealing with functions | `var test as void;` | |\n+| ILiquidStack | Same as IItemStack, only for liquids | `var test = <liquid:water> as ILiquidStack;` | import crafttweaker.liquid.ILiquidStack; |\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Updated Variable_Types.md
Put examples in '`' as readTheDocs.io was doing things |
139,058 | 22.07.2017 22:30:01 | 14,400 | 31270f303aa8f96174070ad5143f94e850bd67db | Better With Mods Compatibility | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "docs/Mods/Modtweaker/BetterWithMods/Anvil.md",
"diff": "+# Anvil\n+\n+The Anvil is a simple 4x4 Crafting Table with the same options.\n+\n+## Shaped\n+\n+### Addition\n+```\n+mods.betterwithmods.Anvil.addShaped(IItemStack output, IIngredient[][] inputs);\n+\n+mods.betterwithmods.Anvil.addShaped(<minecraft:dirt>, [\n+ [<minecraft:stone>,<minecraft:stone>,<minecraft:stone>,<minecraft:stone>],\n+ [<minecraft:stone>,<minecraft:stone>,<minecraft:stone>,<minecraft:stone>],\n+ [<minecraft:stone>,<minecraft:stone>,<minecraft:stone>,<minecraft:stone>],\n+ [<minecraft:stone>,<minecraft:stone>,<minecraft:stone>,<minecraft:stone>]\n+]);\n+```\n+\n+### Removal\n+\n+```\n+mods.betterwithmods.Anvil.removeShaped(IItemStack output, @Optional IIngredient[][] inputs);\n+\n+mods.betterwithmods.Anvil.removeShaped(<minecraft:dirt>);\n+\n+mods.betterwithmods.Anvil.removeShaped(<minecraft:dirt>,[[<minecraft:stone>]]);\n+\n+```\n+\n+## Shapeless\n+\n+### Addition\n+\n+```\n+mods.betterwithmods.Anvil.addShapeless(IItemStack output, IIngredient[] inputs);\n+\n+mods.betterwithmods.Anvil.addShapeless(<minecraft:dirt>, [\n+<minecraft:dirt>,<minecraft:dirt>,<minecraft:dirt>,<minecraft:dirt>,\n+<minecraft:dirt>,<minecraft:dirt>,<minecraft:dirt>,<minecraft:dirt>,\n+<minecraft:dirt>,<minecraft:dirt>,<minecraft:dirt>,<minecraft:dirt>,\n+<minecraft:dirt>,<minecraft:dirt>,<minecraft:dirt>,<minecraft:dirt>\n+]);\n+```\n+\n+### Removal\n+\n+```\n+mods.betterwithmods.Anvil.removeShapeless(IItemStack output, @Optional IIngredient[] inputs);\n+\n+mods.betterwithmods.Anvil.removeShapeless(<minecraft:dirt>);\n+\n+mods.betterwithmods.Anvil.removeShapeless(<minecraft:dirt>, [\n+<minecraft:dirt>,<minecraft:dirt>,<minecraft:dirt>,<minecraft:dirt>,\n+<minecraft:dirt>,<minecraft:dirt>,<minecraft:dirt>,<minecraft:dirt>,\n+<minecraft:dirt>,<minecraft:dirt>,<minecraft:dirt>,<minecraft:dirt>,\n+<minecraft:dirt>,<minecraft:dirt>,<minecraft:dirt>,<minecraft:dirt>\n+]);\n+```\n+\n+\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "docs/Mods/Modtweaker/BetterWithMods/Buoyancy.md",
"diff": "+# Buoyancy\n+\n+Buoyancy effects the ability for an Item to float on water when HCBuoy is enabled in BWM.\n+\n+Value can be a decimal between -1 and 1 where -1 sinks directly to the bottom, 0 reaches equilibrium, 1 floats on top.\n+\n+```\n+mods.betterwithmods.Buoyancy.set(IItemStack stack, float value);\n+\n+```\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "docs/Mods/Modtweaker/BetterWithMods/Cauldron.md",
"diff": "+# Cauldron\n+\n+## Addition\n+\n+```\n+mods.betterwithmods.Cauldron.add(IItemStack input, @Optional IItemStack secondaryOutput, IIngredient[] inputs);\n+\n+mods.betterwithmods.Cauldron.add(<minecraft:dirt>,<minecraft:dirt:1>,[<minecraft:stone>]);\n+\n+mods.betterwithmods.Cauldron.add(<minecraft:dirt>,[<minecraft:stone>]);\n+\n+```\n+\n+## Removal\n+\n+```\n+mods.betterwithmods.Cauldron.remove(IItemStack input, @Optional IIngredient[] inputs);\n+\n+mods.betterwithmods.Cauldron.remove(<minecraft:dirt>,[<minecraft:stone>]);\n+\n+mods.betterwithmods.Cauldron.remove(<minecraft:dirt>);\n+\n+```\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "docs/Mods/Modtweaker/BetterWithMods/Crucible.md",
"diff": "+# Crucible\n+\n+## Addition\n+\n+```\n+mods.betterwithmods.Crucible.add(IItemStack input, @Optional IItemStack secondaryOutput, IIngredient[] inputs);\n+\n+mods.betterwithmods.Crucible.add(<minecraft:dirt>,<minecraft:dirt:1>,[<minecraft:stone>]);\n+\n+mods.betterwithmods.Crucible.add(<minecraft:dirt>,[<minecraft:stone>]);\n+\n+```\n+\n+## Removal\n+\n+```\n+mods.betterwithmods.Crucible.remove(IItemStack input, @Optional IIngredient[] inputs);\n+\n+mods.betterwithmods.Crucible.remove(<minecraft:dirt>,[<minecraft:stone>]);\n+\n+mods.betterwithmods.Crucible.remove(<minecraft:dirt>);\n+\n+```\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "docs/Mods/Modtweaker/BetterWithMods/Kiln.md",
"diff": "+# Kiln\n+\n+The Kiln ONLY takes blocks as inputs, all IItemStack input MUST be that of a place-able block.\n+\n+## Addition\n+\n+```\n+mods.betterwithmods.Kiln.add(IItemStack[] output, IItemStack input);\n+\n+mods.betterwithmods.Kiln.add([<minecraft:diamond>,<minecraft:coal>], <minecraft:coal_ore>);\n+```\n+\n+## Removal\n+\n+```\n+mods.betterwithmods.Kiln.remove(IItemStack input);\n+\n+mods.betterwithmods.Kiln.remove(<minecraft:cobblestone>);\n+```\n+\n+## Structure Block\n+\n+The Kiln is a multiblock based on the block it is made of; This allows registering a block that can be used to create the structure.\n+\n+Input MUST be a _Block_\n+\n+```\n+ mods.betterwithmods.Kiln.registerBlock(IItemStack input);\n+\n+ mods.betterwithmods.Kiln.registerBlock(<minecraft:stonebrick>);\n+```\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "docs/Mods/Modtweaker/BetterWithMods/Mill.md",
"diff": "+# Mill\n+\n+## Addition\n+\n+```\n+mods.betterwithmods.Mill.add(IItemStack input, @Optional IItemStack secondaryOutput, IIngredient[] inputs);\n+\n+mods.betterwithmods.Mill.add(<minecraft:dirt>,<minecraft:dirt:1>,[<minecraft:stone>]);\n+\n+mods.betterwithmods.Mill.add(<minecraft:dirt>,[<minecraft:stone>]);\n+\n+```\n+\n+## Removal\n+\n+```\n+mods.betterwithmods.Mill.remove(IItemStack input, @Optional IIngredient[] inputs);\n+\n+mods.betterwithmods.Mill.remove(<minecraft:dirt>,[<minecraft:stone>]);\n+\n+mods.betterwithmods.Mill.remove(<minecraft:dirt>);\n+\n+```\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "docs/Mods/Modtweaker/BetterWithMods/Saw.md",
"diff": "+# Saw\n+\n+The Saw ONLY takes _Blocks_ as inputs, all IItemStack input MUST be that of a place-able _Block_.\n+\n+## Addition\n+\n+```\n+mods.betterwithmods.Saw.add(IItemStack[] output, IItemStack input);\n+\n+mods.betterwithmods.Saw.add([<minecraft:stick>,<minecraft:stick>], <minecraft:fence>);\n+```\n+\n+## Removal\n+\n+```\n+mods.betterwithmods.Saw.remove(IItemStack input);\n+\n+mods.betterwithmods.Saw.remove(<minecraft:oak_plank>);\n+```\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "docs/Mods/Modtweaker/BetterWithMods/StokedCauldron.md",
"diff": "+# StokedCauldron\n+\n+## Addition\n+\n+```\n+mods.betterwithmods.StokedCauldron.add(IItemStack input, @Optional IItemStack secondaryOutput, IIngredient[] inputs);\n+\n+mods.betterwithmods.StokedCauldron.add(<minecraft:dirt>,<minecraft:dirt:1>,[<minecraft:stone>]);\n+\n+mods.betterwithmods.StokedCauldron.add(<minecraft:dirt>,[<minecraft:stone>]);\n+\n+```\n+\n+## Removal\n+\n+```\n+mods.betterwithmods.StokedCauldron.remove(IItemStack input, @Optional IIngredient[] inputs);\n+\n+mods.betterwithmods.StokedCauldron.remove(<minecraft:dirt>,[<minecraft:stone>]);\n+\n+mods.betterwithmods.StokedCauldron.remove(<minecraft:dirt>);\n+\n+```\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "docs/Mods/Modtweaker/BetterWithMods/StokedCrucible.md",
"diff": "+# StokedCrucible\n+\n+## Addition\n+\n+```\n+mods.betterwithmods.StokedCrucible.add(IItemStack input, @Optional IItemStack secondaryOutput, IIngredient[] inputs);\n+\n+mods.betterwithmods.StokedCrucible.add(<minecraft:dirt>,<minecraft:dirt:1>,[<minecraft:stone>]);\n+\n+mods.betterwithmods.StokedCrucible.add(<minecraft:dirt>,[<minecraft:stone>]);\n+\n+```\n+\n+## Removal\n+\n+```\n+mods.betterwithmods.StokedCrucible.remove(IItemStack input, @Optional IIngredient[] inputs);\n+\n+mods.betterwithmods.StokedCrucible.remove(<minecraft:dirt>,[<minecraft:stone>]);\n+\n+mods.betterwithmods.StokedCrucible.remove(<minecraft:dirt>);\n+\n+```\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "docs/Mods/Modtweaker/BetterWithMods/Turntable.md",
"diff": "+# Turntable\n+\n+The Turntable ONLY takes _Blocks_ as inputs, all IItemStack input MUST be that of a place-able _Block_.\n+\n+The Turntable transforms one block into another and outputs scraps items on transforming\n+## Addition\n+\n+```\n+mods.betterwithmods.Turntable.add(IItemStack inputBlock, IItemStack outputBlock, @Optional IItemStack[] scraps);\n+\n+mods.betterwithmods.Turntable.add(<minecraft:gravel>,<minecraft:sand>,[<minecraft:flint>]);\n+```\n+\n+## Removal\n+\n+```\n+mods.betterwithmods.Turntable.remove(IItemStack input);\n+\n+mods.betterwithmods.Turntable.remove(<minecraft:clay>);\n+```\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Better With Mods Compatibility |
139,058 | 23.07.2017 09:34:23 | 14,400 | d6bf609611de174d380691a0b2fa00ff92b6b05c | Add new files to mkdocs.yml | [
{
"change_type": "MODIFY",
"old_path": "mkdocs.yml",
"new_path": "mkdocs.yml",
"diff": "@@ -41,7 +41,16 @@ pages:\n- Pulverizer: 'Mods/Modtweaker/ThermalExpansion/Pulverizer.md'\n- Refinery: 'Mods/Modtweaker/ThermalExpansion/Refinery.md'\n- Sawmill: 'Mods/Modtweaker/ThermalExpansion/Sawmill.md'\n-\n+ - BetterWithMods:\n+ - Anvil: 'Mods/Modtweaker/BetterWithMods/Anvil.md'\n+ - Cauldron: 'Mods/Modtweaker/BetterWithMods/Cauldron.md'\n+ - Stoked Cauldron: 'Mods/Modtweaker/BetterWithMods/StokedCauldron.md'\n+ - Crucible: 'Mods/Modtweaker/BetterWithMods/Crucible.md'\n+ - Stoked Crucible: 'Mods/Modtweaker/BetterWithMods/StokedCrucible.md'\n+ - Saw: 'Mods/Modtweaker/BetterWithMods/Saw.md'\n+ - Kiln: 'Mods/Modtweaker/BetterWithMods/Kiln.md'\n+ - Turntable: 'Mods/Modtweaker/BetterWithMods/Turntable.md'\n+ - Buoyancy: 'Mods/Modtweaker/BetterWithMods/Buoyancy.md'\n# Do not edit in PRs below here\nsite_name: Crafttweaker Documentation\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Add new files to mkdocs.yml |
139,040 | 23.07.2017 16:09:15 | -7,200 | a8dba6b56f1809306dbb167253a8bc2346b27035 | Added IIngredient Page | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "docs/Vanilla/Variable_Types/IIngredient.md",
"diff": "+# IIngredient\n+\n+An IIngredient is an ingredient for recipes.\n+This could be an item, an ore dictionary entry, a liquid and much more.\n+\n+## Importing the IIngredient package\n+\n+Usually, you won't need this, but in some cases recipes won't work until you import the IIngredient package.\n+You can do this using the following import:\n+```\n+import crafttweaker.item.IIngredient;\n+```\n+\n+## Functions\n+So, what can we do with this?\n+\n+### Mark\n+\n+You can mark an IIngredient so you can later use it in crafting functions.\n+You can also retrieve the mark applied earlier.\n+\n+```\n+//Marks the pick with the String Picky\n+//item.marked(name) <-- Name is a string!\n+val markedPick = <minecraft:diamond_pickaxe>.marked(\"Picky\");\n+\n+//prints \"Picky\"\n+print(markedPick.mark);\n+```\n+\n+### Amount\n+\n+If you want to use more than one of a given item, you can set an amount to an IIngredient.\n+This is as easy as multiplying the IIngredient with an integer.\n+Retrieveing the amount is also possible.\n+```\n+val multipleApples = <minecraft:apple> * 3;\n+\n+//prints 3\n+print(multipleApples.amount);\n+```\n+\n+### OR-ing an IIngredient\n+Sometimes you want either IIngredient X or Y, but don't want to create a recipe for each possibility?\n+That's why there's the OR Method for IIngredients:\n+```\n+val item1 = <minecraft:apple>;\n+val item2 = <minecraft:carrot>;\n+\n+val either = item1 | item2;\n+val either2 = item1.or(item2);\n+```\n+\n+One word of advice though:\n+Using the OR methods is not adviced, as JEI does not display these recipes and sometimes the inputs won't even be consumed!\n+\n+\n+### Get Possible Items or Liquids\n+\n+Sometimes an IIngredient represents more than one item, for example if you are using an OreDictEntry or if you OR-ed two Ingredients.\n+You can get all possible items for this IIngredient in an IItemStack List using the first function.\n+Same goes for liquids in the second function, only they return an ILiquidStack List.\n+\n+```\n+//Returns an IItemStack List\n+//possible items: All iron ingots and the gold ingot from MC\n+val itemsIngredient = <ore:ingotIron> | <minecraft:gold_ingot>;\n+\n+\n+//Returns an ILiquidStack List|\n+//possible liquids: Lava and Water\n+val liquidsIngredient = <liquid:lava> | <liquid:water>;\n+\n+\n+for item in itemsIngredient.items{\n+ //Prints each possible item's Display name\n+ print(item.displayName);\n+}\n+\n+for liquid in liquidsIngredient.liquids{\n+ //Prints each possible liquid's Display name\n+ print(liquid.displayName);\n+}\n+```\n+\n+### Transform an IIngredient upon crafting\n+Sometimes you want an item not to be consumed upon crafting but instead receive damaged or give back a completely different item.\n+This is what item Transformers are there for.\n+\n+```\n+\n+val item = <minecraft:apple>;\n+\n+//Item won't be consumed and stays in the crafting slot.\n+var transformedItem = item.reuse();\n+\n+//Item won't be consumed but will be placed in your inventory upon crafting.\n+transformedItem = item.giveBack();\n+\n+//item will be consumed but will return the specified item to your inventory upon crafting.\n+transformedItem = item.giveBack(<minecraft:potato>);\n+\n+//item will be replaced with the specified item, which will instead go to the crafting slot\n+transformedItem = item.transformReplace(<minecraft:potato>);\n+\n+//damages the item by 1\n+transformedItem = item.transformDamage();\n+\n+//damages the item by the given value\n+transformedItem = item.transformDamage(3);\n+\n+//item will be consumed, no matter what.\n+transformedItem = item.noReturn();\n+\n+//Causes multiple items to be consumed.\n+transformedItem = item.transformConsume(3);\n+```\n+\n+### Ingredient Conditions\n+Sometimes you want your ingredient to have a specific tag or to only work if (not) damaged.\n+These Conditions can be added to your Ingredients using the following:\n+\n+```\n+val item = <minecraft:apple>;\n+\n+//Item will only be accepted with at least 1 point damage\n+var conditionedItem = item.onlyDamaged();\n+\n+//Item will only be accepted with at least the specified damage points\n+conditionedItem = item.onlyDamageAtLeast(10);\n+\n+//Item will only be accepted with at most the specified damage points\n+conditionedItem = item.onlyDamageAtMost(100);\n+\n+//Item will only be accepted with damage points greater or equal as the first and lesser or equal as the 2nd Integer.\n+conditionedItem = item.onlyDamageBetween(10,100);\n+\n+//Item will only be accepted with the specified Tag. The item may have more/other tags than specified, those are ignored when checked.\n+conditionedItem = item.onlyWithTag({display: {Name: \"Tomato\"}});\n+\n+//Item will only be accepted if in a Stack of at least the specified amount. Mostly used in combination with the consume transformer.\n+//Note that if you only add this, you will still require only one item per craft.\n+conditionedItem = item.onlyStack(32);\n+```\n+\n+### Matching\n+If you want to check if an IItemStack matches your IIngredient you can use the match method. This will return a boolean.\n+If the IIngredient represents a liquid, it will check if the item is a valid container for this liquid.\n+\n+```\n+print(<ore:ingotIron>.matches(<minecraft:iron_ingot>));\n+print(<ore:ingotIron>.matchesExact(<minecraft:iron_ingot>));\n+```\n+You can also match two IIngredient Objects, in which case you'd need to use the in operator:\n+\n+```\n+val ingots = <minecraft:iron_ingot> | <minecraft:gold_ingot>;\n+val goldOre = <ore:ingotIron>;\n+val ingotGold = <minecraft:gold_ingot>;\n+\n+\n+//true as the gold ingot is in the ingots Ingredient\n+ingots in ingotGold;\n+\n+//false as <minecraft:iron_ingot> cannot be found in <ore:ingotGold>\n+goldOre in ingots;\n+```\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "docs/Vanilla/Variable_Types/IItemStack.md",
"new_path": "docs/Vanilla/Variable_Types/IItemStack.md",
"diff": "@@ -11,6 +11,10 @@ Usually, the bracket handler returns an IItemStack Object, unless told not to do\n## Functions\nSo what can we do with that now?\n+### IIngredient\n+A bit of Java jargon here: IItemStack is an interface and extends IIngredient. That means that all functions useable for IIngredients also work for IItemStacks, only that they will then return an IIngredient.\n+Please read the IIngredient page for further information on IIngredients.\n+\n### Definition\nReturns the item definition as IItemDefinition Object. Refer to the specific page for further information.\n```\n"
},
{
"change_type": "MODIFY",
"old_path": "mkdocs.yml",
"new_path": "mkdocs.yml",
"diff": "@@ -29,6 +29,7 @@ pages:\n- Variable Types:\n- Types Overview: 'Vanilla/Variable_Types/Variable_Types.md'\n- IEntityDefinition: 'Vanilla/Variable_Types/IEntityDefinition.md'\n+ - IIngredient: 'Vanilla/Variable_Types/IIngredient.md'\n- IItemStack: 'Vanilla/Variable_Types/IItemStack.md'\n- Mods:\n- Modtweaker:\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Added IIngredient Page |
139,040 | 28.07.2017 11:57:22 | -7,200 | 9bd5f9a374eb38da75b9a074452c83a9b0cc5bac | Added Liquid Bracked Handler | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "docs/Vanilla/Brackets/Bracket_Liquid.md",
"diff": "+# Liquid Bracket Handler\n+\n+The liquid Bracket Handler gives you access to the liquids in the game. It is only possible to get liquids registered in the game, so adding or removing mods may cause issues if you reference the mod's liquids in an liquid Bracket Handler.\n+\n+Liquids are referenced in the Liquid Bracket Handler by like so:\n+\n+```\n+<liquid:liquidname>\n+<liquid:lava>\n+```\n+\n+If the liquid is found, this will return an ILiquidStack Object.\n+Please refer to the respective Wiki entry for further information on what you can do with these.\n+\n+# Getting all Registered liquids\n+\n+You can use the following command to output all registered liquids to the CraftTweaker log\n+```\n+/ct liquids\n+/crafttweaker liquids\n+```\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "mkdocs.yml",
"new_path": "mkdocs.yml",
"diff": "@@ -22,6 +22,7 @@ pages:\n- Brackets:\n- Items: 'Vanilla/Brackets/Bracket_Item.md'\n- Entities: 'Vanilla/Brackets/Bracket_Entity.md'\n+ - Liquids: 'Vanilla/Brackets/Bracket_Liquid'\n- Recipes:\n- Crafting Table Recipes: 'Vanilla/Recipes/Recipes_Crafting_Table.md'\n- Furnace Recipes: 'Vanilla/Recipes/Recipes_Furnace.md'\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Added Liquid Bracked Handler |
139,040 | 28.07.2017 13:29:06 | -7,200 | afdc6d1c54acadbaae7ffec619c17ce1970ceb1b | Added ILiquidStack and ILiquidDefinition | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "docs/Vanilla/Variable_Types/ILiquidStack_ILiquidDefinition.md",
"diff": "+# ILiquidStack\n+\n+A LiquidStack consists of a Liquid Definition as well as an optional tag and an optional amount value.\n+\n+## Creating an ILiquidStack\n+An ILiquidStack can be created by using the Liquid Bracket Handler\n+\n+\n+```\n+//see The liquid bracket Handler for further information\n+val lava = <liquid:lava>;\n+\n+//liquid.withTag(Tag as IData)\n+val lavaWithTag = <liquid:lava>.withTag(DATA);\n+\n+//liquid * amount in millibuckets (-> 1000 = 1 Bucket)\n+val lavaWithAmount = <liquid:lava> * 1000;\n+```\n+\n+## Get fluid properties\n+As an ILiquidStack represents a liquid, here surely must also be a way of retrieving the fluid's properties.\n+Check the table to see what you can retrieve from the ILiquidStack Object using ZenGetters.\n+\n+| Zengetter | What is this? | Return Type | Example |\n+|-------------|-----------------------------------------------------------|-------------------|-------------------------------------|\n+| name | This returns the unlocalized liquid name | string | `test = <liquid:lava>.name;` |\n+| displayName | This returns the localized liquid name | string | `test = <liquid:lava>.displayName;` |\n+| amount | This returns the amount of the ILiquidObject | int | `test = <liquid:lava>.amount;` |\n+| luminosity | This returns the luminosity of the referred liquid | int | `test = <liquid:lava>.luminosity;` |\n+| density | This returns the density of the referred liquid | int | `test = <liquid:lava>.density;` |\n+| temperature | This returns the temperature of the referred liquid | int | `test = <liquid:lava>.temperature;` |\n+| viscosity | This returns the viscosity of the referred liquid | int | `test = <liquid:lava>.viscosity;` |\n+| gaseous | This returns whether the referred liquid is gaseous | boolean | `test = <liquid:lava>.gaseous;` |\n+| tag | This returns the ILiquidObject's tag | IData | `test = <liquid:lava>.tag;` |\n+| definition | This returns the referred liquid's definition (see below) | ILiquidDefinition | `test = <liquid:lava>.definition;` |\n+\n+# ILiquidDefinition\n+The ILiquidDefinition is the earlier mentioned definition an ILiquidStack consists of.\n+Unlike the ILiquidStack, this interface allows you to change fluid properties.\n+\n+## Methods\n+So, what can we do with it?\n+\n+### Multiplication\n+Multiplying a ILiquidDefinition results in a new ILiquidStack with the specified amount in millibuckets\n+\n+```\n+val def = <liquid:lava>.definition;\n+\n+//essentially the same\n+val bucketOfLava = def * 1000;\n+val bucketOfLava1 = <liquid:lava> * 1000;\n+```\n+\n+## Get and Set fluid properties\n+\n+As an ILiquidDefinition represents a liquid, you can get, but also set it's properties.\n+Check the table below for further information.\n+\n+Like in the table above, you set the Zengetter/Setter at the end of the ILiquidDefinition.\n+Some ZenGetters have no according ZenSetter, you will need to rely on other means to alter these properties.\n+\n+```\n+val definition = <liquid:lava>.definition;\n+\n+//Zengetter: luminosity\n+val lavaL = definition.luminosity;\n+\n+//Zensetter: luminosity\n+definition.luminosity = 0;\n+```\n+\n+| Zengetter | Zensetter | What is this? | Return/Set Type |\n+|-------------|-------------|----------------------------------------------------------|------------------|\n+| name | | This returns the unlocalized liquid name | string |\n+| displayName | | This returns the localized liquid name | string |\n+| luminosity | luminosity | This returns/sets the luminosity of the referred liquid | int |\n+| density | density | This returns/sets the density of the referred liquid | int |\n+| temperature | temperature | This returns/sets the temperature of the referred liquid | int |\n+| viscosity | viscosity | This returns/sets the viscosity of the referred liquid | int |\n+| gaseous | gaseous | This returns/sets whether the referred liquid is gaseous | boolean |\n+| containers | | This returns all Containers for the referred liquid | List<IItemStack> |\n+\n+# IIngredient Implementaion\n+Java Jargon: ILiquidStack implements IIngredient. In other words, all methods that can be used in IIngredients can also be used for ILiquidStacks\n+Refer to the IIngredient entry for further information on this.\n+Here are some special cases, as liquids just aren't items\n+\n+* You can't mark ILiquidStacks, and you get null of you try to retrieve an ILiquidStack's mark\n+* .items returns an empty List\n+* .liquids returns this liquid as ILiquidStack (so, exactly this object)\n+* LiquidStacks can't have Transformers and asking for transformers always returns false\n+* LiquidStacks can't have Conditions (.only doesn't work)\n+* Matching with items always returns false\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "mkdocs.yml",
"new_path": "mkdocs.yml",
"diff": "@@ -32,6 +32,7 @@ pages:\n- IEntityDefinition: 'Vanilla/Variable_Types/IEntityDefinition.md'\n- IIngredient: 'Vanilla/Variable_Types/IIngredient.md'\n- IItemStack: 'Vanilla/Variable_Types/IItemStack.md'\n+ - ILiquidStack and ILiquidDefinition: 'Vanilla/Variable_Types/ILiquidStack_ILiquidDefinition.md'\n- Mods:\n- Modtweaker:\n- Modtweaker: 'Mods/Modtweaker/Modtweaker.md'\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Added ILiquidStack and ILiquidDefinition |
139,040 | 28.07.2017 21:10:05 | -7,200 | 4042e9b8e7130161de0191355088cd44a89a786a | Added IGame.md | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "docs/Vanilla/Game/IGame.md",
"diff": "+# Game Class\n+\n+The IGame Class is used to obtain general game information.\n+Can be accessed using `game`\n+\n+## Zengetters\n+\n+| Zengetter | What does it do? | Return Type | Usage |\n+|-----------|-----------------------------------------|--------------------------|-----------------|\n+| items | Returns all registered items as list | List<IItemDefinition> | `game.items` |\n+| blocks | Returns all registered blocks as list | List<IBlockDefinition> | `game.blocks` |\n+| liquids | Returns all registered liquids as list | List<ILiquidDefinition> | `game.liquids` |\n+| biomes | Returns all registered biomes as list | List<IBiomes> | `game.biomes` |\n+| entities | Returns all registered entities as list | List<IEntitiyDefinition> | `game.entities` |\n+| locked | Retrurns if the skript is locked or not | boolean | `game.locked` |\n+\n+## Methods\n+\n+### GetEntity\n+```\n+//getEntity(EntityName)\n+\n+//essentially the same\n+val sheep = game.getEntity(\"sheep\");\n+val sheep1 = <entity:sheep>;\n+```\n+\n+### SetLocalization\n+\n+Sets the localization.\n+All parameters are strings.\n+`game.setLocalization(key, value);`\n+`game.setLocalization(lang, key, value);`\n+\n+### Localize\n+\n+Returns a localized String\n+`game.localize(key)`\n+`game.localize(key, lang)`\n+\n+### Lock\n+Locks the game, so skripts can no longer be reloaded.\n+Only applicable prior to CT 1.12 as CT 1.12 does no longer support reloads.\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "mkdocs.yml",
"new_path": "mkdocs.yml",
"diff": "@@ -23,6 +23,8 @@ pages:\n- Items: 'Vanilla/Brackets/Bracket_Item.md'\n- Entities: 'Vanilla/Brackets/Bracket_Entity.md'\n- Liquids: 'Vanilla/Brackets/Bracket_Liquid'\n+ - Game:\n+ - IGame: 'Vanilla/Game/IGame.md'\n- Recipes:\n- Crafting Table Recipes: 'Vanilla/Recipes/Recipes_Crafting_Table.md'\n- Furnace Recipes: 'Vanilla/Recipes/Recipes_Furnace.md'\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Added IGame.md |
139,040 | 28.07.2017 22:29:53 | -7,200 | d29d4722e5d103df4b28c84d21bdf4d265b219bb | Added Mods Entry | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "docs/Vanilla/Game/Mods.md",
"diff": "+# LoadedMods\n+\n+You can use the keyword `loadedMods` to access all currently loaded mods.\n+\n+## Check if a mod is loaded\n+\n+Use the `in`function to check if a mod is loaded:\n+```\n+//if MinecraftCoderPack is loaded\n+if(loadedMods in \"mcp\"){\n+ print(\"success!\");\n+}\n+```\n+\n+## Retrieve a specific mod\n+You can retrieve a specific mod as IMod as long as you have it's ID\n+\n+```\n+//retrieves the minecraftCoderPack mod\n+val mod = loadedMods[\"mcp\"];\n+```\n+\n+# IMod\n+The IMod Interface provides you with some general information on a specific mod\n+\n+```\n+val mod = loadedMods[\"mcp\"];\n+\n+print(mod.id);\n+print(mod.name);\n+print(mod.version);\n+print(mod.description);\n+```\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "mkdocs.yml",
"new_path": "mkdocs.yml",
"diff": "@@ -25,6 +25,7 @@ pages:\n- Liquids: 'Vanilla/Brackets/Bracket_Liquid'\n- Game:\n- IGame: 'Vanilla/Game/IGame.md'\n+ - Mods: 'Vanilla/Game/Mods.md'\n- Recipes:\n- Crafting Table Recipes: 'Vanilla/Recipes/Recipes_Crafting_Table.md'\n- Furnace Recipes: 'Vanilla/Recipes/Recipes_Furnace.md'\n"
}
] | TypeScript | MIT License | crafttweaker/crafttweaker-documentation | Added Mods Entry |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.