Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/vendor/thor/lib/thor/rake_compat.rb,
lib/vendor/dataflow/dataflow/equality.rb,
lib/vendor/json_pure/lib/json/add/rails.rb
Overview
The purpose of this file is to make equality use method calls in as many Ruby implementations as possible. If method calls are used, then equality operations using dataflow variaables becomes seemless I realize overriding core classes is a pretty nasty hack, but if you have a better idea that also passes the equality_specs then I’m all ears. Please run the rubyspec before committing changes to this file.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
- #namespace(name, &block) ⇒ Object
- #rake_namespace ⇒ Object
- #rake_task ⇒ Object
- #task(*args, &block) ⇒ Object
- #to_json(*a) ⇒ Object
Class Method Details
Instance Method Details
#==(other) ⇒ Object
9 10 11 |
# File 'lib/vendor/dataflow/dataflow/equality.rb', line 9 def ==(other) object_id == other.object_id end |
#namespace(name, &block) ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/vendor/thor/lib/thor/rake_compat.rb', line 55 def namespace(name, &block) if klass = Thor::RakeCompat.rake_classes.last const_name = Thor::Util.camel_case(name.to_s).to_sym klass.const_set(const_name, Class.new(Thor)) new_klass = klass.const_get(const_name) Thor::RakeCompat.rake_classes << new_klass end rake_namespace(name, &block) Thor::RakeCompat.rake_classes.pop end |
#rake_namespace ⇒ Object
34 |
# File 'lib/vendor/thor/lib/thor/rake_compat.rb', line 34 alias :rake_namespace :namespace |
#rake_task ⇒ Object
33 |
# File 'lib/vendor/thor/lib/thor/rake_compat.rb', line 33 alias :rake_task :task |
#task(*args, &block) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/vendor/thor/lib/thor/rake_compat.rb', line 36 def task(*args, &block) task = rake_task(*args, &block) if klass = Thor::RakeCompat.rake_classes.last non_namespaced_name = task.name.split(':').last description = non_namespaced_name description << task.arg_names.map{ |n| n.to_s.upcase }.join(' ') description.strip! klass.desc description, task.comment || non_namespaced_name klass.send :define_method, non_namespaced_name do |*args| Rake::Task[task.name.to_sym].invoke(*args) end end task end |