surrounded 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Surrounded
1
+ # ![Surrounded](http://saturnflyer.github.io/surrounded/images/surrounded.png "Surrounded")
2
2
  ## Bring your own complexity
3
3
 
4
4
  [![Build Status](https://travis-ci.org/saturnflyer/surrounded.png?branch=master)](https://travis-ci.org/saturnflyer/surrounded)
@@ -447,9 +447,9 @@ class ActiviatingAccount
447
447
  # end
448
448
  #
449
449
  # use your own classes if you don't want SimpleDelegator
450
- # class MySpecialClass
450
+ # class SomeSpecialRole
451
451
  # include Surrounded # you must remember this
452
- # # Surrounded assumes MySpecialClass.new(the_role_player_here)
452
+ # # Surrounded assumes SomeSpecialRole.new(some_special_role)
453
453
  # def initialize(...);
454
454
  # # ... your code here
455
455
  # end
@@ -27,18 +27,18 @@ module Surrounded
27
27
  def self.default_role_type
28
28
  @default_role_type ||= :module
29
29
  end
30
-
30
+
31
31
  class << self
32
32
  attr_writer :default_role_type, :methods_as_triggers
33
33
  end
34
-
34
+
35
35
  attr_reader :methods_as_triggers
36
-
36
+
37
37
  def self.methods_as_triggers
38
38
  return @methods_as_triggers if defined?(@methods_as_triggers)
39
39
  @methods_as_triggers = false
40
40
  end
41
-
41
+
42
42
  def set_methods_as_triggers
43
43
  @methods_as_triggers = true
44
44
  end
@@ -59,7 +59,7 @@ module Surrounded
59
59
 
60
60
  def private_const_set(name, const)
61
61
  const = const_set(name, const)
62
- private_constant name
62
+ private_constant name.to_sym
63
63
  const
64
64
  end
65
65
 
@@ -92,7 +92,7 @@ module Surrounded
92
92
  end
93
93
  end
94
94
  end
95
-
95
+
96
96
  def role(name, type=nil, &block)
97
97
  role_type = type || default_role_type
98
98
  if role_type == :module
@@ -105,7 +105,7 @@ module Surrounded
105
105
  rescue NameError => e
106
106
  raise e.extend(InvalidRoleType)
107
107
  end
108
-
108
+
109
109
  def apply_roles_on(which)
110
110
  @__apply_role_policy = which
111
111
  end
@@ -151,7 +151,7 @@ module Surrounded
151
151
  const_get(name)
152
152
  end
153
153
  end
154
-
154
+
155
155
  def redo_method(name, args)
156
156
  class_eval %{
157
157
  def #{name}(#{args.join(', ')})
@@ -166,7 +166,7 @@ module Surrounded
166
166
  end
167
167
  }
168
168
  end
169
-
169
+
170
170
  def method_added(name)
171
171
  if methods_as_triggers
172
172
  unless name.to_s.match(/^__trigger|initialize/) || (@triggers && triggers.include?(name))
@@ -1,3 +1,3 @@
1
1
  module Surrounded
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
@@ -10,7 +10,7 @@ describe Surrounded::Context, '.role' do
10
10
 
11
11
  describe 'modules' do
12
12
  it 'creates a module' do
13
- role = RoleContextTester.const_get('Admin')
13
+ role = RoleContextTester.const_get(:Admin)
14
14
  refute_instance_of Class, role
15
15
  assert_kind_of Module, role
16
16
  end
@@ -19,7 +19,7 @@ describe Surrounded::Context, '.role' do
19
19
  error = assert_raises(NameError){
20
20
  RoleContextTester::Admin
21
21
  }
22
- assert_match(/private constant/, error.message)
22
+ assert_match(/private constant/i, error.message)
23
23
  end
24
24
  end
25
25
 
@@ -41,7 +41,7 @@ describe Surrounded::Context, '.role' do
41
41
  error = assert_raises(NameError){
42
42
  WrapperRoleContext::Admin
43
43
  }
44
- assert_match(/private constant/, error.message)
44
+ assert_match(/private constant/i, error.message)
45
45
  end
46
46
  end
47
47
  if test_rebinding_methods?
@@ -79,7 +79,7 @@ describe Surrounded::Context, '.role' do
79
79
  error = assert_raises(NameError){
80
80
  InterfaceContext::AdminInterface
81
81
  }
82
- assert_match(/private constant/, error.message)
82
+ assert_match(/private constant/i, error.message)
83
83
  end
84
84
 
85
85
  it 'creates a private accessor method' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: surrounded
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-10-27 00:00:00.000000000 Z
12
+ date: 2013-11-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: triad
@@ -101,12 +101,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
101
101
  - - '>='
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
+ segments:
105
+ - 0
106
+ hash: 2352251997784321563
104
107
  required_rubygems_version: !ruby/object:Gem::Requirement
105
108
  none: false
106
109
  requirements:
107
110
  - - '>='
108
111
  - !ruby/object:Gem::Version
109
112
  version: '0'
113
+ segments:
114
+ - 0
115
+ hash: 2352251997784321563
110
116
  requirements: []
111
117
  rubyforge_project:
112
118
  rubygems_version: 1.8.26
@@ -121,4 +127,3 @@ test_files:
121
127
  - test/surrounded_context_test.rb
122
128
  - test/surrounded_test.rb
123
129
  - test/test_helper.rb
124
- has_rdoc: