tuberack 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +3 -0
- data/lib/tuberack.rb +4 -3
- data/lib/tuberack/dummy_controller.rb +9 -1
- data/lib/tuberack/dummy_user.rb +2 -2
- data/lib/tuberack/engine.rb +11 -0
- data/lib/tuberack/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 696a3bcb324d0642ad2bc732cfe73a98d03b6b82
|
4
|
+
data.tar.gz: cfe1fdf6f5e48d93219f9406aaa2ad92d74ee830
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8fac9b1ee564eaea4c64730d50eb255590f2f6023f7fe2bd0a1fc34a4208cf33ba4fc5122c347f47d4ca50dfe9a50430d63b6e51f52841a332c5c85a0a9fa0b3
|
7
|
+
data.tar.gz: dadd90dc01bedc29e9bd9b97d5e8595fe77c340de8636321cb71550605243256f850c7893e9900c9fb57008a4d3b2b2729fb72552c6bb6b76ff79c0aeba06a74
|
data/Rakefile
CHANGED
@@ -4,6 +4,9 @@ rescue LoadError
|
|
4
4
|
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
5
|
end
|
6
6
|
|
7
|
+
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
|
8
|
+
load 'rails/tasks/engine.rake'
|
9
|
+
|
7
10
|
Bundler::GemHelper.install_tasks
|
8
11
|
|
9
12
|
require 'rake/testtask'
|
data/lib/tuberack.rb
CHANGED
@@ -1,11 +1,12 @@
|
|
1
|
+
require 'tuberack/engine'
|
2
|
+
require 'tuberack/dummy_controller'
|
3
|
+
require 'tuberack/dummy_user'
|
4
|
+
|
1
5
|
if ENV['RAILS_ENV'] == 'test'
|
2
6
|
require 'tuberack/requirements'
|
3
7
|
require 'tuberack/helpers'
|
4
8
|
require 'tuberack/test_help'
|
5
9
|
end
|
6
10
|
|
7
|
-
require 'tuberack/dummy_controller'
|
8
|
-
require 'tuberack/dummy_user'
|
9
|
-
|
10
11
|
module Tuberack
|
11
12
|
end
|
@@ -20,10 +20,18 @@ module Tuberack
|
|
20
20
|
|
21
21
|
private
|
22
22
|
def changes
|
23
|
+
@@current_user = set_user if params[:user]
|
23
24
|
current_user.manage = params[:manage] =~ /(true|1)/ ? true : false if params[:manage]
|
24
25
|
current_user.xeditable = params[:xeditable] =~ /(true|1)/ ? true : false if params[:xeditable]
|
25
26
|
current_user.roles = params[:role] == 'clear' ? nil : params[:role] if params[:role]
|
26
|
-
|
27
|
+
end
|
28
|
+
|
29
|
+
def set_user
|
30
|
+
if params[:user].to_i == 0
|
31
|
+
nil
|
32
|
+
else
|
33
|
+
DummyUser.find_or_create_by(id: params[:user].to_i) unless current_user.id == params[:user].to_i
|
34
|
+
end
|
27
35
|
end
|
28
36
|
end
|
29
37
|
end
|
data/lib/tuberack/dummy_user.rb
CHANGED
@@ -0,0 +1,11 @@
|
|
1
|
+
module Tuberack
|
2
|
+
class Engine < ::Rails::Engine
|
3
|
+
initializer :append_migrations do |app|
|
4
|
+
unless app.root.to_s.match root.to_s
|
5
|
+
config.paths["db/migrate"].expanded.each do |expanded_path|
|
6
|
+
app.config.paths["db/migrate"] << expanded_path
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
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.6
|
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-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -234,6 +234,7 @@ files:
|
|
234
234
|
- lib/tuberack.rb
|
235
235
|
- lib/tuberack/dummy_controller.rb
|
236
236
|
- lib/tuberack/dummy_user.rb
|
237
|
+
- lib/tuberack/engine.rb
|
237
238
|
- lib/tuberack/helpers.rb
|
238
239
|
- lib/tuberack/requirements.rb
|
239
240
|
- lib/tuberack/test_help.rb
|