ruby-beautify 0.97.1 → 0.97.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 845edab077c5c5bf51a6e33fa1cce9d9337c70b4
4
- data.tar.gz: 334487716f67201c629c3ce0ee46dafd21a8943b
3
+ metadata.gz: 95b3bdeb89a34b2183b43d667c71c8ce3e95c6e4
4
+ data.tar.gz: b4d4147b1c41919ce93522b0489c3dcd1e958461
5
5
  SHA512:
6
- metadata.gz: 9cd313b20304d0b0247015da7cfb8842a2a2bacf34ace4c2cca3256eb406b0022bb6be65c3cf95b4675989616a3e4b7e14ae8d790aed837c354959c91cf3c2c1
7
- data.tar.gz: 4bf21cb165f737d4d97c4778bac5fb942b9cd4f519e34f691932b58b05f00aa941fd80b61ab1ec05c935026e0f79f5bff754a21462972b6601f1ebd02c4a039a
6
+ metadata.gz: 892a887b34598ab7918c33efe425f61a268ac8ca30f405ae887456187e5efe37b3b0593f421416cfd83248f2cbd0597c4b07f2c88b5fa72d97d55ae9b0c5d832
7
+ data.tar.gz: e352c5f70a78c3c11ae9cfbd1cd4779218c9ab07eb21c7be46ab74543df45776cf36eb82ce3550d3c8be0a32e51abcdf681ed9b213fbe6efa2a87a38b48a8f5f
@@ -1,3 +1,6 @@
1
+ ## 0.97.2
2
+ * Thanks goes to @bachue for discovering that `ruby-beautify` was not honoring spaces and indent count on file overwrites.
3
+
1
4
  ## 0.97.1
2
5
  * Now with more config file flavor! (check the [README.md]).
3
6
  * All tests green.
@@ -47,7 +47,7 @@ else
47
47
  if @overwrite
48
48
  if syntax_ok? content
49
49
  fh = open(file, 'w')
50
- fh.write pretty_string content
50
+ fh.write pretty_string content, indent_token: @indent_token, indent_count: @indent_count
51
51
  fh.sync
52
52
  fh.close
53
53
  else
@@ -47,7 +47,7 @@ else
47
47
  if @overwrite
48
48
  if syntax_ok? content
49
49
  fh = open(file, 'w')
50
- fh.write pretty_string content
50
+ fh.write pretty_string content, indent_token: @indent_token, indent_count: @indent_count
51
51
  fh.sync
52
52
  fh.close
53
53
  else
@@ -1,3 +1,3 @@
1
1
  module RubyBeautify
2
- VERSION = "0.97.1"
2
+ VERSION = "0.97.2"
3
3
  end
@@ -0,0 +1,24 @@
1
+ require 'spec_helper.rb'
2
+
3
+ # unit tests suck. But I do want to make sure this one function behaves as expected.
4
+ # it simplifies the rest of the testing process (by not requiring multiple passes of each scenario).
5
+ describe "Ruby Beautify Library" do
6
+ before :all do
7
+ @ugly_string = File.open('spec/usage_scenarios/pre_indented.rb').read
8
+ @pretty_string = File.open('spec/usage_scenarios/pre_indented_pretty.rb').read
9
+ @pretty_string_tabs = @pretty_string.gsub("\t", "\t\t")
10
+ @pretty_string_space = File.open('spec/usage_scenarios/pre_indented_pretty_space.rb').read
11
+ end
12
+
13
+ describe "#pretty_string" do
14
+ it "will indent by tab ( by default )" do
15
+ expect(RubyBeautify.pretty_string(@ugly_string)).to eq @pretty_string
16
+ end
17
+ it "will indent by space" do
18
+ expect(RubyBeautify.pretty_string(@ugly_string, indent_token:' ')).to eq @pretty_string_space
19
+ end
20
+ it "will honor indent count" do
21
+ expect(RubyBeautify.pretty_string(@ugly_string)).to eq @pretty_string
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,12 @@
1
+ # Test for already indented blocks
2
+ class There2 < There
3
+ def m1()
4
+ puts "m1"
5
+ end
6
+ def m2()
7
+ puts "m2"
8
+ end
9
+ def m3()
10
+ puts "m3"
11
+ end
12
+ end
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-beautify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.97.1
4
+ version: 0.97.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ernie Brodeur
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-19 00:00:00.000000000 Z
11
+ date: 2015-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  description: a cli tool (and module) to beautify ruby code.
@@ -60,9 +60,9 @@ executables:
60
60
  extensions: []
61
61
  extra_rdoc_files: []
62
62
  files:
63
- - .gitignore
64
- - .rspec
65
- - .travis.yml
63
+ - ".gitignore"
64
+ - ".rspec"
65
+ - ".travis.yml"
66
66
  - CONTRIB.md
67
67
  - Gemfile
68
68
  - Guardfile
@@ -84,6 +84,7 @@ files:
84
84
  - spec/binary_scenarios/small_example.rb
85
85
  - spec/binary_scenarios/spaces_after.rb
86
86
  - spec/binary_scenarios/spaces_before.rb
87
+ - spec/lib/ruby-beautify_spec.rb
87
88
  - spec/ruby-beautify.dotfile
88
89
  - spec/spec_helper.rb
89
90
  - spec/usage_scenarios/README.md
@@ -101,6 +102,7 @@ files:
101
102
  - spec/usage_scenarios/or_equals_pretty.rb
102
103
  - spec/usage_scenarios/pre_indented.rb
103
104
  - spec/usage_scenarios/pre_indented_pretty.rb
105
+ - spec/usage_scenarios/pre_indented_pretty_space.rb
104
106
  - spec/usage_scenarios_spec.rb
105
107
  homepage: https://github.com/erniebrodeur/ruby-beautify
106
108
  licenses: []
@@ -111,17 +113,17 @@ require_paths:
111
113
  - lib
112
114
  required_ruby_version: !ruby/object:Gem::Requirement
113
115
  requirements:
114
- - - '>='
116
+ - - ">="
115
117
  - !ruby/object:Gem::Version
116
118
  version: '2.0'
117
119
  required_rubygems_version: !ruby/object:Gem::Requirement
118
120
  requirements:
119
- - - '>='
121
+ - - ">="
120
122
  - !ruby/object:Gem::Version
121
123
  version: '0'
122
124
  requirements: []
123
125
  rubyforge_project:
124
- rubygems_version: 2.4.5
126
+ rubygems_version: 2.2.2
125
127
  signing_key:
126
128
  specification_version: 4
127
129
  summary: a cli tool (and module) to beautify ruby code.
@@ -135,6 +137,7 @@ test_files:
135
137
  - spec/binary_scenarios/small_example.rb
136
138
  - spec/binary_scenarios/spaces_after.rb
137
139
  - spec/binary_scenarios/spaces_before.rb
140
+ - spec/lib/ruby-beautify_spec.rb
138
141
  - spec/ruby-beautify.dotfile
139
142
  - spec/spec_helper.rb
140
143
  - spec/usage_scenarios/README.md
@@ -152,4 +155,5 @@ test_files:
152
155
  - spec/usage_scenarios/or_equals_pretty.rb
153
156
  - spec/usage_scenarios/pre_indented.rb
154
157
  - spec/usage_scenarios/pre_indented_pretty.rb
158
+ - spec/usage_scenarios/pre_indented_pretty_space.rb
155
159
  - spec/usage_scenarios_spec.rb