concerned 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,13 +1,13 @@
1
- source :rubygems
1
+ source 'https://www.rubygems.org'
2
2
 
3
3
  group :test do
4
- gem 'rails'
4
+ gem 'rails', '>= 3.0.8'
5
5
  end
6
6
 
7
7
  group :development do
8
- gem "rspec", "~> 2.8.0"
9
- gem "rdoc", "~> 3.12"
10
- gem "bundler", "~> 1.1.0"
11
- gem "jeweler", "~> 1.8.3"
12
- gem "simplecov", ">= 0.5"
8
+ gem "rspec", ">= 2.8.0"
9
+ gem "rdoc", ">= 3.12"
10
+ gem "bundler", ">= 1.1.0"
11
+ gem "jeweler", ">= 1.8.3"
12
+ gem "simplecov", ">= 0.5"
13
13
  end
data/Gemfile.lock CHANGED
@@ -1,109 +1,100 @@
1
1
  GEM
2
- remote: http://rubygems.org/
2
+ remote: https://www.rubygems.org/
3
3
  specs:
4
- actionmailer (3.2.3)
5
- actionpack (= 3.2.3)
6
- mail (~> 2.4.4)
7
- actionpack (3.2.3)
8
- activemodel (= 3.2.3)
9
- activesupport (= 3.2.3)
10
- builder (~> 3.0.0)
11
- erubis (~> 2.7.0)
12
- journey (~> 1.0.1)
13
- rack (~> 1.4.0)
14
- rack-cache (~> 1.2)
15
- rack-test (~> 0.6.1)
16
- sprockets (~> 2.1.2)
17
- activemodel (3.2.3)
18
- activesupport (= 3.2.3)
19
- builder (~> 3.0.0)
20
- activerecord (3.2.3)
21
- activemodel (= 3.2.3)
22
- activesupport (= 3.2.3)
23
- arel (~> 3.0.2)
24
- tzinfo (~> 0.3.29)
25
- activeresource (3.2.3)
26
- activemodel (= 3.2.3)
27
- activesupport (= 3.2.3)
28
- activesupport (3.2.3)
29
- i18n (~> 0.6)
30
- multi_json (~> 1.0)
31
- arel (3.0.2)
32
- builder (3.0.0)
33
- diff-lcs (1.1.3)
34
- erubis (2.7.0)
4
+ abstract (1.0.0)
5
+ actionmailer (3.0.8)
6
+ actionpack (= 3.0.8)
7
+ mail (~> 2.2.19)
8
+ actionpack (3.0.8)
9
+ activemodel (= 3.0.8)
10
+ activesupport (= 3.0.8)
11
+ builder (~> 2.1.2)
12
+ erubis (~> 2.6.6)
13
+ i18n (~> 0.5.0)
14
+ rack (~> 1.2.1)
15
+ rack-mount (~> 0.6.14)
16
+ rack-test (~> 0.5.7)
17
+ tzinfo (~> 0.3.23)
18
+ activemodel (3.0.8)
19
+ activesupport (= 3.0.8)
20
+ builder (~> 2.1.2)
21
+ i18n (~> 0.5.0)
22
+ activerecord (3.0.8)
23
+ activemodel (= 3.0.8)
24
+ activesupport (= 3.0.8)
25
+ arel (~> 2.0.10)
26
+ tzinfo (~> 0.3.23)
27
+ activeresource (3.0.8)
28
+ activemodel (= 3.0.8)
29
+ activesupport (= 3.0.8)
30
+ activesupport (3.0.8)
31
+ arel (2.0.10)
32
+ builder (2.1.2)
33
+ diff-lcs (1.2.1)
34
+ erubis (2.6.6)
35
+ abstract (>= 1.0.0)
35
36
  git (1.2.5)
36
- hike (1.2.1)
37
- i18n (0.6.0)
38
- jeweler (1.8.3)
37
+ i18n (0.5.0)
38
+ jeweler (1.8.4)
39
39
  bundler (~> 1.0)
40
40
  git (>= 1.2.5)
41
41
  rake
42
42
  rdoc
43
- journey (1.0.3)
44
- json (1.7.1)
45
- mail (2.4.4)
43
+ json (1.7.7)
44
+ mail (2.2.19)
45
+ activesupport (>= 2.3.6)
46
46
  i18n (>= 0.4.0)
47
47
  mime-types (~> 1.16)
48
48
  treetop (~> 1.4.8)
49
- mime-types (1.18)
50
- multi_json (1.3.4)
49
+ mime-types (1.21)
50
+ multi_json (1.6.1)
51
51
  polyglot (0.3.3)
52
- rack (1.4.1)
53
- rack-cache (1.2)
54
- rack (>= 0.4)
55
- rack-ssl (1.3.2)
56
- rack
57
- rack-test (0.6.1)
52
+ rack (1.2.8)
53
+ rack-mount (0.6.14)
54
+ rack (>= 1.0.0)
55
+ rack-test (0.5.7)
58
56
  rack (>= 1.0)
59
- rails (3.2.3)
60
- actionmailer (= 3.2.3)
61
- actionpack (= 3.2.3)
62
- activerecord (= 3.2.3)
63
- activeresource (= 3.2.3)
64
- activesupport (= 3.2.3)
57
+ rails (3.0.8)
58
+ actionmailer (= 3.0.8)
59
+ actionpack (= 3.0.8)
60
+ activerecord (= 3.0.8)
61
+ activeresource (= 3.0.8)
62
+ activesupport (= 3.0.8)
65
63
  bundler (~> 1.0)
66
- railties (= 3.2.3)
67
- railties (3.2.3)
68
- actionpack (= 3.2.3)
69
- activesupport (= 3.2.3)
70
- rack-ssl (~> 1.3.2)
64
+ railties (= 3.0.8)
65
+ railties (3.0.8)
66
+ actionpack (= 3.0.8)
67
+ activesupport (= 3.0.8)
71
68
  rake (>= 0.8.7)
72
- rdoc (~> 3.4)
73
- thor (~> 0.14.6)
74
- rake (0.9.2.2)
75
- rdoc (3.12)
69
+ thor (~> 0.14.4)
70
+ rake (10.0.3)
71
+ rdoc (4.0.0)
76
72
  json (~> 1.4)
77
- rspec (2.8.0)
78
- rspec-core (~> 2.8.0)
79
- rspec-expectations (~> 2.8.0)
80
- rspec-mocks (~> 2.8.0)
81
- rspec-core (2.8.0)
82
- rspec-expectations (2.8.0)
83
- diff-lcs (~> 1.1.2)
84
- rspec-mocks (2.8.0)
85
- simplecov (0.6.2)
86
- multi_json (~> 1.3)
87
- simplecov-html (~> 0.5.3)
88
- simplecov-html (0.5.3)
89
- sprockets (2.1.3)
90
- hike (~> 1.2)
91
- rack (~> 1.0)
92
- tilt (~> 1.1, != 1.3.0)
73
+ rspec (2.13.0)
74
+ rspec-core (~> 2.13.0)
75
+ rspec-expectations (~> 2.13.0)
76
+ rspec-mocks (~> 2.13.0)
77
+ rspec-core (2.13.0)
78
+ rspec-expectations (2.13.0)
79
+ diff-lcs (>= 1.1.3, < 2.0)
80
+ rspec-mocks (2.13.0)
81
+ simplecov (0.7.1)
82
+ multi_json (~> 1.0)
83
+ simplecov-html (~> 0.7.1)
84
+ simplecov-html (0.7.1)
93
85
  thor (0.14.6)
94
- tilt (1.3.3)
95
- treetop (1.4.10)
86
+ treetop (1.4.12)
96
87
  polyglot
97
88
  polyglot (>= 0.3.1)
98
- tzinfo (0.3.33)
89
+ tzinfo (0.3.35)
99
90
 
100
91
  PLATFORMS
101
92
  ruby
102
93
 
103
94
  DEPENDENCIES
104
- bundler (~> 1.1.0)
105
- jeweler (~> 1.8.3)
106
- rails
107
- rdoc (~> 3.12)
108
- rspec (~> 2.8.0)
95
+ bundler (>= 1.1.0)
96
+ jeweler (>= 1.8.3)
97
+ rails (>= 3.0.8)
98
+ rdoc (>= 3.12)
99
+ rspec (>= 2.8.0)
109
100
  simplecov (>= 0.5)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.1.5
data/concerned.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "concerned"
8
- s.version = "0.1.4"
8
+ s.version = "0.1.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kristian Mandrup"]
12
- s.date = "2012-09-18"
12
+ s.date = "2013-03-02"
13
13
  s.description = "Makes it easy to apply the concerns pattern in any Ruby context"
14
14
  s.email = "kmandrup@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -29,6 +29,7 @@ Gem::Specification.new do |s|
29
29
  "lib/concerned.rb",
30
30
  "lib/concerned/module_ext.rb",
31
31
  "spec/concerned_spec.rb",
32
+ "spec/fixture_user/bar.rb",
32
33
  "spec/fixture_user/foo.rb",
33
34
  "spec/fixture_user/scopes.rb",
34
35
  "spec/fixture_user/validations.rb",
@@ -41,30 +42,30 @@ Gem::Specification.new do |s|
41
42
  s.homepage = "http://github.com/kristianmandrup/concerned"
42
43
  s.licenses = ["MIT"]
43
44
  s.require_paths = ["lib"]
44
- s.rubygems_version = "1.8.24"
45
+ s.rubygems_version = "1.8.25"
45
46
  s.summary = "Concerns for Ruby (and Rails) projects"
46
47
 
47
48
  if s.respond_to? :specification_version then
48
49
  s.specification_version = 3
49
50
 
50
51
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
51
- s.add_development_dependency(%q<rspec>, ["~> 2.8.0"])
52
- s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
53
- s.add_development_dependency(%q<bundler>, ["~> 1.1.0"])
54
- s.add_development_dependency(%q<jeweler>, ["~> 1.8.3"])
52
+ s.add_development_dependency(%q<rspec>, [">= 2.8.0"])
53
+ s.add_development_dependency(%q<rdoc>, [">= 3.12"])
54
+ s.add_development_dependency(%q<bundler>, [">= 1.1.0"])
55
+ s.add_development_dependency(%q<jeweler>, [">= 1.8.3"])
55
56
  s.add_development_dependency(%q<simplecov>, [">= 0.5"])
56
57
  else
57
- s.add_dependency(%q<rspec>, ["~> 2.8.0"])
58
- s.add_dependency(%q<rdoc>, ["~> 3.12"])
59
- s.add_dependency(%q<bundler>, ["~> 1.1.0"])
60
- s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
58
+ s.add_dependency(%q<rspec>, [">= 2.8.0"])
59
+ s.add_dependency(%q<rdoc>, [">= 3.12"])
60
+ s.add_dependency(%q<bundler>, [">= 1.1.0"])
61
+ s.add_dependency(%q<jeweler>, [">= 1.8.3"])
61
62
  s.add_dependency(%q<simplecov>, [">= 0.5"])
62
63
  end
63
64
  else
64
- s.add_dependency(%q<rspec>, ["~> 2.8.0"])
65
- s.add_dependency(%q<rdoc>, ["~> 3.12"])
66
- s.add_dependency(%q<bundler>, ["~> 1.1.0"])
67
- s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
65
+ s.add_dependency(%q<rspec>, [">= 2.8.0"])
66
+ s.add_dependency(%q<rdoc>, [">= 3.12"])
67
+ s.add_dependency(%q<bundler>, [">= 1.1.0"])
68
+ s.add_dependency(%q<jeweler>, [">= 1.8.3"])
68
69
  s.add_dependency(%q<simplecov>, [">= 0.5"])
69
70
  end
70
71
  end
@@ -17,7 +17,7 @@ class Module
17
17
 
18
18
  def include_concerns(*concerns)
19
19
  options = concerns.extract_options!
20
- scope_name = options[:for] ? options[:for] : name
20
+ scope_name = options[:for] || options[:from] || name
21
21
  concerns.flatten.each do |concern|
22
22
  next if concern.blank?
23
23
  require_concern scope_name, concern
