syntax_fix 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -32,7 +32,4 @@ Usage
32
32
 
33
33
  `-v` or `--verbose` - be verbose about the actions
34
34
 
35
- Contributing
36
- ============
37
-
38
- If you consider to contribute to syntax_fix gem, please try to cover your code with tests
35
+ `-p [PATH]` or `--path [PATH]` - specify the relative path to start actions from
data/Rakefile CHANGED
@@ -1 +1,6 @@
1
1
  require "bundler/gem_tasks"
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -11,9 +11,14 @@ optparse = OptionParser.new do |opts|
11
11
  opts.on( '-v', '--verbose', 'Be verbose about the actions' ) do
12
12
  checker.verbose = true
13
13
  end
14
+ opts.on( '-p [PATH]', '--path [PATH]', 'Specify the relative path to start actions from' ) do |path|
15
+ checker.rel_path = path
16
+ end
17
+ checker.rel_path ||= '.'
14
18
  end
15
19
  optparse.parse!
16
20
 
17
21
  puts 'Reading files...' if checker.verbose
18
- checker.fix_code(File.expand_path('.'))
19
- puts 'Done!' if checker.verbose
22
+ path = File.expand_path(checker.rel_path)
23
+ checker.fix_code(path)
24
+ puts 'Done!' if checker.verbose
@@ -1,5 +1,5 @@
1
+ #!/usr/bin/env ruby
1
2
  $:.push File.expand_path(File.dirname(__FILE__))
2
3
  require "syntax_fix/version"
3
-
4
- SyntaxFix.autoload :Checker, 'syntax_fix/checker.rb'
5
- SyntaxFix.autoload :DirFile, 'syntax_fix/dir_file.rb'
4
+ require 'syntax_fix/checker.rb'
5
+ require 'syntax_fix/dir_file.rb'
@@ -1,6 +1,6 @@
1
1
  module SyntaxFix
2
2
  class Checker
3
- attr_accessor :verbose
3
+ attr_accessor :verbose, :rel_path
4
4
 
5
5
  def fix_code(path)
6
6
  Dir.foreach(path) do |name|
@@ -11,7 +11,7 @@ module SyntaxFix
11
11
 
12
12
  private
13
13
  def fix_file(current_item)
14
- return if !current_item.correct_file?
14
+ return unless current_item.correct_file?
15
15
  content = current_item.read_file
16
16
  fixed_content = fix_syntax(content)
17
17
  if content != fixed_content
@@ -1,3 +1,3 @@
1
1
  module SyntaxFix
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syntax_fix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-02 00:00:00.000000000 Z
12
+ date: 2012-12-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70094412006620 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,12 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70094412006620
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
25
30
  description: Replace Ruby 1.8 syntax with the Ruby 1.9 syntax all over the project
26
31
  email:
27
32
  - parizhskiy@gmail.com
@@ -71,17 +76,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
71
76
  version: '0'
72
77
  requirements: []
73
78
  rubyforge_project: syntax_fix
74
- rubygems_version: 1.8.11
79
+ rubygems_version: 1.8.24
75
80
  signing_key:
76
81
  specification_version: 3
77
82
  summary: Replace Ruby 1.8 syntax with the modern one
78
- test_files:
79
- - spec/fixtures/nested/nested.rb
80
- - spec/fixtures/nested/not_rb.txt
81
- - spec/fixtures/not_rb.dat
82
- - spec/fixtures/test.rb
83
- - spec/fixtures/test/fixed_test.txt
84
- - spec/fixtures/test/test.rb
85
- - spec/spec_helper.rb
86
- - spec/specs/checker_spec.rb
87
- - spec/specs/dir_file_spec.rb
83
+ test_files: []