wtf_methods 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/wtf_methods.rb +29 -0
  3. metadata +45 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d74320b058d3f070b13f95dc545f9ac43f7807db
4
+ data.tar.gz: fa2e6145af55fe0b6f6a2c2ab6e6c6f29169246b
5
+ SHA512:
6
+ metadata.gz: 014aee4468f70b3648a0bfe807711209f57a8c2a8285771db8f16c02f41f9d645317a670cbe31f9bb20599873fe5d0aa80676aeb54ba7b37befde8d2f92b916b
7
+ data.tar.gz: 8e7bb19c5bdbc2b0b78bdd0531d074a748f8556e4edcb3c14211240a3a8d610a66c3ef8fbc2189b79a2d4a06317dae066882c7010a2edfccc3a21910e552c24e
@@ -0,0 +1,29 @@
1
+
2
+ module WTF
3
+ def self.[](class_name)
4
+
5
+ method_array = []
6
+
7
+ if defined?(ActiveRecord::Base)
8
+ target_methods = class_name.methods - ActiveRecord::Base.methods
9
+ else
10
+ target_methods = class_name.methods - Object.methods
11
+ end
12
+
13
+ target_methods.sort.each do |method|
14
+ if method_array.first && method[0] >= "a" && method[0] != method_array.last[1]
15
+ method_array << "--------------------"
16
+ end
17
+ method_array << " #{method}"
18
+ end
19
+
20
+ puts "===================="
21
+ if method_array.empty?
22
+ puts " [none]"
23
+ else
24
+ puts method_array
25
+ end
26
+ puts "===================="
27
+
28
+ end
29
+ end
metadata ADDED
@@ -0,0 +1,45 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: wtf_methods
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Stelios Constantinides
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-12-10 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Prints a formatted list of class methods, excluding ActiveRecord::Base
14
+ (when applicable) and generic Object methods.
15
+ email: sconstantinides@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/wtf_methods.rb
21
+ homepage: http://rubygems.org/gems/wtf_methods
22
+ licenses:
23
+ - MIT
24
+ metadata: {}
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubyforge_project:
41
+ rubygems_version: 2.0.6
42
+ signing_key:
43
+ specification_version: 4
44
+ summary: Browse class-specific methods.
45
+ test_files: []