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.
- data/README.textile +2 -29
- data/VERSION +1 -1
- data/lib/sugar-high/class_ext.rb +2 -133
- data/lib/sugar-high/file.rb +10 -11
- data/lib/sugar-high/file_ext.rb +13 -11
- data/lib/sugar-high/rails/concerns.rb +10 -4
- data/spec/sugar-high/file_spec.rb +26 -28
- data/spec/sugar-high/rails/concerns_spec.rb +31 -1
- data/spec/sugar-high/rails/fixture_user/scopes.rb +4 -0
- data/spec/sugar-high/rails/fixture_user/validations.rb +4 -0
- data/spec/sugar-high/rails/shared/associations.rb +1 -0
- data/spec/sugar-high/rails/shared/caching.rb +4 -0
- data/sugar-high.gemspec +6 -42
- metadata +19 -55
- data/lib/sugar-high/file_mutate.rb +0 -2
- data/lib/sugar-high/file_mutate/append_content.rb +0 -17
- data/lib/sugar-high/file_mutate/delete.rb +0 -29
- data/lib/sugar-high/file_mutate/insert_content.rb +0 -62
- data/lib/sugar-high/file_mutate/mutate.rb +0 -57
- data/lib/sugar-high/file_mutate/overwrite_content.rb +0 -17
- data/lib/sugar-high/file_mutate/remove_content.rb +0 -33
- data/lib/sugar-high/file_mutate/replace_content.rb +0 -45
- data/lib/sugar-high/file_mutation.rb +0 -58
- data/sandbox/test_routes_mutate.rb +0 -8
- data/spec/auto_load_blank_root.rb +0 -3
- data/spec/autoload_blank_root.rb +0 -3
- data/spec/autoload_blank_root/hello.rb +0 -6
- data/spec/autoload_blank_root/sailor.rb +0 -7
- data/spec/fixtures/application_file.rb +0 -6
- data/spec/fixtures/autoload_modules.rb +0 -3
- data/spec/fixtures/autoload_modules/subdir/first.rb +0 -7
- data/spec/fixtures/autoload_modules/subdir/second.rb +0 -5
- data/spec/fixtures/autoload_modules/subdir/third.rb +0 -4
- data/spec/fixtures/autoload_modules_root.rb +0 -3
- data/spec/fixtures/autoload_modules_root/first.rb +0 -7
- data/spec/fixtures/autoload_modules_root/second.rb +0 -4
- data/spec/fixtures/autoload_modules_root/third.rb +0 -7
- data/spec/fixtures/autoload_modulez.rb +0 -4
- data/spec/fixtures/autoload_modulez/first.rb +0 -7
- data/spec/fixtures/autoload_modulez/second.rb +0 -5
- data/spec/fixtures/autoload_modulez/third_one_here.rb +0 -4
- data/spec/fixtures/class_file.rb +0 -22
- data/spec/fixtures/class_file.txt +0 -0
- data/spec/fixtures/content_file.txt +0 -1
- data/spec/fixtures/routes_file.rb +0 -85
- data/spec/sugar-high/class_ext_spec.rb +0 -189
- data/spec/sugar-high/file/file_dsl_spec.rb +0 -4
- data/spec/sugar-high/file_mutate/append_content_spec.rb +0 -61
- data/spec/sugar-high/file_mutate/delete_spec.rb +0 -47
- data/spec/sugar-high/file_mutate/insert_before_last_spec.rb +0 -56
- data/spec/sugar-high/file_mutate/insert_content_spec.rb +0 -111
- data/spec/sugar-high/file_mutate/overwrite_content_spec.rb +0 -80
- data/spec/sugar-high/file_mutate/remove_content_spec.rb +0 -109
- 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
|