ubiquitous_user 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +0 -37
- data/VERSION +1 -1
- data/lib/ubiquitous_user.rb +6 -4
- data/test/test_ubiquitous_user.rb +1 -0
- metadata +3 -3
data/Rakefile
CHANGED
@@ -57,40 +57,3 @@ Rake::RDocTask.new do |rdoc|
|
|
57
57
|
rdoc.rdoc_files.include('LICENSE')
|
58
58
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
59
59
|
end
|
60
|
-
|
61
|
-
begin
|
62
|
-
require 'metric_fu'
|
63
|
-
MetricFu::Configuration.run do |config|
|
64
|
-
#define which metrics you want to use
|
65
|
-
# config.metrics = [:churn, :saikuro, :stats, :flog, :flay, :reek, :roodi, :rcov]
|
66
|
-
config.metrics = [:rcov]
|
67
|
-
# config.graphs = [:flog, :flay, :reek, :roodi, :rcov]
|
68
|
-
config.graphs = [:rcov]
|
69
|
-
|
70
|
-
# config.flay = { :dirs_to_flay => ['app', 'lib'] }
|
71
|
-
# config.flog = { :dirs_to_flog => ['app', 'lib'] }
|
72
|
-
# config.reek = { :dirs_to_reek => ['app', 'lib'] }
|
73
|
-
# config.roodi = { :dirs_to_roodi => ['app', 'lib'] }
|
74
|
-
# config.saikuro = { :output_directory => 'scratch_directory/saikuro',
|
75
|
-
# :input_directory => ['app', 'lib'],
|
76
|
-
# :cyclo => "",
|
77
|
-
# :filter_cyclo => "0",
|
78
|
-
# :warn_cyclo => "5",
|
79
|
-
# :error_cyclo => "7",
|
80
|
-
# :formater => "text"} #this needs to be set to "text"
|
81
|
-
# config.churn = { :start_date => "1 year ago", :minimum_churn_count => 10}
|
82
|
-
config.rcov = { :test_files => ['test/**/test_*.rb'],
|
83
|
-
:rcov_opts => ["--text-report"
|
84
|
-
#"--sort coverage",
|
85
|
-
#"--no-html",
|
86
|
-
# "--text-coverage",
|
87
|
-
# "--no-color",
|
88
|
-
# "--profile",
|
89
|
-
# "--rails",
|
90
|
-
# "--exclude /gems/,/Library/,spec"
|
91
|
-
]
|
92
|
-
}
|
93
|
-
end
|
94
|
-
rescue LoadError
|
95
|
-
puts "Metric fu not available"
|
96
|
-
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.1
|
data/lib/ubiquitous_user.rb
CHANGED
@@ -39,10 +39,12 @@ module UsableHelpers
|
|
39
39
|
|
40
40
|
# If the object is new, let's get ready to mark the user as logged in when saving.
|
41
41
|
if @ubiquitous_user.new_record? or @ubiquitous_user.id != session[:user_id]
|
42
|
-
|
43
|
-
#
|
44
|
-
|
45
|
-
|
42
|
+
controller = self
|
43
|
+
# Read more about this technique on http://stackoverflow.com/questions/2495550/define-a-method-that-is-a-closure-in-ruby
|
44
|
+
klass = class << @ubiquitous_user; self; end
|
45
|
+
klass.send(:define_method, :after_save) do
|
46
|
+
super
|
47
|
+
controller.session[:user_id] = self.id
|
46
48
|
end
|
47
49
|
end
|
48
50
|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 4
|
8
|
-
-
|
9
|
-
version: 0.4.
|
8
|
+
- 1
|
9
|
+
version: 0.4.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- "J. Pablo Fern\xC3\xA1ndez"
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-03-
|
17
|
+
date: 2010-03-23 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|