included-in 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG ADDED
@@ -0,0 +1,3 @@
1
+ * v 0.2.0
2
+
3
+ Mimics the way ActiveSupport 3.1 calls the method and organizes the code. Object#included_in? => Object#in?
data/Manifest CHANGED
@@ -1,6 +1,8 @@
1
+ CHANGELOG
1
2
  README.rdoc
2
3
  Rakefile
3
- included-in.gemspec
4
4
  init.rb
5
5
  lib/included_in.rb
6
+ lib/included_in/object.rb
7
+ lib/included_in/object/inclusion.rb
6
8
  Manifest
data/README.rdoc CHANGED
@@ -1,13 +1,15 @@
1
1
  = Included In
2
2
 
3
- Rails gem that adds an included_in? method to Object for a more readable syntax of include?
3
+ Rails gem that adds an in? method to Object for a more readable syntax of include?
4
+
5
+ Mimics the functionality of ActiveSupport 3.1
4
6
 
5
7
  == Install
6
8
 
7
9
  As a gem (with Bundler)
8
10
 
9
- gem "jaredonline-included-in", :git => "git://github.com/jaredonline/included-in.git"
10
-
11
+ gem "included-in", :require => "included_in"
12
+
11
13
  As a plugin (Rails 2.3.x)
12
14
 
13
15
  script/plugin install git://github.com/jaredonline/included-in.git
@@ -34,7 +36,7 @@ It reads "If the array contains this string", when the real question is, "If the
34
36
  str = "test"
35
37
  arr = ["test", "jack", "Three"]
36
38
 
37
- if str.included_in?(arr)
39
+ if str.in?(arr)
38
40
  # do something...
39
41
  else
40
42
  # do something else...
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('included-in', '0.1.0') do |p|
5
+ Echoe.new('included-in', '0.2.0') do |p|
6
6
  p.description = "Adds an included_in? method to Object for a more readable syntax of include?"
7
7
  p.url = "https://github.com/jaredonline/included-in"
8
8
  p.author = "Jared McFarland"
data/included-in.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{included-in}
5
- s.version = "0.1.0"
5
+ s.version = "0.2.0"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Jared McFarland"]
@@ -10,8 +10,8 @@ Gem::Specification.new do |s|
10
10
  s.date = %q{2011-04-13}
11
11
  s.description = %q{Adds an included_in? method to Object for a more readable syntax of include?}
12
12
  s.email = %q{jared.online@gmail.com}
