lockdown 0.7.1 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.DS_Store +0 -0
- data/History.txt +3 -0
- data/README.txt +1 -1
- data/Rakefile +16 -1
- data/lib/lockdown/context.rb +41 -0
- data/lib/lockdown/database.rb +11 -14
- data/lib/lockdown/frameworks/rails/controller.rb +57 -4
- data/lib/lockdown/frameworks/rails/view.rb +1 -1
- data/lib/lockdown/frameworks/rails.rb +21 -10
- data/lib/lockdown/helper.rb +1 -1
- data/lib/lockdown/permission.rb +204 -0
- data/lib/lockdown/rules.rb +287 -0
- data/lib/lockdown/session.rb +8 -6
- data/lib/lockdown/system.rb +35 -88
- data/lib/lockdown.rb +52 -49
- data/rails_generators/.DS_Store +0 -0
- data/rails_generators/lockdown/.DS_Store +0 -0
- data/rails_generators/lockdown/lockdown_generator.rb +5 -5
- data/rails_generators/lockdown/templates/.DS_Store +0 -0
- data/rails_generators/lockdown/templates/lib/.DS_Store +0 -0
- data/rails_generators/lockdown/templates/lib/lockdown/init.rb +27 -19
- data/rails_generators/lockdown/templates/lib/lockdown/session.rb +1 -3
- data/spec/lockdown/database_spec.rb +158 -0
- data/spec/lockdown/frameworks/rails/controller_spec.rb +220 -0
- data/spec/lockdown/frameworks/rails/view_spec.rb +87 -0
- data/spec/lockdown/frameworks/rails_spec.rb +170 -0
- data/spec/lockdown/permission_spec.rb +156 -0
- data/spec/lockdown/rules_spec.rb +109 -0
- data/spec/lockdown/session_spec.rb +88 -0
- data/spec/lockdown/system_spec.rb +59 -0
- data/spec/lockdown_spec.rb +19 -0
- data/spec/rcov.opts +5 -0
- data/spec/spec.opts +3 -0
- data/spec/spec_helper.rb +1 -0
- data/tasks/post_load.rake +2 -7
- data/tasks/setup.rb +24 -3
- metadata +23 -12
- data/.gitignore +0 -5
- data/Manifest.txt +0 -51
- data/lib/lockdown/controller.rb +0 -64
- data/lib/lockdown/frameworks/merb/controller.rb +0 -63
- data/lib/lockdown/frameworks/merb/view.rb +0 -32
- data/lib/lockdown/frameworks/merb.rb +0 -84
- data/lib/lockdown/orms/data_mapper.rb +0 -70
- data/lib/lockdown/rights.rb +0 -208
- data/tasks/manifest.rake +0 -48
data/tasks/manifest.rake
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
|
2
|
-
require 'find'
|
3
|
-
|
4
|
-
namespace :manifest do
|
5
|
-
|
6
|
-
desc 'Verify the manifest'
|
7
|
-
task :check do
|
8
|
-
fn = PROJ.manifest_file + '.tmp'
|
9
|
-
files = manifest_files
|
10
|
-
|
11
|
-
File.open(fn, 'w') {|fp| fp.puts files}
|
12
|
-
lines = %x(#{DIFF} -du #{PROJ.manifest_file} #{fn}).split("\n")
|
13
|
-
if HAVE_FACETS_ANSICODE and ENV.has_key?('TERM')
|
14
|
-
lines.map! do |line|
|
15
|
-
case line
|
16
|
-
when %r/^(-{3}|\+{3})/; nil
|
17
|
-
when %r/^@/; ANSICode.blue line
|
18
|
-
when %r/^\+/; ANSICode.green line
|
19
|
-
when %r/^\-/; ANSICode.red line
|
20
|
-
else line end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
puts lines.compact
|
24
|
-
rm fn rescue nil
|
25
|
-
end
|
26
|
-
|
27
|
-
desc 'Create a new manifest'
|
28
|
-
task :create do
|
29
|
-
files = manifest_files
|
30
|
-
unless test(?f, PROJ.manifest_file)
|
31
|
-
files << PROJ.manifest_file
|
32
|
-
files.sort!
|
33
|
-
end
|
34
|
-
File.open(PROJ.manifest_file, 'w') {|fp| fp.puts files}
|
35
|
-
end
|
36
|
-
|
37
|
-
task :assert do
|
38
|
-
files = manifest_files
|
39
|
-
manifest = File.read(PROJ.manifest_file).split($/)
|
40
|
-
raise "ERROR: #{PROJ.manifest_file} is out of date" unless files == manifest
|
41
|
-
end
|
42
|
-
|
43
|
-
end # namespace :manifest
|
44
|
-
|
45
|
-
desc 'Alias to manifest:check'
|
46
|
-
task :manifest => 'manifest:check'
|
47
|
-
|
48
|
-
# EOF
|