subelsky_power_tools 1.2.4 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
data/.rvmrc CHANGED
@@ -1 +1 @@
1
- rvm use 1.9.2-p180-patched@subelsky_power_tools --create
1
+ rvm use 1.9.2-p180-patched --create
data/Gemfile CHANGED
@@ -2,8 +2,7 @@ source :rubygems
2
2
  gemspec
3
3
 
4
4
  group :test do
5
- gem "rb-fsevent", "0.4.0"
6
- gem "growl", "1.0.3"
7
- gem "guard-spork", "0.2.0"
8
- gem "guard-rspec", "0.4.0"
5
+ gem "growl"
6
+ gem "guard-spork"
7
+ gem "guard-rspec"
9
8
  end
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- subelsky_power_tools (1.2.4)
4
+ subelsky_power_tools (1.2.5)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -15,7 +15,6 @@ GEM
15
15
  guard-spork (0.2.0)
16
16
  guard (>= 0.2.2)
17
17
  spork (>= 0.8.4)
18
- rb-fsevent (0.4.0)
19
18
  rspec (2.6.0)
20
19
  rspec-core (~> 2.6.0)
21
20
  rspec-expectations (~> 2.6.0)
@@ -31,9 +30,8 @@ PLATFORMS
31
30
  ruby
32
31
 
33
32
  DEPENDENCIES
34
- growl (= 1.0.3)
35
- guard-rspec (= 0.4.0)
36
- guard-spork (= 0.2.0)
37
- rb-fsevent (= 0.4.0)
33
+ growl
34
+ guard-rspec
35
+ guard-spork
38
36
  rspec
39
37
  subelsky_power_tools!
@@ -1,13 +1,13 @@
1
1
  # https://www.relishapp.com/rspec/rspec-core/v/2-10/docs/example-groups/shared-examples
2
- shared_examples "a protected plural controller" do
3
- describe "new", :if => described_class.instance_methods.include?(:new) do
2
+ shared_examples "a protected plural controller" do |skip_actions|
3
+ describe "new", :if => described_class.instance_methods.include?(:new) && not(Array(skip_actions).include?(:new)) do
4
4
  it "requires signin" do
5
5
  get :new
6
6
  response.should redirect_to signin_redirect
7
7
  end
8
8
  end
9
9
 
10
- describe "edit", :if => described_class.instance_methods.include?(:edit) do
10
+ describe "edit", :if => described_class.instance_methods.include?(:edit) && not(Array(skip_actions).include?(:edit)) do
11
11
  def simple_get(obj_id = 1)
12
12
  get :edit, { id: obj_id }
13
13
  end
@@ -24,7 +24,7 @@ shared_examples "a protected plural controller" do
24
24
  end
25
25
  end
26
26
 
27
- describe "show", :if => described_class.instance_methods.include?(:show) do
27
+ describe "show", :if => described_class.instance_methods.include?(:show) && not(Array(skip_actions).include?(:show)) do
28
28
  def simple_get(obj_id = 1)
29
29
  get :show, { id: obj_id }
30
30
  end
@@ -41,21 +41,21 @@ shared_examples "a protected plural controller" do
41
41
  end
42
42
  end
43
43
 
44
- describe "index", :if => described_class.instance_methods.include?(:index) do
44
+ describe "index", :if => described_class.instance_methods.include?(:index) && not(Array(skip_actions).include?(:index)) do
45
45
  it "requires signin" do
46
46
  get :index
47
47
  response.should redirect_to signin_redirect
48
48
  end
49
49
  end
50
50
 
51
- describe "create", :if => described_class.instance_methods.include?(:create) do
51
+ describe "create", :if => described_class.instance_methods.include?(:create) && not(Array(skip_actions).include?(:create)) do
52
52
  it "requires signin" do
53
53
  post :create
54
54
  response.should redirect_to signin_redirect
55
55
  end
56
56
  end
57
57
 
58
- describe "update", :if => described_class.instance_methods.include?(:update) do
58
+ describe "update", :if => described_class.instance_methods.include?(:update) && not(Array(skip_actions).include?(:update)) do
59
59
  def simple_put(obj_id = 1,params = {})
60
60
  put :update, params.merge(id: obj_id)
61
61
  end
@@ -77,7 +77,7 @@ shared_examples "a protected plural controller" do
77
77
  end
78
78
  end
79
79
 
80
- describe "delete", :if => described_class.instance_methods.include?(:destroy) do
80
+ describe "delete", :if => described_class.instance_methods.include?(:destroy) && not(Array(skip_actions).include?(:destroy)) do
81
81
  def simple_delete(obj_id = 1)
82
82
  delete :destroy, id: obj_id
83
83
  end
@@ -96,43 +96,43 @@ shared_examples "a protected plural controller" do
96
96
  end
97
97
  end
98
98
 
99
- shared_examples "a protected singular controller" do
100
- describe "new", :if => described_class.instance_methods.include?(:new) do
99
+ shared_examples "a protected singular controller" do |skip_actions|
100
+ describe "new", :if => described_class.instance_methods.include?(:new) && not(Array(skip_actions).include?(:new)) do
101
101
  it "requires signin" do
102
102
  get :new
103
103
  response.should redirect_to signin_redirect
104
104
  end
105
105
  end
106
106
 
107
- describe "edit", :if => described_class.instance_methods.include?(:edit) do
107
+ describe "edit", :if => described_class.instance_methods.include?(:edit) && not(Array(skip_actions).include?(:edit)) do
108
108
  it "requires signin" do
109
109
  get :edit
110
110
  response.should redirect_to signin_redirect
111
111
  end
112
112
  end
113
113
 
114
- describe "show", :if => described_class.instance_methods.include?(:show) do
114
+ describe "show", :if => described_class.instance_methods.include?(:show) && not(Array(skip_actions).include?(:show)) do
115
115
  it "requires signin" do
116
116
  get :show
117
117
  response.should redirect_to signin_redirect
118
118
  end
119
119
  end
120
120
 
121
- describe "create", :if => described_class.instance_methods.include?(:create) do
121
+ describe "create", :if => described_class.instance_methods.include?(:create) && not(Array(skip_actions).include?(:create)) do
122
122
  it "requires signin" do
123
123
  post :create
124
124
  response.should redirect_to signin_redirect
125
125
  end
126
126
  end
127
127
 
128
- describe "update", :if => described_class.instance_methods.include?(:update) do
128
+ describe "update", :if => described_class.instance_methods.include?(:update) && not(Array(skip_actions).include?(:update)) do
129
129
  it "requires signin" do
130
130
  put :update
131
131
  response.should redirect_to signin_redirect
132
132
  end
133
133
  end
134
134
 
135
- describe "delete", :if => described_class.instance_methods.include?(:destroy) do
135
+ describe "delete", :if => described_class.instance_methods.include?(:destroy) && not(Array(skip_actions).include?(:destroy)) do
136
136
  it "requires signin" do
137
137
  delete :destroy
138
138
  response.should redirect_to signin_redirect
@@ -1,3 +1,3 @@
1
1
  module SubelskyPowerTools
2
- VERSION = "1.2.4"
2
+ VERSION = "1.2.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: subelsky_power_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.5
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: 2012-05-14 00:00:00.000000000 Z
12
+ date: 2012-05-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  version: '0'
83
83
  requirements: []
84
84
  rubyforge_project:
85
- rubygems_version: 1.8.23
85
+ rubygems_version: 1.8.22
86
86
  signing_key:
87
87
  specification_version: 3
88
88
  summary: This is a collection of Ruby extensions and utilities I've been carting around