method_repository 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,9 @@
1
+ language: ruby
2
+
3
+ rvm:
4
+ - 1.9.3
5
+ - 1.9.2
6
+ - ruby-head
7
+ - jruby-19mode
8
+ - rbx-19mode
9
+ - jruby-head
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # MethodRepository
1
+ # MethodRepository [![BuildStatus](https://secure.travis-ci.org/kentaro/method_repository.png)](http://travis-ci.org/kentaro/method_repository)
2
2
 
3
3
  Extracting redandunt code and commonalizing it in a different way.
4
4
 
@@ -61,29 +61,29 @@ qux = Qux.new; qux.extend(Repository)
61
61
  Only explicitely permitted methods are defined as singleton methods of each classes/objects. That results in:
62
62
 
63
63
  ```ruby
64
- Foo.respond_to?(:method1)) #=> true
65
- Bar.respond_to?(:method1)) #=> true
66
- Baz.respond_to?(:method1)) #=> false
67
- Qux.respond_to?(:method1)) #=> false
68
-
69
- Foo.respond_to?(:method2)) #=> false
70
- Bar.respond_to?(:method2)) #=> false
71
- Baz.respond_to?(:method2)) #=> true
72
- Qux.respond_to?(:method1)) #=> false
64
+ Foo.respond_to?(:method1) #=> true
65
+ Bar.respond_to?(:method1) #=> true
66
+ Baz.respond_to?(:method1) #=> false
67
+ Qux.respond_to?(:method1) #=> false
68
+
69
+ Foo.respond_to?(:method2) #=> false
70
+ Bar.respond_to?(:method2) #=> false
71
+ Baz.respond_to?(:method2) #=> true
72
+ Qux.respond_to?(:method2) #=> false
73
73
  ```
74
74
 
75
75
  or
76
76
 
77
77
  ```ruby
78
- foo.respond_to?(:method1)) #=> true
79
- bar.respond_to?(:method1)) #=> true
80
- baz.respond_to?(:method1)) #=> false
81
- qux.respond_to?(:method1)) #=> false
82
-
83
- foo.respond_to?(:method2)) #=> false
84
- bar.respond_to?(:method2)) #=> false
85
- baz.respond_to?(:method2)) #=> true
86
- qux.respond_to?(:method1)) #=> false
78
+ foo.respond_to?(:method1) #=> true
79
+ bar.respond_to?(:method1) #=> true
80
+ baz.respond_to?(:method1) #=> false
81
+ qux.respond_to?(:method1) #=> false
82
+
83
+ foo.respond_to?(:method2) #=> false
84
+ bar.respond_to?(:method2) #=> false
85
+ baz.respond_to?(:method2) #=> true
86
+ qux.respond_to?(:method2) #=> false
87
87
  ```
88
88
 
89
89
  ### Including
@@ -100,15 +100,15 @@ Qux.send(:include, Repository)
100
100
  Results in:
101
101
 
102
102
  ```ruby
103
- Foo.new.respond_to?(:method1)) #=> true
104
- Bar.new.respond_to?(:method1)) #=> true
105
- Baz.new.respond_to?(:method1)) #=> false
106
- Qux.new.respond_to?(:method1)) #=> false
107
-
108
- Foo.new.respond_to?(:method2)) #=> false
109
- Bar.new.respond_to?(:method2)) #=> false
110
- Baz.new.respond_to?(:method2)) #=> true
111
- Qux.new.respond_to?(:method1)) #=> false
103
+ Foo.new.respond_to?(:method1) #=> true
104
+ Bar.new.respond_to?(:method1) #=> true
105
+ Baz.new.respond_to?(:method1) #=> false
106
+ Qux.new.respond_to?(:method1) #=> false
107
+
108
+ Foo.new.respond_to?(:method2) #=> false
109
+ Bar.new.respond_to?(:method2) #=> false
110
+ Baz.new.respond_to?(:method2) #=> true
111
+ Qux.new.respond_to?(:method2) #=> false
112
112
  ```
113
113
 
114
114
  In this case, the methods in `Repository` are, of course, defined as instance methods of each classes, not singleton methods of each objects.
@@ -117,7 +117,7 @@ In this case, the methods in `Repository` are, of course, defined as instance me
117
117
 
118
118
  Add this line to your application's Gemfile:
119
119
 
120
- gem 'inserts'
120
+ gem 'method_repository'
121
121
 
122
122
  And then execute:
123
123
 
@@ -125,7 +125,7 @@ And then execute:
125
125
 
126
126
  Or install it yourself as:
127
127
 
128
- $ gem install inserts
128
+ $ gem install method_repository
129
129
 
130
130
  ## Contributing
131
131
 
data/Rakefile CHANGED
@@ -1 +1,9 @@
1
1
  require "bundler/gem_tasks"
2
+
3
+ require 'rspec/core'
4
+ require 'rspec/core/rake_task'
5
+ RSpec::Core::RakeTask.new(:spec) do |spec|
6
+ spec.pattern = FileList['spec/**/*_spec.rb']
7
+ end
8
+
9
+ task :default => :spec
@@ -38,8 +38,8 @@ module MethodRepository
38
38
  klasses[:in].each do |klass|
39
39
  @targets[klass] ||= []
40
40
  @targets[klass] << {
41
- :name => name,
42
- :block => block,
41
+ name: name,
42
+ block: block,
43
43
  }
44
44
  end
45
45
  end
@@ -1,3 +1,3 @@
1
1
  module MethodRepository
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -12,10 +12,13 @@ Gem::Specification.new do |gem|
12
12
  gem.summary = %q{Extracting redandunt code and commonalizing it in a different way}
13
13
  gem.homepage = "https://github.com/kentaro/method_repository"
14
14
 
15
+ gem.required_ruby_version = '>= 1.9.2'
16
+
15
17
  gem.files = `git ls-files`.split($/)
16
18
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
19
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
20
  gem.require_paths = ["lib"]
19
21
 
20
22
  gem.add_development_dependency "rspec", "~> 2.12"
23
+ gem.add_development_dependency "rake"
21
24
  end
@@ -44,7 +44,7 @@ describe MethodRepository do
44
44
  expect(Foo.respond_to?(:method2)).to be false
45
45
  expect(Bar.respond_to?(:method2)).to be false
46
46
  expect(Baz.respond_to?(:method2)).to be true
47
- expect(Qux.respond_to?(:method1)).to be false
47
+ expect(Qux.respond_to?(:method2)).to be false
48
48
  }
49
49
  end
50
50
 
@@ -70,7 +70,7 @@ describe MethodRepository do
70
70
  expect(foo.respond_to?(:method2)).to be false
71
71
  expect(bar.respond_to?(:method2)).to be false
72
72
  expect(baz.respond_to?(:method2)).to be true
73
- expect(qux.respond_to?(:method1)).to be false
73
+ expect(qux.respond_to?(:method2)).to be false
74
74
  }
75
75
  end
76
76
  end
@@ -92,7 +92,7 @@ describe MethodRepository do
92
92
  expect(Foo.new.respond_to?(:method2)).to be false
93
93
  expect(Bar.new.respond_to?(:method2)).to be false
94
94
  expect(Baz.new.respond_to?(:method2)).to be true
95
- expect(Qux.new.respond_to?(:method1)).to be false
95
+ expect(Qux.new.respond_to?(:method2)).to be false
96
96
  }
97
97
  end
98
98
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: method_repository
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -27,6 +27,22 @@ dependencies:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
29
  version: '2.12'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
30
46
  description: Extracting redandunt code and commonalizing it in a different way.
31
47
  email:
32
48
  - kentarok@gmail.com
@@ -35,6 +51,7 @@ extensions: []
35
51
  extra_rdoc_files: []
36
52
  files:
37
53
  - .gitignore
54
+ - .travis.yml
38
55
  - Gemfile
39
56
  - LICENSE.txt
40
57
  - README.md
@@ -55,7 +72,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
55
72
  requirements:
56
73
  - - ! '>='
57
74
  - !ruby/object:Gem::Version
58
- version: '0'
75
+ version: 1.9.2
59
76
  required_rubygems_version: !ruby/object:Gem::Requirement
60
77
  none: false
61
78
  requirements: