sugar-high 0.5.5 → 0.6.0

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.
Files changed (54) hide show
  1. data/README.textile +2 -29
  2. data/VERSION +1 -1
  3. data/lib/sugar-high/class_ext.rb +2 -133
  4. data/lib/sugar-high/file.rb +10 -11
  5. data/lib/sugar-high/file_ext.rb +13 -11
  6. data/lib/sugar-high/rails/concerns.rb +10 -4
  7. data/spec/sugar-high/file_spec.rb +26 -28
  8. data/spec/sugar-high/rails/concerns_spec.rb +31 -1
  9. data/spec/sugar-high/rails/fixture_user/scopes.rb +4 -0
  10. data/spec/sugar-high/rails/fixture_user/validations.rb +4 -0
  11. data/spec/sugar-high/rails/shared/associations.rb +1 -0
  12. data/spec/sugar-high/rails/shared/caching.rb +4 -0
  13. data/sugar-high.gemspec +6 -42
  14. metadata +19 -55
  15. data/lib/sugar-high/file_mutate.rb +0 -2
  16. data/lib/sugar-high/file_mutate/append_content.rb +0 -17
  17. data/lib/sugar-high/file_mutate/delete.rb +0 -29
  18. data/lib/sugar-high/file_mutate/insert_content.rb +0 -62
  19. data/lib/sugar-high/file_mutate/mutate.rb +0 -57
  20. data/lib/sugar-high/file_mutate/overwrite_content.rb +0 -17
  21. data/lib/sugar-high/file_mutate/remove_content.rb +0 -33
  22. data/lib/sugar-high/file_mutate/replace_content.rb +0 -45
  23. data/lib/sugar-high/file_mutation.rb +0 -58
  24. data/sandbox/test_routes_mutate.rb +0 -8
  25. data/spec/auto_load_blank_root.rb +0 -3
  26. data/spec/autoload_blank_root.rb +0 -3
  27. data/spec/autoload_blank_root/hello.rb +0 -6
  28. data/spec/autoload_blank_root/sailor.rb +0 -7
  29. data/spec/fixtures/application_file.rb +0 -6
  30. data/spec/fixtures/autoload_modules.rb +0 -3
  31. data/spec/fixtures/autoload_modules/subdir/first.rb +0 -7
  32. data/spec/fixtures/autoload_modules/subdir/second.rb +0 -5
  33. data/spec/fixtures/autoload_modules/subdir/third.rb +0 -4
  34. data/spec/fixtures/autoload_modules_root.rb +0 -3
  35. data/spec/fixtures/autoload_modules_root/first.rb +0 -7
  36. data/spec/fixtures/autoload_modules_root/second.rb +0 -4
  37. data/spec/fixtures/autoload_modules_root/third.rb +0 -7
  38. data/spec/fixtures/autoload_modulez.rb +0 -4
  39. data/spec/fixtures/autoload_modulez/first.rb +0 -7
  40. data/spec/fixtures/autoload_modulez/second.rb +0 -5
  41. data/spec/fixtures/autoload_modulez/third_one_here.rb +0 -4
  42. data/spec/fixtures/class_file.rb +0 -22
  43. data/spec/fixtures/class_file.txt +0 -0
  44. data/spec/fixtures/content_file.txt +0 -1
  45. data/spec/fixtures/routes_file.rb +0 -85
  46. data/spec/sugar-high/class_ext_spec.rb +0 -189
  47. data/spec/sugar-high/file/file_dsl_spec.rb +0 -4
  48. data/spec/sugar-high/file_mutate/append_content_spec.rb +0 -61
  49. data/spec/sugar-high/file_mutate/delete_spec.rb +0 -47
  50. data/spec/sugar-high/file_mutate/insert_before_last_spec.rb +0 -56
  51. data/spec/sugar-high/file_mutate/insert_content_spec.rb +0 -111
  52. data/spec/sugar-high/file_mutate/overwrite_content_spec.rb +0 -80
  53. data/spec/sugar-high/file_mutate/remove_content_spec.rb +0 -109
  54. data/spec/sugar-high/file_mutate/replace_content_spec.rb +0 -33
@@ -1,33 +0,0 @@
1
- require 'spec_helper'
2
- require 'sugar-high/file_mutate'
3
- File.mutate_ext :all
4
-
5
- describe "SugarHigh::File" do
6
- let(:empty_file) { fixture_file 'empty.txt' }
7
- let(:non_empty_file) { fixture_file 'non-empty.txt'}
8
- let(:class_file) { fixture_file 'class_file.rb'}
9
- let(:replace_file) { fixture_file 'file.txt' }
10
- let(:file_to_delete) { fixture_file 'file_to_delete.txt' }
11
- let(:routes_file) { fixture_file 'routes_file.rb' }
12
- let(:app_file) { fixture_file 'application_file.rb' }
13
-
14
- describe '#replace_content_from' do
15
- let(:replace_file) { fixture_file 'file.txt' }
16
-
17
- it "should replace content from existing file - class method" do
18
- File.overwrite(replace_file) do
19
- 'Hello You'
20
- end
21
- File.replace_content_from replace_file, :where => 'You', :with => 'Me'
22
- File.read(replace_file).should_not match /You/
23
- end
24
-
25
- it 'should remove content from existing file - instance method #replace_content' do
26
- File.overwrite(replace_file) do
27
- 'Hello You'
28
- end
29
- File.new(replace_file).replace_content :where => 'You', :with => 'Me'
30
- File.read(replace_file).should_not match /You/
31
- end
32
- end
33
- end