meta_tools 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. data/Gemfile +3 -0
  2. data/README.md +51 -0
  3. data/VERSION +1 -1
  4. data/lib/meta_tools.rb +3 -0
  5. data/meta_tools.gemspec +18 -0
  6. metadata +14 -11
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source :rubygems
2
+
3
+ gemspec
@@ -0,0 +1,51 @@
1
+ meta_tools
2
+ ==========
3
+
4
+ A Module that simply contains some methods that help out when metaprogramming.
5
+
6
+ Source [Source](http://dannytatom.github.com/metaid/ "Source")
7
+
8
+ Example
9
+ -------
10
+
11
+ ```ruby
12
+ class User
13
+ attr :role, :name
14
+
15
+ def initialize(name, role=:user)
16
+ @name, @role = name, role
17
+
18
+ if role == :admin
19
+ meta_def(:ban) do |user|
20
+ puts "#{user.name} has been banned by #{@name}!"
21
+ end
22
+ end
23
+ end
24
+
25
+ end
26
+
27
+ u1 = User.new("John")
28
+ u2 = User.new("Joe", :admin)
29
+
30
+ u2.ban("Jacob") # => Jacob has been banned by John!
31
+ u1.ban("Jerry") # => NoMethodError
32
+
33
+ ```
34
+
35
+ Contributing to meta_tools
36
+ --------------------------
37
+
38
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
39
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
40
+ * Fork the project
41
+ * Start a feature/bugfix branch
42
+ * Commit and push until you are happy with your contribution
43
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
44
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
45
+
46
+ Copyright
47
+ ---------
48
+
49
+ Copyright (c) 2011 Ryan Lewis. See LICENSE.txt for
50
+ further details.
51
+
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.6
1
+ 0.2.7
@@ -5,6 +5,9 @@ module MetaTools
5
5
  meta_class
6
6
  end
7
7
 
8
+ # Returns the metaclass of the object.
9
+ #
10
+ # @return [Class] the metaclass
8
11
  def meta_class
9
12
  class << self; self; end
10
13
  end
@@ -0,0 +1,18 @@
1
+ Gem::Specification.new do |s|
2
+ s.author = "Ryan Scott Lewis"
3
+ s.email = "c00lryguy@gmail.com"
4
+
5
+ s.name = File.basename(__FILE__, ".gemspec")
6
+ s.description = "A Module that simply contains some methods that help out when metaprogramming."
7
+ s.summary = "Tools for metaprogramming."
8
+ s.homepage = "http://github.com/c00lryguy/#{s.name}"
9
+ s.version = File.read("VERSION")
10
+ s.license = 'MIT'
11
+ s.platform = Gem::Platform::RUBY
12
+ s.require_path = 'lib'
13
+
14
+ s.files = Dir['{{Rake,Gem}file{.lock,},README*,VERSION,LICENSE,*.gemspec,{bin,examples,lib,spec,test}/**/*}']
15
+ s.test_files = Dir['{examples,spec,test}/**/*']
16
+
17
+ s.add_development_dependency("rspec", "~> 2.6.0")
18
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meta_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-12 00:00:00.000000000Z
12
+ date: 2012-04-15 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70276314773540 !ruby/object:Gem::Requirement
16
+ requirement: &70260275405920 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,23 +21,25 @@ dependencies:
21
21
  version: 2.6.0
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70276314773540
24
+ version_requirements: *70260275405920
25
25
  description: A Module that simply contains some methods that help out when metaprogramming.
26
26
  email: c00lryguy@gmail.com
27
27
  executables: []
28
28
  extensions: []
29
- extra_rdoc_files:
30
- - LICENSE
31
- - VERSION
29
+ extra_rdoc_files: []
32
30
  files:
33
- - LICENSE
34
- - VERSION
35
31
  - Rakefile
36
32
  - Gemfile.lock
33
+ - Gemfile
34
+ - README.md
35
+ - VERSION
36
+ - LICENSE
37
+ - meta_tools.gemspec
37
38
  - lib/meta_tools.rb
38
39
  - spec/spec_helper.rb
39
40
  homepage: http://github.com/c00lryguy/meta_tools
40
- licenses: []
41
+ licenses:
42
+ - MIT
41
43
  post_install_message:
42
44
  rdoc_options: []
43
45
  require_paths:
@@ -56,9 +58,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
58
  version: '0'
57
59
  requirements: []
58
60
  rubyforge_project:
59
- rubygems_version: 1.8.6
61
+ rubygems_version: 1.8.10
60
62
  signing_key:
61
63
  specification_version: 3
62
64
  summary: Tools for metaprogramming.
63
65
  test_files:
64
66
  - spec/spec_helper.rb
67
+ has_rdoc: