tuberack 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +19 -1
- data/lib/tuberack.rb +3 -0
- data/lib/tuberack/dummy_controller.rb +29 -0
- data/lib/tuberack/dummy_user.rb +12 -0
- data/lib/tuberack/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 929015491bb576c288df1db5fb0f013239c64e5d
|
4
|
+
data.tar.gz: f35243f87c96ae462a34a5449551266854429eb3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dba51ce50a7d8c6982266084ac5d0e8ae9b58ce176f2f4545a3ced45cc6c302602ca16d47df4a97048d41fda7e9ec6ccebc35d131894e218ef7930f04d807ac2
|
7
|
+
data.tar.gz: a9178396ae4a118394509b97c2f40656d8329c7ab85d925ebe01dee432a284e7f7575b1dbaef0663d6a0f3d34958417732834a71b4e2fb79ea3d8850630eba24
|
data/Rakefile
CHANGED
@@ -1 +1,19 @@
|
|
1
|
-
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
Bundler::GemHelper.install_tasks
|
8
|
+
|
9
|
+
require 'rake/testtask'
|
10
|
+
|
11
|
+
Rake::TestTask.new(:test) do |t|
|
12
|
+
t.libs << 'lib'
|
13
|
+
t.libs << 'test'
|
14
|
+
t.pattern = 'test/**/*_test.rb'
|
15
|
+
t.verbose = false
|
16
|
+
end
|
17
|
+
|
18
|
+
|
19
|
+
task default: :test
|
data/lib/tuberack.rb
CHANGED
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'tuberack/dummy_user'
|
2
|
+
|
3
|
+
module Tuberack
|
4
|
+
class DummyController < ActionController::Base
|
5
|
+
before_action :changes
|
6
|
+
|
7
|
+
def current_user
|
8
|
+
@@current_user ||= DummyUser.new
|
9
|
+
end
|
10
|
+
|
11
|
+
def xeditable? object
|
12
|
+
current_user.xeditable?
|
13
|
+
end
|
14
|
+
helper_method :xeditable?
|
15
|
+
|
16
|
+
def manage?
|
17
|
+
current_user.manage?
|
18
|
+
end
|
19
|
+
helper_method :manage?
|
20
|
+
|
21
|
+
private
|
22
|
+
def changes
|
23
|
+
current_user.manage = params[:manage] =~ /(true|1)/ ? true : false if params[:manage]
|
24
|
+
current_user.xeditable = params[:xeditable] =~ /(true|1)/ ? true : false if params[:xeditable]
|
25
|
+
current_user.roles = params[:role] == 'clear' ? nil : params[:role] if params[:role]
|
26
|
+
current_user.id = params[:user_id] == 'clear' ? nil : params[:user_id] if params[:user_id]
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/tuberack/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tuberack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JiriKolarik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -232,6 +232,8 @@ files:
|
|
232
232
|
- Readme.md
|
233
233
|
- lib/generators/tuberack/install_generator.rb
|
234
234
|
- lib/tuberack.rb
|
235
|
+
- lib/tuberack/dummy_controller.rb
|
236
|
+
- lib/tuberack/dummy_user.rb
|
235
237
|
- lib/tuberack/helpers.rb
|
236
238
|
- lib/tuberack/requirements.rb
|
237
239
|
- lib/tuberack/test_help.rb
|