mo 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/mo/railtie.rb +26 -0
  2. data/lib/mo/version.rb +1 -1
  3. metadata +4 -4
@@ -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
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Mo
4
- VERSION = "0.0.1"
4
+ VERSION = "0.0.2"
5
5
  end
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.1
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-11 00:00:00.000000000 Z
12
+ date: 2011-12-20 00:00:00.000000000 Z
13
13
  dependencies: []
14
- description: ! '[Mo helps you keep your rails project clean.]'
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: ! '[Mo helps you keep your rails project clean.]'
46
+ summary: Mo helps you keep your rails project clean.
47
47
  test_files: []