@@ -26,12 +26,29 @@ class FixtureUserFor
26
26
  include_concerns :foo, for: 'fixture_user'
27
27
  end
28
28
 
29
+ class FixtureUserFrom
30
+ include_concerns :bar, from: 'fixture_user'
31
+ end
32
+
33
+
34
+ describe 'shared concerns' do
35
+ it 'should require it' do
36
+ expect(Assoc.abc).to be true
37
+ end
38
+ end
39
+
29
40
  describe "Concerned" do
30
41
  describe "using :for" do
31
42
  it 'should include Foo module' do
32
43
  FixtureUserFor.new.should respond_to(:foo)
33
44
  end
34
45
  end
46
+
47
+ describe "using :from" do
48
+ it 'should include Foo module' do
49
+ FixtureUserFrom.new.should respond_to(:bar)
50
+ end
51
+ end
35
52
  end
36
53
 
37
54
  describe "Concerned" do
@@ -0,0 +1,6 @@
1
+ class FixtureUser
2
+ module Bar
3
+ def bar
4
+ end
5
+ end
6
+ end
@@ -1 +1,5 @@
1
- puts "shared/associations was required ok"
1
+ module Assoc
2
+ def self.abc
3
+ true
4
+ end
5
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: concerned
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,14 +9,14 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-18 00:00:00.000000000 Z
12
+ date: 2013-03-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - ~>
19
+ - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
21
  version: 2.8.0
22
22
  type: :development
@@ -24,7 +24,7 @@ dependencies:
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ~>
27
+ - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: 2.8.0
30
30
  - !ruby/object:Gem::Dependency
@@ -32,7 +32,7 @@ dependencies:
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  none: false
34
34
  requirements:
35
- - - ~>
35
+ - - ! '>='
36
36
  - !ruby/object:Gem::Version
37
37
  version: '3.12'
38
38
  type: :development
@@ -40,7 +40,7 @@ dependencies:
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
- - - ~>
43
+ - - ! '>='
44
44
  - !ruby/object:Gem::Version
45
45
  version: '3.12'
46
46
  - !ruby/object:Gem::Dependency
@@ -48,7 +48,7 @@ dependencies:
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  none: false
50
50
  requirements:
51
- - - ~>
51
+ - - ! '>='
52
52
  - !ruby/object:Gem::Version
53
53
  version: 1.1.0
54
54
  type: :development
@@ -56,7 +56,7 @@ dependencies:
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  none: false
58
58
  requirements:
59
- - - ~>
59
+ - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: 1.1.0
62
62
  - !ruby/object:Gem::Dependency
@@ -64,7 +64,7 @@ dependencies:
64
64
  requirement: !ruby/object:Gem::Requirement
65
65
  none: false
66
66
  requirements:
67
- - - ~>
67
+ - - ! '>='
68
68
  - !ruby/object:Gem::Version
69
69
  version: 1.8.3
70
70
  type: :development
@@ -72,7 +72,7 @@ dependencies:
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
- - - ~>
75
+ - - ! '>='
76
76
  - !ruby/object:Gem::Version
77
77
  version: 1.8.3
78
78
  - !ruby/object:Gem::Dependency
@@ -111,6 +111,7 @@ files:
111
111
  - lib/concerned.rb
112
112
  - lib/concerned/module_ext.rb
113
113
  - spec/concerned_spec.rb
114
+ - spec/fixture_user/bar.rb
114
115
  - spec/fixture_user/foo.rb
115
116
  - spec/fixture_user/scopes.rb
116
117
  - spec/fixture_user/validations.rb
@@ -134,7 +135,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
134
135
  version: '0'
135
136
  segments:
136
137
  - 0
137
- hash: 4276078573137133758
138
+ hash: 916306081316537692
138
139
  required_rubygems_version: !ruby/object:Gem::Requirement
139
140
  none: false
140
141
  requirements:
@@ -143,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
144
  version: '0'
144
145
  requirements: []
145
146
  rubyforge_project:
146
- rubygems_version: 1.8.24
147
+ rubygems_version: 1.8.25
147
148
  signing_key:
148
149
  specification_version: 3
149
150
  summary: Concerns for Ruby (and Rails) projects