13
- s.extra_rdoc_files = ["README.rdoc", "lib/included_in.rb"]
14
- s.files = ["README.rdoc", "Rakefile", "included-in.gemspec", "init.rb", "lib/included_in.rb", "Manifest"]
13
+ s.extra_rdoc_files = ["CHANGELOG", "README.rdoc", "lib/included_in.rb", "lib/included_in/object.rb", "lib/included_in/object/inclusion.rb"]
14
+ s.files = ["CHANGELOG", "README.rdoc", "Rakefile", "init.rb", "lib/included_in.rb", "lib/included_in/object.rb", "lib/included_in/object/inclusion.rb", "Manifest", "included-in.gemspec"]
15
15
  s.homepage = %q{https://github.com/jaredonline/included-in}
16
16
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Included-in", "--main", "README.rdoc"]
17
17
  s.require_paths = ["lib"]
data/lib/included_in.rb CHANGED
@@ -1,13 +1 @@
1
- module IncludedIn
2
-
3
- def included_in?(object)
4
- raise ArgumentError.new("You must supply an argument that responds to include?") unless object.respond_to?(:include?)
5
-
6
- object.include?(self)
7
- end
8
-
9
- end
10
-
11
- class Object
12
- include IncludedIn
13
- end
1
+ require 'included_in/object'
@@ -0,0 +1 @@
1
+ require "included_in/object/inclusion.rb"
@@ -0,0 +1,14 @@
1
+ class Object
2
+
3
+ def in?(object)
4
+ raise ArgumentError.new("You must supply an argument that responds to include?") unless object.respond_to?(:include?)
5
+
6
+ object.include?(self)
7
+ end
8
+
9
+ def included_in?(object)
10
+ p "DEPRECATION WARNING: Called Object#included_in?, use Object#in? instead. Called from #{Kernel.caller[0]}"
11
+ in?(object)
12
+ end
13
+
14
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: included-in
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 1
8
+ - 2
9
9
  - 0
10
- version: 0.1.0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jared McFarland
@@ -18,22 +18,22 @@ cert_chain:
18
18
  -----BEGIN CERTIFICATE-----
19
19
  MIIDOjCCAiKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBDMRUwEwYDVQQDDAxqYXJl
20
20
  ZC5vbmxpbmUxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkW
21
- A2NvbTAeFw0xMTA0MTQwMDAzMzhaFw0xMjA0MTMwMDAzMzhaMEMxFTATBgNVBAMM
21
+ A2NvbTAeFw0xMTA0MTQwMDQxMTBaFw0xMjA0MTMwMDQxMTBaMEMxFTATBgNVBAMM
22
22
  DGphcmVkLm9ubGluZTEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPy
23
- LGQBGRYDY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyquUkmhF
24
- Kkznbm9xaTnc9IUQ4aumXVaMNDcjffl5B1ERRmDAuc7RxQjExalTsDemHYJ2yE2V
25
- xs7hdSY/86T0SMrFrmGaBfCkhbMxXngpQCnue3b1cjOZRuYlh/Y6etX+eN44H/RD
26
- RICzaKC5UQ1vzGqhJIBEsOEwmRkTptsKjOujtmgpNkm5SenW+MgZmu2nupQrXdYu
27
- hy9ox0hDBZ85HliY10sKLjcUv6VcR0AH8o9Iq5IiOdbe5OScMa4PtQPXfW+9k7pM
28
- YJEKFvzZqQP0E0RfLi0DSKPGWpf0SKx2rJAGRKOlJEBAm3qN/+nBp1rwWjztaLeU
29
- bfE/BUPnKalVXQIDAQABozkwNzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdB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 0frKfw/jfUUnggYYvO9m+u0+tuas6GpwdY+Ll8ybtBMWQ4G8Msc9fY7EWZ3Jm/hK
33
+ 8n5gejpuKC/MpF6bDllerHWpHI/d2csuHL339sJVR13tZamifgHm748/ig6/bO/K
34
+ m1verQa8BF6GC+fpZgfGriyoN8ync3F4wi2T/9koGzio1kotNIWhWtz8Ay/+KppJ
35
+ VFN1Jwb+Xjp/Jea9EZPL03vBfpTp6Z1OuN3MdRK26SaOBfFRdO/7JfKVdGHLWUPO
36
+ ncO2Ggxc146uqG0Yz4o=
37
37
  -----END CERTIFICATE-----
38
38
 
39
39
  date: 2011-04-13 00:00:00 -07:00
@@ -47,15 +47,21 @@ executables: []
47
47
  extensions: []
48
48
 
49
49
  extra_rdoc_files:
50
+ - CHANGELOG
50
51
  - README.rdoc
51
52
  - lib/included_in.rb
53
+ - lib/included_in/object.rb
54
+ - lib/included_in/object/inclusion.rb
52
55
  files:
56
+ - CHANGELOG
53
57
  - README.rdoc
54
58
  - Rakefile
55
- - included-in.gemspec
56
59
  - init.rb
57
60
  - lib/included_in.rb
61
+ - lib/included_in/object.rb
62
+ - lib/included_in/object/inclusion.rb
58
63
  - Manifest
64
+ - included-in.gemspec
59
65
  has_rdoc: true
60
66
  homepage: https://github.com/jaredonline/included-in
61
67
  licenses: []
metadata.gz.sig CHANGED
Binary file