![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
I wrote this as a small practice for some ruby meta-programming fun. The implementation is relatively simple, and is thread safe.
There are also these other two implementations:
Add this line to your application's Gemfile:
gem 'ruby_decorators'
And then execute:
$ bundle
Or install it yourself as:
$ gem install ruby_decorators
class Hi < RubyDecorator
def call(this, *args, &blk)
this.call(*args, &blk).sub('hello', 'hi')
end
end
class Batman < RubyDecorator
def call(this, *args, &blk)
this.call(*args, &blk).sub('world', 'batman')
end
end
class Catwoman < RubyDecorator
def initialize(*args)
@args = args.any? ? args : ['catwoman']
end
def call(this, *args, &blk)
this.call(*args, &blk).sub('world', @args.join(' '))
end
end
class World
extend RubyDecorators
def initialize
@greeting = 'hello world'
end
def hello_world
@greeting
end
+Batman
def hello_batman
@greeting
end
+Hi
+Catwoman
def hello_catwoman
@greeting
end
+Catwoman.new('super', 'catwoman')
def hello_super_catwoman
@greeting
end
end
world = World.new
world.hello_world # => "hello world"
world.hello_batman # => "hello batman"
world.hello_catwoman # => "hi catwoman"
world.hello_super_catwoman # => "hello super catwoman"
Copyright (c) 2012 Fred Wu
Licensed under the MIT license.
FAQs
Unknown package
We found that ruby_decorators demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.