black_operation 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: caf36fea7f2f86de853b647513603307544d8ced
4
- data.tar.gz: 7db7409da8d64851bba030560dd7b502e7f6c5d4
3
+ metadata.gz: 0117de24f433f0e343e6ca5c9cd82ee1fb9fde28
4
+ data.tar.gz: f09186ace61946d6e35b8d35bd8c7dbb93a96a12
5
5
  SHA512:
6
- metadata.gz: 775429559e4237f3a267d2538b2a4aad8f1297052fca21b89628493688fd55d337655838d800a9e8c323766ef91650b92bbcf0e406443475fb3193ef81c54038
7
- data.tar.gz: 0d9ff2480960236a7ba4e5682f33b0351dde5a3c102aa07c011cfd4520a681b804296403396676286492b51f461e9481346869e3b19fb2191b6cfccc49c8c334
6
+ metadata.gz: 6c4ea99e3d941fa26abb2fc6da8a673167d31cfaaa56041a2293fa95037fe376b4e32d73e25fbdf0e53eafbe74c48784a4ecc37c54dc4671fdf41be1701b55e1
7
+ data.tar.gz: 2ea8a8badc506a1177b0811278f139dd8ab1010d96aa12b7f297bff6fac15455cdc1fe86902f68142db8baa556251bbeb92b2c83a1a25fdf54818eeeaa53e716
@@ -1,3 +1,3 @@
1
1
  module BlackOperation
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
@@ -33,17 +33,22 @@ namespace :black_operation do
33
33
  prefix = Rails.configuration.assets.prefix
34
34
  path = "public"+prefix+"/**/*"
35
35
  Dir.glob(path) do |file|
36
- if File.extname(file.to_s) == ".css" || File.extname(file.to_s.chomp(File.extname(file.to_s))) == ".css"
37
- puts "Full File: #{file.to_s}"
38
- file_handle = File.open("./"+file.to_s,"rb")
39
- file_contents = file_handle.read
40
- file_contents.gsub!(/images\//,"/images/")
41
- #fix double forward-slash
42
- file_contents.gsub!(/\/\/images\//,"/images/");
43
- file_handle.close
44
- file_handle = File.new(file.to_s,"wb")
45
- file_handle.write(file_contents)
46
- file_handle.close
36
+ if File.readable?(file.to_s) && File.writable?(file.to_s)
37
+ if File.extname(file.to_s) == ".css" || File.extname(file.to_s.chomp(File.extname(file.to_s))) == ".css"
38
+ puts "Full File: #{file.to_s}"
39
+ file_handle = File.open("./"+file.to_s,"rb")
40
+ file_contents = file_handle.read
41
+ file_contents.gsub!(/images\//,"/images/")
42
+ #fix double forward-slash
43
+ file_contents.gsub!(/\/\/images\//,"/images/");
44
+ file_handle.close
45
+ file_handle = File.new(file.to_s,"wb")
46
+ file_handle.write(file_contents)
47
+ file_handle.close
48
+ end
49
+ else
50
+ puts "File: #{file.to_s}"
51
+ puts "Skipping...file not readable or writable.\n"
47
52
  end
48
53
  end
49
54
  #Move the images over
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: black_operation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Travis Pessetto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-18 00:00:00.000000000 Z
11
+ date: 2014-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler