mo 0.0.1 → 0.0.2
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/lib/mo/railtie.rb +26 -0
- data/lib/mo/version.rb +1 -1
- metadata +4 -4
data/lib/mo/railtie.rb
CHANGED
@@ -14,6 +14,32 @@ module Mo
|
|
14
14
|
system "sed -e 's/[ \t]*$//' -i #{file}"
|
15
15
|
end
|
16
16
|
end
|
17
|
+
|
18
|
+
# Courtesy of changa.
|
19
|
+
desc "Add utf-8 encoding on files that don't have it"
|
20
|
+
task :encoding do
|
21
|
+
require 'find'
|
22
|
+
files_to_convert = []
|
23
|
+
|
24
|
+
Find.find Rails.root.to_s do |f|
|
25
|
+
if File.file?(f) && f =~ /\.(rb|feature|rake)$/ && `head -n 1 #{f}|grep '# encoding'`.empty?
|
26
|
+
files_to_convert << f
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
print "Converting #{files_to_convert.size} files"
|
31
|
+
puts if verbose
|
32
|
+
files_to_convert.each do |f|
|
33
|
+
system "sed -i -r '1 s/^(.*)$/# encoding: utf-8\\n\\1/g' #{f}"
|
34
|
+
if verbose
|
35
|
+
puts " * #{f}"
|
36
|
+
else
|
37
|
+
print '.'
|
38
|
+
end
|
39
|
+
end
|
40
|
+
puts unless verbose
|
41
|
+
|
42
|
+
end
|
17
43
|
end
|
18
44
|
end
|
19
45
|
end
|
data/lib/mo/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,9 +9,9 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-12-
|
12
|
+
date: 2011-12-20 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
|
-
description:
|
14
|
+
description: Mo helps you keep your rails project clean.
|
15
15
|
email: jboyer@af83.com
|
16
16
|
executables: []
|
17
17
|
extensions: []
|
@@ -43,5 +43,5 @@ rubyforge_project:
|
|
43
43
|
rubygems_version: 1.8.10
|
44
44
|
signing_key:
|
45
45
|
specification_version: 3
|
46
|
-
summary:
|
46
|
+
summary: Mo helps you keep your rails project clean.
|
47
47
|
test_files: []
|