lockdown 0.7.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. data/.DS_Store +0 -0
  2. data/History.txt +3 -0
  3. data/README.txt +1 -1
  4. data/Rakefile +16 -1
  5. data/lib/lockdown/context.rb +41 -0
  6. data/lib/lockdown/database.rb +11 -14
  7. data/lib/lockdown/frameworks/rails/controller.rb +57 -4
  8. data/lib/lockdown/frameworks/rails/view.rb +1 -1
  9. data/lib/lockdown/frameworks/rails.rb +21 -10
  10. data/lib/lockdown/helper.rb +1 -1
  11. data/lib/lockdown/permission.rb +204 -0
  12. data/lib/lockdown/rules.rb +287 -0
  13. data/lib/lockdown/session.rb +8 -6
  14. data/lib/lockdown/system.rb +35 -88
  15. data/lib/lockdown.rb +52 -49
  16. data/rails_generators/.DS_Store +0 -0
  17. data/rails_generators/lockdown/.DS_Store +0 -0
  18. data/rails_generators/lockdown/lockdown_generator.rb +5 -5
  19. data/rails_generators/lockdown/templates/.DS_Store +0 -0
  20. data/rails_generators/lockdown/templates/lib/.DS_Store +0 -0
  21. data/rails_generators/lockdown/templates/lib/lockdown/init.rb +27 -19
  22. data/rails_generators/lockdown/templates/lib/lockdown/session.rb +1 -3
  23. data/spec/lockdown/database_spec.rb +158 -0
  24. data/spec/lockdown/frameworks/rails/controller_spec.rb +220 -0
  25. data/spec/lockdown/frameworks/rails/view_spec.rb +87 -0
  26. data/spec/lockdown/frameworks/rails_spec.rb +170 -0
  27. data/spec/lockdown/permission_spec.rb +156 -0
  28. data/spec/lockdown/rules_spec.rb +109 -0
  29. data/spec/lockdown/session_spec.rb +88 -0
  30. data/spec/lockdown/system_spec.rb +59 -0
  31. data/spec/lockdown_spec.rb +19 -0
  32. data/spec/rcov.opts +5 -0
  33. data/spec/spec.opts +3 -0
  34. data/spec/spec_helper.rb +1 -0
  35. data/tasks/post_load.rake +2 -7
  36. data/tasks/setup.rb +24 -3
  37. metadata +23 -12
  38. data/.gitignore +0 -5
  39. data/Manifest.txt +0 -51
  40. data/lib/lockdown/controller.rb +0 -64
  41. data/lib/lockdown/frameworks/merb/controller.rb +0 -63
  42. data/lib/lockdown/frameworks/merb/view.rb +0 -32
  43. data/lib/lockdown/frameworks/merb.rb +0 -84
  44. data/lib/lockdown/orms/data_mapper.rb +0 -70
  45. data/lib/lockdown/rights.rb +0 -208
  46. 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