tabs2spaces 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  Tabs2spaces
2
2
  ===========
3
3
 
4
- Covert all tabs in spaces using the shell command expand
4
+ Covert all tabs in spaces using the shell commands expand, can undo using unexpand shell command (convert spaces into tabs)
5
5
 
6
6
  ## Installation
7
7
 
@@ -27,10 +27,11 @@ Example of basic usage convert tabs to 2 spaces in all files .rb inside the actu
27
27
 
28
28
  Parameters
29
29
 
30
- tabs2paces -n NUMBER -p "PATTERN"
30
+ tabs2paces -n NUMBER -p "PATTERN" -i
31
31
 
32
32
  NUMBER: number of spaces to replace the tab by default is 2 (OPTIONAL)
33
33
  PATTERN: Pattern to determine the files by default is "*.rb", use "*.js" (OPTIONAL)
34
+ INVERSED: -i parameter set the script to convert spaces into tabs using NUMBER y PATTERN
34
35
 
35
36
  Sintaxis
36
37
 
data/Rakefile CHANGED
@@ -1 +1,10 @@
1
1
  require "bundler/gem_tasks"
2
+
3
+ desc 'Tags version, pushes to remote, and pushes gem'
4
+ task :release => :build do
5
+ sh "git tag v#{Tabs2spaces::VERSION}"
6
+ sh "git push github master"
7
+ sh "git push github v#{Tabs2spaces::VERSION}"
8
+ sh "gem push mercadopago-api-#{Tabs2spaces::VERSION}.gem"
9
+ end
10
+
data/bin/tabs2spaces CHANGED
@@ -6,7 +6,8 @@ require 'optparse'
6
6
 
7
7
  options = {
8
8
  :number => 2,
9
- :pattern => "*.rb"
9
+ :pattern => "*.rb",
10
+ :inversed => false
10
11
  }
11
12
  OptionParser.new do |opts|
12
13
  opts.banner = "Usage: tabs2spaces.rb [options] DIRECTORY"
@@ -18,6 +19,10 @@ OptionParser.new do |opts|
18
19
  opts.on("-p", "--pattern [PATTERN]", "Pattern of files to apply tabs2spaces (default: '*.rb')") do |pattern|
19
20
  options[:pattern] = pattern
20
21
  end
22
+
23
+ opts.on("-i", "--[no-]inversed", "Do the inverse process, convert spaces into tabs") do |inverse|
24
+ options[:inversed] = inverse
25
+ end
21
26
  end.parse!
22
27
 
23
28
  tabs2spaces = Tabs2spaces::Converter.new(ARGV[0], options)
data/lib/tabs2spaces.rb CHANGED
@@ -9,8 +9,13 @@ module Tabs2spaces
9
9
  end
10
10
 
11
11
  def file_expand(file)
12
- puts "Expanding tabs on " + file
13
- return `expand -t #{@options[:number]} -i #{file}`
12
+ unless @options[:inversed]
13
+ puts "Expanding tabs on: " + file
14
+ return `expand -i -t #{@options[:number]} #{file}`
15
+ else
16
+ puts "Unexpanding spaces on: " + file
17
+ return `unexpand --first-only -t #{@options[:number]} #{file}`
18
+ end
14
19
  end
15
20
 
16
21
  def file_write(file, data)
@@ -1,3 +1,3 @@
1
1
  module Tabs2spaces
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,18 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tabs2spaces
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Sergio Marin
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-09-14 00:00:00.000000000 Z
12
+ date: 2013-09-15 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: bundler
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - ~>
18
20
  - !ruby/object:Gem::Version
@@ -20,6 +22,7 @@ dependencies:
20
22
  type: :development
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
27
  - - ~>
25
28
  - !ruby/object:Gem::Version
@@ -27,15 +30,17 @@ dependencies:
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: rake
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
- - - '>='
35
+ - - ! '>='
32
36
  - !ruby/object:Gem::Version
33
37
  version: '0'
34
38
  type: :development
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
- - - '>='
43
+ - - ! '>='
39
44
  - !ruby/object:Gem::Version
40
45
  version: '0'
41
46
  description: Covert all tabs in spaces using the shell command expand
@@ -58,25 +63,26 @@ files:
58
63
  homepage: http://github.com/highercomve/tabs2spaces
59
64
  licenses:
60
65
  - MIT
61
- metadata: {}
62
66
  post_install_message:
63
67
  rdoc_options: []
64
68
  require_paths:
65
69
  - lib
66
70
  required_ruby_version: !ruby/object:Gem::Requirement
71
+ none: false
67
72
  requirements:
68
- - - '>='
73
+ - - ! '>='
69
74
  - !ruby/object:Gem::Version
70
75
  version: '0'
71
76
  required_rubygems_version: !ruby/object:Gem::Requirement
77
+ none: false
72
78
  requirements:
73
- - - '>='
79
+ - - ! '>='
74
80
  - !ruby/object:Gem::Version
75
81
  version: '0'
76
82
  requirements: []
77
83
  rubyforge_project:
78
- rubygems_version: 2.0.7
84
+ rubygems_version: 1.8.24
79
85
  signing_key:
80
- specification_version: 4
86
+ specification_version: 3
81
87
  summary: A gem to convert tabs2spaces in all files on a project
82
88
  test_files: []
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 3980ffa57661b0462321603263fcc49c670e9993
4
- data.tar.gz: 2b1eb5bd6fc6b109dd4613b08e15b51794feefd5
5
- SHA512:
6
- metadata.gz: 994020d2cf809a67b090a625832247b5b2007064f21db2bc3dcd1ff01fcc28775915bd357e235f2d44953b1dc81e27bab920eb283253cecbff3f462c121050f5
7
- data.tar.gz: 427167922f81a1369cd425607668bcb41f8c4e4d5777fe47af83e7162c51ce517ccb16b5f24558fe95dc98c353ee1ad9c9934b7d47cf1598a220c6fae76080b5