rak 1.3 → 1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/bin/rak +6 -3
  2. data/lib/rak.rb +1 -1
  3. data/spec/rak_spec.rb +8 -1
  4. metadata +36 -25
data/bin/rak CHANGED
@@ -31,7 +31,7 @@ class String
31
31
  end
32
32
 
33
33
  class Rak
34
- VERSION = "1.3"
34
+ VERSION = "1.4"
35
35
 
36
36
  FILE_COLOUR = "\033[1;31m"
37
37
  MATCH_COLOUR = "\033[1;37m\033[41m"
@@ -81,7 +81,7 @@ END
81
81
  :plone => %w( .cpt .cpy .metadata .pt .py ),
82
82
  :prolog => %w( .ecl .pl ),
83
83
  :python => %w( .py ),
84
- :ruby => %w( .erb .haml .rake .rb .rhtml .rjs .rxml Rakefile ),
84
+ :ruby => %w( .erb .haml .rake .rb .rhtml .rjs .rxml Rakefile Gemfile ),
85
85
  :scala => %w( .scala ),
86
86
  :scheme => %w( .scm .ss ),
87
87
  :sed => %w( .sed ),
@@ -175,7 +175,7 @@ END
175
175
  [ '-e', '--line-end', GetoptLong::NO_ARGUMENT ],
176
176
  [ '--eval', GetoptLong::REQUIRED_ARGUMENT ]
177
177
  )
178
-
178
+
179
179
  opt[:max_count] = nil
180
180
  opt[:only_print_filelist] = false
181
181
  opt[:print_filename] = true
@@ -489,6 +489,9 @@ END
489
489
  str = "(?:" + str + ")$"
490
490
  end
491
491
  str = str.gsub("~bang", "!").gsub("~ques", "?")
492
+ if str.respond_to?(:force_encoding)
493
+ str.force_encoding("ASCII-8BIT")
494
+ end
492
495
  if $use_onig
493
496
  flags = opt[:ignore_case] ? Oniguruma::OPTION_IGNORECASE : nil
494
497
  Oniguruma::ORegexp.new(str, :options => flags)
data/lib/rak.rb CHANGED
@@ -1,4 +1,4 @@
1
1
 
2
2
  class Rak
3
- VERSION = "1.3"
3
+ VERSION = "1.4"
4
4
  end
@@ -1,4 +1,4 @@
1
-
1
+ #encoding: utf-8
2
2
  require "spec_helper"
3
3
 
4
4
  describe "Rak", "with no options" do
@@ -71,6 +71,13 @@ describe "Rak", "with no options" do
71
71
  1|rakefile rakefile *Canceron* rakefile
72
72
  END
73
73
  end
74
+
75
+ it "matches unicode snowmen" do
76
+ rak("☃", :dir => "example2").should == <<-END
77
+ *snowman.txt*
78
+ 2|# *☃*
79
+ END
80
+ end
74
81
  end
75
82
 
76
83
  describe "Rak", "with FILE or STDIN inputs" do
metadata CHANGED
@@ -1,26 +1,31 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rak
3
- version: !ruby/object:Gem::Version
4
- version: '1.3'
5
- prerelease:
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 1
7
+ - 4
8
+ version: "1.4"
6
9
  platform: ruby
7
- authors:
10
+ authors:
8
11
  - Daniel Lucraft
9
12
  autorequire:
10
13
  bindir: bin
11
14
  cert_chain: []
12
- date: 2011-12-03 00:00:00.000000000 +00:00
15
+
16
+ date: 2012-01-15 00:00:00 +00:00
13
17
  default_executable: rak
14
18
  dependencies: []
15
- description: ! " Grep replacement, recursively scans directories to match a given
16
- Ruby regular expression. Prints highlighted results.\n Based on the Perl tool
17
- 'ack' by Andy Lester. \n"
19
+
20
+ description: " Grep replacement, recursively scans directories to match a given Ruby regular expression. Prints highlighted results.\n Based on the Perl tool 'ack' by Andy Lester. \n"
18
21
  email: dan@fluentradical.com
19
- executables:
22
+ executables:
20
23
  - rak
21
24
  extensions: []
25
+
22
26
  extra_rdoc_files: []
23
- files:
27
+
28
+ files:
24
29
  - History.txt
25
30
  - Manifest.txt
26
31
  - README.txt
@@ -31,26 +36,32 @@ files:
31
36
  has_rdoc: true
32
37
  homepage: http://rak.rubyforge.org
33
38
  licenses: []
39
+
34
40
  post_install_message:
35
41
  rdoc_options: []
36
- require_paths:
42
+
43
+ require_paths:
37
44
  - lib
38
- required_ruby_version: !ruby/object:Gem::Requirement
39
- none: false
40
- requirements:
41
- - - ! '>='
42
- - !ruby/object:Gem::Version
43
- version: '0'
44
- required_rubygems_version: !ruby/object:Gem::Requirement
45
- none: false
46
- requirements:
47
- - - ! '>='
48
- - !ruby/object:Gem::Version
49
- version: '0'
45
+ required_ruby_version: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ segments:
50
+ - 0
51
+ version: "0"
52
+ required_rubygems_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ segments:
57
+ - 0
58
+ version: "0"
50
59
  requirements: []
60
+
51
61
  rubyforge_project: rak
52
- rubygems_version: 1.6.2
62
+ rubygems_version: 1.3.6
53
63
  signing_key:
54
64
  specification_version: 3
55
65
  summary: A grep replacement in Ruby, type "rak pattern".
56
66
  test_files: []
67
+